@sapia-ai/chatbot 2.33.1 โ 2.33.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/RELEASE_WORKFLOW.md +259 -0
- package/docs/data-flow/data-flow.md +40 -0
- package/package.json +4 -1
- package/predictivehire.js +1 -1
- package/predictivehire.umd.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
## [2.33.2](https://github.com/PredictiveHire/phapp-fi-widget/compare/v2.33.1...v2.33.2) (2026-04-30)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **PlacesAutoComplete:** always show send button for normal mode ([82aba55](https://github.com/PredictiveHire/phapp-fi-widget/commit/82aba5527f57b2181c3303b39a143faaaab5dc72))
|
|
7
|
+
* **PlacesAutoComplete:** enable send button for manual location input when no location is suggested ([ce6fb5e](https://github.com/PredictiveHire/phapp-fi-widget/commit/ce6fb5e31827d7652fde4f600cafb0345bade1c7))
|
|
8
|
+
* **PlacesAutoComplete:** simplify send button logic for manual input ([b8b7c93](https://github.com/PredictiveHire/phapp-fi-widget/commit/b8b7c9399950d3cf2327cde1e4888a90aa57f239))
|
|
9
|
+
* release in main not allow to commit change log direct to main ([319a6f2](https://github.com/PredictiveHire/phapp-fi-widget/commit/319a6f2df1e75458db75e9a06377feb6fc3547c0))
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
1
13
|
## [2.33.1](https://github.com/PredictiveHire/phapp-fi-widget/compare/v2.33.0...v2.33.1) (2026-03-10)
|
|
2
14
|
|
|
3
15
|
|
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
# Release Workflow Guide
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
This project follows GitFlow best practices with semantic-release. All releases are published from the `main` branch after PR review and merge.
|
|
6
|
+
|
|
7
|
+
The project supports two types of releases:
|
|
8
|
+
- **Beta Releases**: Test versions published from any branch for early testing (tagged as `beta` on npm)
|
|
9
|
+
- **Production Releases**: Official versions published from `main` branch (tagged as `latest` on npm)
|
|
10
|
+
|
|
11
|
+
## Regular Release Process
|
|
12
|
+
|
|
13
|
+
### 1. Prepare Release Branch
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
# From develop branch, create a release branch
|
|
17
|
+
git checkout develop
|
|
18
|
+
git pull origin develop
|
|
19
|
+
git checkout -b release/YYYY.MM.DD
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
### 2. Create Pull Request
|
|
23
|
+
|
|
24
|
+
- Create PR from `release/YYYY.MM.DD` โ `main`
|
|
25
|
+
- Request team review
|
|
26
|
+
- Address any feedback
|
|
27
|
+
|
|
28
|
+
### 3. Merge to Main
|
|
29
|
+
|
|
30
|
+
- Get PR approval
|
|
31
|
+
- Merge PR to `main` branch
|
|
32
|
+
|
|
33
|
+
### 4. Release via Buildkite
|
|
34
|
+
|
|
35
|
+
- Buildkite pipeline automatically runs on `main` branch
|
|
36
|
+
- Navigate through the pipeline:
|
|
37
|
+
- Tests and build will run automatically
|
|
38
|
+
- **Optional: Publish beta** - Select "No" (or "Yes" if you want a beta version too)
|
|
39
|
+
- Click through DEV and QA deployment blocks if needed
|
|
40
|
+
- **Click "Release phchatbot" block** when ready to publish production release
|
|
41
|
+
- Semantic-release will:
|
|
42
|
+
- Analyze commits since last release
|
|
43
|
+
- Determine version bump (major/minor/patch)
|
|
44
|
+
- Create git tag (e.g., `v2.34.0`)
|
|
45
|
+
- Publish to npm with `latest` tag
|
|
46
|
+
- Create GitHub release with changelog
|
|
47
|
+
- Open a PR `chore/release-vX.Y.Z` with updated `package.json` and `CHANGELOG.md`
|
|
48
|
+
|
|
49
|
+
### 5. Merge the Release PR
|
|
50
|
+
|
|
51
|
+
After the Buildkite release step completes, a PR titled `chore(release): X.Y.Z` will be opened automatically. Merge it to keep `package.json` and `CHANGELOG.md` on `main` in sync.
|
|
52
|
+
|
|
53
|
+
### 6. Sync Back to Develop
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
# Merge main back to develop to keep them in sync
|
|
57
|
+
git checkout develop
|
|
58
|
+
git pull origin develop
|
|
59
|
+
git rebase main --rebase-merges
|
|
60
|
+
git push develop
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Beta Release Process
|
|
64
|
+
|
|
65
|
+
Beta releases allow you to publish test versions to npm for early testing without creating an official release. Beta versions are independent of the main release workflow.
|
|
66
|
+
|
|
67
|
+
### When to Use Beta Releases
|
|
68
|
+
|
|
69
|
+
- Testing features before merging to `main`
|
|
70
|
+
- Sharing work-in-progress with QA or stakeholders
|
|
71
|
+
- Validating fixes in a production-like environment
|
|
72
|
+
- Testing integration with other packages
|
|
73
|
+
|
|
74
|
+
### How to Publish a Beta Release
|
|
75
|
+
|
|
76
|
+
1. **Push Your Branch**: Push your feature/release/hotfix branch to GitHub
|
|
77
|
+
```bash
|
|
78
|
+
git push origin your-branch-name
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
2. **Trigger Buildkite Pipeline**: Buildkite will automatically run when you push
|
|
82
|
+
|
|
83
|
+
3. **Navigate Through Pipeline**:
|
|
84
|
+
- Tests and build run automatically
|
|
85
|
+
- When you reach the "Release Beta?" block, you'll see a dropdown
|
|
86
|
+
- Select **"Yes - Publish beta"** from the dropdown
|
|
87
|
+
- Click "Continue"
|
|
88
|
+
|
|
89
|
+
4. **Beta Version Published**:
|
|
90
|
+
- The beta release step will run
|
|
91
|
+
- Creates version: `{current-version}-beta.{build-number}`
|
|
92
|
+
- Example: `2.33.0-beta.456`
|
|
93
|
+
- Published to npm with `beta` tag
|
|
94
|
+
- Does NOT create git tags or GitHub releases
|
|
95
|
+
- Does NOT modify `package.json` in the repository
|
|
96
|
+
|
|
97
|
+
### Installing Beta Versions
|
|
98
|
+
|
|
99
|
+
Users can install beta versions using the beta tag or specific version:
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
# Install latest beta
|
|
103
|
+
npm install @sapia-ai/chatbot@beta
|
|
104
|
+
|
|
105
|
+
# Install specific beta version
|
|
106
|
+
npm install @sapia-ai/chatbot@2.33.0-beta.456
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Beta Release Notes
|
|
110
|
+
|
|
111
|
+
- Beta releases are **independent** of deployment steps (DEV/QA)
|
|
112
|
+
- You can publish beta WITHOUT deploying to environments
|
|
113
|
+
- You can deploy to DEV/QA WITHOUT publishing beta
|
|
114
|
+
- Beta releases do NOT affect the final production release
|
|
115
|
+
- The `package.json` is restored after beta publish to avoid conflicts
|
|
116
|
+
- Multiple beta releases can be published from the same branch
|
|
117
|
+
|
|
118
|
+
### Beta vs Production Release
|
|
119
|
+
|
|
120
|
+
| Feature | Beta Release | Production Release |
|
|
121
|
+
|---------|-------------|-------------------|
|
|
122
|
+
| Source Branch | Any branch | `main` only |
|
|
123
|
+
| Version Format | `X.Y.Z-beta.BUILD` | `X.Y.Z` |
|
|
124
|
+
| npm Tag | `beta` | `latest` |
|
|
125
|
+
| Git Tag | โ No | โ
Yes |
|
|
126
|
+
| GitHub Release | โ No | โ
Yes |
|
|
127
|
+
| Semantic Versioning | โ Manual | โ
Automatic |
|
|
128
|
+
| Modifies Repo | โ No | โ
Yes (opens PR with version bump) |
|
|
129
|
+
|
|
130
|
+
## Regular Release Process
|
|
131
|
+
|
|
132
|
+
### 1. Create Hotfix Branch
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
# From main branch, create a hotfix branch
|
|
136
|
+
git checkout main
|
|
137
|
+
git pull origin main
|
|
138
|
+
git checkout -b hotfix/TICKET-123-description
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### 2. Fix the Issue
|
|
142
|
+
|
|
143
|
+
- Make necessary fixes
|
|
144
|
+
- Test thoroughly
|
|
145
|
+
- Commit with conventional commit message (e.g., `fix: resolve critical bug`)
|
|
146
|
+
|
|
147
|
+
### 3. Create Pull Request
|
|
148
|
+
|
|
149
|
+
- Create PR from `hotfix/TICKET-123` โ `main`
|
|
150
|
+
- Request quick review
|
|
151
|
+
- Get approval
|
|
152
|
+
|
|
153
|
+
### 4. Merge and Release
|
|
154
|
+
|
|
155
|
+
- Merge PR to `main`
|
|
156
|
+
- Follow same Buildkite release process as regular releases
|
|
157
|
+
- Click "Release phchatbot" block
|
|
158
|
+
|
|
159
|
+
### 5. Sync Back to Develop
|
|
160
|
+
|
|
161
|
+
```bash
|
|
162
|
+
# Merge main back to develop
|
|
163
|
+
git checkout develop
|
|
164
|
+
git pull origin develop
|
|
165
|
+
git rebase main --rebase-merges
|
|
166
|
+
git push origin develop
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
## Commit Message Convention
|
|
170
|
+
|
|
171
|
+
Use [Conventional Commits](https://www.conventionalcommits.org/) format:
|
|
172
|
+
|
|
173
|
+
- `feat: add new feature` โ triggers MINOR version bump
|
|
174
|
+
- `fix: resolve bug` โ triggers PATCH version bump
|
|
175
|
+
- `feat!: breaking change` or `BREAKING CHANGE:` in footer โ triggers MAJOR version bump
|
|
176
|
+
- `chore:`, `docs:`, `style:`, `refactor:`, `test:` โ no version bump
|
|
177
|
+
|
|
178
|
+
## Key Points
|
|
179
|
+
|
|
180
|
+
โ
**DO:**
|
|
181
|
+
- Create PRs for all releases and hotfixes
|
|
182
|
+
- Get code review before merging to `main`
|
|
183
|
+
- Release from `main` branch only (via Buildkite)
|
|
184
|
+
- Merge `main` back to `develop` after release
|
|
185
|
+
- Use conventional commit messages
|
|
186
|
+
- Use beta releases for testing before final release
|
|
187
|
+
- Keep beta and production releases independent
|
|
188
|
+
|
|
189
|
+
โ **DON'T:**
|
|
190
|
+
- Try to release from `release/*` or `hotfix/*` branches
|
|
191
|
+
- Manually create tags or versions
|
|
192
|
+
- Skip the PR review process
|
|
193
|
+
- Forget to sync `main` back to `develop`
|
|
194
|
+
- Rely on beta versions in production (use `latest` tag only)
|
|
195
|
+
|
|
196
|
+
## Why This Workflow?
|
|
197
|
+
|
|
198
|
+
1. **Review Before Release**: PR review ensures code quality
|
|
199
|
+
2. **Release After Merge**: Follows semantic-release best practices
|
|
200
|
+
3. **Single Source of Truth**: `main` always reflects production
|
|
201
|
+
4. **Clean Git History**: All release tags are on `main` branch
|
|
202
|
+
5. **No Duplicate Releases**: Only `main` can trigger releases
|
|
203
|
+
6. **Automatic Versioning**: Semantic-release handles version bumps based on commits
|
|
204
|
+
7. **Protected Branch Compliance**: Semantic-release creates a PR for version/changelog updates rather than pushing directly to `main`, respecting branch protection rules
|
|
205
|
+
|
|
206
|
+
## Troubleshooting
|
|
207
|
+
|
|
208
|
+
### "This run was triggered by a pull request and therefore a new version won't be published"
|
|
209
|
+
|
|
210
|
+
This is expected behavior. Production releases only work from the `main` branch, not from PR contexts. Solution: Merge the PR first, then run the release. If you need to test before merging, use a beta release instead.
|
|
211
|
+
|
|
212
|
+
### Release PR was not created after release
|
|
213
|
+
|
|
214
|
+
Check that:
|
|
215
|
+
- `GITHUB_TOKEN` is available in the Buildkite release step (mapped from `GITHUB_TOKEN_PREDICTIVEHIREBUILD`)
|
|
216
|
+
- The `.buildkite/create-release-pr.sh` script has execute permission
|
|
217
|
+
- No branch named `chore/release-vX.Y.Z` already exists (would cause a push conflict)
|
|
218
|
+
- Check Buildkite logs for the `@semantic-release/exec` step output
|
|
219
|
+
|
|
220
|
+
### Version didn't bump as expected
|
|
221
|
+
|
|
222
|
+
Check your commit messages. Only `feat:` and `fix:` (and breaking changes) trigger version bumps. Use `git log` to review commits since last release.
|
|
223
|
+
|
|
224
|
+
### Need to test changes before merging
|
|
225
|
+
|
|
226
|
+
Use beta releases! Push your branch, run Buildkite, and select "Yes - Publish beta" in the Release Beta block. This creates a test version without affecting the main release.
|
|
227
|
+
|
|
228
|
+
### Beta release failed
|
|
229
|
+
|
|
230
|
+
Check that:
|
|
231
|
+
- `NPM_TOKEN` is configured in Buildkite
|
|
232
|
+
- You selected "Yes - Publish beta" in the dropdown
|
|
233
|
+
- The build step completed successfully
|
|
234
|
+
- Check Buildkite logs for specific error messages
|
|
235
|
+
|
|
236
|
+
### Need to release urgently
|
|
237
|
+
|
|
238
|
+
For urgent hotfixes:
|
|
239
|
+
1. Create hotfix branch from `main`
|
|
240
|
+
2. Make fix with `fix:` commit message
|
|
241
|
+
3. Create PR and get quick review
|
|
242
|
+
4. Merge to `main`
|
|
243
|
+
5. Run Buildkite release immediately
|
|
244
|
+
|
|
245
|
+
### Want to unpublish a beta version
|
|
246
|
+
|
|
247
|
+
Beta versions remain on npm but won't affect users who install `@latest`. If needed, you can deprecate or unpublish using npm CLI:
|
|
248
|
+
|
|
249
|
+
```bash
|
|
250
|
+
# Deprecate a beta version
|
|
251
|
+
npm deprecate @sapia-ai/chatbot@2.33.0-beta.456 "Use latest stable version"
|
|
252
|
+
|
|
253
|
+
# Unpublish (only within 72 hours)
|
|
254
|
+
npm unpublish @sapia-ai/chatbot@2.33.0-beta.456
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
## Questions?
|
|
258
|
+
|
|
259
|
+
Contact the DevOps or Engineering team for assistance with the release process.
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# Flow of Data Diagram
|
|
2
|
+
|
|
3
|
+
```mermaid
|
|
4
|
+
flowchart TD
|
|
5
|
+
|
|
6
|
+
index["index.ts"] --> RootApp["RootApp"]
|
|
7
|
+
|
|
8
|
+
RootApp --> ChatBotInterview["ChatBotInterview"]
|
|
9
|
+
|
|
10
|
+
ChatBotInterview --> PHChatBot["PHChatBot"]
|
|
11
|
+
|
|
12
|
+
PHChatBot --> App["App"]
|
|
13
|
+
PHChatBot --> OrderAssessment["OrderAssessment"]
|
|
14
|
+
PHChatBot --> GenericLang["GenericLanguageSelectionPage"]
|
|
15
|
+
PHChatBot --> AppLang["ApplicationLanguageSelectionPage"]
|
|
16
|
+
|
|
17
|
+
OrderAssessment -.->|"OrderAssessment redirects to generic assessment page"|RootApp
|
|
18
|
+
|
|
19
|
+
App --> ChatbotApp["ChatbotApp"]
|
|
20
|
+
|
|
21
|
+
ChatbotApp --> AccessVerification["AccessVerification"]
|
|
22
|
+
ChatbotApp --> Layout["Layout"]
|
|
23
|
+
|
|
24
|
+
Layout --> Assessment["Assessment"]
|
|
25
|
+
|
|
26
|
+
Assessment --> DialogueFlow["AssessmentDialogueFlow"]
|
|
27
|
+
Assessment --> ResponseFlow["AssessmentResponseFlow"]
|
|
28
|
+
|
|
29
|
+
DialogueFlow --> AgentBubble["AgentMessage Bubble"]
|
|
30
|
+
DialogueFlow --> CandidateBubble["CandidateMessage Bubble"]
|
|
31
|
+
|
|
32
|
+
ResponseFlow --> VideoResponse["VideoResponse"]
|
|
33
|
+
ResponseFlow --> PlacesAutoComplete["PlacesAutoComplete"]
|
|
34
|
+
ResponseFlow --> FTQResponse["FTQResponse"]
|
|
35
|
+
|
|
36
|
+
PlacesAutoComplete --> FTQResponse
|
|
37
|
+
|
|
38
|
+
FTQResponse --> PhoneEditor["PhoneEditor"]
|
|
39
|
+
FTQResponse --> NameEditor["NameEditor"]
|
|
40
|
+
FTQResponse --> PlainTextEditor["PlainTextEditor"]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sapia-ai/chatbot",
|
|
3
|
-
"version": "2.33.
|
|
3
|
+
"version": "2.33.2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "predictivehire.js",
|
|
6
6
|
"scripts": {
|
|
@@ -37,7 +37,10 @@
|
|
|
37
37
|
"@commitlint/cli": "^17.1.2",
|
|
38
38
|
"@commitlint/config-conventional": "^17.1.0",
|
|
39
39
|
"@rollup/plugin-babel": "^6.0.3",
|
|
40
|
+
"@semantic-release/commit-analyzer": "^9.0.2",
|
|
41
|
+
"@semantic-release/exec": "^6.0.3",
|
|
40
42
|
"@semantic-release/git": "^10.0.1",
|
|
43
|
+
"@semantic-release/release-notes-generator": "^10.0.3",
|
|
41
44
|
"@testing-library/dom": "^8.11.1",
|
|
42
45
|
"@testing-library/jest-dom": "^5.17.0",
|
|
43
46
|
"@testing-library/react": "^12.1.2",
|
package/predictivehire.js
CHANGED
|
@@ -43600,7 +43600,7 @@ const i7e = { "option-list": "_option-list_y65d5_1", "option-item": "_option-ite
|
|
|
43600
43600
|
a(E), h(), e && await e(E);
|
|
43601
43601
|
}
|
|
43602
43602
|
}, y = () => c.length ? /* @__PURE__ */ le.jsx("div", { className: jA["option-list"], children: c.map((_) => /* @__PURE__ */ le.jsx("div", { className: jA["option-item"], onClick: () => g(_), children: /* @__PURE__ */ le.jsx("span", { children: _.description }) }, _.placeId)) }) : null;
|
|
43603
|
-
return u ? /* @__PURE__ */ le.jsx(nE, { isSendButtonShown: !0, sendCircleButtonProps: i, wordCountRule: r, onChange: m, onSend: v, initialValue: o }) : /* @__PURE__ */ le.jsx(iI, { visible: c.length > 0, placement: "top", content: y, trigger: [], children: /* @__PURE__ */ le.jsx(nE, { isSendButtonShown: !
|
|
43603
|
+
return u ? /* @__PURE__ */ le.jsx(nE, { isSendButtonShown: !0, sendCircleButtonProps: i, wordCountRule: r, onChange: m, onSend: v, initialValue: o }) : /* @__PURE__ */ le.jsx(iI, { visible: c.length > 0, placement: "top", content: y, trigger: [], children: /* @__PURE__ */ le.jsx(nE, { isSendButtonShown: !0, sendCircleButtonProps: i, wordCountRule: r, onChange: m, onSend: v }) });
|
|
43604
43604
|
};
|
|
43605
43605
|
let e$ = !0, t$ = !0;
|
|
43606
43606
|
function Yd(t, e, r) {
|
package/predictivehire.umd.js
CHANGED
|
@@ -499,7 +499,7 @@ Output:
|
|
|
499
499
|
`:t}};this.options=wZe({},e,n),this.rules=new Tre(this.options)}aA.prototype={turndown:function(n){if(!YZe(n))throw new TypeError(n+" is not a string, or an element/document/fragment node.");if(n==="")return"";var e=Dre.call(this,new BZe(n,this.options));return WZe.call(this,e)},use:function(n){if(Array.isArray(n))for(var e=0;e<n.length;e++)this.use(n[e]);else if(typeof n=="function")n(this);else throw new TypeError("plugin must be a Function or an Array of Functions");return this},addRule:function(n,e){return this.rules.add(n,e),this},keep:function(n){return this.rules.keep(n),this},remove:function(n){return this.rules.remove(n),this},escape:function(n){return GZe.reduce(function(e,t){return e.replace(t[0],t[1])},n)}};function Dre(n){var e=this;return VZe.call(n.childNodes,function(t,r){r=new $Ze(r,e.options);var i="";return r.nodeType===3?i=r.isCode?r.nodeValue:e.escape(r.nodeValue):r.nodeType===1&&(i=KZe.call(e,r)),Are(t,i)},"")}function WZe(n){var e=this;return this.rules.forEach(function(t){typeof t.append=="function"&&(n=Are(n,t.append(e.options)))}),n.replace(/^[\t\r\n]+/,"").replace(/[\t\r\n\s]+$/,"")}function KZe(n){var e=this.rules.forNode(n),t=Dre.call(this,n),r=n.flankingWhitespace;return(r.leading||r.trailing)&&(t=t.trim()),r.leading+e.replacement(t,n,this.options)+r.trailing}function Are(n,e){var t=gre(n),r=pre(e),i=Math.max(n.length-t.length,e.length-r.length),o=`
|
|
500
500
|
|
|
501
501
|
`.substring(0,i);return t+o+r}function YZe(n){return n!=null&&(typeof n=="string"||n.nodeType&&(n.nodeType===1||n.nodeType===9||n.nodeType===11))}const XZe=n=>{let{charactersLength:e}=n;Le.useEffect(()=>{const t=r=>{e>=m0&&(r.preventDefault(),r.stopPropagation())};return window.addEventListener("keydown",t),()=>{window.removeEventListener("keydown",t)}},[e])},oA=n=>{Le.useEffect(()=>{const e=t=>{(t.metaKey||t.ctrlKey)&&t.key===CX&&n()};return window.addEventListener("keydown",e),()=>{window.removeEventListener("keydown",e)}},[n])},$9=n=>{let{wordsLength:e,wordCountLimit:t}=n;Le.useEffect(()=>{const r=i=>{e>=t&&i.key===CBe&&(i.preventDefault(),i.stopPropagation())};return window.addEventListener("keydown",r),()=>{window.removeEventListener("keydown",r)}},[e,t])},z9={"ph-select":"_ph-select_kdec8_1",searchable:"_searchable_kdec8_26","suffix-icon":"_suffix-icon_kdec8_34",dropdown:"_dropdown_kdec8_44"},wre=n=>{let{showSearch:e,searchIconColor:t}=n,r=_objectWithoutProperties3(n,_excluded6);return Qe.jsxs("div",{className:Vn(z9["ph-select"],e?z9.searchable:""),style:{"--icon-color":t},children:[e&&Qe.jsx(kR,{}),Qe.jsx(IR,_objectSpread3(_objectSpread3({},r),{},{showSearch:e,bordered:!1,suffixIcon:Qe.jsx(s3e,{className:z9["suffix-icon"]})}))]})},xre=n=>{let{onClose:e,visible:t,isDesktop:r}=n;const[i,o]=Le.useState(()=>r?"fi_dictation_deviceSelector_desktop":"fi_dictation_deviceSelector_iOS"),l=yi.getInstance(),u=[{label:Qe.jsx(co,{children:l.translate("fi_dictation_deviceSelector_iOS")}),value:"fi_dictation_deviceSelector_iOS"},{label:Qe.jsx(co,{children:l.translate("fi_dictation_deviceSelector_iPad")}),value:"fi_dictation_deviceSelector_iPad"},{label:Qe.jsx(co,{children:l.translate("fi_dictation_deviceSelector_android")}),value:"fi_dictation_deviceSelector_android"},{label:Qe.jsx(co,{children:l.translate("fi_dictation_deviceSelector_desktop")}),value:"fi_dictation_deviceSelector_desktop"}],c={fi_dictation_deviceSelector_iOS:"fi_dictation_content_iOS",fi_dictation_deviceSelector_iPad:"fi_dictation_content_iPad",fi_dictation_deviceSelector_android:"fi_dictation_content_android",fi_dictation_deviceSelector_desktop:"fi_dictation_content_desktop"};return Qe.jsx(vh,{"data-testid":"text-dictation-tip-modal",visible:t,onCancel:e,footer:null,children:Qe.jsxs("div",{children:[Qe.jsx("div",{style:{fontSize:"16px",paddingBottom:"20px"},children:Qe.jsx("strong",{children:l.translate("fi_dictation_title")})}),Qe.jsx("div",{style:{paddingBottom:"15px"},children:Qe.jsx("span",{children:l.translate("fi_dictation_deviceLabel")})}),Qe.jsx("div",{style:{paddingBottom:"15px"},children:Qe.jsx(wre,{defaultValue:i,style:{width:"100%"},options:u,onChange:d=>o(d)})}),Qe.jsx("div",{style:{paddingBottom:"15px"},children:Qe.jsx(co,{children:l.translate(c[i])})}),Qe.jsx("div",{style:{textAlign:"right"},children:Qe.jsx(Fa,{onClick:e,children:l.translate("fi_button_close")})})]})})},QZe={textDictationTip:"_textDictationTip_1o134_1"},kre=n=>{let{onHowClick:e}=n;const t=yi.getInstance();return Qe.jsx("div",{className:QZe.textDictationTip,onClick:e,children:Qe.jsx(co,{children:"".concat(t.translate("fi_dictation_tip")," ").concat(t.translate("fi_dictation_how"))})})},ZZe=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g,q9=n=>{if(n){const{numberOfEmoji:t,textWithoutEmoji:r}=JZe(n);return r.split(/\s+/g).filter(l=>{const u=/^(?:[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088F\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5C\u0C5D\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDC-\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7DC\uA7F1-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA830-\uA835\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uA9E0-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDE80-\uDE9C\uDEA0-\uDED0\uDEE1-\uDEFB\uDF00-\uDF23\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDDC0-\uDDF3\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC58-\uDC76\uDC79-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD20-\uDD39\uDD40-\uDD59\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE40-\uDE48\uDE60-\uDE7E\uDE80-\uDE9F\uDEC0-\uDEC7\uDEC9-\uDEE4\uDEEB-\uDEEF\uDF00-\uDF35\uDF40-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD23\uDD30-\uDD39\uDD40-\uDD65\uDD6F-\uDD85\uDE60-\uDE7E\uDE80-\uDEA9\uDEB0\uDEB1\uDEC2-\uDEC7\uDF00-\uDF27\uDF30-\uDF45\uDF51-\uDF54\uDF70-\uDF81\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC52-\uDC6F\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD03-\uDD26\uDD36-\uDD3F\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDD0-\uDDDA\uDDDC\uDDE1-\uDDF4\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDEF0-\uDEF9\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61\uDF80-\uDF89\uDF8B\uDF8E\uDF90-\uDFB5\uDFB7\uDFD1\uDFD3]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC50-\uDC59\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE50-\uDE59\uDE80-\uDEAA\uDEB8\uDEC0-\uDEC9\uDED0-\uDEE3\uDF00-\uDF1A\uDF30-\uDF3B\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCF2\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8\uDFC0-\uDFE0\uDFF0-\uDFF9]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC50-\uDC6C\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDA0-\uDDA9\uDDB0-\uDDDB\uDDE0-\uDDE9\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDF50-\uDF59\uDFB0\uDFC0-\uDFD4]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD80E\uD80F\uD81C-\uD822\uD840-\uD868\uD86A-\uD86D\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD88C][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46\uDC60-\uDFFF]|\uD810[\uDC00-\uDFFA]|\uD811[\uDC00-\uDE46]|\uD818[\uDD00-\uDD1D\uDD30-\uDD39]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDE70-\uDEBE\uDEC0-\uDEC9\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDD40-\uDD6C\uDD70-\uDD79\uDE40-\uDE96\uDEA0-\uDEB8\uDEBB-\uDED3\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3\uDFF2-\uDFF6]|\uD823[\uDC00-\uDCD5\uDCFF-\uDD1E\uDD80-\uDDF2]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD833[\uDCF0-\uDCF9]|\uD834[\uDEC0-\uDED3\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD40-\uDD49\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB\uDEF0-\uDEF9]|\uD839[\uDCD0-\uDCEB\uDCF0-\uDCF9\uDDD0-\uDDED\uDDF0-\uDDFA\uDEC0-\uDEDE\uDEE0-\uDEE2\uDEE4\uDEE5\uDEE7-\uDEED\uDEF0-\uDEF4\uDEFE\uDEFF\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCCF\uDD00-\uDD43\uDD4B\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEAD\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD88D[\uDC00-\uDC79])$/;return(l==null?void 0:l.length)===1?u.test(l):!!l}).filter(l=>l.charCodeAt(0).toString(16)!=="fe0f"&&l.charCodeAt(0).toString(16)!=="fe0e").length+t}return 0},JZe=n=>{const e=ZZe(),t=((n||"").match(e)||[]).length,r=n.replace(e,"");return{numberOfEmoji:t,textWithoutEmoji:r}},H9=n=>(n||"").length,V9=n=>{let{words:e,wordCountRule:t}=n;const r=yi.getInstance();if(!t||Object.keys(t).length===0)return;const i=t!=null&&t.recommend?((t==null?void 0:t.recommend)+(t==null?void 0:t.max))/2:((t==null?void 0:t.min)+(t==null?void 0:t.max))/2;return(t!=null&&t.min||(t==null?void 0:t.min)===0)&&e<(t==null?void 0:t.min)?{words:e,message:r.translate("fi_alt_shortResponse",{minWordCount:t.min}),color:{progressColor:"#F28826",popoverColor:"#B45600"},step:1}:(t!=null&&t.max||(t==null?void 0:t.max)===0)&&e>=i?e>=(t==null?void 0:t.max)?{words:e,message:r.translate("fi_alt_maxWords"),color:{progressColor:"#E51839",popoverColor:"#E20024"},step:3}:{words:e,message:r.translate("fi_alt_goodResponse"),color:{progressColor:"#51B811",popoverColor:"#328200"},step:3}:{words:e,message:r.translate("fi_alt_goodResponse"),color:{progressColor:"#51B811",popoverColor:"#328200"},step:2}},Ire={"word-count__wrapper":"_word-count__wrapper_1hcgw_1","word-count":"_word-count_1hcgw_1"},G9=n=>{let{words:e,message:t,color:r,step:i,className:o}=n;const l=yi.getInstance();return Qe.jsx("div",{"data-testid":"word-count",className:Vn(Ire["word-count__wrapper"],o),children:Qe.jsx(hG,{trigger:["click","hover"],placement:"top",content:Qe.jsx("span",{style:{color:r.popoverColor},children:t}),children:Qe.jsxs("span",{className:Ire["word-count"],style:{color:r.progressColor},children:[l.translate("fi_label_words",{count:e})," ",t?Qe.jsx(MS,{percent:i*100/3,steps:3,strokeColor:r.progressColor,showInfo:!1},i):null]})})})},sA={"ph-send-button":"_ph-send-button_184so_1","ph-send-button--submitting":"_ph-send-button--submitting_184so_15","ph-send-button__icon":"_ph-send-button__icon_184so_20","ph-send-button__icon--submitting":"_ph-send-button__icon--submitting_184so_26","move-right":"_move-right_184so_1","move-left":"_move-left_184so_1"},lA=n=>{let{size:e=57,backgroundColor:t="#4264fb",iconColor:r,iconSize:i,isSubmitting:o=!1,onClick:l,className:u}=n;const c={"--size":"".concat(e,"px"),"--backgroundColor":t};return Qe.jsx("button",{"data-testid":"send-circle-button",className:Vn(sA["ph-send-button"],o?sA["ph-send-button--submitting"]:"",u),style:c,onClick:()=>!o&&l&&l(),children:Qe.jsx("div",{className:Vn(sA["ph-send-button__icon"],o&&sA["ph-send-button__icon--submitting"]),children:Qe.jsx(Wc,{text:"Send answer",children:Qe.jsx(LKe,{style:{color:r||"#000000a6",fontSize:"".concat(i||Math.floor(e*2/5),"px")}})})})})},uA=n=>{const{chatbotState:{isReEditMode:e}}=is(),{scrollAssessmentDialogToBottom:t}=ip(),r=Le.useRef(0);Le.useEffect(()=>{const i=new Fy(l=>{const u=l[0].contentRect.height;u!==r.current&&!e&&(r.current=u,t())}),o=n.current;return i.observe(o),()=>{i.unobserve(o)}},[e,n,t])},eJe=20,Rre=new aA({headingStyle:"atx",bulletListMarker:"-",codeBlockStyle:"fenced"});Rre.addRule("listItem",{filter:"li",replacement:function(n,e){return(e.parentNode.nodeName==="OL"?"1. ":"- ")+n+`
|
|
502
|
-
`}}),yZe({gfm:!0,breaks:!0});const{EmojiBlot:tJe,ShortNameEmoji:nJe,ToolbarEmoji:rJe,TextAreaEmoji:iJe}=_Ze;mre.Quill.register({"formats/emoji":tJe,"modules/emoji-shortname":nJe,"modules/emoji-toolbar":rJe,"modules/emoji-textarea":iJe});const aJe={toolbar:{container:[[{list:"ordered"},{list:"bullet"}],["emoji"]]},"emoji-toolbar":!0,"emoji-shortname":!0},oJe=["list","emoji"],Pre=n=>{let{defaultValue:e,quillProps:t,doNotShowAgain:r,onSend:i,handleSendButtonClickCallBack:o,onChange:l,sendCircleButtonProps:u,visible:c=!0,renderConfirmModal:d,isSendButtonShown:f=!0,isAutoFocus:h=!0,wordCountRule:m,placeholder:p,allowPaste:g,renderCancelEditButton:v,allowSubmitWithoutText:y=!1,phChatBotCallback:b}=n;const E=Le.useRef(null),_=Le.useRef(null),[T,D]=Le.useState(!1),[x,C]=Le.useState(!1),{direction:S}=Hm(),[A,w]=Le.useState(""),[k,P]=Le.useState(""),O=A?A.replace(/<[^>]*>/g," ").replace(/\s+/g," ").trim():"",z=q9(O),G=H9(O),W=V9({words:z,wordCountRule:m});uA(_),$9({wordsLength:z,wordCountLimit:m==null?void 0:m.max}),XZe({charactersLength:G}),Le.useEffect(()=>{var Q;const I=(Q=E.current)===null||Q===void 0?void 0:Q.getEditor();I&&(I.root.setAttribute("dir",S),I.root.style.textAlign="start")},[S]),Le.useEffect(()=>{var Q;const I=(Q=E.current)===null||Q===void 0?void 0:Q.getEditor();I&&I.root.setAttribute("spellcheck","true")},[]),Le.useEffect(()=>{h&&E.current&&E.current.focus();let Q=null;return x&&E.current&&(Q=setTimeout(()=>{const I=E.current.getEditor();I.setSelection(I.getLength()-1,0),C(!1)})),()=>{Q&&clearTimeout(Q)}},[h,x]),Le.useEffect(()=>{var Q;const I=ae=>{if(!g){ae.preventDefault();return}},q=(Q=E.current)===null||Q===void 0?void 0:Q.getEditor();return q&&q.root.addEventListener("paste",I),()=>{q&&q.root.removeEventListener("paste",I)}},[g]),Le.useEffect(()=>{var Q;const I=(ae,pe)=>{const H=(ae.ops.length>0?ae.ops.map(X=>X.insert).join(" "):"").split(" ").filter(X=>X.length>0);if(H.length>eJe){const X=pe.ops.length>0?pe.ops.map(U=>U.insert).join(" "):"";cf({cb:b.CHATBOT_LOG,payload:{chatbotLogType:Hc.INVALID_PASTE_ANSWER_ACTION,params:{component:"DesktopQuillEditor",event:"text-change",eventData:{delta:ae,oldContents:pe},userUrl:window.location.href,currentValue:X,newAddedText:H==null?void 0:H.join(" ")}}})}},q=(Q=E.current)===null||Q===void 0?void 0:Q.getEditor();return q&&q.on("text-change",I),()=>{q&&q.off("text-change",I)}},[b]),Le.useEffect(()=>{if(e){try{const Q=bZe(e);P(e),w(Q)}catch(Q){console.error("Error converting Markdown to HTML:",Q),w(e),P(e)}C(!0)}else e||(w(""),P(""))},[e]);const oe=Q=>{w(Q);let I="";if(Q)try{I=Rre.turndown(Q),P(I)}catch(q){console.error("Error converting HTML to Markdown:",q),I=O}P(I),typeof l=="function"&&l(I)},ye=Le.useCallback(async()=>{(!k||k.trim().length===0)&&!y||i&&typeof i=="function"&&i(k)},[k,i,y]),be=Le.useCallback(()=>{!y&&z===0||z>(m==null?void 0:m.max)||G>m0||(!r&&z<(m==null?void 0:m.min)?o({words:z}):ye())},[G,r,o,ye,m==null?void 0:m.max,m==null?void 0:m.min,z,y]);return oA(be),Qe.jsxs(Qe.Fragment,{children:[Qe.jsx(xre,{visible:T,onClose:()=>D(!1),isDesktop:!0}),v(),Qe.jsxs("div",{"data-testid":"desktop-editor",className:"editor__wrapper ".concat(!c&&"editor__wrapper__hidden"),ref:_,children:[Qe.jsxs("div",{className:"editor--input",children:[Qe.jsxs("div",{className:"editor-upper-wrapper",children:[Qe.jsx(kre,{onHowClick:()=>D(!0)}),z>0&&W&&Qe.jsx(G9,_objectSpread3({},W))]}),Qe.jsx("div",{className:"quill-editor__wrapper",children:Qe.jsx(mre,_objectSpread3({ref:E,theme:"snow",value:A,onChange:oe,modules:aJe,formats:oJe,placeholder:p},t))})]}),f&&Qe.jsx(lA,_objectSpread3({onClick:be},u)),d({handleContinueBtnClick:ye})]})]})},UE={"simple-editor__wrapper":"_simple-editor__wrapper_kj7cm_1","editor-text-area__wrapper":"_editor-text-area__wrapper_kj7cm_17","editor-text-area":"_editor-text-area_kj7cm_17","editor-upper-wrapper":"_editor-upper-wrapper_kj7cm_41",editor__wrapper__hidden:"_editor__wrapper__hidden_kj7cm_47"},{TextArea:sJe}=Wu,W9=n=>{let{doNotShowAgain:e,textAreaProps:t,sendCircleButtonProps:r,visible:i=!0,placeholder:o,onSend:l,onChange:u,defaultValue:c,handleSendButtonClickCallBack:d,wordCountRule:f,isSendButtonShown:h=!0,renderConfirmModal:m,enableSubmitShortcut:p,allowPaste:g,renderCancelEditButton:v,inputMode:y="text"}=n;const b=Le.useRef(null),[E,_]=Le.useState(""),T=q9(E),D=V9({words:T,wordCountRule:f}),x=H9(E),C=Le.useRef(null);$9({wordsLength:T,wordCountLimit:f==null?void 0:f.max}),uA(C),Le.useEffect(()=>{_(c),b!=null&&b.current&&b.current.focus()},[c]);const S=k=>{var P,O;u&&u(k==null||(P=k.target)===null||P===void 0?void 0:P.value),_(k==null||(O=k.target)===null||O===void 0?void 0:O.value)},A=async()=>{if(!(!E||E.trim().length===0)&&l&&typeof l=="function"){const k=await l(E);k!=null&&k.success&&(_(""),b.current&&b.current.focus())}},w=()=>{T===0||T>(f==null?void 0:f.max)||x>m0||(!e&&T<f.min&&d?d({words:T}):A())};return oA(p?A:()=>{}),Qe.jsxs(Qe.Fragment,{children:[v(),Qe.jsxs("div",{"data-testid":"plain-text-editor",className:Vn(UE["simple-editor__wrapper"],i?"":UE.editor__wrapper__hidden),ref:C,children:[Qe.jsx("div",{className:UE["editor-upper-wrapper"],children:T>0&&D&&Qe.jsx(G9,_objectSpread3({},D))}),Qe.jsxs("div",{className:UE["editor-text-area__wrapper"],children:[Qe.jsx(sJe,_objectSpread3({spellCheck:!0,"data-testid":"editor-text-area",className:UE["editor-text-area"],value:E,ref:k=>{k==null||k.focus(),b.current=k},rows:1,autoSize:{maxRows:4},draggable:!1,placeholder:o,maxLength:m0,onChange:S,onPaste:k=>{if(!g)return k.preventDefault(),!1},inputMode:y},t)),h&&Qe.jsx("div",{"data-testid":"send-button-wrapper",children:Qe.jsx(lA,_objectSpread3({onClick:w,backgroundColor:"#ffffff",size:45,iconSize:25},r))})]}),m&&m({handleContinueBtnClick:A})]})]})},lJe=n=>{let{isSendButtonShown:e,onSend:t,onChange:r,wordCountRule:i,renderCancelEditButton:o,placeholder:l,handleSendButtonClickCallBack:u,sendCircleButtonProps:c,renderConfirmModal:d,allowPaste:f,doNotShowAgain:h,defaultValue:m,onExtractHumanNameFailedCallback:p,piiQuestionType:g,assessmentId:v,theme:y}=n;const[b,E]=Le.useState(!1),[_,T]=Le.useState(""),{extractedCandidateName:D,isExtractingHumanName:x,isFullNameQuestion:C,isLastNameQuestion:S,isFirstNameQuestion:A,checkIfNeedToExtractNameFromAnswer:w,extractHumanNameFromAnswer:k}=LQe({piiQuestionType:g,assessmentId:v,onExtractHumanNameFailedCallback:p}),P=ae=>{var pe;let te=ae==null?void 0:ae.trim();return te=(pe=te)===null||pe===void 0?void 0:pe.replace(/\s\s+/g," "),t(te)},O=async ae=>{if(ae===_)return T(""),P(ae);if(w({candidateAnswer:ae})){const{isNameExtractionSuccessful:te,isCandidateInputSameAsExtractedName:H}=await k({candidateAnswer:ae});if(te&&!H){T(ae),E(!0);return}}return P(ae)},z=ae=>{P(ae),E(!1),T("")},G=()=>{E(!1)},W=()=>{z(_)},oe=()=>{D&&z(D)},ye=yi.getInstance(),be=ye.translate(WX),Q=ye.translate("fi_button_ignore"),I=ye.translate("fi_button_correct");let q="";return A?q=ye.translate("fi_alt_firstName",{candidateFirstName:D}):S?q=ye.translate("fi_alt_lastName",{candidateLastName:D}):C&&(q=ye.translate("fi_alt_fullName",{candidateFullName:D})),Qe.jsxs(Qe.Fragment,{children:[Qe.jsx(NQe,{visible:b,confirmationText:q,handleEditButtonClick:G,editButtonLabel:be,handleIgnoreButtonClick:W,ignoreButtonLabel:Q,handleConfirmButtonClick:oe,confirmButtonLabel:I,theme:y}),Qe.jsx(W9,{isSendButtonShown:e,placeholder:l,onSend:O,sendCircleButtonProps:_objectSpread3(_objectSpread3({},c!=null?c:{}),{},{isSubmitting:(c==null?void 0:c.isSubmitting)||x}),defaultValue:m,onChange:r,wordCountRule:i,renderConfirmModal:d,doNotShowAgain:h,handleSendButtonClickCallBack:u,enableSubmitShortcut:!0,allowPaste:f,renderCancelEditButton:o,inputMode:"text"})]})};var kh=(n=>(n.ANSWER="ANSWER",n.VIDEO_RETRY_RECORDS="VIDEO_RETRY_RECORDS",n.DO_NOT_SHOW_LESS_WORD_COUNT_POP_UP_AGAIN="DO_NOT_SHOW_LESS_WORD_COUNT_POP_UP_AGAIN",n.ASSESSMENT_CACHE="ASSESSMENT_CACHE",n.ASSESSMENT_TAB_COUNT="ASSESSMENT_TAB_COUNT",n.ACCESS_VERIFICATION_INFO="ACCESS_VERIFICATION_INFO",n))(kh||{});const jE=n=>{let{key:e,throttleOptions:t={wait:2e3}}=n;const r=Le.useCallback(d=>{const f=localStorage.getItem(d!=null?d:e);try{return JSON.parse(f)}catch(h){return f}},[e]),i=Le.useCallback(d=>{let{accessKey:f,value:h}=d;typeof h!="string"&&(h=JSON.stringify(h)),localStorage.setItem(f!=null?f:e,h)},[e]),o=Le.useCallback(d=>{localStorage.removeItem(d!=null?d:e)},[e]),{run:l,cancel:u}=Gm(i,t),c=Le.useCallback(d=>{let{accessKey:f,value:h}=d;const m=r(f!=null?f:e)||{};typeof h=="object"&&l({value:_objectSpread3(_objectSpread3({},m),h)})},[r,e,l]);return Le.useEffect(()=>u,[u]),{getItem:r,removeItem:o,updateItemWithThrottle:c,setItem:i}},uJe=n=>{let{children:e,onClick:t}=n;return Qe.jsx(Fa,{type:"text",style:{margin:5,color:Ije,fontSize:12,alignSelf:"center",cursor:"pointer"},onClick:t,children:e})};var cA={exports:{}};cA.exports=K9,cA.exports.isMobile=K9,cA.exports.default=K9;const cJe=/(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|samsungbrowser|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,dJe=/CrOS/,fJe=/android|ipad|playbook|silk/i;function K9(n){n||(n={});let e=n.ua;if(!e&&typeof navigator!="undefined"&&(e=navigator.userAgent),e&&e.headers&&typeof e.headers["user-agent"]=="string"&&(e=e.headers["user-agent"]),typeof e!="string")return!1;let t=cJe.test(e)&&!dJe.test(e)||!!n.tablet&&fJe.test(e);return!t&&n.tablet&&n.featureDetect&&navigator&&navigator.maxTouchPoints>1&&e.indexOf("Macintosh")!==-1&&e.indexOf("Safari")!==-1&&(t=!0),t}var hJe=cA.exports;const Ore=Ma(hJe),Lre=()=>{const[n,e]=Le.useState(()=>Ore());return Le.useEffect(()=>{const t=()=>{e(Ore())};return window.addEventListener("resize",t),()=>{window.removeEventListener("resize",t)}},[]),{isMobile:n}},yf={mobileEditorWrapper:"_mobileEditorWrapper_1i9mo_1",clickableBarWrapper:"_clickableBarWrapper_1i9mo_20",clickableBar:"_clickableBar_1i9mo_20",expanded:"_expanded_1i9mo_33",collapseButton:"_collapseButton_1i9mo_36",infoSection:"_infoSection_1i9mo_47",questionCount:"_questionCount_1i9mo_54",wordCount:"_wordCount_1i9mo_58",hidden:"_hidden_1i9mo_62",editorTextAreaWrapper:"_editorTextAreaWrapper_1i9mo_65",editorTextArea:"_editorTextArea_1i9mo_65"},mJe=n=>{let{expanded:e,handleClick:t}=n;return Qe.jsxs("div",{"data-testid":"clickable-bar",className:yf.clickableBarWrapper,onClick:t,children:[Qe.jsx(Wc,{text:e?"Collapse":"Expand",children:Qe.jsx("div",{className:Vn([yf.clickableBar,e?yf.expanded:""])})}),e?Qe.jsx(Fa,{"aria-label":"collapse",className:yf.collapseButton,children:Qe.jsx(Wc,{text:"Collapse",children:Qe.jsx(BKe,{})})}):null]})},{TextArea:pJe}=Wu,Y9="60px",Nre="calc(100% - ".concat(Y9,")"),Mre=n=>{let{doNotShowAgain:e,sendCircleButtonProps:t,placeholder:r,onSend:i,onChange:o,defaultValue:l,handleSendButtonClickCallBack:u,wordCountRule:c,isSendButtonShown:d=!0,renderConfirmModal:f,allowPaste:h,hideClickableBar:m,renderCancelEditButton:p,isEditing:g,phChatBotCallback:v,allowSubmitWithoutText:y=!1}=n;const[b,E]=Le.useState(!1),[_,T]=Le.useState(""),D=Le.useRef(null),x=q9(_),C=V9({words:x,wordCountRule:c}),S=H9(_),A=Le.useRef(null);Le.useEffect(()=>{T(l),D!=null&&D.current&&D.current.focus()},[l]);const[w,k]=Le.useState(!1),[P,O]=Le.useState(window.visualViewport.height?"".concat(window.visualViewport.height,"px - ").concat(Y9):Nre),z=q=>{var ae,pe;o&&o(q==null||(ae=q.target)===null||ae===void 0?void 0:ae.value),T(q==null||(pe=q.target)===null||pe===void 0?void 0:pe.value)};Le.useEffect(()=>{const q=()=>{O("".concat(window.visualViewport.height,"px - ").concat(Y9))};return window.visualViewport.addEventListener("resize",q),()=>{window.visualViewport.removeEventListener("resize",q)}},[]);const G=()=>{k(q=>!q)},W=async()=>{if(!(!y&&(!_||_.trim().length===0))&&i&&typeof i=="function"){const q=await i(_);q!=null&&q.success&&(T(""),D.current&&D.current.focus())}},oe=()=>{!y&&x===0||x>(c==null?void 0:c.max)||S>m0||(k(!1),!e&&x<(c==null?void 0:c.min)&&u?u({words:x}):W())};$9({wordsLength:x,wordCountLimit:c==null?void 0:c.max}),uA(A);const ye=()=>m?null:Qe.jsx(mJe,{handleClick:G,expanded:w}),be=()=>{const q=x>0&&C;return Qe.jsxs("div",{className:yf.infoSection,children:[Qe.jsx(xre,{visible:b,onClose:()=>E(!1),isDesktop:!1}),Qe.jsxs("div",{children:[q?Qe.jsx(G9,_objectSpread3(_objectSpread3({},C),{},{className:yf.wordCount})):null,Qe.jsx(kre,{onHowClick:()=>E(!0)})]}),d?Qe.jsx(lA,_objectSpread3({onClick:oe,backgroundColor:"#ffffff",size:45,iconSize:25},t)):null]})},Q=()=>Qe.jsxs(Qe.Fragment,{children:[p(()=>{k(!1)}),Qe.jsxs("div",{"data-testid":"mobile-editor",className:yf.mobileEditorWrapper,ref:A,children:[ye(),Qe.jsx("div",{className:yf.editorTextAreaWrapper,children:Qe.jsx(pJe,{spellCheck:!0,"data-testid":"editor-text-area",className:yf.editorTextArea,value:_,ref:q=>{q==null||q.focus(),D.current=q},rows:2,draggable:!1,placeholder:r,maxLength:m0,onChange:z,onPaste:q=>{if(!h)return q.preventDefault(),q.stopPropagation(),!1},onDrop:q=>{if(!h)return cf({cb:v.CHATBOT_LOG,payload:{chatbotLogType:Hc.INVALID_PASTE_ANSWER_ACTION,params:{component:"MobileEditor",event:"onDrop",eventData:q,userUrl:window.location.href,currentValue:_}}}),!0},onInput:q=>{if(!h&&q.nativeEvent&&q.nativeEvent.inputType==="insertFromPaste"){const ae=q.target,pe=_;cf({cb:v.CHATBOT_LOG,payload:{chatbotLogType:Hc.INVALID_PASTE_ANSWER_ACTION,params:{component:"MobileEditor",event:"onInput",eventData:q,userUrl:window.location.href,currentValue:pe,targetValue:ae==null?void 0:ae.value}}})}},onKeyDown:q=>{!h&&(q.ctrlKey&&q.key==="v"||q.metaKey&&q.key==="v"||q.shiftKey&&q.key==="Insert")&&cf({cb:v.CHATBOT_LOG,payload:{chatbotLogType:Hc.INVALID_PASTE_ANSWER_ACTION,params:{component:"MobileEditor",event:"onKeyDown",eventData:q,userUrl:window.location.href,currentValue:_}}})},onContextMenu:q=>{h||cf({cb:v.CHATBOT_LOG,payload:{chatbotLogType:Hc.INVALID_PASTE_ANSWER_ACTION,params:{component:"MobileEditor",event:"onContextMenu",eventData:q,userUrl:window.location.href,currentValue:_}}})},onClick:()=>{w&&setTimeout(()=>{window.scrollTo(0,0)},150)},style:{width:"100%",height:"100%"}})}),be()]})]}),I=()=>Qe.jsx(bxe,{getContainer:()=>document.getElementById(xw),placement:"bottom",onClose:()=>k(!1),visible:!0,closeIcon:!1,headerStyle:{padding:0,height:0},bodyStyle:{padding:0,display:"grid",height:"100%",gridTemplateRows:g?"auto 1fr":"1fr"},drawerStyle:{height:P},contentWrapperStyle:{height:Nre},children:Q()});return w?I():Qe.jsxs(Qe.Fragment,{children:[Q(),f?f({handleContinueBtnClick:W}):null]})},U0=[{emoji:"๐จ๐ฆ",phoneCode:"1",short:"CA",name:"Canada"},{emoji:"๐บ๐ธ",phoneCode:"1",short:"US",name:"United States of America"},{emoji:"๐ง๐ธ",phoneCode:"1",short:"BS",name:"Bahamas"},{emoji:"๐ง๐ง",phoneCode:"1",short:"BB",name:"Barbados"},{emoji:"๐ฆ๐ฎ",phoneCode:"1",short:"AI",name:"Anguilla"},{emoji:"๐ฆ๐ฌ",phoneCode:"1",short:"AG",name:"Antigua and Barbuda"},{emoji:"๐ป๐ฎ",phoneCode:"1",short:"VI",name:"Virgin Islands (U.S.)"},{emoji:"๐ป๐ฌ",phoneCode:"1",short:"VG",name:"Virgin Islands (British)"},{emoji:"๐ฐ๐พ",phoneCode:"1",short:"KY",name:"Cayman Islands"},{emoji:"๐ง๐ฒ",phoneCode:"1",short:"BM",name:"Bermuda"},{emoji:"๐ฌ๐ฉ",phoneCode:"1",short:"GD",name:"Grenada"},{emoji:"๐น๐จ",phoneCode:"1",short:"TC",name:"Turks and Caicos Islands"},{emoji:"๐ฒ๐ธ",phoneCode:"1",short:"MS",name:"Montserrat"},{emoji:"๐ฌ๐บ",phoneCode:"1",short:"GU",name:"Guam"},{emoji:"๐ฆ๐ธ",phoneCode:"1",short:"AS",name:"American Samoa"},{emoji:"๐ณ๐ฑ",phoneCode:"1",short:"SX",name:"Sint Maarten (Dutch part)"},{emoji:"๐ฑ๐จ",phoneCode:"1",short:"LC",name:"Saint Lucia"},{emoji:"๐ฉ๐ฒ",phoneCode:"1",short:"DM",name:"Dominica"},{emoji:"๐ป๐จ",phoneCode:"1",short:"VC",name:"Saint Vincent and the Grenadines"},{emoji:"๐ต๐ท",phoneCode:"1",short:"PR",name:"Puerto Rico"},{emoji:"๐ฉ๐ด",phoneCode:"1",short:"DO",name:"Dominican Republic"},{emoji:"๐น๐น",phoneCode:"1",short:"TT",name:"Trinidad and Tobago"},{emoji:"๐ฐ๐ณ",phoneCode:"1",short:"KN",name:"Saint Kitts and Nevis"},{emoji:"๐ฏ๐ฒ",phoneCode:"1",short:"JM",name:"Jamaica"},{emoji:"๐ช๐ฌ",phoneCode:"20",short:"EG",name:"Egypt"},{emoji:"๐ฒ๐ฆ",phoneCode:"212",short:"MA",name:"Morocco"},{emoji:"๐ฉ๐ฟ",phoneCode:"213",short:"DZ",name:"Algeria"},{emoji:"๐น๐ณ",phoneCode:"216",short:"TN",name:"Tunisia"},{emoji:"๐ฑ๐พ",phoneCode:"218",short:"LY",name:"Libya"},{emoji:"๐ฌ๐ฒ",phoneCode:"220",short:"GM",name:"Gambia"},{emoji:"๐ธ๐ณ",phoneCode:"221",short:"SN",name:"Senegal"},{emoji:"๐ฒ๐ท",phoneCode:"222",short:"MR",name:"Mauritania"},{emoji:"๐ฒ๐ฑ",phoneCode:"223",short:"ML",name:"Mali"},{emoji:"๐ฌ๐ณ",phoneCode:"224",short:"GN",name:"Guinea"},{emoji:"๐จ๐ฎ",phoneCode:"225",short:"CI",name:"Cรดte d'Ivoire"},{emoji:"๐ง๐ซ",phoneCode:"226",short:"BF",name:"Burkina Faso"},{emoji:"๐ณ๐ช",phoneCode:"227",short:"NE",name:"Niger"},{emoji:"๐น๐ฌ",phoneCode:"228",short:"TG",name:"Togo"},{emoji:"๐ง๐ฏ",phoneCode:"229",short:"BJ",name:"Benin"},{emoji:"๐ฒ๐บ",phoneCode:"230",short:"MU",name:"Mauritius"},{emoji:"๐ฑ๐ท",phoneCode:"231",short:"LR",name:"Liberia"},{emoji:"๐ธ๐ฑ",phoneCode:"232",short:"SL",name:"Sierra Leone"},{emoji:"๐ฌ๐ญ",phoneCode:"233",short:"GH",name:"Ghana"},{emoji:"๐ณ๐ฌ",phoneCode:"234",short:"NG",name:"Nigeria"},{emoji:"๐น๐ฉ",phoneCode:"235",short:"TD",name:"Chad"},{emoji:"๐จ๐ซ",phoneCode:"236",short:"CF",name:"Central African Republic"},{emoji:"๐จ๐ฒ",phoneCode:"237",short:"CM",name:"Cameroon"},{emoji:"๐จ๐ป",phoneCode:"238",short:"CV",name:"Cabo Verde"},{emoji:"๐ธ๐น",phoneCode:"239",short:"ST",name:"Sao Tome and Principe"},{emoji:"๐ฌ๐ถ",phoneCode:"240",short:"GQ",name:"Equatorial Guinea"},{emoji:"๐ฌ๐ฆ",phoneCode:"241",short:"GA",name:"Gabon"},{emoji:"๐จ๐ฌ",phoneCode:"242",short:"CG",name:"Congo"},{emoji:"๐จ๐ฉ",phoneCode:"243",short:"CD",name:"Congo, Democratic Republic of the"},{emoji:"๐ฆ๐ด",phoneCode:"244",short:"AO",name:"Angola"},{emoji:"๐ฌ๐ผ",phoneCode:"245",short:"GW",name:"Guinea-Bissau"},{emoji:"๐ธ๐จ",phoneCode:"248",short:"SC",name:"Seychelles"},{emoji:"๐ธ๐ฉ",phoneCode:"249",short:"SD",name:"Sudan"},{emoji:"๐ท๐ผ",phoneCode:"250",short:"RW",name:"Rwanda"},{emoji:"๐ช๐น",phoneCode:"251",short:"ET",name:"Ethiopia"},{emoji:"๐ธ๐ด",phoneCode:"252",short:"SO",name:"Somalia"},{emoji:"๐ฉ๐ฏ",phoneCode:"253",short:"DJ",name:"Djibouti"},{emoji:"๐ฐ๐ช",phoneCode:"254",short:"KE",name:"Kenya"},{emoji:"๐น๐ฟ",phoneCode:"255",short:"TZ",name:"Tanzania, United Republic of"},{emoji:"๐บ๐ฌ",phoneCode:"256",short:"UG",name:"Uganda"},{emoji:"๐ง๐ฎ",phoneCode:"257",short:"BI",name:"Burundi"},{emoji:"๐ฒ๐ฟ",phoneCode:"258",short:"MZ",name:"Mozambique"},{emoji:"๐ฟ๐ฒ",phoneCode:"260",short:"ZM",name:"Zambia"},{emoji:"๐ฒ๐ฌ",phoneCode:"261",short:"MG",name:"Madagascar"},{emoji:"๐ท๐ช",phoneCode:"262",short:"RE",name:"Rรฉunion"},{emoji:"๐ฟ๐ผ",phoneCode:"263",short:"ZW",name:"Zimbabwe"},{emoji:"๐ณ๐ฆ",phoneCode:"264",short:"NA",name:"Namibia"},{emoji:"๐ฒ๐ผ",phoneCode:"265",short:"MW",name:"Malawi"},{emoji:"๐ฑ๐ธ",phoneCode:"266",short:"LS",name:"Lesotho"},{emoji:"๐ง๐ผ",phoneCode:"267",short:"BW",name:"Botswana"},{emoji:"๐ธ๐ฟ",phoneCode:"268",short:"SZ",name:"Eswatini"},{emoji:"๐ฐ๐ฒ",phoneCode:"269",short:"KM",name:"Comoros"},{emoji:"๐พ๐น",phoneCode:"262",short:"YT",name:"Mayotte"},{emoji:"๐ฟ๐ฆ",phoneCode:"27",short:"ZA",name:"South Africa"},{emoji:"๐ช๐ท",phoneCode:"291",short:"ER",name:"Eritrea"},{emoji:"๐ฆ๐ผ",phoneCode:"297",short:"AW",name:"Aruba"},{emoji:"๐ซ๐ด",phoneCode:"298",short:"FO",name:"Faroe Islands"},{emoji:"๐ฌ๐ฑ",phoneCode:"299",short:"GL",name:"Greenland"},{emoji:"๐ฌ๐ท",phoneCode:"30",short:"GR",name:"Greece"},{emoji:"๐ณ๐ฑ",phoneCode:"31",short:"NL",name:"Netherlands"},{emoji:"๐ง๐ช",phoneCode:"32",short:"BE",name:"Belgium"},{emoji:"๐ซ๐ท",phoneCode:"33",short:"FR",name:"France"},{emoji:"๐ช๐ธ",phoneCode:"34",short:"ES",name:"Spain"},{emoji:"๐ฌ๐ฎ",phoneCode:"350",short:"GI",name:"Gibraltar"},{emoji:"๐ต๐น",phoneCode:"351",short:"PT",name:"Portugal"},{emoji:"๐ฑ๐บ",phoneCode:"352",short:"LU",name:"Luxembourg"},{emoji:"๐ฎ๐ช",phoneCode:"353",short:"IE",name:"Ireland"},{emoji:"๐ฎ๐ธ",phoneCode:"354",short:"IS",name:"Iceland"},{emoji:"๐ฆ๐ฑ",phoneCode:"355",short:"AL",name:"Albania"},{emoji:"๐ฒ๐น",phoneCode:"356",short:"MT",name:"Malta"},{emoji:"๐จ๐พ",phoneCode:"357",short:"CY",name:"Cyprus"},{emoji:"๐ซ๐ฎ",phoneCode:"358",short:"FI",name:"Finland"},{emoji:"๐ง๐ฌ",phoneCode:"359",short:"BG",name:"Bulgaria"},{emoji:"๐ญ๐บ",phoneCode:"36",short:"HU",name:"Hungary"},{emoji:"๐ฑ๐น",phoneCode:"370",short:"LT",name:"Lithuania"},{emoji:"๐ฑ๐ป",phoneCode:"371",short:"LV",name:"Latvia"},{emoji:"๐ช๐ช",phoneCode:"372",short:"EE",name:"Estonia"},{emoji:"๐ฒ๐ฉ",phoneCode:"373",short:"MD",name:"Moldova, Republic of"},{emoji:"๐ฆ๐ฒ",phoneCode:"374",short:"AM",name:"Armenia"},{emoji:"๐ง๐พ",phoneCode:"375",short:"BY",name:"Belarus"},{emoji:"๐ฆ๐ฉ",phoneCode:"376",short:"AD",name:"Andorra"},{emoji:"๐ฒ๐จ",phoneCode:"377",short:"MC",name:"Monaco"},{emoji:"๐ธ๐ฒ",phoneCode:"378",short:"SM",name:"San Marino"},{emoji:"๐บ๐ฆ",phoneCode:"380",short:"UA",name:"Ukraine"},{emoji:"๐ท๐ธ",phoneCode:"381",short:"RS",name:"Serbia"},{emoji:"๐ฒ๐ช",phoneCode:"382",short:"ME",name:"Montenegro"},{emoji:"๐ญ๐ท",phoneCode:"385",short:"HR",name:"Croatia"},{emoji:"๐ธ๐ฎ",phoneCode:"386",short:"SI",name:"Slovenia"},{emoji:"๐ง๐ฆ",phoneCode:"387",short:"BA",name:"Bosnia and Herzegovina"},{emoji:"๐ฒ๐ฐ",phoneCode:"389",short:"MK",name:"North Macedonia"},{emoji:"๐ฎ๐น",phoneCode:"39",short:"IT",name:"Italy"},{emoji:"๐ท๐ด",phoneCode:"40",short:"RO",name:"Romania"},{emoji:"๐จ๐ญ",phoneCode:"41",short:"CH",name:"Switzerland"},{emoji:"๐จ๐ฟ",phoneCode:"420",short:"CZ",name:"Czechia"},{emoji:"๐ธ๐ฐ",phoneCode:"421",short:"SK",name:"Slovakia"},{emoji:"๐ฑ๐ฎ",phoneCode:"423",short:"LI",name:"Liechtenstein"},{emoji:"๐ฆ๐น",phoneCode:"43",short:"AT",name:"Austria"},{emoji:"๐ฌ๐ง",phoneCode:"44",short:"GB",name:"United Kingdom of Great Britain and Northern Ireland"},{emoji:"๐ฉ๐ฐ",phoneCode:"45",short:"DK",name:"Denmark"},{emoji:"๐ธ๐ช",phoneCode:"46",short:"SE",name:"Sweden"},{emoji:"๐ณ๐ด",phoneCode:"47",short:"NO",name:"Norway"},{emoji:"๐ต๐ฑ",phoneCode:"48",short:"PL",name:"Poland"},{emoji:"๐ฉ๐ช",phoneCode:"49",short:"DE",name:"Germany"},{emoji:"๐ง๐ฟ",phoneCode:"501",short:"BZ",name:"Belize"},{emoji:"๐ฌ๐น",phoneCode:"502",short:"GT",name:"Guatemala"},{emoji:"๐ธ๐ป",phoneCode:"503",short:"SV",name:"El Salvador"},{emoji:"๐ญ๐ณ",phoneCode:"504",short:"HN",name:"Honduras"},{emoji:"๐ณ๐ฎ",phoneCode:"505",short:"NI",name:"Nicaragua"},{emoji:"๐จ๐ท",phoneCode:"506",short:"CR",name:"Costa Rica"},{emoji:"๐ต๐ฆ",phoneCode:"507",short:"PA",name:"Panama"},{emoji:"๐ต๐ฒ",phoneCode:"508",short:"PM",name:"Saint Pierre and Miquelon"},{emoji:"๐ญ๐น",phoneCode:"509",short:"HT",name:"Haiti"},{emoji:"๐ต๐ช",phoneCode:"51",short:"PE",name:"Peru"},{emoji:"๐ฒ๐ฝ",phoneCode:"52",short:"MX",name:"Mexico"},{emoji:"๐จ๐บ",phoneCode:"53",short:"CU",name:"Cuba"},{emoji:"๐ฆ๐ท",phoneCode:"54",short:"AR",name:"Argentina"},{emoji:"๐ง๐ท",phoneCode:"55",short:"BR",name:"Brazil"},{emoji:"๐จ๐ฑ",phoneCode:"56",short:"CL",name:"Chile"},{emoji:"๐จ๐ด",phoneCode:"57",short:"CO",name:"Colombia"},{emoji:"๐ป๐ช",phoneCode:"58",short:"VE",name:"Venezuela (Bolivarian Republic of)"},{emoji:"๐ฌ๐ต",phoneCode:"590",short:"GP",name:"Guadeloupe"},{emoji:"๐ง๐ด",phoneCode:"591",short:"BO",name:"Bolivia (Plurinational State of)"},{emoji:"๐ฌ๐พ",phoneCode:"592",short:"GY",name:"Guyana"},{emoji:"๐ช๐จ",phoneCode:"593",short:"EC",name:"Ecuador"},{emoji:"๐ฌ๐ซ",phoneCode:"594",short:"GF",name:"French Guiana"},{emoji:"๐ต๐พ",phoneCode:"595",short:"PY",name:"Paraguay"},{emoji:"๐ฒ๐ถ",phoneCode:"596",short:"MQ",name:"Martinique"},{emoji:"๐ธ๐ท",phoneCode:"597",short:"SR",name:"Suriname"},{emoji:"๐บ๐พ",phoneCode:"598",short:"UY",name:"Uruguay"},{emoji:"๐จ๐ผ",phoneCode:"599",short:"CW",name:"Curaรงao"},{emoji:"๐ฒ๐พ",phoneCode:"60",short:"MY",name:"Malaysia"},{emoji:"๐ฆ๐บ",phoneCode:"61",short:"AU",name:"Australia"},{emoji:"๐ฎ๐ฉ",phoneCode:"62",short:"ID",name:"Indonesia"},{emoji:"๐ต๐ญ",phoneCode:"63",short:"PH",name:"Philippines"},{emoji:"๐ณ๐ฟ",phoneCode:"64",short:"NZ",name:"New Zealand"},{emoji:"๐ธ๐ฌ",phoneCode:"65",short:"SG",name:"Singapore"},{emoji:"๐น๐ญ",phoneCode:"66",short:"TH",name:"Thailand"},{emoji:"๐น๐ฑ",phoneCode:"670",short:"TL",name:"Timor-Leste"},{emoji:"๐ง๐ณ",phoneCode:"673",short:"BN",name:"Brunei Darussalam"},{emoji:"๐ต๐ฌ",phoneCode:"675",short:"PG",name:"Papua New Guinea"},{emoji:"๐น๐ด",phoneCode:"676",short:"TO",name:"Tonga"},{emoji:"๐ธ๐ง",phoneCode:"677",short:"SB",name:"Solomon Islands"},{emoji:"๐ป๐บ",phoneCode:"678",short:"VU",name:"Vanuatu"},{emoji:"๐ซ๐ฏ",phoneCode:"679",short:"FJ",name:"Fiji"},{emoji:"๐ต๐ผ",phoneCode:"680",short:"PW",name:"Palau"},{emoji:"๐จ๐ฐ",phoneCode:"682",short:"CK",name:"Cook Islands"},{emoji:"๐ผ๐ธ",phoneCode:"685",short:"WS",name:"Samoa"},{emoji:"๐ฐ๐ฎ",phoneCode:"686",short:"KI",name:"Kiribati"},{emoji:"๐ณ๐จ",phoneCode:"687",short:"NC",name:"New Caledonia"},{emoji:"๐ต๐ซ",phoneCode:"689",short:"PF",name:"French Polynesia"},{emoji:"๐ฐ๐ฟ",phoneCode:"7",short:"KZ",name:"Kazakhstan"},{emoji:"๐ท๐บ",phoneCode:"7",short:"RU",name:"Russian Federation"},{emoji:"๐ฏ๐ต",phoneCode:"81",short:"JP",name:"Japan"},{emoji:"๐ฐ๐ท",phoneCode:"82",short:"KR",name:"Korea, Republic of"},{emoji:"๐ป๐ณ",phoneCode:"84",short:"VN",name:"Viet Nam"},{emoji:"๐ญ๐ฐ",phoneCode:"852",short:"HK",name:"Hong Kong"},{emoji:"๐ฒ๐ด",phoneCode:"853",short:"MO",name:"Macao"},{emoji:"๐ฐ๐ญ",phoneCode:"855",short:"KH",name:"Cambodia"},{emoji:"๐ฑ๐ฆ",phoneCode:"856",short:"LA",name:"Lao People's Democratic Republic"},{emoji:"๐จ๐ณ",phoneCode:"86",short:"CN",name:"China"},{emoji:"๐ง๐ฉ",phoneCode:"880",short:"BD",name:"Bangladesh"},{emoji:"๐น๐ผ",phoneCode:"886",short:"TW",name:"Taiwan, Province of China"},{emoji:"๐น๐ท",phoneCode:"90",short:"TR",name:"Turkey"},{emoji:"๐ฎ๐ณ",phoneCode:"91",short:"IN",name:"India"},{emoji:"๐ต๐ฐ",phoneCode:"92",short:"PK",name:"Pakistan"},{emoji:"๐ฆ๐ซ",phoneCode:"93",short:"AF",name:"Afghanistan"},{emoji:"๐ฑ๐ฐ",phoneCode:"94",short:"LK",name:"Sri Lanka"},{emoji:"๐ฒ๐ฒ",phoneCode:"95",short:"MM",name:"Myanmar"},{emoji:"๐ฒ๐ป",phoneCode:"960",short:"MV",name:"Maldives"},{emoji:"๐ฑ๐ง",phoneCode:"961",short:"LB",name:"Lebanon"},{emoji:"๐ฏ๐ด",phoneCode:"962",short:"JO",name:"Jordan"},{emoji:"๐ธ๐พ",phoneCode:"963",short:"SY",name:"Syrian Arab Republic"},{emoji:"๐ฎ๐ถ",phoneCode:"964",short:"IQ",name:"Iraq"},{emoji:"๐ฐ๐ผ",phoneCode:"965",short:"KW",name:"Kuwait"},{emoji:"๐ธ๐ฆ",phoneCode:"966",short:"SA",name:"Saudi Arabia"},{emoji:"๐พ๐ช",phoneCode:"967",short:"YE",name:"Yemen"},{emoji:"๐ด๐ฒ",phoneCode:"968",short:"OM",name:"Oman"},{emoji:"๐ต๐ธ",phoneCode:"590",short:"BL",name:"Saint Barthรฉlemy"},{emoji:"๐ฆ๐ช",phoneCode:"971",short:"AE",name:"United Arab Emirates"},{emoji:"๐ฎ๐ฑ",phoneCode:"972",short:"IL",name:"Israel"},{emoji:"๐ง๐ญ",phoneCode:"973",short:"BH",name:"Bahrain"},{emoji:"๐ถ๐ฆ",phoneCode:"974",short:"QA",name:"Qatar"},{emoji:"๐ง๐น",phoneCode:"975",short:"BT",name:"Bhutan"},{emoji:"๐ฒ๐ณ",phoneCode:"976",short:"MN",name:"Mongolia"},{emoji:"๐ณ๐ต",phoneCode:"977",short:"NP",name:"Nepal"},{emoji:"๐ฎ๐ท",phoneCode:"98",short:"IR",name:"Iran (Islamic Republic of)"},{emoji:"๐น๐ฏ",phoneCode:"992",short:"TJ",name:"Tajikistan"},{emoji:"๐น๐ฒ",phoneCode:"993",short:"TM",name:"Turkmenistan"},{emoji:"๐ฆ๐ฟ",phoneCode:"994",short:"AZ",name:"Azerbaijan"},{emoji:"๐ฌ๐ช",phoneCode:"995",short:"GE",name:"Georgia"},{emoji:"๐ฐ๐ฌ",phoneCode:"996",short:"KG",name:"Kyrgyzstan"},{emoji:"๐บ๐ฟ",phoneCode:"998",short:"UZ",name:"Uzbekistan"}],yAt="",gJe={"option-list":"_option-list_y65d5_1","option-item":"_option-item_y65d5_17"},Fre=n=>"".concat(n.short," +").concat(n.phoneCode),vJe=n=>{const[e,t]=n==null?void 0:n.split(" ");return{areaShortName:e,phoneCode:t}},yJe=n=>{let{defaultArea:e,onSelectArea:t}=n;const[r,i]=Le.useState(),o=async l=>{const{areaShortName:u}=vJe(l);i(l),t(U0.find(c=>c.short===u))};return Le.useEffect(()=>{let l="";return U0.sort((u,c)=>u.name<c.name?-1:1),U0.forEach(u=>{u.short===e.short&&(l=Fre(u))}),i(l),()=>i("")},[e]),Qe.jsx(IR,{showArrow:!0,showSearch:!0,"data-testid":"phone-code-select",style:{width:120},dropdownMatchSelectWidth:!1,bordered:!1,optionLabelProp:"label",filterOption:(l,u)=>{var c;return(u==null||(c=u.key)===null||c===void 0||(c=c.toString())===null||c===void 0?void 0:c.toLocaleLowerCase()).includes(l==null?void 0:l.toLocaleLowerCase())},onSelect:o,value:r,placement:"topLeft",children:U0.map(l=>{const u=Fre(l),c="".concat(l.name," +").concat(l.phoneCode);return Qe.jsxs(IR.Option,{value:u,label:Qe.jsx("div",{className:gJe["option-item"],children:Qe.jsx("span",{children:"".concat(l.emoji," +").concat(l.phoneCode)})},c),children:[l.emoji," ",c]},c)})})},Bre=n=>{let{sendCircleButtonProps:e,onSend:t,onChange:r,defaultValue:i,defaultArea:o,onSelectArea:l,allowPaste:u,renderCancelEditButton:c,placeholder:d}=n;const f=Le.useRef(null),[h,m]=Le.useState(""),p=Le.useRef(null);uA(p),Le.useEffect(()=>{m(i),f!=null&&f.current&&f.current.focus()},[i]);const g=y=>{var b,E;r&&r(y==null||(b=y.target)===null||b===void 0?void 0:b.value),m(y==null||(E=y.target)===null||E===void 0?void 0:E.value)},v=Le.useCallback(async()=>{if(!(!h||h.trim().length===0)&&t&&typeof t=="function"){const y=await t(h);y!=null&&y.success&&(m(""),f.current&&f.current.focus())}},[h,t]);return oA(v),Qe.jsxs(Qe.Fragment,{children:[c(),Qe.jsxs("div",{"data-testid":"phone-editor",className:"phone-editor__container",ref:p,children:[Qe.jsxs("div",{className:"phone-editor__wrapper ",children:[Qe.jsx(yJe,{onSelectArea:l,defaultArea:o}),Qe.jsx(Wu,{"data-testid":"text-editor",value:h,ref:y=>{y==null||y.focus(),f.current=y},className:"phone-editor",draggable:!1,placeholder:d,onChange:g,onPaste:y=>{if(!u)return y.preventDefault(),!1},inputMode:"tel"})]}),Qe.jsx(lA,_objectSpread3({onClick:v,backgroundColor:"#ffffff"},e))]})]})},X9=n=>{let{sendCircleButtonProps:e,onSend:t,onChange:r,wordCountRule:i,hideClickableBar:o,isSendButtonShown:l=!0,initialValue:u}=n;const c=yi.getInstance(),{isMobile:d}=Lre(),{chatbotState:f,isInternalUser:h,handleExitEditAnswer:m}=is(),{theme:p,currentMessageBubble:g,messageBubbleList:v,region:y,phChatBotCallback:b,assessmentId:E}=f,_=ap(g.status),T=g.questionId,[D,x]=Le.useState(u||""),[C,S]=Le.useState(!1),[A,w]=Le.useState(()=>{const We=U0.find(F=>F.short===f.candidateCountryCode);return We||(DX.has(y)?DX.get(y):DBe)}),{getItem:k,setItem:P}=jE({key:kh.DO_NOT_SHOW_LESS_WORD_COUNT_POP_UP_AGAIN});let O;v==null||v.forEach(We=>{if(We.questionId===T&&We.sender===Co.CANDIDATE){var de;O=(de=We.data)===null||de===void 0?void 0:de.messageItems[0].contents[0].text}});const z=g==null?void 0:g.piiQuestionType,G=CKe(z),W=DKe(z),oe=ene(z),ye=tne(z),be=nne(z),Q=rne(z),I=wKe(g);Le.useEffect(()=>{const We=de=>{de.key===SX&&m()};return window.addEventListener("keydown",We),()=>{window.removeEventListener("keydown",We)}},[m]),Le.useEffect(()=>{if(!_)x(u||"");else if(G){const We=Gne(O);w(U0.find(de=>de.short===(We==null?void 0:We.country))),x(We==null?void 0:We.nationalNumber)}else x(O)},[O,_,G,u]);const q=We=>{var de;We=(de=We)===null||de===void 0?void 0:de.trim();let F=!1,M="";if(W)Kb.isEmail(We)||(F=!0,M=c.translate("fi_error_piiEmail"));else if(oe){var ee;const me=(ee=We)===null||ee===void 0?void 0:ee.split(" ");(me.length<1||me.length>100)&&(F=!0,M=c.translate("fi_error_piiFullName"))}else if(ye){var le;const me=(le=We)===null||le===void 0?void 0:le.split(" ");(me.length<1||me.length>50)&&(F=!0,M=c.translate("fi_error_piiFirstName"))}else if(be){var ge;const me=(ge=We)===null||ge===void 0?void 0:ge.split(" ");(me.length<1||me.length>50)&&(F=!0,M=c.translate("fi_error_piiLastName"))}else if(G){const me=Gne("".concat(A.phoneCode," ").concat(We),A.short);me!=null&&me.isValid()?We=me.number:(F=!0,M=c.translate("fi_error_piiPhoneNumber"),me!=null&&me.isPossible()&&cf({cb:b.CHATBOT_LOG,payload:{chatbotLogType:Hc.INVALID_PHONE_NUMBER,params:{phoneNumber:me,phoneNumberText:We,phoneNumberArea:A}}}))}if(F){vh.error({title:M,okText:c.translate("fi_button_edit")});return}return t==null?void 0:t(We)},ae=We=>{var de,F,M,ee,le;let{handleContinueBtnClick:ge}=We;return Qe.jsxs(vh,{title:Qe.jsx(co,{children:c.translate("fi_error_notEnoughWords",{minWordCount:i.min})}),visible:C,footer:null,closable:!1,children:[Qe.jsx(co,{children:i.recommend?c.translate("fi_error_notEnoughWordsAim",{minWordCount:i.min,recommendedWordCount:i.recommend}):c.translate("fi_error_notEnoughWordsMin",{minWordCount:i.min})}),Qe.jsx("p",{children:c.translate("fi_error_notEnoughWordsEdit")}),Qe.jsx("p",{children:c.translate("fi_error_notEnoughWordsEditNow")}),Qe.jsxs("div",{style:{display:"flex",justifyContent:"center"},children:[Qe.jsx(Fa,{onClick:()=>S(!1),style:{border:"none",backgroundColor:p==null||(de=p.button)===null||de===void 0?void 0:de.backgroundColor,color:p==null||(F=p.button)===null||F===void 0?void 0:F.fontColor,margin:"10px 5px",width:130},children:c.translate("fi_button_edit")}),Qe.jsx(Fa,{onClick:()=>{ge(),S(!1)},style:{border:"1px solid ".concat(p==null||(M=p.button)===null||M===void 0?void 0:M.backgroundColor),backgroundColor:p==null||(ee=p.button)===null||ee===void 0?void 0:ee.fontColor,color:p==null||(le=p.button)===null||le===void 0?void 0:le.backgroundColor,margin:"10px 5px",width:130},children:c.translate("fi_button_continue")})]}),Qe.jsx("div",{style:{display:"flex",justifyContent:"center"},children:Qe.jsx(Zwe,{onChange:me=>P({value:me.target.checked}),children:c.translate("fi_check_dontShow")})})]})},pe=k(),te=We=>{let{words:de}=We;de<=i.min&&S(!0)},X=(v==null?void 0:v.some(We=>{var de;return We.questionId===T&&We.sender===Co.AGENT&&((de=We.data)===null||de===void 0||(de=de.tags)===null||de===void 0?void 0:de.some(F=>(F==null?void 0:F.name)===_b.ALLOW_PASTE&&(F==null?void 0:F.value)==="true"))}))||h,U=I?c.translate("fi_label_enterOrSkipFeedback"):X?c.translate("fi_label_enterOrPasteResponse"):c.translate("fi_label_enterResponse"),B=c.translate("fi_placeholder_demoEmailInput");let L="text";W?L="email":Q&&(L="search");const $=()=>Qe.jsx(lJe,{isSendButtonShown:l,placeholder:U,onSend:q,sendCircleButtonProps:e,defaultValue:D,onChange:r,wordCountRule:i,renderConfirmModal:ae,doNotShowAgain:pe,handleSendButtonClickCallBack:te,allowPaste:X,renderCancelEditButton:K,assessmentId:E,theme:p,onExtractHumanNameFailedCallback:b==null?void 0:b[Ra.CHATBOT_ERROR],piiQuestionType:z}),K=We=>_?Qe.jsx(uJe,{onClick:()=>{We&&We(),m()},children:d?c.translate("fi_label_cancelEditMobile"):c.translate("fi_label_cancelEditDesktop")}):null,Y=()=>G?Qe.jsx(Bre,{onSelectArea:We=>w(We),defaultArea:A,onSend:q,sendCircleButtonProps:_objectSpread3({size:57,iconSize:22},e),defaultValue:D,onChange:r,allowPaste:X,renderCancelEditButton:K,placeholder:U}):ye||be||oe?$():W||Q?Qe.jsx(W9,{isSendButtonShown:l,placeholder:W?B:U,onSend:q,sendCircleButtonProps:e,defaultValue:D,onChange:r,wordCountRule:i,renderConfirmModal:ae,doNotShowAgain:pe,handleSendButtonClickCallBack:te,enableSubmitShortcut:!0,allowPaste:X,renderCancelEditButton:K,inputMode:L}):I?Qe.jsx(Pre,{isSendButtonShown:l,placeholder:U,onSend:We=>q(We||u6),sendCircleButtonProps:e,defaultValue:D,onChange:r,wordCountRule:null,renderConfirmModal:ae,doNotShowAgain:pe,handleSendButtonClickCallBack:te,allowPaste:X,renderCancelEditButton:K,allowSubmitWithoutText:!0,phChatBotCallback:b}):Qe.jsx(Pre,{isSendButtonShown:l,placeholder:U,onSend:q,sendCircleButtonProps:e,defaultValue:D,onChange:r,wordCountRule:i,renderConfirmModal:ae,doNotShowAgain:pe,handleSendButtonClickCallBack:te,allowPaste:X,renderCancelEditButton:K,phChatBotCallback:b}),xe=()=>G?Qe.jsx(Bre,{onSelectArea:We=>w(We),defaultArea:A,onSend:q,sendCircleButtonProps:_objectSpread3({size:45,iconSize:25},e),defaultValue:D,onChange:r,allowPaste:X,renderCancelEditButton:K,placeholder:U}):ye||be||oe?$():W||Q?Qe.jsx(W9,{isSendButtonShown:l,placeholder:W?B:U,onSend:q,sendCircleButtonProps:e,defaultValue:D,onChange:r,wordCountRule:i,renderConfirmModal:ae,doNotShowAgain:pe,handleSendButtonClickCallBack:te,enableSubmitShortcut:!0,allowPaste:X,renderCancelEditButton:K,inputMode:L}):I?Qe.jsx(Mre,{isEditing:_,hideClickableBar:o,isSendButtonShown:l,placeholder:U,onSend:We=>q(We||u6),sendCircleButtonProps:e,defaultValue:D,onChange:r,wordCountRule:null,renderConfirmModal:ae,doNotShowAgain:pe,handleSendButtonClickCallBack:te,allowPaste:X,renderCancelEditButton:K,phChatBotCallback:b,allowSubmitWithoutText:!0}):Qe.jsx(Mre,{isEditing:_,hideClickableBar:o,isSendButtonShown:l,placeholder:U,onSend:q,sendCircleButtonProps:e,defaultValue:D,onChange:r,wordCountRule:i,renderConfirmModal:ae,doNotShowAgain:pe,handleSendButtonClickCallBack:te,allowPaste:X,renderCancelEditButton:K,phChatBotCallback:b});return d?xe():Y()},Ure="AIzaSyCWSAROQu-uLQmQ-fq0ip7aXHpBjPESaQQ",jre="https://places.googleapis.com/v1",bJe="".concat(jre,"/places:autocomplete"),EJe="".concat(jre,"/places"),_Je=500,TJe="en",SJe=["suggestions.placePrediction.placeId","suggestions.placePrediction.text","suggestions.placePrediction.structuredFormat.mainText","suggestions.placePrediction.structuredFormat.secondaryText"].join(","),CJe=["id","formattedAddress","location","displayName"].join(","),DJe=async(n,e)=>n.trim()?((await Ym.post(bJe,{input:n,languageCode:TJe},{headers:{"Content-Type":"application/json","X-Goog-Api-Key":Ure,"X-Goog-FieldMask":SJe},signal:e})).data.suggestions||[]).map(r=>{var i,o;return{placeId:r.placePrediction.placeId,description:r.placePrediction.text.text,mainText:((i=r.placePrediction.structuredFormat)===null||i===void 0||(i=i.mainText)===null||i===void 0?void 0:i.text)||"",secondaryText:((o=r.placePrediction.structuredFormat)===null||o===void 0||(o=o.secondaryText)===null||o===void 0?void 0:o.text)||""}}):[],AJe=async n=>{var e;const t=await Ym.get("".concat(EJe,"/").concat(n),{headers:{"X-Goog-Api-Key":Ure,"X-Goog-FieldMask":CJe}});return{placeId:t.data.id,formattedAddress:t.data.formattedAddress,location:{lat:t.data.location.latitude,lng:t.data.location.longitude},displayName:(e=t.data.displayName)===null||e===void 0?void 0:e.text}},wJe=n=>Ym.isCancel(n)||(n==null?void 0:n.name)==="AbortError",xJe=()=>{const[n,e]=Le.useState([]),[t,r]=Le.useState(!1),[i,o]=Le.useState(null),l=Le.useRef(null),u=Le.useRef(null);Le.useEffect(()=>()=>{l.current&&clearTimeout(l.current),u.current&&u.current.abort()},[]);const c=Le.useCallback(async m=>{u.current&&u.current.abort(),u.current=new AbortController,r(!0),o(null);try{var p;const g=await DJe(m,(p=u.current)===null||p===void 0?void 0:p.signal);e(g)}catch(g){if(wJe(g))return;const v=g instanceof Error?g.message:"Failed to fetch suggestions";o(v),e([])}finally{r(!1)}},[]),d=Le.useCallback(m=>{if(l.current&&clearTimeout(l.current),!m.trim()){e([]);return}l.current=setTimeout(()=>{c(m)},_Je)},[c]),f=async m=>{try{return await AJe(m)}catch(p){const g=p instanceof Error?p.message:"Failed to fetch place details";return o(g),null}},h=Le.useCallback(()=>{e([]),o(null)},[]);return{suggestions:n,isLoading:t,error:i,getSuggestions:d,getPlaceDetails:f,clearSuggestions:h}},$re={"option-list":"_option-list_was2b_1","option-item":"_option-item_was2b_16"},kJe=n=>{let{onSelectLocation:e,wordCountRule:t,sendCircleButtonProps:r}=n;const[i,o]=Le.useState(),[l,u]=Le.useState(""),[c,d]=Le.useState(!1),{suggestions:f,getSuggestions:h,getPlaceDetails:m,clearSuggestions:p,error:g}=xJe();Le.useEffect(()=>{g&&!c&&d(!0)},[g,c]);const v=_=>{!i&&!c&&(u(_),h(_))},y=async _=>{const T={address:_,coordinate:null};return o(T),e?await e(T):{success:!0}},b=async _=>{const T=await m(_.placeId);if(T){const D={address:T.formattedAddress||_.description,coordinate:T.location};o(D),p(),e&&await e(D)}},E=()=>f.length?Qe.jsx("div",{className:$re["option-list"],children:f.map(_=>Qe.jsx("div",{className:$re["option-item"],onClick:()=>b(_),children:Qe.jsx("span",{children:_.description})},_.placeId))}):null;return c?Qe.jsx(X9,{isSendButtonShown:!0,sendCircleButtonProps:r,wordCountRule:t,onChange:v,onSend:y,initialValue:l}):Qe.jsx(hG,{visible:f.length>0,placement:"top",content:E,trigger:[],children:Qe.jsx(X9,{isSendButtonShown:!1,sendCircleButtonProps:r,wordCountRule:t,onChange:v})})},bAt="",EAt="";let zre=!0,qre=!0;function $E(n,e,t){const r=n.match(e);return r&&r.length>=t&&parseFloat(r[t],10)}function lp(n,e,t){if(!n.RTCPeerConnection)return;const r=n.RTCPeerConnection.prototype,i=r.addEventListener;r.addEventListener=function(l,u){if(l!==e)return i.apply(this,arguments);const c=d=>{const f=t(d);f&&(u.handleEvent?u.handleEvent(f):u(f))};return this._eventMap=this._eventMap||{},this._eventMap[e]||(this._eventMap[e]=new Map),this._eventMap[e].set(u,c),i.apply(this,[l,c])};const o=r.removeEventListener;r.removeEventListener=function(l,u){if(l!==e||!this._eventMap||!this._eventMap[e])return o.apply(this,arguments);if(!this._eventMap[e].has(u))return o.apply(this,arguments);const c=this._eventMap[e].get(u);return this._eventMap[e].delete(u),this._eventMap[e].size===0&&delete this._eventMap[e],Object.keys(this._eventMap).length===0&&delete this._eventMap,o.apply(this,[l,c])},Object.defineProperty(r,"on"+e,{get(){return this["_on"+e]},set(l){this["_on"+e]&&(this.removeEventListener(e,this["_on"+e]),delete this["_on"+e]),l&&this.addEventListener(e,this["_on"+e]=l)},enumerable:!0,configurable:!0})}function IJe(n){return typeof n!="boolean"?new Error("Argument type: "+typeof n+". Please use a boolean."):(zre=n,n?"adapter.js logging disabled":"adapter.js logging enabled")}function RJe(n){return typeof n!="boolean"?new Error("Argument type: "+typeof n+". Please use a boolean."):(qre=!n,"adapter.js deprecation warnings "+(n?"disabled":"enabled"))}function Hre(){if(typeof window=="object"){if(zre)return;typeof console!="undefined"&&typeof console.log=="function"&&console.log.apply(console,arguments)}}function Q9(n,e){qre&&console.warn(n+" is deprecated, please use "+e+" instead.")}function PJe(n){const e={browser:null,version:null};if(typeof n=="undefined"||!n.navigator||!n.navigator.userAgent)return e.browser="Not a browser.",e;const{navigator:t}=n;if(t.userAgentData&&t.userAgentData.brands){const r=t.userAgentData.brands.find(i=>i.brand==="Chromium");if(r)return{browser:"chrome",version:parseInt(r.version,10)}}if(t.mozGetUserMedia)e.browser="firefox",e.version=parseInt($E(t.userAgent,/Firefox\/(\d+)\./,1));else if(t.webkitGetUserMedia||n.isSecureContext===!1&&n.webkitRTCPeerConnection)e.browser="chrome",e.version=parseInt($E(t.userAgent,/Chrom(e|ium)\/(\d+)\./,2));else if(n.RTCPeerConnection&&t.userAgent.match(/AppleWebKit\/(\d+)\./))e.browser="safari",e.version=parseInt($E(t.userAgent,/AppleWebKit\/(\d+)\./,1)),e.supportsUnifiedPlan=n.RTCRtpTransceiver&&"currentDirection"in n.RTCRtpTransceiver.prototype,e._safariVersion=$E(t.userAgent,/Version\/(\d+(\.?\d+))/,1);else return e.browser="Not a supported browser.",e;return e}function Vre(n){return Object.prototype.toString.call(n)==="[object Object]"}function Gre(n){return Vre(n)?Object.keys(n).reduce(function(e,t){const r=Vre(n[t]),i=r?Gre(n[t]):n[t],o=r&&!Object.keys(i).length;return i===void 0||o?e:Object.assign(e,{[t]:i})},{}):n}function Z9(n,e,t){!e||t.has(e.id)||(t.set(e.id,e),Object.keys(e).forEach(r=>{r.endsWith("Id")?Z9(n,n.get(e[r]),t):r.endsWith("Ids")&&e[r].forEach(i=>{Z9(n,n.get(i),t)})}))}function Wre(n,e,t){const r=t?"outbound-rtp":"inbound-rtp",i=new Map;if(e===null)return i;const o=[];return n.forEach(l=>{l.type==="track"&&l.trackIdentifier===e.id&&o.push(l)}),o.forEach(l=>{n.forEach(u=>{u.type===r&&u.trackId===l.id&&Z9(n,u,i)})}),i}const Kre=Hre;function Yre(n,e){const t=n&&n.navigator;if(!t.mediaDevices)return;const r=function(u){if(typeof u!="object"||u.mandatory||u.optional)return u;const c={};return Object.keys(u).forEach(d=>{if(d==="require"||d==="advanced"||d==="mediaSource")return;const f=typeof u[d]=="object"?u[d]:{ideal:u[d]};f.exact!==void 0&&typeof f.exact=="number"&&(f.min=f.max=f.exact);const h=function(m,p){return m?m+p.charAt(0).toUpperCase()+p.slice(1):p==="deviceId"?"sourceId":p};if(f.ideal!==void 0){c.optional=c.optional||[];let m={};typeof f.ideal=="number"?(m[h("min",d)]=f.ideal,c.optional.push(m),m={},m[h("max",d)]=f.ideal,c.optional.push(m)):(m[h("",d)]=f.ideal,c.optional.push(m))}f.exact!==void 0&&typeof f.exact!="number"?(c.mandatory=c.mandatory||{},c.mandatory[h("",d)]=f.exact):["min","max"].forEach(m=>{f[m]!==void 0&&(c.mandatory=c.mandatory||{},c.mandatory[h(m,d)]=f[m])})}),u.advanced&&(c.optional=(c.optional||[]).concat(u.advanced)),c},i=function(u,c){if(e.version>=61)return c(u);if(u=JSON.parse(JSON.stringify(u)),u&&typeof u.audio=="object"){const d=function(f,h,m){h in f&&!(m in f)&&(f[m]=f[h],delete f[h])};u=JSON.parse(JSON.stringify(u)),d(u.audio,"autoGainControl","googAutoGainControl"),d(u.audio,"noiseSuppression","googNoiseSuppression"),u.audio=r(u.audio)}if(u&&typeof u.video=="object"){let d=u.video.facingMode;d=d&&(typeof d=="object"?d:{ideal:d});const f=e.version<66;if(d&&(d.exact==="user"||d.exact==="environment"||d.ideal==="user"||d.ideal==="environment")&&!(t.mediaDevices.getSupportedConstraints&&t.mediaDevices.getSupportedConstraints().facingMode&&!f)){delete u.video.facingMode;let h;if(d.exact==="environment"||d.ideal==="environment"?h=["back","rear"]:(d.exact==="user"||d.ideal==="user")&&(h=["front"]),h)return t.mediaDevices.enumerateDevices().then(m=>{m=m.filter(g=>g.kind==="videoinput");let p=m.find(g=>h.some(v=>g.label.toLowerCase().includes(v)));return!p&&m.length&&h.includes("back")&&(p=m[m.length-1]),p&&(u.video.deviceId=d.exact?{exact:p.deviceId}:{ideal:p.deviceId}),u.video=r(u.video),Kre("chrome: "+JSON.stringify(u)),c(u)})}u.video=r(u.video)}return Kre("chrome: "+JSON.stringify(u)),c(u)},o=function(u){return e.version>=64?u:{name:{PermissionDeniedError:"NotAllowedError",PermissionDismissedError:"NotAllowedError",InvalidStateError:"NotAllowedError",DevicesNotFoundError:"NotFoundError",ConstraintNotSatisfiedError:"OverconstrainedError",TrackStartError:"NotReadableError",MediaDeviceFailedDueToShutdown:"NotAllowedError",MediaDeviceKillSwitchOn:"NotAllowedError",TabCaptureError:"AbortError",ScreenCaptureError:"AbortError",DeviceCaptureError:"AbortError"}[u.name]||u.name,message:u.message,constraint:u.constraint||u.constraintName,toString(){return this.name+(this.message&&": ")+this.message}}},l=function(u,c,d){i(u,f=>{t.webkitGetUserMedia(f,c,h=>{d&&d(o(h))})})};if(t.getUserMedia=l.bind(t),t.mediaDevices.getUserMedia){const u=t.mediaDevices.getUserMedia.bind(t.mediaDevices);t.mediaDevices.getUserMedia=function(c){return i(c,d=>u(d).then(f=>{if(d.audio&&!f.getAudioTracks().length||d.video&&!f.getVideoTracks().length)throw f.getTracks().forEach(h=>{h.stop()}),new DOMException("","NotFoundError");return f},f=>Promise.reject(o(f))))}}}function Xre(n){n.MediaStream=n.MediaStream||n.webkitMediaStream}function Qre(n){if(typeof n=="object"&&n.RTCPeerConnection&&!("ontrack"in n.RTCPeerConnection.prototype)){Object.defineProperty(n.RTCPeerConnection.prototype,"ontrack",{get(){return this._ontrack},set(t){this._ontrack&&this.removeEventListener("track",this._ontrack),this.addEventListener("track",this._ontrack=t)},enumerable:!0,configurable:!0});const e=n.RTCPeerConnection.prototype.setRemoteDescription;n.RTCPeerConnection.prototype.setRemoteDescription=function(){return this._ontrackpoly||(this._ontrackpoly=r=>{r.stream.addEventListener("addtrack",i=>{let o;n.RTCPeerConnection.prototype.getReceivers?o=this.getReceivers().find(u=>u.track&&u.track.id===i.track.id):o={track:i.track};const l=new Event("track");l.track=i.track,l.receiver=o,l.transceiver={receiver:o},l.streams=[r.stream],this.dispatchEvent(l)}),r.stream.getTracks().forEach(i=>{let o;n.RTCPeerConnection.prototype.getReceivers?o=this.getReceivers().find(u=>u.track&&u.track.id===i.id):o={track:i};const l=new Event("track");l.track=i,l.receiver=o,l.transceiver={receiver:o},l.streams=[r.stream],this.dispatchEvent(l)})},this.addEventListener("addstream",this._ontrackpoly)),e.apply(this,arguments)}}else lp(n,"track",e=>(e.transceiver||Object.defineProperty(e,"transceiver",{value:{receiver:e.receiver}}),e))}function Zre(n){if(typeof n=="object"&&n.RTCPeerConnection&&!("getSenders"in n.RTCPeerConnection.prototype)&&"createDTMFSender"in n.RTCPeerConnection.prototype){const e=function(i,o){return{track:o,get dtmf(){return this._dtmf===void 0&&(o.kind==="audio"?this._dtmf=i.createDTMFSender(o):this._dtmf=null),this._dtmf},_pc:i}};if(!n.RTCPeerConnection.prototype.getSenders){n.RTCPeerConnection.prototype.getSenders=function(){return this._senders=this._senders||[],this._senders.slice()};const i=n.RTCPeerConnection.prototype.addTrack;n.RTCPeerConnection.prototype.addTrack=function(u,c){let d=i.apply(this,arguments);return d||(d=e(this,u),this._senders.push(d)),d};const o=n.RTCPeerConnection.prototype.removeTrack;n.RTCPeerConnection.prototype.removeTrack=function(u){o.apply(this,arguments);const c=this._senders.indexOf(u);c!==-1&&this._senders.splice(c,1)}}const t=n.RTCPeerConnection.prototype.addStream;n.RTCPeerConnection.prototype.addStream=function(o){this._senders=this._senders||[],t.apply(this,[o]),o.getTracks().forEach(l=>{this._senders.push(e(this,l))})};const r=n.RTCPeerConnection.prototype.removeStream;n.RTCPeerConnection.prototype.removeStream=function(o){this._senders=this._senders||[],r.apply(this,[o]),o.getTracks().forEach(l=>{const u=this._senders.find(c=>c.track===l);u&&this._senders.splice(this._senders.indexOf(u),1)})}}else if(typeof n=="object"&&n.RTCPeerConnection&&"getSenders"in n.RTCPeerConnection.prototype&&"createDTMFSender"in n.RTCPeerConnection.prototype&&n.RTCRtpSender&&!("dtmf"in n.RTCRtpSender.prototype)){const e=n.RTCPeerConnection.prototype.getSenders;n.RTCPeerConnection.prototype.getSenders=function(){const r=e.apply(this,[]);return r.forEach(i=>i._pc=this),r},Object.defineProperty(n.RTCRtpSender.prototype,"dtmf",{get(){return this._dtmf===void 0&&(this.track.kind==="audio"?this._dtmf=this._pc.createDTMFSender(this.track):this._dtmf=null),this._dtmf}})}}function Jre(n){if(!(typeof n=="object"&&n.RTCPeerConnection&&n.RTCRtpSender&&n.RTCRtpReceiver))return;if(!("getStats"in n.RTCRtpSender.prototype)){const t=n.RTCPeerConnection.prototype.getSenders;t&&(n.RTCPeerConnection.prototype.getSenders=function(){const o=t.apply(this,[]);return o.forEach(l=>l._pc=this),o});const r=n.RTCPeerConnection.prototype.addTrack;r&&(n.RTCPeerConnection.prototype.addTrack=function(){const o=r.apply(this,arguments);return o._pc=this,o}),n.RTCRtpSender.prototype.getStats=function(){const o=this;return this._pc.getStats().then(l=>Wre(l,o.track,!0))}}if(!("getStats"in n.RTCRtpReceiver.prototype)){const t=n.RTCPeerConnection.prototype.getReceivers;t&&(n.RTCPeerConnection.prototype.getReceivers=function(){const i=t.apply(this,[]);return i.forEach(o=>o._pc=this),i}),lp(n,"track",r=>(r.receiver._pc=r.srcElement,r)),n.RTCRtpReceiver.prototype.getStats=function(){const i=this;return this._pc.getStats().then(o=>Wre(o,i.track,!1))}}if(!("getStats"in n.RTCRtpSender.prototype&&"getStats"in n.RTCRtpReceiver.prototype))return;const e=n.RTCPeerConnection.prototype.getStats;n.RTCPeerConnection.prototype.getStats=function(){if(arguments.length>0&&arguments[0]instanceof n.MediaStreamTrack){const r=arguments[0];let i,o,l;return this.getSenders().forEach(u=>{u.track===r&&(i?l=!0:i=u)}),this.getReceivers().forEach(u=>(u.track===r&&(o?l=!0:o=u),u.track===r)),l||i&&o?Promise.reject(new DOMException("There are more than one sender or receiver for the track.","InvalidAccessError")):i?i.getStats():o?o.getStats():Promise.reject(new DOMException("There is no sender or receiver for the track.","InvalidAccessError"))}return e.apply(this,arguments)}}function eie(n){n.RTCPeerConnection.prototype.getLocalStreams=function(){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},Object.keys(this._shimmedLocalStreams).map(l=>this._shimmedLocalStreams[l][0])};const e=n.RTCPeerConnection.prototype.addTrack;n.RTCPeerConnection.prototype.addTrack=function(l,u){if(!u)return e.apply(this,arguments);this._shimmedLocalStreams=this._shimmedLocalStreams||{};const c=e.apply(this,arguments);return this._shimmedLocalStreams[u.id]?this._shimmedLocalStreams[u.id].indexOf(c)===-1&&this._shimmedLocalStreams[u.id].push(c):this._shimmedLocalStreams[u.id]=[u,c],c};const t=n.RTCPeerConnection.prototype.addStream;n.RTCPeerConnection.prototype.addStream=function(l){this._shimmedLocalStreams=this._shimmedLocalStreams||{},l.getTracks().forEach(d=>{if(this.getSenders().find(h=>h.track===d))throw new DOMException("Track already exists.","InvalidAccessError")});const u=this.getSenders();t.apply(this,arguments);const c=this.getSenders().filter(d=>u.indexOf(d)===-1);this._shimmedLocalStreams[l.id]=[l].concat(c)};const r=n.RTCPeerConnection.prototype.removeStream;n.RTCPeerConnection.prototype.removeStream=function(l){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},delete this._shimmedLocalStreams[l.id],r.apply(this,arguments)};const i=n.RTCPeerConnection.prototype.removeTrack;n.RTCPeerConnection.prototype.removeTrack=function(l){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},l&&Object.keys(this._shimmedLocalStreams).forEach(u=>{const c=this._shimmedLocalStreams[u].indexOf(l);c!==-1&&this._shimmedLocalStreams[u].splice(c,1),this._shimmedLocalStreams[u].length===1&&delete this._shimmedLocalStreams[u]}),i.apply(this,arguments)}}function tie(n,e){if(!n.RTCPeerConnection)return;if(n.RTCPeerConnection.prototype.addTrack&&e.version>=65)return eie(n);const t=n.RTCPeerConnection.prototype.getLocalStreams;n.RTCPeerConnection.prototype.getLocalStreams=function(){const f=t.apply(this);return this._reverseStreams=this._reverseStreams||{},f.map(h=>this._reverseStreams[h.id])};const r=n.RTCPeerConnection.prototype.addStream;n.RTCPeerConnection.prototype.addStream=function(f){if(this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},f.getTracks().forEach(h=>{if(this.getSenders().find(p=>p.track===h))throw new DOMException("Track already exists.","InvalidAccessError")}),!this._reverseStreams[f.id]){const h=new n.MediaStream(f.getTracks());this._streams[f.id]=h,this._reverseStreams[h.id]=f,f=h}r.apply(this,[f])};const i=n.RTCPeerConnection.prototype.removeStream;n.RTCPeerConnection.prototype.removeStream=function(f){this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},i.apply(this,[this._streams[f.id]||f]),delete this._reverseStreams[this._streams[f.id]?this._streams[f.id].id:f.id],delete this._streams[f.id]},n.RTCPeerConnection.prototype.addTrack=function(f,h){if(this.signalingState==="closed")throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");const m=[].slice.call(arguments,1);if(m.length!==1||!m[0].getTracks().find(v=>v===f))throw new DOMException("The adapter.js addTrack polyfill only supports a single stream which is associated with the specified track.","NotSupportedError");if(this.getSenders().find(v=>v.track===f))throw new DOMException("Track already exists.","InvalidAccessError");this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{};const g=this._streams[h.id];if(g)g.addTrack(f),Promise.resolve().then(()=>{this.dispatchEvent(new Event("negotiationneeded"))});else{const v=new n.MediaStream([f]);this._streams[h.id]=v,this._reverseStreams[v.id]=h,this.addStream(v)}return this.getSenders().find(v=>v.track===f)};function o(d,f){let h=f.sdp;return Object.keys(d._reverseStreams||[]).forEach(m=>{const p=d._reverseStreams[m],g=d._streams[p.id];h=h.replace(new RegExp(g.id,"g"),p.id)}),new RTCSessionDescription({type:f.type,sdp:h})}function l(d,f){let h=f.sdp;return Object.keys(d._reverseStreams||[]).forEach(m=>{const p=d._reverseStreams[m],g=d._streams[p.id];h=h.replace(new RegExp(p.id,"g"),g.id)}),new RTCSessionDescription({type:f.type,sdp:h})}["createOffer","createAnswer"].forEach(function(d){const f=n.RTCPeerConnection.prototype[d],h={[d](){const m=arguments;return arguments.length&&typeof arguments[0]=="function"?f.apply(this,[g=>{const v=o(this,g);m[0].apply(null,[v])},g=>{m[1]&&m[1].apply(null,g)},arguments[2]]):f.apply(this,arguments).then(g=>o(this,g))}};n.RTCPeerConnection.prototype[d]=h[d]});const u=n.RTCPeerConnection.prototype.setLocalDescription;n.RTCPeerConnection.prototype.setLocalDescription=function(){return!arguments.length||!arguments[0].type?u.apply(this,arguments):(arguments[0]=l(this,arguments[0]),u.apply(this,arguments))};const c=Object.getOwnPropertyDescriptor(n.RTCPeerConnection.prototype,"localDescription");Object.defineProperty(n.RTCPeerConnection.prototype,"localDescription",{get(){const d=c.get.apply(this);return d.type===""?d:o(this,d)}}),n.RTCPeerConnection.prototype.removeTrack=function(f){if(this.signalingState==="closed")throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");if(!f._pc)throw new DOMException("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.","TypeError");if(!(f._pc===this))throw new DOMException("Sender was not created by this connection.","InvalidAccessError");this._streams=this._streams||{};let m;Object.keys(this._streams).forEach(p=>{this._streams[p].getTracks().find(v=>f.track===v)&&(m=this._streams[p])}),m&&(m.getTracks().length===1?this.removeStream(this._reverseStreams[m.id]):m.removeTrack(f.track),this.dispatchEvent(new Event("negotiationneeded")))}}function J9(n,e){!n.RTCPeerConnection&&n.webkitRTCPeerConnection&&(n.RTCPeerConnection=n.webkitRTCPeerConnection),n.RTCPeerConnection&&e.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(t){const r=n.RTCPeerConnection.prototype[t],i={[t](){return arguments[0]=new(t==="addIceCandidate"?n.RTCIceCandidate:n.RTCSessionDescription)(arguments[0]),r.apply(this,arguments)}};n.RTCPeerConnection.prototype[t]=i[t]})}function nie(n,e){lp(n,"negotiationneeded",t=>{const r=t.target;if(!((e.version<72||r.getConfiguration&&r.getConfiguration().sdpSemantics==="plan-b")&&r.signalingState!=="stable"))return t})}const rie=Object.freeze(Object.defineProperty({__proto__:null,fixNegotiationNeeded:nie,shimAddTrackRemoveTrack:tie,shimAddTrackRemoveTrackWithNative:eie,shimGetSendersWithDtmf:Zre,shimGetUserMedia:Yre,shimMediaStream:Xre,shimOnTrack:Qre,shimPeerConnection:J9,shimSenderReceiverGetStats:Jre},Symbol.toStringTag,{value:"Module"}));function iie(n,e){const t=n&&n.navigator,r=n&&n.MediaStreamTrack;if(t.getUserMedia=function(i,o,l){Q9("navigator.getUserMedia","navigator.mediaDevices.getUserMedia"),t.mediaDevices.getUserMedia(i).then(o,l)},!(e.version>55&&"autoGainControl"in t.mediaDevices.getSupportedConstraints())){const i=function(l,u,c){u in l&&!(c in l)&&(l[c]=l[u],delete l[u])},o=t.mediaDevices.getUserMedia.bind(t.mediaDevices);if(t.mediaDevices.getUserMedia=function(l){return typeof l=="object"&&typeof l.audio=="object"&&(l=JSON.parse(JSON.stringify(l)),i(l.audio,"autoGainControl","mozAutoGainControl"),i(l.audio,"noiseSuppression","mozNoiseSuppression")),o(l)},r&&r.prototype.getSettings){const l=r.prototype.getSettings;r.prototype.getSettings=function(){const u=l.apply(this,arguments);return i(u,"mozAutoGainControl","autoGainControl"),i(u,"mozNoiseSuppression","noiseSuppression"),u}}if(r&&r.prototype.applyConstraints){const l=r.prototype.applyConstraints;r.prototype.applyConstraints=function(u){return this.kind==="audio"&&typeof u=="object"&&(u=JSON.parse(JSON.stringify(u)),i(u,"autoGainControl","mozAutoGainControl"),i(u,"noiseSuppression","mozNoiseSuppression")),l.apply(this,[u])}}}}function OJe(n,e){n.navigator.mediaDevices&&"getDisplayMedia"in n.navigator.mediaDevices||n.navigator.mediaDevices&&(n.navigator.mediaDevices.getDisplayMedia=function(r){if(!(r&&r.video)){const i=new DOMException("getDisplayMedia without video constraints is undefined");return i.name="NotFoundError",i.code=8,Promise.reject(i)}return r.video===!0?r.video={mediaSource:e}:r.video.mediaSource=e,n.navigator.mediaDevices.getUserMedia(r)})}function aie(n){typeof n=="object"&&n.RTCTrackEvent&&"receiver"in n.RTCTrackEvent.prototype&&!("transceiver"in n.RTCTrackEvent.prototype)&&Object.defineProperty(n.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function eL(n,e){if(typeof n!="object"||!(n.RTCPeerConnection||n.mozRTCPeerConnection))return;!n.RTCPeerConnection&&n.mozRTCPeerConnection&&(n.RTCPeerConnection=n.mozRTCPeerConnection),e.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(i){const o=n.RTCPeerConnection.prototype[i],l={[i](){return arguments[0]=new(i==="addIceCandidate"?n.RTCIceCandidate:n.RTCSessionDescription)(arguments[0]),o.apply(this,arguments)}};n.RTCPeerConnection.prototype[i]=l[i]});const t={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"},r=n.RTCPeerConnection.prototype.getStats;n.RTCPeerConnection.prototype.getStats=function(){const[o,l,u]=arguments;return r.apply(this,[o||null]).then(c=>{if(e.version<53&&!l)try{c.forEach(d=>{d.type=t[d.type]||d.type})}catch(d){if(d.name!=="TypeError")throw d;c.forEach((f,h)=>{c.set(h,Object.assign({},f,{type:t[f.type]||f.type}))})}return c}).then(l,u)}}function oie(n){if(!(typeof n=="object"&&n.RTCPeerConnection&&n.RTCRtpSender)||n.RTCRtpSender&&"getStats"in n.RTCRtpSender.prototype)return;const e=n.RTCPeerConnection.prototype.getSenders;e&&(n.RTCPeerConnection.prototype.getSenders=function(){const i=e.apply(this,[]);return i.forEach(o=>o._pc=this),i});const t=n.RTCPeerConnection.prototype.addTrack;t&&(n.RTCPeerConnection.prototype.addTrack=function(){const i=t.apply(this,arguments);return i._pc=this,i}),n.RTCRtpSender.prototype.getStats=function(){return this.track?this._pc.getStats(this.track):Promise.resolve(new Map)}}function sie(n){if(!(typeof n=="object"&&n.RTCPeerConnection&&n.RTCRtpSender)||n.RTCRtpSender&&"getStats"in n.RTCRtpReceiver.prototype)return;const e=n.RTCPeerConnection.prototype.getReceivers;e&&(n.RTCPeerConnection.prototype.getReceivers=function(){const r=e.apply(this,[]);return r.forEach(i=>i._pc=this),r}),lp(n,"track",t=>(t.receiver._pc=t.srcElement,t)),n.RTCRtpReceiver.prototype.getStats=function(){return this._pc.getStats(this.track)}}function lie(n){!n.RTCPeerConnection||"removeStream"in n.RTCPeerConnection.prototype||(n.RTCPeerConnection.prototype.removeStream=function(t){Q9("removeStream","removeTrack"),this.getSenders().forEach(r=>{r.track&&t.getTracks().includes(r.track)&&this.removeTrack(r)})})}function uie(n){n.DataChannel&&!n.RTCDataChannel&&(n.RTCDataChannel=n.DataChannel)}function cie(n){if(!(typeof n=="object"&&n.RTCPeerConnection))return;const e=n.RTCPeerConnection.prototype.addTransceiver;e&&(n.RTCPeerConnection.prototype.addTransceiver=function(){this.setParametersPromises=[];let r=arguments[1]&&arguments[1].sendEncodings;r===void 0&&(r=[]),r=[...r];const i=r.length>0;i&&r.forEach(l=>{if("rid"in l&&!/^[a-z0-9]{0,16}$/i.test(l.rid))throw new TypeError("Invalid RID value provided.");if("scaleResolutionDownBy"in l&&!(parseFloat(l.scaleResolutionDownBy)>=1))throw new RangeError("scale_resolution_down_by must be >= 1.0");if("maxFramerate"in l&&!(parseFloat(l.maxFramerate)>=0))throw new RangeError("max_framerate must be >= 0.0")});const o=e.apply(this,arguments);if(i){const{sender:l}=o,u=l.getParameters();(!("encodings"in u)||u.encodings.length===1&&Object.keys(u.encodings[0]).length===0)&&(u.encodings=r,l.sendEncodings=r,this.setParametersPromises.push(l.setParameters(u).then(()=>{delete l.sendEncodings}).catch(()=>{delete l.sendEncodings})))}return o})}function die(n){if(!(typeof n=="object"&&n.RTCRtpSender))return;const e=n.RTCRtpSender.prototype.getParameters;e&&(n.RTCRtpSender.prototype.getParameters=function(){const r=e.apply(this,arguments);return"encodings"in r||(r.encodings=[].concat(this.sendEncodings||[{}])),r})}function fie(n){if(!(typeof n=="object"&&n.RTCPeerConnection))return;const e=n.RTCPeerConnection.prototype.createOffer;n.RTCPeerConnection.prototype.createOffer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then(()=>e.apply(this,arguments)).finally(()=>{this.setParametersPromises=[]}):e.apply(this,arguments)}}function hie(n){if(!(typeof n=="object"&&n.RTCPeerConnection))return;const e=n.RTCPeerConnection.prototype.createAnswer;n.RTCPeerConnection.prototype.createAnswer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then(()=>e.apply(this,arguments)).finally(()=>{this.setParametersPromises=[]}):e.apply(this,arguments)}}const mie=Object.freeze(Object.defineProperty({__proto__:null,shimAddTransceiver:cie,shimCreateAnswer:hie,shimCreateOffer:fie,shimGetDisplayMedia:OJe,shimGetParameters:die,shimGetUserMedia:iie,shimOnTrack:aie,shimPeerConnection:eL,shimRTCDataChannel:uie,shimReceiverGetStats:sie,shimRemoveStream:lie,shimSenderGetStats:oie},Symbol.toStringTag,{value:"Module"}));function pie(n){if(!(typeof n!="object"||!n.RTCPeerConnection)){if("getLocalStreams"in n.RTCPeerConnection.prototype||(n.RTCPeerConnection.prototype.getLocalStreams=function(){return this._localStreams||(this._localStreams=[]),this._localStreams}),!("addStream"in n.RTCPeerConnection.prototype)){const e=n.RTCPeerConnection.prototype.addTrack;n.RTCPeerConnection.prototype.addStream=function(r){this._localStreams||(this._localStreams=[]),this._localStreams.includes(r)||this._localStreams.push(r),r.getAudioTracks().forEach(i=>e.call(this,i,r)),r.getVideoTracks().forEach(i=>e.call(this,i,r))},n.RTCPeerConnection.prototype.addTrack=function(r){for(var i=arguments.length,o=new Array(i>1?i-1:0),l=1;l<i;l++)o[l-1]=arguments[l];return o&&o.forEach(u=>{this._localStreams?this._localStreams.includes(u)||this._localStreams.push(u):this._localStreams=[u]}),e.apply(this,arguments)}}"removeStream"in n.RTCPeerConnection.prototype||(n.RTCPeerConnection.prototype.removeStream=function(t){this._localStreams||(this._localStreams=[]);const r=this._localStreams.indexOf(t);if(r===-1)return;this._localStreams.splice(r,1);const i=t.getTracks();this.getSenders().forEach(o=>{i.includes(o.track)&&this.removeTrack(o)})})}}function gie(n){if(!(typeof n!="object"||!n.RTCPeerConnection)&&("getRemoteStreams"in n.RTCPeerConnection.prototype||(n.RTCPeerConnection.prototype.getRemoteStreams=function(){return this._remoteStreams?this._remoteStreams:[]}),!("onaddstream"in n.RTCPeerConnection.prototype))){Object.defineProperty(n.RTCPeerConnection.prototype,"onaddstream",{get(){return this._onaddstream},set(t){this._onaddstream&&(this.removeEventListener("addstream",this._onaddstream),this.removeEventListener("track",this._onaddstreampoly)),this.addEventListener("addstream",this._onaddstream=t),this.addEventListener("track",this._onaddstreampoly=r=>{r.streams.forEach(i=>{if(this._remoteStreams||(this._remoteStreams=[]),this._remoteStreams.includes(i))return;this._remoteStreams.push(i);const o=new Event("addstream");o.stream=i,this.dispatchEvent(o)})})}});const e=n.RTCPeerConnection.prototype.setRemoteDescription;n.RTCPeerConnection.prototype.setRemoteDescription=function(){const r=this;return this._onaddstreampoly||this.addEventListener("track",this._onaddstreampoly=function(i){i.streams.forEach(o=>{if(r._remoteStreams||(r._remoteStreams=[]),r._remoteStreams.indexOf(o)>=0)return;r._remoteStreams.push(o);const l=new Event("addstream");l.stream=o,r.dispatchEvent(l)})}),e.apply(r,arguments)}}}function vie(n){if(typeof n!="object"||!n.RTCPeerConnection)return;const e=n.RTCPeerConnection.prototype,t=e.createOffer,r=e.createAnswer,i=e.setLocalDescription,o=e.setRemoteDescription,l=e.addIceCandidate;e.createOffer=function(d,f){const h=arguments.length>=2?arguments[2]:arguments[0],m=t.apply(this,[h]);return f?(m.then(d,f),Promise.resolve()):m},e.createAnswer=function(d,f){const h=arguments.length>=2?arguments[2]:arguments[0],m=r.apply(this,[h]);return f?(m.then(d,f),Promise.resolve()):m};let u=function(c,d,f){const h=i.apply(this,[c]);return f?(h.then(d,f),Promise.resolve()):h};e.setLocalDescription=u,u=function(c,d,f){const h=o.apply(this,[c]);return f?(h.then(d,f),Promise.resolve()):h},e.setRemoteDescription=u,u=function(c,d,f){const h=l.apply(this,[c]);return f?(h.then(d,f),Promise.resolve()):h},e.addIceCandidate=u}function yie(n){const e=n&&n.navigator;if(e.mediaDevices&&e.mediaDevices.getUserMedia){const t=e.mediaDevices,r=t.getUserMedia.bind(t);e.mediaDevices.getUserMedia=i=>r(bie(i))}!e.getUserMedia&&e.mediaDevices&&e.mediaDevices.getUserMedia&&(e.getUserMedia=function(r,i,o){e.mediaDevices.getUserMedia(r).then(i,o)}.bind(e))}function bie(n){return n&&n.video!==void 0?Object.assign({},n,{video:Gre(n.video)}):n}function Eie(n){if(!n.RTCPeerConnection)return;const e=n.RTCPeerConnection;n.RTCPeerConnection=function(r,i){if(r&&r.iceServers){const o=[];for(let l=0;l<r.iceServers.length;l++){let u=r.iceServers[l];u.urls===void 0&&u.url?(Q9("RTCIceServer.url","RTCIceServer.urls"),u=JSON.parse(JSON.stringify(u)),u.urls=u.url,delete u.url,o.push(u)):o.push(r.iceServers[l])}r.iceServers=o}return new e(r,i)},n.RTCPeerConnection.prototype=e.prototype,"generateCertificate"in e&&Object.defineProperty(n.RTCPeerConnection,"generateCertificate",{get(){return e.generateCertificate}})}function _ie(n){typeof n=="object"&&n.RTCTrackEvent&&"receiver"in n.RTCTrackEvent.prototype&&!("transceiver"in n.RTCTrackEvent.prototype)&&Object.defineProperty(n.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function Tie(n){const e=n.RTCPeerConnection.prototype.createOffer;n.RTCPeerConnection.prototype.createOffer=function(r){if(r){typeof r.offerToReceiveAudio!="undefined"&&(r.offerToReceiveAudio=!!r.offerToReceiveAudio);const i=this.getTransceivers().find(l=>l.receiver.track.kind==="audio");r.offerToReceiveAudio===!1&&i?i.direction==="sendrecv"?i.setDirection?i.setDirection("sendonly"):i.direction="sendonly":i.direction==="recvonly"&&(i.setDirection?i.setDirection("inactive"):i.direction="inactive"):r.offerToReceiveAudio===!0&&!i&&this.addTransceiver("audio",{direction:"recvonly"}),typeof r.offerToReceiveVideo!="undefined"&&(r.offerToReceiveVideo=!!r.offerToReceiveVideo);const o=this.getTransceivers().find(l=>l.receiver.track.kind==="video");r.offerToReceiveVideo===!1&&o?o.direction==="sendrecv"?o.setDirection?o.setDirection("sendonly"):o.direction="sendonly":o.direction==="recvonly"&&(o.setDirection?o.setDirection("inactive"):o.direction="inactive"):r.offerToReceiveVideo===!0&&!o&&this.addTransceiver("video",{direction:"recvonly"})}return e.apply(this,arguments)}}function Sie(n){typeof n!="object"||n.AudioContext||(n.AudioContext=n.webkitAudioContext)}const Cie=Object.freeze(Object.defineProperty({__proto__:null,shimAudioContext:Sie,shimCallbacksAPI:vie,shimConstraints:bie,shimCreateOfferLegacy:Tie,shimGetUserMedia:yie,shimLocalStreamsAPI:pie,shimRTCIceServerUrls:Eie,shimRemoteStreamsAPI:gie,shimTrackEventTransceiver:_ie},Symbol.toStringTag,{value:"Module"}));var Die={exports:{}};(function(n){const e={};e.generateIdentifier=function(){return Math.random().toString(36).substring(2,12)},e.localCName=e.generateIdentifier(),e.splitLines=function(t){return t.trim().split(`
|
|
502
|
+
`}}),yZe({gfm:!0,breaks:!0});const{EmojiBlot:tJe,ShortNameEmoji:nJe,ToolbarEmoji:rJe,TextAreaEmoji:iJe}=_Ze;mre.Quill.register({"formats/emoji":tJe,"modules/emoji-shortname":nJe,"modules/emoji-toolbar":rJe,"modules/emoji-textarea":iJe});const aJe={toolbar:{container:[[{list:"ordered"},{list:"bullet"}],["emoji"]]},"emoji-toolbar":!0,"emoji-shortname":!0},oJe=["list","emoji"],Pre=n=>{let{defaultValue:e,quillProps:t,doNotShowAgain:r,onSend:i,handleSendButtonClickCallBack:o,onChange:l,sendCircleButtonProps:u,visible:c=!0,renderConfirmModal:d,isSendButtonShown:f=!0,isAutoFocus:h=!0,wordCountRule:m,placeholder:p,allowPaste:g,renderCancelEditButton:v,allowSubmitWithoutText:y=!1,phChatBotCallback:b}=n;const E=Le.useRef(null),_=Le.useRef(null),[T,D]=Le.useState(!1),[x,C]=Le.useState(!1),{direction:S}=Hm(),[A,w]=Le.useState(""),[k,P]=Le.useState(""),O=A?A.replace(/<[^>]*>/g," ").replace(/\s+/g," ").trim():"",z=q9(O),G=H9(O),W=V9({words:z,wordCountRule:m});uA(_),$9({wordsLength:z,wordCountLimit:m==null?void 0:m.max}),XZe({charactersLength:G}),Le.useEffect(()=>{var Q;const I=(Q=E.current)===null||Q===void 0?void 0:Q.getEditor();I&&(I.root.setAttribute("dir",S),I.root.style.textAlign="start")},[S]),Le.useEffect(()=>{var Q;const I=(Q=E.current)===null||Q===void 0?void 0:Q.getEditor();I&&I.root.setAttribute("spellcheck","true")},[]),Le.useEffect(()=>{h&&E.current&&E.current.focus();let Q=null;return x&&E.current&&(Q=setTimeout(()=>{const I=E.current.getEditor();I.setSelection(I.getLength()-1,0),C(!1)})),()=>{Q&&clearTimeout(Q)}},[h,x]),Le.useEffect(()=>{var Q;const I=ae=>{if(!g){ae.preventDefault();return}},q=(Q=E.current)===null||Q===void 0?void 0:Q.getEditor();return q&&q.root.addEventListener("paste",I),()=>{q&&q.root.removeEventListener("paste",I)}},[g]),Le.useEffect(()=>{var Q;const I=(ae,pe)=>{const H=(ae.ops.length>0?ae.ops.map(X=>X.insert).join(" "):"").split(" ").filter(X=>X.length>0);if(H.length>eJe){const X=pe.ops.length>0?pe.ops.map(U=>U.insert).join(" "):"";cf({cb:b.CHATBOT_LOG,payload:{chatbotLogType:Hc.INVALID_PASTE_ANSWER_ACTION,params:{component:"DesktopQuillEditor",event:"text-change",eventData:{delta:ae,oldContents:pe},userUrl:window.location.href,currentValue:X,newAddedText:H==null?void 0:H.join(" ")}}})}},q=(Q=E.current)===null||Q===void 0?void 0:Q.getEditor();return q&&q.on("text-change",I),()=>{q&&q.off("text-change",I)}},[b]),Le.useEffect(()=>{if(e){try{const Q=bZe(e);P(e),w(Q)}catch(Q){console.error("Error converting Markdown to HTML:",Q),w(e),P(e)}C(!0)}else e||(w(""),P(""))},[e]);const oe=Q=>{w(Q);let I="";if(Q)try{I=Rre.turndown(Q),P(I)}catch(q){console.error("Error converting HTML to Markdown:",q),I=O}P(I),typeof l=="function"&&l(I)},ye=Le.useCallback(async()=>{(!k||k.trim().length===0)&&!y||i&&typeof i=="function"&&i(k)},[k,i,y]),be=Le.useCallback(()=>{!y&&z===0||z>(m==null?void 0:m.max)||G>m0||(!r&&z<(m==null?void 0:m.min)?o({words:z}):ye())},[G,r,o,ye,m==null?void 0:m.max,m==null?void 0:m.min,z,y]);return oA(be),Qe.jsxs(Qe.Fragment,{children:[Qe.jsx(xre,{visible:T,onClose:()=>D(!1),isDesktop:!0}),v(),Qe.jsxs("div",{"data-testid":"desktop-editor",className:"editor__wrapper ".concat(!c&&"editor__wrapper__hidden"),ref:_,children:[Qe.jsxs("div",{className:"editor--input",children:[Qe.jsxs("div",{className:"editor-upper-wrapper",children:[Qe.jsx(kre,{onHowClick:()=>D(!0)}),z>0&&W&&Qe.jsx(G9,_objectSpread3({},W))]}),Qe.jsx("div",{className:"quill-editor__wrapper",children:Qe.jsx(mre,_objectSpread3({ref:E,theme:"snow",value:A,onChange:oe,modules:aJe,formats:oJe,placeholder:p},t))})]}),f&&Qe.jsx(lA,_objectSpread3({onClick:be},u)),d({handleContinueBtnClick:ye})]})]})},UE={"simple-editor__wrapper":"_simple-editor__wrapper_kj7cm_1","editor-text-area__wrapper":"_editor-text-area__wrapper_kj7cm_17","editor-text-area":"_editor-text-area_kj7cm_17","editor-upper-wrapper":"_editor-upper-wrapper_kj7cm_41",editor__wrapper__hidden:"_editor__wrapper__hidden_kj7cm_47"},{TextArea:sJe}=Wu,W9=n=>{let{doNotShowAgain:e,textAreaProps:t,sendCircleButtonProps:r,visible:i=!0,placeholder:o,onSend:l,onChange:u,defaultValue:c,handleSendButtonClickCallBack:d,wordCountRule:f,isSendButtonShown:h=!0,renderConfirmModal:m,enableSubmitShortcut:p,allowPaste:g,renderCancelEditButton:v,inputMode:y="text"}=n;const b=Le.useRef(null),[E,_]=Le.useState(""),T=q9(E),D=V9({words:T,wordCountRule:f}),x=H9(E),C=Le.useRef(null);$9({wordsLength:T,wordCountLimit:f==null?void 0:f.max}),uA(C),Le.useEffect(()=>{_(c),b!=null&&b.current&&b.current.focus()},[c]);const S=k=>{var P,O;u&&u(k==null||(P=k.target)===null||P===void 0?void 0:P.value),_(k==null||(O=k.target)===null||O===void 0?void 0:O.value)},A=async()=>{if(!(!E||E.trim().length===0)&&l&&typeof l=="function"){const k=await l(E);k!=null&&k.success&&(_(""),b.current&&b.current.focus())}},w=()=>{T===0||T>(f==null?void 0:f.max)||x>m0||(!e&&T<f.min&&d?d({words:T}):A())};return oA(p?A:()=>{}),Qe.jsxs(Qe.Fragment,{children:[v(),Qe.jsxs("div",{"data-testid":"plain-text-editor",className:Vn(UE["simple-editor__wrapper"],i?"":UE.editor__wrapper__hidden),ref:C,children:[Qe.jsx("div",{className:UE["editor-upper-wrapper"],children:T>0&&D&&Qe.jsx(G9,_objectSpread3({},D))}),Qe.jsxs("div",{className:UE["editor-text-area__wrapper"],children:[Qe.jsx(sJe,_objectSpread3({spellCheck:!0,"data-testid":"editor-text-area",className:UE["editor-text-area"],value:E,ref:k=>{k==null||k.focus(),b.current=k},rows:1,autoSize:{maxRows:4},draggable:!1,placeholder:o,maxLength:m0,onChange:S,onPaste:k=>{if(!g)return k.preventDefault(),!1},inputMode:y},t)),h&&Qe.jsx("div",{"data-testid":"send-button-wrapper",children:Qe.jsx(lA,_objectSpread3({onClick:w,backgroundColor:"#ffffff",size:45,iconSize:25},r))})]}),m&&m({handleContinueBtnClick:A})]})]})},lJe=n=>{let{isSendButtonShown:e,onSend:t,onChange:r,wordCountRule:i,renderCancelEditButton:o,placeholder:l,handleSendButtonClickCallBack:u,sendCircleButtonProps:c,renderConfirmModal:d,allowPaste:f,doNotShowAgain:h,defaultValue:m,onExtractHumanNameFailedCallback:p,piiQuestionType:g,assessmentId:v,theme:y}=n;const[b,E]=Le.useState(!1),[_,T]=Le.useState(""),{extractedCandidateName:D,isExtractingHumanName:x,isFullNameQuestion:C,isLastNameQuestion:S,isFirstNameQuestion:A,checkIfNeedToExtractNameFromAnswer:w,extractHumanNameFromAnswer:k}=LQe({piiQuestionType:g,assessmentId:v,onExtractHumanNameFailedCallback:p}),P=ae=>{var pe;let te=ae==null?void 0:ae.trim();return te=(pe=te)===null||pe===void 0?void 0:pe.replace(/\s\s+/g," "),t(te)},O=async ae=>{if(ae===_)return T(""),P(ae);if(w({candidateAnswer:ae})){const{isNameExtractionSuccessful:te,isCandidateInputSameAsExtractedName:H}=await k({candidateAnswer:ae});if(te&&!H){T(ae),E(!0);return}}return P(ae)},z=ae=>{P(ae),E(!1),T("")},G=()=>{E(!1)},W=()=>{z(_)},oe=()=>{D&&z(D)},ye=yi.getInstance(),be=ye.translate(WX),Q=ye.translate("fi_button_ignore"),I=ye.translate("fi_button_correct");let q="";return A?q=ye.translate("fi_alt_firstName",{candidateFirstName:D}):S?q=ye.translate("fi_alt_lastName",{candidateLastName:D}):C&&(q=ye.translate("fi_alt_fullName",{candidateFullName:D})),Qe.jsxs(Qe.Fragment,{children:[Qe.jsx(NQe,{visible:b,confirmationText:q,handleEditButtonClick:G,editButtonLabel:be,handleIgnoreButtonClick:W,ignoreButtonLabel:Q,handleConfirmButtonClick:oe,confirmButtonLabel:I,theme:y}),Qe.jsx(W9,{isSendButtonShown:e,placeholder:l,onSend:O,sendCircleButtonProps:_objectSpread3(_objectSpread3({},c!=null?c:{}),{},{isSubmitting:(c==null?void 0:c.isSubmitting)||x}),defaultValue:m,onChange:r,wordCountRule:i,renderConfirmModal:d,doNotShowAgain:h,handleSendButtonClickCallBack:u,enableSubmitShortcut:!0,allowPaste:f,renderCancelEditButton:o,inputMode:"text"})]})};var kh=(n=>(n.ANSWER="ANSWER",n.VIDEO_RETRY_RECORDS="VIDEO_RETRY_RECORDS",n.DO_NOT_SHOW_LESS_WORD_COUNT_POP_UP_AGAIN="DO_NOT_SHOW_LESS_WORD_COUNT_POP_UP_AGAIN",n.ASSESSMENT_CACHE="ASSESSMENT_CACHE",n.ASSESSMENT_TAB_COUNT="ASSESSMENT_TAB_COUNT",n.ACCESS_VERIFICATION_INFO="ACCESS_VERIFICATION_INFO",n))(kh||{});const jE=n=>{let{key:e,throttleOptions:t={wait:2e3}}=n;const r=Le.useCallback(d=>{const f=localStorage.getItem(d!=null?d:e);try{return JSON.parse(f)}catch(h){return f}},[e]),i=Le.useCallback(d=>{let{accessKey:f,value:h}=d;typeof h!="string"&&(h=JSON.stringify(h)),localStorage.setItem(f!=null?f:e,h)},[e]),o=Le.useCallback(d=>{localStorage.removeItem(d!=null?d:e)},[e]),{run:l,cancel:u}=Gm(i,t),c=Le.useCallback(d=>{let{accessKey:f,value:h}=d;const m=r(f!=null?f:e)||{};typeof h=="object"&&l({value:_objectSpread3(_objectSpread3({},m),h)})},[r,e,l]);return Le.useEffect(()=>u,[u]),{getItem:r,removeItem:o,updateItemWithThrottle:c,setItem:i}},uJe=n=>{let{children:e,onClick:t}=n;return Qe.jsx(Fa,{type:"text",style:{margin:5,color:Ije,fontSize:12,alignSelf:"center",cursor:"pointer"},onClick:t,children:e})};var cA={exports:{}};cA.exports=K9,cA.exports.isMobile=K9,cA.exports.default=K9;const cJe=/(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|samsungbrowser|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,dJe=/CrOS/,fJe=/android|ipad|playbook|silk/i;function K9(n){n||(n={});let e=n.ua;if(!e&&typeof navigator!="undefined"&&(e=navigator.userAgent),e&&e.headers&&typeof e.headers["user-agent"]=="string"&&(e=e.headers["user-agent"]),typeof e!="string")return!1;let t=cJe.test(e)&&!dJe.test(e)||!!n.tablet&&fJe.test(e);return!t&&n.tablet&&n.featureDetect&&navigator&&navigator.maxTouchPoints>1&&e.indexOf("Macintosh")!==-1&&e.indexOf("Safari")!==-1&&(t=!0),t}var hJe=cA.exports;const Ore=Ma(hJe),Lre=()=>{const[n,e]=Le.useState(()=>Ore());return Le.useEffect(()=>{const t=()=>{e(Ore())};return window.addEventListener("resize",t),()=>{window.removeEventListener("resize",t)}},[]),{isMobile:n}},yf={mobileEditorWrapper:"_mobileEditorWrapper_1i9mo_1",clickableBarWrapper:"_clickableBarWrapper_1i9mo_20",clickableBar:"_clickableBar_1i9mo_20",expanded:"_expanded_1i9mo_33",collapseButton:"_collapseButton_1i9mo_36",infoSection:"_infoSection_1i9mo_47",questionCount:"_questionCount_1i9mo_54",wordCount:"_wordCount_1i9mo_58",hidden:"_hidden_1i9mo_62",editorTextAreaWrapper:"_editorTextAreaWrapper_1i9mo_65",editorTextArea:"_editorTextArea_1i9mo_65"},mJe=n=>{let{expanded:e,handleClick:t}=n;return Qe.jsxs("div",{"data-testid":"clickable-bar",className:yf.clickableBarWrapper,onClick:t,children:[Qe.jsx(Wc,{text:e?"Collapse":"Expand",children:Qe.jsx("div",{className:Vn([yf.clickableBar,e?yf.expanded:""])})}),e?Qe.jsx(Fa,{"aria-label":"collapse",className:yf.collapseButton,children:Qe.jsx(Wc,{text:"Collapse",children:Qe.jsx(BKe,{})})}):null]})},{TextArea:pJe}=Wu,Y9="60px",Nre="calc(100% - ".concat(Y9,")"),Mre=n=>{let{doNotShowAgain:e,sendCircleButtonProps:t,placeholder:r,onSend:i,onChange:o,defaultValue:l,handleSendButtonClickCallBack:u,wordCountRule:c,isSendButtonShown:d=!0,renderConfirmModal:f,allowPaste:h,hideClickableBar:m,renderCancelEditButton:p,isEditing:g,phChatBotCallback:v,allowSubmitWithoutText:y=!1}=n;const[b,E]=Le.useState(!1),[_,T]=Le.useState(""),D=Le.useRef(null),x=q9(_),C=V9({words:x,wordCountRule:c}),S=H9(_),A=Le.useRef(null);Le.useEffect(()=>{T(l),D!=null&&D.current&&D.current.focus()},[l]);const[w,k]=Le.useState(!1),[P,O]=Le.useState(window.visualViewport.height?"".concat(window.visualViewport.height,"px - ").concat(Y9):Nre),z=q=>{var ae,pe;o&&o(q==null||(ae=q.target)===null||ae===void 0?void 0:ae.value),T(q==null||(pe=q.target)===null||pe===void 0?void 0:pe.value)};Le.useEffect(()=>{const q=()=>{O("".concat(window.visualViewport.height,"px - ").concat(Y9))};return window.visualViewport.addEventListener("resize",q),()=>{window.visualViewport.removeEventListener("resize",q)}},[]);const G=()=>{k(q=>!q)},W=async()=>{if(!(!y&&(!_||_.trim().length===0))&&i&&typeof i=="function"){const q=await i(_);q!=null&&q.success&&(T(""),D.current&&D.current.focus())}},oe=()=>{!y&&x===0||x>(c==null?void 0:c.max)||S>m0||(k(!1),!e&&x<(c==null?void 0:c.min)&&u?u({words:x}):W())};$9({wordsLength:x,wordCountLimit:c==null?void 0:c.max}),uA(A);const ye=()=>m?null:Qe.jsx(mJe,{handleClick:G,expanded:w}),be=()=>{const q=x>0&&C;return Qe.jsxs("div",{className:yf.infoSection,children:[Qe.jsx(xre,{visible:b,onClose:()=>E(!1),isDesktop:!1}),Qe.jsxs("div",{children:[q?Qe.jsx(G9,_objectSpread3(_objectSpread3({},C),{},{className:yf.wordCount})):null,Qe.jsx(kre,{onHowClick:()=>E(!0)})]}),d?Qe.jsx(lA,_objectSpread3({onClick:oe,backgroundColor:"#ffffff",size:45,iconSize:25},t)):null]})},Q=()=>Qe.jsxs(Qe.Fragment,{children:[p(()=>{k(!1)}),Qe.jsxs("div",{"data-testid":"mobile-editor",className:yf.mobileEditorWrapper,ref:A,children:[ye(),Qe.jsx("div",{className:yf.editorTextAreaWrapper,children:Qe.jsx(pJe,{spellCheck:!0,"data-testid":"editor-text-area",className:yf.editorTextArea,value:_,ref:q=>{q==null||q.focus(),D.current=q},rows:2,draggable:!1,placeholder:r,maxLength:m0,onChange:z,onPaste:q=>{if(!h)return q.preventDefault(),q.stopPropagation(),!1},onDrop:q=>{if(!h)return cf({cb:v.CHATBOT_LOG,payload:{chatbotLogType:Hc.INVALID_PASTE_ANSWER_ACTION,params:{component:"MobileEditor",event:"onDrop",eventData:q,userUrl:window.location.href,currentValue:_}}}),!0},onInput:q=>{if(!h&&q.nativeEvent&&q.nativeEvent.inputType==="insertFromPaste"){const ae=q.target,pe=_;cf({cb:v.CHATBOT_LOG,payload:{chatbotLogType:Hc.INVALID_PASTE_ANSWER_ACTION,params:{component:"MobileEditor",event:"onInput",eventData:q,userUrl:window.location.href,currentValue:pe,targetValue:ae==null?void 0:ae.value}}})}},onKeyDown:q=>{!h&&(q.ctrlKey&&q.key==="v"||q.metaKey&&q.key==="v"||q.shiftKey&&q.key==="Insert")&&cf({cb:v.CHATBOT_LOG,payload:{chatbotLogType:Hc.INVALID_PASTE_ANSWER_ACTION,params:{component:"MobileEditor",event:"onKeyDown",eventData:q,userUrl:window.location.href,currentValue:_}}})},onContextMenu:q=>{h||cf({cb:v.CHATBOT_LOG,payload:{chatbotLogType:Hc.INVALID_PASTE_ANSWER_ACTION,params:{component:"MobileEditor",event:"onContextMenu",eventData:q,userUrl:window.location.href,currentValue:_}}})},onClick:()=>{w&&setTimeout(()=>{window.scrollTo(0,0)},150)},style:{width:"100%",height:"100%"}})}),be()]})]}),I=()=>Qe.jsx(bxe,{getContainer:()=>document.getElementById(xw),placement:"bottom",onClose:()=>k(!1),visible:!0,closeIcon:!1,headerStyle:{padding:0,height:0},bodyStyle:{padding:0,display:"grid",height:"100%",gridTemplateRows:g?"auto 1fr":"1fr"},drawerStyle:{height:P},contentWrapperStyle:{height:Nre},children:Q()});return w?I():Qe.jsxs(Qe.Fragment,{children:[Q(),f?f({handleContinueBtnClick:W}):null]})},U0=[{emoji:"๐จ๐ฆ",phoneCode:"1",short:"CA",name:"Canada"},{emoji:"๐บ๐ธ",phoneCode:"1",short:"US",name:"United States of America"},{emoji:"๐ง๐ธ",phoneCode:"1",short:"BS",name:"Bahamas"},{emoji:"๐ง๐ง",phoneCode:"1",short:"BB",name:"Barbados"},{emoji:"๐ฆ๐ฎ",phoneCode:"1",short:"AI",name:"Anguilla"},{emoji:"๐ฆ๐ฌ",phoneCode:"1",short:"AG",name:"Antigua and Barbuda"},{emoji:"๐ป๐ฎ",phoneCode:"1",short:"VI",name:"Virgin Islands (U.S.)"},{emoji:"๐ป๐ฌ",phoneCode:"1",short:"VG",name:"Virgin Islands (British)"},{emoji:"๐ฐ๐พ",phoneCode:"1",short:"KY",name:"Cayman Islands"},{emoji:"๐ง๐ฒ",phoneCode:"1",short:"BM",name:"Bermuda"},{emoji:"๐ฌ๐ฉ",phoneCode:"1",short:"GD",name:"Grenada"},{emoji:"๐น๐จ",phoneCode:"1",short:"TC",name:"Turks and Caicos Islands"},{emoji:"๐ฒ๐ธ",phoneCode:"1",short:"MS",name:"Montserrat"},{emoji:"๐ฌ๐บ",phoneCode:"1",short:"GU",name:"Guam"},{emoji:"๐ฆ๐ธ",phoneCode:"1",short:"AS",name:"American Samoa"},{emoji:"๐ณ๐ฑ",phoneCode:"1",short:"SX",name:"Sint Maarten (Dutch part)"},{emoji:"๐ฑ๐จ",phoneCode:"1",short:"LC",name:"Saint Lucia"},{emoji:"๐ฉ๐ฒ",phoneCode:"1",short:"DM",name:"Dominica"},{emoji:"๐ป๐จ",phoneCode:"1",short:"VC",name:"Saint Vincent and the Grenadines"},{emoji:"๐ต๐ท",phoneCode:"1",short:"PR",name:"Puerto Rico"},{emoji:"๐ฉ๐ด",phoneCode:"1",short:"DO",name:"Dominican Republic"},{emoji:"๐น๐น",phoneCode:"1",short:"TT",name:"Trinidad and Tobago"},{emoji:"๐ฐ๐ณ",phoneCode:"1",short:"KN",name:"Saint Kitts and Nevis"},{emoji:"๐ฏ๐ฒ",phoneCode:"1",short:"JM",name:"Jamaica"},{emoji:"๐ช๐ฌ",phoneCode:"20",short:"EG",name:"Egypt"},{emoji:"๐ฒ๐ฆ",phoneCode:"212",short:"MA",name:"Morocco"},{emoji:"๐ฉ๐ฟ",phoneCode:"213",short:"DZ",name:"Algeria"},{emoji:"๐น๐ณ",phoneCode:"216",short:"TN",name:"Tunisia"},{emoji:"๐ฑ๐พ",phoneCode:"218",short:"LY",name:"Libya"},{emoji:"๐ฌ๐ฒ",phoneCode:"220",short:"GM",name:"Gambia"},{emoji:"๐ธ๐ณ",phoneCode:"221",short:"SN",name:"Senegal"},{emoji:"๐ฒ๐ท",phoneCode:"222",short:"MR",name:"Mauritania"},{emoji:"๐ฒ๐ฑ",phoneCode:"223",short:"ML",name:"Mali"},{emoji:"๐ฌ๐ณ",phoneCode:"224",short:"GN",name:"Guinea"},{emoji:"๐จ๐ฎ",phoneCode:"225",short:"CI",name:"Cรดte d'Ivoire"},{emoji:"๐ง๐ซ",phoneCode:"226",short:"BF",name:"Burkina Faso"},{emoji:"๐ณ๐ช",phoneCode:"227",short:"NE",name:"Niger"},{emoji:"๐น๐ฌ",phoneCode:"228",short:"TG",name:"Togo"},{emoji:"๐ง๐ฏ",phoneCode:"229",short:"BJ",name:"Benin"},{emoji:"๐ฒ๐บ",phoneCode:"230",short:"MU",name:"Mauritius"},{emoji:"๐ฑ๐ท",phoneCode:"231",short:"LR",name:"Liberia"},{emoji:"๐ธ๐ฑ",phoneCode:"232",short:"SL",name:"Sierra Leone"},{emoji:"๐ฌ๐ญ",phoneCode:"233",short:"GH",name:"Ghana"},{emoji:"๐ณ๐ฌ",phoneCode:"234",short:"NG",name:"Nigeria"},{emoji:"๐น๐ฉ",phoneCode:"235",short:"TD",name:"Chad"},{emoji:"๐จ๐ซ",phoneCode:"236",short:"CF",name:"Central African Republic"},{emoji:"๐จ๐ฒ",phoneCode:"237",short:"CM",name:"Cameroon"},{emoji:"๐จ๐ป",phoneCode:"238",short:"CV",name:"Cabo Verde"},{emoji:"๐ธ๐น",phoneCode:"239",short:"ST",name:"Sao Tome and Principe"},{emoji:"๐ฌ๐ถ",phoneCode:"240",short:"GQ",name:"Equatorial Guinea"},{emoji:"๐ฌ๐ฆ",phoneCode:"241",short:"GA",name:"Gabon"},{emoji:"๐จ๐ฌ",phoneCode:"242",short:"CG",name:"Congo"},{emoji:"๐จ๐ฉ",phoneCode:"243",short:"CD",name:"Congo, Democratic Republic of the"},{emoji:"๐ฆ๐ด",phoneCode:"244",short:"AO",name:"Angola"},{emoji:"๐ฌ๐ผ",phoneCode:"245",short:"GW",name:"Guinea-Bissau"},{emoji:"๐ธ๐จ",phoneCode:"248",short:"SC",name:"Seychelles"},{emoji:"๐ธ๐ฉ",phoneCode:"249",short:"SD",name:"Sudan"},{emoji:"๐ท๐ผ",phoneCode:"250",short:"RW",name:"Rwanda"},{emoji:"๐ช๐น",phoneCode:"251",short:"ET",name:"Ethiopia"},{emoji:"๐ธ๐ด",phoneCode:"252",short:"SO",name:"Somalia"},{emoji:"๐ฉ๐ฏ",phoneCode:"253",short:"DJ",name:"Djibouti"},{emoji:"๐ฐ๐ช",phoneCode:"254",short:"KE",name:"Kenya"},{emoji:"๐น๐ฟ",phoneCode:"255",short:"TZ",name:"Tanzania, United Republic of"},{emoji:"๐บ๐ฌ",phoneCode:"256",short:"UG",name:"Uganda"},{emoji:"๐ง๐ฎ",phoneCode:"257",short:"BI",name:"Burundi"},{emoji:"๐ฒ๐ฟ",phoneCode:"258",short:"MZ",name:"Mozambique"},{emoji:"๐ฟ๐ฒ",phoneCode:"260",short:"ZM",name:"Zambia"},{emoji:"๐ฒ๐ฌ",phoneCode:"261",short:"MG",name:"Madagascar"},{emoji:"๐ท๐ช",phoneCode:"262",short:"RE",name:"Rรฉunion"},{emoji:"๐ฟ๐ผ",phoneCode:"263",short:"ZW",name:"Zimbabwe"},{emoji:"๐ณ๐ฆ",phoneCode:"264",short:"NA",name:"Namibia"},{emoji:"๐ฒ๐ผ",phoneCode:"265",short:"MW",name:"Malawi"},{emoji:"๐ฑ๐ธ",phoneCode:"266",short:"LS",name:"Lesotho"},{emoji:"๐ง๐ผ",phoneCode:"267",short:"BW",name:"Botswana"},{emoji:"๐ธ๐ฟ",phoneCode:"268",short:"SZ",name:"Eswatini"},{emoji:"๐ฐ๐ฒ",phoneCode:"269",short:"KM",name:"Comoros"},{emoji:"๐พ๐น",phoneCode:"262",short:"YT",name:"Mayotte"},{emoji:"๐ฟ๐ฆ",phoneCode:"27",short:"ZA",name:"South Africa"},{emoji:"๐ช๐ท",phoneCode:"291",short:"ER",name:"Eritrea"},{emoji:"๐ฆ๐ผ",phoneCode:"297",short:"AW",name:"Aruba"},{emoji:"๐ซ๐ด",phoneCode:"298",short:"FO",name:"Faroe Islands"},{emoji:"๐ฌ๐ฑ",phoneCode:"299",short:"GL",name:"Greenland"},{emoji:"๐ฌ๐ท",phoneCode:"30",short:"GR",name:"Greece"},{emoji:"๐ณ๐ฑ",phoneCode:"31",short:"NL",name:"Netherlands"},{emoji:"๐ง๐ช",phoneCode:"32",short:"BE",name:"Belgium"},{emoji:"๐ซ๐ท",phoneCode:"33",short:"FR",name:"France"},{emoji:"๐ช๐ธ",phoneCode:"34",short:"ES",name:"Spain"},{emoji:"๐ฌ๐ฎ",phoneCode:"350",short:"GI",name:"Gibraltar"},{emoji:"๐ต๐น",phoneCode:"351",short:"PT",name:"Portugal"},{emoji:"๐ฑ๐บ",phoneCode:"352",short:"LU",name:"Luxembourg"},{emoji:"๐ฎ๐ช",phoneCode:"353",short:"IE",name:"Ireland"},{emoji:"๐ฎ๐ธ",phoneCode:"354",short:"IS",name:"Iceland"},{emoji:"๐ฆ๐ฑ",phoneCode:"355",short:"AL",name:"Albania"},{emoji:"๐ฒ๐น",phoneCode:"356",short:"MT",name:"Malta"},{emoji:"๐จ๐พ",phoneCode:"357",short:"CY",name:"Cyprus"},{emoji:"๐ซ๐ฎ",phoneCode:"358",short:"FI",name:"Finland"},{emoji:"๐ง๐ฌ",phoneCode:"359",short:"BG",name:"Bulgaria"},{emoji:"๐ญ๐บ",phoneCode:"36",short:"HU",name:"Hungary"},{emoji:"๐ฑ๐น",phoneCode:"370",short:"LT",name:"Lithuania"},{emoji:"๐ฑ๐ป",phoneCode:"371",short:"LV",name:"Latvia"},{emoji:"๐ช๐ช",phoneCode:"372",short:"EE",name:"Estonia"},{emoji:"๐ฒ๐ฉ",phoneCode:"373",short:"MD",name:"Moldova, Republic of"},{emoji:"๐ฆ๐ฒ",phoneCode:"374",short:"AM",name:"Armenia"},{emoji:"๐ง๐พ",phoneCode:"375",short:"BY",name:"Belarus"},{emoji:"๐ฆ๐ฉ",phoneCode:"376",short:"AD",name:"Andorra"},{emoji:"๐ฒ๐จ",phoneCode:"377",short:"MC",name:"Monaco"},{emoji:"๐ธ๐ฒ",phoneCode:"378",short:"SM",name:"San Marino"},{emoji:"๐บ๐ฆ",phoneCode:"380",short:"UA",name:"Ukraine"},{emoji:"๐ท๐ธ",phoneCode:"381",short:"RS",name:"Serbia"},{emoji:"๐ฒ๐ช",phoneCode:"382",short:"ME",name:"Montenegro"},{emoji:"๐ญ๐ท",phoneCode:"385",short:"HR",name:"Croatia"},{emoji:"๐ธ๐ฎ",phoneCode:"386",short:"SI",name:"Slovenia"},{emoji:"๐ง๐ฆ",phoneCode:"387",short:"BA",name:"Bosnia and Herzegovina"},{emoji:"๐ฒ๐ฐ",phoneCode:"389",short:"MK",name:"North Macedonia"},{emoji:"๐ฎ๐น",phoneCode:"39",short:"IT",name:"Italy"},{emoji:"๐ท๐ด",phoneCode:"40",short:"RO",name:"Romania"},{emoji:"๐จ๐ญ",phoneCode:"41",short:"CH",name:"Switzerland"},{emoji:"๐จ๐ฟ",phoneCode:"420",short:"CZ",name:"Czechia"},{emoji:"๐ธ๐ฐ",phoneCode:"421",short:"SK",name:"Slovakia"},{emoji:"๐ฑ๐ฎ",phoneCode:"423",short:"LI",name:"Liechtenstein"},{emoji:"๐ฆ๐น",phoneCode:"43",short:"AT",name:"Austria"},{emoji:"๐ฌ๐ง",phoneCode:"44",short:"GB",name:"United Kingdom of Great Britain and Northern Ireland"},{emoji:"๐ฉ๐ฐ",phoneCode:"45",short:"DK",name:"Denmark"},{emoji:"๐ธ๐ช",phoneCode:"46",short:"SE",name:"Sweden"},{emoji:"๐ณ๐ด",phoneCode:"47",short:"NO",name:"Norway"},{emoji:"๐ต๐ฑ",phoneCode:"48",short:"PL",name:"Poland"},{emoji:"๐ฉ๐ช",phoneCode:"49",short:"DE",name:"Germany"},{emoji:"๐ง๐ฟ",phoneCode:"501",short:"BZ",name:"Belize"},{emoji:"๐ฌ๐น",phoneCode:"502",short:"GT",name:"Guatemala"},{emoji:"๐ธ๐ป",phoneCode:"503",short:"SV",name:"El Salvador"},{emoji:"๐ญ๐ณ",phoneCode:"504",short:"HN",name:"Honduras"},{emoji:"๐ณ๐ฎ",phoneCode:"505",short:"NI",name:"Nicaragua"},{emoji:"๐จ๐ท",phoneCode:"506",short:"CR",name:"Costa Rica"},{emoji:"๐ต๐ฆ",phoneCode:"507",short:"PA",name:"Panama"},{emoji:"๐ต๐ฒ",phoneCode:"508",short:"PM",name:"Saint Pierre and Miquelon"},{emoji:"๐ญ๐น",phoneCode:"509",short:"HT",name:"Haiti"},{emoji:"๐ต๐ช",phoneCode:"51",short:"PE",name:"Peru"},{emoji:"๐ฒ๐ฝ",phoneCode:"52",short:"MX",name:"Mexico"},{emoji:"๐จ๐บ",phoneCode:"53",short:"CU",name:"Cuba"},{emoji:"๐ฆ๐ท",phoneCode:"54",short:"AR",name:"Argentina"},{emoji:"๐ง๐ท",phoneCode:"55",short:"BR",name:"Brazil"},{emoji:"๐จ๐ฑ",phoneCode:"56",short:"CL",name:"Chile"},{emoji:"๐จ๐ด",phoneCode:"57",short:"CO",name:"Colombia"},{emoji:"๐ป๐ช",phoneCode:"58",short:"VE",name:"Venezuela (Bolivarian Republic of)"},{emoji:"๐ฌ๐ต",phoneCode:"590",short:"GP",name:"Guadeloupe"},{emoji:"๐ง๐ด",phoneCode:"591",short:"BO",name:"Bolivia (Plurinational State of)"},{emoji:"๐ฌ๐พ",phoneCode:"592",short:"GY",name:"Guyana"},{emoji:"๐ช๐จ",phoneCode:"593",short:"EC",name:"Ecuador"},{emoji:"๐ฌ๐ซ",phoneCode:"594",short:"GF",name:"French Guiana"},{emoji:"๐ต๐พ",phoneCode:"595",short:"PY",name:"Paraguay"},{emoji:"๐ฒ๐ถ",phoneCode:"596",short:"MQ",name:"Martinique"},{emoji:"๐ธ๐ท",phoneCode:"597",short:"SR",name:"Suriname"},{emoji:"๐บ๐พ",phoneCode:"598",short:"UY",name:"Uruguay"},{emoji:"๐จ๐ผ",phoneCode:"599",short:"CW",name:"Curaรงao"},{emoji:"๐ฒ๐พ",phoneCode:"60",short:"MY",name:"Malaysia"},{emoji:"๐ฆ๐บ",phoneCode:"61",short:"AU",name:"Australia"},{emoji:"๐ฎ๐ฉ",phoneCode:"62",short:"ID",name:"Indonesia"},{emoji:"๐ต๐ญ",phoneCode:"63",short:"PH",name:"Philippines"},{emoji:"๐ณ๐ฟ",phoneCode:"64",short:"NZ",name:"New Zealand"},{emoji:"๐ธ๐ฌ",phoneCode:"65",short:"SG",name:"Singapore"},{emoji:"๐น๐ญ",phoneCode:"66",short:"TH",name:"Thailand"},{emoji:"๐น๐ฑ",phoneCode:"670",short:"TL",name:"Timor-Leste"},{emoji:"๐ง๐ณ",phoneCode:"673",short:"BN",name:"Brunei Darussalam"},{emoji:"๐ต๐ฌ",phoneCode:"675",short:"PG",name:"Papua New Guinea"},{emoji:"๐น๐ด",phoneCode:"676",short:"TO",name:"Tonga"},{emoji:"๐ธ๐ง",phoneCode:"677",short:"SB",name:"Solomon Islands"},{emoji:"๐ป๐บ",phoneCode:"678",short:"VU",name:"Vanuatu"},{emoji:"๐ซ๐ฏ",phoneCode:"679",short:"FJ",name:"Fiji"},{emoji:"๐ต๐ผ",phoneCode:"680",short:"PW",name:"Palau"},{emoji:"๐จ๐ฐ",phoneCode:"682",short:"CK",name:"Cook Islands"},{emoji:"๐ผ๐ธ",phoneCode:"685",short:"WS",name:"Samoa"},{emoji:"๐ฐ๐ฎ",phoneCode:"686",short:"KI",name:"Kiribati"},{emoji:"๐ณ๐จ",phoneCode:"687",short:"NC",name:"New Caledonia"},{emoji:"๐ต๐ซ",phoneCode:"689",short:"PF",name:"French Polynesia"},{emoji:"๐ฐ๐ฟ",phoneCode:"7",short:"KZ",name:"Kazakhstan"},{emoji:"๐ท๐บ",phoneCode:"7",short:"RU",name:"Russian Federation"},{emoji:"๐ฏ๐ต",phoneCode:"81",short:"JP",name:"Japan"},{emoji:"๐ฐ๐ท",phoneCode:"82",short:"KR",name:"Korea, Republic of"},{emoji:"๐ป๐ณ",phoneCode:"84",short:"VN",name:"Viet Nam"},{emoji:"๐ญ๐ฐ",phoneCode:"852",short:"HK",name:"Hong Kong"},{emoji:"๐ฒ๐ด",phoneCode:"853",short:"MO",name:"Macao"},{emoji:"๐ฐ๐ญ",phoneCode:"855",short:"KH",name:"Cambodia"},{emoji:"๐ฑ๐ฆ",phoneCode:"856",short:"LA",name:"Lao People's Democratic Republic"},{emoji:"๐จ๐ณ",phoneCode:"86",short:"CN",name:"China"},{emoji:"๐ง๐ฉ",phoneCode:"880",short:"BD",name:"Bangladesh"},{emoji:"๐น๐ผ",phoneCode:"886",short:"TW",name:"Taiwan, Province of China"},{emoji:"๐น๐ท",phoneCode:"90",short:"TR",name:"Turkey"},{emoji:"๐ฎ๐ณ",phoneCode:"91",short:"IN",name:"India"},{emoji:"๐ต๐ฐ",phoneCode:"92",short:"PK",name:"Pakistan"},{emoji:"๐ฆ๐ซ",phoneCode:"93",short:"AF",name:"Afghanistan"},{emoji:"๐ฑ๐ฐ",phoneCode:"94",short:"LK",name:"Sri Lanka"},{emoji:"๐ฒ๐ฒ",phoneCode:"95",short:"MM",name:"Myanmar"},{emoji:"๐ฒ๐ป",phoneCode:"960",short:"MV",name:"Maldives"},{emoji:"๐ฑ๐ง",phoneCode:"961",short:"LB",name:"Lebanon"},{emoji:"๐ฏ๐ด",phoneCode:"962",short:"JO",name:"Jordan"},{emoji:"๐ธ๐พ",phoneCode:"963",short:"SY",name:"Syrian Arab Republic"},{emoji:"๐ฎ๐ถ",phoneCode:"964",short:"IQ",name:"Iraq"},{emoji:"๐ฐ๐ผ",phoneCode:"965",short:"KW",name:"Kuwait"},{emoji:"๐ธ๐ฆ",phoneCode:"966",short:"SA",name:"Saudi Arabia"},{emoji:"๐พ๐ช",phoneCode:"967",short:"YE",name:"Yemen"},{emoji:"๐ด๐ฒ",phoneCode:"968",short:"OM",name:"Oman"},{emoji:"๐ต๐ธ",phoneCode:"590",short:"BL",name:"Saint Barthรฉlemy"},{emoji:"๐ฆ๐ช",phoneCode:"971",short:"AE",name:"United Arab Emirates"},{emoji:"๐ฎ๐ฑ",phoneCode:"972",short:"IL",name:"Israel"},{emoji:"๐ง๐ญ",phoneCode:"973",short:"BH",name:"Bahrain"},{emoji:"๐ถ๐ฆ",phoneCode:"974",short:"QA",name:"Qatar"},{emoji:"๐ง๐น",phoneCode:"975",short:"BT",name:"Bhutan"},{emoji:"๐ฒ๐ณ",phoneCode:"976",short:"MN",name:"Mongolia"},{emoji:"๐ณ๐ต",phoneCode:"977",short:"NP",name:"Nepal"},{emoji:"๐ฎ๐ท",phoneCode:"98",short:"IR",name:"Iran (Islamic Republic of)"},{emoji:"๐น๐ฏ",phoneCode:"992",short:"TJ",name:"Tajikistan"},{emoji:"๐น๐ฒ",phoneCode:"993",short:"TM",name:"Turkmenistan"},{emoji:"๐ฆ๐ฟ",phoneCode:"994",short:"AZ",name:"Azerbaijan"},{emoji:"๐ฌ๐ช",phoneCode:"995",short:"GE",name:"Georgia"},{emoji:"๐ฐ๐ฌ",phoneCode:"996",short:"KG",name:"Kyrgyzstan"},{emoji:"๐บ๐ฟ",phoneCode:"998",short:"UZ",name:"Uzbekistan"}],yAt="",gJe={"option-list":"_option-list_y65d5_1","option-item":"_option-item_y65d5_17"},Fre=n=>"".concat(n.short," +").concat(n.phoneCode),vJe=n=>{const[e,t]=n==null?void 0:n.split(" ");return{areaShortName:e,phoneCode:t}},yJe=n=>{let{defaultArea:e,onSelectArea:t}=n;const[r,i]=Le.useState(),o=async l=>{const{areaShortName:u}=vJe(l);i(l),t(U0.find(c=>c.short===u))};return Le.useEffect(()=>{let l="";return U0.sort((u,c)=>u.name<c.name?-1:1),U0.forEach(u=>{u.short===e.short&&(l=Fre(u))}),i(l),()=>i("")},[e]),Qe.jsx(IR,{showArrow:!0,showSearch:!0,"data-testid":"phone-code-select",style:{width:120},dropdownMatchSelectWidth:!1,bordered:!1,optionLabelProp:"label",filterOption:(l,u)=>{var c;return(u==null||(c=u.key)===null||c===void 0||(c=c.toString())===null||c===void 0?void 0:c.toLocaleLowerCase()).includes(l==null?void 0:l.toLocaleLowerCase())},onSelect:o,value:r,placement:"topLeft",children:U0.map(l=>{const u=Fre(l),c="".concat(l.name," +").concat(l.phoneCode);return Qe.jsxs(IR.Option,{value:u,label:Qe.jsx("div",{className:gJe["option-item"],children:Qe.jsx("span",{children:"".concat(l.emoji," +").concat(l.phoneCode)})},c),children:[l.emoji," ",c]},c)})})},Bre=n=>{let{sendCircleButtonProps:e,onSend:t,onChange:r,defaultValue:i,defaultArea:o,onSelectArea:l,allowPaste:u,renderCancelEditButton:c,placeholder:d}=n;const f=Le.useRef(null),[h,m]=Le.useState(""),p=Le.useRef(null);uA(p),Le.useEffect(()=>{m(i),f!=null&&f.current&&f.current.focus()},[i]);const g=y=>{var b,E;r&&r(y==null||(b=y.target)===null||b===void 0?void 0:b.value),m(y==null||(E=y.target)===null||E===void 0?void 0:E.value)},v=Le.useCallback(async()=>{if(!(!h||h.trim().length===0)&&t&&typeof t=="function"){const y=await t(h);y!=null&&y.success&&(m(""),f.current&&f.current.focus())}},[h,t]);return oA(v),Qe.jsxs(Qe.Fragment,{children:[c(),Qe.jsxs("div",{"data-testid":"phone-editor",className:"phone-editor__container",ref:p,children:[Qe.jsxs("div",{className:"phone-editor__wrapper ",children:[Qe.jsx(yJe,{onSelectArea:l,defaultArea:o}),Qe.jsx(Wu,{"data-testid":"text-editor",value:h,ref:y=>{y==null||y.focus(),f.current=y},className:"phone-editor",draggable:!1,placeholder:d,onChange:g,onPaste:y=>{if(!u)return y.preventDefault(),!1},inputMode:"tel"})]}),Qe.jsx(lA,_objectSpread3({onClick:v,backgroundColor:"#ffffff"},e))]})]})},X9=n=>{let{sendCircleButtonProps:e,onSend:t,onChange:r,wordCountRule:i,hideClickableBar:o,isSendButtonShown:l=!0,initialValue:u}=n;const c=yi.getInstance(),{isMobile:d}=Lre(),{chatbotState:f,isInternalUser:h,handleExitEditAnswer:m}=is(),{theme:p,currentMessageBubble:g,messageBubbleList:v,region:y,phChatBotCallback:b,assessmentId:E}=f,_=ap(g.status),T=g.questionId,[D,x]=Le.useState(u||""),[C,S]=Le.useState(!1),[A,w]=Le.useState(()=>{const We=U0.find(F=>F.short===f.candidateCountryCode);return We||(DX.has(y)?DX.get(y):DBe)}),{getItem:k,setItem:P}=jE({key:kh.DO_NOT_SHOW_LESS_WORD_COUNT_POP_UP_AGAIN});let O;v==null||v.forEach(We=>{if(We.questionId===T&&We.sender===Co.CANDIDATE){var de;O=(de=We.data)===null||de===void 0?void 0:de.messageItems[0].contents[0].text}});const z=g==null?void 0:g.piiQuestionType,G=CKe(z),W=DKe(z),oe=ene(z),ye=tne(z),be=nne(z),Q=rne(z),I=wKe(g);Le.useEffect(()=>{const We=de=>{de.key===SX&&m()};return window.addEventListener("keydown",We),()=>{window.removeEventListener("keydown",We)}},[m]),Le.useEffect(()=>{if(!_)x(u||"");else if(G){const We=Gne(O);w(U0.find(de=>de.short===(We==null?void 0:We.country))),x(We==null?void 0:We.nationalNumber)}else x(O)},[O,_,G,u]);const q=We=>{var de;We=(de=We)===null||de===void 0?void 0:de.trim();let F=!1,M="";if(W)Kb.isEmail(We)||(F=!0,M=c.translate("fi_error_piiEmail"));else if(oe){var ee;const me=(ee=We)===null||ee===void 0?void 0:ee.split(" ");(me.length<1||me.length>100)&&(F=!0,M=c.translate("fi_error_piiFullName"))}else if(ye){var le;const me=(le=We)===null||le===void 0?void 0:le.split(" ");(me.length<1||me.length>50)&&(F=!0,M=c.translate("fi_error_piiFirstName"))}else if(be){var ge;const me=(ge=We)===null||ge===void 0?void 0:ge.split(" ");(me.length<1||me.length>50)&&(F=!0,M=c.translate("fi_error_piiLastName"))}else if(G){const me=Gne("".concat(A.phoneCode," ").concat(We),A.short);me!=null&&me.isValid()?We=me.number:(F=!0,M=c.translate("fi_error_piiPhoneNumber"),me!=null&&me.isPossible()&&cf({cb:b.CHATBOT_LOG,payload:{chatbotLogType:Hc.INVALID_PHONE_NUMBER,params:{phoneNumber:me,phoneNumberText:We,phoneNumberArea:A}}}))}if(F){vh.error({title:M,okText:c.translate("fi_button_edit")});return}return t==null?void 0:t(We)},ae=We=>{var de,F,M,ee,le;let{handleContinueBtnClick:ge}=We;return Qe.jsxs(vh,{title:Qe.jsx(co,{children:c.translate("fi_error_notEnoughWords",{minWordCount:i.min})}),visible:C,footer:null,closable:!1,children:[Qe.jsx(co,{children:i.recommend?c.translate("fi_error_notEnoughWordsAim",{minWordCount:i.min,recommendedWordCount:i.recommend}):c.translate("fi_error_notEnoughWordsMin",{minWordCount:i.min})}),Qe.jsx("p",{children:c.translate("fi_error_notEnoughWordsEdit")}),Qe.jsx("p",{children:c.translate("fi_error_notEnoughWordsEditNow")}),Qe.jsxs("div",{style:{display:"flex",justifyContent:"center"},children:[Qe.jsx(Fa,{onClick:()=>S(!1),style:{border:"none",backgroundColor:p==null||(de=p.button)===null||de===void 0?void 0:de.backgroundColor,color:p==null||(F=p.button)===null||F===void 0?void 0:F.fontColor,margin:"10px 5px",width:130},children:c.translate("fi_button_edit")}),Qe.jsx(Fa,{onClick:()=>{ge(),S(!1)},style:{border:"1px solid ".concat(p==null||(M=p.button)===null||M===void 0?void 0:M.backgroundColor),backgroundColor:p==null||(ee=p.button)===null||ee===void 0?void 0:ee.fontColor,color:p==null||(le=p.button)===null||le===void 0?void 0:le.backgroundColor,margin:"10px 5px",width:130},children:c.translate("fi_button_continue")})]}),Qe.jsx("div",{style:{display:"flex",justifyContent:"center"},children:Qe.jsx(Zwe,{onChange:me=>P({value:me.target.checked}),children:c.translate("fi_check_dontShow")})})]})},pe=k(),te=We=>{let{words:de}=We;de<=i.min&&S(!0)},X=(v==null?void 0:v.some(We=>{var de;return We.questionId===T&&We.sender===Co.AGENT&&((de=We.data)===null||de===void 0||(de=de.tags)===null||de===void 0?void 0:de.some(F=>(F==null?void 0:F.name)===_b.ALLOW_PASTE&&(F==null?void 0:F.value)==="true"))}))||h,U=I?c.translate("fi_label_enterOrSkipFeedback"):X?c.translate("fi_label_enterOrPasteResponse"):c.translate("fi_label_enterResponse"),B=c.translate("fi_placeholder_demoEmailInput");let L="text";W?L="email":Q&&(L="search");const $=()=>Qe.jsx(lJe,{isSendButtonShown:l,placeholder:U,onSend:q,sendCircleButtonProps:e,defaultValue:D,onChange:r,wordCountRule:i,renderConfirmModal:ae,doNotShowAgain:pe,handleSendButtonClickCallBack:te,allowPaste:X,renderCancelEditButton:K,assessmentId:E,theme:p,onExtractHumanNameFailedCallback:b==null?void 0:b[Ra.CHATBOT_ERROR],piiQuestionType:z}),K=We=>_?Qe.jsx(uJe,{onClick:()=>{We&&We(),m()},children:d?c.translate("fi_label_cancelEditMobile"):c.translate("fi_label_cancelEditDesktop")}):null,Y=()=>G?Qe.jsx(Bre,{onSelectArea:We=>w(We),defaultArea:A,onSend:q,sendCircleButtonProps:_objectSpread3({size:57,iconSize:22},e),defaultValue:D,onChange:r,allowPaste:X,renderCancelEditButton:K,placeholder:U}):ye||be||oe?$():W||Q?Qe.jsx(W9,{isSendButtonShown:l,placeholder:W?B:U,onSend:q,sendCircleButtonProps:e,defaultValue:D,onChange:r,wordCountRule:i,renderConfirmModal:ae,doNotShowAgain:pe,handleSendButtonClickCallBack:te,enableSubmitShortcut:!0,allowPaste:X,renderCancelEditButton:K,inputMode:L}):I?Qe.jsx(Pre,{isSendButtonShown:l,placeholder:U,onSend:We=>q(We||u6),sendCircleButtonProps:e,defaultValue:D,onChange:r,wordCountRule:null,renderConfirmModal:ae,doNotShowAgain:pe,handleSendButtonClickCallBack:te,allowPaste:X,renderCancelEditButton:K,allowSubmitWithoutText:!0,phChatBotCallback:b}):Qe.jsx(Pre,{isSendButtonShown:l,placeholder:U,onSend:q,sendCircleButtonProps:e,defaultValue:D,onChange:r,wordCountRule:i,renderConfirmModal:ae,doNotShowAgain:pe,handleSendButtonClickCallBack:te,allowPaste:X,renderCancelEditButton:K,phChatBotCallback:b}),xe=()=>G?Qe.jsx(Bre,{onSelectArea:We=>w(We),defaultArea:A,onSend:q,sendCircleButtonProps:_objectSpread3({size:45,iconSize:25},e),defaultValue:D,onChange:r,allowPaste:X,renderCancelEditButton:K,placeholder:U}):ye||be||oe?$():W||Q?Qe.jsx(W9,{isSendButtonShown:l,placeholder:W?B:U,onSend:q,sendCircleButtonProps:e,defaultValue:D,onChange:r,wordCountRule:i,renderConfirmModal:ae,doNotShowAgain:pe,handleSendButtonClickCallBack:te,enableSubmitShortcut:!0,allowPaste:X,renderCancelEditButton:K,inputMode:L}):I?Qe.jsx(Mre,{isEditing:_,hideClickableBar:o,isSendButtonShown:l,placeholder:U,onSend:We=>q(We||u6),sendCircleButtonProps:e,defaultValue:D,onChange:r,wordCountRule:null,renderConfirmModal:ae,doNotShowAgain:pe,handleSendButtonClickCallBack:te,allowPaste:X,renderCancelEditButton:K,phChatBotCallback:b,allowSubmitWithoutText:!0}):Qe.jsx(Mre,{isEditing:_,hideClickableBar:o,isSendButtonShown:l,placeholder:U,onSend:q,sendCircleButtonProps:e,defaultValue:D,onChange:r,wordCountRule:i,renderConfirmModal:ae,doNotShowAgain:pe,handleSendButtonClickCallBack:te,allowPaste:X,renderCancelEditButton:K,phChatBotCallback:b});return d?xe():Y()},Ure="AIzaSyCWSAROQu-uLQmQ-fq0ip7aXHpBjPESaQQ",jre="https://places.googleapis.com/v1",bJe="".concat(jre,"/places:autocomplete"),EJe="".concat(jre,"/places"),_Je=500,TJe="en",SJe=["suggestions.placePrediction.placeId","suggestions.placePrediction.text","suggestions.placePrediction.structuredFormat.mainText","suggestions.placePrediction.structuredFormat.secondaryText"].join(","),CJe=["id","formattedAddress","location","displayName"].join(","),DJe=async(n,e)=>n.trim()?((await Ym.post(bJe,{input:n,languageCode:TJe},{headers:{"Content-Type":"application/json","X-Goog-Api-Key":Ure,"X-Goog-FieldMask":SJe},signal:e})).data.suggestions||[]).map(r=>{var i,o;return{placeId:r.placePrediction.placeId,description:r.placePrediction.text.text,mainText:((i=r.placePrediction.structuredFormat)===null||i===void 0||(i=i.mainText)===null||i===void 0?void 0:i.text)||"",secondaryText:((o=r.placePrediction.structuredFormat)===null||o===void 0||(o=o.secondaryText)===null||o===void 0?void 0:o.text)||""}}):[],AJe=async n=>{var e;const t=await Ym.get("".concat(EJe,"/").concat(n),{headers:{"X-Goog-Api-Key":Ure,"X-Goog-FieldMask":CJe}});return{placeId:t.data.id,formattedAddress:t.data.formattedAddress,location:{lat:t.data.location.latitude,lng:t.data.location.longitude},displayName:(e=t.data.displayName)===null||e===void 0?void 0:e.text}},wJe=n=>Ym.isCancel(n)||(n==null?void 0:n.name)==="AbortError",xJe=()=>{const[n,e]=Le.useState([]),[t,r]=Le.useState(!1),[i,o]=Le.useState(null),l=Le.useRef(null),u=Le.useRef(null);Le.useEffect(()=>()=>{l.current&&clearTimeout(l.current),u.current&&u.current.abort()},[]);const c=Le.useCallback(async m=>{u.current&&u.current.abort(),u.current=new AbortController,r(!0),o(null);try{var p;const g=await DJe(m,(p=u.current)===null||p===void 0?void 0:p.signal);e(g)}catch(g){if(wJe(g))return;const v=g instanceof Error?g.message:"Failed to fetch suggestions";o(v),e([])}finally{r(!1)}},[]),d=Le.useCallback(m=>{if(l.current&&clearTimeout(l.current),!m.trim()){e([]);return}l.current=setTimeout(()=>{c(m)},_Je)},[c]),f=async m=>{try{return await AJe(m)}catch(p){const g=p instanceof Error?p.message:"Failed to fetch place details";return o(g),null}},h=Le.useCallback(()=>{e([]),o(null)},[]);return{suggestions:n,isLoading:t,error:i,getSuggestions:d,getPlaceDetails:f,clearSuggestions:h}},$re={"option-list":"_option-list_was2b_1","option-item":"_option-item_was2b_16"},kJe=n=>{let{onSelectLocation:e,wordCountRule:t,sendCircleButtonProps:r}=n;const[i,o]=Le.useState(),[l,u]=Le.useState(""),[c,d]=Le.useState(!1),{suggestions:f,getSuggestions:h,getPlaceDetails:m,clearSuggestions:p,error:g}=xJe();Le.useEffect(()=>{g&&!c&&d(!0)},[g,c]);const v=_=>{!i&&!c&&(u(_),h(_))},y=async _=>{const T={address:_,coordinate:null};return o(T),e?await e(T):{success:!0}},b=async _=>{const T=await m(_.placeId);if(T){const D={address:T.formattedAddress||_.description,coordinate:T.location};o(D),p(),e&&await e(D)}},E=()=>f.length?Qe.jsx("div",{className:$re["option-list"],children:f.map(_=>Qe.jsx("div",{className:$re["option-item"],onClick:()=>b(_),children:Qe.jsx("span",{children:_.description})},_.placeId))}):null;return c?Qe.jsx(X9,{isSendButtonShown:!0,sendCircleButtonProps:r,wordCountRule:t,onChange:v,onSend:y,initialValue:l}):Qe.jsx(hG,{visible:f.length>0,placement:"top",content:E,trigger:[],children:Qe.jsx(X9,{isSendButtonShown:!0,sendCircleButtonProps:r,wordCountRule:t,onChange:v,onSend:y})})},bAt="",EAt="";let zre=!0,qre=!0;function $E(n,e,t){const r=n.match(e);return r&&r.length>=t&&parseFloat(r[t],10)}function lp(n,e,t){if(!n.RTCPeerConnection)return;const r=n.RTCPeerConnection.prototype,i=r.addEventListener;r.addEventListener=function(l,u){if(l!==e)return i.apply(this,arguments);const c=d=>{const f=t(d);f&&(u.handleEvent?u.handleEvent(f):u(f))};return this._eventMap=this._eventMap||{},this._eventMap[e]||(this._eventMap[e]=new Map),this._eventMap[e].set(u,c),i.apply(this,[l,c])};const o=r.removeEventListener;r.removeEventListener=function(l,u){if(l!==e||!this._eventMap||!this._eventMap[e])return o.apply(this,arguments);if(!this._eventMap[e].has(u))return o.apply(this,arguments);const c=this._eventMap[e].get(u);return this._eventMap[e].delete(u),this._eventMap[e].size===0&&delete this._eventMap[e],Object.keys(this._eventMap).length===0&&delete this._eventMap,o.apply(this,[l,c])},Object.defineProperty(r,"on"+e,{get(){return this["_on"+e]},set(l){this["_on"+e]&&(this.removeEventListener(e,this["_on"+e]),delete this["_on"+e]),l&&this.addEventListener(e,this["_on"+e]=l)},enumerable:!0,configurable:!0})}function IJe(n){return typeof n!="boolean"?new Error("Argument type: "+typeof n+". Please use a boolean."):(zre=n,n?"adapter.js logging disabled":"adapter.js logging enabled")}function RJe(n){return typeof n!="boolean"?new Error("Argument type: "+typeof n+". Please use a boolean."):(qre=!n,"adapter.js deprecation warnings "+(n?"disabled":"enabled"))}function Hre(){if(typeof window=="object"){if(zre)return;typeof console!="undefined"&&typeof console.log=="function"&&console.log.apply(console,arguments)}}function Q9(n,e){qre&&console.warn(n+" is deprecated, please use "+e+" instead.")}function PJe(n){const e={browser:null,version:null};if(typeof n=="undefined"||!n.navigator||!n.navigator.userAgent)return e.browser="Not a browser.",e;const{navigator:t}=n;if(t.userAgentData&&t.userAgentData.brands){const r=t.userAgentData.brands.find(i=>i.brand==="Chromium");if(r)return{browser:"chrome",version:parseInt(r.version,10)}}if(t.mozGetUserMedia)e.browser="firefox",e.version=parseInt($E(t.userAgent,/Firefox\/(\d+)\./,1));else if(t.webkitGetUserMedia||n.isSecureContext===!1&&n.webkitRTCPeerConnection)e.browser="chrome",e.version=parseInt($E(t.userAgent,/Chrom(e|ium)\/(\d+)\./,2));else if(n.RTCPeerConnection&&t.userAgent.match(/AppleWebKit\/(\d+)\./))e.browser="safari",e.version=parseInt($E(t.userAgent,/AppleWebKit\/(\d+)\./,1)),e.supportsUnifiedPlan=n.RTCRtpTransceiver&&"currentDirection"in n.RTCRtpTransceiver.prototype,e._safariVersion=$E(t.userAgent,/Version\/(\d+(\.?\d+))/,1);else return e.browser="Not a supported browser.",e;return e}function Vre(n){return Object.prototype.toString.call(n)==="[object Object]"}function Gre(n){return Vre(n)?Object.keys(n).reduce(function(e,t){const r=Vre(n[t]),i=r?Gre(n[t]):n[t],o=r&&!Object.keys(i).length;return i===void 0||o?e:Object.assign(e,{[t]:i})},{}):n}function Z9(n,e,t){!e||t.has(e.id)||(t.set(e.id,e),Object.keys(e).forEach(r=>{r.endsWith("Id")?Z9(n,n.get(e[r]),t):r.endsWith("Ids")&&e[r].forEach(i=>{Z9(n,n.get(i),t)})}))}function Wre(n,e,t){const r=t?"outbound-rtp":"inbound-rtp",i=new Map;if(e===null)return i;const o=[];return n.forEach(l=>{l.type==="track"&&l.trackIdentifier===e.id&&o.push(l)}),o.forEach(l=>{n.forEach(u=>{u.type===r&&u.trackId===l.id&&Z9(n,u,i)})}),i}const Kre=Hre;function Yre(n,e){const t=n&&n.navigator;if(!t.mediaDevices)return;const r=function(u){if(typeof u!="object"||u.mandatory||u.optional)return u;const c={};return Object.keys(u).forEach(d=>{if(d==="require"||d==="advanced"||d==="mediaSource")return;const f=typeof u[d]=="object"?u[d]:{ideal:u[d]};f.exact!==void 0&&typeof f.exact=="number"&&(f.min=f.max=f.exact);const h=function(m,p){return m?m+p.charAt(0).toUpperCase()+p.slice(1):p==="deviceId"?"sourceId":p};if(f.ideal!==void 0){c.optional=c.optional||[];let m={};typeof f.ideal=="number"?(m[h("min",d)]=f.ideal,c.optional.push(m),m={},m[h("max",d)]=f.ideal,c.optional.push(m)):(m[h("",d)]=f.ideal,c.optional.push(m))}f.exact!==void 0&&typeof f.exact!="number"?(c.mandatory=c.mandatory||{},c.mandatory[h("",d)]=f.exact):["min","max"].forEach(m=>{f[m]!==void 0&&(c.mandatory=c.mandatory||{},c.mandatory[h(m,d)]=f[m])})}),u.advanced&&(c.optional=(c.optional||[]).concat(u.advanced)),c},i=function(u,c){if(e.version>=61)return c(u);if(u=JSON.parse(JSON.stringify(u)),u&&typeof u.audio=="object"){const d=function(f,h,m){h in f&&!(m in f)&&(f[m]=f[h],delete f[h])};u=JSON.parse(JSON.stringify(u)),d(u.audio,"autoGainControl","googAutoGainControl"),d(u.audio,"noiseSuppression","googNoiseSuppression"),u.audio=r(u.audio)}if(u&&typeof u.video=="object"){let d=u.video.facingMode;d=d&&(typeof d=="object"?d:{ideal:d});const f=e.version<66;if(d&&(d.exact==="user"||d.exact==="environment"||d.ideal==="user"||d.ideal==="environment")&&!(t.mediaDevices.getSupportedConstraints&&t.mediaDevices.getSupportedConstraints().facingMode&&!f)){delete u.video.facingMode;let h;if(d.exact==="environment"||d.ideal==="environment"?h=["back","rear"]:(d.exact==="user"||d.ideal==="user")&&(h=["front"]),h)return t.mediaDevices.enumerateDevices().then(m=>{m=m.filter(g=>g.kind==="videoinput");let p=m.find(g=>h.some(v=>g.label.toLowerCase().includes(v)));return!p&&m.length&&h.includes("back")&&(p=m[m.length-1]),p&&(u.video.deviceId=d.exact?{exact:p.deviceId}:{ideal:p.deviceId}),u.video=r(u.video),Kre("chrome: "+JSON.stringify(u)),c(u)})}u.video=r(u.video)}return Kre("chrome: "+JSON.stringify(u)),c(u)},o=function(u){return e.version>=64?u:{name:{PermissionDeniedError:"NotAllowedError",PermissionDismissedError:"NotAllowedError",InvalidStateError:"NotAllowedError",DevicesNotFoundError:"NotFoundError",ConstraintNotSatisfiedError:"OverconstrainedError",TrackStartError:"NotReadableError",MediaDeviceFailedDueToShutdown:"NotAllowedError",MediaDeviceKillSwitchOn:"NotAllowedError",TabCaptureError:"AbortError",ScreenCaptureError:"AbortError",DeviceCaptureError:"AbortError"}[u.name]||u.name,message:u.message,constraint:u.constraint||u.constraintName,toString(){return this.name+(this.message&&": ")+this.message}}},l=function(u,c,d){i(u,f=>{t.webkitGetUserMedia(f,c,h=>{d&&d(o(h))})})};if(t.getUserMedia=l.bind(t),t.mediaDevices.getUserMedia){const u=t.mediaDevices.getUserMedia.bind(t.mediaDevices);t.mediaDevices.getUserMedia=function(c){return i(c,d=>u(d).then(f=>{if(d.audio&&!f.getAudioTracks().length||d.video&&!f.getVideoTracks().length)throw f.getTracks().forEach(h=>{h.stop()}),new DOMException("","NotFoundError");return f},f=>Promise.reject(o(f))))}}}function Xre(n){n.MediaStream=n.MediaStream||n.webkitMediaStream}function Qre(n){if(typeof n=="object"&&n.RTCPeerConnection&&!("ontrack"in n.RTCPeerConnection.prototype)){Object.defineProperty(n.RTCPeerConnection.prototype,"ontrack",{get(){return this._ontrack},set(t){this._ontrack&&this.removeEventListener("track",this._ontrack),this.addEventListener("track",this._ontrack=t)},enumerable:!0,configurable:!0});const e=n.RTCPeerConnection.prototype.setRemoteDescription;n.RTCPeerConnection.prototype.setRemoteDescription=function(){return this._ontrackpoly||(this._ontrackpoly=r=>{r.stream.addEventListener("addtrack",i=>{let o;n.RTCPeerConnection.prototype.getReceivers?o=this.getReceivers().find(u=>u.track&&u.track.id===i.track.id):o={track:i.track};const l=new Event("track");l.track=i.track,l.receiver=o,l.transceiver={receiver:o},l.streams=[r.stream],this.dispatchEvent(l)}),r.stream.getTracks().forEach(i=>{let o;n.RTCPeerConnection.prototype.getReceivers?o=this.getReceivers().find(u=>u.track&&u.track.id===i.id):o={track:i};const l=new Event("track");l.track=i,l.receiver=o,l.transceiver={receiver:o},l.streams=[r.stream],this.dispatchEvent(l)})},this.addEventListener("addstream",this._ontrackpoly)),e.apply(this,arguments)}}else lp(n,"track",e=>(e.transceiver||Object.defineProperty(e,"transceiver",{value:{receiver:e.receiver}}),e))}function Zre(n){if(typeof n=="object"&&n.RTCPeerConnection&&!("getSenders"in n.RTCPeerConnection.prototype)&&"createDTMFSender"in n.RTCPeerConnection.prototype){const e=function(i,o){return{track:o,get dtmf(){return this._dtmf===void 0&&(o.kind==="audio"?this._dtmf=i.createDTMFSender(o):this._dtmf=null),this._dtmf},_pc:i}};if(!n.RTCPeerConnection.prototype.getSenders){n.RTCPeerConnection.prototype.getSenders=function(){return this._senders=this._senders||[],this._senders.slice()};const i=n.RTCPeerConnection.prototype.addTrack;n.RTCPeerConnection.prototype.addTrack=function(u,c){let d=i.apply(this,arguments);return d||(d=e(this,u),this._senders.push(d)),d};const o=n.RTCPeerConnection.prototype.removeTrack;n.RTCPeerConnection.prototype.removeTrack=function(u){o.apply(this,arguments);const c=this._senders.indexOf(u);c!==-1&&this._senders.splice(c,1)}}const t=n.RTCPeerConnection.prototype.addStream;n.RTCPeerConnection.prototype.addStream=function(o){this._senders=this._senders||[],t.apply(this,[o]),o.getTracks().forEach(l=>{this._senders.push(e(this,l))})};const r=n.RTCPeerConnection.prototype.removeStream;n.RTCPeerConnection.prototype.removeStream=function(o){this._senders=this._senders||[],r.apply(this,[o]),o.getTracks().forEach(l=>{const u=this._senders.find(c=>c.track===l);u&&this._senders.splice(this._senders.indexOf(u),1)})}}else if(typeof n=="object"&&n.RTCPeerConnection&&"getSenders"in n.RTCPeerConnection.prototype&&"createDTMFSender"in n.RTCPeerConnection.prototype&&n.RTCRtpSender&&!("dtmf"in n.RTCRtpSender.prototype)){const e=n.RTCPeerConnection.prototype.getSenders;n.RTCPeerConnection.prototype.getSenders=function(){const r=e.apply(this,[]);return r.forEach(i=>i._pc=this),r},Object.defineProperty(n.RTCRtpSender.prototype,"dtmf",{get(){return this._dtmf===void 0&&(this.track.kind==="audio"?this._dtmf=this._pc.createDTMFSender(this.track):this._dtmf=null),this._dtmf}})}}function Jre(n){if(!(typeof n=="object"&&n.RTCPeerConnection&&n.RTCRtpSender&&n.RTCRtpReceiver))return;if(!("getStats"in n.RTCRtpSender.prototype)){const t=n.RTCPeerConnection.prototype.getSenders;t&&(n.RTCPeerConnection.prototype.getSenders=function(){const o=t.apply(this,[]);return o.forEach(l=>l._pc=this),o});const r=n.RTCPeerConnection.prototype.addTrack;r&&(n.RTCPeerConnection.prototype.addTrack=function(){const o=r.apply(this,arguments);return o._pc=this,o}),n.RTCRtpSender.prototype.getStats=function(){const o=this;return this._pc.getStats().then(l=>Wre(l,o.track,!0))}}if(!("getStats"in n.RTCRtpReceiver.prototype)){const t=n.RTCPeerConnection.prototype.getReceivers;t&&(n.RTCPeerConnection.prototype.getReceivers=function(){const i=t.apply(this,[]);return i.forEach(o=>o._pc=this),i}),lp(n,"track",r=>(r.receiver._pc=r.srcElement,r)),n.RTCRtpReceiver.prototype.getStats=function(){const i=this;return this._pc.getStats().then(o=>Wre(o,i.track,!1))}}if(!("getStats"in n.RTCRtpSender.prototype&&"getStats"in n.RTCRtpReceiver.prototype))return;const e=n.RTCPeerConnection.prototype.getStats;n.RTCPeerConnection.prototype.getStats=function(){if(arguments.length>0&&arguments[0]instanceof n.MediaStreamTrack){const r=arguments[0];let i,o,l;return this.getSenders().forEach(u=>{u.track===r&&(i?l=!0:i=u)}),this.getReceivers().forEach(u=>(u.track===r&&(o?l=!0:o=u),u.track===r)),l||i&&o?Promise.reject(new DOMException("There are more than one sender or receiver for the track.","InvalidAccessError")):i?i.getStats():o?o.getStats():Promise.reject(new DOMException("There is no sender or receiver for the track.","InvalidAccessError"))}return e.apply(this,arguments)}}function eie(n){n.RTCPeerConnection.prototype.getLocalStreams=function(){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},Object.keys(this._shimmedLocalStreams).map(l=>this._shimmedLocalStreams[l][0])};const e=n.RTCPeerConnection.prototype.addTrack;n.RTCPeerConnection.prototype.addTrack=function(l,u){if(!u)return e.apply(this,arguments);this._shimmedLocalStreams=this._shimmedLocalStreams||{};const c=e.apply(this,arguments);return this._shimmedLocalStreams[u.id]?this._shimmedLocalStreams[u.id].indexOf(c)===-1&&this._shimmedLocalStreams[u.id].push(c):this._shimmedLocalStreams[u.id]=[u,c],c};const t=n.RTCPeerConnection.prototype.addStream;n.RTCPeerConnection.prototype.addStream=function(l){this._shimmedLocalStreams=this._shimmedLocalStreams||{},l.getTracks().forEach(d=>{if(this.getSenders().find(h=>h.track===d))throw new DOMException("Track already exists.","InvalidAccessError")});const u=this.getSenders();t.apply(this,arguments);const c=this.getSenders().filter(d=>u.indexOf(d)===-1);this._shimmedLocalStreams[l.id]=[l].concat(c)};const r=n.RTCPeerConnection.prototype.removeStream;n.RTCPeerConnection.prototype.removeStream=function(l){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},delete this._shimmedLocalStreams[l.id],r.apply(this,arguments)};const i=n.RTCPeerConnection.prototype.removeTrack;n.RTCPeerConnection.prototype.removeTrack=function(l){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},l&&Object.keys(this._shimmedLocalStreams).forEach(u=>{const c=this._shimmedLocalStreams[u].indexOf(l);c!==-1&&this._shimmedLocalStreams[u].splice(c,1),this._shimmedLocalStreams[u].length===1&&delete this._shimmedLocalStreams[u]}),i.apply(this,arguments)}}function tie(n,e){if(!n.RTCPeerConnection)return;if(n.RTCPeerConnection.prototype.addTrack&&e.version>=65)return eie(n);const t=n.RTCPeerConnection.prototype.getLocalStreams;n.RTCPeerConnection.prototype.getLocalStreams=function(){const f=t.apply(this);return this._reverseStreams=this._reverseStreams||{},f.map(h=>this._reverseStreams[h.id])};const r=n.RTCPeerConnection.prototype.addStream;n.RTCPeerConnection.prototype.addStream=function(f){if(this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},f.getTracks().forEach(h=>{if(this.getSenders().find(p=>p.track===h))throw new DOMException("Track already exists.","InvalidAccessError")}),!this._reverseStreams[f.id]){const h=new n.MediaStream(f.getTracks());this._streams[f.id]=h,this._reverseStreams[h.id]=f,f=h}r.apply(this,[f])};const i=n.RTCPeerConnection.prototype.removeStream;n.RTCPeerConnection.prototype.removeStream=function(f){this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},i.apply(this,[this._streams[f.id]||f]),delete this._reverseStreams[this._streams[f.id]?this._streams[f.id].id:f.id],delete this._streams[f.id]},n.RTCPeerConnection.prototype.addTrack=function(f,h){if(this.signalingState==="closed")throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");const m=[].slice.call(arguments,1);if(m.length!==1||!m[0].getTracks().find(v=>v===f))throw new DOMException("The adapter.js addTrack polyfill only supports a single stream which is associated with the specified track.","NotSupportedError");if(this.getSenders().find(v=>v.track===f))throw new DOMException("Track already exists.","InvalidAccessError");this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{};const g=this._streams[h.id];if(g)g.addTrack(f),Promise.resolve().then(()=>{this.dispatchEvent(new Event("negotiationneeded"))});else{const v=new n.MediaStream([f]);this._streams[h.id]=v,this._reverseStreams[v.id]=h,this.addStream(v)}return this.getSenders().find(v=>v.track===f)};function o(d,f){let h=f.sdp;return Object.keys(d._reverseStreams||[]).forEach(m=>{const p=d._reverseStreams[m],g=d._streams[p.id];h=h.replace(new RegExp(g.id,"g"),p.id)}),new RTCSessionDescription({type:f.type,sdp:h})}function l(d,f){let h=f.sdp;return Object.keys(d._reverseStreams||[]).forEach(m=>{const p=d._reverseStreams[m],g=d._streams[p.id];h=h.replace(new RegExp(p.id,"g"),g.id)}),new RTCSessionDescription({type:f.type,sdp:h})}["createOffer","createAnswer"].forEach(function(d){const f=n.RTCPeerConnection.prototype[d],h={[d](){const m=arguments;return arguments.length&&typeof arguments[0]=="function"?f.apply(this,[g=>{const v=o(this,g);m[0].apply(null,[v])},g=>{m[1]&&m[1].apply(null,g)},arguments[2]]):f.apply(this,arguments).then(g=>o(this,g))}};n.RTCPeerConnection.prototype[d]=h[d]});const u=n.RTCPeerConnection.prototype.setLocalDescription;n.RTCPeerConnection.prototype.setLocalDescription=function(){return!arguments.length||!arguments[0].type?u.apply(this,arguments):(arguments[0]=l(this,arguments[0]),u.apply(this,arguments))};const c=Object.getOwnPropertyDescriptor(n.RTCPeerConnection.prototype,"localDescription");Object.defineProperty(n.RTCPeerConnection.prototype,"localDescription",{get(){const d=c.get.apply(this);return d.type===""?d:o(this,d)}}),n.RTCPeerConnection.prototype.removeTrack=function(f){if(this.signalingState==="closed")throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");if(!f._pc)throw new DOMException("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.","TypeError");if(!(f._pc===this))throw new DOMException("Sender was not created by this connection.","InvalidAccessError");this._streams=this._streams||{};let m;Object.keys(this._streams).forEach(p=>{this._streams[p].getTracks().find(v=>f.track===v)&&(m=this._streams[p])}),m&&(m.getTracks().length===1?this.removeStream(this._reverseStreams[m.id]):m.removeTrack(f.track),this.dispatchEvent(new Event("negotiationneeded")))}}function J9(n,e){!n.RTCPeerConnection&&n.webkitRTCPeerConnection&&(n.RTCPeerConnection=n.webkitRTCPeerConnection),n.RTCPeerConnection&&e.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(t){const r=n.RTCPeerConnection.prototype[t],i={[t](){return arguments[0]=new(t==="addIceCandidate"?n.RTCIceCandidate:n.RTCSessionDescription)(arguments[0]),r.apply(this,arguments)}};n.RTCPeerConnection.prototype[t]=i[t]})}function nie(n,e){lp(n,"negotiationneeded",t=>{const r=t.target;if(!((e.version<72||r.getConfiguration&&r.getConfiguration().sdpSemantics==="plan-b")&&r.signalingState!=="stable"))return t})}const rie=Object.freeze(Object.defineProperty({__proto__:null,fixNegotiationNeeded:nie,shimAddTrackRemoveTrack:tie,shimAddTrackRemoveTrackWithNative:eie,shimGetSendersWithDtmf:Zre,shimGetUserMedia:Yre,shimMediaStream:Xre,shimOnTrack:Qre,shimPeerConnection:J9,shimSenderReceiverGetStats:Jre},Symbol.toStringTag,{value:"Module"}));function iie(n,e){const t=n&&n.navigator,r=n&&n.MediaStreamTrack;if(t.getUserMedia=function(i,o,l){Q9("navigator.getUserMedia","navigator.mediaDevices.getUserMedia"),t.mediaDevices.getUserMedia(i).then(o,l)},!(e.version>55&&"autoGainControl"in t.mediaDevices.getSupportedConstraints())){const i=function(l,u,c){u in l&&!(c in l)&&(l[c]=l[u],delete l[u])},o=t.mediaDevices.getUserMedia.bind(t.mediaDevices);if(t.mediaDevices.getUserMedia=function(l){return typeof l=="object"&&typeof l.audio=="object"&&(l=JSON.parse(JSON.stringify(l)),i(l.audio,"autoGainControl","mozAutoGainControl"),i(l.audio,"noiseSuppression","mozNoiseSuppression")),o(l)},r&&r.prototype.getSettings){const l=r.prototype.getSettings;r.prototype.getSettings=function(){const u=l.apply(this,arguments);return i(u,"mozAutoGainControl","autoGainControl"),i(u,"mozNoiseSuppression","noiseSuppression"),u}}if(r&&r.prototype.applyConstraints){const l=r.prototype.applyConstraints;r.prototype.applyConstraints=function(u){return this.kind==="audio"&&typeof u=="object"&&(u=JSON.parse(JSON.stringify(u)),i(u,"autoGainControl","mozAutoGainControl"),i(u,"noiseSuppression","mozNoiseSuppression")),l.apply(this,[u])}}}}function OJe(n,e){n.navigator.mediaDevices&&"getDisplayMedia"in n.navigator.mediaDevices||n.navigator.mediaDevices&&(n.navigator.mediaDevices.getDisplayMedia=function(r){if(!(r&&r.video)){const i=new DOMException("getDisplayMedia without video constraints is undefined");return i.name="NotFoundError",i.code=8,Promise.reject(i)}return r.video===!0?r.video={mediaSource:e}:r.video.mediaSource=e,n.navigator.mediaDevices.getUserMedia(r)})}function aie(n){typeof n=="object"&&n.RTCTrackEvent&&"receiver"in n.RTCTrackEvent.prototype&&!("transceiver"in n.RTCTrackEvent.prototype)&&Object.defineProperty(n.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function eL(n,e){if(typeof n!="object"||!(n.RTCPeerConnection||n.mozRTCPeerConnection))return;!n.RTCPeerConnection&&n.mozRTCPeerConnection&&(n.RTCPeerConnection=n.mozRTCPeerConnection),e.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(i){const o=n.RTCPeerConnection.prototype[i],l={[i](){return arguments[0]=new(i==="addIceCandidate"?n.RTCIceCandidate:n.RTCSessionDescription)(arguments[0]),o.apply(this,arguments)}};n.RTCPeerConnection.prototype[i]=l[i]});const t={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"},r=n.RTCPeerConnection.prototype.getStats;n.RTCPeerConnection.prototype.getStats=function(){const[o,l,u]=arguments;return r.apply(this,[o||null]).then(c=>{if(e.version<53&&!l)try{c.forEach(d=>{d.type=t[d.type]||d.type})}catch(d){if(d.name!=="TypeError")throw d;c.forEach((f,h)=>{c.set(h,Object.assign({},f,{type:t[f.type]||f.type}))})}return c}).then(l,u)}}function oie(n){if(!(typeof n=="object"&&n.RTCPeerConnection&&n.RTCRtpSender)||n.RTCRtpSender&&"getStats"in n.RTCRtpSender.prototype)return;const e=n.RTCPeerConnection.prototype.getSenders;e&&(n.RTCPeerConnection.prototype.getSenders=function(){const i=e.apply(this,[]);return i.forEach(o=>o._pc=this),i});const t=n.RTCPeerConnection.prototype.addTrack;t&&(n.RTCPeerConnection.prototype.addTrack=function(){const i=t.apply(this,arguments);return i._pc=this,i}),n.RTCRtpSender.prototype.getStats=function(){return this.track?this._pc.getStats(this.track):Promise.resolve(new Map)}}function sie(n){if(!(typeof n=="object"&&n.RTCPeerConnection&&n.RTCRtpSender)||n.RTCRtpSender&&"getStats"in n.RTCRtpReceiver.prototype)return;const e=n.RTCPeerConnection.prototype.getReceivers;e&&(n.RTCPeerConnection.prototype.getReceivers=function(){const r=e.apply(this,[]);return r.forEach(i=>i._pc=this),r}),lp(n,"track",t=>(t.receiver._pc=t.srcElement,t)),n.RTCRtpReceiver.prototype.getStats=function(){return this._pc.getStats(this.track)}}function lie(n){!n.RTCPeerConnection||"removeStream"in n.RTCPeerConnection.prototype||(n.RTCPeerConnection.prototype.removeStream=function(t){Q9("removeStream","removeTrack"),this.getSenders().forEach(r=>{r.track&&t.getTracks().includes(r.track)&&this.removeTrack(r)})})}function uie(n){n.DataChannel&&!n.RTCDataChannel&&(n.RTCDataChannel=n.DataChannel)}function cie(n){if(!(typeof n=="object"&&n.RTCPeerConnection))return;const e=n.RTCPeerConnection.prototype.addTransceiver;e&&(n.RTCPeerConnection.prototype.addTransceiver=function(){this.setParametersPromises=[];let r=arguments[1]&&arguments[1].sendEncodings;r===void 0&&(r=[]),r=[...r];const i=r.length>0;i&&r.forEach(l=>{if("rid"in l&&!/^[a-z0-9]{0,16}$/i.test(l.rid))throw new TypeError("Invalid RID value provided.");if("scaleResolutionDownBy"in l&&!(parseFloat(l.scaleResolutionDownBy)>=1))throw new RangeError("scale_resolution_down_by must be >= 1.0");if("maxFramerate"in l&&!(parseFloat(l.maxFramerate)>=0))throw new RangeError("max_framerate must be >= 0.0")});const o=e.apply(this,arguments);if(i){const{sender:l}=o,u=l.getParameters();(!("encodings"in u)||u.encodings.length===1&&Object.keys(u.encodings[0]).length===0)&&(u.encodings=r,l.sendEncodings=r,this.setParametersPromises.push(l.setParameters(u).then(()=>{delete l.sendEncodings}).catch(()=>{delete l.sendEncodings})))}return o})}function die(n){if(!(typeof n=="object"&&n.RTCRtpSender))return;const e=n.RTCRtpSender.prototype.getParameters;e&&(n.RTCRtpSender.prototype.getParameters=function(){const r=e.apply(this,arguments);return"encodings"in r||(r.encodings=[].concat(this.sendEncodings||[{}])),r})}function fie(n){if(!(typeof n=="object"&&n.RTCPeerConnection))return;const e=n.RTCPeerConnection.prototype.createOffer;n.RTCPeerConnection.prototype.createOffer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then(()=>e.apply(this,arguments)).finally(()=>{this.setParametersPromises=[]}):e.apply(this,arguments)}}function hie(n){if(!(typeof n=="object"&&n.RTCPeerConnection))return;const e=n.RTCPeerConnection.prototype.createAnswer;n.RTCPeerConnection.prototype.createAnswer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then(()=>e.apply(this,arguments)).finally(()=>{this.setParametersPromises=[]}):e.apply(this,arguments)}}const mie=Object.freeze(Object.defineProperty({__proto__:null,shimAddTransceiver:cie,shimCreateAnswer:hie,shimCreateOffer:fie,shimGetDisplayMedia:OJe,shimGetParameters:die,shimGetUserMedia:iie,shimOnTrack:aie,shimPeerConnection:eL,shimRTCDataChannel:uie,shimReceiverGetStats:sie,shimRemoveStream:lie,shimSenderGetStats:oie},Symbol.toStringTag,{value:"Module"}));function pie(n){if(!(typeof n!="object"||!n.RTCPeerConnection)){if("getLocalStreams"in n.RTCPeerConnection.prototype||(n.RTCPeerConnection.prototype.getLocalStreams=function(){return this._localStreams||(this._localStreams=[]),this._localStreams}),!("addStream"in n.RTCPeerConnection.prototype)){const e=n.RTCPeerConnection.prototype.addTrack;n.RTCPeerConnection.prototype.addStream=function(r){this._localStreams||(this._localStreams=[]),this._localStreams.includes(r)||this._localStreams.push(r),r.getAudioTracks().forEach(i=>e.call(this,i,r)),r.getVideoTracks().forEach(i=>e.call(this,i,r))},n.RTCPeerConnection.prototype.addTrack=function(r){for(var i=arguments.length,o=new Array(i>1?i-1:0),l=1;l<i;l++)o[l-1]=arguments[l];return o&&o.forEach(u=>{this._localStreams?this._localStreams.includes(u)||this._localStreams.push(u):this._localStreams=[u]}),e.apply(this,arguments)}}"removeStream"in n.RTCPeerConnection.prototype||(n.RTCPeerConnection.prototype.removeStream=function(t){this._localStreams||(this._localStreams=[]);const r=this._localStreams.indexOf(t);if(r===-1)return;this._localStreams.splice(r,1);const i=t.getTracks();this.getSenders().forEach(o=>{i.includes(o.track)&&this.removeTrack(o)})})}}function gie(n){if(!(typeof n!="object"||!n.RTCPeerConnection)&&("getRemoteStreams"in n.RTCPeerConnection.prototype||(n.RTCPeerConnection.prototype.getRemoteStreams=function(){return this._remoteStreams?this._remoteStreams:[]}),!("onaddstream"in n.RTCPeerConnection.prototype))){Object.defineProperty(n.RTCPeerConnection.prototype,"onaddstream",{get(){return this._onaddstream},set(t){this._onaddstream&&(this.removeEventListener("addstream",this._onaddstream),this.removeEventListener("track",this._onaddstreampoly)),this.addEventListener("addstream",this._onaddstream=t),this.addEventListener("track",this._onaddstreampoly=r=>{r.streams.forEach(i=>{if(this._remoteStreams||(this._remoteStreams=[]),this._remoteStreams.includes(i))return;this._remoteStreams.push(i);const o=new Event("addstream");o.stream=i,this.dispatchEvent(o)})})}});const e=n.RTCPeerConnection.prototype.setRemoteDescription;n.RTCPeerConnection.prototype.setRemoteDescription=function(){const r=this;return this._onaddstreampoly||this.addEventListener("track",this._onaddstreampoly=function(i){i.streams.forEach(o=>{if(r._remoteStreams||(r._remoteStreams=[]),r._remoteStreams.indexOf(o)>=0)return;r._remoteStreams.push(o);const l=new Event("addstream");l.stream=o,r.dispatchEvent(l)})}),e.apply(r,arguments)}}}function vie(n){if(typeof n!="object"||!n.RTCPeerConnection)return;const e=n.RTCPeerConnection.prototype,t=e.createOffer,r=e.createAnswer,i=e.setLocalDescription,o=e.setRemoteDescription,l=e.addIceCandidate;e.createOffer=function(d,f){const h=arguments.length>=2?arguments[2]:arguments[0],m=t.apply(this,[h]);return f?(m.then(d,f),Promise.resolve()):m},e.createAnswer=function(d,f){const h=arguments.length>=2?arguments[2]:arguments[0],m=r.apply(this,[h]);return f?(m.then(d,f),Promise.resolve()):m};let u=function(c,d,f){const h=i.apply(this,[c]);return f?(h.then(d,f),Promise.resolve()):h};e.setLocalDescription=u,u=function(c,d,f){const h=o.apply(this,[c]);return f?(h.then(d,f),Promise.resolve()):h},e.setRemoteDescription=u,u=function(c,d,f){const h=l.apply(this,[c]);return f?(h.then(d,f),Promise.resolve()):h},e.addIceCandidate=u}function yie(n){const e=n&&n.navigator;if(e.mediaDevices&&e.mediaDevices.getUserMedia){const t=e.mediaDevices,r=t.getUserMedia.bind(t);e.mediaDevices.getUserMedia=i=>r(bie(i))}!e.getUserMedia&&e.mediaDevices&&e.mediaDevices.getUserMedia&&(e.getUserMedia=function(r,i,o){e.mediaDevices.getUserMedia(r).then(i,o)}.bind(e))}function bie(n){return n&&n.video!==void 0?Object.assign({},n,{video:Gre(n.video)}):n}function Eie(n){if(!n.RTCPeerConnection)return;const e=n.RTCPeerConnection;n.RTCPeerConnection=function(r,i){if(r&&r.iceServers){const o=[];for(let l=0;l<r.iceServers.length;l++){let u=r.iceServers[l];u.urls===void 0&&u.url?(Q9("RTCIceServer.url","RTCIceServer.urls"),u=JSON.parse(JSON.stringify(u)),u.urls=u.url,delete u.url,o.push(u)):o.push(r.iceServers[l])}r.iceServers=o}return new e(r,i)},n.RTCPeerConnection.prototype=e.prototype,"generateCertificate"in e&&Object.defineProperty(n.RTCPeerConnection,"generateCertificate",{get(){return e.generateCertificate}})}function _ie(n){typeof n=="object"&&n.RTCTrackEvent&&"receiver"in n.RTCTrackEvent.prototype&&!("transceiver"in n.RTCTrackEvent.prototype)&&Object.defineProperty(n.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function Tie(n){const e=n.RTCPeerConnection.prototype.createOffer;n.RTCPeerConnection.prototype.createOffer=function(r){if(r){typeof r.offerToReceiveAudio!="undefined"&&(r.offerToReceiveAudio=!!r.offerToReceiveAudio);const i=this.getTransceivers().find(l=>l.receiver.track.kind==="audio");r.offerToReceiveAudio===!1&&i?i.direction==="sendrecv"?i.setDirection?i.setDirection("sendonly"):i.direction="sendonly":i.direction==="recvonly"&&(i.setDirection?i.setDirection("inactive"):i.direction="inactive"):r.offerToReceiveAudio===!0&&!i&&this.addTransceiver("audio",{direction:"recvonly"}),typeof r.offerToReceiveVideo!="undefined"&&(r.offerToReceiveVideo=!!r.offerToReceiveVideo);const o=this.getTransceivers().find(l=>l.receiver.track.kind==="video");r.offerToReceiveVideo===!1&&o?o.direction==="sendrecv"?o.setDirection?o.setDirection("sendonly"):o.direction="sendonly":o.direction==="recvonly"&&(o.setDirection?o.setDirection("inactive"):o.direction="inactive"):r.offerToReceiveVideo===!0&&!o&&this.addTransceiver("video",{direction:"recvonly"})}return e.apply(this,arguments)}}function Sie(n){typeof n!="object"||n.AudioContext||(n.AudioContext=n.webkitAudioContext)}const Cie=Object.freeze(Object.defineProperty({__proto__:null,shimAudioContext:Sie,shimCallbacksAPI:vie,shimConstraints:bie,shimCreateOfferLegacy:Tie,shimGetUserMedia:yie,shimLocalStreamsAPI:pie,shimRTCIceServerUrls:Eie,shimRemoteStreamsAPI:gie,shimTrackEventTransceiver:_ie},Symbol.toStringTag,{value:"Module"}));var Die={exports:{}};(function(n){const e={};e.generateIdentifier=function(){return Math.random().toString(36).substring(2,12)},e.localCName=e.generateIdentifier(),e.splitLines=function(t){return t.trim().split(`
|
|
503
503
|
`).map(r=>r.trim())},e.splitSections=function(t){return t.split(`
|
|
504
504
|
m=`).map((i,o)=>(o>0?"m="+i:i).trim()+`\r
|
|
505
505
|
`)},e.getDescription=function(t){const r=e.splitSections(t);return r&&r[0]},e.getMediaSections=function(t){const r=e.splitSections(t);return r.shift(),r},e.matchPrefix=function(t,r){return e.splitLines(t).filter(i=>i.indexOf(r)===0)},e.parseCandidate=function(t){let r;t.indexOf("a=candidate:")===0?r=t.substring(12).split(" "):r=t.substring(10).split(" ");const i={foundation:r[0],component:{1:"rtp",2:"rtcp"}[r[1]]||r[1],protocol:r[2].toLowerCase(),priority:parseInt(r[3],10),ip:r[4],address:r[4],port:parseInt(r[5],10),type:r[7]};for(let o=8;o<r.length;o+=2)switch(r[o]){case"raddr":i.relatedAddress=r[o+1];break;case"rport":i.relatedPort=parseInt(r[o+1],10);break;case"tcptype":i.tcpType=r[o+1];break;case"ufrag":i.ufrag=r[o+1],i.usernameFragment=r[o+1];break;default:i[r[o]]===void 0&&(i[r[o]]=r[o+1]);break}return i},e.writeCandidate=function(t){const r=[];r.push(t.foundation);const i=t.component;i==="rtp"?r.push(1):i==="rtcp"?r.push(2):r.push(i),r.push(t.protocol.toUpperCase()),r.push(t.priority),r.push(t.address||t.ip),r.push(t.port);const o=t.type;return r.push("typ"),r.push(o),o!=="host"&&t.relatedAddress&&t.relatedPort&&(r.push("raddr"),r.push(t.relatedAddress),r.push("rport"),r.push(t.relatedPort)),t.tcpType&&t.protocol.toLowerCase()==="tcp"&&(r.push("tcptype"),r.push(t.tcpType)),(t.usernameFragment||t.ufrag)&&(r.push("ufrag"),r.push(t.usernameFragment||t.ufrag)),"candidate:"+r.join(" ")},e.parseIceOptions=function(t){return t.substring(14).split(" ")},e.parseRtpMap=function(t){let r=t.substring(9).split(" ");const i={payloadType:parseInt(r.shift(),10)};return r=r[0].split("/"),i.name=r[0],i.clockRate=parseInt(r[1],10),i.channels=r.length===3?parseInt(r[2],10):1,i.numChannels=i.channels,i},e.writeRtpMap=function(t){let r=t.payloadType;t.preferredPayloadType!==void 0&&(r=t.preferredPayloadType);const i=t.channels||t.numChannels||1;return"a=rtpmap:"+r+" "+t.name+"/"+t.clockRate+(i!==1?"/"+i:"")+`\r
|