@sprig-technologies/sprig-bundled 2.39.0 → 2.39.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,658 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./view-B4pC15mF.cjs"),Z=require("./index-CtrI2XYD.cjs"),_=require("./getAttributedUrl-vp624K19.cjs"),se="https://cdn.sprig.com",S={document:void 0,videojs:void 0},Se=n=>n+"-loading-spiner",G="hidden",Me=".m3u8",xe="questionId",we="ul-video-recorder-camera-off-button",ke="ul-recording-in-session",rn=[{type:"link",content:`${se}/dependencies/videojs-record-4.5.0.min.css`},{type:"script",content:`${se}/dependencies/RecordRTC-5.6.2.js`},{type:"script",content:`${se}/dependencies/adapter.8.0.0.min.js`},{type:"script",content:`${se}/dependencies/videojs-record-4.5.0.min.js`},{type:"script",content:`${se}/userleap-web-upchunk-v2.2.2.js`}],He=[{type:"link",content:`${se}/dependencies/video-js-7.18.0.min.css`},{type:"script",content:`${se}/dependencies/video-js-7.18.0.min.js`},{type:"style",content:`/* progress control styles */
2
- .video-js .vjs-control {
3
- font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
4
- }
5
-
6
- .video-js .vjs-progress-control .vjs-progress-holder {
7
- margin: 0 0px;
8
- }
9
-
10
- .video-js .vjs-progress-control {
11
- position: absolute;
12
- height: 3px;
13
- width: 100%;
14
- }
15
- /* position and align the buttons and button texts */
16
- .ul-control-panel {
17
- bottom: 0;
18
- width: 100%;
19
- flex-direction: column;
20
- background-color: white;
21
- height: fit-content;
22
- z-index: 2;
23
- }
24
-
25
- .ul-buttons-panel {
26
- color: black;
27
- display: flex;
28
- gap: 20px;
29
- height: 50px;
30
- justify-content: center;
31
- margin: 10px;
32
- padding: 2px 14px 0;
33
- }
34
-
35
- .video-js .vjs-volume-panel {
36
- height: 30px;
37
- width: 40px;
38
- }
39
-
40
- .ul-inactive {
41
- opacity: 0.3;
42
- cursor: default;
43
- pointer-events: none;
44
- }
45
-
46
- /* buttons */
47
- .ul-buttons-panel > .vjs-button {
48
- background-color: rgba(0, 0, 0, 0.05);
49
- border-radius: 50%;
50
- display: flex;
51
- height: 3em;
52
- justify-content: center;
53
- width: 3em;
54
- }
55
-
56
- .vjs-button>.vjs-icon-placeholder:before {
57
- align-items: center;
58
- display: flex;
59
- font-size: unset;
60
- line-height: 0.5;
61
- justify-content: center;
62
- }
63
-
64
- span.ul-button-text {
65
- align-self: flex-end;
66
- position: relative;
67
- top: 14px;
68
- }
69
-
70
- #ul-camera-button {
71
- white-space: nowrap;
72
- }
73
-
74
- .video-js .vjs-volume-control.vjs-volume-horizontal {
75
- background-color: #fff;
76
- z-index: 1;
77
- }
78
-
79
- .vjs-volume-bar.vjs-slider-horizontal .vjs-volume-level {
80
- background-color: black;
81
- }
82
-
83
- .video-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,
84
- .video-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,
85
- .video-js .vjs-volume-panel.vjs-volume-panel-horizontal:active {
86
- width: 40px;
87
- }
88
-
89
- .video-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active,
90
- .video-js .vjs-volume-panel .vjs-volume-control:active,
91
- .video-js .vjs-volume-panel.vjs-hover .vjs-mute-control ~ .vjs-volume-control,
92
- .video-js .vjs-volume-panel.vjs-hover .vjs-volume-control,
93
- .video-js .vjs-volume-panel:active .vjs-volume-control,
94
- .video-js .vjs-volume-panel:focus .vjs-volume-control {
95
- visibility: visible;
96
- left: 40px;
97
- position: absolute;
98
- transition: visibility 0.1s, opacity 0.1s, height 0.1s, width 0.1s, left 0s, top 0s;
99
- }
100
-
101
- /* play button customization */
102
- .video-js .vjs-play-control {
103
- color: black;
104
- }
105
-
106
- .video-js .vjs-play-control .vjs-icon-placeholder:before {
107
- content: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 12 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10.5363 6.40226L1.93958 10.7006C1.64037 10.8502 1.28833 10.6326 1.28833 10.2981V1.7014C1.28833 1.36688 1.64037 1.14931 1.93958 1.29891L10.5363 5.59727C10.868 5.76311 10.868 6.23642 10.5363 6.40226Z' stroke='black' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
108
- }
109
-
110
- /* position and style the current timer */
111
- .ul-time-panel {
112
- position: absolute;
113
- bottom: 80px;
114
- left: 10px;
115
- height: 22px;
116
- color: black;
117
- border: 1px solid #e0e0eb;
118
- border-radius: 23px;
119
- background-color: white;
120
- width: fit-content;
121
- }
122
-
123
- .video-js .vjs-current-time,
124
- .vjs-no-flex .vjs-current-time {
125
- display: flex;
126
- align-items: center;
127
- text-align: center;
128
- }
129
-
130
- /* remove the dot progress indicator */
131
- .video-js .vjs-play-progress:before,
132
- .video-js .vjs-volume-level:before,
133
- .vjs-icon-circle:before,
134
- .vjs-seek-to-live-control .vjs-icon-placeholder:before {
135
- content: none;
136
- }
137
-
138
- .video-js .vjs-mute-control .vjs-icon-placeholder:before {
139
- content: url("data:image/svg+xml,%3Csvg width='19' height='14' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M8.825.324A.75.75 0 019.25 1v11.667a.75.75 0 01-1.219.585l-3.96-3.169H1a.75.75 0 01-.75-.75v-5a.75.75 0 01.75-.75h3.07L8.031.414a.75.75 0 01.794-.09zM7.75 2.56L4.802 4.92a.75.75 0 01-.469.164H1.75v3.5h2.583a.75.75 0 01.469.165l2.948 2.358V2.56zM14.911.47a.75.75 0 011.061 0 9.084 9.084 0 010 12.844.75.75 0 01-1.06-1.06 7.584 7.584 0 000-10.724.75.75 0 010-1.06zM11.97 3.41a.75.75 0 011.06 0 4.917 4.917 0 010 6.953.75.75 0 11-1.06-1.06 3.417 3.417 0 000-4.832.75.75 0 010-1.06z' fill='%23262136'/%3E%3C/svg%3E");
140
- }
141
-
142
- .video-js .vjs-mute-control.vjs-vol-0 .vjs-icon-placeholder:before {
143
- content: url("data:image/svg+xml,%3Csvg width='19' height='14' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M8.5 1.167L4.333 4.5H1v5h3.333L8.5 12.833V1.167zM17.17 4.5l-5 5M12.17 4.5l5 5' stroke='%23262136' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
144
- }
145
-
146
- .video-js .vjs-mute-control.vjs-vol-1 .vjs-icon-placeholder:before {
147
- content: url("data:image/svg+xml,%3Csvg width='19' height='14' viewBox='0 0 19 14' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M8.82489 0.32403C9.08474 0.44892 9.25 0.711703 9.25 1.00001V12.6667C9.25 12.955 9.08474 13.2178 8.82489 13.3427C8.56504 13.4675 8.25661 13.4324 8.03148 13.2523L4.07025 10.0833H1C0.585786 10.0833 0.25 9.74755 0.25 9.33334V4.33334C0.25 3.91913 0.585786 3.58334 1 3.58334H4.07025L8.03148 0.414355C8.25661 0.234253 8.56504 0.19914 8.82489 0.32403ZM7.75 2.56048L4.80185 4.91899C4.66887 5.02538 4.50364 5.08334 4.33333 5.08334H1.75V8.58334H4.33333C4.50364 8.58334 4.66887 8.6413 4.80185 8.74769L7.75 11.1062V2.56048Z' fill='%23262136'/%3E%3C/svg%3E%0A");
148
- }
149
-
150
- .video-js .vjs-mute-control.vjs-vol-2 .vjs-icon-placeholder:before {
151
- content: url("data:image/svg+xml,%3Csvg width='19' height='14' viewBox='0 0 19 14' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M8.82489 0.32403C9.08474 0.44892 9.25 0.711703 9.25 1.00001V12.6667C9.25 12.955 9.08474 13.2178 8.82489 13.3427C8.56504 13.4675 8.25661 13.4324 8.03148 13.2523L4.07025 10.0833H1C0.585786 10.0833 0.25 9.74755 0.25 9.33334V4.33334C0.25 3.91913 0.585786 3.58334 1 3.58334H4.07025L8.03148 0.414355C8.25661 0.234253 8.56504 0.19914 8.82489 0.32403ZM7.75 2.56048L4.80185 4.91899C4.66887 5.02538 4.50364 5.08334 4.33333 5.08334H1.75V8.58334H4.33333C4.50364 8.58334 4.66887 8.6413 4.80185 8.74769L7.75 11.1062V2.56048Z' fill='%23262136'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M11.9698 3.41124C12.2627 3.11839 12.7376 3.11846 13.0304 3.4114C13.9521 4.33341 14.4699 5.58376 14.4699 6.88748C14.4699 8.19121 13.9521 9.44156 13.0304 10.3636C12.7376 10.6565 12.2627 10.6566 11.9698 10.3637C11.6768 10.0709 11.6767 9.596 11.9696 9.30307C12.6101 8.66235 12.9699 7.79346 12.9699 6.88748C12.9699 5.98151 12.6101 5.11262 11.9696 4.4719C11.6767 4.17896 11.6768 3.70409 11.9698 3.41124Z' fill='%23262136'/%3E%3C/svg%3E%0A");
152
- }
153
-
154
- .video-js .vjs-volume-control:hover .vjs-mouse-display {
155
- display: none !important;
156
- }
157
-
158
- .video-js .vjs-play-progress {
159
- background-color: black;
160
- }
161
-
162
- /* position video player inside the container */
163
- .video-js .vjs-tech {
164
- position: static;
165
- }
166
-
167
- .video-js .vjs-time-tooltip {
168
- padding: 0.25em 0.75em;
169
- align-items: center;
170
- color: #333;
171
- background: #FCFCFD;
172
- border-radius: 99px;
173
- text-align: center;
174
- border: 1px solid #E0E0EB;
175
- display: flex;
176
- align-items: center;
177
- justify-content: center;
178
- top: -25px;
179
- font-size: 12px !important;
180
- width: 50px !important;
181
- }
182
-
183
- .video-js .vjs-play-progress.vjs-slider-bar .vjs-time-tooltip {
184
- visibility: hidden !important;
185
- }
186
-
187
- .video-js .vjs-progress-control .vjs-mouse-display {
188
- z-index: 2;
189
- }
190
-
191
- .ul-video-player {
192
- width: 100%;
193
- display: flex;
194
- flex-direction: column;
195
- height: auto;
196
- border: 1px solid #E6E6E6;
197
- background-color: white;
198
- box-sizing: border-box;
199
- border-radius: 4px;
200
- background-clip: border-box;
201
- overflow: hidden;
202
- }
203
-
204
- .video-js.vjs-fullscreen:not(.vjs-ios-native-fs) {
205
- border: none;
206
- }
207
-
208
- #video-response-player-secondary-video-player {
209
- max-width: 200px;
210
- margin-right: 20px;
211
- background-color: transparent;
212
- }
213
-
214
- #ul-card-video__player_recorder-video-recorder.vjs-fullscreen {
215
- display: table;
216
- }
217
-
218
- .video-js div.vjs-progress-control {
219
- margin-top: -3px;
220
- }
221
-
222
- .video-js .vjs-progress-control .vjs-slider {
223
- background-color: #B2BBBD;
224
- }
225
-
226
- .vjs-record.video-js .vjs-control.vjs-button.vjs-fullscreen-control {
227
- position:relative;
228
- }
229
-
230
- .video-js .vjs-fullscreen-control .vjs-icon-placeholder:before {
231
- content: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M9.82143 2.54004L12.2614 2.54004C12.9242 2.54004 13.4614 3.0773 13.4614 3.74004L13.4614 6.18004' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M6.17955 13.46L3.73955 13.46C3.07681 13.46 2.53955 12.9227 2.53955 12.26L2.53955 9.81996' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M12.7772 3.22266L9.36475 6.63516' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M6.29434 9.70605L2.88184 13.1186' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
232
- }
233
-
234
- .video-js.vjs-fullscreen .vjs-fullscreen-control .vjs-icon-placeholder:before {
235
- content: url("data:image/svg+xml,%3Csvg width='16' height='16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1.583 9.813H5.25a1 1 0 011 1v3.666M5.375 10.688L1 15.061M14.917 5.813H11.25a1 1 0 01-1-1V1.146M15.063 1l-4.376 4.375' stroke='%23262136' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
236
- }
237
-
238
- .video-js .vjs-play-control.vjs-ended .vjs-icon-placeholder:before, .video-js .vjs-icon-replay:before {
239
- content: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 12 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10.5363 6.40226L1.93958 10.7006C1.64037 10.8502 1.28833 10.6326 1.28833 10.2981V1.7014C1.28833 1.36688 1.64037 1.14931 1.93958 1.29891L10.5363 5.59727C10.868 5.76311 10.868 6.23642 10.5363 6.40226Z' stroke='black' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
240
- }
241
-
242
- .video-js .vjs-play-control.vjs-playing .vjs-icon-placeholder:before, .vjs-icon-pause:before {
243
- content: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='3.61885' y='2.06074' width='3.16185' height='11.88' rx='0.9' fill='black' stroke='%23EDEDED' stroke-width='0.6' stroke-linecap='round'/%3E%3Crect x='9.21797' y='2.06074' width='3.16185' height='11.88' rx='0.9' fill='black' stroke='%23EDEDED' stroke-width='0.6' stroke-linecap='round'/%3E%3C/svg%3E%0A");
244
- padding: 2px;
245
- }
246
-
247
- .vjs-error-display {
248
- display: none;
249
- }
250
-
251
- .ul-video-player-video {
252
- position: relative;
253
- top: 0;
254
- left: 0;
255
- width: 100%;
256
- }
257
-
258
- .ul-video-container {
259
- width: 100%;
260
- height: auto;
261
- left: 0px;
262
- top: 0px;
263
-
264
- background-color: transparent;
265
- border-radius: 4px;
266
-
267
- align-items: start;
268
- display: flex;
269
- flex-direction: column;
270
-
271
- /* Inside Auto Layout */
272
-
273
- flex: none;
274
- order: 0;
275
- flex-grow: 0;
276
- margin: 10px 0px;
277
- position: relative;
278
- }
279
-
280
- .vjs-record button.vjs-device-button.vjs-control {
281
- background: rgba(255, 255, 255, 96);
282
- width: 100%;
283
- height: 100%;
284
- left: 0;
285
- top: 0;
286
- margin: 0;
287
- border-radius: 0;
288
- line-height: 0.6;
289
- padding: 10px;
290
- display: flex;
291
- align-items: center;
292
- flex-direction: column;
293
- justify-content: center;
294
- z-index: 3;
295
- }
296
-
297
- .vjs-record .vjs-device-button.vjs-control:before {
298
- font-size: 14px !important;
299
- color: #333;
300
- content: "Your browser needs to access your camera and microphone for video recording";
301
- line-height: 135%;
302
- }
303
-
304
- .vjs-record .vjs-device-button.vjs-control.permission-denied:before {
305
- font-size: 16px !important;
306
- color: #262136;
307
- content: "Unable to access your camera and microphone";
308
- }
309
-
310
- .vjs-record .vjs-device-button.vjs-control:after {
311
- display: inline-block;
312
- background: #F0F0F5;
313
- font-size: 13px;
314
- border-radius: 4px;
315
- content: "Request Permissions";
316
- padding: 1em 2em;
317
- color: #333;
318
- margin-top: 20px;
319
- }
320
-
321
- .vjs-record .vjs-device-button.vjs-control.permission-denied:after {
322
- display: inline-block;
323
- background: white;
324
- font-size: 13px;
325
- content: "Please go to your browser settings and update permissions to enable recording";
326
- padding: 1em;
327
- color: #4B575D;
328
- margin: 5px;
329
- line-height: 135%;
330
- text-align: center;
331
- }
332
-
333
- .vjs-control.vjs-button.ul-video-recorder-delete-button, .vjs-control.vjs-button.ul-video-recorder-toggle-button, .vjs-control.vjs-button.ul-video-recorder-camera-off-button-audio-only, .vjs-control.vjs-button.ul-video-recorder-camera-off-button {
334
- cursor: pointer;
335
- }
336
-
337
- .ul-video-recorder-delete-button .vjs-icon-placeholder:before {
338
- content: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M9.21234 7.37549V11.1193M2.53931 4.25595H13.4593H2.53931ZM5.57234 4.25595V3.00833C5.57222 2.84433 5.60354 2.68192 5.6645 2.53038C5.72546 2.37884 5.81488 2.24115 5.92762 2.12519C6.04037 2.00922 6.17424 1.91726 6.32158 1.85456C6.46892 1.79185 6.62683 1.75964 6.78628 1.75977H9.21234C9.37179 1.75964 9.5297 1.79185 9.67703 1.85456C9.82437 1.91726 9.95824 2.00922 10.071 2.12519C10.1837 2.24115 10.2732 2.37884 10.3341 2.53038C10.3951 2.68192 10.4264 2.84433 10.4263 3.00833V4.25595H5.57234ZM12.2463 4.25595V12.9912C12.2463 13.3223 12.1184 13.6399 11.8907 13.8741C11.6631 14.1082 11.3543 14.2398 11.0323 14.2398H4.96628C4.64432 14.2398 4.33555 14.1082 4.10789 13.8741C3.88023 13.6399 3.75234 13.3223 3.75234 12.9912V4.25595H12.2463ZM6.78628 7.37549V11.1193V7.37549Z' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E%0A");
339
- }
340
-
341
- .ul-video-recorder-toggle-button .vjs-icon-placeholder:before {
342
- content: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M8 0C12.4183 0 16 3.58172 16 8C16 12.4183 12.4183 16 8 16C3.58172 16 0 12.4183 0 8C0 3.58172 3.58172 0 8 0Z' fill='%23D15153'/%3E%3C/svg%3E");
343
- }
344
-
345
- .ul-video-recorder-toggle-button.ul-recording-in-session .vjs-icon-placeholder:before {
346
- content: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 12 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 10L12 2C12 0.89543 11.1046 -4.85396e-07 10 -4.37114e-07L2 -8.74228e-08C0.89543 -3.91405e-08 -4.85396e-07 0.895431 -4.37114e-07 2L-8.74228e-08 10C-3.91405e-08 11.1046 0.895431 12 2 12L10 12C11.1046 12 12 11.1046 12 10Z' fill='%23D15153'/%3E%3C/svg%3E%0A");
347
- }
348
-
349
- .ul-video-recorder-camera-off-button .vjs-icon-placeholder:before {
350
- content: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cg clip-path='url(%23clip0_2645_4654)'%3E%3Cpath d='M15.1491 4.75L10.5991 8L15.1491 11.25V4.75Z' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M9.29912 3.4502H2.14912C1.43115 3.4502 0.849121 4.03223 0.849121 4.7502V11.2502C0.849121 11.9682 1.43115 12.5502 2.14912 12.5502H9.29912C10.0171 12.5502 10.5991 11.9682 10.5991 11.2502V4.7502C10.5991 4.03223 10.0171 3.4502 9.29912 3.4502Z' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id='clip0_2645_4654'%3E%3Crect width='15.6' height='15.6' fill='white' transform='translate(0.199951 0.200195)'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E");
351
- }
352
-
353
- .ul-video-recorder-camera-off-button-audio-only .vjs-icon-placeholder:before {
354
- content: url("data:image/svg+xml,%3Csvg width='22' height='15' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M.75 3A2.75 2.75 0 013.5.25h9.081A2.75 2.75 0 0115.331 3v9a2.75 2.75 0 01-2.75 2.75H3.5A2.75 2.75 0 01.75 12V3zM3.5 1.75c-.69 0-1.25.56-1.25 1.25v9c0 .69.56 1.25 1.25 1.25h9.081c.69 0 1.25-.56 1.25-1.25V3c0-.69-.56-1.25-1.25-1.25H3.5z' fill='%23262136'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M14.53 2.03l-12 12-1.06-1.06 12-12 1.06 1.06zM20.87 1.525a.75.75 0 01.38.652v10.588a.75.75 0 01-1.134.644l-5.92-3.53a.75.75 0 01-.365-.643v-3.53a.75.75 0 01.366-.644l5.919-3.53a.75.75 0 01.754-.007zm-5.539 4.607V8.81l4.419 2.635V3.497l-4.419 2.635z' fill='%23262136'/%3E%3C/svg%3E");
355
- transform: scale(0.75);
356
- }
357
-
358
- .ul-upload-progress-label {
359
- padding: 0.15em 0.75em;
360
- align-items: center;
361
- font-size: 12px;
362
- color: #333;
363
- background: #FCFCFD;
364
- border-radius: 99px;
365
- text-align: center;
366
- border: 1px solid #E0E0EB;
367
- display: flex;
368
- align-items: center;
369
- justify-content: center;
370
- position: absolute;
371
- bottom: 75px;
372
- left: calc(50% - 65px);
373
- width: 130px;
374
- z-index: 5;
375
- }
376
-
377
- .ul-upload-progress-label__time {
378
- display: inline-flex;
379
- margin-left: 0.8em;
380
- align-items: center;
381
- }
382
-
383
- .ul-upload-progress-label__time:before {
384
- content: "";
385
- display: inline-flex;
386
- width: 1px;
387
- height: 12px;
388
- background-color: #E0E0EB;
389
- margin-right: 0.8em;
390
- }
391
-
392
- @keyframes grow {
393
- 0% {
394
- transform: scale(1);
395
- background-color: #EEECFC;
396
- }
397
- 50% {
398
- transform: scale(1.2);
399
- background-color: #E1DFF4;
400
- }
401
- 100% {
402
- transform: scale(1);
403
- background-color: #EEECFC;
404
- }
405
- }
406
-
407
- .ul-audio-recorder-placeholder:before {
408
- width: 80px;
409
- height: 80px;
410
- border-radius: 120px;
411
- background-color: #EEECFC;
412
- content: "";
413
- position: absolute;
414
- left: calc(50% - 40px);
415
- top: calc(50% - 40px);
416
- animation: 6s infinite grow;
417
- transform-origin: 50% 60%;
418
- }
419
-
420
- .ul-audio-recorder-placeholder:after {
421
- content: url("data:image/svg+xml,%3Csvg width='98' height='98' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cmask id='a' maskUnits='userSpaceOnUse' x='0' y='0' width='98' height='98'%3E%3Ccircle cx='49' cy='49' r='49' fill='%23EDECF8'/%3E%3C/mask%3E%3Cg mask='url(%23a)'%3E%3Ccircle cx='49' cy='49' r='50' fill='%23645CC2'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M11.422 81.812c5.405-15.547 20.187-26.706 37.576-26.706 17.39 0 32.172 11.159 37.577 26.707-9.164 10.43-22.601 17.013-37.576 17.013-14.976 0-28.414-6.583-37.577-17.014z' fill='%23fff' fill-opacity='.6'/%3E%3Ccircle cx='49' cy='29' r='17' fill='%23fff' fill-opacity='.7'/%3E%3C/g%3E%3C/svg%3E");
422
- position: absolute;
423
- left: 50%;
424
- top: 50%;
425
- transform: translate(-50%, -50%);
426
- transform: translate(-50%, -50%) scale(0.6);
427
- }
428
-
429
- .ul-audio-recorder-placeholder {
430
- min-height: 150px;
431
- width: 100%;
432
- background-color: #fcfcfd;
433
- display: block;
434
- position: relative;
435
- }
436
-
437
- .vjs-fullscreen .ul-audio-recorder-placeholder {
438
- vertical-align: middle;
439
- display: table-cell;
440
- }
441
-
442
- .vjs-fullscreen .ul-control-panel {
443
- height: 80px;
444
- position: absolute;
445
- bottom: 0;
446
- left: 0;
447
- width: 100%;
448
- max-width: 100%;
449
- background-color: #F8F8F8;
450
- }
451
-
452
- .vjs-playback-rate .vjs-playback-rate-value {
453
- align-items: center;
454
- display: flex;
455
- font-size: 12px;
456
- justify-content: center;
457
- }
458
-
459
- .vjs-playback-rate .vjs-menu {
460
- left: -5px;
461
- bottom: 3px;
462
- }
463
-
464
- .vjs-menu-button-popup .vjs-menu .vjs-menu-content {
465
- background-color: white;
466
- border: 1px solid rgba(0, 0, 0, 0.1);
467
- box-sizing: border-box;
468
- border-radius: 4px;
469
- }
470
-
471
- .vjs-menu li {
472
- font-size: 12px;
473
- padding: 5px 0;
474
- }
475
-
476
- .vjs-menu li.vjs-selected {
477
- color: lightgray;
478
- }
479
-
480
- .vjs-menu li.vjs-menu-item:hover {
481
- background-color: rgba(0, 0, 0, 0.05);
482
- }
483
-
484
- .vjs-fullscreen .ul-buttons-panel {
485
- top: calc(50% - 30px);
486
- position: relative;
487
- }
488
-
489
- .vjs-fullscreen .vjs-record-indicator.vjs-control {
490
- bottom: 90px !important;
491
- }
492
-
493
- .vjs-record.video-js div.vjs-control.vjs-record-indicator {
494
- padding: 0.3em 0.75em 0.15em 15px;
495
- align-items: center;
496
- font-size: 12px;
497
- color: #333;
498
- background: #FCFCFD;
499
- border-radius: 99px;
500
- text-align: center;
501
- border: 1px solid #E0E0EB;
502
- display: flex;
503
- justify-content: center;
504
- align-items: center;
505
- position: absolute;
506
- bottom: 75px;
507
- top: auto;
508
- left: calc(50% - 21px);
509
- width: 43px;
510
- height: 16px;
511
- z-index: 4;
512
- }
513
-
514
- .vjs-record.video-js div.vjs-control.vjs-record-indicator:after {
515
- content: "";
516
- background-color: #EB5757;
517
- width: 6px;
518
- height: 6px;
519
- border-radius: 8px;
520
- animation: none;
521
- top: 4px;
522
- left: 5px;
523
- }
524
-
525
- .vjs-record.video-js div.vjs-control.vjs-record-indicator:before {
526
- position: relative;
527
- font-size: 9px;
528
- animation: none;
529
- opacity: 1;
530
- color: #333;
531
- top: auto;
532
- left: auto;
533
- }
534
-
535
- .ul-video-player-loading {
536
- display: inline-block;
537
- position: relative;
538
- width: 6rem;
539
- height: 6rem;
540
-
541
- }
542
- .ul-video-player-loading div {
543
- box-sizing: border-box;
544
- position: absolute;
545
- display: block;
546
- width: 80%;
547
- height: 80%;
548
- margin: 5px;
549
- border: 5px solid #666;
550
- border-radius: 50%;
551
- animation: lds-ring 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
552
- border-color: #666 transparent transparent transparent;
553
- }
554
-
555
- .first {
556
- animation-delay: -0.45s;
557
- }
558
- .second {
559
- animation-delay: -0.3s;
560
- }
561
- .third {
562
- animation-delay: -0.15s;
563
- }
564
-
565
- @keyframes lds-ring {
566
- 0% {
567
- transform: rotate(0deg);
568
- }
569
- 100% {
570
- transform: rotate(360deg);
571
- }
572
- }
573
-
574
- .ul-video-btn {
575
- width: 100%;
576
- border: 1px solid #E6E6E6;
577
- border-radius: 4px;
578
- background-color: rgba(0, 0, 0, 0.02);
579
- padding: 8px;
580
- font-weight: 500;
581
- font-size: 15px;
582
- }
583
-
584
- .ul-record-response-btn:before, .ul-record-response-btn:after, .ul-back-question-btn:before, .ul-back-question-btn:after {
585
- margin: 0 5px;
586
- vertical-align: middle;
587
- }
588
-
589
- .ul-record-response-btn:before {
590
- content: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cg clip-path='url(%23clip0_2645_4654)'%3E%3Cpath d='M15.1491 4.75L10.5991 8L15.1491 11.25V4.75Z' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M9.29912 3.4502H2.14912C1.43115 3.4502 0.849121 4.03223 0.849121 4.7502V11.2502C0.849121 11.9682 1.43115 12.5502 2.14912 12.5502H9.29912C10.0171 12.5502 10.5991 11.9682 10.5991 11.2502V4.7502C10.5991 4.03223 10.0171 3.4502 9.29912 3.4502Z' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id='clip0_2645_4654'%3E%3Crect width='15.6' height='15.6' fill='white' transform='translate(0.199951 0.200195)'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E");
591
- display: inline-block;
592
- transform: translate(0px, 2px);
593
- }
594
-
595
- .ul-record-response-btn:after {
596
- content: 'Record your Response';
597
- }
598
-
599
- .ul-back-question-btn:before {
600
- content: url("data:image/svg+xml,%3Csvg width='15' height='16' viewBox='0 0 15 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M13.8757 8.22361L1.1118 14.6056C0.945578 14.6887 0.75 14.5678 0.75 14.382V1.61803C0.75 1.43219 0.945579 1.31131 1.1118 1.39443L13.8757 7.77639C14.06 7.86852 14.06 8.13148 13.8757 8.22361Z' stroke='black' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
601
- display: inline-block;
602
- transform: scale(0.85) translate(0, 1px);
603
- -moz-transform: scale(0.85) translate(0, 2px);
604
- }
605
-
606
- .ul-back-question-btn:after {
607
- content: 'Back to Question';
608
- }
609
-
610
- .hidden {
611
- display: none !important;
612
- opacity: 0;
613
- visibility: hidden;
614
- }
615
-
616
- .visible {
617
- visibility: visible;
618
- opacity: 1;
619
- animation: fade 0.3s;
620
- }
621
-
622
- @keyframes fade {
623
- 0% {
624
- opacity: 0;
625
- }
626
-
627
- 100% {
628
- opacity: 1;
629
- }
630
- }
631
-
632
- #ul-recording-countdown-screen {
633
- width: 100%;
634
- height: 100%;
635
- color: black;
636
- background-color: rgba(255, 255, 255, 0.8);
637
- position: absolute;
638
- text-align: center;
639
- font-size: 15px;
640
- z-index: 1;
641
- display: table;
642
- }
643
-
644
- .ul-countdown-text {
645
- vertical-align: middle;
646
- display: table-cell;
647
- transform: translate(0, -25px);
648
- }
649
-
650
- .vjs-fullscreen > #ul-recording-countdown-screen {
651
- font-size: 25px;
652
- transform: unset;
653
- }
654
-
655
- .vjs-poster {
656
- background-size: cover;
657
- }
658
- `}],$e="-video-player",Le="-secondary-video-player",Be="-video-recorder";let X,Pe;const re=async({event:n,apiBase:o,headers:t,visitorId:r,envId:i,metadata:s})=>{const l=S.document.documentElement;if(!r||!i)return;const v={event:`SDK - ${n}`,visitorId:r,environmentId:i,metadata:{...s||{},screenWidth:window.screen.width,screenHeight:window.screen.height,clientWidth:l.clientWidth,clientHeight:l.clientHeight,location:window.location.href,language:navigator.language}};(await fetch(`${o}/sdk/1/visitors/${r}/analytics`,{method:"POST",cache:"no-cache",headers:t,body:JSON.stringify(v)})).ok||console.warn("[Sprig] (ERR-444) Failed to track analytics",n)},te=async(n,o,t,r,i,s)=>{re({event:`Video Error ${o}`,apiBase:t,headers:r,visitorId:i,envId:s,metadata:{errorMessage:n.message}});const l=S.document.documentElement,v={screenWidth:window.screen.width,screenHeight:window.screen.height,clientWidth:l.clientWidth,clientHeight:l.clientHeight,location:window.location.href,language:navigator.language},a={action:o,err:{message:n.message,stack:n.stack},meta:v,vid:i,envId:s};(await fetch(`${t}/sdk/1/errors`,{method:"POST",cache:"no-cache",headers:{...r,"userleap-platform":"video_recorder","x-ul-error":window.btoa(`userleap-${Date.now()}-error`)},body:JSON.stringify(a)})).ok||console.warn("[Sprig] (ERR-444) Failed to report error to API",n)},Fe=(n,o)=>{if(n.length===0)return o&&o();Promise.all(n.reduce((t,r)=>(t.push(((i,{type:s,content:l})=>new Promise(function(v,a){let c;s==="script"?(c=S.document.createElement("script"),c.src=l):s==="link"?(c=S.document.createElement("link"),c.rel="stylesheet",c.href=l,c.type="text/css"):(c=S.document.createElement("style"),c.innerHTML=l),c.onload=function(){v(l)},c.onerror=function(){a(l)},c.async=!1,c.id=btoa(l),i.appendChild(c)}))(S.document.head,r)),t),[])).then(()=>{S.videojs=S.document.defaultView.videojs,o&&o()}).catch(function(t){console.log(t+" failed to load")})},Ne=(n,o,t)=>{if(o==="start"&&(n.style.visibility="visible"),o==="none")n.style.visibility=G;else if(o==="success")n.style.visibility=G,n.innerHTML="Upload succeeded!";else{const r=Math.round(parseFloat(t));n.innerHTML=`Uploading <span class="ul-upload-progress-label__time">${r}%</span>`,n.style.background=`linear-gradient(to right, #E0E0EB 0%, #E0E0EB ${r}%, #FCFCFD ${r}%, #FCFCFD 100%)`}},Ee=(n,o)=>{const t=S.videojs(n.id());return t==null?void 0:t.payload[o]},Ve=(n,o)=>{const t=new(S.videojs.getComponent("Component"))(n);return t.addClass("ul-buttons-panel"),o.map(r=>{t.addChild(r)}),on(t),t},on=n=>{n.children().forEach(o=>{if(K[o.name_]){const t=me(K[o.name_],`ul-${K[o.name_]}`);o.el_.appendChild(t)}})},me=(n,o="")=>{const t=S.document.createElement("span");return t.className="ul-button-text",t.innerHTML=n,t.id=o,t},ze=(n,o,t,r,i=!1,s)=>{n.addClass("ul-video-player");const l=new(S.videojs.getComponent("Component"))(n);l.addClass("ul-control-panel"),n.progressBar=l.addChild("ProgressControl"),t&&n.src(t),n.audioPlayerPlaceholder=new(S.videojs.getComponent("Component"))(n),n.audioPlayerPlaceholder.addClass("ul-audio-recorder-placeholder");const v=t&&t.src?dn(t.src):null;!t||!i&&v?(n.audioPlayerPlaceholder.hide(),S.document.getElementById(`${n.id()}_html5_api`).style.height="100%",v&&n.poster(v)):(n.children()[0].classList.add("vjs-hidden"),S.document.getElementById(`${n.id()}_html5_api`).style.height="0px"),n.on("play",()=>{i||!t||v||an(n),s==null||s.play()}),n.on("pause",()=>{s==null||s.pause()}),n.on("seeked",()=>{s==null||s.currentTime(n.currentTime())}),n.on("ratechange",()=>{s==null||s.playbackRate(n.playbackRate())}),n.addChild(n.audioPlayerPlaceholder,{},1),l.addChild(o),n.addChild(l),r&&r(n)},sn=(n,o,t,r,i,s,l,v=!1)=>{Pe=Date.now();const a=ge(o,{controls:!1,bigPlayButton:!1,fluid:!1,width:1280,height:720,playsinline:!0,plugins:{record:{audio:!0,video:{mandatory:{minWidth:1280,minHeight:720}},frameWidth:1280,frameHeight:720,maxLength:600,autoMuteDevice:!0}}});if(!a)return;a.payload=t;const{surveyId:c,questionId:b,responseGroupUid:d,visitorId:f,envId:w}=t;let m;const u=p=>{const g=we,C=we+"-audio-only";Ne(a.uploadProgressLabel,"none"),X&&X.startTime>=Pe&&X.abort();const L=S.document.getElementById("ul-camera-button");p?(a.children()[0].classList.add("vjs-hidden"),x.removeClass(g),x.addClass(C),L.innerHTML=K.TurnOnCamera,a.audioPlayerPlaceholder.removeClass("vjs-hidden"),m==null||m.getTracks().forEach(R=>{R.stop()}),window.navigator.mediaDevices.getUserMedia({video:!0,audio:!0}).then(R=>{m=R,R.getVideoTracks().forEach(P=>{P.enabled=!1}),a.record().onDeviceReady(R)}).catch(a.record().onDeviceError.bind(a.record()))):(m==null||m.getVideoTracks().forEach(R=>{R.enabled=!0}),a.children()[0].classList.remove("vjs-hidden"),a.record().getDevice(),x.removeClass(C),x.addClass(g),L.innerHTML=K.TurnOffCamera,a.audioPlayerPlaceholder.addClass("vjs-hidden"))},h=new(S.videojs.getComponent("Button"))(a,{clickHandler:()=>{h.hasClass(G)||(re({event:"Video Delete Button Clicked",apiBase:r,headers:l,visitorId:f,envId:w,metadata:{questionId:b,responseGroupUid:d,surveyId:c}}),u(a.cameraOff),i(B.DELETE,{}),x.removeClass(G),h.addClass(G))}});h.addClass("ul-video-recorder-delete-button"),h.el_.appendChild(me(K.DeleteButton,"ul-delete-button"));const k=S.document.getElementById(o),y=()=>{k.classList.contains("vjs-fullscreen")&&a.cameraOff?k.style.display="table":k.style.display="flex"};y();const x=new(S.videojs.getComponent("Button"))(a,{clickHandler:()=>{a.record().isRecording()||(a.cameraOff=!a.cameraOff,re({event:"Video Camera Button Clicked",apiBase:r,headers:l,visitorId:t.visitorId,envId:t.envId,metadata:{questionId:b,responseGroupUid:d,surveyId:c,cameraOff:a.cameraOff}}),u(a.cameraOff),!h.hasClass(G)&&h.addClass(G),i(B.DELETE,{}),y())}});x.addClass(we),x.el_.appendChild(me(K.TurnOffCamera,"ul-camera-button"));const j=new(S.videojs.getComponent("Button"))(a,{clickHandler:()=>{const p=S.document.getElementById("ul-recorder-toggle");if(a.record().isRecording())a.record().stop(),p&&(p.innerHTML=K.RecordButton),j.removeClass(ke),h.removeClass(G);else{const g=S.document.getElementById("ul-recording-countdown-screen");if(g)g.remove(),p&&(p.innerHTML=K.RecordButton),u(a.cameraOff),i(B.DELETE,{}),x.removeClass(G),h.addClass(G),j.removeClass(ke),D.show();else{j.addClass(ke),D.hide(),x.addClass(G),h.addClass(G),p&&(p.innerHTML=K.StopButton);const C=S.document.createElement("div");C.id="ul-recording-countdown-screen",k.insertBefore(C,k.children[1]),C.style.height=`${k.offsetHeight}px`,Qe(a,3)}}}});j.addClass("ul-video-recorder-toggle-button"),j.el_.appendChild(me(K.RecordButton,"ul-recorder-toggle"));const E=S.document.createElement("p");E.style.visibility="hidden",E.className="ul-upload-progress-label",n.appendChild(E),a.uploadProgressLabel=E;const N=Ve(a,[h,x,"PlayToggle",j,"FullscreenToggle"]),D=N.children().find(p=>p.name_==="FullscreenToggle");D.hasClass("vjs-disabled")&&D.hide();const T=N.children().find(p=>p.name_==="PlayToggle");T.hide(),h.addClass(G),ze(a,N,s,!1,v),a.on("stopRecord",()=>{j.hide(),T.show(),D.show(),h.removeClass(G)}),a.on("deviceReady",()=>{j.show(),T.hide(),h.addClass(G)}),((p,g,C,L,R)=>{const{surveyId:P,responseGroupUid:H,visitorId:O,envId:A}=p.payload;p.on("deviceError",function(){console.warn("device error: ",p.deviceErrorCode),p.deviceErrorCode.message==="Permission denied"?(p.deviceButton.addClass("permission-denied"),C&&C(B.ERROR,{type:B.PERMISSION_DENIED}),re({event:"Video Permission Denied",apiBase:g,headers:R,visitorId:O,envId:A,metadata:{questionId:Ee(p,xe),responseGroupUid:H,surveyId:P}})):(C&&C(B.ERROR,{type:B.OTHER}),te(new Error(p.deviceErrorCode.message),"recorderDeviceError",g,R,O,A))}),p.on("error",function(Q,$){te($||p.error(),"recorderError",g,R,O,A)}),p.on("startRecord",function(Q,$){L(p.uploadProgressLabel,"none"),re({event:"Video Record Start",apiBase:g,headers:R,visitorId:O,envId:A,metadata:{questionId:Ee(p,xe),responseGroupUid:H,surveyId:P}})}),p.on("finishRecord",async function(){L(p.uploadProgressLabel,"start",0);const Q=Ee(p,xe);if(!P){const I="internal error: missing fields in payload";return C&&C(B.ERROR,{type:B.OTHER}),te(new Error(I),"finishRecord",g,R,O,A),null}p.record().stopDevice();const $=p.cameraOff?B.MEDIA_TYPE_AUDIO:B.MEDIA_TYPE_VIDEO,W=Z.v4();re({event:"Video Record Finish",apiBase:g,headers:R,visitorId:O,envId:A,metadata:{mediaRecordingUid:W,questionId:Q,responseGroupUid:H,surveyId:P,mediaType:$}});const J={surveyId:P,updatedAt:new Date().toISOString(),mediaType:$,mediaRecordingUid:W};Q&&(J.questionId=Q),H&&(J.responseGroupUid=H),O&&(J.visitorId=O);const le=await(async()=>{const I=await fetch(`${g}/2/environments/integrations/upload`,{method:"POST",cache:"no-cache",headers:{"Content-Type":"application/json"},body:JSON.stringify(J)});if(I.ok){const q=await I.json();return C&&C(B.UPLOAD_STARTED,{[B.UPLOAD_ID]:q.upload.id,[B.MEDIA_TYPE]:$,[B.MEDIA_RECORDING_UID]:W}),q.upload.url}return C&&C(B.ERROR,{type:B.OTHER,response:I}),te(new Error("failed to get upload response with url"),"finishRecord",g,R,O,A),null})();le&&(X=S.document.defaultView.UpChunk.createUpload({endpoint:le,file:new S.document.defaultView.File([p.recordedData],`recording ${$} ${Date.now()}`),chunkSize:5120}),X.startTime=Date.now(),re({event:"Video Upload Start",apiBase:g,headers:R,visitorId:O,envId:A,metadata:{mediaRecordingUid:W,questionId:Q,responseGroupUid:H,surveyId:P,mediaType:$,url:le}}),X.on("error",I=>{L(p.uploadProgressLabel,"none"),C&&C(B.UPLOAD_FINISHED,{[B.MEDIA_RECORDING_UID]:W}),te(I,"finishRecord",g,R,O,A)}),X.on("progress",I=>{C&&C(B.UPLOAD_PROGRESS,{[B.MEDIA_RECORDING_UID]:W,[B.UPLOAD_PROGRESS_PCT]:I.detail}),L(p.uploadProgressLabel,"progress",I.detail)}),X.on("success",()=>{L(p.uploadProgressLabel,"success"),C&&C(B.UPLOAD_FINISHED,{[B.MEDIA_RECORDING_UID]:W}),re({event:"Video Upload Success",apiBase:g,headers:R,visitorId:O,envId:A,metadata:{mediaRecordingUid:W,questionId:Q,responseGroupUid:H,surveyId:P,mediaType:$,url:le,elapsedMs:X.startTime&&Date.now()-X.startTime}})}))})})(a,r,i,Ne,l);const M=[{name:"microphone"}];!a.cameraOff&&M.push({name:"camera"}),Promise.all(M.map(p=>{var g;return(g=navigator==null?void 0:navigator.permissions)==null?void 0:g.query(p)})).then(p=>{p.reduce((g,C)=>g&C.state==="granted",!0)&&a&&(a.deviceButton&&a.deviceButton.hide(),a.record().getDevice())}).catch(p=>{})},Qe=(n,o=3)=>{const t=S.document.getElementById("ul-recording-countdown-screen");t&&o===0?(t.remove(),n.record().start()):t&&(t.innerHTML=`<span class='ul-countdown-text'>Recording in... ${o}</span>`,setTimeout(()=>{Qe(n,o-1)},1e3))},Ge=n=>{const o=S.document.createElement("div");return o.className="ul-video-container",o.appendChild((t=>{const r=S.document.createElement("div");return r.className="ul-video-player-loading",r.id=Se(t),["first","second","third","fourth"].map(i=>{const s=S.document.createElement("div");s.className=i,r.appendChild(s)}),r})(n)),o},je=(n,o)=>{const t=S.document.createElement("video");t.id=n,t.className="video-js vjs-default-skin ul-video-player-video";const r=S.document.createElement("p");r.className="vjs-no-js",r.innerHTML="To view this video please enable JavaScript, and consider upgrading to a web browser that";const i=S.document.createElement("a");return i.href="https://videojs.com/html5-video-support/",i.target="_blank",i.innerHTML="supports HTML5 video",r.appendChild(i),t.appendChild(r),o.appendChild(t),o},an=(n,o)=>{n.children()[0].classList.remove("vjs-hidden"),n.audioPlayerPlaceholder.hide(),S.document.getElementById(`${n.id()}_html5_api`).style.height="100%"},ge=(n,o)=>S.document.getElementById(n)?o?S.videojs(n,o):S.videojs(n):(console.error(`Error in finding player element with ID, ${n}`),null),ln=(n,o,t,r=!1,i="https://api.sprig.com",s=document,l=null,v=null)=>{S.document=s;const a=n+$e,c=Ge(a);return S.document.addEventListener("securitypolicyviolation",b=>{te(new Error(`Voice & Video feature violates ${b.violatedDirective} web page CSP policies for the question player.`),"playerDeviceError",i,{})}),Fe(He,()=>{S.document.getElementById(Se(a)).remove(),je(a,c);const b={playsinline:!0,playbackRates:[.5,1,1.5,2],fill:!0};try{const d=n+Le;je(d,c);const f=ge(a,b),w=ge(d,{muted:!0,...b});if(!f||!w)return;((h,k,y)=>{h.addClass(`ul${Le}`);const x=new(S.videojs.getComponent("Component"))(h);k&&h.src(k),h.addChild(x),y&&y(h)})(w,l,v),l||w.addClass(G);const m=Ve(f,["PlaybackRateMenuButton","PlayToggle","FullscreenToggle"]),u=m.children().find(h=>h.name_==="FullscreenToggle");u.hasClass("vjs-disabled")&&u.hide(),ze(f,m,o,t,r,w)}catch(d){return void te(new Error(`Error when creating video player object ${d}`),"playerDeviceError",i,{})}}),c},dn=n=>{if(!n)return null;const o=n.match(/https:\/\/stream.mux.com\/(.*)/);let t=o?o[1]:null;return t.includes(Me)&&(t=t.replace(Me,"")),t?`https://image.mux.com/${t}/thumbnail.jpg?time=0`:null},B={UPLOAD_STARTED:"upload.started",UPLOAD_PROGRESS:"upload.progress",UPLOAD_FINISHED:"upload.finished",DELETE:"delete",ERROR:"error",MEDIA_TYPE:"media.type",PERMISSION_DENIED:"permission_denied",OTHER:"other",UPLOAD_ID:"upload.id",UPLOAD_PROGRESS_PCT:"upload.progress.pct",MEDIA_RECORDING_UID:"media.recording.uid",MEDIA_TYPE_VIDEO:"video",MEDIA_TYPE_AUDIO:"audio"},K={PlaybackRateMenuButton:"Speed",PlayToggle:"Play",FullscreenToggle:"Expand",TurnOnCamera:"Turn on",TurnOffCamera:"Turn off",DeleteButton:"Delete",RecordButton:"Record",StopButton:"Stop",PauseButton:"Pause"},cn=({properties:n,surveyVideoUrl:o,questionId:t})=>{const r=`ul-card-video__question_player-q${t}`,{apiURL:i,viewDocument:s}=e.useConfig(l=>({apiURL:l.apiURL,viewDocument:l.viewDocument}));return e.u("div",{id:r,ref:l=>{if(l&&l.children.length===0&&!n.properties.hideRecordedPrompt){const v=ln(r,{src:o,type:"application/x-mpegURL"},void 0,n.properties.mediaType===B.MEDIA_TYPE_AUDIO,i,s);l.appendChild(v)}}})},ae=({isDisabled:n,onClick:o,children:t})=>e.u(_.Button,{className:"ul-card__button-checkmark",disabled:n,onClick:o,type:"button",children:[e.u("svg",{fill:"none",height:"10",viewBox:"0 0 13 10",width:"13",xmlns:"http://www.w3.org/2000/svg",children:e.u("path",{d:"M11.5 1.5L4.5 8.5L1 5",stroke:"#ffffff",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"})}),t||"Ok"]}),un=({className:n,next:o,properties:t,questionId:r,type:i})=>{const{useMobileStyling:s,border:l}=e.useConfig(T=>({useMobileStyling:T.useMobileStyling,border:T.border})),[v,a]=e.h(!1),[c,b]=e.h(""),[d,f]=e.h(!1),w=t==null?void 0:t.collectName,m=(t==null?void 0:t.nameLabelText)||"Full Name",u=(t==null?void 0:t.consentText)||"I agree to the stated conditions",h=(t==null?void 0:t.submitButtonText)||"Submit",k=!!c.trim(),y=v&&(!w||k),x=(T,M=!1)=>{T.preventDefault(),T.stopPropagation();let p=null;if(!M){if(!y)return void f(!0);p={submitted:!0},w&&(p.name=c)}o({value:p,questionId:r,type:i},!!M||y)},j=T=>{T.preventDefault(),T.stopPropagation(),b(T.currentTarget.value)},E=T=>{T.currentTarget.style.borderColor=d&&!k?Z.ERROR_BORDER_COLOR:l},N=T=>{T.currentTarget.style.borderColor=d&&!k?Z.ERROR_BORDER_COLOR:Z.DEFAULT_BORDER_COLOR},D=()=>e.u(_.QuestionBodyFooterContainer,{children:[e.u("div",{className:"sprig-stretch",children:[e.u(_.Option,{allowTextEntry:!1,border:l,error:d&&!v,id:"consent",isRadio:!1,isSelected:v,label:u,onUserInputChanged:({selected:T})=>{T!==v&&a(!v)},useMobileStyling:s}),w&&e.u("input",{"aria-label":m,"aria-placeholder":m,className:e.cc(e.getClasses("ul-consent-legal__name-input",s)),"data-gramm":"false",maxLength:250,name:"name",onBlur:N,onFocus:E,onInput:j,placeholder:m,style:d&&!k?{borderColor:Z.ERROR_BORDER_COLOR}:{},tabIndex:0,value:c})]}),e.u("div",{className:"ul-card__button-wrapper ul-card-vertical__button-wrapper",children:[e.u(ae,{isDisabled:!y,onClick:T=>x(new SubmitEvent(T.type)),children:e.getButtonText({buttonText:h})}),t.required===!1&&e.u("button",{className:"ul-card-skip__button",onClick:T=>x(new SubmitEvent(T.type),!0),children:e.getSkipButtonText(t)})]})]});return e.u("div",{className:e.cc(n,"ul-card__consent-legal","fade-in-transition"),children:e.u(_.MobileEmbedView,{properties:t,defaultBody:D,embeddedType:"pdf"})},r)},pn=()=>{const{destroy:n,forceBrandedLogo:o}=e.useConfig(t=>({destroy:t.destroy,forceBrandedLogo:t.forceBrandedLogo}));return e.p(()=>{setTimeout(()=>{n(Z.APP_ID)},o?4e3:2e3)},[n,o]),e.u("div",{className:"end-of-survey-text",children:"End of survey"})},vn=({icon:n,scaleLabelType:o,value:t,selectedValue:r})=>{if(o==="smiley"&&t===r){let i=0;return n.replace(/black/g,()=>++i==1?"black":"white")}return n},mn=({activeValue:n,border:o,icon:t,isPressed:r,range:i,scaleLabelType:s,selectedValue:l,setSelectedValue:v,setActiveValue:a,setIsPressed:c,useMobileStyling:b,value:d,viewDocument:f})=>{const w=`option-${d}`,m=s==="number",u=s==="star",h=s==="smiley",k=m&&d===n||d===l,[y,x]=(()=>{const E=u&&l!==null&&d<=l;return u&&d<=n||h&&d===n||E||d===n||d===l?[o,r||E||d===l?1:.3]:["",1]})(),j=e.F(()=>{const E={borderColor:k?y:"",fillOpacity:k?"":x,zIndex:k?3:"auto",color:l===d?"#fff":""};return m?{...E,backgroundColor:l===d?y:""}:{...E,color:u||h||l===d?y:""}},[k,y,x,l,d,m,u,h]);return e.u("button",{"aria-label":m?void 0:String(d),className:(()=>{switch(s){case"star":return e.cc(e.getClasses("likert-star",b),e.getClasses(`likert-star-${d}`,b));case"smiley":return e.cc(e.getClasses("likert-smiley",b),e.getClasses(`likert-smiley-${d}`,b));default:return d===i?e.cc(e.getClasses("likert-number",b),e.getClasses(`likert-number-${d}`,b),e.getClasses("likert-last-option",b)):e.cc(e.getClasses("likert-number",b),e.getClasses(`likert-number-${d}`,b))}})(),dangerouslySetInnerHTML:{__html:vn({icon:t,scaleLabelType:s,value:d,selectedValue:l})},id:w,onClick:E=>{E.preventDefault(),E.stopPropagation(),v(d)},onKeyDown:E=>{var T,M;const N=f.querySelectorAll(`.likert-${s??"number"}`),D=d-1;E.key==="ArrowRight"?(T=N[D+1])==null||T.focus():E.key==="ArrowLeft"?(M=N[D-1])==null||M.focus():E.key!=="Enter"&&E.key!==" "||(E.preventDefault(),E.stopPropagation(),v(d))},onPointerDown:()=>c(!0),onPointerEnter:()=>a(d),onPointerLeave:()=>{a(-1),c(!1)},style:j,tabIndex:0})},gn=({className:n,labels:o,next:t,properties:r,questionId:i,type:s})=>{const{border:l,useMobileStyling:v,viewDocument:a}=e.useConfig(T=>({border:T.border,useMobileStyling:T.useMobileStyling,viewDocument:T.viewDocument})),[c,b]=e.h(-1),[d,f]=e.h(!1),[w,m]=e.h(null),u=o&&o.left,h=o&&o.right;let k;const{range:y,scaleLabelType:x,ratingIcons:j}=r;y&&(k=Number(y));const E=k||5,N=T=>{var M,p;switch(x){case"star":return(M=j[0])==null?void 0:M.svg;case"smiley":return(p=j[T])==null?void 0:p.svg;default:return String(T+1)}},D=[...Array(E)].map((T,M)=>{const p=M+1;return e.u(mn,{activeValue:c,border:l,icon:N(M),isPressed:d,range:E,scaleLabelType:x,selectedValue:w,setActiveValue:b,setIsPressed:f,setSelectedValue:m,useMobileStyling:v,value:p,viewDocument:a},M)});return e.u("form",{className:e.cc(n,"ul-card--likert","fade-in-transition"),children:e.u(_.MobileEmbedView,{properties:r,defaultBody:()=>e.u(e.g,{children:[e.u(_.QuestionBodyWrapper,{children:[e.u("div",{"aria-label":`Rating (1 - ${E})`,className:"ul-card--likert__numbers",role:"radiogroup",children:D}),e.u("div",{className:"ul-card--likert__labels",children:[e.u("span",{children:u}),e.u("span",{children:h})]})]}),e.u(_.QuestionBodyFooterContainer,{children:e.u(ae,{isDisabled:w===null&&r.required,onClick:()=>t({value:w,questionId:i,type:s},!0),children:e.getButtonText(r)})})]})})},i)},hn=({columns:n,onSelect:o,options:t,selectedOptions:r})=>{const i=e._([]),{border:s,useMobileStyling:l}=e.useConfig(f=>({border:f.border,useMobileStyling:f.useMobileStyling})),v=t.findIndex(f=>r[f.id]===null),[a,c]=e.h(v),b=e.T((f,w)=>{o(f,w);const m=a+1,u=t[m];u&&r[u.id]===null&&c(m)},[o,t,r,a]),d=e.T((f,w)=>{const m=a===f;return e.u(e.Accordion,{animate:!0,header:w.label,isOpen:m,onClick:()=>c(m&&!window.UserLeap.isMobileSDK?-1:f),ref:u=>{u&&(i.current[f]=u)},showHeaderCheck:r[w.id]!==null,children:e.u("div",{style:{paddingTop:"12px"},children:n.map(u=>e.u(_.Option,{allowTextEntry:!1,ariaLabel:`${w.label}-${u.label}`,border:s,error:!1,id:`${w.id}-${u.value}`,isRadio:!0,isSelected:r[w.id]===u.value,label:u.label,onUserInputChanged:()=>b(w.id,u.value),useMobileStyling:l},u.label))})},w.id)},[s,n,a,b,r,l]);return e.u("div",{children:t.map((f,w)=>d(w,f))})},bn=({columns:n,onSelect:o,options:t,selectedOptions:r})=>{const{border:i,useMobileStyling:s,isLongFormSurvey:l}=e.useConfig(m=>({border:m.border,useMobileStyling:m.useMobileStyling,isLongFormSurvey:Z.isLongFormSurvey(m.studyType)})),v=t.length,a=n.length,c=e._(null),[b,d]=e.h(!1),[f,w]=e.h(!1);return e.p(()=>{const m=c.current,u=new ResizeObserver(h=>{window.requestAnimationFrame(()=>{m&&(d(Math.round(h[0].contentRect.width)<m.scrollWidth),w(Math.round(h[0].contentRect.width)<m.scrollWidth))})});return m&&u.observe(m),()=>{m&&u.unobserve(m)}},[]),e.u("div",{className:"ul-card--matrix_question_container",children:[e.u("div",{className:e.cc("ul-card--matrix_container",b&&"ul-matrix-scroll-gradient"),onScroll:()=>{(()=>{const m=c.current;m&&d(m.clientWidth+Math.abs(m.scrollLeft)<m.scrollWidth)})()},ref:c,children:e.u("div",{className:e.cc(l&&"ul-card--matrix_grid_longform","ul-card--matrix_grid"),style:`--numColumns: ${a}; --numRows: ${v+1};`,children:[e.u("div",{})," ",n.map(m=>e.u("div",{className:"ul-matrix-column-label",children:m.label},m.label)),t.map(m=>e.u(e.g,{children:[e.u("div",{"aria-label":m.label,className:"ul-matrix-row-label",children:m.label},m.label),e.u("div",{className:"ul-matrix-row-options",role:"radiogroup",children:n.map((u,h)=>{const k=h===a-1;return e.u("div",{className:e.cc("ul-matrix-option-wrapper",k&&"ul-matrix-last-option"),children:e.u(_.Option,{allowTextEntry:!1,ariaLabel:`${m.label}-${u.label}`,border:i,choiceStyle:{background:"transparent",border:"none",marginBottom:"0",padding:"0"},error:!1,id:`${m.id}-${u.value}`,isRadio:!0,isSelected:r[m.id]===u.value,onUserInputChanged:()=>o(m.id,u.value),useMobileStyling:s})},u.value)})})]}))]})}),(b||f)&&e.u("button",{className:f&&!b?"ul-matrix-scroll-arrow left":"ul-matrix-scroll-arrow",onClick:f&&!b?m=>{m.preventDefault();const u=c.current;if(u){const h=getComputedStyle(u).direction==="rtl";u.scrollTo({left:h?u.scrollWidth-u.clientWidth:0,behavior:"smooth"})}}:m=>{m.preventDefault();const u=c.current;if(u){const h=getComputedStyle(u).direction==="rtl";u.scrollTo({left:h?u.clientWidth-u.scrollWidth:u.scrollWidth,behavior:"smooth"})}},children:f&&!b?e.u(fn,{}):e.u(yn,{})})]})},fn=()=>e.u("svg",{fill:"currentColor",height:"32",transform:"matrix(-1,0,0,1,0,0)",version:"1.1",viewBox:"0 0 256 256",width:"32",xmlns:"http://www.w3.org/2000/svg",children:e.u("path",{d:"M221.66,133.66l-72,72a8,8,0,0,1-11.32-11.32L196.69,136H40a8,8,0,0,1,0-16H196.69L138.34,61.66a8,8,0,0,1,11.32-11.32l72,72A8,8,0,0,1,221.66,133.66Z"})}),yn=()=>e.u("svg",{fill:"currentColor",height:"32",viewBox:"0 0 256 256",width:"32",xmlns:"http://www.w3.org/2000/svg",children:e.u("path",{d:"M221.66,133.66l-72,72a8,8,0,0,1-11.32-11.32L196.69,136H40a8,8,0,0,1,0-16H196.69L138.34,61.66a8,8,0,0,1,11.32-11.32l72,72A8,8,0,0,1,221.66,133.66Z"})}),Cn=({className:n,next:o,options:t,properties:r,questionId:i,type:s,onSubmitButtonClick:l})=>{const{useMobileStyling:v,isLongFormSurvey:a}=e.useConfig(k=>({useMobileStyling:k.useMobileStyling,isLongFormSurvey:Z.isLongFormSurvey(k.studyType)})),c=r.matrixColumn,b=r.required,d=k=>{k.preventDefault(),k.stopPropagation(),o({value:w,questionId:i,type:s},!0),l&&l()},f=t.reduce((k,y)=>(k[y.id]=null,k),{}),[w,m]=e.h(f),u=(k,y)=>{m(x=>({...x,[k]:y}))},h=r.displayMatrixAsAccordion||v;return e.u("form",{className:e.cc(n,!a&&"ul-card__matrix","fade-in-transition"),id:"text-form",onSubmit:d,children:e.u(_.MobileEmbedView,{properties:r,defaultBody:()=>{return e.u(e.g,{children:[e.u(_.QuestionBodyWrapper,{children:h?e.u(hn,{columns:c,onSelect:u,options:t,selectedOptions:w}):e.u(bn,{columns:c,onSelect:u,options:t,selectedOptions:w})}),e.u(_.QuestionBodyFooterContainer,{children:e.u(ae,{isDisabled:(k=w,b&&Object.values(k).every(y=>y==null)),onClick:()=>d(new SubmitEvent("submit")),children:e.getButtonText(r)})})]});var k}})},i)},Ze=({className:n,onSubmit:o,options:t=[],properties:r,questionId:i,type:s,showIndividualSubmit:l=!1,onSubmitButtonClick:v})=>{const{border:a,useMobileStyling:c}=e.useConfig(g=>({border:g.border,useMobileStyling:g.useMobileStyling})),b=t.reduce((g,C)=>(g[C.id]={isSelected:!1},g),{}),[d,f]=e.h(b),w=s==="multiplechoice",m=r.required,u=t.find(g=>{var C;return(C=g.optionProperties)==null?void 0:C.noneOfTheAbove}),h=g=>Object.entries(g).some(([C,L])=>{var H;const R=t.find(O=>`${O.id}`===C),P=L.userText===void 0||L.userText.trim()==="";return((H=R==null?void 0:R.optionProperties)==null?void 0:H.allowsTextEntry)&&P&&L.isSelected}),k=g=>Object.values(g).filter(C=>C.isSelected).length,y=r.minSelect&&r.minSelect>0&&r.maxSelectMode===_.MaxSelectModes.Range&&k(d)<r.minSelect&&(m||k(d)>0),x=g=>h(g)||m&&!k(g)||!(C=>{const{minSelect:L=0,maxSelect:R=1/0,maxSelectMode:P}=r,H=k(C);switch(P){case _.MaxSelectModes.Maximum:return H<=R;case _.MaxSelectModes.Range:return H===0||H>=L;default:return!0}})(g),j=Object.entries(d).some(([g,C])=>{var L,R;return C.isSelected&&((R=(L=t.find(P=>`${P.id}`===g))==null?void 0:L.optionProperties)==null?void 0:R.allowsTextEntry)}),E=l&&(!w||j),N=g=>{p(g.id,g.selected,g.userText,g.noneOfTheAbove)},D=g=>{var C;return(r==null?void 0:r.maxSelectMode)!==_.MaxSelectModes.Unlimited&&k(d)===(r==null?void 0:r.maxSelect)&&!((C=d[g])!=null&&C.isSelected)},T=t.map(({id:g,label:C,value:L,optionProperties:R})=>{var Q,$;const P=`${g}`,{allowsTextEntry:H,noneOfTheAbove:O}={allowsTextEntry:!1,noneOfTheAbove:!1,...R};return e.u(_.Option,{allowTextEntry:H,border:a,disabled:D(P),error:(A=d,h(A)),id:P,isRadio:w,isSelected:!!((Q=d[P])!=null&&Q.isSelected),label:C,noneOfTheAbove:O,onUserInputChanged:N,promptText:"Please specify",text:($=d[g])==null?void 0:$.userText,useMobileStyling:c,value:L},P);var A}),M=()=>{o(d,!0),v&&v()},p=(g,C,L,R)=>{const P=Object.assign({},d);if((w||R)&&C)for(const H of Object.values(P))H.isSelected=!1,delete H.userText;else u&&!R&&d[u.id].isSelected&&(P[u.id].isSelected=!1);P[g]={isSelected:C,userText:L},f(P)};return e.u("form",{className:e.cc(n,"ul-card--multiple","fade-in-transition"),id:"text-form",onSubmit:M,children:e.u(_.MobileEmbedView,{properties:r,defaultBody:()=>e.u(e.g,{children:[e.u(_.QuestionBodyWrapper,{children:[r.isDropdown?e.u(_.Select,{disabledOptions:t.filter(g=>D(g.id)),dropdownFooter:y?e.u("div",{className:"ul-card__min-select-counter",style:{marginLeft:"16px"},children:[k(d),"/",r.minSelect]}):void 0,isMultiSelect:!w,multiselectText:r.dropdownMultiselectedText??"choices selected",onChange:g=>{const C={...d};for(const L of t)g.includes(L)?C[L.id].isSelected=!0:C[L.id].isSelected=!1;f(C)},options:t,placeholderText:r.dropdownPlaceholderText??(w?"Select choice":"Select choice(s)"),value:t.filter(g=>d[g.id].isSelected)}):e.u("div",{className:e.cc(e.getClasses("ul-card__choices",c)),role:w?"radiogroup":"group",children:[T,!!y&&e.u("div",{className:"ul-card__min-select-counter",children:[k(d),"/",r.minSelect]})]}),E&&e.u(_.LongformSubmitButton,{handleSubmit:M,isSubmitDisabled:x(d)})]}),e.u(_.QuestionBodyFooterContainer,{children:e.u("div",{className:"ul-card__button-wrapper",children:e.u(ae,{isDisabled:x(d),onClick:M,children:e.getButtonText(r)})})})]})})},i)},xn=n=>{const{questionId:o,type:t,next:r,options:i}=n;return e.u(Ze,{...n,onSubmit:(s,l)=>{const v=Object.entries(s).find(([,f])=>f.isSelected)||[void 0,void 0],[a,c]=v,b=i.find(f=>`${f.id}`===a),d=c!=null&&c.userText?{[a]:{userText:c.userText}}:null;r({value:b&&a?{[a]:b.value}:{},secondaryValue:d,questionId:o,type:t},l)}})},wn=n=>{const{questionId:o,type:t,next:r}=n;return e.u(Ze,{...n,onSubmit:(i,s)=>{const l=Object.entries(i).reduce((a,[c,b])=>(a[c]=b.isSelected,a),{}),v=Object.entries(i).reduce((a,[c,b])=>{if(!b.userText)return a;const d=a||{};return d[c]={userText:b.userText},d},null);r({value:l,secondaryValue:v,questionId:o,type:t},s)}})},kn=({className:n,labels:o,properties:t,next:r,questionId:i,type:s})=>{const[l,v]=e.h(null),{border:a,useMobileStyling:c,viewDocument:b}=e.useConfig(m=>({border:m.border,useMobileStyling:m.useMobileStyling,viewDocument:m.viewDocument})),d=o&&o.left,f=o&&o.right,w=[...Array(11)].map((m,u)=>e.u("button",{className:e.cc(e.getClasses("nps-number",c),e.getClasses(`nps-number-${u}`,c)),id:`option-${u}`,onClick:h=>{h.preventDefault(),h.stopPropagation(),v(u)},onKeyDown:h=>{var y,x;const k=b.querySelectorAll("button.nps-number");h.key==="ArrowRight"?(y=k[u+1])==null||y.focus():h.key==="ArrowLeft"?(x=k[u-1])==null||x.focus():h.key!=="Enter"&&h.key!==" "||(h.preventDefault(),h.stopPropagation(),v(u))},onPointerDown:h=>{h.currentTarget.style.zIndex="2",h.currentTarget.style.borderColor=a},onPointerLeave:h=>{h.currentTarget.style.zIndex="auto",h.currentTarget.style.borderColor=Z.DEFAULT_BORDER_COLOR},style:l===u?{backgroundColor:a,color:"#fff"}:void 0,tabIndex:0,children:u},u));return e.u("form",{className:e.cc(n,"ul-card--nps","fade-in-transition"),children:e.u(_.MobileEmbedView,{properties:t,defaultBody:()=>e.u(e.g,{children:[e.u(_.QuestionBodyWrapper,{children:[e.u("div",{className:"ul-card--nps__numbers",children:w}),e.u("div",{className:"ul-card--nps__labels",children:[e.u("span",{children:d}),e.u("span",{children:f})]})]}),e.u(_.QuestionBodyFooterContainer,{children:e.u(ae,{isDisabled:l===null&&t.required,onClick:()=>r({value:l,questionId:i,type:s},!0),children:e.getButtonText(t)})})]})})},i)},En=({className:n,next:o,properties:t,questionId:r,type:i,onSubmitButtonClick:s})=>{const{border:l,useMobileStyling:v,update:a}=e.useConfig(j=>({border:j.border,useMobileStyling:j.useMobileStyling,update:j.update})),[c,b]=e.h(""),d=e._(null),f=c.trim(),w=t.required===!0&&!f,m=_.useAutoSize(d,()=>a()),u=j=>{const{value:E}=j.currentTarget;m(),j.preventDefault(),j.stopPropagation(),b(E)},h=j=>{j.preventDefault(),j.stopPropagation();const E=t.required!==!0||f.length>0;o({value:c,questionId:r,type:i},E),s&&s()},k=t&&t.openTextPlaceholder?t.openTextPlaceholder:"",y=j=>{j.currentTarget.style.borderColor=l},x=j=>{j.currentTarget.style.borderColor=Z.DEFAULT_BORDER_COLOR};return e.u("form",{className:e.cc(n,"ul-card-text","fade-in-transition"),id:"text-form",children:e.u(_.MobileEmbedView,{defaultBody:()=>e.u("div",{className:"ul-card-text",children:[e.u(_.QuestionBodyWrapper,{children:[e.u("div",{className:"ul-card-text__container",children:e.u("textarea",{"aria-describedby":"ul-caption","aria-labelledby":"ul-question","aria-multiline":"true","aria-placeholder":k,className:e.cc(e.getClasses("ul-card-text__input",v)),"data-gramm":"false",maxLength:5e3,name:"text",onBlur:x,onChange:u,onFocus:y,placeholder:k,ref:d,role:"textbox",tabIndex:0})}),t.footerHtml&&e.u("div",{className:"footer",dangerouslySetInnerHTML:{__html:t.footerHtml}})]}),e.u(_.QuestionBodyFooterContainer,{children:e.u(ae,{isDisabled:w,onClick:h,children:e.getButtonText(t)})})]}),properties:t})},r)},jn=({className:n,labels:o,next:t,properties:r,questionId:i,type:s,onSubmitButtonClick:l,options:v,showIndividualSubmit:a=!1})=>{const c=e._(null),b=e._(0),d=e._(0),f=e._(null),w=e._(!1),m=e._([]),[u,h]=e.h(()=>(r==null?void 0:r.required)===!0),[k,y]=e.h(()=>v.map(I=>({...I,rank:null}))),x=e.F(()=>Array.from({length:v.length},(I,q)=>q+1),[v.length]),{useMobileStyling:j,isPreview:E,headers:N}=e.useConfig(I=>({useMobileStyling:I.useMobileStyling,isPreview:I.isPreview,headers:I.headers})),D=j&&!E,T=Z.isiOS(N)&&D,M=I=>{I.preventDefault(),H(k),l&&l()},p=(I,q)=>{for(let F=0;F<m.current.length;F++){const U=m.current[F];if(!U||U===f.current)continue;const Y=U.getBoundingClientRect();if(I>=Y.left&&I<=Y.right&&q>=Y.top&&q<=Y.bottom)return{element:U,index:F}}return null},g=I=>q=>{if(!D)return;q.preventDefault(),q.stopPropagation(),w.current=!0,c.current=I;const F=q.touches[0];b.current=F.clientY,d.current=F.clientY;const U=q.currentTarget.closest(".ul-card-rank__option");U&&(f.current=U,U.classList.add("is-dragging"))},C=I=>{if(!D||!w.current||c.current===null)return;I.preventDefault(),I.stopPropagation();const q=I.touches[0];d.current=q.clientY;const F=d.current-b.current;f.current&&(f.current.style.transform=`translateY(${F}px)`,f.current.style.zIndex="1000"),m.current.forEach(Y=>{Y&&Y!==f.current&&Y.classList.remove("is-drop-target")});const U=p(q.clientX,q.clientY);U&&U.element.classList.add("is-drop-target")},L=I=>{if(!D||!w.current||c.current===null)return;I.preventDefault(),I.stopPropagation();const q=I.changedTouches[0],F=p(q.clientX,q.clientY);f.current&&(f.current.style.transform="",f.current.style.zIndex="",f.current.classList.remove("is-dragging")),m.current.forEach(U=>{U&&U.classList.remove("is-drop-target")}),F&&F.index!==c.current&&R(c.current,F.index),c.current=null,f.current=null,w.current=!1},R=(I,q)=>{y(F=>{const U=F.map(oe=>({...oe})),[Y]=U.splice(I,1);return U.splice(q,0,Y),U.forEach((oe,z)=>{oe.rank=z+1}),O(),U})},P=I=>{I.preventDefault(),I.dataTransfer&&(I.dataTransfer.dropEffect="move")},H=I=>{const q={};I.reduce((F,U)=>(F[U.id]=U.rank,F),q),t({value:q,questionId:i,type:s},!0)},O=()=>{h(!1)},{left:A,right:Q}=o,$=v.length,W=I=>{I.preventDefault(),I.currentTarget.classList.add("is-drop-target")},J=I=>{I.currentTarget.classList.remove("is-drop-target")},le=I=>{c.current=null,I.currentTarget.classList.remove("is-dragging")};return e.u("form",{className:e.cc(n,"ul-card-rank","fade-in-transition"),onSubmit:M,children:e.u(_.MobileEmbedView,{properties:r,defaultBody:()=>e.u(e.g,{children:[e.u(_.QuestionBodyWrapper,{children:[e.u("div",{className:"ul-card--rank__question-inner-container",children:[e.u("div",{className:"ul-card-rank__labels",children:e.u("span",{children:["1 - ",A]})}),e.u("ol",{className:"ul-card-rank__list",onDragOver:P,children:k.map(({id:I,label:q,rank:F},U)=>{return e.u("li",{className:"ul-card-rank__option",draggable:!D,onDragEnd:D?void 0:le,onDragEnter:D?void 0:W,onDragLeave:D?void 0:J,onDragStart:D?void 0:(oe=U,z=>{c.current=oe,z.dataTransfer&&(z.dataTransfer.effectAllowed="move",z.dataTransfer.setData("text/plain",String(oe)),z.currentTarget.classList.add("is-dragging"))}),onDrop:D?void 0:(Y=U,z=>{var pe,ce;z.preventDefault(),z.currentTarget.classList.remove("is-drop-target");const ie=c.current;c.current=null,(ce=(pe=z.currentTarget.closest(".ul-card-rank__list"))==null?void 0:pe.querySelector(".is-dragging"))==null||ce.classList.remove("is-dragging"),ie!=null&&ie!==Y&&R(ie,Y)}),ref:z=>m.current[U]=z,children:[e.u("select",{"aria-label":`Rank for ${q}`,className:e.cc("ul-card-rank__select",F==null&&"ul-card-rank__select--placeholder"),name:`rank[${I}]`,onChange:z=>((ie,pe)=>{y(ce=>{const ue=parseInt(pe),ne=ce.map(V=>({...V}));ne.some(V=>V.rank==null)&&ne.forEach((V,Ce)=>V.rank=Ce+1);const ye=ne.findIndex(V=>V.id===ie);if(ye===-1)return ce;const ve=ne[ye].rank;return ue<ve?ne.forEach(V=>{V.id!==ie&&V.rank>=ue&&V.rank<ve&&(V.rank=V.rank+1)}):ue>ve&&ne.forEach(V=>{V.id!==ie&&V.rank>ve&&V.rank<=ue&&(V.rank=V.rank-1)}),ne[ye].rank=ue,ne.sort((V,Ce)=>V.rank-Ce.rank),O(),ne})})(I,z.currentTarget.value),value:F??"",children:[F==null&&e.u("option",{className:"ul-card-rank__select-option",disabled:!0,value:"",children:"-"}),x.map(z=>e.u("option",{className:"ul-card-rank__select-option",value:z,children:z},z))]}),e.u("span",{children:q}),T&&e.u("button",{"aria-label":`Drag ${q} to reorder`,className:"ul-card-rank__drag-btn",onTouchEnd:D?L:void 0,onTouchMove:D?C:void 0,onTouchStart:D?g(U):void 0,title:"Drag to reorder",type:"button",children:e.u("svg",{fill:"none",height:"17",viewBox:"0 0 16 17",width:"16",xmlns:"http://www.w3.org/2000/svg",children:e.u("path",{d:"M5.75 11.625C6.37132 11.625 6.875 12.1287 6.875 12.75C6.875 13.3713 6.37132 13.875 5.75 13.875C5.12868 13.875 4.625 13.3713 4.625 12.75C4.625 12.1287 5.12868 11.625 5.75 11.625ZM10.25 11.625C10.8713 11.625 11.375 12.1287 11.375 12.75C11.375 13.3713 10.8713 13.875 10.25 13.875C9.62868 13.875 9.125 13.3713 9.125 12.75C9.125 12.1287 9.62868 11.625 10.25 11.625ZM5.75 7.375C6.37132 7.375 6.875 7.87868 6.875 8.5C6.875 9.12132 6.37132 9.625 5.75 9.625C5.12868 9.625 4.625 9.12132 4.625 8.5C4.625 7.87868 5.12868 7.375 5.75 7.375ZM10.25 7.375C10.8713 7.375 11.375 7.87868 11.375 8.5C11.375 9.12132 10.8713 9.625 10.25 9.625C9.62868 9.625 9.125 9.12132 9.125 8.5C9.125 7.87868 9.62868 7.375 10.25 7.375ZM5.75 3.125C6.37132 3.125 6.875 3.62868 6.875 4.25C6.875 4.87132 6.37132 5.375 5.75 5.375C5.12868 5.375 4.625 4.87132 4.625 4.25C4.625 3.62868 5.12868 3.125 5.75 3.125ZM10.25 3.125C10.8713 3.125 11.375 3.62868 11.375 4.25C11.375 4.87132 10.8713 5.375 10.25 5.375C9.62868 5.375 9.125 4.87132 9.125 4.25C9.125 3.62868 9.62868 3.125 10.25 3.125Z",fill:"currentColor"})})})]},I);var Y,oe})}),e.u("div",{className:"ul-card-rank__labels",children:e.u("span",{children:[$," - ",Q]})})]}),a&&e.u(_.LongformSubmitButton,{handleSubmit:M,isSubmitDisabled:u})]}),e.u(_.QuestionBodyFooterContainer,{children:e.u("div",{className:"ul-card__button-wrapper",children:e.u(_.Button,{disabled:u,children:e.getButtonText(r)})})})]})})},i)},_e=1,We=2,Ye=3,he=n=>n.type==="av_permission",Oe=n=>n.type==="screen_permission",Ke=(n,o)=>n===void 0?_e:n?((t,r)=>!(he(r)?r.permissionDescriptors:[]).includes("camera")||t.getVideoTracks().length>0)(n,o)?Ye:_e:We,qe={avStream:null,currentPage:null,mediaRecordingUids:null,nextQuestion:()=>{},passthroughData:void 0,recordingMediaTypes:void 0,screenPermissionRequested:!1,type:void 0},ee=e.create(n=>({...qe,reset:()=>{n(qe)},updatePage:o=>{n(o)}}));function Ie({currentPage:n,pages:o}){const{avStream:t,recordingMediaTypes:r,updatePage:i}=ee.getState(),{recorderEventEmitter:s}=e.useConfig.getState();s.emit("av.permission",{"permission.descriptors":n.permissionDescriptors,"stream.ready":(l,v)=>{if(t===l)return;let a=n;if(l&&!n.permissionDescriptors.includes("camera")){const c=o.indexOf(n),b=v!=null&&v.active?c+2:c+1;v!=null&&v.active&&r&&s.emit("begin.recording",{"recording.media.types":r,"start.recording.callback":d=>i({mediaRecordingUids:d})}),a=o[b]}i({currentPage:a,avStream:l})}})}function Te({status:n}){const{nextQuestion:o,passthroughData:t,mediaRecordingUids:r,reset:i}=ee.getState(),{recorderEventEmitter:s,handleUploadUpdate:l,index:v}=e.useConfig.getState(),a={value:{taskStatus:n},type:"recordedtask",questionId:(t==null?void 0:t.questionId)||1};t&&s.emit("finish.task",{"begin.callback":c=>{l({mediaRecordingUid:c,isSubmitted:!0,progressPct:0,isComplete:!1})},"progress.callback":(c,b)=>{l({mediaRecordingUid:c,progressPct:b.detail,isSubmitted:!1,isComplete:!1})},"upload.callback":c=>{c&&l({mediaRecordingUid:c,isComplete:!0,isSubmitted:!0,progressPct:100})},"passthrough.data":t,"current.index":v,"task.response":a,"task.complete.callback":c=>{a.value.taskDurationMillisecond=c,r&&(a.value.mediaRecordingUids=r),i(),o(a)}})}function De({pages:n,setIsRequestingPermission:o}){const{recorderEventEmitter:t,eventEmitFn:r}=e.useConfig.getState(),{updatePage:i,currentPage:s,recordingMediaTypes:l,screenPermissionRequested:v}=ee.getState();if(!s)return;const a=n.indexOf(s);switch(s.type){case"av_permission":{const c=v?a+2:a+1;return v&&l&&t.emit("begin.recording",{"recording.media.types":l,"start.recording.callback":b=>{i({mediaRecordingUids:b})}}),void i({currentPage:n[c]})}case"screen_permission":return void t.emit("screen.permission",{"screen.permission.requested":o,"stream.ready.callback":(c,b)=>{const d=b?n[a+1]:s;b&&l&&t.emit("begin.recording",{"recording.media.types":l,"start.recording.callback":f=>{i({captureStream:b,mediaRecordingUids:f})}}),i({currentPage:d,screenPermissionRequested:!0,captureStream:b})}});case"start_task":return r("recorded.task.start"),t.emit("recorded.task.start"),t.emit("start.task"),void i({currentPage:n[a+1],screenPermissionRequested:!0});case"complete_task":return}}const Je="ul-permission-graphics-container",Xe="ul-permission-body",en=e.cc(Je,"ul_recorded-task-inset-spacing"),be=e.cc("ul-horizontal-button-container","ul-horizontal-button-container-left"),nn=({richTextBody:n})=>e.u("div",{className:"ul-rich-text-body",dangerouslySetInnerHTML:{__html:n},id:"ul-task-detail-container"}),fe=({required:n,skipButtonText:o,bottom:t=!1})=>n?null:e.u(_.Button,{className:e.cc(t&&"ul-skip-button-below","ul-button-inactive"),onClick:Te.bind(null,{status:"abandoned"}),children:o||"Skip"}),Re=n=>{const{avStream:o,captureStream:t,recordingMediaTypes:r,updatePage:i}=ee.getState(),s=(r==null?void 0:r.includes("audio"))||(r==null?void 0:r.includes("video"));e.p(()=>{const l=setInterval(()=>{s&&o&&!o.active?i({avStream:null,currentPage:n[0]}):t&&t.active||i({captureStream:void 0,currentPage:n[s?1:0]})},1e3);return()=>clearInterval(l)},[o,t,s,n,r,i])},_n=({content:n,pages:o,required:t})=>{const{buttonText:r,skipButtonText:i,taskDetail:s}=n;return Re(o),e.u("div",{className:"ul-task-page",children:[s&&e.u(nn,{richTextBody:s}),e.u("div",{className:be,children:[e.u(_.Button,{onClick:De.bind(null,{pages:o}),children:r}),e.u(fe,{required:t,skipButtonText:i})]})]},"start-task")},In=({content:n,pages:o,properties:t})=>{const{buttonText:r,skipButtonText:i}=n;Re(o);const s=e.u(_.MobileEmbedView,{properties:t,defaultBody:()=>e.u("div",{className:be,children:[e.u(_.Button,{className:"ul-complete-task-button",onClick:Te.bind(null,{status:"completed"}),children:r}),e.u(_.Button,{className:e.cc("ul-button-inactive"),onClick:Te.bind(null,{status:"given.up"}),children:i})]})});return e.u("div",{className:"ul-task-page",children:[n.taskDetail&&e.u(nn,{richTextBody:n.taskDetail}),s]},"complete-task")},Tn=({content:n,pages:o,required:t})=>{const{buttonText:r,skipButtonText:i}=n,[s]=e.useConfig(a=>[a.tabTitle]),[l,v]=e.h(!1);return e.u("div",{children:[e.u("div",{className:en,children:[e.u("p",{style:{marginTop:"auto"},children:n.selectTabText}),e.u("div",{className:"ul-select-tab-container",children:e.u("p",{className:Xe,children:s})})]}),e.u("div",{className:t?"":be,children:[e.u(_.Button,{disabled:l,onClick:De.bind(null,{pages:o,setIsRequestingPermission:v}),children:r}),e.u(fe,{required:t,skipButtonText:i})]})]})},Sn=({content:n})=>e.u("div",{className:e.cc(Je,"ul_permission_svg_container","ul_recorded-task-inset-spacing","ul-center-horizontally"),dangerouslySetInnerHTML:{__html:n.svg}},"ul-permission-request-graphic"),Dn=({content:n,pages:o,required:t})=>{const{permissionDeniedHeadline:r,permissionDeniedBody:i,skipButtonText:s,tryAgainButtonText:l}=n,v=he(o[0])?o[0]:null;return e.p(()=>{const a=setInterval(()=>{v!==null&&Ie({currentPage:v,pages:o})},1e3);return()=>clearInterval(a)},[v,o]),v?e.u("div",{children:[e.u("div",{className:en,children:e.u("p",{className:"ul-av-permission-denied-paragraph",children:[e.u("span",{className:"ul-av-permission-denied-headline",children:r}),e.u("span",{className:Xe,children:i})]})}),e.u("div",{className:be,children:[e.u(_.Button,{onClick:Ie.bind(null,{currentPage:v,pages:o}),children:l}),e.u(fe,{required:t,skipButtonText:s})]})]}):null},Rn=({stream:n})=>e.u("video",{autoPlay:!0,className:e.cc("ul_recorded-task-inset-spacing"),id:"ul-record-task-video-preview",muted:!0,ref:o=>{o&&(o.srcObject=n||null)}}),Mn=({content:n,pages:o,required:t})=>{const{skipButtonText:r}=n,{avStream:i}=ee.getState();return Re(o),e.u("div",{children:[e.u(Rn,{stream:i}),e.u("div",{className:"ul-vertical-button-container-center",children:[e.u(_.Button,{onClick:De.bind(null,{pages:o}),children:n.buttonText}),e.u(fe,{bottom:!0,required:t,skipButtonText:r})]})]})},Ln=({properties:n})=>{const{pages:o,required:t}=n,{avStream:r,currentPage:i}=ee.getState();if(i===void 0)return null;switch(i==null?void 0:i.type){case"av_permission":{const s=Ke(r,i);return s===_e?e.u(Sn,{content:i}):s===We?e.u(Dn,{content:i,pages:o,required:t}):e.u(Mn,{content:i,pages:o,required:t})}case"screen_permission":return e.u(Tn,{content:i,pages:o,required:t});case"start_task":return e.u(_n,{content:i,pages:o,required:t});case"complete_task":return e.u(In,{content:i,pages:o,properties:n});default:return null}},Bn=({className:n,properties:o,next:t,questionId:r})=>{const i=e.useConfig(),{surveyId:s,responseGroupUid:l,userId:v}=i,a=ee(),{screenPermissionRequested:c}=a,b=ee(u=>u.avStream);let d=ee(u=>u.currentPage);d||(d=function({pages:u,userId:h,responseGroupUid:k,surveyId:y,questionId:x,next:j}){const{updatePage:E}=ee.getState(),{eventEmitFn:N,recorderEventEmitter:D}=e.useConfig.getState(),T={questionId:x,surveyId:y,visitorId:h,responseGroupUid:k};let M=0;D.emit("recorded.task.permission.screen"),N("recorded.task.permission.screen"),D.emit("permission.status",{"permission.status.callback":(g,C,L,R)=>{const P=u[M],{type:H}=P,O=["screen"];if(he(P)){const{permissionDescriptors:A}=P,Q=A==null?void 0:A.includes("microphone"),$=A==null?void 0:A.includes("camera");Q&&O.push("audio"),$&&O.push("video"),(g!=null&&g.active&&!$||g!=null&&g.active&&C)&&M++}Oe(u[M])&&L&&(M++,D.emit("begin.recording",{"recording.media.types":O,"start.recording.callback":A=>E({mediaRecordingUids:A})})),E({currentPage:u[M],avStream:g,screenPermissionRequested:L,nextQuestion:j,type:H,passthroughData:T,recordingMediaTypes:O,captureStream:R})}});const p=u[M];return p.type==="av_permission"&&Ie({currentPage:p,pages:u}),p}({questionId:r,surveyId:s,next:u=>{t(u,!0)},pages:o.pages,responseGroupUid:l,userId:v}));let f=d.headline,w=d.captionText;const m=Ke(b,d);return Oe(d)&&c&&(f=d.permissionDeniedHeadline,w=d.permissionDeniedCaptionText),he(d)&&m===Ye&&(f=d.permissionGrantedHeadline,w=d.permissionGrantedCaptionText),e.u("div",{className:e.cc(n,"ul-center-horizontally","fade-in-transition"),children:[e.u(_.Header,{message:f,properties:{captionText:w}}),e.u(_.QuestionBodyWrapper,{children:e.u(Ln,{properties:o})})]})},Pn=({className:n,next:o,properties:t,questionId:r,type:i})=>{const{visitorAttributes:s,isLongFormSurvey:l}=e.useConfig(d=>({visitorAttributes:d.visitorAttributes,isLongFormSurvey:Z.isLongFormSurvey(d.studyType)})),v=(d,f=!1)=>{o({value:f?{skipped:!0}:void 0,questionId:r,type:i},!0)},a=d=>{d.key!=="Enter"&&d.key!==" "||o({value:void 0,questionId:r,type:i},!0)},c=_.getAttributedUrl(t&&t.buttonUrl,s),b=l&&t.promptActionType===_.PromptActionTypeEnum.NO_BUTTON?()=>e.u(e.g,{}):()=>e.u("div",{children:e.u("div",{className:"ul-card-button-group",children:[e.u("a",{className:"ul-card-text__button ul-card__text-url-prompt-button",href:c,id:"ul-card-text__button",onClick:v,onKeyPress:a,rel:"noreferrer",role:c?"link":"button",tabIndex:0,target:"_blank",children:e.getButtonText(t)}),t.required===!1&&e.u("button",{className:"ul-card-skip__button",onClick:d=>v(0,!0),children:e.getSkipButtonText(t)})]})});return e.u("div",{className:e.cc(n,"ul-card__text-url-prompt","fade-in-transition"),children:e.u(_.MobileEmbedView,{defaultBody:b,properties:t})},r)},Nn=({className:n,questionId:o})=>{const{border:t,destroy:r,endCard:i,forceBrandedLogo:s}=e.useConfig(a=>({border:a.border,destroy:a.destroy,endCard:a.endCard,forceBrandedLogo:a.forceBrandedLogo}));e.p(()=>{setTimeout(()=>{r(Z.APP_ID)},s?4e3:2e3)},[r,s]);const l=i&&i.subheader?e.u("p",{className:"ul-caption",children:i.subheader}):null,v=i&&i.headline?i.headline:"";return e.u("div",{className:e.cc(n,"ul-card--thanks","fade-in-transition"),children:e.u("div",{children:e.u("div",{className:"ul-card--thanks-content",children:[e.u("div",{className:"ul-thanks-check",children:e.u("svg",{"aria-labelledby":"title",fill:"none",height:"99",viewBox:"0 0 81 99",width:"81",xmlns:"http://www.w3.org/2000/svg",children:[e.u("path",{clipRule:"evenodd",d:"M40.5 77C60.9345 77 77.5 60.4345 77.5 40C77.5 19.5655 60.9345 3 40.5 3C20.0655 3 3.5 19.5655 3.5 40C3.5 60.4345 20.0655 77 40.5 77ZM80.5 40C80.5 62.0914 62.5914 80 40.5 80C18.4086 80 0.5 62.0914 0.5 40C0.5 17.9086 18.4086 0 40.5 0C62.5914 0 80.5 17.9086 80.5 40Z",fill:t,fillRule:"evenodd"}),e.u("path",{clipRule:"evenodd",d:"M55.025 22.9046C55.6299 23.4705 55.6616 24.4198 55.0956 25.0247C54.8724 25.2634 54.6109 25.5285 54.3157 25.8277C52.2547 27.9168 48.5549 31.667 44.8135 39.6658C43.2818 42.9406 42.0864 45.8386 41.0823 48.2729C40.6539 49.3116 40.2603 50.2659 39.8902 51.129C39.287 52.5359 38.7248 53.7508 38.1744 54.625C37.8997 55.0613 37.5806 55.4905 37.2017 55.8245C36.8201 56.1607 36.2613 56.5 35.5457 56.5C34.6742 56.5 34.0892 55.9692 33.7774 55.6083C33.4502 55.2296 33.1752 54.7511 32.9396 54.301C32.7305 53.9013 32.5088 53.4367 32.2797 52.9565C32.2429 52.8794 32.2059 52.8019 32.1688 52.7243C31.8942 52.1499 31.5959 51.534 31.2537 50.8868C29.8886 48.305 27.8539 45.2878 24.2343 43.1382C23.522 42.7152 23.2875 41.7949 23.7105 41.0826C24.1335 40.3703 25.0539 40.1358 25.7662 40.5588C30.0556 43.1062 32.4149 46.6647 33.9058 49.4845C34.2776 50.1876 34.5973 50.8487 34.8753 51.4302C34.9147 51.5124 34.9529 51.5926 34.9902 51.6707C35.2222 52.1567 35.4164 52.5637 35.5978 52.9102C35.6151 52.9434 35.6321 52.9754 35.6485 53.0061C36.0565 52.3531 36.5341 51.3434 37.133 49.9468C37.4781 49.1418 37.8572 48.2229 38.2761 47.2074C39.2886 44.7532 40.5339 41.7347 42.0961 38.3948C46.0591 29.9221 50.0641 25.8648 52.1535 23.7482C52.4423 23.4556 52.6944 23.2002 52.9048 22.9753C53.4708 22.3703 54.42 22.3387 55.025 22.9046ZM35.1994 53.5892C35.1994 53.5892 35.2 53.5888 35.2012 53.5879C35.2 53.5889 35.1994 53.5893 35.1994 53.5892ZM36.0666 53.6682C36.0732 53.674 36.0765 53.6775 36.0765 53.6777C36.0765 53.678 36.0732 53.6751 36.0666 53.6682Z",fill:t,fillRule:"evenodd"}),e.u("path",{d:"M69.5 97C69.5 98.1046 56.2924 99 40 99C23.7076 99 10.5 98.1046 10.5 97C10.5 95.8954 23.7076 95 40 95C56.2924 95 69.5 95.8954 69.5 97Z",fill:"black",fillOpacity:"0.2"})]})}),e.u(_.Header,{message:v}),l]})})},o)},On=()=>e.u("div",{className:"thinking-dots-container",children:e.u("div",{className:"thinking-dot"})}),qn=({className:n})=>{const{uploadProgress:o}=e.useConfig(s=>({uploadProgress:s.uploadProgress}));let t,r;Object.values(o).filter(s=>s.isSubmitted).length>1?(t="Your responses are processing",r="Please keep this tab open until your responses are fully processed."):(t="Your response is processing",r="Please keep this tab open until your response is fully processed.");const i=Math.round(Math.min(99,...Object.values(o).filter(s=>s.isSubmitted).map(s=>s.progressPct||0)));return e.u("div",{className:e.cc(n,"ul-card--uploading","fade-in-transition"),children:[e.u("div",{"aria-busy":"true","aria-label":"Processing...","aria-live":"polite",className:"ul-loading-spinner-container",role:"progressbar",children:e.u("div",{className:"ul-loading-spinner",children:[e.u("div",{className:"first"}),e.u("div",{className:"second"}),e.u("div",{className:"third"}),e.u("div",{className:"fourth"})]})}),e.u(_.Header,{message:`${t} (${i}% complete)`}),e.u("p",{className:"ul-caption",children:r})]})},Ue=0,Ae=1,Un=({className:n,next:o,properties:t,questionId:r,type:i})=>{const s=`ul-card-video__player_recorder-q${r}`,{apiURL:l,envId:v,handleUploadUpdate:a,headers:c,responseGroupUid:b,surveyId:d,update:f,viewDocument:w,visitorId:m}=e.useConfig(p=>({apiURL:p.apiURL,envId:p.envId,handleUploadUpdate:p.handleUploadUpdate,headers:p.headers,responseGroupUid:p.responseGroupUid,surveyId:p.surveyId,update:p.update,viewDocument:p.viewDocument,visitorId:p.userId})),[u,h]=e.h(!1),[k,y]=e.h(null),[x,j]=e.h(null),[E,N]=e.h(Ue),D=e._(null);e.p(()=>{const p=D.current,g=new ResizeObserver(()=>{f()});return p&&g.observe(p),()=>{p&&g.unobserve(p)}},[f]);const T=(p,g)=>{p===B.UPLOAD_STARTED?(y(g[B.UPLOAD_ID]),j(g[B.MEDIA_RECORDING_UID]),h(!0)):p===B.DELETE?(y(null),j(null),h(!1)):p===B.UPLOAD_PROGRESS?isNaN(g[B.UPLOAD_PROGRESS_PCT])?a({mediaRecordingUid:g[B.MEDIA_RECORDING_UID],isComplete:!0}):a({mediaRecordingUid:g[B.MEDIA_RECORDING_UID],progressPct:g[B.UPLOAD_PROGRESS_PCT]}):p===B.UPLOAD_FINISHED&&a({mediaRecordingUid:g[B.MEDIA_RECORDING_UID],isComplete:!0})},M=p=>{p.preventDefault(),p.stopPropagation(),document.getElementById(s)&&(g=>{const C=g+Be;if(S.document.getElementById(C)&&S.videojs){try{if(!S.videojs(C).record().stream)return}catch{return}S.videojs(C).record().stop(),S.videojs(C).record().stopDevice()}})(s),k&&x?(a({mediaRecordingUid:x,isSubmitted:!0}),o({value:{mediaRecordingUid:x},questionId:r,type:i},!0)):o({value:null,questionId:r,type:i},!0)};return e.u("form",{className:e.cc(n,"ul-card--video","fade-in-transition"),id:"ul-video-interview-form",children:[e.u(_.QuestionBodyWrapper,{children:[e.u("div",{id:"ul-question-player-container",ref:D,style:{display:E===Ue?"":"none"},children:e.u(_.MobileEmbedView,{defaultBody:()=>e.u("button",{className:"ul-video-btn ul-record-response-btn",onClick:p=>{p.preventDefault(),p.stopPropagation(),document.getElementById(s)&&(g=>{const C=ge(g+$e);C==null||C.pause()})(s),N(Ae)}}),properties:t})}),e.u("div",{style:{display:E===Ae?"block":"none"},children:e.u("div",{id:"ul-recorder-player-container",ref:p=>{if(p&&p.children.length===0){const g=((C,L={},R="https://api.userleap.com",P,H,O,A=!1,Q=document)=>{S.document=Q;const $=C+Be,W=Ge($);return S.document.addEventListener("securitypolicyviolation",J=>{te(new Error(`Voice & Video feature violates ${J.violatedDirective} web page CSP policies for the recorder player.`),"recorderDeviceError",R,O,L.visitorId,L.envId)}),Fe(He.concat(rn),()=>{je($,W),S.document.getElementById(Se($)).remove();try{sn(W,$,L,R,P,H,O,A)}catch(J){return void te(new Error(`Error when creating video recorder player object ${J}`),"recorderDeviceError",R,O,L.visitorId,L.envId)}}),W})(s,{surveyId:d,responseGroupUid:b,questionId:r,visitorId:m,envId:v},l,T,void 0,{...c,"x-ul-video-recorder-origin":"sdk"},t.mediaType===B.MEDIA_TYPE_AUDIO,w);p.appendChild(g)}}})})]}),e.u(_.QuestionBodyFooterContainer,{children:[e.u(ae,{isDisabled:!!t.required&&!u,onClick:M,children:e.getButtonText(t)}),e.u("button",{className:"ul-card-text__button ul-button-inactive ul-card-skip__button",id:"ul-card-video__skip_button",onClick:M,style:{...t.required?{display:"none"}:{},...u?{display:"none"}:{}},children:e.getSkipButtonText(t)})]})]})},tn=n=>n.type==="thanks"||n.type==="uploading",An=({card:n,avatars:o,isThinking:t,isCurrentQuestion:r,currentQuestionBubbleRef:i})=>{const s=(l=>"properties"in l.props&&l.props.properties&&"questionHtml"in l.props.properties&&l.props.properties.questionHtml?{content:l.props.properties.questionHtml,isHtml:!0}:"message"in l.props?{content:l.props.message,isHtml:!1}:{content:"Question",isHtml:!1})(n);return e.u(de,{avatars:o,isLeft:!0,message:{id:`question-${n.name}`,type:"question",content:s.content},ref:r?i:null,children:t?e.u(On,{}):e.u(e.g,{children:[s.isHtml?e.u("div",{className:"chat-message-text",dangerouslySetInnerHTML:{__html:s.content}}):e.u("div",{className:"chat-message-text",children:s.content}),n.type==="videovoice"&&e.u(cn,{properties:n.props,questionId:n.name,surveyVideoUrl:n.props.properties.videoUrl})]})})},Hn=({card:n,avatars:o})=>{const t=(r=>{if(!("properties"in r.props)||!r.props.properties||typeof r.props.properties!="object")return null;const i=r.props.properties,s=[{key:"captionHtml",isHtml:!0},{key:"captionText",isHtml:!1},{key:"richTextBody",isHtml:!0},{key:"body",isHtml:!1}];for(const{key:l,isHtml:v}of s){const a=i[l];if(typeof a=="string"){const c=a.trim();if(c)return{content:c,isHtml:v}}}return null})(n);return t?e.u(de,{avatars:o,hideAvatar:!0,isLeft:!0,message:{id:`caption-${n.name}`,type:"question",content:t.content},children:t.isHtml?e.u("div",{className:"chat-message-text",dangerouslySetInnerHTML:{__html:t.content}}):e.u("div",{className:"chat-message-text",children:t.content})}):null},$n=({card:n,userResponse:o,avatars:t})=>{const r=((i,s)=>{if(i.type==="open"&&s&&typeof s=="object"&&"value"in s)return s.value})(n,o);return e.u("div",{className:"chat-bubble-container chat-right",children:[e.u("div",{className:"chat-bubble chat-bubble-right chat-bubble-text-only",children:e.u("div",{className:"chat-message-text",children:r||e.u("div",{className:"chat-message-no-response",children:"No response"})})}),e.u("img",{alt:"User Avatar",className:"chat-avatar chat-avatar-right",srcSet:`${t.respondentAvatar["1x"]} 1x, ${t.respondentAvatar["2x"]} 2x`})]})},Fn=({card:n,avatars:o,isCurrentQuestion:t,currentQuestionBubbleRef:r})=>{const{endCard:i}=e.useConfig(s=>({endCard:s.endCard}));return e.u(e.g,{children:[e.u(de,{avatars:o,isLeft:!0,message:{id:`thanks-${n.name}`,type:"question",content:(i==null?void 0:i.headline)??"Great! Thank you for your participation."},ref:t?r:null}),(i==null?void 0:i.subheader)&&e.u(de,{avatars:o,hideAvatar:!0,isLeft:!0,message:{id:`caption-${n.name}`,type:"question",content:i.subheader}}),e.u(pn,{})]})},Vn=({card:n,cardIndex:o,index:t,avatars:r,cardResponses:i,questionThinkingStates:s,startingQuestionIdx:l,currentQuestionBubbleRef:v,handleCardResponse:a})=>{const c=o===t,b=o<t,d=tn(n);if(d)return e.u(Fn,{avatars:r,card:n,currentQuestionBubbleRef:v,isCurrentQuestion:c});const f=`${n.name}`,w=i.get(f),m=n.type==="open",u=s.get(f),h=o>(l??0)&&n.type!=="thanks"&&n.type!=="uploading"&&(u===!0||u===void 0);return e.u(e.wn.Fragment,{children:[e.u(An,{avatars:r,card:n,currentQuestionBubbleRef:v,isCurrentQuestion:c,isThinking:h}),!h&&e.u(Hn,{avatars:r,card:n}),b&&m?e.u($n,{avatars:r,card:n,userResponse:w}):(!b||!m)&&!h&&e.u(de,{avatars:r,isLeft:!1,message:{id:`card-${n.name}`,type:"card",content:""},children:e.u("div",{className:"chat-card-container",children:e.u(Qn,{card:n,className:d?"chat-thanks-card":"chat-card",isAnswered:b,next:c?a:()=>{}})})})]},`question-card-${n.name}`)},de=e.wn.forwardRef(({message:n,isLeft:o=!1,children:t,avatars:r,hideAvatar:i=!1},s)=>{const l=o?"chat-bubble-left":"chat-bubble-right";return e.u("div",{className:`chat-bubble-container ${o?"chat-left":"chat-right"}${o&&i?" chat-no-avatar":""}`,ref:s,children:[o&&!i&&e.u("img",{alt:"AI Avatar",className:"chat-avatar chat-avatar-left",srcSet:`${r.agentAvatar["1x"]} 1x, ${r.agentAvatar["2x"]} 2x`}),e.u("div",{className:`chat-bubble ${l}`,children:t||e.u("div",{className:"chat-message-text",children:n.content})}),!o&&!i&&e.u("img",{alt:"User Avatar",className:"chat-avatar chat-avatar-right",srcSet:`${r.respondentAvatar["1x"]} 1x, ${r.respondentAvatar["2x"]} 2x`})]})});de.displayName="ChatBubble";const zn=()=>{const n=e.useConfig(t=>t.close),o=e.F(()=>()=>n(Z.APP_ID),[n]);return e.u("div",{"aria-label":"Close button",className:"conversational-close-btn",onClick:o,onKeyPress:t=>{t.key==="Enter"&&o()},role:"button",tabIndex:0,children:e.u("svg",{fill:"none",height:"16px",viewBox:"0 0 13 13",width:"16px",xmlns:"http://www.w3.org/2000/svg",children:e.u("path",{d:"M2.54964 1.78369L1.78369 2.54964L5.73405 6.5L1.78369 10.4504L2.54964 11.2163L6.5 7.26595L10.4504 11.2163L11.2163 10.4504L7.26595 6.5L11.2163 2.54964L10.4504 1.78369L6.5 5.73405L2.54964 1.78369Z",fill:"#262136"})})})},Qn=({card:n,next:o,className:t="",isAnswered:r=!1})=>{const i={className:r?`${t} answered-card`:t,next:r?()=>{}:o,questionId:n.name,type:n.type,isAnswered:r};switch(n.type){case"consentlegal":return e.u(un,{...i,...n.props});case"likert":return e.u(gn,{...i,...n.props});case"matrix":return e.u(Cn,{...i,...n.props});case"multiplechoice":return e.u(xn,{...i,...n.props});case"multipleselect":return e.u(wn,{...i,...n.props});case"nps":return e.u(kn,{...i,...n.props});case"open":return e.u(En,{...i,...n.props});case"rankorder":return e.u(jn,{...i,...n.props});case"recordedtask":return e.u(Bn,{...i,...n.props});case"texturlprompt":return e.u(Pn,{...i,...n.props});case"thanks":return e.u(Nn,{...i,...n.props});case"uploading":return e.u(qn,{...i,...n.props});case"videovoice":return e.u(Un,{...i,...n.props});default:return null}};exports.default=({cards:n,next:o,previousResponses:t})=>{const{messagesContainerRef:r,currentQuestionBubbleRef:i,scrollToCurrentQuestion:s}=(()=>{const y=e._(null),x=e._(null),j=e.T(()=>{if(x.current&&y.current){const E=y.current,N=x.current.offsetTop-E.offsetTop-16;E.scrollTo({top:Math.max(0,N),behavior:"smooth"})}},[]);return{messagesContainerRef:y,currentQuestionBubbleRef:x,scrollToCurrentQuestion:j}})(),{cardResponses:l,setCardResponse:v}=(()=>{const[y,x]=e.h(new Map);return{cardResponses:y,setCardResponse:e.T((j,E)=>{x(N=>new Map(N).set(j,E))},[])}})(),{index:a,isLongFormSurvey:c,avatars:b,startingQuestionIdx:d}=e.useConfig(y=>({index:y.index,isLongFormSurvey:Z.isLongFormSurvey(y.studyType),avatars:y.avatars,startingQuestionIdx:y.startingQuestionIdx})),f=((y,x,j)=>{const[E,N]=e.h(new Map);return e.p(()=>{if(y.length>0&&x<y.length){const D=y[x],T=`${D.name}`;if(x<=(j??0)||tn(D))return void N(p=>new Map(p).set(T,!1));N(p=>new Map(p).set(T,!0));const M=setTimeout(()=>{N(p=>new Map(p).set(T,!1))},1e3);return()=>clearTimeout(M)}},[x,y,j]),E})(n,a,d),w=((y,x)=>{const[j,E]=e.h(new Set([0]));return e.p(()=>{E(N=>new Set(N).add(y))},[y]),e.p(()=>{const N=x??0;N>0&&E(D=>{const T=new Set(D);for(let M=0;M<=N;M++)T.add(M);return T})},[x]),j})(a,d),m=e.F(()=>({...t,...e.buildReadableResponseMap(n.map((y,x)=>{var j,E;return{...y,value:x<a?((j=l.get(`${y.name}`))==null?void 0:j.value)??null:null,secondaryValue:x<a?((E=l.get(`${y.name}`))==null?void 0:E.secondaryValue)??null:null}}))}),[t,l,n,a]),u=e.pipeReadableResponsesIntoCards(n,m);e.p(()=>{requestAnimationFrame(()=>{s()})},[a,s,f]);const h=e.T((y,x)=>{if(!x)return;const j=u[a];if(!j)return;const E=`${j.name}`;v(E,y),o([y])},[u,a,o,v]),k=u.map((y,x)=>({card:y,cardIndex:x})).filter(({cardIndex:y})=>w.has(y));return e.u("div",{className:"conversational-ui ul-conversational-ui",children:[!c&&e.u(zn,{}),e.u("div",{className:"chat-container",ref:r,children:e.u("div",{className:"chat-messages",children:k.map(({card:y,cardIndex:x})=>e.u(Vn,{avatars:b,card:y,cardIndex:x,cardResponses:l,currentQuestionBubbleRef:i,handleCardResponse:h,index:a,questionThinkingStates:f,startingQuestionIdx:d},`question-card-${y.name}`))})})]})};