@magicfeedback/popup-sdk 1.21.1 → 1.22.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.
Files changed (46) hide show
  1. package/README.md +1 -1
  2. package/dist/2.2.44-HO4Z2OYX.mjs +2421 -0
  3. package/dist/2.2.44-HO4Z2OYX.mjs.map +1 -0
  4. package/dist/2.2.44-NTG36TY5.mjs +2421 -0
  5. package/dist/2.2.44-NTG36TY5.mjs.map +1 -0
  6. package/dist/assets/assets/style.css +113 -36
  7. package/dist/assets/assets/survey-css/2.2.44.css +2413 -0
  8. package/dist/{chunk-7KMBH25G.mjs → chunk-4TNJ2IBB.mjs} +265 -40
  9. package/dist/chunk-4TNJ2IBB.mjs.map +1 -0
  10. package/dist/{chunk-NNWYOG43.mjs → chunk-5UURWEOR.mjs} +265 -40
  11. package/dist/chunk-5UURWEOR.mjs.map +1 -0
  12. package/dist/{chunk-4C3DSMUT.mjs → chunk-6HPKIMVM.mjs} +265 -40
  13. package/dist/chunk-6HPKIMVM.mjs.map +1 -0
  14. package/dist/index.d.mts +28 -1
  15. package/dist/index.d.ts +28 -1
  16. package/dist/index.js +4322 -1466
  17. package/dist/index.js.map +1 -1
  18. package/dist/index.mjs +78 -27
  19. package/dist/index.mjs.map +1 -1
  20. package/dist/index.native.d.mts +28 -1
  21. package/dist/index.native.d.ts +28 -1
  22. package/dist/index.native.js +4322 -1466
  23. package/dist/index.native.js.map +1 -1
  24. package/dist/index.native.mjs +78 -27
  25. package/dist/index.native.mjs.map +1 -1
  26. package/dist/react-native.d.mts +22 -0
  27. package/dist/react-native.d.ts +22 -0
  28. package/dist/react-native.js +2962 -230
  29. package/dist/react-native.js.map +1 -1
  30. package/dist/react-native.mjs +78 -27
  31. package/dist/react-native.mjs.map +1 -1
  32. package/dist/renderPopup-L5TROMDQ.mjs +4001 -0
  33. package/dist/renderPopup-L5TROMDQ.mjs.map +1 -0
  34. package/dist/{renderPopup-IKPXPDB7.mjs → renderPopup-SFDIFFUT.mjs} +70 -40
  35. package/dist/renderPopup-SFDIFFUT.mjs.map +1 -0
  36. package/dist/renderPopup-UXD7L3FX.mjs +4001 -0
  37. package/dist/renderPopup-UXD7L3FX.mjs.map +1 -0
  38. package/package.json +2 -2
  39. package/dist/chunk-4C3DSMUT.mjs.map +0 -1
  40. package/dist/chunk-7KMBH25G.mjs.map +0 -1
  41. package/dist/chunk-NNWYOG43.mjs.map +0 -1
  42. package/dist/renderPopup-IKPXPDB7.mjs.map +0 -1
  43. package/dist/renderPopup-M5ZIXNV6.mjs +0 -3847
  44. package/dist/renderPopup-M5ZIXNV6.mjs.map +0 -1
  45. package/dist/renderPopup-QVMBE4L4.mjs +0 -3847
  46. package/dist/renderPopup-QVMBE4L4.mjs.map +0 -1
@@ -1,3847 +0,0 @@
1
- import {
2
- BUNDLED_SURVEY_SDK_VERSION,
3
- REVEAL_TIMEOUT_MS,
4
- applySurveyPrimaryColor,
5
- buildFontFaceCss,
6
- buildFontFamilyValue,
7
- buildSurveyIdentity,
8
- chooseSurveySdkVersion,
9
- classifySubmitError,
10
- describeSurveySdkChoice,
11
- directionFor,
12
- getLabels,
13
- resolveActionLabels,
14
- revealWhenPainted,
15
- sdkError,
16
- sdkLog,
17
- sdkWarn,
18
- setSurveyBusy,
19
- style_default,
20
- surveySdkUrls
21
- } from "./chunk-7KMBH25G.mjs";
22
- import {
23
- __commonJS,
24
- __toESM
25
- } from "./chunk-3QS3WKRC.mjs";
26
-
27
- // node_modules/@magicfeedback/native/dist/magicfeedback-sdk.browser.js
28
- var require_magicfeedback_sdk_browser = __commonJS({
29
- "node_modules/@magicfeedback/native/dist/magicfeedback-sdk.browser.js"(exports, module) {
30
- "use strict";
31
- !(function(e, t) {
32
- "object" == typeof exports && "object" == typeof module ? module.exports = t() : "function" == typeof define && define.amd ? define([], t) : "object" == typeof exports ? exports.magicfeedback = t() : e.magicfeedback = t();
33
- })(self, () => (() => {
34
- var e = { 4945(e2, t2) {
35
- var i2 = "undefined" != typeof self ? self : this, a = (function() {
36
- function e3() {
37
- this.fetch = false, this.DOMException = i2.DOMException;
38
- }
39
- return e3.prototype = i2, new e3();
40
- })();
41
- !(function(e3) {
42
- !(function(t3) {
43
- var i3 = "URLSearchParams" in e3, a2 = "Symbol" in e3 && "iterator" in Symbol, r2 = "FileReader" in e3 && "Blob" in e3 && (function() {
44
- try {
45
- return new Blob(), true;
46
- } catch (e4) {
47
- return false;
48
- }
49
- })(), n = "FormData" in e3, o = "ArrayBuffer" in e3;
50
- if (o) var s = ["[object Int8Array]", "[object Uint8Array]", "[object Uint8ClampedArray]", "[object Int16Array]", "[object Uint16Array]", "[object Int32Array]", "[object Uint32Array]", "[object Float32Array]", "[object Float64Array]"], l = ArrayBuffer.isView || function(e4) {
51
- return e4 && s.indexOf(Object.prototype.toString.call(e4)) > -1;
52
- };
53
- function d(e4) {
54
- if ("string" != typeof e4 && (e4 = String(e4)), /[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e4)) throw new TypeError("Invalid character in header field name");
55
- return e4.toLowerCase();
56
- }
57
- function c(e4) {
58
- return "string" != typeof e4 && (e4 = String(e4)), e4;
59
- }
60
- function u(e4) {
61
- var t4 = { next: function() {
62
- var t5 = e4.shift();
63
- return { done: void 0 === t5, value: t5 };
64
- } };
65
- return a2 && (t4[Symbol.iterator] = function() {
66
- return t4;
67
- }), t4;
68
- }
69
- function p(e4) {
70
- this.map = {}, e4 instanceof p ? e4.forEach(function(e5, t4) {
71
- this.append(t4, e5);
72
- }, this) : Array.isArray(e4) ? e4.forEach(function(e5) {
73
- this.append(e5[0], e5[1]);
74
- }, this) : e4 && Object.getOwnPropertyNames(e4).forEach(function(t4) {
75
- this.append(t4, e4[t4]);
76
- }, this);
77
- }
78
- function m(e4) {
79
- if (e4.bodyUsed) return Promise.reject(new TypeError("Already read"));
80
- e4.bodyUsed = true;
81
- }
82
- function h(e4) {
83
- return new Promise(function(t4, i4) {
84
- e4.onload = function() {
85
- t4(e4.result);
86
- }, e4.onerror = function() {
87
- i4(e4.error);
88
- };
89
- });
90
- }
91
- function f(e4) {
92
- var t4 = new FileReader(), i4 = h(t4);
93
- return t4.readAsArrayBuffer(e4), i4;
94
- }
95
- function g(e4) {
96
- if (e4.slice) return e4.slice(0);
97
- var t4 = new Uint8Array(e4.byteLength);
98
- return t4.set(new Uint8Array(e4)), t4.buffer;
99
- }
100
- function y() {
101
- return this.bodyUsed = false, this._initBody = function(e4) {
102
- var t4;
103
- this._bodyInit = e4, e4 ? "string" == typeof e4 ? this._bodyText = e4 : r2 && Blob.prototype.isPrototypeOf(e4) ? this._bodyBlob = e4 : n && FormData.prototype.isPrototypeOf(e4) ? this._bodyFormData = e4 : i3 && URLSearchParams.prototype.isPrototypeOf(e4) ? this._bodyText = e4.toString() : o && r2 && (t4 = e4) && DataView.prototype.isPrototypeOf(t4) ? (this._bodyArrayBuffer = g(e4.buffer), this._bodyInit = new Blob([this._bodyArrayBuffer])) : o && (ArrayBuffer.prototype.isPrototypeOf(e4) || l(e4)) ? this._bodyArrayBuffer = g(e4) : this._bodyText = e4 = Object.prototype.toString.call(e4) : this._bodyText = "", this.headers.get("content-type") || ("string" == typeof e4 ? this.headers.set("content-type", "text/plain;charset=UTF-8") : this._bodyBlob && this._bodyBlob.type ? this.headers.set("content-type", this._bodyBlob.type) : i3 && URLSearchParams.prototype.isPrototypeOf(e4) && this.headers.set("content-type", "application/x-www-form-urlencoded;charset=UTF-8"));
104
- }, r2 && (this.blob = function() {
105
- var e4 = m(this);
106
- if (e4) return e4;
107
- if (this._bodyBlob) return Promise.resolve(this._bodyBlob);
108
- if (this._bodyArrayBuffer) return Promise.resolve(new Blob([this._bodyArrayBuffer]));
109
- if (this._bodyFormData) throw new Error("could not read FormData body as blob");
110
- return Promise.resolve(new Blob([this._bodyText]));
111
- }, this.arrayBuffer = function() {
112
- return this._bodyArrayBuffer ? m(this) || Promise.resolve(this._bodyArrayBuffer) : this.blob().then(f);
113
- }), this.text = function() {
114
- var e4, t4, i4, a3 = m(this);
115
- if (a3) return a3;
116
- if (this._bodyBlob) return e4 = this._bodyBlob, i4 = h(t4 = new FileReader()), t4.readAsText(e4), i4;
117
- if (this._bodyArrayBuffer) return Promise.resolve((function(e5) {
118
- for (var t5 = new Uint8Array(e5), i5 = new Array(t5.length), a4 = 0; a4 < t5.length; a4++) i5[a4] = String.fromCharCode(t5[a4]);
119
- return i5.join("");
120
- })(this._bodyArrayBuffer));
121
- if (this._bodyFormData) throw new Error("could not read FormData body as text");
122
- return Promise.resolve(this._bodyText);
123
- }, n && (this.formData = function() {
124
- return this.text().then(E);
125
- }), this.json = function() {
126
- return this.text().then(JSON.parse);
127
- }, this;
128
- }
129
- p.prototype.append = function(e4, t4) {
130
- e4 = d(e4), t4 = c(t4);
131
- var i4 = this.map[e4];
132
- this.map[e4] = i4 ? i4 + ", " + t4 : t4;
133
- }, p.prototype.delete = function(e4) {
134
- delete this.map[d(e4)];
135
- }, p.prototype.get = function(e4) {
136
- return e4 = d(e4), this.has(e4) ? this.map[e4] : null;
137
- }, p.prototype.has = function(e4) {
138
- return this.map.hasOwnProperty(d(e4));
139
- }, p.prototype.set = function(e4, t4) {
140
- this.map[d(e4)] = c(t4);
141
- }, p.prototype.forEach = function(e4, t4) {
142
- for (var i4 in this.map) this.map.hasOwnProperty(i4) && e4.call(t4, this.map[i4], i4, this);
143
- }, p.prototype.keys = function() {
144
- var e4 = [];
145
- return this.forEach(function(t4, i4) {
146
- e4.push(i4);
147
- }), u(e4);
148
- }, p.prototype.values = function() {
149
- var e4 = [];
150
- return this.forEach(function(t4) {
151
- e4.push(t4);
152
- }), u(e4);
153
- }, p.prototype.entries = function() {
154
- var e4 = [];
155
- return this.forEach(function(t4, i4) {
156
- e4.push([i4, t4]);
157
- }), u(e4);
158
- }, a2 && (p.prototype[Symbol.iterator] = p.prototype.entries);
159
- var v = ["DELETE", "GET", "HEAD", "OPTIONS", "POST", "PUT"];
160
- function b(e4, t4) {
161
- var i4, a3, r3 = (t4 = t4 || {}).body;
162
- if (e4 instanceof b) {
163
- if (e4.bodyUsed) throw new TypeError("Already read");
164
- this.url = e4.url, this.credentials = e4.credentials, t4.headers || (this.headers = new p(e4.headers)), this.method = e4.method, this.mode = e4.mode, this.signal = e4.signal, r3 || null == e4._bodyInit || (r3 = e4._bodyInit, e4.bodyUsed = true);
165
- } else this.url = String(e4);
166
- if (this.credentials = t4.credentials || this.credentials || "same-origin", !t4.headers && this.headers || (this.headers = new p(t4.headers)), this.method = (a3 = (i4 = t4.method || this.method || "GET").toUpperCase(), v.indexOf(a3) > -1 ? a3 : i4), this.mode = t4.mode || this.mode || null, this.signal = t4.signal || this.signal, this.referrer = null, ("GET" === this.method || "HEAD" === this.method) && r3) throw new TypeError("Body not allowed for GET or HEAD requests");
167
- this._initBody(r3);
168
- }
169
- function E(e4) {
170
- var t4 = new FormData();
171
- return e4.trim().split("&").forEach(function(e5) {
172
- if (e5) {
173
- var i4 = e5.split("="), a3 = i4.shift().replace(/\+/g, " "), r3 = i4.join("=").replace(/\+/g, " ");
174
- t4.append(decodeURIComponent(a3), decodeURIComponent(r3));
175
- }
176
- }), t4;
177
- }
178
- function k(e4, t4) {
179
- t4 || (t4 = {}), this.type = "default", this.status = void 0 === t4.status ? 200 : t4.status, this.ok = this.status >= 200 && this.status < 300, this.statusText = "statusText" in t4 ? t4.statusText : "OK", this.headers = new p(t4.headers), this.url = t4.url || "", this._initBody(e4);
180
- }
181
- b.prototype.clone = function() {
182
- return new b(this, { body: this._bodyInit });
183
- }, y.call(b.prototype), y.call(k.prototype), k.prototype.clone = function() {
184
- return new k(this._bodyInit, { status: this.status, statusText: this.statusText, headers: new p(this.headers), url: this.url });
185
- }, k.error = function() {
186
- var e4 = new k(null, { status: 0, statusText: "" });
187
- return e4.type = "error", e4;
188
- };
189
- var A = [301, 302, 303, 307, 308];
190
- k.redirect = function(e4, t4) {
191
- if (-1 === A.indexOf(t4)) throw new RangeError("Invalid status code");
192
- return new k(null, { status: t4, headers: { location: e4 } });
193
- }, t3.DOMException = e3.DOMException;
194
- try {
195
- new t3.DOMException();
196
- } catch (e4) {
197
- t3.DOMException = function(e5, t4) {
198
- this.message = e5, this.name = t4;
199
- var i4 = Error(e5);
200
- this.stack = i4.stack;
201
- }, t3.DOMException.prototype = Object.create(Error.prototype), t3.DOMException.prototype.constructor = t3.DOMException;
202
- }
203
- function T(e4, i4) {
204
- return new Promise(function(a3, n2) {
205
- var o2 = new b(e4, i4);
206
- if (o2.signal && o2.signal.aborted) return n2(new t3.DOMException("Aborted", "AbortError"));
207
- var s2 = new XMLHttpRequest();
208
- function l2() {
209
- s2.abort();
210
- }
211
- s2.onload = function() {
212
- var e5, t4, i5 = { status: s2.status, statusText: s2.statusText, headers: (e5 = s2.getAllResponseHeaders() || "", t4 = new p(), e5.replace(/\r?\n[\t ]+/g, " ").split(/\r?\n/).forEach(function(e6) {
213
- var i6 = e6.split(":"), a4 = i6.shift().trim();
214
- if (a4) {
215
- var r4 = i6.join(":").trim();
216
- t4.append(a4, r4);
217
- }
218
- }), t4) };
219
- i5.url = "responseURL" in s2 ? s2.responseURL : i5.headers.get("X-Request-URL");
220
- var r3 = "response" in s2 ? s2.response : s2.responseText;
221
- a3(new k(r3, i5));
222
- }, s2.onerror = function() {
223
- n2(new TypeError("Network request failed"));
224
- }, s2.ontimeout = function() {
225
- n2(new TypeError("Network request failed"));
226
- }, s2.onabort = function() {
227
- n2(new t3.DOMException("Aborted", "AbortError"));
228
- }, s2.open(o2.method, o2.url, true), "include" === o2.credentials ? s2.withCredentials = true : "omit" === o2.credentials && (s2.withCredentials = false), "responseType" in s2 && r2 && (s2.responseType = "blob"), o2.headers.forEach(function(e5, t4) {
229
- s2.setRequestHeader(t4, e5);
230
- }), o2.signal && (o2.signal.addEventListener("abort", l2), s2.onreadystatechange = function() {
231
- 4 === s2.readyState && o2.signal.removeEventListener("abort", l2);
232
- }), s2.send(void 0 === o2._bodyInit ? null : o2._bodyInit);
233
- });
234
- }
235
- T.polyfill = true, e3.fetch || (e3.fetch = T, e3.Headers = p, e3.Request = b, e3.Response = k), t3.Headers = p, t3.Request = b, t3.Response = k, t3.fetch = T, Object.defineProperty(t3, "__esModule", { value: true });
236
- })({});
237
- })(a), a.fetch.ponyfill = true, delete a.fetch.polyfill;
238
- var r = a;
239
- (t2 = r.fetch).default = r.fetch, t2.fetch = r.fetch, t2.Headers = r.Headers, t2.Request = r.Request, t2.Response = r.Response, e2.exports = t2;
240
- }, 317(e2, t2) {
241
- "use strict";
242
- t2.HOST_API_URL_DEV = t2.HOST_API_URL = void 0, t2.HOST_API_URL = "https://api.deepdots.com/", t2.HOST_API_URL_DEV = "https://api-dev.deepdots.com/";
243
- }, 8156(e2, t2, i2) {
244
- "use strict";
245
- var a = this && this.__importDefault || function(e3) {
246
- return e3 && e3.__esModule ? e3 : { default: e3 };
247
- };
248
- Object.defineProperty(t2, "__esModule", { value: true });
249
- const r = a(i2(7927));
250
- let n = null;
251
- n || (n = (0, r.default)()), t2.default = n;
252
- }, 7927(e2, t2, i2) {
253
- "use strict";
254
- var a = this && this.__awaiter || function(e3, t3, i3, a2) {
255
- return new (i3 || (i3 = Promise))(function(r2, n2) {
256
- function o2(e4) {
257
- try {
258
- l2(a2.next(e4));
259
- } catch (e5) {
260
- n2(e5);
261
- }
262
- }
263
- function s2(e4) {
264
- try {
265
- l2(a2.throw(e4));
266
- } catch (e5) {
267
- n2(e5);
268
- }
269
- }
270
- function l2(e4) {
271
- var t4;
272
- e4.done ? r2(e4.value) : (t4 = e4.value, t4 instanceof i3 ? t4 : new i3(function(e5) {
273
- e5(t4);
274
- })).then(o2, s2);
275
- }
276
- l2((a2 = a2.apply(e3, t3 || [])).next());
277
- });
278
- };
279
- Object.defineProperty(t2, "__esModule", { value: true });
280
- const r = i2(7057), n = i2(7544), o = i2(3665), s = i2(9256), l = i2(2313), d = i2(317), c = i2(6471);
281
- t2.default = function() {
282
- const e3 = new o.Config();
283
- let t3 = new s.Log(e3);
284
- return { init: function(i3) {
285
- "boolean" == typeof (null == i3 ? void 0 : i3.debug) && e3.set("debug", i3.debug), "boolean" == typeof (null == i3 ? void 0 : i3.dryRun) && e3.set("dryRun", i3.dryRun), (null == i3 ? void 0 : i3.lang) && e3.set("lang", (0, c.normalizeSurveyLang)(i3.lang)), e3.set("url", (null == i3 ? void 0 : i3.env) && "dev" === (null == i3 ? void 0 : i3.env) ? d.HOST_API_URL_DEV : d.HOST_API_URL), e3.set("env", null == i3 ? void 0 : i3.env), t3.log("Initialized Magicfeedback", e3);
286
- }, send: function(i3, r2, n2, o2 = true, s2, d2) {
287
- var u;
288
- return a(this, void 0, void 0, function* () {
289
- i3 || t3.err("No appID provided"), r2 || t3.err("No publicKey provided"), n2 || t3.err("No feedback provided"), n2.answers || n2.profile || n2.metrics || n2.metadata || t3.err("No feedback data provided");
290
- const a2 = e3.get("url"), p = { integration: i3, publicKey: r2, privateKey: d2, completed: o2, id: s2, feedback: n2, lang: null !== (u = (0, c.detectSurveyLang)(e3.get("lang"))) && void 0 !== u ? u : void 0 };
291
- try {
292
- if (e3.get("dryRun")) return t3.log("Dry run enabled: skipping native feedback submit"), `dry-run-${Date.now()}`;
293
- const i4 = yield (0, l.sendFeedback)(a2, p, t3);
294
- return t3.log("sent native feedback"), i4;
295
- } catch (e4) {
296
- return t3.err("error native feedback", e4), false;
297
- }
298
- });
299
- }, form: function(i3, a2, n2, o2) {
300
- return i3 || t3.err("No appID provided"), a2 || t3.err("No publicKey provided"), new r.Form(e3, i3, a2, n2, o2);
301
- }, agentForm: function(i3, a2, r2) {
302
- return i3 || t3.err("No integrationId provided"), a2 || t3.err("No publicKey provided"), new n.AgentForm(e3, i3, a2, r2);
303
- }, session: function(i3) {
304
- return i3 || t3.err("No sessionId provided"), new r.Form(e3, i3);
305
- }, previewPage: function(i3, n2, o2) {
306
- return a(this, void 0, void 0, function* () {
307
- i3 || t3.err("No selector provided"), n2 && n2.page || t3.err("No page provided for preview");
308
- const a2 = (null == n2 ? void 0 : n2.appId) || `preview-${Date.now()}`, s2 = new r.Form(e3, a2);
309
- return yield s2.previewPage(i3, n2, o2), s2;
310
- });
311
- } };
312
- };
313
- }, 3079(e2, t2) {
314
- "use strict";
315
- t2.History = void 0, t2.History = class {
316
- constructor() {
317
- this.items = [];
318
- }
319
- enqueue(e3) {
320
- this.items.push(e3);
321
- }
322
- dequeue() {
323
- return this.items.shift();
324
- }
325
- rollback() {
326
- return this.items.pop();
327
- }
328
- front() {
329
- return this.items[0];
330
- }
331
- back() {
332
- return this.items[this.items.length - 1];
333
- }
334
- isEmpty() {
335
- return 0 === this.items.length;
336
- }
337
- size() {
338
- return this.items.length;
339
- }
340
- get(e3) {
341
- return this.items[e3];
342
- }
343
- };
344
- }, 7544(e2, t2, i2) {
345
- "use strict";
346
- var a = this && this.__awaiter || function(e3, t3, i3, a2) {
347
- return new (i3 || (i3 = Promise))(function(r2, n2) {
348
- function o2(e4) {
349
- try {
350
- l2(a2.next(e4));
351
- } catch (e5) {
352
- n2(e5);
353
- }
354
- }
355
- function s2(e4) {
356
- try {
357
- l2(a2.throw(e4));
358
- } catch (e5) {
359
- n2(e5);
360
- }
361
- }
362
- function l2(e4) {
363
- var t4;
364
- e4.done ? r2(e4.value) : (t4 = e4.value, t4 instanceof i3 ? t4 : new i3(function(e5) {
365
- e5(t4);
366
- })).then(o2, s2);
367
- }
368
- l2((a2 = a2.apply(e3, t3 || [])).next());
369
- });
370
- };
371
- Object.defineProperty(t2, "__esModule", { value: true }), t2.AgentForm = void 0;
372
- const r = i2(9256), n = i2(279), o = i2(7945), s = i2(7177), l = i2(3107), d = i2(4565), c = i2(5571), u = i2(7213), p = i2(881), m = i2(4039), h = i2(7321);
373
- t2.AgentForm = class {
374
- constructor(e3, t3, i3, a2) {
375
- this.config = e3, this.log = new r.Log(e3), this.url = e3.get("url"), this.integrationId = t3, this.publicKey = i3, this.privateKey = a2, this.formOptionsConfig = { addButton: true, addSuccessScreen: true, questionFormat: "standard", answerDelimiter: s.DEFAULT_ANSWER_DELIMITER, resume: true, allowBack: false, emptyAnswerText: "" }, this.selector = "", this.language = "en", this.product = { customIcons: false }, this.integrationData = null, this.started = false, this.sessionId = "", this.conversation = [], this.askedRefs = [], this.currentTurn = 1, this.maxTurns = 0, this.currentQuestion = null, this.questionHistory = [], this.busy = false, this.rateLimitTimer = null, this.progress = 0, this.total = 0, this.completed = false, this.timeToCompleted = 0;
376
- }
377
- generate(e3, t3 = {}) {
378
- var i3, r2;
379
- return a(this, void 0, void 0, function* () {
380
- this.formOptionsConfig = Object.assign(Object.assign({}, this.formOptionsConfig), t3), this.selector = e3, t3.lang && (this.language = t3.lang), t3.primaryColor && (this.primaryColor = t3.primaryColor);
381
- const a2 = false === this.formOptionsConfig.resume || this.isPreview() ? null : this.restore(), n2 = null === (r2 = null === (i3 = this.integrationData) || void 0 === i3 ? void 0 : i3.style) || void 0 === r2 ? void 0 : r2.startMessage;
382
- if (a2 || !n2) yield this.open(a2);
383
- else try {
384
- this.renderWelcome(n2);
385
- } catch (e4) {
386
- this.log.err(`Could not show the introduction of ${this.integrationId}:`, e4), this.formOptionsConfig.onLoadedEvent && (yield this.formOptionsConfig.onLoadedEvent({ loading: false, error: e4 }));
387
- }
388
- });
389
- }
390
- startForm() {
391
- return a(this, void 0, void 0, function* () {
392
- this.started || (yield this.open(null));
393
- });
394
- }
395
- renderWelcome(e3) {
396
- var t3;
397
- const i3 = (0, d.generateContainer)(this.selector, this.integrationId);
398
- this.primaryColor && (0, d.applyPrimaryColor)(i3, this.primaryColor), (0, d.applyDirection)(i3, this.language), i3.appendChild((0, u.renderStartMessage)(e3, this.formOptionsConfig.addButton, this.formOptionsConfig.startButtonText || (0, p.t)(this.language, "action.start"), () => this.startForm())), this.formOptionsConfig.onLoadedEvent && this.formOptionsConfig.onLoadedEvent({ loading: false, formData: null !== (t3 = this.integrationData) && void 0 !== t3 ? t3 : void 0, lang: this.language });
399
- }
400
- open(e3) {
401
- var t3, i3, r2;
402
- return a(this, void 0, void 0, function* () {
403
- this.started = true;
404
- try {
405
- if (e3) this.log.log(`Resuming agent session ${e3.sessionId} at turn ${e3.currentTurn}`), this.mountForm(), this.renderStep();
406
- else {
407
- const e4 = yield this.startWithRetry();
408
- this.sessionId = e4.sessionId, this.maxTurns = e4.maxTurns, this.currentTurn = null !== (t3 = e4.currentTurn) && void 0 !== t3 ? t3 : 1, this.total = Math.max(this.maxTurns - 1, 0);
409
- const a2 = (0, s.toAgentStep)(e4, this.adapterContext());
410
- if (this.mountForm(), "END" === a2.kind) return yield this.renderEnd(a2), void (this.formOptionsConfig.onLoadedEvent && (yield this.formOptionsConfig.onLoadedEvent({ loading: false, progress: this.progress, total: this.total, sessionId: this.sessionId, formData: null !== (i3 = this.integrationData) && void 0 !== i3 ? i3 : void 0, lang: this.language, completed: true })));
411
- this.acceptQuestion(a2), this.renderStep(), this.persist();
412
- }
413
- this.timeToCompleted = Date.now(), this.formOptionsConfig.onLoadedEvent && (yield this.formOptionsConfig.onLoadedEvent({ loading: false, progress: this.progress, total: this.total, sessionId: this.sessionId, formData: null !== (r2 = this.integrationData) && void 0 !== r2 ? r2 : void 0, lang: this.language, formOptionsConfig: this.formOptionsConfig }));
414
- } catch (e4) {
415
- this.log.err(`Could not start the agent survey ${this.integrationId}:`, e4), this.renderFatal(e4), this.formOptionsConfig.onLoadedEvent && (yield this.formOptionsConfig.onLoadedEvent({ loading: false, error: e4 }));
416
- }
417
- });
418
- }
419
- next() {
420
- return a(this, void 0, void 0, function* () {
421
- return this.runTurn();
422
- });
423
- }
424
- answer() {
425
- const e3 = document.getElementById(this.formId());
426
- return e3 ? (0, l.scrapeInputs)(e3) : [];
427
- }
428
- getConversation() {
429
- return [...this.conversation];
430
- }
431
- getSessionId() {
432
- return this.sessionId;
433
- }
434
- reset() {
435
- this.sessionId = "", this.conversation = [], this.askedRefs = [], this.currentTurn = 1, this.maxTurns = 0, this.currentQuestion = null, this.questionHistory = [], this.busy = false, this.completed = false, this.progress = 0, this.clearRateLimitTimer(), this.clearPersisted();
436
- }
437
- runTurn() {
438
- var e3;
439
- return a(this, void 0, void 0, function* () {
440
- if (this.busy || this.completed || !this.currentQuestion) return;
441
- (0, h.cancelAutoAdvance)(document.getElementById(this.questionsId())), this.busy = true, this.setSubmitDisabled(true), this.clearError();
442
- const t3 = this.currentQuestion;
443
- try {
444
- const i3 = document.getElementById(this.formId()), a2 = document.getElementById(this.questionsId());
445
- if (!i3) throw new Error("Agent form not found");
446
- yield (0, c.awaitUploadReady)(a2);
447
- const r2 = (0, l.scrapeInputs)(i3);
448
- let n2 = (0, s.encodeAnswer)(r2, t3, this.formOptionsConfig.answerDelimiter);
449
- if ("" === n2) {
450
- if (t3.require) return void this.showError(this.formOptionsConfig.requiredMessage || (0, p.t)(this.language, "message.required"));
451
- n2 = this.formOptionsConfig.emptyAnswerText || "";
452
- }
453
- this.formOptionsConfig.beforeSubmitEvent && (yield this.formOptionsConfig.beforeSubmitEvent({ loading: true, progress: this.progress, total: this.total }));
454
- const d2 = { role: "user", content: n2, questionType: t3.type, questionRef: t3.ref }, u2 = this.currentTurn + 1, m2 = yield (0, o.nextAgentTurn)(this.url, Object.assign({ publicKey: this.publicKey, privateKey: this.privateKey, integrationId: this.integrationId, sessionId: this.sessionId, conversation: [...this.conversation], currentTurn: u2, lastAnswer: n2, lastQuestionRef: t3.ref, askedRefs: [...this.askedRefs] }, this.previewFlag()), this.log);
455
- this.conversation.push(d2), this.currentTurn = null !== (e3 = m2.currentTurn) && void 0 !== e3 ? e3 : u2, m2.maxTurns && (this.maxTurns = m2.maxTurns), this.total = Math.max(this.maxTurns - 1, 0);
456
- const h2 = (0, s.toAgentStep)(m2, this.adapterContext());
457
- if ("END" === h2.kind) return void (yield this.renderEnd(h2));
458
- if (this.maxTurns > 0 && this.currentTurn > this.maxTurns + 1) return void (yield this.renderEnd({ kind: "END", reason: "MAX_TURNS", currentTurn: this.currentTurn, maxTurns: this.maxTurns }));
459
- this.acceptQuestion(h2), this.renderStep(), this.persist(), this.formOptionsConfig.onAgentTurnEvent && (yield this.formOptionsConfig.onAgentTurnEvent({ turn: this.currentTurn, maxTurns: this.maxTurns, question: h2.question, isFromBase: h2.isFromBase, topic: h2.topic, coverageGaps: h2.coverageGaps, coverageSummary: h2.coverageSummary, conversation: this.getConversation() })), this.formOptionsConfig.afterSubmitEvent && (yield this.formOptionsConfig.afterSubmitEvent({ response: this.sessionId, loading: false, progress: this.progress, total: this.total, completed: false, error: null }));
460
- } catch (e4) {
461
- yield this.handleTurnError(e4);
462
- } finally {
463
- this.completed || (this.busy = false, this.rateLimitTimer || this.setSubmitDisabled(false));
464
- }
465
- });
466
- }
467
- handleTurnError(e3) {
468
- return a(this, void 0, void 0, function* () {
469
- this.log.err(`An error occurred during the agent turn ${this.integrationId}:`, e3), e3 instanceof n.AgentApiError && "RATE_LIMITED" === e3.kind ? this.startRateLimitCountdown(e3.retryAfterMs || 6e4) : this.showError(this.errorMessageFor(e3)), this.formOptionsConfig.afterSubmitEvent && (yield this.formOptionsConfig.afterSubmitEvent({ loading: false, progress: this.progress, total: this.total, completed: false, error: e3 }));
470
- });
471
- }
472
- acceptQuestion(e3) {
473
- const t3 = e3.question;
474
- e3.isFromBase && t3.ref && !this.askedRefs.includes(t3.ref) && this.askedRefs.push(t3.ref), this.conversation.push({ role: "agent", content: t3.title, questionType: t3.type, questionRef: t3.ref }), this.currentQuestion = t3, this.questionHistory.push(t3), this.progress = Math.max(this.currentTurn - 1, 0);
475
- }
476
- formId() {
477
- return "magicfeedback-agent-" + this.integrationId;
478
- }
479
- questionsId() {
480
- return "magicfeedback-agent-questions-" + this.integrationId;
481
- }
482
- mountForm() {
483
- const e3 = (0, d.generateContainer)(this.selector, this.integrationId);
484
- this.primaryColor && (0, d.applyPrimaryColor)(e3, this.primaryColor), (0, d.applyDirection)(e3, this.language);
485
- const t3 = document.createElement("form");
486
- t3.classList.add("magicfeedback-form"), t3.classList.add("magicfeedback-agent-form"), t3.id = this.formId(), t3.addEventListener("submit", (e4) => {
487
- e4.preventDefault(), this.runTurn();
488
- });
489
- const i3 = document.createElement("div");
490
- i3.classList.add("magicfeedback-questions"), i3.id = this.questionsId(), t3.appendChild(i3), this.formOptionsConfig.addButton && t3.appendChild((0, u.renderActions)(this.formOptionsConfig.allowBack ? "MAGICSURVEY" : "MAGICFORM", () => this.back(), this.formOptionsConfig.sendButtonText || (0, p.t)(this.language, "action.send"), this.formOptionsConfig.backButtonText || (0, p.t)(this.language, "action.back"), this.formOptionsConfig.nextButtonText || (0, p.t)(this.language, "action.next"))), e3.appendChild(t3);
491
- }
492
- renderStep() {
493
- const e3 = document.getElementById(this.questionsId());
494
- e3 && this.currentQuestion && (e3.innerHTML = "", (0, u.renderQuestions)([this.currentQuestion], this.formOptionsConfig.questionFormat, this.language, this.product, () => this.runTurn()).forEach((t3) => e3.appendChild(t3)), (0, m.armGhostTapGuard)(e3));
495
- }
496
- renderEnd(e3) {
497
- return a(this, void 0, void 0, function* () {
498
- this.completed = true, this.currentQuestion = null, this.busy = false, this.timeToCompleted = this.timeToCompleted ? Date.now() - this.timeToCompleted : 0, this.clearRateLimitTimer(), this.clearPersisted();
499
- const t3 = document.getElementById("magicfeedback-container-" + this.integrationId);
500
- if (t3 && false !== this.formOptionsConfig.addSuccessScreen) {
501
- t3.innerHTML = "";
502
- const i3 = "BLOCKED" === e3.reason ? this.formOptionsConfig.blockedMessage || (0, p.t)(this.language, "message.blocked") : this.formOptionsConfig.successMessage || (0, p.t)(this.language, "message.success"), a2 = (0, u.renderSuccess)(i3);
503
- a2.classList.add("magicfeedback-success-message"), a2.classList.add("magicfeedback-agent-end"), "BLOCKED" === e3.reason && a2.classList.add("magicfeedback-agent-end--blocked"), t3.appendChild(a2);
504
- }
505
- this.formOptionsConfig.onFinishEvent && (yield this.formOptionsConfig.onFinishEvent({ sessionId: this.sessionId, reason: e3.reason, turns: this.currentTurn, maxTurns: this.maxTurns, conversation: this.getConversation(), coverageSummary: e3.coverageSummary, timeToCompleted: this.timeToCompleted })), this.formOptionsConfig.afterSubmitEvent && (yield this.formOptionsConfig.afterSubmitEvent({ response: this.sessionId, loading: false, progress: this.progress, total: this.total, completed: true, error: null }));
506
- });
507
- }
508
- back() {
509
- return a(this, void 0, void 0, function* () {
510
- this.busy || this.completed || this.formOptionsConfig.allowBack && (this.questionHistory.length < 2 || (this.questionHistory.pop(), this.conversation.pop(), this.conversation.pop(), this.currentQuestion = this.questionHistory[this.questionHistory.length - 1], this.currentTurn = Math.max(this.currentTurn - 1, 1), this.progress = Math.max(this.currentTurn - 1, 0), this.clearError(), this.renderStep(), this.persist(), this.formOptionsConfig.onBackEvent && (yield this.formOptionsConfig.onBackEvent({ progress: this.progress, total: this.total }))));
511
- });
512
- }
513
- renderFatal(e3) {
514
- try {
515
- (0, d.generateContainer)(this.selector, this.integrationId).appendChild((0, u.renderError)(this.errorMessageFor(e3)));
516
- } catch (e4) {
517
- }
518
- }
519
- errorMessageFor(e3) {
520
- if (!(e3 instanceof n.AgentApiError)) return "Something went wrong. Please try again.";
521
- switch (e3.kind) {
522
- case "AUTH":
523
- case "NOT_FOUND":
524
- case "BAD_CONFIG":
525
- return "This survey is not available right now.";
526
- case "AI_UNAVAILABLE":
527
- return "We couldn't start the survey. Please try again in a moment.";
528
- default:
529
- return "Something went wrong. Please try again.";
530
- }
531
- }
532
- adapterContext() {
533
- return { integrationId: this.integrationId, sessionId: this.sessionId, language: this.language, log: this.log };
534
- }
535
- startWithRetry() {
536
- return a(this, void 0, void 0, function* () {
537
- const e3 = Object.assign({ publicKey: this.publicKey, privateKey: this.privateKey, integrationId: this.integrationId }, this.previewFlag());
538
- try {
539
- return yield (0, o.startAgentSurvey)(this.url, e3, this.log);
540
- } catch (t3) {
541
- if (t3 instanceof n.AgentApiError && "AI_UNAVAILABLE" === t3.kind) return this.log.log("Retrying /start after a transient AI failure"), yield new Promise((e4) => setTimeout(e4, 1500)), yield (0, o.startAgentSurvey)(this.url, e3, this.log);
542
- throw t3;
543
- }
544
- });
545
- }
546
- setSubmitDisabled(e3) {
547
- const t3 = document.getElementById("magicfeedback-submit");
548
- t3 && (t3.disabled = e3);
549
- }
550
- clearError() {
551
- const e3 = document.getElementById(this.questionsId());
552
- null == e3 || e3.querySelectorAll(".magicfeedback-error").forEach((e4) => e4.remove());
553
- }
554
- showError(e3) {
555
- const t3 = document.getElementById(this.questionsId());
556
- t3 && (this.clearError(), t3.insertBefore((0, u.renderError)(e3), t3.firstChild));
557
- }
558
- startRateLimitCountdown(e3) {
559
- this.clearRateLimitTimer(), this.setSubmitDisabled(true);
560
- let t3 = Math.ceil(e3 / 1e3);
561
- const i3 = this.formOptionsConfig.rateLimitMessage || (0, p.t)(this.language, "message.rateLimit"), a2 = () => {
562
- if (t3 <= 0) return this.clearRateLimitTimer(), this.clearError(), void this.setSubmitDisabled(false);
563
- this.showError(i3.replace("{seconds}", String(t3))), t3 -= 1;
564
- };
565
- a2(), this.rateLimitTimer = setInterval(a2, 1e3);
566
- }
567
- clearRateLimitTimer() {
568
- this.rateLimitTimer && (clearInterval(this.rateLimitTimer), this.rateLimitTimer = null);
569
- }
570
- storageKey() {
571
- return `magicfeedback-agent-${this.integrationId}`;
572
- }
573
- isPreview() {
574
- return Boolean(this.config.get("dryRun"));
575
- }
576
- previewFlag() {
577
- return this.isPreview() ? { preview: true } : {};
578
- }
579
- persist() {
580
- if (!this.isPreview() && false !== this.formOptionsConfig.resume) try {
581
- const e3 = { sessionId: this.sessionId, conversation: this.conversation, currentTurn: this.currentTurn, maxTurns: this.maxTurns, askedRefs: this.askedRefs, questionHistory: this.questionHistory, savedAt: Date.now() };
582
- localStorage.setItem(this.storageKey(), JSON.stringify(e3));
583
- } catch (e3) {
584
- this.log.log("Could not persist the agent session", e3);
585
- }
586
- }
587
- restore() {
588
- var e3;
589
- try {
590
- const t3 = localStorage.getItem(this.storageKey());
591
- if (!t3) return null;
592
- const i3 = JSON.parse(t3);
593
- return (null == i3 ? void 0 : i3.sessionId) && (null === (e3 = i3.questionHistory) || void 0 === e3 ? void 0 : e3.length) ? Date.now() - (i3.savedAt || 0) > 18e5 ? (this.clearPersisted(), null) : (this.sessionId = i3.sessionId, this.conversation = i3.conversation || [], this.currentTurn = i3.currentTurn || 1, this.maxTurns = i3.maxTurns || 0, this.askedRefs = i3.askedRefs || [], this.questionHistory = i3.questionHistory, this.currentQuestion = this.questionHistory[this.questionHistory.length - 1], this.total = Math.max(this.maxTurns - 1, 0), this.progress = Math.max(this.currentTurn - 1, 0), i3) : null;
594
- } catch (e4) {
595
- return this.log.log("Could not restore the agent session", e4), null;
596
- }
597
- }
598
- clearPersisted() {
599
- try {
600
- localStorage.removeItem(this.storageKey());
601
- } catch (e3) {
602
- }
603
- }
604
- applyIntegrationContext(e3) {
605
- var t3, i3;
606
- this.integrationData = e3, (null === (t3 = null == e3 ? void 0 : e3.lang) || void 0 === t3 ? void 0 : t3.length) && (this.language = e3.lang[0]), (null == e3 ? void 0 : e3.product) && (this.product = e3.product), (null === (i3 = null == e3 ? void 0 : e3.style) || void 0 === i3 ? void 0 : i3.primaryColor) && (this.primaryColor = e3.style.primaryColor);
607
- }
608
- };
609
- }, 3665(e2, t2) {
610
- "use strict";
611
- t2.Config = void 0, t2.Config = class {
612
- constructor() {
613
- this.variables = {}, this.variables.env = "prod", this.variables.debug = false, this.variables.dryRun = false;
614
- }
615
- get(e3) {
616
- return this.variables[e3];
617
- }
618
- set(e3, t3) {
619
- this.variables[e3] = t3;
620
- }
621
- };
622
- }, 7057(e2, t2, i2) {
623
- "use strict";
624
- var a = this && this.__awaiter || function(e3, t3, i3, a2) {
625
- return new (i3 || (i3 = Promise))(function(r2, n2) {
626
- function o2(e4) {
627
- try {
628
- l2(a2.next(e4));
629
- } catch (e5) {
630
- n2(e5);
631
- }
632
- }
633
- function s2(e4) {
634
- try {
635
- l2(a2.throw(e4));
636
- } catch (e5) {
637
- n2(e5);
638
- }
639
- }
640
- function l2(e4) {
641
- var t4;
642
- e4.done ? r2(e4.value) : (t4 = e4.value, t4 instanceof i3 ? t4 : new i3(function(e5) {
643
- e5(t4);
644
- })).then(o2, s2);
645
- }
646
- l2((a2 = a2.apply(e3, t3 || [])).next());
647
- });
648
- };
649
- Object.defineProperty(t2, "__esModule", { value: true }), t2.Form = void 0;
650
- const r = i2(5558), n = i2(7544), o = i2(9256), s = i2(2313), l = i2(7213), d = i2(5571), c = i2(4565), u = i2(3107), p = i2(1989), m = i2(9700), h = i2(2591), f = i2(3079), g = i2(4636), y = i2(881), v = i2(6471), b = i2(4039), E = i2(2195), k = i2(7321), A = i2(5146), T = [r.FEEDBACKAPPANSWERTYPE.INFO_PAGE, r.FEEDBACKAPPANSWERTYPE.PASSWORD, r.FEEDBACKAPPANSWERTYPE.EMAIL, r.FEEDBACKAPPANSWERTYPE.CONTACT, r.FEEDBACKAPPANSWERTYPE.UPLOAD_FILE, r.FEEDBACKAPPANSWERTYPE.UPLOAD_IMAGE, r.FEEDBACKAPPANSWERTYPE.MAX_DIFF];
651
- t2.Form = class {
652
- constructor(e3, t3, i3, a2, r2) {
653
- this.invalidEmail = false, this.urlAutoAdvanceChecked = false, this.config = e3, this.log = new o.Log(e3), this.formOptionsConfig = { addButton: true, addSuccessScreen: true, getMetaData: true, customMetaData: [], questionFormat: "standard" }, this.selector = "", this.appId = t3, this.publicKey = i3 || "", this.url = e3.get("url"), this.id = "", this.formData = null, this.activeLang = null, this.feedback = { text: "", answers: [], profile: null != a2 ? a2 : [], metrics: [], metadata: null != r2 ? r2 : [] }, this.history = new f.History(), this.agentForm = null, this.graph = new p.PageGraph([]), this.progress = 0, this.total = 0, this.completed = false, this.sending = false, this.timeToCompleted = 0;
654
- }
655
- generate(e3, t3) {
656
- var i3, r2, o2, l2, d2, c2, u2;
657
- return a(this, void 0, void 0, function* () {
658
- try {
659
- this.formOptionsConfig = Object.assign(Object.assign({}, this.formOptionsConfig), t3), this.selector = e3;
660
- let a2 = this.formData;
661
- const p2 = (0, v.detectSurveyLang)((null == t3 ? void 0 : t3.lang) || this.config.get("lang"));
662
- if (void 0 !== this.formData && this.formData || (a2 = "" !== this.publicKey ? yield (0, s.getForm)(this.url, this.appId, this.publicKey, this.log, p2) : yield (0, s.getSessionForm)(this.url, this.appId, this.log, p2)), void 0 === a2 || !a2) throw new Error(`No data for app ${this.appId}`);
663
- if (null === (i3 = a2.error) || void 0 === i3 ? void 0 : i3.message) throw new Error(a2.error.message);
664
- if ("AGENT" === a2.mode) return this.agentForm = new n.AgentForm(this.config, this.appId, this.publicKey), this.agentForm.applyIntegrationContext(a2), void (yield this.agentForm.generate(e3, t3));
665
- if (a2.questions = (null === (r2 = a2.questions) || void 0 === r2 ? void 0 : r2.filter((e4) => "ACTIVE" === e4.status)) || [], a2.pages = (null === (o2 = a2.pages) || void 0 === o2 ? void 0 : o2.filter((e4) => "ACTIVE" === e4.status)) || [], null === (l2 = a2.pages) || void 0 === l2 || l2.forEach((e4) => {
666
- var t4;
667
- return e4.integrationQuestions = null === (t4 = e4.integrationQuestions) || void 0 === t4 ? void 0 : t4.filter((e5) => "ACTIVE" === e5.status);
668
- }), this.formData = a2, this.activeLang = this.resolveActiveLang(p2), !this.formData.savedAt) {
669
- this.formData.savedAt = /* @__PURE__ */ new Date();
670
- try {
671
- localStorage.setItem(`magicfeedback-${this.appId}-${this.lang()}`, JSON.stringify(this.formData));
672
- } catch (e4) {
673
- this.log.log("Could not cache the form data", e4);
674
- }
675
- }
676
- if (void 0 === this.formData.questions || !this.formData.questions) throw new Error(`No questions for app ${this.appId}`);
677
- this.formData.pages && 0 !== (null === (d2 = this.formData.pages) || void 0 === d2 ? void 0 : d2.length) || this.formatPages(), null === (c2 = this.formData.questions) || void 0 === c2 || c2.sort((e4, t4) => e4.position - t4.position), this.formData.pages = this.formData.pages.filter((e4) => {
678
- var t4;
679
- return (null === (t4 = e4.integrationQuestions) || void 0 === t4 ? void 0 : t4.length) > 0;
680
- }), this.formOptionsConfig.getMetaData && this.getMetaData(), (null === (u2 = this.formData.style) || void 0 === u2 ? void 0 : u2.startMessage) ? yield this.generateWelcomeMessage(this.formData.style.startMessage) : this.generateForm("open");
681
- } catch (e4) {
682
- return this.log.err(e4), void (this.formOptionsConfig.onLoadedEvent && (yield this.formOptionsConfig.onLoadedEvent({ loading: false, error: e4 })));
683
- }
684
- });
685
- }
686
- previewPage(e3, t3, i3 = {}) {
687
- var r2, n2, o2, s2, l2, d2, c2, u2, p2;
688
- return a(this, void 0, void 0, function* () {
689
- try {
690
- if (!t3 || !t3.page) throw new Error("[MagicFeedback] No page provided for preview");
691
- if (!t3.page.integrationQuestions || 0 === t3.page.integrationQuestions.length) throw new Error("[MagicFeedback] No questions provided for preview");
692
- this.config.set("dryRun", true), this.formOptionsConfig = Object.assign(Object.assign(Object.assign({}, this.formOptionsConfig), { getMetaData: false }), i3), this.selector = e3;
693
- const a2 = (t3.page.integrationQuestions || []).filter((e4) => !e4.status || "ACTIVE" === e4.status).sort((e4, t4) => e4.position - t4.position), h2 = new m.Page(null !== (r2 = t3.page.id) && void 0 !== r2 ? r2 : "1", null !== (n2 = t3.page.position) && void 0 !== n2 ? n2 : 1, null !== (o2 = t3.appId) && void 0 !== o2 ? o2 : this.appId, a2, null !== (s2 = t3.page.integrationPageRoutes) && void 0 !== s2 ? s2 : []);
694
- this.formData = { id: null !== (l2 = t3.appId) && void 0 !== l2 ? l2 : this.appId, identity: null !== (d2 = t3.identity) && void 0 !== d2 ? d2 : "MAGICFORM", lang: [null !== (c2 = t3.lang) && void 0 !== c2 ? c2 : "en"], product: null !== (u2 = t3.product) && void 0 !== u2 ? u2 : { customIcons: false }, style: null !== (p2 = t3.style) && void 0 !== p2 ? p2 : {}, questions: a2, pages: [h2] }, yield this.generateForm();
695
- } catch (e4) {
696
- return this.log.err(e4), void (this.formOptionsConfig.onLoadedEvent && (yield this.formOptionsConfig.onLoadedEvent({ loading: false, error: e4 })));
697
- }
698
- });
699
- }
700
- formatPages() {
701
- var e3;
702
- if (this.formData) switch (this.formData.identity) {
703
- case "MAGICSURVEY":
704
- this.formData.pages = [], null === (e3 = this.formData.questions) || void 0 === e3 || e3.forEach((e4) => {
705
- var t4, i3;
706
- const a2 = new h.PageRoute(e4.id, e4.ref, h.OperatorType.NOEQUAL, [], h.TransitionType.PAGE, (e4.position + 1).toString(), e4.position.toString()), r2 = new m.Page(e4.position.toString(), e4.position, this.appId, [e4], [a2]);
707
- null === (i3 = null === (t4 = this.formData) || void 0 === t4 ? void 0 : t4.pages) || void 0 === i3 || i3.push(r2);
708
- });
709
- break;
710
- case "MAGICFORM":
711
- const t3 = new m.Page("1", 1, this.appId, this.formData.questions, []);
712
- this.formData.pages = [t3];
713
- }
714
- }
715
- generateContainer() {
716
- var e3, t3;
717
- const i3 = (0, c.generateContainer)(this.selector, this.appId), a2 = null === (t3 = null === (e3 = this.formData) || void 0 === e3 ? void 0 : e3.style) || void 0 === t3 ? void 0 : t3.primaryColor;
718
- return a2 && (0, c.applyPrimaryColor)(i3, a2), (0, c.applyDirection)(i3, this.lang()), i3;
719
- }
720
- generateForm(e3 = "open") {
721
- var t3, i3, r2;
722
- return a(this, void 0, void 0, function* () {
723
- try {
724
- if (!this.formData || !this.formData.pages || 0 === this.formData.pages.length) throw new Error("No form data");
725
- this.graph = new p.PageGraph(this.formData.pages.sort((e4, t4) => e4.position - t4.position));
726
- let a2 = this.generateContainer();
727
- const n2 = document.createElement("form");
728
- n2.classList.add("magicfeedback-form"), n2.id = "magicfeedback-" + this.appId, n2.addEventListener("submit", (e4) => e4.preventDefault());
729
- const o2 = document.createElement("div");
730
- o2.classList.add("magicfeedback-questions"), o2.id = "magicfeedback-questions-" + this.appId;
731
- const s2 = this.graph.getFirstPage();
732
- if (!s2) throw new Error("No page found");
733
- if (this.total = this.graph.findMaxDepth(), s2.elements = (0, l.renderQuestions)(s2.questions, this.formOptionsConfig.questionFormat, this.lang(), null === (t3 = this.formData) || void 0 === t3 ? void 0 : t3.product, () => this.autoSend()), null === (i3 = s2.elements) || void 0 === i3 || i3.forEach((e4) => o2.appendChild(e4)), n2.appendChild(o2), (0, b.armGhostTapGuard)(o2), this.history.enqueue(s2), a2.appendChild(n2), this.progress = this.total - this.graph.findMaxDepth(s2), this.formOptionsConfig.addButton) {
734
- const e4 = (0, l.renderActions)(null === (r2 = this.formData) || void 0 === r2 ? void 0 : r2.identity, () => this.back(), this.formOptionsConfig.sendButtonText || (0, y.t)(this.lang(), "action.send"), this.formOptionsConfig.backButtonText || (0, y.t)(this.lang(), "action.back"), this.formOptionsConfig.nextButtonText || (0, y.t)(this.lang(), "action.next"));
735
- n2.appendChild(e4), this.syncBackButton();
736
- }
737
- this.formOptionsConfig.addButton && n2.addEventListener("submit", (e4) => {
738
- e4.preventDefault(), this.send();
739
- }), this.timeToCompleted = Date.now();
740
- const d2 = this.autoAdvanceFromUrl(o2, s2);
741
- if (d2 && (o2.style.visibility = "hidden"), this.formOptionsConfig.onLoadedEvent && (yield this.formOptionsConfig.onLoadedEvent({ loading: d2, autoAdvancing: d2, progress: this.progress, total: this.total, formData: this.formData, lang: this.lang(), formOptionsConfig: this.formOptionsConfig })), d2) return void (yield this.autoSend());
742
- this.autofocusAfterRender(e3);
743
- } catch (e4) {
744
- return this.log.err(e4), void (this.formOptionsConfig.onLoadedEvent && this.formOptionsConfig.onLoadedEvent({ loading: false, error: e4 }));
745
- }
746
- });
747
- }
748
- autoAdvanceFromUrl(e3, t3) {
749
- return !(this.urlAutoAdvanceChecked || (this.urlAutoAdvanceChecked = true, !(0, k.autoAdvanceRequested)() || 1 !== t3.questions.length || !(0, k.answeredInput)(e3, t3.questions[0].ref)));
750
- }
751
- startForm() {
752
- this.agentForm ? this.agentForm.startForm() : this.generateForm("navigation");
753
- }
754
- focusFirstQuestion() {
755
- return "undefined" != typeof document && (0, E.focusFirstTextQuestion)(document.getElementById("magicfeedback-questions-" + this.appId));
756
- }
757
- autofocusAfterRender(e3) {
758
- const t3 = this.formOptionsConfig.autofocus;
759
- t3 && ("open" === e3 && "always" !== t3 || this.focusFirstQuestion());
760
- }
761
- lang() {
762
- var e3;
763
- return this.activeLang || (null === (e3 = this.formData) || void 0 === e3 ? void 0 : e3.lang) && this.formData.lang[0] || "en";
764
- }
765
- getLang() {
766
- return this.lang();
767
- }
768
- resolveActiveLang(e3) {
769
- var t3, i3;
770
- const a2 = (null === (t3 = this.formData) || void 0 === t3 ? void 0 : t3.lang) || [];
771
- return (null === (i3 = this.formData) || void 0 === i3 ? void 0 : i3.servedLang) ? this.formData.servedLang : e3 && a2.includes(e3) ? e3 : a2[0] || null;
772
- }
773
- generateWelcomeMessage(e3) {
774
- return a(this, void 0, void 0, function* () {
775
- try {
776
- const t3 = this.generateContainer(), i3 = (0, l.renderStartMessage)(e3, this.formOptionsConfig.addButton, this.formOptionsConfig.startButtonText || (0, y.t)(this.lang(), "action.start"), () => this.startForm());
777
- t3.appendChild(i3), this.formOptionsConfig.onLoadedEvent && (yield this.formOptionsConfig.onLoadedEvent({ loading: false, formData: this.formData, lang: this.lang() }));
778
- } catch (e4) {
779
- return this.log.err(e4), void (this.formOptionsConfig.onLoadedEvent && this.formOptionsConfig.onLoadedEvent({ loading: false, error: e4 }));
780
- }
781
- });
782
- }
783
- getMetaData() {
784
- this.formOptionsConfig.customMetaData && (this.feedback.metadata = [...this.feedback.metadata, ...this.formOptionsConfig.customMetaData]), this.feedback.metadata.push({ key: "navigator-url", value: [window.location.href] }), this.feedback.metadata.push({ key: "navigator-origin", value: [window.location.origin] }), this.feedback.metadata.push({ key: "navigator-pathname", value: [window.location.pathname] }), this.feedback.metadata.push({ key: "navigator-search", value: [window.location.search] });
785
- const e3 = new URLSearchParams(window.location.search);
786
- Array.from(new Set(e3.keys())).forEach((t3) => {
787
- const i3 = e3.getAll(t3);
788
- i3.length > 0 && this.feedback.metadata.push({ key: `query-${t3}`, value: i3 });
789
- }), this.feedback.metadata.push({ key: "navigator-user", value: [navigator.userAgent] }), this.feedback.metadata.push({ key: "navigator-language", value: [navigator.language] }), this.feedback.metadata.push({ key: "navigator-platform", value: [navigator.platform] }), this.feedback.metadata.push({ key: "navigator-appVersion", value: [navigator.appVersion] }), this.feedback.metadata.push({ key: "navigator-appName", value: [navigator.appName] }), this.feedback.metadata.push({ key: "navigator-product", value: [navigator.product] }), this.feedback.metadata.push({ key: "screen-width", value: [window.screen.width.toString()] }), this.feedback.metadata.push({ key: "screen-height", value: [window.screen.height.toString()] }), this.appId && "" === this.publicKey && this.feedback.metadata.push({ key: "MAGICFEEDBACK_SESSION", value: [this.appId] });
790
- }
791
- send(e3, t3, i3, n2) {
792
- var o2, s2;
793
- return a(this, void 0, void 0, function* () {
794
- if (this.agentForm) return this.agentForm.next();
795
- const a2 = document.getElementById("magicfeedback-questions-" + this.appId);
796
- (0, k.cancelAutoAdvance)(a2), this.sending = true;
797
- try {
798
- if (i3 && (this.feedback.profile = [...this.feedback.profile, ...i3]), t3 && (this.feedback.metrics = [...this.feedback.metrics, ...t3]), e3 && (this.feedback.metadata = [...this.feedback.metadata, ...e3]), n2) {
799
- this.feedback.answers = [...this.feedback.answers, ...n2], this.formOptionsConfig.beforeSubmitEvent && (yield this.formOptionsConfig.beforeSubmitEvent({ loading: true, progress: this.progress, total: this.total }));
800
- const e4 = yield this.pushAnswers(false);
801
- if (!e4) throw new A.SubmitError("SEND_FAILED", "No response");
802
- return this.id = e4, void (this.formOptionsConfig.afterSubmitEvent && (yield this.formOptionsConfig.afterSubmitEvent({ loading: false, progress: this.progress, total: this.total })));
803
- }
804
- if (yield (0, d.awaitUploadReady)(a2), this.answer(), this.formOptionsConfig.beforeSubmitEvent && (yield this.formOptionsConfig.beforeSubmitEvent({ loading: true, progress: this.progress, total: this.total })), this.invalidEmail) throw new A.SubmitError("INVALID_EMAIL", "Invalid email");
805
- const l2 = this.history.back();
806
- if (!l2) throw new A.SubmitError("NO_PAGE", "No page found");
807
- for (const e4 of l2.questions.filter((e5) => e5.require && ![r.FEEDBACKAPPANSWERTYPE.CONSENT, r.FEEDBACKAPPANSWERTYPE.INFO_PAGE].includes(e5.type))) {
808
- const t4 = e4.assets, i4 = this.feedback.answers.filter((t5) => t5.key.includes(e4.ref) && !t5.key.includes("extra-option"));
809
- if (0 === i4.length || i4.find((e5) => 0 === e5.value.length)) throw this.log.err(`The question ${e4.ref} is required`), new A.SubmitError("REQUIRED", "No response");
810
- if (null == t4 ? void 0 : t4.minOptions) {
811
- let a3 = [];
812
- if ((null == t4 ? void 0 : t4.exclusiveAnswers) && (a3 = null == t4 ? void 0 : t4.exclusiveAnswers), !i4[0].value.find((e5) => a3.includes(e5)) && i4[0].value.length < (null == t4 ? void 0 : t4.minOptions)) throw this.log.err(`The question ${e4.ref} requires at least ${null == t4 ? void 0 : t4.minOptions} options`), new A.SubmitError("REQUIRED", "No response");
813
- }
814
- if (e4.type === r.FEEDBACKAPPANSWERTYPE.MAX_DIFF) {
815
- const t5 = null !== (s2 = null === (o2 = e4.assets) || void 0 === o2 ? void 0 : o2.setIndex) && void 0 !== s2 ? s2 : 1, i5 = this.parseMaxDiffAnswer(this.feedback.answers.find((t6) => t6.key === e4.ref)).find((e5) => e5.set === t5);
816
- if (!(null == i5 ? void 0 : i5.best) || !(null == i5 ? void 0 : i5.worst)) throw this.log.err(`The MaxDiff question ${e4.ref} requires the most and the least important`), new A.SubmitError("REQUIRED", "No response");
817
- }
818
- if (e4.type === r.FEEDBACKAPPANSWERTYPE.MULTI_QUESTION_MATRIX) {
819
- const i5 = this.feedback.answers.find((t5) => t5.key === e4.ref);
820
- if (!i5) throw this.log.err(`The matrix question ${e4.ref} is required`), new A.SubmitError("REQUIRED", "No response");
821
- const a3 = this.parseMatrixAnswerPre(i5), r2 = Array.isArray(null == t4 ? void 0 : t4.options) ? t4.options : [];
822
- if (r2.length > 0) {
823
- if (r2.find((e5) => {
824
- const t5 = a3.find((t6) => t6.key === e5);
825
- return !t5 || !Array.isArray(t5.value) || 0 === t5.value.length;
826
- })) throw this.log.err(`The matrix question ${e4.ref} requires an answer in every row`), new A.SubmitError("REQUIRED", "No response");
827
- } else if (0 === a3.length || a3.some((e5) => !Array.isArray(e5.value) || 0 === e5.value.length)) throw this.log.err(`The matrix question ${e4.ref} requires an answer in every row`), new A.SubmitError("REQUIRED", "No response");
828
- }
829
- }
830
- const c2 = yield this.pushAnswers(false);
831
- if (!c2) throw new A.SubmitError("SEND_FAILED", "No response");
832
- this.id = c2, yield this.processNextQuestion(a2);
833
- } catch (e4) {
834
- this.log.err(`An error occurred while submitting the form ${this.appId}:`, e4), this.formOptionsConfig.afterSubmitEvent && (yield this.formOptionsConfig.afterSubmitEvent({ loading: false, progress: this.progress, total: this.total, error: e4 }));
835
- } finally {
836
- this.sending = false, null == a2 || a2.style.removeProperty("visibility");
837
- }
838
- });
839
- }
840
- autoSend() {
841
- if (!this.sending) return this.send();
842
- }
843
- answer() {
844
- const e3 = "magicfeedback-" + this.appId, t3 = document.getElementById(e3);
845
- if (!t3) return this.log.err(`Form "${e3}" not found.`), this.feedback.answers = [], [];
846
- const i3 = this.history.back();
847
- if (!i3) return this.feedback.answers = (0, u.scrapeInputs)(t3), this.feedback.answers;
848
- const a2 = [];
849
- let n2 = false;
850
- this.invalidEmail = false;
851
- const o2 = t3.querySelectorAll(".magicfeedback-input"), l2 = {}, c2 = {}, p2 = {}, m2 = {};
852
- if (o2.forEach((e4) => {
853
- var t4, o3;
854
- const u2 = e4, h3 = i3.questions.find((e5) => {
855
- var t5;
856
- return null === (t5 = u2.name) || void 0 === t5 ? void 0 : t5.includes(e5.ref);
857
- }), f2 = u2.type, g2 = u2.classList[0], y2 = { key: u2.name, value: [] }, v2 = "magicfeedback-consent" === g2 ? u2.checked.toString() : u2.value;
858
- if (y2.key && "" !== y2.key) if (y2.key.startsWith("extra-option-")) "" !== v2 && (y2.value.push(v2), a2.push(y2));
859
- else switch (null == h3 ? void 0 : h3.type) {
860
- case r.FEEDBACKAPPANSWERTYPE.EMAIL:
861
- case r.FEEDBACKAPPANSWERTYPE.TEXT:
862
- case r.FEEDBACKAPPANSWERTYPE.LONGTEXT:
863
- case r.FEEDBACKAPPANSWERTYPE.NUMBER:
864
- case r.FEEDBACKAPPANSWERTYPE.DATE:
865
- case r.FEEDBACKAPPANSWERTYPE.CONTACT:
866
- case r.FEEDBACKAPPANSWERTYPE.PASSWORD:
867
- "" !== v2 && ("email" === f2 ? (0, s.validateEmail)(v2) ? (this.feedback.profile.push({ key: "email", value: [v2] }), y2.value.push(v2), a2.push(y2)) : (this.log.err("Invalid email"), n2 = true, this.invalidEmail = true) : (y2.value.push(v2), a2.push(y2)));
868
- break;
869
- case r.FEEDBACKAPPANSWERTYPE.RADIO:
870
- u2.checked && (y2.value.push(v2), a2.push(y2));
871
- break;
872
- case r.FEEDBACKAPPANSWERTYPE.MULTIPLECHOICE:
873
- case r.FEEDBACKAPPANSWERTYPE.MULTIPLECHOISE_IMAGE:
874
- u2.checked && (c2[y2.key] || (c2[y2.key] = []), c2[y2.key].push(v2));
875
- break;
876
- case r.FEEDBACKAPPANSWERTYPE.BOOLEAN:
877
- u2.checked && (y2.value.push(v2), a2.push(y2));
878
- break;
879
- case r.FEEDBACKAPPANSWERTYPE.CONSENT:
880
- y2.value.push(u2.checked.toString()), a2.push(y2);
881
- break;
882
- case r.FEEDBACKAPPANSWERTYPE.RATING_EMOJI:
883
- case r.FEEDBACKAPPANSWERTYPE.RATING_NUMBER:
884
- case r.FEEDBACKAPPANSWERTYPE.RATING_STAR:
885
- u2.checked && (y2.value.push(v2), a2.push(y2));
886
- break;
887
- case r.FEEDBACKAPPANSWERTYPE.SELECT:
888
- "" !== v2 && (y2.value.push(v2), a2.push(y2));
889
- break;
890
- case r.FEEDBACKAPPANSWERTYPE.POINT_SYSTEM:
891
- "number" === f2 && u2.id && (p2[y2.key] || (p2[y2.key] = []), "" !== v2 && p2[y2.key].push(`${u2.id}:${v2}%`));
892
- break;
893
- case r.FEEDBACKAPPANSWERTYPE.PRIORITY_LIST:
894
- "hidden" === f2 && (l2[y2.key] || (l2[y2.key] = []), l2[y2.key].push(v2));
895
- break;
896
- case r.FEEDBACKAPPANSWERTYPE.MULTI_QUESTION_MATRIX:
897
- e4.checked && (y2.value.push(v2), a2.push(y2));
898
- break;
899
- case r.FEEDBACKAPPANSWERTYPE.MAX_DIFF: {
900
- if ("radio" !== f2 || !h3) break;
901
- const e5 = y2.key === `${h3.ref}-best` ? "best" : y2.key === `${h3.ref}-worst` ? "worst" : null;
902
- if (!e5) break;
903
- m2[h3.ref] || (m2[h3.ref] = { set: null !== (o3 = null === (t4 = h3.assets) || void 0 === t4 ? void 0 : t4.setIndex) && void 0 !== o3 ? o3 : 1, shown: [], best: null, worst: null });
904
- const i4 = m2[h3.ref];
905
- "best" === e5 && i4.shown.push(v2), u2.checked && (i4[e5] = v2);
906
- break;
907
- }
908
- case r.FEEDBACKAPPANSWERTYPE.UPLOAD_IMAGE:
909
- case r.FEEDBACKAPPANSWERTYPE.UPLOAD_FILE: {
910
- const e5 = (0, d.getUploadValues)(u2);
911
- e5.length && (y2.value.push(...e5), a2.push(y2));
912
- break;
913
- }
914
- }
915
- }), n2) return [];
916
- Object.entries(c2).forEach(([e4, t4]) => {
917
- t4 && 0 !== t4.length && a2.push({ key: e4, value: t4 });
918
- }), Object.entries(p2).forEach(([e4, t4]) => {
919
- t4 && 0 !== t4.length && a2.push({ key: e4, value: t4 });
920
- }), Object.entries(l2).forEach(([e4, t4]) => {
921
- if (!t4 || 0 === t4.length) return;
922
- const i4 = t4.slice().sort((e5, t5) => Number(e5.split(".")[0]) - Number(t5.split(".")[0]));
923
- a2.push({ key: e4, value: i4 });
924
- }), Object.entries(m2).forEach(([e4, t4]) => {
925
- (t4.best || t4.worst) && a2.push({ key: e4, value: [JSON.stringify([t4])] });
926
- });
927
- try {
928
- i3.questions.filter((e4) => e4.type === r.FEEDBACKAPPANSWERTYPE.MULTI_QUESTION_MATRIX).forEach((e4) => {
929
- const t4 = e4.ref + "-", i4 = a2.filter((e5) => e5.key.startsWith(t4));
930
- if (0 === i4.length) return;
931
- const r2 = i4.map((e5) => ({ key: e5.key.substring(t4.length), value: e5.value })), n3 = { key: e4.ref, value: [JSON.stringify(r2)] };
932
- for (const e5 of i4) {
933
- const t5 = a2.findIndex((t6) => t6.key === e5.key);
934
- -1 !== t5 && a2.splice(t5, 1);
935
- }
936
- const o3 = a2.findIndex((t5) => t5.key === e4.ref);
937
- -1 !== o3 ? a2[o3] = n3 : a2.push(n3);
938
- });
939
- } catch (e4) {
940
- this.log.err("Error agrupando MULTI_QUESTION_MATRIX", e4);
941
- }
942
- const h2 = this.withEarlierMaxDiffSets((0, v.toBaseAnswers)(a2, i3.questions), i3.questions);
943
- return this.feedback.answers = h2, i3.setAnswer(h2), h2;
944
- }
945
- withEarlierMaxDiffSets(e3, t3) {
946
- return e3.map((e4) => {
947
- if (!t3.some((t4) => t4.ref === e4.key && t4.type === r.FEEDBACKAPPANSWERTYPE.MAX_DIFF)) return e4;
948
- const i3 = this.parseMaxDiffAnswer(e4), a2 = [...this.parseMaxDiffAnswer(this.earlierAnswer(e4.key)).filter((e5) => !i3.some((t4) => t4.set === e5.set)), ...i3].sort((e5, t4) => e5.set - t4.set);
949
- return Object.assign(Object.assign({}, e4), { value: [JSON.stringify(a2)] });
950
- });
951
- }
952
- earlierAnswer(e3) {
953
- var t3, i3;
954
- for (let a2 = this.history.size() - 2; a2 >= 0; a2--) {
955
- const r2 = null === (i3 = null === (t3 = this.history.get(a2)) || void 0 === t3 ? void 0 : t3.answers) || void 0 === i3 ? void 0 : i3.find((t4) => t4.key === e3);
956
- if (r2) return r2;
957
- }
958
- }
959
- finish() {
960
- return a(this, void 0, void 0, function* () {
961
- if (this.completed = true, this.timeToCompleted = Date.now() - this.timeToCompleted, this.feedback.metadata.push({ key: "time-to-complete", value: [this.timeToCompleted.toString()] }), this.formOptionsConfig.addSuccessScreen) {
962
- const e3 = document.getElementById("magicfeedback-container-" + this.appId);
963
- e3.childNodes.length > 0 && e3.removeChild(e3.childNodes[0]);
964
- const t3 = (0, l.renderSuccess)(this.formOptionsConfig.successMessage || (0, y.t)(this.lang(), "message.success"));
965
- e3.appendChild(t3);
966
- }
967
- this.feedback.answers = [];
968
- try {
969
- const e3 = yield this.pushAnswers(true);
970
- if (!e3) {
971
- const e4 = new A.SubmitError("SEND_FAILED", `An error occurred while submitting the form ${this.appId}:`);
972
- throw this.formOptionsConfig.afterSubmitEvent && (yield this.formOptionsConfig.afterSubmitEvent({ loading: false, progress: this.progress, total: this.total, completed: this.completed, error: e4 })), e4;
973
- }
974
- this.id = e3, this.formOptionsConfig.afterSubmitEvent && (yield this.formOptionsConfig.afterSubmitEvent({ response: this.id, loading: false, progress: this.progress, total: this.total, completed: this.completed, error: null }));
975
- } catch (e3) {
976
- this.log.err(`An error occurred while submitting the form ${this.appId}:`, e3), this.formOptionsConfig.afterSubmitEvent && (yield this.formOptionsConfig.afterSubmitEvent({ loading: false, progress: this.progress, total: this.total, completed: this.completed, error: e3 }));
977
- }
978
- });
979
- }
980
- pushAnswers(e3 = false) {
981
- return a(this, void 0, void 0, function* () {
982
- try {
983
- if (this.config.get("dryRun")) {
984
- const e4 = this.id || `dry-run-${this.appId}-${Date.now()}`;
985
- return this.log.log(`Dry run enabled: skipping feedback submit for form ${this.appId}`), e4;
986
- }
987
- const t3 = this.config.get("url"), i3 = { integration: this.appId, publicKey: this.publicKey, feedback: this.feedback, completed: e3, lang: this.lang() };
988
- return yield (0, s.sendFeedback)(t3, this.id ? Object.assign(Object.assign({}, i3), { sessionId: this.id }) : i3, this.log);
989
- } catch (e4) {
990
- return this.log.err(`An error occurred while submitting the form ${this.appId}:`, e4), "";
991
- }
992
- });
993
- }
994
- callFollowUpQuestion(e3) {
995
- var t3, i3;
996
- return a(this, void 0, void 0, function* () {
997
- if (!(null == e3 ? void 0 : e3.followup)) return null;
998
- const a2 = null !== (t3 = this.feedback.answers.find((t4) => t4.key === e3.ref)) && void 0 !== t3 ? t3 : this.feedback.answers.find((t4) => t4.key.includes(e3.ref) && !t4.key.includes("extra-option")), r2 = null === (i3 = null == a2 ? void 0 : a2.value) || void 0 === i3 ? void 0 : i3.find((e4) => null != e4 && "" !== e4);
999
- if (void 0 === r2) return this.log.log(`The question ${e3.ref} has no answer, skipping its follow up`), null;
1000
- try {
1001
- const t4 = this.config.get("url"), i4 = Object.assign(Object.assign(Object.assign({ answer: r2 }, "" !== this.publicKey && { publicKey: this.publicKey }), "" === this.publicKey && { campaignSessionId: this.appId }), { sessionId: this.id, question: e3, previousAnswers: this.previousAnswers(e3), upcomingQuestions: this.upcomingQuestions() });
1002
- return yield (0, s.getFollowUpQuestion)(t4, i4, this.log);
1003
- } catch (t4) {
1004
- return this.log.err(`An error occurred while requesting the follow up of ${e3.ref} in the form ${this.appId}:`, t4), null;
1005
- }
1006
- });
1007
- }
1008
- previousAnswers(e3) {
1009
- var t3;
1010
- const i3 = /* @__PURE__ */ new Map();
1011
- for (let a2 = 0; a2 < this.history.size(); a2++) {
1012
- const r2 = this.history.get(a2);
1013
- if (r2) for (const a3 of r2.questions) {
1014
- if (a3.ref === e3.ref) continue;
1015
- if (T.includes(a3.type)) continue;
1016
- const n2 = this.followUpAnswerValue(a3, null === (t3 = r2.answers) || void 0 === t3 ? void 0 : t3.find((e4) => e4.key === a3.ref));
1017
- void 0 !== n2 && (i3.delete(a3.ref), i3.set(a3.ref, { title: a3.title, answer: n2 }));
1018
- }
1019
- }
1020
- return [...i3.values()];
1021
- }
1022
- followUpAnswerValue(e3, t3) {
1023
- var i3;
1024
- const a2 = (null !== (i3 = null == t3 ? void 0 : t3.value) && void 0 !== i3 ? i3 : []).filter((e4) => null != e4 && "" !== e4);
1025
- if (0 === a2.length) return;
1026
- if (e3.type === r.FEEDBACKAPPANSWERTYPE.BOOLEAN && 1 === a2.length && ["Yes", "No"].includes(a2[0])) return "Yes" === a2[0];
1027
- if (e3.type === r.FEEDBACKAPPANSWERTYPE.MULTI_QUESTION_MATRIX) {
1028
- const t4 = this.parseMatrixAnswerPre({ key: e3.ref, value: a2 }).map((e4) => `${e4.key}: ${(Array.isArray(e4.value) ? e4.value : [e4.value]).join(", ")}`);
1029
- return t4.length > 0 ? t4 : void 0;
1030
- }
1031
- const n2 = a2.map((e4) => "string" == typeof e4 ? e4 : JSON.stringify(e4));
1032
- return 1 === n2.length ? n2[0] : n2;
1033
- }
1034
- upcomingQuestions() {
1035
- var e3, t3;
1036
- const i3 = this.history.back();
1037
- if (!i3) return [];
1038
- const a2 = [], n2 = /* @__PURE__ */ new Set(), o2 = /* @__PURE__ */ new Set();
1039
- let s2 = i3.isFollowup && i3.origin ? i3.origin : i3, l2 = null !== (e3 = s2.answers) && void 0 !== e3 ? e3 : [];
1040
- for (; !o2.has(s2.id); ) {
1041
- let e4;
1042
- if (o2.add(s2.id), l2) {
1043
- const i5 = this.graph.findRoute(s2, l2);
1044
- e4 = i5 ? i5.transition === h.TransitionType.PAGE && null !== (t3 = i5.transitionDestiny) && void 0 !== t3 ? t3 : void 0 : this.graph.getNextEdgeByDefault(s2);
1045
- } else {
1046
- if (s2.edges.some((e5) => e5.typeCondition !== h.ConditionType.DIRECT && e5.typeCondition !== h.ConditionType.PRECONDITIONAL)) break;
1047
- e4 = this.graph.getNextEdgeByDefault(s2);
1048
- }
1049
- const i4 = e4 ? this.graph.getNodeById(e4) : void 0;
1050
- if (!i4) break;
1051
- if (i4.edges.filter((e5) => e5.typeCondition === h.ConditionType.PRECONDITIONAL).some((e5) => !this.latestAnswer(e5.questionRef))) break;
1052
- if (this.skipsByPreconditions(i4)) s2 = i4, l2 = [];
1053
- else {
1054
- for (const e5 of i4.questions) e5.type !== r.FEEDBACKAPPANSWERTYPE.INFO_PAGE && (n2.has(e5.ref) || (n2.add(e5.ref), a2.push({ title: e5.title })));
1055
- s2 = i4, l2 = null;
1056
- }
1057
- }
1058
- return a2;
1059
- }
1060
- processNextQuestion(e3) {
1061
- var t3, i3;
1062
- return a(this, void 0, void 0, function* () {
1063
- const a2 = this.history.back();
1064
- if (!a2) throw new A.SubmitError("NO_PAGE", "No page found");
1065
- const r2 = a2.isFollowup ? [] : a2.getFollowupQuestions();
1066
- if (0 === (null == r2 ? void 0 : r2.length)) return void (yield this.renderNextQuestion(e3, a2));
1067
- const n2 = [];
1068
- for (const e4 of r2) {
1069
- const t4 = a2.questions.find((t5) => t5.ref === e4);
1070
- if (t4) {
1071
- const e5 = yield this.callFollowUpQuestion(t4);
1072
- e5 && n2.push(e5);
1073
- }
1074
- }
1075
- if (0 === n2.length) return void (yield this.renderNextQuestion(e3, a2));
1076
- const o2 = new m.Page(a2.id, a2.position, this.appId, n2, a2.edges), s2 = new g.PageNode(a2.id, a2.position, a2.edges, o2, n2, true);
1077
- s2.origin = a2.isFollowup && a2.origin ? a2.origin : a2, s2.elements = (0, l.renderQuestions)(n2, this.formOptionsConfig.questionFormat, this.lang(), null === (t3 = this.formData) || void 0 === t3 ? void 0 : t3.product, () => this.autoSend()), this.history.enqueue(s2), this.syncBackButton(), this.progress += 0.5, e3.innerHTML = "", null === (i3 = s2.elements) || void 0 === i3 || i3.forEach((t4) => e3.appendChild(t4)), (0, b.armGhostTapGuard)(e3), this.formOptionsConfig.afterSubmitEvent && (yield this.formOptionsConfig.afterSubmitEvent({ response: this.id, loading: false, progress: this.progress, total: this.total, followup: s2.isFollowup, completed: this.completed, error: null })), this.autofocusAfterRender("navigation");
1078
- });
1079
- }
1080
- renderNextQuestion(e3, t3) {
1081
- var i3, r2, n2;
1082
- return a(this, void 0, void 0, function* () {
1083
- const a2 = t3.isFollowup && t3.origin ? t3.origin : t3, o2 = a2 === t3 ? this.feedback.answers : [...null !== (i3 = a2.answers) && void 0 !== i3 ? i3 : [], ...this.feedback.answers];
1084
- let s2 = this.graph.getNextPage(a2, o2);
1085
- if (s2) {
1086
- if (this.skipsByPreconditions(s2)) return this.feedback.answers = [], void (yield this.renderNextQuestion(e3, s2));
1087
- s2.elements = (0, l.renderQuestions)(s2.questions, this.formOptionsConfig.questionFormat, this.lang(), null === (r2 = this.formData) || void 0 === r2 ? void 0 : r2.product, () => this.autoSend()), e3.innerHTML = "", null === (n2 = s2.elements) || void 0 === n2 || n2.forEach((t4) => e3.appendChild(t4)), (0, b.armGhostTapGuard)(e3), this.history.enqueue(s2), this.syncBackButton(), this.progress = this.total - this.graph.findMaxDepth(s2), this.formOptionsConfig.afterSubmitEvent && (yield this.formOptionsConfig.afterSubmitEvent({ response: this.id, loading: false, progress: this.progress, total: this.total, followup: s2.isFollowup, completed: this.completed, error: null })), this.autofocusAfterRender("navigation");
1088
- } else this.finish();
1089
- });
1090
- }
1091
- skipsByPreconditions(e3) {
1092
- var t3;
1093
- const i3 = e3.edges.filter((e4) => "PRECONDITIONAL" === e4.typeCondition).sort((e4, t4) => e4.position < t4.position ? -1 : e4.position > t4.position ? 1 : 0);
1094
- if (0 === i3.length) return false;
1095
- const a2 = i3.some((e4) => e4.transition === h.TransitionType.ALLOW);
1096
- let n2 = a2;
1097
- for (const e4 of i3) {
1098
- const i4 = this.latestAnswer(e4.questionRef);
1099
- let a3 = false;
1100
- if (i4) {
1101
- const n3 = null === (t3 = this.formData) || void 0 === t3 ? void 0 : t3.questions.find((t4) => t4.ref === e4.questionRef), o2 = Array.isArray(i4.value) ? i4.value : [i4.value], s2 = Array.isArray(e4.value) ? e4.value : [e4.value];
1102
- if ((null == n3 ? void 0 : n3.type) === r.FEEDBACKAPPANSWERTYPE.MULTI_QUESTION_MATRIX) a3 = this.evaluateMatrixPreconditional(e4, i4);
1103
- else switch (e4.typeOperator) {
1104
- case "EQUAL":
1105
- case "INQ":
1106
- a3 = o2.some((e5) => s2.includes(e5));
1107
- break;
1108
- case "NOEQUAL":
1109
- case "NINQ":
1110
- a3 = o2.every((e5) => !s2.includes(e5));
1111
- break;
1112
- case "GREATER":
1113
- a3 = o2.some((e5) => Number(e5) > Number(s2[0]));
1114
- break;
1115
- case "LESS":
1116
- a3 = o2.some((e5) => Number(e5) < Number(s2[0]));
1117
- break;
1118
- case "GREATEREQUAL":
1119
- a3 = o2.some((e5) => Number(e5) >= Number(s2[0]));
1120
- break;
1121
- case "LESSEQUAL":
1122
- a3 = o2.some((e5) => Number(e5) <= Number(s2[0]));
1123
- }
1124
- }
1125
- if (e4.transition === h.TransitionType.ALLOW) a3 || (n2 = false);
1126
- else if (e4.transition === h.TransitionType.NEXT && a3) return true;
1127
- }
1128
- return !!a2 && !n2;
1129
- }
1130
- latestAnswer(e3) {
1131
- var t3, i3;
1132
- for (let a2 = this.history.size() - 1; a2 >= 0; a2--) {
1133
- const r2 = null === (i3 = null === (t3 = this.history.get(a2)) || void 0 === t3 ? void 0 : t3.answers) || void 0 === i3 ? void 0 : i3.find((t4) => t4.key === e3);
1134
- if (r2) return r2;
1135
- }
1136
- }
1137
- syncBackButton() {
1138
- const e3 = document.getElementById("magicfeedback-" + this.appId), t3 = null == e3 ? void 0 : e3.querySelector(".magicfeedback-back");
1139
- t3 && (t3.hidden = this.history.size() <= 1);
1140
- }
1141
- back() {
1142
- var e3;
1143
- return a(this, void 0, void 0, function* () {
1144
- if (this.history.size() <= 1) return;
1145
- const t3 = document.getElementById("magicfeedback-questions-" + this.appId);
1146
- (0, k.cancelAutoAdvance)(t3), t3 && t3.childNodes.length > 0 && (t3.innerHTML = ""), this.history.rollback(), this.syncBackButton();
1147
- const i3 = this.history.back();
1148
- i3 ? (null === (e3 = i3.elements) || void 0 === e3 || e3.forEach((e4) => t3.appendChild(e4)), (0, b.armGhostTapGuard)(t3), this.progress = this.total - this.graph.findMaxDepth(i3)) : this.progress = this.history.size(), this.formOptionsConfig.onBackEvent && (yield this.formOptionsConfig.onBackEvent({ loading: false, progress: this.progress, followup: (null == i3 ? void 0 : i3.isFollowup) || false, error: i3 ? null : "No page found" })), i3 && this.autofocusAfterRender("navigation");
1149
- });
1150
- }
1151
- previewQuestion(e3, t3, i3) {
1152
- var a2, r2;
1153
- const n2 = Array.isArray(t3) ? t3 : [t3];
1154
- if (!n2 || 0 === n2.length) throw new Error("[MagicFeedback] No question provided for preview");
1155
- const o2 = document.getElementById(e3);
1156
- if (!o2) throw new Error(`[MagicFeedback] Element with ID '${e3}' not found.`);
1157
- const { format: s2 = this.formOptionsConfig.questionFormat || "standard", language: d2 = this.lang(), product: u2 = (null === (a2 = this.formData) || void 0 === a2 ? void 0 : a2.product) || { customIcons: false }, style: p2 = (null === (r2 = this.formData) || void 0 === r2 ? void 0 : r2.style) || {}, clearContainer: m2 = true, wrap: h2 = true } = i3 || {};
1158
- m2 && (o2.innerHTML = ""), (null == p2 ? void 0 : p2.primaryColor) && (0, c.applyPrimaryColor)(o2, p2.primaryColor), (0, c.applyDirection)(o2, d2);
1159
- let f2 = [];
1160
- try {
1161
- f2 = (0, l.renderQuestions)(n2, s2, d2, u2);
1162
- } catch (e4) {
1163
- throw this.log.err(e4), e4;
1164
- }
1165
- let g2 = o2;
1166
- if (h2) {
1167
- const e4 = document.createElement("div");
1168
- e4.classList.add("magicfeedback-preview-question"), g2.appendChild(e4), g2 = e4;
1169
- }
1170
- return f2.forEach((e4) => g2.appendChild(e4)), o2;
1171
- }
1172
- parseMaxDiffAnswer(e3) {
1173
- var t3;
1174
- if (!e3 || "string" != typeof (null === (t3 = e3.value) || void 0 === t3 ? void 0 : t3[0])) return [];
1175
- try {
1176
- const t4 = JSON.parse(e3.value[0]);
1177
- return Array.isArray(t4) ? t4 : [];
1178
- } catch (e4) {
1179
- return [];
1180
- }
1181
- }
1182
- parseMatrixAnswerPre(e3) {
1183
- if (!e3 || !e3.value) return [];
1184
- if (1 === e3.value.length && "string" == typeof e3.value[0] && e3.value[0].trim().startsWith("[")) try {
1185
- const t3 = JSON.parse(e3.value[0]);
1186
- if (Array.isArray(t3)) return t3;
1187
- } catch (e4) {
1188
- return [];
1189
- }
1190
- return Array.isArray(e3.value) && e3.value.length > 0 && "object" == typeof e3.value[0] && null !== e3.value[0] && "key" in e3.value[0] ? e3.value : [];
1191
- }
1192
- evaluateMatrixPreconditional(e3, t3) {
1193
- const i3 = Array.isArray(e3.value) ? e3.value : [e3.value], a2 = new Set(e3.option || []), r2 = this.parseMatrixAnswerPre(t3);
1194
- if (!r2.length) return false;
1195
- const n2 = a2.size > 0 ? r2.filter((e4) => a2.has(e4.key)) : r2;
1196
- if (!n2.length) return false;
1197
- switch (e3.typeOperator) {
1198
- case "EQUAL":
1199
- case "INQ":
1200
- return n2.some((e4) => (Array.isArray(e4.value) ? e4.value : [e4.value]).some((e5) => i3.includes(e5)));
1201
- case "NOEQUAL":
1202
- case "NINQ":
1203
- return n2.every((e4) => (Array.isArray(e4.value) ? e4.value : [e4.value]).every((e5) => !i3.includes(e5)));
1204
- case "GREATER":
1205
- return n2.some((e4) => (Array.isArray(e4.value) ? e4.value : [e4.value]).some((e5) => i3.some((t4) => Number(e5) > Number(t4))));
1206
- case "LESS":
1207
- return n2.some((e4) => (Array.isArray(e4.value) ? e4.value : [e4.value]).some((e5) => i3.some((t4) => Number(e5) < Number(t4))));
1208
- case "GREATEREQUAL":
1209
- return n2.some((e4) => (Array.isArray(e4.value) ? e4.value : [e4.value]).some((e5) => i3.some((t4) => Number(e5) >= Number(t4))));
1210
- case "LESSEQUAL":
1211
- return n2.some((e4) => (Array.isArray(e4.value) ? e4.value : [e4.value]).some((e5) => i3.some((t4) => Number(e5) <= Number(t4))));
1212
- default:
1213
- return false;
1214
- }
1215
- }
1216
- };
1217
- }, 9700(e2, t2) {
1218
- "use strict";
1219
- t2.Page = void 0, t2.Page = class {
1220
- constructor(e3, t3, i2, a, r) {
1221
- this.id = e3, this.position = t3, this.generatedAt = (/* @__PURE__ */ new Date()).toISOString(), this.updatedAt = (/* @__PURE__ */ new Date()).toISOString(), this.status = "ACTIVE", this.integrationId = i2, this.integrationQuestions = a, this.integrationPageRoutes = r;
1222
- }
1223
- };
1224
- }, 1989(e2, t2, i2) {
1225
- "use strict";
1226
- t2.PageGraph = void 0;
1227
- const a = i2(4636), r = i2(5558), n = i2(2591);
1228
- t2.PageGraph = class {
1229
- constructor(e3) {
1230
- this.nodes = /* @__PURE__ */ new Map(), this.buildGraph(e3);
1231
- }
1232
- buildGraph(e3) {
1233
- e3.forEach((e4) => {
1234
- var t3;
1235
- e4.integrationPageRoutes && (e4.integrationPageRoutes = (null === (t3 = e4.integrationPageRoutes) || void 0 === t3 ? void 0 : t3.sort((e5, t4) => {
1236
- const i4 = new Date((null == e5 ? void 0 : e5.generatedAt) || 0).getTime(), a2 = new Date((null == t4 ? void 0 : t4.generatedAt) || 0).getTime();
1237
- return i4 !== a2 ? i4 - a2 : "DIRECT" === e5.typeCondition && "DIRECT" !== t4.typeCondition ? 1 : "DIRECT" !== e5.typeCondition && "DIRECT" === t4.typeCondition ? -1 : 0;
1238
- })) || []);
1239
- const i3 = new a.PageNode(e4.id, e4.position, e4.integrationPageRoutes || [], e4, e4.integrationQuestions);
1240
- this.nodes.set(i3.id, i3);
1241
- });
1242
- }
1243
- getNodeById(e3) {
1244
- return this.nodes.get(e3);
1245
- }
1246
- getNextEdgeByDefault(e3) {
1247
- if (!e3) return;
1248
- const t3 = e3.edges.find((e4) => e4.typeCondition === n.ConditionType.DIRECT);
1249
- if (!t3 || ![n.TransitionType.FINISH, n.TransitionType.REDIRECT].includes(t3.transition)) {
1250
- if (t3 && t3.transitionDestiny) return t3.transitionDestiny;
1251
- for (const t4 of this.nodes.values()) if (t4.position === e3.position + 1) return t4.id;
1252
- }
1253
- }
1254
- getFirstPage() {
1255
- let e3, t3 = Number.MAX_VALUE;
1256
- for (const i3 of this.nodes.values()) i3.position < t3 && (t3 = i3.position, e3 = i3);
1257
- return e3;
1258
- }
1259
- getNextPage(e3, t3) {
1260
- var i3;
1261
- if (!e3) return;
1262
- const a2 = this.findRoute(e3, t3);
1263
- if (!a2) {
1264
- const t4 = this.getNextEdgeByDefault(e3);
1265
- if (!t4) return;
1266
- return this.getNodeById(t4);
1267
- }
1268
- switch (a2.transition) {
1269
- case n.TransitionType.PAGE:
1270
- if (!a2.transitionDestiny) return;
1271
- return this.getNodeById(a2.transitionDestiny);
1272
- case n.TransitionType.FINISH:
1273
- return;
1274
- case n.TransitionType.REDIRECT:
1275
- return void (window.location.href = (null === (i3 = a2.transitionDestiny) || void 0 === i3 ? void 0 : i3.includes("?")) ? `${a2.transitionDestiny}&${window.location.search.slice(1)}` : `${a2.transitionDestiny}${window.location.search}`);
1276
- default:
1277
- return;
1278
- }
1279
- }
1280
- findRoute(e3, t3) {
1281
- return e3.edges.sort((e4, t4) => "DIRECT" === e4.typeCondition ? 1 : "DIRECT" === t4.typeCondition ? -1 : 0), e3.edges.find((i3) => {
1282
- const a2 = e3.questions.find((e4) => e4.ref === i3.questionRef), o = null == t3 ? void 0 : t3.filter((e4) => e4.key === i3.questionRef);
1283
- if ("DIRECT" === i3.typeCondition) return true;
1284
- if (!o || 0 === o.length) return false;
1285
- if ((null == a2 ? void 0 : a2.type) === r.FEEDBACKAPPANSWERTYPE.MULTI_QUESTION_MATRIX) return this.evaluateMatrixCondition(i3, o);
1286
- const s = Array.isArray(i3.value) ? i3.value : [i3.value];
1287
- switch (i3.typeOperator) {
1288
- case n.OperatorType.EQUAL:
1289
- return o.some((e4) => (Array.isArray(e4.value) ? e4.value : [e4.value]).some((e5) => s.includes(e5)));
1290
- case n.OperatorType.NOEQUAL:
1291
- return o.every((e4) => (Array.isArray(e4.value) ? e4.value : [e4.value]).every((e5) => !s.includes(e5)));
1292
- case n.OperatorType.GREATER:
1293
- return o.some((e4) => (Array.isArray(e4.value) ? e4.value : [e4.value]).some((e5) => s.some((t4) => Number(e5) > Number(t4))));
1294
- case n.OperatorType.LESS:
1295
- return o.some((e4) => (Array.isArray(e4.value) ? e4.value : [e4.value]).some((e5) => s.some((t4) => Number(e5) < Number(t4))));
1296
- case n.OperatorType.GREATEREQUAL:
1297
- return o.some((e4) => (Array.isArray(e4.value) ? e4.value : [e4.value]).some((e5) => s.some((t4) => Number(e5) >= Number(t4))));
1298
- case n.OperatorType.LESSEQUAL:
1299
- return o.some((e4) => (Array.isArray(e4.value) ? e4.value : [e4.value]).some((e5) => s.some((t4) => Number(e5) <= Number(t4))));
1300
- case n.OperatorType.INQ:
1301
- return o.some((e4) => (Array.isArray(e4.value) ? e4.value : [e4.value]).some((e5) => s.includes(e5)));
1302
- case n.OperatorType.NINQ:
1303
- return o.every((e4) => (Array.isArray(e4.value) ? e4.value : [e4.value]).every((e5) => !s.includes(e5)));
1304
- default:
1305
- return false;
1306
- }
1307
- });
1308
- }
1309
- findDepth(e3) {
1310
- const t3 = this.getNodeById(e3);
1311
- if (!t3) return 0;
1312
- const i3 = /* @__PURE__ */ new Set();
1313
- return this.DFSUtil(t3, i3, 0);
1314
- }
1315
- findMaxDepth(e3) {
1316
- if (e3 || (e3 = this.getFirstPage()), !e3) return 0;
1317
- const t3 = /* @__PURE__ */ new Set();
1318
- let i3 = 1;
1319
- return i3 = Math.max(i3, this.DFSUtil(e3, t3, i3)), i3;
1320
- }
1321
- DFSUtil(e3, t3, i3) {
1322
- t3.add(e3);
1323
- let a2 = i3;
1324
- const r2 = [...e3.edges.filter((e4) => e4.typeCondition !== n.ConditionType.PRECONDITIONAL) || []], o = this.getNextEdgeByDefault(e3);
1325
- if (o) {
1326
- const i4 = this.getNodeById(o);
1327
- i4 && !t3.has(i4) && r2.push(new n.PageRoute(i4.id, "", n.OperatorType.DEFAULT, [""], n.TransitionType.PAGE, i4.id, e3.id));
1328
- }
1329
- for (const e4 of r2) {
1330
- if (!e4.transitionDestiny) continue;
1331
- const r3 = this.getNodeById(e4.transitionDestiny);
1332
- if (r3 && !t3.has(r3)) {
1333
- const e5 = i3 + 1, n2 = new Set(t3), o2 = this.DFSUtil(r3, n2, e5);
1334
- a2 = Math.max(a2, o2);
1335
- }
1336
- }
1337
- return a2;
1338
- }
1339
- parseMatrixAnswer(e3) {
1340
- if (!e3 || !e3.value) return [];
1341
- if (1 === e3.value.length && "string" == typeof e3.value[0] && e3.value[0].trim().startsWith("[")) try {
1342
- const t3 = JSON.parse(e3.value[0]);
1343
- if (Array.isArray(t3)) return t3;
1344
- } catch (e4) {
1345
- return [];
1346
- }
1347
- return Array.isArray(e3.value) && e3.value.length > 0 && "object" == typeof e3.value[0] && null !== e3.value[0] && "key" in e3.value[0] ? e3.value : [];
1348
- }
1349
- evaluateMatrixCondition(e3, t3) {
1350
- const i3 = Array.isArray(e3.value) ? e3.value : [e3.value], a2 = new Set(e3.option || []), r2 = t3[0], o = this.parseMatrixAnswer(r2);
1351
- if (!o.length) return false;
1352
- const s = a2.size > 0 ? o.filter((e4) => a2.has(e4.key)) : o;
1353
- if (!s.length) return false;
1354
- switch (e3.typeOperator) {
1355
- case n.OperatorType.EQUAL:
1356
- case n.OperatorType.INQ:
1357
- return s.some((e4) => (Array.isArray(e4.value) ? e4.value : [e4.value]).some((e5) => i3.includes(e5)));
1358
- case n.OperatorType.NOEQUAL:
1359
- case n.OperatorType.NINQ:
1360
- return s.every((e4) => (Array.isArray(e4.value) ? e4.value : [e4.value]).every((e5) => !i3.includes(e5)));
1361
- case n.OperatorType.GREATER:
1362
- return s.some((e4) => (Array.isArray(e4.value) ? e4.value : [e4.value]).some((e5) => i3.some((t4) => Number(e5) > Number(t4))));
1363
- case n.OperatorType.LESS:
1364
- return s.some((e4) => (Array.isArray(e4.value) ? e4.value : [e4.value]).some((e5) => i3.some((t4) => Number(e5) < Number(t4))));
1365
- case n.OperatorType.GREATEREQUAL:
1366
- return s.some((e4) => (Array.isArray(e4.value) ? e4.value : [e4.value]).some((e5) => i3.some((t4) => Number(e5) >= Number(t4))));
1367
- case n.OperatorType.LESSEQUAL:
1368
- return s.some((e4) => (Array.isArray(e4.value) ? e4.value : [e4.value]).some((e5) => i3.some((t4) => Number(e5) <= Number(t4))));
1369
- default:
1370
- return false;
1371
- }
1372
- }
1373
- };
1374
- }, 4636(e2, t2) {
1375
- "use strict";
1376
- t2.PageNode = void 0, t2.PageNode = class {
1377
- constructor(e3, t3, i2, a, r, n = false) {
1378
- this.answers = [], this.id = e3, this.position = t3, this.edges = i2, this.data = a, this.questions = r.sort((e4, t4) => e4.position - t4.position), this.elements = [], this.isFollowup = n;
1379
- }
1380
- getFollowupQuestions() {
1381
- return this.questions.filter((e3) => e3.followup).map((e3) => e3.ref);
1382
- }
1383
- getRequiredQuestions() {
1384
- return this.questions.filter((e3) => e3.require).map((e3) => e3.ref);
1385
- }
1386
- setAnswer(e3) {
1387
- this.answers = e3;
1388
- }
1389
- };
1390
- }, 2591(e2, t2) {
1391
- "use strict";
1392
- var i2, a, r, n;
1393
- t2.PageRoute = t2.X = t2.OperatorType = t2.ConditionType = t2.TransitionType = void 0, (n = t2.TransitionType || (t2.TransitionType = {})).PAGE = "PAGE", n.FINISH = "FINISH", n.REDIRECT = "REDIRECT", n.NEXT = "NEXT", n.ALLOW = "ALLOW", (function(e3) {
1394
- e3.LOGICAL = "LOGICAL", e3.DIRECT = "DIRECT", e3.PRECONDITIONAL = "PRECONDITIONAL";
1395
- })(i2 = t2.ConditionType || (t2.ConditionType = {})), (r = t2.OperatorType || (t2.OperatorType = {})).EQUAL = "EQUAL", r.NOEQUAL = "NOEQUAL", r.GREATER = "GREATER", r.LESS = "LESS", r.GREATEREQUAL = "GREATEREQUAL", r.LESSEQUAL = "LESSEQUAL", r.INQ = "INQ", r.NINQ = "NINQ", r.DEFAULT = "DEFAULT", (function(e3) {
1396
- e3.ACTIVE = "ACTIVE", e3.DEPRECATED = "DEPRECATED", e3.DELETE = "DELETE";
1397
- })(a = t2.X || (t2.X = {})), t2.PageRoute = class {
1398
- constructor(e3, t3, r2, n2, o, s, l, d, c, u) {
1399
- this.id = e3, this.questionRef = t3, this.typeCondition = d || i2.LOGICAL, this.typeOperator = r2, this.value = n2 || [], this.transition = o, this.transitionDestiny = s, this.status = a.ACTIVE, this.generatedAt = /* @__PURE__ */ new Date(), this.updatedAt = /* @__PURE__ */ new Date(), this.integrationPageId = l, this.position = c || 0, this.option = u || [];
1400
- }
1401
- };
1402
- }, 5558(e2, t2) {
1403
- "use strict";
1404
- var i2, a;
1405
- t2.AGENT_ANSWER_TYPE_BLOCKED = t2.FEEDBACKAPPANSWERTYPE = void 0, (a = t2.FEEDBACKAPPANSWERTYPE || (t2.FEEDBACKAPPANSWERTYPE = {})).CONTACT = "CONTACT", a.MULTIPLECHOISE_IMAGE = "MULTIPLECHOISE_IMAGE", a.EMAIL = "EMAIL", a.RATING_STAR = "RATING_STAR", a.RADIO = "RADIO", a.MULTIPLECHOICE = "MULTIPLECHOICE", a.SELECT = "SELECT", a.TEXT = "TEXT", a.LONGTEXT = "LONGTEXT", a.NUMBER = "NUMBER", a.RATING_EMOJI = "RATING_EMOJI", a.RATING_NUMBER = "RATING_NUMBER", a.DATE = "DATE", a.BOOLEAN = "BOOLEAN", a.PASSWORD = "PASSWORD", a.CONSENT = "CONSENT", a.MULTI_QUESTION_MATRIX = "MULTI_QUESTION_MATRIX", a.POINT_SYSTEM = "POINT_SYSTEM", a.PRIORITY_LIST = "PRIORITY_LIST", a.INFO_PAGE = "INFO_PAGE", a.UPLOAD_FILE = "UPLOAD_FILE", a.UPLOAD_IMAGE = "UPLOAD_IMAGE", a.MAX_DIFF = "MAX_DIFF", t2.AGENT_ANSWER_TYPE_BLOCKED = "ABUSIVE_OR_OFFENSIVE", (function(e3) {
1406
- e3.FORM = "form", e3.DIV = "div";
1407
- })(i2 || (i2 = {}));
1408
- }, 4565(e2, t2, i2) {
1409
- "use strict";
1410
- t2.applyDirection = t2.applyPrimaryColor = t2.generateContainer = void 0;
1411
- const a = i2(881);
1412
- t2.generateContainer = function(e3, t3) {
1413
- let i3 = document.getElementById(e3);
1414
- if (!i3 && (i3 = document.getElementById("magicfeedback-container-" + t3), !i3)) throw new Error(`Element with ID '${e3}' not found.`);
1415
- return i3.classList.add("magicfeedback-container"), i3.id = "magicfeedback-container-" + t3, i3.innerHTML = "", i3;
1416
- }, t2.applyPrimaryColor = function(e3, t3) {
1417
- e3.style.setProperty("--mf-primary", t3), e3.style.setProperty("--mf-primary-hover", `color-mix(in srgb, ${t3} 85%, black)`), e3.style.setProperty("--mf-primary-light", `color-mix(in srgb, ${t3} 15%, white)`), e3.style.setProperty("--mf-primary-border", `color-mix(in srgb, ${t3} 35%, transparent)`), e3.style.setProperty("--mf-border-focus", t3);
1418
- }, t2.applyDirection = function(e3, t3) {
1419
- const i3 = (0, a.isRtlLanguage)(t3);
1420
- e3.setAttribute("dir", i3 ? "rtl" : "ltr"), e3.classList.toggle("magicfeedback-rtl", i3);
1421
- };
1422
- }, 516(e2, t2, i2) {
1423
- "use strict";
1424
- t2.getUrlParam = t2.getBooleanOptions = t2.parseTitle = void 0;
1425
- const a = i2(881);
1426
- t2.parseTitle = function(e3, t3) {
1427
- return e3 ? "object" == typeof e3 ? e3[t3] || e3.en : e3 : "";
1428
- }, t2.getBooleanOptions = function(e3) {
1429
- return [(0, a.t)(e3, "boolean.yes"), (0, a.t)(e3, "boolean.no")];
1430
- }, t2.getUrlParam = function(e3) {
1431
- return new URLSearchParams(window.location.search).get(e3);
1432
- };
1433
- }, 6559(e2, t2, i2) {
1434
- "use strict";
1435
- t2.iW = t2.$P = t2.usesLegacyRatingNumber = t2.createRatingNumberElement = t2.createStarRating = t2.createRatingPlaceholder = void 0;
1436
- const a = i2(881), r = i2(7321);
1437
- function n(e3, t3, i3 = "ltr") {
1438
- const a2 = document.createElement("div");
1439
- a2.classList.add("magicfeedback-rating-placeholder");
1440
- const r2 = document.createElement("span");
1441
- r2.textContent = null != e3 ? e3 : "", r2.classList.add("magicfeedback-rating-placeholder-value");
1442
- const n2 = document.createElement("span");
1443
- return n2.textContent = null != t3 ? t3 : "", n2.classList.add("magicfeedback-rating-placeholder-value"), "ltr" === i3 ? (e3 && a2.appendChild(r2), t3 && a2.appendChild(n2)) : (t3 && a2.appendChild(n2), e3 && a2.appendChild(r2)), a2;
1444
- }
1445
- t2.createRatingPlaceholder = n, t2.createStarRating = function(e3, t3, i3, a2 = () => {
1446
- }, o) {
1447
- const s = document.createElement("div");
1448
- s.classList.add("magicfeedback-rating-star-container"), s.style.maxWidth = "300px", s.style.margin = "auto", s.dataset.originalSelection = "0";
1449
- const l = (e4) => {
1450
- s.querySelectorAll(".rating__star").forEach((t4, i4) => {
1451
- t4.classList.toggle("magicfeedback-rating-star-selected", i4 < e4);
1452
- });
1453
- };
1454
- for (let t4 = 1; t4 <= 5; t4++) {
1455
- const i4 = document.createElement("label");
1456
- i4.classList.add("magicfeedback-rating-star-option");
1457
- const n2 = document.createElement("input");
1458
- n2.id = `rating-${e3}-${t4}`, n2.type = "radio", n2.name = e3, n2.value = t4.toString(), n2.style.position = "absolute", n2.style.opacity = "0", n2.style.width = "0", n2.style.height = "0", n2.classList.add("magicfeedback-input"), o && o === n2.value && (n2.checked = true), n2.addEventListener("change", () => {
1459
- l(Number(n2.value)), s.dataset.originalSelection = n2.value;
1460
- }), (0, r.autoAdvanceOn)(n2, a2), i4.appendChild(n2);
1461
- const d2 = document.createElement("label");
1462
- d2.htmlFor = `rating-${e3}-${t4}`, d2.classList.add("rating__star"), d2.textContent = "\u2605", d2.style.fontSize = "40px", d2.style.color = "#CCCCCC", d2.style.cursor = "pointer", d2.addEventListener("mouseenter", () => l(t4)), d2.addEventListener("mouseleave", () => l(Number(s.dataset.originalSelection || "0"))), i4.appendChild(d2), s.appendChild(i4);
1463
- }
1464
- const d = s.querySelector("input:checked");
1465
- d && (s.dataset.originalSelection = d.value, l(Number(d.value)));
1466
- const c = n(t3, i3);
1467
- return c.childElementCount > 0 && s.appendChild(c), s;
1468
- }, t2.createRatingNumberElement = function(e3, i3, n2, o, s, l, d, c, u = {}) {
1469
- var p, m;
1470
- const h = document.createElement("div");
1471
- h.classList.add("magicfeedback-rating-number");
1472
- const f = !!u.legacy, g = f && !!u.isPhone, y = g ? (function(e4) {
1473
- const t3 = (null == e4 ? void 0 : e4.max) ? Number(e4.max) : 10, i4 = (null == e4 ? void 0 : e4.min) ? Number(e4.min) : 0;
1474
- return (a2) => {
1475
- var r2;
1476
- return (null === (r2 = null == e4 ? void 0 : e4.numberPlaceholders) || void 0 === r2 ? void 0 : r2[a2]) || (a2 === i4 ? null == e4 ? void 0 : e4.minPlaceholder : void 0) || (a2 === t3 ? null == e4 ? void 0 : e4.maxPlaceholder : void 0) || void 0;
1477
- };
1478
- })(i3) : null;
1479
- g && (o = "column", i3 = Object.assign(Object.assign({}, i3), { minPlaceholder: void 0, maxPlaceholder: void 0, numberPlaceholders: void 0 })), f && h.classList.add("magicfeedback-rating-number--legacy");
1480
- const v = "column" === o, b = "ltr" === n2 ? o : `${o}-reverse`, E = document.createElement("div");
1481
- E.classList.add("magicfeedback-rating-number-container"), E.classList.add(`magicfeedback-rating-number-container-${n2}`), E.classList.add(`magicfeedback-rating-number-container-${o}`), E.style.display = "flex", E.style.flexDirection = b, E.setAttribute("role", "radiogroup"), E.setAttribute("aria-label", (null == i3 ? void 0 : i3.ariaLabel) || (0, a.t)(c, "rating.ariaLabel"));
1482
- const k = (null == i3 ? void 0 : i3.max) ? Number(null == i3 ? void 0 : i3.max) : 10, A = (null == i3 ? void 0 : i3.min) ? Number(null == i3 ? void 0 : i3.min) : 0;
1483
- !v && k - A + 1 > 6 && E.classList.add("magicfeedback-rating-number-container-row--dense");
1484
- const T = (null == i3 ? void 0 : i3.numberPlaceholders) || null, C = !(!T || !Object.keys(T).length), x = !v && !f && !!T && Object.values(T).some((e4) => !!e4), w = "bottom" === (null == i3 ? void 0 : i3.numberPlaceholdersPosition) ? "bottom" : "top";
1485
- x && (E.style.alignItems = "stretch");
1486
- let S = null;
1487
- if (!v && !x && ((null == i3 ? void 0 : i3.minPlaceholder) || (null == i3 ? void 0 : i3.maxPlaceholder))) {
1488
- S = document.createElement("div"), S.classList.add("magicfeedback-rating-number-scale-labels");
1489
- const e4 = document.createElement("span");
1490
- e4.classList.add("magicfeedback-rating-number-scale-label"), e4.textContent = null !== (p = null == i3 ? void 0 : i3.minPlaceholder) && void 0 !== p ? p : "";
1491
- const t3 = document.createElement("span");
1492
- t3.classList.add("magicfeedback-rating-number-scale-label"), t3.textContent = null !== (m = null == i3 ? void 0 : i3.maxPlaceholder) && void 0 !== m ? m : "", "ltr" === n2 ? (S.appendChild(e4), S.appendChild(t3)) : (S.appendChild(t3), S.appendChild(e4));
1493
- }
1494
- let P = null;
1495
- if (v && !C && E.classList.add("magicfeedback-rating-number-container-column--bare"), (v ? !C : !x) && ((null == i3 ? void 0 : i3.minPlaceholder) || (null == i3 ? void 0 : i3.maxPlaceholder))) {
1496
- const e4 = "ltr" === n2 ? null == i3 ? void 0 : i3.minPlaceholder : null == i3 ? void 0 : i3.maxPlaceholder, t3 = "ltr" === n2 ? null == i3 ? void 0 : i3.maxPlaceholder : null == i3 ? void 0 : i3.minPlaceholder, a2 = (e5) => {
1497
- const t4 = document.createElement("div");
1498
- return t4.classList.add("magicfeedback-rating-number-scale-label-block"), v || (t4.classList.add("magicfeedback-rating-number-scale-label-block--stacked"), t4.style.display = "none"), t4.textContent = e5, t4;
1499
- };
1500
- e4 && h.appendChild(a2(e4)), t3 && (P = a2(t3));
1501
- }
1502
- for (let t3 = A; t3 <= k; t3++) {
1503
- const a2 = document.createElement("div");
1504
- a2.classList.add("magicfeedback-rating-number-option"), a2.classList.add(`magicfeedback-rating-number-option-${o}`);
1505
- const n3 = document.createElement("label");
1506
- n3.htmlFor = `rating-${e3}-${t3}`, n3.classList.add("magicfeedback-rating-number-option-label-container");
1507
- const c2 = C && (T[t3] || (t3 === A ? null == i3 ? void 0 : i3.minPlaceholder : void 0) || (t3 === k ? null == i3 ? void 0 : i3.maxPlaceholder : void 0)), u2 = document.createElement("input");
1508
- u2.id = `rating-${e3}-${t3}`, u2.type = "radio", u2.name = e3, u2.value = t3.toString(), u2.classList.add(s), u2.classList.add("magicfeedback-input");
1509
- const p2 = null == y ? void 0 : y(t3);
1510
- u2.setAttribute("aria-label", c2 ? `${t3} \u2014 ${c2}` : p2 ? `${t3} \u2014 ${p2}` : `${t3}`), (0, r.autoAdvanceOn)(u2, l), d && d === u2.value && (u2.checked = true), n3.appendChild(u2);
1511
- const m2 = document.createElement("span");
1512
- m2.classList.add("magicfeedback-rating-number-value");
1513
- const h2 = document.createElement("span");
1514
- if (h2.textContent = p2 ? `${t3} = ${p2}` : t3.toString(), h2.classList.add("magicfeedback-rating-number-value-num"), f && (h2.style.fontWeight = "normal"), m2.appendChild(h2), (v || x) && c2) {
1515
- const e4 = document.createElement("span");
1516
- e4.textContent = c2, e4.classList.add("magicfeedback-rating-number-value-label"), v || (e4.style.display = "none"), m2.appendChild(e4);
1517
- } else !v && !x && T && T[t3] && (n3.title = T[t3]);
1518
- if (n3.appendChild(m2), x) {
1519
- const e4 = document.createElement("label");
1520
- e4.htmlFor = u2.id, e4.classList.add("magicfeedback-rating-number-option-caption"), e4.textContent = c2 || "", a2.classList.add("magicfeedback-rating-number-option--captioned"), a2.classList.add(`magicfeedback-rating-number-option--caption-${w}`), a2.style.flexDirection = "top" === w ? "column" : "column-reverse", a2.style.justifyContent = "flex-end", a2.appendChild(e4);
1521
- }
1522
- a2.appendChild(n3), E.appendChild(a2);
1523
- }
1524
- if (h.appendChild(E), P && h.appendChild(P), S) {
1525
- const e4 = null == i3 ? void 0 : i3.minMaxPlaceholderPosition;
1526
- "top" !== e4 && "bottom" !== e4 || (S.classList.add(`magicfeedback-rating-number-scale-labels--${e4}`), S.style.order = "top" === e4 ? "-1" : "1"), "top" === e4 ? h.insertBefore(S, E) : h.appendChild(S);
1527
- }
1528
- if (v || f || (function(e4, i4, a2, r2, n3 = t2.$P) {
1529
- if ("undefined" == typeof ResizeObserver) return;
1530
- const o2 = i4.classList.contains("magicfeedback-rating-number-container-row--dense"), s2 = !!i4.querySelector(".magicfeedback-rating-number-option--captioned");
1531
- let l2 = 0, d2 = false;
1532
- const c2 = "function" == typeof requestAnimationFrame ? requestAnimationFrame : (e5) => (e5(0), 0);
1533
- let u2 = 0, p2 = false;
1534
- new ResizeObserver((t3) => {
1535
- var m2;
1536
- const h2 = null === (m2 = t3[0]) || void 0 === m2 ? void 0 : m2.contentRect.width;
1537
- h2 && h2 !== u2 && (u2 = h2, p2 || (p2 = true, c2(() => {
1538
- var t4;
1539
- p2 = false, d2 || (l2 = parseFloat(getComputedStyle(i4).columnGap) || 0), (t4 = u2 < a2 * n3 + (a2 - 1) * l2) !== d2 && (d2 = t4, e4.classList.toggle("magicfeedback-rating-number--stacked", t4), e4.querySelectorAll(":scope > .magicfeedback-rating-number-scale-labels").forEach((e5) => {
1540
- e5.style.display = t4 ? "none" : "";
1541
- }), e4.querySelectorAll(":scope > .magicfeedback-rating-number-scale-label-block--stacked").forEach((e5) => {
1542
- e5.style.display = t4 ? "" : "none";
1543
- }), i4.classList.toggle("magicfeedback-rating-number-container-row", !t4), i4.classList.toggle("magicfeedback-rating-number-container-row--dense", !t4 && o2), i4.classList.toggle("magicfeedback-rating-number-container-column", t4), i4.classList.toggle("magicfeedback-rating-number-container-column--bare", t4 && !s2), i4.style.flexDirection = t4 ? "ltr" === r2 ? "column" : "column-reverse" : "ltr" === r2 ? "row" : "row-reverse", i4.querySelectorAll(":scope > .magicfeedback-rating-number-option").forEach((e5) => {
1544
- if (e5.classList.toggle("magicfeedback-rating-number-option-row", !t4), e5.classList.toggle("magicfeedback-rating-number-option-column", t4), !e5.classList.contains("magicfeedback-rating-number-option--captioned")) return;
1545
- const i5 = e5.classList.contains("magicfeedback-rating-number-option--caption-top");
1546
- e5.style.flexDirection = t4 ? "" : i5 ? "column" : "column-reverse", e5.querySelectorAll(".magicfeedback-rating-number-option-caption").forEach((e6) => {
1547
- e6.style.display = t4 ? "none" : "";
1548
- }), e5.querySelectorAll(".magicfeedback-rating-number-value-label").forEach((e6) => {
1549
- e6.style.display = t4 ? "" : "none";
1550
- });
1551
- }));
1552
- })));
1553
- }).observe(e4);
1554
- })(h, E, k - A + 1, n2, x ? t2.iW : t2.$P), (null == i3 ? void 0 : i3.extraOption) && (null == i3 ? void 0 : i3.extraOptionText)) {
1555
- const t3 = document.createElement("div");
1556
- t3.classList.add("magicfeedback-rating-number-extra-row");
1557
- const a2 = document.createElement("div");
1558
- a2.classList.add("magicfeedback-rating-number-option"), a2.classList.add("magicfeedback-rating-number-option--extra");
1559
- const n3 = document.createElement("label");
1560
- n3.htmlFor = `rating-${e3}-extra`, n3.classList.add("magicfeedback-rating-number-option-label-container");
1561
- const o2 = document.createElement("input");
1562
- o2.id = `rating-${e3}-extra`, o2.type = "radio", o2.name = e3, o2.value = "-", o2.classList.add(s), o2.classList.add("magicfeedback-input"), o2.setAttribute("aria-label", null == i3 ? void 0 : i3.extraOptionText), (0, r.autoAdvanceOn)(o2, l);
1563
- const d2 = document.createElement("span");
1564
- d2.classList.add("magicfeedback-rating-number-value");
1565
- const c2 = document.createElement("span");
1566
- c2.textContent = null == i3 ? void 0 : i3.extraOptionText, c2.classList.add("magicfeedback-rating-number-value-label"), d2.appendChild(c2), n3.appendChild(o2), n3.appendChild(d2), a2.appendChild(n3), t3.appendChild(a2), h.appendChild(t3);
1567
- }
1568
- return h;
1569
- }, t2.usesLegacyRatingNumber = function(e3) {
1570
- return !!e3 && /matas/i.test(e3);
1571
- }, t2.$P = 44, t2.iW = 72;
1572
- }, 8042(e2, t2, i2) {
1573
- "use strict";
1574
- t2.getQuestionRenderer = void 0;
1575
- const a = i2(5558), r = i2(8998), n = i2(1072), o = i2(6732), s = i2(2090), l = i2(8065), d = i2(9085), c = i2(8817), u = i2(9965), p = i2(9180), m = i2(1991), h = i2(9152), f = i2(1917), g = i2(5452), y = i2(2644), v = i2(2773), b = i2(1066), E = i2(1843), k = i2(4250), A = i2(8409), T = i2(2282), C = i2(8736), x = /* @__PURE__ */ new Map([[a.FEEDBACKAPPANSWERTYPE.TEXT, s.renderText], [a.FEEDBACKAPPANSWERTYPE.LONGTEXT, n.renderLongText], [a.FEEDBACKAPPANSWERTYPE.NUMBER, o.renderNumber], [a.FEEDBACKAPPANSWERTYPE.RADIO, r.renderChoice], [a.FEEDBACKAPPANSWERTYPE.MULTIPLECHOICE, r.renderChoice], [a.FEEDBACKAPPANSWERTYPE.BOOLEAN, l.renderBoolean], [a.FEEDBACKAPPANSWERTYPE.SELECT, d.renderSelect], [a.FEEDBACKAPPANSWERTYPE.DATE, c.renderDate], [a.FEEDBACKAPPANSWERTYPE.EMAIL, u.renderEmail], [a.FEEDBACKAPPANSWERTYPE.PASSWORD, p.renderPassword], [a.FEEDBACKAPPANSWERTYPE.CONSENT, m.renderConsent], [a.FEEDBACKAPPANSWERTYPE.RATING_EMOJI, h.renderRatingEmoji], [a.FEEDBACKAPPANSWERTYPE.RATING_NUMBER, f.renderRatingNumber], [a.FEEDBACKAPPANSWERTYPE.RATING_STAR, g.renderRatingStar], [a.FEEDBACKAPPANSWERTYPE.MULTI_QUESTION_MATRIX, y.renderMatrix], [a.FEEDBACKAPPANSWERTYPE.PRIORITY_LIST, v.renderPriorityList], [a.FEEDBACKAPPANSWERTYPE.POINT_SYSTEM, b.renderPointSystem], [a.FEEDBACKAPPANSWERTYPE.UPLOAD_IMAGE, E.renderUploadImage], [a.FEEDBACKAPPANSWERTYPE.UPLOAD_FILE, k.renderUploadFile], [a.FEEDBACKAPPANSWERTYPE.MULTIPLECHOISE_IMAGE, A.renderMultipleChoiceImage], [a.FEEDBACKAPPANSWERTYPE.INFO_PAGE, T.renderInfoPage], [a.FEEDBACKAPPANSWERTYPE.MAX_DIFF, C.renderMaxDiff]]);
1576
- t2.getQuestionRenderer = function(e3) {
1577
- return x.get(e3);
1578
- };
1579
- }, 8065(e2, t2, i2) {
1580
- "use strict";
1581
- t2.renderBoolean = void 0;
1582
- const a = i2(516), r = i2(7321);
1583
- t2.renderBoolean = ({ question: e3, language: t3, urlParamValue: i3, send: n }) => {
1584
- const { ref: o, assets: s } = e3, l = document.createElement("div"), d = "magicfeedback-radio", c = document.createElement("div");
1585
- return c.classList.add("magicfeedback-boolean-container"), c.style.display = "flex", c.style.flexDirection = "row", c.style.justifyContent = "space-between", c.style.width = "70%", c.style.margin = "auto", ((null == s ? void 0 : s.addIcon) ? ["\u{1F44D}", "\u{1F44E}"] : (0, a.getBooleanOptions)(t3)).forEach((e4, t4) => {
1586
- const a2 = document.createElement("label");
1587
- a2.classList.add("magicfeedback-boolean-option"), a2.htmlFor = `rating-${o}-${t4}`, a2.style.cursor = "pointer", a2.style.display = "flex", a2.style.justifyContent = "center", a2.style.alignItems = "center", a2.style.margin = "auto", a2.style.padding = "0", a2.style.width = "45%", a2.style.height = "38px";
1588
- const s2 = document.createElement("label");
1589
- s2.htmlFor = `rating-${o}-${t4}`, s2.textContent = e4, s2.style.margin = "0", s2.style.padding = "0";
1590
- const l2 = document.createElement("input");
1591
- l2.id = `rating-${o}-${t4}`, l2.type = "radio", l2.name = o, l2.value = ["Yes", "No"][t4], l2.classList.add(d), l2.classList.add("magicfeedback-input"), l2.style.position = "absolute", l2.style.opacity = "0", l2.style.width = "0", l2.style.height = "0", l2.style.margin = "0", (0, r.autoAdvanceOn)(l2, n), i3 && i3.toLowerCase() === l2.value.toLowerCase() && (l2.checked = true), a2.appendChild(l2), a2.appendChild(s2), c.appendChild(a2);
1592
- }), l.appendChild(c), { element: l, elementTypeClass: d };
1593
- };
1594
- }, 8998(e2, t2, i2) {
1595
- "use strict";
1596
- t2.Z = t2.renderChoice = void 0;
1597
- const a = i2(5558), r = i2(9784), n = i2(7321);
1598
- t2.renderChoice = ({ question: e3, language: i3, urlParamValue: s, randomPosition: l, send: d }) => {
1599
- const { type: c, ref: u, value: p, defaultValue: m, assets: h } = e3, f = document.createElement("div"), g = "magicfeedback-" + ("MULTIPLECHOICE" === c ? "checkbox" : "radio");
1600
- let y = p || [];
1601
- l && (y = y.sort(() => Math.random() - 0.5));
1602
- let v = (null == h ? void 0 : h.exclusiveAnswers) || [];
1603
- (null == h ? void 0 : h.extraOption) && (v = v.filter((e4) => e4 !== h.extraOptionText)), v.length > 0 && (null == v || v.forEach((e4) => {
1604
- y.includes(e4) || y.push(e4);
1605
- }));
1606
- const b = null == h ? void 0 : h.extraOptionText;
1607
- return (null == h ? void 0 : h.extraOption) && b && !y.includes(b) && y.push(b), y.forEach((e4, t3) => {
1608
- const o2 = document.createElement("div");
1609
- o2.classList.add(`magicfeedback-${"MULTIPLECHOICE" === c ? "checkbox" : "radio"}-container`);
1610
- const l2 = document.createElement("label"), p2 = document.createElement("input");
1611
- if (p2.id = `rating-${u}-${t3}`, p2.type = "MULTIPLECHOICE" === c ? "checkbox" : "radio", p2.name = u, p2.value = e4, p2.classList.add(g), p2.classList.add("magicfeedback-input"), c === a.FEEDBACKAPPANSWERTYPE.MULTIPLECHOICE && (null == h ? void 0 : h.maxOptions) && (null == h ? void 0 : h.maxOptions) > 0 && p2.addEventListener("change", () => {
1612
- document.querySelectorAll(`input[name="${u}"]:checked`).length > (null == h ? void 0 : h.maxOptions) && (p2.checked = false);
1613
- }), c === a.FEEDBACKAPPANSWERTYPE.RADIO && d && (!(null == h ? void 0 : h.extraOptionText) || (null == h ? void 0 : h.extraOptionText) && e4 !== (null == h ? void 0 : h.extraOptionText)) && (0, n.autoAdvanceOn)(p2, d), e4 !== m && e4 !== s || (p2.checked = true), l2.textContent = e4, l2.htmlFor = `rating-${u}-${t3}`, p2.addEventListener("change", (t4) => {
1614
- const i4 = document.getElementById(`extra-option-${u}`);
1615
- t4.target.checked && v.includes(e4) ? (y.forEach((t5) => {
1616
- t5 !== e4 && (document.querySelector(`input[value="${t5}"]`).checked = false);
1617
- }), i4 && (i4.style.display = "none")) : v.forEach((t5) => {
1618
- t5 !== e4 && (document.querySelector(`input[value="${t5}"]`).checked = false);
1619
- }), (null == h ? void 0 : h.extraOption) && e4 === (null == h ? void 0 : h.extraOptionText) && i4 && (i4.style.display = t4.target.checked ? "block" : "none");
1620
- }), o2.appendChild(p2), o2.appendChild(l2), f.appendChild(o2), (null == h ? void 0 : h.extraOption) && e4 === (null == h ? void 0 : h.extraOptionText)) {
1621
- const e5 = document.createElement("input");
1622
- e5.type = "text", e5.placeholder = (null == h ? void 0 : h.extraOptionPlaceholder) || r.placeholder.answer(i3 || "en"), e5.classList.add("magicfeedback-extra-option"), e5.classList.add("magicfeedback-input"), e5.id = `extra-option-${u}`, e5.name = `extra-option-${u}`, e5.style.display = "none", f.appendChild(e5);
1623
- }
1624
- }), c === a.FEEDBACKAPPANSWERTYPE.RADIO && "row" === (null == h ? void 0 : h.direction) && (f.classList.add("magicfeedback-radio--row"), (function(e4, i4) {
1625
- if (e4.classList.toggle("magicfeedback-radio--stacked", window.innerWidth < o), "undefined" == typeof ResizeObserver) return;
1626
- const a2 = "function" == typeof requestAnimationFrame ? requestAnimationFrame : (e5) => (e5(0), 0);
1627
- let r2 = 0, n2 = false;
1628
- new ResizeObserver((s2) => {
1629
- var l2;
1630
- const d2 = null === (l2 = s2[0]) || void 0 === l2 ? void 0 : l2.contentRect.width;
1631
- d2 && d2 !== r2 && (r2 = d2, n2 || (n2 = true, a2(() => {
1632
- n2 = false, ((a3) => {
1633
- const r3 = parseFloat(getComputedStyle(e4).columnGap) || 0, n3 = i4 * t2.Z + (i4 - 1) * r3;
1634
- e4.classList.toggle("magicfeedback-radio--stacked", window.innerWidth < o || a3 < n3);
1635
- })(r2);
1636
- })));
1637
- }).observe(e4);
1638
- })(f, y.length)), { element: f, elementTypeClass: g };
1639
- }, t2.Z = 120;
1640
- const o = 600;
1641
- }, 1991(e2, t2, i2) {
1642
- "use strict";
1643
- t2.renderConsent = void 0;
1644
- const a = i2(7321);
1645
- t2.renderConsent = ({ question: e3, urlParamValue: t3, send: i3 }) => {
1646
- const { id: r, ref: n, value: o, require: s } = e3, l = document.createElement("input");
1647
- return l.type = "checkbox", l.id = `magicfeedback-${r}`, l.name = n, l.value = "true", l.required = s, l.classList.add("magicfeedback-consent"), l.classList.add("magicfeedback-input"), t3 && o.includes(t3) && (l.checked = true), (0, a.autoAdvanceOn)(l, i3), { element: l, elementTypeClass: "magicfeedback-consent" };
1648
- };
1649
- }, 8817(e2, t2, i2) {
1650
- "use strict";
1651
- t2.renderDate = void 0;
1652
- const a = i2(9784);
1653
- t2.renderDate = ({ language: e3, placeholderText: t3, urlParamValue: i3 }) => {
1654
- const r = document.createElement("input");
1655
- return r.type = "date", r.placeholder = t3 || a.placeholder.date(e3 || "en"), i3 && (r.value = i3), { element: r, elementTypeClass: "magicfeedback-date" };
1656
- };
1657
- }, 9965(e2, t2, i2) {
1658
- "use strict";
1659
- t2.renderEmail = void 0;
1660
- const a = i2(881), r = { outside: "magicfeedback-email-row", inside: "magicfeedback-email-inset" };
1661
- function n(e3, t3) {
1662
- var i3;
1663
- document.activeElement !== e3 && e3.focus();
1664
- const a2 = e3.value;
1665
- try {
1666
- if ("function" == typeof document.execCommand && document.execCommand("insertText", false, t3) && e3.value !== a2) return "insertText";
1667
- } catch (e4) {
1668
- }
1669
- try {
1670
- if ("number" == typeof e3.selectionStart) return e3.setRangeText(t3, e3.selectionStart, null !== (i3 = e3.selectionEnd) && void 0 !== i3 ? i3 : e3.selectionStart, "end"), e3.dispatchEvent(new Event("input", { bubbles: true })), "setRangeText";
1671
- } catch (e4) {
1672
- }
1673
- return e3.value = a2 + t3, e3.dispatchEvent(new Event("input", { bubbles: true })), "append";
1674
- }
1675
- function o(e3, t3, i3) {
1676
- const o2 = document.createElement("div");
1677
- o2.classList.add(r[t3]);
1678
- const s = document.createElement("button");
1679
- s.type = "button", s.classList.add("magicfeedback-email-at"), s.textContent = "@", s.setAttribute("aria-label", (0, a.t)(i3, "email.atButton"));
1680
- const l = (e4) => e4.preventDefault();
1681
- s.addEventListener("pointerdown", l), s.addEventListener("mousedown", l), s.addEventListener("click", () => n(e3, "@")), o2.appendChild(e3), o2.appendChild(s);
1682
- const d = document.createElement("p");
1683
- d.classList.add("magicfeedback-email-hint");
1684
- const c = (0, a.t)(i3, "email.atHint"), u = c.indexOf("@");
1685
- if (u >= 0) {
1686
- const e4 = document.createElement("b");
1687
- e4.textContent = "@", d.append(c.slice(0, u), e4, c.slice(u + 1));
1688
- } else d.textContent = c;
1689
- const p = document.createElement("div");
1690
- return p.classList.add("magicfeedback-email-container"), p.appendChild(o2), p.appendChild(d), p;
1691
- }
1692
- t2.renderEmail = ({ question: e3, language: t3, placeholderText: i3, urlParamValue: a2 }) => {
1693
- var r2;
1694
- const s = document.createElement("input");
1695
- s.type = "email", s.placeholder = i3 || "you@example.com";
1696
- const l = "magicfeedback-email";
1697
- a2 && (s.value = a2), (function(e4) {
1698
- let t4 = 0;
1699
- e4.addEventListener("keydown", (i4) => {
1700
- (function(e5) {
1701
- return "Digit2" === e5.code && e5.altKey && !e5.ctrlKey && !e5.metaKey && !e5.isComposing;
1702
- })(i4) && (i4.preventDefault(), n(e4, "@"), t4 = Date.now() + 150);
1703
- }), e4.addEventListener("beforeinput", (e5) => {
1704
- Date.now() < t4 && "insertText" === e5.inputType && e5.data && "@" !== e5.data && e5.preventDefault();
1705
- });
1706
- })(s);
1707
- const d = null === (r2 = null == e3 ? void 0 : e3.assets) || void 0 === r2 ? void 0 : r2.atButton;
1708
- return "outside" === d || "inside" === d ? { element: s, elementTypeClass: l, container: o(s, d, t3) } : { element: s, elementTypeClass: l };
1709
- };
1710
- }, 2282(e2, t2) {
1711
- "use strict";
1712
- t2.renderInfoPage = void 0, t2.renderInfoPage = ({ question: e3, placeholderText: t3 }) => {
1713
- var i2, a;
1714
- const r = document.createElement("div");
1715
- if ("string" == typeof (null === (i2 = e3.assets) || void 0 === i2 ? void 0 : i2.placeholder) ? "" !== e3.assets.placeholder.trim() : Boolean(null === (a = e3.assets) || void 0 === a ? void 0 : a.placeholder)) {
1716
- const e4 = document.createElement("div");
1717
- e4.classList.add("magicfeedback-info-message"), e4.innerHTML = t3 || "", r.appendChild(e4);
1718
- }
1719
- return { element: r, elementTypeClass: "magicfeedback-info-page" };
1720
- };
1721
- }, 1072(e2, t2, i2) {
1722
- "use strict";
1723
- t2.renderLongText = void 0;
1724
- const a = i2(9784);
1725
- t2.renderLongText = ({ language: e3, placeholderText: t3, urlParamValue: i3, maxCharacters: r }) => {
1726
- const n = document.createElement("textarea");
1727
- return n.rows = 3, r > 0 && (n.maxLength = r), n.placeholder = t3 || a.placeholder.answer(e3 || "en"), i3 && (n.value = i3), { element: n, elementTypeClass: "magicfeedback-longtext" };
1728
- };
1729
- }, 2644(e2, t2) {
1730
- "use strict";
1731
- t2.renderMatrix = void 0, t2.renderMatrix = ({ question: e3, isPhone: t3, randomPosition: i2 }) => {
1732
- const { ref: a, value: r, assets: n } = e3, o = document.createElement("div"), s = document.createElement("div");
1733
- s.classList.add("magicfeedback-multi-question-matrix-container");
1734
- let l = (null == n ? void 0 : n.options) || [], d = [...r], c = [];
1735
- if (i2 && (l = null == l ? void 0 : l.sort(() => Math.random() - 0.5), d = [...d].sort(() => Math.random() - 0.5)), (null == n ? void 0 : n.exclusiveAnswers) && (c = null == n ? void 0 : n.exclusiveAnswers, null == c || c.forEach((e4) => {
1736
- d.includes(e4) || d.push(e4);
1737
- })), t3) {
1738
- const e4 = document.createElement("div");
1739
- e4.classList.add("magicfeedback-multi-question-matrix-list"), null == l || l.forEach((t4) => {
1740
- const i3 = document.createElement("div");
1741
- i3.classList.add("magicfeedback-multi-question-matrix-list-item"), i3.style.display = "flex", i3.style.flexDirection = "column", i3.style.alignItems = "flex-start", i3.style.marginBottom = "10px";
1742
- const r2 = document.createElement("label");
1743
- r2.classList.add("magicfeedback-multi-question-matrix-label"), r2.style.paddingBottom = "10px", r2.textContent = t4, i3.appendChild(r2), d.forEach((e5) => {
1744
- const r3 = document.createElement("div");
1745
- r3.classList.add("magicfeedback-radio-container"), r3.style.display = "flex", r3.style.alignItems = "center", r3.style.justifyContent = "flex-start", r3.style.width = "99%", r3.style.margin = "5px auto";
1746
- const n2 = document.createElement("label"), o2 = document.createElement("input");
1747
- o2.id = `${a}-${t4}-${e5}`, o2.type = "radio", o2.name = `${a}-${t4}`, o2.value = e5, o2.classList.add("magicfeedback-input"), n2.textContent = e5, n2.htmlFor = `${a}-${t4}-${e5}`, r3.appendChild(o2), r3.appendChild(n2), i3.appendChild(r3);
1748
- }), e4.appendChild(i3);
1749
- }), s.appendChild(e4);
1750
- } else {
1751
- const e4 = document.createElement("table");
1752
- e4.classList.add("magicfeedback-multi-question-matrix-table");
1753
- const t4 = document.createElement("thead");
1754
- t4.classList.add("magicfeedback-multi-question-matrix-header"), t4.style.paddingBottom = "15px";
1755
- const i3 = document.createElement("tr"), r2 = document.createElement("th");
1756
- i3.appendChild(r2), d.forEach((e5) => {
1757
- const t5 = document.createElement("th");
1758
- t5.textContent = e5, i3.appendChild(t5);
1759
- }), t4.appendChild(i3), e4.appendChild(t4);
1760
- const n2 = document.createElement("tbody");
1761
- null == l || l.forEach((e5) => {
1762
- const t5 = document.createElement("tr");
1763
- t5.classList.add("magicfeedback-multi-question-matrix-row-tr");
1764
- const i4 = document.createElement("td");
1765
- i4.classList.add("magicfeedback-multi-question-matrix-question");
1766
- const r3 = document.createElement("label");
1767
- r3.classList.add("magicfeedback-multi-question-matrix-label"), r3.textContent = e5, i4.appendChild(r3), t5.appendChild(i4), d.forEach((i5) => {
1768
- const r4 = document.createElement("td"), n3 = document.createElement("input");
1769
- n3.type = "radio", n3.name = `${a}-${e5}`, n3.value = i5, n3.id = `${a}-${e5}-${i5}`, n3.classList.add("magicfeedback-input");
1770
- const o2 = document.createElement("label");
1771
- o2.classList.add("magicfeedback-multi-question-matrix-option-label"), o2.htmlFor = n3.id, o2.textContent = i5, r4.classList.add("magicfeedback-multi-question-matrix-option"), r4.appendChild(n3), r4.appendChild(o2), t5.appendChild(r4);
1772
- }), n2.appendChild(t5);
1773
- }), e4.appendChild(n2), s.appendChild(e4);
1774
- }
1775
- return o.appendChild(s), { element: o, elementTypeClass: "magicfeedback-multi-question-matrix" };
1776
- };
1777
- }, 8736(e2, t2, i2) {
1778
- "use strict";
1779
- t2.renderMaxDiff = void 0;
1780
- const a = i2(516), r = i2(881), n = "http://www.w3.org/2000/svg";
1781
- t2.renderMaxDiff = ({ question: e3, language: t3, randomPosition: i3 }) => {
1782
- const { ref: o, value: s, assets: l } = e3, d = document.createElement("div");
1783
- let c = [...s || []];
1784
- i3 && (c = c.sort(() => Math.random() - 0.5));
1785
- const u = { best: (0, a.parseTitle)(null == l ? void 0 : l.bestLabel, t3) || (0, r.t)(t3, "maxDiff.best"), worst: (0, a.parseTitle)(null == l ? void 0 : l.worstLabel, t3) || (0, r.t)(t3, "maxDiff.worst") }, p = document.createElement("div");
1786
- p.classList.add("magicfeedback-max-diff-container");
1787
- const m = Number(null == l ? void 0 : l.setIndex) || 1, h = Number(null == l ? void 0 : l.setCount) || 1;
1788
- (null == l ? void 0 : l.showSetProgress) && h > 1 && p.appendChild((function(e4, t4, i4) {
1789
- const a2 = document.createElement("div");
1790
- a2.classList.add("magicfeedback-max-diff-progress");
1791
- const n2 = document.createElement("span");
1792
- n2.classList.add("magicfeedback-max-diff-progress-label"), n2.textContent = (0, r.t)(i4, "maxDiff.setProgress", { k: e4, n: t4 });
1793
- const o2 = document.createElement("span");
1794
- o2.classList.add("magicfeedback-max-diff-progress-track"), o2.setAttribute("aria-hidden", "true");
1795
- const s2 = document.createElement("span");
1796
- return s2.classList.add("magicfeedback-max-diff-progress-fill"), s2.style.width = `${Math.min(100, e4 / t4 * 100)}%`, o2.appendChild(s2), a2.appendChild(n2), a2.appendChild(o2), a2;
1797
- })(m, h, t3));
1798
- const f = document.createElement("table");
1799
- f.classList.add("magicfeedback-max-diff-table");
1800
- const g = (e4) => {
1801
- const t4 = document.createElement("th");
1802
- t4.scope = "col", t4.classList.add("magicfeedback-max-diff-head", `magicfeedback-max-diff-head-${e4}`);
1803
- const i4 = document.createElement("span");
1804
- return i4.classList.add("magicfeedback-max-diff-head-label"), i4.appendChild((function(e5) {
1805
- const t5 = document.createElementNS(n, "svg");
1806
- t5.setAttribute("viewBox", "0 0 24 24"), t5.setAttribute("width", "16"), t5.setAttribute("height", "16"), t5.setAttribute("fill", "none"), t5.setAttribute("stroke", "currentColor"), t5.setAttribute("stroke-width", "2.6"), t5.setAttribute("stroke-linecap", "round"), t5.setAttribute("stroke-linejoin", "round"), t5.setAttribute("aria-hidden", "true");
1807
- const i5 = document.createElementNS(n, "path");
1808
- return i5.setAttribute("d", "best" === e5 ? "M12 19V5M5 12l7-7 7 7" : "M12 5v14M19 12l-7 7-7-7"), t5.appendChild(i5), t5;
1809
- })(e4)), i4.appendChild(document.createTextNode(u[e4])), t4.appendChild(i4), t4;
1810
- }, y = document.createElement("thead"), v = document.createElement("tr"), b = document.createElement("td");
1811
- b.classList.add("magicfeedback-max-diff-head-spacer"), v.appendChild(g("best")), v.appendChild(b), v.appendChild(g("worst")), y.appendChild(v), f.appendChild(y);
1812
- const E = (e4, t4, i4) => {
1813
- const a2 = document.createElement("td");
1814
- a2.classList.add("magicfeedback-max-diff-cell");
1815
- const r2 = document.createElement("label");
1816
- r2.classList.add("magicfeedback-max-diff-pick");
1817
- const n2 = document.createElement("input");
1818
- return n2.type = "radio", n2.name = `${o}-${e4}`, n2.value = t4, n2.id = `${o}-${e4}-${i4}`, n2.classList.add("magicfeedback-input", "magicfeedback-max-diff-input", `magicfeedback-max-diff-${e4}`), n2.setAttribute("aria-label", `${t4}: ${u[e4]}`), r2.appendChild(n2), a2.appendChild(r2), a2;
1819
- }, k = document.createElement("tbody");
1820
- return c.forEach((e4, t4) => {
1821
- const i4 = document.createElement("tr");
1822
- i4.classList.add("magicfeedback-max-diff-row");
1823
- const a2 = document.createElement("th");
1824
- a2.scope = "row", a2.classList.add("magicfeedback-max-diff-item"), a2.textContent = e4, i4.appendChild(E("best", e4, t4)), i4.appendChild(a2), i4.appendChild(E("worst", e4, t4)), k.appendChild(i4);
1825
- }), f.appendChild(k), f.addEventListener("change", (e4) => {
1826
- var t4;
1827
- const i4 = e4.target;
1828
- i4.classList.contains("magicfeedback-max-diff-input") && (null === (t4 = i4.closest("tr")) || void 0 === t4 || t4.querySelectorAll(".magicfeedback-max-diff-input").forEach((e5) => {
1829
- e5 !== i4 && (e5.checked = false);
1830
- }));
1831
- }), p.appendChild(f), d.appendChild(p), { element: d, elementTypeClass: "magicfeedback-max-diff" };
1832
- };
1833
- }, 8409(e2, t2, i2) {
1834
- "use strict";
1835
- t2.renderMultipleChoiceImage = void 0;
1836
- const a = i2(7321);
1837
- t2.renderMultipleChoiceImage = ({ question: e3, randomPosition: t3, urlParamValue: i3, send: r }) => {
1838
- const n = document.createElement("div"), { ref: o, assets: s } = e3;
1839
- let l = [...e3.value];
1840
- const d = document.createElement("div");
1841
- d.classList.add("magicfeedback-multiple-choice-image-container"), d.style.display = "flex", d.style.flexDirection = "row", d.style.flexWrap = "wrap", d.style.justifyContent = "center";
1842
- const c = l.length;
1843
- let u = 1, p = 1;
1844
- if (window.innerWidth < 600) u = 1, p = c;
1845
- else switch (c) {
1846
- case 1:
1847
- case 2:
1848
- case 3:
1849
- u = c, p = 1;
1850
- break;
1851
- case 4:
1852
- case 5:
1853
- case 6:
1854
- p = 2, u = Math.ceil(c / p);
1855
- break;
1856
- case 7:
1857
- case 8:
1858
- case 9:
1859
- p = 3, u = Math.ceil(c / p);
1860
- break;
1861
- default:
1862
- p = 4, u = Math.ceil(c / p);
1863
- }
1864
- const m = void 0 !== (null == s ? void 0 : s.addTitle) && (null == s ? void 0 : s.addTitle), h = void 0 !== (null == s ? void 0 : s.multiOption) && (null == s ? void 0 : s.multiOption), f = void 0 !== (null == s ? void 0 : s.extraOption) && (null == s ? void 0 : s.extraOption);
1865
- function g(e4) {
1866
- try {
1867
- const { position: t4, url: n2, value: s2 } = e4, l2 = document.createElement("div");
1868
- l2.classList.add("magicfeedback-multiple-choice-image-option"), l2.style.width = `calc(100% / ${u} - 2px)`, l2.style.height = `calc(100% / ${p} - 2px)`, l2.style.padding = "8px", l2.style.margin = "0";
1869
- const c2 = document.createElement("label");
1870
- c2.classList.add("magicfeedback-image-option-label-container"), c2.htmlFor = `rating-${o}-${t4}`, c2.style.cursor = "pointer", c2.addEventListener("click", () => {
1871
- c2.style.border = "2px solid #000";
1872
- });
1873
- const f2 = document.createElement("label");
1874
- f2.textContent = s2, f2.classList.add("magicfeedback-multiple-choice-image-label");
1875
- const g2 = document.createElement("input");
1876
- g2.id = `rating-${o}-${t4}`, g2.type = h ? "checkbox" : "radio", g2.name = o, g2.value = s2, g2.style.position = "absolute", g2.style.opacity = "0", g2.style.width = "0", g2.style.height = "0", g2.classList.add("magicfeedback-input"), i3 && i3 === g2.value && (g2.checked = true), h || (0, a.autoAdvanceOn)(g2, r);
1877
- const y = document.createElement("img");
1878
- y.classList.add("magicfeedback-multiple-choice-image-image"), y.src = n2, y.style.cursor = "pointer", y.style.backgroundSize = "cover", y.style.backgroundPosition = "center", y.style.width = "100%", y.style.height = "100%", y.style.objectFit = "cover", y.style.margin = "auto", c2.appendChild(g2), c2.appendChild(y), m && c2.appendChild(f2), l2.appendChild(c2), d.appendChild(l2);
1879
- } catch (e5) {
1880
- console.error(e5);
1881
- }
1882
- }
1883
- return t3 && (l = l.sort(() => Math.random() - 0.5)), l.forEach((e4) => g(JSON.parse(e4))), f && (null == s ? void 0 : s.extraOptionValue) && (null == s ? void 0 : s.extraOptionValue.length) > 0 && g(null == s ? void 0 : s.extraOptionValue[0]), n.appendChild(d), { element: n, elementTypeClass: "magicfeedback-multiple-choice-image" };
1884
- };
1885
- }, 6732(e2, t2, i2) {
1886
- "use strict";
1887
- t2.renderNumber = void 0;
1888
- const a = i2(9784), r = i2(516);
1889
- t2.renderNumber = ({ question: e3, format: t3, language: i3, urlParamValue: n }) => {
1890
- const o = document.createElement("input");
1891
- o.type = "number", o.placeholder = "slim" === t3 ? (0, r.parseTitle)(e3.title, i3) : a.placeholder.number(i3 || "en");
1892
- const { value: s } = e3;
1893
- return s.length && (s.sort((e4, t4) => Number(e4) - Number(t4)), o.max = s[s.length - 1], o.min = s[0], o.value = s[0]), n && !isNaN(Number(n)) && (o.value = n), { element: o, elementTypeClass: "magicfeedback-number" };
1894
- };
1895
- }, 9180(e2, t2, i2) {
1896
- "use strict";
1897
- t2.renderPassword = void 0;
1898
- const a = i2(9784);
1899
- t2.renderPassword = ({ language: e3, placeholderText: t3, urlParamValue: i3 }) => {
1900
- const r = document.createElement("input");
1901
- return r.type = "password", r.placeholder = t3 || a.placeholder.password(e3 || "en"), i3 && (r.value = i3), { element: r, elementTypeClass: "magicfeedback-password" };
1902
- };
1903
- }, 1066(e2, t2, i2) {
1904
- "use strict";
1905
- t2.renderPointSystem = void 0;
1906
- const a = i2(9784);
1907
- t2.renderPointSystem = ({ question: e3, language: t3 }) => {
1908
- const { ref: i3, value: r } = e3, n = document.createElement("div"), o = document.createElement("div");
1909
- o.classList.add("magicfeedback-point-system-container");
1910
- const s = document.createElement("ul");
1911
- s.classList.add("magicfeedback-point-system-list"), s.style.padding = "0";
1912
- const l = 100 / r.length, d = document.createElement("div");
1913
- d.classList.add("magicfeedback-error"), d.textContent = a.placeholder.pointsystemerror(t3 || "en"), d.style.color = "#C70039", d.style.fontSize = "14px", d.style.textAlign = "end", d.style.width = "100%", d.style.display = "none";
1914
- const c = document.createElement("div");
1915
- c.classList.add("magicfeedback-point-system-total"), c.style.textAlign = "end", c.style.fontSize = "15px", c.style.marginTop = "5px";
1916
- const u = document.createElement("bdi");
1917
- return u.setAttribute("dir", "ltr"), u.textContent = "0 / 100 %", c.appendChild(u), r.forEach((e4, t4) => {
1918
- const a2 = document.createElement("li");
1919
- a2.classList.add("magicfeedback-point-system-item"), a2.style.display = "flex", a2.style.justifyContent = "space-between", a2.style.alignItems = "center", a2.style.margin = "5px";
1920
- const r2 = document.createElement("label");
1921
- r2.textContent = e4, r2.style.fontSize = "15px", a2.appendChild(r2);
1922
- const n2 = document.createElement("span");
1923
- n2.classList.add("magicfeedback-point-system-input-container");
1924
- const o2 = document.createElement("input");
1925
- o2.name = i3, o2.id = `${e4}`, o2.type = "number", o2.min = "0", o2.max = "100", o2.value = "0", o2.classList.add("magicfeedback-input"), o2.style.width = "40px", o2.style.border = "0", o2.style.textAlign = "center", o2.style.margin = "0 5px", o2.autofocus = 0 === t4;
1926
- const p = document.createElement("span");
1927
- p.textContent = "%", p.style.color = "#000", o2.addEventListener("input", () => {
1928
- const e5 = s.querySelectorAll("input");
1929
- let t5 = 0;
1930
- e5.forEach((e6) => {
1931
- t5 += Number(e6.value);
1932
- }), t5 > 100 && (o2.value = `${l}%`, t5 -= Number(o2.value));
1933
- const i4 = document.getElementById("magicfeedback-submit");
1934
- i4 && (t5 < 100 ? (c.style.color = "orange", i4.setAttribute("disabled", "true")) : (d.style.display = "none", c.style.color = "green", i4.removeAttribute("disabled"))), u.textContent = `${t5} / 100 %`;
1935
- }), o2.addEventListener("focus", () => {
1936
- const e5 = document.getElementById("magicfeedback-submit");
1937
- e5 && (e5.setAttribute("disabled", "true"), e5.addEventListener("pointerover", () => {
1938
- const e6 = s.querySelectorAll("input");
1939
- let t5 = 0;
1940
- e6.forEach((e7) => {
1941
- t5 += Number(e7.value);
1942
- }), t5 < 100 && (d.style.display = "block");
1943
- }));
1944
- }), n2.appendChild(o2), n2.appendChild(p), a2.appendChild(n2), s.appendChild(a2);
1945
- }), o.appendChild(s), o.appendChild(c), o.appendChild(d), n.appendChild(o), { element: n, elementTypeClass: "magicfeedback-point-system" };
1946
- };
1947
- }, 2773(e2, t2, i2) {
1948
- "use strict";
1949
- t2.renderPriorityList = void 0;
1950
- const a = i2(881);
1951
- t2.renderPriorityList = ({ question: e3, randomPosition: t3, language: i3 }) => {
1952
- var r, n, o;
1953
- const s = document.createElement("div"), l = (function(e4) {
1954
- const { value: t4, ref: i4, randomPosition: r2 = false, limitPriority: n2 = false, maxPriority: o2 = 0, language: s2 = "en", placeholder: l2 = "" } = e4, d = (e5) => (0, a.t)(s2, "priority." + e5), c = document.createElement("div");
1955
- if (c.classList.add("magicfeedback-priority-list-container"), n2 && o2 && o2 > 0) {
1956
- const e5 = [], n3 = document.createElement("div");
1957
- n3.classList.add("magicfeedback-priority-list-header");
1958
- const u2 = document.createElement("div");
1959
- u2.classList.add("magicfeedback-priority-list-instruction"), u2.textContent = "" !== l2 ? l2 : `${d("instruction")}`, u2.style.display = "none";
1960
- const p2 = document.createElement("button");
1961
- p2.type = "button", p2.textContent = d("selectOptions"), p2.classList.add("magicfeedback-button"), p2.classList.add("magicfeedback-priority-list-open-btn"), n3.appendChild(p2), n3.appendChild(u2);
1962
- const m = document.createElement("div");
1963
- m.classList.add("magicfeedback-priority-list-reorder");
1964
- const h = document.createElement("ul");
1965
- h.classList.add("magicfeedback-priority-list-list"), m.appendChild(h);
1966
- const f = () => {
1967
- h.innerHTML = "", e5.forEach((t5, a2) => {
1968
- const r3 = document.createElement("li");
1969
- r3.classList.add("magicfeedback-priority-list-item");
1970
- const n4 = document.createElement("input");
1971
- n4.classList.add("magicfeedback-input-magicfeedback-priority-list"), n4.classList.add("magicfeedback-input"), n4.type = "hidden", n4.id = `priority-list-${i4}`, n4.name = i4, n4.value = `${a2 + 1}. ${t5}`, r3.appendChild(n4);
1972
- const o3 = document.createElement("label");
1973
- o3.classList.add("magicfeedback-priority-list-item-label"), o3.textContent = `${a2 + 1}. ${t5}`, r3.appendChild(o3);
1974
- const s3 = document.createElement("div");
1975
- s3.classList.add("magicfeedback-priority-list-arrows");
1976
- const l3 = document.createElement("img");
1977
- l3.classList.add("magicfeedback-priority-list-arrow-up"), l3.src = "https://magicfeedback-c6458-dev.web.app/assets/arrow.svg", l3.style.visibility = 0 === a2 ? "hidden" : "visible";
1978
- const d2 = document.createElement("img");
1979
- d2.classList.add("magicfeedback-priority-list-arrow-down"), d2.src = "https://magicfeedback-c6458-dev.web.app/assets/arrow.svg", d2.style.transform = "rotate(180deg)", d2.style.visibility = a2 === e5.length - 1 ? "hidden" : "visible", l3.addEventListener("click", () => {
1980
- var i5, a3, s4, c2;
1981
- const u3 = r3.previousElementSibling;
1982
- if (u3) {
1983
- const p3 = Number(null === (i5 = n4.value) || void 0 === i5 ? void 0 : i5.split(".")[0]) - 1;
1984
- n4.value = `${p3}. ${t5}`, o3.textContent = `${p3}. ${t5}`, l3.style.visibility = 1 === p3 ? "hidden" : "visible", d2.style.visibility = p3 === e5.length ? "hidden" : "visible";
1985
- const m2 = u3.querySelector(".magicfeedback-input-magicfeedback-priority-list"), f2 = u3.querySelector(".magicfeedback-priority-list-item-label"), g2 = u3.querySelector(".magicfeedback-priority-list-arrow-up"), y2 = u3.querySelector(".magicfeedback-priority-list-arrow-down");
1986
- if (m2 && f2 && g2 && y2) {
1987
- const t6 = Number(null === (a3 = m2.value) || void 0 === a3 ? void 0 : a3.split(".")[0]) + 1;
1988
- m2.value = `${t6}.${null === (s4 = f2.textContent) || void 0 === s4 ? void 0 : s4.split(".")[1]}`, f2.textContent = `${t6}.${null === (c2 = f2.textContent) || void 0 === c2 ? void 0 : c2.split(".")[1]}`, g2.style.visibility = 1 === t6 ? "hidden" : "visible", y2.style.visibility = t6 === e5.length ? "hidden" : "visible";
1989
- }
1990
- h.insertBefore(r3, u3);
1991
- }
1992
- }), d2.addEventListener("click", () => {
1993
- var i5, a3, s4;
1994
- const c2 = r3.nextElementSibling;
1995
- if (c2) {
1996
- const u3 = Number(null === (i5 = n4.value) || void 0 === i5 ? void 0 : i5.split(".")[0]) + 1;
1997
- n4.value = `${u3}. ${t5}`, o3.textContent = `${u3}. ${t5}`, l3.style.visibility = 1 === u3 ? "hidden" : "visible", d2.style.visibility = u3 === e5.length ? "hidden" : "visible";
1998
- const p3 = c2.querySelector(".magicfeedback-input-magicfeedback-priority-list"), m2 = c2.querySelector(".magicfeedback-priority-list-item-label"), f2 = c2.querySelector(".magicfeedback-priority-list-arrow-up"), g2 = c2.querySelector(".magicfeedback-priority-list-arrow-down");
1999
- if (p3 && m2 && f2 && g2) {
2000
- const t6 = Number(p3.value.split(".")[0]) - 1;
2001
- p3.value = `${t6}.${null === (a3 = m2.textContent) || void 0 === a3 ? void 0 : a3.split(".")[1]}`, m2.textContent = `${t6}.${null === (s4 = m2.textContent) || void 0 === s4 ? void 0 : s4.split(".")[1]}`, f2.style.visibility = 1 === t6 ? "hidden" : "visible", g2.style.visibility = t6 === e5.length ? "hidden" : "visible";
2002
- }
2003
- h.insertBefore(c2, r3);
2004
- }
2005
- }), s3.appendChild(l3), s3.appendChild(d2), r3.appendChild(s3), h.appendChild(r3);
2006
- });
2007
- }, g = document.createElement("div");
2008
- g.classList.add("magicfeedback-modal-backdrop"), g.setAttribute("dir", (0, a.isRtlLanguage)(s2) ? "rtl" : "ltr"), g.style.position = "fixed", g.style.top = "0", g.style.left = "0", g.style.width = "100vw", g.style.height = "100vh", g.style.background = "rgba(0,0,0,0.4)", g.style.display = "none", g.style.alignItems = "center", g.style.justifyContent = "center", g.style.zIndex = "9999";
2009
- const y = document.createElement("div");
2010
- y.classList.add("magicfeedback-modal"), y.style.background = "#fff", y.style.borderRadius = "8px", y.style.boxShadow = "0 8px 24px rgba(0,0,0,0.2)", y.style.maxWidth = "520px", y.style.width = "90%", y.style.maxHeight = "80vh", y.style.display = "flex", y.style.flexDirection = "column", y.style.overflow = "hidden", y.style.padding = "16px", y.style.position = "relative";
2011
- const v = document.createElement("h5");
2012
- v.classList.add("magicfeedback-modal-title"), v.style.flexShrink = "0", v.style.marginTop = "0";
2013
- const b = () => Math.min(e5.length + 1, o2), E = () => {
2014
- v.textContent = `${d("selectOptionNumber")}${b()}`;
2015
- };
2016
- E();
2017
- const k = document.createElement("div");
2018
- k.classList.add("magicfeedback-modal-list"), k.style.flex = "1 1 auto", k.style.overflowY = "auto", k.style.minHeight = "0", (r2 ? [...t4].sort(() => Math.random() - 0.5) : [...t4]).forEach((t5) => {
2019
- const a2 = document.createElement("label");
2020
- a2.classList.add("magicfeedback-modal-row");
2021
- const r3 = document.createElement("input");
2022
- r3.type = "checkbox", r3.classList.add("magicfeedback-input"), r3.name = `${i4}-selection`, r3.value = t5;
2023
- const n4 = document.createElement("span");
2024
- n4.textContent = t5, r3.addEventListener("change", () => {
2025
- if (r3.checked) {
2026
- if (e5.length >= o2) return r3.checked = false, a2.classList.add("magicfeedback-warning"), void setTimeout(() => {
2027
- a2.classList.remove("magicfeedback-warning");
2028
- }, 800);
2029
- e5.push(t5);
2030
- } else {
2031
- const i5 = e5.indexOf(t5);
2032
- -1 !== i5 && e5.splice(i5, 1);
2033
- }
2034
- E(), C();
2035
- }), a2.appendChild(r3), a2.appendChild(n4), k.appendChild(a2);
2036
- });
2037
- const A = document.createElement("div");
2038
- A.classList.add("magicfeedback-modal-actions"), A.style.flexShrink = "0";
2039
- const T = document.createElement("div");
2040
- T.classList.add("magicfeedback-modal-counter");
2041
- const C = () => {
2042
- const t5 = d("of");
2043
- T.textContent = `${d("prioritized")} ${e5.length} ${t5} ${o2}`, u2.style.display = e5.length > 0 ? "block" : "none";
2044
- };
2045
- C();
2046
- const x = document.createElement("button");
2047
- x.type = "button", x.classList.add("magicfeedback-modal-close"), x.setAttribute("aria-label", d("cancel")), x.title = d("cancel"), x.textContent = "\xD7", x.style.position = "absolute", x.style.top = "8px", x.style.setProperty("inset-inline-end", "8px"), x.style.border = "none", x.style.background = "transparent", x.style.fontSize = "24px", x.style.cursor = "pointer";
2048
- const w = () => {
2049
- document.body.appendChild(g), g.style.display = "flex", E(), C();
2050
- }, S = () => {
2051
- g.style.display = "none", c.appendChild(g);
2052
- };
2053
- x.addEventListener("click", () => {
2054
- S();
2055
- });
2056
- const P = document.createElement("button");
2057
- return P.type = "button", P.textContent = d("confirm"), P.classList.add("magicfeedback-button"), P.classList.add("magicfeedback-button-primary"), P.addEventListener("click", () => {
2058
- S(), f();
2059
- }), A.appendChild(T), A.appendChild(P), y.appendChild(x), y.appendChild(v), y.appendChild(k), y.appendChild(A), g.appendChild(y), p2.addEventListener("click", () => {
2060
- w();
2061
- }), g.addEventListener("click", (e6) => {
2062
- e6.target === g && S();
2063
- }), c.appendChild(n3), c.appendChild(m), c.appendChild(g), f(), c;
2064
- }
2065
- const u = document.createElement("ul");
2066
- u.classList.add("magicfeedback-priority-list-list");
2067
- const p = r2 ? [...t4].sort(() => Math.random() - 0.5) : [...t4];
2068
- return p.forEach((e5, t5) => {
2069
- const a2 = document.createElement("li");
2070
- a2.classList.add("magicfeedback-priority-list-item"), a2.style.display = "flex", a2.style.justifyContent = "space-between", a2.style.alignItems = "center", a2.style.margin = "5px";
2071
- const r3 = document.createElement("input");
2072
- r3.classList.add("magicfeedback-input-magicfeedback-priority-list"), r3.classList.add("magicfeedback-input"), r3.type = "hidden", r3.id = `priority-list-${i4}`, r3.name = i4, r3.value = `${t5 + 1}. ${e5}`, a2.appendChild(r3);
2073
- const n3 = document.createElement("label");
2074
- n3.classList.add("magicfeedback-priority-list-item-label"), n3.textContent = `${t5 + 1}. ${e5}`, a2.appendChild(n3);
2075
- const o3 = document.createElement("div");
2076
- o3.style.display = "flex", o3.style.alignItems = "center", o3.style.justifyContent = "space-between";
2077
- const s3 = document.createElement("img");
2078
- s3.classList.add("magicfeedback-priority-list-arrow-up"), s3.src = "https://magicfeedback-c6458-dev.web.app/assets/arrow.svg", s3.style.width = "20px", s3.style.height = "20px", s3.style.cursor = "pointer", s3.style.margin = "0 5px", s3.style.color = "#000", s3.style.visibility = 0 === t5 ? "hidden" : "visible", s3.addEventListener("click", () => {
2079
- var t6, i5, o4, d2;
2080
- const c2 = a2.previousElementSibling;
2081
- if (c2) {
2082
- const m = Number(null === (t6 = r3.value) || void 0 === t6 ? void 0 : t6.split(".")[0]) - 1;
2083
- r3.value = `${m}. ${e5}`, n3.textContent = `${m}. ${e5}`, s3.style.visibility = 1 === m ? "hidden" : "visible", l3.style.visibility = m === p.length ? "hidden" : "visible";
2084
- const h = c2.querySelector(".magicfeedback-input-magicfeedback-priority-list"), f = c2.querySelector(".magicfeedback-priority-list-item-label"), g = c2.querySelector(".magicfeedback-priority-list-arrow-up"), y = c2.querySelector(".magicfeedback-priority-list-arrow-down");
2085
- if (h && f && g && y) {
2086
- const e6 = Number(null === (i5 = h.value) || void 0 === i5 ? void 0 : i5.split(".")[0]) + 1;
2087
- h.value = `${e6}.${null === (o4 = f.textContent) || void 0 === o4 ? void 0 : o4.split(".")[1]}`, f.textContent = `${e6}.${null === (d2 = f.textContent) || void 0 === d2 ? void 0 : d2.split(".")[1]}`, g.style.visibility = 1 === e6 ? "hidden" : "visible", y.style.visibility = e6 === p.length ? "hidden" : "visible";
2088
- }
2089
- u.insertBefore(a2, c2);
2090
- }
2091
- });
2092
- const l3 = document.createElement("img");
2093
- l3.classList.add("magicfeedback-priority-list-arrow-down"), l3.src = "https://magicfeedback-c6458-dev.web.app/assets/arrow.svg", l3.style.width = "20px", l3.style.height = "20px", l3.style.cursor = "pointer", l3.style.margin = "0 5px", l3.style.color = "#000", l3.style.transform = "rotate(180deg)", l3.style.visibility = t5 === p.length - 1 ? "hidden" : "visible", l3.addEventListener("click", () => {
2094
- var t6, i5, o4;
2095
- const d2 = a2.nextElementSibling;
2096
- if (d2) {
2097
- const c2 = Number(null === (t6 = r3.value) || void 0 === t6 ? void 0 : t6.split(".")[0]) + 1;
2098
- r3.value = `${c2}. ${e5}`, n3.textContent = `${c2}. ${e5}`, s3.style.visibility = 1 === c2 ? "hidden" : "visible", l3.style.visibility = c2 === p.length ? "hidden" : "visible";
2099
- const m = d2.querySelector(".magicfeedback-input-magicfeedback-priority-list"), h = d2.querySelector(".magicfeedback-priority-list-item-label"), f = d2.querySelector(".magicfeedback-priority-list-arrow-up"), g = d2.querySelector(".magicfeedback-priority-list-arrow-down");
2100
- if (m && h && f && g) {
2101
- const e6 = Number(m.value.split(".")[0]) - 1;
2102
- m.value = `${e6}.${null === (i5 = h.textContent) || void 0 === i5 ? void 0 : i5.split(".")[1]}`, h.textContent = `${e6}.${null === (o4 = h.textContent) || void 0 === o4 ? void 0 : o4.split(".")[1]}`, f.style.visibility = 1 === e6 ? "hidden" : "visible", g.style.visibility = e6 === p.length ? "hidden" : "visible";
2103
- }
2104
- u.insertBefore(d2, a2);
2105
- }
2106
- }), o3.appendChild(s3), o3.appendChild(l3), a2.appendChild(o3), u.appendChild(a2);
2107
- }), c.appendChild(u), c;
2108
- })({ value: e3.value, ref: e3.ref, randomPosition: t3, limitPriority: (null === (r = e3.assets) || void 0 === r ? void 0 : r.limitPriority) || false, maxPriority: (null === (n = e3.assets) || void 0 === n ? void 0 : n.maxPriority) || 0, placeholder: (null === (o = e3.assets) || void 0 === o ? void 0 : o.placeholder) || "", language: i3 || "en" });
2109
- return s.appendChild(l), { element: s, elementTypeClass: "magicfeedback-priority-list" };
2110
- };
2111
- }, 9152(e2, t2, i2) {
2112
- "use strict";
2113
- t2.renderRatingEmoji = void 0;
2114
- const a = i2(6559), r = i2(7321), n = "https://survey-dev.magicfeedback.io/assets/emojis";
2115
- t2.renderRatingEmoji = ({ question: e3, url: t3, send: i3, urlParamValue: o }) => {
2116
- const { ref: s, assets: l } = e3, d = document.createElement("div"), c = "magicfeedback-rating", u = document.createElement("div");
2117
- u.classList.add("magicfeedback-rating-container");
2118
- const p = (null == l ? void 0 : l.max) ? Number(null == l ? void 0 : l.max) : 5, m = (null == l ? void 0 : l.min) ? Number(null == l ? void 0 : l.min) : 1, h = (0, a.createRatingPlaceholder)(null == l ? void 0 : l.minPlaceholder, null == l ? void 0 : l.maxPlaceholder);
2119
- for (let e4 = m; e4 <= p; e4++) {
2120
- const a2 = document.createElement("div");
2121
- a2.classList.add("magicfeedback-rating-option");
2122
- const l2 = document.createElement("label");
2123
- l2.htmlFor = `rating-${s}-${e4}`, l2.classList.add("magicfeedback-rating-option-label-container");
2124
- const d2 = document.createElement("label");
2125
- d2.htmlFor = `rating-${s}-${e4}`, d2.textContent = e4.toString();
2126
- const h2 = document.createElement("img");
2127
- if (h2.alt = `face-${s}-${e4}`, h2.className = `rating-image${e4}`, 0 === m && 10 === p) h2.src = `${t3}/${e4}.svg`, h2.onerror = () => h2.src = `${n}/${e4}.svg`;
2128
- else if (1 === m && 5 === p) switch (e4) {
2129
- case 1:
2130
- h2.src = `${t3}/1.svg`, h2.onerror = () => h2.src = `${n}/1.svg`;
2131
- break;
2132
- case 2:
2133
- h2.src = `${t3}/2.svg`, h2.onerror = () => h2.src = `${n}/2.svg`;
2134
- break;
2135
- case 3:
2136
- h2.src = `${t3}/6.svg`, h2.onerror = () => h2.src = `${n}/6.svg`;
2137
- break;
2138
- case 4:
2139
- h2.src = `${t3}/9.svg`, h2.onerror = () => h2.src = `${n}/9.svg`;
2140
- break;
2141
- case 5:
2142
- h2.src = `${t3}/10.svg`, h2.onerror = () => h2.src = `${n}/10.svg`;
2143
- }
2144
- else {
2145
- const i4 = Math.round(10 / (p - m) * (e4 - m));
2146
- h2.src = `${t3}/${i4}.svg`, h2.onerror = () => h2.src = `${n}/${i4}.svg`;
2147
- }
2148
- const f = document.createElement("input");
2149
- f.id = `rating-${s}-${e4}`, f.type = "radio", f.name = s, f.value = e4.toString(), f.classList.add(c), f.classList.add("magicfeedback-input"), (0, r.autoAdvanceOn)(f, i3), o && o === f.value && (f.checked = true), l2.appendChild(f), l2.appendChild(h2), l2.appendChild(d2), a2.appendChild(l2), u.appendChild(a2);
2150
- }
2151
- if ((null == l ? void 0 : l.extraOption) && (null == l ? void 0 : l.extraOptionText)) {
2152
- const e4 = document.createElement("div");
2153
- e4.classList.add("magicfeedback-rating-option");
2154
- const t4 = document.createElement("label");
2155
- t4.htmlFor = `rating-${s}-extra`, t4.classList.add("magicfeedback-rating-option-label-container");
2156
- const a2 = document.createElement("label");
2157
- a2.htmlFor = `rating-${s}-extra`, a2.textContent = null == l ? void 0 : l.extraOptionText;
2158
- const n2 = document.createElement("img");
2159
- n2.src = "https://magicfeedback-c6458-dev.web.app/assets/question.svg", n2.alt = `face-${s}-extra`, n2.className = "magicfeedback-rating-image-extra";
2160
- const o2 = document.createElement("input");
2161
- o2.id = `rating-${s}-extra`, o2.type = "radio", o2.name = s, o2.value = "-", o2.classList.add(c), o2.classList.add("magicfeedback-input"), (0, r.autoAdvanceOn)(o2, i3), t4.appendChild(o2), t4.appendChild(n2), t4.appendChild(a2), e4.appendChild(t4), u.appendChild(e4);
2162
- }
2163
- return h.childElementCount > 0 && u.appendChild(h), d.appendChild(u), { element: d, elementTypeClass: c };
2164
- };
2165
- }, 1917(e2, t2, i2) {
2166
- "use strict";
2167
- t2.renderRatingNumber = void 0;
2168
- const a = i2(6559);
2169
- t2.renderRatingNumber = ({ question: e3, order: t3, direction: i3, send: r, urlParamValue: n, language: o, isPhone: s, productId: l }) => {
2170
- const d = "magicfeedback-rating-number";
2171
- return { element: (0, a.createRatingNumberElement)(e3.ref, e3.assets, t3, i3, d, r, n, o, { legacy: (0, a.usesLegacyRatingNumber)(l), isPhone: s }), elementTypeClass: d };
2172
- };
2173
- }, 5452(e2, t2, i2) {
2174
- "use strict";
2175
- t2.renderRatingStar = void 0;
2176
- const a = i2(6559);
2177
- t2.renderRatingStar = ({ question: e3, send: t3, urlParamValue: i3 }) => {
2178
- var r, n;
2179
- const o = document.createElement("div"), s = (0, a.createStarRating)(e3.ref, null === (r = e3.assets) || void 0 === r ? void 0 : r.minPlaceholder, null === (n = e3.assets) || void 0 === n ? void 0 : n.maxPlaceholder, t3, i3);
2180
- return o.appendChild(s), { element: o, elementTypeClass: "magicfeedback-rating-star" };
2181
- };
2182
- }, 9085(e2, t2, i2) {
2183
- "use strict";
2184
- t2.renderSelect = void 0;
2185
- const a = i2(516), r = i2(881);
2186
- t2.renderSelect = ({ question: e3, format: t3, language: i3, urlParamValue: n }) => {
2187
- const { title: o, value: s, defaultValue: l } = e3, d = document.createElement("select"), c = document.createElement("option");
2188
- return c.value = "", c.text = "slim" === t3 ? (0, a.parseTitle)(o, i3) : l || (0, r.t)(i3, "select.placeholder"), c.disabled = true, c.selected = true, d.appendChild(c), s.forEach((e4) => {
2189
- const t4 = document.createElement("option");
2190
- t4.value = e4, t4.text = e4, d.appendChild(t4);
2191
- }), n && s.includes(n) && (d.value = n), { element: d, elementTypeClass: "magicfeedback-select" };
2192
- };
2193
- }, 2090(e2, t2, i2) {
2194
- "use strict";
2195
- t2.renderText = void 0;
2196
- const a = i2(9784);
2197
- t2.renderText = ({ language: e3, placeholderText: t3, urlParamValue: i3, send: r }) => {
2198
- const n = document.createElement("input");
2199
- return n.type = "text", n.placeholder = t3 || a.placeholder.answer(e3 || "en"), i3 && (n.value = i3), n.addEventListener("keyup", (e4) => {
2200
- e4.preventDefault(), "Enter" === e4.key && r && r();
2201
- }), { element: n, elementTypeClass: "magicfeedback-text" };
2202
- };
2203
- }, 4250(e2, t2, i2) {
2204
- "use strict";
2205
- t2.renderUploadFile = void 0;
2206
- const a = i2(5571);
2207
- t2.renderUploadFile = ({ question: e3, language: t3 }) => (0, a.createUploadControl)(e3, t3, "file");
2208
- }, 1843(e2, t2, i2) {
2209
- "use strict";
2210
- t2.renderUploadImage = void 0;
2211
- const a = i2(5571);
2212
- t2.renderUploadImage = ({ question: e3, language: t3 }) => (0, a.createUploadControl)(e3, t3, "image");
2213
- }, 5571(e2, t2, i2) {
2214
- "use strict";
2215
- var a = this && this.__awaiter || function(e3, t3, i3, a2) {
2216
- return new (i3 || (i3 = Promise))(function(r2, n2) {
2217
- function o2(e4) {
2218
- try {
2219
- l2(a2.next(e4));
2220
- } catch (e5) {
2221
- n2(e5);
2222
- }
2223
- }
2224
- function s2(e4) {
2225
- try {
2226
- l2(a2.throw(e4));
2227
- } catch (e5) {
2228
- n2(e5);
2229
- }
2230
- }
2231
- function l2(e4) {
2232
- var t4;
2233
- e4.done ? r2(e4.value) : (t4 = e4.value, t4 instanceof i3 ? t4 : new i3(function(e5) {
2234
- e5(t4);
2235
- })).then(o2, s2);
2236
- }
2237
- l2((a2 = a2.apply(e3, t3 || [])).next());
2238
- });
2239
- };
2240
- Object.defineProperty(t2, "__esModule", { value: true }), t2.createUploadControl = t2.awaitUploadReady = t2.getUploadValues = t2.formatFileSize = void 0;
2241
- const r = i2(9784), n = i2(516), o = "__mfUploadValues", s = "__mfUploadReady";
2242
- function l(e3) {
2243
- if ("number" != typeof e3 || isNaN(e3)) return "";
2244
- if (e3 < 1024) return `${e3} B`;
2245
- const t3 = e3 / 1024;
2246
- if (t3 < 1024) return `${t3 < 10 ? t3.toFixed(1) : Math.round(t3)} KB`;
2247
- const i3 = t3 / 1024;
2248
- return `${i3 < 10 ? i3.toFixed(1) : Math.round(i3)} MB`;
2249
- }
2250
- t2.formatFileSize = l, t2.getUploadValues = function(e3) {
2251
- const t3 = e3[o];
2252
- return Array.isArray(t3) ? t3 : [];
2253
- }, t2.awaitUploadReady = function(e3) {
2254
- return a(this, void 0, void 0, function* () {
2255
- if (!e3) return;
2256
- const t3 = Array.from(e3.querySelectorAll(".magicfeedback-upload-native"));
2257
- yield Promise.all(t3.map((e4) => e4[s]).filter(Boolean));
2258
- });
2259
- }, t2.createUploadControl = function(e3, t3, i3) {
2260
- const { ref: a2, require: d, title: c, assets: u } = e3, p = "image" === i3 ? "magicfeedback-upload-image" : "magicfeedback-upload-file", m = (null == u ? void 0 : u.multiple) || false, h = m ? (null == u ? void 0 : u.maxFiles) || 0 : 1, f = Number(null == u ? void 0 : u.maxFileSize) > 0 ? Number(null == u ? void 0 : u.maxFileSize) : 0, g = 1024 * f * 1024, y = document.createElement("div");
2261
- y.classList.add("magicfeedback-upload");
2262
- const v = document.createElement("input");
2263
- v.type = "file", "image" === i3 && (v.accept = "image/*"), v.multiple = m, v.required = d, v.name = a2, v.id = `magicfeedback-upload-input-${a2}`, v.classList.add(p), v.classList.add("magicfeedback-input"), v.classList.add("magicfeedback-upload-native"), v[o] = [], v[s] = Promise.resolve();
2264
- const b = (0, n.parseTitle)(c, t3);
2265
- b && v.setAttribute("aria-label", b);
2266
- const E = document.createElement("div");
2267
- E.classList.add("magicfeedback-upload-dropzone");
2268
- const k = document.createElement("span");
2269
- k.classList.add("magicfeedback-upload-icon"), k.innerHTML = "image" === i3 ? '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"/><circle cx="8.5" cy="8.5" r="1.5"/><path d="M21 15l-5-5L5 21"/></svg>' : '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M16 16l-4-4-4 4"/><path d="M12 12v9"/><path d="M20.39 18.39A5 5 0 0 0 18 9h-1.26A8 8 0 1 0 3 16.3"/></svg>';
2270
- const A = document.createElement("span");
2271
- A.classList.add("magicfeedback-upload-cta"), A.textContent = r.placeholder.upload.cta(t3);
2272
- const T = document.createElement("span");
2273
- T.classList.add("magicfeedback-upload-hint"), T.textContent = (function(e4, t4, i4, a3, n2) {
2274
- const o2 = [r.placeholder.upload.formats(e4, t4)];
2275
- return i4 && a3 > 0 && o2.push(r.placeholder.upload.maxFiles(e4, a3)), n2 > 0 && o2.push(r.placeholder.upload.maxSize(e4, n2)), o2.filter(Boolean).join(" \xB7 ");
2276
- })(t3, i3, m, h, f), E.appendChild(v), E.appendChild(k), E.appendChild(A), E.appendChild(T);
2277
- const C = document.createElement("div");
2278
- C.classList.add("magicfeedback-upload-error");
2279
- const x = document.createElement("ul");
2280
- x.classList.add("magicfeedback-upload-list"), y.appendChild(E), y.appendChild(C), y.appendChild(x);
2281
- const w = /* @__PURE__ */ new WeakMap(), S = (e4) => {
2282
- const t4 = w.get(e4);
2283
- return t4 ? Promise.resolve(t4) : new Promise((t5) => {
2284
- const i4 = new FileReader(), a3 = (i5) => {
2285
- const a4 = JSON.stringify({ name: e4.name, type: e4.type, size: e4.size, content: i5 });
2286
- w.set(e4, a4), t5(a4);
2287
- };
2288
- i4.onload = () => a3("string" == typeof i4.result ? i4.result : ""), i4.onerror = () => a3(""), i4.readAsDataURL(e4);
2289
- });
2290
- }, P = [], L = (e4) => {
2291
- try {
2292
- const t4 = h > 0 ? e4.slice(0, h) : e4, i4 = new DataTransfer();
2293
- t4.forEach((e5) => i4.items.add(e5)), v.files = i4.files;
2294
- } catch (e5) {
2295
- }
2296
- !(function() {
2297
- P.forEach((e6) => URL.revokeObjectURL(e6)), P.length = 0, x.innerHTML = "";
2298
- const e5 = Array.from(v.files || []);
2299
- y.classList.toggle("magicfeedback-upload--has-files", e5.length > 0), e5.forEach((e6, a3) => {
2300
- const n2 = document.createElement("li");
2301
- n2.classList.add("magicfeedback-upload-file-item");
2302
- const o2 = document.createElement("span");
2303
- if (o2.classList.add("magicfeedback-upload-thumb"), "image" === i3 && e6.type.startsWith("image/")) {
2304
- const t4 = URL.createObjectURL(e6);
2305
- P.push(t4);
2306
- const i4 = document.createElement("img");
2307
- i4.src = t4, i4.alt = e6.name, o2.appendChild(i4);
2308
- } else o2.innerHTML = '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><path d="M14 2v6h6"/></svg>';
2309
- const s2 = document.createElement("span");
2310
- s2.classList.add("magicfeedback-upload-file-info");
2311
- const d2 = document.createElement("span");
2312
- d2.classList.add("magicfeedback-upload-file-name"), d2.textContent = e6.name, d2.title = e6.name;
2313
- const c2 = document.createElement("span");
2314
- c2.classList.add("magicfeedback-upload-file-size"), c2.textContent = l(e6.size), s2.appendChild(d2), s2.appendChild(c2);
2315
- const u2 = document.createElement("button");
2316
- u2.type = "button", u2.classList.add("magicfeedback-upload-remove"), u2.setAttribute("aria-label", `${r.placeholder.upload.remove(t3)}: ${e6.name}`), u2.innerHTML = '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M18 6 6 18"/><path d="m6 6 12 12"/></svg>', u2.addEventListener("click", (e7) => {
2317
- e7.preventDefault(), e7.stopPropagation(), L(Array.from(v.files || []).filter((e8, t4) => t4 !== a3));
2318
- }), n2.appendChild(o2), n2.appendChild(s2), n2.appendChild(u2), x.appendChild(n2);
2319
- });
2320
- })(), (() => {
2321
- const e5 = Array.from(v.files || []), t4 = Promise.all(e5.map(S)).then((e6) => {
2322
- v[o] = e6;
2323
- });
2324
- v[s] = t4;
2325
- })();
2326
- }, O = (e4) => {
2327
- if (!e4.length) return C.textContent = "", void C.classList.remove("is-visible");
2328
- const i4 = e4.map((e5) => e5.name).join(", ");
2329
- C.textContent = `${r.placeholder.upload.tooLarge(t3, f)}: ${i4}`, C.classList.add("is-visible");
2330
- }, I = (e4) => {
2331
- if (!g) return { accepted: e4, rejected: [] };
2332
- const t4 = [], i4 = [];
2333
- return e4.forEach((e5) => (e5.size <= g ? t4 : i4).push(e5)), { accepted: t4, rejected: i4 };
2334
- };
2335
- v.addEventListener("change", () => {
2336
- const { accepted: e4, rejected: t4 } = I(Array.from(v.files || []));
2337
- O(t4), L(e4);
2338
- });
2339
- const N = (e4) => {
2340
- e4.preventDefault(), e4.stopPropagation();
2341
- };
2342
- return ["dragenter", "dragover"].forEach((e4) => E.addEventListener(e4, (e5) => {
2343
- N(e5), E.classList.add("is-dragover");
2344
- })), ["dragleave", "dragend"].forEach((e4) => E.addEventListener(e4, (e5) => {
2345
- N(e5), E.classList.remove("is-dragover");
2346
- })), E.addEventListener("drop", (e4) => {
2347
- N(e4), E.classList.remove("is-dragover");
2348
- const t4 = e4.dataTransfer;
2349
- let a3 = t4 ? Array.from(t4.files) : [];
2350
- if ("image" === i3 && (a3 = a3.filter((e5) => e5.type.startsWith("image/"))), !a3.length) return;
2351
- const { accepted: r2, rejected: n2 } = I(a3);
2352
- if (O(n2), !r2.length) return;
2353
- const o2 = m ? Array.from(v.files || []) : [];
2354
- L(o2.concat(r2));
2355
- }), { element: y, elementTypeClass: p };
2356
- };
2357
- }, 7945(e2, t2, i2) {
2358
- "use strict";
2359
- var a = this && this.__awaiter || function(e3, t3, i3, a2) {
2360
- return new (i3 || (i3 = Promise))(function(r2, n2) {
2361
- function o2(e4) {
2362
- try {
2363
- l2(a2.next(e4));
2364
- } catch (e5) {
2365
- n2(e5);
2366
- }
2367
- }
2368
- function s2(e4) {
2369
- try {
2370
- l2(a2.throw(e4));
2371
- } catch (e5) {
2372
- n2(e5);
2373
- }
2374
- }
2375
- function l2(e4) {
2376
- var t4;
2377
- e4.done ? r2(e4.value) : (t4 = e4.value, t4 instanceof i3 ? t4 : new i3(function(e5) {
2378
- e5(t4);
2379
- })).then(o2, s2);
2380
- }
2381
- l2((a2 = a2.apply(e3, t3 || [])).next());
2382
- });
2383
- }, r = this && this.__importDefault || function(e3) {
2384
- return e3 && e3.__esModule ? e3 : { default: e3 };
2385
- };
2386
- Object.defineProperty(t2, "__esModule", { value: true }), t2.nextAgentTurn = t2.startAgentSurvey = void 0;
2387
- const n = r(i2(4945)), o = i2(2313), s = i2(9857), l = i2(279);
2388
- function d(e3, t3, i3, r2, s2) {
2389
- var d2;
2390
- return a(this, void 0, void 0, function* () {
2391
- let a2;
2392
- try {
2393
- a2 = yield (0, n.default)(e3 + t3, { method: "POST", headers: Object.assign({ "Content-Type": "application/json" }, o.header), body: JSON.stringify(i3) });
2394
- } catch (e4) {
2395
- throw r2.err(`[agentSurvey/${s2}] network error`, e4), new l.AgentApiError("NETWORK", (null == e4 ? void 0 : e4.message) || "Network error");
2396
- }
2397
- if (!a2.ok) {
2398
- let e4 = null;
2399
- try {
2400
- e4 = yield a2.json();
2401
- } catch (e5) {
2402
- }
2403
- const t4 = (0, l.mapAgentStatus)(a2.status, s2);
2404
- throw r2.err(`[agentSurvey/${s2}] ${a2.status}`, e4), new l.AgentApiError(t4, (null === (d2 = null == e4 ? void 0 : e4.error) || void 0 === d2 ? void 0 : d2.message) || (null == e4 ? void 0 : e4.message) || a2.statusText, a2.status, "RATE_LIMITED" === t4 ? (function(e5) {
2405
- var t5, i4;
2406
- const a3 = null === (i4 = null === (t5 = null == e5 ? void 0 : e5.headers) || void 0 === t5 ? void 0 : t5.get) || void 0 === i4 ? void 0 : i4.call(t5, "Retry-After"), r3 = a3 ? Number(a3) : NaN;
2407
- return Number.isFinite(r3) && r3 > 0 ? 1e3 * r3 : 6e4;
2408
- })(a2) : void 0, e4);
2409
- }
2410
- try {
2411
- const e4 = yield a2.json();
2412
- return r2.log(`[agentSurvey/${s2}] ok`, e4), e4;
2413
- } catch (e4) {
2414
- throw new l.AgentApiError("MALFORMED", "Unreadable response body", a2.status);
2415
- }
2416
- });
2417
- }
2418
- t2.startAgentSurvey = function(e3, t3, i3) {
2419
- return d(e3, s.endpoints.sdk.agentSurveyStart, t3, i3, "start");
2420
- }, t2.nextAgentTurn = function(e3, t3, i3) {
2421
- return d(e3, s.endpoints.sdk.agentSurveyNext, t3, i3, "next");
2422
- };
2423
- }, 279(e2, t2) {
2424
- "use strict";
2425
- t2.mapAgentStatus = t2.AgentApiError = void 0;
2426
- class i2 extends Error {
2427
- constructor(e3, t3, a, r, n) {
2428
- super(t3), this.kind = e3, this.status = a, this.retryAfterMs = r, this.body = n, this.name = "AgentApiError", Object.setPrototypeOf(this, i2.prototype);
2429
- }
2430
- get retryable() {
2431
- return "RATE_LIMITED" === this.kind || "AI_UNAVAILABLE" === this.kind || "NETWORK" === this.kind;
2432
- }
2433
- }
2434
- t2.AgentApiError = i2, t2.mapAgentStatus = function(e3, t3) {
2435
- return 429 === e3 ? "RATE_LIMITED" : 406 === e3 || 401 === e3 || 403 === e3 ? "AUTH" : 404 === e3 ? "NOT_FOUND" : 400 === e3 || 422 === e3 ? "BAD_CONFIG" : e3 >= 500 ? "start" === t3 ? "AI_UNAVAILABLE" : "NETWORK" : "MALFORMED";
2436
- };
2437
- }, 7177(e2, t2, i2) {
2438
- "use strict";
2439
- t2.encodeAnswer = t2.toAgentStep = t2.DEFAULT_ANSWER_DELIMITER = void 0;
2440
- const a = i2(5558), r = i2(516);
2441
- t2.DEFAULT_ANSWER_DELIMITER = ", ";
2442
- const n = [a.FEEDBACKAPPANSWERTYPE.RADIO, a.FEEDBACKAPPANSWERTYPE.MULTIPLECHOICE, a.FEEDBACKAPPANSWERTYPE.SELECT, a.FEEDBACKAPPANSWERTYPE.MULTIPLECHOISE_IMAGE], o = Object.values(a.FEEDBACKAPPANSWERTYPE);
2443
- function s(e3, t3, i3) {
2444
- const r2 = { randomPosition: false, direction: "row", order: "ltr" };
2445
- return e3 !== a.FEEDBACKAPPANSWERTYPE.RATING_NUMBER && e3 !== a.FEEDBACKAPPANSWERTYPE.RATING_EMOJI || Object.assign(r2, (function(e4) {
2446
- const t4 = e4.map(Number).filter((e5) => Number.isFinite(e5));
2447
- return t4.length >= 2 ? { min: Math.min(...t4), max: Math.max(...t4) } : { min: 1, max: 5 };
2448
- })(t3)), e3 === a.FEEDBACKAPPANSWERTYPE.LONGTEXT && (r2.maxCharacters = 0), Object.assign(Object.assign({}, r2), (null == i3 ? void 0 : i3.assets) || {});
2449
- }
2450
- function l(e3, t3, i3) {
2451
- var l2, d, c, u;
2452
- const { full: p, title: m } = t3, h = [...null !== (d = null !== (l2 = e3.questionValues) && void 0 !== l2 ? l2 : null == p ? void 0 : p.value) && void 0 !== d ? d : []], f = (function(e4, t4, i4) {
2453
- var s2, l3, d2;
2454
- const c2 = String(e4 || "").trim().toUpperCase();
2455
- return "RATING" === c2 ? a.FEEDBACKAPPANSWERTYPE.RATING_NUMBER : c2 === a.FEEDBACKAPPANSWERTYPE.CONTACT ? (null === (s2 = i4.log) || void 0 === s2 || s2.log("[agentSurvey] CONTACT has no renderer, falling back to TEXT"), a.FEEDBACKAPPANSWERTYPE.TEXT) : o.includes(c2) ? n.includes(c2) && 0 === t4.length ? (null === (d2 = i4.log) || void 0 === d2 || d2.err(`[agentSurvey] ${c2} arrived with no options, falling back to TEXT`), a.FEEDBACKAPPANSWERTYPE.TEXT) : c2 !== a.FEEDBACKAPPANSWERTYPE.BOOLEAN || 2 !== t4.length || (function(e5, t5) {
2456
- if (2 !== e5.length) return false;
2457
- const i5 = e5.map((e6) => String(e6).trim().toLowerCase()), a2 = (0, r.getBooleanOptions)(t5).map((e6) => e6.toLowerCase()), n2 = ["yes", "no"];
2458
- return i5[0] === n2[0] && i5[1] === n2[1] || i5[0] === a2[0] && i5[1] === a2[1];
2459
- })(t4, i4.language) ? c2 : a.FEEDBACKAPPANSWERTYPE.RADIO : (null === (l3 = i4.log) || void 0 === l3 || l3.err(`[agentSurvey] unknown question type "${e4}", falling back to TEXT`), a.FEEDBACKAPPANSWERTYPE.TEXT);
2460
- })(null !== (c = null == p ? void 0 : p.type) && void 0 !== c ? c : e3.questionType, h, i3), g = e3.questionRef || (null == p ? void 0 : p.ref) || `agent-q-${e3.currentTurn}`;
2461
- return { id: (null == p ? void 0 : p.id) || `agent-${i3.sessionId}-${e3.currentTurn}`, title: m || "", type: f, questionType: { conf: null }, ref: g, require: null === (u = null == p ? void 0 : p.require) || void 0 === u || u, external_id: (null == p ? void 0 : p.external_id) || "", value: h, defaultValue: (null == p ? void 0 : p.defaultValue) || "", followup: false, position: e3.currentTurn, assets: s(f, h, p), refMetric: (null == p ? void 0 : p.refMetric) || "", integrationId: i3.integrationId, integrationPageId: "", status: "ACTIVE" };
2462
- }
2463
- t2.toAgentStep = function(e3, t3) {
2464
- var i3, r2, n2;
2465
- const o2 = e3, s2 = e3.currentTurn, d = e3.maxTurns, c = o2.coverageSummary, u = (e4) => ({ kind: "END", reason: e4, currentTurn: s2, maxTurns: d, coverageSummary: c });
2466
- if (o2.answerType === a.AGENT_ANSWER_TYPE_BLOCKED) return u("BLOCKED");
2467
- if (true === o2.shouldEnd) return u("SHOULD_END");
2468
- const p = (function(e4) {
2469
- const t4 = e4.question && "object" == typeof e4.question ? e4.question : e4.nextQuestion && "object" == typeof e4.nextQuestion ? e4.nextQuestion : null;
2470
- if (t4) {
2471
- const e5 = t4, i4 = e5.title;
2472
- return { full: e5, title: "string" == typeof i4 ? i4 : i4 ? JSON.stringify(i4) : null };
2473
- }
2474
- return { full: null, title: "string" == typeof e4.nextQuestion ? e4.nextQuestion : null };
2475
- })(e3);
2476
- return "NONE" === String(null !== (n2 = null !== (r2 = null === (i3 = p.full) || void 0 === i3 ? void 0 : i3.type) && void 0 !== r2 ? r2 : e3.questionType) && void 0 !== n2 ? n2 : "").trim().toUpperCase() ? u("TYPE_NONE") : p.title && p.title.trim() ? { kind: "QUESTION", question: l(e3, p, t3), isFromBase: true === e3.isFromBase, currentTurn: s2, maxTurns: d, topic: o2.topic, coverageGaps: e3.coverageGaps, coverageSummary: c } : u("NO_QUESTION");
2477
- }, t2.encodeAnswer = function(e3, i3, a2 = t2.DEFAULT_ANSWER_DELIMITER) {
2478
- const r2 = i3.ref, n2 = (e4) => e4.flatMap((e5) => Array.isArray(e5.value) ? e5.value : [e5.value]).map((e5) => "string" == typeof e5 ? e5 : JSON.stringify(e5)).map((e5) => (e5 || "").trim()).filter((e5) => "" !== e5), o2 = n2(e3.filter((e4) => e4.key === r2)), s2 = n2(e3.filter((e4) => e4.key === `extra-option-${r2}`));
2479
- return [o2.filter((e4, t3) => o2.indexOf(e4) === t3).join(a2), s2.join(a2)].filter((e4) => "" !== e4).join(a2);
2480
- };
2481
- }, 3107(e2, t2, i2) {
2482
- "use strict";
2483
- t2.scrapeInputs = void 0;
2484
- const a = i2(5571);
2485
- t2.scrapeInputs = function(e3) {
2486
- const t3 = e3.querySelectorAll(".magicfeedback-input"), i3 = [], r = {};
2487
- return t3.forEach((e4) => {
2488
- var t4;
2489
- const n = e4, o = n.name;
2490
- if (!o) return;
2491
- const s = n.type;
2492
- if (("radio" === s || "checkbox" === s) && !n.checked) return;
2493
- const l = n.value, d = n.classList[0];
2494
- if ((null == d ? void 0 : d.includes("magicfeedback-priority-list")) || (null === (t4 = n.id) || void 0 === t4 ? void 0 : t4.startsWith("priority-list-"))) return r[o] || (r[o] = []), void r[o].push(l);
2495
- if (null == d ? void 0 : d.includes("magicfeedback-upload")) {
2496
- const e5 = (0, a.getUploadValues)(n);
2497
- return void (e5.length && i3.push({ key: o, value: e5 }));
2498
- }
2499
- const c = "magicfeedback-consent" === d ? n.checked.toString() : l;
2500
- null != c && i3.push({ key: o, value: [c] });
2501
- }), Object.entries(r).forEach(([e4, t4]) => {
2502
- const a2 = t4.slice().sort((e5, t5) => Number(e5.split(".")[0]) - Number(t5.split(".")[0]));
2503
- i3.push({ key: e4, value: a2 });
2504
- }), i3;
2505
- };
2506
- }, 881(e2, t2) {
2507
- "use strict";
2508
- t2.t = t2.isRtlLanguage = t2.DB = t2.Fc = void 0;
2509
- const i2 = { "placeholder.answer": "Write your answer here...", "placeholder.number": "Write your number here...", "placeholder.email": "Write your email here...", "placeholder.date": "Write your date here...", "placeholder.password": "Write your password here...", "pointSystem.error": "The total points must be 100 %", "boolean.yes": "Yes", "boolean.no": "No", "upload.cta": "Drag & drop or click to upload", "upload.imagesOnly": "Images only", "upload.anyFileType": "Any file type", "upload.maxFiles": "Max {n} files", "upload.maxSize": "Max {mb} MB", "upload.tooLarge": "File is too large (max {mb} MB)", "upload.remove": "Remove", "select.placeholder": "Select an option", "rating.ariaLabel": "Rating", "maxDiff.best": "Most important", "maxDiff.worst": "Least important", "maxDiff.setProgress": "Block {k} of {n}", "priority.selectUpTo": "Select up to", "priority.options": "options", "priority.thenOrder": "and then order them", "priority.selectOptions": "Select options", "priority.cancel": "Cancel", "priority.confirm": "Confirm", "priority.selectOptionNumber": "Select option #", "priority.prioritized": "Prioritized", "priority.of": "of", "priority.instruction": "Your priority list can be seen below. If you wish, you can rearrange your choices using the arrows. Click 'Next' to confirm your selection and proceed.", "action.send": "Send", "action.back": "Back", "action.next": "Next", "action.start": "Go!", "message.success": "Thank you for your feedback!", "message.blocked": "Thanks for your time - we'll end the conversation here.", "message.required": "Please answer before continuing.", "message.rateLimit": "Too many requests. Retrying in {seconds}s...", "email.atHint": "Tap @ to insert the symbol in your email address", "email.atButton": "Insert @" }, a = { en: i2, es: { "placeholder.answer": "Escribe tu respuesta aqu\xED...", "placeholder.number": "Escribe tu n\xFAmero aqu\xED...", "placeholder.email": "Escribe tu correo electr\xF3nico aqu\xED...", "placeholder.date": "Escribe tu fecha aqu\xED...", "placeholder.password": "Escribe tu contrase\xF1a aqu\xED...", "pointSystem.error": "El total de puntos debe ser 100 %", "boolean.yes": "S\xED", "boolean.no": "No", "upload.cta": "Arrastra y suelta o haz clic para subir", "upload.imagesOnly": "Solo im\xE1genes", "upload.anyFileType": "Cualquier tipo de archivo", "upload.maxFiles": "M\xE1x. {n} archivos", "upload.maxSize": "M\xE1x. {mb} MB", "upload.tooLarge": "Archivo demasiado grande (m\xE1x. {mb} MB)", "upload.remove": "Eliminar", "select.placeholder": "Selecciona una opci\xF3n", "rating.ariaLabel": "Valoraci\xF3n", "maxDiff.best": "M\xE1s importante", "maxDiff.worst": "Menos importante", "maxDiff.setProgress": "Bloque {k} de {n}", "priority.selectUpTo": "Selecciona hasta", "priority.options": "opciones", "priority.thenOrder": "y luego ord\xE9nalas", "priority.selectOptions": "Seleccionar opciones", "priority.cancel": "Cancelar", "priority.confirm": "Confirmar", "priority.selectOptionNumber": "Selecciona la opci\xF3n #", "priority.prioritized": "Priorizadas", "priority.of": "de", "priority.instruction": 'Tu lista priorizada se muestra abajo. Si deseas, puedes reordenar las opciones con las flechas. Haz clic en "Siguiente" para confirmar y continuar.', "action.send": "Enviar", "action.back": "Atr\xE1s", "action.next": "Siguiente", "action.start": "\xA1Empezar!", "message.success": "\xA1Gracias por tus comentarios!", "message.blocked": "Gracias por tu tiempo, terminamos aqu\xED la conversaci\xF3n.", "message.required": "Por favor, responde antes de continuar.", "message.rateLimit": "Demasiadas solicitudes. Reintentando en {seconds} s...", "email.atHint": "Pulsa @ para insertar el s\xEDmbolo en tu correo electr\xF3nico", "email.atButton": "Insertar @" }, de: { "placeholder.answer": "Schreiben Sie hier Ihre Antwort...", "placeholder.number": "Geben Sie hier Ihre Zahl ein...", "placeholder.email": "Geben Sie hier Ihre E-Mail-Adresse ein...", "placeholder.date": "Geben Sie hier Ihr Datum ein...", "placeholder.password": "Geben Sie hier Ihr Passwort ein...", "pointSystem.error": "Die Gesamtpunktzahl muss 100 % betragen", "boolean.yes": "Ja", "boolean.no": "Nein", "upload.cta": "Ziehen Sie Dateien hierher oder klicken Sie zum Hochladen", "upload.imagesOnly": "Nur Bilder", "upload.anyFileType": "Beliebiger Dateityp", "upload.maxFiles": "Max. {n} Dateien", "upload.maxSize": "Max. {mb} MB", "upload.tooLarge": "Datei ist zu gro\xDF (max. {mb} MB)", "upload.remove": "Entfernen", "select.placeholder": "Option ausw\xE4hlen", "rating.ariaLabel": "Bewertung", "maxDiff.best": "Am wichtigsten", "maxDiff.worst": "Am wenigsten wichtig", "maxDiff.setProgress": "Block {k} von {n}", "priority.selectUpTo": "W\xE4hlen Sie bis zu", "priority.options": "Optionen", "priority.thenOrder": "und ordnen Sie sie dann", "priority.selectOptions": "Optionen ausw\xE4hlen", "priority.cancel": "Abbrechen", "priority.confirm": "Best\xE4tigen", "priority.selectOptionNumber": "W\xE4hlen Sie Option #", "priority.prioritized": "Priorisiert", "priority.of": "von", "priority.instruction": 'Ihre Priorit\xE4tenliste wird unten angezeigt. Wenn Sie m\xF6chten, k\xF6nnen Sie Ihre Auswahl mit den Pfeilen neu anordnen. Klicken Sie auf "Weiter", um Ihre Auswahl zu best\xE4tigen und fortzufahren.', "action.send": "Senden", "action.back": "Zur\xFCck", "action.next": "Weiter", "action.start": "Los!", "message.success": "Vielen Dank f\xFCr Ihr Feedback!", "message.blocked": "Danke f\xFCr Ihre Zeit - wir beenden das Gespr\xE4ch hier.", "message.required": "Bitte antworten Sie, bevor Sie fortfahren.", "message.rateLimit": "Zu viele Anfragen. Erneuter Versuch in {seconds} s...", "email.atHint": "Tippen Sie auf @, um das Zeichen in Ihre E-Mail-Adresse einzuf\xFCgen", "email.atButton": "@ einf\xFCgen" }, fr: { "placeholder.answer": "\xC9crivez votre r\xE9ponse ici...", "placeholder.number": "\xC9crivez votre nombre ici...", "placeholder.email": "\xC9crivez votre e-mail ici...", "placeholder.date": "\xC9crivez votre date ici...", "placeholder.password": "\xC9crivez votre mot de passe ici...", "pointSystem.error": "Le total des points doit \xEAtre de 100 %", "boolean.yes": "Oui", "boolean.no": "Non", "upload.cta": "Glissez-d\xE9posez ou cliquez pour t\xE9l\xE9verser", "upload.imagesOnly": "Images uniquement", "upload.anyFileType": "Tout type de fichier", "upload.maxFiles": "Max. {n} fichiers", "upload.maxSize": "Max. {mb} Mo", "upload.tooLarge": "Fichier trop volumineux (max. {mb} Mo)", "upload.remove": "Supprimer", "select.placeholder": "S\xE9lectionnez une option", "rating.ariaLabel": "\xC9valuation", "maxDiff.best": "Le plus important", "maxDiff.worst": "Le moins important", "maxDiff.setProgress": "Bloc {k} sur {n}", "priority.selectUpTo": "S\xE9lectionnez jusqu'\xE0", "priority.options": "options", "priority.thenOrder": "puis classez-les", "priority.selectOptions": "S\xE9lectionner des options", "priority.cancel": "Annuler", "priority.confirm": "Confirmer", "priority.selectOptionNumber": "S\xE9lectionnez l'option #", "priority.prioritized": "Prioris\xE9es", "priority.of": "sur", "priority.instruction": `Votre liste de priorit\xE9s est affich\xE9e ci-dessous. Si vous le souhaitez, vous pouvez r\xE9organiser vos choix \xE0 l'aide des fl\xE8ches. Cliquez sur "Suivant" pour confirmer votre s\xE9lection et continuer.`, "action.send": "Envoyer", "action.back": "Retour", "action.next": "Suivant", "action.start": "C'est parti !", "message.success": "Merci pour votre retour !", "message.blocked": "Merci pour votre temps, nous terminons la conversation ici.", "message.required": "Veuillez r\xE9pondre avant de continuer.", "message.rateLimit": "Trop de requ\xEAtes. Nouvelle tentative dans {seconds} s...", "email.atHint": "Appuyez sur @ pour ins\xE9rer le symbole dans votre adresse e-mail", "email.atButton": "Ins\xE9rer @" }, pt: { "placeholder.answer": "Escreva sua resposta aqui...", "placeholder.number": "Escreva seu n\xFAmero aqui...", "placeholder.email": "Escreva seu e-mail aqui...", "placeholder.date": "Escreva sua data aqui...", "placeholder.password": "Escreva sua senha aqui...", "pointSystem.error": "O total de pontos deve ser 100 %", "boolean.yes": "Sim", "boolean.no": "N\xE3o", "upload.cta": "Arraste e solte ou clique para enviar", "upload.imagesOnly": "Somente imagens", "upload.anyFileType": "Qualquer tipo de arquivo", "upload.maxFiles": "M\xE1x. {n} arquivos", "upload.maxSize": "M\xE1x. {mb} MB", "upload.tooLarge": "Arquivo muito grande (m\xE1x. {mb} MB)", "upload.remove": "Remover", "select.placeholder": "Selecione uma op\xE7\xE3o", "rating.ariaLabel": "Avalia\xE7\xE3o", "maxDiff.best": "Mais importante", "maxDiff.worst": "Menos importante", "maxDiff.setProgress": "Bloco {k} de {n}", "priority.selectUpTo": "Selecione at\xE9", "priority.options": "op\xE7\xF5es", "priority.thenOrder": "e depois ordene-as", "priority.selectOptions": "Selecionar op\xE7\xF5es", "priority.cancel": "Cancelar", "priority.confirm": "Confirmar", "priority.selectOptionNumber": "Selecione a op\xE7\xE3o #", "priority.prioritized": "Priorizadas", "priority.of": "de", "priority.instruction": 'Sua lista de prioridades pode ser vista abaixo. Se quiser, voc\xEA pode reorganizar suas escolhas usando as setas. Clique em "Pr\xF3ximo" para confirmar sua sele\xE7\xE3o e continuar.', "action.send": "Enviar", "action.back": "Voltar", "action.next": "Pr\xF3ximo", "action.start": "Come\xE7ar!", "message.success": "Obrigado pelo seu feedback!", "message.blocked": "Obrigado pelo seu tempo, encerramos a conversa por aqui.", "message.required": "Responda antes de continuar.", "message.rateLimit": "Muitas solicita\xE7\xF5es. Tentando novamente em {seconds} s...", "email.atHint": "Toque em @ para inserir o s\xEDmbolo no seu endere\xE7o de e-mail", "email.atButton": "Inserir @" }, da: { "placeholder.answer": "Skriv dit svar her...", "placeholder.number": "Skriv dit nummer her...", "placeholder.email": "Skriv din e-mail her...", "placeholder.date": "Skriv din dato her...", "placeholder.password": "Skriv dit kodeord her...", "pointSystem.error": "Samlet antal point skal v\xE6re 100 %", "boolean.yes": "Ja", "boolean.no": "Nej", "upload.cta": "Tr\xE6k og slip eller klik for at uploade", "upload.imagesOnly": "Kun billeder", "upload.anyFileType": "Enhver filtype", "upload.maxFiles": "Maks. {n} filer", "upload.maxSize": "Maks. {mb} MB", "upload.tooLarge": "Filen er for stor (maks. {mb} MB)", "upload.remove": "Fjern", "select.placeholder": "V\xE6lg en mulighed", "rating.ariaLabel": "Bed\xF8mmelse", "maxDiff.best": "Vigtigst", "maxDiff.worst": "Mindst vigtigt", "maxDiff.setProgress": "Blok {k} af {n}", "priority.selectUpTo": "V\xE6lg op til", "priority.options": "muligheder", "priority.thenOrder": "og sorter dem derefter", "priority.selectOptions": "V\xE6lg muligheder", "priority.cancel": "Annuller", "priority.confirm": "Bekr\xE6ft", "priority.selectOptionNumber": "V\xE6lg mulighed #", "priority.prioritized": "Prioriteret", "priority.of": "af", "priority.instruction": 'Din prioritetsliste vises nedenfor. Hvis du \xF8nsker det, kan du omarrangere dine valg ved hj\xE6lp af pilene. Klik p\xE5 "N\xE6ste" for at bekr\xE6fte dit valg og forts\xE6tte.', "action.send": "Send", "action.back": "Tilbage", "action.next": "N\xE6ste", "action.start": "Start!", "message.success": "Tak for din feedback!", "message.blocked": "Tak for din tid - vi afslutter samtalen her.", "message.required": "Svar venligst, f\xF8r du forts\xE6tter.", "message.rateLimit": "For mange foresp\xF8rgsler. Pr\xF8ver igen om {seconds} s...", "email.atHint": "Tryk p\xE5 @ for at inds\xE6tte symbolet i din e-mailadresse", "email.atButton": "Inds\xE6t @" }, fi: { "placeholder.answer": "Kirjoita vastauksesi t\xE4h\xE4n...", "placeholder.number": "Kirjoita numerosi t\xE4h\xE4n...", "placeholder.email": "Kirjoita s\xE4hk\xF6postiosoitteesi t\xE4h\xE4n...", "placeholder.date": "Kirjoita p\xE4iv\xE4m\xE4\xE4r\xE4si t\xE4h\xE4n...", "placeholder.password": "Kirjoita salasanasi t\xE4h\xE4n...", "pointSystem.error": "Kokonaispisteiden on oltava 100 %", "boolean.yes": "Kyll\xE4", "boolean.no": "Ei", "upload.cta": "Ved\xE4 ja pudota tai napsauta ladataksesi", "upload.imagesOnly": "Vain kuvat", "upload.anyFileType": "Mik\xE4 tahansa tiedostotyyppi", "upload.maxFiles": "Enint\xE4\xE4n {n} tiedostoa", "upload.maxSize": "Enint\xE4\xE4n {mb} MB", "upload.tooLarge": "Tiedosto on liian suuri (enint\xE4\xE4n {mb} MB)", "upload.remove": "Poista", "select.placeholder": "Valitse vaihtoehto", "rating.ariaLabel": "Arvio", "maxDiff.best": "T\xE4rkein", "maxDiff.worst": "V\xE4hiten t\xE4rke\xE4", "maxDiff.setProgress": "Osa {k}/{n}", "priority.selectUpTo": "Valitse enint\xE4\xE4n", "priority.options": "vaihtoehtoa", "priority.thenOrder": "ja j\xE4rjest\xE4 ne sitten", "priority.selectOptions": "Valitse vaihtoehdot", "priority.cancel": "Peruuta", "priority.confirm": "Vahvista", "priority.selectOptionNumber": "Valitse vaihtoehto #", "priority.prioritized": "Priorisoitu", "priority.of": " / ", "priority.instruction": 'Prioriteettilistasi n\xE4kyy alla. Voit halutessasi j\xE4rjest\xE4\xE4 valinnat uudelleen nuolien avulla. Napsauta "Seuraava" vahvistaaksesi valinnan ja jatkaaksesi.', "action.send": "L\xE4het\xE4", "action.back": "Takaisin", "action.next": "Seuraava", "action.start": "Aloita!", "message.success": "Kiitos palautteestasi!", "message.blocked": "Kiitos ajastasi - lopetamme keskustelun t\xE4h\xE4n.", "message.required": "Vastaa ennen jatkamista.", "message.rateLimit": "Liikaa pyynt\xF6j\xE4. Yritet\xE4\xE4n uudelleen {seconds} s kuluttua...", "email.atHint": "Napauta @ lis\xE4t\xE4ksesi merkin s\xE4hk\xF6postiosoitteeseesi", "email.atButton": "Lis\xE4\xE4 @" }, no: { "placeholder.answer": "Skriv svaret ditt her...", "placeholder.number": "Skriv nummeret ditt her...", "placeholder.email": "Skriv e-posten din her...", "placeholder.date": "Skriv datoen din her...", "placeholder.password": "Skriv passordet ditt her...", "pointSystem.error": "Totalt antall poeng m\xE5 v\xE6re 100 %", "boolean.yes": "Ja", "boolean.no": "Nei", "upload.cta": "Dra og slipp eller klikk for \xE5 laste opp", "upload.imagesOnly": "Kun bilder", "upload.anyFileType": "Alle filtyper", "upload.maxFiles": "Maks {n} filer", "upload.maxSize": "Maks {mb} MB", "upload.tooLarge": "Filen er for stor (maks {mb} MB)", "upload.remove": "Fjern", "select.placeholder": "Velg et alternativ", "rating.ariaLabel": "Vurdering", "maxDiff.best": "Viktigst", "maxDiff.worst": "Minst viktig", "maxDiff.setProgress": "Blokk {k} av {n}", "priority.selectUpTo": "Velg opptil", "priority.options": "alternativer", "priority.thenOrder": "og ordne dem deretter", "priority.selectOptions": "Velg alternativer", "priority.cancel": "Avbryt", "priority.confirm": "Bekreft", "priority.selectOptionNumber": "Velg alternativ #", "priority.prioritized": "Prioritert", "priority.of": "av", "priority.instruction": 'Prioriteringslisten din vises nedenfor. Hvis du \xF8nsker det, kan du ordne valgene dine ved hjelp av pilene. Klikk p\xE5 "Neste" for \xE5 bekrefte valget ditt og fortsette.', "action.send": "Send", "action.back": "Tilbake", "action.next": "Neste", "action.start": "Start!", "message.success": "Takk for tilbakemeldingen!", "message.blocked": "Takk for tiden din - vi avslutter samtalen her.", "message.required": "Vennligst svar f\xF8r du fortsetter.", "message.rateLimit": "For mange foresp\xF8rsler. Pr\xF8ver igjen om {seconds} s...", "email.atHint": "Trykk p\xE5 @ for \xE5 sette inn tegnet i e-postadressen din", "email.atButton": "Sett inn @" }, sv: { "placeholder.answer": "Skriv ditt svar h\xE4r...", "placeholder.number": "Skriv ditt nummer h\xE4r...", "placeholder.email": "Skriv din e-post h\xE4r...", "placeholder.date": "Skriv ditt datum h\xE4r...", "placeholder.password": "Skriv ditt l\xF6senord h\xE4r...", "pointSystem.error": "Totala po\xE4ng m\xE5ste vara 100 %", "boolean.yes": "Ja", "boolean.no": "Nej", "upload.cta": "Dra och sl\xE4pp eller klicka f\xF6r att ladda upp", "upload.imagesOnly": "Endast bilder", "upload.anyFileType": "Alla filtyper", "upload.maxFiles": "Max {n} filer", "upload.maxSize": "Max {mb} MB", "upload.tooLarge": "Filen \xE4r f\xF6r stor (max {mb} MB)", "upload.remove": "Ta bort", "select.placeholder": "V\xE4lj ett alternativ", "rating.ariaLabel": "Betyg", "maxDiff.best": "Viktigast", "maxDiff.worst": "Minst viktig", "maxDiff.setProgress": "Block {k} av {n}", "priority.selectUpTo": "V\xE4lj upp till", "priority.options": "alternativ", "priority.thenOrder": "och ordna dem sedan", "priority.selectOptions": "V\xE4lj alternativ", "priority.cancel": "Avbryt", "priority.confirm": "Bekr\xE4fta", "priority.selectOptionNumber": "V\xE4lj alternativ #", "priority.prioritized": "Prioriterat", "priority.of": "av", "priority.instruction": 'Din prioriteringslista visas nedan. Om du vill kan du ordna om dina val med hj\xE4lp av pilarna. Klicka p\xE5 "N\xE4sta" f\xF6r att bekr\xE4fta ditt val och forts\xE4tta.', "action.send": "Skicka", "action.back": "Tillbaka", "action.next": "N\xE4sta", "action.start": "K\xF6r!", "message.success": "Tack f\xF6r din feedback!", "message.blocked": "Tack f\xF6r din tid - vi avslutar samtalet h\xE4r.", "message.required": "Svara innan du forts\xE4tter.", "message.rateLimit": "F\xF6r m\xE5nga f\xF6rfr\xE5gningar. F\xF6rs\xF6ker igen om {seconds} s...", "email.atHint": "Tryck p\xE5 @ f\xF6r att infoga tecknet i din e-postadress", "email.atButton": "Infoga @" }, ar: { "placeholder.answer": "\u0627\u0643\u062A\u0628 \u0625\u062C\u0627\u0628\u062A\u0643 \u0647\u0646\u0627...", "placeholder.number": "\u0627\u0643\u062A\u0628 \u0631\u0642\u0645\u0643 \u0647\u0646\u0627...", "placeholder.email": "\u0627\u0643\u062A\u0628 \u0628\u0631\u064A\u062F\u0643 \u0627\u0644\u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A \u0647\u0646\u0627...", "placeholder.date": "\u0627\u0643\u062A\u0628 \u062A\u0627\u0631\u064A\u062E\u0643 \u0647\u0646\u0627...", "placeholder.password": "\u0627\u0643\u062A\u0628 \u0643\u0644\u0645\u0629 \u0627\u0644\u0645\u0631\u0648\u0631 \u0627\u0644\u062E\u0627\u0635\u0629 \u0628\u0643 \u0647\u0646\u0627...", "pointSystem.error": "\u064A\u062C\u0628 \u0623\u0646 \u062A\u0643\u0648\u0646 \u0627\u0644\u0646\u0642\u0627\u0637 \u0627\u0644\u0625\u062C\u0645\u0627\u0644\u064A\u0629 100 %", "boolean.yes": "\u0646\u0639\u0645", "boolean.no": "\u0644\u0627", "upload.cta": "\u0627\u0633\u062D\u0628 \u0648\u0623\u0641\u0644\u062A \u0623\u0648 \u0627\u0646\u0642\u0631 \u0644\u0644\u062A\u062D\u0645\u064A\u0644", "upload.imagesOnly": "\u0627\u0644\u0635\u0648\u0631 \u0641\u0642\u0637", "upload.anyFileType": "\u0623\u064A \u0646\u0648\u0639 \u0645\u0646 \u0627\u0644\u0645\u0644\u0641\u0627\u062A", "upload.maxFiles": "{n} \u0645\u0644\u0641\u0627\u062A \u0643\u062D\u062F \u0623\u0642\u0635\u0649", "upload.maxSize": "{mb} \u0645\u064A\u063A\u0627\u0628\u0627\u064A\u062A \u0643\u062D\u062F \u0623\u0642\u0635\u0649", "upload.tooLarge": "\u0627\u0644\u0645\u0644\u0641 \u0643\u0628\u064A\u0631 \u062C\u062F\u064B\u0627 (\u0627\u0644\u062D\u062F \u0627\u0644\u0623\u0642\u0635\u0649 {mb} \u0645\u064A\u063A\u0627\u0628\u0627\u064A\u062A)", "upload.remove": "\u0625\u0632\u0627\u0644\u0629", "select.placeholder": "\u0627\u062E\u062A\u0631 \u062E\u064A\u0627\u0631\u064B\u0627", "rating.ariaLabel": "\u0627\u0644\u062A\u0642\u064A\u064A\u0645", "maxDiff.best": "\u0627\u0644\u0623\u0643\u062B\u0631 \u0623\u0647\u0645\u064A\u0629", "maxDiff.worst": "\u0627\u0644\u0623\u0642\u0644 \u0623\u0647\u0645\u064A\u0629", "maxDiff.setProgress": "\u0627\u0644\u0645\u062C\u0645\u0648\u0639\u0629 {k} \u0645\u0646 {n}", "priority.selectUpTo": "\u0627\u062E\u062A\u0631 \u062D\u062A\u0649", "priority.options": "\u062E\u064A\u0627\u0631\u0627\u062A", "priority.thenOrder": "\u062B\u0645 \u0631\u062A\u0628\u0647\u0627", "priority.selectOptions": "\u0627\u062E\u062A\u0631 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A", "priority.cancel": "\u0625\u0644\u063A\u0627\u0621", "priority.confirm": "\u062A\u0623\u0643\u064A\u062F", "priority.selectOptionNumber": "\u0627\u062E\u062A\u0631 \u0627\u0644\u062E\u064A\u0627\u0631 #", "priority.prioritized": "\u062A\u0645 \u0627\u0644\u062A\u0631\u062A\u064A\u0628", "priority.of": "\u0645\u0646", "priority.instruction": '\u062A\u0638\u0647\u0631 \u0642\u0627\u0626\u0645\u0629 \u0627\u0644\u0623\u0648\u0644\u0648\u064A\u0627\u062A \u0627\u0644\u062E\u0627\u0635\u0629 \u0628\u0643 \u0623\u062F\u0646\u0627\u0647. \u0625\u0630\u0627 \u0631\u063A\u0628\u062A\u060C \u064A\u0645\u0643\u0646\u0643 \u0625\u0639\u0627\u062F\u0629 \u062A\u0631\u062A\u064A\u0628 \u0627\u062E\u062A\u064A\u0627\u0631\u0627\u062A\u0643 \u0628\u0627\u0633\u062A\u062E\u062F\u0627\u0645 \u0627\u0644\u0623\u0633\u0647\u0645. \u0627\u0646\u0642\u0631 \u0639\u0644\u0649 "\u0627\u0644\u062A\u0627\u0644\u064A" \u0644\u062A\u0623\u0643\u064A\u062F \u0627\u062E\u062A\u064A\u0627\u0631\u0643 \u0648\u0627\u0644\u0645\u062A\u0627\u0628\u0639\u0629.', "action.send": "\u0625\u0631\u0633\u0627\u0644", "action.back": "\u0631\u062C\u0648\u0639", "action.next": "\u0627\u0644\u062A\u0627\u0644\u064A", "action.start": "\u0627\u0628\u062F\u0623!", "message.success": "\u0634\u0643\u0631\u064B\u0627 \u0644\u0645\u0644\u0627\u062D\u0638\u0627\u062A\u0643!", "message.blocked": "\u0634\u0643\u0631\u064B\u0627 \u0639\u0644\u0649 \u0648\u0642\u062A\u0643\u060C \u0633\u0646\u0646\u0647\u064A \u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0629 \u0647\u0646\u0627.", "message.required": "\u064A\u0631\u062C\u0649 \u0627\u0644\u0625\u062C\u0627\u0628\u0629 \u0642\u0628\u0644 \u0627\u0644\u0645\u062A\u0627\u0628\u0639\u0629.", "message.rateLimit": "\u0637\u0644\u0628\u0627\u062A \u0643\u062B\u064A\u0631\u0629 \u062C\u062F\u064B\u0627. \u0633\u0646\u0639\u064A\u062F \u0627\u0644\u0645\u062D\u0627\u0648\u0644\u0629 \u062E\u0644\u0627\u0644 {seconds} \u062B\u0627\u0646\u064A\u0629...", "email.atHint": "\u0627\u0636\u063A\u0637 \u0639\u0644\u0649 @ \u0644\u0625\u062F\u0631\u0627\u062C \u0627\u0644\u0631\u0645\u0632 \u0641\u064A \u0639\u0646\u0648\u0627\u0646 \u0628\u0631\u064A\u062F\u0643 \u0627\u0644\u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A", "email.atButton": "\u0625\u062F\u0631\u0627\u062C @" }, bn: { "placeholder.answer": "\u098F\u0996\u09BE\u09A8\u09C7 \u0986\u09AA\u09A8\u09BE\u09B0 \u0989\u09A4\u09CD\u09A4\u09B0 \u09B2\u09BF\u0996\u09C1\u09A8...", "placeholder.number": "\u098F\u0996\u09BE\u09A8\u09C7 \u0986\u09AA\u09A8\u09BE\u09B0 \u09B8\u0982\u0996\u09CD\u09AF\u09BE \u09B2\u09BF\u0996\u09C1\u09A8...", "placeholder.email": "\u098F\u0996\u09BE\u09A8\u09C7 \u0986\u09AA\u09A8\u09BE\u09B0 \u0987\u09AE\u09C7\u0987\u09B2 \u09B2\u09BF\u0996\u09C1\u09A8...", "placeholder.date": "\u098F\u0996\u09BE\u09A8\u09C7 \u0986\u09AA\u09A8\u09BE\u09B0 \u09A4\u09BE\u09B0\u09BF\u0996 \u09B2\u09BF\u0996\u09C1\u09A8...", "placeholder.password": "\u098F\u0996\u09BE\u09A8\u09C7 \u0986\u09AA\u09A8\u09BE\u09B0 \u09AA\u09BE\u09B8\u0993\u09AF\u09BC\u09BE\u09B0\u09CD\u09A1 \u09B2\u09BF\u0996\u09C1\u09A8...", "pointSystem.error": "\u09AE\u09CB\u099F \u09AA\u09AF\u09BC\u09C7\u09A8\u09CD\u099F 100 % \u09B9\u09A4\u09C7 \u09B9\u09AC\u09C7", "boolean.yes": "\u09B9\u09CD\u09AF\u09BE\u0981", "boolean.no": "\u09A8\u09BE", "upload.cta": "\u099F\u09C7\u09A8\u09C7 \u0986\u09A8\u09C1\u09A8 \u09AC\u09BE \u0986\u09AA\u09B2\u09CB\u09A1 \u0995\u09B0\u09A4\u09C7 \u0995\u09CD\u09B2\u09BF\u0995 \u0995\u09B0\u09C1\u09A8", "upload.imagesOnly": "\u09B6\u09C1\u09A7\u09C1\u09AE\u09BE\u09A4\u09CD\u09B0 \u099B\u09AC\u09BF", "upload.anyFileType": "\u09AF\u09C7\u0995\u09CB\u09A8\u09CB \u09A7\u09B0\u09A8\u09C7\u09B0 \u09AB\u09BE\u0987\u09B2", "upload.maxFiles": "\u09B8\u09B0\u09CD\u09AC\u09CB\u099A\u09CD\u099A {n}\u099F\u09BF \u09AB\u09BE\u0987\u09B2", "upload.maxSize": "\u09B8\u09B0\u09CD\u09AC\u09CB\u099A\u09CD\u099A {mb} MB", "upload.tooLarge": "\u09AB\u09BE\u0987\u09B2\u099F\u09BF \u0996\u09C1\u09AC \u09AC\u09A1\u09BC (\u09B8\u09B0\u09CD\u09AC\u09CB\u099A\u09CD\u099A {mb} MB)", "upload.remove": "\u09B8\u09B0\u09BE\u09A8", "select.placeholder": "\u098F\u0995\u099F\u09BF \u09AC\u09BF\u0995\u09B2\u09CD\u09AA \u09A8\u09BF\u09B0\u09CD\u09AC\u09BE\u099A\u09A8 \u0995\u09B0\u09C1\u09A8", "rating.ariaLabel": "\u09B0\u09C7\u099F\u09BF\u0982", "maxDiff.best": "\u09B8\u09AC\u099A\u09C7\u09AF\u09BC\u09C7 \u0997\u09C1\u09B0\u09C1\u09A4\u09CD\u09AC\u09AA\u09C2\u09B0\u09CD\u09A3", "maxDiff.worst": "\u09B8\u09AC\u099A\u09C7\u09AF\u09BC\u09C7 \u0995\u09AE \u0997\u09C1\u09B0\u09C1\u09A4\u09CD\u09AC\u09AA\u09C2\u09B0\u09CD\u09A3", "maxDiff.setProgress": "\u09AC\u09CD\u09B2\u0995 {k}/{n}", "priority.selectUpTo": "\u09B8\u09B0\u09CD\u09AC\u09CB\u099A\u09CD\u099A \u09A8\u09BF\u09B0\u09CD\u09AC\u09BE\u099A\u09A8 \u0995\u09B0\u09C1\u09A8", "priority.options": "\u099F\u09BF \u09AC\u09BF\u0995\u09B2\u09CD\u09AA", "priority.thenOrder": "\u09A4\u09BE\u09B0\u09AA\u09B0 \u09B8\u09C7\u0997\u09C1\u09B2\u09CB \u09B8\u09BE\u099C\u09BE\u09A8", "priority.selectOptions": "\u09AC\u09BF\u0995\u09B2\u09CD\u09AA \u09A8\u09BF\u09B0\u09CD\u09AC\u09BE\u099A\u09A8 \u0995\u09B0\u09C1\u09A8", "priority.cancel": "\u09AC\u09BE\u09A4\u09BF\u09B2", "priority.confirm": "\u09A8\u09BF\u09B6\u09CD\u099A\u09BF\u09A4 \u0995\u09B0\u09C1\u09A8", "priority.selectOptionNumber": "\u09AC\u09BF\u0995\u09B2\u09CD\u09AA # \u09A8\u09BF\u09B0\u09CD\u09AC\u09BE\u099A\u09A8 \u0995\u09B0\u09C1\u09A8", "priority.prioritized": "\u0985\u0997\u09CD\u09B0\u09BE\u09A7\u09BF\u0995\u09BE\u09B0\u09AA\u09CD\u09B0\u09BE\u09AA\u09CD\u09A4", "priority.of": "\u098F\u09B0 \u09AE\u09A7\u09CD\u09AF\u09C7", "priority.instruction": '\u0986\u09AA\u09A8\u09BE\u09B0 \u0985\u0997\u09CD\u09B0\u09BE\u09A7\u09BF\u0995\u09BE\u09B0 \u09A4\u09BE\u09B2\u09BF\u0995\u09BE \u09A8\u09BF\u099A\u09C7 \u09A6\u09C7\u0996\u09BE\u09A8\u09CB \u09B9\u09AF\u09BC\u09C7\u099B\u09C7\u0964 \u099A\u09BE\u0987\u09B2\u09C7 \u09A4\u09C0\u09B0 \u099A\u09BF\u09B9\u09CD\u09A8 \u09AC\u09CD\u09AF\u09AC\u09B9\u09BE\u09B0 \u0995\u09B0\u09C7 \u0986\u09AA\u09A8\u09BE\u09B0 \u09AA\u099B\u09A8\u09CD\u09A6\u0997\u09C1\u09B2\u09CB \u09AA\u09C1\u09A8\u09B0\u09BE\u09AF\u09BC \u09B8\u09BE\u099C\u09BE\u09A4\u09C7 \u09AA\u09BE\u09B0\u09C7\u09A8\u0964 "\u09AA\u09B0\u09AC\u09B0\u09CD\u09A4\u09C0" \u0995\u09CD\u09B2\u09BF\u0995 \u0995\u09B0\u09C7 \u0986\u09AA\u09A8\u09BE\u09B0 \u09A8\u09BF\u09B0\u09CD\u09AC\u09BE\u099A\u09A8 \u09A8\u09BF\u09B6\u09CD\u099A\u09BF\u09A4 \u0995\u09B0\u09C1\u09A8 \u098F\u09AC\u0982 \u098F\u0997\u09BF\u09AF\u09BC\u09C7 \u09AF\u09BE\u09A8\u0964', "action.send": "\u09AA\u09BE\u09A0\u09BE\u09A8", "action.back": "\u09AA\u09BF\u099B\u09A8\u09C7", "action.next": "\u09AA\u09B0\u09AC\u09B0\u09CD\u09A4\u09C0", "action.start": "\u09B6\u09C1\u09B0\u09C1 \u0995\u09B0\u09C1\u09A8!", "message.success": "\u0986\u09AA\u09A8\u09BE\u09B0 \u09AE\u09A4\u09BE\u09AE\u09A4\u09C7\u09B0 \u099C\u09A8\u09CD\u09AF \u09A7\u09A8\u09CD\u09AF\u09AC\u09BE\u09A6!", "message.blocked": "\u0986\u09AA\u09A8\u09BE\u09B0 \u09B8\u09AE\u09AF\u09BC\u09C7\u09B0 \u099C\u09A8\u09CD\u09AF \u09A7\u09A8\u09CD\u09AF\u09AC\u09BE\u09A6, \u0986\u09AE\u09B0\u09BE \u098F\u0996\u09BE\u09A8\u09C7\u0987 \u0995\u09A5\u09CB\u09AA\u0995\u09A5\u09A8 \u09B6\u09C7\u09B7 \u0995\u09B0\u099B\u09BF\u0964", "message.required": "\u099A\u09BE\u09B2\u09BF\u09AF\u09BC\u09C7 \u09AF\u09BE\u0993\u09AF\u09BC\u09BE\u09B0 \u0986\u0997\u09C7 \u0985\u09A8\u09C1\u0997\u09CD\u09B0\u09B9 \u0995\u09B0\u09C7 \u0989\u09A4\u09CD\u09A4\u09B0 \u09A6\u09BF\u09A8\u0964", "message.rateLimit": "\u0985\u09A8\u09C7\u0995 \u09AC\u09C7\u09B6\u09BF \u0985\u09A8\u09C1\u09B0\u09CB\u09A7\u0964 {seconds} \u09B8\u09C7\u0995\u09C7\u09A8\u09CD\u09A1\u09C7 \u0986\u09AC\u09BE\u09B0 \u099A\u09C7\u09B7\u09CD\u099F\u09BE \u0995\u09B0\u09BE \u09B9\u099A\u09CD\u099B\u09C7...", "email.atHint": "\u0986\u09AA\u09A8\u09BE\u09B0 \u0987\u09AE\u09C7\u0987\u09B2 \u09A0\u09BF\u0995\u09BE\u09A8\u09BE\u09AF\u09BC \u099A\u09BF\u09B9\u09CD\u09A8\u099F\u09BF \u09AF\u09CB\u0997 \u0995\u09B0\u09A4\u09C7 @ \u099A\u09BE\u09AA\u09C1\u09A8", "email.atButton": "@ \u09AF\u09CB\u0997 \u0995\u09B0\u09C1\u09A8" }, it: { "placeholder.answer": "Scrivi qui la tua risposta...", "placeholder.number": "Scrivi qui il numero...", "placeholder.email": "Scrivi qui la tua email...", "placeholder.date": "Scrivi qui la data...", "placeholder.password": "Scrivi qui la tua password...", "pointSystem.error": "Il totale dei punti deve essere 100 %", "boolean.yes": "S\xEC", "boolean.no": "No", "upload.cta": "Trascina e rilascia o clicca per caricare", "upload.imagesOnly": "Solo immagini", "upload.anyFileType": "Qualsiasi tipo di file", "upload.maxFiles": "Max {n} file", "upload.maxSize": "Max {mb} MB", "upload.tooLarge": "Il file \xE8 troppo grande (max {mb} MB)", "upload.remove": "Rimuovi", "select.placeholder": "Seleziona un'opzione", "rating.ariaLabel": "Valutazione", "maxDiff.best": "Pi\xF9 importante", "maxDiff.worst": "Meno importante", "maxDiff.setProgress": "Blocco {k} di {n}", "priority.selectUpTo": "Seleziona fino a", "priority.options": "opzioni", "priority.thenOrder": "e poi ordinali", "priority.selectOptions": "Seleziona opzioni", "priority.cancel": "Annulla", "priority.confirm": "Conferma", "priority.selectOptionNumber": "Seleziona opzione #", "priority.prioritized": "Prioritizzate", "priority.of": "di", "priority.instruction": 'La tua lista di priorit\xE0 \xE8 mostrata qui sotto. Se vuoi, puoi riordinare le tue scelte usando le frecce. Clicca su "Avanti" per confermare la selezione e continuare.', "action.send": "Invia", "action.back": "Indietro", "action.next": "Avanti", "action.start": "Via!", "message.success": "Grazie per il tuo feedback!", "message.blocked": "Grazie per il tuo tempo \u2013 terminiamo qui la conversazione.", "message.required": "Rispondi prima di continuare.", "message.rateLimit": "Troppe richieste. Nuovo tentativo tra {seconds}s...", "email.atHint": "Tocca @ per inserire il simbolo nel tuo indirizzo email", "email.atButton": "Inserisci @" }, nl: { "placeholder.answer": "Typ hier je antwoord...", "placeholder.number": "Typ hier je getal...", "placeholder.email": "Typ hier je e-mailadres...", "placeholder.date": "Typ hier de datum...", "placeholder.password": "Typ hier je wachtwoord...", "pointSystem.error": "Het totaal aantal punten moet 100 % zijn", "boolean.yes": "Ja", "boolean.no": "Nee", "upload.cta": "Sleep een bestand hierheen of klik om te uploaden", "upload.imagesOnly": "Alleen afbeeldingen", "upload.anyFileType": "Elk bestandstype", "upload.maxFiles": "Max. {n} bestanden", "upload.maxSize": "Max. {mb} MB", "upload.tooLarge": "Bestand is te groot (max. {mb} MB)", "upload.remove": "Verwijderen", "select.placeholder": "Selecteer een optie", "rating.ariaLabel": "Beoordeling", "maxDiff.best": "Belangrijkst", "maxDiff.worst": "Minst belangrijk", "maxDiff.setProgress": "Blok {k} van {n}", "priority.selectUpTo": "Selecteer tot", "priority.options": "opties", "priority.thenOrder": "en rangschik ze vervolgens", "priority.selectOptions": "Selecteer opties", "priority.cancel": "Annuleren", "priority.confirm": "Bevestigen", "priority.selectOptionNumber": "Selecteer optie #", "priority.prioritized": "Geprioriteerd", "priority.of": "van", "priority.instruction": 'Je prioriteitenlijst wordt hieronder weergegeven. Als je wilt, kun je je keuzes herschikken met behulp van de pijlen. Klik op "Volgende" om je selectie te bevestigen en door te gaan.', "action.send": "Verzenden", "action.back": "Terug", "action.next": "Volgende", "action.start": "Aan de slag!", "message.success": "Bedankt voor je feedback!", "message.blocked": "Bedankt voor je tijd \u2013 we be\xEBindigen het gesprek hier.", "message.required": "Beantwoord de vraag voordat je verdergaat.", "message.rateLimit": "Te veel verzoeken. Opnieuw proberen over {seconds}s...", "email.atHint": "Tik op @ om het symbool in je e-mailadres in te voegen", "email.atButton": "@ invoegen" }, pl: { "placeholder.answer": "Wpisz tutaj swoj\u0105 odpowied\u017A...", "placeholder.number": "Wpisz tutaj liczb\u0119...", "placeholder.email": "Wpisz tutaj sw\xF3j adres e-mail...", "placeholder.date": "Wpisz tutaj dat\u0119...", "placeholder.password": "Wpisz tutaj swoje has\u0142o...", "pointSystem.error": "Suma punkt\xF3w musi wynosi\u0107 100 %", "boolean.yes": "Tak", "boolean.no": "Nie", "upload.cta": "Przeci\u0105gnij i upu\u015B\u0107 lub kliknij, aby przes\u0142a\u0107", "upload.imagesOnly": "Tylko obrazy", "upload.anyFileType": "Dowolny typ pliku", "upload.maxFiles": "Maks. liczba plik\xF3w: {n}", "upload.maxSize": "Maks. {mb} MB", "upload.tooLarge": "Plik jest za du\u017Cy (maks. {mb} MB)", "upload.remove": "Usu\u0144", "select.placeholder": "Wybierz opcj\u0119", "rating.ariaLabel": "Ocena", "maxDiff.best": "Najwa\u017Cniejsze", "maxDiff.worst": "Najmniej wa\u017Cne", "maxDiff.setProgress": "Blok {k} z {n}", "priority.selectUpTo": "Wybierz do", "priority.options": "opcje", "priority.thenOrder": "a nast\u0119pnie je uporz\u0105dkuj", "priority.selectOptions": "Wybierz opcje", "priority.cancel": "Anuluj", "priority.confirm": "Potwierd\u017A", "priority.selectOptionNumber": "Wybierz opcj\u0119 #", "priority.prioritized": "Priorytetowe", "priority.of": "z", "priority.instruction": 'Twoja lista priorytet\xF3w jest pokazana poni\u017Cej. Je\u015Bli chcesz, mo\u017Cesz zmieni\u0107 kolejno\u015B\u0107 swoich wybor\xF3w za pomoc\u0105 strza\u0142ek. Kliknij "Dalej", aby potwierdzi\u0107 wyb\xF3r i kontynuowa\u0107.', "action.send": "Wy\u015Blij", "action.back": "Wstecz", "action.next": "Dalej", "action.start": "Zaczynamy!", "message.success": "Dzi\u0119kujemy za Twoj\u0105 opini\u0119!", "message.blocked": "Dzi\u0119kujemy za po\u015Bwi\u0119cony czas \u2013 w tym miejscu ko\u0144czymy rozmow\u0119.", "message.required": "Odpowiedz, zanim przejdziesz dalej.", "message.rateLimit": "Zbyt wiele \u017C\u0105da\u0144. Ponowna pr\xF3ba za {seconds} s...", "email.atHint": "Dotknij @, aby wstawi\u0107 ten symbol do adresu e-mail", "email.atButton": "Wstaw @" }, ru: { "boolean.yes": "\u0414\u0430", "boolean.no": "\u041D\u0435\u0442", "priority.selectUpTo": "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0434\u043E", "priority.options": "\u0432\u0430\u0440\u0438\u0430\u043D\u0442\u043E\u0432", "priority.thenOrder": "\u0430 \u0437\u0430\u0442\u0435\u043C \u0443\u043F\u043E\u0440\u044F\u0434\u043E\u0447\u044C\u0442\u0435 \u0438\u0445", "priority.selectOptions": "\u0412\u044B\u0431\u0440\u0430\u0442\u044C \u0432\u0430\u0440\u0438\u0430\u043D\u0442\u044B", "priority.cancel": "\u041E\u0442\u043C\u0435\u043D\u0430", "priority.confirm": "\u041F\u043E\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u044C", "priority.selectOptionNumber": "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0432\u0430\u0440\u0438\u0430\u043D\u0442 #", "priority.prioritized": "\u041F\u0440\u0438\u043E\u0440\u0438\u0442\u0435\u0442\u044B", "priority.of": "\u0438\u0437", "priority.instruction": '\u0412\u0430\u0448 \u0441\u043F\u0438\u0441\u043E\u043A \u043F\u0440\u0438\u043E\u0440\u0438\u0442\u0435\u0442\u043E\u0432 \u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0430\u0435\u0442\u0441\u044F \u043D\u0438\u0436\u0435. \u0415\u0441\u043B\u0438 \u0445\u043E\u0442\u0438\u0442\u0435, \u0432\u044B \u043C\u043E\u0436\u0435\u0442\u0435 \u0438\u0437\u043C\u0435\u043D\u0438\u0442\u044C \u043F\u043E\u0440\u044F\u0434\u043E\u043A \u0432\u0430\u0440\u0438\u0430\u043D\u0442\u043E\u0432 \u0441 \u043F\u043E\u043C\u043E\u0449\u044C\u044E \u0441\u0442\u0440\u0435\u043B\u043E\u043A. \u041D\u0430\u0436\u043C\u0438\u0442\u0435 "\u0414\u0430\u043B\u0435\u0435", \u0447\u0442\u043E\u0431\u044B \u043F\u043E\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u044C \u0432\u044B\u0431\u043E\u0440 \u0438 \u043F\u0440\u043E\u0434\u043E\u043B\u0436\u0438\u0442\u044C.' }, ja: { "boolean.yes": "\u306F\u3044", "boolean.no": "\u3044\u3044\u3048", "priority.selectUpTo": "\u6700\u5927", "priority.options": "\u500B\u306E\u30AA\u30D7\u30B7\u30E7\u30F3\u3092\u9078\u629E", "priority.thenOrder": "\u305D\u306E\u5F8C\u4E26\u3079\u66FF\u3048\u3066\u304F\u3060\u3055\u3044", "priority.selectOptions": "\u30AA\u30D7\u30B7\u30E7\u30F3\u3092\u9078\u629E", "priority.cancel": "\u30AD\u30E3\u30F3\u30BB\u30EB", "priority.confirm": "\u78BA\u8A8D", "priority.selectOptionNumber": "\u30AA\u30D7\u30B7\u30E7\u30F3 # \u3092\u9078\u629E", "priority.prioritized": "\u512A\u5148\u9806\u4F4D", "priority.of": "\u306E\u3046\u3061", "priority.instruction": "\u512A\u5148\u9806\u4F4D\u30EA\u30B9\u30C8\u306F\u4EE5\u4E0B\u306B\u8868\u793A\u3055\u308C\u307E\u3059\u3002\u5FC5\u8981\u306B\u5FDC\u3058\u3066\u3001\u77E2\u5370\u3092\u4F7F\u3063\u3066\u9078\u629E\u80A2\u3092\u4E26\u3079\u66FF\u3048\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002\u300C\u6B21\u3078\u300D\u3092\u30AF\u30EA\u30C3\u30AF\u3057\u3066\u9078\u629E\u3092\u78BA\u5B9A\u3057\u3001\u7D9A\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002" }, zh: { "boolean.yes": "\u662F", "boolean.no": "\u4E0D", "priority.selectUpTo": "\u6700\u591A\u9009\u62E9", "priority.options": "\u4E2A\u9009\u9879", "priority.thenOrder": "\u7136\u540E\u6392\u5E8F\u5B83\u4EEC", "priority.selectOptions": "\u9009\u62E9\u9009\u9879", "priority.cancel": "\u53D6\u6D88", "priority.confirm": "\u786E\u8BA4", "priority.selectOptionNumber": "\u9009\u62E9\u9009\u9879 #", "priority.prioritized": "\u5DF2\u4F18\u5148", "priority.of": "\u5171", "priority.instruction": "\u4F60\u7684\u4F18\u5148\u5217\u8868\u5982\u4E0B\u6240\u793A\u3002\u5982\u6709\u9700\u8981\uFF0C\u53EF\u4EE5\u4F7F\u7528\u7BAD\u5934\u91CD\u65B0\u6392\u5E8F\u9009\u9879\u3002\u70B9\u51FB\u201C\u4E0B\u4E00\u6B65\u201D\u786E\u8BA4\u9009\u62E9\u5E76\u7EE7\u7EED\u3002" }, ko: { "boolean.yes": "\uC608", "boolean.no": "\uC544\uB2C8", "priority.selectUpTo": "\uCD5C\uB300", "priority.options": "\uAC1C\uC758 \uC635\uC158 \uC120\uD0DD", "priority.thenOrder": "\uADF8\uB7F0 \uB2E4\uC74C \uC815\uB82C\uD558\uC138\uC694", "priority.selectOptions": "\uC635\uC158 \uC120\uD0DD", "priority.cancel": "\uCDE8\uC18C", "priority.confirm": "\uD655\uC778", "priority.selectOptionNumber": "\uC635\uC158 # \uC120\uD0DD", "priority.prioritized": "\uC6B0\uC120\uC21C\uC704", "priority.of": "\uC911", "priority.instruction": '\uC6B0\uC120\uC21C\uC704 \uBAA9\uB85D\uC740 \uC544\uB798\uC5D0 \uD45C\uC2DC\uB429\uB2C8\uB2E4. \uC6D0\uD55C\uB2E4\uBA74 \uD654\uC0B4\uD45C\uB97C \uC0AC\uC6A9\uD574 \uC120\uD0DD \uD56D\uBAA9\uC744 \uC7AC\uC815\uB82C\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4. "\uB2E4\uC74C"\uC744 \uD074\uB9AD\uD558\uC5EC \uC120\uD0DD\uC744 \uD655\uC778\uD558\uACE0 \uACC4\uC18D\uD558\uC138\uC694.' }, bg: { "placeholder.answer": "\u041D\u0430\u043F\u0438\u0448\u0435\u0442\u0435 \u043E\u0442\u0433\u043E\u0432\u043E\u0440\u0430 \u0441\u0438 \u0442\u0443\u043A...", "placeholder.number": "\u041D\u0430\u043F\u0438\u0448\u0435\u0442\u0435 \u0447\u0438\u0441\u043B\u043E\u0442\u043E \u0442\u0443\u043A...", "placeholder.email": "\u041D\u0430\u043F\u0438\u0448\u0435\u0442\u0435 \u0438\u043C\u0435\u0439\u043B\u0430 \u0441\u0438 \u0442\u0443\u043A...", "placeholder.date": "\u041D\u0430\u043F\u0438\u0448\u0435\u0442\u0435 \u0434\u0430\u0442\u0430\u0442\u0430 \u0442\u0443\u043A...", "placeholder.password": "\u041D\u0430\u043F\u0438\u0448\u0435\u0442\u0435 \u043F\u0430\u0440\u043E\u043B\u0430\u0442\u0430 \u0441\u0438 \u0442\u0443\u043A...", "pointSystem.error": "\u041E\u0431\u0449\u0438\u044F\u0442 \u0431\u0440\u043E\u0439 \u0442\u043E\u0447\u043A\u0438 \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0435 100 %", "boolean.yes": "\u0414\u0430", "boolean.no": "\u041D\u0435", "upload.cta": "\u041F\u043B\u044A\u0437\u043D\u0435\u0442\u0435 \u0438 \u043F\u0443\u0441\u043D\u0435\u0442\u0435 \u0438\u043B\u0438 \u0449\u0440\u0430\u043A\u043D\u0435\u0442\u0435, \u0437\u0430 \u0434\u0430 \u043A\u0430\u0447\u0438\u0442\u0435", "upload.imagesOnly": "\u0421\u0430\u043C\u043E \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F", "upload.anyFileType": "\u0412\u0441\u044F\u043A\u0430\u043A\u044A\u0432 \u0442\u0438\u043F \u0444\u0430\u0439\u043B", "upload.maxFiles": "\u041C\u0430\u043A\u0441. {n} \u0444\u0430\u0439\u043B\u0430", "upload.maxSize": "\u041C\u0430\u043A\u0441. {mb} MB", "upload.tooLarge": "\u0424\u0430\u0439\u043B\u044A\u0442 \u0435 \u0442\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C (\u043C\u0430\u043A\u0441. {mb} MB)", "upload.remove": "\u041F\u0440\u0435\u043C\u0430\u0445\u0432\u0430\u043D\u0435", "select.placeholder": "\u0418\u0437\u0431\u0435\u0440\u0435\u0442\u0435 \u043E\u043F\u0446\u0438\u044F", "rating.ariaLabel": "\u041E\u0446\u0435\u043D\u043A\u0430", "maxDiff.best": "\u041D\u0430\u0439-\u0432\u0430\u0436\u043D\u043E", "maxDiff.worst": "\u041D\u0430\u0439-\u043C\u0430\u043B\u043A\u043E \u0432\u0430\u0436\u043D\u043E", "maxDiff.setProgress": "\u0411\u043B\u043E\u043A {k} \u043E\u0442 {n}", "priority.selectUpTo": "\u0418\u0437\u0431\u0435\u0440\u0435\u0442\u0435 \u0434\u043E", "priority.options": "\u043E\u043F\u0446\u0438\u0438", "priority.thenOrder": "\u0438 \u0441\u043B\u0435\u0434 \u0442\u043E\u0432\u0430 \u0433\u0438 \u043F\u043E\u0434\u0440\u0435\u0434\u0435\u0442\u0435", "priority.selectOptions": "\u0418\u0437\u0431\u0435\u0440\u0435\u0442\u0435 \u043E\u043F\u0446\u0438\u0438", "priority.cancel": "\u041E\u0442\u043A\u0430\u0437", "priority.confirm": "\u041F\u043E\u0442\u0432\u044A\u0440\u0436\u0434\u0430\u0432\u0430\u043D\u0435", "priority.selectOptionNumber": "\u0418\u0437\u0431\u0435\u0440\u0435\u0442\u0435 \u043E\u043F\u0446\u0438\u044F \u2116", "priority.prioritized": "\u041F\u0440\u0438\u043E\u0440\u0438\u0442\u0438\u0437\u0438\u0440\u0430\u043D\u0438", "priority.of": "\u043E\u0442", "priority.instruction": "\u0412\u0430\u0448\u0438\u044F\u0442 \u0441\u043F\u0438\u0441\u044A\u043A \u0441 \u043F\u0440\u0438\u043E\u0440\u0438\u0442\u0435\u0442\u0438 \u0435 \u043F\u043E\u043A\u0430\u0437\u0430\u043D \u043F\u043E-\u0434\u043E\u043B\u0443. \u0410\u043A\u043E \u0436\u0435\u043B\u0430\u0435\u0442\u0435, \u043C\u043E\u0436\u0435\u0442\u0435 \u0434\u0430 \u043F\u0440\u0435\u043D\u0430\u0440\u0435\u0434\u0438\u0442\u0435 \u0438\u0437\u0431\u043E\u0440\u0430 \u0441\u0438 \u0447\u0440\u0435\u0437 \u0441\u0442\u0440\u0435\u043B\u043A\u0438\u0442\u0435. \u0429\u0440\u0430\u043A\u043D\u0435\u0442\u0435 \u0432\u044A\u0440\u0445\u0443 \u201E\u041D\u0430\u043F\u0440\u0435\u0434\u201C, \u0437\u0430 \u0434\u0430 \u043F\u043E\u0442\u0432\u044A\u0440\u0434\u0438\u0442\u0435 \u0438\u0437\u0431\u043E\u0440\u0430 \u0441\u0438 \u0438 \u0434\u0430 \u043F\u0440\u043E\u0434\u044A\u043B\u0436\u0438\u0442\u0435.", "action.send": "\u0418\u0437\u043F\u0440\u0430\u0449\u0430\u043D\u0435", "action.back": "\u041D\u0430\u0437\u0430\u0434", "action.next": "\u041D\u0430\u043F\u0440\u0435\u0434", "action.start": "\u0421\u0442\u0430\u0440\u0442!", "message.success": "\u0411\u043B\u0430\u0433\u043E\u0434\u0430\u0440\u0438\u043C \u0412\u0438 \u0437\u0430 \u043E\u0431\u0440\u0430\u0442\u043D\u0430\u0442\u0430 \u0432\u0440\u044A\u0437\u043A\u0430!", "message.blocked": "\u0411\u043B\u0430\u0433\u043E\u0434\u0430\u0440\u0438\u043C \u0412\u0438 \u0437\u0430 \u043E\u0442\u0434\u0435\u043B\u0435\u043D\u043E\u0442\u043E \u0432\u0440\u0435\u043C\u0435 \u2013 \u0449\u0435 \u043F\u0440\u0438\u043A\u043B\u044E\u0447\u0438\u043C \u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440\u0430 \u0434\u043E\u0442\u0443\u043A.", "message.required": "\u041C\u043E\u043B\u044F, \u043E\u0442\u0433\u043E\u0432\u043E\u0440\u0435\u0442\u0435, \u043F\u0440\u0435\u0434\u0438 \u0434\u0430 \u043F\u0440\u043E\u0434\u044A\u043B\u0436\u0438\u0442\u0435.", "message.rateLimit": "\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u043D\u043E\u0433\u043E \u0437\u0430\u044F\u0432\u043A\u0438. \u041D\u043E\u0432 \u043E\u043F\u0438\u0442 \u0441\u043B\u0435\u0434 {seconds} \u0441...", "email.atHint": "\u0414\u043E\u043A\u043E\u0441\u043D\u0435\u0442\u0435 @, \u0437\u0430 \u0434\u0430 \u0432\u044A\u0432\u0435\u0434\u0435\u0442\u0435 \u0441\u0438\u043C\u0432\u043E\u043B\u0430 \u0432 \u0438\u043C\u0435\u0439\u043B \u0430\u0434\u0440\u0435\u0441\u0430 \u0441\u0438", "email.atButton": "\u0412\u044A\u0432\u0435\u0436\u0434\u0430\u043D\u0435 \u043D\u0430 @" }, cs: { "placeholder.answer": "Sem napi\u0161te svou odpov\u011B\u010F...", "placeholder.number": "Sem napi\u0161te \u010D\xEDslo...", "placeholder.email": "Sem napi\u0161te sv\u016Fj e-mail...", "placeholder.date": "Sem napi\u0161te datum...", "placeholder.password": "Sem napi\u0161te sv\xE9 heslo...", "pointSystem.error": "Sou\u010Det bod\u016F mus\xED b\xFDt 100 %", "boolean.yes": "Ano", "boolean.no": "Ne", "upload.cta": "P\u0159et\xE1hn\u011Bte soubor sem nebo klikn\u011Bte a nahrajte jej", "upload.imagesOnly": "Pouze obr\xE1zky", "upload.anyFileType": "Libovoln\xFD typ souboru", "upload.maxFiles": "Max. po\u010Det soubor\u016F: {n}", "upload.maxSize": "Max. {mb} MB", "upload.tooLarge": "Soubor je p\u0159\xEDli\u0161 velk\xFD (max. {mb} MB)", "upload.remove": "Odebrat", "select.placeholder": "Vyberte mo\u017Enost", "rating.ariaLabel": "Hodnocen\xED", "maxDiff.best": "Nejd\u016Fle\u017Eit\u011Bj\u0161\xED", "maxDiff.worst": "Nejm\xE9n\u011B d\u016Fle\u017Eit\xE9", "maxDiff.setProgress": "Blok {k} z {n}", "priority.selectUpTo": "Vyberte a\u017E", "priority.options": "mo\u017Enosti", "priority.thenOrder": "a pot\xE9 je se\u0159a\u010Fte", "priority.selectOptions": "Vyberte mo\u017Enosti", "priority.cancel": "Zru\u0161it", "priority.confirm": "Potvrdit", "priority.selectOptionNumber": "Vyberte mo\u017Enost \u010D.", "priority.prioritized": "Se\u0159azeno podle priority", "priority.of": "z", "priority.instruction": "N\xED\u017Ee vid\xEDte sv\u016Fj seznam priorit. Pokud chcete, m\u016F\u017Eete sv\xE9 volby p\u0159euspo\u0159\xE1dat pomoc\xED \u0161ipek. Kliknut\xEDm na \u201EDal\u0161\xED\u201C potvrd\xEDte sv\u016Fj v\xFDb\u011Br a budete pokra\u010Dovat.", "action.send": "Odeslat", "action.back": "Zp\u011Bt", "action.next": "Dal\u0161\xED", "action.start": "Za\u010D\xEDt!", "message.success": "D\u011Bkujeme za va\u0161i zp\u011Btnou vazbu!", "message.blocked": "D\u011Bkujeme za v\xE1\u0161 \u010Das \u2013 zde konverzaci ukon\u010D\xEDme.", "message.required": "P\u0159ed pokra\u010Dov\xE1n\xEDm pros\xEDm odpov\u011Bzte.", "message.rateLimit": "P\u0159\xEDli\u0161 mnoho po\u017Eadavk\u016F. Nov\xFD pokus za {seconds} s...", "email.atHint": "Klepnut\xEDm na @ vlo\u017E\xEDte symbol do sv\xE9 e-mailov\xE9 adresy", "email.atButton": "Vlo\u017Eit @" }, el: { "placeholder.answer": "\u0393\u03C1\u03AC\u03C8\u03C4\u03B5 \u03C4\u03B7\u03BD \u03B1\u03C0\u03AC\u03BD\u03C4\u03B7\u03C3\u03AE \u03C3\u03B1\u03C2 \u03B5\u03B4\u03CE...", "placeholder.number": "\u0393\u03C1\u03AC\u03C8\u03C4\u03B5 \u03C4\u03BF\u03BD \u03B1\u03C1\u03B9\u03B8\u03BC\u03CC \u03B5\u03B4\u03CE...", "placeholder.email": "\u0393\u03C1\u03AC\u03C8\u03C4\u03B5 \u03C4\u03BF email \u03C3\u03B1\u03C2 \u03B5\u03B4\u03CE...", "placeholder.date": "\u0393\u03C1\u03AC\u03C8\u03C4\u03B5 \u03C4\u03B7\u03BD \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1 \u03B5\u03B4\u03CE...", "placeholder.password": "\u0393\u03C1\u03AC\u03C8\u03C4\u03B5 \u03C4\u03BF\u03BD \u03BA\u03C9\u03B4\u03B9\u03BA\u03CC \u03C0\u03C1\u03CC\u03C3\u03B2\u03B1\u03C3\u03AE\u03C2 \u03C3\u03B1\u03C2 \u03B5\u03B4\u03CE...", "pointSystem.error": "\u03A4\u03BF \u03C3\u03CD\u03BD\u03BF\u03BB\u03BF \u03C4\u03C9\u03BD \u03C0\u03CC\u03BD\u03C4\u03C9\u03BD \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 100 %", "boolean.yes": "\u039D\u03B1\u03B9", "boolean.no": "\u038C\u03C7\u03B9", "upload.cta": "\u03A3\u03CD\u03C1\u03B5\u03C4\u03B5 \u03BA\u03B1\u03B9 \u03B1\u03C6\u03AE\u03C3\u03C4\u03B5 \u03AE \u03BA\u03AC\u03BD\u03C4\u03B5 \u03BA\u03BB\u03B9\u03BA \u03B3\u03B9\u03B1 \u03BC\u03B5\u03C4\u03B1\u03C6\u03CC\u03C1\u03C4\u03C9\u03C3\u03B7", "upload.imagesOnly": "\u039C\u03CC\u03BD\u03BF \u03B5\u03B9\u03BA\u03CC\u03BD\u03B5\u03C2", "upload.anyFileType": "\u039F\u03C0\u03BF\u03B9\u03BF\u03C3\u03B4\u03AE\u03C0\u03BF\u03C4\u03B5 \u03C4\u03CD\u03C0\u03BF\u03C2 \u03B1\u03C1\u03C7\u03B5\u03AF\u03BF\u03C5", "upload.maxFiles": "\u0388\u03C9\u03C2 {n} \u03B1\u03C1\u03C7\u03B5\u03AF\u03B1", "upload.maxSize": "\u0388\u03C9\u03C2 {mb} MB", "upload.tooLarge": "\u03A4\u03BF \u03B1\u03C1\u03C7\u03B5\u03AF\u03BF \u03B5\u03AF\u03BD\u03B1\u03B9 \u03C0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF (\u03AD\u03C9\u03C2 {mb} MB)", "upload.remove": "\u0391\u03C6\u03B1\u03AF\u03C1\u03B5\u03C3\u03B7", "select.placeholder": "\u039A\u03AC\u03BD\u03C4\u03B5 \u03BC\u03B9\u03B1 \u03B5\u03C0\u03B9\u03BB\u03BF\u03B3\u03AE", "rating.ariaLabel": "\u0392\u03B1\u03B8\u03BC\u03BF\u03BB\u03BF\u03B3\u03AF\u03B1", "maxDiff.best": "\u03A0\u03B9\u03BF \u03C3\u03B7\u03BC\u03B1\u03BD\u03C4\u03B9\u03BA\u03CC", "maxDiff.worst": "\u039B\u03B9\u03B3\u03CC\u03C4\u03B5\u03C1\u03BF \u03C3\u03B7\u03BC\u03B1\u03BD\u03C4\u03B9\u03BA\u03CC", "maxDiff.setProgress": "\u0395\u03BD\u03CC\u03C4\u03B7\u03C4\u03B1 {k} \u03B1\u03C0\u03CC {n}", "priority.selectUpTo": "\u0395\u03C0\u03B9\u03BB\u03AD\u03BE\u03C4\u03B5 \u03AD\u03C9\u03C2", "priority.options": "\u03B5\u03C0\u03B9\u03BB\u03BF\u03B3\u03AD\u03C2", "priority.thenOrder": "\u03BA\u03B1\u03B9 \u03C3\u03C4\u03B7 \u03C3\u03C5\u03BD\u03AD\u03C7\u03B5\u03B9\u03B1 \u03C4\u03B1\u03BE\u03B9\u03BD\u03BF\u03BC\u03AE\u03C3\u03C4\u03B5 \u03C4\u03B5\u03C2", "priority.selectOptions": "\u039A\u03AC\u03BD\u03C4\u03B5 \u03C4\u03B9\u03C2 \u03B5\u03C0\u03B9\u03BB\u03BF\u03B3\u03AD\u03C2 \u03C3\u03B1\u03C2", "priority.cancel": "\u0391\u03BA\u03CD\u03C1\u03C9\u03C3\u03B7", "priority.confirm": "\u0395\u03C0\u03B9\u03B2\u03B5\u03B2\u03B1\u03AF\u03C9\u03C3\u03B7", "priority.selectOptionNumber": "\u0395\u03C0\u03B9\u03BB\u03BF\u03B3\u03AE \u03B1\u03C1.", "priority.prioritized": "\u039C\u03B5 \u03C0\u03C1\u03BF\u03C4\u03B5\u03C1\u03B1\u03B9\u03CC\u03C4\u03B7\u03C4\u03B1", "priority.of": "\u03B1\u03C0\u03CC", "priority.instruction": "\u0397 \u03BB\u03AF\u03C3\u03C4\u03B1 \u03C0\u03C1\u03BF\u03C4\u03B5\u03C1\u03B1\u03B9\u03BF\u03C4\u03AE\u03C4\u03C9\u03BD \u03C3\u03B1\u03C2 \u03B5\u03BC\u03C6\u03B1\u03BD\u03AF\u03B6\u03B5\u03C4\u03B1\u03B9 \u03C0\u03B1\u03C1\u03B1\u03BA\u03AC\u03C4\u03C9. \u0391\u03BD \u03B8\u03AD\u03BB\u03B5\u03C4\u03B5, \u03BC\u03C0\u03BF\u03C1\u03B5\u03AF\u03C4\u03B5 \u03BD\u03B1 \u03B1\u03BB\u03BB\u03AC\u03BE\u03B5\u03C4\u03B5 \u03C4\u03B7 \u03C3\u03B5\u03B9\u03C1\u03AC \u03C4\u03C9\u03BD \u03B5\u03C0\u03B9\u03BB\u03BF\u03B3\u03CE\u03BD \u03C3\u03B1\u03C2 \u03BC\u03B5 \u03C4\u03B1 \u03B2\u03AD\u03BB\u03B7. \u039A\u03AC\u03BD\u03C4\u03B5 \u03BA\u03BB\u03B9\u03BA \u03C3\u03C4\u03BF \xAB\u0395\u03C0\u03CC\u03BC\u03B5\u03BD\u03BF\xBB \u03B3\u03B9\u03B1 \u03BD\u03B1 \u03B5\u03C0\u03B9\u03B2\u03B5\u03B2\u03B1\u03B9\u03CE\u03C3\u03B5\u03C4\u03B5 \u03C4\u03B7\u03BD \u03B5\u03C0\u03B9\u03BB\u03BF\u03B3\u03AE \u03C3\u03B1\u03C2 \u03BA\u03B1\u03B9 \u03BD\u03B1 \u03C3\u03C5\u03BD\u03B5\u03C7\u03AF\u03C3\u03B5\u03C4\u03B5.", "action.send": "\u0391\u03C0\u03BF\u03C3\u03C4\u03BF\u03BB\u03AE", "action.back": "\u03A0\u03AF\u03C3\u03C9", "action.next": "\u0395\u03C0\u03CC\u03BC\u03B5\u03BD\u03BF", "action.start": "\u03A0\u03AC\u03BC\u03B5!", "message.success": "\u03A3\u03B1\u03C2 \u03B5\u03C5\u03C7\u03B1\u03C1\u03B9\u03C3\u03C4\u03BF\u03CD\u03BC\u03B5 \u03B3\u03B9\u03B1 \u03C4\u03B1 \u03C3\u03C7\u03CC\u03BB\u03B9\u03AC \u03C3\u03B1\u03C2!", "message.blocked": "\u03A3\u03B1\u03C2 \u03B5\u03C5\u03C7\u03B1\u03C1\u03B9\u03C3\u03C4\u03BF\u03CD\u03BC\u03B5 \u03B3\u03B9\u03B1 \u03C4\u03BF\u03BD \u03C7\u03C1\u03CC\u03BD\u03BF \u03C3\u03B1\u03C2 \u2013 \u03B8\u03B1 \u03BF\u03BB\u03BF\u03BA\u03BB\u03B7\u03C1\u03CE\u03C3\u03BF\u03C5\u03BC\u03B5 \u03C4\u03B7 \u03C3\u03C5\u03B6\u03AE\u03C4\u03B7\u03C3\u03B7 \u03B5\u03B4\u03CE.", "message.required": "\u0391\u03C0\u03B1\u03BD\u03C4\u03AE\u03C3\u03C4\u03B5 \u03C0\u03C1\u03B9\u03BD \u03C3\u03C5\u03BD\u03B5\u03C7\u03AF\u03C3\u03B5\u03C4\u03B5.", "message.rateLimit": "\u03A0\u03AC\u03C1\u03B1 \u03C0\u03BF\u03BB\u03BB\u03AC \u03B1\u03B9\u03C4\u03AE\u03BC\u03B1\u03C4\u03B1. \u039D\u03AD\u03B1 \u03C0\u03C1\u03BF\u03C3\u03C0\u03AC\u03B8\u03B5\u03B9\u03B1 \u03C3\u03B5 {seconds} \u03B4\u03B5\u03C5\u03C4\u03B5\u03C1\u03CC\u03BB\u03B5\u03C0\u03C4\u03B1...", "email.atHint": "\u03A0\u03B1\u03C4\u03AE\u03C3\u03C4\u03B5 @ \u03B3\u03B9\u03B1 \u03BD\u03B1 \u03B5\u03B9\u03C3\u03B1\u03B3\u03AC\u03B3\u03B5\u03C4\u03B5 \u03C4\u03BF \u03C3\u03CD\u03BC\u03B2\u03BF\u03BB\u03BF \u03C3\u03C4\u03B7 \u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 email \u03C3\u03B1\u03C2", "email.atButton": "\u0395\u03B9\u03C3\u03B1\u03B3\u03C9\u03B3\u03AE @" }, et: { "placeholder.answer": "Kirjuta oma vastus siia...", "placeholder.number": "Kirjuta number siia...", "placeholder.email": "Kirjuta oma e-posti aadress siia...", "placeholder.date": "Kirjuta kuup\xE4ev siia...", "placeholder.password": "Kirjuta oma parool siia...", "pointSystem.error": "Punktide summa peab olema 100 %", "boolean.yes": "Jah", "boolean.no": "Ei", "upload.cta": "Lohista fail siia v\xF5i kl\xF5psa \xFCleslaadimiseks", "upload.imagesOnly": "Ainult pildid", "upload.anyFileType": "Mis tahes failit\xFC\xFCp", "upload.maxFiles": "Kuni {n} faili", "upload.maxSize": "Kuni {mb} MB", "upload.tooLarge": "Fail on liiga suur (kuni {mb} MB)", "upload.remove": "Eemalda", "select.placeholder": "Vali variant", "rating.ariaLabel": "Hinnang", "maxDiff.best": "K\xF5ige olulisem", "maxDiff.worst": "K\xF5ige v\xE4hem oluline", "maxDiff.setProgress": "Plokk {k}/{n}", "priority.selectUpTo": "Vali kuni", "priority.options": "varianti", "priority.thenOrder": "ja seej\xE4rel j\xE4rjesta need", "priority.selectOptions": "Vali variandid", "priority.cancel": "T\xFChista", "priority.confirm": "Kinnita", "priority.selectOptionNumber": "Vali variant nr", "priority.prioritized": "J\xE4rjestatud", "priority.of": "/", "priority.instruction": "Sinu prioriteetide nimekiri on n\xE4ha allpool. Soovi korral saad valikute j\xE4rjekorda nooltega muuta. Kl\xF5psa \u201EEdasi\u201C, et oma valik kinnitada ja j\xE4tkata.", "action.send": "Saada", "action.back": "Tagasi", "action.next": "Edasi", "action.start": "Alusta!", "message.success": "T\xE4name tagasiside eest!", "message.blocked": "T\xE4name sind aja eest \u2013 l\xF5petame vestluse siinkohal.", "message.required": "Palun vasta enne j\xE4tkamist.", "message.rateLimit": "Liiga palju p\xE4ringuid. Uus katse {seconds} s p\xE4rast...", "email.atHint": "Puuduta @, et lisada s\xFCmbol oma e-posti aadressi", "email.atButton": "Lisa @" }, ga: { "placeholder.answer": "Scr\xEDobh d'fhreagra anseo...", "placeholder.number": "Scr\xEDobh an uimhir anseo...", "placeholder.email": "Scr\xEDobh do sheoladh r\xEDomhphoist anseo...", "placeholder.date": "Scr\xEDobh an d\xE1ta anseo...", "placeholder.password": "Scr\xEDobh do phasfhocal anseo...", "pointSystem.error": "Caithfidh na point\xED san ioml\xE1n a bheith cothrom le 100 %", "boolean.yes": "T\xE1", "boolean.no": "N\xEDl", "upload.cta": "Tarraing agus scaoil n\xF3 clice\xE1il chun uasl\xF3d\xE1il", "upload.imagesOnly": "\xCDomh\xE1nna amh\xE1in", "upload.anyFileType": "Aon chine\xE1l comhaid", "upload.maxFiles": "{n} comhad ar a mh\xE9ad", "upload.maxSize": "{mb} MB ar a mh\xE9ad", "upload.tooLarge": "T\xE1 an comhad r\xF3mh\xF3r ({mb} MB ar a mh\xE9ad)", "upload.remove": "Bain", "select.placeholder": "Roghnaigh rogha", "rating.ariaLabel": "R\xE1t\xE1il", "maxDiff.best": "Is t\xE1bhachta\xED", "maxDiff.worst": "Is l\xFA t\xE1bhacht", "maxDiff.setProgress": "Bloc {k} as {n}", "priority.selectUpTo": "Roghnaigh suas le", "priority.options": "rogha", "priority.thenOrder": "agus ansin cuir in ord iad", "priority.selectOptions": "Roghnaigh roghanna", "priority.cancel": "Cealaigh", "priority.confirm": "Deimhnigh", "priority.selectOptionNumber": "Roghnaigh rogha uimhir", "priority.prioritized": "In ord tosa\xEDochta", "priority.of": "as", "priority.instruction": "T\xE1 do liosta tosa\xEDochta le feice\xE1il th\xEDos. M\xE1s mian leat, is f\xE9idir leat do roghanna a athord\xFA leis na saigheada. Clice\xE1il ar 'Ar aghaidh' chun do rogha a dheimhni\xFA agus lean\xFAint ar aghaidh.", "action.send": "Seol", "action.back": "Siar", "action.next": "Ar aghaidh", "action.start": "Ar aghaidh linn!", "message.success": "Go raibh maith agat as d'aiseolas!", "message.blocked": "Go raibh maith agat as do chuid ama \u2013 cuirfimid deireadh leis an gcomhr\xE1 anseo.", "message.required": "Freagair sula leanann t\xFA ar aghaidh, le do thoil.", "message.rateLimit": "An iomarca iarratas. Triail eile i gceann {seconds} s...", "email.atHint": "Tap\xE1il @ chun an tsiombail a chur isteach i do sheoladh r\xEDomhphoist", "email.atButton": "Cuir isteach @" }, hr: { "placeholder.answer": "Ovdje upi\u0161ite svoj odgovor...", "placeholder.number": "Ovdje upi\u0161ite broj...", "placeholder.email": "Ovdje upi\u0161ite svoju e-adresu...", "placeholder.date": "Ovdje upi\u0161ite datum...", "placeholder.password": "Ovdje upi\u0161ite svoju lozinku...", "pointSystem.error": "Ukupan broj bodova mora biti 100 %", "boolean.yes": "Da", "boolean.no": "Ne", "upload.cta": "Povucite i ispustite ili kliknite za prijenos", "upload.imagesOnly": "Samo slike", "upload.anyFileType": "Bilo koja vrsta datoteke", "upload.maxFiles": "Najvi\u0161e datoteka: {n}", "upload.maxSize": "Najvi\u0161e {mb} MB", "upload.tooLarge": "Datoteka je prevelika (najvi\u0161e {mb} MB)", "upload.remove": "Ukloni", "select.placeholder": "Odaberite opciju", "rating.ariaLabel": "Ocjena", "maxDiff.best": "Najva\u017Enije", "maxDiff.worst": "Najmanje va\u017Eno", "maxDiff.setProgress": "Blok {k} od {n}", "priority.selectUpTo": "Odaberite najvi\u0161e", "priority.options": "opcija", "priority.thenOrder": "i zatim ih poredajte", "priority.selectOptions": "Odaberite opcije", "priority.cancel": "Odustani", "priority.confirm": "Potvrdi", "priority.selectOptionNumber": "Odaberite opciju br.", "priority.prioritized": "Prioritizirano", "priority.of": "od", "priority.instruction": "Va\u0161 popis prioriteta prikazan je u nastavku. Ako \u017Eelite, mo\u017Eete promijeniti redoslijed svojih odabira pomo\u0107u strelica. Kliknite \u201EDalje\u201D da biste potvrdili odabir i nastavili.", "action.send": "Po\u0161alji", "action.back": "Natrag", "action.next": "Dalje", "action.start": "Kreni!", "message.success": "Hvala vam na povratnim informacijama!", "message.blocked": "Hvala vam na vremenu \u2013 ovdje \u0107emo zavr\u0161iti razgovor.", "message.required": "Molimo odgovorite prije nastavka.", "message.rateLimit": "Previ\u0161e zahtjeva. Ponovni poku\u0161aj za {seconds} s...", "email.atHint": "Dodirnite @ da biste umetnuli znak u svoju e-adresu", "email.atButton": "Umetni @" }, hu: { "placeholder.answer": "\xCDrja ide a v\xE1lasz\xE1t...", "placeholder.number": "\xCDrja ide a sz\xE1mot...", "placeholder.email": "\xCDrja ide az e-mail-c\xEDm\xE9t...", "placeholder.date": "\xCDrja ide a d\xE1tumot...", "placeholder.password": "\xCDrja ide a jelszav\xE1t...", "pointSystem.error": "A pontok \xF6sszeg\xE9nek 100 %-nak kell lennie", "boolean.yes": "Igen", "boolean.no": "Nem", "upload.cta": "H\xFAzza ide a f\xE1jlt, vagy kattintson a felt\xF6lt\xE9shez", "upload.imagesOnly": "Csak k\xE9pek", "upload.anyFileType": "B\xE1rmilyen f\xE1jlt\xEDpus", "upload.maxFiles": "Legfeljebb {n} f\xE1jl", "upload.maxSize": "Legfeljebb {mb} MB", "upload.tooLarge": "A f\xE1jl t\xFAl nagy (legfeljebb {mb} MB)", "upload.remove": "Elt\xE1vol\xEDt\xE1s", "select.placeholder": "V\xE1lasszon egy lehet\u0151s\xE9get", "rating.ariaLabel": "\xC9rt\xE9kel\xE9s", "maxDiff.best": "Legfontosabb", "maxDiff.worst": "Legkev\xE9sb\xE9 fontos", "maxDiff.setProgress": "Blokk: {k}/{n}", "priority.selectUpTo": "V\xE1lasszon legfeljebb", "priority.options": "lehet\u0151s\xE9get", "priority.thenOrder": "\xE9s rendezze \u0151ket sorba", "priority.selectOptions": "Lehet\u0151s\xE9gek kiv\xE1laszt\xE1sa", "priority.cancel": "M\xE9gse", "priority.confirm": "Meger\u0151s\xEDt\xE9s", "priority.selectOptionNumber": "Lehet\u0151s\xE9g kiv\xE1laszt\xE1sa: #", "priority.prioritized": "Rangsorolva", "priority.of": "/", "priority.instruction": "A priorit\xE1si list\xE1ja al\xE1bb l\xE1that\xF3. Ha szeretn\xE9, a nyilakkal \xE1trendezheti a v\xE1laszt\xE1sait. Kattintson a \u201ETov\xE1bb\u201D gombra a v\xE1laszt\xE1s meger\u0151s\xEDt\xE9s\xE9hez \xE9s a folytat\xE1shoz.", "action.send": "K\xFCld\xE9s", "action.back": "Vissza", "action.next": "Tov\xE1bb", "action.start": "Indul\xE1s!", "message.success": "K\xF6sz\xF6nj\xFCk a visszajelz\xE9s\xE9t!", "message.blocked": "K\xF6sz\xF6nj\xFCk, hogy id\u0151t sz\xE1nt r\xE1nk \u2013 itt befejezz\xFCk a besz\xE9lget\xE9st.", "message.required": "K\xE9rj\xFCk, v\xE1laszoljon a tov\xE1bbl\xE9p\xE9s el\u0151tt.", "message.rateLimit": "T\xFAl sok k\xE9r\xE9s. \xDAjrapr\xF3b\xE1lkoz\xE1s {seconds} mp m\xFAlva...", "email.atHint": "Koppintson a @ gombra a jel besz\xFAr\xE1s\xE1hoz az e-mail-c\xEDm\xE9be", "email.atButton": "@ besz\xFAr\xE1sa" }, lt: { "placeholder.answer": "\u012Era\u0161ykite savo atsakym\u0105 \u010Dia...", "placeholder.number": "\u012Era\u0161ykite skai\u010Di\u0173 \u010Dia...", "placeholder.email": "\u012Era\u0161ykite savo el. pa\u0161to adres\u0105 \u010Dia...", "placeholder.date": "\u012Era\u0161ykite dat\u0105 \u010Dia...", "placeholder.password": "\u012Era\u0161ykite savo slapta\u017Eod\u012F \u010Dia...", "pointSystem.error": "Bendra ta\u0161k\u0173 suma turi b\u016Bti 100 %", "boolean.yes": "Taip", "boolean.no": "Ne", "upload.cta": "Nutempkite fail\u0105 arba spustel\u0117kite, kad \u012Fkeltum\u0117te", "upload.imagesOnly": "Tik paveiksl\u0117liai", "upload.anyFileType": "Bet koks failo tipas", "upload.maxFiles": "Daugiausia fail\u0173: {n}", "upload.maxSize": "Daugiausia {mb} MB", "upload.tooLarge": "Failas per didelis (daugiausia {mb} MB)", "upload.remove": "Pa\u0161alinti", "select.placeholder": "Pasirinkite parinkt\u012F", "rating.ariaLabel": "\u012Evertinimas", "maxDiff.best": "Svarbiausia", "maxDiff.worst": "Ma\u017Eiausiai svarbu", "maxDiff.setProgress": "Blokas {k} i\u0161 {n}", "priority.selectUpTo": "Pasirinkite iki", "priority.options": "parink\u010Di\u0173", "priority.thenOrder": "ir tada jas surikiuokite", "priority.selectOptions": "Pasirinkite parinktis", "priority.cancel": "At\u0161aukti", "priority.confirm": "Patvirtinti", "priority.selectOptionNumber": "Pasirinkite parinkt\u012F Nr.", "priority.prioritized": "Pagal prioritet\u0105", "priority.of": "i\u0161", "priority.instruction": "J\u016Bs\u0173 prioritet\u0173 s\u0105ra\u0161as pateiktas \u017Eemiau. Jei norite, pasirinkim\u0173 tvark\u0105 galite pakeisti rodykl\u0117mis. Spustel\u0117kite \u201EToliau\u201C, kad patvirtintum\u0117te pasirinkim\u0105 ir t\u0119stum\u0117te.", "action.send": "Si\u0173sti", "action.back": "Atgal", "action.next": "Toliau", "action.start": "Pirmyn!", "message.success": "D\u0117kojame u\u017E atsiliepim\u0105!", "message.blocked": "D\u0117kojame u\u017E j\u016Bs\u0173 laik\u0105 \u2013 \u010Dia pokalb\u012F baigsime.", "message.required": "Prie\u0161 t\u0119sdami atsakykite.", "message.rateLimit": "Per daug u\u017Eklaus\u0173. Bandoma i\u0161 naujo po {seconds} s...", "email.atHint": "Bakstel\u0117kite @, kad \u012Fterptum\u0117te simbol\u012F \u012F savo el. pa\u0161to adres\u0105", "email.atButton": "\u012Eterpti @" }, lv: { "placeholder.answer": "Ierakstiet savu atbildi \u0161eit...", "placeholder.number": "Ierakstiet skaitli \u0161eit...", "placeholder.email": "Ierakstiet savu e-pasta adresi \u0161eit...", "placeholder.date": "Ierakstiet datumu \u0161eit...", "placeholder.password": "Ierakstiet savu paroli \u0161eit...", "pointSystem.error": "Kop\u0113jam punktu skaitam j\u0101b\u016Bt 100 %", "boolean.yes": "J\u0101", "boolean.no": "N\u0113", "upload.cta": "Velciet un nometiet vai noklik\u0161\u0137iniet, lai aug\u0161upiel\u0101d\u0113tu", "upload.imagesOnly": "Tikai att\u0113li", "upload.anyFileType": "Jebkur\u0161 faila veids", "upload.maxFiles": "Maks. failu skaits: {n}", "upload.maxSize": "Maks. {mb} MB", "upload.tooLarge": "Fails ir p\u0101r\u0101k liels (maks. {mb} MB)", "upload.remove": "No\u0146emt", "select.placeholder": "Izv\u0113lieties opciju", "rating.ariaLabel": "V\u0113rt\u0113jums", "maxDiff.best": "Vissvar\u012Bg\u0101kais", "maxDiff.worst": "Vismaz\u0101k svar\u012Bgais", "maxDiff.setProgress": "Bloks {k} no {n}", "priority.selectUpTo": "Izv\u0113lieties l\u012Bdz", "priority.options": "opcij\u0101m", "priority.thenOrder": "un p\u0113c tam sak\u0101rtojiet t\u0101s", "priority.selectOptions": "Izv\u0113lieties opcijas", "priority.cancel": "Atcelt", "priority.confirm": "Apstiprin\u0101t", "priority.selectOptionNumber": "Izv\u0113lieties opciju Nr.", "priority.prioritized": "Sak\u0101rtotas p\u0113c priorit\u0101tes", "priority.of": "no", "priority.instruction": "J\u016Bsu priorit\u0101\u0161u saraksts ir redzams zem\u0101k. Ja v\u0113laties, varat main\u012Bt izv\u0113\u013Cu sec\u012Bbu, izmantojot bulti\u0146as. Noklik\u0161\u0137iniet uz 'T\u0101l\u0101k', lai apstiprin\u0101tu izv\u0113li un turpin\u0101tu.", "action.send": "Nos\u016Bt\u012Bt", "action.back": "Atpaka\u013C", "action.next": "T\u0101l\u0101k", "action.start": "Aiziet!", "message.success": "Paldies par J\u016Bsu atsauksmi!", "message.blocked": "Paldies par velt\u012Bto laiku \u2013 \u0161eit sarunu beigsim.", "message.required": "L\u016Bdzu, atbildiet, pirms turpin\u0101t.", "message.rateLimit": "P\u0101r\u0101k daudz piepras\u012Bjumu. Atk\u0101rtots m\u0113\u0123in\u0101jums p\u0113c {seconds} s...", "email.atHint": "Pieskarieties @, lai e-pasta adres\u0113 ievietotu \u0161o simbolu", "email.atButton": "Ievietot @" }, mt: { "placeholder.answer": "Ikteb it-twe\u0121iba tieg\u0127ek hawn...", "placeholder.number": "Ikteb in-numru tieg\u0127ek hawn...", "placeholder.email": "Ikteb l-email tieg\u0127ek hawn...", "placeholder.date": "Ikteb id-data hawn...", "placeholder.password": "Ikteb il-password tieg\u0127ek hawn...", "pointSystem.error": "It-total tal-punti g\u0127andu jkun 100 %", "boolean.yes": "Iva", "boolean.no": "Le", "upload.cta": "Ikkaxkar u po\u0121\u0121i jew ikklikkja biex ittella'", "upload.imagesOnly": "Stampi biss", "upload.anyFileType": "Kull tip ta' fajl", "upload.maxFiles": "Massimu ta' {n} fajls", "upload.maxSize": "Massimu ta' {mb} MB", "upload.tooLarge": "Il-fajl huwa kbir wisq (massimu {mb} MB)", "upload.remove": "Ne\u0127\u0127i", "select.placeholder": "Ag\u0127\u017Cel g\u0127a\u017Cla", "rating.ariaLabel": "Valutazzjoni", "maxDiff.best": "L-aktar importanti", "maxDiff.worst": "L-inqas importanti", "maxDiff.setProgress": "Blokk {k} minn {n}", "priority.selectUpTo": "Ag\u0127\u017Cel sa", "priority.options": "g\u0127a\u017Cliet", "priority.thenOrder": "u mbag\u0127ad po\u0121\u0121ihom f'ordni", "priority.selectOptions": "Ag\u0127\u017Cel g\u0127a\u017Cliet", "priority.cancel": "Ikkan\u010Bella", "priority.confirm": "Ikkonferma", "priority.selectOptionNumber": "Ag\u0127\u017Cel l-g\u0127a\u017Cla nru", "priority.prioritized": "Prijoritizzati", "priority.of": "minn", "priority.instruction": "Il-lista ta' prijoritajiet tieg\u0127ek tidher hawn ta\u0127t. Jekk trid, tista' tirran\u0121a mill-\u0121did l-g\u0127a\u017Cliet tieg\u0127ek billi tu\u017Ca l-vle\u0121e\u0121. Ikklikkja 'Li jmiss' biex tikkonferma l-g\u0127a\u017Cla tieg\u0127ek u tkompli.", "action.send": "Ibg\u0127at", "action.back": "Lura", "action.next": "Li jmiss", "action.start": "Ejja!", "message.success": "Grazzi tal-feedback tieg\u0127ek!", "message.blocked": "Grazzi tal-\u0127in tieg\u0127ek \u2013 se nwaqqfu l-konversazzjoni hawn.", "message.required": "Jekk jog\u0127\u0121bok wie\u0121eb qabel ma tkompli.", "message.rateLimit": "Wisq talbiet. Ner\u0121g\u0127u nippruvaw f'{seconds}s...", "email.atHint": "Ag\u0127fas @ biex idda\u0127\u0127al is-simbolu fl-indirizz tal-email tieg\u0127ek", "email.atButton": "Da\u0127\u0127al @" }, ro: { "placeholder.answer": "Scrie\u021Bi r\u0103spunsul aici...", "placeholder.number": "Scrie\u021Bi num\u0103rul aici...", "placeholder.email": "Scrie\u021Bi adresa de e-mail aici...", "placeholder.date": "Scrie\u021Bi data aici...", "placeholder.password": "Scrie\u021Bi parola aici...", "pointSystem.error": "Totalul punctelor trebuie s\u0103 fie 100 %", "boolean.yes": "Da", "boolean.no": "Nu", "upload.cta": "Trage\u021Bi \u0219i plasa\u021Bi sau face\u021Bi clic pentru a \xEEnc\u0103rca", "upload.imagesOnly": "Doar imagini", "upload.anyFileType": "Orice tip de fi\u0219ier", "upload.maxFiles": "Maximum {n} fi\u0219iere", "upload.maxSize": "Maximum {mb} MB", "upload.tooLarge": "Fi\u0219ierul este prea mare (maximum {mb} MB)", "upload.remove": "Elimina\u021Bi", "select.placeholder": "Selecta\u021Bi o op\u021Biune", "rating.ariaLabel": "Evaluare", "maxDiff.best": "Cel mai important", "maxDiff.worst": "Cel mai pu\u021Bin important", "maxDiff.setProgress": "Blocul {k} din {n}", "priority.selectUpTo": "Selecta\u021Bi p\xE2n\u0103 la", "priority.options": "op\u021Biuni", "priority.thenOrder": "\u0219i apoi ordona\u021Bi-le", "priority.selectOptions": "Selecta\u021Bi op\u021Biuni", "priority.cancel": "Anula\u021Bi", "priority.confirm": "Confirma\u021Bi", "priority.selectOptionNumber": "Selecta\u021Bi op\u021Biunea nr.", "priority.prioritized": "Prioritizate", "priority.of": "din", "priority.instruction": "Lista dvs. de priorit\u0103\u021Bi este afi\u0219at\u0103 mai jos. Dac\u0103 dori\u021Bi, pute\u021Bi reordona op\u021Biunile folosind s\u0103ge\u021Bile. Face\u021Bi clic pe \u201E\xCEnainte\u201D pentru a confirma selec\u021Bia \u0219i a continua.", "action.send": "Trimite\u021Bi", "action.back": "\xCEnapoi", "action.next": "\xCEnainte", "action.start": "S\u0103 \xEEncepem!", "message.success": "V\u0103 mul\u021Bumim pentru feedback!", "message.blocked": "V\u0103 mul\u021Bumim pentru timpul acordat \u2013 vom \xEEncheia conversa\u021Bia aici.", "message.required": "V\u0103 rug\u0103m s\u0103 r\u0103spunde\u021Bi \xEEnainte de a continua.", "message.rateLimit": "Prea multe solicit\u0103ri. Re\xEEncerc\u0103m \xEEn {seconds} s...", "email.atHint": "Atinge\u021Bi @ pentru a insera simbolul \xEEn adresa de e-mail", "email.atButton": "Insera\u021Bi @" }, sk: { "placeholder.answer": "Sem nap\xED\u0161te svoju odpove\u010F...", "placeholder.number": "Sem nap\xED\u0161te \u010D\xEDslo...", "placeholder.email": "Sem nap\xED\u0161te svoj e-mail...", "placeholder.date": "Sem nap\xED\u0161te d\xE1tum...", "placeholder.password": "Sem nap\xED\u0161te heslo...", "pointSystem.error": "S\xFA\u010Det bodov mus\xED by\u0165 100 %", "boolean.yes": "\xC1no", "boolean.no": "Nie", "upload.cta": "Presu\u0148te s\xFAbor sem alebo kliknite a nahrajte ho", "upload.imagesOnly": "Iba obr\xE1zky", "upload.anyFileType": "Ak\xFDko\u013Evek typ s\xFAboru", "upload.maxFiles": "Max. po\u010Det s\xFAborov: {n}", "upload.maxSize": "Max. {mb} MB", "upload.tooLarge": "S\xFAbor je pr\xEDli\u0161 ve\u013Ek\xFD (max. {mb} MB)", "upload.remove": "Odstr\xE1ni\u0165", "select.placeholder": "Vyberte mo\u017Enos\u0165", "rating.ariaLabel": "Hodnotenie", "maxDiff.best": "Najd\xF4le\u017Eitej\u0161ie", "maxDiff.worst": "Najmenej d\xF4le\u017Eit\xE9", "maxDiff.setProgress": "Blok {k} z {n}", "priority.selectUpTo": "Vyberte najviac", "priority.options": "mo\u017Enosti", "priority.thenOrder": "a potom ich zora\u010Fte", "priority.selectOptions": "Vyberte mo\u017Enosti", "priority.cancel": "Zru\u0161i\u0165", "priority.confirm": "Potvrdi\u0165", "priority.selectOptionNumber": "Vyberte mo\u017Enos\u0165 \u010D.", "priority.prioritized": "Zoraden\xE9 pod\u013Ea priority", "priority.of": "z", "priority.instruction": "V\xE1\u0161 zoznam prior\xEDt vid\xEDte ni\u017E\u0161ie. Ak chcete, m\xF4\u017Eete svoje vo\u013Eby preusporiada\u0165 pomocou \u0161\xEDpok. Kliknut\xEDm na \u201E\u010Ealej\u201C potvrd\xEDte v\xFDber a budete pokra\u010Dova\u0165.", "action.send": "Odosla\u0165", "action.back": "Sp\xE4\u0165", "action.next": "\u010Ealej", "action.start": "Po\u010Fme na to!", "message.success": "\u010Eakujeme za va\u0161u sp\xE4tn\xFA v\xE4zbu!", "message.blocked": "\u010Eakujeme za v\xE1\u0161 \u010Das \u2013 tu konverz\xE1ciu ukon\u010D\xEDme.", "message.required": "Pred pokra\u010Dovan\xEDm, pros\xEDm, odpovedzte.", "message.rateLimit": "Pr\xEDli\u0161 ve\u013Ea po\u017Eiadaviek. Opakujeme o {seconds} s...", "email.atHint": "\u0164uknut\xEDm na @ vlo\u017E\xEDte symbol do e-mailovej adresy", "email.atButton": "Vlo\u017Ei\u0165 @" }, sl: { "placeholder.answer": "Tukaj vpi\u0161ite svoj odgovor...", "placeholder.number": "Tukaj vpi\u0161ite \u0161tevilo...", "placeholder.email": "Tukaj vpi\u0161ite svoj e-po\u0161tni naslov...", "placeholder.date": "Tukaj vpi\u0161ite datum...", "placeholder.password": "Tukaj vpi\u0161ite geslo...", "pointSystem.error": "Skupno \u0161tevilo to\u010Dk mora biti 100 %", "boolean.yes": "Da", "boolean.no": "Ne", "upload.cta": "Povlecite in spustite ali kliknite za nalaganje", "upload.imagesOnly": "Samo slike", "upload.anyFileType": "Katera koli vrsta datoteke", "upload.maxFiles": "Najve\u010D datotek: {n}", "upload.maxSize": "Najve\u010D {mb} MB", "upload.tooLarge": "Datoteka je prevelika (najve\u010D {mb} MB)", "upload.remove": "Odstrani", "select.placeholder": "Izberite mo\u017Enost", "rating.ariaLabel": "Ocena", "maxDiff.best": "Najpomembnej\u0161e", "maxDiff.worst": "Najmanj pomembno", "maxDiff.setProgress": "Sklop {k} od {n}", "priority.selectUpTo": "Izberite do", "priority.options": "mo\u017Enosti", "priority.thenOrder": "in jih nato razvrstite", "priority.selectOptions": "Izberite mo\u017Enosti", "priority.cancel": "Prekli\u010Di", "priority.confirm": "Potrdi", "priority.selectOptionNumber": "Izberite mo\u017Enost \u0161t.", "priority.prioritized": "Razvr\u0161\u010Deno po prednosti", "priority.of": "od", "priority.instruction": "Va\u0161 seznam prednosti je prikazan spodaj. \u010Ce \u017Eelite, lahko izbire prerazporedite s pu\u0161\u010Dicami. Kliknite \xBBNaprej\xAB, da potrdite izbor in nadaljujete.", "action.send": "Po\u0161lji", "action.back": "Nazaj", "action.next": "Naprej", "action.start": "Za\u010Dnimo!", "message.success": "Hvala za va\u0161e povratne informacije!", "message.blocked": "Hvala za va\u0161 \u010Das \u2013 pogovor bomo tukaj zaklju\u010Dili.", "message.required": "Pred nadaljevanjem odgovorite na vpra\u0161anje.", "message.rateLimit": "Preve\u010D zahtev. Ponoven poskus \u010Dez {seconds} s...", "email.atHint": "Tapnite @, da vstavite simbol v e-po\u0161tni naslov", "email.atButton": "Vstavi @" } };
2510
- t2.Fc = ["en", "da", "fi", "no", "es", "sv", "ar", "bn", "de", "pt", "fr", "bg", "cs", "el", "et", "ga", "hr", "hu", "it", "lt", "lv", "mt", "nl", "pl", "ro", "sk", "sl"], Object.keys(a), t2.DB = ["ar"];
2511
- const r = { nb: "no", nn: "no", nob: "no", nno: "no", iw: "he", in: "id", cmn: "zh" };
2512
- function n(e3) {
2513
- return (function(e4) {
2514
- if (!e4) return null;
2515
- const t3 = e4.trim().toLowerCase().replace(/_/g, "-");
2516
- if (!t3) return null;
2517
- if (a[t3]) return t3;
2518
- const i3 = t3.split("-")[0], n2 = r[i3] || i3;
2519
- return a[n2] ? n2 : null;
2520
- })(e3) || "en";
2521
- }
2522
- Object.keys(i2), t2.isRtlLanguage = function(e3) {
2523
- return -1 !== t2.DB.indexOf(n(e3));
2524
- }, t2.t = function(e3, t3, r2) {
2525
- const o = a[n(e3)] || i2, s = void 0 !== o[t3] ? o[t3] : i2[t3];
2526
- return r2 ? (function(e4, t4) {
2527
- return Object.keys(t4).reduce((e5, i3) => e5.replace(new RegExp("\\{" + i3 + "\\}", "g"), String(t4[i3])), e4);
2528
- })(s, r2) : s;
2529
- };
2530
- }, 9857(e2, t2) {
2531
- "use strict";
2532
- t2.endpoints = void 0, t2.endpoints = { sdk: { app: (e3, t3) => `sdk/app/${e3}/${t3}`, app_info: (e3, t3) => `sdk/app/${e3}/${t3}/info`, session: (e3) => `sdk/app/session/${e3}/info`, feedback: "sdk/feedback", followUpQuestion: "sdk/followUpQuestion", agentSurveyStart: "sdk/agentSurvey/start", agentSurveyNext: "sdk/agentSurvey/next" } };
2533
- }, 9784(e2, t2, i2) {
2534
- "use strict";
2535
- t2.placeholder = void 0;
2536
- const a = i2(881);
2537
- t2.placeholder = { answer: (e3) => (0, a.t)(e3, "placeholder.answer"), number: (e3) => (0, a.t)(e3, "placeholder.number"), email: (e3) => (0, a.t)(e3, "placeholder.email"), date: (e3) => (0, a.t)(e3, "placeholder.date"), password: (e3) => (0, a.t)(e3, "placeholder.password"), pointsystemerror: (e3) => (0, a.t)(e3, "pointSystem.error"), upload: { cta: (e3) => (0, a.t)(e3, "upload.cta"), formats: (e3, t3) => (0, a.t)(e3, "image" === t3 ? "upload.imagesOnly" : "upload.anyFileType"), maxFiles: (e3, t3) => (0, a.t)(e3, "upload.maxFiles", { n: t3 }), maxSize: (e3, t3) => (0, a.t)(e3, "upload.maxSize", { mb: t3 }), tooLarge: (e3, t3) => (0, a.t)(e3, "upload.tooLarge", { mb: t3 }), remove: (e3) => (0, a.t)(e3, "upload.remove") } };
2538
- }, 7213(e2, t2, i2) {
2539
- "use strict";
2540
- t2.renderStartMessage = t2.renderSuccess = t2.renderError = t2.renderActions = t2.renderQuestions = void 0;
2541
- const a = i2(5558), r = i2(8042), n = i2(516), o = i2(6471), s = i2(7321), l = { small: "1rem", medium: "1.2rem", large: "1.5rem" };
2542
- t2.renderQuestions = function e3(t3, i3 = "standard", d = "en", c = { customIcons: false }, u) {
2543
- if (!t3) throw new Error("[MagicFeedback] No questions provided");
2544
- const p = [], { customIcons: m, id: h } = c;
2545
- return t3.forEach((f) => {
2546
- var g, y;
2547
- if ((null === (y = null === (g = null == f ? void 0 : f.questionType) || void 0 === g ? void 0 : g.conf) || void 0 === y ? void 0 : y.length) > 0) {
2548
- let t4 = document.createElement("div");
2549
- t4.classList.add("magicfeedback-div");
2550
- const a2 = document.createElement("label");
2551
- a2.setAttribute("for", `magicfeedback-${f.id}`), a2.textContent = (0, n.parseTitle)(f.title, d), a2.classList.add("magicfeedback-label"), t4.appendChild(a2), f.questionType.conf.forEach((e4) => {
2552
- e4.ref = f.ref, f.assets[e4.id] && (e4.assets = { placeholder: f.assets[e4.id] });
2553
- }), e3(f.questionType.conf, i3, d, c, u).forEach((e4) => {
2554
- t4.appendChild(e4);
2555
- }), p.push(t4);
2556
- } else {
2557
- const e4 = (function(e5, t4, i4, d2, c2, u2) {
2558
- var p2, m2, h2;
2559
- let f2, g2, y2, { id: v, title: b, type: E, ref: k, require: A, defaultValue: T, assets: C } = e5, x = document.createElement("div");
2560
- x.classList.add("magicfeedback-div");
2561
- const w = window.innerWidth < 600, S = "slim" === t4 ? (0, n.parseTitle)(b, i4) : null == C ? void 0 : C.placeholder, P = (0, o.shownValueFor)(e5, (0, n.getUrlParam)(k)), L = (null == C ? void 0 : C.maxCharacters) || 0, O = false === (null == C ? void 0 : C.autoAdvance) ? void 0 : c2, I = void 0 !== (null == C ? void 0 : C.randomPosition) && (null == C ? void 0 : C.randomPosition), N = (null == C ? void 0 : C.direction) || "row", D = (null == C ? void 0 : C.order) || "ltr", R = (0, r.getQuestionRenderer)(E);
2562
- if (!R) return x;
2563
- {
2564
- const r2 = R({ question: e5, format: t4, language: i4, url: d2, send: E === a.FEEDBACKAPPANSWERTYPE.TEXT ? c2 : O, isPhone: w, urlParamValue: P, placeholderText: S, maxCharacters: L, randomPosition: I, direction: N, order: D, productId: u2 });
2565
- f2 = r2.element, g2 = r2.elementTypeClass, y2 = r2.container || r2.element;
2566
- }
2567
- f2.id = `magicfeedback-${v}`, f2.setAttribute("name", k), f2.classList.add(g2), (void 0 !== T || null !== P) && (f2.value = P || T), ["RADIO", "MULTIPLECHOICE", "UPLOAD_IMAGE", "UPLOAD_FILE"].includes(E) || (f2.classList.add("magicfeedback-input"), f2.required = A);
2568
- const j = document.createElement("label");
2569
- j.setAttribute("for", `magicfeedback-${v}`), j.textContent = (0, n.parseTitle)(b, i4), j.classList.add("magicfeedback-label"), (function(e6, t5) {
2570
- if ("INFO_PAGE" !== t5.type) return;
2571
- const { assets: i5 } = t5, a2 = (function(e7) {
2572
- if (e7) return l[e7] || e7;
2573
- })(null == i5 ? void 0 : i5.titleSize), r2 = (n2 = null == i5 ? void 0 : i5.titleStyle, Array.isArray(n2) ? n2 : n2 ? [n2] : []);
2574
- var n2;
2575
- a2 && e6.style.setProperty("font-size", a2, "important"), (null == i5 ? void 0 : i5.titleAlign) && (e6.style.setProperty("width", "100%", "important"), e6.style.setProperty("align-self", "stretch", "important"), e6.style.setProperty("text-align", i5.titleAlign, "important")), r2.includes("italic") && e6.style.setProperty("font-style", "italic", "important"), r2.includes("bold") && e6.style.setProperty("font-weight", "bold", "important"), r2.includes("underline") && e6.style.setProperty("text-decoration", "underline", "important");
2576
- })(j, e5);
2577
- const F = document.createElement("label");
2578
- if (F.textContent = (0, n.parseTitle)(null == C ? void 0 : C.subtitle, i4), F.classList.add("magicfeedback-sublabel"), (null === (p2 = null == C ? void 0 : C.subtitleStyle) || void 0 === p2 ? void 0 : p2.includes("italic")) && (F.style.fontStyle = "italic"), (null === (m2 = null == C ? void 0 : C.subtitleStyle) || void 0 === m2 ? void 0 : m2.includes("bold")) && (F.style.fontWeight = "bold"), (null === (h2 = null == C ? void 0 : C.subtitleStyle) || void 0 === h2 ? void 0 : h2.includes("underline")) && (F.style.textDecoration = "underline"), ["CONSENT"].includes(E)) x.classList.add("magicfeedback-consent-container"), x.appendChild(f2), x.appendChild(j), (null == C ? void 0 : C.subtitle) && x.appendChild(F);
2579
- else {
2580
- if ("slim" !== t4 && (x.appendChild(j), (null == C ? void 0 : C.subtitle) && x.appendChild(F), void 0 !== (null == C ? void 0 : C.general) && "" !== (null == C ? void 0 : C.general))) {
2581
- const e6 = document.createElement("img");
2582
- e6.src = null == C ? void 0 : C.general, e6.classList.add("magicfeedback-image"), e6.style.maxWidth = "auto", e6.style.height = "400px", e6.style.margin = "10px 0", x.appendChild(e6);
2583
- }
2584
- if ("LONGTEXT" === E && L > 0) {
2585
- const e6 = document.createElement("div");
2586
- if (e6.classList.add("magicfeedback-counter"), e6.textContent = `${f2.value.length}/${L}`, e6.style.textAlign = "end", e6.style.fontSize = "15px", e6.style.marginTop = "5px", f2.addEventListener("input", () => {
2587
- e6.textContent = `${f2.value.length}/${L}`;
2588
- }), x.appendChild(f2), x.appendChild(e6), (null == C ? void 0 : C.extraOption) && (null == C ? void 0 : C.extraOptionText)) {
2589
- const e7 = document.createElement("div");
2590
- e7.classList.add("magicfeedback-skip-container"), e7.classList.add("magicfeedback-checkbox-container"), e7.style.display = "flex", e7.style.justifyContent = "flex-start";
2591
- const t5 = document.createElement("input");
2592
- t5.classList.add("magicfeedback-skip"), t5.type = "checkbox", t5.id = `skip-${k}`, t5.name = k, t5.value = "-", t5.style.cursor = "pointer";
2593
- const i5 = document.createElement("label");
2594
- i5.htmlFor = `skip-${k}`, i5.textContent = null == C ? void 0 : C.extraOptionText, i5.style.fontSize = "15px", i5.style.cursor = "pointer", i5.style.margin = "0 5px", t5.addEventListener("click", () => {
2595
- f2.value = "-";
2596
- }), (0, s.autoAdvanceOn)(t5, O, "click"), e7.appendChild(t5), e7.appendChild(i5), x.appendChild(e7);
2597
- }
2598
- } else x.appendChild(y2);
2599
- }
2600
- return x;
2601
- })(f, i3, d, "https://survey-dev.magicfeedback.io/assets/emojis" + (m ? `/${h}` : ""), 1 === t3.length ? u : void 0, h);
2602
- p.push(e4);
2603
- }
2604
- }), p;
2605
- }, t2.renderActions = function(e3 = "", t3, i3 = "Submit", a2 = "Back", r2 = "Next") {
2606
- const n2 = document.createElement("div");
2607
- n2.classList.add("magicfeedback-action-container");
2608
- const o2 = document.createElement("button");
2609
- o2.id = "magicfeedback-submit", o2.type = "submit", o2.classList.add("magicfeedback-submit"), o2.textContent = "MAGICSURVEY" === e3 ? r2 || "Next" : i3 || "Submit";
2610
- const s2 = document.createElement("button");
2611
- return s2.id = "magicfeedback-back", s2.type = "button", s2.classList.add("magicfeedback-back"), s2.textContent = a2 || "Back", s2.addEventListener("click", t3), s2.addEventListener("click", () => {
2612
- o2.removeAttribute("disabled");
2613
- }), "MAGICSURVEY" === e3 && n2.appendChild(s2), n2.appendChild(o2), n2;
2614
- }, t2.renderError = function(e3) {
2615
- const t3 = document.createElement("div");
2616
- return t3.classList.add("magicfeedback-error"), t3.textContent = e3, t3;
2617
- }, t2.renderSuccess = function(e3) {
2618
- const t3 = document.createElement("div");
2619
- return t3.classList.add("magicfeedback-success"), t3.textContent = e3, t3;
2620
- }, t2.renderStartMessage = function(e3, t3 = false, i3 = "Go!", a2 = () => {
2621
- }) {
2622
- const r2 = document.createElement("div");
2623
- r2.classList.add("magicfeedback-start-message-container");
2624
- const n2 = document.createElement("div");
2625
- if (n2.classList.add("magicfeedback-start-message"), n2.innerHTML = e3, r2.appendChild(n2), t3) {
2626
- const e4 = document.createElement("button");
2627
- e4.id = "magicfeedback-start-message-button", e4.classList.add("magicfeedback-start-message-button"), e4.textContent = i3, e4.addEventListener("click", () => a2()), r2.appendChild(e4);
2628
- }
2629
- return r2;
2630
- };
2631
- }, 2313(e2, t2, i2) {
2632
- "use strict";
2633
- var a = this && this.__awaiter || function(e3, t3, i3, a2) {
2634
- return new (i3 || (i3 = Promise))(function(r2, n2) {
2635
- function o2(e4) {
2636
- try {
2637
- l2(a2.next(e4));
2638
- } catch (e5) {
2639
- n2(e5);
2640
- }
2641
- }
2642
- function s2(e4) {
2643
- try {
2644
- l2(a2.throw(e4));
2645
- } catch (e5) {
2646
- n2(e5);
2647
- }
2648
- }
2649
- function l2(e4) {
2650
- var t4;
2651
- e4.done ? r2(e4.value) : (t4 = e4.value, t4 instanceof i3 ? t4 : new i3(function(e5) {
2652
- e5(t4);
2653
- })).then(o2, s2);
2654
- }
2655
- l2((a2 = a2.apply(e3, t3 || [])).next());
2656
- });
2657
- }, r = this && this.__importDefault || function(e3) {
2658
- return e3 && e3.__esModule ? e3 : { default: e3 };
2659
- };
2660
- Object.defineProperty(t2, "__esModule", { value: true }), t2.getFollowUpQuestion = t2.sendFeedback = t2.getQuestions = t2.getSessionForm = t2.getForm = t2.takePreloadedInfo = t2.validateEmail = t2.header = void 0;
2661
- const n = r(i2(4945)), o = r(i2(8330)), s = i2(9857), l = i2(6471);
2662
- function d(e3) {
2663
- if ("undefined" == typeof window) return;
2664
- const i3 = window, a2 = i3.__MAGICFEEDBACK_PRELOADED_INFO__;
2665
- if (a2 && a2.url === e3 && a2.parameters === t2.header["x-magicfeedback-parameters"]) {
2666
- delete i3.__MAGICFEEDBACK_PRELOADED_INFO__;
2667
- try {
2668
- return JSON.parse(a2.body);
2669
- } catch (e4) {
2670
- return;
2671
- }
2672
- }
2673
- }
2674
- t2.header = { Accept: "application/json", "Magicfeedback-Sdk-Version": o.default.version, "x-magicfeedback-parameters": window.location.search || "" }, t2.validateEmail = function(e3) {
2675
- return /\S+@\S+\.\S+/.test(e3);
2676
- }, t2.takePreloadedInfo = d, t2.getForm = function(e3, i3, r2, o2, c) {
2677
- return a(this, void 0, void 0, function* () {
2678
- try {
2679
- const a2 = (0, l.withLangParam)(e3 + s.endpoints.sdk.app_info(i3, r2), c), o3 = d(a2);
2680
- if (void 0 !== o3) return o3;
2681
- const u = yield (0, n.default)(a2, { method: "GET", headers: t2.header });
2682
- return yield u.json();
2683
- } catch (e4) {
2684
- o2.err(e4);
2685
- }
2686
- });
2687
- }, t2.getSessionForm = function(e3, i3, r2, o2) {
2688
- return a(this, void 0, void 0, function* () {
2689
- try {
2690
- const a2 = (0, l.withLangParam)(e3 + s.endpoints.sdk.session(i3), o2), r3 = d(a2);
2691
- if (void 0 !== r3) return r3;
2692
- const c = yield (0, n.default)(a2, { method: "GET", headers: t2.header });
2693
- return yield c.json();
2694
- } catch (e4) {
2695
- r2.err(e4);
2696
- }
2697
- });
2698
- }, t2.getQuestions = function(e3, i3, r2, o2, d2) {
2699
- return a(this, void 0, void 0, function* () {
2700
- try {
2701
- const a2 = yield (0, n.default)((0, l.withLangParam)(e3 + s.endpoints.sdk.app(i3, r2), d2), { method: "GET", headers: t2.header });
2702
- if (a2.ok) {
2703
- const e4 = yield a2.json();
2704
- return o2.log(`Received questions for app ${i3}`, e4), e4;
2705
- }
2706
- throw o2.err(`Failed to get questions for app ${i3}:`, a2.status, a2.statusText), new Error("[MagicFeedback] Bad response from server");
2707
- } catch (e4) {
2708
- return o2.err(e4), [];
2709
- }
2710
- });
2711
- }, t2.sendFeedback = function(e3, i3, r2) {
2712
- return a(this, void 0, void 0, function* () {
2713
- try {
2714
- const a2 = yield (0, n.default)(e3 + s.endpoints.sdk.feedback, { method: "POST", headers: Object.assign({ "Content-Type": "application/json" }, t2.header), body: JSON.stringify(i3) });
2715
- if (a2.ok) return r2.log(`Form ${i3.integration} submitted successfully!`), (yield a2.json()).sessionId;
2716
- throw r2.err(`Failed to submit form ${i3.integration}:`, a2.status, a2.statusText), new Error(a2.statusText);
2717
- } catch (e4) {
2718
- return r2.err(e4), "";
2719
- }
2720
- });
2721
- }, t2.getFollowUpQuestion = function(e3, i3, r2) {
2722
- return a(this, void 0, void 0, function* () {
2723
- try {
2724
- const a2 = yield (0, n.default)(e3 + s.endpoints.sdk.followUpQuestion, { method: "POST", headers: Object.assign({ "Content-Type": "application/json" }, t2.header), body: JSON.stringify(i3) });
2725
- if (a2.ok) return r2.log(`Received follow up question for form ${i3.integration}`), (yield a2.json()) || "";
2726
- throw r2.err(`Failed to get follow up question for form ${i3.integration}:`, a2.status, a2.statusText), new Error(a2.statusText);
2727
- } catch (e4) {
2728
- return r2.err(e4), "";
2729
- }
2730
- });
2731
- };
2732
- }, 5146(e2, t2) {
2733
- "use strict";
2734
- t2.SubmitError = void 0;
2735
- class i2 extends Error {
2736
- constructor(e3, t3) {
2737
- super(t3), this.code = e3, this.name = "SubmitError", Object.setPrototypeOf(this, i2.prototype);
2738
- }
2739
- }
2740
- t2.SubmitError = i2;
2741
- }, 6471(e2, t2, i2) {
2742
- "use strict";
2743
- t2.toBaseAnswers = t2.shownValueFor = t2.withLangParam = t2.detectSurveyLang = t2.normalizeSurveyLang = void 0;
2744
- const a = i2(5558), r = { nb: "no", nn: "no", nob: "no", nno: "no" };
2745
- function n(e3) {
2746
- if (!e3 || "string" != typeof e3) return null;
2747
- const t3 = e3.trim().toLowerCase().replace(/_/g, "-").split("-")[0];
2748
- return /^[a-z]{2,3}$/.test(t3) ? r[t3] || t3 : null;
2749
- }
2750
- function o(e3) {
2751
- if (null == e3) return null;
2752
- if ("string" == typeof e3 && e3.trim().startsWith("{")) try {
2753
- e3 = JSON.parse(e3);
2754
- } catch (t3) {
2755
- return e3;
2756
- }
2757
- return "object" == typeof e3 ? void 0 !== e3.value ? String(e3.value) : null : String(e3);
2758
- }
2759
- t2.normalizeSurveyLang = n, t2.detectSurveyLang = function(e3) {
2760
- return n(e3) || (function() {
2761
- if ("undefined" == typeof navigator) return null;
2762
- const e4 = [...Array.isArray(navigator.languages) ? navigator.languages : [], navigator.language];
2763
- for (const t3 of e4) {
2764
- const e5 = n(t3);
2765
- if (e5) return e5;
2766
- }
2767
- return null;
2768
- })();
2769
- }, t2.withLangParam = function(e3, t3) {
2770
- return t3 ? `${e3}${e3.includes("?") ? "&" : "?"}lang=${encodeURIComponent(t3)}` : e3;
2771
- }, t2.shownValueFor = function(e3, t3) {
2772
- var i3, a2;
2773
- if (null === t3 || !Array.isArray(null == e3 ? void 0 : e3.baseValue)) return t3;
2774
- const r2 = e3.baseValue.findIndex((e4) => o(e4) === t3);
2775
- return -1 === r2 ? t3 : null !== (a2 = o(null === (i3 = e3.value) || void 0 === i3 ? void 0 : i3[r2])) && void 0 !== a2 ? a2 : t3;
2776
- };
2777
- const s = [a.FEEDBACKAPPANSWERTYPE.RADIO, a.FEEDBACKAPPANSWERTYPE.MULTIPLECHOICE, a.FEEDBACKAPPANSWERTYPE.MULTIPLECHOISE_IMAGE, a.FEEDBACKAPPANSWERTYPE.SELECT];
2778
- t2.toBaseAnswers = function(e3, t3) {
2779
- return e3.map((e4) => {
2780
- if (e4.key.startsWith("extra-option-")) return e4;
2781
- const i3 = t3.find((t4) => t4.ref === e4.key) || t3.find((t4) => e4.key.includes(t4.ref));
2782
- if (!i3) return e4;
2783
- const r2 = (function(e5) {
2784
- const t4 = /* @__PURE__ */ new Map(), i4 = null == e5 ? void 0 : e5.value, a2 = null == e5 ? void 0 : e5.baseValue;
2785
- return Array.isArray(i4) && Array.isArray(a2) ? (i4.forEach((e6, i5) => {
2786
- const r3 = o(e6), n3 = o(a2[i5]);
2787
- null === r3 || null === n3 || t4.has(r3) || t4.set(r3, n3);
2788
- }), t4) : t4;
2789
- })(i3);
2790
- if (0 === r2.size) return e4;
2791
- let n2;
2792
- if (s.includes(i3.type)) n2 = (e5) => {
2793
- var t4;
2794
- return "string" == typeof e5 && null !== (t4 = r2.get(e5)) && void 0 !== t4 ? t4 : e5;
2795
- };
2796
- else if (i3.type === a.FEEDBACKAPPANSWERTYPE.PRIORITY_LIST) n2 = (e5) => "string" == typeof e5 ? (function(e6, t4) {
2797
- var i4, a2;
2798
- const r3 = /^(\d+)\.\s?(.*)$/.exec(e6);
2799
- if (!r3) return null !== (i4 = t4.get(e6)) && void 0 !== i4 ? i4 : e6;
2800
- const n3 = r3[2];
2801
- return `${r3[1]}. ${null !== (a2 = t4.get(n3)) && void 0 !== a2 ? a2 : n3}`;
2802
- })(e5, r2) : e5;
2803
- else if (i3.type === a.FEEDBACKAPPANSWERTYPE.POINT_SYSTEM) n2 = (e5) => "string" == typeof e5 ? (function(e6, t4) {
2804
- var i4;
2805
- const a2 = e6.lastIndexOf(":");
2806
- if (-1 === a2) return e6;
2807
- const r3 = e6.substring(0, a2);
2808
- return `${null !== (i4 = t4.get(r3)) && void 0 !== i4 ? i4 : r3}${e6.substring(a2)}`;
2809
- })(e5, r2) : e5;
2810
- else if (i3.type === a.FEEDBACKAPPANSWERTYPE.MULTI_QUESTION_MATRIX) n2 = (e5) => "string" == typeof e5 ? (function(e6, t4) {
2811
- try {
2812
- const i4 = JSON.parse(e6);
2813
- return Array.isArray(i4) ? JSON.stringify(i4.map((e7) => Object.assign(Object.assign({}, e7), { value: Array.isArray(null == e7 ? void 0 : e7.value) ? e7.value.map((e8) => {
2814
- var i5;
2815
- return null !== (i5 = t4.get(e8)) && void 0 !== i5 ? i5 : e8;
2816
- }) : null == e7 ? void 0 : e7.value }))) : e6;
2817
- } catch (t5) {
2818
- return e6;
2819
- }
2820
- })(e5, r2) : e5;
2821
- else {
2822
- if (i3.type !== a.FEEDBACKAPPANSWERTYPE.MAX_DIFF) return e4;
2823
- n2 = (e5) => "string" == typeof e5 ? (function(e6, t4) {
2824
- try {
2825
- const i4 = JSON.parse(e6);
2826
- if (!Array.isArray(i4)) return e6;
2827
- const a2 = (e7) => {
2828
- var i5;
2829
- return "string" == typeof e7 && null !== (i5 = t4.get(e7)) && void 0 !== i5 ? i5 : e7;
2830
- };
2831
- return JSON.stringify(i4.map((e7) => Object.assign(Object.assign({}, e7), { shown: Array.isArray(null == e7 ? void 0 : e7.shown) ? e7.shown.map(a2) : null == e7 ? void 0 : e7.shown, best: a2(null == e7 ? void 0 : e7.best), worst: a2(null == e7 ? void 0 : e7.worst) })));
2832
- } catch (t5) {
2833
- return e6;
2834
- }
2835
- })(e5, r2) : e5;
2836
- }
2837
- return Object.assign(Object.assign({}, e4), { value: e4.value.map(n2) });
2838
- });
2839
- };
2840
- }, 7321(e2, t2) {
2841
- "use strict";
2842
- t2.answeredInput = t2.autoAdvanceRequested = t2.f3 = t2.cancelAutoAdvance = t2.autoAdvanceOn = t2.IX = void 0, t2.IX = 300;
2843
- const i2 = /* @__PURE__ */ new Map();
2844
- t2.autoAdvanceOn = function(e3, a, r = "change") {
2845
- a && e3.addEventListener(r, () => (function(e4, a2) {
2846
- const r2 = i2.get(a2);
2847
- r2 && clearTimeout(r2.timer);
2848
- const n = setTimeout(() => {
2849
- i2.delete(a2), e4.isConnected && a2();
2850
- }, t2.IX);
2851
- i2.set(a2, { timer: n, source: e4 });
2852
- })(e3, a));
2853
- }, t2.cancelAutoAdvance = function(e3) {
2854
- e3 && i2.forEach(({ timer: t3, source: a }, r) => {
2855
- e3.contains(a) && (clearTimeout(t3), i2.delete(r));
2856
- });
2857
- }, t2.f3 = "autoadvance", t2.autoAdvanceRequested = function(e3 = window.location.search) {
2858
- const i3 = new URLSearchParams(e3).get(t2.f3);
2859
- return "true" === i3 || "1" === i3;
2860
- }, t2.answeredInput = function(e3, t3) {
2861
- return Array.from(e3.querySelectorAll(".magicfeedback-input")).filter((e4) => e4.name === t3).find((e4) => "radio" === e4.type || "checkbox" === e4.type ? e4.checked : "" !== e4.value) || null;
2862
- };
2863
- }, 2195(e2, t2) {
2864
- "use strict";
2865
- t2.focusFirstTextQuestion = t2.jg = void 0, t2.jg = ["text", "email", "number", "tel", "url", "search"], t2.focusFirstTextQuestion = function(e3) {
2866
- var i2, a;
2867
- if (!e3) return false;
2868
- const r = (function(e4) {
2869
- if (!e4) return null;
2870
- const i3 = e4.querySelector(".magicfeedback-div");
2871
- if (!i3) return null;
2872
- const a2 = i3.querySelector('input:not([type="hidden"]), textarea, select, button');
2873
- if (!a2) return null;
2874
- const r2 = a2;
2875
- return r2.disabled || r2.readOnly ? null : "TEXTAREA" === a2.tagName || "INPUT" === a2.tagName && t2.jg.includes(a2.type) ? r2 : null;
2876
- })(e3);
2877
- if (!r) return false;
2878
- const n = null === (i2 = e3.ownerDocument) || void 0 === i2 ? void 0 : i2.activeElement;
2879
- if (n && !e3.contains(n) && (function(e4) {
2880
- const t3 = e4.tagName;
2881
- return "INPUT" === t3 || "TEXTAREA" === t3 || "SELECT" === t3 || true === e4.isContentEditable;
2882
- })(n)) return false;
2883
- try {
2884
- r.focus({ preventScroll: true });
2885
- } catch (e4) {
2886
- r.focus();
2887
- }
2888
- return (null === (a = e3.ownerDocument) || void 0 === a ? void 0 : a.activeElement) === r;
2889
- };
2890
- }, 4039(e2, t2) {
2891
- "use strict";
2892
- t2.armGhostTapGuard = t2.H = void 0, t2.H = 400;
2893
- const i2 = /* @__PURE__ */ new WeakMap();
2894
- t2.armGhostTapGuard = function(e3) {
2895
- e3 && (i2.has(e3) || e3.addEventListener("click", (r) => {
2896
- var n;
2897
- 0 !== r.detail && (a() - (null !== (n = i2.get(e3)) && void 0 !== n ? n : -1 / 0) >= t2.H || (r.preventDefault(), r.stopPropagation()));
2898
- }, true), i2.set(e3, a()));
2899
- };
2900
- const a = () => "undefined" != typeof performance ? performance.now() : Date.now();
2901
- }, 9256(e2, t2) {
2902
- "use strict";
2903
- t2.Log = void 0, t2.Log = class {
2904
- constructor(e3) {
2905
- this.config = e3;
2906
- }
2907
- log(...e3) {
2908
- this.config.get("debug") && console.log("[MagicFeedback]:", ...e3);
2909
- }
2910
- err(...e3) {
2911
- console.error("[MagicFeedback]:", ...e3);
2912
- }
2913
- };
2914
- }, 8330(e2) {
2915
- "use strict";
2916
- e2.exports = JSON.parse('{"name":"@magicfeedback/native","version":"2.2.39","main":"./dist/magicfeedback-sdk.node.js","browser":"./dist/magicfeedback-sdk.browser.js","types":"./dist/types/src/index.d.ts","repository":{"type":"git","url":"git+ssh://git@github.com/MagicFeedback/magicfeedback-sdk.git"},"author":"farias@magicfeedback.io","license":"MIT","private":false,"scripts":{"dev":"vite","build":"webpack","build:watch":"webpack --watch --mode development","release":"npm publish --access public","release:beta":"npm publish --access public --tag beta","release:alpha":"npm publish --access public --tag alpha","test":"jest","test:watch":"jest --watchAll","coverage":"jest --coverage","publish:sdk":"bash publish.sh","publish:sdk:dry-run":"NPM_DRY_RUN=1 bash publish.sh"},"files":["dist"],"devDependencies":{"@babel/preset-typescript":"^7.22.5","@types/node":"^22.20.5","@types/webpack":"^5.28.0","@types/webpack-node-externals":"^2.5.3","c8":"^7.11.0","copy-webpack-plugin":"^14.0.0","jest":"^29.5.0","jest-environment-jsdom":"^29.5.0","jest-fetch-mock":"^3.0.3","nock":"^13.2.4","ts-jest":"^29.1.0","ts-loader":"^9.2.7","ts-node":"^10.7.0","typescript":"^4.6.2","vite":"^6.4.5","webpack":"^5.70.0","webpack-cli":"^4.9.2","webpack-node-externals":"^3.0.0"},"dependencies":{"cross-fetch":"^3.1.5","is-bundling-for-browser-or-node":"^1.1.1"},"description":"MagicFeedbackAI JavaScript Library for [MagicFeedback.io](https://magicfeedback.io/)","bugs":{"url":"https://github.com/MagicFeedback/magicfeedback-sdk/issues"},"homepage":"https://github.com/MagicFeedback/magicfeedback-sdk#readme","directories":{"example":"examples","test":"test"},"style":"./dist/styles/magicfeedback-default.css"}');
2917
- } };
2918
- const t = {};
2919
- let i = (function i2(a) {
2920
- const r = t[a];
2921
- if (void 0 !== r) return r.exports;
2922
- const n = t[a] = { exports: {} };
2923
- return e[a].call(n.exports, n, n.exports, i2), n.exports;
2924
- })(8156);
2925
- return i = i.default, i;
2926
- })());
2927
- }
2928
- });
2929
-
2930
- // src/ui/logo.ts
2931
- var BASE_CSS = "max-height:40px; max-width:100%; object-fit:contain; display:block; margin:12px 0 0 0;";
2932
- var MAX_HEIGHT = {
2933
- small: "30px",
2934
- medium: "50px",
2935
- large: "70px"
2936
- };
2937
- function insertPopupLogo(parent, anchor, style, id) {
2938
- if (!style?.logo) return null;
2939
- if (parent.ownerDocument.getElementById(id)) return null;
2940
- const img = parent.ownerDocument.createElement("img");
2941
- img.id = id;
2942
- img.src = style.logo;
2943
- img.alt = "Logo";
2944
- img.style.cssText = BASE_CSS;
2945
- if (style.logoSize && MAX_HEIGHT[style.logoSize]) {
2946
- img.style.maxHeight = MAX_HEIGHT[style.logoSize];
2947
- }
2948
- switch (style.logoPosition) {
2949
- case "left":
2950
- img.style.margin = "12px 0 0 0";
2951
- img.style.setProperty("margin-inline-start", "0");
2952
- img.style.setProperty("margin-inline-end", "16px");
2953
- break;
2954
- case "right":
2955
- img.style.margin = "12px 0 0 0";
2956
- img.style.setProperty("margin-inline-start", "auto");
2957
- img.style.setProperty("margin-inline-end", "0");
2958
- break;
2959
- case "center":
2960
- img.style.margin = "12px auto 0 auto";
2961
- break;
2962
- }
2963
- parent.insertBefore(img, anchor);
2964
- return img;
2965
- }
2966
-
2967
- // src/ui/surveySdkLoader.ts
2968
- var import_native = __toESM(require_magicfeedback_sdk_browser());
2969
-
2970
- // src/ui/surveyCss.ts
2971
- var SURVEY_CSS_LOADERS = {
2972
- "2.2.38": () => import("./2.2.38-LGZRM7GX.mjs"),
2973
- "2.2.39": () => import("./2.2.39-BJJ3YRJ4.mjs")
2974
- };
2975
-
2976
- // src/ui/surveySdkLoader.ts
2977
- var SURVEY_SDK_LOAD_TIMEOUT_MS = 6e3;
2978
- async function loadVendoredCss(version) {
2979
- const load = SURVEY_CSS_LOADERS[version];
2980
- if (!load) throw new Error(`no vendored survey CSS for ${version}`);
2981
- const css = (await load()).default;
2982
- if (typeof css !== "string" || css.length === 0) throw new Error(`empty survey CSS for ${version}`);
2983
- return css;
2984
- }
2985
- var cache = /* @__PURE__ */ new Map();
2986
- var queue = Promise.resolve();
2987
- function isUsable(sdk) {
2988
- return !!sdk && typeof sdk.form === "function" && typeof sdk.init === "function";
2989
- }
2990
- function loadUmdScript(url, nonce, timeoutMs = SURVEY_SDK_LOAD_TIMEOUT_MS) {
2991
- return new Promise((resolve, reject) => {
2992
- const w = window;
2993
- const hadGlobal = Object.prototype.hasOwnProperty.call(w, "magicfeedback");
2994
- const previous = w.magicfeedback;
2995
- const amdDefine = typeof w.define === "function" && w.define.amd ? w.define : void 0;
2996
- if (amdDefine) w.define = void 0;
2997
- const script = document.createElement("script");
2998
- script.src = url;
2999
- script.async = true;
3000
- script.crossOrigin = "anonymous";
3001
- if (nonce) script.setAttribute("nonce", nonce);
3002
- let settled = false;
3003
- const finish = (error) => {
3004
- if (settled) return;
3005
- settled = true;
3006
- clearTimeout(timer);
3007
- const loaded = w.magicfeedback;
3008
- if (hadGlobal) w.magicfeedback = previous;
3009
- else delete w.magicfeedback;
3010
- if (amdDefine) w.define = amdDefine;
3011
- script.remove();
3012
- if (error) reject(error);
3013
- else if (loaded === previous || !isUsable(loaded)) reject(new Error("survey SDK script did not expose magicfeedback"));
3014
- else resolve(loaded);
3015
- };
3016
- const timer = setTimeout(() => finish(new Error(`timeout after ${timeoutMs} ms`)), timeoutMs);
3017
- script.onload = () => finish();
3018
- script.onerror = () => finish(new Error("script failed to load"));
3019
- document.head.appendChild(script);
3020
- });
3021
- }
3022
- async function loadVersion(version, nonce, loadScript, loadCss) {
3023
- let css;
3024
- try {
3025
- css = await loadCss(version);
3026
- } catch (error) {
3027
- sdkWarn(`[Deepdots] survey CSS ${version} failed:`, error);
3028
- return null;
3029
- }
3030
- const sdk = await loadScriptChain(version, nonce, loadScript);
3031
- return sdk ? { sdk, css } : null;
3032
- }
3033
- async function loadScriptChain(version, nonce, loadScript) {
3034
- for (const url of surveySdkUrls(version)) {
3035
- const attempt = queue.then(() => loadScript(url, nonce));
3036
- queue = attempt.catch(() => void 0);
3037
- try {
3038
- const sdk = await attempt;
3039
- if (isUsable(sdk)) return sdk;
3040
- } catch (error) {
3041
- sdkWarn(`[Deepdots] survey SDK ${version} failed from ${url}:`, error);
3042
- }
3043
- }
3044
- return null;
3045
- }
3046
- function logSurveySdkChoice(choice, debug) {
3047
- const problem = choice.source === "bundled" && (choice.reason === "invalid" || choice.reason === "load_failed");
3048
- if (problem) sdkWarn(`[Deepdots] ${describeSurveySdkChoice(choice)}`);
3049
- else if (debug) sdkLog(`[Deepdots] ${describeSurveySdkChoice(choice)}`);
3050
- }
3051
- async function resolveSurveySdk(requested, options = {}, deps = {}) {
3052
- const { nonce, debug } = options;
3053
- const bundled = deps.bundled ?? import_native.default;
3054
- const choice = chooseSurveySdkVersion(requested);
3055
- if (choice.source === "bundled" || typeof document === "undefined") {
3056
- logSurveySdkChoice(choice, debug);
3057
- return { sdk: bundled, choice };
3058
- }
3059
- const loadScript = deps.loadScript ?? loadUmdScript;
3060
- const loadCss = deps.loadCss ?? loadVendoredCss;
3061
- let pending = cache.get(choice.version);
3062
- if (!pending) {
3063
- pending = loadVersion(choice.version, nonce, loadScript, loadCss);
3064
- cache.set(choice.version, pending);
3065
- }
3066
- const loaded = await pending;
3067
- if (loaded) {
3068
- logSurveySdkChoice(choice, debug);
3069
- return { sdk: loaded.sdk, css: loaded.css, choice };
3070
- }
3071
- cache.delete(choice.version);
3072
- const fallback = {
3073
- version: BUNDLED_SURVEY_SDK_VERSION,
3074
- source: "bundled",
3075
- reason: "load_failed",
3076
- requested: choice.version
3077
- };
3078
- logSurveySdkChoice(fallback, debug);
3079
- return { sdk: bundled, choice: fallback };
3080
- }
3081
-
3082
- // src/ui/renderPopup.ts
3083
- function ensureStyle(id, css, nonce) {
3084
- let el = document.getElementById(id);
3085
- if (el && nonce && el.getAttribute("nonce") !== nonce) {
3086
- el.remove();
3087
- el = null;
3088
- }
3089
- if (!el) {
3090
- el = document.createElement("style");
3091
- el.id = id;
3092
- if (nonce) el.setAttribute("nonce", nonce);
3093
- el.textContent = css;
3094
- document.head.appendChild(el);
3095
- } else if (el.textContent !== css) {
3096
- el.textContent = css;
3097
- }
3098
- return el;
3099
- }
3100
- function ensureMagicFeedbackStyles(nonce) {
3101
- ensureStyle("magicfeedback-sdk-styles", style_default, nonce);
3102
- }
3103
- var SURVEY_ALIGNMENT_STYLE_ID = "deepdots-survey-alignment";
3104
- function ensureSurveyAlignmentStyles(nonce) {
3105
- ensureStyle(SURVEY_ALIGNMENT_STYLE_ID, `
3106
- .deepdots-popup .magicfeedback-container,
3107
- .deepdots-popup .magicfeedback-form,
3108
- .deepdots-popup .magicfeedback-div { padding-left: 0; padding-right: 0; }
3109
- `, nonce);
3110
- }
3111
- function ensureSpinnerStyles(nonce) {
3112
- ensureStyle("deepdots-spinner-styles", `
3113
- /* El enunciado trae margin-top:20px del CSS de surveys, que sumaba al hueco de la barra
3114
- de progreso y descompensaba la simetr\xEDa. Solo se anula en el primero: entre preguntas
3115
- de la misma p\xE1gina sigue separando. */
3116
- .deepdots-popup .magicfeedback-questions .magicfeedback-div:first-child .magicfeedback-label { margin-top: 0; }
3117
- @keyframes ddspin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
3118
- .mf-spinner { display:flex; justify-content:center; align-items:center; padding:8px 0; }
3119
- .mf-spinner-circle { width:28px; height:28px; border:3px solid #e0e6ed; border-top-color:#1E293B; border-radius:50%; animation: ddspin 0.9s linear infinite; }
3120
- `, nonce);
3121
- }
3122
- function ensureResponsiveStyles(nonce) {
3123
- ensureStyle("deepdots-responsive-styles", `
3124
- /* Responsive adjustments */
3125
- @media (max-width: 640px) {
3126
- .deepdots-popup {
3127
- width: calc(100% - 24px) !important;
3128
- max-width: calc(100% - 24px) !important;
3129
- height: auto !important;
3130
- max-height: 90vh !important;
3131
- border-radius: 12px !important;
3132
- padding: calc(16px + env(safe-area-inset-top)) 16px calc(16px + env(safe-area-inset-bottom)) 16px !important;
3133
- box-sizing: border-box;
3134
- }
3135
- .deepdots-popup .mf-spinner-circle { width: 32px; height: 32px; border-width: 4px; }
3136
- .deepdots-popup button { font-size: 16px !important; }
3137
- .deepdots-popup-header button { width:48px; height:48px; }
3138
- .deepdots-popup-header button svg { width:26px; height:26px; }
3139
- /* Apilados en el orden del DOM: la acci\xF3n principal (Send/Start/Complete) arriba y
3140
- Back debajo. */
3141
- .deepdots-popup-footer { flex-direction: column !important; gap: 4px !important; }
3142
- .deepdots-popup-footer button { width: 100%; }
3143
- }
3144
- @media (max-width: 400px) {
3145
- .deepdots-popup { padding: calc(12px + env(safe-area-inset-top)) 12px calc(12px + env(safe-area-inset-bottom)) 12px !important; }
3146
- .deepdots-popup-header button { width:48px; height:48px; }
3147
- .deepdots-popup-header button svg { width:26px; height:26px; }
3148
- }
3149
- @media (orientation: landscape) and (max-height: 480px) {
3150
- .deepdots-popup {
3151
- height: 100vh !important;
3152
- max-height: 100vh !important;
3153
- overflow-y: auto !important;
3154
- }
3155
- }
3156
- `, nonce);
3157
- }
3158
- function ensureCustomCss(css, nonce) {
3159
- const STYLE_ID = "deepdots-custom-css";
3160
- if (!css) {
3161
- document.getElementById(STYLE_ID)?.remove();
3162
- return;
3163
- }
3164
- document.head.appendChild(ensureStyle(STYLE_ID, css, nonce));
3165
- }
3166
- function ensureFontFace(family, url, nonce) {
3167
- const css = buildFontFaceCss(family, url);
3168
- if (!css) return;
3169
- ensureStyle("deepdots-font-face", css, nonce);
3170
- }
3171
- function hasFinePointer() {
3172
- return typeof window !== "undefined" && typeof window.matchMedia === "function" && window.matchMedia("(pointer: fine)").matches;
3173
- }
3174
- async function renderPopup(container, surveyId, productId, actions, emit, onClose, env = "production", userId, style, sessionId, miniService, analyticsFeedbackSessionId, options) {
3175
- let surveyCompletedEmitted = false;
3176
- let stylesInjected = false;
3177
- let pageDepth = 0;
3178
- let onStartPage = false;
3179
- const cspNonce = options?.cspNonce?.trim() || void 0;
3180
- let labels = getLabels(options?.language);
3181
- let actionLabels = resolveActionLabels(actions, options?.language);
3182
- let direction = directionFor(options?.language);
3183
- const isDark = style?.theme === "dark";
3184
- const theme = {
3185
- popupBg: isDark ? "#1e1e1e" : "#fff",
3186
- // El popup fija su propio fondo, así que debe fijar también el esquema de color.
3187
- // Sin esto los controles de formulario (input/textarea/select) caen al estilo por
3188
- // defecto del navegador: en un host con `prefers-color-scheme: dark` se pintan
3189
- // oscuros con texto blanco sobre el fondo claro del popup.
3190
- colorScheme: isDark ? "dark" : "light",
3191
- textPrimary: isDark ? "#f0f0f0" : "#111",
3192
- closeBtnHoverColor: isDark ? "#fff" : "#000000",
3193
- textMuted: isDark ? "#9ca3af" : "#6b7280",
3194
- progressTrack: isDark ? "#3f3f46" : "#e5e7eb"
3195
- };
3196
- const positionMap = {
3197
- "center": { justifyContent: "center", alignItems: "center", background: "rgba(0,0,0,0.5)" },
3198
- "bottom": { justifyContent: "center", alignItems: "flex-end", padding: "16px", background: "transparent" },
3199
- "bottom-right": { justifyContent: "flex-end", alignItems: "flex-end", padding: "16px", background: "transparent" },
3200
- "bottom-left": { justifyContent: "flex-start", alignItems: "flex-end", padding: "16px", background: "transparent" },
3201
- "top": { justifyContent: "center", alignItems: "flex-start", padding: "16px", background: "transparent" },
3202
- "top-right": { justifyContent: "flex-end", alignItems: "flex-start", padding: "16px", background: "transparent" },
3203
- "top-left": { justifyContent: "flex-start", alignItems: "flex-start", padding: "16px", background: "transparent" }
3204
- };
3205
- const pos = positionMap[style?.position ?? "center"] ?? positionMap["center"];
3206
- const passThrough = pos.background === "transparent";
3207
- const popup = document.createElement("div");
3208
- popup.id = "dd-popup";
3209
- popup.className = "deepdots-popup";
3210
- popup.setAttribute("dir", direction);
3211
- popup.style.cssText = `
3212
- position: relative;
3213
- pointer-events: auto;
3214
- display: flex;
3215
- flex-direction: column;
3216
- justify-content: flex-start;
3217
- background: ${theme.popupBg};
3218
- color-scheme: ${theme.colorScheme};
3219
- border-radius: 8px;
3220
- padding: 24px;
3221
- box-shadow: 0 4px 6px rgba(0,0,0,0.1);
3222
- max-width: 600px;
3223
- width: 90%;
3224
- max-height: 90vh;
3225
- min-height: 200px;
3226
- `;
3227
- const font = style?.font;
3228
- if (font?.family) {
3229
- const familyValue = buildFontFamilyValue(font.family);
3230
- popup.style.fontFamily = familyValue;
3231
- popup.style.setProperty("--deepdots-font", familyValue);
3232
- popup.classList.add("deepdots-has-font");
3233
- if (font.url) ensureFontFace(font.family, font.url, cspNonce);
3234
- }
3235
- const header = document.createElement("div");
3236
- header.className = "deepdots-popup-header";
3237
- header.style.cssText = "display:flex; justify-content:space-between; align-items:center; gap:12px; width:100%; flex:0 0 auto;";
3238
- const titleEl = document.createElement("h2");
3239
- titleEl.id = "dd-title";
3240
- titleEl.className = "deepdots-popup-title";
3241
- titleEl.style.cssText = `margin:0; font-size:17px; font-weight:600; line-height:1.3; color:${theme.textPrimary}; text-transform:none; text-align:start; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;`;
3242
- titleEl.hidden = true;
3243
- const setTitle = (value) => {
3244
- if (!value) return;
3245
- titleEl.textContent = value;
3246
- titleEl.hidden = false;
3247
- };
3248
- setTitle(options?.title);
3249
- header.appendChild(titleEl);
3250
- const closeBtn = document.createElement("button");
3251
- closeBtn.id = "dd-close";
3252
- closeBtn.type = "button";
3253
- closeBtn.setAttribute("aria-label", labels.closeAria);
3254
- closeBtn.innerHTML = `
3255
- <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
3256
- <path d="M5 5L19 19M5 19L19 5" stroke="currentColor" stroke-width="1.5" stroke-linecap="butt"/>
3257
- </svg>
3258
- `;
3259
- closeBtn.style.cssText = `
3260
- background:transparent;
3261
- border:none;
3262
- width:32px;
3263
- height:32px;
3264
- display:flex;
3265
- align-items:center;
3266
- justify-content:center;
3267
- border-radius: 8px;
3268
- cursor:pointer;
3269
- color:${theme.textPrimary};
3270
- padding:4px;
3271
- transition: color .15s ease, transform .15s ease;
3272
- box-shadow: none !important;
3273
- `;
3274
- closeBtn.onmouseenter = () => {
3275
- closeBtn.style.color = theme.closeBtnHoverColor;
3276
- closeBtn.style.transform = "scale(1.06)";
3277
- };
3278
- closeBtn.onmouseleave = () => {
3279
- closeBtn.style.color = theme.textPrimary;
3280
- closeBtn.style.transform = "scale(1)";
3281
- };
3282
- const closeFromChrome = () => {
3283
- emit("popup_clicked", surveyId, { action: "close_icon" });
3284
- onClose();
3285
- };
3286
- closeBtn.onclick = closeFromChrome;
3287
- closeBtn.style.flex = "0 0 auto";
3288
- closeBtn.style.marginLeft = "auto";
3289
- header.appendChild(closeBtn);
3290
- let progressEnabled = options?.showProgressBar === true;
3291
- let progressShowUnit = true;
3292
- let progressUnit = "fraction";
3293
- const progressEl = document.createElement("div");
3294
- progressEl.id = "dd-progress";
3295
- progressEl.className = "deepdots-progress";
3296
- progressEl.style.cssText = "display:none; flex-direction:column; gap:8px; width:100%; flex:0 0 auto; padding:16px 0; box-sizing:border-box;";
3297
- const progressHead = document.createElement("div");
3298
- progressHead.className = "deepdots-progress-head";
3299
- progressHead.style.cssText = "display:flex; flex-direction:row; justify-content:space-between; align-items:center; width:100%; gap:8px;";
3300
- const progressLabel = document.createElement("span");
3301
- progressLabel.id = "dd-progress-label";
3302
- progressLabel.style.cssText = "font-size:13px; line-height:1.2;";
3303
- const progressCurrent = document.createElement("span");
3304
- progressCurrent.id = "dd-progress-current";
3305
- progressCurrent.style.cssText = `font-weight:700; color:${theme.textPrimary};`;
3306
- const progressTotal = document.createElement("span");
3307
- progressTotal.id = "dd-progress-total";
3308
- progressTotal.style.cssText = `font-weight:400; color:${theme.textMuted};`;
3309
- progressLabel.appendChild(progressCurrent);
3310
- progressLabel.appendChild(progressTotal);
3311
- const progressFollowUp = document.createElement("span");
3312
- progressFollowUp.id = "dd-progress-followup";
3313
- progressFollowUp.textContent = labels.followUp;
3314
- progressFollowUp.style.cssText = "display:none; font-size:12px; font-weight:600; color:#fff; background:rgba(59,130,246,0.44); border-radius:999px; padding:2px 10px;";
3315
- progressHead.appendChild(progressLabel);
3316
- progressHead.appendChild(progressFollowUp);
3317
- const progressTrack = document.createElement("div");
3318
- progressTrack.className = "deepdots-progress-track";
3319
- progressTrack.style.cssText = `width:100%; height:4px; border-radius:999px; background:${theme.progressTrack}; overflow:hidden;`;
3320
- const progressBar = document.createElement("div");
3321
- progressBar.id = "dd-progress-bar";
3322
- progressBar.style.cssText = "height:100%; width:0%; background:#22C55E; border-radius:999px; transition:width 450ms ease;";
3323
- progressTrack.appendChild(progressBar);
3324
- progressEl.appendChild(progressHead);
3325
- progressEl.appendChild(progressTrack);
3326
- function updateProgress(p) {
3327
- const total = typeof p.total === "number" ? p.total : 0;
3328
- const progress = typeof p.progress === "number" ? p.progress : 0;
3329
- if (!progressEnabled || onStartPage || p.completed || total <= 1) {
3330
- progressEl.style.display = "none";
3331
- containerContent.style.paddingTop = "16px";
3332
- return;
3333
- }
3334
- progressEl.style.display = "flex";
3335
- containerContent.style.paddingTop = "0";
3336
- const current = Math.min(total, Math.max(1, progress + 1));
3337
- const pct = Math.min(100, Math.max(0, current / total * 100));
3338
- progressBar.style.width = `${pct}%`;
3339
- const label = Math.min(total, Math.max(1, Math.floor(progress) + 1));
3340
- progressLabel.style.display = progressShowUnit ? "block" : "none";
3341
- if (progressUnit === "percentage") {
3342
- progressCurrent.textContent = `${Math.round(pct)}%`;
3343
- progressTotal.textContent = "";
3344
- } else {
3345
- progressCurrent.textContent = `${labels.question} ${label}`;
3346
- progressTotal.textContent = ` ${labels.of} ${total}`;
3347
- }
3348
- progressFollowUp.style.display = p.followup ? "inline-block" : "none";
3349
- }
3350
- ensureMagicFeedbackStyles(cspNonce);
3351
- ensureSurveyAlignmentStyles(cspNonce);
3352
- ensureSpinnerStyles(cspNonce);
3353
- ensureResponsiveStyles(cspNonce);
3354
- ensureCustomCss(options?.surveyCss, cspNonce);
3355
- const containerContent = document.createElement("div");
3356
- containerContent.id = "dd-content";
3357
- containerContent.className = "deepdots-popup-container-content";
3358
- containerContent.style.cssText = "display:flex; flex-direction:column; flex:1 1 auto; min-height:0; padding:16px 0 0 0; overflow:hidden;";
3359
- const main = document.createElement("div");
3360
- main.id = "dd-main";
3361
- main.className = "deepdots-popup-main";
3362
- main.style.cssText = "display:flex; flex-direction:column; width:100%; flex:1 1 auto; min-height:0; overflow-y:auto;";
3363
- const formWrapper = document.createElement("div");
3364
- formWrapper.id = "dd-form-wrapper";
3365
- formWrapper.style.cssText = "width:100%; flex: 1 1 auto;";
3366
- const errorHint = document.createElement("div");
3367
- errorHint.id = "dd-error";
3368
- errorHint.className = "deepdots-error-hint";
3369
- errorHint.style.cssText = `
3370
- display: none;
3371
- margin: 12px 0 0 0;
3372
- padding: 10px 12px;
3373
- border-radius: 6px;
3374
- background: #FEF3C7; /* amber-100 */
3375
- color: #92400E; /* amber-700 */
3376
- border: 1px solid #FCD34D; /* amber-300 */
3377
- font-size: 13px;
3378
- `;
3379
- errorHint.setAttribute("role", "alert");
3380
- errorHint.setAttribute("aria-live", "polite");
3381
- const spinnerEl = document.createElement("div");
3382
- spinnerEl.className = "mf-spinner";
3383
- spinnerEl.setAttribute("role", "status");
3384
- spinnerEl.setAttribute("aria-label", labels.loadingAria);
3385
- spinnerEl.innerHTML = '<div class="mf-spinner-circle"></div>';
3386
- spinnerEl.style.cssText = "position:absolute; top:50%; left:50%; transform:translate(-50%,-50%);";
3387
- const formDivId = `magicfeedback-form-${surveyId}`;
3388
- const formHost = document.createElement("div");
3389
- formHost.id = formDivId;
3390
- formHost.style.cssText = "width:100%; visibility:hidden;";
3391
- formWrapper.appendChild(spinnerEl);
3392
- formWrapper.appendChild(formHost);
3393
- main.appendChild(formWrapper);
3394
- const loadErrorEl = document.createElement("div");
3395
- loadErrorEl.id = "dd-load-error";
3396
- loadErrorEl.className = "deepdots-load-error";
3397
- loadErrorEl.setAttribute("role", "alert");
3398
- loadErrorEl.style.cssText = `display:none; width:100%; text-align:center; padding:24px 0; font-size:15px; color:${theme.textPrimary};`;
3399
- main.appendChild(loadErrorEl);
3400
- main.appendChild(errorHint);
3401
- const footer = document.createElement("div");
3402
- footer.id = "dd-footer";
3403
- footer.className = "deepdots-popup-footer";
3404
- footer.setAttribute("data-actions-wrapper", "true");
3405
- footer.style.cssText = "display:flex; flex-direction: row-reverse ;justify-content:space-between; align-items:center; gap:4px; margin-top:auto; width:100%; padding-top:12px;";
3406
- const backButton = document.createElement("button");
3407
- backButton.id = "dd-back";
3408
- backButton.className = "dd-nav-btn";
3409
- backButton.textContent = actionLabels.back;
3410
- backButton.style.cssText = `
3411
- background: transparent;
3412
- color: ${theme.textMuted};
3413
- border: none;
3414
- min-height: 44px;
3415
- padding: 12px 24px;
3416
- border-radius: 999px; /* p\xEDldora, como el Button de Material3 en KMP */
3417
- cursor: pointer;
3418
- font-size: 15px;
3419
- font-weight: 600;
3420
- transition: filter .15s ease;
3421
- display: inline-flex;
3422
- align-items: center;
3423
- justify-content: center;
3424
- text-align: center;
3425
- `;
3426
- backButton.onmouseenter = () => {
3427
- backButton.style.filter = "brightness(0.9)";
3428
- };
3429
- backButton.onmouseleave = () => {
3430
- backButton.style.filter = "brightness(1)";
3431
- };
3432
- backButton.onclick = () => {
3433
- emit("popup_clicked", surveyId, { action: "back" });
3434
- formInstance?.back?.();
3435
- };
3436
- const startButton = document.createElement("button");
3437
- startButton.id = "dd-start";
3438
- startButton.className = "dd-nav-btn";
3439
- startButton.textContent = actionLabels.start;
3440
- startButton.style.cssText = `
3441
- background: #1E293B;
3442
- color: #fff;
3443
- border: none;
3444
- min-height: 44px;
3445
- padding: 12px 24px;
3446
- border-radius: 999px; /* p\xEDldora, como el Button de Material3 en KMP */
3447
- cursor: pointer;
3448
- font-size: 15px;
3449
- font-weight: 600;
3450
- box-shadow: 0 2px 4px rgba(0,0,0,0.1);
3451
- transition: filter .15s ease;
3452
- display: inline-flex;
3453
- align-items: center;
3454
- justify-content: center;
3455
- text-align: center;
3456
- `;
3457
- startButton.onclick = () => {
3458
- emit("popup_clicked", surveyId, { action: "start_survey" });
3459
- formInstance?.startForm?.();
3460
- onStartPage = false;
3461
- updateProgress({ progress: formInstance?.progress, total: formInstance?.total });
3462
- };
3463
- const closeButton = document.createElement("button");
3464
- closeButton.id = "dd-complete";
3465
- closeButton.className = "dd-nav-btn";
3466
- closeButton.textContent = actionLabels.complete;
3467
- closeButton.style.cssText = `
3468
- background: #1E293B;
3469
- color: #fff;
3470
- border: none;
3471
- min-height: 44px;
3472
- padding: 12px 24px;
3473
- border-radius: 999px; /* p\xEDldora, como el Button de Material3 en KMP */
3474
- cursor: pointer;
3475
- font-size: 15px;
3476
- font-weight: 600;
3477
- box-shadow: 0 2px 4px rgba(0,0,0,0.1);
3478
- transition: filter .15s ease;
3479
- display: inline-flex;
3480
- align-items: center;
3481
- justify-content: center;
3482
- text-align: center;
3483
- `;
3484
- closeButton.onmouseenter = () => {
3485
- closeButton.style.filter = "brightness(0.9)";
3486
- };
3487
- closeButton.onmouseleave = () => {
3488
- closeButton.style.filter = "brightness(1)";
3489
- };
3490
- closeButton.onclick = () => {
3491
- emit("popup_clicked", surveyId, { action: "complete" });
3492
- onClose();
3493
- };
3494
- const submitButton = document.createElement("button");
3495
- submitButton.id = "dd-submit";
3496
- submitButton.className = "dd-nav-btn";
3497
- submitButton.textContent = actionLabels.accept;
3498
- submitButton.style.cssText = `
3499
- background: #1E293B;
3500
- color: #fff;
3501
- border: none;
3502
- min-height: 44px;
3503
- padding: 12px 24px;
3504
- border-radius: 999px; /* p\xEDldora, como el Button de Material3 en KMP */
3505
- cursor: pointer;
3506
- font-size: 15px;
3507
- font-weight: 600;
3508
- box-shadow: 0 2px 4px rgba(0,0,0,0.1);
3509
- transition: filter .15s ease;
3510
- display: inline-flex;
3511
- align-items: center;
3512
- justify-content: center;
3513
- text-align: center;
3514
- `;
3515
- const cancelButton = document.createElement("button");
3516
- cancelButton.id = "dd-cancel";
3517
- cancelButton.type = "button";
3518
- cancelButton.className = "dd-nav-btn";
3519
- cancelButton.textContent = actionLabels.decline;
3520
- cancelButton.style.cssText = submitButton.style.cssText;
3521
- cancelButton.onclick = closeFromChrome;
3522
- submitButton.onclick = () => {
3523
- if (!surveyCompletedEmitted) {
3524
- emit("popup_clicked", surveyId, { action: "manual_send" });
3525
- formInstance?.send?.();
3526
- }
3527
- };
3528
- function applyLabels(lang) {
3529
- labels = getLabels(lang);
3530
- actionLabels = resolveActionLabels(actions, lang);
3531
- backButton.textContent = actionLabels.back;
3532
- startButton.textContent = actionLabels.start;
3533
- closeButton.textContent = actionLabels.complete;
3534
- submitButton.textContent = actionLabels.accept;
3535
- cancelButton.textContent = actionLabels.decline;
3536
- loadErrorEl.textContent = labels.errorLoad;
3537
- closeBtn.setAttribute("aria-label", labels.closeAria);
3538
- spinnerEl.setAttribute("aria-label", labels.loadingAria);
3539
- progressFollowUp.textContent = labels.followUp;
3540
- direction = directionFor(lang);
3541
- popup.setAttribute("dir", direction);
3542
- }
3543
- backButton.style.display = "none";
3544
- startButton.style.display = "none";
3545
- submitButton.style.display = "none";
3546
- closeButton.style.display = "none";
3547
- cancelButton.style.display = "none";
3548
- footer.appendChild(submitButton);
3549
- footer.appendChild(backButton);
3550
- footer.appendChild(closeButton);
3551
- footer.appendChild(startButton);
3552
- footer.appendChild(cancelButton);
3553
- containerContent.appendChild(main);
3554
- footer.style.flex = "0 0 auto";
3555
- containerContent.appendChild(footer);
3556
- function updateButtons(state) {
3557
- backButton.style.display = "none";
3558
- startButton.style.display = "none";
3559
- submitButton.style.display = "none";
3560
- closeButton.style.display = "none";
3561
- cancelButton.style.display = "none";
3562
- backButton.style.width = "";
3563
- startButton.style.width = "";
3564
- submitButton.style.width = "";
3565
- closeButton.style.width = "";
3566
- switch (state) {
3567
- case "loading":
3568
- break;
3569
- case "start":
3570
- startButton.style.display = "inline-flex";
3571
- startButton.style.width = "100%";
3572
- break;
3573
- case "in_progress_first":
3574
- submitButton.style.display = "inline-flex";
3575
- submitButton.style.width = "";
3576
- setLoading(false);
3577
- break;
3578
- case "in_progress_next":
3579
- backButton.style.display = "inline-flex";
3580
- submitButton.style.display = "inline-flex";
3581
- setLoading(false);
3582
- break;
3583
- case "completed":
3584
- closeButton.style.display = "inline-flex";
3585
- closeButton.style.width = "100%";
3586
- setLoading(false);
3587
- break;
3588
- case "error":
3589
- setLoading(false);
3590
- break;
3591
- case "load_error":
3592
- cancelButton.style.display = "inline-flex";
3593
- break;
3594
- }
3595
- }
3596
- function updateNavButtons() {
3597
- updateButtons(pageDepth > 0 ? "in_progress_next" : "in_progress_first");
3598
- }
3599
- let successMessageHtml = "";
3600
- function showSuccessScreen() {
3601
- progressEl.style.display = "none";
3602
- formWrapper.style.display = "none";
3603
- let done = main.querySelector(".deepdots-success");
3604
- if (!done) {
3605
- done = document.createElement("div");
3606
- done.className = "deepdots-success";
3607
- done.style.cssText = `width:100%; text-align:center; padding:24px 0; color:${theme.textPrimary};`;
3608
- main.insertBefore(done, errorHint);
3609
- }
3610
- done.innerHTML = successMessageHtml || "<p>Thank you for your feedback!</p>";
3611
- done.querySelectorAll("img").forEach((img) => {
3612
- img.style.cssText = "max-width:100%; height:auto; margin:0 auto 16px auto; display:block;";
3613
- });
3614
- }
3615
- let loadFailed = false;
3616
- function showLoadError(reason) {
3617
- sdkWarn("[Deepdots] survey failed to load:", reason);
3618
- if (loadFailed) return;
3619
- loadFailed = true;
3620
- progressEl.style.display = "none";
3621
- formWrapper.style.display = "none";
3622
- errorHint.style.display = "none";
3623
- loadErrorEl.textContent = labels.errorLoad;
3624
- loadErrorEl.style.display = "block";
3625
- setLoading(false);
3626
- updateButtons("load_error");
3627
- reveal();
3628
- }
3629
- popup.appendChild(header);
3630
- popup.appendChild(progressEl);
3631
- popup.appendChild(containerContent);
3632
- container.innerHTML = "";
3633
- container.appendChild(popup);
3634
- container.style.display = "flex";
3635
- container.style.visibility = "hidden";
3636
- container.style.pointerEvents = "none";
3637
- container.style.justifyContent = pos.justifyContent;
3638
- container.style.alignItems = pos.alignItems;
3639
- container.style.background = pos.background;
3640
- if (pos.padding) container.style.padding = pos.padding;
3641
- let revealed = false;
3642
- let revealTimer = null;
3643
- let surveyLoaded = false;
3644
- let openFocusDone = false;
3645
- function autofocusOnOpen() {
3646
- if (openFocusDone || !revealed || !surveyLoaded) return;
3647
- openFocusDone = true;
3648
- if (hasFinePointer()) formInstance?.focusFirstQuestion?.();
3649
- }
3650
- function reveal() {
3651
- if (revealed) return;
3652
- revealed = true;
3653
- if (revealTimer !== null) {
3654
- clearTimeout(revealTimer);
3655
- revealTimer = null;
3656
- }
3657
- if (!container.contains(popup)) return;
3658
- container.style.visibility = "visible";
3659
- container.style.pointerEvents = passThrough ? "none" : "";
3660
- autofocusOnOpen();
3661
- }
3662
- function revealWhenPainted2() {
3663
- if (revealed) return;
3664
- revealWhenPainted(popup, reveal);
3665
- }
3666
- revealTimer = setTimeout(reveal, REVEAL_TIMEOUT_MS);
3667
- function setLoading(isLoading) {
3668
- spinnerEl.style.display = isLoading ? "flex" : "none";
3669
- setSurveyBusy(formWrapper, isLoading);
3670
- if (!isLoading) {
3671
- formHost.style.visibility = "visible";
3672
- revealWhenPainted2();
3673
- }
3674
- footer.style.display = isLoading ? "none" : "flex";
3675
- backButton.disabled = isLoading;
3676
- startButton.disabled = isLoading;
3677
- closeButton.disabled = isLoading;
3678
- submitButton.disabled = isLoading;
3679
- submitButton.style.opacity = isLoading ? "0.6" : "1";
3680
- submitButton.style.cursor = isLoading ? "not-allowed" : "pointer";
3681
- if (isLoading) {
3682
- updateButtons("loading");
3683
- }
3684
- }
3685
- setLoading(true);
3686
- if (typeof window === "undefined" || typeof document === "undefined") {
3687
- return;
3688
- }
3689
- let formInstance = null;
3690
- const { sdk: magicfeedback, choice: surveySdk, css: surveySdkCss } = await resolveSurveySdk(
3691
- options?.surveySdkVersion,
3692
- { nonce: cspNonce, debug: options?.debug }
3693
- );
3694
- popup.dataset.surveySdk = `${surveySdk.version} ${surveySdk.source}`;
3695
- if (!container.contains(popup)) return;
3696
- if (surveySdkCss) ensureStyle("magicfeedback-sdk-styles", surveySdkCss, cspNonce);
3697
- else ensureMagicFeedbackStyles(cspNonce);
3698
- try {
3699
- if (!magicfeedback || typeof magicfeedback.form !== "function") {
3700
- sdkWarn("[MagicFeedback] form() no disponible. Fallback manual.");
3701
- showLoadError("form() not available");
3702
- return;
3703
- }
3704
- magicfeedback.init(
3705
- {
3706
- debug: true,
3707
- env: env === "production" ? "prod" : "dev"
3708
- }
3709
- );
3710
- const { profile, metadata } = buildSurveyIdentity(userId ?? null, sessionId ?? null, miniService ?? null, analyticsFeedbackSessionId ?? null);
3711
- formInstance = magicfeedback.form(surveyId, productId, profile, metadata);
3712
- const generateOptions = {
3713
- addButton: false,
3714
- getMetaData: true,
3715
- // La pantalla final la pinta el popup: `renderSuccess` de @magicfeedback/native usa
3716
- // textContent, así que el mensaje de la plataforma (HTML con imagen) no se vería, y
3717
- // su fallback es un literal genérico que ignora `style.successMessage`.
3718
- addSuccessScreen: false,
3719
- // Surveys multi-idioma: native pide a la API este idioma (el del init o el del
3720
- // dispositivo) y, si el survey no lo tiene, la API sirve el idioma por defecto.
3721
- lang: options?.language,
3722
- // Foco en la primera pregunta de escribir tras Start, Siguiente o Atrás. Native lo
3723
- // aplica después de afterSubmitEvent/onBackEvent, cuando `setLoading(false)` ya ha
3724
- // quitado el `inert`. La apertura va aparte (ver autofocusOnOpen).
3725
- autofocus: "navigation"
3726
- };
3727
- generateOptions.onLoadedEvent = ({ formData, lang, error }) => {
3728
- if (error) {
3729
- showLoadError(error);
3730
- return;
3731
- }
3732
- const shownLang = typeof lang === "string" && lang.trim().length > 0 ? lang : void 0;
3733
- const surveyLang = shownLang ?? (Array.isArray(formData?.lang) ? formData.lang.find((l) => typeof l === "string" && l.trim().length > 0) : void 0);
3734
- if (surveyLang) applyLabels(surveyLang);
3735
- try {
3736
- } catch {
3737
- }
3738
- const s = formData?.style;
3739
- if (s && !stylesInjected) {
3740
- stylesInjected = true;
3741
- if (s.successMessage) successMessageHtml = s.successMessage;
3742
- if (options?.showProgressBar === void 0) progressEnabled = s.showProgressBar === true;
3743
- if (s.showProgressUnit !== void 0) progressShowUnit = s.showProgressUnit !== false;
3744
- if (s.progressUnit) progressUnit = s.progressUnit;
3745
- if (s.loadingBarColor) {
3746
- progressBar.style.background = s.loadingBarColor;
3747
- progressFollowUp.style.background = s.loadingBarColor;
3748
- }
3749
- if (s.boxBackgroundColor) {
3750
- popup.style.background = s.boxBackgroundColor;
3751
- }
3752
- if (s.contentAlign) {
3753
- main.style.justifyContent = s.contentAlign === "center" ? "center" : "flex-start";
3754
- }
3755
- applySurveyPrimaryColor(popup, s);
3756
- if (s.buttonPrimaryColor) {
3757
- submitButton.style.background = s.buttonPrimaryColor;
3758
- submitButton.style.border = "none";
3759
- submitButton.style.color = "#fff";
3760
- startButton.style.background = s.buttonPrimaryColor;
3761
- startButton.style.border = "none";
3762
- startButton.style.color = "#fff";
3763
- closeButton.style.background = s.buttonPrimaryColor;
3764
- closeButton.style.border = "none";
3765
- closeButton.style.color = "#fff";
3766
- }
3767
- if (s.buttonSecondaryColor) {
3768
- backButton.style.background = "transparent";
3769
- backButton.style.color = s.buttonSecondaryColor;
3770
- backButton.style.border = "none";
3771
- }
3772
- insertPopupLogo(popup, progressEl, s, "deepdots-popup-logo");
3773
- if (s.startMessage && s.startMessage !== "") {
3774
- sdkLog(s.startMessage);
3775
- onStartPage = true;
3776
- updateButtons("start");
3777
- } else {
3778
- updateButtons("in_progress_first");
3779
- }
3780
- } else {
3781
- updateButtons("in_progress_first");
3782
- }
3783
- updateProgress({ progress: formInstance.progress, total: formInstance.total });
3784
- setLoading(false);
3785
- if (!surveyLoaded) {
3786
- surveyLoaded = true;
3787
- autofocusOnOpen();
3788
- }
3789
- };
3790
- let lastReportedError = null;
3791
- generateOptions.beforeSubmitEvent = () => {
3792
- setLoading(true);
3793
- };
3794
- generateOptions.afterSubmitEvent = ({ error, completed, total, progress, followup }) => {
3795
- if (error) {
3796
- setLoading(false);
3797
- const { reason, message } = classifySubmitError(error);
3798
- if (reason === "required" || reason === "invalid_email") {
3799
- errorHint.textContent = reason === "invalid_email" ? labels.errorInvalidEmail : labels.errorRequired;
3800
- errorHint.style.display = "block";
3801
- updateNavButtons();
3802
- return;
3803
- }
3804
- errorHint.textContent = labels.errorSubmit;
3805
- errorHint.style.display = "block";
3806
- sdkWarn("[Deepdots] survey submit error:", reason, message);
3807
- if (error !== lastReportedError) {
3808
- lastReportedError = error;
3809
- emit("survey_error", surveyId, { reason, message });
3810
- }
3811
- return;
3812
- }
3813
- errorHint.style.display = "none";
3814
- setLoading(false);
3815
- if (completed) {
3816
- emit("survey_completed", surveyId, { action: "completed" });
3817
- surveyCompletedEmitted = true;
3818
- showSuccessScreen();
3819
- updateButtons("completed");
3820
- updateProgress({ progress, total, completed: true });
3821
- return;
3822
- }
3823
- emit("popup_clicked", surveyId, { action: "partial" });
3824
- pageDepth++;
3825
- updateNavButtons();
3826
- updateProgress({ progress, total, followup });
3827
- };
3828
- generateOptions.onBackEvent = ({ progress, error, followup }) => {
3829
- if (!error) pageDepth = Math.max(0, pageDepth - 1);
3830
- updateNavButtons();
3831
- updateProgress({ progress, total: formInstance.total, followup });
3832
- };
3833
- formInstance.generate(formDivId, generateOptions).catch((err) => {
3834
- sdkError("[MagicFeedback] Error generating form:", err);
3835
- showLoadError(err);
3836
- });
3837
- } catch (e) {
3838
- sdkError("[MagicFeedback] Exception initializing form:", e);
3839
- showLoadError(e);
3840
- }
3841
- }
3842
- export {
3843
- REVEAL_TIMEOUT_MS,
3844
- SURVEY_ALIGNMENT_STYLE_ID,
3845
- renderPopup
3846
- };
3847
- //# sourceMappingURL=renderPopup-QVMBE4L4.mjs.map