santoid-sdk 4.0.0 → 4.0.1

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.
@@ -0,0 +1,290 @@
1
+ INFO: Scanner configuration file: /opt/sonar-scanner/conf/sonar-scanner.properties
2
+ INFO: Project root configuration file: NONE
3
+ INFO: SonarScanner 5.0.1.3006
4
+ INFO: Java 17.0.8 Amazon.com Inc. (64-bit)
5
+ INFO: Linux 5.15.0-1062-aws amd64
6
+ INFO: Bitbucket Cloud Pipelines detected, no host variable set. Defaulting to sonarcloud.io.
7
+ INFO: User cache: /root/.sonar/cache
8
+ INFO: Analyzing on SonarQube server 8.0.0.55282
9
+ INFO: Default locale: "en", source code encoding: "UTF-8" (analysis is platform dependent)
10
+ INFO: Load global settings
11
+ INFO: Load global settings (done) | time=415ms
12
+ INFO: Server id: 1BD809FA-AWHW8ct9-T_TB3XqouNu
13
+ INFO: Loading required plugins
14
+ INFO: Load plugins index
15
+ INFO: Load plugins index (done) | time=140ms
16
+ INFO: Load/download plugins
17
+ INFO: Load/download plugins (done) | time=536ms
18
+ INFO: Found an active CI vendor: 'Bitbucket Pipelines'
19
+ INFO: Detected project key 'santodigital_santoid-sdk-javascript' from 'Bitbucket Cloud Pipelines'
20
+ INFO: Detected organization key 'santodigital' from 'Bitbucket Cloud Pipelines'
21
+ INFO: Load project settings for component key: 'santodigital_santoid-sdk-javascript'
22
+ INFO: Load project settings for component key: 'santodigital_santoid-sdk-javascript' (done) | time=170ms
23
+ INFO: Process project properties
24
+ INFO: Project key: santodigital_santoid-sdk-javascript
25
+ INFO: Base dir: /opt/atlassian/pipelines/agent/build
26
+ INFO: Working dir: /opt/atlassian/pipelines/agent/build/.scannerwork
27
+ INFO: Load project branches
28
+ INFO: Load project branches (done) | time=139ms
29
+ INFO: Check ALM binding of project 'santodigital_santoid-sdk-javascript'
30
+ INFO: Detected project binding: BOUND
31
+ INFO: Check ALM binding of project 'santodigital_santoid-sdk-javascript' (done) | time=132ms
32
+ INFO: Load project pull requests
33
+ INFO: Load project pull requests (done) | time=138ms
34
+ INFO: Load branch configuration
35
+ INFO: Detected analysis for branch 'feature/SAN-5656'
36
+ INFO: Auto-configuring branch feature/SAN-5656
37
+ INFO: Load branch configuration (done) | time=3ms
38
+ INFO: Load quality profiles
39
+ INFO: Load quality profiles (done) | time=215ms
40
+ INFO: Load active rules
41
+ INFO: Load active rules (done) | time=5699ms
42
+ INFO: Organization key: santodigital
43
+ INFO: Branch name: feature/SAN-5656, type: short-lived
44
+ INFO: Preprocessing files...
45
+ INFO: 1 language detected in 38 preprocessed files
46
+ INFO: 0 files ignored because of inclusion/exclusion patterns
47
+ INFO: 0 files ignored because of scm ignore settings
48
+ INFO: Loading plugins for detected languages
49
+ INFO: Load/download plugins
50
+ INFO: Load/download plugins (done) | time=798ms
51
+ INFO: Load project repositories
52
+ INFO: Load project repositories (done) | time=201ms
53
+ INFO: SCM collecting changed files in the branch
54
+ WARN: Could not find ref: master in refs/heads, refs/remotes/upstream or refs/remotes/origin
55
+ INFO: SCM collecting changed files in the branch (done) | time=146ms
56
+ INFO: Indexing files...
57
+ INFO: Project configuration:
58
+ INFO: Excluded sources: **/build-wrapper-dump.json, __tests__/**/*.test.ts
59
+ INFO: Included tests: __tests__/**/*.test.ts
60
+ INFO: 38 files indexed
61
+ INFO: Quality profile for ts: Sonar way
62
+ INFO: ------------- Run sensors on module santodigital_santoid-sdk-javascript
63
+ INFO: Load metrics repository
64
+ INFO: Load metrics repository (done) | time=109ms
65
+ INFO: Sensor cache enabled
66
+ INFO: Load sensor cache
67
+ INFO: Load sensor cache (404) | time=364ms
68
+ INFO: Sensor JaCoCo XML Report Importer [jacoco]
69
+ INFO: 'sonar.coverage.jacoco.xmlReportPaths' is not defined. Using default locations: target/site/jacoco/jacoco.xml,target/site/jacoco-it/jacoco.xml,build/reports/jacoco/test/jacocoTestReport.xml
70
+ INFO: No report imported, no coverage information will be imported by JaCoCo XML Report Importer
71
+ INFO: Sensor JaCoCo XML Report Importer [jacoco] (done) | time=5ms
72
+ INFO: Sensor Java Config Sensor [iac]
73
+ INFO: 0 source files to be analyzed
74
+ INFO: 0/0 source files have been analyzed
75
+ INFO: Sensor Java Config Sensor [iac] (done) | time=49ms
76
+ INFO: Sensor JavaScript/TypeScript analysis [javascript]
77
+ INFO: Detected os: Linux arch: amd64 alpine: false. Platform: LINUX_X64
78
+ INFO: Using embedded Node.js runtime
79
+ INFO: Using Node.js executable: '/root/.sonar/js/node-runtime/node'.
80
+ INFO: Memory configuration: OS (31628 MB), Node.js (4144 MB).
81
+ INFO: Found 1 tsconfig.json file(s): [/opt/atlassian/pipelines/agent/build/tsconfig.json]
82
+ INFO: Creating TypeScript program
83
+ INFO: TypeScript configuration file /opt/atlassian/pipelines/agent/build/tsconfig.json
84
+ INFO: 38 source files to be analyzed
85
+ INFO: Starting analysis with current program
86
+ INFO: Analyzed 38 file(s) with current program
87
+ INFO: 38/38 source files have been analyzed
88
+ INFO: Hit the cache for 0 out of 38
89
+ INFO: Miss the cache for 38 out of 38: ANALYSIS_MODE_INELIGIBLE [38/38]
90
+ INFO: Sensor JavaScript/TypeScript analysis [javascript] (done) | time=13586ms
91
+ INFO: Sensor CSS Rules [javascript]
92
+ INFO: No CSS, PHP, HTML or VueJS files are found in the project. CSS analysis is skipped.
93
+ INFO: Sensor CSS Rules [javascript] (done) | time=1ms
94
+ INFO: Sensor JavaScript/TypeScript Coverage [javascript]
95
+ INFO: Analysing [/opt/atlassian/pipelines/agent/build/coverage/lcov.info]
96
+ INFO: Sensor JavaScript/TypeScript Coverage [javascript] (done) | time=26ms
97
+ INFO: Sensor IaC Docker Sensor [iac]
98
+ INFO: 0 source files to be analyzed
99
+ INFO: 0/0 source files have been analyzed
100
+ INFO: Sensor IaC Docker Sensor [iac] (done) | time=65ms
101
+ INFO: Sensor Serverless configuration file sensor [security]
102
+ INFO: 0 Serverless function entries were found in the project
103
+ INFO: 0 Serverless function handlers were kept as entrypoints
104
+ INFO: Sensor Serverless configuration file sensor [security] (done) | time=5ms
105
+ INFO: Sensor AWS SAM template file sensor [security]
106
+ INFO: Sensor AWS SAM template file sensor [security] (done) | time=1ms
107
+ INFO: Sensor AWS SAM Inline template file sensor [security]
108
+ INFO: Sensor AWS SAM Inline template file sensor [security] (done) | time=1ms
109
+ INFO: Sensor TextAndSecretsSensor [text]
110
+ INFO: Available processors: 8
111
+ INFO: Using 8 threads for analysis.
112
+ INFO: 38 source files to be analyzed
113
+ INFO: 38/38 source files have been analyzed
114
+ INFO: Sensor TextAndSecretsSensor [text] (done) | time=806ms
115
+ INFO: Sensor JavaSecuritySensor [security]
116
+ INFO: Enabled taint analysis rules: S2076, S2078, S2083, S2091, S2631, S3649, S5131, S5135, S5144, S5145, S5146, S5147, S5334, S5883, S6096, S6173, S6287, S6350, S6384, S6390, S6398, S6399, S6547, S6549
117
+ INFO: Load type hierarchy and UCFGs: Starting
118
+ INFO: Load type hierarchy: Starting
119
+ INFO: Reading type hierarchy from: /opt/atlassian/pipelines/agent/build/.scannerwork/ucfg2/java
120
+ INFO: Read 0 type definitions
121
+ INFO: Load type hierarchy: Time spent was 00:00:00.003
122
+ INFO: Load UCFGs: Starting
123
+ INFO: Load UCFGs: Time spent was 00:00:00.000
124
+ INFO: Load type hierarchy and UCFGs: Time spent was 00:00:00.004
125
+ INFO: No UCFGs have been included for analysis.
126
+ INFO: java security sensor: Time spent was 00:00:00.098
127
+ INFO: java security sensor: Begin: 2024-06-19T16:14:36.538812451Z, End: 2024-06-19T16:14:36.637468068Z, Duration: 00:00:00.098
128
+ Load type hierarchy and UCFGs: Begin: 2024-06-19T16:14:36.541288811Z, End: 2024-06-19T16:14:36.545537533Z, Duration: 00:00:00.004
129
+ Load type hierarchy: Begin: 2024-06-19T16:14:36.541353543Z, End: 2024-06-19T16:14:36.544909456Z, Duration: 00:00:00.003
130
+ Load UCFGs: Begin: 2024-06-19T16:14:36.545320352Z, End: 2024-06-19T16:14:36.545383230Z, Duration: 00:00:00.000
131
+ INFO: java security sensor peak memory: 133 MB
132
+ INFO: Sensor JavaSecuritySensor [security] (done) | time=130ms
133
+ INFO: Sensor CSharpSecuritySensor [security]
134
+ INFO: Enabled taint analysis rules: S2076, S2078, S2083, S2091, S2631, S3649, S5131, S5135, S5144, S5145, S5146, S5334, S5883, S6096, S6173, S6287, S6350, S6399, S6639, S6641
135
+ INFO: Load type hierarchy and UCFGs: Starting
136
+ INFO: Load type hierarchy: Starting
137
+ INFO: Reading type hierarchy from: /opt/atlassian/pipelines/agent/build/ucfg2/cs
138
+ INFO: Read 0 type definitions
139
+ INFO: Load type hierarchy: Time spent was 00:00:00.000
140
+ INFO: Load UCFGs: Starting
141
+ INFO: Load UCFGs: Time spent was 00:00:00.000
142
+ INFO: Load type hierarchy and UCFGs: Time spent was 00:00:00.000
143
+ INFO: No UCFGs have been included for analysis.
144
+ INFO: csharp security sensor: Time spent was 00:00:00.001
145
+ INFO: csharp security sensor: Begin: 2024-06-19T16:14:36.656168342Z, End: 2024-06-19T16:14:36.657548361Z, Duration: 00:00:00.001
146
+ Load type hierarchy and UCFGs: Begin: 2024-06-19T16:14:36.656397072Z, End: 2024-06-19T16:14:36.657150518Z, Duration: 00:00:00.000
147
+ Load type hierarchy: Begin: 2024-06-19T16:14:36.656417624Z, End: 2024-06-19T16:14:36.656757570Z, Duration: 00:00:00.000
148
+ Load UCFGs: Begin: 2024-06-19T16:14:36.656964011Z, End: 2024-06-19T16:14:36.657029138Z, Duration: 00:00:00.000
149
+ INFO: csharp security sensor peak memory: 133 MB
150
+ INFO: Sensor CSharpSecuritySensor [security] (done) | time=2ms
151
+ INFO: Sensor PhpSecuritySensor [security]
152
+ INFO: Enabled taint analysis rules: S2076, S2078, S2083, S2091, S2631, S3649, S5131, S5135, S5144, S5145, S5146, S5334, S5335, S5883, S6173, S6287, S6350
153
+ INFO: Load type hierarchy and UCFGs: Starting
154
+ INFO: Load type hierarchy: Starting
155
+ INFO: Reading type hierarchy from: /opt/atlassian/pipelines/agent/build/.scannerwork/ucfg2/php
156
+ INFO: Read 0 type definitions
157
+ INFO: Load type hierarchy: Time spent was 00:00:00.000
158
+ INFO: Load UCFGs: Starting
159
+ INFO: Load UCFGs: Time spent was 00:00:00.000
160
+ INFO: Load type hierarchy and UCFGs: Time spent was 00:00:00.000
161
+ INFO: No UCFGs have been included for analysis.
162
+ INFO: php security sensor: Time spent was 00:00:00.000
163
+ INFO: php security sensor: Begin: 2024-06-19T16:14:36.658409979Z, End: 2024-06-19T16:14:36.659380003Z, Duration: 00:00:00.000
164
+ Load type hierarchy and UCFGs: Begin: 2024-06-19T16:14:36.658581316Z, End: 2024-06-19T16:14:36.659030804Z, Duration: 00:00:00.000
165
+ Load type hierarchy: Begin: 2024-06-19T16:14:36.658595263Z, End: 2024-06-19T16:14:36.658725357Z, Duration: 00:00:00.000
166
+ Load UCFGs: Begin: 2024-06-19T16:14:36.658868726Z, End: 2024-06-19T16:14:36.658908623Z, Duration: 00:00:00.000
167
+ INFO: php security sensor peak memory: 133 MB
168
+ INFO: Sensor PhpSecuritySensor [security] (done) | time=1ms
169
+ INFO: Sensor PythonSecuritySensor [security]
170
+ INFO: Enabled taint analysis rules: S2076, S2078, S2083, S2091, S2631, S3649, S5131, S5135, S5144, S5145, S5146, S5147, S5334, S5496, S6287, S6350, S6639, S6680, S6776, S6839
171
+ INFO: Load type hierarchy and UCFGs: Starting
172
+ INFO: Load type hierarchy: Starting
173
+ INFO: Reading type hierarchy from: /opt/atlassian/pipelines/agent/build/.scannerwork/ucfg2/python
174
+ INFO: Read 0 type definitions
175
+ INFO: Load type hierarchy: Time spent was 00:00:00.000
176
+ INFO: Load UCFGs: Starting
177
+ INFO: Load UCFGs: Time spent was 00:00:00.000
178
+ INFO: Load type hierarchy and UCFGs: Time spent was 00:00:00.000
179
+ INFO: No UCFGs have been included for analysis.
180
+ INFO: python security sensor: Time spent was 00:00:00.000
181
+ INFO: python security sensor: Begin: 2024-06-19T16:14:36.660202383Z, End: 2024-06-19T16:14:36.661034793Z, Duration: 00:00:00.000
182
+ Load type hierarchy and UCFGs: Begin: 2024-06-19T16:14:36.660336035Z, End: 2024-06-19T16:14:36.660695984Z, Duration: 00:00:00.000
183
+ Load type hierarchy: Begin: 2024-06-19T16:14:36.660357499Z, End: 2024-06-19T16:14:36.660468856Z, Duration: 00:00:00.000
184
+ Load UCFGs: Begin: 2024-06-19T16:14:36.660578950Z, End: 2024-06-19T16:14:36.660603246Z, Duration: 00:00:00.000
185
+ INFO: python security sensor peak memory: 133 MB
186
+ INFO: Sensor PythonSecuritySensor [security] (done) | time=1ms
187
+ INFO: Sensor JsSecuritySensor [security]
188
+ INFO: Enabled taint analysis rules: S2631, S2076, S5131, S5146, S6105, S6350, S3649, S5144, S2083, S5147, S5334, S5883, S5696, S6096, S6287
189
+ INFO: Load type hierarchy and UCFGs: Starting
190
+ INFO: Load type hierarchy: Starting
191
+ INFO: Reading type hierarchy from: /opt/atlassian/pipelines/agent/build/.scannerwork/ucfg2/js
192
+ INFO: Read 0 type definitions
193
+ INFO: Load type hierarchy: Time spent was 00:00:00.007
194
+ INFO: Load UCFGs: Starting
195
+ INFO: Reading UCFGs from: /opt/atlassian/pipelines/agent/build/.scannerwork/ucfg2/js
196
+ INFO: Load UCFGs: Time spent was 00:00:00.387
197
+ INFO: Load type hierarchy and UCFGs: Time spent was 00:00:00.395
198
+ INFO: Analyzing 152 UCFGs to detect vulnerabilities.
199
+ INFO: Check cache: Starting
200
+ INFO: Load cache: Starting
201
+ INFO: Load cache: Time spent was 00:00:00.000
202
+ INFO: Check cache: Time spent was 00:00:00.005
203
+ INFO: Create runtime call graph: Starting
204
+ INFO: Variable Type Analysis #1: Starting
205
+ INFO: Create runtime type propagation graph: Starting
206
+ INFO: Create runtime type propagation graph: Time spent was 00:00:00.060
207
+ INFO: Run SCC (Tarjan) on 855 nodes: Starting
208
+ INFO: Run SCC (Tarjan) on 855 nodes: Time spent was 00:00:00.019
209
+ INFO: Tarjan found 855 strongly connected components
210
+ INFO: Propagate runtime types to strongly connected components: Starting
211
+ INFO: Propagate runtime types to strongly connected components: Time spent was 00:00:00.049
212
+ INFO: Variable Type Analysis #1: Time spent was 00:00:00.163
213
+ INFO: Variable Type Analysis #2: Starting
214
+ INFO: Create runtime type propagation graph: Starting
215
+ INFO: Create runtime type propagation graph: Time spent was 00:00:00.046
216
+ INFO: Run SCC (Tarjan) on 855 nodes: Starting
217
+ INFO: Run SCC (Tarjan) on 855 nodes: Time spent was 00:00:00.001
218
+ INFO: Tarjan found 855 strongly connected components
219
+ INFO: Propagate runtime types to strongly connected components: Starting
220
+ INFO: Propagate runtime types to strongly connected components: Time spent was 00:00:00.002
221
+ INFO: Variable Type Analysis #2: Time spent was 00:00:00.055
222
+ INFO: Create runtime call graph: Time spent was 00:00:00.273
223
+ INFO: Load config: Starting
224
+ INFO: Load config: Time spent was 00:00:00.224
225
+ INFO: Compute entry points: Starting
226
+ INFO: Compute entry points: Time spent was 00:00:00.199
227
+ INFO: All rules entry points : 28
228
+ INFO: Slice call graph: Starting
229
+ INFO: Slice call graph: Time spent was 00:00:00.000
230
+ INFO: Live variable analysis: Starting
231
+ INFO: Live variable analysis: Time spent was 00:00:00.048
232
+ INFO: Taint analysis for js: Starting
233
+ INFO: 0 / 152 UCFGs simulated, memory usage: 100 MB
234
+ INFO: 28 / 152 UCFGs simulated, memory usage: 123 MB
235
+ INFO: Taint analysis for js: Time spent was 00:00:25.471
236
+ INFO: Report issues: Starting
237
+ INFO: Report issues: Time spent was 00:00:00.006
238
+ INFO: Store cache: Starting
239
+ INFO: Store cache: Time spent was 00:00:00.007
240
+ INFO: js security sensor: Time spent was 00:00:26.645
241
+ INFO: js security sensor: Begin: 2024-06-19T16:14:36.661822382Z, End: 2024-06-19T16:15:03.307408435Z, Duration: 00:00:26.645
242
+ Load type hierarchy and UCFGs: Begin: 2024-06-19T16:14:36.662014487Z, End: 2024-06-19T16:14:37.057894290Z, Duration: 00:00:00.395
243
+ Load type hierarchy: Begin: 2024-06-19T16:14:36.662034178Z, End: 2024-06-19T16:14:36.669236174Z, Duration: 00:00:00.007
244
+ Load UCFGs: Begin: 2024-06-19T16:14:36.669422197Z, End: 2024-06-19T16:14:37.057096785Z, Duration: 00:00:00.387
245
+ Check cache: Begin: 2024-06-19T16:14:37.058145299Z, End: 2024-06-19T16:14:37.063262991Z, Duration: 00:00:00.005
246
+ Load cache: Begin: 2024-06-19T16:14:37.058180849Z, End: 2024-06-19T16:14:37.058247672Z, Duration: 00:00:00.000
247
+ Create runtime call graph: Begin: 2024-06-19T16:14:37.063437537Z, End: 2024-06-19T16:14:37.337185065Z, Duration: 00:00:00.273
248
+ Variable Type Analysis #1: Begin: 2024-06-19T16:14:37.073032400Z, End: 2024-06-19T16:14:37.236311273Z, Duration: 00:00:00.163
249
+ Create runtime type propagation graph: Begin: 2024-06-19T16:14:37.082876918Z, End: 2024-06-19T16:14:37.143668146Z, Duration: 00:00:00.060
250
+ Run SCC (Tarjan) on 855 nodes: Begin: 2024-06-19T16:14:37.164334224Z, End: 2024-06-19T16:14:37.183495137Z, Duration: 00:00:00.019
251
+ Propagate runtime types to strongly connected components: Begin: 2024-06-19T16:14:37.186904807Z, End: 2024-06-19T16:14:37.236079924Z, Duration: 00:00:00.049
252
+ Variable Type Analysis #2: Begin: 2024-06-19T16:14:37.251454658Z, End: 2024-06-19T16:14:37.306918889Z, Duration: 00:00:00.055
253
+ Create runtime type propagation graph: Begin: 2024-06-19T16:14:37.254349465Z, End: 2024-06-19T16:14:37.301061372Z, Duration: 00:00:00.046
254
+ Run SCC (Tarjan) on 855 nodes: Begin: 2024-06-19T16:14:37.302129958Z, End: 2024-06-19T16:14:37.303784858Z, Duration: 00:00:00.001
255
+ Propagate runtime types to strongly connected components: Begin: 2024-06-19T16:14:37.304053254Z, End: 2024-06-19T16:14:37.306768773Z, Duration: 00:00:00.002
256
+ Load config: Begin: 2024-06-19T16:14:37.339256810Z, End: 2024-06-19T16:14:37.563613989Z, Duration: 00:00:00.224
257
+ Compute entry points: Begin: 2024-06-19T16:14:37.563833538Z, End: 2024-06-19T16:14:37.762977595Z, Duration: 00:00:00.199
258
+ Slice call graph: Begin: 2024-06-19T16:14:37.763780888Z, End: 2024-06-19T16:14:37.763807337Z, Duration: 00:00:00.000
259
+ Live variable analysis: Begin: 2024-06-19T16:14:37.763917500Z, End: 2024-06-19T16:14:37.812818327Z, Duration: 00:00:00.048
260
+ Taint analysis for js: Begin: 2024-06-19T16:14:37.813875605Z, End: 2024-06-19T16:15:03.285284464Z, Duration: 00:00:25.471
261
+ Report issues: Begin: 2024-06-19T16:15:03.285376865Z, End: 2024-06-19T16:15:03.291417790Z, Duration: 00:00:00.006
262
+ Store cache: Begin: 2024-06-19T16:15:03.291560638Z, End: 2024-06-19T16:15:03.299100170Z, Duration: 00:00:00.007
263
+ INFO: js security sensor peak memory: 189 MB
264
+ INFO: Sensor JsSecuritySensor [security] (done) | time=26647ms
265
+ INFO: ------------- Run sensors on project
266
+ INFO: Sensor Zero Coverage Sensor
267
+ INFO: Sensor Zero Coverage Sensor (done) | time=1ms
268
+ INFO: SCM Publisher SCM provider for this project is: git
269
+ INFO: SCM Publisher 1 source file to be analyzed
270
+ INFO: SCM Publisher 1/1 source file have been analyzed (done) | time=570ms
271
+ INFO: CPD Executor 7 files had no CPD blocks
272
+ INFO: CPD Executor Calculating CPD for 20 files
273
+ INFO: CPD Executor CPD calculation finished (done) | time=205ms
274
+ INFO: SCM writing changed lines
275
+ WARN: Could not find ref: master in refs/heads, refs/remotes/upstream or refs/remotes/origin
276
+ INFO: SCM writing changed lines (done) | time=4ms
277
+ INFO: Analysis report generated in 8959ms, dir size=258 KB
278
+ INFO: Analysis report compressed in 70ms, zip size=72 KB
279
+ INFO: Analysis report uploaded in 418ms
280
+ INFO: ANALYSIS SUCCESSFUL, you can find the results at: https://sonarcloud.io/dashboard?id=santodigital_santoid-sdk-javascript&branch=feature%2FSAN-5656&resolved=false
281
+ INFO: Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report
282
+ INFO: More about the report processing at https://sonarcloud.io/api/ce/task?id=AZAxR-YJJXMjdYysTNq2
283
+ INFO: Time spent writing ucfgs 73ms
284
+ INFO: Analysis total time: 1:03.895 s
285
+ INFO: ------------------------------------------------------------------------
286
+ INFO: EXECUTION SUCCESS
287
+ INFO: ------------------------------------------------------------------------
288
+ INFO: Total time: 1:10.465s
289
+ INFO: Final Memory: 64M/189M
290
+ INFO: ------------------------------------------------------------------------
package/browser/index.js CHANGED
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("SantoiDSDK",[],t):"object"==typeof exports?exports.SantoiDSDK=t():e.SantoiDSDK=t()}(this,(()=>(()=>{"use strict";var e={373:function(e,t,n){var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractService=void 0;const r=o(n(218)),s=n(661);t.AbstractService=class{constructor(e,t){this.options=e,this.serviceOptions=t}request(e){var t,n,{contentType:o="application/json",authToken:i=this.options.token,baseUrl:a=(null!==(t=this.options.customApiUrl)&&void 0!==t?t:s.API_GATEWAY_URL)}=void 0===e?{}:e;const c={baseURL:a,headers:{"Content-Type":o,Authorization:`Bearer ${i}`}};let l=this.options.domain;if(!this.options.domain&&this.options.token){const e=this.serviceOptions.tryDecodeJwt(this.options.token);l=null===(n=null==e?void 0:e.claims)||void 0===n?void 0:n.domain}return c.headers&&(l&&(c.headers.Domain=l),this.options.useBillingAccounts&&(c.headers.clientCredentials=!0)),r.default.create(c)}}},605:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FaceMatchService=void 0;const o=n(373),r=n(951);class s extends o.AbstractService{async faceMatch(e,t){return await(0,r.retryAsyncFunctionXTimes)((async()=>{const n=new this.serviceOptions.FormDataClass;return n.append("track",this.options.track),n.append("firstImage",e,"firstImage.jpg"),n.append("secondImage",t,"secondImage.jpg"),(await this.request({contentType:"multipart/form-data"}).post("/api/v1/facematch/pair",n,{params:{sensitive_data_compliance:!0}})).data}))}}t.FaceMatchService=s},144:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TypificationService=void 0;const o=n(373),r=n(951);class s extends o.AbstractService{async predict(e){return await(0,r.retryAsyncFunctionXTimes)((async()=>{const t=new this.serviceOptions.FormDataClass;return t.append("track",this.options.track),t.append("imageFile",e,"imageFile.jpg"),(await this.request({contentType:"multipart/form-data"}).post("/api/v3/typification/predict",t)).data}))}}t.TypificationService=s},122:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.insertUploadIdentificationDocument=void 0;const o=n(661);t.insertUploadIdentificationDocument=function(e,t){var n,r,s;const i=t?document.querySelector(t):document.body;if(!i)throw new Error("Cannot find target element");const a=document.createElement("iframe");a.style.overflow="hidden",a.style.border="0",a.setAttribute("width",null!==(n=e.width)&&void 0!==n?n:"100%"),a.setAttribute("height",null!==(r=e.height)&&void 0!==r?r:"550px"),a.setAttribute("scrolling","no");let c=`${null!==(s=e.customAppUrl)&&void 0!==s?s:o.APPLICATION_URL}/share/domains/${e.domain}/tracks/${e.track}/flow/${e.flow}/embedded`;e.token&&(c+=`?accessToken=${e.token}`),a.setAttribute("src",c),i.appendChild(a)}},42:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.LivenessDetectionService=void 0;const o=n(551),r=n(620),s=n(951),i=n(661);t.LivenessDetectionService=class{constructor(e,t){this.frameGetControls={},this.currentStep="front",this.pauseSendingFramesToWebSocket=!1,this.websocketClosedBySDK=!1,this.validationSuccess=!1,this.canSendNextBytes=!0,this.endCalled=!1,this.cancelSendingFramesToWebsocket=void 0,this.successFrames={front:void 0,right:void 0,left:void 0,up:void 0,bottom:void 0},this.options=e,this.abstractWebSocket=t}async onWebSocketMessage(e){var t,n,r,i,a,c,l,u;const d=e.data,p=JSON.parse(d);return(null==p?void 0:p.validation)&&this.currentStep&&(this.successFrames[this.currentStep]=this.lastSentBytes),(null==p?void 0:p.next_step)&&!p.error&&(this.currentStep=p.next_step,await(null===(n=(t=this.options).onNextStep)||void 0===n?void 0:n.call(t,p.next_step)),await(null===(i=(r=this.options)[`on${(0,s.capitalizeFirstLetter)(p.next_step)}Step`])||void 0===i?void 0:i.call(r))),p&&(this.canSendNextBytes=!!(null==p?void 0:p.can_send_next_bytes)),(null==p?void 0:p.success)&&(this.successFrames.bottom=this.lastSentBytes,this.validationSuccess=!0,await(null===(c=(a=this.options).onSuccess)||void 0===c?void 0:c.call(a,{livenessId:p.livenessId,successFrames:this.successFrames})),await this.stopLivenessDetection()),(null==p?void 0:p.error)&&await(null===(u=(l=this.options).onError)||void 0===u?void 0:u.call(l,new o.SDKError({message:"Wrong position",code:o.ELivenessDetectionErrorCodes.WRONG_POSITION}))),p}async stopLivenessDetection(){var e,t,n,o,r;await(0,s.waitFor)((()=>!!this.cancelSendingFramesToWebsocket)),null===(e=this.cancelSendingFramesToWebsocket)||void 0===e||e.call(this),await(null===(n=(t=this.frameGetControls).stopGettingFrames)||void 0===n?void 0:n.call(t)),this.abstractWebSocket.disconnectFromWebSocket(),this.endCalled||(await(null===(r=(o=this.options).onEnd)||void 0===r?void 0:r.call(o)),this.endCalled=!0),this.websocketClosedBySDK=!0}async sendFramesToWebSocket(){var e,t;try{if(this.canSendNextBytes&&!this.pauseSendingFramesToWebSocket){const n=await(null===(t=(e=this.frameGetControls).getNextFrame)||void 0===t?void 0:t.call(e));n&&(this.abstractWebSocket.send(n),this.lastSentBytes=n,this.canSendNextBytes=!1)}}catch(e){await this.stopLivenessDetection()}}async onConnect(){var e,t,n,o,a,c,l,u,d,p;try{if(this.options.getNextFrame)this.frameGetControls.startGettingFrames=this.options.startGettingFrames,this.frameGetControls.getNextFrame=this.options.getNextFrame,this.frameGetControls.stopGettingFrames=this.options.stopGettingFrames,this.frameGetControls.videoStream=await(null===(t=(e=this.options).startGettingFrames)||void 0===t?void 0:t.call(e));else{const e=await(0,r.getDefaultFrameControls)();this.frameGetControls.startGettingFrames=e.startGettingFrames,this.frameGetControls.getNextFrame=e.getNextFrame,this.frameGetControls.stopGettingFrames=e.stopGettingFrames,this.frameGetControls.videoStream=await(null===(o=(n=this.frameGetControls).startGettingFrames)||void 0===o?void 0:o.call(n))}await(null===(c=(a=this.options).onStart)||void 0===c?void 0:c.call(a,{videoStream:this.getVideoStream()})),await(null===(u=(l=this.options).onNextStep)||void 0===u?void 0:u.call(l,"front")),await(null===(p=(d=this.options).onFrontStep)||void 0===p?void 0:p.call(d)),this.cancelSendingFramesToWebsocket=(0,s.callAsyncFunctionEveryXSeconds)((async()=>{await this.sendFramesToWebSocket()}),i.SEND_FRAMES_INTERVAL_MS)}catch(e){await this.onError()}}async onError(){var e,t;this.validationSuccess||(await(null===(t=(e=this.options).onError)||void 0===t?void 0:t.call(e,new o.SDKError({message:"Internal Error",code:o.EDefaultErrorCodes.INTERNAL_ERROR}))),await this.stopLivenessDetection())}resumeGettingFrames(){this.pauseSendingFramesToWebSocket=!1}pauseGettingFrames(){this.pauseSendingFramesToWebSocket=!0}getVideoStream(){var e;return null===(e=this.frameGetControls)||void 0===e?void 0:e.videoStream}}},234:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.livenessDetection=void 0;const o=n(42),r=n(551),s=n(706),i=n(616);t.livenessDetection=function(e){var t;try{const n=new s.AbstractWebSocket({WebSocketClass:null!==(t=e.CustomWebSocketClass)&&void 0!==t?t:WebSocket,decodeJwt:i.decodeJwt},e);n.startConnection();const r=new o.LivenessDetectionService(e,n);return n.waitForWebSocketConnection().then((()=>{r.onConnect()})).catch((()=>{r.onError()})),n.addListener("message",(e=>{r.onWebSocketMessage(e)})),n.addListener("error",(()=>{r.onError()})),n.addListener("close",(()=>{r.onError()})),{getVideoStream:()=>r.getVideoStream(),stopLivenessDetection:async()=>{await r.stopLivenessDetection()},resumeGettingFrames:()=>{r.resumeGettingFrames()},pauseGettingFrames:()=>{r.pauseGettingFrames()}}}catch(e){throw new r.SDKError({message:"Error while starting SDK",code:r.EDefaultErrorCodes.INITIALIZATION_ERROR})}}},171:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UploadIdentificationDocumentService=void 0;const o=n(144),r=n(605),s=n(551),i=n(616);t.UploadIdentificationDocumentService=class{constructor(e,t){this.results={uploadedDocument:null,typification:{status:null,results:null,loading:!1,error:null},liveness:{status:null,results:null,loading:!1,error:null},faceMatch:{status:null,results:null,loading:!1,error:null}},this.options=e,this.internalOptions=t,this.typificationService=new o.TypificationService(e,{FormDataClass:FormData,tryDecodeJwt:i.tryDecodeJwt}),this.faceMatchService=new r.FaceMatchService(e,{FormDataClass:FormData,tryDecodeJwt:i.tryDecodeJwt})}getResults(){return this.results}async updateResults(e){var t,n,o,r,s,i;this.results=Object.assign(Object.assign({},this.results),e),await(null===(n=(t=this.options).onUpdate)||void 0===n?void 0:n.call(t,this.results)),e.faceMatch||this.tryStartFaceMatch(),Object.entries(this.results).every((([e,t])=>"uploadedDocument"===e||!!t.results))&&(await(null===(r=(o=this.options).onSuccess)||void 0===r?void 0:r.call(o,this.results)),await(null===(i=(s=this.options).onEnd)||void 0===i?void 0:i.call(s)))}updateUploadedDocument(e){this.results.uploadedDocument=e}async startDocumentUpload(e){var t,n;try{this.updateResults({typification:{status:null,results:null,loading:!0,error:null}}),this.updateUploadedDocument(e);const t=await this.typificationService.predict(e);this.updateResults({typification:{status:"success",results:t,loading:!1,error:null}})}catch(e){const o=new s.SDKError({message:"Error during document upload/analysis",code:s.EUploadIdentificationDocumentErrorCodes.DOCUMENT_ANALYSIS_ERROR,details:e});await(null===(n=(t=this.options).onError)||void 0===n?void 0:n.call(t,o)),this.updateResults({typification:{status:"error",results:null,loading:!1,error:o}})}}startLivenessDetection(e){var t,n;const o=Object.assign(Object.assign({},this.options.livenessDetectionOptions),e);this.updateResults({liveness:{results:null,status:null,loading:!0,error:null}});try{return this.internalOptions.livenessDetection(Object.assign(Object.assign({domain:this.options.domain,customId:this.options.customId,customWebSocketUrl:this.options.customWebSocketUrl,token:this.options.token,track:this.options.track},o),{onSuccess:async e=>{var t;await(null===(t=null==o?void 0:o.onSuccess)||void 0===t?void 0:t.call(o,e)),this.updateResults({liveness:{status:"success",results:e,loading:!1,error:null}})},onError:async e=>{var t,n,r;await(null===(t=null==o?void 0:o.onError)||void 0===t?void 0:t.call(o,e)),await(null===(r=(n=this.options).onError)||void 0===r?void 0:r.call(n,e)),this.updateResults({liveness:{status:"error",results:null,loading:"wrong-position"===(null==e?void 0:e.code),error:null!=e?e:null}})}}))}catch(e){const o=new s.SDKError({message:"Error during liveness detection",code:s.EUploadIdentificationDocumentErrorCodes.LIVENESS_DETECTION_ERROR,details:e});null===(n=(t=this.options).onError)||void 0===n||n.call(t,o),this.updateResults({liveness:{status:"error",results:null,loading:!1,error:o}})}}async startFaceMatch(e,t){var n,o;try{this.updateResults({faceMatch:{status:null,results:null,loading:!0,error:null}});const n=await this.faceMatchService.faceMatch(e,t);this.updateResults({faceMatch:{results:n,status:"success",loading:!1,error:null}})}catch(e){const t=new s.SDKError({message:"Error when comparing the face with the document",code:s.EUploadIdentificationDocumentErrorCodes.FACE_MATCH_ERROR,details:e});await(null===(o=(n=this.options).onError)||void 0===o?void 0:o.call(n,t)),this.updateResults({faceMatch:{results:null,status:"error",loading:!1,error:t}})}}async tryStartFaceMatch(){var e,t,n;!this.results.uploadedDocument||!(null===(e=this.results.liveness.results)||void 0===e?void 0:e.successFrames.front)||this.results.faceMatch.loading||this.results.liveness.loading||this.results.typification.loading?await(null===(n=(t=this.options).onError)||void 0===n?void 0:n.call(t,new s.SDKError({message:"Unavailable faces",code:s.EUploadIdentificationDocumentErrorCodes.FACE_MATCH_UNAVAILABLE_FACES_ERROR}))):await this.startFaceMatch(this.results.uploadedDocument,this.results.liveness.results.successFrames.front)}startAll(e,t){this.startDocumentUpload(e),this.startLivenessDetection(t)}}},604:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.uploadIdentificationDocument=void 0;const o=n(171),r=n(234);t.uploadIdentificationDocument=function(e){const t=new o.UploadIdentificationDocumentService(e,{livenessDetection:r.livenessDetection});return{startDocumentUpload:async(...e)=>{await t.startDocumentUpload(...e)},startLivenessDetection:(...e)=>t.startLivenessDetection(...e),startFaceComparison:async(...e)=>{await t.tryStartFaceMatch(...e)},startAll:(...e)=>{t.startAll(...e)},getResults:(...e)=>t.getResults(...e)}}},620:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getDefaultFrameControls=void 0,t.getDefaultFrameControls=async function(){let e,t,n,o;return{startGettingFrames:async function(){return e&&t&&n||(e=await navigator.mediaDevices.getUserMedia({video:!0}),t=document.createElement("video"),t.setAttribute("autoplay","true"),t.style.transform="scale(-1, 1)",t.style.position="absolute",t.style.left="99999px",document.body.appendChild(t),t.srcObject=e,n=document.createElement("canvas"),o=n.getContext("2d")),e},getNextFrame:async function(){if(n&&t)return n.width=t.videoWidth,n.height=t.videoHeight,null==o||o.drawImage(t,0,0,n.width,n.height),await new Promise(((e,t)=>{n?n.toBlob((t=>{e(t)})):e(null)}));throw new Error("Cannot found video element")},stopGettingFrames:function(){t&&(document.body.removeChild(t),t=void 0),n&&(n=void 0),o&&(o=void 0),e&&(null==e||e.getTracks().forEach((e=>{e.stop()})),e=void 0)}}}},616:(e,t)=>{function n(e){const t=e.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),n=decodeURIComponent(window.atob(t).split("").map((e=>"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2))).join(""));return JSON.parse(n)}Object.defineProperty(t,"__esModule",{value:!0}),t.tryDecodeJwt=t.decodeJwt=void 0,t.decodeJwt=n,t.tryDecodeJwt=function(e){try{return n(e)}catch(e){return null}}},661:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_RETRY_TIME_STEP=t.DEFAULT_NUMBER_OF_RETRIES=t.SEND_FRAMES_INTERVAL_MS=t.APPLICATION_URL=t.API_GATEWAY_URL=t.WEBSOCKET_BASE_URL=void 0,t.WEBSOCKET_BASE_URL="wss://santoid-liveness-w4ynos5dlq-ue.a.run.app/api/v1/liveness/ws",t.API_GATEWAY_URL="https://api.santoid.com.br",t.APPLICATION_URL="https://app.santoid.com.br",t.SEND_FRAMES_INTERVAL_MS=100,t.DEFAULT_NUMBER_OF_RETRIES=5,t.DEFAULT_RETRY_TIME_STEP=1e3},551:(e,t)=>{var n,o,r;Object.defineProperty(t,"__esModule",{value:!0}),t.SDKError=t.EUploadIdentificationDocumentErrorCodes=t.ELivenessDetectionErrorCodes=t.EDefaultErrorCodes=void 0,function(e){e.INITIALIZATION_ERROR="initialization-error",e.INTERNAL_ERROR="internal-error"}(n||(t.EDefaultErrorCodes=n={})),function(e){e.WRONG_POSITION="liveness-detection/wrong-position"}(o||(t.ELivenessDetectionErrorCodes=o={})),function(e){e.FACE_MATCH_ERROR="upload-identification-document/face-match-error",e.FACE_MATCH_UNAVAILABLE_FACES_ERROR="upload-identification-document/face-match-unavailable-faces-error",e.DOCUMENT_ANALYSIS_ERROR="upload-identification-document/document-analysis-error",e.LIVENESS_DETECTION_ERROR="upload-identification-document/liveness-detection-error"}(r||(t.EUploadIdentificationDocumentErrorCodes=r={}));class s extends Error{constructor({message:e,code:t,details:n}){super(e),this.code=t,this.details=n}}t.SDKError=s},951:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.retryAsyncFunctionXTimes=t.callAsyncFunctionEveryXSeconds=t.waitFor=t.wait=t.capitalizeFirstLetter=void 0;const o=n(218),r=n(661);async function s(e){await new Promise((t=>{e()?t():setTimeout((()=>{s(e).then(t)}),500)}))}function i(e){var t;return e instanceof o.AxiosError&&(503===(null===(t=e.response)||void 0===t?void 0:t.status)||"Network Error"===e.message)}t.capitalizeFirstLetter=function(e){return e.charAt(0).toUpperCase()+e.slice(1)},t.wait=async e=>{await new Promise((t=>{setTimeout(t,e)}))},t.waitFor=s,t.callAsyncFunctionEveryXSeconds=function e(t,n,o={stop:!1}){const r={timerEnd:!1};return setTimeout((()=>{r.timerEnd=!0}),n),t().then((async()=>{await s((()=>r.timerEnd)),o.stop||e(t,n,o)})),function(){o.stop=!0}},t.retryAsyncFunctionXTimes=async function e(n,o=i,s=r.DEFAULT_NUMBER_OF_RETRIES,a=1e3,c=r.DEFAULT_RETRY_TIME_STEP){try{return await n()}catch(r){if(o(r)&&s>0)return await(0,t.wait)(a),await e(n,o,s-1,a+c,c);throw r}}},706:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractWebSocket=void 0;const o=n(661);t.AbstractWebSocket=class{constructor(e,t){this.classOptions=e,this.sdkOptions=t}startConnection(){var e,t;const n=this.classOptions.decodeJwt(this.sdkOptions.token),r={x_endpoint_api_userinfo:this.sdkOptions.token,domain:null!==(e=this.sdkOptions.domain)&&void 0!==e?e:n.claims.domain,track:this.sdkOptions.track};this.sdkOptions.customId&&(r.customerRequestId=this.sdkOptions.customId),this.sdkOptions.useBillingAccounts&&(r.clientCredentials=!0);const s=Object.entries(r).map((e=>e.join("="))).join("&");this.websocket=new this.classOptions.WebSocketClass(`${null!==(t=this.sdkOptions.customWebSocketUrl)&&void 0!==t?t:o.WEBSOCKET_BASE_URL}?${s}`)}async waitForWebSocketConnection(){if(await new Promise((e=>{const t=setInterval((()=>{[3,1].includes(this.websocket.readyState)&&(clearInterval(t),e())}),5)})),3===this.websocket.readyState)throw new Error("Cannot connect to server")}disconnectFromWebSocket(){var e,t;[2,3].includes(this.websocket.readyState)||null===(t=(e=this.websocket).close)||void 0===t||t.call(e)}get readyState(){return this.websocket.readyState}addListener(e,t){var n,o;this.websocket.on?this.websocket.on(e,t):null===(o=(n=this.websocket).addEventListener)||void 0===o||o.call(n,e,t)}send(e){this.websocket.send(e)}}},218:(e,t,n)=>{function o(e,t){return function(){return e.apply(t,arguments)}}const{toString:r}=Object.prototype,{getPrototypeOf:s}=Object,i=(a=Object.create(null),e=>{const t=r.call(e);return a[t]||(a[t]=t.slice(8,-1).toLowerCase())});var a;const c=e=>(e=e.toLowerCase(),t=>i(t)===e),l=e=>t=>typeof t===e,{isArray:u}=Array,d=l("undefined"),p=c("ArrayBuffer"),f=l("string"),h=l("function"),m=l("number"),v=e=>null!==e&&"object"==typeof e,y=e=>{if("object"!==i(e))return!1;const t=s(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},g=c("Date"),E=c("File"),b=c("Blob"),w=c("FileList"),S=c("URLSearchParams");function O(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let o,r;if("object"!=typeof e&&(e=[e]),u(e))for(o=0,r=e.length;o<r;o++)t.call(null,e[o],o,e);else{const r=n?Object.getOwnPropertyNames(e):Object.keys(e),s=r.length;let i;for(o=0;o<s;o++)i=r[o],t.call(null,e[i],i,e)}}function R(e,t){t=t.toLowerCase();const n=Object.keys(e);let o,r=n.length;for(;r-- >0;)if(o=n[r],t===o.toLowerCase())return o;return null}const A="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:n.g,T=e=>!d(e)&&e!==A,_=(C="undefined"!=typeof Uint8Array&&s(Uint8Array),e=>C&&e instanceof C);var C;const D=c("HTMLFormElement"),F=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),N=c("RegExp"),j=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),o={};O(n,((n,r)=>{let s;!1!==(s=t(n,r,e))&&(o[r]=s||n)})),Object.defineProperties(e,o)},k="abcdefghijklmnopqrstuvwxyz",L="0123456789",U={DIGIT:L,ALPHA:k,ALPHA_DIGIT:k+k.toUpperCase()+L},x=c("AsyncFunction");var P={isArray:u,isArrayBuffer:p,isBuffer:function(e){return null!==e&&!d(e)&&null!==e.constructor&&!d(e.constructor)&&h(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||h(e.append)&&("formdata"===(t=i(e))||"object"===t&&h(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&p(e.buffer),t},isString:f,isNumber:m,isBoolean:e=>!0===e||!1===e,isObject:v,isPlainObject:y,isUndefined:d,isDate:g,isFile:E,isBlob:b,isRegExp:N,isFunction:h,isStream:e=>v(e)&&h(e.pipe),isURLSearchParams:S,isTypedArray:_,isFileList:w,forEach:O,merge:function e(){const{caseless:t}=T(this)&&this||{},n={},o=(o,r)=>{const s=t&&R(n,r)||r;y(n[s])&&y(o)?n[s]=e(n[s],o):y(o)?n[s]=e({},o):u(o)?n[s]=o.slice():n[s]=o};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&O(arguments[e],o);return n},extend:(e,t,n,{allOwnKeys:r}={})=>(O(t,((t,r)=>{n&&h(t)?e[r]=o(t,n):e[r]=t}),{allOwnKeys:r}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,o)=>{e.prototype=Object.create(t.prototype,o),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,o)=>{let r,i,a;const c={};if(t=t||{},null==e)return t;do{for(r=Object.getOwnPropertyNames(e),i=r.length;i-- >0;)a=r[i],o&&!o(a,e,t)||c[a]||(t[a]=e[a],c[a]=!0);e=!1!==n&&s(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:i,kindOfTest:c,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const o=e.indexOf(t,n);return-1!==o&&o===n},toArray:e=>{if(!e)return null;if(u(e))return e;let t=e.length;if(!m(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Symbol.iterator]).call(e);let o;for(;(o=n.next())&&!o.done;){const n=o.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const o=[];for(;null!==(n=e.exec(t));)o.push(n);return o},isHTMLForm:D,hasOwnProperty:F,hasOwnProp:F,reduceDescriptors:j,freezeMethods:e=>{j(e,((t,n)=>{if(h(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const o=e[n];h(o)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(e,t)=>{const n={},o=e=>{e.forEach((e=>{n[e]=!0}))};return u(e)?o(e):o(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(e,t)=>(e=+e,Number.isFinite(e)?e:t),findKey:R,global:A,isContextDefined:T,ALPHABET:U,generateString:(e=16,t=U.ALPHA_DIGIT)=>{let n="";const{length:o}=t;for(;e--;)n+=t[Math.random()*o|0];return n},isSpecCompliantForm:function(e){return!!(e&&h(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),n=(e,o)=>{if(v(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[o]=e;const r=u(e)?[]:{};return O(e,((e,t)=>{const s=n(e,o+1);!d(s)&&(r[t]=s)})),t[o]=void 0,r}}return e};return n(e,0)},isAsyncFn:x,isThenable:e=>e&&(v(e)||h(e))&&h(e.then)&&h(e.catch)};function I(e,t,n,o,r){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),o&&(this.request=o),r&&(this.response=r)}P.inherits(I,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:P.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const B=I.prototype,M={};function W(e){return P.isPlainObject(e)||P.isArray(e)}function G(e){return P.endsWith(e,"[]")?e.slice(0,-2):e}function q(e,t,n){return e?e.concat(t).map((function(e,t){return e=G(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{M[e]={value:e}})),Object.defineProperties(I,M),Object.defineProperty(B,"isAxiosError",{value:!0}),I.from=(e,t,n,o,r,s)=>{const i=Object.create(B);return P.toFlatObject(e,i,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),I.call(i,e.message,t,n,o,r),i.cause=e,i.name=e.name,s&&Object.assign(i,s),i};const J=P.toFlatObject(P,{},null,(function(e){return/^is[A-Z]/.test(e)}));function K(e,t,n){if(!P.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const o=(n=P.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!P.isUndefined(t[e])}))).metaTokens,r=n.visitor||l,s=n.dots,i=n.indexes,a=(n.Blob||"undefined"!=typeof Blob&&Blob)&&P.isSpecCompliantForm(t);if(!P.isFunction(r))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(P.isDate(e))return e.toISOString();if(!a&&P.isBlob(e))throw new I("Blob is not supported. Use a Buffer instead.");return P.isArrayBuffer(e)||P.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function l(e,n,r){let a=e;if(e&&!r&&"object"==typeof e)if(P.endsWith(n,"{}"))n=o?n:n.slice(0,-2),e=JSON.stringify(e);else if(P.isArray(e)&&function(e){return P.isArray(e)&&!e.some(W)}(e)||(P.isFileList(e)||P.endsWith(n,"[]"))&&(a=P.toArray(e)))return n=G(n),a.forEach((function(e,o){!P.isUndefined(e)&&null!==e&&t.append(!0===i?q([n],o,s):null===i?n:n+"[]",c(e))})),!1;return!!W(e)||(t.append(q(r,n,s),c(e)),!1)}const u=[],d=Object.assign(J,{defaultVisitor:l,convertValue:c,isVisitable:W});if(!P.isObject(e))throw new TypeError("data must be an object");return function e(n,o){if(!P.isUndefined(n)){if(-1!==u.indexOf(n))throw Error("Circular reference detected in "+o.join("."));u.push(n),P.forEach(n,(function(n,s){!0===(!(P.isUndefined(n)||null===n)&&r.call(t,n,P.isString(s)?s.trim():s,o,d))&&e(n,o?o.concat(s):[s])})),u.pop()}}(e),t}function z(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function H(e,t){this._pairs=[],e&&K(e,this,t)}const V=H.prototype;function $(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function X(e,t,n){if(!t)return e;const o=n&&n.encode||$,r=n&&n.serialize;let s;if(s=r?r(t,n):P.isURLSearchParams(t)?t.toString():new H(t,n).toString(o),s){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+s}return e}V.append=function(e,t){this._pairs.push([e,t])},V.toString=function(e){const t=e?function(t){return e.call(this,t,z)}:z;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};var Y=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){P.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},Z={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Q={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:H,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},isStandardBrowserEnv:(()=>{let e;return("undefined"==typeof navigator||"ReactNative"!==(e=navigator.product)&&"NativeScript"!==e&&"NS"!==e)&&"undefined"!=typeof window&&"undefined"!=typeof document})(),isStandardBrowserWebWorkerEnv:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,protocols:["http","https","file","blob","url","data"]};function ee(e){function t(e,n,o,r){let s=e[r++];const i=Number.isFinite(+s),a=r>=e.length;return s=!s&&P.isArray(o)?o.length:s,a?(P.hasOwnProp(o,s)?o[s]=[o[s],n]:o[s]=n,!i):(o[s]&&P.isObject(o[s])||(o[s]=[]),t(e,n,o[s],r)&&P.isArray(o[s])&&(o[s]=function(e){const t={},n=Object.keys(e);let o;const r=n.length;let s;for(o=0;o<r;o++)s=n[o],t[s]=e[s];return t}(o[s])),!i)}if(P.isFormData(e)&&P.isFunction(e.entries)){const n={};return P.forEachEntry(e,((e,o)=>{t(function(e){return P.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),o,n,0)})),n}return null}const te={transitional:Z,adapter:["xhr","http"],transformRequest:[function(e,t){const n=t.getContentType()||"",o=n.indexOf("application/json")>-1,r=P.isObject(e);if(r&&P.isHTMLForm(e)&&(e=new FormData(e)),P.isFormData(e))return o&&o?JSON.stringify(ee(e)):e;if(P.isArrayBuffer(e)||P.isBuffer(e)||P.isStream(e)||P.isFile(e)||P.isBlob(e))return e;if(P.isArrayBufferView(e))return e.buffer;if(P.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let s;if(r){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return K(e,new Q.classes.URLSearchParams,Object.assign({visitor:function(e,t,n,o){return Q.isNode&&P.isBuffer(e)?(this.append(t,e.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((s=P.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return K(s?{"files[]":e}:e,t&&new t,this.formSerializer)}}return r||o?(t.setContentType("application/json",!1),function(e,t,n){if(P.isString(e))try{return(0,JSON.parse)(e),P.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||te.transitional,n=t&&t.forcedJSONParsing,o="json"===this.responseType;if(e&&P.isString(e)&&(n&&!this.responseType||o)){const n=!(t&&t.silentJSONParsing)&&o;try{return JSON.parse(e)}catch(e){if(n){if("SyntaxError"===e.name)throw I.from(e,I.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Q.classes.FormData,Blob:Q.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};P.forEach(["delete","get","head","post","put","patch"],(e=>{te.headers[e]={}}));var ne=te;const oe=P.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),re=Symbol("internals");function se(e){return e&&String(e).trim().toLowerCase()}function ie(e){return!1===e||null==e?e:P.isArray(e)?e.map(ie):String(e)}function ae(e,t,n,o,r){return P.isFunction(o)?o.call(this,t,n):(r&&(t=n),P.isString(t)?P.isString(o)?-1!==t.indexOf(o):P.isRegExp(o)?o.test(t):void 0:void 0)}class ce{constructor(e){e&&this.set(e)}set(e,t,n){const o=this;function r(e,t,n){const r=se(t);if(!r)throw new Error("header name must be a non-empty string");const s=P.findKey(o,r);(!s||void 0===o[s]||!0===n||void 0===n&&!1!==o[s])&&(o[s||t]=ie(e))}const s=(e,t)=>P.forEach(e,((e,n)=>r(e,n,t)));return P.isPlainObject(e)||e instanceof this.constructor?s(e,t):P.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim())?s((e=>{const t={};let n,o,r;return e&&e.split("\n").forEach((function(e){r=e.indexOf(":"),n=e.substring(0,r).trim().toLowerCase(),o=e.substring(r+1).trim(),!n||t[n]&&oe[n]||("set-cookie"===n?t[n]?t[n].push(o):t[n]=[o]:t[n]=t[n]?t[n]+", "+o:o)})),t})(e),t):null!=e&&r(t,e,n),this}get(e,t){if(e=se(e)){const n=P.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let o;for(;o=n.exec(e);)t[o[1]]=o[2];return t}(e);if(P.isFunction(t))return t.call(this,e,n);if(P.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=se(e)){const n=P.findKey(this,e);return!(!n||void 0===this[n]||t&&!ae(0,this[n],n,t))}return!1}delete(e,t){const n=this;let o=!1;function r(e){if(e=se(e)){const r=P.findKey(n,e);!r||t&&!ae(0,n[r],r,t)||(delete n[r],o=!0)}}return P.isArray(e)?e.forEach(r):r(e),o}clear(e){const t=Object.keys(this);let n=t.length,o=!1;for(;n--;){const r=t[n];e&&!ae(0,this[r],r,e,!0)||(delete this[r],o=!0)}return o}normalize(e){const t=this,n={};return P.forEach(this,((o,r)=>{const s=P.findKey(n,r);if(s)return t[s]=ie(o),void delete t[r];const i=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,n)=>t.toUpperCase()+n))}(r):String(r).trim();i!==r&&delete t[r],t[i]=ie(o),n[i]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return P.forEach(this,((n,o)=>{null!=n&&!1!==n&&(t[o]=e&&P.isArray(n)?n.join(", "):n)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach((e=>n.set(e))),n}static accessor(e){const t=(this[re]=this[re]={accessors:{}}).accessors,n=this.prototype;function o(e){const o=se(e);t[o]||(function(e,t){const n=P.toCamelCase(" "+t);["get","set","has"].forEach((o=>{Object.defineProperty(e,o+n,{value:function(e,n,r){return this[o].call(this,t,e,n,r)},configurable:!0})}))}(n,e),t[o]=!0)}return P.isArray(e)?e.forEach(o):o(e),this}}ce.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),P.reduceDescriptors(ce.prototype,(({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}})),P.freezeMethods(ce);var le=ce;function ue(e,t){const n=this||ne,o=t||n,r=le.from(o.headers);let s=o.data;return P.forEach(e,(function(e){s=e.call(n,s,r.normalize(),t?t.status:void 0)})),r.normalize(),s}function de(e){return!(!e||!e.__CANCEL__)}function pe(e,t,n){I.call(this,null==e?"canceled":e,I.ERR_CANCELED,t,n),this.name="CanceledError"}P.inherits(pe,I,{__CANCEL__:!0});var fe=Q.isStandardBrowserEnv?{write:function(e,t,n,o,r,s){const i=[];i.push(e+"="+encodeURIComponent(t)),P.isNumber(n)&&i.push("expires="+new Date(n).toGMTString()),P.isString(o)&&i.push("path="+o),P.isString(r)&&i.push("domain="+r),!0===s&&i.push("secure"),document.cookie=i.join("; ")},read:function(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}};function he(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}var me=Q.isStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let n;function o(n){let o=n;return e&&(t.setAttribute("href",o),o=t.href),t.setAttribute("href",o),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:"/"===t.pathname.charAt(0)?t.pathname:"/"+t.pathname}}return n=o(window.location.href),function(e){const t=P.isString(e)?o(e):e;return t.protocol===n.protocol&&t.host===n.host}}():function(){return!0};function ve(e,t){let n=0;const o=function(e,t){e=e||10;const n=new Array(e),o=new Array(e);let r,s=0,i=0;return t=void 0!==t?t:1e3,function(a){const c=Date.now(),l=o[i];r||(r=c),n[s]=a,o[s]=c;let u=i,d=0;for(;u!==s;)d+=n[u++],u%=e;if(s=(s+1)%e,s===i&&(i=(i+1)%e),c-r<t)return;const p=l&&c-l;return p?Math.round(1e3*d/p):void 0}}(50,250);return r=>{const s=r.loaded,i=r.lengthComputable?r.total:void 0,a=s-n,c=o(a);n=s;const l={loaded:s,total:i,progress:i?s/i:void 0,bytes:a,rate:c||void 0,estimated:c&&i&&s<=i?(i-s)/c:void 0,event:r};l[t?"download":"upload"]=!0,e(l)}}const ye={http:null,xhr:"undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){let o=e.data;const r=le.from(e.headers).normalize(),s=e.responseType;let i,a;function c(){e.cancelToken&&e.cancelToken.unsubscribe(i),e.signal&&e.signal.removeEventListener("abort",i)}P.isFormData(o)&&(Q.isStandardBrowserEnv||Q.isStandardBrowserWebWorkerEnv?r.setContentType(!1):r.getContentType(/^\s*multipart\/form-data/)?P.isString(a=r.getContentType())&&r.setContentType(a.replace(/^\s*(multipart\/form-data);+/,"$1")):r.setContentType("multipart/form-data"));let l=new XMLHttpRequest;if(e.auth){const t=e.auth.username||"",n=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";r.set("Authorization","Basic "+btoa(t+":"+n))}const u=he(e.baseURL,e.url);function d(){if(!l)return;const o=le.from("getAllResponseHeaders"in l&&l.getAllResponseHeaders());!function(e,t,n){const o=n.config.validateStatus;n.status&&o&&!o(n.status)?t(new I("Request failed with status code "+n.status,[I.ERR_BAD_REQUEST,I.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}((function(e){t(e),c()}),(function(e){n(e),c()}),{data:s&&"text"!==s&&"json"!==s?l.response:l.responseText,status:l.status,statusText:l.statusText,headers:o,config:e,request:l}),l=null}if(l.open(e.method.toUpperCase(),X(u,e.params,e.paramsSerializer),!0),l.timeout=e.timeout,"onloadend"in l?l.onloadend=d:l.onreadystatechange=function(){l&&4===l.readyState&&(0!==l.status||l.responseURL&&0===l.responseURL.indexOf("file:"))&&setTimeout(d)},l.onabort=function(){l&&(n(new I("Request aborted",I.ECONNABORTED,e,l)),l=null)},l.onerror=function(){n(new I("Network Error",I.ERR_NETWORK,e,l)),l=null},l.ontimeout=function(){let t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const o=e.transitional||Z;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(new I(t,o.clarifyTimeoutError?I.ETIMEDOUT:I.ECONNABORTED,e,l)),l=null},Q.isStandardBrowserEnv){const t=(e.withCredentials||me(u))&&e.xsrfCookieName&&fe.read(e.xsrfCookieName);t&&r.set(e.xsrfHeaderName,t)}void 0===o&&r.setContentType(null),"setRequestHeader"in l&&P.forEach(r.toJSON(),(function(e,t){l.setRequestHeader(t,e)})),P.isUndefined(e.withCredentials)||(l.withCredentials=!!e.withCredentials),s&&"json"!==s&&(l.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&l.addEventListener("progress",ve(e.onDownloadProgress,!0)),"function"==typeof e.onUploadProgress&&l.upload&&l.upload.addEventListener("progress",ve(e.onUploadProgress)),(e.cancelToken||e.signal)&&(i=t=>{l&&(n(!t||t.type?new pe(null,e,l):t),l.abort(),l=null)},e.cancelToken&&e.cancelToken.subscribe(i),e.signal&&(e.signal.aborted?i():e.signal.addEventListener("abort",i)));const p=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(u);p&&-1===Q.protocols.indexOf(p)?n(new I("Unsupported protocol "+p+":",I.ERR_BAD_REQUEST,e)):l.send(o||null)}))}};P.forEach(ye,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));const ge=e=>`- ${e}`,Ee=e=>P.isFunction(e)||null===e||!1===e;var be=e=>{e=P.isArray(e)?e:[e];const{length:t}=e;let n,o;const r={};for(let s=0;s<t;s++){let t;if(n=e[s],o=n,!Ee(n)&&(o=ye[(t=String(n)).toLowerCase()],void 0===o))throw new I(`Unknown adapter '${t}'`);if(o)break;r[t||"#"+s]=o}if(!o){const e=Object.entries(r).map((([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build")));throw new I("There is no suitable adapter to dispatch the request "+(t?e.length>1?"since :\n"+e.map(ge).join("\n"):" "+ge(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return o};function we(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new pe(null,e)}function Se(e){return we(e),e.headers=le.from(e.headers),e.data=ue.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),be(e.adapter||ne.adapter)(e).then((function(t){return we(e),t.data=ue.call(e,e.transformResponse,t),t.headers=le.from(t.headers),t}),(function(t){return de(t)||(we(e),t&&t.response&&(t.response.data=ue.call(e,e.transformResponse,t.response),t.response.headers=le.from(t.response.headers))),Promise.reject(t)}))}const Oe=e=>e instanceof le?e.toJSON():e;function Re(e,t){t=t||{};const n={};function o(e,t,n){return P.isPlainObject(e)&&P.isPlainObject(t)?P.merge.call({caseless:n},e,t):P.isPlainObject(t)?P.merge({},t):P.isArray(t)?t.slice():t}function r(e,t,n){return P.isUndefined(t)?P.isUndefined(e)?void 0:o(void 0,e,n):o(e,t,n)}function s(e,t){if(!P.isUndefined(t))return o(void 0,t)}function i(e,t){return P.isUndefined(t)?P.isUndefined(e)?void 0:o(void 0,e):o(void 0,t)}function a(n,r,s){return s in t?o(n,r):s in e?o(void 0,n):void 0}const c={url:s,method:s,data:s,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:a,headers:(e,t)=>r(Oe(e),Oe(t),!0)};return P.forEach(Object.keys(Object.assign({},e,t)),(function(o){const s=c[o]||r,i=s(e[o],t[o],o);P.isUndefined(i)&&s!==a||(n[o]=i)})),n}const Ae={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{Ae[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const Te={};Ae.transitional=function(e,t,n){function o(e,t){return"[Axios v1.5.1] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,r,s)=>{if(!1===e)throw new I(o(r," has been removed"+(t?" in "+t:"")),I.ERR_DEPRECATED);return t&&!Te[r]&&(Te[r]=!0,console.warn(o(r," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,r,s)}};var _e={assertOptions:function(e,t,n){if("object"!=typeof e)throw new I("options must be an object",I.ERR_BAD_OPTION_VALUE);const o=Object.keys(e);let r=o.length;for(;r-- >0;){const s=o[r],i=t[s];if(i){const t=e[s],n=void 0===t||i(t,s,e);if(!0!==n)throw new I("option "+s+" must be "+n,I.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new I("Unknown option "+s,I.ERR_BAD_OPTION)}},validators:Ae};const Ce=_e.validators;class De{constructor(e){this.defaults=e,this.interceptors={request:new Y,response:new Y}}request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Re(this.defaults,t);const{transitional:n,paramsSerializer:o,headers:r}=t;void 0!==n&&_e.assertOptions(n,{silentJSONParsing:Ce.transitional(Ce.boolean),forcedJSONParsing:Ce.transitional(Ce.boolean),clarifyTimeoutError:Ce.transitional(Ce.boolean)},!1),null!=o&&(P.isFunction(o)?t.paramsSerializer={serialize:o}:_e.assertOptions(o,{encode:Ce.function,serialize:Ce.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase();let s=r&&P.merge(r.common,r[t.method]);r&&P.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete r[e]})),t.headers=le.concat(s,r);const i=[];let a=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(a=a&&e.synchronous,i.unshift(e.fulfilled,e.rejected))}));const c=[];let l;this.interceptors.response.forEach((function(e){c.push(e.fulfilled,e.rejected)}));let u,d=0;if(!a){const e=[Se.bind(this),void 0];for(e.unshift.apply(e,i),e.push.apply(e,c),u=e.length,l=Promise.resolve(t);d<u;)l=l.then(e[d++],e[d++]);return l}u=i.length;let p=t;for(d=0;d<u;){const e=i[d++],t=i[d++];try{p=e(p)}catch(e){t.call(this,e);break}}try{l=Se.call(this,p)}catch(e){return Promise.reject(e)}for(d=0,u=c.length;d<u;)l=l.then(c[d++],c[d++]);return l}getUri(e){return X(he((e=Re(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}}P.forEach(["delete","get","head","options"],(function(e){De.prototype[e]=function(t,n){return this.request(Re(n||{},{method:e,url:t,data:(n||{}).data}))}})),P.forEach(["post","put","patch"],(function(e){function t(t){return function(n,o,r){return this.request(Re(r||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:o}))}}De.prototype[e]=t(),De.prototype[e+"Form"]=t(!0)}));var Fe=De;class Ne{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const n=this;this.promise.then((e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null})),this.promise.then=e=>{let t;const o=new Promise((e=>{n.subscribe(e),t=e})).then(e);return o.cancel=function(){n.unsubscribe(t)},o},e((function(e,o,r){n.reason||(n.reason=new pe(e,o,r),t(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}static source(){let e;return{token:new Ne((function(t){e=t})),cancel:e}}}var je=Ne;const ke={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(ke).forEach((([e,t])=>{ke[t]=e}));var Le=ke;const Ue=function e(t){const n=new Fe(t),r=o(Fe.prototype.request,n);return P.extend(r,Fe.prototype,n,{allOwnKeys:!0}),P.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(Re(t,n))},r}(ne);Ue.Axios=Fe,Ue.CanceledError=pe,Ue.CancelToken=je,Ue.isCancel=de,Ue.VERSION="1.5.1",Ue.toFormData=K,Ue.AxiosError=I,Ue.Cancel=Ue.CanceledError,Ue.all=function(e){return Promise.all(e)},Ue.spread=function(e){return function(t){return e.apply(null,t)}},Ue.isAxiosError=function(e){return P.isObject(e)&&!0===e.isAxiosError},Ue.mergeConfig=Re,Ue.AxiosHeaders=le,Ue.formToJSON=e=>ee(P.isHTMLForm(e)?new FormData(e):e),Ue.getAdapter=be,Ue.HttpStatusCode=Le,Ue.default=Ue,e.exports=Ue}},t={};function n(o){var r=t[o];if(void 0!==r)return r.exports;var s=t[o]={exports:{}};return e[o].call(s.exports,s,s.exports,n),s.exports}n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}();var o={};return(()=>{var e=o;const t=n(234),r=n(604),s=n(122);class i{}i.livenessDetection=t.livenessDetection,i.uploadIdentificationDocument=r.uploadIdentificationDocument,i.insertUploadIdentificationDocument=s.insertUploadIdentificationDocument,e.default=i})(),o.default})()));
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("SantoiDSDK",[],t):"object"==typeof exports?exports.SantoiDSDK=t():e.SantoiDSDK=t()}(this,(()=>(()=>{"use strict";var e={373:function(e,t,n){var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractService=void 0;const r=o(n(218)),s=n(661);t.AbstractService=class{constructor(e,t){this.options=e,this.serviceOptions=t}request(e){var t,n,{contentType:o="application/json",authToken:i=this.options.token,baseUrl:a=(null!==(t=this.options.customApiUrl)&&void 0!==t?t:s.API_GATEWAY_URL)}=void 0===e?{}:e;const c={baseURL:a,headers:{"Content-Type":o,Authorization:`Bearer ${i}`}};let l=this.options.domain;if(!this.options.domain&&this.options.token){const e=this.serviceOptions.tryDecodeJwt(this.options.token);l=null===(n=null==e?void 0:e.claims)||void 0===n?void 0:n.domain}return c.headers&&(l&&(c.headers.Domain=l),this.options.useBillingAccounts&&(c.headers.clientCredentials=!0)),r.default.create(c)}}},605:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FaceMatchService=void 0;const o=n(373),r=n(951);class s extends o.AbstractService{async faceMatch(e,t){return await(0,r.retryAsyncFunctionXTimes)((async()=>{const n=new this.serviceOptions.FormDataClass;return n.append("track",this.options.track),n.append("firstImage",e,"firstImage.jpg"),n.append("secondImage",t,"secondImage.jpg"),(await this.request({contentType:"multipart/form-data"}).post("/api/v1/facematch/pair",n,{params:{sensitive_data_compliance:!0}})).data}))}}t.FaceMatchService=s},144:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TypificationService=void 0;const o=n(373),r=n(951);class s extends o.AbstractService{async predict(e){return await(0,r.retryAsyncFunctionXTimes)((async()=>{const t=new this.serviceOptions.FormDataClass;return t.append("track",this.options.track),t.append("imageFile",e,"imageFile.jpg"),(await this.request({contentType:"multipart/form-data"}).post("/api/v3/typification/predict",t)).data}))}}t.TypificationService=s},122:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.insertUploadIdentificationDocument=void 0;const o=n(661);t.insertUploadIdentificationDocument=function(e,t){var n,r,s;const i=t?document.querySelector(t):document.body;if(!i)throw new Error("Cannot find target element");const a=document.createElement("iframe");a.style.overflow="hidden",a.style.border="0",a.setAttribute("width",null!==(n=e.width)&&void 0!==n?n:"100%"),a.setAttribute("height",null!==(r=e.height)&&void 0!==r?r:"550px"),a.setAttribute("scrolling","no"),a.setAttribute("allow","camera; microphone; clipboard-read; clipboard-write");let c=`${null!==(s=e.customAppUrl)&&void 0!==s?s:o.APPLICATION_URL}/share/domains/${e.domain}/tracks/${e.track}/flow/${e.flow}/embedded`;e.token&&(c+=`?accessToken=${e.token}`),a.setAttribute("src",c),i.appendChild(a)}},42:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.LivenessDetectionService=void 0;const o=n(551),r=n(620),s=n(951),i=n(661);t.LivenessDetectionService=class{constructor(e,t){this.frameGetControls={},this.currentStep="front",this.pauseSendingFramesToWebSocket=!1,this.websocketClosedBySDK=!1,this.validationSuccess=!1,this.canSendNextBytes=!0,this.endCalled=!1,this.cancelSendingFramesToWebsocket=void 0,this.successFrames={front:void 0,right:void 0,left:void 0,up:void 0,bottom:void 0},this.options=e,this.abstractWebSocket=t}async onWebSocketMessage(e){var t,n,r,i,a,c,l,u;const d=e.data,p=JSON.parse(d);return(null==p?void 0:p.validation)&&this.currentStep&&(this.successFrames[this.currentStep]=this.lastSentBytes),(null==p?void 0:p.next_step)&&!p.error&&(this.currentStep=p.next_step,await(null===(n=(t=this.options).onNextStep)||void 0===n?void 0:n.call(t,p.next_step)),await(null===(i=(r=this.options)[`on${(0,s.capitalizeFirstLetter)(p.next_step)}Step`])||void 0===i?void 0:i.call(r))),p&&(this.canSendNextBytes=!!(null==p?void 0:p.can_send_next_bytes)),(null==p?void 0:p.success)&&(this.successFrames.bottom=this.lastSentBytes,this.validationSuccess=!0,await(null===(c=(a=this.options).onSuccess)||void 0===c?void 0:c.call(a,{livenessId:p.livenessId,successFrames:this.successFrames})),await this.stopLivenessDetection()),(null==p?void 0:p.error)&&await(null===(u=(l=this.options).onError)||void 0===u?void 0:u.call(l,new o.SDKError({message:"Wrong position",code:o.ELivenessDetectionErrorCodes.WRONG_POSITION}))),p}async stopLivenessDetection(){var e,t,n,o,r;await(0,s.waitFor)((()=>!!this.cancelSendingFramesToWebsocket)),null===(e=this.cancelSendingFramesToWebsocket)||void 0===e||e.call(this),await(null===(n=(t=this.frameGetControls).stopGettingFrames)||void 0===n?void 0:n.call(t)),this.abstractWebSocket.disconnectFromWebSocket(),this.endCalled||(await(null===(r=(o=this.options).onEnd)||void 0===r?void 0:r.call(o)),this.endCalled=!0),this.websocketClosedBySDK=!0}async sendFramesToWebSocket(){var e,t;try{if(this.canSendNextBytes&&!this.pauseSendingFramesToWebSocket){const n=await(null===(t=(e=this.frameGetControls).getNextFrame)||void 0===t?void 0:t.call(e));n&&(this.abstractWebSocket.send(n),this.lastSentBytes=n,this.canSendNextBytes=!1)}}catch(e){await this.stopLivenessDetection()}}async onConnect(){var e,t,n,o,a,c,l,u,d,p;try{if(this.options.getNextFrame)this.frameGetControls.startGettingFrames=this.options.startGettingFrames,this.frameGetControls.getNextFrame=this.options.getNextFrame,this.frameGetControls.stopGettingFrames=this.options.stopGettingFrames,this.frameGetControls.videoStream=await(null===(t=(e=this.options).startGettingFrames)||void 0===t?void 0:t.call(e));else{const e=await(0,r.getDefaultFrameControls)();this.frameGetControls.startGettingFrames=e.startGettingFrames,this.frameGetControls.getNextFrame=e.getNextFrame,this.frameGetControls.stopGettingFrames=e.stopGettingFrames,this.frameGetControls.videoStream=await(null===(o=(n=this.frameGetControls).startGettingFrames)||void 0===o?void 0:o.call(n))}await(null===(c=(a=this.options).onStart)||void 0===c?void 0:c.call(a,{videoStream:this.getVideoStream()})),await(null===(u=(l=this.options).onNextStep)||void 0===u?void 0:u.call(l,"front")),await(null===(p=(d=this.options).onFrontStep)||void 0===p?void 0:p.call(d)),this.cancelSendingFramesToWebsocket=(0,s.callAsyncFunctionEveryXSeconds)((async()=>{await this.sendFramesToWebSocket()}),i.SEND_FRAMES_INTERVAL_MS)}catch(e){await this.onError()}}async onError(){var e,t;this.validationSuccess||(await(null===(t=(e=this.options).onError)||void 0===t?void 0:t.call(e,new o.SDKError({message:"Internal Error",code:o.EDefaultErrorCodes.INTERNAL_ERROR}))),await this.stopLivenessDetection())}resumeGettingFrames(){this.pauseSendingFramesToWebSocket=!1}pauseGettingFrames(){this.pauseSendingFramesToWebSocket=!0}getVideoStream(){var e;return null===(e=this.frameGetControls)||void 0===e?void 0:e.videoStream}}},234:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.livenessDetection=void 0;const o=n(42),r=n(551),s=n(706),i=n(616);t.livenessDetection=function(e){var t;try{const n=new s.AbstractWebSocket({WebSocketClass:null!==(t=e.CustomWebSocketClass)&&void 0!==t?t:WebSocket,decodeJwt:i.decodeJwt},e);n.startConnection();const r=new o.LivenessDetectionService(e,n);return n.waitForWebSocketConnection().then((()=>{r.onConnect()})).catch((()=>{r.onError()})),n.addListener("message",(e=>{r.onWebSocketMessage(e)})),n.addListener("error",(()=>{r.onError()})),n.addListener("close",(()=>{r.onError()})),{getVideoStream:()=>r.getVideoStream(),stopLivenessDetection:async()=>{await r.stopLivenessDetection()},resumeGettingFrames:()=>{r.resumeGettingFrames()},pauseGettingFrames:()=>{r.pauseGettingFrames()}}}catch(e){throw new r.SDKError({message:"Error while starting SDK",code:r.EDefaultErrorCodes.INITIALIZATION_ERROR})}}},171:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UploadIdentificationDocumentService=void 0;const o=n(144),r=n(605),s=n(551),i=n(616);t.UploadIdentificationDocumentService=class{constructor(e,t){this.results={uploadedDocument:null,typification:{status:null,results:null,loading:!1,error:null},liveness:{status:null,results:null,loading:!1,error:null},faceMatch:{status:null,results:null,loading:!1,error:null}},this.options=e,this.internalOptions=t,this.typificationService=new o.TypificationService(e,{FormDataClass:FormData,tryDecodeJwt:i.tryDecodeJwt}),this.faceMatchService=new r.FaceMatchService(e,{FormDataClass:FormData,tryDecodeJwt:i.tryDecodeJwt})}getResults(){return this.results}async updateResults(e){var t,n,o,r,s,i;this.results=Object.assign(Object.assign({},this.results),e),await(null===(n=(t=this.options).onUpdate)||void 0===n?void 0:n.call(t,this.results)),e.faceMatch||this.tryStartFaceMatch(),Object.entries(this.results).every((([e,t])=>"uploadedDocument"===e||!!t.results))&&(await(null===(r=(o=this.options).onSuccess)||void 0===r?void 0:r.call(o,this.results)),await(null===(i=(s=this.options).onEnd)||void 0===i?void 0:i.call(s)))}updateUploadedDocument(e){this.results.uploadedDocument=e}async startDocumentUpload(e){var t,n;try{this.updateResults({typification:{status:null,results:null,loading:!0,error:null}}),this.updateUploadedDocument(e);const t=await this.typificationService.predict(e);this.updateResults({typification:{status:"success",results:t,loading:!1,error:null}})}catch(e){const o=new s.SDKError({message:"Error during document upload/analysis",code:s.EUploadIdentificationDocumentErrorCodes.DOCUMENT_ANALYSIS_ERROR,details:e});await(null===(n=(t=this.options).onError)||void 0===n?void 0:n.call(t,o)),this.updateResults({typification:{status:"error",results:null,loading:!1,error:o}})}}startLivenessDetection(e){var t,n;const o=Object.assign(Object.assign({},this.options.livenessDetectionOptions),e);this.updateResults({liveness:{results:null,status:null,loading:!0,error:null}});try{return this.internalOptions.livenessDetection(Object.assign(Object.assign({domain:this.options.domain,customId:this.options.customId,customWebSocketUrl:this.options.customWebSocketUrl,token:this.options.token,track:this.options.track},o),{onSuccess:async e=>{var t;await(null===(t=null==o?void 0:o.onSuccess)||void 0===t?void 0:t.call(o,e)),this.updateResults({liveness:{status:"success",results:e,loading:!1,error:null}})},onError:async e=>{var t,n,r;await(null===(t=null==o?void 0:o.onError)||void 0===t?void 0:t.call(o,e)),await(null===(r=(n=this.options).onError)||void 0===r?void 0:r.call(n,e)),this.updateResults({liveness:{status:"error",results:null,loading:"wrong-position"===(null==e?void 0:e.code),error:null!=e?e:null}})}}))}catch(e){const o=new s.SDKError({message:"Error during liveness detection",code:s.EUploadIdentificationDocumentErrorCodes.LIVENESS_DETECTION_ERROR,details:e});null===(n=(t=this.options).onError)||void 0===n||n.call(t,o),this.updateResults({liveness:{status:"error",results:null,loading:!1,error:o}})}}async startFaceMatch(e,t){var n,o;try{this.updateResults({faceMatch:{status:null,results:null,loading:!0,error:null}});const n=await this.faceMatchService.faceMatch(e,t);this.updateResults({faceMatch:{results:n,status:"success",loading:!1,error:null}})}catch(e){const t=new s.SDKError({message:"Error when comparing the face with the document",code:s.EUploadIdentificationDocumentErrorCodes.FACE_MATCH_ERROR,details:e});await(null===(o=(n=this.options).onError)||void 0===o?void 0:o.call(n,t)),this.updateResults({faceMatch:{results:null,status:"error",loading:!1,error:t}})}}async tryStartFaceMatch(){var e,t,n;!this.results.uploadedDocument||!(null===(e=this.results.liveness.results)||void 0===e?void 0:e.successFrames.front)||this.results.faceMatch.loading||this.results.liveness.loading||this.results.typification.loading?await(null===(n=(t=this.options).onError)||void 0===n?void 0:n.call(t,new s.SDKError({message:"Unavailable faces",code:s.EUploadIdentificationDocumentErrorCodes.FACE_MATCH_UNAVAILABLE_FACES_ERROR}))):await this.startFaceMatch(this.results.uploadedDocument,this.results.liveness.results.successFrames.front)}startAll(e,t){this.startDocumentUpload(e),this.startLivenessDetection(t)}}},604:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.uploadIdentificationDocument=void 0;const o=n(171),r=n(234);t.uploadIdentificationDocument=function(e){const t=new o.UploadIdentificationDocumentService(e,{livenessDetection:r.livenessDetection});return{startDocumentUpload:async(...e)=>{await t.startDocumentUpload(...e)},startLivenessDetection:(...e)=>t.startLivenessDetection(...e),startFaceComparison:async(...e)=>{await t.tryStartFaceMatch(...e)},startAll:(...e)=>{t.startAll(...e)},getResults:(...e)=>t.getResults(...e)}}},620:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getDefaultFrameControls=void 0,t.getDefaultFrameControls=async function(){let e,t,n,o;return{startGettingFrames:async function(){return e&&t&&n||(e=await navigator.mediaDevices.getUserMedia({video:!0}),t=document.createElement("video"),t.setAttribute("autoplay","true"),t.style.transform="scale(-1, 1)",t.style.position="absolute",t.style.left="99999px",document.body.appendChild(t),t.srcObject=e,n=document.createElement("canvas"),o=n.getContext("2d")),e},getNextFrame:async function(){if(n&&t)return n.width=t.videoWidth,n.height=t.videoHeight,null==o||o.drawImage(t,0,0,n.width,n.height),await new Promise(((e,t)=>{n?n.toBlob((t=>{e(t)})):e(null)}));throw new Error("Cannot found video element")},stopGettingFrames:function(){t&&(document.body.removeChild(t),t=void 0),n&&(n=void 0),o&&(o=void 0),e&&(null==e||e.getTracks().forEach((e=>{e.stop()})),e=void 0)}}}},616:(e,t)=>{function n(e){const t=e.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),n=decodeURIComponent(window.atob(t).split("").map((e=>"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2))).join(""));return JSON.parse(n)}Object.defineProperty(t,"__esModule",{value:!0}),t.tryDecodeJwt=t.decodeJwt=void 0,t.decodeJwt=n,t.tryDecodeJwt=function(e){try{return n(e)}catch(e){return null}}},661:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_RETRY_TIME_STEP=t.DEFAULT_NUMBER_OF_RETRIES=t.SEND_FRAMES_INTERVAL_MS=t.APPLICATION_URL=t.API_GATEWAY_URL=t.WEBSOCKET_BASE_URL=void 0,t.WEBSOCKET_BASE_URL="wss://santoid-liveness-w4ynos5dlq-ue.a.run.app/api/v1/liveness/ws",t.API_GATEWAY_URL="https://api.santoid.com.br",t.APPLICATION_URL="https://app.santoid.com.br",t.SEND_FRAMES_INTERVAL_MS=100,t.DEFAULT_NUMBER_OF_RETRIES=5,t.DEFAULT_RETRY_TIME_STEP=1e3},551:(e,t)=>{var n,o,r;Object.defineProperty(t,"__esModule",{value:!0}),t.SDKError=t.EUploadIdentificationDocumentErrorCodes=t.ELivenessDetectionErrorCodes=t.EDefaultErrorCodes=void 0,function(e){e.INITIALIZATION_ERROR="initialization-error",e.INTERNAL_ERROR="internal-error"}(n||(t.EDefaultErrorCodes=n={})),function(e){e.WRONG_POSITION="liveness-detection/wrong-position"}(o||(t.ELivenessDetectionErrorCodes=o={})),function(e){e.FACE_MATCH_ERROR="upload-identification-document/face-match-error",e.FACE_MATCH_UNAVAILABLE_FACES_ERROR="upload-identification-document/face-match-unavailable-faces-error",e.DOCUMENT_ANALYSIS_ERROR="upload-identification-document/document-analysis-error",e.LIVENESS_DETECTION_ERROR="upload-identification-document/liveness-detection-error"}(r||(t.EUploadIdentificationDocumentErrorCodes=r={}));class s extends Error{constructor({message:e,code:t,details:n}){super(e),this.code=t,this.details=n}}t.SDKError=s},951:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.retryAsyncFunctionXTimes=t.callAsyncFunctionEveryXSeconds=t.waitFor=t.wait=t.capitalizeFirstLetter=void 0;const o=n(218),r=n(661);async function s(e){await new Promise((t=>{e()?t():setTimeout((()=>{s(e).then(t)}),500)}))}function i(e){var t;return e instanceof o.AxiosError&&(503===(null===(t=e.response)||void 0===t?void 0:t.status)||"Network Error"===e.message)}t.capitalizeFirstLetter=function(e){return e.charAt(0).toUpperCase()+e.slice(1)},t.wait=async e=>{await new Promise((t=>{setTimeout(t,e)}))},t.waitFor=s,t.callAsyncFunctionEveryXSeconds=function e(t,n,o={stop:!1}){const r={timerEnd:!1};return setTimeout((()=>{r.timerEnd=!0}),n),t().then((async()=>{await s((()=>r.timerEnd)),o.stop||e(t,n,o)})),function(){o.stop=!0}},t.retryAsyncFunctionXTimes=async function e(n,o=i,s=r.DEFAULT_NUMBER_OF_RETRIES,a=1e3,c=r.DEFAULT_RETRY_TIME_STEP){try{return await n()}catch(r){if(o(r)&&s>0)return await(0,t.wait)(a),await e(n,o,s-1,a+c,c);throw r}}},706:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractWebSocket=void 0;const o=n(661);t.AbstractWebSocket=class{constructor(e,t){this.classOptions=e,this.sdkOptions=t}startConnection(){var e,t;const n=this.classOptions.decodeJwt(this.sdkOptions.token),r={x_endpoint_api_userinfo:this.sdkOptions.token,domain:null!==(e=this.sdkOptions.domain)&&void 0!==e?e:n.claims.domain,track:this.sdkOptions.track};this.sdkOptions.customId&&(r.customerRequestId=this.sdkOptions.customId),this.sdkOptions.useBillingAccounts&&(r.clientCredentials=!0);const s=Object.entries(r).map((e=>e.join("="))).join("&");this.websocket=new this.classOptions.WebSocketClass(`${null!==(t=this.sdkOptions.customWebSocketUrl)&&void 0!==t?t:o.WEBSOCKET_BASE_URL}?${s}`)}async waitForWebSocketConnection(){if(await new Promise((e=>{const t=setInterval((()=>{[3,1].includes(this.websocket.readyState)&&(clearInterval(t),e())}),5)})),3===this.websocket.readyState)throw new Error("Cannot connect to server")}disconnectFromWebSocket(){var e,t;[2,3].includes(this.websocket.readyState)||null===(t=(e=this.websocket).close)||void 0===t||t.call(e)}get readyState(){return this.websocket.readyState}addListener(e,t){var n,o;this.websocket.on?this.websocket.on(e,t):null===(o=(n=this.websocket).addEventListener)||void 0===o||o.call(n,e,t)}send(e){this.websocket.send(e)}}},218:(e,t,n)=>{function o(e,t){return function(){return e.apply(t,arguments)}}const{toString:r}=Object.prototype,{getPrototypeOf:s}=Object,i=(a=Object.create(null),e=>{const t=r.call(e);return a[t]||(a[t]=t.slice(8,-1).toLowerCase())});var a;const c=e=>(e=e.toLowerCase(),t=>i(t)===e),l=e=>t=>typeof t===e,{isArray:u}=Array,d=l("undefined"),p=c("ArrayBuffer"),f=l("string"),h=l("function"),m=l("number"),v=e=>null!==e&&"object"==typeof e,y=e=>{if("object"!==i(e))return!1;const t=s(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},g=c("Date"),E=c("File"),b=c("Blob"),w=c("FileList"),S=c("URLSearchParams");function O(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let o,r;if("object"!=typeof e&&(e=[e]),u(e))for(o=0,r=e.length;o<r;o++)t.call(null,e[o],o,e);else{const r=n?Object.getOwnPropertyNames(e):Object.keys(e),s=r.length;let i;for(o=0;o<s;o++)i=r[o],t.call(null,e[i],i,e)}}function R(e,t){t=t.toLowerCase();const n=Object.keys(e);let o,r=n.length;for(;r-- >0;)if(o=n[r],t===o.toLowerCase())return o;return null}const A="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:n.g,T=e=>!d(e)&&e!==A,_=(C="undefined"!=typeof Uint8Array&&s(Uint8Array),e=>C&&e instanceof C);var C;const D=c("HTMLFormElement"),F=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),N=c("RegExp"),j=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),o={};O(n,((n,r)=>{let s;!1!==(s=t(n,r,e))&&(o[r]=s||n)})),Object.defineProperties(e,o)},k="abcdefghijklmnopqrstuvwxyz",L="0123456789",U={DIGIT:L,ALPHA:k,ALPHA_DIGIT:k+k.toUpperCase()+L},x=c("AsyncFunction");var P={isArray:u,isArrayBuffer:p,isBuffer:function(e){return null!==e&&!d(e)&&null!==e.constructor&&!d(e.constructor)&&h(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||h(e.append)&&("formdata"===(t=i(e))||"object"===t&&h(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&p(e.buffer),t},isString:f,isNumber:m,isBoolean:e=>!0===e||!1===e,isObject:v,isPlainObject:y,isUndefined:d,isDate:g,isFile:E,isBlob:b,isRegExp:N,isFunction:h,isStream:e=>v(e)&&h(e.pipe),isURLSearchParams:S,isTypedArray:_,isFileList:w,forEach:O,merge:function e(){const{caseless:t}=T(this)&&this||{},n={},o=(o,r)=>{const s=t&&R(n,r)||r;y(n[s])&&y(o)?n[s]=e(n[s],o):y(o)?n[s]=e({},o):u(o)?n[s]=o.slice():n[s]=o};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&O(arguments[e],o);return n},extend:(e,t,n,{allOwnKeys:r}={})=>(O(t,((t,r)=>{n&&h(t)?e[r]=o(t,n):e[r]=t}),{allOwnKeys:r}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,o)=>{e.prototype=Object.create(t.prototype,o),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,o)=>{let r,i,a;const c={};if(t=t||{},null==e)return t;do{for(r=Object.getOwnPropertyNames(e),i=r.length;i-- >0;)a=r[i],o&&!o(a,e,t)||c[a]||(t[a]=e[a],c[a]=!0);e=!1!==n&&s(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:i,kindOfTest:c,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const o=e.indexOf(t,n);return-1!==o&&o===n},toArray:e=>{if(!e)return null;if(u(e))return e;let t=e.length;if(!m(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Symbol.iterator]).call(e);let o;for(;(o=n.next())&&!o.done;){const n=o.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const o=[];for(;null!==(n=e.exec(t));)o.push(n);return o},isHTMLForm:D,hasOwnProperty:F,hasOwnProp:F,reduceDescriptors:j,freezeMethods:e=>{j(e,((t,n)=>{if(h(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const o=e[n];h(o)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(e,t)=>{const n={},o=e=>{e.forEach((e=>{n[e]=!0}))};return u(e)?o(e):o(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(e,t)=>(e=+e,Number.isFinite(e)?e:t),findKey:R,global:A,isContextDefined:T,ALPHABET:U,generateString:(e=16,t=U.ALPHA_DIGIT)=>{let n="";const{length:o}=t;for(;e--;)n+=t[Math.random()*o|0];return n},isSpecCompliantForm:function(e){return!!(e&&h(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),n=(e,o)=>{if(v(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[o]=e;const r=u(e)?[]:{};return O(e,((e,t)=>{const s=n(e,o+1);!d(s)&&(r[t]=s)})),t[o]=void 0,r}}return e};return n(e,0)},isAsyncFn:x,isThenable:e=>e&&(v(e)||h(e))&&h(e.then)&&h(e.catch)};function I(e,t,n,o,r){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),o&&(this.request=o),r&&(this.response=r)}P.inherits(I,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:P.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const B=I.prototype,M={};function W(e){return P.isPlainObject(e)||P.isArray(e)}function G(e){return P.endsWith(e,"[]")?e.slice(0,-2):e}function q(e,t,n){return e?e.concat(t).map((function(e,t){return e=G(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{M[e]={value:e}})),Object.defineProperties(I,M),Object.defineProperty(B,"isAxiosError",{value:!0}),I.from=(e,t,n,o,r,s)=>{const i=Object.create(B);return P.toFlatObject(e,i,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),I.call(i,e.message,t,n,o,r),i.cause=e,i.name=e.name,s&&Object.assign(i,s),i};const J=P.toFlatObject(P,{},null,(function(e){return/^is[A-Z]/.test(e)}));function K(e,t,n){if(!P.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const o=(n=P.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!P.isUndefined(t[e])}))).metaTokens,r=n.visitor||l,s=n.dots,i=n.indexes,a=(n.Blob||"undefined"!=typeof Blob&&Blob)&&P.isSpecCompliantForm(t);if(!P.isFunction(r))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(P.isDate(e))return e.toISOString();if(!a&&P.isBlob(e))throw new I("Blob is not supported. Use a Buffer instead.");return P.isArrayBuffer(e)||P.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function l(e,n,r){let a=e;if(e&&!r&&"object"==typeof e)if(P.endsWith(n,"{}"))n=o?n:n.slice(0,-2),e=JSON.stringify(e);else if(P.isArray(e)&&function(e){return P.isArray(e)&&!e.some(W)}(e)||(P.isFileList(e)||P.endsWith(n,"[]"))&&(a=P.toArray(e)))return n=G(n),a.forEach((function(e,o){!P.isUndefined(e)&&null!==e&&t.append(!0===i?q([n],o,s):null===i?n:n+"[]",c(e))})),!1;return!!W(e)||(t.append(q(r,n,s),c(e)),!1)}const u=[],d=Object.assign(J,{defaultVisitor:l,convertValue:c,isVisitable:W});if(!P.isObject(e))throw new TypeError("data must be an object");return function e(n,o){if(!P.isUndefined(n)){if(-1!==u.indexOf(n))throw Error("Circular reference detected in "+o.join("."));u.push(n),P.forEach(n,(function(n,s){!0===(!(P.isUndefined(n)||null===n)&&r.call(t,n,P.isString(s)?s.trim():s,o,d))&&e(n,o?o.concat(s):[s])})),u.pop()}}(e),t}function z(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function H(e,t){this._pairs=[],e&&K(e,this,t)}const V=H.prototype;function $(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function X(e,t,n){if(!t)return e;const o=n&&n.encode||$,r=n&&n.serialize;let s;if(s=r?r(t,n):P.isURLSearchParams(t)?t.toString():new H(t,n).toString(o),s){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+s}return e}V.append=function(e,t){this._pairs.push([e,t])},V.toString=function(e){const t=e?function(t){return e.call(this,t,z)}:z;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};var Y=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){P.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},Z={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Q={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:H,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},isStandardBrowserEnv:(()=>{let e;return("undefined"==typeof navigator||"ReactNative"!==(e=navigator.product)&&"NativeScript"!==e&&"NS"!==e)&&"undefined"!=typeof window&&"undefined"!=typeof document})(),isStandardBrowserWebWorkerEnv:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,protocols:["http","https","file","blob","url","data"]};function ee(e){function t(e,n,o,r){let s=e[r++];const i=Number.isFinite(+s),a=r>=e.length;return s=!s&&P.isArray(o)?o.length:s,a?(P.hasOwnProp(o,s)?o[s]=[o[s],n]:o[s]=n,!i):(o[s]&&P.isObject(o[s])||(o[s]=[]),t(e,n,o[s],r)&&P.isArray(o[s])&&(o[s]=function(e){const t={},n=Object.keys(e);let o;const r=n.length;let s;for(o=0;o<r;o++)s=n[o],t[s]=e[s];return t}(o[s])),!i)}if(P.isFormData(e)&&P.isFunction(e.entries)){const n={};return P.forEachEntry(e,((e,o)=>{t(function(e){return P.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),o,n,0)})),n}return null}const te={transitional:Z,adapter:["xhr","http"],transformRequest:[function(e,t){const n=t.getContentType()||"",o=n.indexOf("application/json")>-1,r=P.isObject(e);if(r&&P.isHTMLForm(e)&&(e=new FormData(e)),P.isFormData(e))return o&&o?JSON.stringify(ee(e)):e;if(P.isArrayBuffer(e)||P.isBuffer(e)||P.isStream(e)||P.isFile(e)||P.isBlob(e))return e;if(P.isArrayBufferView(e))return e.buffer;if(P.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let s;if(r){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return K(e,new Q.classes.URLSearchParams,Object.assign({visitor:function(e,t,n,o){return Q.isNode&&P.isBuffer(e)?(this.append(t,e.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((s=P.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return K(s?{"files[]":e}:e,t&&new t,this.formSerializer)}}return r||o?(t.setContentType("application/json",!1),function(e,t,n){if(P.isString(e))try{return(0,JSON.parse)(e),P.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||te.transitional,n=t&&t.forcedJSONParsing,o="json"===this.responseType;if(e&&P.isString(e)&&(n&&!this.responseType||o)){const n=!(t&&t.silentJSONParsing)&&o;try{return JSON.parse(e)}catch(e){if(n){if("SyntaxError"===e.name)throw I.from(e,I.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Q.classes.FormData,Blob:Q.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};P.forEach(["delete","get","head","post","put","patch"],(e=>{te.headers[e]={}}));var ne=te;const oe=P.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),re=Symbol("internals");function se(e){return e&&String(e).trim().toLowerCase()}function ie(e){return!1===e||null==e?e:P.isArray(e)?e.map(ie):String(e)}function ae(e,t,n,o,r){return P.isFunction(o)?o.call(this,t,n):(r&&(t=n),P.isString(t)?P.isString(o)?-1!==t.indexOf(o):P.isRegExp(o)?o.test(t):void 0:void 0)}class ce{constructor(e){e&&this.set(e)}set(e,t,n){const o=this;function r(e,t,n){const r=se(t);if(!r)throw new Error("header name must be a non-empty string");const s=P.findKey(o,r);(!s||void 0===o[s]||!0===n||void 0===n&&!1!==o[s])&&(o[s||t]=ie(e))}const s=(e,t)=>P.forEach(e,((e,n)=>r(e,n,t)));return P.isPlainObject(e)||e instanceof this.constructor?s(e,t):P.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim())?s((e=>{const t={};let n,o,r;return e&&e.split("\n").forEach((function(e){r=e.indexOf(":"),n=e.substring(0,r).trim().toLowerCase(),o=e.substring(r+1).trim(),!n||t[n]&&oe[n]||("set-cookie"===n?t[n]?t[n].push(o):t[n]=[o]:t[n]=t[n]?t[n]+", "+o:o)})),t})(e),t):null!=e&&r(t,e,n),this}get(e,t){if(e=se(e)){const n=P.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let o;for(;o=n.exec(e);)t[o[1]]=o[2];return t}(e);if(P.isFunction(t))return t.call(this,e,n);if(P.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=se(e)){const n=P.findKey(this,e);return!(!n||void 0===this[n]||t&&!ae(0,this[n],n,t))}return!1}delete(e,t){const n=this;let o=!1;function r(e){if(e=se(e)){const r=P.findKey(n,e);!r||t&&!ae(0,n[r],r,t)||(delete n[r],o=!0)}}return P.isArray(e)?e.forEach(r):r(e),o}clear(e){const t=Object.keys(this);let n=t.length,o=!1;for(;n--;){const r=t[n];e&&!ae(0,this[r],r,e,!0)||(delete this[r],o=!0)}return o}normalize(e){const t=this,n={};return P.forEach(this,((o,r)=>{const s=P.findKey(n,r);if(s)return t[s]=ie(o),void delete t[r];const i=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,n)=>t.toUpperCase()+n))}(r):String(r).trim();i!==r&&delete t[r],t[i]=ie(o),n[i]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return P.forEach(this,((n,o)=>{null!=n&&!1!==n&&(t[o]=e&&P.isArray(n)?n.join(", "):n)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach((e=>n.set(e))),n}static accessor(e){const t=(this[re]=this[re]={accessors:{}}).accessors,n=this.prototype;function o(e){const o=se(e);t[o]||(function(e,t){const n=P.toCamelCase(" "+t);["get","set","has"].forEach((o=>{Object.defineProperty(e,o+n,{value:function(e,n,r){return this[o].call(this,t,e,n,r)},configurable:!0})}))}(n,e),t[o]=!0)}return P.isArray(e)?e.forEach(o):o(e),this}}ce.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),P.reduceDescriptors(ce.prototype,(({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}})),P.freezeMethods(ce);var le=ce;function ue(e,t){const n=this||ne,o=t||n,r=le.from(o.headers);let s=o.data;return P.forEach(e,(function(e){s=e.call(n,s,r.normalize(),t?t.status:void 0)})),r.normalize(),s}function de(e){return!(!e||!e.__CANCEL__)}function pe(e,t,n){I.call(this,null==e?"canceled":e,I.ERR_CANCELED,t,n),this.name="CanceledError"}P.inherits(pe,I,{__CANCEL__:!0});var fe=Q.isStandardBrowserEnv?{write:function(e,t,n,o,r,s){const i=[];i.push(e+"="+encodeURIComponent(t)),P.isNumber(n)&&i.push("expires="+new Date(n).toGMTString()),P.isString(o)&&i.push("path="+o),P.isString(r)&&i.push("domain="+r),!0===s&&i.push("secure"),document.cookie=i.join("; ")},read:function(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}};function he(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}var me=Q.isStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let n;function o(n){let o=n;return e&&(t.setAttribute("href",o),o=t.href),t.setAttribute("href",o),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:"/"===t.pathname.charAt(0)?t.pathname:"/"+t.pathname}}return n=o(window.location.href),function(e){const t=P.isString(e)?o(e):e;return t.protocol===n.protocol&&t.host===n.host}}():function(){return!0};function ve(e,t){let n=0;const o=function(e,t){e=e||10;const n=new Array(e),o=new Array(e);let r,s=0,i=0;return t=void 0!==t?t:1e3,function(a){const c=Date.now(),l=o[i];r||(r=c),n[s]=a,o[s]=c;let u=i,d=0;for(;u!==s;)d+=n[u++],u%=e;if(s=(s+1)%e,s===i&&(i=(i+1)%e),c-r<t)return;const p=l&&c-l;return p?Math.round(1e3*d/p):void 0}}(50,250);return r=>{const s=r.loaded,i=r.lengthComputable?r.total:void 0,a=s-n,c=o(a);n=s;const l={loaded:s,total:i,progress:i?s/i:void 0,bytes:a,rate:c||void 0,estimated:c&&i&&s<=i?(i-s)/c:void 0,event:r};l[t?"download":"upload"]=!0,e(l)}}const ye={http:null,xhr:"undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){let o=e.data;const r=le.from(e.headers).normalize(),s=e.responseType;let i,a;function c(){e.cancelToken&&e.cancelToken.unsubscribe(i),e.signal&&e.signal.removeEventListener("abort",i)}P.isFormData(o)&&(Q.isStandardBrowserEnv||Q.isStandardBrowserWebWorkerEnv?r.setContentType(!1):r.getContentType(/^\s*multipart\/form-data/)?P.isString(a=r.getContentType())&&r.setContentType(a.replace(/^\s*(multipart\/form-data);+/,"$1")):r.setContentType("multipart/form-data"));let l=new XMLHttpRequest;if(e.auth){const t=e.auth.username||"",n=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";r.set("Authorization","Basic "+btoa(t+":"+n))}const u=he(e.baseURL,e.url);function d(){if(!l)return;const o=le.from("getAllResponseHeaders"in l&&l.getAllResponseHeaders());!function(e,t,n){const o=n.config.validateStatus;n.status&&o&&!o(n.status)?t(new I("Request failed with status code "+n.status,[I.ERR_BAD_REQUEST,I.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}((function(e){t(e),c()}),(function(e){n(e),c()}),{data:s&&"text"!==s&&"json"!==s?l.response:l.responseText,status:l.status,statusText:l.statusText,headers:o,config:e,request:l}),l=null}if(l.open(e.method.toUpperCase(),X(u,e.params,e.paramsSerializer),!0),l.timeout=e.timeout,"onloadend"in l?l.onloadend=d:l.onreadystatechange=function(){l&&4===l.readyState&&(0!==l.status||l.responseURL&&0===l.responseURL.indexOf("file:"))&&setTimeout(d)},l.onabort=function(){l&&(n(new I("Request aborted",I.ECONNABORTED,e,l)),l=null)},l.onerror=function(){n(new I("Network Error",I.ERR_NETWORK,e,l)),l=null},l.ontimeout=function(){let t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const o=e.transitional||Z;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(new I(t,o.clarifyTimeoutError?I.ETIMEDOUT:I.ECONNABORTED,e,l)),l=null},Q.isStandardBrowserEnv){const t=(e.withCredentials||me(u))&&e.xsrfCookieName&&fe.read(e.xsrfCookieName);t&&r.set(e.xsrfHeaderName,t)}void 0===o&&r.setContentType(null),"setRequestHeader"in l&&P.forEach(r.toJSON(),(function(e,t){l.setRequestHeader(t,e)})),P.isUndefined(e.withCredentials)||(l.withCredentials=!!e.withCredentials),s&&"json"!==s&&(l.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&l.addEventListener("progress",ve(e.onDownloadProgress,!0)),"function"==typeof e.onUploadProgress&&l.upload&&l.upload.addEventListener("progress",ve(e.onUploadProgress)),(e.cancelToken||e.signal)&&(i=t=>{l&&(n(!t||t.type?new pe(null,e,l):t),l.abort(),l=null)},e.cancelToken&&e.cancelToken.subscribe(i),e.signal&&(e.signal.aborted?i():e.signal.addEventListener("abort",i)));const p=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(u);p&&-1===Q.protocols.indexOf(p)?n(new I("Unsupported protocol "+p+":",I.ERR_BAD_REQUEST,e)):l.send(o||null)}))}};P.forEach(ye,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));const ge=e=>`- ${e}`,Ee=e=>P.isFunction(e)||null===e||!1===e;var be=e=>{e=P.isArray(e)?e:[e];const{length:t}=e;let n,o;const r={};for(let s=0;s<t;s++){let t;if(n=e[s],o=n,!Ee(n)&&(o=ye[(t=String(n)).toLowerCase()],void 0===o))throw new I(`Unknown adapter '${t}'`);if(o)break;r[t||"#"+s]=o}if(!o){const e=Object.entries(r).map((([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build")));throw new I("There is no suitable adapter to dispatch the request "+(t?e.length>1?"since :\n"+e.map(ge).join("\n"):" "+ge(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return o};function we(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new pe(null,e)}function Se(e){return we(e),e.headers=le.from(e.headers),e.data=ue.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),be(e.adapter||ne.adapter)(e).then((function(t){return we(e),t.data=ue.call(e,e.transformResponse,t),t.headers=le.from(t.headers),t}),(function(t){return de(t)||(we(e),t&&t.response&&(t.response.data=ue.call(e,e.transformResponse,t.response),t.response.headers=le.from(t.response.headers))),Promise.reject(t)}))}const Oe=e=>e instanceof le?e.toJSON():e;function Re(e,t){t=t||{};const n={};function o(e,t,n){return P.isPlainObject(e)&&P.isPlainObject(t)?P.merge.call({caseless:n},e,t):P.isPlainObject(t)?P.merge({},t):P.isArray(t)?t.slice():t}function r(e,t,n){return P.isUndefined(t)?P.isUndefined(e)?void 0:o(void 0,e,n):o(e,t,n)}function s(e,t){if(!P.isUndefined(t))return o(void 0,t)}function i(e,t){return P.isUndefined(t)?P.isUndefined(e)?void 0:o(void 0,e):o(void 0,t)}function a(n,r,s){return s in t?o(n,r):s in e?o(void 0,n):void 0}const c={url:s,method:s,data:s,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:a,headers:(e,t)=>r(Oe(e),Oe(t),!0)};return P.forEach(Object.keys(Object.assign({},e,t)),(function(o){const s=c[o]||r,i=s(e[o],t[o],o);P.isUndefined(i)&&s!==a||(n[o]=i)})),n}const Ae={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{Ae[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const Te={};Ae.transitional=function(e,t,n){function o(e,t){return"[Axios v1.5.1] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,r,s)=>{if(!1===e)throw new I(o(r," has been removed"+(t?" in "+t:"")),I.ERR_DEPRECATED);return t&&!Te[r]&&(Te[r]=!0,console.warn(o(r," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,r,s)}};var _e={assertOptions:function(e,t,n){if("object"!=typeof e)throw new I("options must be an object",I.ERR_BAD_OPTION_VALUE);const o=Object.keys(e);let r=o.length;for(;r-- >0;){const s=o[r],i=t[s];if(i){const t=e[s],n=void 0===t||i(t,s,e);if(!0!==n)throw new I("option "+s+" must be "+n,I.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new I("Unknown option "+s,I.ERR_BAD_OPTION)}},validators:Ae};const Ce=_e.validators;class De{constructor(e){this.defaults=e,this.interceptors={request:new Y,response:new Y}}request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Re(this.defaults,t);const{transitional:n,paramsSerializer:o,headers:r}=t;void 0!==n&&_e.assertOptions(n,{silentJSONParsing:Ce.transitional(Ce.boolean),forcedJSONParsing:Ce.transitional(Ce.boolean),clarifyTimeoutError:Ce.transitional(Ce.boolean)},!1),null!=o&&(P.isFunction(o)?t.paramsSerializer={serialize:o}:_e.assertOptions(o,{encode:Ce.function,serialize:Ce.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase();let s=r&&P.merge(r.common,r[t.method]);r&&P.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete r[e]})),t.headers=le.concat(s,r);const i=[];let a=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(a=a&&e.synchronous,i.unshift(e.fulfilled,e.rejected))}));const c=[];let l;this.interceptors.response.forEach((function(e){c.push(e.fulfilled,e.rejected)}));let u,d=0;if(!a){const e=[Se.bind(this),void 0];for(e.unshift.apply(e,i),e.push.apply(e,c),u=e.length,l=Promise.resolve(t);d<u;)l=l.then(e[d++],e[d++]);return l}u=i.length;let p=t;for(d=0;d<u;){const e=i[d++],t=i[d++];try{p=e(p)}catch(e){t.call(this,e);break}}try{l=Se.call(this,p)}catch(e){return Promise.reject(e)}for(d=0,u=c.length;d<u;)l=l.then(c[d++],c[d++]);return l}getUri(e){return X(he((e=Re(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}}P.forEach(["delete","get","head","options"],(function(e){De.prototype[e]=function(t,n){return this.request(Re(n||{},{method:e,url:t,data:(n||{}).data}))}})),P.forEach(["post","put","patch"],(function(e){function t(t){return function(n,o,r){return this.request(Re(r||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:o}))}}De.prototype[e]=t(),De.prototype[e+"Form"]=t(!0)}));var Fe=De;class Ne{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const n=this;this.promise.then((e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null})),this.promise.then=e=>{let t;const o=new Promise((e=>{n.subscribe(e),t=e})).then(e);return o.cancel=function(){n.unsubscribe(t)},o},e((function(e,o,r){n.reason||(n.reason=new pe(e,o,r),t(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}static source(){let e;return{token:new Ne((function(t){e=t})),cancel:e}}}var je=Ne;const ke={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(ke).forEach((([e,t])=>{ke[t]=e}));var Le=ke;const Ue=function e(t){const n=new Fe(t),r=o(Fe.prototype.request,n);return P.extend(r,Fe.prototype,n,{allOwnKeys:!0}),P.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(Re(t,n))},r}(ne);Ue.Axios=Fe,Ue.CanceledError=pe,Ue.CancelToken=je,Ue.isCancel=de,Ue.VERSION="1.5.1",Ue.toFormData=K,Ue.AxiosError=I,Ue.Cancel=Ue.CanceledError,Ue.all=function(e){return Promise.all(e)},Ue.spread=function(e){return function(t){return e.apply(null,t)}},Ue.isAxiosError=function(e){return P.isObject(e)&&!0===e.isAxiosError},Ue.mergeConfig=Re,Ue.AxiosHeaders=le,Ue.formToJSON=e=>ee(P.isHTMLForm(e)?new FormData(e):e),Ue.getAdapter=be,Ue.HttpStatusCode=Le,Ue.default=Ue,e.exports=Ue}},t={};function n(o){var r=t[o];if(void 0!==r)return r.exports;var s=t[o]={exports:{}};return e[o].call(s.exports,s,s.exports,n),s.exports}n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}();var o={};return(()=>{var e=o;const t=n(234),r=n(604),s=n(122);class i{}i.livenessDetection=t.livenessDetection,i.uploadIdentificationDocument=r.uploadIdentificationDocument,i.insertUploadIdentificationDocument=s.insertUploadIdentificationDocument,e.default=i})(),o.default})()));
@@ -14,6 +14,7 @@ function insertUploadIdentificationDocument(options, cssSelector) {
14
14
  iframeElement.setAttribute('width', (_a = options.width) !== null && _a !== void 0 ? _a : '100%');
15
15
  iframeElement.setAttribute('height', (_b = options.height) !== null && _b !== void 0 ? _b : '550px');
16
16
  iframeElement.setAttribute('scrolling', 'no');
17
+ iframeElement.setAttribute('allow', 'camera; microphone; clipboard-read; clipboard-write');
17
18
  let iframeUrl = `${(_c = options.customAppUrl) !== null && _c !== void 0 ? _c : constants_1.APPLICATION_URL}/share/domains/${options.domain}/tracks/${options.track}/flow/${options.flow}/embedded`;
18
19
  if (options.token) {
19
20
  iframeUrl += `?accessToken=${options.token}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "santoid-sdk",
3
- "version": "4.0.0",
3
+ "version": "4.0.1",
4
4
  "description": "",
5
5
  "main": "client/index.js",
6
6
  "types": "client/index.d.ts",