diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index c6c8b362..00000000 --- a/.editorconfig +++ /dev/null @@ -1,9 +0,0 @@ -root = true - -[*] -indent_style = space -indent_size = 2 -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true diff --git a/.env.example b/.env.template similarity index 50% rename from .env.example rename to .env.template index 70e6c2d1..492f4ddb 100644 --- a/.env.example +++ b/.env.template @@ -4,3 +4,10 @@ NEXT_PUBLIC_E2EE_WASM_URL=/wasm.wasm NEXT_PUBLIC_LIGHT_ADJUSTMENT_ASSETS_PATH=https://cdn.jsdelivr.net/npm/@shiguredo/light-adjustment@latest/dist NEXT_PUBLIC_VIRTUAL_BACKGROUND_ASSETS_PATH=https://cdn.jsdelivr.net/npm/@shiguredo/virtual-background@latest/dist NEXT_PUBLIC_NOISE_SUPPRESSION_ASSETS_PATH=https://cdn.jsdelivr.net/npm/@shiguredo/noise-suppression@latest/dist + +# テストに利用する Sora の Signaling URL を指定してください +E2E_TEST_SORA_SIGNALING_URL=ws://127.0.0.1:5000/signaling +# テストに利用する Sora の ChannelID のプレフィックスを指定してください +E2E_TEST_SORA_CHANNEL_ID_PREFIX=sora-js-sdk-e2e-test_ +# テストに利用するアクセストークンを指定してください、不要であれば何の値でも問題ありません +E2E_TEST_ACCESS_TOKEN=access_token \ No newline at end of file diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..91560a10 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,15 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file + +version: 2 +updates: + - package-ecosystem: "npm" + directory: "/" + schedule: + interval: "weekly" + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" diff --git a/.github/renovate.json b/.github/renovate.json deleted file mode 100644 index c8184d4b..00000000 --- a/.github/renovate.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "$schema": "https://docs.renovatebot.com/renovate-schema.json", - "extends": [ - "config:base", - ":timezone(Asia/Tokyo)", - ":combinePatchMinorReleases", - ":prHourlyLimitNone", - ":prConcurrentLimit10", - "group:recommended", - "group:allNonMajor", - "schedule:weekly" - ], - "dependencyDashboard": false, - "packageRules": [ - { - "matchUpdateTypes": [ - "minor", - "patch", - "pin", - "digest" - ], - "platformAutomerge": true, - "automerge": true - }, - { - "matchUpdateTypes": [ - "minor", - "patch", - "pin", - "digest" - ], - "matchPackagePatterns": [ - "next" - ], - "groupName": "next", - "platformAutomerge": true, - "automerge": true - } - ] -} \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a8f4608b..58942784 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,16 +15,14 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - node-version: [18, 20] + node-version: [18, 20, 22] steps: - uses: actions/checkout@v4 - name: Node.js ${{ matrix.node-version }} uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} - - uses: pnpm/action-setup@v2 - with: - version: 8 + - uses: pnpm/action-setup@v4 - run: pnpm install - run: pnpm biome --version - run: pnpm run lint diff --git a/.github/workflows/dependency-review.yml b/.github/workflows/dependency-review.yml index 4e751977..0d4a0136 100644 --- a/.github/workflows/dependency-review.yml +++ b/.github/workflows/dependency-review.yml @@ -17,4 +17,4 @@ jobs: - name: 'Checkout Repository' uses: actions/checkout@v4 - name: 'Dependency Review' - uses: actions/dependency-review-action@v3 + uses: actions/dependency-review-action@v4 diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml new file mode 100644 index 00000000..00cd1cba --- /dev/null +++ b/.github/workflows/e2e-test.yml @@ -0,0 +1,55 @@ +name: e2e-test + +on: + push: + branches: + - develop + - "feature/*" + paths-ignore: + - "**.md" + - "LICENSE" + - "releases/*" + +jobs: + e2e-test: + timeout-minutes: 20 + runs-on: ubuntu-latest + strategy: + matrix: + # node: ["20", "22"] + node: ["22"] + # browser: ["chromium", "firefox", "webkit"] + browser: ["chromium"] + env: + E2E_TEST_SORA_SIGNALING_URL: ${{ secrets.TEST_SIGNALING_URL }} + E2E_TEST_SORA_CHANNEL_ID_PREFIX: ${{ secrets.TEST_CHANNEL_ID_PREFIX }} + E2E_TEST_ACCESS_TOKEN: ${{ secrets.TEST_SECRET_KEY }} + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node }} + - uses: pnpm/action-setup@v4 + - run: pnpm --version + - run: pnpm install + - run: pnpm run build + - run: pnpm exec playwright install ${{ matrix.browser }} --with-deps + - run: pnpm exec playwright test --project=${{ matrix.browser }} + env: + VITE_SORA_CHANNEL_ID_SUFFIX: _${{ matrix.node }} + - name: Slack Notification + if: success() + uses: rtCamp/action-slack-notify@v2 + env: + SLACK_CHANNEL: sora-devtools + SLACK_COLOR: good + SLACK_TITLE: Success test + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} + - name: Slack Notification + if: failure() + uses: rtCamp/action-slack-notify@v2 + env: + SLACK_CHANNEL: sora-devtools + SLACK_COLOR: danger + SLACK_TITLE: Failure test + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} diff --git a/.gitignore b/.gitignore index 3c36555d..f47220d6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,5 @@ .next node_modules/ -.env.local -.env wasm.wasm next-env.d.ts *.tsbuildinfo @@ -10,3 +8,14 @@ next-env.d.ts # next dev は distDir に dev を利用する dev/ + +# .env +.env* +!.env.template +!.env.production + +# playwright +/test-results/ +/playwright-report/ +/blob-report/ +/playwright/.cache/ diff --git a/.husky/pre-commit b/.husky/pre-commit deleted file mode 100755 index 3dd1ddf9..00000000 --- a/.husky/pre-commit +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -. "$(dirname "$0")/_/husky.sh" - -pnpm run lint diff --git a/.markdownlint.yaml b/.markdownlint.yaml new file mode 100644 index 00000000..dc7b2134 --- /dev/null +++ b/.markdownlint.yaml @@ -0,0 +1,5 @@ +# line-length +MD013: false + +# no-emphasis-as-heading +MD036: false diff --git a/.pnpmfile.cjs b/.pnpmfile.cjs new file mode 100644 index 00000000..37782f2e --- /dev/null +++ b/.pnpmfile.cjs @@ -0,0 +1,14 @@ +module.exports = { + packageExtensions: { + 'sora-js-sdk': { + peerDependencyMeta: { + 'sora-js-sdk': { + optional: true, + }, + }, + dependencies: { + 'sora-js-sdk': ({ version }) => (version.includes('canary') ? 'canary' : 'latest'), + }, + }, + }, +} diff --git a/CHANGES.md b/CHANGES.md index 93530e02..d6405ea5 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -11,6 +11,64 @@ ## develop +## 2024.1.0 + +**2024-06-07** + +- [UPDATE] sora-js-sdk のバージョンを 2024.1.0 に上げる + - @voluntas +- [CHANGE] ヘッダーの接続先 URL の表示の初期値を変更する + - `未接続` を `Signaling URL` `TURN URL` に変更する + - @tnamao +- [ADD] ヘッダーに接続中の TURN URL を表示する + - `local-candidate` の RTCStats に `url` が含まれる場合に表示する + - `local-candidate` が複数存在する場合は、最初に取得できる `url` を表示する + - `url` が取得できない場合は `不明` と表示する + - @tnamao +- [CHANGE] `.env.example` を `.env.template` に揃える + - @voluntas +- [CHANGE] `resolution` `displayResolution` `frameRate` を任意の値を入力できるようにする + - 元々のプルダウンで指定できた値は Dropdown ボタンのメニューから選択可能になります + - `resolution` と `displayResolution` はこの修正前後で保持するパラメータの互換性が無くなり、破壊的変更になります + - 解像度が `{width}x{height}` ではない形式や数字を期待する箇所に数字以外が入った場合は、`未指定` と同じ扱いになります + - frameRate に数値以外が設定された場合は、`未指定` と同じ扱いになります + - @tnamao +- [ADD] `resolution` と `displayResolution` のプルダウンに `540p (960x540)` を追加する + - @tnamao +- [CHANGE] index ページのリンクに指定していた `multistream` パラメータを全て削除する + - multistream はデフォルト有効になり、明示的な指定は不要となったため + - @tnamao +- [ADD] 映像のコーデックなどの情報を映像にオーバーレイ表示する `Show media stats` のトグルを追加する + - Firefox での制限 + - 複数の RemoteVideo を受信しているときに RTCPeerConnection の getStats から取得できるコーデック情報がおかしくなってしまうため、正しい動画のコーデック情報を表示できません + - Firefox では RemoteVideo の MediaStreamTrack から解像度や FPS の取得できないため、項目の値の表示は `undefined` になります + - @tnamao +- [ADD] 受信している接続のクライアント ID の表示に対応する + - `notify` で受け取ったクライアント ID を表示に使用するため、state の `soraContents.remoteMediaStream` を `soraContents.remoteClient` に変更し、MediaStream の他に `connectionId` と `client_id` を保持できる型に変更する + - この変更に伴ってリモートの `MediaStream` を使用した関数、変数の名前を `Client` に変更する + - @tnamao +- [CHANGE] `Session ID` と自身の `Connection ID` `Client ID` の表示を `type: notify` の `connection.created` を受け取ったタイミングでの表示に変更する + - この変更に伴い、Sora Devtools の Sora 接続状態の確認は state の `soraContents.connectionStatus` の値の確認も追加する + - @tnamao +- [CHANGE] オーディオコーデック `LYRA` の設定を削除する + - 関連するコードと `service-worker.js` の削除 + - next.config.js から不要な設定の削除 + - @tnamao +- [CHANGE] `multistream` の初期値を `未指定` に変更する + - querystring にパラメータが存在しない場合に `true` になるのを防ぐため + - @tnamao +- [CHANGE] `getDisplayMedia` 使用時の MediaConstraints に audio も含めるようにする + - gDM に渡す MediaConstraint の `audio` パラメータは audio のトグルの状態や `Media options` の設定と連動している + - @tnamao +- [CHANGE] role が `sendonly` の時に `Audio Output` のフォームを非表示にする + - @tnamao +- [ADD] LocalVideo でサイマルキャストの rid を変更するボタンにラベルとツールチップを追加する + - @tnamao +- [ADD] Playwright を利用した E2E テストを追加する + - @voluntas + +## 2023.2.0 + - [FIX] `audioStreamingLanguageCode` のトグルを有効に設定した時に `Advanced signaling options` が強調されない問題を修正する - @tnamao - [ADD] `h265_params` のフォームを追加する @@ -227,7 +285,7 @@ ## 2022.3.0 - [UPDATE] media-processors/virtual-background を 2022.6.1 に更新する - - https://github.com/shiguredo/media-processors/releases/tag/virtual-background-2022.6.1 + - - @sile - [UPDATE] メディアオプションに facingMode を追加する - @yuitowest @@ -275,7 +333,7 @@ ## 2021.2.5 - [FIX] sora-js-sdk のバージョンを 2021.2.3 に更新する - - https://github.com/shiguredo/sora-js-sdk/releases/tag/2021.2.3 + - - @yuitowest ## 2021.2.4 @@ -286,13 +344,13 @@ ## 2021.2.3 - [FIX] sora-js-sdk のバージョンを 2021.2.2 に更新する - - https://github.com/shiguredo/sora-js-sdk/releases/tag/2021.2.2 + - - @yuitowest ## 2021.2.2 - [FIX] sora-js-sdk のバージョンを 2021.2.1 に更新する - - https://github.com/shiguredo/sora-js-sdk/releases/tag/2021.2.1 + - - @yuitowest ## 2021.2.1 @@ -341,26 +399,26 @@ ## 2021.1.6 - [FIX] sora-js-sdk のバージョンを 2021.1.6 に更新する - - https://github.com/shiguredo/sora-js-sdk/releases/tag/2021.1.6 + - - @yuitowest ## 2021.1.5 - [FIX] sora-js-sdk のバージョンを 2021.1.5 に更新する - - https://github.com/shiguredo/sora-js-sdk/releases/tag/2021.1.5 + - - @yuitowest ## 2021.1.4 - [FIX] sora-js-sdk のバージョンを 2021.1.4 に更新する - - https://github.com/shiguredo/sora-js-sdk/releases/tag/2021.1.4 + - - @yuitowest ## 2021.1.3 - [FIX] sora-js-sdk のバージョンを 2021.1.3 に更新する - - https://github.com/shiguredo/sora-js-sdk/releases/tag/2021.1.2 - - https://github.com/shiguredo/sora-js-sdk/releases/tag/2021.1.3 + - + - - @yuitowest ## 2021.1.2 @@ -371,7 +429,7 @@ ## 2021.1.1 - [FIX] sora-js-sdk のバージョンを 2021.1.1 に更新する - - https://github.com/shiguredo/sora-js-sdk/releases/tag/2021.1.1 + - - @yuitowest ## 2021.1.0 diff --git a/DEV.md b/DEV.md index b078145d..f06a5ec3 100644 --- a/DEV.md +++ b/DEV.md @@ -4,20 +4,18 @@ ## corepack -``` -$ brew uninstall pnpm npm yarn -$ brew install corepack -$ corepack enable pnpm npm yarn -$ corepack prepare pnpm@latest-8 --activate +```bash +brew uninstall pnpm npm yarn +brew install corepack +corepack enable pnpm +corepack prepare pnpm@latest-8 --activate ``` ## 開発環境 - nodejs - - 18.17.1 以降 - package.json でバージョンを確認すること - pnpm - - 8.7.0 以降 - package.json でバージョンを確認すること - pnpm install - これで事前に利用するライブラリをインストールする @@ -33,9 +31,9 @@ $ corepack prepare pnpm@latest-8 --activate - `cp .env.example .env` を実行 - 内容の変更は不要です -## 開発 +## 開発サーバー -- `pnpm run dev` でローカルサーバを起動する +- `pnpm run dev` でローカルサーバーを起動する ## パッケージ更新 diff --git a/DOCUMENT.md b/DOCUMENT.md index 9bcbc73f..98287afd 100644 --- a/DOCUMENT.md +++ b/DOCUMENT.md @@ -1,237 +1,232 @@ # ドキュメント ## channelId + 接続するチャネルの ID を指定します。 1-255 文字までの文字列を指定できます。 - ## role -クライアントの役割を指定します。 +クライアントの役割を指定します。 ## multistream -マルチストリームを使用するかどうかを指定します。 +マルチストリームを使用するかどうかを指定します。 ## simulcast -サイマルキャストを使用するかどうかを指定します。 +サイマルキャストを使用するかどうかを指定します。 ## simulcastRid + サイマルキャストで配信されている映像を受信する際のエンコードの初期値を指定します。 r0: 解像度(一辺)が1/4になるようにエンコード r1: 解像度(一辺)が1/2になるようにエンコード r2: 通常の解像度のままエンコード - ## spotlight -スポットライトを使用するかどうかを指定します。 +スポットライトを使用するかどうかを指定します。 ## spotlightNumber + スポットライトでフォーカスする配信数の最大値を指定します。 1-8 までの数字を指定できます。 - ## spotlightFocusRid + スポットライトででフォーカスした場合の映像を受信する際のエンコードの初期値を指定します。 r0: 解像度(一辺)が1/4になるようにエンコード r1: 解像度(一辺)が1/2になるようにエンコード r2: 通常の解像度のままエンコード - ## spotlightUnfocusRid + スポットライトででフォーカスが外れた場合の映像を受信する際のエンコードの初期値を指定します。 r0: 解像度(一辺)が1/4になるようにエンコード r1: 解像度(一辺)が1/2になるようにエンコード r2: 通常の解像度のままエンコード - ## audio -音声配信をするかどうかを指定します。 +音声配信をするかどうかを指定します。 ## audioCodecType -音声のコーデックタイプを指定します。 +音声のコーデックタイプを指定します。 ## audioBitRate -音声のビットレートを指定します。 +音声のビットレートを指定します。 ## video -映像配信をするかどうかを指定します。 +映像配信をするかどうかを指定します。 ## videoCodecType -映像のコーデックタイプを指定します。 +映像のコーデックタイプを指定します。 ## videoBitRate -映像のビットレートを指定します。 +映像のビットレートを指定します。 ## e2ee -E2EE(End-to-End Encryption) を使用するかどうかを指定します。 +E2EE(End-to-End Encryption) を使用するかどうかを指定します。 ## reconnect + 切断時に再接続するかどうかを指定します。 一度接続に成功したあとに意図しない切断があった場合に再接続を試みる仕組みです。 - ## clientId -接続時に任意のクライアント ID を指定できます。 +接続時に任意のクライアント ID を指定できます。 ## metadata -認証するための判断材料としてのメタデータを指定します。 +認証するための判断材料としてのメタデータを指定します。 ## bundleId -同一端末から複数接続する場合に、それぞれの接続で同一の bundle_id を指定すると、指定した接続からの音声や映像やメッセージングを受信しなくなります。 +同一端末から複数接続する場合に、それぞれの接続で同一の bundle_id を指定すると、指定した接続からの音声や映像やメッセージングを受信しなくなります。 ## signalingNotifyMetadata -クライアントが参加や離脱したときに送られるシグナリング通知に含まれるメタデータを指定します。 +クライアントが参加や離脱したときに送られるシグナリング通知に含まれるメタデータを指定します。 ## signalingUrlCandidates -シグナリングをするURLを複数指定します。 +シグナリングをするURLを複数指定します。 ## forwardingFilter -デフォルトの転送フィルターを指定します。 +デフォルトの転送フィルターを指定します。 ## dataChannels -メッセージング用の DataChannel を指定します。 +メッセージング用の DataChannel を指定します。 ## dataChannelSignaling -シグナリングを DataChannel 経由に切り替えるかどうかを指定します。 +シグナリングを DataChannel 経由に切り替えるかどうかを指定します。 ## ignoreDisconnectWebSocket -シグナリングを DataChannel 経由に切り替えた際に、 WebSocket が閉じても、接続が切断しないようにするかどうかを指定します。 +シグナリングを DataChannel 経由に切り替えた際に、 WebSocket が閉じても、接続が切断しないようにするかどうかを指定します。 ## audioStreamingLanguageCode -音声解析用の言語コードを指定します。 - - -## audioLyraParamsBitrate -音声に Lyra コーデックを使った場合のビットレートを指定します。 +音声解析用の言語コードを指定します。 ## videoVP9Params -映像のコーデックタイプに VP9 を指定した場合の設定を指定します。 +映像のコーデックタイプに VP9 を指定した場合の設定を指定します。 ## videoH264Params -映像のコーデックタイプに H264 を指定した場合の設定を指定します。 +映像のコーデックタイプに H264 を指定した場合の設定を指定します。 ## videoAV1Params -映像のコーデックタイプに AV1 を指定した場合の設定を指定します。 +映像のコーデックタイプに AV1 を指定した場合の設定を指定します。 ## mediaType + メディアタイプを指定します。 getUserMedia: デバイスに接続されているカメラ/マイクをメディアとして使用します。 getDisplayMedia: ディスプレイまたはその一部(ウィンドウ等)をメディアとして使用します。 fakeMedia: 生成した映像と音声をメディアとして使用します - ## fakeVolume -mediaType に fakeMedia を選択した際の音量を指定します。 +mediaType に fakeMedia を選択した際の音量を指定します。 ## audioContentHint -MediaStreamTrack audio の contentHint を指定します。 +MediaStreamTrack audio の contentHint を指定します。 ## autoGainControl -MediaTrackConstraints の autoGainControl を指定します。 +MediaTrackConstraints の autoGainControl を指定します。 ## noiseSuppression -MediaTrackConstraints の noiseSuppression を指定します。 +MediaTrackConstraints の noiseSuppression を指定します。 ## echoCancellation -MediaTrackConstraints の echoCancellation を指定します。 +MediaTrackConstraints の echoCancellation を指定します。 ## echoCancellationType -MediaTrackConstraints の echoCancellationType を指定します。 +MediaTrackConstraints の echoCancellationType を指定します。 ## mediaProcessorsNoiseSuppression -shiguredo Media Processors のノイズ抑制を使用するかどうか指定します。 +shiguredo Media Processors のノイズ抑制を使用するかどうか指定します。 ## videoContentHint -MediaStreamTrack video の contentHint を指定します。 +MediaStreamTrack video の contentHint を指定します。 ## resolution -解像度を指定します。 +解像度を指定します。 ## frameRate -MediaTrackConstraints の frameRate を指定します。 +MediaTrackConstraints の frameRate を指定します。 ## aspectRatio -MediaTrackConstraints の aspectRatio を指定します。 +MediaTrackConstraints の aspectRatio を指定します。 ## resizeMode -MediaTrackConstraints の resizeMode を指定します。 +MediaTrackConstraints の resizeMode を指定します。 ## blurRadius -shiguredo Media Processors の背景ぼかしを使用するかどうか指定します。 +shiguredo Media Processors の背景ぼかしを使用するかどうか指定します。 ## lightAdjustment -shiguredo Media Processors のライト調整を使用するかどうかを指定します。 +shiguredo Media Processors のライト調整を使用するかどうかを指定します。 ## facingMode -モバイルカメラのフロント/バックを切り替えます。 +モバイルカメラのフロント/バックを切り替えます。 ## audioInput -音声入力を指定します。 +音声入力を指定します。 ## videoInput -映像入力を指定します。 +映像入力を指定します。 ## audioOutput -音声出力を指定します。 +音声出力を指定します。 ## displayResolution -画面に表示する際の解像度を指定します。 +画面に表示する際の解像度を指定します。 ## micDevice -Audio MediaStreamTrack を生成するかどうかを切り替えます。 +Audio MediaStreamTrack を生成するかどうかを切り替えます。 ## cameraDevice -Video MediaStreamTrack を生成するかどうかを切り替えます。 +Video MediaStreamTrack を生成するかどうかを切り替えます。 ## audioTrack -Audio MediaStreamTrack の enabled 属性を切り替えます。 +Audio MediaStreamTrack の enabled 属性を切り替えます。 ## videoTrack -video MediaStreamTrack の enabled 属性を切り替えます。 - +video MediaStreamTrack の enabled 属性を切り替えます。 diff --git a/README.md b/README.md index 2b3bff5e..fd2e5b25 100644 --- a/README.md +++ b/README.md @@ -7,11 +7,11 @@ We will not respond to PRs or issues that have not been discussed on Discord. Also, Discord is only available in Japanese. -Please read https://github.com/shiguredo/oss/blob/master/README.en.md before use. +Please read before use. ## 時雨堂のオープンソースソフトウェアについて -利用前に https://github.com/shiguredo/oss をお読みください。 +利用前に をお読みください。 ## 概要 @@ -25,10 +25,10 @@ Sora の配信、視聴機能が一通り確認できるようになっていま **このサイトだけでは WebRTC SFU を試すことはできません。WebRTC SFU Sora を別途用意してください** 開発版 (develop ブランチ) がデプロイされています。 -https://sora-devtools.shiguredo.app + 正式版 (master ブランチ) がデプロイされています。 -https://master.sora-devtools.pages.dev + ## スクリーンショット @@ -36,28 +36,22 @@ https://master.sora-devtools.pages.dev ## 利用技術 -- Sora JavaScript SDK - - [WebRTC SFU Sora JavaScript SDK](https://github.com/shiguredo/sora-js-sdk) -- Next.js - - [Next\.js by Vercel \- The React Framework](https://nextjs.org/) -- TypeScript - - [TypeScript: Typed JavaScript at Any Scale\.](https://www.typescriptlang.org/) -- React - - [React – A JavaScript library for building user interfaces](https://reactjs.org/) -- Redux - - [Redux \- A predictable state container for JavaScript apps\. \| Redux](https://redux.js.org/) -- Redux Toolkit - - [Redux Toolkit \| Redux Toolkit](https://redux-toolkit.js.org/) -- Bootstrap - - [Bootstrap · The most popular HTML, CSS, and JS library in the world\.](https://getbootstrap.com/) -- Media Processors +- [WebRTC SFU Sora JavaScript SDK](https://github.com/shiguredo/sora-js-sdk) +- [Next\.js](https://nextjs.org/) +- [TypeScript](https://www.typescriptlang.org/) +- [React](https://reactjs.org/) +- [Redux](https://redux.js.org/) + - [Redux Toolkit](https://redux-toolkit.js.org/) +- [Bootstrap](https://getbootstrap.com/) + - [React Bootstrap \| React Bootstrap](https://react-bootstrap.github.io/) +- [Media Processors](https://github.com/shiguredo/media-processors) - [@shiguredo/virtual\-background \- npm](https://www.npmjs.com/package/@shiguredo/virtual-background) - [@shiguredo/noise\-suppression \- npm](https://www.npmjs.com/package/@shiguredo/noise-suppression) - [@shiguredo/light\-adjustment \- npm](https://www.npmjs.com/package/@shiguredo/light-adjustment) -- pnpm - - [Fast, disk space efficient package manager \| pnpm](https://pnpm.io/) -- Biome - - [Biome](https://biomejs.dev/) +- [Playwright](https://playwright.dev/) +- [Vitest](https://vitest.dev/) +- [pnpm](https://pnpm.io/) +- [Biome](https://biomejs.dev/) ## 特徴 @@ -88,9 +82,7 @@ getUserMedia や getDisplayMedia ではなく Canvas を利用したフェイク 例えば multi_sendrecv で設定を弄らなかった場合は以下のような値になります。 -``` -https://example.com/devtools?multistream=true&role=sendrecv -``` +`https://example.com/devtools?multistream=true&role=sendrecv` ## 用語集 @@ -167,8 +159,8 @@ https://example.com/devtools?multistream=true&role=sendrecv [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0) -``` -Copyright 2017-2023, Shiguredo Inc. +```text +Copyright 2017-2024, Shiguredo Inc. Copyright 2017-2022, Yuki Ito (Original Author) Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/biome.json b/biome.jsonc similarity index 73% rename from biome.json rename to biome.jsonc index 46a45834..fda708f5 100644 --- a/biome.json +++ b/biome.jsonc @@ -1,5 +1,5 @@ { - "$schema": "https://biomejs.dev/schemas/1.4.0/schema.json", + "$schema": "https://biomejs.dev/schemas/1.8.0/schema.json", "organizeImports": { "enabled": true }, @@ -11,13 +11,16 @@ "noExplicitAny": "off" }, "style": { - "useNamingConvention": "off" + "useNamingConvention": "off", + "noDefaultExport": "off", + "useFilenamingConvention": "off" }, "nursery": { - "noUselessLoneBlockStatements": "off" + "noUndeclaredDependencies": "off" }, "complexity": { - "useSimplifiedLogicExpression": "off" + "useSimplifiedLogicExpression": "off", + "noExcessiveCognitiveComplexity": "off" } } }, @@ -45,7 +48,7 @@ "enabled": true, "quoteStyle": "single", "jsxQuoteStyle": "double", - "trailingComma": "all", + "trailingCommas": "all", "semicolons": "asNeeded", "arrowParentheses": "always", "indentStyle": "space", diff --git a/dist/404.html b/dist/404.html index ed400ba2..8f984aea 100644 --- a/dist/404.html +++ b/dist/404.html @@ -1 +1 @@ -404: This page could not be found

404

This page could not be found.

\ No newline at end of file +404: This page could not be found

404

This page could not be found.

\ No newline at end of file diff --git a/dist/_next/static/chunks/209-6329d02a9669cf0f.js b/dist/_next/static/chunks/209-6329d02a9669cf0f.js deleted file mode 100644 index bd8284ef..00000000 --- a/dist/_next/static/chunks/209-6329d02a9669cf0f.js +++ /dev/null @@ -1,5 +0,0 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[209],{8926:function(e,t,n){"use strict";var r=n(959);t.Z=function(e){let t=(0,r.useRef)(e);return(0,r.useEffect)(()=>{t.current=e},[e]),t}},6575:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(959),o=n(8926);function i(e){let t=(0,o.Z)(e);return(0,r.useCallback)(function(...e){return t.current&&t.current(...e)},[t])}},6160:function(e,t,n){"use strict";var r=n(959);let o=void 0!==n.g&&n.g.navigator&&"ReactNative"===n.g.navigator.product,i="undefined"!=typeof document;t.Z=i||o?r.useLayoutEffect:r.useEffect},5466:function(e,t,n){"use strict";var r=n(959);let o=e=>e&&"function"!=typeof e?t=>{e.current=t}:e;t.Z=function(e,t){return(0,r.useMemo)(()=>(function(e,t){let n=o(e),r=o(t);return e=>{n&&n(e),r&&r(e)}})(e,t),[e,t])}},9189:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(959);function o(){let e=(0,r.useRef)(!0),t=(0,r.useRef)(()=>e.current);return(0,r.useEffect)(()=>(e.current=!0,()=>{e.current=!1}),[]),t.current}},2674:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(959);function o(e){let t=(0,r.useRef)(null);return(0,r.useEffect)(()=>{t.current=e}),t.current}},9548:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(959);function o(e){let t=function(e){let t=(0,r.useRef)(e);return t.current=e,t}(e);(0,r.useEffect)(()=>()=>t.current(),[])}},5872:function(e,t,n){"use strict";function r(e){return`data-rr-ui-${e}`}function o(e){return`rrUi${e}`}n.d(t,{$F:function(){return o},PB:function(){return r}})},3774:function(e,t,n){"use strict";n.d(t,{sD:function(){return c}});var r=n(5466),o=n(6575),i=n(6160),a=n(959),s=n(3233),u=n(1527);function l({children:e,in:t,onExited:n,onEntered:s,transition:u}){let[l,c]=(0,a.useState)(!t);t&&l&&c(!1);let f=function({in:e,onTransition:t}){let n=(0,a.useRef)(null),r=(0,a.useRef)(!0),s=(0,o.Z)(t);return(0,i.Z)(()=>{if(!n.current)return;let t=!1;return s({in:e,element:n.current,initial:r.current,isStale:()=>t}),()=>{t=!0}},[e,s]),(0,i.Z)(()=>(r.current=!1,()=>{r.current=!0}),[]),n}({in:!!t,onTransition:e=>{Promise.resolve(u(e)).then(()=>{e.isStale()||(e.in?null==s||s(e.element,e.initial):(c(!0),null==n||n(e.element)))},t=>{throw e.in||c(!0),t})}}),d=(0,r.Z)(f,e.ref);return l&&!t?null:(0,a.cloneElement)(e,{ref:d})}function c(e,t,n){return e?(0,u.jsx)(e,Object.assign({},n)):t?(0,u.jsx)(l,Object.assign({},n,{transition:t})):(0,u.jsx)(s.Z,Object.assign({},n))}},3233:function(e,t,n){"use strict";var r=n(6575),o=n(5466),i=n(959);t.Z=function({children:e,in:t,onExited:n,mountOnEnter:a,unmountOnExit:s}){let u=(0,i.useRef)(null),l=(0,i.useRef)(t),c=(0,r.Z)(n);(0,i.useEffect)(()=>{t?l.current=!0:c(u.current)},[t,c]);let f=(0,o.Z)(u,e.ref),d=(0,i.cloneElement)(e,{ref:f});return t?d:s||!l.current&&a?null:d}},3439:function(e,t,n){"use strict";n.d(t,{h:function(){return o}});let r=n(959).createContext(null),o=(e,t=null)=>null!=e?String(e):t||null;t.Z=r},8821:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(8342),o=n(2762),i=n(959),a=n(348);let s=(e,t)=>o.Z?null==e?(t||(0,r.Z)()).body:("function"==typeof e&&(e=e()),e&&"current"in e&&(e=e.current),e&&("nodeType"in e||e.getBoundingClientRect))?e:null:null;function u(e,t){let n=(0,a.Z)(),[r,o]=(0,i.useState)(()=>s(e,null==n?void 0:n.document));if(!r){let t=s(e);t&&o(t)}return(0,i.useEffect)(()=>{t&&r&&t(r)},[t,r]),(0,i.useEffect)(()=>{let t=s(e);t!==r&&o(t)},[e,r]),r}},348:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(959),o=n(2762);let i=(0,r.createContext)(o.Z?window:void 0);function a(){return(0,r.useContext)(i)}i.Provider},663:function(e,t,n){"use strict";function r(e){return"Escape"===e.code||27===e.keyCode}n.d(t,{k:function(){return r}})},4875:function(e,t){var n;/*! - Copyright (c) 2018 Jed Watson. - Licensed under the MIT License (MIT), see - http://jedwatson.github.io/classnames -*/!function(){"use strict";var r={}.hasOwnProperty;function o(){for(var e=[],t=0;t(0,u.jsx)("button",{ref:o,type:"button",className:s()("btn-close",t&&`btn-close-${t}`,e),"aria-label":n,...r}));c.displayName="CloseButton",c.propTypes=l,t.Z=c},9225:function(e,t,n){"use strict";n.d(t,{Z:function(){return v}});var r=n(4875),o=n.n(r),i=n(968),a=n(959),s=n(7691),u=n(9196),l=function(...e){return e.filter(e=>null!=e).reduce((e,t)=>{if("function"!=typeof t)throw Error("Invalid Argument Type, must only provide functions, undefined, or null.");return null===e?t:function(...n){e.apply(this,n),t.apply(this,n)}},null)},c=n(6057),f=n(77),d=n(1527);let p={height:["marginTop","marginBottom"],width:["marginLeft","marginRight"]};function m(e,t){let n=t[`offset${e[0].toUpperCase()}${e.slice(1)}`],r=p[e];return n+parseInt((0,i.Z)(t,r[0]),10)+parseInt((0,i.Z)(t,r[1]),10)}let h={[s.Wj]:"collapse",[s.Ix]:"collapsing",[s.d0]:"collapsing",[s.cn]:"collapse show"};var v=a.forwardRef(({onEnter:e,onEntering:t,onEntered:n,onExit:r,onExiting:i,className:s,children:p,dimension:v="height",in:g=!1,timeout:y=300,mountOnEnter:E=!1,unmountOnExit:x=!1,appear:b=!1,getDimensionValue:C=m,...O},N)=>{let Z="function"==typeof v?v():v,j=(0,a.useMemo)(()=>l(e=>{e.style[Z]="0"},e),[Z,e]),k=(0,a.useMemo)(()=>l(e=>{let t=`scroll${Z[0].toUpperCase()}${Z.slice(1)}`;e.style[Z]=`${e[t]}px`},t),[Z,t]),w=(0,a.useMemo)(()=>l(e=>{e.style[Z]=null},n),[Z,n]),R=(0,a.useMemo)(()=>l(e=>{e.style[Z]=`${C(Z,e)}px`,(0,c.Z)(e)},r),[r,C,Z]),S=(0,a.useMemo)(()=>l(e=>{e.style[Z]=null},i),[Z,i]);return(0,d.jsx)(f.Z,{ref:N,addEndListener:u.Z,...O,"aria-expanded":O.role?g:null,onEnter:j,onEntering:k,onEntered:w,onExit:R,onExiting:S,childRef:p.ref,in:g,timeout:y,mountOnEnter:E,unmountOnExit:x,appear:b,children:(e,t)=>a.cloneElement(p,{...t,className:o()(s,p.props.className,h[e],"width"===Z&&"collapse-horizontal")})})})},1046:function(e,t,n){"use strict";var r=n(4875),o=n.n(r),i=n(959),a=n(7885),s=n(1527);let u=i.forwardRef(({bsPrefix:e,fluid:t=!1,as:n="div",className:r,...i},u)=>{let l=(0,a.vE)(e,"container"),c="string"==typeof t?`-${t}`:"-fluid";return(0,s.jsx)(n,{ref:u,...i,className:o()(r,t?`${l}${c}`:l)})});u.displayName="Container",t.Z=u},4281:function(e,t,n){"use strict";var r=n(4875),o=n.n(r),i=n(959),a=n(7691),s=n(9196),u=n(6057),l=n(77),c=n(1527);let f={[a.d0]:"show",[a.cn]:"show"},d=i.forwardRef(({className:e,children:t,transitionClasses:n={},onEnter:r,...a},d)=>{let p={in:!1,timeout:300,mountOnEnter:!1,unmountOnExit:!1,appear:!1,...a},m=(0,i.useCallback)((e,t)=>{(0,u.Z)(e),null==r||r(e,t)},[r]);return(0,c.jsx)(l.Z,{ref:d,addEndListener:s.Z,...p,onEnter:m,childRef:t.ref,children:(r,a)=>i.cloneElement(t,{...a,className:o()("fade",e,t.props.className,f[r],n[r])})})});d.displayName="Fade",t.Z=d},6136:function(e,t,n){"use strict";let r,o;n.d(t,{Z:function(){return ep}});var i=n(4875),a=n.n(i),s=n(959),u=n(3439),l=n(3549),c=n(7885),f=n(1527);let d=s.forwardRef(({bsPrefix:e,className:t,as:n,...r},o)=>{e=(0,c.vE)(e,"navbar-brand");let i=n||(r.href?"a":"span");return(0,f.jsx)(i,{...r,ref:o,className:a()(t,e)})});d.displayName="NavbarBrand";var p=n(9225),m=n(3764);let h=s.forwardRef(({children:e,bsPrefix:t,...n},r)=>{t=(0,c.vE)(t,"navbar-collapse");let o=(0,s.useContext)(m.Z);return(0,f.jsx)(p.Z,{in:!!(o&&o.expanded),...n,children:(0,f.jsx)("div",{ref:r,className:t,children:e})})});h.displayName="NavbarCollapse";var v=n(6575);let g=s.forwardRef(({bsPrefix:e,className:t,children:n,label:r="Toggle navigation",as:o="button",onClick:i,...u},l)=>{e=(0,c.vE)(e,"navbar-toggler");let{onToggle:d,expanded:p}=(0,s.useContext)(m.Z)||{},h=(0,v.Z)(e=>{i&&i(e),d&&d()});return"button"===o&&(u.type="button"),(0,f.jsx)(o,{...u,ref:l,onClick:h,"aria-label":r,className:a()(t,e,!p&&"collapsed"),children:n||(0,f.jsx)("span",{className:`${e}-icon`})})});g.displayName="NavbarToggle";var y=n(6160);let E=new WeakMap,x=(e,t)=>{if(!e||!t)return;let n=E.get(t)||new Map;E.set(t,n);let r=n.get(e);return r||((r=t.matchMedia(e)).refCount=0,n.set(r.media,r)),r},b=function(e){let t=Object.keys(e);function n(e,t){return e===t?t:e?`${e} and ${t}`:t}return function(r,o,i){let a;return"object"==typeof r?(a=r,i=o,o=!0):a={[r]:o=o||!0},function(e,t="undefined"==typeof window?void 0:window){let n=x(e,t),[r,o]=(0,s.useState)(()=>!!n&&n.matches);return(0,y.Z)(()=>{let n=x(e,t);if(!n)return o(!1);let r=E.get(t),i=()=>{o(n.matches)};return n.refCount++,n.addListener(i),i(),()=>{n.removeListener(i),n.refCount--,n.refCount<=0&&(null==r||r.delete(n.media)),n=void 0}},[e]),r}((0,s.useMemo)(()=>Object.entries(a).reduce((r,[o,i])=>{if("up"===i||!0===i){let t;r=n(r,("number"==typeof(t=e[o])&&(t=`${t}px`),`(min-width: ${t})`))}if("down"===i||!0===i){let i;r=n(r,(i="number"==typeof(i=e[t[Math.min(t.indexOf(o)+1,t.length-1)]])?`${i-.2}px`:`calc(${i} - 0.2px)`,`(max-width: ${i})`))}return r},""),[JSON.stringify(a)]),i)}}({xs:0,sm:576,md:768,lg:992,xl:1200,xxl:1400});var C=n(8342);function O(e){void 0===e&&(e=(0,C.Z)());try{var t=e.activeElement;if(!t||!t.nodeName)return null;return t}catch(t){return e.body}}var N=n(6712),Z=n(2762),j=n(7937),k=n(422),w=n(9189),R=n(9548),S=n(2674),T=n(968);let $=(0,n(5872).PB)("modal-open");class F{constructor({ownerDocument:e,handleContainerOverflow:t=!0,isRTL:n=!1}={}){this.handleContainerOverflow=t,this.isRTL=n,this.modals=[],this.ownerDocument=e}getScrollbarWidth(){return function(e=document){return Math.abs(e.defaultView.innerWidth-e.documentElement.clientWidth)}(this.ownerDocument)}getElement(){return(this.ownerDocument||document).body}setModalAttributes(e){}removeModalAttributes(e){}setContainerStyle(e){let t={overflow:"hidden"},n=this.isRTL?"paddingLeft":"paddingRight",r=this.getElement();e.style={overflow:r.style.overflow,[n]:r.style[n]},e.scrollBarWidth&&(t[n]=`${parseInt((0,T.Z)(r,n)||"0",10)+e.scrollBarWidth}px`),r.setAttribute($,""),(0,T.Z)(r,t)}reset(){[...this.modals].forEach(e=>this.remove(e))}removeContainerStyle(e){let t=this.getElement();t.removeAttribute($),Object.assign(t.style,e.style)}add(e){let t=this.modals.indexOf(e);return -1!==t||(t=this.modals.length,this.modals.push(e),this.setModalAttributes(e),0!==t||(this.state={scrollBarWidth:this.getScrollbarWidth(),style:{}},this.handleContainerOverflow&&this.setContainerStyle(this.state))),t}remove(e){let t=this.modals.indexOf(e);-1!==t&&(this.modals.splice(t,1),!this.modals.length&&this.handleContainerOverflow&&this.removeContainerStyle(this.state),this.removeModalAttributes(e))}isTopModal(e){return!!this.modals.length&&this.modals[this.modals.length-1]===e}}var L=F,A=n(8821),D=n(348),I=n(3774),P=n(663);let M=["show","role","className","style","children","backdrop","keyboard","onBackdropClick","onEscapeKeyDown","transition","runTransition","backdropTransition","runBackdropTransition","autoFocus","enforceFocus","restoreFocus","restoreFocusOptions","renderDialog","renderBackdrop","manager","container","onShow","onHide","onExit","onExited","onExiting","onEnter","onEntering","onEntered"],_=(0,s.forwardRef)((e,t)=>{let{show:n=!1,role:o="dialog",className:i,style:a,children:u,backdrop:l=!0,keyboard:c=!0,onBackdropClick:d,onEscapeKeyDown:p,transition:m,runTransition:h,backdropTransition:g,runBackdropTransition:y,autoFocus:E=!0,enforceFocus:x=!0,restoreFocus:b=!0,restoreFocusOptions:C,renderDialog:T,renderBackdrop:$=e=>(0,f.jsx)("div",Object.assign({},e)),manager:F,container:_,onShow:B,onHide:U=()=>{},onExit:W,onExited:V,onExiting:H,onEnter:G,onEntering:X,onEntered:K}=e,Y=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r=0||(o[n]=e[n]);return o}(e,M),q=(0,D.Z)(),z=(0,A.Z)(_),J=function(e){let t=(0,D.Z)(),n=e||(r||(r=new L({ownerDocument:null==t?void 0:t.document})),r),o=(0,s.useRef)({dialog:null,backdrop:null});return Object.assign(o.current,{add:()=>n.add(o.current),remove:()=>n.remove(o.current),isTopModal:()=>n.isTopModal(o.current),setDialogRef:(0,s.useCallback)(e=>{o.current.dialog=e},[]),setBackdropRef:(0,s.useCallback)(e=>{o.current.backdrop=e},[])})}(F),Q=(0,w.Z)(),ee=(0,S.Z)(n),[et,en]=(0,s.useState)(!n),er=(0,s.useRef)(null);(0,s.useImperativeHandle)(t,()=>J,[J]),Z.Z&&!ee&&n&&(er.current=O(null==q?void 0:q.document)),n&&et&&en(!1);let eo=(0,v.Z)(()=>{if(J.add(),ec.current=(0,j.Z)(document,"keydown",eu),el.current=(0,j.Z)(document,"focus",()=>setTimeout(ea),!0),B&&B(),E){var e,t;let n=O(null!=(e=null==(t=J.dialog)?void 0:t.ownerDocument)?e:null==q?void 0:q.document);J.dialog&&n&&!(0,N.Z)(J.dialog,n)&&(er.current=n,J.dialog.focus())}}),ei=(0,v.Z)(()=>{if(J.remove(),null==ec.current||ec.current(),null==el.current||el.current(),b){var e;null==(e=er.current)||null==e.focus||e.focus(C),er.current=null}});(0,s.useEffect)(()=>{n&&z&&eo()},[n,z,eo]),(0,s.useEffect)(()=>{et&&ei()},[et,ei]),(0,R.Z)(()=>{ei()});let ea=(0,v.Z)(()=>{if(!x||!Q()||!J.isTopModal())return;let e=O(null==q?void 0:q.document);J.dialog&&e&&!(0,N.Z)(J.dialog,e)&&J.dialog.focus()}),es=(0,v.Z)(e=>{e.target===e.currentTarget&&(null==d||d(e),!0===l&&U())}),eu=(0,v.Z)(e=>{c&&(0,P.k)(e)&&J.isTopModal()&&(null==p||p(e),e.defaultPrevented||U())}),el=(0,s.useRef)(),ec=(0,s.useRef)();if(!z)return null;let ef=Object.assign({role:o,ref:J.setDialogRef,"aria-modal":"dialog"===o||void 0},Y,{style:a,className:i,tabIndex:-1}),ed=T?T(ef):(0,f.jsx)("div",Object.assign({},ef,{children:s.cloneElement(u,{role:"document"})}));ed=(0,I.sD)(m,h,{unmountOnExit:!0,mountOnEnter:!0,appear:!0,in:!!n,onExit:W,onExiting:H,onExited:(...e)=>{en(!0),null==V||V(...e)},onEnter:G,onEntering:X,onEntered:K,children:ed});let ep=null;return l&&(ep=$({ref:J.setBackdropRef,onClick:es}),ep=(0,I.sD)(g,y,{in:!!n,appear:!0,mountOnEnter:!0,unmountOnExit:!0,children:ep})),(0,f.jsx)(f.Fragment,{children:k.createPortal((0,f.jsxs)(f.Fragment,{children:[ep,ed]}),z)})});_.displayName="Modal";var B=Object.assign(_,{Manager:L}),U=n(4281);let W=s.forwardRef(({className:e,bsPrefix:t,as:n="div",...r},o)=>(t=(0,c.vE)(t,"offcanvas-body"),(0,f.jsx)(n,{ref:o,className:a()(e,t),...r})));W.displayName="OffcanvasBody";var V=n(7691),H=n(9196),G=n(77);let X={[V.d0]:"show",[V.cn]:"show"},K=s.forwardRef(({bsPrefix:e,className:t,children:n,in:r=!1,mountOnEnter:o=!1,unmountOnExit:i=!1,appear:u=!1,...l},d)=>(e=(0,c.vE)(e,"offcanvas"),(0,f.jsx)(G.Z,{ref:d,addEndListener:H.Z,in:r,mountOnEnter:o,unmountOnExit:i,appear:u,...l,childRef:n.ref,children:(r,o)=>s.cloneElement(n,{...o,className:a()(t,n.props.className,(r===V.d0||r===V.Ix)&&`${e}-toggling`,X[r])})})));K.displayName="OffcanvasToggling";let Y=s.createContext({onHide(){}});var q=n(7657);let z=s.forwardRef(({closeLabel:e="Close",closeVariant:t,closeButton:n=!1,onHide:r,children:o,...i},a)=>{let u=(0,s.useContext)(Y),l=(0,v.Z)(()=>{null==u||u.onHide(),null==r||r()});return(0,f.jsxs)("div",{ref:a,...i,children:[o,n&&(0,f.jsx)(q.Z,{"aria-label":e,variant:t,onClick:l})]})}),J=s.forwardRef(({bsPrefix:e,className:t,closeLabel:n="Close",closeButton:r=!1,...o},i)=>(e=(0,c.vE)(e,"offcanvas-header"),(0,f.jsx)(z,{ref:i,...o,className:a()(t,e),closeLabel:n,closeButton:r})));J.displayName="OffcanvasHeader";let Q=s.forwardRef((e,t)=>(0,f.jsx)("div",{...e,ref:t,className:a()(e.className,"h5")})),ee=s.forwardRef(({className:e,bsPrefix:t,as:n=Q,...r},o)=>(t=(0,c.vE)(t,"offcanvas-title"),(0,f.jsx)(n,{ref:o,className:a()(e,t),...r})));ee.displayName="OffcanvasTitle";var et=n(9523),en=n(3465);function er(e,t){return e.replace(RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}let eo={FIXED_CONTENT:".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",STICKY_CONTENT:".sticky-top",NAVBAR_TOGGLER:".navbar-toggler"};class ei extends L{adjustAndStore(e,t,n){let r=t.style[e];t.dataset[e]=r,(0,T.Z)(t,{[e]:`${parseFloat((0,T.Z)(t,e))+n}px`})}restore(e,t){let n=t.dataset[e];void 0!==n&&(delete t.dataset[e],(0,T.Z)(t,{[e]:n}))}setContainerStyle(e){var t;super.setContainerStyle(e);let n=this.getElement();if(t="modal-open",n.classList?n.classList.add(t):(0,et.Z)(n,t)||("string"==typeof n.className?n.className=n.className+" "+t:n.setAttribute("class",(n.className&&n.className.baseVal||"")+" "+t)),!e.scrollBarWidth)return;let r=this.isRTL?"paddingLeft":"paddingRight",o=this.isRTL?"marginLeft":"marginRight";(0,en.Z)(n,eo.FIXED_CONTENT).forEach(t=>this.adjustAndStore(r,t,e.scrollBarWidth)),(0,en.Z)(n,eo.STICKY_CONTENT).forEach(t=>this.adjustAndStore(o,t,-e.scrollBarWidth)),(0,en.Z)(n,eo.NAVBAR_TOGGLER).forEach(t=>this.adjustAndStore(o,t,e.scrollBarWidth))}removeContainerStyle(e){var t;super.removeContainerStyle(e);let n=this.getElement();t="modal-open",n.classList?n.classList.remove(t):"string"==typeof n.className?n.className=er(n.className,t):n.setAttribute("class",er(n.className&&n.className.baseVal||"",t));let r=this.isRTL?"paddingLeft":"paddingRight",o=this.isRTL?"marginLeft":"marginRight";(0,en.Z)(n,eo.FIXED_CONTENT).forEach(e=>this.restore(r,e)),(0,en.Z)(n,eo.STICKY_CONTENT).forEach(e=>this.restore(o,e)),(0,en.Z)(n,eo.NAVBAR_TOGGLER).forEach(e=>this.restore(o,e))}}function ea(e){return(0,f.jsx)(K,{...e})}function es(e){return(0,f.jsx)(U.Z,{...e})}let eu=s.forwardRef(({bsPrefix:e,className:t,children:n,"aria-labelledby":r,placement:i="start",responsive:u,show:l=!1,backdrop:d=!0,keyboard:p=!0,scroll:h=!1,onEscapeKeyDown:g,onShow:y,onHide:E,container:x,autoFocus:C=!0,enforceFocus:O=!0,restoreFocus:N=!0,restoreFocusOptions:Z,onEntered:j,onExit:k,onExiting:w,onEnter:R,onEntering:S,onExited:T,backdropClassName:$,manager:F,renderStaticNode:L=!1,...A},D)=>{let I=(0,s.useRef)();e=(0,c.vE)(e,"offcanvas");let{onToggle:P}=(0,s.useContext)(m.Z)||{},[M,_]=(0,s.useState)(!1),U=b(u||"xs","up");(0,s.useEffect)(()=>{_(u?l&&!U:l)},[l,u,U]);let W=(0,v.Z)(()=>{null==P||P(),null==E||E()}),V=(0,s.useMemo)(()=>({onHide:W}),[W]),H=(0,s.useCallback)(t=>(0,f.jsx)("div",{...t,className:a()(`${e}-backdrop`,$)}),[$,e]),G=o=>(0,f.jsx)("div",{...o,...A,className:a()(t,u?`${e}-${u}`:e,`${e}-${i}`),"aria-labelledby":r,children:n});return(0,f.jsxs)(f.Fragment,{children:[!M&&(u||L)&&G({}),(0,f.jsx)(Y.Provider,{value:V,children:(0,f.jsx)(B,{show:M,ref:D,backdrop:d,container:x,keyboard:p,autoFocus:C,enforceFocus:O&&!h,restoreFocus:N,restoreFocusOptions:Z,onEscapeKeyDown:g,onShow:y,onHide:W,onEnter:(e,...t)=>{e&&(e.style.visibility="visible"),null==R||R(e,...t)},onEntering:S,onEntered:j,onExit:k,onExiting:w,onExited:(e,...t)=>{e&&(e.style.visibility=""),null==T||T(...t)},manager:F||(h?(I.current||(I.current=new ei({handleContainerOverflow:!1})),I.current):(o||(o=new ei(void 0)),o)),transition:ea,backdropTransition:es,renderBackdrop:H,renderDialog:G})})]})});eu.displayName="Offcanvas";var el=Object.assign(eu,{Body:W,Header:J,Title:ee});let ec=s.forwardRef((e,t)=>{let n=(0,s.useContext)(m.Z);return(0,f.jsx)(el,{ref:t,show:!!(null!=n&&n.expanded),...e,renderStaticNode:!0})});ec.displayName="NavbarOffcanvas";let ef=s.forwardRef(({className:e,bsPrefix:t,as:n="span",...r},o)=>(t=(0,c.vE)(t,"navbar-text"),(0,f.jsx)(n,{ref:o,className:a()(e,t),...r})));ef.displayName="NavbarText";let ed=s.forwardRef((e,t)=>{let{bsPrefix:n,expand:r=!0,variant:o="light",bg:i,fixed:d,sticky:p,className:h,as:v="nav",expanded:g,onToggle:y,onSelect:E,collapseOnSelect:x=!1,...b}=(0,l.Ch)(e,{expanded:"onToggle"}),C=(0,c.vE)(n,"navbar"),O=(0,s.useCallback)((...e)=>{null==E||E(...e),x&&g&&(null==y||y(!1))},[E,x,g,y]);void 0===b.role&&"nav"!==v&&(b.role="navigation");let N=`${C}-expand`;"string"==typeof r&&(N=`${N}-${r}`);let Z=(0,s.useMemo)(()=>({onToggle:()=>null==y?void 0:y(!g),bsPrefix:C,expanded:!!g,expand:r}),[C,g,r,y]);return(0,f.jsx)(m.Z.Provider,{value:Z,children:(0,f.jsx)(u.Z.Provider,{value:O,children:(0,f.jsx)(v,{ref:t,...b,className:a()(h,C,r&&N,o&&`${C}-${o}`,i&&`bg-${i}`,p&&`sticky-${p}`,d&&`fixed-${d}`)})})})});ed.displayName="Navbar";var ep=Object.assign(ed,{Brand:d,Collapse:h,Offcanvas:ec,Text:ef,Toggle:g})},3764:function(e,t,n){"use strict";let r=n(959).createContext(null);r.displayName="NavbarContext",t.Z=r},7885:function(e,t,n){"use strict";n.d(t,{SC:function(){return c},pi:function(){return u},vE:function(){return s},zG:function(){return l}});var r=n(959);n(1527);let o=r.createContext({prefixes:{},breakpoints:["xxl","xl","lg","md","sm","xs"],minBreakpoint:"xs"}),{Consumer:i,Provider:a}=o;function s(e,t){let{prefixes:n}=(0,r.useContext)(o);return e||n[t]||t}function u(){let{breakpoints:e}=(0,r.useContext)(o);return e}function l(){let{minBreakpoint:e}=(0,r.useContext)(o);return e}function c(){let{dir:e}=(0,r.useContext)(o);return"rtl"===e}},77:function(e,t,n){"use strict";var r=n(959),o=n(7691),i=n(5466),a=n(9843),s=n(1527);let u=r.forwardRef(({onEnter:e,onEntering:t,onEntered:n,onExit:u,onExiting:l,onExited:c,addEndListener:f,children:d,childRef:p,...m},h)=>{let v=(0,r.useRef)(null),g=(0,i.Z)(v,p),y=e=>{g((0,a.Z)(e))},E=e=>t=>{e&&v.current&&e(v.current,t)},x=(0,r.useCallback)(E(e),[e]),b=(0,r.useCallback)(E(t),[t]),C=(0,r.useCallback)(E(n),[n]),O=(0,r.useCallback)(E(u),[u]),N=(0,r.useCallback)(E(l),[l]),Z=(0,r.useCallback)(E(c),[c]),j=(0,r.useCallback)(E(f),[f]);return(0,s.jsx)(o.ZP,{ref:h,...m,onEnter:x,onEntered:C,onEntering:b,onExit:O,onExited:Z,onExiting:N,addEndListener:j,nodeRef:v,children:"function"==typeof d?(e,t)=>d(e,{...t,ref:y}):r.cloneElement(d,{ref:y})})});t.Z=u},9843:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(422);function o(e){return e&&"setState"in e?r.findDOMNode(e):null!=e?e:null}},9196:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(968),o=n(7937);function i(e,t){let n=(0,r.Z)(e,t)||"",o=-1===n.indexOf("ms")?1e3:1;return parseFloat(n)*o}function a(e,t){var n,a,s,u,l,c,f,d,p,m,h,v;let g=i(e,"transitionDuration"),y=i(e,"transitionDelay"),E=(n=e,a=n=>{n.target===e&&(E(),t(n))},null==(s=g+y)&&(c=-1===(l=(0,r.Z)(n,"transitionDuration")||"").indexOf("ms")?1e3:1,s=parseFloat(l)*c||0),h=(d=!1,p=setTimeout(function(){d||function(e,t,n,r){if(void 0===n&&(n=!1),void 0===r&&(r=!0),e){var o=document.createEvent("HTMLEvents");o.initEvent(t,n,r),e.dispatchEvent(o)}}(n,"transitionend",!0)},s+5),m=(0,o.Z)(n,"transitionend",function(){d=!0},{once:!0}),function(){clearTimeout(p),m()}),v=(0,o.Z)(n,"transitionend",a),function(){h(),v()})}},6057:function(e,t,n){"use strict";function r(e){e.offsetHeight}n.d(t,{Z:function(){return r}})},7691:function(e,t,n){"use strict";n.d(t,{cn:function(){return d},d0:function(){return f},Wj:function(){return c},Ix:function(){return p},ZP:function(){return v}});var r=n(3804);function o(e,t){return(o=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}var i=n(959),a=n(422),s={disabled:!1},u=i.createContext(null),l="unmounted",c="exited",f="entering",d="entered",p="exiting",m=function(e){function t(t,n){r=e.call(this,t,n)||this;var r,o,i=n&&!n.isMounting?t.enter:t.appear;return r.appearStatus=null,t.in?i?(o=c,r.appearStatus=f):o=d:o=t.unmountOnExit||t.mountOnEnter?l:c,r.state={status:o},r.nextCallback=null,r}t.prototype=Object.create(e.prototype),t.prototype.constructor=t,o(t,e),t.getDerivedStateFromProps=function(e,t){return e.in&&t.status===l?{status:c}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(e){var t=null;if(e!==this.props){var n=this.state.status;this.props.in?n!==f&&n!==d&&(t=f):(n===f||n===d)&&(t=p)}this.updateStatus(!1,t)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var e,t,n,r=this.props.timeout;return e=t=n=r,null!=r&&"number"!=typeof r&&(e=r.exit,t=r.enter,n=void 0!==r.appear?r.appear:t),{exit:e,enter:t,appear:n}},n.updateStatus=function(e,t){if(void 0===e&&(e=!1),null!==t){if(this.cancelNextCallback(),t===f){if(this.props.unmountOnExit||this.props.mountOnEnter){var n=this.props.nodeRef?this.props.nodeRef.current:a.findDOMNode(this);n&&n.scrollTop}this.performEnter(e)}else this.performExit()}else this.props.unmountOnExit&&this.state.status===c&&this.setState({status:l})},n.performEnter=function(e){var t=this,n=this.props.enter,r=this.context?this.context.isMounting:e,o=this.props.nodeRef?[r]:[a.findDOMNode(this),r],i=o[0],u=o[1],l=this.getTimeouts(),c=r?l.appear:l.enter;if(!e&&!n||s.disabled){this.safeSetState({status:d},function(){t.props.onEntered(i)});return}this.props.onEnter(i,u),this.safeSetState({status:f},function(){t.props.onEntering(i,u),t.onTransitionEnd(c,function(){t.safeSetState({status:d},function(){t.props.onEntered(i,u)})})})},n.performExit=function(){var e=this,t=this.props.exit,n=this.getTimeouts(),r=this.props.nodeRef?void 0:a.findDOMNode(this);if(!t||s.disabled){this.safeSetState({status:c},function(){e.props.onExited(r)});return}this.props.onExit(r),this.safeSetState({status:p},function(){e.props.onExiting(r),e.onTransitionEnd(n.exit,function(){e.safeSetState({status:c},function(){e.props.onExited(r)})})})},n.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},n.setNextCallback=function(e){var t=this,n=!0;return this.nextCallback=function(r){n&&(n=!1,t.nextCallback=null,e(r))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},n.onTransitionEnd=function(e,t){this.setNextCallback(t);var n=this.props.nodeRef?this.props.nodeRef.current:a.findDOMNode(this),r=null==e&&!this.props.addEndListener;if(!n||r){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var o=this.props.nodeRef?[this.nextCallback]:[n,this.nextCallback],i=o[0],s=o[1];this.props.addEndListener(i,s)}null!=e&&setTimeout(this.nextCallback,e)},n.render=function(){var e=this.state.status;if(e===l)return null;var t=this.props,n=t.children,o=(t.in,t.mountOnEnter,t.unmountOnExit,t.appear,t.enter,t.exit,t.timeout,t.addEndListener,t.onEnter,t.onEntering,t.onEntered,t.onExit,t.onExiting,t.onExited,t.nodeRef,(0,r.Z)(t,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]));return i.createElement(u.Provider,{value:null},"function"==typeof n?n(e,o):i.cloneElement(i.Children.only(n),o))},t}(i.Component);function h(){}m.contextType=u,m.propTypes={},m.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:h,onEntering:h,onEntered:h,onExit:h,onExiting:h,onExited:h},m.UNMOUNTED=l,m.EXITED=c,m.ENTERING=f,m.ENTERED=d,m.EXITING=p;var v=m},3549:function(e,t,n){"use strict";function r(){return(r=Object.assign?Object.assign.bind():function(e){for(var t=1;t1?t-1:0),o=1;o=0||(o[n]=e[n]);return o}n.d(t,{Z:function(){return r}})},1876:function(e,t,n){"use strict";n.d(t,{Z:function(){return O}});var r={};n.r(r),n.d(r,{exclude:function(){return C},extract:function(){return v},parse:function(){return g},parseUrl:function(){return E},pick:function(){return b},stringify:function(){return y},stringifyUrl:function(){return x}});let o="%[a-f0-9]{2}",i=RegExp("("+o+")|([^%]+?)","gi"),a=RegExp("("+o+")+","gi");function s(e,t){if(!("string"==typeof e&&"string"==typeof t))throw TypeError("Expected the arguments to be of type `string`");if(""===e||""===t)return[];let n=e.indexOf(t);return -1===n?[]:[e.slice(0,n),e.slice(n+t.length)]}let u=e=>null==e,l=e=>encodeURIComponent(e).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),c=Symbol("encodeFragmentIdentifier");function f(e){if("string"!=typeof e||1!==e.length)throw TypeError("arrayFormatSeparator must be single character string")}function d(e,t){return t.encode?t.strict?l(e):encodeURIComponent(e):e}function p(e,t){return t.decode?function(e){if("string"!=typeof e)throw TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return decodeURIComponent(e)}catch{return function(e){let t={"%FE%FF":"��","%FF%FE":"��"},n=a.exec(e);for(;n;){try{t[n[0]]=decodeURIComponent(n[0])}catch{let e=function(e){try{return decodeURIComponent(e)}catch{let t=e.match(i)||[];for(let n=1;n{if(t=/\[(\d*)]$/.exec(e),e=e.replace(/\[\d*]$/,""),!t){r[e]=n;return}void 0===r[e]&&(r[e]={}),r[e][t[1]]=n};case"bracket":return(e,n,r)=>{if(t=/(\[])$/.exec(e),e=e.replace(/\[]$/,""),!t){r[e]=n;return}if(void 0===r[e]){r[e]=[n];return}r[e]=[...r[e],n]};case"colon-list-separator":return(e,n,r)=>{if(t=/(:list)$/.exec(e),e=e.replace(/:list$/,""),!t){r[e]=n;return}if(void 0===r[e]){r[e]=[n];return}r[e]=[...r[e],n]};case"comma":case"separator":return(t,n,r)=>{let o="string"==typeof n&&n.includes(e.arrayFormatSeparator),i="string"==typeof n&&!o&&p(n,e).includes(e.arrayFormatSeparator);n=i?p(n,e):n;let a=o||i?n.split(e.arrayFormatSeparator).map(t=>p(t,e)):null===n?n:p(n,e);r[t]=a};case"bracket-separator":return(t,n,r)=>{let o=/(\[])$/.test(t);if(t=t.replace(/\[]$/,""),!o){r[t]=n?p(n,e):n;return}let i=null===n?[]:n.split(e.arrayFormatSeparator).map(t=>p(t,e));if(void 0===r[t]){r[t]=i;return}r[t]=[...r[t],...i]};default:return(e,t,n)=>{if(void 0===n[e]){n[e]=t;return}n[e]=[...[n[e]].flat(),t]}}}(t),r=Object.create(null);if("string"!=typeof e||!(e=e.trim().replace(/^[?#&]/,"")))return r;for(let o of e.split("&")){if(""===o)continue;let e=t.decode?o.replace(/\+/g," "):o,[i,a]=s(e,"=");void 0===i&&(i=e),a=void 0===a?null:["comma","separator","bracket-separator"].includes(t.arrayFormat)?a:p(a,t),n(p(i,t),a,r)}for(let[e,n]of Object.entries(r))if("object"==typeof n&&null!==n)for(let[e,r]of Object.entries(n))n[e]=h(r,t);else r[e]=h(n,t);return!1===t.sort?r:(!0===t.sort?Object.keys(r).sort():Object.keys(r).sort(t.sort)).reduce((e,t)=>{let n=r[t];return n&&"object"==typeof n&&!Array.isArray(n)?e[t]=function e(t){return Array.isArray(t)?t.sort():"object"==typeof t?e(Object.keys(t)).sort((e,t)=>Number(e)-Number(t)).map(e=>t[e]):t}(n):e[t]=n,e},Object.create(null))}function y(e,t){if(!e)return"";f((t={encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:",",...t}).arrayFormatSeparator);let n=n=>t.skipNull&&u(e[n])||t.skipEmptyString&&""===e[n],r=function(e){switch(e.arrayFormat){case"index":return t=>(n,r)=>{let o=n.length;return void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,[d(t,e),"[",o,"]"].join("")]:[...n,[d(t,e),"[",d(o,e),"]=",d(r,e)].join("")]};case"bracket":return t=>(n,r)=>void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,[d(t,e),"[]"].join("")]:[...n,[d(t,e),"[]=",d(r,e)].join("")];case"colon-list-separator":return t=>(n,r)=>void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,[d(t,e),":list="].join("")]:[...n,[d(t,e),":list=",d(r,e)].join("")];case"comma":case"separator":case"bracket-separator":{let t="bracket-separator"===e.arrayFormat?"[]=":"=";return n=>(r,o)=>void 0===o||e.skipNull&&null===o||e.skipEmptyString&&""===o?r:(o=null===o?"":o,0===r.length)?[[d(n,e),t,d(o,e)].join("")]:[[r,d(o,e)].join(e.arrayFormatSeparator)]}default:return t=>(n,r)=>void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,d(t,e)]:[...n,[d(t,e),"=",d(r,e)].join("")]}}(t),o={};for(let[t,r]of Object.entries(e))n(t)||(o[t]=r);let i=Object.keys(o);return!1!==t.sort&&i.sort(t.sort),i.map(n=>{let o=e[n];return void 0===o?"":null===o?d(n,t):Array.isArray(o)?0===o.length&&"bracket-separator"===t.arrayFormat?d(n,t)+"[]":o.reduce(r(n),[]).join("&"):d(n,t)+"="+d(o,t)}).filter(e=>e.length>0).join("&")}function E(e,t){t={decode:!0,...t};let[n,r]=s(e,"#");return void 0===n&&(n=e),{url:n?.split("?")?.[0]??"",query:g(v(e),t),...t&&t.parseFragmentIdentifier&&r?{fragmentIdentifier:p(r,t)}:{}}}function x(e,t){t={encode:!0,strict:!0,[c]:!0,...t};let n=m(e.url).split("?")[0]||"",r=y({...g(v(e.url),{sort:!1}),...e.query},t);r&&(r=`?${r}`);let o=function(e){let t="",n=e.indexOf("#");return -1!==n&&(t=e.slice(n)),t}(e.url);if(e.fragmentIdentifier){let r=new URL(n);r.hash=e.fragmentIdentifier,o=t[c]?r.hash:`#${e.fragmentIdentifier}`}return`${n}${r}${o}`}function b(e,t,n){let{url:r,query:o,fragmentIdentifier:i}=E(e,n={parseFragmentIdentifier:!0,[c]:!1,...n});return x({url:r,query:function(e,t){let n={};if(Array.isArray(t))for(let r of t){let t=Object.getOwnPropertyDescriptor(e,r);t?.enumerable&&Object.defineProperty(n,r,t)}else for(let r of Reflect.ownKeys(e)){let o=Object.getOwnPropertyDescriptor(e,r);if(o.enumerable){let i=e[r];t(r,i,e)&&Object.defineProperty(n,r,o)}}return n}(o,t),fragmentIdentifier:i},n)}function C(e,t,n){return b(e,Array.isArray(t)?e=>!t.includes(e):(e,n)=>!t(e,n),n)}var O=r}}]); \ No newline at end of file diff --git a/dist/_next/static/chunks/360-68d92f958c6a7dac.js b/dist/_next/static/chunks/360-68d92f958c6a7dac.js new file mode 100644 index 00000000..5471b96e --- /dev/null +++ b/dist/_next/static/chunks/360-68d92f958c6a7dac.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[360],{7311:function(e,t,n){n.d(t,{Z:function(){return o}});var r=n(5271);function o(){return(0,r.useState)(null)}},4586:function(e,t,n){n.d(t,{Z:function(){return a}});var r=n(5271),o=n(994);function a(e,t,n,a=!1){let i=(0,o.Z)(n);(0,r.useEffect)(()=>{let n="function"==typeof e?e():e;return n.addEventListener(t,i,a),()=>n.removeEventListener(t,i,a)},[e])}},5434:function(e,t,n){n.d(t,{Z:function(){return o}});var r=n(5271);function o(){let[,e]=(0,r.useReducer)(e=>!e,!1);return e}},2798:function(e,t,n){n.d(t,{Z:function(){return l}});var r=n(5271),o=n(9761),a=n(3354);let i=2147483648-1;function l(){let e=(0,o.Z)(),t=(0,r.useRef)();return(0,a.Z)(()=>clearTimeout(t.current)),(0,r.useMemo)(()=>{let n=()=>clearTimeout(t.current);return{set:function(r,o=0){e()&&(n(),o<=i?t.current=setTimeout(r,o):function e(t,n,r){let o=r-Date.now();t.current=o<=i?setTimeout(n,o):setTimeout(()=>e(t,n,r),i)}(t,r,Date.now()+o))},clear:n,handleRef:t}},[])}},1900:function(e,t,n){n.d(t,{Z:function(){return u}});var r=n(5271);n(7311),n(50);var o=n(994);n(4586),n(9761),n(5965),n(9125),new WeakMap;var a=n(8743),i=n(2676);let l=["onKeyDown"],s=r.forwardRef((e,t)=>{var n;let{onKeyDown:r}=e,s=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r=0||(o[n]=e[n]);return o}(e,l),[u]=(0,a.FT)(Object.assign({tagName:"a"},s)),c=(0,o.Z)(e=>{u.onKeyDown(e),null==r||r(e)});return(n=s.href)&&"#"!==n.trim()&&"button"!==s.role?(0,i.jsx)("a",Object.assign({ref:t},s,{onKeyDown:r})):(0,i.jsx)("a",Object.assign({ref:t},s,u,{onKeyDown:c}))});s.displayName="Anchor";var u=s},8743:function(e,t,n){n.d(t,{FT:function(){return i}});var r=n(5271),o=n(2676);let a=["as","disabled"];function i({tagName:e,disabled:t,href:n,target:r,rel:o,role:a,onClick:i,tabIndex:l=0,type:s}){e||(e=null!=n||null!=r||null!=o?"a":"button");let u={tagName:e};if("button"===e)return[{type:s||"button",disabled:t},u];let c=r=>{var o;if(!t&&("a"!==e||(o=n)&&"#"!==o.trim())||r.preventDefault(),t){r.stopPropagation();return}null==i||i(r)};return"a"===e&&(n||(n="#"),t&&(n=void 0)),[{role:null!=a?a:"button",disabled:void 0,tabIndex:t?void 0:l,href:n,target:"a"===e?r:void 0,"aria-disabled":t||void 0,rel:"a"===e?o:void 0,onClick:c,onKeyDown:e=>{" "===e.key&&(e.preventDefault(),c(e))}},u]}let l=r.forwardRef((e,t)=>{let{as:n,disabled:r}=e,l=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r=0||(o[n]=e[n]);return o}(e,a),[s,{tagName:u}]=i(Object.assign({tagName:n,disabled:r},l));return(0,o.jsx)(u,Object.assign({},l,s,{ref:t}))});l.displayName="Button",t.ZP=l},5851:function(e,t,n){let r=n(5271).createContext(null);t.Z=r},9355:function(e,t,n){n.d(t,{d:function(){return d}});var r=n(5271),o=n(7311),a=n(5851),i=n(7200),l=n(5116),s=n(5882),u=n(2676);let c=["children","usePopper"],f=()=>{};function d(e={}){let t=(0,r.useContext)(a.Z),[n,u]=(0,o.Z)(),c=(0,r.useRef)(!1),{flip:d,offset:p,rootCloseEvent:h,fixed:m=!1,placement:v,popperConfig:g={},enableEventListeners:y=!0,usePopper:b=!!t}=e,x=(null==t?void 0:t.show)==null?!!e.show:t.show;x&&!c.current&&(c.current=!0);let{placement:w,setMenu:O,menuElement:j,toggleElement:E}=t||{},Z=(0,i.Z)(E,j,(0,s.ZP)({placement:v||w||"bottom-start",enabled:b,enableEvents:null==y?x:y,offset:p,flip:d,fixed:m,arrowElement:n,popperConfig:g})),D=Object.assign({ref:O||f,"aria-labelledby":null==E?void 0:E.id},Z.attributes.popper,{style:Z.styles.popper}),C={show:x,placement:w,hasShown:c.current,toggle:null==t?void 0:t.toggle,popper:b?Z:null,arrowProps:b?Object.assign({ref:u},Z.attributes.arrow,{style:Z.styles.arrow}):{}};return(0,l.Z)(j,e=>{null==t||t.toggle(!1,e)},{clickTrigger:h,disabled:!x}),[D,C]}function p(e){let{children:t,usePopper:n=!0}=e,[r,o]=d(Object.assign({},function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r=0||(o[n]=e[n]);return o}(e,c),{usePopper:n}));return(0,u.jsx)(u.Fragment,{children:t(r,o)})}p.displayName="DropdownMenu",t.Z=p},5082:function(e,t,n){n.d(t,{Jr:function(){return u},bt:function(){return l}});var r=n(5271),o=n(336),a=n(5851),i=n(2676);let l=e=>{var t;return(null==(t=e.getAttribute("role"))?void 0:t.toLowerCase())==="menu"},s=()=>{};function u(){let e=(0,o.gP)(),{show:t=!1,toggle:n=s,setToggle:i,menuElement:u}=(0,r.useContext)(a.Z)||{},c={id:e,ref:i||s,onClick:(0,r.useCallback)(e=>{n(!t,e)},[t,n]),"aria-expanded":!!t};return u&&l(u)&&(c["aria-haspopup"]=!0),[c,{show:t,toggle:n}]}function c({children:e}){let[t,n]=u();return(0,i.jsx)(i.Fragment,{children:e(t,n)})}c.displayName="DropdownToggle",t.ZP=c},8848:function(e,t,n){let r=n(5271).createContext(null);r.displayName="NavContext",t.Z=r},9628:function(e,t,n){n.d(t,{v:function(){return d}});var r=n(5271),o=n(994),a=n(8848),i=n(177),l=n(8743),s=n(8122),u=n(3778),c=n(2676);let f=["as","active","eventKey"];function d({key:e,onClick:t,active:n,id:l,role:c,disabled:f}){let d=(0,r.useContext)(i.Z),p=(0,r.useContext)(a.Z),h=(0,r.useContext)(u.Z),m=n,v={role:c};if(p){c||"tablist"!==p.role||(v.role="tab");let t=p.getControllerId(null!=e?e:null),r=p.getControlledId(null!=e?e:null);v[(0,s.PB)("event-key")]=e,v.id=t||l,((m=null==n&&null!=e?p.activeKey===e:n)||!(null!=h&&h.unmountOnExit)&&!(null!=h&&h.mountOnEnter))&&(v["aria-controls"]=r)}return"tab"===v.role&&(v["aria-selected"]=m,m||(v.tabIndex=-1),f&&(v.tabIndex=-1,v["aria-disabled"]=!0)),v.onClick=(0,o.Z)(n=>{f||(null==t||t(n),null!=e&&d&&!n.isPropagationStopped()&&d(e,n))}),[v,{isActive:m}]}let p=r.forwardRef((e,t)=>{let{as:n=l.ZP,active:r,eventKey:o}=e,a=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r=0||(o[n]=e[n]);return o}(e,f),[u,p]=d(Object.assign({key:(0,i.h)(o,a.href),active:r},a));return u[(0,s.PB)("active")]=p.isActive,(0,c.jsx)(n,Object.assign({},a,u,{ref:t}))});p.displayName="NavItem",t.Z=p},3778:function(e,t,n){let r=n(5271).createContext(null);t.Z=r},6162:function(e,t,n){n.d(t,{W:function(){return d}});var r=n(5271),o=n(3778),a=n(177),i=n(3636),l=n(2676);let s=["active","eventKey","mountOnEnter","transition","unmountOnExit","role","onEnter","onEntering","onEntered","onExit","onExiting","onExited"],u=["activeKey","getControlledId","getControllerId"],c=["as"];function f(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r=0||(o[n]=e[n]);return o}function d(e){let{active:t,eventKey:n,mountOnEnter:i,transition:l,unmountOnExit:c,role:d="tabpanel",onEnter:p,onEntering:h,onEntered:m,onExit:v,onExiting:g,onExited:y}=e,b=f(e,s),x=(0,r.useContext)(o.Z);if(!x)return[Object.assign({},b,{role:d}),{eventKey:n,isActive:t,mountOnEnter:i,transition:l,unmountOnExit:c,onEnter:p,onEntering:h,onEntered:m,onExit:v,onExiting:g,onExited:y}];let{activeKey:w,getControlledId:O,getControllerId:j}=x,E=f(x,u),Z=(0,a.h)(n);return[Object.assign({},b,{role:d,id:O(n),"aria-labelledby":j(n)}),{eventKey:n,isActive:null==t&&null!=Z?(0,a.h)(w)===Z:t,transition:l||E.transition,mountOnEnter:null!=i?i:E.mountOnEnter,unmountOnExit:null!=c?c:E.unmountOnExit,onEnter:p,onEntering:h,onEntered:m,onExit:v,onExiting:g,onExited:y}]}let p=r.forwardRef((e,t)=>{let{as:n="div"}=e,[r,{isActive:s,onEnter:u,onEntering:p,onEntered:h,onExit:m,onExiting:v,onExited:g,mountOnEnter:y,unmountOnExit:b,transition:x=i.Z}]=d(f(e,c));return(0,l.jsx)(o.Z.Provider,{value:null,children:(0,l.jsx)(a.Z.Provider,{value:null,children:(0,l.jsx)(x,{in:s,onEnter:u,onEntering:p,onEntered:h,onExit:m,onExiting:v,onExited:g,mountOnEnter:y,unmountOnExit:b,children:(0,l.jsx)(n,Object.assign({},r,{ref:t,hidden:!s,"aria-hidden":!s}))})})})});p.displayName="TabPanel",t.Z=p},3809:function(e,t,n){var r=n(5271),o=n(3689),a=n(336),i=n(3778),l=n(177),s=n(6162),u=n(2676);let c=e=>{let{id:t,generateChildId:n,onSelect:s,activeKey:c,defaultActiveKey:f,transition:d,mountOnEnter:p,unmountOnExit:h,children:m}=e,[v,g]=(0,o.$c)(c,f,s),y=(0,a.gP)(t),b=(0,r.useMemo)(()=>n||((e,t)=>y?`${y}-${t}-${e}`:null),[y,n]),x=(0,r.useMemo)(()=>({onSelect:g,activeKey:v,transition:d,mountOnEnter:p||!1,unmountOnExit:h||!1,getControlledId:e=>b(e,"tabpane"),getControllerId:e=>b(e,"tab")}),[g,v,d,p,h,b]);return(0,u.jsx)(i.Z.Provider,{value:x,children:(0,u.jsx)(l.Z.Provider,{value:g||null,children:m})})};c.Panel=s.Z,t.Z=c},5882:function(e,t,n){n.d(t,{ZP:function(){return r}});function r({enabled:e,enableEvents:t,placement:n,flip:r,offset:o,fixed:a,containerPadding:i,arrowElement:l,popperConfig:s={}}){var u,c,f,d,p;let h=function(e){let t={};return Array.isArray(e)?(null==e||e.forEach(e=>{t[e.name]=e}),t):e||t}(s.modifiers);return Object.assign({},s,{placement:n,enabled:e,strategy:a?"fixed":s.strategy,modifiers:function(e={}){return Array.isArray(e)?e:Object.keys(e).map(t=>(e[t].name=t,e[t]))}(Object.assign({},h,{eventListeners:{enabled:t,options:null==(u=h.eventListeners)?void 0:u.options},preventOverflow:Object.assign({},h.preventOverflow,{options:i?Object.assign({padding:i},null==(c=h.preventOverflow)?void 0:c.options):null==(f=h.preventOverflow)?void 0:f.options}),offset:{options:Object.assign({offset:o},null==(d=h.offset)?void 0:d.options)},arrow:Object.assign({},h.arrow,{enabled:!!l,options:Object.assign({},null==(p=h.arrow)?void 0:p.options,{element:l})}),flip:Object.assign({enabled:!!r},h.flip)}))})}},5116:function(e,t,n){n.d(t,{f:function(){return f}});var r=n(6712),o=n(2685),a=n(8342),i=n(5271),l=n(994),s=n(1190),u=n.n(s);let c=()=>{},f=e=>e&&("current"in e?e.current:e),d={click:"mousedown",mouseup:"mousedown",pointerup:"pointerdown"};t.Z=function(e,t=c,{disabled:n,clickTrigger:s="click"}={}){let p=(0,i.useRef)(!1),h=(0,i.useRef)(!1),m=(0,i.useCallback)(t=>{let n=f(e);u()(!!n,"ClickOutside captured a close event but does not have a ref to compare it to. useClickOutside(), should be passed a ref that resolves to a DOM node"),p.current=!n||!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)||0!==t.button||!!(0,r.Z)(n,t.target)||h.current,h.current=!1},[e]),v=(0,l.Z)(t=>{let n=f(e);n&&(0,r.Z)(n,t.target)&&(h.current=!0)}),g=(0,l.Z)(e=>{p.current||t(e)});(0,i.useEffect)(()=>{var t,r;if(n||null==e)return;let i=(0,a.Z)(f(e)),l=i.defaultView||window,u=null!=(t=l.event)?t:null==(r=l.parent)?void 0:r.event,p=null;d[s]&&(p=(0,o.Z)(i,d[s],v,!0));let h=(0,o.Z)(i,s,m,!0),y=(0,o.Z)(i,s,e=>{if(e===u){u=void 0;return}g(e)}),b=[];return"ontouchstart"in i.documentElement&&(b=[].slice.call(i.body.children).map(e=>(0,o.Z)(e,"mousemove",c))),()=>{null==p||p(),h(),y(),b.forEach(e=>e())}},[e,n,s,m,v,g])}},7200:function(e,t,n){n.d(t,{Z:function(){return ex}});var r,o,a,i,l,s=n(5271),u=Object.prototype.hasOwnProperty;function c(e,t,n){for(n of e.keys())if(f(n,t))return n}function f(e,t){var n,r,o;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&f(e[r],t[r]););return -1===r}if(n===Set){if(e.size!==t.size)return!1;for(r of e)if((o=r)&&"object"==typeof o&&!(o=c(t,o))||!t.has(o))return!1;return!0}if(n===Map){if(e.size!==t.size)return!1;for(r of e)if((o=r[0])&&"object"==typeof o&&!(o=c(t,o))||!f(r[1],t.get(o)))return!1;return!0}if(n===ArrayBuffer)e=new Uint8Array(e),t=new Uint8Array(t);else if(n===DataView){if((r=e.byteLength)===t.byteLength)for(;r--&&e.getInt8(r)===t.getInt8(r););return -1===r}if(ArrayBuffer.isView(e)){if((r=e.byteLength)===t.byteLength)for(;r--&&e[r]===t[r];);return -1===r}if(!n||"object"==typeof e){for(n in r=0,e)if(u.call(e,n)&&++r&&!u.call(t,n)||!(n in t)||!f(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!=e&&t!=t}var d=n(9761),p=function(e){let t=(0,d.Z)();return[e[0],(0,s.useCallback)(n=>{if(t())return e[1](n)},[t,e[1]])]};function h(e){return e.split("-")[0]}function m(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function v(e){var t=m(e).Element;return e instanceof t||e instanceof Element}function g(e){var t=m(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function y(e){if("undefined"==typeof ShadowRoot)return!1;var t=m(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}var b=Math.max,x=Math.min,w=Math.round;function O(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function j(){return!/^((?!chrome|android).)*safari/i.test(O())}function E(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var r=e.getBoundingClientRect(),o=1,a=1;t&&g(e)&&(o=e.offsetWidth>0&&w(r.width)/e.offsetWidth||1,a=e.offsetHeight>0&&w(r.height)/e.offsetHeight||1);var i=(v(e)?m(e):window).visualViewport,l=!j()&&n,s=(r.left+(l&&i?i.offsetLeft:0))/o,u=(r.top+(l&&i?i.offsetTop:0))/a,c=r.width/o,f=r.height/a;return{width:c,height:f,top:u,right:s+c,bottom:u+f,left:s,x:s,y:u}}function Z(e){var t=E(e),n=e.offsetWidth,r=e.offsetHeight;return 1>=Math.abs(t.width-n)&&(n=t.width),1>=Math.abs(t.height-r)&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function D(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&y(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function C(e){return e?(e.nodeName||"").toLowerCase():null}function N(e){return m(e).getComputedStyle(e)}function S(e){return((v(e)?e.ownerDocument:e.document)||window.document).documentElement}function P(e){return"html"===C(e)?e:e.assignedSlot||e.parentNode||(y(e)?e.host:null)||S(e)}function k(e){return g(e)&&"fixed"!==N(e).position?e.offsetParent:null}function T(e){for(var t=m(e),n=k(e);n&&["table","td","th"].indexOf(C(n))>=0&&"static"===N(n).position;)n=k(n);return n&&("html"===C(n)||"body"===C(n)&&"static"===N(n).position)?t:n||function(e){var t=/firefox/i.test(O());if(/Trident/i.test(O())&&g(e)&&"fixed"===N(e).position)return null;var n=P(e);for(y(n)&&(n=n.host);g(n)&&0>["html","body"].indexOf(C(n));){var r=N(n);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||t&&"filter"===r.willChange||t&&r.filter&&"none"!==r.filter)return n;n=n.parentNode}return null}(e)||t}function M(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function R(e,t,n){return b(e,x(t,n))}function A(){return{top:0,right:0,bottom:0,left:0}}function I(e){return Object.assign({},A(),e)}function L(e,t){return t.reduce(function(t,n){return t[n]=e,t},{})}var _="bottom",F="right",W="left",B="auto",H=["top",_,F,W],U="start",X="viewport",V="popper",Y=H.reduce(function(e,t){return e.concat([t+"-"+U,t+"-end"])},[]),K=[].concat(H,[B]).reduce(function(e,t){return e.concat([t,t+"-"+U,t+"-end"])},[]),z=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function $(e){return e.split("-")[1]}var q={top:"auto",right:"auto",bottom:"auto",left:"auto"};function G(e){var t,n,r,o,a,i,l,s=e.popper,u=e.popperRect,c=e.placement,f=e.variation,d=e.offsets,p=e.position,h=e.gpuAcceleration,v=e.adaptive,g=e.roundOffsets,y=e.isFixed,b=d.x,x=void 0===b?0:b,O=d.y,j=void 0===O?0:O,E="function"==typeof g?g({x:x,y:j}):{x:x,y:j};x=E.x,j=E.y;var Z=d.hasOwnProperty("x"),D=d.hasOwnProperty("y"),C=W,P="top",k=window;if(v){var M=T(s),R="clientHeight",A="clientWidth";M===m(s)&&"static"!==N(M=S(s)).position&&"absolute"===p&&(R="scrollHeight",A="scrollWidth"),("top"===c||(c===W||c===F)&&"end"===f)&&(P=_,j-=(y&&M===k&&k.visualViewport?k.visualViewport.height:M[R])-u.height,j*=h?1:-1),(c===W||("top"===c||c===_)&&"end"===f)&&(C=F,x-=(y&&M===k&&k.visualViewport?k.visualViewport.width:M[A])-u.width,x*=h?1:-1)}var I=Object.assign({position:p},v&&q),L=!0===g?(t={x:x,y:j},n=m(s),r=t.x,o=t.y,{x:w(r*(a=n.devicePixelRatio||1))/a||0,y:w(o*a)/a||0}):{x:x,y:j};return(x=L.x,j=L.y,h)?Object.assign({},I,((l={})[P]=D?"0":"",l[C]=Z?"0":"",l.transform=1>=(k.devicePixelRatio||1)?"translate("+x+"px, "+j+"px)":"translate3d("+x+"px, "+j+"px, 0)",l)):Object.assign({},I,((i={})[P]=D?j+"px":"",i[C]=Z?x+"px":"",i.transform="",i))}var J={passive:!0},Q={left:"right",right:"left",bottom:"top",top:"bottom"};function ee(e){return e.replace(/left|right|bottom|top/g,function(e){return Q[e]})}var et={start:"end",end:"start"};function en(e){return e.replace(/start|end/g,function(e){return et[e]})}function er(e){var t=m(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function eo(e){return E(S(e)).left+er(e).scrollLeft}function ea(e){var t=N(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function ei(e,t){void 0===t&&(t=[]);var n,r=function e(t){return["html","body","#document"].indexOf(C(t))>=0?t.ownerDocument.body:g(t)&&ea(t)?t:e(P(t))}(e),o=r===(null==(n=e.ownerDocument)?void 0:n.body),a=m(r),i=o?[a].concat(a.visualViewport||[],ea(r)?r:[]):r,l=t.concat(i);return o?l:l.concat(ei(P(i)))}function el(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function es(e,t,n){var r,o,a,i,l,s,u,c,f,d;return t===X?el(function(e,t){var n=m(e),r=S(e),o=n.visualViewport,a=r.clientWidth,i=r.clientHeight,l=0,s=0;if(o){a=o.width,i=o.height;var u=j();(u||!u&&"fixed"===t)&&(l=o.offsetLeft,s=o.offsetTop)}return{width:a,height:i,x:l+eo(e),y:s}}(e,n)):v(t)?((r=E(t,!1,"fixed"===n)).top=r.top+t.clientTop,r.left=r.left+t.clientLeft,r.bottom=r.top+t.clientHeight,r.right=r.left+t.clientWidth,r.width=t.clientWidth,r.height=t.clientHeight,r.x=r.left,r.y=r.top,r):el((o=S(e),i=S(o),l=er(o),s=null==(a=o.ownerDocument)?void 0:a.body,u=b(i.scrollWidth,i.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),c=b(i.scrollHeight,i.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0),f=-l.scrollLeft+eo(o),d=-l.scrollTop,"rtl"===N(s||i).direction&&(f+=b(i.clientWidth,s?s.clientWidth:0)-u),{width:u,height:c,x:f,y:d}))}function eu(e){var t,n=e.reference,r=e.element,o=e.placement,a=o?h(o):null,i=o?$(o):null,l=n.x+n.width/2-r.width/2,s=n.y+n.height/2-r.height/2;switch(a){case"top":t={x:l,y:n.y-r.height};break;case _:t={x:l,y:n.y+n.height};break;case F:t={x:n.x+n.width,y:s};break;case W:t={x:n.x-r.width,y:s};break;default:t={x:n.x,y:n.y}}var u=a?M(a):null;if(null!=u){var c="y"===u?"height":"width";switch(i){case U:t[u]=t[u]-(n[c]/2-r[c]/2);break;case"end":t[u]=t[u]+(n[c]/2-r[c]/2)}}return t}function ec(e,t){void 0===t&&(t={});var n,r,o,a,i,l,s,u,c=t,f=c.placement,d=void 0===f?e.placement:f,p=c.strategy,h=void 0===p?e.strategy:p,m=c.boundary,y=c.rootBoundary,w=c.elementContext,O=void 0===w?V:w,j=c.altBoundary,Z=c.padding,k=void 0===Z?0:Z,M=I("number"!=typeof k?k:L(k,H)),R=e.rects.popper,A=e.elements[void 0!==j&&j?O===V?"reference":V:O],W=(n=v(A)?A:A.contextElement||S(e.elements.popper),r=void 0===m?"clippingParents":m,o=void 0===y?X:y,s=(l=[].concat("clippingParents"===r?(a=ei(P(n)),v(i=["absolute","fixed"].indexOf(N(n).position)>=0&&g(n)?T(n):n)?a.filter(function(e){return v(e)&&D(e,i)&&"body"!==C(e)}):[]):[].concat(r),[o]))[0],(u=l.reduce(function(e,t){var r=es(n,t,h);return e.top=b(r.top,e.top),e.right=x(r.right,e.right),e.bottom=x(r.bottom,e.bottom),e.left=b(r.left,e.left),e},es(n,s,h))).width=u.right-u.left,u.height=u.bottom-u.top,u.x=u.left,u.y=u.top,u),B=E(e.elements.reference),U=eu({reference:B,element:R,strategy:"absolute",placement:d}),Y=el(Object.assign({},R,U)),K=O===V?Y:B,z={top:W.top-K.top+M.top,bottom:K.bottom-W.bottom+M.bottom,left:W.left-K.left+M.left,right:K.right-W.right+M.right},$=e.modifiersData.offset;if(O===V&&$){var q=$[d];Object.keys(z).forEach(function(e){var t=[F,_].indexOf(e)>=0?1:-1,n=["top",_].indexOf(e)>=0?"y":"x";z[e]+=q[n]*t})}return z}function ef(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function ed(e){return["top",F,_,W].some(function(t){return e[t]>=0})}var ep={placement:"bottom",modifiers:[],strategy:"absolute"};function eh(){for(var e=arguments.length,t=Array(e),n=0;n=0?-1:1,s=(l="function"==typeof a?a(Object.assign({},r,{placement:n})):a)[0],u=l[1],s=s||0,u=(u||0)*i,[W,F].indexOf(o)>=0?{x:u,y:s}:{x:s,y:u}),e},{}),l=i[t.placement],s=l.x,u=l.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=s,t.modifiersData.popperOffsets.y+=u),t.modifiersData[r]=i}},{name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var o=n.mainAxis,a=void 0===o||o,i=n.altAxis,l=void 0===i||i,s=n.fallbackPlacements,u=n.padding,c=n.boundary,f=n.rootBoundary,d=n.altBoundary,p=n.flipVariations,m=void 0===p||p,v=n.allowedAutoPlacements,g=t.options.placement,y=h(g)===g,b=s||(y||!m?[ee(g)]:function(e){if(h(e)===B)return[];var t=ee(e);return[en(e),t,en(t)]}(g)),x=[g].concat(b).reduce(function(e,n){var r,o,a,i,l,s,d,p,g,y,b,x;return e.concat(h(n)===B?(o=(r={placement:n,boundary:c,rootBoundary:f,padding:u,flipVariations:m,allowedAutoPlacements:v}).placement,a=r.boundary,i=r.rootBoundary,l=r.padding,s=r.flipVariations,p=void 0===(d=r.allowedAutoPlacements)?K:d,0===(b=(y=(g=$(o))?s?Y:Y.filter(function(e){return $(e)===g}):H).filter(function(e){return p.indexOf(e)>=0})).length&&(b=y),Object.keys(x=b.reduce(function(e,n){return e[n]=ec(t,{placement:n,boundary:a,rootBoundary:i,padding:l})[h(n)],e},{})).sort(function(e,t){return x[e]-x[t]})):n)},[]),w=t.rects.reference,O=t.rects.popper,j=new Map,E=!0,Z=x[0],D=0;D=0,k=P?"width":"height",T=ec(t,{placement:C,boundary:c,rootBoundary:f,altBoundary:d,padding:u}),M=P?S?F:W:S?_:"top";w[k]>O[k]&&(M=ee(M));var R=ee(M),A=[];if(a&&A.push(T[N]<=0),l&&A.push(T[M]<=0,T[R]<=0),A.every(function(e){return e})){Z=C,E=!1;break}j.set(C,A)}if(E)for(var I=m?3:1,L=function(e){var t=x.find(function(t){var n=j.get(t);if(n)return n.slice(0,e).every(function(e){return e})});if(t)return Z=t,"break"},X=I;X>0&&"break"!==L(X);X--);t.placement!==Z&&(t.modifiersData[r]._skip=!0,t.placement=Z,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},{name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name,o=n.mainAxis,a=n.altAxis,i=n.boundary,l=n.rootBoundary,s=n.altBoundary,u=n.padding,c=n.tether,f=void 0===c||c,d=n.tetherOffset,p=void 0===d?0:d,m=ec(t,{boundary:i,rootBoundary:l,padding:u,altBoundary:s}),v=h(t.placement),g=$(t.placement),y=!g,w=M(v),O="x"===w?"y":"x",j=t.modifiersData.popperOffsets,E=t.rects.reference,D=t.rects.popper,C="function"==typeof p?p(Object.assign({},t.rects,{placement:t.placement})):p,N="number"==typeof C?{mainAxis:C,altAxis:C}:Object.assign({mainAxis:0,altAxis:0},C),S=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,P={x:0,y:0};if(j){if(void 0===o||o){var k,I="y"===w?"top":W,L="y"===w?_:F,B="y"===w?"height":"width",H=j[w],X=H+m[I],V=H-m[L],Y=f?-D[B]/2:0,K=g===U?E[B]:D[B],z=g===U?-D[B]:-E[B],q=t.elements.arrow,G=f&&q?Z(q):{width:0,height:0},J=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:A(),Q=J[I],ee=J[L],et=R(0,E[B],G[B]),en=y?E[B]/2-Y-et-Q-N.mainAxis:K-et-Q-N.mainAxis,er=y?-E[B]/2+Y+et+ee+N.mainAxis:z+et+ee+N.mainAxis,eo=t.elements.arrow&&T(t.elements.arrow),ea=eo?"y"===w?eo.clientTop||0:eo.clientLeft||0:0,ei=null!=(k=null==S?void 0:S[w])?k:0,el=R(f?x(X,H+en-ei-ea):X,H,f?b(V,H+er-ei):V);j[w]=el,P[w]=el-H}if(void 0!==a&&a){var es,eu,ef="x"===w?"top":W,ed="x"===w?_:F,ep=j[O],eh="y"===O?"height":"width",em=ep+m[ef],ev=ep-m[ed],eg=-1!==["top",W].indexOf(v),ey=null!=(eu=null==S?void 0:S[O])?eu:0,eb=eg?em:ep-E[eh]-D[eh]-ey+N.altAxis,ex=eg?ep+E[eh]+D[eh]-ey-N.altAxis:ev,ew=f&&eg?(es=R(eb,ep,ex))>ex?ex:es:R(f?eb:em,ep,f?ex:ev);j[O]=ew,P[O]=ew-ep}t.modifiersData[r]=P}},requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n,r=e.state,o=e.name,a=e.options,i=r.elements.arrow,l=r.modifiersData.popperOffsets,s=h(r.placement),u=M(s),c=[W,F].indexOf(s)>=0?"height":"width";if(i&&l){var f=I("number"!=typeof(t="function"==typeof(t=a.padding)?t(Object.assign({},r.rects,{placement:r.placement})):t)?t:L(t,H)),d=Z(i),p="y"===u?"top":W,m="y"===u?_:F,v=r.rects.reference[c]+r.rects.reference[u]-l[u]-r.rects.popper[c],g=l[u]-r.rects.reference[u],y=T(i),b=y?"y"===u?y.clientHeight||0:y.clientWidth||0:0,x=f[p],w=b-d[c]-f[m],O=b/2-d[c]/2+(v/2-g/2),j=R(x,O,w);r.modifiersData[o]=((n={})[u]=j,n.centerOffset=j-O,n)}},effect:function(e){var t=e.state,n=e.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!=typeof r||(r=t.elements.popper.querySelector(r)))&&D(t.elements.popper,r)&&(t.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]}]}).defaultModifiers)?[]:o,l=void 0===(i=r.defaultOptions)?ep:i,function(e,t,n){void 0===n&&(n=l);var r,o,i={placement:"bottom",orderedModifiers:[],options:Object.assign({},ep,l),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},s=[],u=!1,c={state:i,setOptions:function(n){var r,o,u,d,p,h="function"==typeof n?n(i.options):n;f(),i.options=Object.assign({},l,i.options,h),i.scrollParents={reference:v(e)?ei(e):e.contextElement?ei(e.contextElement):[],popper:ei(t)};var m=(o=Object.keys(r=[].concat(a,i.options.modifiers).reduce(function(e,t){var n=e[t.name];return e[t.name]=n?Object.assign({},n,t,{options:Object.assign({},n.options,t.options),data:Object.assign({},n.data,t.data)}):t,e},{})).map(function(e){return r[e]}),u=new Map,d=new Set,p=[],o.forEach(function(e){u.set(e.name,e)}),o.forEach(function(e){d.has(e.name)||function e(t){d.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach(function(t){if(!d.has(t)){var n=u.get(t);n&&e(n)}}),p.push(t)}(e)}),z.reduce(function(e,t){return e.concat(p.filter(function(e){return e.phase===t}))},[]));return i.orderedModifiers=m.filter(function(e){return e.enabled}),i.orderedModifiers.forEach(function(e){var t=e.name,n=e.options,r=e.effect;if("function"==typeof r){var o=r({state:i,name:t,instance:c,options:void 0===n?{}:n});s.push(o||function(){})}}),c.update()},forceUpdate:function(){if(!u){var e,t,n,r,o,a,l,s,f,d,p,h,v=i.elements,y=v.reference,b=v.popper;if(eh(y,b)){i.rects={reference:(t=T(b),n="fixed"===i.options.strategy,r=g(t),s=g(t)&&(a=w((o=t.getBoundingClientRect()).width)/t.offsetWidth||1,l=w(o.height)/t.offsetHeight||1,1!==a||1!==l),f=S(t),d=E(y,s,n),p={scrollLeft:0,scrollTop:0},h={x:0,y:0},(r||!r&&!n)&&(("body"!==C(t)||ea(f))&&(p=(e=t)!==m(e)&&g(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:er(e)),g(t)?(h=E(t,!0),h.x+=t.clientLeft,h.y+=t.clientTop):f&&(h.x=eo(f))),{x:d.left+p.scrollLeft-h.x,y:d.top+p.scrollTop-h.y,width:d.width,height:d.height}),popper:Z(b)},i.reset=!1,i.placement=i.options.placement,i.orderedModifiers.forEach(function(e){return i.modifiersData[e.name]=Object.assign({},e.data)});for(var x=0;xvoid 0},ey={name:"ariaDescribedBy",enabled:!0,phase:"afterWrite",effect:({state:e})=>()=>{let{reference:t,popper:n}=e.elements;if("removeAttribute"in t){let e=(t.getAttribute("aria-describedby")||"").split(",").filter(e=>e.trim()!==n.id);e.length?t.setAttribute("aria-describedby",e.join(",")):t.removeAttribute("aria-describedby")}},fn:({state:e})=>{var t;let{popper:n,reference:r}=e.elements,o=null==(t=n.getAttribute("role"))?void 0:t.toLowerCase();if(n.id&&"tooltip"===o&&"setAttribute"in r){let e=r.getAttribute("aria-describedby");if(e&&-1!==e.split(",").indexOf(n.id))return;r.setAttribute("aria-describedby",e?`${e},${n.id}`:n.id)}}},eb=[];var ex=function(e,t,n={}){let{enabled:r=!0,placement:o="bottom",strategy:a="absolute",modifiers:i=eb}=n,l=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r=0||(o[n]=e[n]);return o}(n,ev),u=(0,s.useRef)(i),c=(0,s.useRef)(),d=(0,s.useCallback)(()=>{var e;null==(e=c.current)||e.update()},[]),h=(0,s.useCallback)(()=>{var e;null==(e=c.current)||e.forceUpdate()},[]),[m,v]=p((0,s.useState)({placement:o,update:d,forceUpdate:h,attributes:{},styles:{popper:{},arrow:{}}})),g=(0,s.useMemo)(()=>({name:"updateStateModifier",enabled:!0,phase:"write",requires:["computeStyles"],fn:({state:e})=>{let t={},n={};Object.keys(e.elements).forEach(r=>{t[r]=e.styles[r],n[r]=e.attributes[r]}),v({state:e,styles:t,attributes:n,update:d,forceUpdate:h,placement:e.placement})}}),[d,h,v]),y=(0,s.useMemo)(()=>(f(u.current,i)||(u.current=i),u.current),[i]);return(0,s.useEffect)(()=>{c.current&&r&&c.current.setOptions({placement:o,strategy:a,modifiers:[...y,g,eg]})},[a,o,g,r,y]),(0,s.useEffect)(()=>{if(r&&null!=e&&null!=t)return c.current=em(e,t,Object.assign({},l,{placement:o,strategy:a,modifiers:[...y,ey,g]})),()=>{null!=c.current&&(c.current.destroy(),c.current=void 0,v(e=>Object.assign({},e,{attributes:{},styles:{popper:{}}})))}},[r,e,t]),m}},5924:function(e,t,n){function r(){for(var e,t,n=0,r="";n{let{as:n,bsPrefix:r,variant:a="primary",size:u,active:c=!1,disabled:f=!1,className:d,...p}=e,h=(0,l.vE)(r,"btn"),[m,{tagName:v}]=(0,i.FT)({tagName:n,disabled:f,...p});return(0,s.jsx)(v,{...m,...p,ref:t,disabled:f,className:o()(d,h,c&&"active",a&&"".concat(h,"-").concat(a),u&&"".concat(h,"-").concat(u),p.href&&f&&"disabled")})});u.displayName="Button",t.Z=u},5633:function(e,t,n){var r=n(2187),o=n.n(r),a=n(5271),i=n(8849),l=n(2676);let s=a.forwardRef((e,t)=>{let[{className:n,...r},{as:a="div",bsPrefix:s,spans:u}]=function(e){let{as:t,bsPrefix:n,className:r,...a}=e;n=(0,i.vE)(n,"col");let l=(0,i.pi)(),s=(0,i.zG)(),u=[],c=[];return l.forEach(e=>{let t,r,o;let i=a[e];delete a[e],"object"==typeof i&&null!=i?{span:t,offset:r,order:o}=i:t=i;let l=e!==s?"-".concat(e):"";t&&u.push(!0===t?"".concat(n).concat(l):"".concat(n).concat(l,"-").concat(t)),null!=o&&c.push("order".concat(l,"-").concat(o)),null!=r&&c.push("offset".concat(l,"-").concat(r))}),[{...a,className:o()(r,...u,...c)},{as:t,bsPrefix:n,spans:u}]}(e);return(0,l.jsx)(a,{...r,ref:t,className:o()(n,!u.length&&s)})});s.displayName="Col",t.Z=s},801:function(e,t,n){n.d(t,{Z:function(){return F}});var r=n(2187),o=n.n(r),a=n(5271),i=n(3465),l=n(2853),s=n(3689),u=n(5965),c=n(5434),f=n(4586),d=n(994),p=n(5851),h=n(9355),m=n(5082),v=n(177),g=n(8848),y=n(8743),b=n(8122),x=n(2676);let w=["eventKey","disabled","onClick","active","as"];function O({key:e,href:t,active:n,disabled:r,onClick:o}){let i=(0,a.useContext)(v.Z),{activeKey:l}=(0,a.useContext)(g.Z)||{},s=(0,v.h)(e,t),u=null==n&&null!=e?(0,v.h)(l)===s:n;return[{onClick:(0,d.Z)(e=>{r||(null==o||o(e),i&&!e.isPropagationStopped()&&i(s,e))}),"aria-disabled":r||void 0,"aria-selected":u,[(0,b.PB)("dropdown-item")]:""},{isActive:u}]}let j=a.forwardRef((e,t)=>{let{eventKey:n,disabled:r,onClick:o,active:a,as:i=y.ZP}=e,l=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r=0||(o[n]=e[n]);return o}(e,w),[s]=O({key:n,href:l.href,disabled:r,onClick:o,active:a});return(0,x.jsx)(i,Object.assign({},l,{ref:t},s))});j.displayName="DropdownItem";var E=n(2879);function Z(){let e=(0,c.Z)(),t=(0,a.useRef)(null),n=(0,a.useCallback)(n=>{t.current=n,e()},[e]);return[t,n]}function D({defaultShow:e,show:t,onSelect:n,onToggle:r,itemSelector:o=`* [${(0,b.PB)("dropdown-item")}]`,focusFirstItemOnShow:c,placement:h="bottom-start",children:g}){let y=(0,E.Z)(),[w,O]=(0,s.$c)(t,e,r),[j,D]=Z(),C=j.current,[N,S]=Z(),P=N.current,k=(0,u.Z)(w),T=(0,a.useRef)(null),M=(0,a.useRef)(!1),R=(0,a.useContext)(v.Z),A=(0,a.useCallback)((e,t,n=null==t?void 0:t.type)=>{O(e,{originalEvent:t,source:n})},[O]),I=(0,d.Z)((e,t)=>{null==n||n(e,t),A(!1,t,"select"),t.isPropagationStopped()||null==R||R(e,t)}),L=(0,a.useMemo)(()=>({toggle:A,placement:h,show:w,menuElement:C,toggleElement:P,setMenu:D,setToggle:S}),[A,h,w,C,P,D,S]);C&&k&&!w&&(M.current=C.contains(C.ownerDocument.activeElement));let _=(0,d.Z)(()=>{P&&P.focus&&P.focus()}),F=(0,d.Z)(()=>{let e=T.current,t=c;if(null==t&&(t=!!(j.current&&(0,m.bt)(j.current))&&"keyboard"),!1===t||"keyboard"===t&&!/^key.+$/.test(e))return;let n=(0,i.Z)(j.current,o)[0];n&&n.focus&&n.focus()});(0,a.useEffect)(()=>{w?F():M.current&&(M.current=!1,_())},[w,M,_,F]),(0,a.useEffect)(()=>{T.current=null});let W=(e,t)=>{if(!j.current)return null;let n=(0,i.Z)(j.current,o),r=n.indexOf(e)+t;return r=Math.max(0,Math.min(r,n.length)),n[r]};return(0,f.Z)((0,a.useCallback)(()=>y.document,[y]),"keydown",e=>{var t,n;let{key:r}=e,o=e.target,a=null==(t=j.current)?void 0:t.contains(o),i=null==(n=N.current)?void 0:n.contains(o);if(/input|textarea/i.test(o.tagName)&&(" "===r||"Escape"!==r&&a||"Escape"===r&&"search"===o.type)||!a&&!i||"Tab"===r&&(!j.current||!w))return;T.current=e.type;let s={originalEvent:e,source:e.type};switch(r){case"ArrowUp":{let t=W(o,-1);t&&t.focus&&t.focus(),e.preventDefault();return}case"ArrowDown":if(e.preventDefault(),w){let e=W(o,1);e&&e.focus&&e.focus()}else O(!0,s);return;case"Tab":(0,l.ZP)(o.ownerDocument,"keyup",e=>{var t;("Tab"!==e.key||e.target)&&null!=(t=j.current)&&t.contains(e.target)||O(!1,s)},{once:!0});break;case"Escape":"Escape"===r&&(e.preventDefault(),e.stopPropagation()),O(!1,s)}}),(0,x.jsx)(v.Z.Provider,{value:I,children:(0,x.jsx)(p.Z.Provider,{value:L,children:g})})}D.displayName="Dropdown",D.Menu=h.Z,D.Toggle=m.ZP,D.Item=j;var C=n(5770),N=n(908),S=n(8849);let P=a.forwardRef((e,t)=>{let{className:n,bsPrefix:r,as:a="hr",role:i="separator",...l}=e;return r=(0,S.vE)(r,"dropdown-divider"),(0,x.jsx)(a,{ref:t,className:o()(n,r),role:i,...l})});P.displayName="DropdownDivider";let k=a.forwardRef((e,t)=>{let{className:n,bsPrefix:r,as:a="div",role:i="heading",...l}=e;return r=(0,S.vE)(r,"dropdown-header"),(0,x.jsx)(a,{ref:t,className:o()(n,r),role:i,...l})});k.displayName="DropdownHeader";var T=n(1900);let M=a.forwardRef((e,t)=>{let{bsPrefix:n,className:r,eventKey:a,disabled:i=!1,onClick:l,active:s,as:u=T.Z,...c}=e,f=(0,S.vE)(n,"dropdown-item"),[d,p]=O({key:a,href:c.href,disabled:i,onClick:l,active:s});return(0,x.jsx)(u,{...c,...d,ref:t,className:o()(r,f,p.isActive&&"active",i&&"disabled")})});M.displayName="DropdownItem";let R=a.forwardRef((e,t)=>{let{className:n,bsPrefix:r,as:a="span",...i}=e;return r=(0,S.vE)(r,"dropdown-item-text"),(0,x.jsx)(a,{ref:t,className:o()(n,r),...i})});R.displayName="DropdownItemText";var A=n(5151),I=n(4695),L=n(4153);let _=a.forwardRef((e,t)=>{let{bsPrefix:n,drop:r="down",show:i,className:l,align:s="start",onSelect:u,onToggle:c,focusFirstItemOnShow:f,as:p="div",navbar:h,autoClose:m=!0,...v}=(0,C.Ch)(e,{show:"onToggle"}),g=(0,a.useContext)(L.Z),y=(0,S.vE)(n,"dropdown"),b=(0,S.SC)(),w=e=>!1===m?"click"===e:"inside"===m?"rootClose"!==e:"outside"!==m||"select"!==e,O=(0,d.Z)((e,t)=>{var n,r;(null==(n=t.originalEvent)||null==(r=n.target)||!r.classList.contains("dropdown-toggle")||"mousedown"!==t.source)&&(t.originalEvent.currentTarget===document&&("keydown"!==t.source||"Escape"===t.originalEvent.key)&&(t.source="rootClose"),w(t.source)&&(null==c||c(e,t)))}),j=(0,A.J)("end"===s,r,b),E=(0,a.useMemo)(()=>({align:s,drop:r,isRTL:b}),[s,r,b]);return(0,x.jsx)(N.Z.Provider,{value:E,children:(0,x.jsx)(D,{placement:j,show:i,onSelect:u,onToggle:O,focusFirstItemOnShow:f,itemSelector:".".concat(y,"-item:not(.disabled):not(:disabled)"),children:g?v.children:(0,x.jsx)(p,{...v,ref:t,className:o()(l,i&&"show",{down:y,"down-centered":"".concat(y,"-center"),up:"dropup","up-centered":"dropup-center dropup",end:"dropend",start:"dropstart"}[r])})})})});_.displayName="Dropdown";var F=Object.assign(_,{Toggle:I.Z,Menu:A.Z,Item:M,ItemText:R,Divider:P,Header:k})},9594:function(e,t,n){n.d(t,{Z:function(){return h}});var r=n(5271),o=n(507),a=n.n(o),i=n(801),l=n(4695),s=n(5151);let u=a().oneOf(["start","end"]),c=a().oneOfType([u,a().shape({sm:u}),a().shape({md:u}),a().shape({lg:u}),a().shape({xl:u}),a().shape({xxl:u}),a().object]);var f=n(2676);let d={id:a().string,href:a().string,onClick:a().func,title:a().node.isRequired,disabled:a().bool,align:c,menuRole:a().string,renderMenuOnMount:a().bool,rootCloseEvent:a().string,menuVariant:a().oneOf(["dark"]),flip:a().bool,bsPrefix:a().string,variant:a().string,size:a().string},p=r.forwardRef((e,t)=>{let{title:n,children:r,bsPrefix:o,rootCloseEvent:a,variant:u,size:c,menuRole:d,renderMenuOnMount:p,disabled:h,href:m,id:v,menuVariant:g,flip:y,...b}=e;return(0,f.jsxs)(i.Z,{ref:t,...b,children:[(0,f.jsx)(l.Z,{id:v,href:m,size:c,variant:u,disabled:h,childBsPrefix:o,children:n}),(0,f.jsx)(s.Z,{role:d,renderOnMount:p,rootCloseEvent:a,variant:g,flip:y,children:r})]})});p.displayName="DropdownButton",p.propTypes=d;var h=p},908:function(e,t,n){let r=n(5271).createContext({});r.displayName="DropdownContext",t.Z=r},5151:function(e,t,n){n.d(t,{J:function(){return m}});var r=n(2187),o=n.n(r),a=n(5271),i=n(9355),l=n(9125),s=n(1920);n(1190);var u=n(908),c=n(4153),f=n(2116),d=n(8849),p=n(1926),h=n(2676);function m(e,t,n){let r=e?n?"bottom-start":"bottom-end":n?"bottom-end":"bottom-start";return"up"===t?r=e?n?"top-start":"top-end":n?"top-end":"top-start":"end"===t?r=e?n?"left-end":"right-end":n?"left-start":"right-start":"start"===t?r=e?n?"right-end":"left-end":n?"right-start":"left-start":"down-centered"===t?r="bottom":"up-centered"===t&&(r="top"),r}let v=a.forwardRef((e,t)=>{let{bsPrefix:n,className:r,align:v,rootCloseEvent:g,flip:y=!0,show:b,renderOnMount:x,as:w="div",popperConfig:O,variant:j,...E}=e,Z=!1,D=(0,a.useContext)(f.Z),C=(0,d.vE)(n,"dropdown-menu"),{align:N,drop:S,isRTL:P}=(0,a.useContext)(u.Z);v=v||N;let k=(0,a.useContext)(c.Z),T=[];if(v){if("object"==typeof v){let e=Object.keys(v);if(e.length){let t=e[0],n=v[t];Z="start"===n,T.push("".concat(C,"-").concat(t,"-").concat(n))}}else"end"===v&&(Z=!0)}let M=m(Z,S,P),[R,{hasShown:A,popper:I,show:L,toggle:_}]=(0,i.d)({flip:y,rootCloseEvent:g,show:b,usePopper:!D&&0===T.length,offset:[0,2],popperConfig:O,placement:M});if(R.ref=(0,s.Z)((0,p.Z)(t,"DropdownMenu"),R.ref),(0,l.Z)(()=>{L&&(null==I||I.update())},[L]),!A&&!x&&!k)return null;"string"!=typeof w&&(R.show=L,R.close=()=>null==_?void 0:_(!1),R.align=v);let F=E.style;return null!=I&&I.placement&&(F={...E.style,...R.style},E["x-placement"]=I.placement),(0,h.jsx)(w,{...E,...R,style:F,...(T.length||D)&&{"data-bs-popper":"static"},className:o()(r,C,L&&"show",Z&&"".concat(C,"-end"),j&&"".concat(C,"-").concat(j),...T)})});v.displayName="DropdownMenu",t.Z=v},4695:function(e,t,n){var r=n(1920),o=n(5851),a=n(5082),i=n(2187),l=n.n(i),s=n(5271),u=n(2932),c=n(8849),f=n(1926),d=n(2676);let p=s.forwardRef((e,t)=>{let{bsPrefix:n,split:i,className:p,childBsPrefix:h,as:m=u.Z,...v}=e,g=(0,c.vE)(n,"dropdown-toggle"),y=(0,s.useContext)(o.Z);void 0!==h&&(v.bsPrefix=h);let[b]=(0,a.Jr)();return b.ref=(0,r.Z)(b.ref,(0,f.Z)(t,"DropdownToggle")),(0,d.jsx)(m,{className:l()(p,g,i&&"".concat(g,"-split"),(null==y?void 0:y.show)&&"show"),...b,...v})});p.displayName="DropdownToggle",t.Z=p},914:function(e,t,n){n.d(t,{Ed:function(){return a},UI:function(){return o},XW:function(){return i}});var r=n(5271);function o(e,t){let n=0;return r.Children.map(e,e=>r.isValidElement(e)?t(e,n++):e)}function a(e,t){let n=0;r.Children.forEach(e,e=>{r.isValidElement(e)&&t(e,n++)})}function i(e,t){return r.Children.toArray(e).some(e=>r.isValidElement(e)&&e.type===t)}},3926:function(e,t,n){var r=n(2187),o=n.n(r),a=n(5271),i=n(507),l=n.n(i),s=n(2676);let u={type:l().string,tooltip:l().bool,as:l().elementType},c=a.forwardRef((e,t)=>{let{as:n="div",className:r,type:a="valid",tooltip:i=!1,...l}=e;return(0,s.jsx)(n,{...l,ref:t,className:o()(r,"".concat(a,"-").concat(i?"tooltip":"feedback"))})});c.displayName="Feedback",c.propTypes=u,t.Z=c},2003:function(e,t,n){n.d(t,{Z:function(){return E}});var r=n(2187),o=n.n(r),a=n(507),i=n.n(a),l=n(5271),s=n(8573),u=n(3629),c=n(8849),f=n(2676);let d=l.forwardRef((e,t)=>{let{className:n,bsPrefix:r,as:a="div",...i}=e;return r=(0,c.vE)(r,"form-floating"),(0,f.jsx)(a,{ref:t,className:o()(n,r),...i})});d.displayName="FormFloating";var p=n(2928),h=n(9383),m=n(6833);let v=l.forwardRef((e,t)=>{let{bsPrefix:n,className:r,id:a,...i}=e,{controlId:s}=(0,l.useContext)(m.Z);return n=(0,c.vE)(n,"form-range"),(0,f.jsx)("input",{...i,type:"range",ref:t,className:o()(r,n),id:a||s})});v.displayName="FormRange";var g=n(925);let y=l.forwardRef((e,t)=>{let{bsPrefix:n,className:r,as:a="small",muted:i,...l}=e;return n=(0,c.vE)(n,"form-text"),(0,f.jsx)(a,{...l,ref:t,className:o()(r,n,i&&"text-muted")})});y.displayName="FormText";let b=l.forwardRef((e,t)=>(0,f.jsx)(s.Z,{...e,ref:t,type:"switch"}));b.displayName="Switch";var x=Object.assign(b,{Input:s.Z.Input,Label:s.Z.Label});let w=l.forwardRef((e,t)=>{let{bsPrefix:n,className:r,children:a,controlId:i,label:l,...s}=e;return n=(0,c.vE)(n,"form-floating"),(0,f.jsxs)(p.Z,{ref:t,className:o()(r,n),controlId:i,...s,children:[a,(0,f.jsx)("label",{htmlFor:i,children:l})]})});w.displayName="FloatingLabel";let O={_ref:i().any,validated:i().bool,as:i().elementType},j=l.forwardRef((e,t)=>{let{className:n,validated:r,as:a="form",...i}=e;return(0,f.jsx)(a,{...i,ref:t,className:o()(n,r&&"was-validated")})});j.displayName="Form",j.propTypes=O;var E=Object.assign(j,{Group:p.Z,Control:u.Z,Floating:d,Check:s.Z,Switch:x,Label:h.Z,Text:y,Range:v,Select:g.Z,FloatingLabel:w})},8573:function(e,t,n){n.d(t,{Z:function(){return h}});var r=n(2187),o=n.n(r),a=n(5271),i=n(3926),l=n(1305),s=n(6833),u=n(8849),c=n(2676);let f=a.forwardRef((e,t)=>{let{bsPrefix:n,className:r,htmlFor:i,...l}=e,{controlId:f}=(0,a.useContext)(s.Z);return n=(0,u.vE)(n,"form-check-label"),(0,c.jsx)("label",{...l,ref:t,htmlFor:i||f,className:o()(r,n)})});f.displayName="FormCheckLabel";var d=n(914);let p=a.forwardRef((e,t)=>{let{id:n,bsPrefix:r,bsSwitchPrefix:p,inline:h=!1,reverse:m=!1,disabled:v=!1,isValid:g=!1,isInvalid:y=!1,feedbackTooltip:b=!1,feedback:x,feedbackType:w,className:O,style:j,title:E="",type:Z="checkbox",label:D,children:C,as:N="input",...S}=e;r=(0,u.vE)(r,"form-check"),p=(0,u.vE)(p,"form-switch");let{controlId:P}=(0,a.useContext)(s.Z),k=(0,a.useMemo)(()=>({controlId:n||P}),[P,n]),T=!C&&null!=D&&!1!==D||(0,d.XW)(C,f),M=(0,c.jsx)(l.Z,{...S,type:"switch"===Z?"checkbox":Z,ref:t,isValid:g,isInvalid:y,disabled:v,as:N});return(0,c.jsx)(s.Z.Provider,{value:k,children:(0,c.jsx)("div",{style:j,className:o()(O,T&&r,h&&"".concat(r,"-inline"),m&&"".concat(r,"-reverse"),"switch"===Z&&p),children:C||(0,c.jsxs)(c.Fragment,{children:[M,T&&(0,c.jsx)(f,{title:E,children:D}),x&&(0,c.jsx)(i.Z,{type:w,tooltip:b,children:x})]})})})});p.displayName="FormCheck";var h=Object.assign(p,{Input:l.Z,Label:f})},1305:function(e,t,n){var r=n(2187),o=n.n(r),a=n(5271),i=n(6833),l=n(8849),s=n(2676);let u=a.forwardRef((e,t)=>{let{id:n,bsPrefix:r,className:u,type:c="checkbox",isValid:f=!1,isInvalid:d=!1,as:p="input",...h}=e,{controlId:m}=(0,a.useContext)(i.Z);return r=(0,l.vE)(r,"form-check-input"),(0,s.jsx)(p,{...h,ref:t,type:c,id:n||m,className:o()(u,r,f&&"is-valid",d&&"is-invalid")})});u.displayName="FormCheckInput",t.Z=u},6833:function(e,t,n){let r=n(5271).createContext({});t.Z=r},3629:function(e,t,n){var r=n(2187),o=n.n(r),a=n(5271);n(1190);var i=n(3926),l=n(6833),s=n(8849),u=n(2676);let c=a.forwardRef((e,t)=>{let{bsPrefix:n,type:r,size:i,htmlSize:c,id:f,className:d,isValid:p=!1,isInvalid:h=!1,plaintext:m,readOnly:v,as:g="input",...y}=e,{controlId:b}=(0,a.useContext)(l.Z);return n=(0,s.vE)(n,"form-control"),(0,u.jsx)(g,{...y,type:r,size:c,ref:t,readOnly:v,id:f||b,className:o()(d,m?"".concat(n,"-plaintext"):n,i&&"".concat(n,"-").concat(i),"color"===r&&"".concat(n,"-color"),p&&"is-valid",h&&"is-invalid")})});c.displayName="FormControl",t.Z=Object.assign(c,{Feedback:i.Z})},2928:function(e,t,n){var r=n(5271),o=n(6833),a=n(2676);let i=r.forwardRef((e,t)=>{let{controlId:n,as:i="div",...l}=e,s=(0,r.useMemo)(()=>({controlId:n}),[n]);return(0,a.jsx)(o.Z.Provider,{value:s,children:(0,a.jsx)(i,{...l,ref:t})})});i.displayName="FormGroup",t.Z=i},9383:function(e,t,n){var r=n(2187),o=n.n(r),a=n(5271);n(1190);var i=n(5633),l=n(6833),s=n(8849),u=n(2676);let c=a.forwardRef((e,t)=>{let{as:n="label",bsPrefix:r,column:c=!1,visuallyHidden:f=!1,className:d,htmlFor:p,...h}=e,{controlId:m}=(0,a.useContext)(l.Z);r=(0,s.vE)(r,"form-label");let v="col-form-label";"string"==typeof c&&(v="".concat(v," ").concat(v,"-").concat(c));let g=o()(d,r,f&&"visually-hidden",c&&v);return(p=p||m,c)?(0,u.jsx)(i.Z,{ref:t,as:"label",className:g,htmlFor:p,...h}):(0,u.jsx)(n,{ref:t,className:g,htmlFor:p,...h})});c.displayName="FormLabel",t.Z=c},925:function(e,t,n){var r=n(2187),o=n.n(r),a=n(5271),i=n(8849),l=n(6833),s=n(2676);let u=a.forwardRef((e,t)=>{let{bsPrefix:n,size:r,htmlSize:u,className:c,isValid:f=!1,isInvalid:d=!1,id:p,...h}=e,{controlId:m}=(0,a.useContext)(l.Z);return n=(0,i.vE)(n,"form-select"),(0,s.jsx)("select",{...h,size:u,ref:t,className:o()(c,n,r&&"".concat(n,"-").concat(r),f&&"is-valid",d&&"is-invalid"),id:p||m})});u.displayName="FormSelect",t.Z=u},5938:function(e,t,n){n.d(t,{Z:function(){return d}});var r=n(2187),o=n.n(r),a=n(5271),i=n(8849),l=n(1305),s=n(4153),u=n(2676);let c=a.forwardRef((e,t)=>{let{className:n,bsPrefix:r,as:a="span",...l}=e;return r=(0,i.vE)(r,"input-group-text"),(0,u.jsx)(a,{ref:t,className:o()(n,r),...l})});c.displayName="InputGroupText";let f=a.forwardRef((e,t)=>{let{bsPrefix:n,size:r,hasValidation:l,className:c,as:f="div",...d}=e;n=(0,i.vE)(n,"input-group");let p=(0,a.useMemo)(()=>({}),[]);return(0,u.jsx)(s.Z.Provider,{value:p,children:(0,u.jsx)(f,{ref:t,...d,className:o()(c,n,r&&"".concat(n,"-").concat(r),l&&"has-validation")})})});f.displayName="InputGroup";var d=Object.assign(f,{Text:c,Radio:e=>(0,u.jsx)(c,{children:(0,u.jsx)(l.Z,{type:"radio",...e})}),Checkbox:e=>(0,u.jsx)(c,{children:(0,u.jsx)(l.Z,{type:"checkbox",...e})})})},4153:function(e,t,n){let r=n(5271).createContext(null);r.displayName="InputGroupContext",t.Z=r},7855:function(e,t,n){n.d(t,{Z:function(){return C}});var r=n(2187),o=n.n(r);n(9215);var a=n(5271),i=n(5770),l=n(3465),s=n(5434),u=n(1920),c=n(8848),f=n(177),d=n(3778),p=n(8122),h=n(9628),m=n(2676);let v=["as","onSelect","activeKey","role","onKeyDown"],g=()=>{},y=(0,p.PB)("event-key"),b=a.forwardRef((e,t)=>{let n,r,{as:o="div",onSelect:i,activeKey:h,role:b,onKeyDown:x}=e,w=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r=0||(o[n]=e[n]);return o}(e,v),O=(0,s.Z)(),j=(0,a.useRef)(!1),E=(0,a.useContext)(f.Z),Z=(0,a.useContext)(d.Z);Z&&(b=b||"tablist",h=Z.activeKey,n=Z.getControlledId,r=Z.getControllerId);let D=(0,a.useRef)(null),C=e=>{let t=D.current;if(!t)return null;let n=(0,l.Z)(t,`[${y}]:not([aria-disabled=true])`),r=t.querySelector("[aria-selected=true]");if(!r||r!==document.activeElement)return null;let o=n.indexOf(r);if(-1===o)return null;let a=o+e;return a>=n.length&&(a=0),a<0&&(a=n.length-1),n[a]},N=(e,t)=>{null!=e&&(null==i||i(e,t),null==E||E(e,t))};(0,a.useEffect)(()=>{if(D.current&&j.current){let e=D.current.querySelector(`[${y}][aria-selected=true]`);null==e||e.focus()}j.current=!1});let S=(0,u.Z)(t,D);return(0,m.jsx)(f.Z.Provider,{value:N,children:(0,m.jsx)(c.Z.Provider,{value:{role:b,activeKey:(0,f.h)(h),getControlledId:n||g,getControllerId:r||g},children:(0,m.jsx)(o,Object.assign({},w,{onKeyDown:e=>{let t;if(null==x||x(e),Z){switch(e.key){case"ArrowLeft":case"ArrowUp":t=C(-1);break;case"ArrowRight":case"ArrowDown":t=C(1);break;default:return}t&&(e.preventDefault(),N(t.dataset[(0,p.$F)("EventKey")]||null,e),j.current=!0,O())}},ref:S,role:b}))})})});b.displayName="Nav";var x=Object.assign(b,{Item:h.Z}),w=n(8849),O=n(2116);let j=a.createContext(null);j.displayName="CardHeaderContext";var E=n(1913),Z=n(1730);let D=a.forwardRef((e,t)=>{let n,r;let{as:l="div",bsPrefix:s,variant:u,fill:c=!1,justify:f=!1,navbar:d,navbarScroll:p,className:h,activeKey:v,...g}=(0,i.Ch)(e,{activeKey:"onSelect"}),y=(0,w.vE)(s,"nav"),b=!1,E=(0,a.useContext)(O.Z),Z=(0,a.useContext)(j);return E?(n=E.bsPrefix,b=null==d||d):Z&&({cardHeaderBsPrefix:r}=Z),(0,m.jsx)(x,{as:l,ref:t,activeKey:v,className:o()(h,{[y]:!b,["".concat(n,"-nav")]:b,["".concat(n,"-nav-scroll")]:b&&p,["".concat(r,"-").concat(u)]:!!r,["".concat(y,"-").concat(u)]:!!u,["".concat(y,"-fill")]:c,["".concat(y,"-justified")]:f}),...g})});D.displayName="Nav";var C=Object.assign(D,{Item:E.Z,Link:Z.Z})},1913:function(e,t,n){var r=n(5271),o=n(2187),a=n.n(o),i=n(8849),l=n(2676);let s=r.forwardRef((e,t)=>{let{className:n,bsPrefix:r,as:o="div",...s}=e;return r=(0,i.vE)(r,"nav-item"),(0,l.jsx)(o,{ref:t,className:a()(n,r),...s})});s.displayName="NavItem",t.Z=s},1730:function(e,t,n){var r=n(2187),o=n.n(r),a=n(5271),i=n(1900),l=n(9628),s=n(177),u=n(8849),c=n(2676);let f=a.forwardRef((e,t)=>{let{bsPrefix:n,className:r,as:a=i.Z,active:f,eventKey:d,disabled:p=!1,...h}=e;n=(0,u.vE)(n,"nav-link");let[m,v]=(0,l.v)({key:(0,s.h)(d,h.href),active:f,disabled:p,...h});return(0,c.jsx)(a,{...h,...m,ref:t,disabled:p,className:o()(r,n,p&&"disabled",v.isActive&&"active")})});f.displayName="NavLink",t.Z=f},291:function(e,t,n){n.d(t,{Z:function(){return F}});var r=n(6712),o=n(507),a=n.n(o),i=n(5271),l=n(2798);n(1190);var s=n(5770),u=n(1920),c=n(2187),f=n.n(c),d=n(967),p=n(7311),h=n(7200),m=n(2685),v=n(8342),g=n(994),y=n(5116),b=n(7128);let x=()=>{};var w=function(e,t,{disabled:n,clickTrigger:r}={}){let o=t||x;(0,y.Z)(e,o,{disabled:n,clickTrigger:r});let a=(0,g.Z)(e=>{(0,b.k)(e)&&o(e)});(0,i.useEffect)(()=>{if(n||null==e)return;let t=(0,v.Z)((0,y.f)(e)),r=(t.defaultView||window).event,o=(0,m.Z)(t,"keyup",e=>{if(e===r){r=void 0;return}a(e)});return()=>{o()}},[e,n,a])},O=n(8633),j=n(5882),E=n(9458);let Z=i.forwardRef((e,t)=>{let{flip:n,offset:r,placement:o,containerPadding:a,popperConfig:l={},transition:s,runTransition:c}=e,[f,m]=(0,p.Z)(),[v,g]=(0,p.Z)(),y=(0,u.Z)(m,t),b=(0,O.Z)(e.container),x=(0,O.Z)(e.target),[Z,D]=(0,i.useState)(!e.show),C=(0,h.Z)(x,f,(0,j.ZP)({placement:o,enableEvents:!!e.show,containerPadding:a||5,flip:n,offset:r,arrowElement:v,popperConfig:l}));e.show&&Z&&D(!1);let N=e.show||!Z;if(w(f,e.onHide,{disabled:!e.rootClose||e.rootCloseDisabled,clickTrigger:e.rootCloseEvent}),!N)return null;let{onExit:S,onExiting:P,onEnter:k,onEntering:T,onEntered:M}=e,R=e.children(Object.assign({},C.attributes.popper,{style:C.styles.popper,ref:y}),{popper:C,placement:o,show:!!e.show,arrowProps:Object.assign({},C.attributes.arrow,{style:C.styles.arrow,ref:g})});return R=(0,E.sD)(s,c,{in:!!e.show,appear:!0,mountOnEnter:!0,unmountOnExit:!0,children:R,onExit:S,onExiting:P,onExited:(...t)=>{D(!0),e.onExited&&e.onExited(...t)},onEnter:k,onEntering:T,onEntered:M}),b?d.createPortal(R,b):null});Z.displayName="Overlay";var D=n(9125),C=n(9523),N=n(8849),S=n(3459),P=n(3766),k=n(3493),T=n(2676);let M=i.forwardRef((e,t)=>{let{bsPrefix:n,placement:r="right",className:o,style:a,children:i,arrowProps:l,hasDoneInitialMeasure:s,popper:u,show:c,...d}=e;n=(0,N.vE)(n,"tooltip");let p=(0,N.SC)(),[h]=(null==r?void 0:r.split("-"))||[],m=(0,P.z)(h,p),v=a;return c&&!s&&(v={...a,...(0,k.Z)(null==u?void 0:u.strategy)}),(0,T.jsxs)("div",{ref:t,style:v,role:"tooltip","x-placement":h,className:f()(o,n,"bs-tooltip-".concat(m)),...d,children:[(0,T.jsx)("div",{className:"tooltip-arrow",...l}),(0,T.jsx)("div",{className:"".concat(n,"-inner"),children:i})]})});M.displayName="Tooltip";var R=Object.assign(M,{TOOLTIP_OFFSET:[0,6]}),A=n(7615),I=n(142);let L=i.forwardRef((e,t)=>{let{children:n,transition:r=A.Z,popperConfig:o={},rootClose:a=!1,placement:l="top",show:s=!1,...c}=e,d=(0,i.useRef)({}),[p,h]=(0,i.useState)(null),[m,v]=function(e){let t=(0,i.useRef)(null),n=(0,N.vE)(void 0,"popover"),r=(0,N.vE)(void 0,"tooltip"),o=(0,i.useMemo)(()=>({name:"offset",options:{offset:()=>{if(e)return e;if(t.current){if((0,C.Z)(t.current,n))return S.Z.POPPER_OFFSET;if((0,C.Z)(t.current,r))return R.TOOLTIP_OFFSET}return[0,0]}}}),[e,n,r]);return[t,[o]]}(c.offset),y=(0,u.Z)(t,m),b=!0===r?A.Z:r||void 0,x=(0,g.Z)(e=>{h(e),null==o||null==o.onFirstUpdate||o.onFirstUpdate(e)});return(0,D.Z)(()=>{p&&c.target&&(null==d.current.scheduleUpdate||d.current.scheduleUpdate())},[p,c.target]),(0,i.useEffect)(()=>{s||h(null)},[s]),(0,T.jsx)(Z,{...c,ref:y,popperConfig:{...o,modifiers:v.concat(o.modifiers||[]),onFirstUpdate:x},transition:b,rootClose:a,placement:l,show:s,children:(e,t)=>{var a,l;let{arrowProps:s,popper:u,show:c}=t;!function(e,t){let{ref:n}=e,{ref:r}=t;e.ref=n.__wrapped||(n.__wrapped=e=>n((0,I.Z)(e))),t.ref=r.__wrapped||(r.__wrapped=e=>r((0,I.Z)(e)))}(e,s);let h=null==u?void 0:u.placement,m=Object.assign(d.current,{state:null==u?void 0:u.state,scheduleUpdate:null==u?void 0:u.update,placement:h,outOfBoundaries:(null==u?void 0:null==(a=u.state)?void 0:null==(l=a.modifiersData.hide)?void 0:l.isReferenceHidden)||!1,strategy:o.strategy}),v=!!p;return"function"==typeof n?n({...e,placement:h,show:c,...!r&&c&&{className:"show"},popper:m,arrowProps:s,hasDoneInitialMeasure:v}):i.cloneElement(n,{...e,placement:h,arrowProps:s,popper:m,hasDoneInitialMeasure:v,className:f()(n.props.className,!r&&c&&"show"),style:{...n.props.style,...e.style}})}})});function _(e,t,n){let[o]=t,a=o.currentTarget,i=o.relatedTarget||o.nativeEvent[n];i&&i===a||(0,r.Z)(a,i)||e(...t)}L.displayName="Overlay",a().oneOf(["click","hover","focus"]);var F=e=>{let{trigger:t=["hover","focus"],overlay:n,children:r,popperConfig:o={},show:a,defaultShow:c=!1,onToggle:f,delay:d,placement:p,flip:h=p&&-1!==p.indexOf("auto"),...m}=e,v=(0,i.useRef)(null),g=(0,u.Z)(v,r.ref),y=(0,l.Z)(),b=(0,i.useRef)(""),[x,w]=(0,s.$c)(a,c,f),O=d&&"object"==typeof d?d:{show:d,hide:d},{onFocus:j,onBlur:E,onClick:Z}="function"!=typeof r?i.Children.only(r).props:{},D=(0,i.useCallback)(()=>{if(y.clear(),b.current="show",!O.show){w(!0);return}y.set(()=>{"show"===b.current&&w(!0)},O.show)},[O.show,w,y]),C=(0,i.useCallback)(()=>{if(y.clear(),b.current="hide",!O.hide){w(!1);return}y.set(()=>{"hide"===b.current&&w(!1)},O.hide)},[O.hide,w,y]),N=(0,i.useCallback)(function(){for(var e=arguments.length,t=Array(e),n=0;n{g((0,I.Z)(e))}};return -1!==R.indexOf("click")&&(A.onClick=P),-1!==R.indexOf("focus")&&(A.onFocus=N,A.onBlur=S),-1!==R.indexOf("hover")&&(A.onMouseOver=k,A.onMouseOut=M),(0,T.jsxs)(T.Fragment,{children:["function"==typeof r?r(A):(0,i.cloneElement)(r,A),(0,T.jsx)(L,{...m,show:x,onHide:C,flip:h,placement:p,popperConfig:o,target:v.current,children:n})]})}},3459:function(e,t,n){n.d(t,{Z:function(){return d}});var r=n(2187),o=n.n(r),a=n(5271),i=n(8849),l=n(2676);let s=a.forwardRef((e,t)=>{let{className:n,bsPrefix:r,as:a="div",...s}=e;return r=(0,i.vE)(r,"popover-header"),(0,l.jsx)(a,{ref:t,className:o()(n,r),...s})});s.displayName="PopoverHeader";let u=a.forwardRef((e,t)=>{let{className:n,bsPrefix:r,as:a="div",...s}=e;return r=(0,i.vE)(r,"popover-body"),(0,l.jsx)(a,{ref:t,className:o()(n,r),...s})});u.displayName="PopoverBody";var c=n(3766),f=n(3493),d=Object.assign(a.forwardRef((e,t)=>{let{bsPrefix:n,placement:r="right",className:a,style:s,children:d,body:p,arrowProps:h,hasDoneInitialMeasure:m,popper:v,show:g,...y}=e,b=(0,i.vE)(n,"popover"),x=(0,i.SC)(),[w]=(null==r?void 0:r.split("-"))||[],O=(0,c.z)(w,x),j=s;return g&&!m&&(j={...s,...(0,f.Z)(null==v?void 0:v.strategy)}),(0,l.jsxs)("div",{ref:t,role:"tooltip",style:j,"x-placement":w,className:o()(a,b,w&&"bs-popover-".concat(O)),...y,children:[(0,l.jsx)("div",{className:"popover-arrow",...h}),p?(0,l.jsx)(u,{children:d}):d]})}),{Header:s,Body:u,POPPER_OFFSET:[0,8]})},7571:function(e,t,n){var r=n(2187),o=n.n(r),a=n(5271),i=n(8849),l=n(2676);let s=a.forwardRef((e,t)=>{let{bsPrefix:n,className:r,as:a="div",...s}=e,u=(0,i.vE)(n,"row"),c=(0,i.pi)(),f=(0,i.zG)(),d="".concat(u,"-cols"),p=[];return c.forEach(e=>{let t;let n=s[e];delete s[e],null!=n&&"object"==typeof n?{cols:t}=n:t=n,null!=t&&p.push("".concat(d).concat(e!==f?"-".concat(e):"","-").concat(t))}),(0,l.jsx)(a,{ref:t,...s,className:o()(r,u,...p)})});s.displayName="Row",t.Z=s},697:function(e,t,n){var r=n(2187),o=n.n(r),a=n(5271),i=n(8849),l=n(2676);let s=a.forwardRef((e,t)=>{let{bsPrefix:n,variant:r,animation:a="border",size:s,as:u="div",className:c,...f}=e;n=(0,i.vE)(n,"spinner");let d="".concat(n,"-").concat(a);return(0,l.jsx)(u,{ref:t,...f,className:o()(c,d,s&&"".concat(d,"-").concat(s),r&&"text-".concat(r))})});s.displayName="Spinner",t.Z=s},1874:function(e,t,n){n.d(t,{Z:function(){return p}});var r=n(507),o=n.n(r);n(5271);var a=n(3809),i=n(24),l=n(2676);let s=e=>{let{transition:t,...n}=e;return(0,l.jsx)(a.Z,{...n,transition:(0,i.Z)(t)})};s.displayName="TabContainer";var u=n(6623),c=n(3657);let f={eventKey:o().oneOfType([o().string,o().number]),title:o().node.isRequired,disabled:o().bool,tabClassName:o().string,tabAttrs:o().object},d=()=>{throw Error("ReactBootstrap: The `Tab` component is not meant to be rendered! It's an abstract component that is only valid as a direct Child of the `Tabs` Component. For custom tabs components use TabPane and TabsContainer directly")};d.propTypes=f;var p=Object.assign(d,{Container:s,Content:u.Z,Pane:c.Z})},6623:function(e,t,n){var r=n(5271),o=n(2187),a=n.n(o),i=n(8849),l=n(2676);let s=r.forwardRef((e,t)=>{let{className:n,bsPrefix:r,as:o="div",...s}=e;return r=(0,i.vE)(r,"tab-content"),(0,l.jsx)(o,{ref:t,className:a()(n,r),...s})});s.displayName="TabContent",t.Z=s},3657:function(e,t,n){var r=n(2187),o=n.n(r),a=n(5271),i=n(177),l=n(3778),s=n(6162),u=n(8849),c=n(7615),f=n(24),d=n(2676);let p=a.forwardRef((e,t)=>{let{bsPrefix:n,transition:r,...a}=e,[{className:p,as:h="div",...m},{isActive:v,onEnter:g,onEntering:y,onEntered:b,onExit:x,onExiting:w,onExited:O,mountOnEnter:j,unmountOnExit:E,transition:Z=c.Z}]=(0,s.W)({...a,transition:(0,f.Z)(r)}),D=(0,u.vE)(n,"tab-pane");return(0,d.jsx)(l.Z.Provider,{value:null,children:(0,d.jsx)(i.Z.Provider,{value:null,children:(0,d.jsx)(Z,{in:v,onEnter:g,onEntering:y,onEntered:b,onExit:x,onExiting:w,onExited:O,mountOnEnter:j,unmountOnExit:E,children:(0,d.jsx)(h,{...m,ref:t,className:o()(p,D,v&&"active")})})})})});p.displayName="TabPane",t.Z=p},9393:function(e,t,n){n(5271);var r=n(5770),o=n(3809),a=n(7855),i=n(1730),l=n(1913),s=n(6623),u=n(3657),c=n(914),f=n(24),d=n(2676);function p(e){let{title:t,eventKey:n,disabled:r,tabClassName:o,tabAttrs:a,id:s}=e.props;return null==t?null:(0,d.jsx)(l.Z,{as:"li",role:"presentation",children:(0,d.jsx)(i.Z,{as:"button",type:"button",eventKey:n,disabled:r,id:s,className:o,...a,children:t})})}let h=e=>{let t;let{id:n,onSelect:i,transition:l,mountOnEnter:h=!1,unmountOnExit:m=!1,variant:v="tabs",children:g,activeKey:y=((0,c.Ed)(g,e=>{null==t&&(t=e.props.eventKey)}),t),...b}=(0,r.Ch)(e,{activeKey:"onSelect"});return(0,d.jsxs)(o.Z,{id:n,activeKey:y,onSelect:i,transition:(0,f.Z)(l),mountOnEnter:h,unmountOnExit:m,children:[(0,d.jsx)(a.Z,{id:n,...b,role:"tablist",as:"ul",variant:v,children:(0,c.UI)(g,p)}),(0,d.jsx)(s.Z,{children:(0,c.UI)(g,e=>{let t={...e.props};return delete t.title,delete t.disabled,delete t.tabClassName,delete t.tabAttrs,(0,d.jsx)(u.Z,{...t})})})]})};h.displayName="Tabs",t.Z=h},6610:function(e,t,n){n.d(t,{Z:function(){return b}});var r=n(5271),o=n(2187),a=n.n(o),i=n(2798),l=n(9800),s=n(7615),u=n(2676);let c={[l.d0]:"showing",[l.Ix]:"showing show"},f=r.forwardRef((e,t)=>(0,u.jsx)(s.Z,{...e,ref:t,transitionClasses:c}));f.displayName="ToastFade";var d=n(994),p=n(8849),h=n(8462);let m=r.createContext({onClose(){}}),v=r.forwardRef((e,t)=>{let{bsPrefix:n,closeLabel:o="Close",closeVariant:i,closeButton:l=!0,className:s,children:c,...f}=e;n=(0,p.vE)(n,"toast-header");let v=(0,r.useContext)(m),g=(0,d.Z)(e=>{null==v||null==v.onClose||v.onClose(e)});return(0,u.jsxs)("div",{ref:t,...f,className:a()(n,s),children:[c,l&&(0,u.jsx)(h.Z,{"aria-label":o,variant:i,onClick:g,"data-dismiss":"toast"})]})});v.displayName="ToastHeader";let g=r.forwardRef((e,t)=>{let{className:n,bsPrefix:r,as:o="div",...i}=e;return r=(0,p.vE)(r,"toast-body"),(0,u.jsx)(o,{ref:t,className:a()(n,r),...i})});g.displayName="ToastBody";let y=r.forwardRef((e,t)=>{let{bsPrefix:n,className:o,transition:l=f,show:s=!0,animation:c=!0,delay:d=5e3,autohide:h=!1,onClose:v,onEntered:g,onExit:y,onExiting:b,onEnter:x,onEntering:w,onExited:O,bg:j,...E}=e;n=(0,p.vE)(n,"toast");let Z=(0,r.useRef)(d),D=(0,r.useRef)(v);(0,r.useEffect)(()=>{Z.current=d,D.current=v},[d,v]);let C=(0,i.Z)(),N=!!(h&&s),S=(0,r.useCallback)(()=>{N&&(null==D.current||D.current())},[N]);(0,r.useEffect)(()=>{C.set(S,Z.current)},[C,S]);let P=(0,r.useMemo)(()=>({onClose:v}),[v]),k=!!(l&&c),T=(0,u.jsx)("div",{...E,ref:t,className:a()(n,o,j&&"bg-".concat(j),!k&&(s?"show":"hide")),role:"alert","aria-live":"assertive","aria-atomic":"true"});return(0,u.jsx)(m.Provider,{value:P,children:k&&l?(0,u.jsx)(l,{in:s,onEnter:x,onEntering:w,onEntered:g,onExit:y,onExiting:b,onExited:O,unmountOnExit:!0,children:T}):T})});y.displayName="Toast";var b=Object.assign(y,{Body:g,Header:v})},3493:function(e,t,n){n.d(t,{Z:function(){return r}});function r(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"absolute";return{position:e,top:"0",left:"0",opacity:"0",pointerEvents:"none"}}},24:function(e,t,n){n.d(t,{Z:function(){return a}});var r=n(3636),o=n(7615);function a(e){return"boolean"==typeof e?e?o.Z:r.Z:e}},3766:function(e,t,n){function r(e,t){let n=e;return"left"===e?n=t?"end":"start":"right"===e&&(n=t?"start":"end"),n}n.d(t,{z:function(){return r}}),n(5271)},1926:function(e,t,n){function r(e,t){return e}n.d(t,{Z:function(){return r}}),n(3670),n(5271),n(1920)},9215:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){for(var e=arguments.length,t=Array(e),n=0;n>",s=i||r;if(null==n[r])return t?Error("Required "+a+" `"+s+"` was not specified in `"+l+"`."):null;for(var u=arguments.length,c=Array(u>6?u-6:0),f=6;f{if((0,f.default)("Draggable: onDragStart: %j",t),!1===this.props.onStart(e,(0,s.createDraggableData)(this,t)))return!1;this.setState({dragging:!0,dragged:!0})}),m(this,"onDrag",(e,t)=>{if(!this.state.dragging)return!1;(0,f.default)("Draggable: onDrag: %j",t);let n=(0,s.createDraggableData)(this,t),r={x:n.x,y:n.y,slackX:0,slackY:0};if(this.props.bounds){let{x:e,y:t}=r;r.x+=this.state.slackX,r.y+=this.state.slackY;let[o,a]=(0,s.getBoundPosition)(this,r.x,r.y);r.x=o,r.y=a,r.slackX=this.state.slackX+(e-r.x),r.slackY=this.state.slackY+(t-r.y),n.x=r.x,n.y=r.y,n.deltaX=r.x-this.state.x,n.deltaY=r.y-this.state.y}if(!1===this.props.onDrag(e,n))return!1;this.setState(r)}),m(this,"onDragStop",(e,t)=>{if(!this.state.dragging||!1===this.props.onStop(e,(0,s.createDraggableData)(this,t)))return!1;(0,f.default)("Draggable: onDragStop: %j",t);let n={dragging:!1,slackX:0,slackY:0};if(this.props.position){let{x:e,y:t}=this.props.position;n.x=e,n.y=t}this.setState(n)}),this.state={dragging:!1,dragged:!1,x:e.position?e.position.x:e.defaultPosition.x,y:e.position?e.position.y:e.defaultPosition.y,prevPropsPosition:{...e.position},slackX:0,slackY:0,isElementSVG:!1},e.position&&!(e.onDrag||e.onStop)&&console.warn("A `position` was applied to this , without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){void 0!==window.SVGElement&&this.findDOMNode() instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.setState({dragging:!1})}findDOMNode(){var e,t;return null!==(e=null===(t=this.props)||void 0===t||null===(t=t.nodeRef)||void 0===t?void 0:t.current)&&void 0!==e?e:a.default.findDOMNode(this)}render(){let{axis:e,bounds:t,children:n,defaultPosition:o,defaultClassName:a,defaultClassNameDragging:u,defaultClassNameDragged:f,position:d,positionOffset:p,scale:m,...v}=this.props,g={},y=null,b=!d||this.state.dragging,x=d||o,w={x:(0,s.canDragX)(this)&&b?this.state.x:x.x,y:(0,s.canDragY)(this)&&b?this.state.y:x.y};this.state.isElementSVG?y=(0,l.createSVGTransform)(w,p):g=(0,l.createCSSTransform)(w,p);let O=(0,i.default)(n.props.className||"",a,{[u]:this.state.dragging,[f]:this.state.dragged});return r.createElement(c.default,h({},v,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),r.cloneElement(r.Children.only(n),{className:O,style:{...n.props.style,...g},transform:y}))}}t.default=v,m(v,"displayName","Draggable"),m(v,"propTypes",{...c.default.propTypes,axis:o.default.oneOf(["both","x","y","none"]),bounds:o.default.oneOfType([o.default.shape({left:o.default.number,right:o.default.number,top:o.default.number,bottom:o.default.number}),o.default.string,o.default.oneOf([!1])]),defaultClassName:o.default.string,defaultClassNameDragging:o.default.string,defaultClassNameDragged:o.default.string,defaultPosition:o.default.shape({x:o.default.number,y:o.default.number}),positionOffset:o.default.shape({x:o.default.oneOfType([o.default.number,o.default.string]),y:o.default.oneOfType([o.default.number,o.default.string])}),position:o.default.shape({x:o.default.number,y:o.default.number}),className:u.dontSetMe,style:u.dontSetMe,transform:u.dontSetMe}),m(v,"defaultProps",{...c.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})},7322:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=f(void 0);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var i=o?Object.getOwnPropertyDescriptor(e,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}(n(5271)),o=c(n(507)),a=c(n(967)),i=n(2153),l=n(2356),s=n(9035),u=c(n(3544));function c(e){return e&&e.__esModule?e:{default:e}}function f(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(f=function(e){return e?n:t})(e)}function d(e,t,n){var r;return(t="symbol"==typeof(r=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?r:String(r))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let p={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}},h=p.mouse;class m extends r.Component{constructor(){super(...arguments),d(this,"dragging",!1),d(this,"lastX",NaN),d(this,"lastY",NaN),d(this,"touchIdentifier",null),d(this,"mounted",!1),d(this,"handleDragStart",e=>{if(this.props.onMouseDown(e),!this.props.allowAnyClick&&"number"==typeof e.button&&0!==e.button)return!1;let t=this.findDOMNode();if(!t||!t.ownerDocument||!t.ownerDocument.body)throw Error(" not mounted on DragStart!");let{ownerDocument:n}=t;if(this.props.disabled||!(e.target instanceof n.defaultView.Node)||this.props.handle&&!(0,i.matchesSelectorAndParentsTo)(e.target,this.props.handle,t)||this.props.cancel&&(0,i.matchesSelectorAndParentsTo)(e.target,this.props.cancel,t))return;"touchstart"===e.type&&e.preventDefault();let r=(0,i.getTouchIdentifier)(e);this.touchIdentifier=r;let o=(0,l.getControlPosition)(e,r,this);if(null==o)return;let{x:a,y:s}=o,c=(0,l.createCoreData)(this,a,s);(0,u.default)("DraggableCore: handleDragStart: %j",c),(0,u.default)("calling",this.props.onStart),!1!==this.props.onStart(e,c)&&!1!==this.mounted&&(this.props.enableUserSelectHack&&(0,i.addUserSelectStyles)(n),this.dragging=!0,this.lastX=a,this.lastY=s,(0,i.addEvent)(n,h.move,this.handleDrag),(0,i.addEvent)(n,h.stop,this.handleDragStop))}),d(this,"handleDrag",e=>{let t=(0,l.getControlPosition)(e,this.touchIdentifier,this);if(null==t)return;let{x:n,y:r}=t;if(Array.isArray(this.props.grid)){let e=n-this.lastX,t=r-this.lastY;if([e,t]=(0,l.snapToGrid)(this.props.grid,e,t),!e&&!t)return;n=this.lastX+e,r=this.lastY+t}let o=(0,l.createCoreData)(this,n,r);if((0,u.default)("DraggableCore: handleDrag: %j",o),!1===this.props.onDrag(e,o)||!1===this.mounted){try{this.handleDragStop(new MouseEvent("mouseup"))}catch(t){let e=document.createEvent("MouseEvents");e.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(e)}return}this.lastX=n,this.lastY=r}),d(this,"handleDragStop",e=>{if(!this.dragging)return;let t=(0,l.getControlPosition)(e,this.touchIdentifier,this);if(null==t)return;let{x:n,y:r}=t;if(Array.isArray(this.props.grid)){let e=n-this.lastX||0,t=r-this.lastY||0;[e,t]=(0,l.snapToGrid)(this.props.grid,e,t),n=this.lastX+e,r=this.lastY+t}let o=(0,l.createCoreData)(this,n,r);if(!1===this.props.onStop(e,o)||!1===this.mounted)return!1;let a=this.findDOMNode();a&&this.props.enableUserSelectHack&&(0,i.removeUserSelectStyles)(a.ownerDocument),(0,u.default)("DraggableCore: handleDragStop: %j",o),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,a&&((0,u.default)("DraggableCore: Removing handlers"),(0,i.removeEvent)(a.ownerDocument,h.move,this.handleDrag),(0,i.removeEvent)(a.ownerDocument,h.stop,this.handleDragStop))}),d(this,"onMouseDown",e=>(h=p.mouse,this.handleDragStart(e))),d(this,"onMouseUp",e=>(h=p.mouse,this.handleDragStop(e))),d(this,"onTouchStart",e=>(h=p.touch,this.handleDragStart(e))),d(this,"onTouchEnd",e=>(h=p.touch,this.handleDragStop(e)))}componentDidMount(){this.mounted=!0;let e=this.findDOMNode();e&&(0,i.addEvent)(e,p.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;let e=this.findDOMNode();if(e){let{ownerDocument:t}=e;(0,i.removeEvent)(t,p.mouse.move,this.handleDrag),(0,i.removeEvent)(t,p.touch.move,this.handleDrag),(0,i.removeEvent)(t,p.mouse.stop,this.handleDragStop),(0,i.removeEvent)(t,p.touch.stop,this.handleDragStop),(0,i.removeEvent)(e,p.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,i.removeUserSelectStyles)(t)}}findDOMNode(){var e,t;return null!==(e=this.props)&&void 0!==e&&e.nodeRef?null===(t=this.props)||void 0===t||null===(t=t.nodeRef)||void 0===t?void 0:t.current:a.default.findDOMNode(this)}render(){return r.cloneElement(r.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}}t.default=m,d(m,"displayName","DraggableCore"),d(m,"propTypes",{allowAnyClick:o.default.bool,children:o.default.node.isRequired,disabled:o.default.bool,enableUserSelectHack:o.default.bool,offsetParent:function(e,t){if(e[t]&&1!==e[t].nodeType)throw Error("Draggable's offsetParent must be a DOM Node.")},grid:o.default.arrayOf(o.default.number),handle:o.default.string,cancel:o.default.string,nodeRef:o.default.object,onStart:o.default.func,onDrag:o.default.func,onStop:o.default.func,onMouseDown:o.default.func,scale:o.default.number,className:s.dontSetMe,style:s.dontSetMe,transform:s.dontSetMe}),d(m,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1})},4569:function(e,t,n){let{default:r,DraggableCore:o}=n(9661);e.exports=r,e.exports.default=r,e.exports.DraggableCore=o},2153:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.addClassName=u,t.addEvent=function(e,t,n,r){if(!e)return;let o={capture:!0,...r};e.addEventListener?e.addEventListener(t,n,o):e.attachEvent?e.attachEvent("on"+t,n):e["on"+t]=n},t.addUserSelectStyles=function(e){if(!e)return;let t=e.getElementById("react-draggable-style-el");t||((t=e.createElement("style")).type="text/css",t.id="react-draggable-style-el",t.innerHTML=".react-draggable-transparent-selection *::-moz-selection {all: inherit;}\n",t.innerHTML+=".react-draggable-transparent-selection *::selection {all: inherit;}\n",e.getElementsByTagName("head")[0].appendChild(t)),e.body&&u(e.body,"react-draggable-transparent-selection")},t.createCSSTransform=function(e,t){let n=s(e,t,"px");return{[(0,o.browserPrefixToKey)("transform",o.default)]:n}},t.createSVGTransform=function(e,t){return s(e,t,"")},t.getTouch=function(e,t){return e.targetTouches&&(0,r.findInArray)(e.targetTouches,e=>t===e.identifier)||e.changedTouches&&(0,r.findInArray)(e.changedTouches,e=>t===e.identifier)},t.getTouchIdentifier=function(e){return e.targetTouches&&e.targetTouches[0]?e.targetTouches[0].identifier:e.changedTouches&&e.changedTouches[0]?e.changedTouches[0].identifier:void 0},t.getTranslation=s,t.innerHeight=function(e){let t=e.clientHeight,n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,r.int)(n.paddingTop),t-=(0,r.int)(n.paddingBottom)},t.innerWidth=function(e){let t=e.clientWidth,n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,r.int)(n.paddingLeft),t-=(0,r.int)(n.paddingRight)},t.matchesSelector=l,t.matchesSelectorAndParentsTo=function(e,t,n){let r=e;do{if(l(r,t))return!0;if(r===n)break;r=r.parentNode}while(r);return!1},t.offsetXYFromParent=function(e,t,n){let r=t===t.ownerDocument.body?{left:0,top:0}:t.getBoundingClientRect();return{x:(e.clientX+t.scrollLeft-r.left)/n,y:(e.clientY+t.scrollTop-r.top)/n}},t.outerHeight=function(e){let t=e.clientHeight,n=e.ownerDocument.defaultView.getComputedStyle(e);return t+((0,r.int)(n.borderTopWidth)+(0,r.int)(n.borderBottomWidth))},t.outerWidth=function(e){let t=e.clientWidth,n=e.ownerDocument.defaultView.getComputedStyle(e);return t+((0,r.int)(n.borderLeftWidth)+(0,r.int)(n.borderRightWidth))},t.removeClassName=c,t.removeEvent=function(e,t,n,r){if(!e)return;let o={capture:!0,...r};e.removeEventListener?e.removeEventListener(t,n,o):e.detachEvent?e.detachEvent("on"+t,n):e["on"+t]=null},t.removeUserSelectStyles=function(e){if(e)try{if(e.body&&c(e.body,"react-draggable-transparent-selection"),e.selection)e.selection.empty();else{let t=(e.defaultView||window).getSelection();t&&"Caret"!==t.type&&t.removeAllRanges()}}catch(e){}};var r=n(9035),o=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=a(void 0);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var l=o?Object.getOwnPropertyDescriptor(e,i):null;l&&(l.get||l.set)?Object.defineProperty(r,i,l):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}(n(8596));function a(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(a=function(e){return e?n:t})(e)}let i="";function l(e,t){return i||(i=(0,r.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(t){return(0,r.isFunction)(e[t])})),!!(0,r.isFunction)(e[i])&&e[i](t)}function s(e,t,n){let{x:r,y:o}=e,a="translate(".concat(r).concat(n,",").concat(o).concat(n,")");if(t){let e="".concat("string"==typeof t.x?t.x:t.x+n),r="".concat("string"==typeof t.y?t.y:t.y+n);a="translate(".concat(e,", ").concat(r,")")+a}return a}function u(e,t){e.classList?e.classList.add(t):e.className.match(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)")))||(e.className+=" ".concat(t))}function c(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(RegExp("(?:^|\\s)".concat(t,"(?!\\S)"),"g"),"")}},8596:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.browserPrefixToKey=o,t.browserPrefixToStyle=function(e,t){return t?"-".concat(t.toLowerCase(),"-").concat(e):e},t.default=void 0,t.getPrefix=r;let n=["Moz","Webkit","O","ms"];function r(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"transform";if("undefined"==typeof window)return"";let r=null===(e=window.document)||void 0===e||null===(e=e.documentElement)||void 0===e?void 0:e.style;if(!r||t in r)return"";for(let e=0;e: Unmounted during event!");return t}},9035:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.dontSetMe=function(e,t,n){if(e[t])return Error("Invalid prop ".concat(t," passed to ").concat(n," - do not set this, set it on the child."))},t.findInArray=function(e,t){for(let n=0,r=e.length;n{let[t,...r]=e,o=null==n?void 0:n(t,...r);return i(t),o},[n])]}},1190:function(e){e.exports=function(){}},336:function(e,t,n){n.d(t,{gP:function(){return u}});var r=n(5271);let o={prefix:String(Math.round(1e10*Math.random())),current:0},a=r.createContext(o),i=r.createContext(!1),l=!!("undefined"!=typeof window&&window.document&&window.document.createElement),s=new WeakMap,u="function"==typeof r.useId?function(e){let t=r.useId(),[n]=(0,r.useState)("function"==typeof r.useSyncExternalStore?r.useSyncExternalStore(d,c,f):(0,r.useContext)(i)),a=n?"react-aria":`react-aria${o.prefix}`;return e||`${a}-${t}`}:function(e){let t=(0,r.useContext)(a);t!==o||l||console.warn("When server rendering, you must wrap your application in an to ensure consistent ids are generated between the client and server.");let n=function(e=!1){let t=(0,r.useContext)(a),n=(0,r.useRef)(null);if(null===n.current&&!e){var o,i;let e=null===(i=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED)||void 0===i?void 0:null===(o=i.ReactCurrentOwner)||void 0===o?void 0:o.current;if(e){let n=s.get(e);null==n?s.set(e,{id:t.current,state:e.memoizedState}):e.memoizedState!==n.state&&(t.current=n.id,s.delete(e))}n.current=++t.current}return n.current}(!!e),i=`react-aria${t.prefix}`;return e||`${i}-${n}`};function c(){return!1}function f(){return!0}function d(e){return()=>{}}}}]); \ No newline at end of file diff --git a/dist/_next/static/chunks/710-da513b3ac5d39207.js b/dist/_next/static/chunks/710-da513b3ac5d39207.js new file mode 100644 index 00000000..12424b14 --- /dev/null +++ b/dist/_next/static/chunks/710-da513b3ac5d39207.js @@ -0,0 +1,5 @@ +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[710],{50:function(e,t,n){"use strict";var r=n(5271);t.Z=function(e){let t=(0,r.useRef)(e);return(0,r.useEffect)(()=>{t.current=e},[e]),t}},994:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(5271),o=n(50);function i(e){let t=(0,o.Z)(e);return(0,r.useCallback)(function(...e){return t.current&&t.current(...e)},[t])}},9125:function(e,t,n){"use strict";var r=n(5271);let o=void 0!==n.g&&n.g.navigator&&"ReactNative"===n.g.navigator.product,i="undefined"!=typeof document;t.Z=i||o?r.useLayoutEffect:r.useEffect},1920:function(e,t,n){"use strict";var r=n(5271);let o=e=>e&&"function"!=typeof e?t=>{e.current=t}:e;t.Z=function(e,t){return(0,r.useMemo)(()=>(function(e,t){let n=o(e),r=o(t);return e=>{n&&n(e),r&&r(e)}})(e,t),[e,t])}},9761:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(5271);function o(){let e=(0,r.useRef)(!0),t=(0,r.useRef)(()=>e.current);return(0,r.useEffect)(()=>(e.current=!0,()=>{e.current=!1}),[]),t.current}},5965:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(5271);function o(e){let t=(0,r.useRef)(null);return(0,r.useEffect)(()=>{t.current=e}),t.current}},3354:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(5271);function o(e){let t=function(e){let t=(0,r.useRef)(e);return t.current=e,t}(e);(0,r.useEffect)(()=>()=>t.current(),[])}},8122:function(e,t,n){"use strict";function r(e){return`data-rr-ui-${e}`}function o(e){return`rrUi${e}`}n.d(t,{$F:function(){return o},PB:function(){return r}})},9458:function(e,t,n){"use strict";n.d(t,{sD:function(){return m}});var r=n(1920),o=n(994),i=n(9125),a=n(5271),s=n(3636),u=n(7128);let l=["onEnter","onEntering","onEntered","onExit","onExiting","onExited","addEndListener","children"];var c=n(2676);let f=["component"],d=a.forwardRef((e,t)=>{let{component:n}=e,o=function(e){let{onEnter:t,onEntering:n,onEntered:o,onExit:i,onExiting:s,onExited:c,addEndListener:f,children:d}=e,p=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r=0||(o[n]=e[n]);return o}(e,l),{major:m}=(0,u.E)(),h=m>=19?d.props.ref:d.ref,v=(0,a.useRef)(null),g=(0,r.Z)(v,"function"==typeof d?null:h),y=e=>t=>{e&&v.current&&e(v.current,t)},E=(0,a.useCallback)(y(t),[t]),x=(0,a.useCallback)(y(n),[n]),b=(0,a.useCallback)(y(o),[o]),C=(0,a.useCallback)(y(i),[i]),O=(0,a.useCallback)(y(s),[s]),N=(0,a.useCallback)(y(c),[c]),Z=(0,a.useCallback)(y(f),[f]);return Object.assign({},p,{nodeRef:v},t&&{onEnter:E},n&&{onEntering:x},o&&{onEntered:b},i&&{onExit:C},s&&{onExiting:O},c&&{onExited:N},f&&{addEndListener:Z},{children:"function"==typeof d?(e,t)=>d(e,Object.assign({},t,{ref:g})):(0,a.cloneElement)(d,{ref:g})})}(function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r=0||(o[n]=e[n]);return o}(e,f));return(0,c.jsx)(n,Object.assign({ref:t},o))});function p({children:e,in:t,onExited:n,onEntered:s,transition:u}){let[l,c]=(0,a.useState)(!t);t&&l&&c(!1);let f=function({in:e,onTransition:t}){let n=(0,a.useRef)(null),r=(0,a.useRef)(!0),s=(0,o.Z)(t);return(0,i.Z)(()=>{if(!n.current)return;let t=!1;return s({in:e,element:n.current,initial:r.current,isStale:()=>t}),()=>{t=!0}},[e,s]),(0,i.Z)(()=>(r.current=!1,()=>{r.current=!0}),[]),n}({in:!!t,onTransition:e=>{Promise.resolve(u(e)).then(()=>{e.isStale()||(e.in?null==s||s(e.element,e.initial):(c(!0),null==n||n(e.element)))},t=>{throw e.in||c(!0),t})}}),d=(0,r.Z)(f,e.ref);return l&&!t?null:(0,a.cloneElement)(e,{ref:d})}function m(e,t,n){return e?(0,c.jsx)(d,Object.assign({},n,{component:e})):t?(0,c.jsx)(p,Object.assign({},n,{transition:t})):(0,c.jsx)(s.Z,Object.assign({},n))}},3636:function(e,t,n){"use strict";var r=n(994),o=n(1920),i=n(5271);t.Z=function({children:e,in:t,onExited:n,mountOnEnter:a,unmountOnExit:s}){let u=(0,i.useRef)(null),l=(0,i.useRef)(t),c=(0,r.Z)(n);(0,i.useEffect)(()=>{t?l.current=!0:c(u.current)},[t,c]);let f=(0,o.Z)(u,e.ref),d=(0,i.cloneElement)(e,{ref:f});return t?d:s||!l.current&&a?null:d}},177:function(e,t,n){"use strict";n.d(t,{h:function(){return o}});let r=n(5271).createContext(null),o=(e,t=null)=>null!=e?String(e):t||null;t.Z=r},8633:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(8342),o=n(2762),i=n(5271),a=n(2879);let s=(e,t)=>o.Z?null==e?(t||(0,r.Z)()).body:("function"==typeof e&&(e=e()),e&&"current"in e&&(e=e.current),e&&("nodeType"in e||e.getBoundingClientRect))?e:null:null;function u(e,t){let n=(0,a.Z)(),[r,o]=(0,i.useState)(()=>s(e,null==n?void 0:n.document));if(!r){let t=s(e);t&&o(t)}return(0,i.useEffect)(()=>{t&&r&&t(r)},[t,r]),(0,i.useEffect)(()=>{let t=s(e);t!==r&&o(t)},[e,r]),r}},2879:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(5271),o=n(2762);let i=(0,r.createContext)(o.Z?window:void 0);function a(){return(0,r.useContext)(i)}i.Provider},7128:function(e,t,n){"use strict";n.d(t,{E:function(){return i},k:function(){return o}});var r=n(5271);function o(e){return"Escape"===e.code||27===e.keyCode}function i(){let e=r.version.split(".");return{major:+e[0],minor:+e[1],patch:+e[2]}}},2853:function(e,t,n){"use strict";var r=n(2762),o=!1,i=!1;try{var a={get passive(){return o=!0},get once(){return i=o=!0}};r.Z&&(window.addEventListener("test",a,a),window.removeEventListener("test",a,!0))}catch(e){}t.ZP=function(e,t,n,r){if(r&&"boolean"!=typeof r&&!i){var a=r.once,s=r.capture,u=n;!i&&a&&(u=n.__once||function e(r){this.removeEventListener(t,e,s),n.call(this,r)},n.__once=u),e.addEventListener(t,u,o?r:s)}e.addEventListener(t,n,r)}},2762:function(e,t){"use strict";t.Z=!!("undefined"!=typeof window&&window.document&&window.document.createElement)},6712:function(e,t,n){"use strict";function r(e,t){return e.contains?e.contains(t):e.compareDocumentPosition?e===t||!!(16&e.compareDocumentPosition(t)):void 0}n.d(t,{Z:function(){return r}})},968:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(8342),o=/([A-Z])/g,i=/^ms-/;function a(e){return e.replace(o,"-$1").toLowerCase().replace(i,"-ms-")}var s=/^((translate|rotate|scale)(X|Y|Z|3d)?|matrix(3d)?|perspective|skew(X|Y)?)$/i,u=function(e,t){var n,o="",i="";if("string"==typeof t)return e.style.getPropertyValue(a(t))||((n=(0,r.Z)(e))&&n.defaultView||window).getComputedStyle(e,void 0).getPropertyValue(a(t));Object.keys(t).forEach(function(n){var r=t[n];r||0===r?n&&s.test(n)?i+=n+"("+r+") ":o+=a(n)+": "+r+";":e.style.removeProperty(a(n))}),i&&(o+="transform: "+i+";"),e.style.cssText+=";"+o}},9523:function(e,t,n){"use strict";function r(e,t){return e.classList?!!t&&e.classList.contains(t):-1!==(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")}n.d(t,{Z:function(){return r}})},2685:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(2853),o=function(e,t,n,r){var o=r&&"boolean"!=typeof r?r.capture:r;e.removeEventListener(t,n,o),n.__once&&e.removeEventListener(t,n.__once,o)},i=function(e,t,n,i){return(0,r.ZP)(e,t,n,i),function(){o(e,t,n,i)}}},8342:function(e,t,n){"use strict";function r(e){return e&&e.ownerDocument||document}n.d(t,{Z:function(){return r}})},3465:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=Function.prototype.bind.call(Function.prototype.call,[].slice);function o(e,t){return r(e.querySelectorAll(t))}},3670:function(e){"use strict";e.exports=function(e,t,n,r,o,i,a,s){if(!e){var u;if(void 0===t)u=Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[n,r,o,i,a,s],c=0;(u=Error(t.replace(/%s/g,function(){return l[c++]}))).name="Invariant Violation"}throw u.framesToPop=1,u}}},8462:function(e,t,n){"use strict";var r=n(507),o=n.n(r),i=n(5271),a=n(2187),s=n.n(a),u=n(2676);let l={"aria-label":o().string,onClick:o().func,variant:o().oneOf(["white"])},c=i.forwardRef((e,t)=>{let{className:n,variant:r,"aria-label":o="Close",...i}=e;return(0,u.jsx)("button",{ref:t,type:"button",className:s()("btn-close",r&&"btn-close-".concat(r),n),"aria-label":o,...i})});c.displayName="CloseButton",c.propTypes=l,t.Z=c},9725:function(e,t,n){"use strict";n.d(t,{Z:function(){return v}});var r=n(2187),o=n.n(r),i=n(968),a=n(5271),s=n(9800),u=n(4995),l=function(){for(var e=arguments.length,t=Array(e),n=0;nnull!=e).reduce((e,t)=>{if("function"!=typeof t)throw Error("Invalid Argument Type, must only provide functions, undefined, or null.");return null===e?t:function(){for(var n=arguments.length,r=Array(n),o=0;o{let{onEnter:n,onEntering:r,onEntered:i,onExit:s,onExiting:p,className:v,children:g,dimension:y="height",in:E=!1,timeout:x=300,mountOnEnter:b=!1,unmountOnExit:C=!1,appear:O=!1,getDimensionValue:N=m,...Z}=e,k="function"==typeof y?y():y,j=(0,a.useMemo)(()=>l(e=>{e.style[k]="0"},n),[k,n]),w=(0,a.useMemo)(()=>l(e=>{let t="scroll".concat(k[0].toUpperCase()).concat(k.slice(1));e.style[k]="".concat(e[t],"px")},r),[k,r]),R=(0,a.useMemo)(()=>l(e=>{e.style[k]=null},i),[k,i]),S=(0,a.useMemo)(()=>l(e=>{e.style[k]="".concat(N(k,e),"px"),(0,c.Z)(e)},s),[s,N,k]),T=(0,a.useMemo)(()=>l(e=>{e.style[k]=null},p),[k,p]);return(0,d.jsx)(f.Z,{ref:t,addEndListener:u.Z,...Z,"aria-expanded":Z.role?E:null,onEnter:j,onEntering:w,onEntered:R,onExit:S,onExiting:T,childRef:g.ref,in:E,timeout:x,mountOnEnter:b,unmountOnExit:C,appear:O,children:(e,t)=>a.cloneElement(g,{...t,className:o()(v,g.props.className,h[e],"width"===k&&"collapse-horizontal")})})})},3204:function(e,t,n){"use strict";var r=n(2187),o=n.n(r),i=n(5271),a=n(8849),s=n(2676);let u=i.forwardRef((e,t)=>{let{bsPrefix:n,fluid:r=!1,as:i="div",className:u,...l}=e,c=(0,a.vE)(n,"container");return(0,s.jsx)(i,{ref:t,...l,className:o()(u,r?"".concat(c).concat("string"==typeof r?"-".concat(r):"-fluid"):c)})});u.displayName="Container",t.Z=u},7615:function(e,t,n){"use strict";var r=n(2187),o=n.n(r),i=n(5271),a=n(9800),s=n(4995),u=n(1024),l=n(2816),c=n(2676);let f={[a.d0]:"show",[a.cn]:"show"},d=i.forwardRef((e,t)=>{let{className:n,children:r,transitionClasses:a={},onEnter:d,...p}=e,m={in:!1,timeout:300,mountOnEnter:!1,unmountOnExit:!1,appear:!1,...p},h=(0,i.useCallback)((e,t)=>{(0,u.Z)(e),null==d||d(e,t)},[d]);return(0,c.jsx)(l.Z,{ref:t,addEndListener:s.Z,...m,onEnter:h,childRef:r.ref,children:(e,t)=>i.cloneElement(r,{...t,className:o()("fade",n,r.props.className,f[e],a[e])})})});d.displayName="Fade",t.Z=d},9534:function(e,t,n){"use strict";let r,o;n.d(t,{Z:function(){return ep}});var i=n(2187),a=n.n(i),s=n(5271),u=n(177),l=n(5770),c=n(8849),f=n(2676);let d=s.forwardRef((e,t)=>{let{bsPrefix:n,className:r,as:o,...i}=e;n=(0,c.vE)(n,"navbar-brand");let s=o||(i.href?"a":"span");return(0,f.jsx)(s,{...i,ref:t,className:a()(r,n)})});d.displayName="NavbarBrand";var p=n(9725),m=n(2116);let h=s.forwardRef((e,t)=>{let{children:n,bsPrefix:r,...o}=e;r=(0,c.vE)(r,"navbar-collapse");let i=(0,s.useContext)(m.Z);return(0,f.jsx)(p.Z,{in:!!(i&&i.expanded),...o,children:(0,f.jsx)("div",{ref:t,className:r,children:n})})});h.displayName="NavbarCollapse";var v=n(994);let g=s.forwardRef((e,t)=>{let{bsPrefix:n,className:r,children:o,label:i="Toggle navigation",as:u="button",onClick:l,...d}=e;n=(0,c.vE)(n,"navbar-toggler");let{onToggle:p,expanded:h}=(0,s.useContext)(m.Z)||{},g=(0,v.Z)(e=>{l&&l(e),p&&p()});return"button"===u&&(d.type="button"),(0,f.jsx)(u,{...d,ref:t,onClick:g,"aria-label":i,className:a()(r,n,!h&&"collapsed"),children:o||(0,f.jsx)("span",{className:"".concat(n,"-icon")})})});g.displayName="NavbarToggle";var y=n(9125);let E=new WeakMap,x=(e,t)=>{if(!e||!t)return;let n=E.get(t)||new Map;E.set(t,n);let r=n.get(e);return r||((r=t.matchMedia(e)).refCount=0,n.set(r.media,r)),r},b=function(e){let t=Object.keys(e);function n(e,t){return e===t?t:e?`${e} and ${t}`:t}return function(r,o,i){let a;return"object"==typeof r?(a=r,i=o,o=!0):a={[r]:o=o||!0},function(e,t="undefined"==typeof window?void 0:window){let n=x(e,t),[r,o]=(0,s.useState)(()=>!!n&&n.matches);return(0,y.Z)(()=>{let n=x(e,t);if(!n)return o(!1);let r=E.get(t),i=()=>{o(n.matches)};return n.refCount++,n.addListener(i),i(),()=>{n.removeListener(i),n.refCount--,n.refCount<=0&&(null==r||r.delete(n.media)),n=void 0}},[e]),r}((0,s.useMemo)(()=>Object.entries(a).reduce((r,[o,i])=>{if("up"===i||!0===i){let t;r=n(r,("number"==typeof(t=e[o])&&(t=`${t}px`),`(min-width: ${t})`))}if("down"===i||!0===i){let i;r=n(r,(i="number"==typeof(i=e[t[Math.min(t.indexOf(o)+1,t.length-1)]])?`${i-.2}px`:`calc(${i} - 0.2px)`,`(max-width: ${i})`))}return r},""),[JSON.stringify(a)]),i)}}({xs:0,sm:576,md:768,lg:992,xl:1200,xxl:1400});var C=n(8342);function O(e){void 0===e&&(e=(0,C.Z)());try{var t=e.activeElement;if(!t||!t.nodeName)return null;return t}catch(t){return e.body}}var N=n(6712),Z=n(2762),k=n(2685),j=n(967),w=n(9761),R=n(3354),S=n(5965),T=n(968);let L=(0,n(8122).PB)("modal-open");class F{constructor({ownerDocument:e,handleContainerOverflow:t=!0,isRTL:n=!1}={}){this.handleContainerOverflow=t,this.isRTL=n,this.modals=[],this.ownerDocument=e}getScrollbarWidth(){return function(e=document){return Math.abs(e.defaultView.innerWidth-e.documentElement.clientWidth)}(this.ownerDocument)}getElement(){return(this.ownerDocument||document).body}setModalAttributes(e){}removeModalAttributes(e){}setContainerStyle(e){let t={overflow:"hidden"},n=this.isRTL?"paddingLeft":"paddingRight",r=this.getElement();e.style={overflow:r.style.overflow,[n]:r.style[n]},e.scrollBarWidth&&(t[n]=`${parseInt((0,T.Z)(r,n)||"0",10)+e.scrollBarWidth}px`),r.setAttribute(L,""),(0,T.Z)(r,t)}reset(){[...this.modals].forEach(e=>this.remove(e))}removeContainerStyle(e){let t=this.getElement();t.removeAttribute(L),Object.assign(t.style,e.style)}add(e){let t=this.modals.indexOf(e);return -1!==t||(t=this.modals.length,this.modals.push(e),this.setModalAttributes(e),0!==t||(this.state={scrollBarWidth:this.getScrollbarWidth(),style:{}},this.handleContainerOverflow&&this.setContainerStyle(this.state))),t}remove(e){let t=this.modals.indexOf(e);-1!==t&&(this.modals.splice(t,1),!this.modals.length&&this.handleContainerOverflow&&this.removeContainerStyle(this.state),this.removeModalAttributes(e))}isTopModal(e){return!!this.modals.length&&this.modals[this.modals.length-1]===e}}var A=F,P=n(8633),D=n(2879),I=n(9458),M=n(7128);let _=["show","role","className","style","children","backdrop","keyboard","onBackdropClick","onEscapeKeyDown","transition","runTransition","backdropTransition","runBackdropTransition","autoFocus","enforceFocus","restoreFocus","restoreFocusOptions","renderDialog","renderBackdrop","manager","container","onShow","onHide","onExit","onExited","onExiting","onEnter","onEntering","onEntered"],$=(0,s.forwardRef)((e,t)=>{let{show:n=!1,role:o="dialog",className:i,style:a,children:u,backdrop:l=!0,keyboard:c=!0,onBackdropClick:d,onEscapeKeyDown:p,transition:m,runTransition:h,backdropTransition:g,runBackdropTransition:y,autoFocus:E=!0,enforceFocus:x=!0,restoreFocus:b=!0,restoreFocusOptions:C,renderDialog:T,renderBackdrop:L=e=>(0,f.jsx)("div",Object.assign({},e)),manager:F,container:$,onShow:B,onHide:U=()=>{},onExit:W,onExited:V,onExiting:H,onEnter:G,onEntering:X,onEntered:K}=e,Y=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r=0||(o[n]=e[n]);return o}(e,_),q=(0,D.Z)(),z=(0,P.Z)($),J=function(e){let t=(0,D.Z)(),n=e||(r||(r=new A({ownerDocument:null==t?void 0:t.document})),r),o=(0,s.useRef)({dialog:null,backdrop:null});return Object.assign(o.current,{add:()=>n.add(o.current),remove:()=>n.remove(o.current),isTopModal:()=>n.isTopModal(o.current),setDialogRef:(0,s.useCallback)(e=>{o.current.dialog=e},[]),setBackdropRef:(0,s.useCallback)(e=>{o.current.backdrop=e},[])})}(F),Q=(0,w.Z)(),ee=(0,S.Z)(n),[et,en]=(0,s.useState)(!n),er=(0,s.useRef)(null);(0,s.useImperativeHandle)(t,()=>J,[J]),Z.Z&&!ee&&n&&(er.current=O(null==q?void 0:q.document)),n&&et&&en(!1);let eo=(0,v.Z)(()=>{if(J.add(),ec.current=(0,k.Z)(document,"keydown",eu),el.current=(0,k.Z)(document,"focus",()=>setTimeout(ea),!0),B&&B(),E){var e,t;let n=O(null!=(e=null==(t=J.dialog)?void 0:t.ownerDocument)?e:null==q?void 0:q.document);J.dialog&&n&&!(0,N.Z)(J.dialog,n)&&(er.current=n,J.dialog.focus())}}),ei=(0,v.Z)(()=>{if(J.remove(),null==ec.current||ec.current(),null==el.current||el.current(),b){var e;null==(e=er.current)||null==e.focus||e.focus(C),er.current=null}});(0,s.useEffect)(()=>{n&&z&&eo()},[n,z,eo]),(0,s.useEffect)(()=>{et&&ei()},[et,ei]),(0,R.Z)(()=>{ei()});let ea=(0,v.Z)(()=>{if(!x||!Q()||!J.isTopModal())return;let e=O(null==q?void 0:q.document);J.dialog&&e&&!(0,N.Z)(J.dialog,e)&&J.dialog.focus()}),es=(0,v.Z)(e=>{e.target===e.currentTarget&&(null==d||d(e),!0===l&&U())}),eu=(0,v.Z)(e=>{c&&(0,M.k)(e)&&J.isTopModal()&&(null==p||p(e),e.defaultPrevented||U())}),el=(0,s.useRef)(),ec=(0,s.useRef)();if(!z)return null;let ef=Object.assign({role:o,ref:J.setDialogRef,"aria-modal":"dialog"===o||void 0},Y,{style:a,className:i,tabIndex:-1}),ed=T?T(ef):(0,f.jsx)("div",Object.assign({},ef,{children:s.cloneElement(u,{role:"document"})}));ed=(0,I.sD)(m,h,{unmountOnExit:!0,mountOnEnter:!0,appear:!0,in:!!n,onExit:W,onExiting:H,onExited:(...e)=>{en(!0),null==V||V(...e)},onEnter:G,onEntering:X,onEntered:K,children:ed});let ep=null;return l&&(ep=L({ref:J.setBackdropRef,onClick:es}),ep=(0,I.sD)(g,y,{in:!!n,appear:!0,mountOnEnter:!0,unmountOnExit:!0,children:ep})),(0,f.jsx)(f.Fragment,{children:j.createPortal((0,f.jsxs)(f.Fragment,{children:[ep,ed]}),z)})});$.displayName="Modal";var B=Object.assign($,{Manager:A}),U=n(7615);let W=s.forwardRef((e,t)=>{let{className:n,bsPrefix:r,as:o="div",...i}=e;return r=(0,c.vE)(r,"offcanvas-body"),(0,f.jsx)(o,{ref:t,className:a()(n,r),...i})});W.displayName="OffcanvasBody";var V=n(9800),H=n(4995),G=n(2816);let X={[V.d0]:"show",[V.cn]:"show"},K=s.forwardRef((e,t)=>{let{bsPrefix:n,className:r,children:o,in:i=!1,mountOnEnter:u=!1,unmountOnExit:l=!1,appear:d=!1,...p}=e;return n=(0,c.vE)(n,"offcanvas"),(0,f.jsx)(G.Z,{ref:t,addEndListener:H.Z,in:i,mountOnEnter:u,unmountOnExit:l,appear:d,...p,childRef:o.ref,children:(e,t)=>s.cloneElement(o,{...t,className:a()(r,o.props.className,(e===V.d0||e===V.Ix)&&"".concat(n,"-toggling"),X[e])})})});K.displayName="OffcanvasToggling";let Y=s.createContext({onHide(){}});var q=n(8462);let z=s.forwardRef((e,t)=>{let{closeLabel:n="Close",closeVariant:r,closeButton:o=!1,onHide:i,children:a,...u}=e,l=(0,s.useContext)(Y),c=(0,v.Z)(()=>{null==l||l.onHide(),null==i||i()});return(0,f.jsxs)("div",{ref:t,...u,children:[a,o&&(0,f.jsx)(q.Z,{"aria-label":n,variant:r,onClick:c})]})}),J=s.forwardRef((e,t)=>{let{bsPrefix:n,className:r,closeLabel:o="Close",closeButton:i=!1,...s}=e;return n=(0,c.vE)(n,"offcanvas-header"),(0,f.jsx)(z,{ref:t,...s,className:a()(r,n),closeLabel:o,closeButton:i})});J.displayName="OffcanvasHeader";let Q=s.forwardRef((e,t)=>(0,f.jsx)("div",{...e,ref:t,className:a()(e.className,"h5")})),ee=s.forwardRef((e,t)=>{let{className:n,bsPrefix:r,as:o=Q,...i}=e;return r=(0,c.vE)(r,"offcanvas-title"),(0,f.jsx)(o,{ref:t,className:a()(n,r),...i})});ee.displayName="OffcanvasTitle";var et=n(9523),en=n(3465);function er(e,t){return e.replace(RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}let eo={FIXED_CONTENT:".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",STICKY_CONTENT:".sticky-top",NAVBAR_TOGGLER:".navbar-toggler"};class ei extends A{adjustAndStore(e,t,n){let r=t.style[e];t.dataset[e]=r,(0,T.Z)(t,{[e]:"".concat(parseFloat((0,T.Z)(t,e))+n,"px")})}restore(e,t){let n=t.dataset[e];void 0!==n&&(delete t.dataset[e],(0,T.Z)(t,{[e]:n}))}setContainerStyle(e){var t;super.setContainerStyle(e);let n=this.getElement();if(t="modal-open",n.classList?n.classList.add(t):(0,et.Z)(n,t)||("string"==typeof n.className?n.className=n.className+" "+t:n.setAttribute("class",(n.className&&n.className.baseVal||"")+" "+t)),!e.scrollBarWidth)return;let r=this.isRTL?"paddingLeft":"paddingRight",o=this.isRTL?"marginLeft":"marginRight";(0,en.Z)(n,eo.FIXED_CONTENT).forEach(t=>this.adjustAndStore(r,t,e.scrollBarWidth)),(0,en.Z)(n,eo.STICKY_CONTENT).forEach(t=>this.adjustAndStore(o,t,-e.scrollBarWidth)),(0,en.Z)(n,eo.NAVBAR_TOGGLER).forEach(t=>this.adjustAndStore(o,t,e.scrollBarWidth))}removeContainerStyle(e){var t;super.removeContainerStyle(e);let n=this.getElement();t="modal-open",n.classList?n.classList.remove(t):"string"==typeof n.className?n.className=er(n.className,t):n.setAttribute("class",er(n.className&&n.className.baseVal||"",t));let r=this.isRTL?"paddingLeft":"paddingRight",o=this.isRTL?"marginLeft":"marginRight";(0,en.Z)(n,eo.FIXED_CONTENT).forEach(e=>this.restore(r,e)),(0,en.Z)(n,eo.STICKY_CONTENT).forEach(e=>this.restore(o,e)),(0,en.Z)(n,eo.NAVBAR_TOGGLER).forEach(e=>this.restore(o,e))}}function ea(e){return(0,f.jsx)(K,{...e})}function es(e){return(0,f.jsx)(U.Z,{...e})}let eu=s.forwardRef((e,t)=>{let{bsPrefix:n,className:r,children:i,"aria-labelledby":u,placement:l="start",responsive:d,show:p=!1,backdrop:h=!0,keyboard:g=!0,scroll:y=!1,onEscapeKeyDown:E,onShow:x,onHide:C,container:O,autoFocus:N=!0,enforceFocus:Z=!0,restoreFocus:k=!0,restoreFocusOptions:j,onEntered:w,onExit:R,onExiting:S,onEnter:T,onEntering:L,onExited:F,backdropClassName:A,manager:P,renderStaticNode:D=!1,...I}=e,M=(0,s.useRef)();n=(0,c.vE)(n,"offcanvas");let{onToggle:_}=(0,s.useContext)(m.Z)||{},[$,U]=(0,s.useState)(!1),W=b(d||"xs","up");(0,s.useEffect)(()=>{U(d?p&&!W:p)},[p,d,W]);let V=(0,v.Z)(()=>{null==_||_(),null==C||C()}),H=(0,s.useMemo)(()=>({onHide:V}),[V]),G=(0,s.useCallback)(e=>(0,f.jsx)("div",{...e,className:a()("".concat(n,"-backdrop"),A)}),[A,n]),X=e=>(0,f.jsx)("div",{...e,...I,className:a()(r,d?"".concat(n,"-").concat(d):n,"".concat(n,"-").concat(l)),"aria-labelledby":u,children:i});return(0,f.jsxs)(f.Fragment,{children:[!$&&(d||D)&&X({}),(0,f.jsx)(Y.Provider,{value:H,children:(0,f.jsx)(B,{show:$,ref:t,backdrop:h,container:O,keyboard:g,autoFocus:N,enforceFocus:Z&&!y,restoreFocus:k,restoreFocusOptions:j,onEscapeKeyDown:E,onShow:x,onHide:V,onEnter:function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r1?t-1:0),r=1;r{let n=(0,s.useContext)(m.Z);return(0,f.jsx)(el,{ref:t,show:!!(null!=n&&n.expanded),...e,renderStaticNode:!0})});ec.displayName="NavbarOffcanvas";let ef=s.forwardRef((e,t)=>{let{className:n,bsPrefix:r,as:o="span",...i}=e;return r=(0,c.vE)(r,"navbar-text"),(0,f.jsx)(o,{ref:t,className:a()(n,r),...i})});ef.displayName="NavbarText";let ed=s.forwardRef((e,t)=>{let{bsPrefix:n,expand:r=!0,variant:o="light",bg:i,fixed:d,sticky:p,className:h,as:v="nav",expanded:g,onToggle:y,onSelect:E,collapseOnSelect:x=!1,...b}=(0,l.Ch)(e,{expanded:"onToggle"}),C=(0,c.vE)(n,"navbar"),O=(0,s.useCallback)(function(){for(var e=arguments.length,t=Array(e),n=0;n({onToggle:()=>null==y?void 0:y(!g),bsPrefix:C,expanded:!!g,expand:r}),[C,g,r,y]);return(0,f.jsx)(m.Z.Provider,{value:Z,children:(0,f.jsx)(u.Z.Provider,{value:O,children:(0,f.jsx)(v,{ref:t,...b,className:a()(h,C,r&&N,o&&"".concat(C,"-").concat(o),i&&"bg-".concat(i),p&&"sticky-".concat(p),d&&"fixed-".concat(d))})})})});ed.displayName="Navbar";var ep=Object.assign(ed,{Brand:d,Collapse:h,Offcanvas:ec,Text:ef,Toggle:g})},2116:function(e,t,n){"use strict";let r=n(5271).createContext(null);r.displayName="NavbarContext",t.Z=r},8849:function(e,t,n){"use strict";n.d(t,{SC:function(){return c},pi:function(){return u},vE:function(){return s},zG:function(){return l}});var r=n(5271);n(2676);let o=r.createContext({prefixes:{},breakpoints:["xxl","xl","lg","md","sm","xs"],minBreakpoint:"xs"}),{Consumer:i,Provider:a}=o;function s(e,t){let{prefixes:n}=(0,r.useContext)(o);return e||n[t]||t}function u(){let{breakpoints:e}=(0,r.useContext)(o);return e}function l(){let{minBreakpoint:e}=(0,r.useContext)(o);return e}function c(){let{dir:e}=(0,r.useContext)(o);return"rtl"===e}},2816:function(e,t,n){"use strict";var r=n(5271),o=n(9800),i=n(1920),a=n(142),s=n(2676);let u=r.forwardRef((e,t)=>{let{onEnter:n,onEntering:u,onEntered:l,onExit:c,onExiting:f,onExited:d,addEndListener:p,children:m,childRef:h,...v}=e,g=(0,r.useRef)(null),y=(0,i.Z)(g,h),E=e=>{y((0,a.Z)(e))},x=e=>t=>{e&&g.current&&e(g.current,t)},b=(0,r.useCallback)(x(n),[n]),C=(0,r.useCallback)(x(u),[u]),O=(0,r.useCallback)(x(l),[l]),N=(0,r.useCallback)(x(c),[c]),Z=(0,r.useCallback)(x(f),[f]),k=(0,r.useCallback)(x(d),[d]),j=(0,r.useCallback)(x(p),[p]);return(0,s.jsx)(o.ZP,{ref:t,...v,onEnter:b,onEntered:O,onEntering:C,onExit:N,onExited:k,onExiting:Z,addEndListener:j,nodeRef:g,children:"function"==typeof m?(e,t)=>m(e,{...t,ref:E}):r.cloneElement(m,{ref:E})})});t.Z=u},142:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(967);function o(e){return e&&"setState"in e?r.findDOMNode(e):null!=e?e:null}},4995:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(968),o=n(2685);function i(e,t){let n=(0,r.Z)(e,t)||"",o=-1===n.indexOf("ms")?1e3:1;return parseFloat(n)*o}function a(e,t){var n,a,s,u,l,c,f,d,p,m,h,v;let g=i(e,"transitionDuration"),y=i(e,"transitionDelay"),E=(n=e,a=n=>{n.target===e&&(E(),t(n))},null==(s=g+y)&&(c=-1===(l=(0,r.Z)(n,"transitionDuration")||"").indexOf("ms")?1e3:1,s=parseFloat(l)*c||0),h=(d=!1,p=setTimeout(function(){d||function(e,t,n,r){if(void 0===n&&(n=!1),void 0===r&&(r=!0),e){var o=document.createEvent("HTMLEvents");o.initEvent(t,n,r),e.dispatchEvent(o)}}(n,"transitionend",!0)},s+5),m=(0,o.Z)(n,"transitionend",function(){d=!0},{once:!0}),function(){clearTimeout(p),m()}),v=(0,o.Z)(n,"transitionend",a),function(){h(),v()})}},1024:function(e,t,n){"use strict";function r(e){e.offsetHeight}n.d(t,{Z:function(){return r}})},3399:function(e,t,n){e.exports=n(5030)},4049:function(e,t,n){"use strict";var r=n(6257);function o(){}function i(){}i.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,i,a){if(a!==r){var s=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:o};return n.PropTypes=n,n}},507:function(e,t,n){e.exports=n(4049)()},6257:function(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},9800:function(e,t,n){"use strict";n.d(t,{cn:function(){return d},d0:function(){return f},Wj:function(){return c},Ix:function(){return p},ZP:function(){return v}});var r=n(4139);function o(e,t){return(o=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}var i=n(5271),a=n(967),s={disabled:!1},u=i.createContext(null),l="unmounted",c="exited",f="entering",d="entered",p="exiting",m=function(e){function t(t,n){r=e.call(this,t,n)||this;var r,o,i=n&&!n.isMounting?t.enter:t.appear;return r.appearStatus=null,t.in?i?(o=c,r.appearStatus=f):o=d:o=t.unmountOnExit||t.mountOnEnter?l:c,r.state={status:o},r.nextCallback=null,r}t.prototype=Object.create(e.prototype),t.prototype.constructor=t,o(t,e),t.getDerivedStateFromProps=function(e,t){return e.in&&t.status===l?{status:c}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(e){var t=null;if(e!==this.props){var n=this.state.status;this.props.in?n!==f&&n!==d&&(t=f):(n===f||n===d)&&(t=p)}this.updateStatus(!1,t)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var e,t,n,r=this.props.timeout;return e=t=n=r,null!=r&&"number"!=typeof r&&(e=r.exit,t=r.enter,n=void 0!==r.appear?r.appear:t),{exit:e,enter:t,appear:n}},n.updateStatus=function(e,t){if(void 0===e&&(e=!1),null!==t){if(this.cancelNextCallback(),t===f){if(this.props.unmountOnExit||this.props.mountOnEnter){var n=this.props.nodeRef?this.props.nodeRef.current:a.findDOMNode(this);n&&n.scrollTop}this.performEnter(e)}else this.performExit()}else this.props.unmountOnExit&&this.state.status===c&&this.setState({status:l})},n.performEnter=function(e){var t=this,n=this.props.enter,r=this.context?this.context.isMounting:e,o=this.props.nodeRef?[r]:[a.findDOMNode(this),r],i=o[0],u=o[1],l=this.getTimeouts(),c=r?l.appear:l.enter;if(!e&&!n||s.disabled){this.safeSetState({status:d},function(){t.props.onEntered(i)});return}this.props.onEnter(i,u),this.safeSetState({status:f},function(){t.props.onEntering(i,u),t.onTransitionEnd(c,function(){t.safeSetState({status:d},function(){t.props.onEntered(i,u)})})})},n.performExit=function(){var e=this,t=this.props.exit,n=this.getTimeouts(),r=this.props.nodeRef?void 0:a.findDOMNode(this);if(!t||s.disabled){this.safeSetState({status:c},function(){e.props.onExited(r)});return}this.props.onExit(r),this.safeSetState({status:p},function(){e.props.onExiting(r),e.onTransitionEnd(n.exit,function(){e.safeSetState({status:c},function(){e.props.onExited(r)})})})},n.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},n.setNextCallback=function(e){var t=this,n=!0;return this.nextCallback=function(r){n&&(n=!1,t.nextCallback=null,e(r))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},n.onTransitionEnd=function(e,t){this.setNextCallback(t);var n=this.props.nodeRef?this.props.nodeRef.current:a.findDOMNode(this),r=null==e&&!this.props.addEndListener;if(!n||r){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var o=this.props.nodeRef?[this.nextCallback]:[n,this.nextCallback],i=o[0],s=o[1];this.props.addEndListener(i,s)}null!=e&&setTimeout(this.nextCallback,e)},n.render=function(){var e=this.state.status;if(e===l)return null;var t=this.props,n=t.children,o=(t.in,t.mountOnEnter,t.unmountOnExit,t.appear,t.enter,t.exit,t.timeout,t.addEndListener,t.onEnter,t.onEntering,t.onEntered,t.onExit,t.onExiting,t.onExited,t.nodeRef,(0,r.Z)(t,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]));return i.createElement(u.Provider,{value:null},"function"==typeof n?n(e,o):i.cloneElement(i.Children.only(n),o))},t}(i.Component);function h(){}m.contextType=u,m.propTypes={},m.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:h,onEntering:h,onEntered:h,onExit:h,onExiting:h,onExited:h},m.UNMOUNTED=l,m.EXITED=c,m.ENTERING=f,m.ENTERED=d,m.EXITING=p;var v=m},5770:function(e,t,n){"use strict";function r(){return(r=Object.assign?Object.assign.bind():function(e){for(var t=1;t1?t-1:0),o=1;o=0)continue;n[r]=e[r]}return n}n.d(t,{Z:function(){return r}})},2598:function(e,t,n){"use strict";n.d(t,{Z:function(){return O}});var r={};n.r(r),n.d(r,{exclude:function(){return C},extract:function(){return v},parse:function(){return g},parseUrl:function(){return E},pick:function(){return b},stringify:function(){return y},stringifyUrl:function(){return x}});let o="%[a-f0-9]{2}",i=RegExp("("+o+")|([^%]+?)","gi"),a=RegExp("("+o+")+","gi");function s(e,t){if(!("string"==typeof e&&"string"==typeof t))throw TypeError("Expected the arguments to be of type `string`");if(""===e||""===t)return[];let n=e.indexOf(t);return -1===n?[]:[e.slice(0,n),e.slice(n+t.length)]}let u=e=>null==e,l=e=>encodeURIComponent(e).replaceAll(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),c=Symbol("encodeFragmentIdentifier");function f(e){if("string"!=typeof e||1!==e.length)throw TypeError("arrayFormatSeparator must be single character string")}function d(e,t){return t.encode?t.strict?l(e):encodeURIComponent(e):e}function p(e,t){return t.decode?function(e){if("string"!=typeof e)throw TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return decodeURIComponent(e)}catch{return function(e){let t={"%FE%FF":"��","%FF%FE":"��"},n=a.exec(e);for(;n;){try{t[n[0]]=decodeURIComponent(n[0])}catch{let e=function(e){try{return decodeURIComponent(e)}catch{let t=e.match(i)||[];for(let n=1;n{if(t=/\[(\d*)]$/.exec(e),e=e.replace(/\[\d*]$/,""),!t){r[e]=n;return}void 0===r[e]&&(r[e]={}),r[e][t[1]]=n};case"bracket":return(e,n,r)=>{if(t=/(\[])$/.exec(e),e=e.replace(/\[]$/,""),!t){r[e]=n;return}if(void 0===r[e]){r[e]=[n];return}r[e]=[...r[e],n]};case"colon-list-separator":return(e,n,r)=>{if(t=/(:list)$/.exec(e),e=e.replace(/:list$/,""),!t){r[e]=n;return}if(void 0===r[e]){r[e]=[n];return}r[e]=[...r[e],n]};case"comma":case"separator":return(t,n,r)=>{let o="string"==typeof n&&n.includes(e.arrayFormatSeparator),i="string"==typeof n&&!o&&p(n,e).includes(e.arrayFormatSeparator);n=i?p(n,e):n;let a=o||i?n.split(e.arrayFormatSeparator).map(t=>p(t,e)):null===n?n:p(n,e);r[t]=a};case"bracket-separator":return(t,n,r)=>{let o=/(\[])$/.test(t);if(t=t.replace(/\[]$/,""),!o){r[t]=n?p(n,e):n;return}let i=null===n?[]:n.split(e.arrayFormatSeparator).map(t=>p(t,e));if(void 0===r[t]){r[t]=i;return}r[t]=[...r[t],...i]};default:return(e,t,n)=>{if(void 0===n[e]){n[e]=t;return}n[e]=[...[n[e]].flat(),t]}}}(t),r=Object.create(null);if("string"!=typeof e||!(e=e.trim().replace(/^[?#&]/,"")))return r;for(let o of e.split("&")){if(""===o)continue;let e=t.decode?o.replaceAll("+"," "):o,[i,a]=s(e,"=");void 0===i&&(i=e),a=void 0===a?null:["comma","separator","bracket-separator"].includes(t.arrayFormat)?a:p(a,t),n(p(i,t),a,r)}for(let[e,n]of Object.entries(r))if("object"==typeof n&&null!==n)for(let[e,r]of Object.entries(n))n[e]=h(r,t);else r[e]=h(n,t);return!1===t.sort?r:(!0===t.sort?Object.keys(r).sort():Object.keys(r).sort(t.sort)).reduce((e,t)=>{let n=r[t];return e[t]=n&&"object"==typeof n&&!Array.isArray(n)?function e(t){return Array.isArray(t)?t.sort():"object"==typeof t?e(Object.keys(t)).sort((e,t)=>Number(e)-Number(t)).map(e=>t[e]):t}(n):n,e},Object.create(null))}function y(e,t){if(!e)return"";f((t={encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:",",...t}).arrayFormatSeparator);let n=n=>t.skipNull&&u(e[n])||t.skipEmptyString&&""===e[n],r=function(e){switch(e.arrayFormat){case"index":return t=>(n,r)=>{let o=n.length;return void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,[d(t,e),"[",o,"]"].join("")]:[...n,[d(t,e),"[",d(o,e),"]=",d(r,e)].join("")]};case"bracket":return t=>(n,r)=>void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,[d(t,e),"[]"].join("")]:[...n,[d(t,e),"[]=",d(r,e)].join("")];case"colon-list-separator":return t=>(n,r)=>void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,[d(t,e),":list="].join("")]:[...n,[d(t,e),":list=",d(r,e)].join("")];case"comma":case"separator":case"bracket-separator":{let t="bracket-separator"===e.arrayFormat?"[]=":"=";return n=>(r,o)=>void 0===o||e.skipNull&&null===o||e.skipEmptyString&&""===o?r:(o=null===o?"":o,0===r.length)?[[d(n,e),t,d(o,e)].join("")]:[[r,d(o,e)].join(e.arrayFormatSeparator)]}default:return t=>(n,r)=>void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,d(t,e)]:[...n,[d(t,e),"=",d(r,e)].join("")]}}(t),o={};for(let[t,r]of Object.entries(e))n(t)||(o[t]=r);let i=Object.keys(o);return!1!==t.sort&&i.sort(t.sort),i.map(n=>{let o=e[n];return void 0===o?"":null===o?d(n,t):Array.isArray(o)?0===o.length&&"bracket-separator"===t.arrayFormat?d(n,t)+"[]":o.reduce(r(n),[]).join("&"):d(n,t)+"="+d(o,t)}).filter(e=>e.length>0).join("&")}function E(e,t){t={decode:!0,...t};let[n,r]=s(e,"#");return void 0===n&&(n=e),{url:n?.split("?")?.[0]??"",query:g(v(e),t),...t&&t.parseFragmentIdentifier&&r?{fragmentIdentifier:p(r,t)}:{}}}function x(e,t){t={encode:!0,strict:!0,[c]:!0,...t};let n=m(e.url).split("?")[0]||"",r=y({...g(v(e.url),{sort:!1}),...e.query},t);r&&=`?${r}`;let o=function(e){let t="",n=e.indexOf("#");return -1!==n&&(t=e.slice(n)),t}(e.url);if("string"==typeof e.fragmentIdentifier){let r=new URL(n);r.hash=e.fragmentIdentifier,o=t[c]?r.hash:`#${e.fragmentIdentifier}`}return`${n}${r}${o}`}function b(e,t,n){let{url:r,query:o,fragmentIdentifier:i}=E(e,n={parseFragmentIdentifier:!0,[c]:!1,...n});return x({url:r,query:function(e,t){let n={};if(Array.isArray(t))for(let r of t){let t=Object.getOwnPropertyDescriptor(e,r);t?.enumerable&&Object.defineProperty(n,r,t)}else for(let r of Reflect.ownKeys(e)){let o=Object.getOwnPropertyDescriptor(e,r);if(o.enumerable){let i=e[r];t(r,i,e)&&Object.defineProperty(n,r,o)}}return n}(o,t),fragmentIdentifier:i},n)}function C(e,t,n){return b(e,Array.isArray(t)?e=>!t.includes(e):(e,n)=>!t(e,n),n)}var O=r}}]); \ No newline at end of file diff --git a/dist/_next/static/chunks/782e517e-9b59eaf587f42fc7.js b/dist/_next/static/chunks/782e517e-9b59eaf587f42fc7.js new file mode 100644 index 00000000..f35b0738 --- /dev/null +++ b/dist/_next/static/chunks/782e517e-9b59eaf587f42fc7.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[518],{3708:function(e,t,n){var r,l=n(4529),a=n(294),o={usingClientEntryPoint:!1,Events:null,Dispatcher:{current:null}};function i(e){var t="https://react.dev/errors/"+e;if(1p||(e.current=d[p],d[p]=null,p--)}function g(e,t){d[++p]=e.current,e.current=t}var y=Symbol.for("react.element"),v=Symbol.for("react.portal"),b=Symbol.for("react.fragment"),k=Symbol.for("react.strict_mode"),w=Symbol.for("react.profiler"),S=Symbol.for("react.provider"),C=Symbol.for("react.consumer"),E=Symbol.for("react.context"),x=Symbol.for("react.forward_ref"),z=Symbol.for("react.suspense"),P=Symbol.for("react.suspense_list"),N=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),L=Symbol.for("react.scope");Symbol.for("react.debug_trace_mode");var T=Symbol.for("react.offscreen"),F=Symbol.for("react.legacy_hidden"),M=Symbol.for("react.cache");Symbol.for("react.tracing_marker");var O=Symbol.iterator;function R(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=O&&e[O]||e["@@iterator"])?e:null}var D=m(null),A=m(null),I=m(null),U=m(null),B={$$typeof:E,_currentValue:null,_currentValue2:null,_threadCount:0,Provider:null,Consumer:null};function V(e,t){switch(g(I,t),g(A,e),g(D,null),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)&&(t=t.namespaceURI)?s2(t):0;break;default:if(t=(e=8===e?t.parentNode:t).tagName,e=e.namespaceURI)t=s3(e=s2(e),t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}h(D),g(D,t)}function Q(){h(D),h(A),h(I)}function $(e){null!==e.memoizedState&&g(U,e);var t=D.current,n=s3(t,e.type);t!==n&&(g(A,e),g(D,n))}function j(e){A.current===e&&(h(D),h(A)),U.current===e&&(h(U),B._currentValue=null)}var W=a.unstable_scheduleCallback,H=a.unstable_cancelCallback,q=a.unstable_shouldYield,K=a.unstable_requestPaint,Y=a.unstable_now,X=a.unstable_getCurrentPriorityLevel,G=a.unstable_ImmediatePriority,Z=a.unstable_UserBlockingPriority,J=a.unstable_NormalPriority,ee=a.unstable_LowPriority,et=a.unstable_IdlePriority,en=a.log,er=a.unstable_setDisableYieldValue,el=null,ea=null;function eo(e){if("function"==typeof en&&er(e),ea&&"function"==typeof ea.setStrictMode)try{ea.setStrictMode(el,e)}catch(e){}}var ei=Math.clz32?Math.clz32:function(e){return 0==(e>>>=0)?32:31-(eu(e)/es|0)|0},eu=Math.log,es=Math.LN2,ec=128,ef=4194304;function ed(e){var t=42&e;if(0!==t)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return 4194176&e;case 4194304:case 8388608:case 16777216:case 33554432:return 62914560&e;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function ep(e,t){var n=e.pendingLanes;if(0===n)return 0;var r=0,l=e.suspendedLanes;e=e.pingedLanes;var a=134217727&n;return 0!==a?0!=(n=a&~l)?r=ed(n):0!=(e&=a)&&(r=ed(e)):0!=(n&=~l)?r=ed(n):0!==e&&(r=ed(e)),0===r?0:0!==t&&t!==r&&0==(t&l)&&((l=r&-r)>=(e=t&-t)||32===l&&0!=(4194176&e))?t:r}function em(e,t){return e.errorRecoveryDisabledLanes&t?0:0!=(e=-536870913&e.pendingLanes)?e:536870912&e?536870912:0}function eh(){var e=ec;return 0==(4194176&(ec<<=1))&&(ec=128),e}function eg(){var e=ef;return 0==(62914560&(ef<<=1))&&(ef=4194304),e}function ey(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function ev(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-ei(t);e.entangledLanes|=t,e.entanglements[r]=1073741824|e.entanglements[r]|4194218&n}function eb(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-ei(n),l=1<l||u[r]!==s[l]){var c="\n"+u[r].replace(" at new "," at ");return e.displayName&&c.includes("")&&(c=c.replace("",e.displayName)),c}while(1<=r&&0<=l);break}}}finally{eG=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?eX(n):""}function eJ(e){try{var t="";do t+=function(e){switch(e.tag){case 26:case 27:case 5:return eX(e.type);case 16:return eX("Lazy");case 13:return eX("Suspense");case 19:return eX("SuspenseList");case 0:case 2:case 15:return e=eZ(e.type,!1);case 11:return e=eZ(e.type.render,!1);case 1:return e=eZ(e.type,!0);default:return""}}(e),e=e.return;while(e);return t}catch(e){return"\nError generating stack: "+e.message+"\n"+e.stack}}var e0=Symbol.for("react.client.reference");function e1(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":case"object":return e;default:return""}}function e2(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function e3(e){e._valueTracker||(e._valueTracker=function(e){var t=e2(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&void 0!==n&&"function"==typeof n.get&&"function"==typeof n.set){var l=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(e){r=""+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function e4(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=e2(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)}function e6(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}var e8=/[\n"\\]/g;function e5(e){return e.replace(e8,function(e){return"\\"+e.charCodeAt(0).toString(16)+" "})}function e7(e,t,n,r,l,a,o,i){e.name="",null!=o&&"function"!=typeof o&&"symbol"!=typeof o&&"boolean"!=typeof o?e.type=o:e.removeAttribute("type"),null!=t?"number"===o?(0===t&&""===e.value||e.value!=t)&&(e.value=""+e1(t)):e.value!==""+e1(t)&&(e.value=""+e1(t)):"submit"!==o&&"reset"!==o||e.removeAttribute("value"),null!=t?te(e,o,e1(t)):null!=n?te(e,o,e1(n)):null!=r&&e.removeAttribute("value"),null==l&&null!=a&&(e.defaultChecked=!!a),null!=l&&(e.checked=l&&"function"!=typeof l&&"symbol"!=typeof l),null!=i&&"function"!=typeof i&&"symbol"!=typeof i&&"boolean"!=typeof i?e.name=""+e1(i):e.removeAttribute("name")}function e9(e,t,n,r,l,a,o,i){if(null!=a&&"function"!=typeof a&&"symbol"!=typeof a&&"boolean"!=typeof a&&(e.type=a),null!=t||null!=n){if(!("submit"!==a&&"reset"!==a||null!=t))return;n=null!=n?""+e1(n):"",t=null!=t?""+e1(t):n,i||t===e.value||(e.value=t),e.defaultValue=t}r="function"!=typeof(r=null!=r?r:l)&&"symbol"!=typeof r&&!!r,e.checked=i?e.checked:!!r,e.defaultChecked=!!r,null!=o&&"function"!=typeof o&&"symbol"!=typeof o&&"boolean"!=typeof o&&(e.name=o)}function te(e,t,n){"number"===t&&e6(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}var tt=Array.isArray;function tn(e,t,n,r){if(e=e.options,t){t={};for(var l=0;l"+t.valueOf().toString()+"",t=iX.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}}var to=ta;"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction&&(to=function(e,t){return MSApp.execUnsafeLocalFunction(function(){return ta(e,t)})});var ti=to;function tu(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType){n.nodeValue=t;return}}e.textContent=t}var ts=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function tc(e,t,n){var r=0===t.indexOf("--");null==n||"boolean"==typeof n||""===n?r?e.setProperty(t,""):"float"===t?e.cssFloat="":e[t]="":r?e.setProperty(t,n):"number"!=typeof n||0===n||ts.has(t)?"float"===t?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function tf(e,t,n){if(null!=t&&"object"!=typeof t)throw Error(i(62));if(e=e.style,null!=n){for(var r in n)!n.hasOwnProperty(r)||null!=t&&t.hasOwnProperty(r)||(0===r.indexOf("--")?e.setProperty(r,""):"float"===r?e.cssFloat="":e[r]="");for(var l in t)r=t[l],t.hasOwnProperty(l)&&n[l]!==r&&tc(e,l,r)}else for(var a in t)t.hasOwnProperty(a)&&tc(e,a,t[a])}function td(e){if(-1===e.indexOf("-"))return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var tp=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),tm=null;function th(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var tg=null,ty=null;function tv(e){var t=eO(e);if(t&&(e=t.stateNode)){var n=eD(e);switch(e=t.stateNode,t.type){case"input":if(e7(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,"radio"===n.type&&null!=t){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+e5(""+t)+'"][type="radio"]'),t=0;t>=o,l-=o,tj=1<<32-ei(t)+l|n<h?(g=f,f=null):g=f.sibling;var y=p(l,f,i[h],u);if(null===y){null===f&&(f=g);break}e&&f&&null===y.alternate&&t(l,f),o=a(y,o,h),null===c?s=y:c.sibling=y,c=y,f=g}if(h===i.length)return n(l,f),tZ&&tH(l,h),s;if(null===f){for(;hg?(y=h,h=null):y=h.sibling;var b=p(l,h,v.value,s);if(null===b){null===h&&(h=y);break}e&&h&&null===b.alternate&&t(l,h),o=a(b,o,g),null===f?c=b:f.sibling=b,f=b,h=y}if(v.done)return n(l,h),tZ&&tH(l,g),c;if(null===h){for(;!v.done;g++,v=u.next())null!==(v=d(l,v.value,s))&&(o=a(v,o,g),null===f?c=v:f.sibling=v,f=v);return tZ&&tH(l,g),c}for(h=r(l,h);!v.done;g++,v=u.next())null!==(v=m(h,l,g,v.value,s))&&(e&&null!==v.alternate&&h.delete(null===v.key?g:v.key),o=a(v,o,g),null===f?c=v:f.sibling=v,f=v);return e&&h.forEach(function(e){return t(l,e)}),tZ&&tH(l,g),c}(s,c,f,h);if("function"==typeof f.then)return u(s,c,nJ(f),h);if(f.$$typeof===E)return u(s,c,ai(s,f,h),h);n1(s,f)}return"string"==typeof f&&""!==f||"number"==typeof f?(f=""+f,null!==c&&6===c.tag?(n(s,c.sibling),(c=l(c,f)).return=s):(n(s,c),(c=i_(f,s.mode,h)).return=s),o(s=c)):n(s,c)}(u,s,c,f),nG=null,u}}var n4=n3(!0),n6=n3(!1),n8=m(null),n5=m(0);function n7(e,t){g(n5,e=oz),g(n8,t),oz=e|t.baseLanes}function n9(){g(n5,oz),g(n8,n8.current)}function re(){oz=n5.current,h(n8),h(n5)}var rt=m(null),rn=null;function rr(e){var t=e.alternate;g(ri,1&ri.current),g(rt,e),null===rn&&(null===t||null!==n8.current?rn=e:null!==t.memoizedState&&(rn=e))}function rl(e){if(22===e.tag){if(g(ri,ri.current),g(rt,e),null===rn){var t=e.alternate;null!==t&&null!==t.memoizedState&&(rn=e)}}else ra(e)}function ra(){g(ri,ri.current),g(rt,rt.current)}function ro(e){h(rt),rn===e&&(rn=null),h(ri)}var ri=m(0);function ru(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||"$?"===n.data||"$!"===n.data))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!=(128&t.flags))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var rs=s.ReactCurrentDispatcher,rc=s.ReactCurrentBatchConfig,rf=0,rd=null,rp=null,rm=null,rh=!1,rg=!1,ry=!1,rv=0,rb=0,rk=null,rw=0;function rS(){throw Error(i(321))}function rC(e,t){if(null===t)return!1;for(var n=0;na?a:8;var o=rc.transition,i={_callbacks:new Set};rc.transition=i,lf(e,!1,t,n);try{var u=l();if(null!==u&&"object"==typeof u&&"function"==typeof u.then){av(i,u);var s,c,f=(s=[],c={status:"pending",value:null,reason:null,then:function(e){s.push(e)}},u.then(function(){c.status="fulfilled",c.value=r;for(var e=0;e title"))),sG(l,n,r),l[eE]=e,eI(l),n=l;break e;case"link":var a=cE("link","href",t).get(n+(r.href||""));if(a){for(var o=0;o",e=e.removeChild(e.firstChild);break;case"select":e="string"==typeof r.is?l.createElement("select",{is:r.is}):l.createElement("select"),r.multiple?e.multiple=!0:r.size&&(e.size=r.size);break;default:e="string"==typeof r.is?l.createElement(n,{is:r.is}):l.createElement(n)}}e[eE]=t,e[ex]=r;e:for(l=t.child;null!==l;){if(5===l.tag||6===l.tag)e.appendChild(l.stateNode);else if(4!==l.tag&&27!==l.tag&&null!==l.child){l.child.return=l,l=l.child;continue}if(l===t)break;for(;null===l.sibling;){if(null===l.return||l.return===t)break e;l=l.return}l.sibling.return=l.return,l=l.sibling}switch(t.stateNode=e,sG(e,n,r),n){case"button":case"input":case"select":case"textarea":e=!!r.autoFocus;break;case"img":e=!0;break;default:e=!1}e&&aC(t)}}return aP(t),t.flags&=-16777217,null;case 6:if(e&&null!=t.stateNode)e.memoizedProps!==r&&aC(t);else{if("string"!=typeof r&&null===t.stateNode)throw Error(i(166));if(e=I.current,t9(t)){e:{if(e=t.stateNode,n=t.memoizedProps,e[eE]=t,(r=e.nodeValue!==n)&&null!==(l=tX))switch(l.tag){case 3:if(l=0!=(1&l.mode),sq(e.nodeValue,n,l),l){e=!1;break e}break;case 27:case 5:var a=0!=(1&l.mode);if(!0!==l.memoizedProps.suppressHydrationWarning&&sq(e.nodeValue,n,a),a){e=!1;break e}}e=r}e&&aC(t)}else(e=s1(e).createTextNode(r))[eE]=t,t.stateNode=e}return aP(t),null;case 13:if(ro(t),r=t.memoizedState,null===e||null!==e.memoizedState&&null!==e.memoizedState.dehydrated){if(tZ&&null!==tG&&0!=(1&t.mode)&&0==(128&t.flags))ne(),nt(),t.flags|=384,l=!1;else if(l=t9(t),null!==r&&null!==r.dehydrated){if(null===e){if(!l)throw Error(i(318));if(!(l=null!==(l=t.memoizedState)?l.dehydrated:null))throw Error(i(317));l[eE]=t}else nt(),0==(128&t.flags)&&(t.memoizedState=null),t.flags|=4;aP(t),l=!1}else null!==tJ&&(o0(tJ),tJ=null),l=!0;if(!l)return 256&t.flags?t:null}if(0!=(128&t.flags))return t.lanes=n,t;return n=null!==r,e=null!==e&&null!==e.memoizedState,n&&(r=t.child,l=null,null!==r.alternate&&null!==r.alternate.memoizedState&&null!==r.alternate.memoizedState.cachePool&&(l=r.alternate.memoizedState.cachePool.pool),a=null,null!==r.memoizedState&&null!==r.memoizedState.cachePool&&(a=r.memoizedState.cachePool.pool),a!==l&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),ax(t,t.updateQueue),aP(t),null;case 4:return Q(),null===e&&sA(t.stateNode.containerInfo),aP(t),null;case 10:return an(t.type._context),aP(t),null;case 19:if(h(ri),null===(l=t.memoizedState))return aP(t),null;if(r=0!=(128&t.flags),null===(a=l.rendering)){if(r)az(l,!1);else{if(0!==oP||null!==e&&0!=(128&e.flags))for(e=t.child;null!==e;){if(null!==(a=ru(e))){for(t.flags|=128,az(l,!1),e=a.updateQueue,t.updateQueue=e,ax(t,e),t.subtreeFlags=0,e=n,n=t.child;null!==n;)ix(n,e),n=n.sibling;return g(ri,1&ri.current|2),t.child}e=e.sibling}null!==l.tail&&Y()>oI&&(t.flags|=128,r=!0,az(l,!1),t.lanes=4194304)}}else{if(!r){if(null!==(e=ru(a))){if(t.flags|=128,r=!0,e=e.updateQueue,t.updateQueue=e,ax(t,e),az(l,!0),null===l.tail&&"hidden"===l.tailMode&&!a.alternate&&!tZ)return aP(t),null}else 2*Y()-l.renderingStartTime>oI&&536870912!==n&&(t.flags|=128,r=!0,az(l,!1),t.lanes=4194304)}l.isBackwards?(a.sibling=t.child,t.child=a):(null!==(e=l.last)?e.sibling=a:t.child=a,l.last=a)}if(null!==l.tail)return t=l.tail,l.rendering=t,l.tail=t.sibling,l.renderingStartTime=Y(),t.sibling=null,e=ri.current,g(ri,r?1&e|2:1&e),t;return aP(t),null;case 22:case 23:return ro(t),re(),r=null!==t.memoizedState,null!==e?null!==e.memoizedState!==r&&(t.flags|=8192):r&&(t.flags|=8192),r&&0!=(1&t.mode)?0!=(536870912&n)&&0==(128&t.flags)&&(aP(t),6&t.subtreeFlags&&(t.flags|=8192)):aP(t),null!==(n=t.updateQueue)&&ax(t,n.retryQueue),n=null,null!==e&&null!==e.memoizedState&&null!==e.memoizedState.cachePool&&(n=e.memoizedState.cachePool.pool),r=null,null!==t.memoizedState&&null!==t.memoizedState.cachePool&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),null!==e&&h(ab),null;case 24:return n=null,null!==e&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),an(ad),aP(t),null;case 25:return null}throw Error(i(156,t.tag))}(t.alternate,t,oz);if(null!==n){ow=n;return}if(null!==(t=t.sibling)){ow=t;return}ow=t=e}while(null!==t);0===oP&&(oP=5)}function is(e,t,n,r,l){var a=ek,o=ov.transition;try{ov.transition=null,ek=2,function(e,t,n,r,l,a){do id();while(null!==oj);if(0!=(6&ob))throw Error(i(327));var o,u=e.finishedWork,s=e.finishedLanes;if(null!==u){if(e.finishedWork=null,e.finishedLanes=0,u===e.current)throw Error(i(177));e.callbackNode=null,e.callbackPriority=0,e.cancelPendingCommit=null;var c=u.lanes|u.childLanes;if(function(e,t,n){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.entangledLanes&=t,e.errorRecoveryDisabledLanes&=t,e.shellSuspendCounter=0,t=e.entanglements;for(var l=e.expirationTimes,a=e.hiddenUpdates;0r&&(l=r,r=a,a=l),l=si(n,a);var o=si(n,r);l&&o&&(1!==e.rangeCount||e.anchorNode!==l.node||e.anchorOffset!==l.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&((t=t.createRange()).setStart(l.node,l.offset),e.removeAllRanges(),a>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)1===e.nodeType&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for("function"==typeof n.focus&&n.focus(),n=0;nn?32:n;n=ov.transition;var l=ek;try{if(ov.transition=null,ek=r,null===oj)var a=!1;else{r=oq,oq=null;var o=oj,u=oW;if(oj=null,oW=0,0!=(6&ob))throw Error(i(331));var s=ob;if(ob|=4,of(o.current),ol(o,o.current,u,r),ob=s,nb(!1),ea&&"function"==typeof ea.onPostCommitFiberRoot)try{ea.onPostCommitFiberRoot(el,o)}catch(e){}a=!0}return a}finally{ek=l,ov.transition=n,ic(e,t)}}return!1}function ip(e,t,n){t=lL(e,t=lP(n,t),2),null!==(e=nO(e,t,2))&&(o2(e,2),nv(e))}function im(e,t,n){if(3===e.tag)ip(e,e,n);else for(;null!==t;){if(3===t.tag){ip(t,e,n);break}if(1===t.tag){var r=t.stateNode;if("function"==typeof t.type.getDerivedStateFromError||"function"==typeof r.componentDidCatch&&(null===oQ||!oQ.has(r))){e=lT(t,e=lP(n,e),2),null!==(t=nO(t,e,2))&&(o2(t,2),nv(t));break}}t=t.return}}function ih(e,t,n){var r=e.pingCache;if(null===r){r=e.pingCache=new om;var l=new Set;r.set(t,l)}else void 0===(l=r.get(t))&&(l=new Set,r.set(t,l));l.has(n)||(ox=!0,l.add(n),e=ig.bind(null,e,t,n),t.then(e,e))}function ig(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,2&ob?oR=!0:4&ob&&(oD=!0),ik(),ok===e&&(oS&n)===n&&(4===oP||3===oP&&(62914560&oS)===oS&&300>Y()-oA?0==(2&ob)&&o5(e,0):oT|=n),nv(e)}function iy(e,t){0===t&&(t=0==(1&e.mode)?2:eg()),null!==(e=ns(e,t))&&(o2(e,t),nv(e))}function iv(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),iy(e,n)}function ib(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,l=e.memoizedState;null!==l&&(n=l.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}null!==r&&r.delete(t),iy(e,n)}function ik(){if(50=uH),uY=!1;function uX(e,t){switch(e){case"keyup":return -1!==uj.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function uG(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var uZ=!1,uJ={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function u0(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!uJ[e.type]:"textarea"===t}function u1(e,t,n,r){tb(r),0<(t=sV(t,"onChange")).length&&(n=new i3("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var u2=null,u3=null;function u4(e){sM(e,0)}function u6(e){if(e4(eR(e)))return e}function u8(e,t){if("change"===e)return t}var u5=!1;if(e$){if(e$){var u7="oninput"in document;if(!u7){var u9=document.createElement("div");u9.setAttribute("oninput","return;"),u7="function"==typeof u9.oninput}r=u7}else r=!1;u5=r&&(!document.documentMode||9=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=so(r)}}function su(){for(var e=window,t=e6();t instanceof e.HTMLIFrameElement;){try{var n="string"==typeof t.contentWindow.location.href}catch(e){n=!1}if(n)e=t.contentWindow;else break;t=e6(e.document)}return t}function ss(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}var sc=e$&&"documentMode"in document&&11>=document.documentMode,sf=null,sd=null,sp=null,sm=!1;function sh(e,t,n){var r=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;sm||null==sf||sf!==e6(r)||(r="selectionStart"in(r=sf)&&ss(r)?{start:r.selectionStart,end:r.selectionEnd}:{anchorNode:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset},sp&&nQ(sp,r)||(sp=r,0<(r=sV(sd,"onSelect")).length&&(t=new i3("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=sf)))}function sg(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var sy={animationend:sg("Animation","AnimationEnd"),animationiteration:sg("Animation","AnimationIteration"),animationstart:sg("Animation","AnimationStart"),transitionend:sg("Transition","TransitionEnd")},sv={},sb={};function sk(e){if(sv[e])return sv[e];if(!sy[e])return e;var t,n=sy[e];for(t in n)if(n.hasOwnProperty(t)&&t in sb)return sv[e]=n[t];return e}e$&&(sb=document.createElement("div").style,"AnimationEvent"in window||(delete sy.animationend.animation,delete sy.animationiteration.animation,delete sy.animationstart.animation),"TransitionEvent"in window||delete sy.transitionend.transition);var sw=sk("animationend"),sS=sk("animationiteration"),sC=sk("animationstart"),sE=sk("transitionend"),sx=new Map,sz="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll scrollEnd toggle touchMove waiting wheel".split(" ");function sP(e,t){sx.set(e,t),eV(t,[e])}for(var sN=0;sN title"):null)}var cz=null;function cP(){}function cN(){if(this.count--,0===this.count){if(this.stylesheets)cL(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var c_=null;function cL(e,t){e.stylesheets=null,null!==e.unsuspend&&(e.count++,c_=new Map,t.forEach(cT,e),c_=null,cN.call(e))}function cT(e,t){if(!(4&t.state.loading)){var n=c_.get(e);if(n)var r=n.get(null);else{n=new Map,c_.set(e,n);for(var l=e.querySelectorAll("link[data-precedence],style[data-precedence]"),a=0;aclearTimeout(t.current)),(0,r.useMemo)(()=>{let n=()=>clearTimeout(t.current);return{set:function(r,o=0){e()&&(n(),o<=i?t.current=setTimeout(r,o):function e(t,n,r){let o=r-Date.now();t.current=o<=i?setTimeout(n,o):setTimeout(()=>e(t,n,r),i)}(t,r,Date.now()+o))},clear:n,handleRef:t}},[])}},3162:function(e,t,n){n.d(t,{FT:function(){return i}});var r=n(959),o=n(1527);let a=["as","disabled"];function i({tagName:e,disabled:t,href:n,target:r,rel:o,role:a,onClick:i,tabIndex:s=0,type:l}){e||(e=null!=n||null!=r||null!=o?"a":"button");let u={tagName:e};if("button"===e)return[{type:l||"button",disabled:t},u];let f=r=>{var o;if(!t&&("a"!==e||(o=n)&&"#"!==o.trim())||r.preventDefault(),t){r.stopPropagation();return}null==i||i(r)};return"a"===e&&(n||(n="#"),t&&(n=void 0)),[{role:null!=a?a:"button",disabled:void 0,tabIndex:t?void 0:s,href:n,target:"a"===e?r:void 0,"aria-disabled":t||void 0,rel:"a"===e?o:void 0,onClick:f,onKeyDown:e=>{" "===e.key&&(e.preventDefault(),f(e))}},u]}let s=r.forwardRef((e,t)=>{let{as:n,disabled:r}=e,s=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r=0||(o[n]=e[n]);return o}(e,a),[l,{tagName:u}]=i(Object.assign({tagName:n,disabled:r},s));return(0,o.jsx)(u,Object.assign({},s,l,{ref:t}))});s.displayName="Button",t.ZP=s},3970:function(e,t,n){let r=n(959).createContext(null);r.displayName="NavContext",t.Z=r},6465:function(e,t,n){n.d(t,{v:function(){return d}});var r=n(959),o=n(6575),a=n(3970),i=n(3439),s=n(3162),l=n(5872),u=n(3503),f=n(1527);let c=["as","active","eventKey"];function d({key:e,onClick:t,active:n,id:s,role:f,disabled:c}){let d=(0,r.useContext)(i.Z),p=(0,r.useContext)(a.Z),h=(0,r.useContext)(u.Z),m=n,v={role:f};if(p){f||"tablist"!==p.role||(v.role="tab");let t=p.getControllerId(null!=e?e:null),r=p.getControlledId(null!=e?e:null);v[(0,l.PB)("event-key")]=e,v.id=t||s,((m=null==n&&null!=e?p.activeKey===e:n)||!(null!=h&&h.unmountOnExit)&&!(null!=h&&h.mountOnEnter))&&(v["aria-controls"]=r)}return"tab"===v.role&&(v["aria-selected"]=m,m||(v.tabIndex=-1),c&&(v.tabIndex=-1,v["aria-disabled"]=!0)),v.onClick=(0,o.Z)(n=>{c||(null==t||t(n),null!=e&&d&&!n.isPropagationStopped()&&d(e,n))}),[v,{isActive:m}]}let p=r.forwardRef((e,t)=>{let{as:n=s.ZP,active:r,eventKey:o}=e,a=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r=0||(o[n]=e[n]);return o}(e,c),[u,p]=d(Object.assign({key:(0,i.h)(o,a.href),active:r},a));return u[(0,l.PB)("active")]=p.isActive,(0,f.jsx)(n,Object.assign({},a,u,{ref:t}))});p.displayName="NavItem",t.Z=p},3503:function(e,t,n){let r=n(959).createContext(null);t.Z=r},7468:function(e,t,n){n.d(t,{W:function(){return d}});var r=n(959),o=n(3503),a=n(3439),i=n(3233),s=n(1527);let l=["active","eventKey","mountOnEnter","transition","unmountOnExit","role","onEnter","onEntering","onEntered","onExit","onExiting","onExited"],u=["activeKey","getControlledId","getControllerId"],f=["as"];function c(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r=0||(o[n]=e[n]);return o}function d(e){let{active:t,eventKey:n,mountOnEnter:i,transition:s,unmountOnExit:f,role:d="tabpanel",onEnter:p,onEntering:h,onEntered:m,onExit:v,onExiting:g,onExited:y}=e,b=c(e,l),x=(0,r.useContext)(o.Z);if(!x)return[Object.assign({},b,{role:d}),{eventKey:n,isActive:t,mountOnEnter:i,transition:s,unmountOnExit:f,onEnter:p,onEntering:h,onEntered:m,onExit:v,onExiting:g,onExited:y}];let{activeKey:w,getControlledId:O,getControllerId:E}=x,j=c(x,u),D=(0,a.h)(n);return[Object.assign({},b,{role:d,id:O(n),"aria-labelledby":E(n)}),{eventKey:n,isActive:null==t&&null!=D?(0,a.h)(w)===D:t,transition:s||j.transition,mountOnEnter:null!=i?i:j.mountOnEnter,unmountOnExit:null!=f?f:j.unmountOnExit,onEnter:p,onEntering:h,onEntered:m,onExit:v,onExiting:g,onExited:y}]}let p=r.forwardRef((e,t)=>{let{as:n="div"}=e,[r,{isActive:l,onEnter:u,onEntering:p,onEntered:h,onExit:m,onExiting:v,onExited:g,mountOnEnter:y,unmountOnExit:b,transition:x=i.Z}]=d(c(e,f));return(0,s.jsx)(o.Z.Provider,{value:null,children:(0,s.jsx)(a.Z.Provider,{value:null,children:(0,s.jsx)(x,{in:l,onEnter:u,onEntering:p,onEntered:h,onExit:m,onExiting:v,onExited:g,mountOnEnter:y,unmountOnExit:b,children:(0,s.jsx)(n,Object.assign({},r,{ref:t,hidden:!l,"aria-hidden":!l}))})})})});p.displayName="TabPanel",t.Z=p},7031:function(e,t,n){n.d(t,{Z:function(){return y}});var r=n(959);let o={prefix:String(Math.round(1e10*Math.random())),current:0},a=r.createContext(o),i=r.createContext(!1),s=!!("undefined"!=typeof window&&window.document&&window.document.createElement),l=new WeakMap,u="function"==typeof r.useId?function(e){let t=r.useId(),[n]=(0,r.useState)("function"==typeof r.useSyncExternalStore?r.useSyncExternalStore(d,f,c):(0,r.useContext)(i)),a=n?"react-aria":`react-aria${o.prefix}`;return e||`${a}-${t}`}:function(e){let t=(0,r.useContext)(a);t!==o||s||console.warn("When server rendering, you must wrap your application in an to ensure consistent ids are generated between the client and server.");let n=function(e=!1){let t=(0,r.useContext)(a),n=(0,r.useRef)(null);if(null===n.current&&!e){var o,i;let e=null===(i=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED)||void 0===i?void 0:null===(o=i.ReactCurrentOwner)||void 0===o?void 0:o.current;if(e){let n=l.get(e);null==n?l.set(e,{id:t.current,state:e.memoizedState}):e.memoizedState!==n.state&&(t.current=n.id,l.delete(e))}n.current=++t.current}return n.current}(!!e),i=`react-aria${t.prefix}`;return e||`${i}-${n}`};function f(){return!1}function c(){return!0}function d(e){return()=>{}}var p=n(3503),h=n(3439),m=n(7468),v=n(1527);let g=e=>{let{id:t,generateChildId:n,onSelect:o,activeKey:a,defaultActiveKey:i,transition:s,mountOnEnter:l,unmountOnExit:f,children:c}=e,[d,m]=function(e,t,n){let o=(0,r.useRef)(void 0!==e),[a,i]=(0,r.useState)(t),s=void 0!==e,l=o.current;return o.current=s,!s&&l&&a!==t&&i(t),[s?e:a,(0,r.useCallback)((...e)=>{let[t,...r]=e,o=null==n?void 0:n(t,...r);return i(t),o},[n])]}(a,i,o),g=u(t),y=(0,r.useMemo)(()=>n||((e,t)=>g?`${g}-${t}-${e}`:null),[g,n]),b=(0,r.useMemo)(()=>({onSelect:m,activeKey:d,transition:s,mountOnEnter:l||!1,unmountOnExit:f||!1,getControlledId:e=>y(e,"tabpane"),getControllerId:e=>y(e,"tab")}),[m,d,s,l,f,y]);return(0,v.jsx)(p.Z.Provider,{value:b,children:(0,v.jsx)(h.Z.Provider,{value:m||null,children:c})})};g.Panel=m.Z;var y=g},5924:function(e,t,n){function r(){for(var e,t,n=0,r="";n>",l=i||r;if(null==n[r])return t?Error("Required "+a+" `"+l+"` was not specified in `"+s+"`."):null;for(var u=arguments.length,f=Array(u>6?u-6:0),c=6;c{let p=(0,s.vE)(t,"btn"),[h,{tagName:m}]=(0,i.FT)({tagName:e,disabled:u,...c});return(0,l.jsx)(m,{...h,...c,ref:d,disabled:u,className:o()(f,p,a&&"active",n&&`${p}-${n}`,r&&`${p}-${r}`,c.href&&u&&"disabled")})});u.displayName="Button",t.Z=u},1797:function(e,t,n){var r=n(4875),o=n.n(r),a=n(959),i=n(7885),s=n(1527);let l=a.forwardRef((e,t)=>{let[{className:n,...r},{as:a="div",bsPrefix:l,spans:u}]=function({as:e,bsPrefix:t,className:n,...r}){t=(0,i.vE)(t,"col");let a=(0,i.pi)(),s=(0,i.zG)(),l=[],u=[];return a.forEach(e=>{let n,o,a;let i=r[e];delete r[e],"object"==typeof i&&null!=i?{span:n,offset:o,order:a}=i:n=i;let f=e!==s?`-${e}`:"";n&&l.push(!0===n?`${t}${f}`:`${t}${f}-${n}`),null!=a&&u.push(`order${f}-${a}`),null!=o&&u.push(`offset${f}-${o}`)}),[{...r,className:o()(n,...l,...u)},{as:e,bsPrefix:t,spans:l}]}(e);return(0,s.jsx)(a,{...r,ref:t,className:o()(n,!u.length&&l)})});l.displayName="Col",t.Z=l},3988:function(e,t,n){n.d(t,{Ed:function(){return a},UI:function(){return o},XW:function(){return i}});var r=n(959);function o(e,t){let n=0;return r.Children.map(e,e=>r.isValidElement(e)?t(e,n++):e)}function a(e,t){let n=0;r.Children.forEach(e,e=>{r.isValidElement(e)&&t(e,n++)})}function i(e,t){return r.Children.toArray(e).some(e=>r.isValidElement(e)&&e.type===t)}},8144:function(e,t,n){var r=n(4875),o=n.n(r),a=n(959),i=n(507),s=n.n(i),l=n(1527);let u={type:s().string,tooltip:s().bool,as:s().elementType},f=a.forwardRef(({as:e="div",className:t,type:n="valid",tooltip:r=!1,...a},i)=>(0,l.jsx)(e,{...a,ref:i,className:o()(t,`${n}-${r?"tooltip":"feedback"}`)}));f.displayName="Feedback",f.propTypes=u,t.Z=f},8871:function(e,t,n){n.d(t,{Z:function(){return j}});var r=n(4875),o=n.n(r),a=n(507),i=n.n(a),s=n(959),l=n(6090),u=n(7704),f=n(7885),c=n(1527);let d=s.forwardRef(({className:e,bsPrefix:t,as:n="div",...r},a)=>(t=(0,f.vE)(t,"form-floating"),(0,c.jsx)(n,{ref:a,className:o()(e,t),...r})));d.displayName="FormFloating";var p=n(6962),h=n(7517),m=n(3404);let v=s.forwardRef(({bsPrefix:e,className:t,id:n,...r},a)=>{let{controlId:i}=(0,s.useContext)(m.Z);return e=(0,f.vE)(e,"form-range"),(0,c.jsx)("input",{...r,type:"range",ref:a,className:o()(t,e),id:n||i})});v.displayName="FormRange";var g=n(8413);let y=s.forwardRef(({bsPrefix:e,className:t,as:n="small",muted:r,...a},i)=>(e=(0,f.vE)(e,"form-text"),(0,c.jsx)(n,{...a,ref:i,className:o()(t,e,r&&"text-muted")})));y.displayName="FormText";let b=s.forwardRef((e,t)=>(0,c.jsx)(l.Z,{...e,ref:t,type:"switch"}));b.displayName="Switch";var x=Object.assign(b,{Input:l.Z.Input,Label:l.Z.Label});let w=s.forwardRef(({bsPrefix:e,className:t,children:n,controlId:r,label:a,...i},s)=>(e=(0,f.vE)(e,"form-floating"),(0,c.jsxs)(p.Z,{ref:s,className:o()(t,e),controlId:r,...i,children:[n,(0,c.jsx)("label",{htmlFor:r,children:a})]})));w.displayName="FloatingLabel";let O={_ref:i().any,validated:i().bool,as:i().elementType},E=s.forwardRef(({className:e,validated:t,as:n="form",...r},a)=>(0,c.jsx)(n,{...r,ref:a,className:o()(e,t&&"was-validated")}));E.displayName="Form",E.propTypes=O;var j=Object.assign(E,{Group:p.Z,Control:u.Z,Floating:d,Check:l.Z,Switch:x,Label:h.Z,Text:y,Range:v,Select:g.Z,FloatingLabel:w})},6090:function(e,t,n){n.d(t,{Z:function(){return h}});var r=n(4875),o=n.n(r),a=n(959),i=n(8144),s=n(3404),l=n(7885),u=n(1527);let f=a.forwardRef(({id:e,bsPrefix:t,className:n,type:r="checkbox",isValid:i=!1,isInvalid:f=!1,as:c="input",...d},p)=>{let{controlId:h}=(0,a.useContext)(s.Z);return t=(0,l.vE)(t,"form-check-input"),(0,u.jsx)(c,{...d,ref:p,type:r,id:e||h,className:o()(n,t,i&&"is-valid",f&&"is-invalid")})});f.displayName="FormCheckInput";let c=a.forwardRef(({bsPrefix:e,className:t,htmlFor:n,...r},i)=>{let{controlId:f}=(0,a.useContext)(s.Z);return e=(0,l.vE)(e,"form-check-label"),(0,u.jsx)("label",{...r,ref:i,htmlFor:n||f,className:o()(t,e)})});c.displayName="FormCheckLabel";var d=n(3988);let p=a.forwardRef(({id:e,bsPrefix:t,bsSwitchPrefix:n,inline:r=!1,reverse:p=!1,disabled:h=!1,isValid:m=!1,isInvalid:v=!1,feedbackTooltip:g=!1,feedback:y,feedbackType:b,className:x,style:w,title:O="",type:E="checkbox",label:j,children:D,as:S="input",...C},N)=>{t=(0,l.vE)(t,"form-check"),n=(0,l.vE)(n,"form-switch");let{controlId:Z}=(0,a.useContext)(s.Z),P=(0,a.useMemo)(()=>({controlId:e||Z}),[Z,e]),T=!D&&null!=j&&!1!==j||(0,d.XW)(D,c),k=(0,u.jsx)(f,{...C,type:"switch"===E?"checkbox":E,ref:N,isValid:m,isInvalid:v,disabled:h,as:S});return(0,u.jsx)(s.Z.Provider,{value:P,children:(0,u.jsx)("div",{style:w,className:o()(x,T&&t,r&&`${t}-inline`,p&&`${t}-reverse`,"switch"===E&&n),children:D||(0,u.jsxs)(u.Fragment,{children:[k,T&&(0,u.jsx)(c,{title:O,children:j}),y&&(0,u.jsx)(i.Z,{type:b,tooltip:g,children:y})]})})})});p.displayName="FormCheck";var h=Object.assign(p,{Input:f,Label:c})},3404:function(e,t,n){let r=n(959).createContext({});t.Z=r},7704:function(e,t,n){var r=n(4875),o=n.n(r),a=n(959);n(1190);var i=n(8144),s=n(3404),l=n(7885),u=n(1527);let f=a.forwardRef(({bsPrefix:e,type:t,size:n,htmlSize:r,id:i,className:f,isValid:c=!1,isInvalid:d=!1,plaintext:p,readOnly:h,as:m="input",...v},g)=>{let{controlId:y}=(0,a.useContext)(s.Z);return e=(0,l.vE)(e,"form-control"),(0,u.jsx)(m,{...v,type:t,size:r,ref:g,readOnly:h,id:i||y,className:o()(f,p?`${e}-plaintext`:e,n&&`${e}-${n}`,"color"===t&&`${e}-color`,c&&"is-valid",d&&"is-invalid")})});f.displayName="FormControl",t.Z=Object.assign(f,{Feedback:i.Z})},6962:function(e,t,n){var r=n(959),o=n(3404),a=n(1527);let i=r.forwardRef(({controlId:e,as:t="div",...n},i)=>{let s=(0,r.useMemo)(()=>({controlId:e}),[e]);return(0,a.jsx)(o.Z.Provider,{value:s,children:(0,a.jsx)(t,{...n,ref:i})})});i.displayName="FormGroup",t.Z=i},7517:function(e,t,n){var r=n(4875),o=n.n(r),a=n(959);n(1190);var i=n(1797),s=n(3404),l=n(7885),u=n(1527);let f=a.forwardRef(({as:e="label",bsPrefix:t,column:n=!1,visuallyHidden:r=!1,className:f,htmlFor:c,...d},p)=>{let{controlId:h}=(0,a.useContext)(s.Z);t=(0,l.vE)(t,"form-label");let m="col-form-label";"string"==typeof n&&(m=`${m} ${m}-${n}`);let v=o()(f,t,r&&"visually-hidden",n&&m);return(c=c||h,n)?(0,u.jsx)(i.Z,{ref:p,as:"label",className:v,htmlFor:c,...d}):(0,u.jsx)(e,{ref:p,className:v,htmlFor:c,...d})});f.displayName="FormLabel",t.Z=f},8413:function(e,t,n){var r=n(4875),o=n.n(r),a=n(959),i=n(7885),s=n(3404),l=n(1527);let u=a.forwardRef(({bsPrefix:e,size:t,htmlSize:n,className:r,isValid:u=!1,isInvalid:f=!1,id:c,...d},p)=>{let{controlId:h}=(0,a.useContext)(s.Z);return e=(0,i.vE)(e,"form-select"),(0,l.jsx)("select",{...d,size:n,ref:p,className:o()(r,e,t&&`${e}-${t}`,u&&"is-valid",f&&"is-invalid"),id:c||h})});u.displayName="FormSelect",t.Z=u},712:function(e,t,n){n.d(t,{Z:function(){return S}});var r=n(4875),o=n.n(r);n(293);var a=n(959),i=n(3549),s=n(3465),l=n(5466),u=n(3970),f=n(3439),c=n(3503),d=n(5872),p=n(6465),h=n(1527);let m=["as","onSelect","activeKey","role","onKeyDown"],v=()=>{},g=(0,d.PB)("event-key"),y=a.forwardRef((e,t)=>{let n,r,{as:o="div",onSelect:i,activeKey:p,role:y,onKeyDown:b}=e,x=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r=0||(o[n]=e[n]);return o}(e,m),w=function(){let[,e]=(0,a.useReducer)(e=>!e,!1);return e}(),O=(0,a.useRef)(!1),E=(0,a.useContext)(f.Z),j=(0,a.useContext)(c.Z);j&&(y=y||"tablist",p=j.activeKey,n=j.getControlledId,r=j.getControllerId);let D=(0,a.useRef)(null),S=e=>{let t=D.current;if(!t)return null;let n=(0,s.Z)(t,`[${g}]:not([aria-disabled=true])`),r=t.querySelector("[aria-selected=true]");if(!r||r!==document.activeElement)return null;let o=n.indexOf(r);if(-1===o)return null;let a=o+e;return a>=n.length&&(a=0),a<0&&(a=n.length-1),n[a]},C=(e,t)=>{null!=e&&(null==i||i(e,t),null==E||E(e,t))};(0,a.useEffect)(()=>{if(D.current&&O.current){let e=D.current.querySelector(`[${g}][aria-selected=true]`);null==e||e.focus()}O.current=!1});let N=(0,l.Z)(t,D);return(0,h.jsx)(f.Z.Provider,{value:C,children:(0,h.jsx)(u.Z.Provider,{value:{role:y,activeKey:(0,f.h)(p),getControlledId:n||v,getControllerId:r||v},children:(0,h.jsx)(o,Object.assign({},x,{onKeyDown:e=>{let t;if(null==b||b(e),j){switch(e.key){case"ArrowLeft":case"ArrowUp":t=S(-1);break;case"ArrowRight":case"ArrowDown":t=S(1);break;default:return}t&&(e.preventDefault(),C(t.dataset[(0,d.$F)("EventKey")]||null,e),O.current=!0,w())}},ref:N,role:y}))})})});y.displayName="Nav";var b=Object.assign(y,{Item:p.Z}),x=n(7885),w=n(3764);let O=a.createContext(null);O.displayName="CardHeaderContext";var E=n(2772),j=n(9069);let D=a.forwardRef((e,t)=>{let n,r;let{as:s="div",bsPrefix:l,variant:u,fill:f=!1,justify:c=!1,navbar:d,navbarScroll:p,className:m,activeKey:v,...g}=(0,i.Ch)(e,{activeKey:"onSelect"}),y=(0,x.vE)(l,"nav"),E=!1,j=(0,a.useContext)(w.Z),D=(0,a.useContext)(O);return j?(n=j.bsPrefix,E=null==d||d):D&&({cardHeaderBsPrefix:r}=D),(0,h.jsx)(b,{as:s,ref:t,activeKey:v,className:o()(m,{[y]:!E,[`${n}-nav`]:E,[`${n}-nav-scroll`]:E&&p,[`${r}-${u}`]:!!r,[`${y}-${u}`]:!!u,[`${y}-fill`]:f,[`${y}-justified`]:c}),...g})});D.displayName="Nav";var S=Object.assign(D,{Item:E.Z,Link:j.Z})},2772:function(e,t,n){var r=n(959),o=n(4875),a=n.n(o),i=n(7885),s=n(1527);let l=r.forwardRef(({className:e,bsPrefix:t,as:n="div",...r},o)=>(t=(0,i.vE)(t,"nav-item"),(0,s.jsx)(n,{ref:o,className:a()(e,t),...r})));l.displayName="NavItem",t.Z=l},9069:function(e,t,n){n.d(t,{Z:function(){return v}});var r=n(4875),o=n.n(r),a=n(959);n(3011),n(8926);var i=n(6575);n(9189),n(2674),n(6160),new WeakMap;var s=n(3162),l=n(1527);let u=["onKeyDown"],f=a.forwardRef((e,t)=>{var n;let{onKeyDown:r}=e,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r=0||(o[n]=e[n]);return o}(e,u),[a]=(0,s.FT)(Object.assign({tagName:"a"},o)),f=(0,i.Z)(e=>{a.onKeyDown(e),null==r||r(e)});return(n=o.href)&&"#"!==n.trim()&&"button"!==o.role?(0,l.jsx)("a",Object.assign({ref:t},o,{onKeyDown:r})):(0,l.jsx)("a",Object.assign({ref:t},o,a,{onKeyDown:f}))});f.displayName="Anchor";var c=f,d=n(6465),p=n(3439),h=n(7885);let m=a.forwardRef(({bsPrefix:e,className:t,as:n=c,active:r,eventKey:a,disabled:i=!1,...s},u)=>{e=(0,h.vE)(e,"nav-link");let[f,m]=(0,d.v)({key:(0,p.h)(a,s.href),active:r,disabled:i,...s});return(0,l.jsx)(n,{...s,...f,ref:u,disabled:i,className:o()(t,e,i&&"disabled",m.isActive&&"active")})});m.displayName="NavLink";var v=m},185:function(e,t,n){n.d(t,{Z:function(){return e4}});var r,o,a,i,s,l=n(6712),u=n(507),f=n.n(u),c=n(959),d=n(2447),p=n(1190),h=n.n(p),m=n(3549),v=n(5466),g=n(4875),y=n.n(g),b=n(422),x=n(3011),w=Object.prototype.hasOwnProperty;function O(e,t,n){for(n of e.keys())if(E(n,t))return n}function E(e,t){var n,r,o;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&E(e[r],t[r]););return -1===r}if(n===Set){if(e.size!==t.size)return!1;for(r of e)if((o=r)&&"object"==typeof o&&!(o=O(t,o))||!t.has(o))return!1;return!0}if(n===Map){if(e.size!==t.size)return!1;for(r of e)if((o=r[0])&&"object"==typeof o&&!(o=O(t,o))||!E(r[1],t.get(o)))return!1;return!0}if(n===ArrayBuffer)e=new Uint8Array(e),t=new Uint8Array(t);else if(n===DataView){if((r=e.byteLength)===t.byteLength)for(;r--&&e.getInt8(r)===t.getInt8(r););return -1===r}if(ArrayBuffer.isView(e)){if((r=e.byteLength)===t.byteLength)for(;r--&&e[r]===t[r];);return -1===r}if(!n||"object"==typeof e){for(n in r=0,e)if(w.call(e,n)&&++r&&!w.call(t,n)||!(n in t)||!E(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!=e&&t!=t}var j=n(9189),D=function(e){let t=(0,j.Z)();return[e[0],(0,c.useCallback)(n=>{if(t())return e[1](n)},[t,e[1]])]};function S(e){return e.split("-")[0]}function C(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function N(e){var t=C(e).Element;return e instanceof t||e instanceof Element}function Z(e){var t=C(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function P(e){if("undefined"==typeof ShadowRoot)return!1;var t=C(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}var T=Math.max,k=Math.min,M=Math.round;function R(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function A(){return!/^((?!chrome|android).)*safari/i.test(R())}function $(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var r=e.getBoundingClientRect(),o=1,a=1;t&&Z(e)&&(o=e.offsetWidth>0&&M(r.width)/e.offsetWidth||1,a=e.offsetHeight>0&&M(r.height)/e.offsetHeight||1);var i=(N(e)?C(e):window).visualViewport,s=!A()&&n,l=(r.left+(s&&i?i.offsetLeft:0))/o,u=(r.top+(s&&i?i.offsetTop:0))/a,f=r.width/o,c=r.height/a;return{width:f,height:c,top:u,right:l+f,bottom:u+c,left:l,x:l,y:u}}function L(e){var t=$(e),n=e.offsetWidth,r=e.offsetHeight;return 1>=Math.abs(t.width-n)&&(n=t.width),1>=Math.abs(t.height-r)&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function _(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&P(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function I(e){return e?(e.nodeName||"").toLowerCase():null}function F(e){return C(e).getComputedStyle(e)}function W(e){return((N(e)?e.ownerDocument:e.document)||window.document).documentElement}function B(e){return"html"===I(e)?e:e.assignedSlot||e.parentNode||(P(e)?e.host:null)||W(e)}function H(e){return Z(e)&&"fixed"!==F(e).position?e.offsetParent:null}function U(e){for(var t=C(e),n=H(e);n&&["table","td","th"].indexOf(I(n))>=0&&"static"===F(n).position;)n=H(n);return n&&("html"===I(n)||"body"===I(n)&&"static"===F(n).position)?t:n||function(e){var t=/firefox/i.test(R());if(/Trident/i.test(R())&&Z(e)&&"fixed"===F(e).position)return null;var n=B(e);for(P(n)&&(n=n.host);Z(n)&&0>["html","body"].indexOf(I(n));){var r=F(n);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||t&&"filter"===r.willChange||t&&r.filter&&"none"!==r.filter)return n;n=n.parentNode}return null}(e)||t}function X(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function V(e,t,n){return T(e,k(t,n))}function Y(){return{top:0,right:0,bottom:0,left:0}}function K(e){return Object.assign({},Y(),e)}function z(e,t){return t.reduce(function(t,n){return t[n]=e,t},{})}var q="bottom",G="right",J="left",Q="auto",ee=["top",q,G,J],et="start",en="viewport",er="popper",eo=ee.reduce(function(e,t){return e.concat([t+"-"+et,t+"-end"])},[]),ea=[].concat(ee,[Q]).reduce(function(e,t){return e.concat([t,t+"-"+et,t+"-end"])},[]),ei=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function es(e){return e.split("-")[1]}var el={top:"auto",right:"auto",bottom:"auto",left:"auto"};function eu(e){var t,n,r,o,a,i,s,l=e.popper,u=e.popperRect,f=e.placement,c=e.variation,d=e.offsets,p=e.position,h=e.gpuAcceleration,m=e.adaptive,v=e.roundOffsets,g=e.isFixed,y=d.x,b=void 0===y?0:y,x=d.y,w=void 0===x?0:x,O="function"==typeof v?v({x:b,y:w}):{x:b,y:w};b=O.x,w=O.y;var E=d.hasOwnProperty("x"),j=d.hasOwnProperty("y"),D=J,S="top",N=window;if(m){var Z=U(l),P="clientHeight",T="clientWidth";Z===C(l)&&"static"!==F(Z=W(l)).position&&"absolute"===p&&(P="scrollHeight",T="scrollWidth"),("top"===f||(f===J||f===G)&&"end"===c)&&(S=q,w-=(g&&Z===N&&N.visualViewport?N.visualViewport.height:Z[P])-u.height,w*=h?1:-1),(f===J||("top"===f||f===q)&&"end"===c)&&(D=G,b-=(g&&Z===N&&N.visualViewport?N.visualViewport.width:Z[T])-u.width,b*=h?1:-1)}var k=Object.assign({position:p},m&&el),R=!0===v?(t={x:b,y:w},n=C(l),r=t.x,o=t.y,{x:M(r*(a=n.devicePixelRatio||1))/a||0,y:M(o*a)/a||0}):{x:b,y:w};return(b=R.x,w=R.y,h)?Object.assign({},k,((s={})[S]=j?"0":"",s[D]=E?"0":"",s.transform=1>=(N.devicePixelRatio||1)?"translate("+b+"px, "+w+"px)":"translate3d("+b+"px, "+w+"px, 0)",s)):Object.assign({},k,((i={})[S]=j?w+"px":"",i[D]=E?b+"px":"",i.transform="",i))}var ef={passive:!0},ec={left:"right",right:"left",bottom:"top",top:"bottom"};function ed(e){return e.replace(/left|right|bottom|top/g,function(e){return ec[e]})}var ep={start:"end",end:"start"};function eh(e){return e.replace(/start|end/g,function(e){return ep[e]})}function em(e){var t=C(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function ev(e){return $(W(e)).left+em(e).scrollLeft}function eg(e){var t=F(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function ey(e,t){void 0===t&&(t=[]);var n,r=function e(t){return["html","body","#document"].indexOf(I(t))>=0?t.ownerDocument.body:Z(t)&&eg(t)?t:e(B(t))}(e),o=r===(null==(n=e.ownerDocument)?void 0:n.body),a=C(r),i=o?[a].concat(a.visualViewport||[],eg(r)?r:[]):r,s=t.concat(i);return o?s:s.concat(ey(B(i)))}function eb(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function ex(e,t,n){var r,o,a,i,s,l,u,f,c,d;return t===en?eb(function(e,t){var n=C(e),r=W(e),o=n.visualViewport,a=r.clientWidth,i=r.clientHeight,s=0,l=0;if(o){a=o.width,i=o.height;var u=A();(u||!u&&"fixed"===t)&&(s=o.offsetLeft,l=o.offsetTop)}return{width:a,height:i,x:s+ev(e),y:l}}(e,n)):N(t)?((r=$(t,!1,"fixed"===n)).top=r.top+t.clientTop,r.left=r.left+t.clientLeft,r.bottom=r.top+t.clientHeight,r.right=r.left+t.clientWidth,r.width=t.clientWidth,r.height=t.clientHeight,r.x=r.left,r.y=r.top,r):eb((o=W(e),i=W(o),s=em(o),l=null==(a=o.ownerDocument)?void 0:a.body,u=T(i.scrollWidth,i.clientWidth,l?l.scrollWidth:0,l?l.clientWidth:0),f=T(i.scrollHeight,i.clientHeight,l?l.scrollHeight:0,l?l.clientHeight:0),c=-s.scrollLeft+ev(o),d=-s.scrollTop,"rtl"===F(l||i).direction&&(c+=T(i.clientWidth,l?l.clientWidth:0)-u),{width:u,height:f,x:c,y:d}))}function ew(e){var t,n=e.reference,r=e.element,o=e.placement,a=o?S(o):null,i=o?es(o):null,s=n.x+n.width/2-r.width/2,l=n.y+n.height/2-r.height/2;switch(a){case"top":t={x:s,y:n.y-r.height};break;case q:t={x:s,y:n.y+n.height};break;case G:t={x:n.x+n.width,y:l};break;case J:t={x:n.x-r.width,y:l};break;default:t={x:n.x,y:n.y}}var u=a?X(a):null;if(null!=u){var f="y"===u?"height":"width";switch(i){case et:t[u]=t[u]-(n[f]/2-r[f]/2);break;case"end":t[u]=t[u]+(n[f]/2-r[f]/2)}}return t}function eO(e,t){void 0===t&&(t={});var n,r,o,a,i,s,l,u=t,f=u.placement,c=void 0===f?e.placement:f,d=u.strategy,p=void 0===d?e.strategy:d,h=u.boundary,m=u.rootBoundary,v=u.elementContext,g=void 0===v?er:v,y=u.altBoundary,b=u.padding,x=void 0===b?0:b,w=K("number"!=typeof x?x:z(x,ee)),O=e.rects.popper,E=e.elements[void 0!==y&&y?g===er?"reference":er:g],j=(n=N(E)?E:E.contextElement||W(e.elements.popper),s=(i=[].concat("clippingParents"===(r=void 0===h?"clippingParents":h)?(o=ey(B(n)),N(a=["absolute","fixed"].indexOf(F(n).position)>=0&&Z(n)?U(n):n)?o.filter(function(e){return N(e)&&_(e,a)&&"body"!==I(e)}):[]):[].concat(r),[void 0===m?en:m]))[0],(l=i.reduce(function(e,t){var r=ex(n,t,p);return e.top=T(r.top,e.top),e.right=k(r.right,e.right),e.bottom=k(r.bottom,e.bottom),e.left=T(r.left,e.left),e},ex(n,s,p))).width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l),D=$(e.elements.reference),S=ew({reference:D,element:O,strategy:"absolute",placement:c}),C=eb(Object.assign({},O,S)),P=g===er?C:D,M={top:j.top-P.top+w.top,bottom:P.bottom-j.bottom+w.bottom,left:j.left-P.left+w.left,right:P.right-j.right+w.right},R=e.modifiersData.offset;if(g===er&&R){var A=R[c];Object.keys(M).forEach(function(e){var t=[G,q].indexOf(e)>=0?1:-1,n=["top",q].indexOf(e)>=0?"y":"x";M[e]+=A[n]*t})}return M}function eE(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function ej(e){return["top",G,q,J].some(function(t){return e[t]>=0})}var eD={placement:"bottom",modifiers:[],strategy:"absolute"};function eS(){for(var e=arguments.length,t=Array(e),n=0;n=0?-1:1,l=(s="function"==typeof a?a(Object.assign({},r,{placement:n})):a)[0],u=s[1],l=l||0,u=(u||0)*i,[J,G].indexOf(o)>=0?{x:u,y:l}:{x:l,y:u}),e},{}),s=i[t.placement],l=s.x,u=s.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=u),t.modifiersData[r]=i}},{name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var o=n.mainAxis,a=void 0===o||o,i=n.altAxis,s=void 0===i||i,l=n.fallbackPlacements,u=n.padding,f=n.boundary,c=n.rootBoundary,d=n.altBoundary,p=n.flipVariations,h=void 0===p||p,m=n.allowedAutoPlacements,v=t.options.placement,g=S(v)===v,y=l||(g||!h?[ed(v)]:function(e){if(S(e)===Q)return[];var t=ed(e);return[eh(e),t,eh(t)]}(v)),b=[v].concat(y).reduce(function(e,n){var r,o,a,i,s,l,d,p,v,g,y,b;return e.concat(S(n)===Q?(o=(r={placement:n,boundary:f,rootBoundary:c,padding:u,flipVariations:h,allowedAutoPlacements:m}).placement,a=r.boundary,i=r.rootBoundary,s=r.padding,l=r.flipVariations,p=void 0===(d=r.allowedAutoPlacements)?ea:d,0===(y=(g=(v=es(o))?l?eo:eo.filter(function(e){return es(e)===v}):ee).filter(function(e){return p.indexOf(e)>=0})).length&&(y=g),Object.keys(b=y.reduce(function(e,n){return e[n]=eO(t,{placement:n,boundary:a,rootBoundary:i,padding:s})[S(n)],e},{})).sort(function(e,t){return b[e]-b[t]})):n)},[]),x=t.rects.reference,w=t.rects.popper,O=new Map,E=!0,j=b[0],D=0;D=0,T=P?"width":"height",k=eO(t,{placement:C,boundary:f,rootBoundary:c,altBoundary:d,padding:u}),M=P?Z?G:J:Z?q:"top";x[T]>w[T]&&(M=ed(M));var R=ed(M),A=[];if(a&&A.push(k[N]<=0),s&&A.push(k[M]<=0,k[R]<=0),A.every(function(e){return e})){j=C,E=!1;break}O.set(C,A)}if(E)for(var $=h?3:1,L=function(e){var t=b.find(function(t){var n=O.get(t);if(n)return n.slice(0,e).every(function(e){return e})});if(t)return j=t,"break"},_=$;_>0&&"break"!==L(_);_--);t.placement!==j&&(t.modifiersData[r]._skip=!0,t.placement=j,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},{name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name,o=n.mainAxis,a=n.altAxis,i=n.boundary,s=n.rootBoundary,l=n.altBoundary,u=n.padding,f=n.tether,c=void 0===f||f,d=n.tetherOffset,p=void 0===d?0:d,h=eO(t,{boundary:i,rootBoundary:s,padding:u,altBoundary:l}),m=S(t.placement),v=es(t.placement),g=!v,y=X(m),b="x"===y?"y":"x",x=t.modifiersData.popperOffsets,w=t.rects.reference,O=t.rects.popper,E="function"==typeof p?p(Object.assign({},t.rects,{placement:t.placement})):p,j="number"==typeof E?{mainAxis:E,altAxis:E}:Object.assign({mainAxis:0,altAxis:0},E),D=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,C={x:0,y:0};if(x){if(void 0===o||o){var N,Z="y"===y?"top":J,P="y"===y?q:G,M="y"===y?"height":"width",R=x[y],A=R+h[Z],$=R-h[P],_=c?-O[M]/2:0,I=v===et?w[M]:O[M],F=v===et?-O[M]:-w[M],W=t.elements.arrow,B=c&&W?L(W):{width:0,height:0},H=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:Y(),K=H[Z],z=H[P],Q=V(0,w[M],B[M]),ee=g?w[M]/2-_-Q-K-j.mainAxis:I-Q-K-j.mainAxis,en=g?-w[M]/2+_+Q+z+j.mainAxis:F+Q+z+j.mainAxis,er=t.elements.arrow&&U(t.elements.arrow),eo=er?"y"===y?er.clientTop||0:er.clientLeft||0:0,ea=null!=(N=null==D?void 0:D[y])?N:0,ei=V(c?k(A,R+ee-ea-eo):A,R,c?T($,R+en-ea):$);x[y]=ei,C[y]=ei-R}if(void 0!==a&&a){var el,eu,ef="x"===y?"top":J,ec="x"===y?q:G,ed=x[b],ep="y"===b?"height":"width",eh=ed+h[ef],em=ed-h[ec],ev=-1!==["top",J].indexOf(m),eg=null!=(eu=null==D?void 0:D[b])?eu:0,ey=ev?eh:ed-w[ep]-O[ep]-eg+j.altAxis,eb=ev?ed+w[ep]+O[ep]-eg-j.altAxis:em,ex=c&&ev?(el=V(ey,ed,eb))>eb?eb:el:V(c?ey:eh,ed,c?eb:em);x[b]=ex,C[b]=ex-ed}t.modifiersData[r]=C}},requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n,r=e.state,o=e.name,a=e.options,i=r.elements.arrow,s=r.modifiersData.popperOffsets,l=S(r.placement),u=X(l),f=[J,G].indexOf(l)>=0?"height":"width";if(i&&s){var c=K("number"!=typeof(t="function"==typeof(t=a.padding)?t(Object.assign({},r.rects,{placement:r.placement})):t)?t:z(t,ee)),d=L(i),p="y"===u?"top":J,h="y"===u?q:G,m=r.rects.reference[f]+r.rects.reference[u]-s[u]-r.rects.popper[f],v=s[u]-r.rects.reference[u],g=U(i),y=g?"y"===u?g.clientHeight||0:g.clientWidth||0:0,b=c[p],x=y-d[f]-c[h],w=y/2-d[f]/2+(m/2-v/2),O=V(b,w,x);r.modifiersData[o]=((n={})[u]=O,n.centerOffset=O-w,n)}},effect:function(e){var t=e.state,n=e.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!=typeof r||(r=t.elements.popper.querySelector(r)))&&_(t.elements.popper,r)&&(t.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]}]}).defaultModifiers)?[]:o,s=void 0===(i=r.defaultOptions)?eD:i,function(e,t,n){void 0===n&&(n=s);var r,o={placement:"bottom",orderedModifiers:[],options:Object.assign({},eD,s),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},i=[],l=!1,u={state:o,setOptions:function(n){var r,l,c,d,p,h="function"==typeof n?n(o.options):n;f(),o.options=Object.assign({},s,o.options,h),o.scrollParents={reference:N(e)?ey(e):e.contextElement?ey(e.contextElement):[],popper:ey(t)};var m=(l=Object.keys(r=[].concat(a,o.options.modifiers).reduce(function(e,t){var n=e[t.name];return e[t.name]=n?Object.assign({},n,t,{options:Object.assign({},n.options,t.options),data:Object.assign({},n.data,t.data)}):t,e},{})).map(function(e){return r[e]}),c=new Map,d=new Set,p=[],l.forEach(function(e){c.set(e.name,e)}),l.forEach(function(e){d.has(e.name)||function e(t){d.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach(function(t){if(!d.has(t)){var n=c.get(t);n&&e(n)}}),p.push(t)}(e)}),ei.reduce(function(e,t){return e.concat(p.filter(function(e){return e.phase===t}))},[]));return o.orderedModifiers=m.filter(function(e){return e.enabled}),o.orderedModifiers.forEach(function(e){var t=e.name,n=e.options,r=e.effect;if("function"==typeof r){var a=r({state:o,name:t,instance:u,options:void 0===n?{}:n});i.push(a||function(){})}}),u.update()},forceUpdate:function(){if(!l){var e,t,n,r,a,i,s,f,c,d,p,h,m=o.elements,v=m.reference,g=m.popper;if(eS(v,g)){o.rects={reference:(t=U(g),n="fixed"===o.options.strategy,r=Z(t),f=Z(t)&&(i=M((a=t.getBoundingClientRect()).width)/t.offsetWidth||1,s=M(a.height)/t.offsetHeight||1,1!==i||1!==s),c=W(t),d=$(v,f,n),p={scrollLeft:0,scrollTop:0},h={x:0,y:0},(r||!r&&!n)&&(("body"!==I(t)||eg(c))&&(p=(e=t)!==C(e)&&Z(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:em(e)),Z(t)?(h=$(t,!0),h.x+=t.clientLeft,h.y+=t.clientTop):c&&(h.x=ev(c))),{x:d.left+p.scrollLeft-h.x,y:d.top+p.scrollTop-h.y,width:d.width,height:d.height}),popper:L(g)},o.reset=!1,o.placement=o.options.placement,o.orderedModifiers.forEach(function(e){return o.modifiersData[e.name]=Object.assign({},e.data)});for(var y=0;yvoid 0},eP={name:"ariaDescribedBy",enabled:!0,phase:"afterWrite",effect:({state:e})=>()=>{let{reference:t,popper:n}=e.elements;if("removeAttribute"in t){let e=(t.getAttribute("aria-describedby")||"").split(",").filter(e=>e.trim()!==n.id);e.length?t.setAttribute("aria-describedby",e.join(",")):t.removeAttribute("aria-describedby")}},fn:({state:e})=>{var t;let{popper:n,reference:r}=e.elements,o=null==(t=n.getAttribute("role"))?void 0:t.toLowerCase();if(n.id&&"tooltip"===o&&"setAttribute"in r){let e=r.getAttribute("aria-describedby");if(e&&-1!==e.split(",").indexOf(n.id))return;r.setAttribute("aria-describedby",e?`${e},${n.id}`:n.id)}}},eT=[];var ek=function(e,t,n={}){let{enabled:r=!0,placement:o="bottom",strategy:a="absolute",modifiers:i=eT}=n,s=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r=0||(o[n]=e[n]);return o}(n,eN),l=(0,c.useRef)(i),u=(0,c.useRef)(),f=(0,c.useCallback)(()=>{var e;null==(e=u.current)||e.update()},[]),d=(0,c.useCallback)(()=>{var e;null==(e=u.current)||e.forceUpdate()},[]),[p,h]=D((0,c.useState)({placement:o,update:f,forceUpdate:d,attributes:{},styles:{popper:{},arrow:{}}})),m=(0,c.useMemo)(()=>({name:"updateStateModifier",enabled:!0,phase:"write",requires:["computeStyles"],fn:({state:e})=>{let t={},n={};Object.keys(e.elements).forEach(r=>{t[r]=e.styles[r],n[r]=e.attributes[r]}),h({state:e,styles:t,attributes:n,update:f,forceUpdate:d,placement:e.placement})}}),[f,d,h]),v=(0,c.useMemo)(()=>(E(l.current,i)||(l.current=i),l.current),[i]);return(0,c.useEffect)(()=>{u.current&&r&&u.current.setOptions({placement:o,strategy:a,modifiers:[...v,m,eZ]})},[a,o,m,r,v]),(0,c.useEffect)(()=>{if(r&&null!=e&&null!=t)return u.current=eC(e,t,Object.assign({},s,{placement:o,strategy:a,modifiers:[...v,eP,m]})),()=>{null!=u.current&&(u.current.destroy(),u.current=void 0,h(e=>Object.assign({},e,{attributes:{},styles:{popper:{}}})))}},[r,e,t]),p},eM=n(7937),eR=n(8342),eA=n(6575);let e$=()=>{},eL=e=>e&&("current"in e?e.current:e),e_={click:"mousedown",mouseup:"mousedown",pointerup:"pointerdown"};var eI=function(e,t=e$,{disabled:n,clickTrigger:r="click"}={}){let o=(0,c.useRef)(!1),a=(0,c.useRef)(!1),i=(0,c.useCallback)(t=>{let n=eL(e);h()(!!n,"ClickOutside captured a close event but does not have a ref to compare it to. useClickOutside(), should be passed a ref that resolves to a DOM node"),o.current=!n||!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)||0!==t.button||!!(0,l.Z)(n,t.target)||a.current,a.current=!1},[e]),s=(0,eA.Z)(t=>{let n=eL(e);n&&(0,l.Z)(n,t.target)&&(a.current=!0)}),u=(0,eA.Z)(e=>{o.current||t(e)});(0,c.useEffect)(()=>{var t,o;if(n||null==e)return;let a=(0,eR.Z)(eL(e)),l=a.defaultView||window,f=null!=(t=l.event)?t:null==(o=l.parent)?void 0:o.event,c=null;e_[r]&&(c=(0,eM.Z)(a,e_[r],s,!0));let d=(0,eM.Z)(a,r,i,!0),p=(0,eM.Z)(a,r,e=>{if(e===f){f=void 0;return}u(e)}),h=[];return"ontouchstart"in a.documentElement&&(h=[].slice.call(a.body.children).map(e=>(0,eM.Z)(e,"mousemove",e$))),()=>{null==c||c(),d(),p(),h.forEach(e=>e())}},[e,n,r,i,s,u])},eF=n(663);let eW=()=>{};var eB=function(e,t,{disabled:n,clickTrigger:r}={}){let o=t||eW;eI(e,o,{disabled:n,clickTrigger:r});let a=(0,eA.Z)(e=>{(0,eF.k)(e)&&o(e)});(0,c.useEffect)(()=>{if(n||null==e)return;let t=(0,eR.Z)(eL(e)),r=(t.defaultView||window).event,o=(0,eM.Z)(t,"keyup",e=>{if(e===r){r=void 0;return}a(e)});return()=>{o()}},[e,n,a])},eH=n(8821),eU=n(3774);let eX=c.forwardRef((e,t)=>{let{flip:n,offset:r,placement:o,containerPadding:a,popperConfig:i={},transition:s,runTransition:l}=e,[u,f]=(0,x.Z)(),[d,p]=(0,x.Z)(),h=(0,v.Z)(f,t),m=(0,eH.Z)(e.container),g=(0,eH.Z)(e.target),[y,w]=(0,c.useState)(!e.show),O=ek(g,u,function({enabled:e,enableEvents:t,placement:n,flip:r,offset:o,fixed:a,containerPadding:i,arrowElement:s,popperConfig:l={}}){var u,f,c,d,p;let h=function(e){let t={};return Array.isArray(e)?(null==e||e.forEach(e=>{t[e.name]=e}),t):e||t}(l.modifiers);return Object.assign({},l,{placement:n,enabled:e,strategy:a?"fixed":l.strategy,modifiers:function(e={}){return Array.isArray(e)?e:Object.keys(e).map(t=>(e[t].name=t,e[t]))}(Object.assign({},h,{eventListeners:{enabled:t,options:null==(u=h.eventListeners)?void 0:u.options},preventOverflow:Object.assign({},h.preventOverflow,{options:i?Object.assign({padding:i},null==(f=h.preventOverflow)?void 0:f.options):null==(c=h.preventOverflow)?void 0:c.options}),offset:{options:Object.assign({offset:o},null==(d=h.offset)?void 0:d.options)},arrow:Object.assign({},h.arrow,{enabled:!!s,options:Object.assign({},null==(p=h.arrow)?void 0:p.options,{element:s})}),flip:Object.assign({enabled:!!r},h.flip)}))})}({placement:o,enableEvents:!!e.show,containerPadding:a||5,flip:n,offset:r,arrowElement:d,popperConfig:i}));e.show&&y&&w(!1);let E=e.show||!y;if(eB(u,e.onHide,{disabled:!e.rootClose||e.rootCloseDisabled,clickTrigger:e.rootCloseEvent}),!E)return null;let{onExit:j,onExiting:D,onEnter:S,onEntering:C,onEntered:N}=e,Z=e.children(Object.assign({},O.attributes.popper,{style:O.styles.popper,ref:h}),{popper:O,placement:o,show:!!e.show,arrowProps:Object.assign({},O.attributes.arrow,{style:O.styles.arrow,ref:p})});return Z=(0,eU.sD)(s,l,{in:!!e.show,appear:!0,mountOnEnter:!0,unmountOnExit:!0,children:Z,onExit:j,onExiting:D,onExited:(...t)=>{w(!0),e.onExited&&e.onExited(...t)},onEnter:S,onEntering:C,onEntered:N}),m?b.createPortal(Z,m):null});eX.displayName="Overlay";var eV=n(6160),eY=n(9523),eK=n(7885),ez=n(4948),eq=n(8760),eG=n(2073),eJ=n(1527);let eQ=c.forwardRef(({bsPrefix:e,placement:t="right",className:n,style:r,children:o,arrowProps:a,hasDoneInitialMeasure:i,popper:s,show:l,...u},f)=>{e=(0,eK.vE)(e,"tooltip");let c=(0,eK.SC)(),[d]=(null==t?void 0:t.split("-"))||[],p=(0,eq.z)(d,c),h=r;return l&&!i&&(h={...r,...(0,eG.Z)(null==s?void 0:s.strategy)}),(0,eJ.jsxs)("div",{ref:f,style:h,role:"tooltip","x-placement":d,className:y()(n,e,`bs-tooltip-${p}`),...u,children:[(0,eJ.jsx)("div",{className:"tooltip-arrow",...a}),(0,eJ.jsx)("div",{className:`${e}-inner`,children:o})]})});eQ.displayName="Tooltip";var e0=Object.assign(eQ,{TOOLTIP_OFFSET:[0,6]}),e1=n(4281),e5=n(9843);let e7=c.forwardRef(({children:e,transition:t=e1.Z,popperConfig:n={},rootClose:r=!1,placement:o="top",show:a=!1,...i},s)=>{let l=(0,c.useRef)({}),[u,f]=(0,c.useState)(null),[d,p]=function(e){let t=(0,c.useRef)(null),n=(0,eK.vE)(void 0,"popover"),r=(0,eK.vE)(void 0,"tooltip"),o=(0,c.useMemo)(()=>({name:"offset",options:{offset:()=>{if(e)return e;if(t.current){if((0,eY.Z)(t.current,n))return ez.Z.POPPER_OFFSET;if((0,eY.Z)(t.current,r))return e0.TOOLTIP_OFFSET}return[0,0]}}}),[e,n,r]);return[t,[o]]}(i.offset),h=(0,v.Z)(s,d),m=!0===t?e1.Z:t||void 0,g=(0,eA.Z)(e=>{f(e),null==n||null==n.onFirstUpdate||n.onFirstUpdate(e)});return(0,eV.Z)(()=>{u&&i.target&&(null==l.current.scheduleUpdate||l.current.scheduleUpdate())},[u,i.target]),(0,c.useEffect)(()=>{a||f(null)},[a]),(0,eJ.jsx)(eX,{...i,ref:h,popperConfig:{...n,modifiers:p.concat(n.modifiers||[]),onFirstUpdate:g},transition:m,rootClose:r,placement:o,show:a,children:(r,{arrowProps:o,popper:a,show:i})=>{var s,f;!function(e,t){let{ref:n}=e,{ref:r}=t;e.ref=n.__wrapped||(n.__wrapped=e=>n((0,e5.Z)(e))),t.ref=r.__wrapped||(r.__wrapped=e=>r((0,e5.Z)(e)))}(r,o);let d=null==a?void 0:a.placement,p=Object.assign(l.current,{state:null==a?void 0:a.state,scheduleUpdate:null==a?void 0:a.update,placement:d,outOfBoundaries:(null==a?void 0:null==(s=a.state)?void 0:null==(f=s.modifiersData.hide)?void 0:f.isReferenceHidden)||!1,strategy:n.strategy}),h=!!u;return"function"==typeof e?e({...r,placement:d,show:i,...!t&&i&&{className:"show"},popper:p,arrowProps:o,hasDoneInitialMeasure:h}):c.cloneElement(e,{...r,placement:d,arrowProps:o,popper:p,hasDoneInitialMeasure:h,className:y()(e.props.className,!t&&i&&"show"),style:{...e.props.style,...r.style}})}})});function e9(e,t,n){let[r]=t,o=r.currentTarget,a=r.relatedTarget||r.nativeEvent[n];a&&a===o||(0,l.Z)(o,a)||e(...t)}e7.displayName="Overlay",f().oneOf(["click","hover","focus"]);var e4=({trigger:e=["hover","focus"],overlay:t,children:n,popperConfig:r={},show:o,defaultShow:a=!1,onToggle:i,delay:s,placement:l,flip:u=l&&-1!==l.indexOf("auto"),...f})=>{let p=(0,c.useRef)(null),h=(0,v.Z)(p,n.ref),g=(0,d.Z)(),y=(0,c.useRef)(""),[b,x]=(0,m.$c)(o,a,i),w=s&&"object"==typeof s?s:{show:s,hide:s},{onFocus:O,onBlur:E,onClick:j}="function"!=typeof n?c.Children.only(n).props:{},D=(0,c.useCallback)(()=>{if(g.clear(),y.current="show",!w.show){x(!0);return}g.set(()=>{"show"===y.current&&x(!0)},w.show)},[w.show,x,g]),S=(0,c.useCallback)(()=>{if(g.clear(),y.current="hide",!w.hide){x(!1);return}g.set(()=>{"hide"===y.current&&x(!1)},w.hide)},[w.hide,x,g]),C=(0,c.useCallback)((...e)=>{D(),null==O||O(...e)},[D,O]),N=(0,c.useCallback)((...e)=>{S(),null==E||E(...e)},[S,E]),Z=(0,c.useCallback)((...e)=>{x(!b),null==j||j(...e)},[j,x,b]),P=(0,c.useCallback)((...e)=>{e9(D,e,"fromElement")},[D]),T=(0,c.useCallback)((...e)=>{e9(S,e,"toElement")},[S]),k=null==e?[]:[].concat(e),M={ref:e=>{h((0,e5.Z)(e))}};return -1!==k.indexOf("click")&&(M.onClick=Z),-1!==k.indexOf("focus")&&(M.onFocus=C,M.onBlur=N),-1!==k.indexOf("hover")&&(M.onMouseOver=P,M.onMouseOut=T),(0,eJ.jsxs)(eJ.Fragment,{children:["function"==typeof n?n(M):(0,c.cloneElement)(n,M),(0,eJ.jsx)(e7,{...f,show:b,onHide:S,flip:u,placement:l,popperConfig:r,target:p.current,children:t})]})}},4948:function(e,t,n){n.d(t,{Z:function(){return d}});var r=n(4875),o=n.n(r),a=n(959),i=n(7885),s=n(1527);let l=a.forwardRef(({className:e,bsPrefix:t,as:n="div",...r},a)=>(t=(0,i.vE)(t,"popover-header"),(0,s.jsx)(n,{ref:a,className:o()(e,t),...r})));l.displayName="PopoverHeader";let u=a.forwardRef(({className:e,bsPrefix:t,as:n="div",...r},a)=>(t=(0,i.vE)(t,"popover-body"),(0,s.jsx)(n,{ref:a,className:o()(e,t),...r})));u.displayName="PopoverBody";var f=n(8760),c=n(2073),d=Object.assign(a.forwardRef(({bsPrefix:e,placement:t="right",className:n,style:r,children:a,body:l,arrowProps:d,hasDoneInitialMeasure:p,popper:h,show:m,...v},g)=>{let y=(0,i.vE)(e,"popover"),b=(0,i.SC)(),[x]=(null==t?void 0:t.split("-"))||[],w=(0,f.z)(x,b),O=r;return m&&!p&&(O={...r,...(0,c.Z)(null==h?void 0:h.strategy)}),(0,s.jsxs)("div",{ref:g,role:"tooltip",style:O,"x-placement":x,className:o()(n,y,x&&`bs-popover-${w}`),...v,children:[(0,s.jsx)("div",{className:"popover-arrow",...d}),l?(0,s.jsx)(u,{children:a}):a]})}),{Header:l,Body:u,POPPER_OFFSET:[0,8]})},6229:function(e,t,n){var r=n(4875),o=n.n(r),a=n(959),i=n(7885),s=n(1527);let l=a.forwardRef(({bsPrefix:e,className:t,as:n="div",...r},a)=>{let l=(0,i.vE)(e,"row"),u=(0,i.pi)(),f=(0,i.zG)(),c=`${l}-cols`,d=[];return u.forEach(e=>{let t;let n=r[e];delete r[e],null!=n&&"object"==typeof n?{cols:t}=n:t=n;let o=e!==f?`-${e}`:"";null!=t&&d.push(`${c}${o}-${t}`)}),(0,s.jsx)(n,{ref:a,...r,className:o()(t,l,...d)})});l.displayName="Row",t.Z=l},7142:function(e,t,n){var r=n(4875),o=n.n(r),a=n(959),i=n(7885),s=n(1527);let l=a.forwardRef(({bsPrefix:e,variant:t,animation:n="border",size:r,as:a="div",className:l,...u},f)=>{e=(0,i.vE)(e,"spinner");let c=`${e}-${n}`;return(0,s.jsx)(a,{ref:f,...u,className:o()(l,c,r&&`${c}-${r}`,t&&`text-${t}`)})});l.displayName="Spinner",t.Z=l},3603:function(e,t,n){n.d(t,{Z:function(){return p}});var r=n(507),o=n.n(r);n(959);var a=n(7031),i=n(3207),s=n(1527);let l=({transition:e,...t})=>(0,s.jsx)(a.Z,{...t,transition:(0,i.Z)(e)});l.displayName="TabContainer";var u=n(3942),f=n(3470);let c={eventKey:o().oneOfType([o().string,o().number]),title:o().node.isRequired,disabled:o().bool,tabClassName:o().string,tabAttrs:o().object},d=()=>{throw Error("ReactBootstrap: The `Tab` component is not meant to be rendered! It's an abstract component that is only valid as a direct Child of the `Tabs` Component. For custom tabs components use TabPane and TabsContainer directly")};d.propTypes=c;var p=Object.assign(d,{Container:l,Content:u.Z,Pane:f.Z})},3942:function(e,t,n){var r=n(959),o=n(4875),a=n.n(o),i=n(7885),s=n(1527);let l=r.forwardRef(({className:e,bsPrefix:t,as:n="div",...r},o)=>(t=(0,i.vE)(t,"tab-content"),(0,s.jsx)(n,{ref:o,className:a()(e,t),...r})));l.displayName="TabContent",t.Z=l},3470:function(e,t,n){var r=n(4875),o=n.n(r),a=n(959),i=n(3439),s=n(3503),l=n(7468),u=n(7885),f=n(4281),c=n(3207),d=n(1527);let p=a.forwardRef(({bsPrefix:e,transition:t,...n},r)=>{let[{className:a,as:p="div",...h},{isActive:m,onEnter:v,onEntering:g,onEntered:y,onExit:b,onExiting:x,onExited:w,mountOnEnter:O,unmountOnExit:E,transition:j=f.Z}]=(0,l.W)({...n,transition:(0,c.Z)(t)}),D=(0,u.vE)(e,"tab-pane");return(0,d.jsx)(s.Z.Provider,{value:null,children:(0,d.jsx)(i.Z.Provider,{value:null,children:(0,d.jsx)(j,{in:m,onEnter:v,onEntering:g,onEntered:y,onExit:b,onExiting:x,onExited:w,mountOnEnter:O,unmountOnExit:E,children:(0,d.jsx)(p,{...h,ref:r,className:o()(a,D,m&&"active")})})})})});p.displayName="TabPane",t.Z=p},384:function(e,t,n){n(959);var r=n(3549),o=n(7031),a=n(712),i=n(9069),s=n(2772),l=n(3942),u=n(3470),f=n(3988),c=n(3207),d=n(1527);function p(e){let{title:t,eventKey:n,disabled:r,tabClassName:o,tabAttrs:a,id:l}=e.props;return null==t?null:(0,d.jsx)(s.Z,{as:"li",role:"presentation",children:(0,d.jsx)(i.Z,{as:"button",type:"button",eventKey:n,disabled:r,id:l,className:o,...a,children:t})})}let h=e=>{let t;let{id:n,onSelect:i,transition:s,mountOnEnter:h=!1,unmountOnExit:m=!1,variant:v="tabs",children:g,activeKey:y=((0,f.Ed)(g,e=>{null==t&&(t=e.props.eventKey)}),t),...b}=(0,r.Ch)(e,{activeKey:"onSelect"});return(0,d.jsxs)(o.Z,{id:n,activeKey:y,onSelect:i,transition:(0,c.Z)(s),mountOnEnter:h,unmountOnExit:m,children:[(0,d.jsx)(a.Z,{...b,role:"tablist",as:"ul",variant:v,children:(0,f.UI)(g,p)}),(0,d.jsx)(l.Z,{children:(0,f.UI)(g,e=>{let t={...e.props};return delete t.title,delete t.disabled,delete t.tabClassName,delete t.tabAttrs,(0,d.jsx)(u.Z,{...t})})})]})};h.displayName="Tabs",t.Z=h},4637:function(e,t,n){n.d(t,{Z:function(){return x}});var r=n(959),o=n(4875),a=n.n(o),i=n(2447),s=n(7691),l=n(4281),u=n(1527);let f={[s.d0]:"showing",[s.Ix]:"showing show"},c=r.forwardRef((e,t)=>(0,u.jsx)(l.Z,{...e,ref:t,transitionClasses:f}));c.displayName="ToastFade";var d=c,p=n(6575),h=n(7885),m=n(7657);let v=r.createContext({onClose(){}}),g=r.forwardRef(({bsPrefix:e,closeLabel:t="Close",closeVariant:n,closeButton:o=!0,className:i,children:s,...l},f)=>{e=(0,h.vE)(e,"toast-header");let c=(0,r.useContext)(v),d=(0,p.Z)(e=>{null==c||null==c.onClose||c.onClose(e)});return(0,u.jsxs)("div",{ref:f,...l,className:a()(e,i),children:[s,o&&(0,u.jsx)(m.Z,{"aria-label":t,variant:n,onClick:d,"data-dismiss":"toast"})]})});g.displayName="ToastHeader";let y=r.forwardRef(({className:e,bsPrefix:t,as:n="div",...r},o)=>(t=(0,h.vE)(t,"toast-body"),(0,u.jsx)(n,{ref:o,className:a()(e,t),...r})));y.displayName="ToastBody";let b=r.forwardRef(({bsPrefix:e,className:t,transition:n=d,show:o=!0,animation:s=!0,delay:l=5e3,autohide:f=!1,onClose:c,onEntered:p,onExit:m,onExiting:g,onEnter:y,onEntering:b,onExited:x,bg:w,...O},E)=>{e=(0,h.vE)(e,"toast");let j=(0,r.useRef)(l),D=(0,r.useRef)(c);(0,r.useEffect)(()=>{j.current=l,D.current=c},[l,c]);let S=(0,i.Z)(),C=!!(f&&o),N=(0,r.useCallback)(()=>{C&&(null==D.current||D.current())},[C]);(0,r.useEffect)(()=>{S.set(N,j.current)},[S,N]);let Z=(0,r.useMemo)(()=>({onClose:c}),[c]),P=!!(n&&s),T=(0,u.jsx)("div",{...O,ref:E,className:a()(e,t,w&&`bg-${w}`,!P&&(o?"show":"hide")),role:"alert","aria-live":"assertive","aria-atomic":"true"});return(0,u.jsx)(v.Provider,{value:Z,children:P&&n?(0,u.jsx)(n,{in:o,onEnter:y,onEntering:b,onEntered:p,onExit:m,onExiting:g,onExited:x,unmountOnExit:!0,children:T}):T})});b.displayName="Toast";var x=Object.assign(b,{Body:y,Header:g})},2073:function(e,t,n){n.d(t,{Z:function(){return r}});function r(e="absolute"){return{position:e,top:"0",left:"0",opacity:"0",pointerEvents:"none"}}},3207:function(e,t,n){n.d(t,{Z:function(){return a}});var r=n(3233),o=n(4281);function a(e){return"boolean"==typeof e?e?o.Z:r.Z:e}},8760:function(e,t,n){function r(e,t){let n=e;return"left"===e?n=t?"end":"start":"right"===e&&(n=t?"start":"end"),n}n.d(t,{z:function(){return r}}),n(959)},2537:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"DraggableCore",{enumerable:!0,get:function(){return f.default}}),t.default=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=p(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var i=o?Object.getOwnPropertyDescriptor(e,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}(n(959)),o=d(n(507)),a=d(n(422)),i=d(n(5924)),s=n(6843),l=n(8260),u=n(1794),f=d(n(6921)),c=d(n(556));function d(e){return e&&e.__esModule?e:{default:e}}function p(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(p=function(e){return e?n:t})(e)}function h(){return(h=Object.assign?Object.assign.bind():function(e){for(var t=1;t{if((0,c.default)("Draggable: onDragStart: %j",t),!1===this.props.onStart(e,(0,l.createDraggableData)(this,t)))return!1;this.setState({dragging:!0,dragged:!0})}),m(this,"onDrag",(e,t)=>{if(!this.state.dragging)return!1;(0,c.default)("Draggable: onDrag: %j",t);let n=(0,l.createDraggableData)(this,t),r={x:n.x,y:n.y,slackX:0,slackY:0};if(this.props.bounds){let{x:e,y:t}=r;r.x+=this.state.slackX,r.y+=this.state.slackY;let[o,a]=(0,l.getBoundPosition)(this,r.x,r.y);r.x=o,r.y=a,r.slackX=this.state.slackX+(e-r.x),r.slackY=this.state.slackY+(t-r.y),n.x=r.x,n.y=r.y,n.deltaX=r.x-this.state.x,n.deltaY=r.y-this.state.y}if(!1===this.props.onDrag(e,n))return!1;this.setState(r)}),m(this,"onDragStop",(e,t)=>{if(!this.state.dragging||!1===this.props.onStop(e,(0,l.createDraggableData)(this,t)))return!1;(0,c.default)("Draggable: onDragStop: %j",t);let n={dragging:!1,slackX:0,slackY:0};if(this.props.position){let{x:e,y:t}=this.props.position;n.x=e,n.y=t}this.setState(n)}),this.state={dragging:!1,dragged:!1,x:e.position?e.position.x:e.defaultPosition.x,y:e.position?e.position.y:e.defaultPosition.y,prevPropsPosition:{...e.position},slackX:0,slackY:0,isElementSVG:!1},e.position&&!(e.onDrag||e.onStop)&&console.warn("A `position` was applied to this , without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){void 0!==window.SVGElement&&this.findDOMNode() instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.setState({dragging:!1})}findDOMNode(){var e,t;return null!==(e=null===(t=this.props)||void 0===t||null===(t=t.nodeRef)||void 0===t?void 0:t.current)&&void 0!==e?e:a.default.findDOMNode(this)}render(){let{axis:e,bounds:t,children:n,defaultPosition:o,defaultClassName:a,defaultClassNameDragging:u,defaultClassNameDragged:c,position:d,positionOffset:p,scale:m,...v}=this.props,g={},y=null,b=!d||this.state.dragging,x=d||o,w={x:(0,l.canDragX)(this)&&b?this.state.x:x.x,y:(0,l.canDragY)(this)&&b?this.state.y:x.y};this.state.isElementSVG?y=(0,s.createSVGTransform)(w,p):g=(0,s.createCSSTransform)(w,p);let O=(0,i.default)(n.props.className||"",a,{[u]:this.state.dragging,[c]:this.state.dragged});return r.createElement(f.default,h({},v,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),r.cloneElement(r.Children.only(n),{className:O,style:{...n.props.style,...g},transform:y}))}}t.default=v,m(v,"displayName","Draggable"),m(v,"propTypes",{...f.default.propTypes,axis:o.default.oneOf(["both","x","y","none"]),bounds:o.default.oneOfType([o.default.shape({left:o.default.number,right:o.default.number,top:o.default.number,bottom:o.default.number}),o.default.string,o.default.oneOf([!1])]),defaultClassName:o.default.string,defaultClassNameDragging:o.default.string,defaultClassNameDragged:o.default.string,defaultPosition:o.default.shape({x:o.default.number,y:o.default.number}),positionOffset:o.default.shape({x:o.default.oneOfType([o.default.number,o.default.string]),y:o.default.oneOfType([o.default.number,o.default.string])}),position:o.default.shape({x:o.default.number,y:o.default.number}),className:u.dontSetMe,style:u.dontSetMe,transform:u.dontSetMe}),m(v,"defaultProps",{...f.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})},6921:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=c(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var i=o?Object.getOwnPropertyDescriptor(e,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}(n(959)),o=f(n(507)),a=f(n(422)),i=n(6843),s=n(8260),l=n(1794),u=f(n(556));function f(e){return e&&e.__esModule?e:{default:e}}function c(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(c=function(e){return e?n:t})(e)}function d(e,t,n){var r;return(t="symbol"==typeof(r=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?r:String(r))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let p={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}},h=p.mouse;class m extends r.Component{constructor(){super(...arguments),d(this,"dragging",!1),d(this,"lastX",NaN),d(this,"lastY",NaN),d(this,"touchIdentifier",null),d(this,"mounted",!1),d(this,"handleDragStart",e=>{if(this.props.onMouseDown(e),!this.props.allowAnyClick&&"number"==typeof e.button&&0!==e.button)return!1;let t=this.findDOMNode();if(!t||!t.ownerDocument||!t.ownerDocument.body)throw Error(" not mounted on DragStart!");let{ownerDocument:n}=t;if(this.props.disabled||!(e.target instanceof n.defaultView.Node)||this.props.handle&&!(0,i.matchesSelectorAndParentsTo)(e.target,this.props.handle,t)||this.props.cancel&&(0,i.matchesSelectorAndParentsTo)(e.target,this.props.cancel,t))return;"touchstart"===e.type&&e.preventDefault();let r=(0,i.getTouchIdentifier)(e);this.touchIdentifier=r;let o=(0,s.getControlPosition)(e,r,this);if(null==o)return;let{x:a,y:l}=o,f=(0,s.createCoreData)(this,a,l);(0,u.default)("DraggableCore: handleDragStart: %j",f),(0,u.default)("calling",this.props.onStart),!1!==this.props.onStart(e,f)&&!1!==this.mounted&&(this.props.enableUserSelectHack&&(0,i.addUserSelectStyles)(n),this.dragging=!0,this.lastX=a,this.lastY=l,(0,i.addEvent)(n,h.move,this.handleDrag),(0,i.addEvent)(n,h.stop,this.handleDragStop))}),d(this,"handleDrag",e=>{let t=(0,s.getControlPosition)(e,this.touchIdentifier,this);if(null==t)return;let{x:n,y:r}=t;if(Array.isArray(this.props.grid)){let e=n-this.lastX,t=r-this.lastY;if([e,t]=(0,s.snapToGrid)(this.props.grid,e,t),!e&&!t)return;n=this.lastX+e,r=this.lastY+t}let o=(0,s.createCoreData)(this,n,r);if((0,u.default)("DraggableCore: handleDrag: %j",o),!1===this.props.onDrag(e,o)||!1===this.mounted){try{this.handleDragStop(new MouseEvent("mouseup"))}catch(t){let e=document.createEvent("MouseEvents");e.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(e)}return}this.lastX=n,this.lastY=r}),d(this,"handleDragStop",e=>{if(!this.dragging)return;let t=(0,s.getControlPosition)(e,this.touchIdentifier,this);if(null==t)return;let{x:n,y:r}=t;if(Array.isArray(this.props.grid)){let e=n-this.lastX||0,t=r-this.lastY||0;[e,t]=(0,s.snapToGrid)(this.props.grid,e,t),n=this.lastX+e,r=this.lastY+t}let o=(0,s.createCoreData)(this,n,r);if(!1===this.props.onStop(e,o)||!1===this.mounted)return!1;let a=this.findDOMNode();a&&this.props.enableUserSelectHack&&(0,i.removeUserSelectStyles)(a.ownerDocument),(0,u.default)("DraggableCore: handleDragStop: %j",o),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,a&&((0,u.default)("DraggableCore: Removing handlers"),(0,i.removeEvent)(a.ownerDocument,h.move,this.handleDrag),(0,i.removeEvent)(a.ownerDocument,h.stop,this.handleDragStop))}),d(this,"onMouseDown",e=>(h=p.mouse,this.handleDragStart(e))),d(this,"onMouseUp",e=>(h=p.mouse,this.handleDragStop(e))),d(this,"onTouchStart",e=>(h=p.touch,this.handleDragStart(e))),d(this,"onTouchEnd",e=>(h=p.touch,this.handleDragStop(e)))}componentDidMount(){this.mounted=!0;let e=this.findDOMNode();e&&(0,i.addEvent)(e,p.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;let e=this.findDOMNode();if(e){let{ownerDocument:t}=e;(0,i.removeEvent)(t,p.mouse.move,this.handleDrag),(0,i.removeEvent)(t,p.touch.move,this.handleDrag),(0,i.removeEvent)(t,p.mouse.stop,this.handleDragStop),(0,i.removeEvent)(t,p.touch.stop,this.handleDragStop),(0,i.removeEvent)(e,p.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,i.removeUserSelectStyles)(t)}}findDOMNode(){var e,t;return null!==(e=this.props)&&void 0!==e&&e.nodeRef?null===(t=this.props)||void 0===t||null===(t=t.nodeRef)||void 0===t?void 0:t.current:a.default.findDOMNode(this)}render(){return r.cloneElement(r.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}}t.default=m,d(m,"displayName","DraggableCore"),d(m,"propTypes",{allowAnyClick:o.default.bool,children:o.default.node.isRequired,disabled:o.default.bool,enableUserSelectHack:o.default.bool,offsetParent:function(e,t){if(e[t]&&1!==e[t].nodeType)throw Error("Draggable's offsetParent must be a DOM Node.")},grid:o.default.arrayOf(o.default.number),handle:o.default.string,cancel:o.default.string,nodeRef:o.default.object,onStart:o.default.func,onDrag:o.default.func,onStop:o.default.func,onMouseDown:o.default.func,scale:o.default.number,className:l.dontSetMe,style:l.dontSetMe,transform:l.dontSetMe}),d(m,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1})},6871:function(e,t,n){let{default:r,DraggableCore:o}=n(2537);e.exports=r,e.exports.default=r,e.exports.DraggableCore=o},6843:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.addClassName=u,t.addEvent=function(e,t,n,r){if(!e)return;let o={capture:!0,...r};e.addEventListener?e.addEventListener(t,n,o):e.attachEvent?e.attachEvent("on"+t,n):e["on"+t]=n},t.addUserSelectStyles=function(e){if(!e)return;let t=e.getElementById("react-draggable-style-el");t||((t=e.createElement("style")).type="text/css",t.id="react-draggable-style-el",t.innerHTML=".react-draggable-transparent-selection *::-moz-selection {all: inherit;}\n",t.innerHTML+=".react-draggable-transparent-selection *::selection {all: inherit;}\n",e.getElementsByTagName("head")[0].appendChild(t)),e.body&&u(e.body,"react-draggable-transparent-selection")},t.createCSSTransform=function(e,t){let n=l(e,t,"px");return{[(0,o.browserPrefixToKey)("transform",o.default)]:n}},t.createSVGTransform=function(e,t){return l(e,t,"")},t.getTouch=function(e,t){return e.targetTouches&&(0,r.findInArray)(e.targetTouches,e=>t===e.identifier)||e.changedTouches&&(0,r.findInArray)(e.changedTouches,e=>t===e.identifier)},t.getTouchIdentifier=function(e){return e.targetTouches&&e.targetTouches[0]?e.targetTouches[0].identifier:e.changedTouches&&e.changedTouches[0]?e.changedTouches[0].identifier:void 0},t.getTranslation=l,t.innerHeight=function(e){let t=e.clientHeight,n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,r.int)(n.paddingTop),t-=(0,r.int)(n.paddingBottom)},t.innerWidth=function(e){let t=e.clientWidth,n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,r.int)(n.paddingLeft),t-=(0,r.int)(n.paddingRight)},t.matchesSelector=s,t.matchesSelectorAndParentsTo=function(e,t,n){let r=e;do{if(s(r,t))return!0;if(r===n)break;r=r.parentNode}while(r);return!1},t.offsetXYFromParent=function(e,t,n){let r=t===t.ownerDocument.body?{left:0,top:0}:t.getBoundingClientRect();return{x:(e.clientX+t.scrollLeft-r.left)/n,y:(e.clientY+t.scrollTop-r.top)/n}},t.outerHeight=function(e){let t=e.clientHeight,n=e.ownerDocument.defaultView.getComputedStyle(e);return t+((0,r.int)(n.borderTopWidth)+(0,r.int)(n.borderBottomWidth))},t.outerWidth=function(e){let t=e.clientWidth,n=e.ownerDocument.defaultView.getComputedStyle(e);return t+((0,r.int)(n.borderLeftWidth)+(0,r.int)(n.borderRightWidth))},t.removeClassName=f,t.removeEvent=function(e,t,n,r){if(!e)return;let o={capture:!0,...r};e.removeEventListener?e.removeEventListener(t,n,o):e.detachEvent?e.detachEvent("on"+t,n):e["on"+t]=null},t.removeUserSelectStyles=function(e){if(e)try{if(e.body&&f(e.body,"react-draggable-transparent-selection"),e.selection)e.selection.empty();else{let t=(e.defaultView||window).getSelection();t&&"Caret"!==t.type&&t.removeAllRanges()}}catch(e){}};var r=n(1794),o=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=a(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}(n(3266));function a(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(a=function(e){return e?n:t})(e)}let i="";function s(e,t){return i||(i=(0,r.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(t){return(0,r.isFunction)(e[t])})),!!(0,r.isFunction)(e[i])&&e[i](t)}function l(e,t,n){let{x:r,y:o}=e,a="translate(".concat(r).concat(n,",").concat(o).concat(n,")");if(t){let e="".concat("string"==typeof t.x?t.x:t.x+n),r="".concat("string"==typeof t.y?t.y:t.y+n);a="translate(".concat(e,", ").concat(r,")")+a}return a}function u(e,t){e.classList?e.classList.add(t):e.className.match(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)")))||(e.className+=" ".concat(t))}function f(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(RegExp("(?:^|\\s)".concat(t,"(?!\\S)"),"g"),"")}},3266:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.browserPrefixToKey=o,t.browserPrefixToStyle=function(e,t){return t?"-".concat(t.toLowerCase(),"-").concat(e):e},t.default=void 0,t.getPrefix=r;let n=["Moz","Webkit","O","ms"];function r(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"transform";if("undefined"==typeof window)return"";let r=null===(e=window.document)||void 0===e||null===(e=e.documentElement)||void 0===e?void 0:e.style;if(!r||t in r)return"";for(let e=0;e: Unmounted during event!");return t}},1794:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.dontSetMe=function(e,t,n){if(e[t])return Error("Invalid prop ".concat(t," passed to ").concat(n," - do not set this, set it on the child."))},t.findInArray=function(e,t){for(let n=0,r=e.length;np||(e.current=d[p],d[p]=null,p--)}function g(e,t){d[++p]=e.current,e.current=t}var y=Symbol.for("react.element"),v=Symbol.for("react.portal"),b=Symbol.for("react.fragment"),k=Symbol.for("react.strict_mode"),w=Symbol.for("react.profiler"),S=Symbol.for("react.provider"),C=Symbol.for("react.context"),E=Symbol.for("react.server_context"),x=Symbol.for("react.forward_ref"),z=Symbol.for("react.suspense"),P=Symbol.for("react.suspense_list"),N=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),L=Symbol.for("react.scope");Symbol.for("react.debug_trace_mode");var T=Symbol.for("react.offscreen"),F=Symbol.for("react.legacy_hidden"),M=Symbol.for("react.cache");Symbol.for("react.tracing_marker");var O=Symbol.iterator;function R(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=O&&e[O]||e["@@iterator"])?e:null}var D=m(null),A=m(null),I=m(null),U=m(null),$={$$typeof:C,_currentValue:null,_currentValue2:null,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null};function B(e,t){switch(g(I,t),g(A,e),g(D,null),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)&&(t=t.namespaceURI)?sj(t):0;break;default:if(t=(e=8===e?t.parentNode:t).tagName,e=e.namespaceURI)t=sQ(e=sj(e),t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}h(D),g(D,t)}function V(){h(D),h(A),h(I)}function j(e){null!==e.memoizedState&&g(U,e);var t=D.current,n=sQ(t,e.type);t!==n&&(g(A,e),g(D,n))}function Q(e){A.current===e&&(h(D),h(A)),U.current===e&&(h(U),$._currentValue=null)}var W=a.unstable_scheduleCallback,H=a.unstable_cancelCallback,q=a.unstable_shouldYield,K=a.unstable_requestPaint,Y=a.unstable_now,X=a.unstable_getCurrentPriorityLevel,G=a.unstable_ImmediatePriority,Z=a.unstable_UserBlockingPriority,J=a.unstable_NormalPriority,ee=a.unstable_LowPriority,et=a.unstable_IdlePriority,en=null,er=null,el=Math.clz32?Math.clz32:function(e){return 0==(e>>>=0)?32:31-(ea(e)/eo|0)|0},ea=Math.log,eo=Math.LN2,ei=128,eu=4194304;function es(e){var t=42&e;if(0!==t)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return 4194176&e;case 4194304:case 8388608:case 16777216:case 33554432:return 62914560&e;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function ec(e,t){var n=e.pendingLanes;if(0===n)return 0;var r=0,l=e.suspendedLanes;e=e.pingedLanes;var a=134217727&n;return 0!==a?0!=(n=a&~l)?r=es(n):0!=(e&=a)&&(r=es(e)):0!=(n&=~l)?r=es(n):0!==e&&(r=es(e)),0===r?0:0!==t&&t!==r&&0==(t&l)&&((l=r&-r)>=(e=t&-t)||32===l&&0!=(4194176&e))?t:r}function ef(e,t){return e.errorRecoveryDisabledLanes&t?0:0!=(e=-536870913&e.pendingLanes)?e:536870912&e?536870912:0}function ed(){var e=eu;return 0==(62914560&(eu<<=1))&&(eu=4194304),e}function ep(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function em(e,t){e.pendingLanes|=t,268435456!==t&&(e.suspendedLanes=0,e.pingedLanes=0)}function eh(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-el(t);e.entangledLanes|=t,e.entanglements[r]=1073741824|e.entanglements[r]|4194218&n}function eg(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-el(n),l=1<l||u[r]!==s[l]){var c="\n"+u[r].replace(" at new "," at ");return e.displayName&&c.includes("")&&(c=c.replace("",e.displayName)),c}while(1<=r&&0<=l);break}}}finally{eK=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?eq(n):""}function eX(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":case"object":return e;default:return""}}function eG(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function eZ(e){e._valueTracker||(e._valueTracker=function(e){var t=eG(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&void 0!==n&&"function"==typeof n.get&&"function"==typeof n.set){var l=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(e){r=""+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function eJ(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=eG(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)}function e0(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}var e1=/[\n"\\]/g;function e2(e){return e.replace(e1,function(e){return"\\"+e.charCodeAt(0).toString(16)+" "})}function e3(e,t,n,r,l,a,o,i){e.name="",null!=o&&"function"!=typeof o&&"symbol"!=typeof o&&"boolean"!=typeof o?e.type=o:e.removeAttribute("type"),null!=t?"number"===o?(0===t&&""===e.value||e.value!=t)&&(e.value=""+eX(t)):e.value!==""+eX(t)&&(e.value=""+eX(t)):"submit"!==o&&"reset"!==o||e.removeAttribute("value"),null!=t?e6(e,o,eX(t)):null!=n?e6(e,o,eX(n)):null!=r&&e.removeAttribute("value"),null==l&&null!=a&&(e.defaultChecked=!!a),null!=l&&(e.checked=l&&"function"!=typeof l&&"symbol"!=typeof l),null!=i&&"function"!=typeof i&&"symbol"!=typeof i&&"boolean"!=typeof i?e.name=""+eX(i):e.removeAttribute("name")}function e4(e,t,n,r,l,a,o,i){if(null!=a&&"function"!=typeof a&&"symbol"!=typeof a&&"boolean"!=typeof a&&(e.type=a),null!=t||null!=n){if(!("submit"!==a&&"reset"!==a||null!=t))return;n=null!=n?""+eX(n):"",t=null!=t?""+eX(t):n,i||t===e.value||(e.value=t),e.defaultValue=t}r="function"!=typeof(r=null!=r?r:l)&&"symbol"!=typeof r&&!!r,e.checked=i?e.checked:!!r,e.defaultChecked=!!r,null!=o&&"function"!=typeof o&&"symbol"!=typeof o&&"boolean"!=typeof o&&(e.name=o)}function e6(e,t,n){"number"===t&&e0(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}var e8=Array.isArray;function e5(e,t,n,r){if(e=e.options,t){t={};for(var l=0;l"+t.valueOf().toString()+"",t=iA.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}}var tt=te;"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction&&(tt=function(e,t){return MSApp.execUnsafeLocalFunction(function(){return te(e,t)})});var tn=tt;function tr(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType){n.nodeValue=t;return}}e.textContent=t}var tl=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function ta(e,t,n){var r=0===t.indexOf("--");null==n||"boolean"==typeof n||""===n?r?e.setProperty(t,""):"float"===t?e.cssFloat="":e[t]="":r?e.setProperty(t,n):"number"!=typeof n||0===n||tl.has(t)?"float"===t?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function to(e,t,n){if(null!=t&&"object"!=typeof t)throw Error(i(62));if(e=e.style,null!=n){for(var r in n)!n.hasOwnProperty(r)||null!=t&&t.hasOwnProperty(r)||(0===r.indexOf("--")?e.setProperty(r,""):"float"===r?e.cssFloat="":e[r]="");for(var l in t)r=t[l],t.hasOwnProperty(l)&&n[l]!==r&&ta(e,l,r)}else for(var a in t)t.hasOwnProperty(a)&&ta(e,a,t[a])}function ti(e){if(-1===e.indexOf("-"))return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var tu=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),ts=null;function tc(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var tf=null,td=null;function tp(e){var t=eT(e);if(t&&(e=t.stateNode)){var n=eM(e);switch(e=t.stateNode,t.type){case"input":if(e3(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,"radio"===n.type&&null!=t){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+e2(""+t)+'"][type="radio"]'),t=0;t>=o,l-=o,tU=1<<32-el(t)+l|n<h?(g=f,f=null):g=f.sibling;var y=p(l,f,i[h],u);if(null===y){null===f&&(f=g);break}e&&f&&null===y.alternate&&t(l,f),o=a(y,o,h),null===c?s=y:c.sibling=y,c=y,f=g}if(h===i.length)return n(l,f),tq&&tB(l,h),s;if(null===f){for(;hg?(y=h,h=null):y=h.sibling;var b=p(l,h,v.value,s);if(null===b){null===h&&(h=y);break}e&&h&&null===b.alternate&&t(l,h),o=a(b,o,g),null===f?c=b:f.sibling=b,f=b,h=y}if(v.done)return n(l,h),tq&&tB(l,g),c;if(null===h){for(;!v.done;g++,v=u.next())null!==(v=d(l,v.value,s))&&(o=a(v,o,g),null===f?c=v:f.sibling=v,f=v);return tq&&tB(l,g),c}for(h=r(l,h);!v.done;g++,v=u.next())null!==(v=m(h,l,g,v.value,s))&&(e&&null!==v.alternate&&h.delete(null===v.key?g:v.key),o=a(v,o,g),null===f?c=v:f.sibling=v,f=v);return e&&h.forEach(function(e){return t(l,e)}),tq&&tB(l,g),c}(c,f,h,g);if("function"==typeof h.then)return s(c,f,nN(h),g);if(h.$$typeof===C||h.$$typeof===E)return s(c,f,ae(c,h,g),g);nL(c,h)}return"string"==typeof h&&""!==h||"number"==typeof h?(h=""+h,null!==f&&6===f.tag?(n(c,f.sibling),(f=l(f,h)).return=c):(n(c,f),(f=ig(h,c.mode,g)).return=c),o(c=f)):n(c,f)}(s,c,f,h),nz=null,s}}var nM=nF(!0),nO=nF(!1),nR=m(null),nD=m(0);function nA(e,t){g(nD,e=oy),g(nR,t),oy=e|t.baseLanes}function nI(){g(nD,oy),g(nR,nR.current)}function nU(){oy=nD.current,h(nR),h(nD)}var n$=m(null),nB=null;function nV(e){var t=e.alternate;g(nH,1&nH.current),g(n$,e),null===nB&&(null===t||null!==nR.current?nB=e:null!==t.memoizedState&&(nB=e))}function nj(e){if(22===e.tag){if(g(nH,nH.current),g(n$,e),null===nB){var t=e.alternate;null!==t&&null!==t.memoizedState&&(nB=e)}}else nQ(e)}function nQ(){g(nH,nH.current),g(n$,n$.current)}function nW(e){h(n$),nB===e&&(nB=null),h(nH)}var nH=m(0);function nq(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||"$?"===n.data||"$!"===n.data))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!=(128&t.flags))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var nK=null,nY=null,nX=!1,nG=!1,nZ=!1,nJ=0;function n0(e){e!==nY&&null===e.next&&(null===nY?nK=nY=e:nY=nY.next=e),nG=!0,nX||(nX=!0,n6(n3))}function n1(e){if(!nZ&&nG){var t=null;nZ=!0;do for(var n=!1,r=nK;null!==r;){if(!e||0===r.tag){var l=op,a=ec(r,r===of?l:0);if(0!=(3&a))try{if(n=!0,l=r,0!=(6&oc))throw Error(i(327));if(!o7()){var o=o1(l,a);if(0!==l.tag&&2===o){var u=a,s=ef(l,u);0!==s&&(a=s,o=oV(l,u,s))}if(1===o)throw u=ob,oY(l,0),oW(l,a,0),n0(l),u;6===o?oW(l,a,0):(l.finishedWork=l.current.alternate,l.finishedLanes=a,o8(l,ox,oN,oC))}n0(l)}catch(e){null===t?t=[e]:t.push(e)}}r=r.next}while(n);if(nZ=!1,null!==t){if(1a?a:8;var o=ra.transition;ra.transition={},lo(e,!1,t,n);try{var i=l();if(null!==i&&"object"==typeof i&&"function"==typeof i.then){var u=re(i,r);la(e,t,u)}else{var s=rt(i,r);la(e,t,s)}}catch(n){la(e,t,{then:function(){},status:"rejected",reason:n})}finally{ey=a,ra.transition=o}}function r9(e,t,n,r){if(5!==e.tag)throw Error(i(476));if(null===e.memoizedState){var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:rL,lastRenderedState:f},a=l;l={memoizedState:f,baseState:f,baseQueue:null,queue:l,next:null},e.memoizedState=l;var o=e.alternate;null!==o&&(o.memoizedState=l)}else a=e.memoizedState.queue;r7(e,a,t,f,function(){return n(r)})}function le(){var e=l9($);return null!==e?e:f}function lt(){return rP().memoizedState}function ln(){return rP().memoizedState}function lr(e){for(var t=e.return;null!==t;){switch(t.tag){case 24:case 3:var n=oU(t),r=nf(t,e=nc(n),n);null!==r&&(o$(r,t,n),nd(r,t,n)),t={cache:ao()},e.payload=t;return}t=t.return}}function ll(e,t,n){var r=oU(e);n={lane:r,revertLane:0,action:n,hasEagerState:!1,eagerState:null,next:null},li(e)?lu(t,n):null!==(n=nr(e,t,n,r))&&(o$(n,e,r),ls(n,t,r))}function la(e,t,n){var r=oU(e),l={lane:r,revertLane:0,action:n,hasEagerState:!1,eagerState:null,next:null};if(li(e))lu(t,l);else{var a=e.alternate;if(0===e.lanes&&(null===a||0===a.lanes)&&null!==(a=t.lastRenderedReducer))try{var o=t.lastRenderedState,i=a(o,n);if(l.hasEagerState=!0,l.eagerState=i,tT(i,o)){nn(e,t,l,0),null===of&&nt();return}}catch(e){}finally{}null!==(n=nr(e,t,l,r))&&(o$(n,e,r),ls(n,t,r))}}function lo(e,t,n,r){if(r={lane:2,revertLane:n8(),action:r,hasEagerState:!1,eagerState:null,next:null},li(e)){if(t)throw Error(i(479))}else null!==(t=nr(e,n,r,2))&&o$(t,e,2)}function li(e){var t=e.alternate;return e===ri||null!==t&&t===ri}function lu(e,t){rf=rc=!0;var n=e.pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function ls(e,t,n){if(0!=(4194176&n)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,eg(e,n)}}iI=function(){return{lastEffect:null,events:null,stores:null}};var lc={readContext:l9,use:r_,useCallback:ry,useContext:ry,useEffect:ry,useImperativeHandle:ry,useInsertionEffect:ry,useLayoutEffect:ry,useMemo:ry,useReducer:ry,useRef:ry,useState:ry,useDebugValue:ry,useDeferredValue:ry,useTransition:ry,useSyncExternalStore:ry,useId:ry};lc.useCacheRefresh=ry,lc.useHostTransitionStatus=ry,lc.useFormState=ry,lc.useOptimistic=ry;var lf={readContext:l9,use:r_,useCallback:function(e,t){return rz().memoizedState=[e,void 0===t?null:t],e},useContext:l9,useEffect:rZ,useImperativeHandle:function(e,t,n){n=null!=n?n.concat([e]):null,rX(4194308,4,r2.bind(null,t,e),n)},useLayoutEffect:function(e,t){return rX(4194308,4,e,t)},useInsertionEffect:function(e,t){rX(4,2,e,t)},useMemo:function(e,t){var n=rz();return t=void 0===t?null:t,rd&&e(),e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=rz();return t=void 0!==n?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=ll.bind(null,ri,e),[r.memoizedState,e]},useRef:function(e){return e={current:e},rz().memoizedState=e},useState:function(e){var t=(e=r$(e)).queue,n=la.bind(null,ri,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:r4,useDeferredValue:function(e){return rz().memoizedState=e,e},useTransition:function(){var e=r$(!1);return e=r7.bind(null,ri,e.queue,!0,!1),rz().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=ri,l=rz();if(tq){if(void 0===n)throw Error(i(407));n=n()}else{if(n=t(),null===of)throw Error(i(349));0!=(60&op)||rR(r,t,n)}l.memoizedState=n;var a={value:n,getSnapshot:t};return l.queue=a,rZ(rA.bind(null,r,a,e),[e]),r.flags|=2048,rK(9,rD.bind(null,r,a,n,t),{destroy:void 0},null),n},useId:function(){var e=rz(),t=of.identifierPrefix;if(tq){var n=t$,r=tU;t=":"+t+"R"+(n=(r&~(1<<32-el(r)-1)).toString(32)+n),0<(n=rp++)&&(t+="H"+n.toString(32)),t+=":"}else t=":"+t+"r"+(n=rg++).toString(32)+":";return e.memoizedState=t},useCacheRefresh:function(){return rz().memoizedState=lr.bind(null,ri)}};lf.useHostTransitionStatus=le,lf.useFormState=function(e,t){if(tq){var n=of.formState;if(null!==n){e:{if(tq){if(tH){t:{for(var r=tH,l=tY;8!==r.nodeType;)if(!l||null===(r=s2(r))){r=null;break t}r="F!"===(l=r.data)||"F"===l?r:null}if(r){tH=s2(r),r="F!"===r.data;break e}}t2()}r=!1}r&&(t=n[0])}}return(n=rz()).memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:rW,lastRenderedState:t},n.queue=r,n=la.bind(null,ri,r),r.dispatch=n,r=rz(),l={state:t,dispatch:null,action:e,pending:null},r.queue=l,n=rV.bind(null,ri,l,n),l.dispatch=n,r.memoizedState=e,[t,n]},lf.useOptimistic=function(e){var t=rz();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=lo.bind(null,ri,!0,n),n.dispatch=t,[e,t]};var ld={readContext:l9,use:r_,useCallback:r6,useContext:l9,useEffect:rJ,useImperativeHandle:r3,useInsertionEffect:r0,useLayoutEffect:r1,useMemo:r8,useReducer:rT,useRef:rY,useState:function(){return rT(rL)},useDebugValue:r4,useDeferredValue:function(e){return r5(rP(),ru.memoizedState,e)},useTransition:function(){var e=rT(rL)[0],t=rP().memoizedState;return["boolean"==typeof e?e:rN(e),t]},useSyncExternalStore:rO,useId:lt};ld.useCacheRefresh=ln,ld.useHostTransitionStatus=le,ld.useFormState=function(e){return rH(rP(),ru,e)},ld.useOptimistic=function(e,t){return rB(rP(),ru,e,t)};var lp={readContext:l9,use:r_,useCallback:r6,useContext:l9,useEffect:rJ,useImperativeHandle:r3,useInsertionEffect:r0,useLayoutEffect:r1,useMemo:r8,useReducer:rM,useRef:rY,useState:function(){return rM(rL)},useDebugValue:r4,useDeferredValue:function(e){var t=rP();return null===ru?(t.memoizedState=e,e):r5(t,ru.memoizedState,e)},useTransition:function(){var e=rM(rL)[0],t=rP().memoizedState;return["boolean"==typeof e?e:rN(e),t]},useSyncExternalStore:rO,useId:lt};function lm(e,t){if(e&&e.defaultProps)for(var n in t=u({},t),e=e.defaultProps)void 0===t[n]&&(t[n]=e[n]);return t}function lh(e,t,n,r){n=null==(n=n(r,t=e.memoizedState))?t:u({},t,n),e.memoizedState=n,0===e.lanes&&(e.updateQueue.baseState=n)}lp.useCacheRefresh=ln,lp.useHostTransitionStatus=le,lp.useFormState=function(e){var t=rP(),n=ru;if(null!==n)return rH(t,n,e);t=t.memoizedState;var r=(n=rP()).queue.dispatch;return n.memoizedState=e,[t,r]},lp.useOptimistic=function(e,t){var n=rP();return null!==ru?rB(n,ru,e,t):(n.baseState=e,[e,n.queue.dispatch])};var lg={isMounted:function(e){return!!(e=e._reactInternals)&&tg(e)===e},enqueueSetState:function(e,t,n){var r=oU(e=e._reactInternals),l=nc(r);l.payload=t,null!=n&&(l.callback=n),null!==(t=nf(e,l,r))&&(o$(t,e,r),nd(t,e,r))},enqueueReplaceState:function(e,t,n){var r=oU(e=e._reactInternals),l=nc(r);l.tag=1,l.payload=t,null!=n&&(l.callback=n),null!==(t=nf(e,l,r))&&(o$(t,e,r),nd(t,e,r))},enqueueForceUpdate:function(e,t){var n=oU(e=e._reactInternals),r=nc(n);r.tag=2,null!=t&&(r.callback=t),null!==(t=nf(e,r,n))&&(o$(t,e,n),nd(t,e,n))}};function ly(e,t,n,r,l,a,o){return"function"==typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(r,a,o):!t.prototype||!t.prototype.isPureReactComponent||!ny(n,r)||!ny(l,a)}function lv(e,t,n){var r=!1,l=tk,a=t.contextType;return"object"==typeof a&&null!==a?a=l9(a):(l=tx(t)?tC:tw.current,a=(r=null!=(r=t.contextTypes))?tE(e,l):tk),t=new t(n,a),e.memoizedState=null!==t.state&&void 0!==t.state?t.state:null,t.updater=lg,e.stateNode=t,t._reactInternals=e,r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=l,e.__reactInternalMemoizedMaskedChildContext=a),t}function lb(e,t,n,r){e=t.state,"function"==typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(n,r),"function"==typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&lg.enqueueReplaceState(t,t.state,null)}function lk(e,t,n,r){var l=e.stateNode;l.props=n,l.state=e.memoizedState,l.refs={},nu(e);var a=t.contextType;"object"==typeof a&&null!==a?l.context=l9(a):(a=tx(t)?tC:tw.current,l.context=tE(e,a)),l.state=e.memoizedState,"function"==typeof(a=t.getDerivedStateFromProps)&&(lh(e,t,a,n),l.state=e.memoizedState),"function"==typeof t.getDerivedStateFromProps||"function"==typeof l.getSnapshotBeforeUpdate||"function"!=typeof l.UNSAFE_componentWillMount&&"function"!=typeof l.componentWillMount||(t=l.state,"function"==typeof l.componentWillMount&&l.componentWillMount(),"function"==typeof l.UNSAFE_componentWillMount&&l.UNSAFE_componentWillMount(),t!==l.state&&lg.enqueueReplaceState(l,l.state,null),nm(e,n,l,r),l.state=e.memoizedState),"function"==typeof l.componentDidMount&&(e.flags|=4194308)}function lw(e,t){try{var n="",r=t;do n+=function(e){switch(e.tag){case 26:case 27:case 5:return eq(e.type);case 16:return eq("Lazy");case 13:return eq("Suspense");case 19:return eq("SuspenseList");case 0:case 2:case 15:return e=eY(e.type,!1);case 11:return e=eY(e.type.render,!1);case 1:return e=eY(e.type,!0);default:return""}}(r),r=r.return;while(r);var l=n}catch(e){l="\nError generating stack: "+e.message+"\n"+e.stack}return{value:e,source:t,stack:l,digest:null}}function lS(e,t,n){return{value:e,source:null,stack:null!=n?n:null,digest:null!=t?t:null}}function lC(e,t){try{console.error(t.value)}catch(e){setTimeout(function(){throw e})}}function lE(e,t,n){(n=nc(n)).tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){o_||(o_=!0,oL=r),lC(e,t)},n}function lx(e,t,n){(n=nc(n)).tag=3;var r=e.type.getDerivedStateFromError;if("function"==typeof r){var l=t.value;n.payload=function(){return r(l)},n.callback=function(){lC(e,t)}}var a=e.stateNode;return null!==a&&"function"==typeof a.componentDidCatch&&(n.callback=function(){lC(e,t),"function"!=typeof r&&(null===oT?oT=new Set([this]):oT.add(this));var n=t.stack;this.componentDidCatch(t.value,{componentStack:null!==n?n:""})}),n}function lz(e,t,n,r,l){return 0==(1&e.mode)?e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,1===n.tag&&(null===n.alternate?n.tag=17:((t=nc(2)).tag=2,nf(n,t,2))),n.lanes|=2):(e.flags|=65536,e.lanes=l),e}var lP=s.ReactCurrentOwner,lN=Error(i(461)),l_=!1;function lL(e,t,n,r){t.child=null===e?nO(t,null,n,r):nM(t,e.child,n,r)}function lT(e,t,n,r,l){n=n.render;var a=t.ref;return(l7(t,l),r=rb(e,t,n,r,a,l),n=rC(),null===e||l_)?(tq&&n&&tj(t),t.flags|=1,lL(e,t,r,l),t.child):(rE(e,t,l),lZ(e,t,l))}function lF(e,t,n,r,l){if(null===e){var a=n.type;return"function"!=typeof a||is(a)||void 0!==a.defaultProps||null!==n.compare||void 0!==n.defaultProps?((e=ip(n.type,null,r,null,t,t.mode,l)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=a,lM(e,t,a,r,l))}if(a=e.child,0==(e.lanes&l)){var o=a.memoizedProps;if((n=null!==(n=n.compare)?n:ny)(o,r)&&e.ref===t.ref)return lZ(e,t,l)}return t.flags|=1,(e=ic(a,r)).ref=t.ref,e.return=t,t.child=e}function lM(e,t,n,r,l){if(null!==e){var a=e.memoizedProps;if(ny(a,r)&&e.ref===t.ref){if(l_=!1,t.pendingProps=r=a,0==(e.lanes&l))return t.lanes=e.lanes,lZ(e,t,l);0!=(131072&e.flags)&&(l_=!0)}}return lA(e,t,n,r,l)}function lO(e,t,n){var r=t.pendingProps,l=r.children,a=0!=(2&t.stateNode._pendingVisibility),o=null!==e?e.memoizedState:null;if(lD(e,t),"hidden"===r.mode||a){if(0!=(128&t.flags)){if(n=null!==o?o.baseLanes|n:n,null!==e){for(l=0,r=t.child=e.child;null!==r;)l=l|r.lanes|r.childLanes,r=r.sibling;t.childLanes=l&~n}else t.childLanes=0,t.child=null;return lR(e,t,n)}if(0==(1&t.mode))t.memoizedState={baseLanes:0,cachePool:null},null!==e&&af(t,null),nI(),nj(t);else{if(0==(536870912&n))return t.lanes=t.childLanes=536870912,lR(e,t,null!==o?o.baseLanes|n:n);t.memoizedState={baseLanes:0,cachePool:null},null!==e&&af(t,null!==o?o.cachePool:null),null!==o?nA(t,o):nI(),nj(t)}}else null!==o?(af(t,o.cachePool),nA(t,o),nQ(t),t.memoizedState=null):(null!==e&&af(t,null),nI(),nQ(t));return lL(e,t,l,n),t.child}function lR(e,t,n){var r=ac();return r=null===r?null:{parent:aa._currentValue,pool:r},t.memoizedState={baseLanes:n,cachePool:r},null!==e&&af(t,null),nI(),nj(t),null}function lD(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function lA(e,t,n,r,l){var a=tx(n)?tC:tw.current;return(a=tE(t,a),l7(t,l),n=rb(e,t,n,r,a,l),r=rC(),null===e||l_)?(tq&&r&&tj(t),t.flags|=1,lL(e,t,n,l),t.child):(rE(e,t,l),lZ(e,t,l))}function lI(e,t,n,r,l,a){return(l7(t,a),n=rw(t,r,n,l),rk(),r=rC(),null===e||l_)?(tq&&r&&tj(t),t.flags|=1,lL(e,t,n,a),t.child):(rE(e,t,a),lZ(e,t,a))}function lU(e,t,n,r,l){if(tx(n)){var a=!0;t_(t)}else a=!1;if(l7(t,l),null===t.stateNode)lG(e,t),lv(t,n,r),lk(t,n,r,l),r=!0;else if(null===e){var o=t.stateNode,i=t.memoizedProps;o.props=i;var u=o.context,s=n.contextType;s="object"==typeof s&&null!==s?l9(s):tE(t,s=tx(n)?tC:tw.current);var c=n.getDerivedStateFromProps,f="function"==typeof c||"function"==typeof o.getSnapshotBeforeUpdate;f||"function"!=typeof o.UNSAFE_componentWillReceiveProps&&"function"!=typeof o.componentWillReceiveProps||(i!==r||u!==s)&&lb(t,o,r,s),ni=!1;var d=t.memoizedState;o.state=d,nm(t,r,o,l),u=t.memoizedState,i!==r||d!==u||tS.current||ni?("function"==typeof c&&(lh(t,n,c,r),u=t.memoizedState),(i=ni||ly(t,n,i,r,d,u,s))?(f||"function"!=typeof o.UNSAFE_componentWillMount&&"function"!=typeof o.componentWillMount||("function"==typeof o.componentWillMount&&o.componentWillMount(),"function"==typeof o.UNSAFE_componentWillMount&&o.UNSAFE_componentWillMount()),"function"==typeof o.componentDidMount&&(t.flags|=4194308)):("function"==typeof o.componentDidMount&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=u),o.props=r,o.state=u,o.context=s,r=i):("function"==typeof o.componentDidMount&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,ns(e,t),i=t.memoizedProps,s=t.type===t.elementType?i:lm(t.type,i),o.props=s,f=t.pendingProps,d=o.context,u="object"==typeof(u=n.contextType)&&null!==u?l9(u):tE(t,u=tx(n)?tC:tw.current);var p=n.getDerivedStateFromProps;(c="function"==typeof p||"function"==typeof o.getSnapshotBeforeUpdate)||"function"!=typeof o.UNSAFE_componentWillReceiveProps&&"function"!=typeof o.componentWillReceiveProps||(i!==f||d!==u)&&lb(t,o,r,u),ni=!1,d=t.memoizedState,o.state=d,nm(t,r,o,l);var m=t.memoizedState;i!==f||d!==m||tS.current||ni?("function"==typeof p&&(lh(t,n,p,r),m=t.memoizedState),(s=ni||ly(t,n,s,r,d,m,u)||!1)?(c||"function"!=typeof o.UNSAFE_componentWillUpdate&&"function"!=typeof o.componentWillUpdate||("function"==typeof o.componentWillUpdate&&o.componentWillUpdate(r,m,u),"function"==typeof o.UNSAFE_componentWillUpdate&&o.UNSAFE_componentWillUpdate(r,m,u)),"function"==typeof o.componentDidUpdate&&(t.flags|=4),"function"==typeof o.getSnapshotBeforeUpdate&&(t.flags|=1024)):("function"!=typeof o.componentDidUpdate||i===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),"function"!=typeof o.getSnapshotBeforeUpdate||i===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=m),o.props=r,o.state=m,o.context=u,r=s):("function"!=typeof o.componentDidUpdate||i===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),"function"!=typeof o.getSnapshotBeforeUpdate||i===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),r=!1)}return l$(e,t,n,r,a,l)}function l$(e,t,n,r,l,a){lD(e,t);var o=0!=(128&t.flags);if(!r&&!o)return l&&tL(t,n,!1),lZ(e,t,a);r=t.stateNode,lP.current=t;var i=o&&"function"!=typeof n.getDerivedStateFromError?null:r.render();return t.flags|=1,null!==e&&o?(t.child=nM(t,e.child,null,a),t.child=nM(t,null,i,a)):lL(e,t,i,a),t.memoizedState=r.state,l&&tL(t,n,!0),t.child}function lB(e){var t=e.stateNode;t.pendingContext?tP(e,t.pendingContext,t.pendingContext!==t.context):t.context&&tP(e,t.context,!1),B(e,t.containerInfo)}function lV(e,t,n,r,l){return t8(),t5(l),t.flags|=256,lL(e,t,n,r),t.child}var lj={dehydrated:null,treeContext:null,retryLane:0};function lQ(e){return{baseLanes:e,cachePool:ad()}}function lW(e,t,n){var r,l=t.pendingProps,a=!1,o=0!=(128&t.flags);if((r=o)||(r=(null===e||null!==e.memoizedState)&&0!=(2&nH.current)),r&&(a=!0,t.flags&=-129),null===e){if(tq){if(a?nV(t):nQ(t),tq&&((o=e=tH)?t0(t,o)||(t1(t)&&t2(),tH=s2(o),r=tW,tH&&t0(t,tH)?tX(r,o):(tG(tW,t),tq=!1,tW=t,tH=e)):(t1(t)&&t2(),tG(tW,t),tq=!1,tW=t,tH=e)),null!==(e=t.memoizedState)&&null!==(e=e.dehydrated))return 0==(1&t.mode)?t.lanes=2:"$!"===e.data?t.lanes=16:t.lanes=536870912,null;nW(t)}return(o=l.children,e=l.fallback,a)?(nQ(t),l=t.mode,a=t.child,o={mode:"hidden",children:o},0==(1&l)&&null!==a?(a.childLanes=0,a.pendingProps=o):a=ih(o,l,0,null),e=im(e,l,n,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=lQ(n),t.memoizedState=lj,e):(nV(t),lH(t,o))}if(null!==(r=e.memoizedState)){var u=r.dehydrated;if(null!==u)return function(e,t,n,r,l,a,o){if(n)return 256&t.flags?(nV(t),t.flags&=-257,lq(e,t,o,l=lS(Error(i(422))))):null!==t.memoizedState?(nQ(t),t.child=e.child,t.flags|=128,null):(nQ(t),l=r.fallback,a=t.mode,r=ih({mode:"visible",children:r.children},a,0,null),l=im(l,a,o,null),l.flags|=2,r.return=t,l.return=t,r.sibling=l,t.child=r,0!=(1&t.mode)&&nM(t,e.child,null,o),t.child.memoizedState=lQ(o),t.memoizedState=lj,l);if(nV(t),0==(1&t.mode))return lq(e,t,o,null);if("$!"===l.data){if(l=l.nextSibling&&l.nextSibling.dataset)var u=l.dgst;return l=u,(a=Error(i(419))).digest=l,lq(e,t,o,l=lS(a,l,void 0))}if(u=0!=(o&e.childLanes),l_||u){if(null!==(r=of)){if(0!=(42&(u=o&-o)))u=1;else switch(u){case 2:u=1;break;case 8:u=4;break;case 32:u=16;break;case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:u=64;break;case 268435456:u=134217728;break;default:u=0}if(0!==(u=0!=(u&(r.suspendedLanes|o))?0:u)&&u!==a.retryLane)throw a.retryLane=u,nl(e,u),o$(r,e,u),lN}return"$?"!==l.data&&o0(),lq(e,t,o,null)}return"$?"===l.data?(t.flags|=128,t.child=e.child,t=ia.bind(null,e),l._reactRetry=t,null):(e=a.treeContext,tH=s1(l.nextSibling),tW=t,tq=!0,tK=null,tY=!1,null!==e&&(tD[tA++]=tU,tD[tA++]=t$,tD[tA++]=tI,tU=e.id,t$=e.overflow,tI=t),t=lH(t,r.children),t.flags|=4096,t)}(e,t,o,l,u,r,n)}if(a){nQ(t),a=l.fallback,o=t.mode,u=(r=e.child).sibling;var s={mode:"hidden",children:l.children};return 0==(1&o)&&t.child!==r?((l=t.child).childLanes=0,l.pendingProps=s,t.deletions=null):(l=ic(r,s)).subtreeFlags=31457280&r.subtreeFlags,null!==u?a=ic(u,a):(a=im(a,o,n,null),a.flags|=2),a.return=t,l.return=t,l.sibling=a,t.child=l,l=a,a=t.child,null===(o=e.child.memoizedState)?o=lQ(n):(null!==(r=o.cachePool)?(u=aa._currentValue,r=r.parent!==u?{parent:u,pool:u}:r):r=ad(),o={baseLanes:o.baseLanes|n,cachePool:r}),a.memoizedState=o,a.childLanes=e.childLanes&~n,t.memoizedState=lj,l}return nV(t),e=(a=e.child).sibling,l=ic(a,{mode:"visible",children:l.children}),0==(1&t.mode)&&(l.lanes=n),l.return=t,l.sibling=null,null!==e&&(null===(n=t.deletions)?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=l,t.memoizedState=null,l}function lH(e,t){return(t=ih({mode:"visible",children:t},e.mode,0,null)).return=e,e.child=t}function lq(e,t,n,r){return null!==r&&t5(r),nM(t,e.child,null,n),e=lH(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function lK(e,t,n){e.lanes|=t;var r=e.alternate;null!==r&&(r.lanes|=t),l8(e.return,t,n)}function lY(e,t,n,r,l){var a=e.memoizedState;null===a?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:l}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailMode=l)}function lX(e,t,n){var r=t.pendingProps,l=r.revealOrder,a=r.tail;if(lL(e,t,r.children,n),0!=(2&(r=nH.current)))r=1&r|2,t.flags|=128;else{if(null!==e&&0!=(128&e.flags))e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&lK(e,n,t);else if(19===e.tag)lK(e,n,t);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(g(nH,r),0==(1&t.mode))t.memoizedState=null;else switch(l){case"forwards":for(l=null,n=t.child;null!==n;)null!==(e=n.alternate)&&null===nq(e)&&(l=n),n=n.sibling;null===(n=l)?(l=t.child,t.child=null):(l=n.sibling,n.sibling=null),lY(t,!1,l,n,a);break;case"backwards":for(n=null,l=t.child,t.child=null;null!==l;){if(null!==(e=l.alternate)&&null===nq(e)){t.child=l;break}e=l.sibling,l.sibling=n,n=l,l=e}lY(t,!0,n,null,a);break;case"together":lY(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function lG(e,t){0==(1&t.mode)&&null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2)}function lZ(e,t,n){if(null!==e&&(t.dependencies=e.dependencies),ok|=t.lanes,0==(n&t.childLanes))return null;if(null!==e&&t.child!==e.child)throw Error(i(153));if(null!==t.child){for(n=ic(e=t.child,e.pendingProps),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=ic(e,e.pendingProps)).return=t;n.sibling=null}return t.child}var lJ=m(null),l0=null,l1=null,l2=null;function l3(){l2=l1=l0=null}function l4(e,t,n){g(lJ,t._currentValue),t._currentValue=n}function l6(e){e._currentValue=lJ.current,h(lJ)}function l8(e,t,n){for(;null!==e;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,null!==r&&(r.childLanes|=t)):null!==r&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function l5(e,t,n){var r=e.child;for(null!==r&&(r.return=e);null!==r;){var l=r.dependencies;if(null!==l)for(var a=r.child,o=l.firstContext;null!==o;){if(o.context===t){if(1===r.tag){(o=nc(n&-n)).tag=2;var u=r.updateQueue;if(null!==u){var s=(u=u.shared).pending;null===s?o.next=o:(o.next=s.next,s.next=o),u.pending=o}}r.lanes|=n,null!==(o=r.alternate)&&(o.lanes|=n),l8(r.return,n,e),l.lanes|=n;break}o=o.next}else if(10===r.tag)a=r.type===e.type?null:r.child;else if(18===r.tag){if(null===(a=r.return))throw Error(i(341));a.lanes|=n,null!==(l=a.alternate)&&(l.lanes|=n),l8(a,n,e),a=r.sibling}else a=r.child;if(null!==a)a.return=r;else for(a=r;null!==a;){if(a===e){a=null;break}if(null!==(r=a.sibling)){r.return=a.return,a=r;break}a=a.return}r=a}}function l7(e,t){l0=e,l2=l1=null,null!==(e=e.dependencies)&&null!==e.firstContext&&(0!=(e.lanes&t)&&(l_=!0),e.firstContext=null)}function l9(e){return at(l0,e)}function ae(e,t,n){return null===l0&&l7(e,n),at(e,t)}function at(e,t){var n=t._currentValue;if(l2!==t){if(t={context:t,memoizedValue:n,next:null},null===l1){if(null===e)throw Error(i(308));l1=t,e.dependencies={lanes:0,firstContext:t}}else l1=l1.next=t}return n}var an="undefined"!=typeof AbortController?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},ar=a.unstable_scheduleCallback,al=a.unstable_NormalPriority,aa={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0,_defaultValue:null,_globalName:null};function ao(){return{controller:new an,data:new Map,refCount:0}}function ai(e){e.refCount--,0===e.refCount&&ar(al,function(){e.controller.abort()})}var au=s.ReactCurrentBatchConfig,as=m(null);function ac(){var e=as.current;return null!==e?e:of.pooledCache}function af(e,t){null===t?g(as,as.current):g(as,t.pool)}function ad(){var e=ac();return null===e?null:{parent:aa._currentValue,pool:e}}function ap(e){e.flags|=4}function am(e){e.flags|=2097664}function ah(e,t){if("stylesheet"!==t.type||0!=(4&t.state.loading))e.flags&=-16777217;else if(e.flags|=16777216,0==(42&op)&&!(t="stylesheet"!==t.type||0!=(3&t.state.loading))){if(oG())e.flags|=8192;else throw nE=nk,nb}}function ag(e,t){null!==t?e.flags|=4:16384&e.flags&&(t=22!==e.tag?ed():536870912,e.lanes|=t)}function ay(e,t){if(!tq)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;null!==n;)null!==n.alternate&&(r=n),n=n.sibling;null===r?t||null===e.tail?e.tail=null:e.tail.sibling=null:r.sibling=null}}function av(e){var t=null!==e.alternate&&e.alternate.child===e.child,n=0,r=0;if(t)for(var l=e.child;null!==l;)n|=l.lanes|l.childLanes,r|=31457280&l.subtreeFlags,r|=31457280&l.flags,l.return=e,l=l.sibling;else for(l=e.child;null!==l;)n|=l.lanes|l.childLanes,r|=l.subtreeFlags,r|=l.flags,l.return=e,l=l.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function ab(e,t){switch(tQ(t),t.tag){case 1:null!=(e=t.type.childContextTypes)&&tz();break;case 3:l6(aa),V(),h(tS),h(tw);break;case 26:case 27:case 5:Q(t);break;case 4:V();break;case 13:nW(t);break;case 19:h(nH);break;case 10:l6(t.type._context);break;case 22:case 23:nW(t),nU(),null!==e&&h(as);break;case 24:l6(aa)}}function ak(e,t,n){var r=Array.prototype.slice.call(arguments,3);try{t.apply(n,r)}catch(e){this.onError(e)}}var aw=!1,aS=null,aC=!1,aE=null,ax={onError:function(e){aw=!0,aS=e}};function az(e,t,n,r,l,a,o,i,u){aw=!1,aS=null,ak.apply(ax,arguments)}var aP=!1,aN=!1,a_="function"==typeof WeakSet?WeakSet:Set,aL=null;function aT(e,t){try{var n=e.ref;if(null!==n){var r=e.stateNode;switch(e.tag){case 26:case 27:case 5:var l=r;break;default:l=r}"function"==typeof n?e.refCleanup=n(l):n.current=l}}catch(n){ie(e,t,n)}}function aF(e,t){var n=e.ref,r=e.refCleanup;if(null!==n){if("function"==typeof r)try{r()}catch(n){ie(e,t,n)}finally{e.refCleanup=null,null!=(e=e.alternate)&&(e.refCleanup=null)}else if("function"==typeof n)try{n(null)}catch(n){ie(e,t,n)}else n.current=null}}function aM(e,t,n){try{n()}catch(n){ie(e,t,n)}}var aO=!1;function aR(e,t,n){var r=t.updateQueue;if(null!==(r=null!==r?r.lastEffect:null)){var l=r=r.next;do{if((l.tag&e)===e){var a=l.inst,o=a.destroy;void 0!==o&&(a.destroy=void 0,aM(t,n,o))}l=l.next}while(l!==r)}}function aD(e,t){if(null!==(t=null!==(t=t.updateQueue)?t.lastEffect:null)){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create,l=n.inst;r=r(),l.destroy=r}n=n.next}while(n!==t)}}function aA(e,t){try{aD(t,e)}catch(t){ie(e,e.return,t)}}function aI(e){var t=e.updateQueue;if(null!==t){var n=e.stateNode;try{ng(t,n)}catch(t){ie(e,e.return,t)}}}function aU(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&r.focus();break;case"img":n.src&&(r.src=n.src)}}catch(t){ie(e,e.return,t)}}function a$(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:a0(e,n),4&r&&aA(n,5);break;case 1:if(a0(e,n),4&r){if(e=n.stateNode,null===t)try{e.componentDidMount()}catch(e){ie(n,n.return,e)}else{var l=n.elementType===n.type?t.memoizedProps:lm(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(l,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){ie(n,n.return,e)}}}64&r&&aI(n),512&r&&aT(n,n.return);break;case 3:if(a0(e,n),64&r&&null!==(r=n.updateQueue)){if(e=null,null!==n.child)switch(n.child.tag){case 27:case 5:case 1:e=n.child.stateNode}try{ng(r,e)}catch(e){ie(n,n.return,e)}}break;case 26:a0(e,n),512&r&&aT(n,n.return);break;case 27:case 5:a0(e,n),null===t&&4&r&&aU(n),512&r&&aT(n,n.return);break;case 12:default:a0(e,n);break;case 13:a0(e,n),4&r&&aK(e,n);break;case 22:if(0!=(1&n.mode)){if(!(l=null!==n.memoizedState||aP)){t=null!==t&&null!==t.memoizedState||aN;var a=aP,o=aN;aP=l,(aN=t)&&!o?function e(t,n,r){for(r=r&&0!=(8772&n.subtreeFlags),n=n.child;null!==n;){var l=n.alternate,a=t,o=n,i=o.flags;switch(o.tag){case 0:case 11:case 15:e(a,o,r),aA(o,4);break;case 1:if(e(a,o,r),"function"==typeof(a=o.stateNode).componentDidMount)try{a.componentDidMount()}catch(e){ie(o,o.return,e)}if(null!==(l=o.updateQueue)){var u=l.shared.hiddenCallbacks;if(null!==u)for(l.shared.hiddenCallbacks=null,l=0;l title"))),sI(l,n,r),l[ew]=e,eR(l),n=l;break e;case"link":var a=cf("link","href",t).get(n+(r.href||""));if(a){for(var o=0;o",e=e.removeChild(e.firstChild);break;case"select":e="string"==typeof r.is?l.createElement("select",{is:r.is}):l.createElement("select"),r.multiple?e.multiple=!0:r.size&&(e.size=r.size);break;default:e="string"==typeof r.is?l.createElement(n,{is:r.is}):l.createElement(n)}}e[ew]=t,e[eS]=r;e:for(l=t.child;null!==l;){if(5===l.tag||6===l.tag)e.appendChild(l.stateNode);else if(4!==l.tag&&27!==l.tag&&null!==l.child){l.child.return=l,l=l.child;continue}if(l===t)break;for(;null===l.sibling;){if(null===l.return||l.return===t)break e;l=l.return}l.sibling.return=l.return,l=l.sibling}switch(t.stateNode=e,sI(e,n,r),n){case"button":case"input":case"select":case"textarea":e=!!r.autoFocus;break;case"img":e=!0;break;default:e=!1}e&&ap(t)}null!==t.ref&&am(t)}return av(t),t.flags&=-16777217,null;case 6:if(e&&null!=t.stateNode)e.memoizedProps!==r&&ap(t);else{if("string"!=typeof r&&null===t.stateNode)throw Error(i(166));if(e=I.current,t4(t)){e:{if(e=t.stateNode,n=t.memoizedProps,e[ew]=t,(r=e.nodeValue!==n)&&null!==(l=tW))switch(l.tag){case 3:if(l=0!=(1&l.mode),sO(e.nodeValue,n,l),l){e=!1;break e}break;case 27:case 5:var a=0!=(1&l.mode);if(!0!==l.memoizedProps.suppressHydrationWarning&&sO(e.nodeValue,n,a),a){e=!1;break e}}e=r}e&&ap(t)}else(e=sV(e).createTextNode(r))[ew]=t,t.stateNode=e}return av(t),null;case 13:if(nW(t),r=t.memoizedState,null===e||null!==e.memoizedState&&null!==e.memoizedState.dehydrated){if(tq&&null!==tH&&0!=(1&t.mode)&&0==(128&t.flags))t6(),t8(),t.flags|=384,l=!1;else if(l=t4(t),null!==r&&null!==r.dehydrated){if(null===e){if(!l)throw Error(i(318));if(!(l=null!==(l=t.memoizedState)?l.dehydrated:null))throw Error(i(317));l[ew]=t}else t8(),0==(128&t.flags)&&(t.memoizedState=null),t.flags|=4;av(t),l=!1}else null!==tK&&(oj(tK),tK=null),l=!0;if(!l)return 256&t.flags?t:null}if(0!=(128&t.flags))return t.lanes=n,t;return n=null!==r,e=null!==e&&null!==e.memoizedState,n&&(r=t.child,l=null,null!==r.alternate&&null!==r.alternate.memoizedState&&null!==r.alternate.memoizedState.cachePool&&(l=r.alternate.memoizedState.cachePool.pool),a=null,null!==r.memoizedState&&null!==r.memoizedState.cachePool&&(a=r.memoizedState.cachePool.pool),a!==l&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),ag(t,t.updateQueue),av(t),null;case 4:return V(),null===e&&sE(t.stateNode.containerInfo),av(t),null;case 10:return l6(t.type._context),av(t),null;case 19:if(h(nH),null===(l=t.memoizedState))return av(t),null;if(r=0!=(128&t.flags),null===(a=l.rendering)){if(r)ay(l,!1);else{if(0!==ov||null!==e&&0!=(128&e.flags))for(e=t.child;null!==e;){if(null!==(a=nq(e))){for(t.flags|=128,ay(l,!1),e=a.updateQueue,t.updateQueue=e,ag(t,e),t.subtreeFlags=0,e=n,n=t.child;null!==n;)id(n,e),n=n.sibling;return g(nH,1&nH.current|2),t.child}e=e.sibling}null!==l.tail&&Y()>oP&&(t.flags|=128,r=!0,ay(l,!1),t.lanes=4194304)}}else{if(!r){if(null!==(e=nq(a))){if(t.flags|=128,r=!0,e=e.updateQueue,t.updateQueue=e,ag(t,e),ay(l,!0),null===l.tail&&"hidden"===l.tailMode&&!a.alternate&&!tq)return av(t),null}else 2*Y()-l.renderingStartTime>oP&&536870912!==n&&(t.flags|=128,r=!0,ay(l,!1),t.lanes=4194304)}l.isBackwards?(a.sibling=t.child,t.child=a):(null!==(e=l.last)?e.sibling=a:t.child=a,l.last=a)}if(null!==l.tail)return t=l.tail,l.rendering=t,l.tail=t.sibling,l.renderingStartTime=Y(),t.sibling=null,e=nH.current,g(nH,r?1&e|2:1&e),t;return av(t),null;case 22:case 23:return nW(t),nU(),r=null!==t.memoizedState,null!==e?null!==e.memoizedState!==r&&(t.flags|=8192):r&&(t.flags|=8192),r&&0!=(1&t.mode)?0!=(536870912&n)&&0==(128&t.flags)&&(av(t),6&t.subtreeFlags&&(t.flags|=8192)):av(t),null!==(n=t.updateQueue)&&ag(t,n.retryQueue),n=null,null!==e&&null!==e.memoizedState&&null!==e.memoizedState.cachePool&&(n=e.memoizedState.cachePool.pool),r=null,null!==t.memoizedState&&null!==t.memoizedState.cachePool&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),null!==e&&h(as),null;case 24:return n=null,null!==e&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),l6(aa),av(t),null;case 25:return null}throw Error(i(156,t.tag))}(t.alternate,t,oy);if(null!==n){od=n;return}if(null!==(t=t.sibling)){od=t;return}od=t=e}while(null!==t);0===ov&&(ov=5)}function o8(e,t,n,r){var l=ey,a=os.transition;try{os.transition=null,ey=2,function(e,t,n,r,l){do o7();while(null!==oM);if(0!=(6&oc))throw Error(i(327));var a=e.finishedWork,o=e.finishedLanes;if(null!==a){if(e.finishedWork=null,e.finishedLanes=0,a===e.current)throw Error(i(177));e.callbackNode=null,e.callbackPriority=0,e.cancelPendingCommit=null;var u=a.lanes|a.childLanes;if(function(e,t,n){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.entangledLanes&=t,e.errorRecoveryDisabledLanes&=t,e.shellSuspendCounter=0,t=e.entanglements;for(var l=e.expirationTimes,a=e.hiddenUpdates;0r&&(l=r,r=a,a=l),l=u4(n,a);var o=u4(n,r);l&&o&&(1!==e.rangeCount||e.anchorNode!==l.node||e.anchorOffset!==l.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&((t=t.createRange()).setStart(l.node,l.offset),e.removeAllRanges(),a>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)1===e.nodeType&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for("function"==typeof n.focus&&n.focus(),n=0;nn?32:n;n=os.transition;var l=ey;try{if(os.transition=null,ey=r,null===oM)var a=!1;else{r=oD,oD=null;var o=oM,u=oO;if(oM=null,oO=0,0!=(6&oc))throw Error(i(331));var s=oc;if(oc|=4,on(o.current),a6(o,o.current,u,r),oc=s,n1(!1),er&&"function"==typeof er.onPostCommitFiberRoot)try{er.onPostCommitFiberRoot(en,o)}catch(e){}a=!0}return a}finally{ey=l,os.transition=n,o5(e,t)}}return!1}function o9(e,t,n){t=lE(e,t=lw(n,t),2),null!==(e=nf(e,t,2))&&(em(e,2),n0(e))}function ie(e,t,n){if(3===e.tag)o9(e,e,n);else for(;null!==t;){if(3===t.tag){o9(t,e,n);break}if(1===t.tag){var r=t.stateNode;if("function"==typeof t.type.getDerivedStateFromError||"function"==typeof r.componentDidCatch&&(null===oT||!oT.has(r))){e=lx(t,e=lw(n,e),2),null!==(t=nf(t,e,2))&&(em(t,2),n0(t));break}}t=t.return}}function it(e,t,n){var r=e.pingCache;if(null===r){r=e.pingCache=new oa;var l=new Set;r.set(t,l)}else void 0===(l=r.get(t))&&(l=new Set,r.set(t,l));l.has(n)||(og=!0,l.add(n),e=ir.bind(null,e,t,n),t.then(e,e))}function ir(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,of===e&&(op&n)===n&&(4===ov||3===ov&&(62914560&op)===op&&300>Y()-oz?0==(2&oc)&&oY(e,0):oS|=n),n0(e)}function il(e,t){0===t&&(t=0==(1&e.mode)?2:ed()),null!==(e=nl(e,t))&&(em(e,t),n0(e))}function ia(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),il(e,n)}function io(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,l=e.memoizedState;null!==l&&(n=l.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}null!==r&&r.delete(t),il(e,n)}function ii(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function iu(e,t,n,r){return new ii(e,t,n,r)}function is(e){return!(!(e=e.prototype)||!e.isReactComponent)}function ic(e,t){var n=e.alternate;return null===n?((n=iu(e.tag,t,e.key,e.mode)).elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=31457280&e.flags,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function id(e,t){e.flags&=31457282;var n=e.alternate;return null===n?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function ip(e,t,n,r,l,a,o){if(l=2,r=e,"function"==typeof e)is(e)&&(l=1);else if("string"==typeof e)l=!function(e,t,n){if(1===n||null!=t.itemProp)return!1;switch(e){case"meta":case"title":return!0;case"style":if("string"!=typeof t.precedence||"string"!=typeof t.href||""===t.href)break;return!0;case"link":if("string"!=typeof t.rel||"string"!=typeof t.href||""===t.href||t.onLoad||t.onError)break;if("stylesheet"===t.rel)return e=t.disabled,"string"==typeof t.precedence&&null==e;return!0;case"script":if(!0===t.async&&!t.onLoad&&!t.onError&&"string"==typeof t.src&&t.src)return!0}return!1}(e,n,D.current)?"html"===e||"head"===e||"body"===e?27:5:26;else e:switch(e){case b:return im(n.children,a,o,t);case k:l=8,0!=(1&(a|=8))&&(a|=16);break;case w:return(e=iu(12,n,t,2|a)).elementType=w,e.lanes=o,e;case z:return(e=iu(13,n,t,a)).elementType=z,e.lanes=o,e;case P:return(e=iu(19,n,t,a)).elementType=P,e.lanes=o,e;case T:return ih(n,a,o,t);case F:case L:case M:return(e=iu(24,n,t,a)).elementType=M,e.lanes=o,e;default:if("object"==typeof e&&null!==e)switch(e.$$typeof){case S:l=10;break e;case C:l=9;break e;case x:l=11;break e;case N:l=14;break e;case _:l=16,r=null;break e}throw Error(i(130,null==e?e:typeof e,""))}return(t=iu(l,n,t,a)).elementType=e,t.type=r,t.lanes=o,t}function im(e,t,n,r){return(e=iu(7,e,r,t)).lanes=n,e}function ih(e,t,n,r){(e=iu(22,e,r,t)).elementType=T,e.lanes=n;var l={_visibility:1,_pendingVisibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null,_current:null,detach:function(){var e=l._current;if(null===e)throw Error(i(456));if(0==(2&l._pendingVisibility)){var t=nl(e,2);null!==t&&(l._pendingVisibility|=2,o$(t,e,2))}},attach:function(){var e=l._current;if(null===e)throw Error(i(456));if(0!=(2&l._pendingVisibility)){var t=nl(e,2);null!==t&&(l._pendingVisibility&=-3,o$(t,e,2))}}};return e.stateNode=l,e}function ig(e,t,n){return(e=iu(6,e,null,t)).lanes=n,e}function iy(e,t,n){return(t=iu(4,null!==e.children?e.children:[],e.key,t)).lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function iv(e,t,n,r,l,a){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=ep(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.finishedLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ep(0),this.hiddenUpdates=ep(null),this.identifierPrefix=r,this.onRecoverableError=l,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=a,this.incompleteTransitions=new Map}function ib(e,t,n,r,l,a,o,i,u,s,c){return e=new iv(e,t,n,i,u,c),1===t?(t=1,!0===a&&(t|=24)):t=0,a=iu(3,null,null,t),e.current=a,a.stateNode=e,t=ao(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},nu(a),e}function ik(e){if(!e)return tk;e=e._reactInternals;e:{if(tg(e)!==e||1!==e.tag)throw Error(i(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(tx(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(null!==t);throw Error(i(171))}if(1===e.tag){var n=e.type;if(tx(n))return tN(e,n,t)}return t}function iw(e,t,n,r,l,a,o,i,u,s,c){return(e=ib(n,r,!0,e,l,a,o,i,u,s,c)).context=ik(null),(l=nc(r=oU(n=e.current))).callback=null!=t?t:null,nf(n,l,r),e.current.lanes=r,em(e,r),n0(e),e}function iS(e,t,n,r){var l=t.current,a=oU(l);return n=ik(n),null===t.context?t.context=n:t.pendingContext=n,(t=nc(a)).payload={element:e},null!==(r=void 0===r?null:r)&&(t.callback=r),null!==(e=nf(l,t,a))&&(o$(e,l,a),nd(e,l,a)),a}function iC(e){return(e=e.current).child?(e.child.tag,e.child.stateNode):null}function iE(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n=uM),uD=!1;function uA(e,t){switch(e){case"keyup":return -1!==uT.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function uI(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var uU=!1,u$={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function uB(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!u$[e.type]:"textarea"===t}function uV(e,t,n,r){tm(r),0<(t=sN(t,"onChange")).length&&(n=new iQ("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var uj=null,uQ=null;function uW(e){sk(e,0)}function uH(e){if(eJ(eF(e)))return e}function uq(e,t){if("change"===e)return t}var uK=!1;if(e$){if(e$){var uY="oninput"in document;if(!uY){var uX=document.createElement("div");uX.setAttribute("oninput","return;"),uY="function"==typeof uX.oninput}r=uY}else r=!1;uK=r&&(!document.documentMode||9=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=u3(r)}}function u6(){for(var e=window,t=e0();t instanceof e.HTMLIFrameElement;){try{var n="string"==typeof t.contentWindow.location.href}catch(e){n=!1}if(n)e=t.contentWindow;else break;t=e0(e.document)}return t}function u8(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}var u5=e$&&"documentMode"in document&&11>=document.documentMode,u7=null,u9=null,se=null,st=!1;function sn(e,t,n){var r=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;st||null==u7||u7!==e0(r)||(r="selectionStart"in(r=u7)&&u8(r)?{start:r.selectionStart,end:r.selectionEnd}:{anchorNode:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset},se&&ny(se,r)||(se=r,0<(r=sN(u9,"onSelect")).length&&(t=new iQ("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=u7)))}function sr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var sl={animationend:sr("Animation","AnimationEnd"),animationiteration:sr("Animation","AnimationIteration"),animationstart:sr("Animation","AnimationStart"),transitionend:sr("Transition","TransitionEnd")},sa={},so={};function si(e){if(sa[e])return sa[e];if(!sl[e])return e;var t,n=sl[e];for(t in n)if(n.hasOwnProperty(t)&&t in so)return sa[e]=n[t];return e}e$&&(so=document.createElement("div").style,"AnimationEvent"in window||(delete sl.animationend.animation,delete sl.animationiteration.animation,delete sl.animationstart.animation),"TransitionEvent"in window||delete sl.transitionend.transition);var su=si("animationend"),ss=si("animationiteration"),sc=si("animationstart"),sf=si("transitionend"),sd=new Map,sp="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll scrollEnd toggle touchMove waiting wheel".split(" ");function sm(e,t){sd.set(e,t),eI(t,[e])}for(var sh=0;sh title"):null)}var cp=null;function cm(){}function ch(){if(this.count--,0===this.count){if(this.stylesheets)cy(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var cg=null;function cy(e,t){e.stylesheets=null,null!==e.unsuspend&&(e.count++,cg=new Map,t.forEach(cv,e),cg=null,ch.call(e))}function cv(e,t){if(!(4&t.state.loading)){var n=cg.get(e);if(n)var r=n.get("last");else{n=new Map,cg.set(e,n);for(var l=e.querySelectorAll("link[data-precedence],style[data-precedence]"),a=0;a{let{operation:Z}=l.data;"disconnect"===Z&&"function"==typeof this.onWorkerDisconnect&&this.onWorkerDisconnect()}}clearWorker(){this.worker&&this.worker.postMessage({type:"clear"})}terminateWorker(){this.worker&&this.worker.terminate()}async init(){let{preKeyBundle:l}=await window.e2ee.init();return l}setupSenderTransform(l,Z){if(!this.worker)throw Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"encrypt",readableStream:l,writableStream:Z},[l,Z])}setupReceiverTransform(l,Z){if(!this.worker)throw Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"decrypt",readableStream:l,writableStream:Z},[l,Z])}postRemoteSecretKeyMaterials(l){if(!this.worker)throw Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"remoteSecretKeyMaterials",remoteSecretKeyMaterials:l.remoteSecretKeyMaterials})}postRemoveRemoteDeriveKey(l){if(!this.worker)throw Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"removeRemoteDeriveKey",connectionId:l})}postSelfSecretKeyMaterial(l,Z,c,b=0){if(!this.worker)throw Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"selfSecretKeyMaterial",selfConnectionId:l,selfKeyId:Z,selfSecretKeyMaterial:c,waitingTime:b})}startSession(l,Z){let[c,b]=window.e2ee.startSession(l,Z.identityKey,Z.signedPreKey,Z.preKeySignature);if(b)throw b;return c}stopSession(l){let[Z,c]=window.e2ee.stopSession(l);if(c)throw c;return Z}receiveMessage(l){let[Z,c]=window.e2ee.receiveMessage(l);if(c)throw c;return Z}start(l){let[Z,c]=window.e2ee.start(l);if(c)throw c;return Z}addPreKeyBundle(l,Z){let c=window.e2ee.addPreKeyBundle(l,Z.identityKey,Z.signedPreKey,Z.preKeySignature);if(c)throw c}selfFingerprint(){return window.e2ee.selfFingerprint()}remoteFingerprints(){return window.e2ee.remoteFingerprints()}static async loadWasm(l){if(window.e2ee,(()=>{if("undefined"!=typeof global);else if("undefined"!=typeof window)window.global=window;else if("undefined"!=typeof self)self.global=self;else throw Error("cannot export Go (neither global, window nor self is defined)");if(global.require||"undefined"==typeof require||(global.require=require),!global.fs&&global.require){let l=require("fs");0!==Object.keys(l)&&(global.fs=l)}let l=()=>{let l=Error("not implemented");return l.code="ENOSYS",l};if(!global.fs){let Z="";global.fs={constants:{O_WRONLY:-1,O_RDWR:-1,O_CREAT:-1,O_TRUNC:-1,O_APPEND:-1,O_EXCL:-1},writeSync(l,b){let d=(Z+=c.decode(b)).lastIndexOf("\n");return -1!=d&&(console.log(Z.substr(0,d)),Z=Z.substr(d+1)),b.length},write(Z,c,b,d,m,I){if(0!==b||d!==c.length||null!==m){I(l());return}I(null,this.writeSync(Z,c))},chmod(Z,c,b){b(l())},chown(Z,c,b,d){d(l())},close(Z,c){c(l())},fchmod(Z,c,b){b(l())},fchown(Z,c,b,d){d(l())},fstat(Z,c){c(l())},fsync(l,Z){Z(null)},ftruncate(Z,c,b){b(l())},lchown(Z,c,b,d){d(l())},link(Z,c,b){b(l())},lstat(Z,c){c(l())},mkdir(Z,c,b){b(l())},open(Z,c,b,d){d(l())},read(Z,c,b,d,m,I){I(l())},readdir(Z,c){c(l())},readlink(Z,c){c(l())},rename(Z,c,b){b(l())},rmdir(Z,c){c(l())},stat(Z,c){c(l())},symlink(Z,c,b){b(l())},truncate(Z,c,b){b(l())},unlink(Z,c){c(l())},utimes(Z,c,b,d){d(l())}}}if(global.process||(global.process={getuid:()=>-1,getgid:()=>-1,geteuid:()=>-1,getegid:()=>-1,getgroups(){throw l()},pid:-1,ppid:-1,umask(){throw l()},cwd(){throw l()},chdir(){throw l()}}),!global.crypto){let l=require("crypto");global.crypto={getRandomValues(Z){l.randomFillSync(Z)}}}global.performance||(global.performance={now(){let[l,Z]=m.hrtime();return 1e3*l+Z/1e6}}),global.TextEncoder||(global.TextEncoder=require("util").TextEncoder),global.TextDecoder||(global.TextDecoder=require("util").TextDecoder);let Z=new TextEncoder("utf-8"),c=new TextDecoder("utf-8");if(global.Go=class{constructor(){this.argv=["js"],this.env={},this.exit=l=>{0!==l&&console.warn("exit code:",l)},this._exitPromise=new Promise(l=>{this._resolveExitPromise=l}),this._pendingEvent=null,this._scheduledTimeouts=new Map,this._nextCallbackTimeoutID=1;let l=(l,Z)=>{this.mem.setUint32(l+0,Z,!0),this.mem.setUint32(l+4,Math.floor(Z/4294967296),!0)},b=l=>this.mem.getUint32(l+0,!0)+4294967296*this.mem.getInt32(l+4,!0),d=l=>{let Z=this.mem.getFloat64(l,!0);if(0===Z)return;if(!isNaN(Z))return Z;let c=this.mem.getUint32(l,!0);return this._values[c]},m=(l,Z)=>{if("number"==typeof Z&&0!==Z){if(isNaN(Z)){this.mem.setUint32(l+4,2146959360,!0),this.mem.setUint32(l,0,!0);return}this.mem.setFloat64(l,Z,!0);return}if(void 0===Z){this.mem.setFloat64(l,0,!0);return}let c=this._ids.get(Z);void 0===c&&(void 0===(c=this._idPool.pop())&&(c=this._values.length),this._values[c]=Z,this._goRefCounts[c]=0,this._ids.set(Z,c)),this._goRefCounts[c]++;let b=0;switch(typeof Z){case"object":null!==Z&&(b=1);break;case"string":b=2;break;case"symbol":b=3;break;case"function":b=4}this.mem.setUint32(l+4,2146959360|b,!0),this.mem.setUint32(l,c,!0)},I=l=>{let Z=b(l+0),c=b(l+8);return new Uint8Array(this._inst.exports.mem.buffer,Z,c)},W=l=>{let Z=b(l+0),c=b(l+8),m=Array(c);for(let l=0;l{let Z=b(l+0),d=b(l+8);return c.decode(new DataView(this._inst.exports.mem.buffer,Z,d))},i=Date.now()-performance.now();this.importObject={go:{"runtime.wasmExit":l=>{let Z=this.mem.getInt32(l+8,!0);this.exited=!0,delete this._inst,delete this._values,delete this._goRefCounts,delete this._ids,delete this._idPool,this.exit(Z)},"runtime.wasmWrite":l=>{let Z=b(l+8),c=b(l+16),d=this.mem.getInt32(l+24,!0);fs.writeSync(Z,new Uint8Array(this._inst.exports.mem.buffer,c,d))},"runtime.resetMemoryDataView":l=>{this.mem=new DataView(this._inst.exports.mem.buffer)},"runtime.nanotime1":Z=>{l(Z+8,(i+performance.now())*1e6)},"runtime.walltime1":Z=>{let c=(new Date).getTime();l(Z+8,c/1e3),this.mem.setInt32(Z+16,c%1e3*1e6,!0)},"runtime.scheduleTimeoutEvent":l=>{let Z=this._nextCallbackTimeoutID;this._nextCallbackTimeoutID++,this._scheduledTimeouts.set(Z,setTimeout(()=>{for(this._resume();this._scheduledTimeouts.has(Z);)console.warn("scheduleTimeoutEvent: missed timeout event"),this._resume()},b(l+8)+1)),this.mem.setInt32(l+16,Z,!0)},"runtime.clearTimeoutEvent":l=>{let Z=this.mem.getInt32(l+8,!0);clearTimeout(this._scheduledTimeouts.get(Z)),this._scheduledTimeouts.delete(Z)},"runtime.getRandomData":l=>{crypto.getRandomValues(I(l+8))},"syscall/js.finalizeRef":l=>{let Z=this.mem.getUint32(l+8,!0);if(this._goRefCounts[Z]--,0===this._goRefCounts[Z]){let l=this._values[Z];this._values[Z]=null,this._ids.delete(l),this._idPool.push(Z)}},"syscall/js.stringVal":l=>{m(l+24,V(l+8))},"syscall/js.valueGet":l=>{let Z=Reflect.get(d(l+8),V(l+16));m((l=this._inst.exports.getsp())+32,Z)},"syscall/js.valueSet":l=>{Reflect.set(d(l+8),V(l+16),d(l+32))},"syscall/js.valueDelete":l=>{Reflect.deleteProperty(d(l+8),V(l+16))},"syscall/js.valueIndex":l=>{m(l+24,Reflect.get(d(l+8),b(l+16)))},"syscall/js.valueSetIndex":l=>{Reflect.set(d(l+8),b(l+16),d(l+24))},"syscall/js.valueCall":l=>{try{let Z=d(l+8),c=Reflect.get(Z,V(l+16)),b=W(l+32),I=Reflect.apply(c,Z,b);l=this._inst.exports.getsp(),m(l+56,I),this.mem.setUint8(l+64,1)}catch(Z){m(l+56,Z),this.mem.setUint8(l+64,0)}},"syscall/js.valueInvoke":l=>{try{let Z=d(l+8),c=W(l+16),b=Reflect.apply(Z,void 0,c);l=this._inst.exports.getsp(),m(l+40,b),this.mem.setUint8(l+48,1)}catch(Z){m(l+40,Z),this.mem.setUint8(l+48,0)}},"syscall/js.valueNew":l=>{try{let Z=d(l+8),c=W(l+16),b=Reflect.construct(Z,c);l=this._inst.exports.getsp(),m(l+40,b),this.mem.setUint8(l+48,1)}catch(Z){m(l+40,Z),this.mem.setUint8(l+48,0)}},"syscall/js.valueLength":Z=>{l(Z+16,parseInt(d(Z+8).length))},"syscall/js.valuePrepareString":c=>{let b=Z.encode(String(d(c+8)));m(c+16,b),l(c+24,b.length)},"syscall/js.valueLoadString":l=>{let Z=d(l+8);I(l+16).set(Z)},"syscall/js.valueInstanceOf":l=>{this.mem.setUint8(l+24,d(l+8) instanceof d(l+16)?1:0)},"syscall/js.copyBytesToGo":Z=>{let c=I(Z+8),b=d(Z+32);if(!(b instanceof Uint8Array||b instanceof Uint8ClampedArray)){this.mem.setUint8(Z+48,0);return}let m=b.subarray(0,c.length);c.set(m),l(Z+40,m.length),this.mem.setUint8(Z+48,1)},"syscall/js.copyBytesToJS":Z=>{let c=d(Z+8),b=I(Z+16);if(!(c instanceof Uint8Array||c instanceof Uint8ClampedArray)){this.mem.setUint8(Z+48,0);return}let m=b.subarray(0,c.length);c.set(m),l(Z+40,m.length),this.mem.setUint8(Z+48,1)},debug:l=>{console.log(l)}}}}async run(l){this._inst=l,this.mem=new DataView(this._inst.exports.mem.buffer),this._values=[NaN,0,null,!0,!1,global,this],this._goRefCounts=Array(this._values.length).fill(1/0),this._ids=new Map([[0,1],[null,2],[!0,3],[!1,4],[global,5],[this,6]]),this._idPool=[],this.exited=!1;let c=4096,b=l=>{let b=c,d=Z.encode(l+"\x00");return new Uint8Array(this.mem.buffer,c,d.length).set(d),(c+=d.length)%8!=0&&(c+=8-c%8),b},d=this.argv.length,m=[];this.argv.forEach(l=>{m.push(b(l))}),m.push(0),Object.keys(this.env).sort().forEach(l=>{m.push(b(`${l}=${this.env[l]}`))}),m.push(0);let I=c;m.forEach(l=>{this.mem.setUint32(c,l,!0),this.mem.setUint32(c+4,0,!0),c+=8}),this._inst.exports.run(d,I),this.exited&&this._resolveExitPromise(),await this._exitPromise}_resume(){if(this.exited)throw Error("Go program has already exited");this._inst.exports.resume(),this.exited&&this._resolveExitPromise()}_makeFuncWrapper(l){let Z=this;return function(){let c={id:l,this:this,args:arguments};return Z._pendingEvent=c,Z._resume(),c.result}}},global.require&&global.require.main===module&&global.process&&global.process.versions&&!global.process.versions.electron){m.argv.length<3&&(console.error("usage: go_js_wasm_exec [wasm binary] [arguments]"),m.exit(1));let l=new Go;l.argv=m.argv.slice(2),l.env=Object.assign({TMPDIR:require("os").tmpdir()},m.env),l.exit=m.exit,WebAssembly.instantiate(fs.readFileSync(m.argv[2]),l.importObject).then(Z=>(m.on("exit",Z=>{0!==Z||l.exited||(l._pendingEvent={id:0},l._resume())}),l.run(Z.instance))).catch(l=>{console.error(l),m.exit(1)})}})(),!window.Go)throw Error(`Failed to load module Go. window.Go is ${window.Go}.`);let Z=new Go,{instance:c}=await WebAssembly.instantiateStreaming(fetch(l),Z.importObject);if(Z.run(c),!window.e2ee)throw Error(`Failed to load module e2ee. window.e2ee is ${window.e2ee}.`)}static version(){return"2021.1.0"}static wasmVersion(){return window.e2ee.version()}}async function W(l,Z){if(Z.audio&&"boolean"!=typeof Z.audio)for(let c of l.getAudioTracks())await c.applyConstraints(Z.audio);if(Z.video&&"boolean"!=typeof Z.video)for(let c of l.getVideoTracks())await c.applyConstraints(Z.video)}/** - * @shiguredo/lyra-wasm - * Lyra V2 WebAssembly build - * @version: 2022.2.0 - * @author: Shiguredo Inc. - * @license: Apache-2.0 - **/let V="1.3.0";class i{worker;constructor(l){this.worker=l}static load(l,Z){let c=URL.createObjectURL(new Blob([atob("KGZ1bmN0aW9uIChmYWN0b3J5KSB7CiAgdHlwZW9mIGRlZmluZSA9PT0gJ2Z1bmN0aW9uJyAmJiBkZWZpbmUuYW1kID8gZGVmaW5lKGZhY3RvcnkpIDoKICBmYWN0b3J5KCk7Cn0pKChmdW5jdGlvbiAoKSB7ICd1c2Ugc3RyaWN0JzsKCiAgdmFyIEx5cmFXYXNtTW9kdWxlID0gKCgpID0+IHsKICAgIHZhciBfc2NyaXB0RGlyID0gKHR5cGVvZiBkb2N1bWVudCA9PT0gJ3VuZGVmaW5lZCcgJiYgdHlwZW9mIGxvY2F0aW9uID09PSAndW5kZWZpbmVkJyA/IG5ldyAocmVxdWlyZSgndScgKyAncmwnKS5VUkwpKCdmaWxlOicgKyBfX2ZpbGVuYW1lKS5ocmV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ZmVyLnNpemUoKTsKICAgICAgfQogICAgICBlbmNvZGUoYXVkaW9EYXRhKSB7CiAgICAgICAgICBpZiAoYXVkaW9EYXRhLmxlbmd0aCAhPT0gdGhpcy5mcmFtZVNpemUpIHsKICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoYGV4cGVjdGVkIGFuIGF1ZGlvIGRhdGEgd2l0aCAke3RoaXMuZnJhbWVTaXplfSBzYW1wbGVzLCBidXQgZ290IG9uZSB3aXRoICR7YXVkaW9EYXRhLmxlbmd0aH0gc2FtcGxlc2ApOwogICAgICAgICAgfQogICAgICAgICAgdGhpcy53YXNtTW9kdWxlLmNvcHlJbnQxNkFycmF5VG9BdWRpb0RhdGEodGhpcy5idWZmZXIsIGF1ZGlvRGF0YSk7CiAgICAgICAgICBjb25zdCByZXN1bHQgPSB0aGlzLmVuY29kZXIuZW5jb2RlKHRoaXMuYnVmZmVyKTsKICAgICAgICAgIGlmIChyZXN1bHQgPT09IHVuZGVmaW5lZCkgewogICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcigiZmFpbGVkIHRvIGVuY29kZSIpOwogICAgICAgICAgfQogICAgICAgICAgZWxzZSB7CiAgICAgICAgICAgICAgdHJ5IHsKICAgICAgICAgICAgICAgICAgY29uc3QgZW5jb2RlZEF1ZGlvRGF0YSA9IG5ldyBVaW50OEFycmF5KHJlc3VsdC5zaXplKCkpOwogICAgICAgICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGVuY29kZWRBdWRpb0RhdGEubGVuZ3RoOyBpKyspIHsKICAgICAgICAgICAgICAgICAgICAgIGVuY29kZWRBdWRpb0RhdGFbaV0gPSByZXN1bHQuZ2V0KGkpOwogICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgIGlmIChlbmNvZGVkQXVkaW9EYXRhLmxlbmd0aCA9PT0gMCkgewogICAgICAgICAgICAgICAgICAgICAgLy8gRFRYIOOBjOacieWKueOAgeOBi+OBpOOAgSBhdWRpb0RhdGEg44GM54Sh6Z+z44Gq44GE44GX44OO44Kk44K644Gg44GR44KS5ZCr44KT44Gn44GE44KL5aC05ZCI44Gr44Gv44GT44GT44Gr5p2l44KLCiAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdW5kZWZpbmVkOwogICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgIHJldHVybiBlbmNvZGVkQXVkaW9EYXRhOwogICAgICAgICAgICAgIH0KICAgICAgICAgICAgICBmaW5hbGx5IHsKICAgICAgICAgICAgICAgICAgcmVzdWx0LmRlbGV0ZSgpOwogICAgICAgICAgICAgIH0KICAgICAgICAgIH0KICAgICAgfQogICAgICBzZXRCaXRyYXRlKGJpdHJhdGUpIHsKICAgICAgICAgIGNoZWNrQml0cmF0ZShiaXRyYXRlKTsKICAgICAgICAgIGlmICghdGhpcy5lbmNvZGVyLnNldEJpdHJhdGUoYml0cmF0ZSkpIHsKICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoYGZhaWxlZCB0byB1cGRhdGUgYml0cmF0ZSBmcm9tICR7dGhpcy5iaXRyYXRlfSB0byAke2JpdHJhdGV9YCk7CiAgICAgICAgICB9CiAgICAgIH0KICAgICAgZGVzdHJveSgpIHsKICAgICAgICAgIHRoaXMuZW5jb2Rlci5kZWxldGUoKTsKICAgICAgICAgIHRoaXMuYnVmZmVyLmRlbGV0ZSgpOwogICAgICB9CiAgfQogIGNsYXNzIEx5cmFTeW5jRGVjb2RlciB7CiAgICAgIHdhc21Nb2R1bGU7CiAgICAgIGRlY29kZXI7CiAgICAgIGJ1ZmZlcjsKICAgICAgc2FtcGxlUmF0ZTsKICAgICAgbnVtYmVyT2ZDaGFubmVsczsKICAgICAgZnJhbWVTaXplOwogICAgICBjb25zdHJ1Y3Rvcih3YXNtTW9kdWxlLCBkZWNvZGVyLCBidWZmZXIsIG9wdGlvbnMpIHsKICAgICAgICAgIHRoaXMud2FzbU1vZHVsZSA9IHdhc21Nb2R1bGU7CiAgICAgICAgICB0aGlzLmRlY29kZXIgPSBkZWNvZGVyOwogICAgICAgICAgdGhpcy5idWZmZXIgPSBidWZmZXI7CiAgICAgICAgICB0aGlzLnNhbXBsZVJhdGUgPSBvcHRpb25zLnNhbXBsZVJhdGUgfHwgREVGQVVMVF9TQU1QTEVfUkFURTsKICAgICAgICAgIHRoaXMubnVtYmVyT2ZDaGFubmVscyA9IG9wdGlvbnMubnVtYmVyT2ZDaGFubmVscyB8fCBERUZBVUxUX0NIQU5ORUxTOwogICAgICAgICAgdGhpcy5mcmFtZVNpemUgPSAodGhpcy5zYW1wbGVSYXRlICogRlJBTUVfRFVSQVRJT05fTVMpIC8gMTAwMDsKICAgICAgfQogICAgICBkZWNvZGUoZW5jb2RlZEF1ZGlvRGF0YSkgewogICAgICAgICAgaWYgKGVuY29kZWRBdWRpb0RhdGEgIT09IHVuZGVmaW5lZCkgewogICAgICAgICAgICAgIHRoaXMuYnVmZmVyLnJlc2l6ZSgwLCAwKTsgLy8gY2xlYXIoKSDjgpLkvb/jgYbjgajjgIzplqLmlbDjgYzlrZjlnKjjgZfjgarjgYTjgI3jgajjgYTjgYbjgqjjg6njg7zjgYzlh7rjgovjga7jgacgcmVzaXplKCkg44Gn5Luj55SoCiAgICAgICAgICAgICAgZm9yIChjb25zdCB2IG9mIGVuY29kZWRBdWRpb0RhdGEpIHsKICAgICAgICAgICAgICAgICAgdGhpcy5idWZmZXIucHVzaF9iYWNrKHYpOwogICAgICAgICAgICAgIH0KICAgICAgICAgICAgICBpZiAoIXRoaXMuZGVjb2Rlci5zZXRFbmNvZGVkUGFja2V0KHRoaXMuYnVmZmVyKSkgewogICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoImZhaWxlZCB0byBzZXQgZW5jb2RlZCBwYWNrZXQiKTsKICAgICAgICAgICAgICB9CiAgICAgICAgICB9CiAgICAgICAgICBjb25zdCByZXN1bHQgPSB0aGlzLmRlY29kZXIuZGVjb2RlU2FtcGxlcyh0aGlzLmZyYW1lU2l6ZSk7CiAgICAgICAgICBpZiAocmVzdWx0ID09PSB1bmRlZmluZWQpIHsKICAgICAgICAgICAgICB0aHJvdyBFcnJvcigiZmFpbGVkIHRvIGRlY29kZSBzYW1wbGVzIik7CiAgICAgICAgICB9CiAgICAgICAgICB0cnkgewogICAgICAgICAgICAgIGNvbnN0IGF1ZGlvRGF0YSA9IG5ldyBJbnQxNkFycmF5KHRoaXMuZnJhbWVTaXplKTsKICAgICAgICAgICAgICB0aGlzLndhc21Nb2R1bGUuY29weUF1ZGlvRGF0YVRvSW50MTZBcnJheShhdWRpb0RhdGEsIHJlc3VsdCk7CiAgICAgICAgICAgICAgcmV0dXJuIGF1ZGlvRGF0YTsKICAgICAgICAgIH0KICAgICAgICAgIGZpbmFsbHkgewogICAgICAgICAgICAgIHJlc3VsdC5kZWxldGUoKTsKICAgICAgICAgIH0KICAgICAgfQogICAgICBkZXN0cm95KCkgewogICAgICAgICAgdGhpcy5kZWNvZGVyLmRlbGV0ZSgpOwogICAgICAgICAgdGhpcy5idWZmZXIuZGVsZXRlKCk7CiAgICAgIH0KICB9CgogIC8vIOOCqOODs+OCs+ODvOODgOOBqOODh+OCs+ODvOODgOOBruOCpOODs+OCueOCv+ODs+OCueOBruWQiOioiOaVsOOBruacgOWkp+WApAogIC8vCiAgLy8g44GT44Gu5YCk44KS5aSJ5pu044GZ44KL5aC05ZCI44Gr44GvIHdhc20vQlVJTEQg44Gr44GC44KLIGAtcyBJTklUSUFMX01FTU9SWWAg44Gu5YCk44KC5ZCI44KP44Gb44Gm5aSJ5pu044GZ44KL44GT44GoCiAgY29uc3QgTUFYX1JFU09VUkNFUyA9IDEwOwogIGxldCBSRVNPVVJDRV9NQU5BR0VSOwogIGNsYXNzIFJlc291cmNlTWFuYWdlciB7CiAgICAgIGx5cmFNb2R1bGU7CiAgICAgIGVuY29kZXJzID0gbmV3IE1hcCgpOwogICAgICBkZWNvZGVycyA9IG5ldyBNYXAoKTsKICAgICAgY29uc3RydWN0b3I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XREZWNvZGVyKHBvcnQsIG9wdGlvbnMpIHsKICAgICAgICAgIGNvbnN0IGRlY29kZXIgPSB0aGlzLmRlY29kZXJzLmdldChwb3J0KTsKICAgICAgICAgIGlmIChkZWNvZGVyICE9PSB1bmRlZmluZWQpIHsKICAgICAgICAgICAgICBkZWNvZGVyLmxhc3RBY2Nlc3NlZFRpbWUgPSBwZXJmb3JtYW5jZS5ub3coKTsKICAgICAgICAgICAgICByZXR1cm4gZGVjb2Rlci5pdGVtOwogICAgICAgICAgfQogICAgICAgICAgZWxzZSB7CiAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuY3JlYXRlRGVjb2Rlcihwb3J0LCBvcHRpb25zKTsKICAgICAgICAgIH0KICAgICAgfQogICAgICByZW1vdmUocG9ydCkgewogICAgICAgICAgewogICAgICAgICAgICAgIGNvbnN0IHJlc291cmNlID0gdGhpcy5lbmNvZGVycy5nZXQocG9ydCk7CiAgICAgICAgICAgICAgaWYgKHJlc291cmNlICE9PSB1bmRlZmluZWQpIHsKICAgICAgICAgICAgICAgICAgcmVzb3VyY2UuaXRlbS5kZXN0cm95KCk7CiAgICAgICAgICAgICAgICAgIHRoaXMuZW5jb2RlcnMuZGVsZXRlKHBvcnQpOwogICAgICAgICAgICAgIH0KICAgICAgICAgIH0KICAgICAgICAgIHsKICAgICAgICAgICAgICBjb25zdCByZXNvdXJjZSA9IHRoaXMuZGVjb2RlcnMuZ2V0KHBvcnQpOwogICAgICAgICAgICAgIGlmIChyZXNvdXJjZSAhPT0gdW5kZWZpbmVkKSB7CiAgICAgICAgICAgICAgICAgIHJlc291cmNlLml0ZW0uZGVzdHJveSgpOwogICAgICAgICAgICAgICAgICB0aGlzLmRlY29kZXJzLmRlbGV0ZShwb3J0KTsKICAgICAgICAgICAgICB9CiAgICAgICAgICB9CiAgICAgIH0KICAgICAgZXZpY3RJZk5lZWQoKSB7CiAgICAgICAgICBpZiAodGhpcy5lbmNvZGVycy5zaXplICsgdGhpcy5kZWNvZGVycy5zaXplIDwgTUFYX1JFU09VUkNFUykgewogICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgIH0KICAgICAgICAgIC8vIOOCpOODs+OCueOCv+ODs+OCueaVsOOBruS4iumZkOOBq+mBlOOBl+OBpuOBhOOCi+WgtOWQiOOBq+OBr+OAgeS9v+eUqOOBleOCjOOBn+aZguWIu+OBjOS4gOeVquWPpOOBhOOCguOBruOCkuWJiumZpOOBmeOCiwogICAgICAgICAgbGV0IG9sZGVzdFBvcnQ7CiAgICAgICAgICBsZXQgb2xkZXN0VGltZTsKICAgICAgICAgIGZvciAoY29uc3QgW3BvcnQsIHJlc291cmNlXSBvZiB0aGlzLmVuY29kZXJzLmVudHJpZXMoKSkgewogICAgICAgICAgICAgIGlmIChvbGRlc3RUaW1lID09PSB1bmRlZmluZWQgfHwgcmVzb3VyY2UubGFzdEFjY2Vzc2VkVGltZSA8IG9sZGVzdFRpbWUpIHsKICAgICAgICAgICAgICAgICAgb2xkZXN0UG9ydCA9IHBvcnQ7CiAgICAgICAgICAgICAgICAgIG9sZGVzdFRpbWUgPSByZXNvdXJjZS5sYXN0QWNjZXNzZWRUaW1lOwogICAgICAgICAgICAgIH0KICAgICAgICAgIH0KICAgICAgICAgIGZvciAoY29uc3QgW3BvcnQsIHJlc291cmNlXSBvZiB0aGlzLmRlY29kZXJzLmVudHJpZXMoKSkgewogICAgICAgICAgICAgIGlmIChvbGRlc3RUaW1lID09PSB1bmRlZmluZWQgfHwgcmVzb3VyY2UubGFzdEFjY2Vzc2VkVGltZSA8IG9sZGVzdFRpbWUpIHsKICAgICAgICAgICAgICAgICAgb2xkZXN0UG9ydCA9IHBvcnQ7CiAgICAgICAgICAgICAgICAgIG9sZGVzdFRpbWUgPSByZXNvdXJjZS5sYXN0QWNjZXNzZWRUaW1lOwogICAgICAgICAgICAgIH0KICAgICAgICAgIH0KICAgICAgICAgIGlmIChvbGRlc3RQb3J0ICE9PSB1bmRlZmluZWQpIHsKICAgICAgICAgICAgICB0aG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B9IH0pOwogICAgICAgICAgICAgIH0KICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgIGNhc2UgIkx5cmFNb2R1bGUuY3JlYXRlRW5jb2RlciI6CiAgICAgICAgICAgICAgewogICAgICAgICAgICAgICAgICBjb25zdCBwb3J0ID0gbXNnLmRhdGEucG9ydDsKICAgICAgICAgICAgICAgICAgdHJ5IHsKICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IG1hbmFnZXIgPSBSRVNPVVJDRV9NQU5BR0VSOwogICAgICAgICAgICAgICAgICAgICAgaWYgKG1hbmFnZXIgPT09IHVuZGVmaW5lZCkgewogICAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcigiUkVTT1VSQ0VfTUFOQUdFUiBpcyB1bmRlZmluZWQiKTsKICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IG9wdGlvbnMgPSBtc2cuZGF0YS5vcHRpb25zOwogICAgICAgICAgICAgICAgICAgICAgY29uc3QgZW5jb2RlciA9IG1hbmFnZXIuY3JlYXRlRW5jb2Rlcihwb3J0LCBvcHRpb25zKTsKICAgICAgICAgICAgICAgICAgICAgIHBvcnQub25tZXNzYWdlID0gKG1zZykgPT4gewogICAgICAgICAgICAgICAgICAgICAgICAgIGhhbmRsZUVuY29kZXJNZXNzYWdlKG1hbmFnZXIsIHBvcnQsIG9wdGlvbnMsIG1zZyk7CiAgICAgICAgICAgICAgICAgICAgICB9OwogICAgICAgICAgICAgICAgICAgICAgcG9ydC5wb3N0TWVzc2FnZSh7IHR5cGU6IGAke21zZy5kYXRhLnR5cGV9LnJlc3VsdGAsIHJlc3VsdDogeyBmcmFtZVNpemU6IGVuY29kZXIuZnJhbWVTaXplIH0gfSk7CiAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgY2F0Y2ggKGVycm9yKSB7CiAgICAgICAgICAgICAgICAgICAgICBwb3J0LnBvc3RNZXNzYWdlKHsgdHlwZTogYCR7bXNnLmRhdGEudHlwZX0ucmVzdWx0YCwgcmVzdWx0OiB7IGVycm9yIH0gfSk7CiAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICBjYXNlICJMeXJhTW9kdWxlLmNyZWF0ZURlY29kZXIiOgogICAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgICAgY29uc3QgcG9ydCA9IG1zZy5kYXRhLnBvcnQ7CiAgICAgICAgICAgICAgICAgIHRyeSB7CiAgICAgICAgICAgICAgICAgICAgICBjb25zdCBtYW5hZ2VyID0gUkVTT1VSQ0VfTUFOQUdFUjsKICAgICAgICAgICAgICAgICAgICAgIGlmIChtYW5hZ2VyID09PSB1bmRlZmluZWQpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoIlJFU09VUkNFX01BTkFHRVIgaXMgdW5kZWZpbmVkIik7CiAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICBjb25zdCBvcHRpb25zID0gbXNnLmRhdGEub3B0aW9uczsKICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IGRlY29kZXIgPSBtYW5hZ2VyLmNyZWF0ZURlY29kZXIocG9ydCwgb3B0aW9ucyk7CiAgICAgICAgICAgICAgICAgICAgICBwb3J0Lm9ubWVzc2FnZSA9IChtc2cpID0+IHsKICAgICAgICAgICAgICAgICAgICAgICAgICBoYW5kbGVEZWNvZGVyTWVzc2FnZShtYW5hZ2VyLCBwb3J0LCBvcHRpb25zLCBtc2cpOwogICAgICAgICAgICAgICAgICAgICAgfTsKICAgICAgICAgICAgICAgICAgICAgIHBvcnQucG9zdE1lc3NhZ2UoeyB0eXBlOiBgJHttc2cuZGF0YS50eXBlfS5yZXN1bHRgLCByZXN1bHQ6IHsgZnJhbWVTaXplOiBkZWNvZGVyLmZyYW1lU2l6ZSB9IH0pOwogICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgIGNhdGNoIChlcnJvcikgewogICAgICAgICAgICAgICAgICAgICAgcG9ydC5wb3N0TWVzc2FnZSh7IHR5cGU6IGAke21zZy5kYXRhLnR5cGV9LnJlc3VsdGAsIHJlc3VsdDogeyBlcnJvciB9IH0pOwogICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgfQogICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgZGVmYXVsdDoKICAgICAgICAgICAgICBjb25zb2xlLndhcm4oInJlY2VpdmVkIHVua25vd24gbWVzc2FnZSIpOwogICAgICAgICAgICAgIGNvbnNvbGUud2Fybihtc2cpOwogICAgICB9CiAgfTsKICBmdW5jdGlvbiBoYW5kbGVFbmNvZGVyTWVzc2FnZShtYW5hZ2VyLCBwb3J0LCBvcHRpb25zLCBtc2cpIHsKICAgICAgc3dpdGNoIChtc2cuZGF0YS50eXBlKSB7CiAgICAgICAgICBjYXNlICJMeXJhRW5jb2Rlci5lbmNvZGUiOgogICAgICAgICAgICAgIHRyeSB7CiAgICAgICAgICAgICAgICAgIGNvbnN0IGVuY29kZXIgPSBtYW5hZ2VyLmdldEVuY29kZXIocG9ydCwgb3B0aW9ucyk7CiAgICAgICAgICAgICAgICAgIGNvbnN0IGVuY29kZWRBdWRpb0RhdGEgPSBlbmNvZGVyLmVuY29kZShtc2cuZGF0YS5hdWRpb0RhdGEpOwogICAgICAgICAgICAgICAgICBjb25zdCByZXNwb25zZSA9IHsgdHlwZTogYCR7bXNnLmRhdGEudHlwZX0ucmVzdWx0YCwgcmVzdWx0OiB7IGVuY29kZWRBdWRpb0RhdGEgfSB9OwogICAgICAgICAgICAgICAgICBpZiAoZW5jb2RlZEF1ZGlvRGF0YSA9PT0gdW5kZWZpbmVkKSB7CiAgICAgICAgICAgICAgICAgICAgICBwb3J0LnBvc3RNZXNzYWdlKHJlc3BvbnNlKTsKICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICBlbHNlIHsKICAgICAgICAgICAgICAgICAgICAgIHBvcnQucG9zdE1lc3NhZ2UocmVzcG9uc2UsIFtlbmNvZGVkQXVkaW9EYXRhLmJ1ZmZlcl0pOwogICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgfQogICAgICAgICAgICAgIGNhdGNoIChlcnJvcikgewogICAgICAgICAgICAgICAgICBwb3J0LnBvc3RNZXNzYWdlKHsgdHlwZTogYCR7bXNnLmRhdGEudHlwZX0ucmVzdWx0YCwgcmVzdWx0OiB7IGVycm9yIH0gfSk7CiAgICAgICAgICAgICAgfQogICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgY2FzZSAiTHlyYUVuY29kZXIuZGVzdHJveSI6CiAgICAgICAgICAgICAgbWFuYWdlci5yZW1vdmUocG9ydCk7CiAgICAgICAgICAgICAgcG9ydC5vbm1lc3NhZ2UgPSBudWxsOwogICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgZGVmYXVsdDoKICAgICAgICAgICAgICBjb25zb2xlLndhcm4oInJlY2VpdmVkIHVua25vd24gbWVzc2FnZSIpOwogICAgICAgICAgICAgIGNvbnNvbGUud2Fybihtc2cpOwogICAgICB9CiAgfQogIGZ1bmN0aW9uIGhhbmRsZURlY29kZXJNZXNzYWdlKG1hbmFnZXIsIHBvcnQsIG9wdGlvbnMsIG1zZykgewogICAgICBzd2l0Y2ggKG1zZy5kYXRhLnR5cGUpIHsKICAgICAgICAgIGNhc2UgIkx5cmFEZWNvZGVyLmRlY29kZSI6CiAgICAgICAgICAgICAgdHJ5IHsKICAgICAgICAgICAgICAgICAgY29uc3QgZGVjb2RlciA9IG1hbmFnZXIuZ2V0RGVjb2Rlcihwb3J0LCBvcHRpb25zKTsKICAgICAgICAgICAgICAgICAgY29uc3QgYXVkaW9EYXRhID0gZGVjb2Rlci5kZWNvZGUobXNnLmRhdGEuZW5jb2RlZEF1ZGlvRGF0YSk7CiAgICAgICAgICAgICAgICAgIHBvcnQucG9zdE1lc3NhZ2UoeyB0eXBlOiBgJHttc2cuZGF0YS50eXBlfS5yZXN1bHRgLCByZXN1bHQ6IHsgYXVkaW9EYXRhIH0gfSwgW2F1ZGlvRGF0YS5idWZmZXJdKTsKICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgY2F0Y2ggKGVycm9yKSB7CiAgICAgICAgICAgICAgICAgIHBvcnQucG9zdE1lc3NhZ2UoeyB0eXBlOiBgJHttc2cuZGF0YS50eXBlfS5yZXN1bHRgLCByZXN1bHQ6IHsgZXJyb3IgfSB9KTsKICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICBjYXNlICJMeXJhRGVjb2Rlci5kZXN0cm95IjoKICAgICAgICAgICAgICBtYW5hZ2VyLnJlbW92ZShwb3J0KTsKICAgICAgICAgICAgICBwb3J0Lm9ubWVzc2FnZSA9IG51bGw7CiAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICBkZWZhdWx0OgogICAgICAgICAgICAgIGNvbnNvbGUud2FybigicmVjZWl2ZWQgdW5rbm93biBtZXNzYWdlIik7CiAgICAgICAgICAgICAgY29uc29sZS53YXJuKG1zZyk7CiAgICAgIH0KICB9Cgp9KSk7Cg==")],{type:"application/javascript"})),b=new Worker(c,{name:"lyra_sync_worker"});l=new URL(l,document.location.href).toString(),Z=new URL(Z,document.location.href).toString();let d=new Promise((l,Z)=>{b.addEventListener("message",c=>{let d=c.data.result.error;void 0===d?l(new i(b)):Z(d)},{once:!0})});return b.postMessage({type:"LyraModule.load",modelPath:Z,wasmPath:l}),d}createEncoder(l={}){let Z=new MessageChannel,c=new Promise((c,b)=>{Z.port1.addEventListener("message",d=>{let m=d.data.result;"error"in m?b(m.error):c(new t(Z.port1,m.frameSize,l))},{once:!0}),Z.port1.start()});return this.worker.postMessage({type:"LyraModule.createEncoder",port:Z.port2,options:l},[Z.port2]),c}createDecoder(l={}){let Z=new MessageChannel,c=new Promise((c,b)=>{Z.port1.addEventListener("message",d=>{let m=d.data.result;"error"in m?b(m.error):c(new X(Z.port1,m.frameSize,l))},{once:!0}),Z.port1.start()});return this.worker.postMessage({type:"LyraModule.createDecoder",port:Z.port2,options:l},[Z.port2]),c}}class t{port;sampleRate;numberOfChannels;bitrate;enableDtx;frameSize;constructor(l,Z,c){this.port=l,this.frameSize=Z,this.sampleRate=c.sampleRate||16e3,this.numberOfChannels=c.numberOfChannels||1,this.bitrate=c.bitrate||9200,this.enableDtx=c.enableDtx||!1}encode(l){let Z=new Promise((l,Z)=>{this.port.addEventListener("message",c=>{let b=c.data.result;"error"in b?Z(b.error):l(b.encodedAudioData)},{once:!0})});return this.port.postMessage({type:"LyraEncoder.encode",audioData:l},[l.buffer]),Z}destroy(){this.port.postMessage({type:"LyraEncoder.destroy"}),this.port.close()}static fromState(l){return l.port.start(),new t(l.port,l.frameSize,l)}}class X{port;sampleRate;numberOfChannels;frameSize;constructor(l,Z,c){this.port=l,this.frameSize=Z,this.sampleRate=c.sampleRate||16e3,this.numberOfChannels=c.numberOfChannels||1}decode(l){let Z=new Promise((l,Z)=>{this.port.addEventListener("message",c=>{let b=c.data.result;"error"in b?Z(b.error):l(b.audioData)},{once:!0})});return void 0===l?this.port.postMessage({type:"LyraDecoder.decode",encodedAudioData:l}):this.port.postMessage({type:"LyraDecoder.decode",encodedAudioData:l},[l.buffer]),Z}destroy(){this.port.postMessage({type:"LyraDecoder.destroy"}),this.port.close()}static fromState(l){return l.port.start(),new X(l.port,l.frameSize,l)}}async function g(l={}){return(await e()).createEncoder(l)}async function G(l={}){return(await e()).createDecoder(l)}async function e(){if(void 0===b)throw Error("Lyra has not been initialized. Please call `Sora.initLyra()` beforehand.");return void 0===d&&(d=await i.load(b.wasmPath,b.modelPath)),d}function n(){let l=atob("KGZ1bmN0aW9uIChmYWN0b3J5KSB7CiAgICB0eXBlb2YgZGVmaW5lID09PSAnZnVuY3Rpb24nICYmIGRlZmluZS5hbWQgPyBkZWZpbmUoZmFjdG9yeSkgOgogICAgZmFjdG9yeSgpOwp9KSgoZnVuY3Rpb24gKCkgeyAndXNlIHN0cmljdCc7CgogICAgLyoqCiAgICAgKiBAc2hpZ3VyZWRvL2x5cmEtd2FzbQogICAgICogTHlyYSBWMiBXZWJBc3NlbWJseSBidWlsZAogICAgICogQHZlcnNpb246IDIwMjIuMi4wCiAgICAgKiBAYXV0aG9yOiBTaGlndXJlZG8gSW5jLgogICAgICogQGxpY2Vuc2U6IEFwYWNoZS0yLjAKICAgICAqKi8KCiAgICBjb25zdCBERUZBVUxUX1NBTVBMRV9SQVRFID0gMTYwMDA7CiAgICBjb25zdCBERUZBVUxUX0JJVFJBVEUgPSA5MjAwOwogICAgY29uc3QgREVGQVVMVF9FTkFCTEVfRFRYID0gZmFsc2U7CiAgICBjb25zdCBERUZBVUxUX0NIQU5ORUxTID0gMTsKICAgIC8qKgogICAgICogTHlyYSDjga7jgqjjg7PjgrPjg7zjg4AKICAgICAqLwogICAgY2xhc3MgTHlyYUVuY29kZXIgewogICAgICAgIC8qKgogICAgICAgICAqIHdhc20g44Gn44Gu44Ko44Oz44Kz44O844OJ5Yem55CG44KS5a6f6KGM44GZ44KLIHdlYiB3b3JrZXIg44Go6YCa5L+h44GZ44KL44Gf44KB44Gu44Od44O844OICiAgICAgICAgICovCiAgICAgICAgcG9ydDsKICAgICAgICAvKioKICAgICAgICAgKiDnj77lnKjjga7jgrXjg7Pjg5fjg5fjg6rjg7PjgrDjg6zjg7zjg4gKICAgICAgICAgKi8KICAgICAgICBzYW1wbGVSYXRlOwogICAgICAgIC8qKgogICAgICAgICAqIOePvuWcqOOBruODgeODo+ODjeODq+aVsAogICAgICAgICAqLwogICAgICAgIG51bWJlck9mQ2hhbm5lbHM7CiAgICAgICAgLyoqCiAgICAgICAgICog54++5Zyo44Gu44Ko44Oz44Kz44O844OJ44OT44OD44OI44Os44O844OICiAgICAgICAgICovCiAgICAgICAgYml0cmF0ZTsKICAgICAgICAvKioKICAgICAgICAgKiBEVFgg44GM5pyJ5Yq544Gr44Gq44Gj44Gm44GE44KL44GL44Gp44GG44GLCiAgICAgICAgICovCiAgICAgICAgZW5hYmxlRHR4OwogICAgICAgIC8qKgogICAgICAgICAqIOS4gOOBpOOBruODleODrOODvOODoO+8iHtAbGluayBMeXJhRW5jb2Rlci5lbmNvZGV9IOODoeOCveODg+ODieOBq+a4oeOBmemfs+WjsOODh+ODvOOCv++8ieOBq+WQq+OCgeOCi+OCteODs+ODl+ODq+aVsAogICAgICAgICAqLwogICAgICAgIGZyYW1lU2l6ZTsKICAgICAgICAvKioKICAgICAgICAgKiBAaW50ZXJuYWwKICAgICAgICAgKi8KICAgICAgICBjb25zdHJ1Y3Rvcihwb3J0LCBmcmFtZVNpemUsIG9wdGlvbnMpIHsKICAgICAgICAgICAgdGhpcy5wb3J0ID0gcG9ydDsKICAgICAgICAgICAgdGhpcy5mcmFtZVNpemUgPSBmcmFtZVNpemU7CiAgICAgICAgICAgIHRoaXMuc2FtcGxlUmF0ZSA9IG9wdGlvbnMuc2FtcGxlUmF0ZSB8fCBERUZBVUxUX1NBTVBMRV9SQVRFOwogICAgICAgICAgICB0aGlzLm51bWJlck9mQ2hhbm5lbHMgPSBvcHRpb25zLm51bWJlck9mQ2hhbm5lbHMgfHwgREVGQVVMVF9DSEFOTkVMUzsKICAgICAgICAgICAgdGhpcy5iaXRyYXRlID0gb3B0aW9ucy5iaXRyYXRlIHx8IERFRkFVTFRfQklUUkFURTsKICAgICAgICAgICAgdGhpcy5lbmFibGVEdHggPSBvcHRpb25zLmVuYWJsZUR0eCB8fCBERUZBVUxUX0VOQUJMRV9EVFg7CiAgICAgICAgfQogICAgICAgIC8qKgogICAgICAgICAqIDIwbXMg5YiG44Gu6Z+z5aOw44OH44O844K/44KS44Ko44Oz44Kz44O844OJ44GZ44KLCiAgICAgICAgICoKICAgICAgICAgKiDjgarjgYogYXVkaW9EYXRhIOOBruaJgOacieaoqeOBryB3ZWIgd29ya2VyIOOBq+enu+i7ouOBleOCjOOCi+OBruOBp+OAgQogICAgICAgICAqIOOBk+OBruODoeOCveODg+ODieWRvOOBs+WHuuOBl+W+jOOBq+OBr+WRvOOBs+WHuuOBl+OCguOBqOOCueODrOODg+ODieOBi+OCieOBr+ODh+ODvOOCv+OBq+WPgueFp+OBp+OBjeOBquOBj+OBquOCiuOBvuOBmQogICAgICAgICAqIO+8iOOBpOOBvuOCiuWQjOOBmCBhdWRpb0RhdGEg44Kk44Oz44K544K/44Oz44K544Gu5L2/44GE5Zue44GX44Gv44Gn44GN44Gq44GE77yJCiAgICAgICAgICoKICAgICAgICAgKiBAcGFyYW1zIGF1ZGlvRGF0YSDjgqjjg7PjgrPjg7zjg4nlr77osaHjga7pn7Plo7Djg4fjg7zjgr8KICAgICAgICAgKiBAcmV0dXJucyDjgqjjg7PjgrPjg7zjg4nlvozjga7jg5DjgqTjg4jliJfjgILjgoLjgZcgRFRYIOOBjOacieWKueOBp+mfs+WjsOODh+ODvOOCv+OBjOeEoemfs+OBquWgtOWQiOOBq+OBryB1bmRlZmluZWQg44GM5Luj44KP44KK44Gr6L+U44GV44KM44KL44CCCiAgICAgICAgICoKICAgICAgICAgKiBAdGhyb3dzCiAgICAgICAgICoKICAgICAgICAgKiDku6XkuIvjga7jgYTjgZrjgozjgYvjgavoqbLlvZPjgZnjgovloLTlkIjjgavjga/kvovlpJbjgYzpgIHlh7rjgZXjgozjgos6CiAgICAgICAgICogLSDlhaXlipvpn7Plo7Djg4fjg7zjgr/jgYwgMjBtcyDljZjkvY3vvIjjgrXjg7Pjg5fjg6vmlbDjgajjgZfjgabjga8ge0BsaW5rIEx5cmFFbmNvZGVyLmZyYW1lU2l6ZX3vvInjgafjga/jgarjgYQKICAgICAgICAgKiAtIOOBneOBruS7luOAgeS9leOCieOBi+OBrueQhueUseOBp+OCqOODs+OCs+ODvOODieOBq+WkseaVl+OBl+OBn+WgtOWQiAogICAgICAgICAqLwogICAgICAgIGVuY29kZShhdWRpb0RhdGEpIHsKICAgICAgICAgICAgY29uc3QgcHJvbWlzZSA9IG5ldyBQcm9taXNlKChyZXNvbHZlLCByZWplY3QpID0+IHsKICAgICAgICAgICAgICAgIHRoaXMucG9ydC5hZGRFdmVudExpc3RlbmVyKCJtZXNzYWdlIiwgKHJlcykgPT4gewogICAgICAgICAgICAgICAgICAgIGNvbnN0IHJlc3VsdCA9IHJlcy5kYXRhLnJlc3VsdDsKICAgICAgICAgICAgICAgICAgICBpZiAoImVycm9yIiBpbiByZXN1bHQpIHsKICAgICAgICAgICAgICAgICAgICAgICAgcmVqZWN0KHJlc3VsdC5lcnJvcik7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIGVsc2UgewogICAgICAgICAgICAgICAgICAgICAgICByZXNvbHZlKHJlc3VsdC5lbmNvZGVkQXVkaW9EYXRhKTsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICB9LCB7IG9uY2U6IHRydWUgfSk7CiAgICAgICAgICAgIH0pOwogICAgICAgICAgICB0aGlzLnBvcnQucG9zdE1lc3NhZ2UoeyB0eXBlOiAiTHlyYUVuY29kZXIuZW5jb2RlIiwgYXVkaW9EYXRhIH0sIFthdWRpb0RhdGEuYnVmZmVyXSk7CiAgICAgICAgICAgIHJldHVybiBwcm9taXNlOwogICAgICAgIH0KICAgICAgICAvKioKICAgICAgICAgKiDjgqjjg7PjgrPjg7zjg4DnlKjjgavnorrkv53jgZfjgZ/jg6rjgr3jg7zjgrnjgpLop6PmlL7jgZnjgosKICAgICAgICAgKi8KICAgICAgICBkZXN0cm95KCkgewogICAgICAgICAgICB0aGlzLnBvcnQucG9zdE1lc3NhZ2UoeyB0eXBlOiAiTHlyYUVuY29kZXIuZGVzdHJveSIgfSk7CiAgICAgICAgICAgIHRoaXMucG9ydC5jbG9zZSgpOwogICAgICAgIH0KICAgICAgICAvKioKICAgICAgICAgKiB7QGxpbmsgTHlyYUVuY29kZXJTdGF0ZX0g44GL44KJIHtAbGluayBMeXJhRW5jb2Rlcn0g44KS5b6p5YWD44GZ44KLCiAgICAgICAgICoKICAgICAgICAgKiB7QGxpbmsgTHlyYUVuY29kZXJ9IOOBryB7QGxpbmsgTWVzc2FnZVBvcnQucG9zdE1lc3NhZ2UoKX0g44KS5L2/44Gj44Gm44CBCiAgICAgICAgICog5Yil44GuIHdlYiB3b3JrZXIg44Gr6Lui6YCB44GZ44KL44GT44Go44GM5Y+v6IO944CCCiAgICAgICAgICog44Gf44Gg44GX44CB6Lui6YCB5pmC44Gr44Gv44Kv44Op44K544KE44Oh44K944OD44OJ44Gu54q25oWL44Gv6JC944Gh44Gm44GX44G+44GG44Gu44Gn44CBCiAgICAgICAgICog44Gd44KM44KS5b6p5YWD44GX44Gm5YaN44Gz5Yip55So5Y+v6IO944Gr44GZ44KL44Gf44KB44Gu6Zai5pWw44CCCiAgICAgICAgICog44Gq44GK44CB6Lui6YCB44Gu6Zqb44Gr44GvIHtAbGluayBMeXJhRW5jb2Rlci5wb3J0fSDjga7miYDmnInmqKnjgpLnp7vorbLjgZnjgovlv4XopoHjgYzjgYLjgovjgIIKICAgICAgICAgKgogICAgICAgICAqIEBwYXJhbSBzdGF0ZSDjgqjjg7PjgrPjg7zjg4Djga7nirbmhYsKICAgICAgICAgKiBAcmV0dXJuIOW+qeWFg+OBleOCjOOBn+OCqOODs+OCs+ODvOODgAogICAgICAgICAqLwogICAgICAgIHN0YXRpYyBmcm9tU3RhdGUoc3RhdGUpIHsKICAgICAgICAgICAgc3RhdGUucG9ydC5zdGFydCgpOwogICAgICAgICAgICByZXR1cm4gbmV3IEx5cmFFbmNvZGVyKHN0YXRlLnBvcnQsIHN0YXRlLmZyYW1lU2l6ZSwgc3RhdGUpOwogICAgICAgIH0KICAgIH0KICAgIC8qKgogICAgICogTHlyYSDjga7jg4fjgrPjg7zjg4AKICAgICAqLwogICAgY2xhc3MgTHlyYURlY29kZXIgewogICAgICAgIC8qKgogICAgICAgICAqIHdhc20g44Gn44Gu44OH44Kz44O844OJ5Yem55CG44KS5a6f6KGM44GZ44KLIHdlYiB3b3JrZXIg44Go6YCa5L+h44GZ44KL44Gf44KB44Gu44Od44O844OICiAgICAgICAgICovCiAgICAgICAgcG9ydDsKICAgICAgICAvKioKICAgICAgICAgKiDnj77lnKjjga7jgrXjg7Pjg5fjg5fjg6rjg7PjgrDjg6zjg7zjg4gKICAgICAgICAgKi8KICAgICAgICBzYW1wbGVSYXRlOwogICAgICAgIC8qKgogICAgICAgICAqIOePvuWcqOOBruODgeODo+ODjeODq+aVsAogICAgICAgICAqLwogICAgICAgIG51bWJlck9mQ2hhbm5lbHM7CiAgICAgICAgLyoqCiAgICAgICAgICog5LiA44Gk44Gu44OV44Os44O844Og77yIe0BsaW5rIEx5cmFFbmNvZGVyLmRlY29kZX0g44Oh44K944OD44OJ44Gu6L+U44KK5YCk44Gu6Z+z5aOw44OH44O844K/77yJ44Gr5ZCr44G+44KM44KL44K144Oz44OX44Or5pWwCiAgICAgICAgICovCiAgICAgICAgZnJhbWVTaXplOwogICAgICAgIC8qKgogICAgICAgICAqIEBpbnRlcm5hbAogICAgICAgICAqLwogICAgICAgIGNvbnN0cnVjdG9yKHBvcnQsIGZyYW1lU2l6ZSwgb3B0aW9ucykgewogICAgICAgICAgICB0aGlzLnBvcnQgPSBwb3J0OwogICAgICAgICAgICB0aGlzLmZyYW1lU2l6ZSA9IGZyYW1lU2l6ZTsKICAgICAgICAgICAgdGhpcy5zYW1wbGVSYXRlID0gb3B0aW9ucy5zYW1wbGVSYXRlIHx8IERFRkFVTFRfU0FNUExFX1JBVEU7CiAgICAgICAgICAgIHRoaXMubnVtYmVyT2ZDaGFubmVscyA9IG9wdGlvbnMubnVtYmVyT2ZDaGFubmVscyB8fCBERUZBVUxUX0NIQU5ORUxTOwogICAgICAgIH0KICAgICAgICAvKioKICAgICAgICAgKiB7QGxpbmsgTHlyYUVuY29kZXIuZW5jb2RlfSDjg6Hjgr3jg4Pjg4njgavjgojjgaPjgabjgqjjg7PjgrPjg7zjg4njgZXjgozjgZ/pn7Plo7Djg4fjg7zjgr/jgpLjg4fjgrPjg7zjg4njgZnjgosKICAgICAgICAgKgogICAgICAgICAqIOOBquOBiiBlbmNvZGVkQXVkaW9EYXRhIOOBruaJgOacieaoqeOBryB3ZWIgd29ya2VyIOOBq+enu+i7ouOBleOCjOOCi+OBruOBp+OAgQogICAgICAgICAqIOOBk+OBruODoeOCveODg+ODieWRvOOBs+WHuuOBl+W+jOOBq+OBr+WRvOOBs+WHuuOBl+OCguOBqOOCueODrOODg+ODieOBi+OCieOBr+ODh+ODvOOCv+OBq+WPgueFp+OBp+OBjeOBquOBj+OBquOCiuOBvuOBmQogICAgICAgICAqIO+8iOOBpOOBvuOCiuWQjOOBmCBlbmNvZGVkQXVkaW9EYXRhIOOCpOODs+OCueOCv+ODs+OCueOBruS9v+OBhOWbnuOBl+OBr+OBp+OBjeOBquOBhO+8iQogICAgICAgICAqCiAgICAgICAgICogQHBhcmFtcyBlbmNvZGVkQXVkaW9EYXRhIOODh+OCs+ODvOODieWvvuixoeOBruODkOOCpOODiuODquWIl+OBquOBhOOBlyB1bmRlZmluZWQKICAgICAgICAgKiBAcmV0dXJucyDjg4fjgrPjg7zjg4njgZXjgozjgZ8gMjBtcyDliIbjga7pn7Plo7Djg4fjg7zjgr/jgIJ1bmRlZmluZWQg44GM5rih44GV44KM44Gf5aC05ZCI44Gr44Gv5Luj44KP44KK44Gr44Kz44Oz44OV44Kp44O844OI44OO44Kk44K644GM55Sf5oiQ44GV44KM44KL44CCCiAgICAgICAgICovCiAgICAgICAgZGVjb2RlKGVuY29kZWRBdWRpb0RhdGEpIHsKICAgICAgICAgICAgY29uc3QgcHJvbWlzZSA9IG5ldyBQcm9taXNlKChyZXNvbHZlLCByZWplY3QpID0+IHsKICAgICAgICAgICAgICAgIHRoaXMucG9ydC5hZGRFdmVudExpc3RlbmVyKCJtZXNzYWdlIiwgKHJlcykgPT4gewogICAgICAgICAgICAgICAgICAgIGNvbnN0IHJlc3VsdCA9IHJlcy5kYXRhLnJlc3VsdDsKICAgICAgICAgICAgICAgICAgICBpZiAoImVycm9yIiBpbiByZXN1bHQpIHsKICAgICAgICAgICAgICAgICAgICAgICAgcmVqZWN0KHJlc3VsdC5lcnJvcik7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIGVsc2UgewogICAgICAgICAgICAgICAgICAgICAgICByZXNvbHZlKHJlc3VsdC5hdWRpb0RhdGEpOwogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIH0sIHsgb25jZTogdHJ1ZSB9KTsKICAgICAgICAgICAgfSk7CiAgICAgICAgICAgIGlmIChlbmNvZGVkQXVkaW9EYXRhID09PSB1bmRlZmluZWQpIHsKICAgICAgICAgICAgICAgIHRoaXMucG9ydC5wb3N0TWVzc2FnZSh7IHR5cGU6ICJMeXJhRGVjb2Rlci5kZWNvZGUiLCBlbmNvZGVkQXVkaW9EYXRhIH0pOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGVsc2UgewogICAgICAgICAgICAgICAgdGhpcy5wb3J0LnBvc3RNZXNzYWdlKHsgdHlwZTogIkx5cmFEZWNvZGVyLmRlY29kZSIsIGVuY29kZWRBdWRpb0RhdGEgfSwgW2VuY29kZWRBdWRpb0RhdGEuYnVmZmVyXSk7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgcmV0dXJuIHByb21pc2U7CiAgICAgICAgfQogICAgICAgIC8qKgogICAgICAgICAqIOODh+OCs+ODvOODgOeUqOOBq+eiuuS/neOBl+OBn+ODquOCveODvOOCueOCkuino+aUvuOBmeOCiwogICAgICAgICAqLwogICAgICAgIGRlc3Ryb3koKSB7CiAgICAgICAgICAgIHRoaXMucG9ydC5wb3N0TWVzc2FnZSh7IHR5cGU6ICJMeXJhRGVjb2Rlci5kZXN0cm95IiB9KTsKICAgICAgICAgICAgdGhpcy5wb3J0LmNsb3NlKCk7CiAgICAgICAgfQogICAgICAgIC8qKgogICAgICAgICAqIHtAbGluayBMeXJhRGVjb2RlclN0YXRlfSDjgYvjgokge0BsaW5rIEx5cmFEZWNvZGVyfSDjgpLlvqnlhYPjgZnjgosKICAgICAgICAgKgogICAgICAgICAqIHtAbGluayBMeXJhRGVjb2Rlcn0g44GvIHtAbGluayBNZXNzYWdlUG9ydC5wb3N0TWVzc2FnZSgpfSDjgpLkvb/jgaPjgabjgIEKICAgICAgICAgKiDliKXjga4gd2ViIHdvcmtlciDjgavou6LpgIHjgZnjgovjgZPjgajjgYzlj6/og73jgIIKICAgICAgICAgKiDjgZ/jgaDjgZfjgIHou6LpgIHmmYLjgavjga/jgq/jg6njgrnjgoTjg6Hjgr3jg4Pjg4njga7nirbmhYvjga/okL3jgaHjgabjgZfjgb7jgYbjga7jgafjgIEKICAgICAgICAgKiDjgZ3jgozjgpLlvqnlhYPjgZfjgablho3jgbPliKnnlKjlj6/og73jgavjgZnjgovjgZ/jgoHjga7plqLmlbDjgIIKICAgICAgICAgKiDjgarjgYrjgIHou6LpgIHjga7pmpvjgavjga8ge0BsaW5rIEx5cmFEZWNvZGVyLnBvcnR9IOOBruaJgOacieaoqeOCkuenu+itsuOBmeOCi+W/heimgeOBjOOBguOCi+OAggogICAgICAgICAqCiAgICAgICAgICogQHBhcmFtIHN0YXRlIOODh+OCs+ODvOODgOOBrueKtuaFiwogICAgICAgICAqIEByZXR1cm4g5b6p5YWD44GV44KM44Gf44OH44Kz44O844OACiAgICAgICAgICovCiAgICAgICAgc3RhdGljIGZyb21TdGF0ZShzdGF0ZSkgewogICAgICAgICAgICBzdGF0ZS5wb3J0LnN0YXJ0KCk7CiAgICAgICAgICAgIHJldHVybiBuZXcgTHlyYURlY29kZXIoc3RhdGUucG9ydCwgc3RhdGUuZnJhbWVTaXplLCBzdGF0ZSk7CiAgICAgICAgfQogICAgfQoKICAgIC8qKgogICAgICogUENN77yITDE277yJ44Gu6Z+z5aOw44OH44O844K/44KSIEx5cmEg44Gn44Ko44Oz44Kz44O844OJ44GZ44KLCiAgICAgKgogICAgICogQHBhcmFtIGVuY29kZXIgTHlyYSDjgqjjg7PjgrPjg7z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GVyU3RhdGUpOwogICAgICAgIHJldHVybiBuZXcgVHJhbnNmb3JtU3RyZWFtKHsKICAgICAgICAgICAgYXN5bmMgdHJhbnNmb3JtKGVuY29kZWRGcmFtZSwgY29udHJvbGxlcikgewogICAgICAgICAgICAgICAgYXdhaXQgdHJhbnNmb3JtUGNtVG9MeXJhKGVuY29kZXIsIGVuY29kZWRGcmFtZSwgY29udHJvbGxlcik7CiAgICAgICAgICAgIH0sCiAgICAgICAgICAgIGZsdXNoKCkgewogICAgICAgICAgICAgICAgZW5jb2Rlci5kZXN0cm95KCk7CiAgICAgICAgICAgIH0sCiAgICAgICAgfSk7CiAgICB9CiAgICBmdW5jdGlvbiBjcmVhdGVSZWNlaXZlclRyYW5zZm9ybShkZWNvZGVyU3RhdGUpIHsKICAgICAgICBjb25zdCBkZWNvZGVyID0gTHlyYURlY29kZXIuZnJvbVN0YXRlKGRlY29kZXJTdGF0ZSk7CiAgICAgICAgcmV0dXJuIG5ldyBUcmFuc2Zvcm1TdHJlYW0oewogICAgICAgICAgICBhc3luYyB0cmFuc2Zvcm0oZW5jb2RlZEZyYW1lLCBjb250cm9sbGVyKSB7CiAgICAgICAgICAgICAgICBhd2FpdCB0cmFuc2Zvcm1MeXJhVG9QY20oZGVjb2RlciwgZW5jb2RlZEZyYW1lLCBjb250cm9sbGVyKTsKICAgICAgICAgICAgfSwKICAgICAgICAgICAgZmx1c2goKSB7CiAgICAgICAgICAgICAgICBkZWNvZGVyLmRlc3Ryb3koKTsKICAgICAgICAgICAgfSwKICAgICAgICB9KTsKICAgIH0KICAgIG9ucnRjdHJhbnNmb3JtID0gKG1zZykgPT4gewogICAgICAgIGlmIChtc2cudHJhbnNmb3JtZXIub3B0aW9ucy5uYW1lID09PSAnc2VuZGVyVHJhbnNmb3JtJykgewogICAgICAgICAgICBjb25zdCB0cmFuc2Zvcm0gPSBjcmVhdGVTZW5kZXJUcmFuc2Zvcm0obXNnLnRyYW5zZm9ybWVyLm9wdGlvbnMubHlyYUVuY29kZXIpOwogICAgICAgICAgICBtc2cudHJhbnNmb3JtZXIucmVhZGFibGUKICAgICAgICAgICAgICAgIC5waXBlVGhyb3VnaCh0cmFuc2Zvcm0pCiAgICAgICAgICAgICAgICAucGlwZVRvKG1zZy50cmFuc2Zvcm1lci53cml0YWJsZSkKICAgICAgICAgICAgICAgIC5jYXRjaCgoZSkgPT4gY29uc29sZS53YXJuKGUpKTsKICAgICAgICB9CiAgICAgICAgZWxzZSBpZiAobXNnLnRyYW5zZm9ybWVyLm9wdGlvbnMubmFtZSA9PT0gJ3JlY2VpdmVyVHJhbnNmb3JtJykgewogICAgICAgICAgICBjb25zdCB0cmFuc2Zvcm0gPSBjcmVhdGVSZWNlaXZlclRyYW5zZm9ybShtc2cudHJhbnNmb3JtZXIub3B0aW9ucy5seXJhRGVjb2Rlcik7CiAgICAgICAgICAgIG1zZy50cmFuc2Zvcm1lci5yZWFkYWJsZQogICAgICAgICAgICAgICAgLnBpcGVUaHJvdWdoKHRyYW5zZm9ybSkKICAgICAgICAgICAgICAgIC5waXBlVG8obXNnLnRyYW5zZm9ybWVyLndyaXRhYmxlKQogICAgICAgICAgICAgICAgLmNhdGNoKChlKSA9PiBjb25zb2xlLndhcm4oZSkpOwogICAgICAgIH0KICAgICAgICBlbHNlIHsKICAgICAgICAgICAgY29uc29sZS53YXJuKCd1bmtub3duIG1lc3NhZ2UnKTsKICAgICAgICAgICAgY29uc29sZS53YXJuKG1zZyk7CiAgICAgICAgfQogICAgfTsKCn0pKTsK");return new Worker(URL.createObjectURL(new Blob([l],{type:"application/javascript"})))}async function a(l,Z,c){let b=new DataView(Z.data),d=new Int16Array(Z.data.byteLength/2);for(let l=0;l>1|(21845&B)<<1;K=(61680&(K=(52428&K)>>2|(13107&K)<<2))>>4|(3855&K)<<4,U[B]=((65280&K)>>8|(255&K)<<8)>>1}for(var T=function(l,Z,c){for(var b,d=l.length,m=0,I=new C(Z);m>V]=i}else for(m=0,b=new C(d);m>15-l[m]);return b},S=new y(288),B=0;B<144;++B)S[B]=8;for(var B=144;B<256;++B)S[B]=9;for(var B=256;B<280;++B)S[B]=7;for(var B=280;B<288;++B)S[B]=8;for(var v=new y(32),B=0;B<32;++B)v[B]=5;var z=T(S,9,0),w=T(S,9,1),O=T(v,5,0),j=T(v,5,1),x=function(l){for(var Z=l[0],c=1;cZ&&(Z=l[c]);return Z},f=function(l,Z,c){var b=Z/8|0;return(l[b]|l[b+1]<<8)>>(7&Z)&c},L=function(l,Z){var c=Z/8|0;return(l[c]|l[c+1]<<8|l[c+2]<<16)>>(7&Z)},M=function(l){return(l+7)/8|0},Q=function(l,Z,c){return(null==Z||Z<0)&&(Z=0),(null==c||c>l.length)&&(c=l.length),new y(l.subarray(Z,c))},E=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],P=function(l,Z,c){var b=Error(Z||E[l]);if(b.code=l,Error.captureStackTrace&&Error.captureStackTrace(b,P),!c)throw b;return b},D=function(l,Z,c,b){var d=l.length,m=b?b.length:0;if(!d||Z.f&&!Z.l)return c||new y(0);var I=!c,W=I||2!=Z.i,V=Z.i;I&&(c=new y(3*d));var i=function(l){var Z=c.length;if(l>Z){var b=new y(Math.max(2*Z,l));b.set(c),c=b}},t=Z.f||0,X=Z.p||0,g=Z.b||0,G=Z.l,e=Z.d,n=Z.m,a=Z.n,R=8*d;do{if(!G){t=f(l,X,1);var h=f(l,X+1,3);if(X+=3,h){if(1==h)G=w,e=j,n=9,a=5;else if(2==h){var s=f(l,X,31)+257,C=f(l,X+10,15)+4,o=s+f(l,X+5,31)+1;X+=14;for(var J=new y(o),F=new y(19),A=0;A>4;if(K<16)J[A++]=K;else{var S=0,v=0;for(16==K?(v=3+f(l,X,3),X+=2,S=J[A-1]):17==K?(v=3+f(l,X,7),X+=3):18==K&&(v=11+f(l,X,127),X+=7);v--;)J[A++]=S}}var z=J.subarray(0,s),O=J.subarray(s);n=x(z),a=x(O),G=T(z,n,1),e=T(O,a,1)}else P(1)}else{var K=M(X)+4,E=l[K-4]|l[K-3]<<8,D=K+E;if(D>d){V&&P(0);break}W&&i(g+E),c.set(l.subarray(K,D),g),Z.b=g+=E,Z.p=X=8*D,Z.f=t;continue}if(X>R){V&&P(0);break}}W&&i(g+131072);for(var q=(1<>4;if((X+=15&S)>R){V&&P(0);break}if(S||P(2),ll<256)c[g++]=ll;else if(256==ll){$=X,G=null;break}else{var lZ=ll-254;if(ll>264){var A=ll-257,lc=Y[A];lZ=f(l,X,(1<>4;lb||P(3),X+=15&lb;var O=H[ld];if(ld>3){var lc=u[ld];O+=L(l,X)&(1<R){V&&P(0);break}W&&i(g+131072);var lm=g+lZ;if(g>8},_=function(l,Z,c){c<<=7&Z;var b=Z/8|0;l[b]|=c,l[b+1]|=c>>8,l[b+2]|=c>>16},$=function(l,Z){for(var c=[],b=0;bg&&(g=m[b].s);var G=new C(g+1),e=ll(c[t-1],G,0);if(e>Z){var b=0,n=0,a=e-Z,R=1<Z)n+=R-(1<>=a;n>0;){var s=m[b].s;G[s]=0&&n;--b){var o=m[b].s;G[o]==Z&&(--G[o],++n)}e=Z}return{t:new y(G),l:e}},ll=function(l,Z,c){return -1==l.s?Math.max(ll(l.l,Z,c+1),ll(l.r,Z,c+1)):Z[l.s]=c},lZ=function(l){for(var Z=l.length;Z&&!l[--Z];);for(var c=new C(++Z),b=0,d=l[0],m=1,I=function(l){c[b++]=l},W=1;W<=Z;++W)if(l[W]==d&&W!=Z)++m;else{if(!d&&m>2){for(;m>138;m-=138)I(32754);m>2&&(I(m>10?m-11<<5|28690:m-3<<5|12305),m=0)}else if(m>3){for(I(d),--m;m>6;m-=6)I(8304);m>2&&(I(m-3<<5|8208),m=0)}for(;m--;)I(d);m=1,d=l[W]}return{c:c.subarray(0,b),n:Z}},lc=function(l,Z){for(var c=0,b=0;b>8,l[d+2]=255^l[d],l[d+3]=255^l[d+1];for(var m=0;m4&&!B[p[w-1]];--w);var j=i+5<<3,x=lc(d,S)+lc(m,v)+I,f=lc(d,a)+lc(m,s)+I+14+3*w+lc(H,B)+2*H[16]+3*H[17]+7*H[18];if(V>=0&&j<=x&&j<=f)return lb(Z,t,l.subarray(V,V+i));if(q(Z,t,1+(f15&&(q(Z,t,E[r]>>5&127),t+=E[r]>>12)}}else X=z,g=S,G=O,e=v;for(var r=0;r255){var P=D>>18&31;_(Z,t,X[P+257]),t+=g[P+257],P>7&&(q(Z,t,D>>23&31),t+=Y[P]);var ll=31&D;_(Z,t,G[ll]),t+=e[ll],ll>3&&(_(Z,t,D>>5&8191),t+=u[ll])}else _(Z,t,X[D]),t+=g[D]}return _(Z,t,X[256]),t+g[256]},lm=new o([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),lI=new y(0),lW=function(l,Z,c,b,d,m){var I=m.z||l.length,W=new y(b+I+5*(1+Math.ceil(I/7e3))+d),V=W.subarray(b,W.length-d),i=m.l,t=7&(m.r||0);if(Z){t&&(V[0]=m.r>>3);for(var X=lm[Z-1],g=X>>13,G=8191&X,e=(1<7e3||U>24576)&&(z>423||!i)){t=ld(l,V,0,p,J,F,k,U,K,H-K,t),U=N=k=0,K=H;for(var w=0;w<286;++w)J[w]=0;for(var w=0;w<30;++w)F[w]=0}var O=2,j=0,x=G,f=S-v&32767;if(z>2&&T==s(H-f))for(var L=Math.min(g,z)-1,E=Math.min(32767,H),P=Math.min(258,z);f<=E&&--x&&S!=v;){if(l[H+O]==l[H+O-f]){for(var D=0;DO){if(O=D,j=f,D>L)break;for(var q=Math.min(f,D-2),_=0,w=0;w_&&(_=lZ,v=$)}}}v=n[S=v],f+=S-v&32767}if(j){p[U++]=268435456|A[O]<<18|r[j];var lc=31&A[O],lI=31&r[j];k+=Y[lc]+u[lI],++J[257+lc],++F[lI],B=H+O,++N}else p[U++]=l[H],++J[l[H]]}}for(H=Math.max(H,B);H=I&&(V[t/8|0]=i,lW=I),t=lb(V,t+1,l.subarray(H,lW))}m.i=I}return Q(W,0,b+M(t)+d)},lV=function(){var l=1,Z=0;return{p:function(c){for(var b=l,d=Z,m=0|c.length,I=0;I!=m;){for(var W=Math.min(I+2655,m);I>16),d=(65535&d)+15*(d>>16)}l=b,Z=d},d:function(){return l%=65521,Z%=65521,(255&l)<<24|(65280&l)<<8|(255&Z)<<8|Z>>8}}},li=function(l,Z,c,b,d){if(!d&&(d={l:1},Z.dictionary)){var m=Z.dictionary.subarray(-32768),I=new y(m.length+l.length);I.set(m),I.set(l,m.length),l=I,d.w=m.length}return lW(l,null==Z.level?6:Z.level,null==Z.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(l.length)))):12+Z.mem,c,b,d)},lt=function(l,Z,c){for(;c;++Z)l[Z]=c,c>>>=8},lX=function(l,Z){var c=Z.level;if(l[0]=120,l[1]=(0==c?0:c<6?1:9==c?3:2)<<6|(Z.dictionary&&32),l[1]|=31-(l[0]<<8|l[1])%31,Z.dictionary){var b=lV();b.p(Z.dictionary),lt(l,2,b.d())}};function lg(l,Z){Z||(Z={});var c=lV();c.p(l);var b=li(l,Z,Z.dictionary?6:2,4);return lX(b,Z),lt(b,b.length-4,c.d()),b}function lG(l,Z){var c;return D(l.subarray((c=Z&&Z.dictionary,((15&l[0])!=8||l[0]>>4>7||(l[0]<<8|l[1])%31)&&P(6,"invalid zlib data"),(l[1]>>5&1)==+!c&&P(6,"invalid zlib data: "+(32&l[1]?"need":"unexpected")+" dictionary"),(l[1]>>3&4)+2),-4),{i:2},Z&&Z.out,Z&&Z.dictionary)}var le="undefined"!=typeof TextDecoder&&new TextDecoder;try{le.decode(lI,{stream:!0})}catch(l){}function ln(){let l=window.navigator.userAgent.toLocaleLowerCase();return -1!==l.indexOf("edge")?"edge":-1!==l.indexOf("chrome")&&-1===l.indexOf("edge")?"chrome":-1!==l.indexOf("safari")&&-1===l.indexOf("chrome")?"safari":-1!==l.indexOf("opera")?"opera":-1!==l.indexOf("firefox")?"firefox":null}function la(l){return void 0!==l.authn_metadata?l.authn_metadata:void 0!==l.metadata?l.metadata:null}function lR(l){return"object"==typeof l&&null!==l&&"pre_key_bundle"in l?l.pre_key_bundle:null}class lh extends Error{}function ls(l,Z,c){let b=new Event(l);try{b.data=JSON.parse(JSON.stringify(Z))}catch(l){b.data=Z}return b.transportType=c,b}function ly(l,Z,c,b,d){let m=new Event(l);try{m.data=JSON.parse(JSON.stringify(Z))}catch(l){m.data=Z}return m.logType=c,m.dataChannelId=b,m.dataChannelLabel=d,m}function lC(l,Z){if(Z){let Z=lG(new Uint8Array(l));return new TextDecoder().decode(Z)}return l}class lo{constructor(l,Z,c,d,m,I){this.midToAudioCodecType=new Map,this.senderStreamInitialized=new WeakSet,this.role=Z,this.channelId=c,this.metadata=d,this.signalingUrlCandidates=l,this.options=m,this.connectionTimeout=6e4,"number"==typeof this.options.timeout&&(console.warn("@deprecated timeout option will be removed in a future version. Use connectionTimeout."),this.connectionTimeout=this.options.timeout),"number"==typeof this.options.connectionTimeout&&(this.connectionTimeout=this.options.connectionTimeout),this.disconnectWaitTimeout=3e3,"number"==typeof this.options.disconnectWaitTimeout&&(this.disconnectWaitTimeout=this.options.disconnectWaitTimeout),this.signalingCandidateTimeout=3e3,"number"==typeof this.options.signalingCandidateTimeout&&(this.signalingCandidateTimeout=this.options.signalingCandidateTimeout),this.constraints=null,this.debug=I,this.clientId=null,this.connectionId=null,this.sessionId=null,this.remoteConnectionIds=[],this.stream=null,this.ws=null,this.pc=null,this.encodings=[],this.callbacks={disconnect:()=>{},push:()=>{},addstream:()=>{},track:()=>{},removestream:()=>{},removetrack:()=>{},notify:()=>{},log:()=>{},timeout:()=>{},timeline:()=>{},signaling:()=>{},message:()=>{},datachannel:()=>{}},this.authMetadata=null,this.e2ee=null,this.connectionTimeoutTimerId=0,this.monitorSignalingWebSocketEventTimerId=0,this.monitorIceConnectionStateChangeTimerId=0,this.soraDataChannels={},this.mids={audio:"",video:""},this.signalingSwitched=!1,this.signalingOfferMessageDataChannels={},this.connectedSignalingUrl="",this.contactSignalingUrl="",void 0!==b&&(this.lyra=new s)}on(l,Z){"addstream"===l?console.warn("@deprecated addstream callback will be removed in a future version. Use track callback."):"removestream"===l&&console.warn("@deprecated removestream callback will be removed in a future version. Use removetrack callback."),l in this.callbacks&&(this.callbacks[l]=Z)}stopAudioTrack(l){for(let Z of l.getAudioTracks())Z.enabled=!1;return new Promise((Z,c)=>{setTimeout(()=>{Promise.all(l.getAudioTracks().map(async Z=>{if(Z.stop(),l.removeTrack(Z),null!==this.pc){let l=this.pc.getSenders().find(l=>l.track&&l.track.id===Z.id);if(l)return l.replaceTrack(null)}})).then(()=>Z()).catch(c)},100)})}stopVideoTrack(l){for(let Z of l.getVideoTracks())Z.enabled=!1;return new Promise((Z,c)=>{setTimeout(()=>{Promise.all(l.getVideoTracks().map(async Z=>{if(Z.stop(),l.removeTrack(Z),null!==this.pc){let l=this.pc.getSenders().find(l=>l.track&&l.track.id===Z.id);if(l)return l.replaceTrack(null)}})).then(()=>Z()).catch(c)},100)})}async replaceAudioTrack(l,Z){await this.stopAudioTrack(l);let c=this.getAudioTransceiver();if(null===c)throw Error("Unable to set an audio track. Audio track sender is undefined");l.addTrack(Z),await c.sender.replaceTrack(Z),await this.setupSenderTransform(c.sender)}async replaceVideoTrack(l,Z){await this.stopVideoTrack(l);let c=this.getVideoTransceiver();if(null===c)throw Error("Unable to set video track. Video track sender is undefined");l.addTrack(Z),await c.sender.replaceTrack(Z),await this.setupSenderTransform(c.sender)}signalingTerminate(){for(let l of Object.keys(this.soraDataChannels)){let Z=this.soraDataChannels[l];Z&&Z.close(),delete this.soraDataChannels[l]}this.ws&&(this.ws.close(),this.ws=null),this.pc&&this.pc.close(),this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection()}abendPeerConnectionState(l){for(let l of(this.clearMonitorIceConnectionStateChange(),this.pc&&(this.pc.ondatachannel=null,this.pc.oniceconnectionstatechange=null,this.pc.onicegatheringstatechange=null,this.pc.onconnectionstatechange=null),this.ws&&(this.ws.onclose=l=>{this.writeWebSocketTimelineLog("onclose",{code:l.code,reason:l.reason})},this.ws.onmessage=null,this.ws.onerror=null),Object.keys(this.soraDataChannels))){let Z=this.soraDataChannels[l];Z&&(Z.onclose=l=>{let Z=l.currentTarget;this.writeDataChannelTimelineLog("onclose",Z),this.trace("CLOSE DATA CHANNEL",Z.label)},Z.onmessage=null,Z.onerror=null)}for(let l of Object.keys(this.soraDataChannels)){let Z=this.soraDataChannels[l];Z&&Z.close(),delete this.soraDataChannels[l]}this.ws&&(this.ws.close(),this.ws=null),this.pc&&this.pc.close(),this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection();let Z=this.soraCloseEvent("abend",l);this.callbacks.disconnect(Z),this.writeSoraTimelineLog("disconnect-abend",Z)}async abend(l,Z){for(let l of(this.clearMonitorIceConnectionStateChange(),this.pc&&(this.pc.ondatachannel=null,this.pc.oniceconnectionstatechange=null,this.pc.onicegatheringstatechange=null,this.pc.onconnectionstatechange=null),this.ws&&(this.ws.onclose=l=>{this.writeWebSocketTimelineLog("onclose",{code:l.code,reason:l.reason})},this.ws.onmessage=null,this.ws.onerror=null),Object.keys(this.soraDataChannels))){let Z=this.soraDataChannels[l];Z&&(Z.onclose=l=>{let Z=l.currentTarget;this.writeDataChannelTimelineLog("onclose",Z),this.trace("CLOSE DATA CHANNEL",Z.label)},Z.onmessage=null,Z.onerror=null)}if(this.soraDataChannels.signaling){let Z={type:"disconnect",reason:l};if(this.signalingOfferMessageDataChannels.signaling&&!0===this.signalingOfferMessageDataChannels.signaling.compress){let l=lg(new TextEncoder().encode(JSON.stringify(Z)),{});if("open"===this.soraDataChannels.signaling.readyState)try{this.soraDataChannels.signaling.send(l),this.writeDataChannelSignalingLog("send-disconnect",this.soraDataChannels.signaling,Z)}catch(Z){let l=Z.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.soraDataChannels.signaling,l)}}else if("open"===this.soraDataChannels.signaling.readyState)try{this.soraDataChannels.signaling.send(JSON.stringify(Z)),this.writeDataChannelSignalingLog("send-disconnect",this.soraDataChannels.signaling,Z)}catch(Z){let l=Z.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.soraDataChannels.signaling,l)}}for(let l of Object.keys(this.soraDataChannels)){let Z=this.soraDataChannels[l];Z&&(Z.onerror=null,Z.close()),delete this.soraDataChannels[l]}if(await this.disconnectWebSocket(l),await this.disconnectPeerConnection(),this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection(),"WEBSOCKET-ONCLOSE"===l&&Z&&(1e3===Z.code||1005===Z.code)){let l=this.soraCloseEvent("normal","DISCONNECT",Z);this.writeSoraTimelineLog("disconnect-normal",l),this.callbacks.disconnect(l);return}let c=this.soraCloseEvent("abend",l,Z);this.writeSoraTimelineLog("disconnect-abend",c),this.callbacks.disconnect(this.soraCloseEvent("abend",l,Z))}initializeConnection(){this.clientId=null,this.connectionId=null,this.sessionId=null,this.remoteConnectionIds=[],this.stream=null,this.ws=null,this.pc=null,this.encodings=[],this.authMetadata=null,this.e2ee=null,this.soraDataChannels={},this.mids={audio:"",video:""},this.signalingSwitched=!1,this.signalingOfferMessageDataChannels={},this.contactSignalingUrl="",this.connectedSignalingUrl="",this.clearConnectionTimeout()}disconnectWebSocket(l){let Z=0;return this.signalingSwitched?(this.ws&&(this.ws.close(),this.ws=null),Promise.resolve(null)):new Promise((c,b)=>{if(!this.ws)return c(null);if(this.ws.onclose=l=>(this.ws&&(this.ws.close(),this.ws=null),clearTimeout(Z),this.writeWebSocketTimelineLog("onclose",{code:l.code,reason:l.reason}),c({code:l.code,reason:l.reason})),1!==this.ws.readyState)return this.ws.close(),this.ws=null,c(null);{let b={type:"disconnect",reason:l};this.ws.send(JSON.stringify(b)),this.writeWebSocketSignalingLog("send-disconnect",b),Z=setTimeout(()=>{this.ws&&(this.ws.close(),this.ws=null),c({code:1006,reason:""})},this.disconnectWaitTimeout)}})}disconnectDataChannel(){let l=()=>{for(let l of Object.keys(this.soraDataChannels)){let Z=this.soraDataChannels[l];Z&&(Z.onerror=null,Z.close()),delete this.soraDataChannels[l]}};return new Promise((Z,c)=>{if(!this.soraDataChannels.signaling)return l(),Z({code:4999,reason:""});let b=setTimeout(()=>(l(),c()),this.disconnectWaitTimeout),d=[];for(let c of Object.keys(this.soraDataChannels)){let m=this.soraDataChannels[c];if(m){m.onerror=()=>(clearTimeout(b),l(),Z({code:4999,reason:""}));let c=()=>new Promise((l,Z)=>{let c=0,b=setInterval(()=>{c++,"closed"===m.readyState&&(clearInterval(b),l()),this.disconnectWaitTimeout<100*c&&(l(),clearInterval(b))},100)});d.push(c())}}Promise.all(d).then(()=>{0===Object.keys(this.soraDataChannels).length?Z(null):Z({code:4999,reason:""})}).catch(l=>c(l)).finally(()=>{l(),clearTimeout(b)});let m={type:"disconnect",reason:"NO-ERROR"};if(this.signalingOfferMessageDataChannels.signaling&&!0===this.signalingOfferMessageDataChannels.signaling.compress){let l=lg(new TextEncoder().encode(JSON.stringify(m)),{});if("open"===this.soraDataChannels.signaling.readyState)try{this.soraDataChannels.signaling.send(l),this.writeDataChannelSignalingLog("send-disconnect",this.soraDataChannels.signaling,m)}catch(Z){let l=Z.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.soraDataChannels.signaling,l)}}else if("open"===this.soraDataChannels.signaling.readyState)try{this.soraDataChannels.signaling.send(JSON.stringify(m)),this.writeDataChannelSignalingLog("send-disconnect",this.soraDataChannels.signaling,m)}catch(Z){let l=Z.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.soraDataChannels.signaling,l)}})}disconnectPeerConnection(){return new Promise((l,Z)=>(this.pc&&"closed"!==this.pc.connectionState&&this.pc.close(),l()))}async disconnect(){for(let l of(this.clearMonitorIceConnectionStateChange(),this.pc&&(this.pc.ondatachannel=null,this.pc.oniceconnectionstatechange=null,this.pc.onicegatheringstatechange=null,this.pc.onconnectionstatechange=null),this.ws&&(this.ws.onclose=l=>{this.writeWebSocketTimelineLog("onclose",{code:l.code,reason:l.reason})},this.ws.onmessage=null,this.ws.onerror=null),Object.keys(this.soraDataChannels))){let Z=this.soraDataChannels[l];Z&&(Z.onmessage=null,Z.onclose=l=>{let Z=l.currentTarget;this.writeDataChannelTimelineLog("onclose",Z),this.trace("CLOSE DATA CHANNEL",Z.label)})}let l=null;if(this.signalingSwitched){try{let Z=await this.disconnectDataChannel();null!==Z&&(l=this.soraCloseEvent("normal","DISCONNECT",Z))}catch(Z){l=this.soraCloseEvent("abend","DISCONNECT-TIMEOUT")}await this.disconnectWebSocket("NO-ERROR"),await this.disconnectPeerConnection()}else{let Z=await this.disconnectWebSocket("NO-ERROR");await this.disconnectPeerConnection(),null!==Z&&(l=this.soraCloseEvent("normal","DISCONNECT",Z))}this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection(),l&&("abend"===l.type?this.writeSoraTimelineLog("disconnect-abend",l):"normal"===l.type&&this.writeSoraTimelineLog("disconnect-normal",l),this.callbacks.disconnect(l))}setupE2EE(){!0===this.options.e2ee&&(this.e2ee=new I,this.e2ee.onWorkerDisconnect=async()=>{await this.abend("INTERNAL-ERROR",{reason:"CRASH-E2EE-WORKER"})},this.e2ee.startWorker())}startE2EE(){if(!0===this.options.e2ee&&this.e2ee){if(!this.connectionId){let l=Error();throw l.message="E2EE failed. Self connectionId is null",l}this.e2ee.clearWorker();let l=this.e2ee.start(this.connectionId);this.e2ee.postSelfSecretKeyMaterial(this.connectionId,l.selfKeyId,l.selfSecretKeyMaterial)}}async getSignalingWebSocket(l){if("string"==typeof l)return new Promise((Z,c)=>{let b=new WebSocket(l);b.onclose=l=>{let Z=new lh(`Signaling failed. CloseEventCode:${l.code} CloseEventReason:'${l.reason}'`);Z.code=l.code,Z.reason=l.reason,this.writeWebSocketTimelineLog("onclose",Z),c(Z)},b.onopen=l=>{Z(b)}});if(Array.isArray(l)){let Z=!1,c=l=>new Promise((c,b)=>{let d=new WebSocket(l),m=setTimeout(()=>{this.writeWebSocketSignalingLog("signaling-url-candidate",{type:"timeout",url:d.url}),d&&!Z&&(d.onclose=null,d.onerror=null,d.onopen=null,d.close(),b())},this.signalingCandidateTimeout);d.onclose=l=>{this.writeWebSocketSignalingLog("signaling-url-candidate",{type:"close",url:d.url,message:"WebSocket closed",code:l.code,reason:l.reason}),d&&d.close(),clearInterval(m),b()},d.onerror=l=>{this.writeWebSocketSignalingLog("signaling-url-candidate",{type:"error",url:d.url,message:"Failed to connect WebSocket"}),d&&(d.onclose=null,d.close()),clearInterval(m),b()},d.onopen=l=>{d&&(clearInterval(m),Z?(this.writeWebSocketSignalingLog("signaling-url-candidate",{type:"open",url:d.url,selected:!1}),d.onerror=null,d.onclose=null,d.onopen=null,d.close(),b()):(this.writeWebSocketSignalingLog("signaling-url-candidate",{type:"open",url:d.url,selected:!0}),d.onerror=null,d.onclose=null,d.onopen=null,Z=!0,c(d)))}});try{return await Promise.any(l.map(l=>c(l)))}catch(l){throw new lh("Signaling failed. All signaling URL candidates failed to connect")}}throw new lh("Signaling failed. Invalid format signaling URL candidates")}async signaling(l,Z=!1){let c=await this.createOffer();return this.trace("CREATE OFFER",c),new Promise((b,d)=>{this.writeWebSocketSignalingLog("new-websocket",l.url),l.binaryType="arraybuffer",l.onclose=l=>{let Z=new lh(`Signaling failed. CloseEventCode:${l.code} CloseEventReason:'${l.reason}'`);Z.code=l.code,Z.reason=l.reason,this.writeWebSocketTimelineLog("onclose",Z),this.signalingTerminate(),d(Z)},l.onmessage=async Z=>{if(Z.data instanceof ArrayBuffer){this.writeWebSocketSignalingLog("onmessage-e2ee",Z.data),this.signalingOnMessageE2EE(Z.data);return}if("string"!=typeof Z.data)throw Error("Received invalid signaling data");let c=JSON.parse(Z.data);if("offer"===c.type)this.writeWebSocketSignalingLog("onmessage-offer",c),this.signalingOnMessageTypeOffer(c),this.connectedSignalingUrl=l.url,b(c);else if("update"===c.type)this.writeWebSocketSignalingLog("onmessage-update",c),await this.signalingOnMessageTypeUpdate(c);else if("re-offer"===c.type)this.writeWebSocketSignalingLog("onmessage-re-offer",c),await this.signalingOnMessageTypeReOffer(c);else if("ping"===c.type)await this.signalingOnMessageTypePing(c);else if("push"===c.type)this.callbacks.push(c,"websocket");else if("notify"===c.type)"connection.created"===c.event_type?this.writeWebSocketTimelineLog("notify-connection.created",c):"connection.destroyed"===c.event_type&&this.writeWebSocketTimelineLog("notify-connection.destroyed",c),this.signalingOnMessageTypeNotify(c,"websocket");else if("switched"===c.type)this.writeWebSocketSignalingLog("onmessage-switched",c),this.signalingOnMessageTypeSwitched(c);else if("redirect"===c.type){this.writeWebSocketSignalingLog("onmessage-redirect",c);try{let l=await this.signalingOnMessageTypeRedirect(c);b(l)}catch(l){d(l)}}},(async()=>{let b;try{b=function(l,Z,c,b,d,m){if("sendrecv"!==Z&&"sendonly"!==Z&&"recvonly"!==Z)throw Error("Unknown role type");if(null==c)throw Error("channelId can not be null or undefined");let I={type:"connect",sora_client:"Sora JavaScript SDK 2023.2.0",environment:window.navigator.userAgent,role:Z,channel_id:c,sdp:l,audio:!0,video:!0};if("sendrecv"===Z&&!0!==d.multistream)throw Error("Failed to parse options. Options multistream must be true when connecting using 'sendrecv'");!0===m&&(I.redirect=!0),"boolean"==typeof d.multistream&&(I.multistream=d.multistream),"boolean"==typeof d.simulcast&&(I.simulcast=d.simulcast),void 0!==d.simulcastRid&&0<=["r0","r1","r2"].indexOf(d.simulcastRid)&&(I.simulcast_rid=d.simulcastRid),"boolean"==typeof d.spotlight&&(I.spotlight=d.spotlight),"spotlightNumber"in d&&(I.spotlight_number=d.spotlightNumber);let W=["none","r0","r1","r2"];void 0!==d.spotlightFocusRid&&0<=W.indexOf(d.spotlightFocusRid)&&(I.spotlight_focus_rid=d.spotlightFocusRid),void 0!==d.spotlightUnfocusRid&&0<=W.indexOf(d.spotlightUnfocusRid)&&(I.spotlight_unfocus_rid=d.spotlightUnfocusRid),void 0!==b&&(I.metadata=b),void 0!==d.signalingNotifyMetadata&&(I.signaling_notify_metadata=d.signalingNotifyMetadata),void 0!==d.forwardingFilter&&(I.forwarding_filter=d.forwardingFilter),void 0!==d.clientId&&(I.client_id=d.clientId),void 0!==d.bundleId&&(I.bundle_id=d.bundleId),"boolean"==typeof d.dataChannelSignaling&&(I.data_channel_signaling=d.dataChannelSignaling),"boolean"==typeof d.ignoreDisconnectWebSocket&&(I.ignore_disconnect_websocket=d.ignoreDisconnectWebSocket);let i=["audioCodecType","audioBitRate"],t=["audioOpusParamsChannels","audioOpusParamsMaxplaybackrate","audioOpusParamsStereo","audioOpusParamsSpropStereo","audioOpusParamsMinptime","audioOpusParamsPtime","audioOpusParamsUseinbandfec","audioOpusParamsUsedtx"],X=["audioLyraParamsBitrate","audioLyraParamsUsedtx"],g=["videoCodecType","videoBitRate","videoVP9Params","videoH264Params","videoH265Params","videoAV1Params"],G=Object.assign({},d);Object.keys(G).filter(l=>{"audio"===l&&"boolean"==typeof G[l]||"video"===l&&"boolean"==typeof G[l]||0<=i.indexOf(l)&&null!==G[l]||0<=t.indexOf(l)&&null!==G[l]||0<=X.indexOf(l)&&null!==G[l]||0<=g.indexOf(l)&&null!==G[l]||delete G[l]}),void 0!==G.audio&&(I.audio=G.audio);let e=Object.keys(G).some(l=>0<=i.indexOf(l));I.audio&&e&&(I.audio={},"audioCodecType"in G&&(I.audio.codec_type=G.audioCodecType),"audioBitRate"in G&&(I.audio.bit_rate=G.audioBitRate));let n=Object.keys(G).some(l=>0<=t.indexOf(l));I.audio&&n&&("object"!=typeof I.audio&&(I.audio={}),I.audio.opus_params={},"audioOpusParamsChannels"in G&&(I.audio.opus_params.channels=G.audioOpusParamsChannels),"audioOpusParamsMaxplaybackrate"in G&&(I.audio.opus_params.maxplaybackrate=G.audioOpusParamsMaxplaybackrate),"audioOpusParamsStereo"in G&&(I.audio.opus_params.stereo=G.audioOpusParamsStereo),"audioOpusParamsSpropStereo"in G&&(I.audio.opus_params.sprop_stereo=G.audioOpusParamsSpropStereo),"audioOpusParamsMinptime"in G&&(I.audio.opus_params.minptime=G.audioOpusParamsMinptime),"audioOpusParamsPtime"in G&&(I.audio.opus_params.ptime=G.audioOpusParamsPtime),"audioOpusParamsUseinbandfec"in G&&(I.audio.opus_params.useinbandfec=G.audioOpusParamsUseinbandfec),"audioOpusParamsUsedtx"in G&&(I.audio.opus_params.usedtx=G.audioOpusParamsUsedtx)),I.audio&&"LYRA"===d.audioCodecType&&("object"!=typeof I.audio&&(I.audio={}),I.audio.lyra_params={version:V},"audioLyraParamsBitrate"in G&&(I.audio.lyra_params.bitrate=G.audioLyraParamsBitrate),"audioLyraParamsUsedtx"in G&&(I.audio.lyra_params.usedtx=G.audioLyraParamsUsedtx)),void 0!==G.video&&(I.video=G.video);let a=Object.keys(G).some(l=>0<=g.indexOf(l));if(I.video&&a&&(I.video={},"videoCodecType"in G&&(I.video.codec_type=G.videoCodecType),"videoBitRate"in G&&(I.video.bit_rate=G.videoBitRate),"videoVP9Params"in G&&(I.video.vp9_params=G.videoVP9Params),"videoH264Params"in G&&(I.video.h264_params=G.videoH264Params),"videoH265Params"in G&&(I.video.h265_params=G.videoH265Params),"videoAV1Params"in G&&(I.video.av1_params=G.videoAV1Params)),I.simulcast&&!function(){if(!window.RTCRtpSender||!RTCRtpSender.getCapabilities)return!1;let l=RTCRtpSender.getCapabilities("video");if(!l)return!1;let Z=l.headerExtensions.map(l=>l.uri);return["urn:ietf:params:rtp-hdrext:sdes:mid","urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id","urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id"].every(l=>Z.includes(l))}()&&"recvonly"!==Z)throw Error("Simulcast can not be used with this browser");if("boolean"==typeof d.e2ee&&(I.e2ee=d.e2ee),!0===d.e2ee){if(void 0===I.signaling_notify_metadata&&(I.signaling_notify_metadata={}),null===I.signaling_notify_metadata||"object"!=typeof I.signaling_notify_metadata)throw Error("E2EE failed. Options signalingNotifyMetadata must be type 'object'");!0===I.video&&(I.video={}),I.video&&(I.video.codec_type="VP8")}return Array.isArray(d.dataChannels)&&0{this.pc&&(this.writePeerConnectionTimelineLog("oniceconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),this.trace("ONICECONNECTIONSTATECHANGE ICECONNECTIONSTATE",this.pc.iceConnectionState))},this.pc.onicegatheringstatechange=l=>{this.pc&&this.writePeerConnectionTimelineLog("onicegatheringstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState})},this.pc.onconnectionstatechange=l=>{this.pc&&this.writePeerConnectionTimelineLog("onconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState})},this.pc.ondatachannel=l=>{this.onDataChannel(l)}}async setRemoteDescription(l){if(!this.pc)return;let Z=this.processOfferSdp(l.sdp),c=new RTCSessionDescription({type:"offer",sdp:Z});await this.pc.setRemoteDescription(c),this.writePeerConnectionTimelineLog("set-remote-description",c)}async createAnswer(l){if(!this.pc)return;for(let l of Object.values(this.mids)){let Z=this.pc.getTransceivers().find(Z=>Z.mid===l);Z&&"recvonly"===Z.direction&&(Z.direction="sendrecv")}if(this.options.simulcast&&("sendrecv"===this.role||"sendonly"===this.role)){let Z=this.pc.getTransceivers().find(l=>{if(null!==l.mid&&null!==l.sender.track&&(null===l.currentDirection||"sendonly"===l.currentDirection)&&(""!==this.mids.video&&this.mids.video===l.mid||0<=l.mid.indexOf("video")))return l});if(Z){await this.setSenderParameters(Z,this.encodings),await this.setRemoteDescription(l),this.trace("TRANSCEIVER SENDER GET_PARAMETERS",Z.sender.getParameters()),await this.setSenderParameters(Z,this.encodings);let c=await this.pc.createAnswer();void 0!==c.sdp&&(c.sdp=this.processAnswerSdpForLocal(c.sdp)),await this.pc.setLocalDescription(c),this.trace("TRANSCEIVER SENDER GET_PARAMETERS",Z.sender.getParameters());return}}let Z=await this.pc.createAnswer();void 0!==Z.sdp&&(Z.sdp=this.processAnswerSdpForLocal(Z.sdp)),this.writePeerConnectionTimelineLog("create-answer",Z),await this.pc.setLocalDescription(Z),this.writePeerConnectionTimelineLog("set-local-description",Z)}processOfferSdp(l){let Z=l;if("firefox"===ln()&&(Z=Z.replace(/^m=(audio|video) 0 /gm,(l,Z)=>`m=${Z} 9 `)),this.midToAudioCodecType.clear(),void 0===this.lyra||!Z.includes("109 lyra/"))return Z;for(let l of Z.split(/^m=/m).slice(1)){if(!l.startsWith("audio"))continue;let Z=/a=mid:(.*)/.exec(l);if(Z){let c=l.includes("109 lyra/")?"LYRA":"OPUS";this.midToAudioCodecType.set(Z[1],c)}}return this.lyra.processOfferSdp(Z)}processAnswerSdpForLocal(l){return void 0===this.lyra?l:this.lyra.processAnswerSdpForLocal(l)}processAnswerSdpForSora(l){return void 0===this.lyra?l:this.lyra.processAnswerSdpForSora(l)}async setupSenderTransform(l){if(null===this.e2ee&&void 0===this.lyra||null===l.track||this.senderStreamInitialized.has(l))return;let Z="audio"===l.track.kind&&"LYRA"===this.options.audioCodecType;if("transform"in RTCRtpSender.prototype){if(!Z||void 0===this.lyra)return;let c=n(),b=await this.lyra.createEncoder();l.transform=new RTCRtpScriptTransform(c,{name:"senderTransform",lyraEncoder:b},[b.port])}else{let c=l.createEncodedStreams(),b=c.readable;if(Z&&void 0!==this.lyra){let l=await this.lyra.createEncoder(),Z=new TransformStream({transform:(Z,c)=>a(l,Z,c)});b=c.readable.pipeThrough(Z)}this.e2ee?this.e2ee.setupSenderTransform(b,c.writable):b.pipeTo(c.writable).catch(l=>console.warn(l))}this.senderStreamInitialized.add(l)}async setupReceiverTransform(l,Z){if(null===this.e2ee&&void 0===this.lyra)return;let c=this.midToAudioCodecType.get(l||"");if("transform"in RTCRtpSender.prototype){if("LYRA"!==c||void 0===this.lyra)return;let l=n(),b=await this.lyra.createDecoder();Z.transform=new RTCRtpScriptTransform(l,{name:"receiverTransform",lyraDecoder:b},[b.port])}else{let l=Z.createEncodedStreams(),b=l.writable;if("LYRA"===c&&void 0!==this.lyra){let Z=await this.lyra.createDecoder(),c=new TransformStream({transform:(l,c)=>R(Z,l,c)});c.readable.pipeTo(l.writable).catch(l=>console.warn(l)),b=c.writable}this.e2ee?this.e2ee.setupReceiverTransform(l.readable,b):l.readable.pipeTo(b).catch(l=>console.warn(l))}}sendAnswer(){if(this.pc&&this.ws&&this.pc.localDescription){this.trace("ANSWER SDP",this.pc.localDescription.sdp);let l={type:"answer",sdp:this.processAnswerSdpForSora(this.pc.localDescription.sdp)};this.ws.send(JSON.stringify(l)),this.writeWebSocketSignalingLog("send-answer",l)}}onIceCandidate(){return new Promise((l,Z)=>{this.pc&&(this.pc.oniceconnectionstatechange=Z=>{this.pc&&(this.writePeerConnectionTimelineLog("oniceconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),this.trace("ONICECONNECTIONSTATECHANGE ICECONNECTIONSTATE",this.pc.iceConnectionState),"connected"===this.pc.iceConnectionState&&l())},this.pc.onicecandidate=Z=>{if(this.writePeerConnectionTimelineLog("onicecandidate",Z.candidate),this.pc&&this.trace("ONICECANDIDATE ICEGATHERINGSTATE",this.pc.iceGatheringState),null===Z.candidate)l();else{let l=Object.assign(Z.candidate.toJSON(),{type:"candidate"});this.trace("ONICECANDIDATE CANDIDATE MESSAGE",l),this.sendSignalingMessage(l)}})})}waitChangeConnectionStateConnected(){return new Promise((l,Z)=>{if(this.pc&&void 0===this.pc.connectionState){l();return}let c=setInterval(()=>{if(this.pc)this.pc&&"connected"===this.pc.connectionState&&(clearInterval(c),l());else{let l=Error();l.message="PeerConnection connectionState did not change to 'connected'",clearInterval(c),Z(l)}},10)})}monitorSignalingWebSocketEvent(){return new Promise((l,Z)=>{this.monitorSignalingWebSocketEventTimerId=setInterval(()=>{this.ws&&(this.clearMonitorSignalingWebSocketEvent(),this.ws.onclose=l=>{let c=new lh(`Signaling failed. CloseEventCode:${l.code} CloseEventReason:'${l.reason}'`);c.code=l.code,c.reason=l.reason,this.writeWebSocketTimelineLog("onclose",c),this.signalingTerminate(),Z(c)},this.ws.onerror=l=>{let c=new lh("Signaling failed. WebSocket onerror was called");this.writeWebSocketSignalingLog("onerror",c),this.signalingTerminate(),Z(c)})},100)})}monitorWebSocketEvent(){this.ws&&(this.ws.onclose=async l=>{this.writeWebSocketTimelineLog("onclose",{code:l.code,reason:l.reason}),await this.abend("WEBSOCKET-ONCLOSE",{code:l.code,reason:l.reason})},this.ws.onerror=async l=>{this.writeWebSocketSignalingLog("onerror"),await this.abend("WEBSOCKET-ONERROR")})}monitorPeerConnectionState(){this.pc&&(this.pc.oniceconnectionstatechange=l=>{this.pc&&void 0===this.pc.connectionState&&(this.writePeerConnectionTimelineLog("oniceconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),this.trace("ONICECONNECTIONSTATECHANGE ICECONNECTIONSTATE",this.pc.iceConnectionState),clearTimeout(this.monitorIceConnectionStateChangeTimerId),"failed"===this.pc.iceConnectionState?this.abendPeerConnectionState("ICE-CONNECTION-STATE-FAILED"):"disconnected"===this.pc.iceConnectionState&&(this.monitorIceConnectionStateChangeTimerId=setTimeout(()=>{this.pc&&"disconnected"===this.pc.iceConnectionState&&this.abendPeerConnectionState("ICE-CONNECTION-STATE-DISCONNECTED-TIMEOUT")},1e4)))},this.pc.onconnectionstatechange=l=>{this.pc&&(this.writePeerConnectionTimelineLog("onconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),"failed"===this.pc.connectionState&&this.abendPeerConnectionState("CONNECTION-STATE-FAILED"))})}setConnectionTimeout(){return new Promise((l,Z)=>{0{if(!this.pc||this.pc&&void 0!==this.pc.connectionState&&"connected"!==this.pc.connectionState){let l=Error();l.message="Signaling connection timeout",this.callbacks.timeout(),this.trace("DISCONNECT","Signaling connection timeout"),this.writePeerConnectionTimelineLog("signaling-connection-timeout",{connectionTimeout:this.connectionTimeout}),this.signalingTerminate(),Z(l)}},this.connectionTimeout))})}clearConnectionTimeout(){clearTimeout(this.connectionTimeoutTimerId)}clearMonitorSignalingWebSocketEvent(){clearInterval(this.monitorSignalingWebSocketEventTimerId)}clearMonitorIceConnectionStateChange(){clearInterval(this.monitorIceConnectionStateChangeTimerId)}trace(l,Z){this.callbacks.log(l,Z),this.debug&&function(l,Z,c){let b=l=>{if(l&&"object"==typeof l){let Z=null;try{Z=Object.keys(JSON.parse(JSON.stringify(l)))}catch(l){}Z&&Array.isArray(Z)?Z.filter(Z=>{console.group(Z),b(l[Z]),console.groupEnd()}):console.info(l)}else console.info(l)},d="";window.performance&&(d=`[${(window.performance.now()/1e3).toFixed(3)}]`),l&&(d=`${d}[${l}]`),void 0!==console.info&&void 0!==console.group?(console.group(`${d} ${Z}`),b(c),console.groupEnd()):console.log(`${d} ${Z} -`,c)}(this.clientId,l,Z)}writeWebSocketSignalingLog(l,Z){this.callbacks.signaling(ls(l,Z,"websocket")),this.writeWebSocketTimelineLog(l,Z)}writeDataChannelSignalingLog(l,Z,c){this.callbacks.signaling(ls(l,c,"datachannel")),this.writeDataChannelTimelineLog(l,Z,c)}writeWebSocketTimelineLog(l,Z){let c=ly(l,Z,"websocket");this.callbacks.timeline(c)}writeDataChannelTimelineLog(l,Z,c){let b=ly(l,c,"datachannel",Z.id,Z.label);this.callbacks.timeline(b)}writePeerConnectionTimelineLog(l,Z){let c=ly(l,Z,"peerconnection");this.callbacks.timeline(c)}writeSoraTimelineLog(l,Z){let c=ly(l,Z,"sora");this.callbacks.timeline(c)}async createOffer(){let l=new window.RTCPeerConnection({iceServers:[]});if("safari"===ln()){l.addTransceiver("video",{direction:"recvonly"}),l.addTransceiver("audio",{direction:"recvonly"});let Z=await l.createOffer();return l.close(),this.writePeerConnectionTimelineLog("create-offer",Z),Z}let Z=await l.createOffer({offerToReceiveAudio:!0,offerToReceiveVideo:!0});return l.close(),this.writePeerConnectionTimelineLog("create-offer",Z),Z}signalingOnMessageE2EE(l){if(this.e2ee){let Z=new Uint8Array(l),c=this.e2ee.receiveMessage(Z);this.e2ee.postRemoteSecretKeyMaterials(c),c.messages.filter(l=>{this.sendE2EEMessage(l.buffer)})}}signalingOnMessageTypeOffer(l){if(this.clientId=l.client_id,this.connectionId=l.connection_id,void 0!==l.session_id&&(this.sessionId=l.session_id),void 0!==l.metadata&&(this.authMetadata=l.metadata),Array.isArray(l.encodings)&&(this.encodings=l.encodings),void 0!==l.mid&&void 0!==l.mid.audio&&(this.mids.audio=l.mid.audio),void 0!==l.mid&&void 0!==l.mid.video&&(this.mids.video=l.mid.video),l.data_channels)for(let Z of l.data_channels)this.signalingOfferMessageDataChannels[Z.label]=Z;this.trace("SIGNALING OFFER MESSAGE",l),this.trace("OFFER SDP",l.sdp)}sendUpdateAnswer(){this.pc&&this.ws&&this.pc.localDescription&&(this.trace("ANSWER SDP",this.pc.localDescription.sdp),this.sendSignalingMessage({type:"update",sdp:this.pc.localDescription.sdp}))}sendReAnswer(){this.pc?.localDescription&&(this.trace("RE ANSWER SDP",this.pc.localDescription.sdp),this.sendSignalingMessage({type:"re-answer",sdp:this.pc.localDescription.sdp}))}async signalingOnMessageTypeUpdate(l){this.trace("SIGNALING UPDATE MESSGE",l),this.trace("UPDATE SDP",l.sdp),await this.setRemoteDescription(l),await this.createAnswer(l),this.sendUpdateAnswer()}async signalingOnMessageTypeReOffer(l){this.trace("SIGNALING RE OFFER MESSGE",l),this.trace("RE OFFER SDP",l.sdp),await this.setRemoteDescription(l),await this.createAnswer(l),this.sendReAnswer()}async signalingOnMessageTypePing(l){let Z={type:"pong"};if(l.stats){let l=await this.getStats();Z.stats=l}this.ws&&this.ws.send(JSON.stringify(Z))}signalingOnMessageTypeNotify(l,Z){if("connection.created"===l.event_type){let Z=l.connection_id;if(this.connectionId!==Z){let c=lR(la(l));if(c&&this.e2ee&&Z){let l=this.e2ee.startSession(Z,c);this.e2ee.postRemoteSecretKeyMaterials(l),l.messages.filter(l=>{this.sendE2EEMessage(l.buffer)}),this.e2ee.postSelfSecretKeyMaterial(l.selfConnectionId,l.selfKeyId,l.selfSecretKeyMaterial)}}(l.data&&Array.isArray(l.data)?l.data:l.metadata_list&&Array.isArray(l.metadata_list)?l.metadata_list:[]).filter(l=>{let Z=lR(la(l)),c=l.connection_id;c&&this.e2ee&&Z&&this.e2ee.addPreKeyBundle(c,Z)})}else if("connection.destroyed"===l.event_type){let Z=lR(la(l)),c=l.connection_id;if(Z&&this.e2ee&&c){let l=this.e2ee.stopSession(c);this.e2ee.postSelfSecretKeyMaterial(l.selfConnectionId,l.selfKeyId,l.selfSecretKeyMaterial,5e3),l.messages.filter(l=>{this.sendE2EEMessage(l.buffer)}),this.e2ee.postRemoveRemoteDeriveKey(c)}}this.callbacks.notify(l,Z)}signalingOnMessageTypeSwitched(l){if(this.signalingSwitched=!0,this.ws)for(let Z of(l.ignore_disconnect_websocket&&(this.ws&&(this.ws.onclose=null,this.ws.close(),this.ws=null),this.writeWebSocketSignalingLog("close")),this.datachannels))this.callbacks.datachannel(function(l){let Z=new Event("datachannel");return Z.datachannel=l,Z}(Z))}async signalingOnMessageTypeRedirect(l){this.ws&&(this.ws.onclose=null,this.ws.onerror=null,this.ws.close(),this.ws=null);let Z=await this.getSignalingWebSocket(l.location);return await this.signaling(Z,!0)}async setSenderParameters(l,Z){let c=l.sender.getParameters();c.encodings=Z,await l.sender.setParameters(c),this.trace("TRANSCEIVER SENDER SET_PARAMETERS",c),this.writePeerConnectionTimelineLog("transceiver-sender-set-parameters",c)}async getStats(){let l=[];return this.pc&&(await this.pc.getStats()).forEach(Z=>{l.push(Z)}),l}onDataChannel(l){let Z=l.channel;Z.bufferedAmountLowThreshold=65536,Z.binaryType="arraybuffer",this.soraDataChannels[Z.label]=Z,this.writeDataChannelTimelineLog("ondatachannel",Z,{binaryType:Z.binaryType,bufferedAmount:Z.bufferedAmount,bufferedAmountLowThreshold:Z.bufferedAmountLowThreshold,id:Z.id,label:Z.label,maxPacketLifeTime:Z.maxPacketLifeTime,maxRetransmits:Z.maxRetransmits,negotiated:Z.negotiated,ordered:Z.ordered,protocol:Z.protocol,readyState:Z.readyState,reliable:Z.reliable}),l.channel.onbufferedamountlow=l=>{let Z=l.currentTarget;this.writeDataChannelTimelineLog("onbufferedamountlow",Z)},l.channel.onopen=l=>{let Z=l.currentTarget;this.trace("OPEN DATA CHANNEL",Z.label),"signaling"===Z.label&&this.ws?this.writeDataChannelSignalingLog("onopen",Z):this.writeDataChannelTimelineLog("onopen",Z)},l.channel.onclose=async l=>{let Z=l.currentTarget;this.writeDataChannelTimelineLog("onclose",Z),this.trace("CLOSE DATA CHANNEL",Z.label),await this.disconnect()},l.channel.onerror=async l=>{let Z=l.currentTarget;this.writeDataChannelTimelineLog("onerror",Z),this.trace("ERROR DATA CHANNEL",Z.label),await this.abend("DATA-CHANNEL-ONERROR",{params:{label:Z.label}})},"signaling"===l.channel.label?l.channel.onmessage=async l=>{let Z=l.currentTarget,c=Z.label,b=this.signalingOfferMessageDataChannels[c];if(!b){console.warn(`Received onmessage event for '${c}' DataChannel. But '${c}' DataChannel settings doesn't exist`);return}let d=JSON.parse(lC(l.data,b.compress));this.writeDataChannelSignalingLog(`onmessage-${d.type}`,Z,d),"re-offer"===d.type&&await this.signalingOnMessageTypeReOffer(d)}:"notify"===l.channel.label?l.channel.onmessage=l=>{let Z=l.currentTarget,c=Z.label,b=this.signalingOfferMessageDataChannels[c];if(!b){console.warn(`Received onmessage event for '${c}' DataChannel. But '${c}' DataChannel settings doesn't exist`);return}let d=JSON.parse(lC(l.data,b.compress));"connection.created"===d.event_type?this.writeDataChannelTimelineLog("notify-connection.created",Z,d):"connection.destroyed"===d.event_type&&this.writeDataChannelTimelineLog("notify-connection.destroyed",Z,d),this.signalingOnMessageTypeNotify(d,"datachannel")}:"push"===l.channel.label?l.channel.onmessage=l=>{let Z=l.currentTarget.label,c=this.signalingOfferMessageDataChannels[Z];if(!c){console.warn(`Received onmessage event for '${Z}' DataChannel. But '${Z}' DataChannel settings doesn't exist`);return}let b=JSON.parse(lC(l.data,c.compress));this.callbacks.push(b,"datachannel")}:"e2ee"===l.channel.label?l.channel.onmessage=l=>{let Z=l.currentTarget,c=l.data;this.signalingOnMessageE2EE(c),this.writeDataChannelSignalingLog("onmessage-e2ee",Z,c)}:"stats"===l.channel.label?l.channel.onmessage=async l=>{let Z=l.currentTarget.label,c=this.signalingOfferMessageDataChannels[Z];if(!c){console.warn(`Received onmessage event for '${Z}' DataChannel. But '${Z}' DataChannel settings doesn't exist`);return}if("req-stats"===JSON.parse(lC(l.data,c.compress)).type){let l=await this.getStats();this.sendStatsMessage(l)}}:/^#.*/.exec(l.channel.label)&&(l.channel.onmessage=l=>{let Z;if(null===l.currentTarget)return;let c=l.currentTarget.label,b=this.signalingOfferMessageDataChannels[c];if(!b){console.warn(`Received onmessage event for '${c}' DataChannel. But '${c}' DataChannel settings doesn't exist`);return}let d=l.target;"string"==typeof l.data?Z=new TextEncoder().encode(l.data):l.data instanceof ArrayBuffer?Z=l.data:console.warn("Received onmessage event data is not of type String or ArrayBuffer."),void 0!==Z&&(!0===b.compress&&(Z=lG(new Uint8Array(Z)).buffer),this.callbacks.message(function(l,Z){let c=new Event("message");return c.label=l,c.data=Z,c}(d.label,Z)))})}sendSignalingMessage(l){if(this.soraDataChannels.signaling){if(this.signalingOfferMessageDataChannels.signaling&&!0===this.signalingOfferMessageDataChannels.signaling.compress){let Z=lg(new TextEncoder().encode(JSON.stringify(l)),{});this.soraDataChannels.signaling.send(Z)}else this.soraDataChannels.signaling.send(JSON.stringify(l));this.writeDataChannelSignalingLog(`send-${l.type}`,this.soraDataChannels.signaling,l)}else null!==this.ws&&(this.ws.send(JSON.stringify(l)),this.writeWebSocketSignalingLog(`send-${l.type}`,l))}sendE2EEMessage(l){this.soraDataChannels.e2ee?(this.soraDataChannels.e2ee.send(l),this.writeDataChannelSignalingLog("send-e2ee",this.soraDataChannels.e2ee,l)):null!==this.ws&&(this.ws.send(l),this.writeWebSocketSignalingLog("send-e2ee",l))}sendStatsMessage(l){if(this.soraDataChannels.stats){let Z={type:"stats",reports:l};if(this.signalingOfferMessageDataChannels.stats&&!0===this.signalingOfferMessageDataChannels.stats.compress){let l=lg(new TextEncoder().encode(JSON.stringify(Z)),{});this.soraDataChannels.stats.send(l)}else this.soraDataChannels.stats.send(JSON.stringify(Z))}}getAudioTransceiver(){return this.pc&&this.mids.audio&&this.pc.getTransceivers().find(l=>l.mid===this.mids.audio)||null}getVideoTransceiver(){return this.pc&&this.mids.video&&this.pc.getTransceivers().find(l=>l.mid===this.mids.video)||null}soraCloseEvent(l,Z,c){return new class extends Event{constructor(l,Z,c){super(l),c&&(c.code&&(this.code=c.code),c.reason&&(this.reason=c.reason),c.params&&(this.params=c.params)),this.title=Z}}(l,Z,c)}sendMessage(l,Z){let c=this.soraDataChannels[l];if(null===this.pc)return;if(void 0===c)throw Error("Could not find DataChannel");if("open"!==c.readyState)throw Error("Messaging DataChannel is not open");let b=this.signalingOfferMessageDataChannels[l];if(void 0!==b&&!0===b.compress){let l=lg(Z,{});c.send(l)}else c.send(Z)}get e2eeSelfFingerprint(){if(this.options.e2ee&&this.e2ee)return this.e2ee.selfFingerprint()}get e2eeRemoteFingerprints(){if(this.options.e2ee&&this.e2ee)return this.e2ee.remoteFingerprints()}get audio(){return null!==this.getAudioTransceiver()}get video(){return null!==this.getVideoTransceiver()}get signalingUrl(){return this.signalingUrlCandidates}get datachannels(){if(!this.signalingSwitched)return[];let l=Object.keys(this.signalingOfferMessageDataChannels).filter(l=>/^#.*/.exec(l)),Z=[];for(let c of l){let l=this.soraDataChannels[c];if(!l)continue;let b=this.signalingOfferMessageDataChannels[c];if(!b)continue;let d={label:l.label,ordered:l.ordered,protocol:l.protocol,compress:b.compress,direction:b.direction};"number"==typeof l.maxPacketLifeTime&&(d.maxPacketLifeTime=l.maxPacketLifeTime),"number"==typeof l.maxRetransmits&&(d.maxRetransmits=l.maxRetransmits),Z.push(d)}return Z}}class lY extends lo{async connect(l){return this.options.multistream?await Promise.race([this.multiStream(l).finally(()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()}),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]):await Promise.race([this.singleStream(l).finally(()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()}),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]),this.monitorWebSocketEvent(),this.monitorPeerConnectionState(),l}async singleStream(l){await this.disconnect(),this.setupE2EE();let Z=await this.getSignalingWebSocket(this.signalingUrlCandidates),c=await this.signaling(Z);if(this.startE2EE(),await this.connectPeerConnection(c),await this.setRemoteDescription(c),l.getTracks().filter(Z=>{this.pc&&this.pc.addTrack(Z,l)}),this.pc)for(let l of this.pc.getSenders())await this.setupSenderTransform(l);return this.stream=l,await this.createAnswer(c),this.sendAnswer(),await this.onIceCandidate(),await this.waitChangeConnectionStateConnected(),l}async multiStream(l){await this.disconnect(),this.setupE2EE();let Z=await this.getSignalingWebSocket(this.signalingUrlCandidates),c=await this.signaling(Z);if(this.startE2EE(),await this.connectPeerConnection(c),this.pc&&(this.pc.ontrack=async l=>{await this.setupReceiverTransform(l.transceiver.mid,l.receiver);let Z=l.streams[0];if(!Z)return;let c={"stream.id":Z.id,id:l.track.id,label:l.track.label,enabled:l.track.enabled,kind:l.track.kind,muted:l.track.muted,readyState:l.track.readyState};this.writePeerConnectionTimelineLog("ontrack",c),"default"!==Z.id&&Z.id!==this.connectionId&&(this.callbacks.track(l),Z.onremovetrack=l=>{if(this.callbacks.removetrack(l),l.target){let Z=this.remoteConnectionIds.indexOf(l.target.id);-1{this.pc&&this.pc.addTrack(Z,l)}),this.pc)for(let l of this.pc.getSenders())await this.setupSenderTransform(l);return this.stream=l,await this.createAnswer(c),this.sendAnswer(),await this.onIceCandidate(),await this.waitChangeConnectionStateConnected(),l}}class lu extends lo{async connect(){if(this.options.multistream){await Promise.race([this.multiStream().finally(()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()}),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]),this.monitorWebSocketEvent(),this.monitorPeerConnectionState();return}let l=await Promise.race([this.singleStream().finally(()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()}),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]);return this.monitorWebSocketEvent(),this.monitorPeerConnectionState(),l}async singleStream(){await this.disconnect(),this.setupE2EE();let l=await this.getSignalingWebSocket(this.signalingUrlCandidates),Z=await this.signaling(l);return this.startE2EE(),await this.connectPeerConnection(Z),this.pc&&(this.pc.ontrack=async l=>{await this.setupReceiverTransform(l.transceiver.mid,l.receiver),this.stream=l.streams[0];let Z=this.stream.id;if("default"===Z)return;let c={"stream.id":Z,id:l.track.id,label:l.track.label,enabled:l.track.enabled,kind:l.track.kind,muted:l.track.muted,readyState:l.track.readyState};this.writePeerConnectionTimelineLog("ontrack",c),this.callbacks.track(l),this.stream.onremovetrack=l=>{if(this.callbacks.removetrack(l),l.target){let Z=l.target.id,c=this.remoteConnectionIds.indexOf(Z);-1{await this.setupReceiverTransform(l.transceiver.mid,l.receiver);let Z=l.streams[0];if("default"===Z.id||Z.id===this.connectionId)return;let c={"stream.id":Z.id,id:l.track.id,label:l.track.label,enabled:l.track.enabled,kind:l.track.kind,muted:l.track.muted,readyState:l.track.readyState};this.writePeerConnectionTimelineLog("ontrack",c),this.callbacks.track(l),Z.onremovetrack=l=>{if(this.callbacks.removetrack(l),l.target){let Z=l.target.id,c=this.remoteConnectionIds.indexOf(Z);-1{await I.loadWasm(l)},initLyra:function(l){return"createEncodedStreams"in RTCRtpSender.prototype||"transform"in RTCRtpSender.prototype?"undefined"==typeof SharedArrayBuffer?(console.warn("Lyra requires cross-origin isolation to use SharedArrayBuffer."),!1):(b=l,d=void 0,!0):(console.warn("This browser doesn't support WebRTC Encoded Transform feature that Lyra requires."),!1)},connection:(l,Z=!1)=>new lp(l,Z),version:()=>"2023.2.0",helpers:{applyMediaStreamConstraints:W}}}}]); \ No newline at end of file diff --git a/dist/_next/static/chunks/f7393389-2ff678dcc0729b9b.js b/dist/_next/static/chunks/f7393389-2ff678dcc0729b9b.js new file mode 100644 index 00000000..de9f299e --- /dev/null +++ b/dist/_next/static/chunks/f7393389-2ff678dcc0729b9b.js @@ -0,0 +1,2 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[251],{1433:function(e,t,i){i.d(t,{Z:function(){return eC}});var n=i(8459);class a{constructor(){if(!RTCRtpSender.prototype.createEncodedStreams)throw Error("E2EE is not supported in this browser.");this.worker=null,this.onWorkerDisconnect=null}startWorker(){let e=atob("InVzZSBzdHJpY3QiOwpjb25zdCBjb25uZWN0aW9uSWRMZW5ndGggPSAyNjsKZnVuY3Rpb24gYnl0ZUNvdW50KG4pIHsKICAgIGlmIChuID09PSAwKSB7CiAgICAgICAgcmV0dXJuIDE7CiAgICB9CiAgICAvLyBsb2cyNTYoeCkgPSBsb2coeCkgLyBsb2coMjU2KQogICAgcmV0dXJuIE1hdGguZmxvb3IoTWF0aC5sb2cobikgLyBNYXRoLmxvZygyICoqIDgpICsgMSk7Cn0KZnVuY3Rpb24gYXJyYXlCdWZmZXJUb051bWJlcihhcnJheUJ1ZmZlcikgewogICAgLy8gMzJiaXQg44G+44Gn44KS5oOz5a6aIChCaWdJbnQg44G444Gu5pu444GN5o+b44GI5pmC44Gr6KaB5L+u5q2jKQogICAgY29uc3QgbmV3QXJyYXlCdWZmZXIgPSBuZXcgQXJyYXlCdWZmZXIoVWludDMyQXJyYXkuQllURVNfUEVSX0VMRU1FTlQpOwogICAgY29uc3QgbmV3RGF0YVZpZXcgPSBuZXcgRGF0YVZpZXcobmV3QXJyYXlCdWZmZXIpOwogICAgY29uc3QgZGF0YVZpZXcgPSBuZXcgRGF0YVZpZXcoYXJyYXlCdWZmZXIpOwogICAgY29uc3QgcGFkZGluZ0xlbmd0aCA9IFVpbnQzMkFycmF5LkJZVEVTX1BFUl9FTEVNRU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W9uSWQsIGtleUlkLCBkZXJpdmVLZXkgfTsKICAgICAgICBzZWxmRGVyaXZlS2V5TWFwLnNldCgnbGF0ZXN0JywgbmV4dFNlbGZEZXJpdmVLZXkpOwogICAgfQp9CmZ1bmN0aW9uIHNpbGVuY2VGcmFtZShlbmNvZGVkRnJhbWUpIHsKICAgIC8vIGNvbm5lY3Rpb24uY3JlYXRlZCwgcmVjZWl2ZU1lc3NhZ2Ug5Y+X5L+h5YmN44Gu5aC05ZCICiAgICBpZiAoZW5jb2RlZEZyYW1lLnR5cGUgPT09IHVuZGVmaW5lZCkgewogICAgICAgIC8vIOmfs+WjsOOBr+aal+WPt+WMluOBr+OBhOOCi+OBqOiBnuOBkeOBn+OCguOBruOBmOOCg+OBquOBhOOBruOBp+e9ruOBjeaPm+OBiOOCiwogICAgICAgIGNvbnN0IG5ld0RhdGEgPSBuZXcgQXJyYXlCdWZmZXIoMyk7CiAgICAgICAgY29uc3QgbmV3VWludDggPSBuZXcgVWludDhBcnJheShuZXdEYXRhKTsKICAgICAgICAvLyBPcHVzIOOCteOCpOODrOODs+OCueODleODrOODvOODoAogICAgICAgIG5ld1VpbnQ4LnNldChbMHhkOCwgMHhmZiwgMHhmZV0pOwogICAgICAgIGVuY29kZWRGcmFtZS5kYXRhID0gbmV3RGF0YTsKICAgIH0KICAgIGVsc2UgewogICAgICAgIC8vIOaYoOWDj+OBjOato+W4uOOBmOOCg+OBquOBhOOBn+OCgSBQTEkg44K544OI44O844Og44GM55m655Sf44GX44Gm44GX44G+44GGCiAgICAgICAgLy8g44Gd44Gu44Gf44KBIDMyMHgyNDAg44Gu55yf44Gj6buS44Gq55S76Z2i44Gr572u44GN5o+b44GI44KLCiAgICAgICAgY29uc3QgbmV3RGF0YSA9IG5ldyBBcnJheUJ1ZmZlcig2MCk7CiAgICAgICAgY29uc3QgbmV3VWludDggPSBuZXcgVWludDhBcnJheShuZXdEYXRhKTsKICAgICAgICBuZXdVaW50OC5zZXQoWwogICAgICAgICAgICAweGIwLCAweDA1LCAweDAwLCAweDlkLCAweDAxLCAweDJhLCAweGEwLCAweDAwLCAweDVhLCAweDAwLCAweDM5LCAweDAzLCAweDAwLCAweDAwLCAweDFjLAogICAgICAgICAgICAweDIyLCAweDE2LCAweDE2LCAweDIyLCAweDY2LCAweDEyLCAweDIwLCAweDA0LCAweDkwLCAweDQwLCAweDAwLCAweGM1LCAweDAxLCAweGUwLCAweDdjLAogICAgICAgICAgICAweDRkLCAweDJmLCAweGZhLCAweGRkLCAweDRkLCAweGE1LCAweDdmLCAweDg5LCAweGE1LCAweGZmLCAweDViLCAweGE5LCAweGI0LCAweGFmLCAweGYxLAogICAgICAgICAgICAweDM0LCAweGJmLCAweGViLCAweDc1LCAweDM2LCAweDk1LCAweGZlLCAweDI2LCAweDk2LCAweDYwLCAweGZlLCAweGZmLCAweGJhLCAweGZmLCAweDQwLAogICAgICAgIF0pOwogICAgICAgIGVuY29kZWRGcmFtZS5kYXRhID0gbmV3RGF0YTsKICAgIH0KICAgIHJldHVybiBlbmNvZGVkRnJhbWU7Cn0KZnVuY3Rpb24gc2V0V3JpdGVJVihjb25uZWN0aW9uSWQsIGtleUlkLCB3cml0ZUlWKSB7CiAgICBjb25zdCBrZXkgPSBbY29ubmVjdGlvbklkLCBrZXlJZC50b1N0cmluZygpXS5qb2luKCc6Jyk7CiAgICB3cml0ZUlWTWFwLnNldChrZXksIHdyaXRlSVYpOwp9CmZ1bmN0aW9uIGdldFdyaXRlSVYoY29ubmVjdGlvbklkLCBrZXlJZCkgewogICAgY29uc3Qga2V5ID0gW2Nvbm5lY3Rpb25JZCwga2V5SWQudG9TdHJpbmcoKV0uam9pbignOicpOwogICAgcmV0dXJuIHdyaXRlSVZNYXAuZ2V0KGtleSk7Cn0KZnVuY3Rpb24gZ2VuZXJhdGVJVihjb3VudCwgY29ubmVjdGlvbklkLCBrZXlJZCkgewogICAgLy8gVE9ETzoga2V5SWQg44GMIE51bWJlci5NQVhfU0FGRV9JTlRFR0VSLCA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ICAgICBjb25zdCBzZnJhbWVIZWFkZXIgPSBuZXcgVWludDhBcnJheShzZnJhbWVIZWFkZXJCdWZmZXIpOwogICAgICAgIGNvbnN0IGNvbm5lY3Rpb25JZCA9IHRleHREZWNvZGVyLmRlY29kZShjb25uZWN0aW9uSWRCdWZmZXIpOwogICAgICAgIGNvbnN0IFtzLCBjb3VudCwga2V5SWRdID0gcGFyc2VTRnJhbWVIZWFkZXIoc2ZyYW1lSGVhZGVyQnVmZmVyKTsKICAgICAgICAvLyDku4rlm57jga8gcyBmbGFnIOOBryAwIOOBruOBvwogICAgICAgIGlmIChzICE9PSAwKSB7CiAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcignVU5FWFBFQ1RFRC1TLUZMQUcnKTsKICAgICAgICB9CiAgICAgICAgY29uc3QgZGVyaXZlS2V5ID0gZ2V0UmVtb3RlRGVyaXZlS2V5KGNvbm5lY3Rpb25JZCwga2V5SWQpOwogICAgICAgIGlmICghZGVyaXZlS2V5KSB7CiAgICAgICAgICAgIHJldHVybjsKICAgICAgICB9CiAgICAgICAgY29uc3QgaXYgPSBnZW5lcmF0ZUlWKGNvdW50LCBjb25uZWN0aW9uSWQsIGtleUlkKTsKICAgICAgICBpZiAoIWl2KSB7CiAgICAgICAgICAgIHJldHVybjsKICAgICAgICB9CiAgICAgICAgY29uc3QgZnJhbWVBZGQgPSBlbmNvZGVGcmFtZUFkZChmcmFtZU1ldGFkYXRhLCBzZnJhbWVIZWFkZXIsIGNvbm5lY3Rpb25JZCk7CiAgICAgICAgY3J5cHRvLnN1YnRsZQogICAgICAgICAgICAuZGVjcnlwdCh7CiAgICAgICAgICAgIG5hbWU6ICdBRVMtR0NNJywKICAgICAgICAgICAgaXY6IGl2LAogICAgICAgICAgICBhZGRpdGlvbmFsRGF0YTogZnJhbWVBZGQsCiAgICAgICAgfSwgZGVyaXZlS2V5LCBuZXcgVWludDhBcnJheShlbmNyeXB0ZWRGcmFtZUJ1ZmZlcikpCiAgICAgICAgICAgIC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iAgICAgICAgfSwgd2FpdGluZ1RpbWUgfHwgMCk7CiAgICAgICAgLy8gVE9ETzogKzEwMDAg44Gn6Y2155Sf5oiQ5b6M44Gr5a6f6KGM44GV44KM44KL44KI44GG44Gr44GX44Gm44GE44KL44GM55+t44GE5aC05ZCI44Gv5Ly444Gw44GZCiAgICAgICAgY29uc3QgcmVtb3ZhbFdhaXRpbmdUaW1lID0gKHdhaXRpbmdUaW1lIHx8IDApICsgMTAwMDsKICAgICAgICBpZiAocmVtb3ZhbFRpbWVvdXRJZCkgewogICAgICAgICAgICAvLyDli5XkvZzmuIjjgb/jgr/jgqTjg57jg7zmnInjgooKICAgICAgICAgICAgaWYgKHdhaXRpbmdUaW1lKSB7CiAgICAgICAgICAgICAgICAvLyBjb25uZWN0aW9uLmRlc3Ryb3llZAogICAgICAgICAgICAgICAgY2xlYXJUaW1lb3V0KHJlbW92YWxUaW1lb3V0SWQpOwogICAgICAgICAgICAgICAgcmVtb3ZhbFRpbWVvdXRJZCA9IHNldFRpbWVvdXQoKCkgPT4gewogICAgICAgICAgICAgICAgICAgIHJlbW92ZU9sZFJlbW90ZURlcml2ZUtleXMoKTsKICAgICAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQocmVtb3ZhbFRpbWVvdXRJZCk7CiAgICAgICAgICAgICAgICAgICAgcmVtb3ZhbFRpbWVvdXRJZCA9IDA7CiAgICAgICAgICAgICAgICB9LCByZW1vdmFsV2FpdGluZ1RpbWUpOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIGVsc2UgewogICAgICAgICAgICAvLyDli5XkvZzmuIjjgb/jgr/jgqTjg57jg7zjgarjgZcKICAgICAgICAgICAgLy8gY29ubmVjdGlvbi5jcmVhdGVkIOOBruWgtOWQiOOCguWwkeOBl+Wun+ihjOOCkumBheOCieOBm+OCiwogICAgICAgICAgICByZW1vdmFsVGltZW91dElkID0gc2V0VGltZW91dCgoKSA9PiB7CiAgICAgICAgICAgICAgICByZW1vdmVPbGRSZW1vdGVEZXJpdmVLZXlzKCk7CiAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQocmVtb3ZhbFRpbWVvdXRJZCk7CiAgICAgICAgICAgICAgICByZW1vdmFsVGltZW91dElkID0gMDsKICAgICAgICAgICAgfSwgcmVtb3ZhbFdhaXRpbmdUaW1lKTsKICAgICAgICB9CiAgICB9CiAgICBlbHNlIGlmICh0eXBlID09PSAncmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxzJykgewogICAgICAgIGNvbnN0IHsgcmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxzIH0gPSBldmVudC5kYXRhOwogICAgICAgIGZvciAoY29uc3QgW2Nvbm5lY3Rpb25JZCwgcmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxdIG9mIE9iamVjdC5lbnRyaWVzKHJlbW90ZVNlY3JldEtleU1hdGVyaWFscykpIHsKICAgICAgICAgICAgY29uc3QgeyBrZXlJZCwgc2VjcmV0S2V5TWF0ZXJpYWwgfSA9IHJlbW90ZVNlY3JldEtleU1hdGVyaWFsOwogICAgICAgICAgICBjcnlwdG8uc3VidGxlCiAgICAgICAgICAgICAgICAuaW1wb3J0S2V5KCdyYXcnLCBzZWNyZXRLZXlNYXRlcmlhbC5idWZmZXIsICdIS0RGJywgZmFsc2UsIFsnZGVyaXZlQml0cycsICdkZXJpdmVLZXknXSkKICAgICAgICAgICAgICAgIC50aGVuKChtYXRlcmlhbCkgPT4gewogICAgICAgICAgICAgICAgZ2VuZXJhdGVEZXJpdmVLZXkobWF0ZXJpYWwpLnRoZW4oKGRlcml2ZUtleSkgPT4gewogICAgICAgICAgICAgICAgICAgIHNldFJlbW90ZURlcml2ZUtleShjb25uZWN0aW9uSWQsIGtleUlkLCBkZXJpdmVLZXkpOwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICBnZW5lcmF0ZVdyaXRlSVYobWF0ZXJpYWwpLnRoZW4oKHdyaXRlSVYpID0+IHsKICAgICAgICAgICAgICAgICAg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waXBlVG8od3JpdGFibGVTdHJlYW0pOwogICAgfQogICAgZWxzZSBpZiAodHlwZSA9PT0gJ2NsZWFyJykgewogICAgICAgIGNvdW50TWFwLmNsZWFyKCk7CiAgICAgICAgd3JpdGVJVk1hcC5jbGVhcigpOwogICAgICAgIHJlbW90ZURlcml2ZUtleU1hcC5jbGVhcigpOwogICAgICAgIGxhdGVzdFJlbW90ZUtleUlkTWFwLmNsZWFyKCk7CiAgICAgICAgc2VsZkRlcml2ZUtleU1hcC5jbGVhcigpOwogICAgfQp9Owo=");this.worker=new Worker(URL.createObjectURL(new Blob([e],{type:"application/javascript"}))),this.worker.onmessage=e=>{let{operation:t}=e.data;"disconnect"===t&&"function"==typeof this.onWorkerDisconnect&&this.onWorkerDisconnect()}}clearWorker(){this.worker&&this.worker.postMessage({type:"clear"})}terminateWorker(){this.worker&&this.worker.terminate()}async init(){let{preKeyBundle:e}=await window.e2ee.init();return e}setupSenderTransform(e,t){if(!this.worker)throw Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"encrypt",readableStream:e,writableStream:t},[e,t])}setupReceiverTransform(e,t){if(!this.worker)throw Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"decrypt",readableStream:e,writableStream:t},[e,t])}postRemoteSecretKeyMaterials(e){if(!this.worker)throw Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"remoteSecretKeyMaterials",remoteSecretKeyMaterials:e.remoteSecretKeyMaterials})}postRemoveRemoteDeriveKey(e){if(!this.worker)throw Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"removeRemoteDeriveKey",connectionId:e})}postSelfSecretKeyMaterial(e,t,i,n=0){if(!this.worker)throw Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"selfSecretKeyMaterial",selfConnectionId:e,selfKeyId:t,selfSecretKeyMaterial:i,waitingTime:n})}startSession(e,t){let[i,n]=window.e2ee.startSession(e,t.identityKey,t.signedPreKey,t.preKeySignature);if(n)throw n;return i}stopSession(e){let[t,i]=window.e2ee.stopSession(e);if(i)throw i;return t}receiveMessage(e){let[t,i]=window.e2ee.receiveMessage(e);if(i)throw i;return t}start(e){let[t,i]=window.e2ee.start(e);if(i)throw i;return t}addPreKeyBundle(e,t){let i=window.e2ee.addPreKeyBundle(e,t.identityKey,t.signedPreKey,t.preKeySignature);if(i)throw i}selfFingerprint(){return window.e2ee.selfFingerprint()}remoteFingerprints(){return window.e2ee.remoteFingerprints()}static async loadWasm(e){if(window.e2ee,(()=>{if("undefined"!=typeof global);else if("undefined"!=typeof window)window.global=window;else if("undefined"!=typeof self)self.global=self;else throw Error("cannot export Go (neither global, window nor self is defined)");if(global.require||"undefined"==typeof require||(global.require=require),!global.fs&&global.require){let e=require("fs");0!==Object.keys(e)&&(global.fs=e)}let e=()=>{let e=Error("not implemented");return e.code="ENOSYS",e};if(!global.fs){let t="";global.fs={constants:{O_WRONLY:-1,O_RDWR:-1,O_CREAT:-1,O_TRUNC:-1,O_APPEND:-1,O_EXCL:-1},writeSync(e,n){let a=(t+=i.decode(n)).lastIndexOf("\n");return -1!=a&&(console.log(t.substr(0,a)),t=t.substr(a+1)),n.length},write(t,i,n,a,s,o){if(0!==n||a!==i.length||null!==s){o(e());return}o(null,this.writeSync(t,i))},chmod(t,i,n){n(e())},chown(t,i,n,a){a(e())},close(t,i){i(e())},fchmod(t,i,n){n(e())},fchown(t,i,n,a){a(e())},fstat(t,i){i(e())},fsync(e,t){t(null)},ftruncate(t,i,n){n(e())},lchown(t,i,n,a){a(e())},link(t,i,n){n(e())},lstat(t,i){i(e())},mkdir(t,i,n){n(e())},open(t,i,n,a){a(e())},read(t,i,n,a,s,o){o(e())},readdir(t,i){i(e())},readlink(t,i){i(e())},rename(t,i,n){n(e())},rmdir(t,i){i(e())},stat(t,i){i(e())},symlink(t,i,n){n(e())},truncate(t,i,n){n(e())},unlink(t,i){i(e())},utimes(t,i,n,a){a(e())}}}if(global.process||(global.process={getuid:()=>-1,getgid:()=>-1,geteuid:()=>-1,getegid:()=>-1,getgroups(){throw e()},pid:-1,ppid:-1,umask(){throw e()},cwd(){throw e()},chdir(){throw e()}}),!global.crypto){let e=require("crypto");global.crypto={getRandomValues(t){e.randomFillSync(t)}}}global.performance||(global.performance={now(){let[e,t]=n.hrtime();return 1e3*e+t/1e6}}),global.TextEncoder||(global.TextEncoder=require("util").TextEncoder),global.TextDecoder||(global.TextDecoder=require("util").TextDecoder);let t=new TextEncoder("utf-8"),i=new TextDecoder("utf-8");if(global.Go=class{constructor(){this.argv=["js"],this.env={},this.exit=e=>{0!==e&&console.warn("exit code:",e)},this._exitPromise=new Promise(e=>{this._resolveExitPromise=e}),this._pendingEvent=null,this._scheduledTimeouts=new Map,this._nextCallbackTimeoutID=1;let e=(e,t)=>{this.mem.setUint32(e+0,t,!0),this.mem.setUint32(e+4,Math.floor(t/4294967296),!0)},n=e=>this.mem.getUint32(e+0,!0)+4294967296*this.mem.getInt32(e+4,!0),a=e=>{let t=this.mem.getFloat64(e,!0);if(0===t)return;if(!isNaN(t))return t;let i=this.mem.getUint32(e,!0);return this._values[i]},s=(e,t)=>{if("number"==typeof t&&0!==t){if(isNaN(t)){this.mem.setUint32(e+4,2146959360,!0),this.mem.setUint32(e,0,!0);return}this.mem.setFloat64(e,t,!0);return}if(void 0===t){this.mem.setFloat64(e,0,!0);return}let i=this._ids.get(t);void 0===i&&(void 0===(i=this._idPool.pop())&&(i=this._values.length),this._values[i]=t,this._goRefCounts[i]=0,this._ids.set(t,i)),this._goRefCounts[i]++;let n=0;switch(typeof t){case"object":null!==t&&(n=1);break;case"string":n=2;break;case"symbol":n=3;break;case"function":n=4}this.mem.setUint32(e+4,2146959360|n,!0),this.mem.setUint32(e,i,!0)},o=e=>{let t=n(e+0),i=n(e+8);return new Uint8Array(this._inst.exports.mem.buffer,t,i)},l=e=>{let t=n(e+0),i=n(e+8),s=Array(i);for(let e=0;e{let t=n(e+0),a=n(e+8);return i.decode(new DataView(this._inst.exports.mem.buffer,t,a))},g=Date.now()-performance.now();this.importObject={go:{"runtime.wasmExit":e=>{let t=this.mem.getInt32(e+8,!0);this.exited=!0,delete this._inst,delete this._values,delete this._goRefCounts,delete this._ids,delete this._idPool,this.exit(t)},"runtime.wasmWrite":e=>{let t=n(e+8),i=n(e+16),a=this.mem.getInt32(e+24,!0);fs.writeSync(t,new Uint8Array(this._inst.exports.mem.buffer,i,a))},"runtime.resetMemoryDataView":e=>{this.mem=new DataView(this._inst.exports.mem.buffer)},"runtime.nanotime1":t=>{e(t+8,(g+performance.now())*1e6)},"runtime.walltime1":t=>{let i=(new Date).getTime();e(t+8,i/1e3),this.mem.setInt32(t+16,i%1e3*1e6,!0)},"runtime.scheduleTimeoutEvent":e=>{let t=this._nextCallbackTimeoutID;this._nextCallbackTimeoutID++,this._scheduledTimeouts.set(t,setTimeout(()=>{for(this._resume();this._scheduledTimeouts.has(t);)console.warn("scheduleTimeoutEvent: missed timeout event"),this._resume()},n(e+8)+1)),this.mem.setInt32(e+16,t,!0)},"runtime.clearTimeoutEvent":e=>{let t=this.mem.getInt32(e+8,!0);clearTimeout(this._scheduledTimeouts.get(t)),this._scheduledTimeouts.delete(t)},"runtime.getRandomData":e=>{crypto.getRandomValues(o(e+8))},"syscall/js.finalizeRef":e=>{let t=this.mem.getUint32(e+8,!0);if(this._goRefCounts[t]--,0===this._goRefCounts[t]){let e=this._values[t];this._values[t]=null,this._ids.delete(e),this._idPool.push(t)}},"syscall/js.stringVal":e=>{s(e+24,r(e+8))},"syscall/js.valueGet":e=>{let t=Reflect.get(a(e+8),r(e+16));s((e=this._inst.exports.getsp())+32,t)},"syscall/js.valueSet":e=>{Reflect.set(a(e+8),r(e+16),a(e+32))},"syscall/js.valueDelete":e=>{Reflect.deleteProperty(a(e+8),r(e+16))},"syscall/js.valueIndex":e=>{s(e+24,Reflect.get(a(e+8),n(e+16)))},"syscall/js.valueSetIndex":e=>{Reflect.set(a(e+8),n(e+16),a(e+24))},"syscall/js.valueCall":e=>{try{let t=a(e+8),i=Reflect.get(t,r(e+16)),n=l(e+32),o=Reflect.apply(i,t,n);e=this._inst.exports.getsp(),s(e+56,o),this.mem.setUint8(e+64,1)}catch(t){s(e+56,t),this.mem.setUint8(e+64,0)}},"syscall/js.valueInvoke":e=>{try{let t=a(e+8),i=l(e+16),n=Reflect.apply(t,void 0,i);e=this._inst.exports.getsp(),s(e+40,n),this.mem.setUint8(e+48,1)}catch(t){s(e+40,t),this.mem.setUint8(e+48,0)}},"syscall/js.valueNew":e=>{try{let t=a(e+8),i=l(e+16),n=Reflect.construct(t,i);e=this._inst.exports.getsp(),s(e+40,n),this.mem.setUint8(e+48,1)}catch(t){s(e+40,t),this.mem.setUint8(e+48,0)}},"syscall/js.valueLength":t=>{e(t+16,parseInt(a(t+8).length))},"syscall/js.valuePrepareString":i=>{let n=t.encode(String(a(i+8)));s(i+16,n),e(i+24,n.length)},"syscall/js.valueLoadString":e=>{let t=a(e+8);o(e+16).set(t)},"syscall/js.valueInstanceOf":e=>{this.mem.setUint8(e+24,a(e+8) instanceof a(e+16)?1:0)},"syscall/js.copyBytesToGo":t=>{let i=o(t+8),n=a(t+32);if(!(n instanceof Uint8Array||n instanceof Uint8ClampedArray)){this.mem.setUint8(t+48,0);return}let s=n.subarray(0,i.length);i.set(s),e(t+40,s.length),this.mem.setUint8(t+48,1)},"syscall/js.copyBytesToJS":t=>{let i=a(t+8),n=o(t+16);if(!(i instanceof Uint8Array||i instanceof Uint8ClampedArray)){this.mem.setUint8(t+48,0);return}let s=n.subarray(0,i.length);i.set(s),e(t+40,s.length),this.mem.setUint8(t+48,1)},debug:e=>{console.log(e)}}}}async run(e){this._inst=e,this.mem=new DataView(this._inst.exports.mem.buffer),this._values=[NaN,0,null,!0,!1,global,this],this._goRefCounts=Array(this._values.length).fill(1/0),this._ids=new Map([[0,1],[null,2],[!0,3],[!1,4],[global,5],[this,6]]),this._idPool=[],this.exited=!1;let i=4096,n=e=>{let n=i,a=t.encode(e+"\0");return new Uint8Array(this.mem.buffer,i,a.length).set(a),(i+=a.length)%8!=0&&(i+=8-i%8),n},a=this.argv.length,s=[];this.argv.forEach(e=>{s.push(n(e))}),s.push(0),Object.keys(this.env).sort().forEach(e=>{s.push(n(`${e}=${this.env[e]}`))}),s.push(0);let o=i;s.forEach(e=>{this.mem.setUint32(i,e,!0),this.mem.setUint32(i+4,0,!0),i+=8}),this._inst.exports.run(a,o),this.exited&&this._resolveExitPromise(),await this._exitPromise}_resume(){if(this.exited)throw Error("Go program has already exited");this._inst.exports.resume(),this.exited&&this._resolveExitPromise()}_makeFuncWrapper(e){let t=this;return function(){let i={id:e,this:this,args:arguments};return t._pendingEvent=i,t._resume(),i.result}}},global.require&&global.require.main===module&&global.process&&global.process.versions&&!global.process.versions.electron){n.argv.length<3&&(console.error("usage: go_js_wasm_exec [wasm binary] [arguments]"),n.exit(1));let e=new Go;e.argv=n.argv.slice(2),e.env=Object.assign({TMPDIR:require("os").tmpdir()},n.env),e.exit=n.exit,WebAssembly.instantiate(fs.readFileSync(n.argv[2]),e.importObject).then(t=>(n.on("exit",t=>{0!==t||e.exited||(e._pendingEvent={id:0},e._resume())}),e.run(t.instance))).catch(e=>{console.error(e),n.exit(1)})}})(),!window.Go)throw Error(`Failed to load module Go. window.Go is ${window.Go}.`);let t=new Go,{instance:i}=await WebAssembly.instantiateStreaming(fetch(e),t.importObject);if(t.run(i),!window.e2ee)throw Error(`Failed to load module e2ee. window.e2ee is ${window.e2ee}.`)}static version(){return"2021.1.0"}static wasmVersion(){return window.e2ee.version()}}async function s(e,t){if(t.audio&&"boolean"!=typeof t.audio)for(let i of e.getAudioTracks())await i.applyConstraints(t.audio);if(t.video&&"boolean"!=typeof t.video)for(let i of e.getVideoTracks())await i.applyConstraints(t.video)}var o=Uint8Array,l=Uint16Array,r=Int32Array,g=new o([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),c=new o([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),d=new o([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),C=function(e,t){for(var i=new l(31),n=0;n<31;++n)i[n]=t+=1<>1|(21845&Z)<<1;w=(61680&(w=(52428&w)>>2|(13107&w)<<2))>>4|(3855&w)<<4,p[Z]=((65280&w)>>8|(255&w)<<8)>>1}for(var f=function(e,t,i){for(var n,a=e.length,s=0,o=new l(t);s>g]=c}else for(s=0,n=new l(a);s>15-e[s]);return n},S=new o(288),Z=0;Z<144;++Z)S[Z]=8;for(var Z=144;Z<256;++Z)S[Z]=9;for(var Z=256;Z<280;++Z)S[Z]=7;for(var Z=280;Z<288;++Z)S[Z]=8;for(var V=new o(32),Z=0;Z<32;++Z)V[Z]=5;var y=f(S,9,0),W=f(S,9,1),G=f(V,5,0),v=f(V,5,1),k=function(e){for(var t=e[0],i=1;it&&(t=e[i]);return t},R=function(e,t,i){var n=t/8|0;return(e[n]|e[n+1]<<8)>>(7&t)&i},T=function(e,t){var i=t/8|0;return(e[i]|e[i+1]<<8|e[i+2]<<16)>>(7&t)},O=function(e){return(e+7)/8|0},X=function(e,t,i){return(null==i||i>e.length)&&(i=e.length),new o(e.subarray(t,i))},B=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],E=function(e,t,i){var n=Error(t||B[e]);if(n.code=e,Error.captureStackTrace&&Error.captureStackTrace(n,E),!i)throw n;return n},N=function(e,t,i,n){var a=e.length;if(!a||t.f&&!t.l)return i||new o(0);var s=!i,l=s||2!=t.i,r=t.i;s&&(i=new o(3*a));var C=function(e){var t=i.length;if(e>t){var n=new o(Math.max(2*t,e));n.set(i),i=n}},h=t.f||0,m=t.p||0,u=t.b||0,b=t.l,p=t.d,Z=t.m,w=t.n,S=8*a;do{if(!b){h=R(e,m,1);var V=R(e,m+1,3);if(m+=3,V){if(1==V)b=W,p=v,Z=9,w=5;else if(2==V){var y=R(e,m,31)+257,G=R(e,m+10,15)+4,B=y+R(e,m+5,31)+1;m+=14;for(var N=new o(B),Y=new o(19),D=0;D>4;if(F<16)N[D++]=F;else{var j=0,Q=0;for(16==F?(Q=3+R(e,m,3),m+=2,j=N[D-1]):17==F?(Q=3+R(e,m,7),m+=3):18==F&&(Q=11+R(e,m,127),m+=7);Q--;)N[D++]=j}}var P=N.subarray(0,y),x=N.subarray(y);Z=k(P),w=k(x),b=f(P,Z,1),p=f(x,w,1)}else E(1)}else{var F=O(m)+4,H=e[F-4]|e[F-3]<<8,M=F+H;if(M>a){r&&E(0);break}l&&C(u+H),i.set(e.subarray(F,M),u),t.b=u+=H,t.p=m=8*M,t.f=h;continue}if(m>S){r&&E(0);break}}l&&C(u+131072);for(var _=(1<>4;if((m+=15&j)>S){r&&E(0);break}if(j||E(2),$<256)i[u++]=$;else if(256==$){q=m,b=null;break}else{var ee=$-254;if($>264){var D=$-257,et=g[D];ee=R(e,m,(1<>4;ei||E(3),m+=15&ei;var x=A[en];if(en>3){var et=c[en];x+=T(e,m)&(1<S){r&&E(0);break}l&&C(u+131072);var ea=u+ee;if(u>8},D=function(e,t,i){i<<=7&t;var n=t/8|0;e[n]|=i,e[n+1]|=i>>8,e[n+2]|=i>>16},L=function(e,t){for(var i=[],n=0;nI&&(I=s[n].s);var m=new l(I+1),u=K(i[C-1],m,0);if(u>t){var n=0,A=0,b=u-t,p=1<t)A+=p-(1<>=b;A>0;){var w=s[n].s;m[w]=0&&A;--n){var f=s[n].s;m[f]==t&&(--m[f],++A)}u=t}return{t:new o(m),l:u}},K=function(e,t,i){return -1==e.s?Math.max(K(e.l,t,i+1),K(e.r,t,i+1)):t[e.s]=i},J=function(e){for(var t=e.length;t&&!e[--t];);for(var i=new l(++t),n=0,a=e[0],s=1,o=function(e){i[n++]=e},r=1;r<=t;++r)if(e[r]==a&&r!=t)++s;else{if(!a&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(a),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(a);s=1,a=e[r]}return{c:i.subarray(0,n),n:t}},U=function(e,t){for(var i=0,n=0;n>8,e[a+2]=255^e[a],e[a+3]=255^e[a+1];for(var s=0;s4&&!Q[d[x-1]];--x);var H=h+5<<3,M=U(a,S)+U(s,V)+o,_=U(a,Z)+U(s,v)+o+14+3*x+U(N,Q)+2*N[16]+3*N[17]+7*N[18];if(C>=0&&H<=M&&H<=_)return F(t,I,e.subarray(C,C+h));if(Y(t,I,1+(_15&&(Y(t,I,ee[K]>>5&127),I+=ee[K]>>12)}}else m=y,u=S,A=G,b=V;for(var K=0;K255){var et=ei>>18&31;D(t,I,m[et+257]),I+=u[et+257],et>7&&(Y(t,I,ei>>23&31),I+=g[et]);var en=31&ei;D(t,I,A[en]),I+=b[en],en>3&&(D(t,I,ei>>5&8191),I+=c[en])}else D(t,I,m[ei]),I+=u[ei]}return D(t,I,m[256]),I+u[256]},Q=new r([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),P=new o(0),x=function(e,t,i,n,a,s){var d=s.z||e.length,C=new o(n+d+5*(1+Math.ceil(d/7e3))+a),h=C.subarray(n,C.length-a),I=s.l,u=7&(s.r||0);if(t){u&&(h[0]=s.r>>3);for(var A=Q[t-1],p=A>>13,Z=8191&A,w=(1<7e3||E>24576)&&(J>423||!I)){u=j(e,h,0,G,v,k,T,E,Y,B-Y,u),E=R=T=0,Y=B;for(var U=0;U<286;++U)v[U]=0;for(var U=0;U<30;++U)k[U]=0}var P=2,x=0,H=Z,M=L-K&32767;if(J>2&&D==W(B-M))for(var _=Math.min(p,J)-1,z=Math.min(32767,B),q=Math.min(258,J);M<=z&&--H&&L!=K;){if(e[B+P]==e[B+P-M]){for(var $=0;$P){if(P=$,x=M,$>_)break;for(var ee=Math.min(M,$-2),et=0,U=0;Uet&&(et=ea,K=ei)}}}K=f[L=K],M+=L-K&32767}if(x){G[E++]=268435456|m[P]<<18|b[x];var es=31&m[P],eo=31&b[x];T+=g[es]+c[eo],++v[257+es],++k[eo],N=B+P,++R}else G[E++]=e[B],++v[e[B]]}}for(B=Math.max(B,N);B=d&&(h[u/8|0]=I,el=d),u=F(h,u+1,e.subarray(B,el))}s.i=d}return X(C,0,n+O(u)+a)},H=function(){var e=1,t=0;return{p:function(i){for(var n=e,a=t,s=0|i.length,o=0;o!=s;){for(var l=Math.min(o+2655,s);o>16),a=(65535&a)+15*(a>>16)}e=n,t=a},d:function(){return e%=65521,t%=65521,(255&e)<<24|(65280&e)<<8|(255&t)<<8|t>>8}}},M=function(e,t,i,n,a){if(!a&&(a={l:1},t.dictionary)){var s=t.dictionary.subarray(-32768),l=new o(s.length+e.length);l.set(s),l.set(e,s.length),e=l,a.w=s.length}return x(e,null==t.level?6:t.level,null==t.mem?a.l?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):20:12+t.mem,i,n,a)},_=function(e,t,i){for(;i;++t)e[t]=i,i>>>=8},z=function(e,t){var i=t.level;if(e[0]=120,e[1]=(0==i?0:i<6?1:9==i?3:2)<<6|(t.dictionary&&32),e[1]|=31-(e[0]<<8|e[1])%31,t.dictionary){var n=H();n.p(t.dictionary),_(e,2,n.d())}};function q(e,t){t||(t={});var i=H();i.p(e);var n=M(e,t,t.dictionary?6:2,4);return z(n,t),_(n,n.length-4,i.d()),n}function $(e,t){return N(e.subarray((((15&e[0])!=8||e[0]>>4>7||(e[0]<<8|e[1])%31)&&E(6,"invalid zlib data"),(e[1]>>5&1)==+!t&&E(6,"invalid zlib data: "+(32&e[1]?"need":"unexpected")+" dictionary"),(e[1]>>3&4)+2),-4),{i:2},t,t)}var ee="undefined"!=typeof TextDecoder&&new TextDecoder;try{ee.decode(P,{stream:!0})}catch(e){}function et(){let e=window.navigator.userAgent.toLocaleLowerCase();return -1!==e.indexOf("edge")?"edge":-1!==e.indexOf("chrome")&&-1===e.indexOf("edge")?"chrome":-1!==e.indexOf("safari")&&-1===e.indexOf("chrome")?"safari":-1!==e.indexOf("opera")?"opera":-1!==e.indexOf("firefox")?"firefox":null}function ei(e){return void 0!==e.authn_metadata?e.authn_metadata:void 0!==e.metadata?e.metadata:null}function en(e){return"object"==typeof e&&null!==e&&"pre_key_bundle"in e?e.pre_key_bundle:null}class ea extends Error{}function es(e,t,i){let n=new Event(e);try{n.data=JSON.parse(JSON.stringify(t))}catch(e){n.data=t}return n.transportType=i,n}function eo(e,t,i,n,a){let s=new Event(e);try{s.data=JSON.parse(JSON.stringify(t))}catch(e){s.data=t}return s.logType=i,s.dataChannelId=n,s.dataChannelLabel=a,s}function el(e,t){if(t){let t=$(new Uint8Array(e));return new TextDecoder().decode(t)}return e}class er{constructor(e,t,i,n,a,s){this.senderStreamInitialized=new WeakSet,this.role=t,this.channelId=i,this.metadata=n,this.signalingUrlCandidates=e,this.options=a,this.connectionTimeout=6e4,"number"==typeof this.options.timeout&&(console.warn("@deprecated timeout option will be removed in a future version. Use connectionTimeout."),this.connectionTimeout=this.options.timeout),"number"==typeof this.options.connectionTimeout&&(this.connectionTimeout=this.options.connectionTimeout),this.disconnectWaitTimeout=3e3,"number"==typeof this.options.disconnectWaitTimeout&&(this.disconnectWaitTimeout=this.options.disconnectWaitTimeout),this.signalingCandidateTimeout=3e3,"number"==typeof this.options.signalingCandidateTimeout&&(this.signalingCandidateTimeout=this.options.signalingCandidateTimeout),this.constraints=null,this.debug=s,this.clientId=null,this.connectionId=null,this.sessionId=null,this.remoteConnectionIds=[],this.stream=null,this.ws=null,this.pc=null,this.encodings=[],this.callbacks={disconnect:()=>{},push:()=>{},addstream:()=>{},track:()=>{},removestream:()=>{},removetrack:()=>{},notify:()=>{},log:()=>{},timeout:()=>{},timeline:()=>{},signaling:()=>{},message:()=>{},datachannel:()=>{}},this.authMetadata=null,this.e2ee=null,this.connectionTimeoutTimerId=0,this.monitorSignalingWebSocketEventTimerId=0,this.monitorIceConnectionStateChangeTimerId=0,this.soraDataChannels={},this.mids={audio:"",video:""},this.signalingSwitched=!1,this.signalingOfferMessageDataChannels={},this.connectedSignalingUrl="",this.contactSignalingUrl=""}on(e,t){"addstream"===e?console.warn("@deprecated addstream callback will be removed in a future version. Use track callback."):"removestream"===e&&console.warn("@deprecated removestream callback will be removed in a future version. Use removetrack callback."),e in this.callbacks&&(this.callbacks[e]=t)}stopAudioTrack(e){return console.warn("@deprecated stopAudioTrack will be removed in a future version. Use removeAudioTrack instead."),this.removeAudioTrack(e)}removeAudioTrack(e){for(let t of e.getAudioTracks())t.enabled=!1;return new Promise((t,i)=>{setTimeout(()=>{Promise.all(e.getAudioTracks().map(async t=>{if(t.stop(),e.removeTrack(t),null!==this.pc){let e=this.pc.getSenders().find(e=>e.track&&e.track.id===t.id);if(e)return e.replaceTrack(null)}})).then(()=>t()).catch(i)},100)})}stopVideoTrack(e){return console.warn("@deprecated stopVideoTrack will be removed in a future version. Use removeVideoTrack instead."),this.removeVideoTrack(e)}removeVideoTrack(e){for(let t of e.getVideoTracks())t.enabled=!1;return new Promise((t,i)=>{setTimeout(()=>{Promise.all(e.getVideoTracks().map(async t=>{if(t.stop(),e.removeTrack(t),null!==this.pc){let e=this.pc.getSenders().find(e=>e.track&&e.track.id===t.id);if(e)return e.replaceTrack(null)}})).then(()=>t()).catch(i)},100)})}async replaceAudioTrack(e,t){await this.removeAudioTrack(e);let i=this.getAudioTransceiver();if(null===i)throw Error("Unable to set an audio track. Audio track sender is undefined");e.addTrack(t),await i.sender.replaceTrack(t),await this.setupSenderTransform(i.sender)}async replaceVideoTrack(e,t){await this.removeVideoTrack(e);let i=this.getVideoTransceiver();if(null===i)throw Error("Unable to set video track. Video track sender is undefined");e.addTrack(t),await i.sender.replaceTrack(t),await this.setupSenderTransform(i.sender)}signalingTerminate(){for(let e of Object.keys(this.soraDataChannels)){let t=this.soraDataChannels[e];t&&t.close(),delete this.soraDataChannels[e]}this.ws&&(this.ws.close(),this.ws=null),this.pc&&this.pc.close(),this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection()}abendPeerConnectionState(e){for(let e of(this.clearMonitorIceConnectionStateChange(),this.pc&&(this.pc.ondatachannel=null,this.pc.oniceconnectionstatechange=null,this.pc.onicegatheringstatechange=null,this.pc.onconnectionstatechange=null),this.ws&&(this.ws.onclose=e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason})},this.ws.onmessage=null,this.ws.onerror=null),Object.keys(this.soraDataChannels))){let t=this.soraDataChannels[e];t&&(t.onclose=e=>{let t=e.currentTarget;this.writeDataChannelTimelineLog("onclose",t),this.trace("CLOSE DATA CHANNEL",t.label)},t.onmessage=null,t.onerror=null)}for(let e of Object.keys(this.soraDataChannels)){let t=this.soraDataChannels[e];t&&t.close(),delete this.soraDataChannels[e]}this.ws&&(this.ws.close(),this.ws=null),this.pc&&this.pc.close(),this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection();let t=this.soraCloseEvent("abend",e);this.callbacks.disconnect(t),this.writeSoraTimelineLog("disconnect-abend",t)}async abend(e,t){for(let e of(this.clearMonitorIceConnectionStateChange(),this.pc&&(this.pc.ondatachannel=null,this.pc.oniceconnectionstatechange=null,this.pc.onicegatheringstatechange=null,this.pc.onconnectionstatechange=null),this.ws&&(this.ws.onclose=e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason})},this.ws.onmessage=null,this.ws.onerror=null),Object.keys(this.soraDataChannels))){let t=this.soraDataChannels[e];t&&(t.onclose=e=>{let t=e.currentTarget;this.writeDataChannelTimelineLog("onclose",t),this.trace("CLOSE DATA CHANNEL",t.label)},t.onmessage=null,t.onerror=null)}if(this.soraDataChannels.signaling){let t={type:"disconnect",reason:e};if(this.signalingOfferMessageDataChannels.signaling&&!0===this.signalingOfferMessageDataChannels.signaling.compress){let e=q(new TextEncoder().encode(JSON.stringify(t)),{});if("open"===this.soraDataChannels.signaling.readyState)try{this.soraDataChannels.signaling.send(e),this.writeDataChannelSignalingLog("send-disconnect",this.soraDataChannels.signaling,t)}catch(t){let e=t.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.soraDataChannels.signaling,e)}}else if("open"===this.soraDataChannels.signaling.readyState)try{this.soraDataChannels.signaling.send(JSON.stringify(t)),this.writeDataChannelSignalingLog("send-disconnect",this.soraDataChannels.signaling,t)}catch(t){let e=t.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.soraDataChannels.signaling,e)}}for(let e of Object.keys(this.soraDataChannels)){let t=this.soraDataChannels[e];t&&(t.onerror=null,t.close()),delete this.soraDataChannels[e]}if(await this.disconnectWebSocket(e),await this.disconnectPeerConnection(),this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection(),"WEBSOCKET-ONCLOSE"===e&&t&&(1e3===t.code||1005===t.code)){let e=this.soraCloseEvent("normal","DISCONNECT",t);this.writeSoraTimelineLog("disconnect-normal",e),this.callbacks.disconnect(e);return}let i=this.soraCloseEvent("abend",e,t);this.writeSoraTimelineLog("disconnect-abend",i),this.callbacks.disconnect(this.soraCloseEvent("abend",e,t))}initializeConnection(){this.clientId=null,this.connectionId=null,this.sessionId=null,this.remoteConnectionIds=[],this.stream=null,this.ws=null,this.pc=null,this.encodings=[],this.authMetadata=null,this.e2ee=null,this.soraDataChannels={},this.mids={audio:"",video:""},this.signalingSwitched=!1,this.signalingOfferMessageDataChannels={},this.contactSignalingUrl="",this.connectedSignalingUrl="",this.clearConnectionTimeout()}disconnectWebSocket(e){let t=0;return this.signalingSwitched?(this.ws&&(this.ws.close(),this.ws=null),Promise.resolve(null)):new Promise((i,n)=>{if(!this.ws)return i(null);if(this.ws.onclose=e=>(this.ws&&(this.ws.close(),this.ws=null),clearTimeout(t),this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason}),i({code:e.code,reason:e.reason})),1!==this.ws.readyState)return this.ws.close(),this.ws=null,i(null);{let n={type:"disconnect",reason:e};this.ws.send(JSON.stringify(n)),this.writeWebSocketSignalingLog("send-disconnect",n),t=setTimeout(()=>{this.ws&&(this.ws.close(),this.ws=null),i({code:1006,reason:""})},this.disconnectWaitTimeout)}})}disconnectDataChannel(){let e=()=>{for(let e of Object.keys(this.soraDataChannels)){let t=this.soraDataChannels[e];t&&(t.onerror=null,t.close()),delete this.soraDataChannels[e]}};return new Promise((t,i)=>{if(!this.soraDataChannels.signaling)return e(),t({code:4999,reason:""});let n=setTimeout(()=>(e(),i()),this.disconnectWaitTimeout),a=[];for(let i of Object.keys(this.soraDataChannels)){let s=this.soraDataChannels[i];if(s){s.onerror=()=>(clearTimeout(n),e(),t({code:4999,reason:""}));let i=()=>new Promise((e,t)=>{let i=0,n=setInterval(()=>{i++,"closed"===s.readyState&&(clearInterval(n),e()),this.disconnectWaitTimeout<100*i&&(e(),clearInterval(n))},100)});a.push(i())}}Promise.all(a).then(()=>{0===Object.keys(this.soraDataChannels).length?t(null):t({code:4999,reason:""})}).catch(e=>i(e)).finally(()=>{e(),clearTimeout(n)});let s={type:"disconnect",reason:"NO-ERROR"};if(this.signalingOfferMessageDataChannels.signaling&&!0===this.signalingOfferMessageDataChannels.signaling.compress){let e=q(new TextEncoder().encode(JSON.stringify(s)),{});if("open"===this.soraDataChannels.signaling.readyState)try{this.soraDataChannels.signaling.send(e),this.writeDataChannelSignalingLog("send-disconnect",this.soraDataChannels.signaling,s)}catch(t){let e=t.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.soraDataChannels.signaling,e)}}else if("open"===this.soraDataChannels.signaling.readyState)try{this.soraDataChannels.signaling.send(JSON.stringify(s)),this.writeDataChannelSignalingLog("send-disconnect",this.soraDataChannels.signaling,s)}catch(t){let e=t.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.soraDataChannels.signaling,e)}})}disconnectPeerConnection(){return new Promise((e,t)=>(this.pc&&"closed"!==this.pc.connectionState&&this.pc.close(),e()))}async disconnect(){for(let e of(this.clearMonitorIceConnectionStateChange(),this.pc&&(this.pc.ondatachannel=null,this.pc.oniceconnectionstatechange=null,this.pc.onicegatheringstatechange=null,this.pc.onconnectionstatechange=null),this.ws&&(this.ws.onclose=e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason})},this.ws.onmessage=null,this.ws.onerror=null),Object.keys(this.soraDataChannels))){let t=this.soraDataChannels[e];t&&(t.onmessage=null,t.onclose=e=>{let t=e.currentTarget;this.writeDataChannelTimelineLog("onclose",t),this.trace("CLOSE DATA CHANNEL",t.label)})}let e=null;if(this.signalingSwitched){try{let t=await this.disconnectDataChannel();null!==t&&(e=this.soraCloseEvent("normal","DISCONNECT",t))}catch(t){e=this.soraCloseEvent("abend","DISCONNECT-TIMEOUT")}await this.disconnectWebSocket("NO-ERROR"),await this.disconnectPeerConnection()}else{let t=await this.disconnectWebSocket("NO-ERROR");await this.disconnectPeerConnection(),null!==t&&(e=this.soraCloseEvent("normal","DISCONNECT",t))}this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection(),e&&("abend"===e.type?this.writeSoraTimelineLog("disconnect-abend",e):"normal"===e.type&&this.writeSoraTimelineLog("disconnect-normal",e),this.callbacks.disconnect(e))}setupE2EE(){!0===this.options.e2ee&&(this.e2ee=new a,this.e2ee.onWorkerDisconnect=async()=>{await this.abend("INTERNAL-ERROR",{reason:"CRASH-E2EE-WORKER"})},this.e2ee.startWorker())}startE2EE(){if(!0===this.options.e2ee&&this.e2ee){if(!this.connectionId){let e=Error();throw e.message="E2EE failed. Self connectionId is null",e}this.e2ee.clearWorker();let e=this.e2ee.start(this.connectionId);this.e2ee.postSelfSecretKeyMaterial(this.connectionId,e.selfKeyId,e.selfSecretKeyMaterial)}}async getSignalingWebSocket(e){if("string"==typeof e)return new Promise((t,i)=>{let n=new WebSocket(e);n.onclose=e=>{let t=new ea(`Signaling failed. CloseEventCode:${e.code} CloseEventReason:'${e.reason}'`);t.code=e.code,t.reason=e.reason,this.writeWebSocketTimelineLog("onclose",t),i(t)},n.onopen=e=>{t(n)}});if(Array.isArray(e)){let t=!1,i=e=>new Promise((i,n)=>{let a=new WebSocket(e),s=setTimeout(()=>{this.writeWebSocketSignalingLog("signaling-url-candidate",{type:"timeout",url:a.url}),a&&!t&&(a.onclose=null,a.onerror=null,a.onopen=null,a.close(),n())},this.signalingCandidateTimeout);a.onclose=e=>{this.writeWebSocketSignalingLog("signaling-url-candidate",{type:"close",url:a.url,message:"WebSocket closed",code:e.code,reason:e.reason}),a&&a.close(),clearInterval(s),n()},a.onerror=e=>{this.writeWebSocketSignalingLog("signaling-url-candidate",{type:"error",url:a.url,message:"Failed to connect WebSocket"}),a&&(a.onclose=null,a.close()),clearInterval(s),n()},a.onopen=e=>{a&&(clearInterval(s),t?(this.writeWebSocketSignalingLog("signaling-url-candidate",{type:"open",url:a.url,selected:!1}),a.onerror=null,a.onclose=null,a.onopen=null,a.close(),n()):(this.writeWebSocketSignalingLog("signaling-url-candidate",{type:"open",url:a.url,selected:!0}),a.onerror=null,a.onclose=null,a.onopen=null,t=!0,i(a)))}});try{return await Promise.any(e.map(e=>i(e)))}catch(e){throw new ea("Signaling failed. All signaling URL candidates failed to connect")}}throw new ea("Signaling failed. Invalid format signaling URL candidates")}async signaling(e,t=!1){let i=await this.createOffer();return this.trace("CREATE OFFER",i),new Promise((n,a)=>{this.writeWebSocketSignalingLog("new-websocket",e.url),e.binaryType="arraybuffer",e.onclose=e=>{let t=new ea(`Signaling failed. CloseEventCode:${e.code} CloseEventReason:'${e.reason}'`);t.code=e.code,t.reason=e.reason,this.writeWebSocketTimelineLog("onclose",t),this.signalingTerminate(),a(t)},e.onmessage=async t=>{if(t.data instanceof ArrayBuffer){this.writeWebSocketSignalingLog("onmessage-e2ee",t.data),this.signalingOnMessageE2EE(t.data);return}if("string"!=typeof t.data)throw Error("Received invalid signaling data");let i=JSON.parse(t.data);if("offer"===i.type)this.writeWebSocketSignalingLog("onmessage-offer",i),this.signalingOnMessageTypeOffer(i),this.connectedSignalingUrl=e.url,n(i);else if("update"===i.type)this.writeWebSocketSignalingLog("onmessage-update",i),await this.signalingOnMessageTypeUpdate(i);else if("re-offer"===i.type)this.writeWebSocketSignalingLog("onmessage-re-offer",i),await this.signalingOnMessageTypeReOffer(i);else if("ping"===i.type)await this.signalingOnMessageTypePing(i);else if("push"===i.type)this.callbacks.push(i,"websocket");else if("notify"===i.type)"connection.created"===i.event_type?this.writeWebSocketTimelineLog("notify-connection.created",i):"connection.destroyed"===i.event_type&&this.writeWebSocketTimelineLog("notify-connection.destroyed",i),this.signalingOnMessageTypeNotify(i,"websocket");else if("switched"===i.type)this.writeWebSocketSignalingLog("onmessage-switched",i),this.signalingOnMessageTypeSwitched(i);else if("redirect"===i.type){this.writeWebSocketSignalingLog("onmessage-redirect",i);try{let e=await this.signalingOnMessageTypeRedirect(i);n(e)}catch(e){a(e)}}},(async()=>{let n;try{n=function(e,t,i,n,a,s){if("sendrecv"!==t&&"sendonly"!==t&&"recvonly"!==t)throw Error("Unknown role type");if(null==i)throw Error("channelId can not be null or undefined");let o={type:"connect",sora_client:"Sora JavaScript SDK 2024.1.0-canary.1",environment:window.navigator.userAgent,role:t,channel_id:i,sdp:e,audio:!0,video:!0};if("sendrecv"===t&&!1===a.multistream)throw Error("Failed to parse options. Options multistream must be true when connecting using 'sendrecv'");!0===s&&(o.redirect=!0),"boolean"==typeof a.multistream&&(o.multistream=a.multistream),"boolean"==typeof a.simulcast&&(o.simulcast=a.simulcast),void 0!==a.simulcastRid&&0<=["r0","r1","r2"].indexOf(a.simulcastRid)&&(o.simulcast_rid=a.simulcastRid),"boolean"==typeof a.spotlight&&(o.spotlight=a.spotlight),"spotlightNumber"in a&&(o.spotlight_number=a.spotlightNumber);let l=["none","r0","r1","r2"];void 0!==a.spotlightFocusRid&&0<=l.indexOf(a.spotlightFocusRid)&&(o.spotlight_focus_rid=a.spotlightFocusRid),void 0!==a.spotlightUnfocusRid&&0<=l.indexOf(a.spotlightUnfocusRid)&&(o.spotlight_unfocus_rid=a.spotlightUnfocusRid),void 0!==n&&(o.metadata=n),void 0!==a.signalingNotifyMetadata&&(o.signaling_notify_metadata=a.signalingNotifyMetadata),void 0!==a.forwardingFilter&&(o.forwarding_filter=a.forwardingFilter),void 0!==a.clientId&&(o.client_id=a.clientId),void 0!==a.bundleId&&(o.bundle_id=a.bundleId),"boolean"==typeof a.dataChannelSignaling&&(o.data_channel_signaling=a.dataChannelSignaling),"boolean"==typeof a.ignoreDisconnectWebSocket&&(o.ignore_disconnect_websocket=a.ignoreDisconnectWebSocket);let r=["audioCodecType","audioBitRate"],g=["audioOpusParamsChannels","audioOpusParamsMaxplaybackrate","audioOpusParamsStereo","audioOpusParamsSpropStereo","audioOpusParamsMinptime","audioOpusParamsPtime","audioOpusParamsUseinbandfec","audioOpusParamsUsedtx"],c=["videoCodecType","videoBitRate","videoVP9Params","videoH264Params","videoH265Params","videoAV1Params"],d=Object.assign({},a);Object.keys(d).filter(e=>{"audio"===e&&"boolean"==typeof d[e]||"video"===e&&"boolean"==typeof d[e]||0<=r.indexOf(e)&&null!==d[e]||0<=g.indexOf(e)&&null!==d[e]||0<=c.indexOf(e)&&null!==d[e]||delete d[e]}),void 0!==d.audio&&(o.audio=d.audio);let C=Object.keys(d).some(e=>0<=r.indexOf(e));o.audio&&C&&(o.audio={},"audioCodecType"in d&&(o.audio.codec_type=d.audioCodecType),"audioBitRate"in d&&(o.audio.bit_rate=d.audioBitRate));let h=Object.keys(d).some(e=>0<=g.indexOf(e));o.audio&&h&&("object"!=typeof o.audio&&(o.audio={}),o.audio.opus_params={},"audioOpusParamsChannels"in d&&(o.audio.opus_params.channels=d.audioOpusParamsChannels),"audioOpusParamsMaxplaybackrate"in d&&(o.audio.opus_params.maxplaybackrate=d.audioOpusParamsMaxplaybackrate),"audioOpusParamsStereo"in d&&(o.audio.opus_params.stereo=d.audioOpusParamsStereo),"audioOpusParamsSpropStereo"in d&&(o.audio.opus_params.sprop_stereo=d.audioOpusParamsSpropStereo),"audioOpusParamsMinptime"in d&&(o.audio.opus_params.minptime=d.audioOpusParamsMinptime),"audioOpusParamsPtime"in d&&(o.audio.opus_params.ptime=d.audioOpusParamsPtime),"audioOpusParamsUseinbandfec"in d&&(o.audio.opus_params.useinbandfec=d.audioOpusParamsUseinbandfec),"audioOpusParamsUsedtx"in d&&(o.audio.opus_params.usedtx=d.audioOpusParamsUsedtx)),void 0!==d.video&&(o.video=d.video);let I=Object.keys(d).some(e=>0<=c.indexOf(e));if(o.video&&I&&(o.video={},"videoCodecType"in d&&(o.video.codec_type=d.videoCodecType),"videoBitRate"in d&&(o.video.bit_rate=d.videoBitRate),"videoVP9Params"in d&&(o.video.vp9_params=d.videoVP9Params),"videoH264Params"in d&&(o.video.h264_params=d.videoH264Params),"videoH265Params"in d&&(o.video.h265_params=d.videoH265Params),"videoAV1Params"in d&&(o.video.av1_params=d.videoAV1Params)),o.simulcast&&!function(){if(!window.RTCRtpSender||!RTCRtpSender.getCapabilities)return!1;let e=RTCRtpSender.getCapabilities("video");if(!e)return!1;let t=e.headerExtensions.map(e=>e.uri);return["urn:ietf:params:rtp-hdrext:sdes:mid","urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id","urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id"].every(e=>t.includes(e))}()&&"recvonly"!==t)throw Error("Simulcast can not be used with this browser");if("boolean"==typeof a.e2ee&&(o.e2ee=a.e2ee),!0===a.e2ee){if(void 0===o.signaling_notify_metadata&&(o.signaling_notify_metadata={}),null===o.signaling_notify_metadata||"object"!=typeof o.signaling_notify_metadata)throw Error("E2EE failed. Options signalingNotifyMetadata must be type 'object'");!0===o.video&&(o.video={}),o.video&&(o.video.codec_type="VP8")}return Array.isArray(a.dataChannels)&&0{this.pc&&(this.writePeerConnectionTimelineLog("oniceconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),this.trace("ONICECONNECTIONSTATECHANGE ICECONNECTIONSTATE",this.pc.iceConnectionState))},this.pc.onicegatheringstatechange=e=>{this.pc&&this.writePeerConnectionTimelineLog("onicegatheringstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState})},this.pc.onconnectionstatechange=e=>{this.pc&&this.writePeerConnectionTimelineLog("onconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState})},this.pc.ondatachannel=e=>{this.onDataChannel(e)}}async setRemoteDescription(e){if(!this.pc)return;let t=new RTCSessionDescription({type:"offer",sdp:this.processOfferSdp(e.sdp)});await this.pc.setRemoteDescription(t),this.writePeerConnectionTimelineLog("set-remote-description",t)}async createAnswer(e){if(!this.pc)return;for(let e of Object.values(this.mids)){let t=this.pc.getTransceivers().find(t=>t.mid===e);t&&"recvonly"===t.direction&&(t.direction="sendrecv")}if(this.options.simulcast&&("sendrecv"===this.role||"sendonly"===this.role)){let t=this.pc.getTransceivers().find(e=>{if(null!==e.mid&&null!==e.sender.track&&(null===e.currentDirection||"sendonly"===e.currentDirection)&&(""!==this.mids.video&&this.mids.video===e.mid||0<=e.mid.indexOf("video")))return e});if(t){await this.setSenderParameters(t,this.encodings),await this.setRemoteDescription(e),this.trace("TRANSCEIVER SENDER GET_PARAMETERS",t.sender.getParameters()),await this.setSenderParameters(t,this.encodings);let i=await this.pc.createAnswer();await this.pc.setLocalDescription(i),this.trace("TRANSCEIVER SENDER GET_PARAMETERS",t.sender.getParameters());return}}let t=await this.pc.createAnswer();this.writePeerConnectionTimelineLog("create-answer",t),await this.pc.setLocalDescription(t),this.writePeerConnectionTimelineLog("set-local-description",t)}processOfferSdp(e){let t=e;return"firefox"===et()&&(t=t.replace(/^m=(audio|video) 0 /gm,(e,t)=>`m=${t} 9 `)),t}async setupSenderTransform(e){if(null===this.e2ee||null===e.track||this.senderStreamInitialized.has(e)||"transform"in RTCRtpSender.prototype)return;let t=e.createEncodedStreams(),i=t.readable;this.e2ee.setupSenderTransform(i,t.writable),this.senderStreamInitialized.add(e)}async setupReceiverTransform(e,t){if(null===this.e2ee||"transform"in RTCRtpSender.prototype)return;let i=t.createEncodedStreams(),n=i.writable;this.e2ee.setupReceiverTransform(i.readable,n)}sendAnswer(){if(this.pc&&this.ws&&this.pc.localDescription){this.trace("ANSWER SDP",this.pc.localDescription.sdp);let e={type:"answer",sdp:this.pc.localDescription.sdp};this.ws.send(JSON.stringify(e)),this.writeWebSocketSignalingLog("send-answer",e)}}onIceCandidate(){return new Promise((e,t)=>{this.pc&&(this.pc.oniceconnectionstatechange=t=>{this.pc&&(this.writePeerConnectionTimelineLog("oniceconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),this.trace("ONICECONNECTIONSTATECHANGE ICECONNECTIONSTATE",this.pc.iceConnectionState),"connected"===this.pc.iceConnectionState&&e())},this.pc.onicecandidate=t=>{if(this.writePeerConnectionTimelineLog("onicecandidate",t.candidate),this.pc&&this.trace("ONICECANDIDATE ICEGATHERINGSTATE",this.pc.iceGatheringState),null===t.candidate)e();else{let e=Object.assign(t.candidate.toJSON(),{type:"candidate"});this.trace("ONICECANDIDATE CANDIDATE MESSAGE",e),this.sendSignalingMessage(e)}})})}waitChangeConnectionStateConnected(){return new Promise((e,t)=>{if(this.pc&&void 0===this.pc.connectionState){e();return}let i=setInterval(()=>{if(this.pc)this.pc&&"connected"===this.pc.connectionState&&(clearInterval(i),e());else{let e=Error();e.message="PeerConnection connectionState did not change to 'connected'",clearInterval(i),t(e)}},10)})}monitorSignalingWebSocketEvent(){return new Promise((e,t)=>{this.monitorSignalingWebSocketEventTimerId=setInterval(()=>{this.ws&&(this.clearMonitorSignalingWebSocketEvent(),this.ws.onclose=e=>{let i=new ea(`Signaling failed. CloseEventCode:${e.code} CloseEventReason:'${e.reason}'`);i.code=e.code,i.reason=e.reason,this.writeWebSocketTimelineLog("onclose",i),this.signalingTerminate(),t(i)},this.ws.onerror=e=>{let i=new ea("Signaling failed. WebSocket onerror was called");this.writeWebSocketSignalingLog("onerror",i),this.signalingTerminate(),t(i)})},100)})}monitorWebSocketEvent(){this.ws&&(this.ws.onclose=async e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason}),await this.abend("WEBSOCKET-ONCLOSE",{code:e.code,reason:e.reason})},this.ws.onerror=async e=>{this.writeWebSocketSignalingLog("onerror"),await this.abend("WEBSOCKET-ONERROR")})}monitorPeerConnectionState(){this.pc&&(this.pc.oniceconnectionstatechange=e=>{this.pc&&void 0===this.pc.connectionState&&(this.writePeerConnectionTimelineLog("oniceconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),this.trace("ONICECONNECTIONSTATECHANGE ICECONNECTIONSTATE",this.pc.iceConnectionState),clearTimeout(this.monitorIceConnectionStateChangeTimerId),"failed"===this.pc.iceConnectionState?this.abendPeerConnectionState("ICE-CONNECTION-STATE-FAILED"):"disconnected"===this.pc.iceConnectionState&&(this.monitorIceConnectionStateChangeTimerId=setTimeout(()=>{this.pc&&"disconnected"===this.pc.iceConnectionState&&this.abendPeerConnectionState("ICE-CONNECTION-STATE-DISCONNECTED-TIMEOUT")},1e4)))},this.pc.onconnectionstatechange=e=>{this.pc&&(this.writePeerConnectionTimelineLog("onconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),"failed"===this.pc.connectionState&&this.abendPeerConnectionState("CONNECTION-STATE-FAILED"))})}setConnectionTimeout(){return new Promise((e,t)=>{0{if(!this.pc||this.pc&&void 0!==this.pc.connectionState&&"connected"!==this.pc.connectionState){let e=Error();e.message="Signaling connection timeout",this.callbacks.timeout(),this.trace("DISCONNECT","Signaling connection timeout"),this.writePeerConnectionTimelineLog("signaling-connection-timeout",{connectionTimeout:this.connectionTimeout}),this.signalingTerminate(),t(e)}},this.connectionTimeout))})}clearConnectionTimeout(){clearTimeout(this.connectionTimeoutTimerId)}clearMonitorSignalingWebSocketEvent(){clearInterval(this.monitorSignalingWebSocketEventTimerId)}clearMonitorIceConnectionStateChange(){clearInterval(this.monitorIceConnectionStateChangeTimerId)}trace(e,t){this.callbacks.log(e,t),this.debug&&function(e,t,i){let n=e=>{if(e&&"object"==typeof e){let t=null;try{t=Object.keys(JSON.parse(JSON.stringify(e)))}catch(e){}t&&Array.isArray(t)?t.filter(t=>{console.group(t),n(e[t]),console.groupEnd()}):console.info(e)}else console.info(e)},a="";window.performance&&(a=`[${(window.performance.now()/1e3).toFixed(3)}]`),e&&(a=`${a}[${e}]`),void 0!==console.info&&void 0!==console.group?(console.group(`${a} ${t}`),n(i),console.groupEnd()):console.log(`${a} ${t} +`,i)}(this.clientId,e,t)}writeWebSocketSignalingLog(e,t){this.callbacks.signaling(es(e,t,"websocket")),this.writeWebSocketTimelineLog(e,t)}writeDataChannelSignalingLog(e,t,i){this.callbacks.signaling(es(e,i,"datachannel")),this.writeDataChannelTimelineLog(e,t,i)}writeWebSocketTimelineLog(e,t){let i=eo(e,t,"websocket");this.callbacks.timeline(i)}writeDataChannelTimelineLog(e,t,i){let n=eo(e,i,"datachannel",t.id,t.label);this.callbacks.timeline(n)}writePeerConnectionTimelineLog(e,t){let i=eo(e,t,"peerconnection");this.callbacks.timeline(i)}writeSoraTimelineLog(e,t){let i=eo(e,t,"sora");this.callbacks.timeline(i)}async createOffer(){let e=new window.RTCPeerConnection({iceServers:[]});if("safari"===et()){e.addTransceiver("video",{direction:"recvonly"}),e.addTransceiver("audio",{direction:"recvonly"});let t=await e.createOffer();return e.close(),this.writePeerConnectionTimelineLog("create-offer",t),t}let t=await e.createOffer({offerToReceiveAudio:!0,offerToReceiveVideo:!0});return e.close(),this.writePeerConnectionTimelineLog("create-offer",t),t}signalingOnMessageE2EE(e){if(this.e2ee){let t=new Uint8Array(e),i=this.e2ee.receiveMessage(t);this.e2ee.postRemoteSecretKeyMaterials(i),i.messages.filter(e=>{this.sendE2EEMessage(e.buffer)})}}signalingOnMessageTypeOffer(e){if(this.clientId=e.client_id,this.connectionId=e.connection_id,void 0!==e.session_id&&(this.sessionId=e.session_id),void 0!==e.metadata&&(this.authMetadata=e.metadata),Array.isArray(e.encodings)&&(this.encodings=e.encodings),void 0!==e.mid&&void 0!==e.mid.audio&&(this.mids.audio=e.mid.audio),void 0!==e.mid&&void 0!==e.mid.video&&(this.mids.video=e.mid.video),e.data_channels)for(let t of e.data_channels)this.signalingOfferMessageDataChannels[t.label]=t;this.trace("SIGNALING OFFER MESSAGE",e),this.trace("OFFER SDP",e.sdp)}sendUpdateAnswer(){this.pc&&this.ws&&this.pc.localDescription&&(this.trace("ANSWER SDP",this.pc.localDescription.sdp),this.sendSignalingMessage({type:"update",sdp:this.pc.localDescription.sdp}))}sendReAnswer(){this.pc?.localDescription&&(this.trace("RE ANSWER SDP",this.pc.localDescription.sdp),this.sendSignalingMessage({type:"re-answer",sdp:this.pc.localDescription.sdp}))}async signalingOnMessageTypeUpdate(e){this.trace("SIGNALING UPDATE MESSGE",e),this.trace("UPDATE SDP",e.sdp),await this.setRemoteDescription(e),await this.createAnswer(e),this.sendUpdateAnswer()}async signalingOnMessageTypeReOffer(e){this.trace("SIGNALING RE OFFER MESSGE",e),this.trace("RE OFFER SDP",e.sdp),await this.setRemoteDescription(e),await this.createAnswer(e),this.sendReAnswer()}async signalingOnMessageTypePing(e){let t={type:"pong"};if(e.stats){let e=await this.getStats();t.stats=e}this.ws&&this.ws.send(JSON.stringify(t))}signalingOnMessageTypeNotify(e,t){if("connection.created"===e.event_type){let t=e.connection_id;if(this.connectionId!==t){let i=en(ei(e));if(i&&this.e2ee&&t){let e=this.e2ee.startSession(t,i);this.e2ee.postRemoteSecretKeyMaterials(e),e.messages.filter(e=>{this.sendE2EEMessage(e.buffer)}),this.e2ee.postSelfSecretKeyMaterial(e.selfConnectionId,e.selfKeyId,e.selfSecretKeyMaterial)}}(e.data&&Array.isArray(e.data)?e.data:e.metadata_list&&Array.isArray(e.metadata_list)?e.metadata_list:[]).filter(e=>{let t=en(ei(e)),i=e.connection_id;i&&this.e2ee&&t&&this.e2ee.addPreKeyBundle(i,t)})}else if("connection.destroyed"===e.event_type){let t=en(ei(e)),i=e.connection_id;if(t&&this.e2ee&&i){let e=this.e2ee.stopSession(i);this.e2ee.postSelfSecretKeyMaterial(e.selfConnectionId,e.selfKeyId,e.selfSecretKeyMaterial,5e3),e.messages.filter(e=>{this.sendE2EEMessage(e.buffer)}),this.e2ee.postRemoveRemoteDeriveKey(i)}}this.callbacks.notify(e,t)}signalingOnMessageTypeSwitched(e){if(this.signalingSwitched=!0,this.ws)for(let t of(e.ignore_disconnect_websocket&&(this.ws&&(this.ws.onclose=null,this.ws.close(),this.ws=null),this.writeWebSocketSignalingLog("close")),this.datachannels))this.callbacks.datachannel(function(e){let t=new Event("datachannel");return t.datachannel=e,t}(t))}async signalingOnMessageTypeRedirect(e){this.ws&&(this.ws.onclose=null,this.ws.onerror=null,this.ws.close(),this.ws=null);let t=await this.getSignalingWebSocket(e.location);return await this.signaling(t,!0)}async setSenderParameters(e,t){let i=e.sender.getParameters();i.encodings=t,await e.sender.setParameters(i),this.trace("TRANSCEIVER SENDER SET_PARAMETERS",i),this.writePeerConnectionTimelineLog("transceiver-sender-set-parameters",i)}async getStats(){let e=[];return this.pc&&(await this.pc.getStats()).forEach(t=>{e.push(t)}),e}onDataChannel(e){let t=e.channel;t.bufferedAmountLowThreshold=65536,t.binaryType="arraybuffer",this.soraDataChannels[t.label]=t,this.writeDataChannelTimelineLog("ondatachannel",t,{binaryType:t.binaryType,bufferedAmount:t.bufferedAmount,bufferedAmountLowThreshold:t.bufferedAmountLowThreshold,id:t.id,label:t.label,maxPacketLifeTime:t.maxPacketLifeTime,maxRetransmits:t.maxRetransmits,negotiated:t.negotiated,ordered:t.ordered,protocol:t.protocol,readyState:t.readyState,reliable:t.reliable}),e.channel.onbufferedamountlow=e=>{let t=e.currentTarget;this.writeDataChannelTimelineLog("onbufferedamountlow",t)},e.channel.onopen=e=>{let t=e.currentTarget;this.trace("OPEN DATA CHANNEL",t.label),"signaling"===t.label&&this.ws?this.writeDataChannelSignalingLog("onopen",t):this.writeDataChannelTimelineLog("onopen",t)},e.channel.onclose=async e=>{let t=e.currentTarget;this.writeDataChannelTimelineLog("onclose",t),this.trace("CLOSE DATA CHANNEL",t.label),await this.disconnect()},e.channel.onerror=async e=>{let t=e.currentTarget;this.writeDataChannelTimelineLog("onerror",t),this.trace("ERROR DATA CHANNEL",t.label),await this.abend("DATA-CHANNEL-ONERROR",{params:{label:t.label}})},"signaling"===e.channel.label?e.channel.onmessage=async e=>{let t=e.currentTarget,i=t.label,n=this.signalingOfferMessageDataChannels[i];if(!n){console.warn(`Received onmessage event for '${i}' DataChannel. But '${i}' DataChannel settings doesn't exist`);return}let a=JSON.parse(el(e.data,n.compress));this.writeDataChannelSignalingLog(`onmessage-${a.type}`,t,a),"re-offer"===a.type&&await this.signalingOnMessageTypeReOffer(a)}:"notify"===e.channel.label?e.channel.onmessage=e=>{let t=e.currentTarget,i=t.label,n=this.signalingOfferMessageDataChannels[i];if(!n){console.warn(`Received onmessage event for '${i}' DataChannel. But '${i}' DataChannel settings doesn't exist`);return}let a=JSON.parse(el(e.data,n.compress));"connection.created"===a.event_type?this.writeDataChannelTimelineLog("notify-connection.created",t,a):"connection.destroyed"===a.event_type&&this.writeDataChannelTimelineLog("notify-connection.destroyed",t,a),this.signalingOnMessageTypeNotify(a,"datachannel")}:"push"===e.channel.label?e.channel.onmessage=e=>{let t=e.currentTarget.label,i=this.signalingOfferMessageDataChannels[t];if(!i){console.warn(`Received onmessage event for '${t}' DataChannel. But '${t}' DataChannel settings doesn't exist`);return}let n=JSON.parse(el(e.data,i.compress));this.callbacks.push(n,"datachannel")}:"e2ee"===e.channel.label?e.channel.onmessage=e=>{let t=e.currentTarget,i=e.data;this.signalingOnMessageE2EE(i),this.writeDataChannelSignalingLog("onmessage-e2ee",t,i)}:"stats"===e.channel.label?e.channel.onmessage=async e=>{let t=e.currentTarget.label,i=this.signalingOfferMessageDataChannels[t];if(!i){console.warn(`Received onmessage event for '${t}' DataChannel. But '${t}' DataChannel settings doesn't exist`);return}if("req-stats"===JSON.parse(el(e.data,i.compress)).type){let e=await this.getStats();this.sendStatsMessage(e)}}:/^#.*/.exec(e.channel.label)&&(e.channel.onmessage=e=>{let t;if(null===e.currentTarget)return;let i=e.currentTarget.label,n=this.signalingOfferMessageDataChannels[i];if(!n){console.warn(`Received onmessage event for '${i}' DataChannel. But '${i}' DataChannel settings doesn't exist`);return}let a=e.target;"string"==typeof e.data?t=new TextEncoder().encode(e.data):e.data instanceof ArrayBuffer?t=e.data:console.warn("Received onmessage event data is not of type String or ArrayBuffer."),void 0!==t&&(!0===n.compress&&(t=$(new Uint8Array(t)).buffer),this.callbacks.message(function(e,t){let i=new Event("message");return i.label=e,i.data=t,i}(a.label,t)))})}sendSignalingMessage(e){if(this.soraDataChannels.signaling){if(this.signalingOfferMessageDataChannels.signaling&&!0===this.signalingOfferMessageDataChannels.signaling.compress){let t=q(new TextEncoder().encode(JSON.stringify(e)),{});this.soraDataChannels.signaling.send(t)}else this.soraDataChannels.signaling.send(JSON.stringify(e));this.writeDataChannelSignalingLog(`send-${e.type}`,this.soraDataChannels.signaling,e)}else null!==this.ws&&(this.ws.send(JSON.stringify(e)),this.writeWebSocketSignalingLog(`send-${e.type}`,e))}sendE2EEMessage(e){this.soraDataChannels.e2ee?(this.soraDataChannels.e2ee.send(e),this.writeDataChannelSignalingLog("send-e2ee",this.soraDataChannels.e2ee,e)):null!==this.ws&&(this.ws.send(e),this.writeWebSocketSignalingLog("send-e2ee",e))}sendStatsMessage(e){if(this.soraDataChannels.stats){let t={type:"stats",reports:e};if(this.signalingOfferMessageDataChannels.stats&&!0===this.signalingOfferMessageDataChannels.stats.compress){let e=q(new TextEncoder().encode(JSON.stringify(t)),{});this.soraDataChannels.stats.send(e)}else this.soraDataChannels.stats.send(JSON.stringify(t))}}getAudioTransceiver(){return this.pc&&this.mids.audio&&this.pc.getTransceivers().find(e=>e.mid===this.mids.audio)||null}getVideoTransceiver(){return this.pc&&this.mids.video&&this.pc.getTransceivers().find(e=>e.mid===this.mids.video)||null}soraCloseEvent(e,t,i){return new class extends Event{constructor(e,t,i){super(e),i&&(i.code&&(this.code=i.code),i.reason&&(this.reason=i.reason),i.params&&(this.params=i.params)),this.title=t}}(e,t,i)}sendMessage(e,t){let i=this.soraDataChannels[e];if(null===this.pc)return;if(void 0===i)throw Error("Could not find DataChannel");if("open"!==i.readyState)throw Error("Messaging DataChannel is not open");let n=this.signalingOfferMessageDataChannels[e];if(void 0!==n&&!0===n.compress){let e=q(t,{});i.send(e)}else i.send(t)}get e2eeSelfFingerprint(){if(this.options.e2ee&&this.e2ee)return this.e2ee.selfFingerprint()}get e2eeRemoteFingerprints(){if(this.options.e2ee&&this.e2ee)return this.e2ee.remoteFingerprints()}get audio(){return null!==this.getAudioTransceiver()}get video(){return null!==this.getVideoTransceiver()}get signalingUrl(){return this.signalingUrlCandidates}get datachannels(){if(!this.signalingSwitched)return[];let e=Object.keys(this.signalingOfferMessageDataChannels).filter(e=>/^#.*/.exec(e)),t=[];for(let i of e){let e=this.soraDataChannels[i];if(!e)continue;let n=this.signalingOfferMessageDataChannels[i];if(!n)continue;let a={label:e.label,ordered:e.ordered,protocol:e.protocol,compress:n.compress,direction:n.direction};"number"==typeof e.maxPacketLifeTime&&(a.maxPacketLifeTime=e.maxPacketLifeTime),"number"==typeof e.maxRetransmits&&(a.maxRetransmits=e.maxRetransmits),t.push(a)}return t}}class eg extends er{async connect(e){return!1===this.options.multistream?await Promise.race([this.legacyStream(e).finally(()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()}),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]):await Promise.race([this.multiStream(e).finally(()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()}),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]),this.monitorWebSocketEvent(),this.monitorPeerConnectionState(),e}async legacyStream(e){await this.disconnect(),this.setupE2EE();let t=await this.getSignalingWebSocket(this.signalingUrlCandidates),i=await this.signaling(t);if(this.startE2EE(),await this.connectPeerConnection(i),await this.setRemoteDescription(i),e.getTracks().filter(t=>{this.pc&&this.pc.addTrack(t,e)}),this.pc)for(let e of this.pc.getSenders())await this.setupSenderTransform(e);return this.stream=e,await this.createAnswer(i),this.sendAnswer(),await this.onIceCandidate(),await this.waitChangeConnectionStateConnected(),e}async multiStream(e){await this.disconnect(),this.setupE2EE();let t=await this.getSignalingWebSocket(this.signalingUrlCandidates),i=await this.signaling(t);if(this.startE2EE(),await this.connectPeerConnection(i),this.pc&&(this.pc.ontrack=async e=>{await this.setupReceiverTransform(e.transceiver.mid,e.receiver);let t=e.streams[0];if(!t)return;let i={"stream.id":t.id,id:e.track.id,label:e.track.label,enabled:e.track.enabled,kind:e.track.kind,muted:e.track.muted,readyState:e.track.readyState};this.writePeerConnectionTimelineLog("ontrack",i),"default"!==t.id&&t.id!==this.connectionId&&(this.callbacks.track(e),t.onremovetrack=e=>{if(this.callbacks.removetrack(e),e.target){let t=this.remoteConnectionIds.indexOf(e.target.id);-1{this.pc&&this.pc.addTrack(t,e)}),this.pc)for(let e of this.pc.getSenders())await this.setupSenderTransform(e);return this.stream=e,await this.createAnswer(i),this.sendAnswer(),await this.onIceCandidate(),await this.waitChangeConnectionStateConnected(),e}}class ec extends er{async connect(){if(!1===this.options.multistream){let e=await Promise.race([this.legacyStream().finally(()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()}),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]);return this.monitorWebSocketEvent(),this.monitorPeerConnectionState(),e}await Promise.race([this.multiStream().finally(()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()}),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]),this.monitorWebSocketEvent(),this.monitorPeerConnectionState()}async legacyStream(){await this.disconnect(),this.setupE2EE();let e=await this.getSignalingWebSocket(this.signalingUrlCandidates),t=await this.signaling(e);return this.startE2EE(),await this.connectPeerConnection(t),this.pc&&(this.pc.ontrack=async e=>{await this.setupReceiverTransform(e.transceiver.mid,e.receiver),this.stream=e.streams[0];let t=this.stream.id;if("default"===t)return;let i={"stream.id":t,id:e.track.id,label:e.track.label,enabled:e.track.enabled,kind:e.track.kind,muted:e.track.muted,readyState:e.track.readyState};this.writePeerConnectionTimelineLog("ontrack",i),this.callbacks.track(e),this.stream.onremovetrack=e=>{if(this.callbacks.removetrack(e),e.target){let t=e.target.id,i=this.remoteConnectionIds.indexOf(t);-1{await this.setupReceiverTransform(e.transceiver.mid,e.receiver);let t=e.streams[0];if("default"===t.id||t.id===this.connectionId)return;let i={"stream.id":t.id,id:e.track.id,label:e.track.label,enabled:e.track.enabled,kind:e.track.kind,muted:e.track.muted,readyState:e.track.readyState};this.writePeerConnectionTimelineLog("ontrack",i),this.callbacks.track(e),t.onremovetrack=e=>{if(this.callbacks.removetrack(e),e.target){let t=e.target.id,i=this.remoteConnectionIds.indexOf(t);-1{await a.loadWasm(e)},connection:(e,t=!1)=>new ed(e,t),version:()=>"2024.1.0-canary.1",helpers:{applyMediaStreamConstraints:s}}}}]); \ No newline at end of file diff --git a/dist/_next/static/chunks/framework-4ed78fcefec7e84d.js b/dist/_next/static/chunks/framework-4ed78fcefec7e84d.js new file mode 100644 index 00000000..2fa3e708 --- /dev/null +++ b/dist/_next/static/chunks/framework-4ed78fcefec7e84d.js @@ -0,0 +1,33 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[774],{6521:function(e,n,t){/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var r,l,a,u,o,i,s=t(5271),c=t(7537);function f(e){for(var n="https://reactjs.org/docs/error-decoder.html?invariant="+e,t=1;t