File manager - Edit - /home/wwwroot/camplus.hk/master.camplus.hk/public_html/assets/custom/survey-creator/new/survey.core.min.js
Back
/*! * surveyjs - Survey JavaScript library v1.9.75 * Copyright (c) 2015-2023 Devsoft Baltic OÜ - http://surveyjs.io/ * License: MIT (http://www.opensource.org/licenses/mit-license.php) */ !function (e, t) { "object" == typeof exports && "object" == typeof module ? module.exports = t() : "function" == typeof define && define.amd ? define("survey-core", [], t) : "object" == typeof exports ? exports["survey-core"] = t() : e.Survey = t() }(this, (function () { return function (e) { var t = {}; function n(o) { if (t[o]) return t[o].exports; var r = t[o] = { i: o, l: !1, exports: {} }; return e[o].call(r.exports, r, r.exports, n), r.l = !0, r.exports } return n.m = e, n.c = t, n.d = function (e, t, o) { n.o(e, t) || Object.defineProperty(e, t, { enumerable: !0, get: o }) }, n.r = function (e) { "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(e, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(e, "__esModule", { value: !0 }) }, n.t = function (e, t) { if (1 & t && (e = n(e)), 8 & t) return e; if (4 & t && "object" == typeof e && e && e.__esModule) return e; var o = Object.create(null); if (n.r(o), Object.defineProperty(o, "default", { enumerable: !0, value: e }), 2 & t && "string" != typeof e) for (var r in e) n.d(o, r, function (t) { return e[t] }.bind(null, r)); return o }, n.n = function (e) { var t = e && e.__esModule ? function () { return e.default } : function () { return e }; return n.d(t, "a", t), t }, n.o = function (e, t) { return Object.prototype.hasOwnProperty.call(e, t) }, n.p = "", n(n.s = 40) }([function (e, t) { var n; n = function () { return this }(); try { n = n || new Function("return this")() } catch (e) { "object" == typeof window && (n = window) } e.exports = n }, function (e, t, n) { (function (e) { var o = void 0 !== e && e || "undefined" != typeof self && self || window, r = Function.prototype.apply; function i(e, t) { this._id = e, this._clearFn = t } t.setTimeout = function () { return new i(r.call(setTimeout, o, arguments), clearTimeout) }, t.setInterval = function () { return new i(r.call(setInterval, o, arguments), clearInterval) }, t.clearTimeout = t.clearInterval = function (e) { e && e.close() }, i.prototype.unref = i.prototype.ref = function () { }, i.prototype.close = function () { this._clearFn.call(o, this._id) }, t.enroll = function (e, t) { clearTimeout(e._idleTimeoutId), e._idleTimeout = t }, t.unenroll = function (e) { clearTimeout(e._idleTimeoutId), e._idleTimeout = -1 }, t._unrefActive = t.active = function (e) { clearTimeout(e._idleTimeoutId); var t = e._idleTimeout; t >= 0 && (e._idleTimeoutId = setTimeout((function () { e._onTimeout && e._onTimeout() }), t)) }, n(2), t.setImmediate = "undefined" != typeof self && self.setImmediate || void 0 !== e && e.setImmediate || this && this.setImmediate, t.clearImmediate = "undefined" != typeof self && self.clearImmediate || void 0 !== e && e.clearImmediate || this && this.clearImmediate }).call(this, n(0)) }, function (e, t, n) { (function (e, t) { !function (e, n) { "use strict"; if (!e.setImmediate) { var o, r, i, s, a, l = 1, u = {}, c = !1, p = e.document, h = Object.getPrototypeOf && Object.getPrototypeOf(e); h = h && h.setTimeout ? h : e, "[object process]" === {}.toString.call(e.process) ? o = function (e) { t.nextTick((function () { f(e) })) } : !function () { if (e.postMessage && !e.importScripts) { var t = !0, n = e.onmessage; return e.onmessage = function () { t = !1 }, e.postMessage("", "*"), e.onmessage = n, t } }() ? e.MessageChannel ? ((i = new MessageChannel).port1.onmessage = function (e) { f(e.data) }, o = function (e) { i.port2.postMessage(e) }) : p && "onreadystatechange" in p.createElement("script") ? (r = p.documentElement, o = function (e) { var t = p.createElement("script"); t.onreadystatechange = function () { f(e), t.onreadystatechange = null, r.removeChild(t), t = null }, r.appendChild(t) }) : o = function (e) { setTimeout(f, 0, e) } : (s = "setImmediate$" + Math.random() + "$", a = function (t) { t.source === e && "string" == typeof t.data && 0 === t.data.indexOf(s) && f(+t.data.slice(s.length)) }, e.addEventListener ? e.addEventListener("message", a, !1) : e.attachEvent("onmessage", a), o = function (t) { e.postMessage(s + t, "*") }), h.setImmediate = function (e) { "function" != typeof e && (e = new Function("" + e)); for (var t = new Array(arguments.length - 1), n = 0; n < t.length; n++)t[n] = arguments[n + 1]; var r = { callback: e, args: t }; return u[l] = r, o(l), l++ }, h.clearImmediate = d } function d(e) { delete u[e] } function f(e) { if (c) setTimeout(f, 0, e); else { var t = u[e]; if (t) { c = !0; try { !function (e) { var t = e.callback, n = e.args; switch (n.length) { case 0: t(); break; case 1: t(n[0]); break; case 2: t(n[0], n[1]); break; case 3: t(n[0], n[1], n[2]); break; default: t.apply(void 0, n) } }(t) } finally { d(e), c = !1 } } } } }("undefined" == typeof self ? void 0 === e ? this : e : self) }).call(this, n(0), n(3)) }, function (e, t) { var n, o, r = e.exports = {}; function i() { throw new Error("setTimeout has not been defined") } function s() { throw new Error("clearTimeout has not been defined") } function a(e) { if (n === setTimeout) return setTimeout(e, 0); if ((n === i || !n) && setTimeout) return n = setTimeout, setTimeout(e, 0); try { return n(e, 0) } catch (t) { try { return n.call(null, e, 0) } catch (t) { return n.call(this, e, 0) } } } !function () { try { n = "function" == typeof setTimeout ? setTimeout : i } catch (e) { n = i } try { o = "function" == typeof clearTimeout ? clearTimeout : s } catch (e) { o = s } }(); var l, u = [], c = !1, p = -1; function h() { c && l && (c = !1, l.length ? u = l.concat(u) : p = -1, u.length && d()) } function d() { if (!c) { var e = a(h); c = !0; for (var t = u.length; t;) { for (l = u, u = []; ++p < t;)l && l[p].run(); p = -1, t = u.length } l = null, c = !1, function (e) { if (o === clearTimeout) return clearTimeout(e); if ((o === s || !o) && clearTimeout) return o = clearTimeout, clearTimeout(e); try { o(e) } catch (t) { try { return o.call(null, e) } catch (t) { return o.call(this, e) } } }(e) } } function f(e, t) { this.fun = e, this.array = t } function g() { } r.nextTick = function (e) { var t = new Array(arguments.length - 1); if (arguments.length > 1) for (var n = 1; n < arguments.length; n++)t[n - 1] = arguments[n]; u.push(new f(e, t)), 1 !== u.length || c || a(d) }, f.prototype.run = function () { this.fun.apply(null, this.array) }, r.title = "browser", r.browser = !0, r.env = {}, r.argv = [], r.version = "", r.versions = {}, r.on = g, r.addListener = g, r.once = g, r.off = g, r.removeListener = g, r.removeAllListeners = g, r.emit = g, r.prependListener = g, r.prependOnceListener = g, r.listeners = function (e) { return [] }, r.binding = function (e) { throw new Error("process.binding is not supported") }, r.cwd = function () { return "/" }, r.chdir = function (e) { throw new Error("process.chdir is not supported") }, r.umask = function () { return 0 } }, function (e, t, n) { var o = { "./ArrowDown_34x34.svg": 5, "./ArrowLeft.svg": 6, "./ArrowRight.svg": 7, "./Arrow_downGREY_10x10.svg": 8, "./ChooseFile.svg": 9, "./Clear.svg": 10, "./DefaultFile.svg": 11, "./Delete.svg": 12, "./Down_34x34.svg": 13, "./Left.svg": 14, "./ModernBooleanCheckChecked.svg": 15, "./ModernBooleanCheckInd.svg": 16, "./ModernBooleanCheckUnchecked.svg": 17, "./ModernCheck.svg": 18, "./ModernRadio.svg": 19, "./More.svg": 20, "./ProgressButton.svg": 21, "./ProgressButtonV2.svg": 22, "./RemoveFile.svg": 23, "./Right.svg": 24, "./SearchClear.svg": 25, "./TimerCircle.svg": 26, "./V2Check.svg": 27, "./V2Check_24x24.svg": 28, "./V2DragElement_16x16.svg": 29, "./clear_16x16.svg": 30, "./collapseDetail.svg": 31, "./expandDetail.svg": 32, "./no-image.svg": 33, "./search.svg": 34 }; function r(e) { var t = i(e); return n(t) } function i(e) { if (!n.o(o, e)) { var t = new Error("Cannot find module '" + e + "'"); throw t.code = "MODULE_NOT_FOUND", t } return o[e] } r.keys = function () { return Object.keys(o) }, r.resolve = i, e.exports = r, r.id = 4 }, function (e, t) { e.exports = '<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 34 34" xml:space="preserve"><polygon class="st0" points="12,16 14,14 17,17 20,14 22,16 17,21 "></polygon></svg>' }, function (e, t) { e.exports = '<svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M15 8.99999H4.39998L8.69998 13.3L7.29998 14.7L0.599976 7.99999L7.29998 1.29999L8.69998 2.69999L4.39998 6.99999H15V8.99999Z"></path></svg>' }, function (e, t) { e.exports = '<svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M1 6.99999H11.6L7.3 2.69999L8.7 1.29999L15.4 7.99999L8.7 14.7L7.3 13.3L11.6 8.99999H1V6.99999Z"></path></svg>' }, function (e, t) { e.exports = '<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 10 10" xml:space="preserve"><polygon class="st0" points="2,2 0,4 5,9 10,4 8,2 5,5 "></polygon></svg>' }, function (e, t) { e.exports = '<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M22 9V7C22 5.9 21.1 5 20 5H12L10 3H4C2.9 3 2 3.9 2 5V9V10V21H22L24 9H22ZM4 5H9.2L10.6 6.4L11.2 7H12H20V9H4V5ZM20.3 19H4V11H21.6L20.3 19Z"></path></svg>' }, function (e, t) { e.exports = '<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M22.6 8.6L16.4 2.4C16 2 15.5 1.8 15 1.8C14.5 1.8 14 2 13.6 2.4L1.4 14.6C0.600003 15.4 0.600003 16.6 1.4 17.4L6 22H12L22.6 11.4C23.3 10.6 23.3 9.3 22.6 8.6ZM11.1 20H6.8L2.8 16L6.2 12.6L12.4 18.8L11.1 20ZM13.8 17.4L7.6 11.2L15 3.8L21.2 10L13.8 17.4ZM16 20H23V22H14L16 20Z"></path></svg>' }, function (e, t) { e.exports = '<svg viewBox="0 0 56 68" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_9011_41219)"><path d="M54.83 10.83L45.17 1.17C44.7982 0.798664 44.357 0.504208 43.8714 0.303455C43.3858 0.102703 42.8654 -0.000411943 42.34 1.2368e-06H6C4.4087 1.2368e-06 2.88257 0.632142 1.75735 1.75736C0.632136 2.88258 0 4.4087 0 6V62C0 63.5913 0.632136 65.1174 1.75735 66.2426C2.88257 67.3679 4.4087 68 6 68H50C51.5913 68 53.1174 67.3679 54.2426 66.2426C55.3679 65.1174 56 63.5913 56 62V13.66C56.0004 13.1346 55.8973 12.6142 55.6965 12.1286C55.4958 11.643 55.2013 11.2018 54.83 10.83ZM44 2.83L53.17 12H48C46.9391 12 45.9217 11.5786 45.1716 10.8284C44.4214 10.0783 44 9.06087 44 8V2.83ZM54 62C54 63.0609 53.5786 64.0783 52.8284 64.8284C52.0783 65.5786 51.0609 66 50 66H6C4.93913 66 3.92172 65.5786 3.17157 64.8284C2.42142 64.0783 2 63.0609 2 62V6C2 4.93914 2.42142 3.92172 3.17157 3.17157C3.92172 2.42143 4.93913 2 6 2H42V8C42 9.5913 42.6321 11.1174 43.7574 12.2426C44.8826 13.3679 46.4087 14 48 14H54V62ZM14 24H42V26H14V24ZM14 30H42V32H14V30ZM14 36H42V38H14V36ZM14 42H42V44H14V42Z" fill="#909090"></path></g><defs><clipPath id="clip0_9011_41219"><rect width="56" height="68" fill="white"></rect></clipPath></defs></svg>' }, function (e, t) { e.exports = '<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M22 4H20H16V2C16 0.9 15.1 0 14 0H10C8.9 0 8 0.9 8 2V4H4H2V6H4V20C4 21.1 4.9 22 6 22H18C19.1 22 20 21.1 20 20V6H22V4ZM10 2H14V4H10V2ZM18 20H6V6H8H16H18V20ZM14 8H16V18H14V8ZM11 8H13V18H11V8ZM8 8H10V18H8V8Z"></path></svg>' }, function (e, t) { e.exports = '<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 34 34" xml:space="preserve"><g><path class="st0" d="M33,34H0V0h33c0.6,0,1,0.4,1,1v32C34,33.6,33.6,34,33,34z"></path><polygon class="st1" points="12,16 14,14 17,17 20,14 22,16 17,21 "></polygon></g></svg>' }, function (e, t) { e.exports = '<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 16 16" xml:space="preserve"><polygon points="11,12 9,14 3,8 9,2 11,4 7,8 "></polygon></svg>' }, function (e, t) { e.exports = '<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24"><polygon points="19,10 14,10 14,5 10,5 10,10 5,10 5,14 10,14 10,19 14,19 14,14 19,14 "></polygon></svg>' }, function (e, t) { e.exports = '<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24"><path d="M22,0H2C0.9,0,0,0.9,0,2v20c0,1.1,0.9,2,2,2h20c1.1,0,2-0.9,2-2V2C24,0.9,23.1,0,22,0z M21,18L6,3h15V18z M3,6l15,15H3V6z"></path></svg>' }, function (e, t) { e.exports = '<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24"><rect x="5" y="10" width="14" height="4"></rect></svg>' }, function (e, t) { e.exports = '<svg viewBox="0 0 24 24"><path d="M5,13l2-2l3,3l7-7l2,2l-9,9L5,13z"></path></svg>' }, function (e, t) { e.exports = '<svg viewBox="-12 -12 24 24"><circle r="6" cx="0" cy="0"></circle></svg>' }, function (e, t) { e.exports = '<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M6 12C6 13.1 5.1 14 4 14C2.9 14 2 13.1 2 12C2 10.9 2.9 10 4 10C5.1 10 6 10.9 6 12ZM12 10C10.9 10 10 10.9 10 12C10 13.1 10.9 14 12 14C13.1 14 14 13.1 14 12C14 10.9 13.1 10 12 10ZM20 10C18.9 10 18 10.9 18 12C18 13.1 18.9 14 20 14C21.1 14 22 13.1 22 12C22 10.9 21.1 10 20 10Z"></path></svg>' }, function (e, t) { e.exports = '<svg viewBox="0 0 10 10"><polygon points="2,2 0,4 5,9 10,4 8,2 5,5 "></polygon></svg>' }, function (e, t) { e.exports = '<svg viewBox="0 0 16 16"><path d="M15 8.99999H4.39998L8.69998 13.3L7.29998 14.7L0.599976 7.99999L7.29998 1.29999L8.69998 2.69999L4.39998 6.99999H15V8.99999Z"></path></svg>' }, function (e, t) { e.exports = '<svg viewBox="0 0 16 16"><path d="M8,2C4.7,2,2,4.7,2,8s2.7,6,6,6s6-2.7,6-6S11.3,2,8,2z M11,10l-1,1L8,9l-2,2l-1-1l2-2L5,6l1-1l2,2l2-2l1,1L9,8 L11,10z"></path></svg>' }, function (e, t) { e.exports = '<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 16 16" xml:space="preserve"><polygon points="5,4 7,2 13,8 7,14 5,12 9,8 "></polygon></svg>' }, function (e, t) { e.exports = '<svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M13.35 3.34999L12.65 2.64999L8.05002 7.24999L3.35002 2.64999L2.65002 3.34999L7.25002 8.04999L2.65002 12.65L3.35002 13.35L8.05002 8.74999L12.65 13.35L13.35 12.65L8.75002 8.04999L13.35 3.34999Z"></path></svg>' }, function (e, t) { e.exports = '<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 160 160"><circle cx="80" cy="80" r="70" style="stroke: var(--sd-timer-stroke-background-color); stroke-width: var(--sd-timer-stroke-background-width)" stroke-dasharray="none" stroke-dashoffset="none"></circle><circle cx="80" cy="80" r="70"></circle></svg>' }, function (e, t) { e.exports = '<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M8.00001 15.8L2.60001 10.4L4.00001 9L8.00001 13L16 5L17.4 6.4L8.00001 15.8Z"></path></svg>' }, function (e, t) { e.exports = '<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M9 20.1L1 12L3.1 9.9L9 15.9L20.9 4L23 6.1L9 20.1Z"></path></svg>' }, function (e, t) { e.exports = '<svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M2 4C2 3.73478 2.10536 3.48043 2.29289 3.29289C2.48043 3.10536 2.73478 3 3 3H13C13.2652 3 13.5196 3.10536 13.7071 3.29289C13.8946 3.48043 14 3.73478 14 4C14 4.26522 13.8946 4.51957 13.7071 4.70711C13.5196 4.89464 13.2652 5 13 5H3C2.73478 5 2.48043 4.89464 2.29289 4.70711C2.10536 4.51957 2 4.26522 2 4ZM13 7H3C2.73478 7 2.48043 7.10536 2.29289 7.29289C2.10536 7.48043 2 7.73478 2 8C2 8.26522 2.10536 8.51957 2.29289 8.70711C2.48043 8.89464 2.73478 9 3 9H13C13.2652 9 13.5196 8.89464 13.7071 8.70711C13.8946 8.51957 14 8.26522 14 8C14 7.73478 13.8946 7.48043 13.7071 7.29289C13.5196 7.10536 13.2652 7 13 7ZM13 11H3C2.73478 11 2.48043 11.1054 2.29289 11.2929C2.10536 11.4804 2 11.7348 2 12C2 12.2652 2.10536 12.5196 2.29289 12.7071C2.48043 12.8946 2.73478 13 3 13H13C13.2652 13 13.5196 12.8946 13.7071 12.7071C13.8946 12.5196 14 12.2652 14 12C14 11.7348 13.8946 11.4804 13.7071 11.2929C13.5196 11.1054 13.2652 11 13 11Z"></path></svg>' }, function (e, t) { e.exports = '<svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M13.35 3.34999L12.65 2.64999L8.05002 7.24999L3.35002 2.64999L2.65002 3.34999L7.25002 8.04999L2.65002 12.65L3.35002 13.35L8.05002 8.74999L12.65 13.35L13.35 12.65L8.75002 8.04999L13.35 3.34999Z"></path></svg>' }, function (e, t) { e.exports = '<svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M13 7H3V9H13V7Z"></path></svg>' }, function (e, t) { e.exports = '<svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M13 7H9V3H7V7H3V9H7V13H9V9H13V7Z"></path></svg>' }, function (e, t) { e.exports = '<svg viewBox="0 0 48 48"><g opacity="0.5"><path d="M14 17.01C14 16.4167 14.1759 15.8366 14.5056 15.3433C14.8352 14.8499 15.3038 14.4654 15.8519 14.2384C16.4001 14.0113 17.0033 13.9519 17.5853 14.0676C18.1672 14.1834 18.7018 14.4691 19.1213 14.8887C19.5409 15.3082 19.8266 15.8428 19.9424 16.4247C20.0581 17.0067 19.9987 17.6099 19.7716 18.1581C19.5446 18.7062 19.1601 19.1748 18.6667 19.5044C18.1734 19.8341 17.5933 20.01 17 20.01C16.2044 20.01 15.4413 19.6939 14.8787 19.1313C14.3161 18.5687 14 17.8056 14 17.01ZM27.09 24.14L20 36.01H36L27.09 24.14ZM36.72 8.14L35.57 10.01H36C36.5304 10.01 37.0391 10.2207 37.4142 10.5958C37.7893 10.9709 38 11.4796 38 12.01V36.01C38 36.5404 37.7893 37.0491 37.4142 37.4242C37.0391 37.7993 36.5304 38.01 36 38.01H18.77L17.57 40.01H36C37.0609 40.01 38.0783 39.5886 38.8284 38.8384C39.5786 38.0883 40 37.0709 40 36.01V12.01C39.9966 11.0765 39.6668 10.1737 39.0678 9.45778C38.4688 8.74188 37.6382 8.25802 36.72 8.09V8.14ZM36.86 4.5L12.86 44.5L11.14 43.5L13.23 40.01H12C10.9391 40.01 9.92172 39.5886 9.17157 38.8384C8.42143 38.0883 8 37.0709 8 36.01V12.01C8 10.9491 8.42143 9.93172 9.17157 9.18157C9.92172 8.43143 10.9391 8.01 12 8.01H32.43L35.14 3.5L36.86 4.5ZM14.43 38.01L15.63 36.01H12L19 27.01L20.56 27.8L31.23 10.01H12C11.4696 10.01 10.9609 10.2207 10.5858 10.5958C10.2107 10.9709 10 11.4796 10 12.01V36.01C10 36.5404 10.2107 37.0491 10.5858 37.4242C10.9609 37.7993 11.4696 38.01 12 38.01H14.43Z"></path></g></svg>' }, function (e, t) { e.exports = '<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M14 2C9.6 2 6 5.6 6 10C6 11.8 6.6 13.5 7.7 14.9L2.3 20.3C1.9 20.7 1.9 21.3 2.3 21.7C2.5 21.9 2.7 22 3 22C3.3 22 3.5 21.9 3.7 21.7L9.1 16.3C10.5 17.4 12.2 18 14 18C18.4 18 22 14.4 22 10C22 5.6 18.4 2 14 2ZM14 16C10.7 16 8 13.3 8 10C8 6.7 10.7 4 14 4C17.3 4 20 6.7 20 10C20 13.3 17.3 16 14 16Z"></path></svg>' }, , , , , , function (e, t, n) { "use strict"; n.r(t), n.d(t, "Version", (function () { return Gi })), n.d(t, "checkLibraryVersion", (function () { return Yi })), n.d(t, "settings", (function () { return o })), n.d(t, "Helpers", (function () { return r })), n.d(t, "AnswerCountValidator", (function () { return Le })), n.d(t, "EmailValidator", (function () { return Ne })), n.d(t, "NumericValidator", (function () { return De })), n.d(t, "RegexValidator", (function () { return je })), n.d(t, "SurveyValidator", (function () { return Re })), n.d(t, "TextValidator", (function () { return Ae })), n.d(t, "ValidatorResult", (function () { return Ie })), n.d(t, "ExpressionValidator", (function () { return Me })), n.d(t, "ValidatorRunner", (function () { return Ee })), n.d(t, "ItemValue", (function () { return qe })), n.d(t, "Base", (function () { return ce })), n.d(t, "Event", (function () { return he })), n.d(t, "EventBase", (function () { return de })), n.d(t, "ArrayChanges", (function () { return pe })), n.d(t, "ComputedUpdater", (function () { return ue })), n.d(t, "SurveyError", (function () { return fe })), n.d(t, "SurveyElementCore", (function () { return Dt })), n.d(t, "SurveyElement", (function () { return At })), n.d(t, "DragTypeOverMeEnum", (function () { return Ot })), n.d(t, "CalculatedValue", (function () { return jt })), n.d(t, "CustomError", (function () { return Se })), n.d(t, "AnswerRequiredError", (function () { return ye })), n.d(t, "OneAnswerRequiredError", (function () { return me })), n.d(t, "RequreNumericError", (function () { return ve })), n.d(t, "ExceedSizeError", (function () { return be })), n.d(t, "LocalizableString", (function () { return u })), n.d(t, "LocalizableStrings", (function () { return c })), n.d(t, "HtmlConditionItem", (function () { return Ft })), n.d(t, "UrlConditionItem", (function () { return qt })), n.d(t, "ChoicesRestful", (function () { return Qt })), n.d(t, "ChoicesRestfull", (function () { return Ht })), n.d(t, "FunctionFactory", (function () { return R })), n.d(t, "registerFunction", (function () { return E })), n.d(t, "ConditionRunner", (function () { return oe })), n.d(t, "ExpressionRunner", (function () { return re })), n.d(t, "ExpressionExecutor", (function () { return te })), n.d(t, "Operand", (function () { return B })), n.d(t, "Const", (function () { return U })), n.d(t, "BinaryOperand", (function () { return Q })), n.d(t, "Variable", (function () { return W })), n.d(t, "FunctionOperand", (function () { return J })), n.d(t, "ArrayOperand", (function () { return z })), n.d(t, "UnaryOperand", (function () { return H })), n.d(t, "ConditionsParser", (function () { return Z })), n.d(t, "ProcessValue", (function () { return I })), n.d(t, "JsonError", (function () { return P })), n.d(t, "JsonIncorrectTypeError", (function () { return O })), n.d(t, "JsonMetadata", (function () { return C })), n.d(t, "JsonMetadataClass", (function () { return b })), n.d(t, "JsonMissingTypeError", (function () { return x })), n.d(t, "JsonMissingTypeErrorBase", (function () { return V })), n.d(t, "JsonObject", (function () { return S })), n.d(t, "JsonObjectProperty", (function () { return m })), n.d(t, "JsonRequiredPropertyError", (function () { return T })), n.d(t, "JsonUnknownPropertyError", (function () { return w })), n.d(t, "Serializer", (function () { return _ })), n.d(t, "property", (function () { return f })), n.d(t, "propertyArray", (function () { return y })), n.d(t, "MatrixDropdownCell", (function () { return bn })), n.d(t, "MatrixDropdownRowModelBase", (function () { return wn })), n.d(t, "QuestionMatrixDropdownModelBase", (function () { return xn })), n.d(t, "MatrixDropdownColumn", (function () { return hn })), n.d(t, "matrixDropdownColumnTypes", (function () { return pn })), n.d(t, "QuestionMatrixDropdownRenderedCell", (function () { return gn })), n.d(t, "QuestionMatrixDropdownRenderedRow", (function () { return yn })), n.d(t, "QuestionMatrixDropdownRenderedTable", (function () { return mn })), n.d(t, "MatrixDropdownRowModel", (function () { return Tn })), n.d(t, "QuestionMatrixDropdownModel", (function () { return Sn })), n.d(t, "MatrixDynamicRowModel", (function () { return Qn })), n.d(t, "QuestionMatrixDynamicModel", (function () { return Hn })), n.d(t, "MatrixRowModel", (function () { return _o })), n.d(t, "MatrixCells", (function () { return Io })), n.d(t, "QuestionMatrixModel", (function () { return Ro })), n.d(t, "QuestionMatrixBaseModel", (function () { return Zt })), n.d(t, "MultipleTextItemModel", (function () { return Qo })), n.d(t, "QuestionMultipleTextModel", (function () { return Ho })), n.d(t, "PanelModel", (function () { return $o })), n.d(t, "PanelModelBase", (function () { return Go })), n.d(t, "QuestionRowModel", (function () { return Jo })), n.d(t, "FlowPanelModel", (function () { return Xo })), n.d(t, "PageModel", (function () { return er })), n.d(t, "DefaultTitleModel", (function () { return tr })), n.d(t, "Question", (function () { return $t })), n.d(t, "QuestionNonValue", (function () { return or })), n.d(t, "QuestionEmptyModel", (function () { return ir })), n.d(t, "QuestionCheckboxBase", (function () { return Co })), n.d(t, "QuestionSelectBase", (function () { return bo })), n.d(t, "QuestionCheckboxModel", (function () { return ar })), n.d(t, "QuestionTagboxModel", (function () { return yr })), n.d(t, "QuestionRankingModel", (function () { return Vr })), n.d(t, "QuestionCommentModel", (function () { return Or })), n.d(t, "QuestionDropdownModel", (function () { return To })), n.d(t, "QuestionFactory", (function () { return rn })), n.d(t, "ElementFactory", (function () { return sn })), n.d(t, "QuestionFileModel", (function () { return _r })), n.d(t, "QuestionHtmlModel", (function () { return Er })), n.d(t, "QuestionRadiogroupModel", (function () { return Ar })), n.d(t, "QuestionRatingModel", (function () { return Mr })), n.d(t, "RenderedRatingItem", (function () { return Nr })), n.d(t, "QuestionExpressionModel", (function () { return ln })), n.d(t, "QuestionTextBase", (function () { return Lo })), n.d(t, "CharacterCounter", (function () { return Ao })), n.d(t, "QuestionTextModel", (function () { return No })), n.d(t, "QuestionBooleanModel", (function () { return kr })), n.d(t, "QuestionImagePickerModel", (function () { return zr })), n.d(t, "ImageItemValue", (function () { return Hr })), n.d(t, "QuestionImageModel", (function () { return $r })), n.d(t, "QuestionSignaturePadModel", (function () { return ni })), n.d(t, "QuestionPanelDynamicModel", (function () { return ui })), n.d(t, "QuestionPanelDynamicItem", (function () { return ai })), n.d(t, "SurveyTimer", (function () { return so })), n.d(t, "SurveyTimerModel", (function () { return uo })), n.d(t, "SurveyProgressModel", (function () { return ci })), n.d(t, "SurveyProgressButtonsModel", (function () { return pi })), n.d(t, "SurveyModel", (function () { return yo })), n.d(t, "SurveyTrigger", (function () { return fi })), n.d(t, "SurveyTriggerComplete", (function () { return yi })), n.d(t, "SurveyTriggerSetValue", (function () { return mi })), n.d(t, "SurveyTriggerVisible", (function () { return gi })), n.d(t, "SurveyTriggerCopyValue", (function () { return Ci })), n.d(t, "SurveyTriggerRunExpression", (function () { return bi })), n.d(t, "Trigger", (function () { return di })), n.d(t, "PopupSurveyModel", (function () { return Vi })), n.d(t, "SurveyWindowModel", (function () { return xi })), n.d(t, "TextPreProcessor", (function () { return nn })), n.d(t, "Notifier", (function () { return ho })), n.d(t, "dxSurveyService", (function () { return Gn })), n.d(t, "englishStrings", (function () { return i })), n.d(t, "surveyLocalization", (function () { return s })), n.d(t, "surveyStrings", (function () { return a })), n.d(t, "QuestionCustomWidget", (function () { return zt })), n.d(t, "CustomWidgetCollection", (function () { return Ut })), n.d(t, "QuestionCustomModel", (function () { return Ii })), n.d(t, "QuestionCompositeModel", (function () { return Ei })), n.d(t, "ComponentQuestionJSON", (function () { return Ti })), n.d(t, "ComponentCollection", (function () { return Si })), n.d(t, "StylesManager", (function () { return oo })), n.d(t, "ListModel", (function () { return yt })), n.d(t, "MultiSelectListModel", (function () { return cr })), n.d(t, "PopupModel", (function () { return bt })), n.d(t, "createDialogOptions", (function () { return Ct })), n.d(t, "PopupBaseViewModel", (function () { return ji })), n.d(t, "PopupDropdownViewModel", (function () { return qi })), n.d(t, "PopupModalViewModel", (function () { return Bi })), n.d(t, "createPopupViewModel", (function () { return Hi })), n.d(t, "createPopupModalViewModel", (function () { return Qi })), n.d(t, "DropdownListModel", (function () { return Vo })), n.d(t, "DropdownMultiSelectListModel", (function () { return dr })), n.d(t, "QuestionButtonGroupModel", (function () { return Ji })), n.d(t, "ButtonGroupItemModel", (function () { return $i })), n.d(t, "ButtonGroupItemValue", (function () { return Wi })), n.d(t, "IsMobile", (function () { return En })), n.d(t, "IsTouch", (function () { return An })), n.d(t, "_setIsTouch", (function () { return Ln })), n.d(t, "confirmAction", (function () { return Be })), n.d(t, "detectIEOrEdge", (function () { return Qe })), n.d(t, "doKey2ClickUp", (function () { return $e })), n.d(t, "doKey2ClickDown", (function () { return Ke })), n.d(t, "doKey2ClickBlur", (function () { return Ge })), n.d(t, "loadFileFromBase64", (function () { return He })), n.d(t, "increaseHeightByContent", (function () { return Xe })), n.d(t, "createSvg", (function () { return Ue })), n.d(t, "sanitizeEditableContent", (function () { return nt })), n.d(t, "CssClassBuilder", (function () { return at })), n.d(t, "surveyCss", (function () { return Un })), n.d(t, "defaultV2Css", (function () { return Wn })), n.d(t, "defaultV2ThemeName", (function () { return Jn })), n.d(t, "DragDropSurveyElements", (function () { return Xi })), n.d(t, "DragDropChoices", (function () { return vr })), n.d(t, "defaultStandardCss", (function () { return Zi })), n.d(t, "modernCss", (function () { return es })), n.d(t, "SvgIconRegistry", (function () { return ts })), n.d(t, "SvgRegistry", (function () { return ns })), n.d(t, "SvgBundleViewModel", (function () { })), n.d(t, "RendererFactory", (function () { return Wt })), n.d(t, "ResponsivityManager", (function () { return it })), n.d(t, "VerticalResponsivityManager", (function () { return st })), n.d(t, "unwrap", (function () { return We })), n.d(t, "getOriginalEvent", (function () { return Ye })), n.d(t, "createDropdownActionModel", (function () { return Vt })), n.d(t, "createDropdownActionModelAdvanced", (function () { return xt })), n.d(t, "Action", (function () { return Tt })), n.d(t, "ActionDropdownViewModel", (function () { return St })), n.d(t, "AdaptiveActionContainer", (function () { return It })), n.d(t, "defaultActionBarCss", (function () { return ct })), n.d(t, "ActionContainer", (function () { return pt })), n.d(t, "TooltipManager", (function () { return rs })), n.d(t, "DragOrClickHelper", (function () { return kn })), n.d(t, "Model", (function () { return yo })); var o = { comparator: { trimStrings: !0, caseSensitive: !1 }, expressionDisableConversionChar: "#", useLocalTimeZone: !0, get commentPrefix() { return o.commentSuffix }, set commentPrefix(e) { o.commentSuffix = e }, commentSuffix: "-Comment", webserviceEncodeParameters: !0, useCachingForChoicesRestful: !0, get useCachingForChoicesRestfull() { return o.useCachingForChoicesRestful }, set useCachingForChoicesRestfull(e) { o.useCachingForChoicesRestful = e }, surveyServiceUrl: "https://api.surveyjs.io/public/v1/Survey", itemValueSeparator: "|", itemValueAlwaysSerializeAsObject: !1, itemValueAlwaysSerializeText: !1, defaultLocaleName: "default", storeDuplicatedTranslations: !1, matrixDefaultRowName: "default", matrixDefaultCellType: "dropdown", matrixTotalValuePostFix: "-total", matrixMaximumRowCount: 1e3, matrixMaxRowCountInCondition: 1, panelDynamicMaxPanelCountInCondition: 1, matrixRenderRemoveAsIcon: !0, panelMaximumPanelCount: 100, ratingMaximumRateValueCount: 20, disableOnGettingChoicesFromWeb: !1, serializeLocalizableStringAsObject: !1, allowShowEmptyTitleInDesignMode: !0, allowShowEmptyDescriptionInDesignMode: !0, executeCompleteTriggerOnValueChanged: !1, changeNavigationButtonsOnCompleteTrigger: !0, executeSkipTriggerOnValueChanged: !0, readOnlyCommentRenderMode: "textarea", readOnlyTextRenderMode: "input", confirmActionFunc: function (e) { return confirm(e) }, minWidth: "300px", maxWidth: "100%", maximumConditionRunCountOnValueChanged: 10, setQuestionVisibleIndexForHiddenTitle: !1, setQuestionVisibleIndexForHiddenNumber: !1, lazyRowsRendering: !1, lazyRowsRenderingStartRow: 3, notifications: { lifetime: 2e3 }, showItemsInOrder: "default", noneItemValue: "none", supportedValidators: { question: ["expression"], comment: ["text", "regex"], text: ["numeric", "text", "regex", "email"], checkbox: ["answercount"], imagepicker: ["answercount"] }, minDate: "", maxDate: "", showModal: void 0, supportCreatorV2: !1, showDefaultItemsInCreatorV2: !0, customIcons: {}, rankingDragHandleArea: "entireItem", titleTags: { survey: "h3", page: "h4", panel: "h4", question: "h5" }, questions: { inputTypes: ["color", "date", "datetime", "datetime-local", "email", "month", "number", "password", "range", "tel", "text", "time", "url", "week"], dataList: ["", "name", "honorific-prefix", "given-name", "additional-name", "family-name", "honorific-suffix", "nickname", "organization-title", "username", "new-password", "current-password", "organization", "street-address", "address-line1", "address-line2", "address-line3", "address-level4", "address-level3", "address-level2", "address-level1", "country", "country-name", "postal-code", "cc-name", "cc-given-name", "cc-additional-name", "cc-family-name", "cc-number", "cc-exp", "cc-exp-month", "cc-exp-year", "cc-csc", "cc-type", "transaction-currency", "transaction-amount", "language", "bday", "bday-day", "bday-month", "bday-year", "sex", "url", "photo", "tel", "tel-country-code", "tel-national", "tel-area-code", "tel-local", "tel-local-prefix", "tel-local-suffix", "tel-extension", "email", "impp"] } }, r = function () { function e() { } return e.isValueEmpty = function (t) { if (Array.isArray(t) && 0 === t.length) return !0; if (t && "object" == typeof t && t.constructor === Object) { for (var n in t) if (!e.isValueEmpty(t[n])) return !1; return !0 } return !t && 0 !== t && !1 !== t }, e.isArrayContainsEqual = function (t, n) { if (!Array.isArray(t) || !Array.isArray(n)) return !1; if (t.length !== n.length) return !1; for (var o = 0; o < t.length; o++) { for (var r = 0; r < n.length && !e.isTwoValueEquals(t[o], n[r]); r++); if (r === n.length) return !1 } return !0 }, e.isArraysEqual = function (t, n, o, r, i) { if (void 0 === o && (o = !1), !Array.isArray(t) || !Array.isArray(n)) return !1; if (t.length !== n.length) return !1; if (o) { for (var s = [], a = [], l = 0; l < t.length; l++)s.push(t[l]), a.push(n[l]); s.sort(), a.sort(), t = s, n = a } for (l = 0; l < t.length; l++)if (!e.isTwoValueEquals(t[l], n[l], o, r, i)) return !1; return !0 }, e.isTwoValueEquals = function (t, n, r, i, s) { if (void 0 === r && (r = !1), t === n) return !0; if (Array.isArray(t) && 0 === t.length && void 0 === n) return !0; if (Array.isArray(n) && 0 === n.length && void 0 === t) return !0; if (null == t && "" === n) return !0; if (null == n && "" === t) return !0; if (void 0 === s && (s = o.comparator.trimStrings), void 0 === i && (i = o.comparator.caseSensitive), "string" == typeof t && "string" == typeof n) return s && (t = t.trim(), n = n.trim()), i || (t = t.toLowerCase(), n = n.toLowerCase()), t === n; if (t instanceof Date && n instanceof Date) return t.getTime() == n.getTime(); if (e.isConvertibleToNumber(t) && e.isConvertibleToNumber(n) && parseInt(t) === parseInt(n) && parseFloat(t) === parseFloat(n)) return !0; if (!e.isValueEmpty(t) && e.isValueEmpty(n) || e.isValueEmpty(t) && !e.isValueEmpty(n)) return !1; if ((!0 === t || !1 === t) && "string" == typeof n) return t.toString() === n.toLocaleLowerCase(); if ((!0 === n || !1 === n) && "string" == typeof t) return n.toString() === t.toLocaleLowerCase(); if (!(t instanceof Object || n instanceof Object)) return t == n; if (!(t instanceof Object && n instanceof Object)) return !1; if (t.equals) return t.equals(n); if (t.toJSON && n.toJSON && t.getType && n.getType) return !t.isDiposed && !n.isDiposed && (t.getType() === n.getType() && ((!t.name || t.name === n.name) && this.isTwoValueEquals(t.toJSON(), n.toJSON(), r, i, s))); if (Array.isArray(t) && Array.isArray(n)) return e.isArraysEqual(t, n, r, i, s); if (t.equalsTo && n.equalsTo) return t.equalsTo(n); for (var a in t) if (t.hasOwnProperty(a)) { if (!n.hasOwnProperty(a)) return !1; if (!this.isTwoValueEquals(t[a], n[a], r, i, s)) return !1 } for (a in n) if (n.hasOwnProperty(a) && !t.hasOwnProperty(a)) return !1; return !0 }, e.randomizeArray = function (e) { for (var t = e.length - 1; t > 0; t--) { var n = Math.floor(Math.random() * (t + 1)), o = e[t]; e[t] = e[n], e[n] = o } return e }, e.getUnbindValue = function (e) { return e && e instanceof Object && !(e instanceof Date) ? JSON.parse(JSON.stringify(e)) : e }, e.createCopy = function (e) { var t = {}; if (!e) return t; for (var n in e) t[n] = e[n]; return t }, e.isConvertibleToNumber = function (e) { return null != e && !Array.isArray(e) && !isNaN(e) }, e.isNumber = function (e) { return !isNaN(this.getNumber(e)) }, e.getNumber = function (e) { if ("string" == typeof e && e && 0 == e.indexOf("0x") && e.length > 32) return NaN; e = this.prepareStringToNumber(e); var t = parseFloat(e); return isNaN(t) || !isFinite(e) ? NaN : t }, e.prepareStringToNumber = function (e) { if ("string" != typeof e || !e) return e; var t = e.indexOf(","); return t > -1 && e.indexOf(",", t + 1) < 0 ? e.replace(",", ".") : e }, e.getMaxLength = function (e, t) { return e < 0 && (e = t), e > 0 ? e : null }, e.getRemainingCharacterCounterText = function (e, t) { return !t || t <= 0 ? "" : [e ? e.length : "0", t].join("/") }, e.getNumberByIndex = function (t, n) { if (t < 0) return ""; var o = 1, r = "", i = ".", s = !0, a = "A", l = ""; if (n) { for (var u = (l = n).length - 1, c = !1, p = 0; p < l.length; p++)if (e.isCharDigit(l[p])) { c = !0; break } for (var h = function () { return c && !e.isCharDigit(l[u]) || e.isCharNotLetterAndDigit(l[u]) }; u >= 0 && h();)u--; var d = ""; for (u < l.length - 1 && (d = l.substring(u + 1), l = l.substring(0, u + 1)), u = l.length - 1; u >= 0 && !h() && (u--, c);); a = l.substring(u + 1), r = l.substring(0, u + 1), parseInt(a) ? o = parseInt(a) : 1 == a.length && (s = !1), (d || r) && (i = d) } if (s) { for (var f = (t + o).toString(); f.length < a.length;)f = "0" + f; return r + f + i } return r + String.fromCharCode(a.charCodeAt(0) + t) + i }, e.isCharNotLetterAndDigit = function (t) { return t.toUpperCase() == t.toLowerCase() && !e.isCharDigit(t) }, e.isCharDigit = function (e) { return e >= "0" && e <= "9" }, e.countDecimals = function (t) { if (e.isNumber(t) && Math.floor(t) !== t) { var n = t.toString().split("."); return n.length > 1 && n[1].length || 0 } return 0 }, e.correctAfterPlusMinis = function (t, n, o) { var r = e.countDecimals(t), i = e.countDecimals(n); if (r > 0 || i > 0) { var s = Math.max(r, i); o = parseFloat(o.toFixed(s)) } return o }, e.sumAnyValues = function (t, n) { if (!e.isNumber(t) || !e.isNumber(n)) { if (Array.isArray(t) && Array.isArray(n)) return [].concat(t).concat(n); if (Array.isArray(t) || Array.isArray(n)) { var o = Array.isArray(t) ? t : n, r = o === t ? n : t; if ("string" == typeof r) { var i = o.join(", "); return o === t ? i + r : r + i } if ("number" == typeof r) { for (var s = 0, a = 0; a < o.length; a++)"number" == typeof o[a] && (s = e.correctAfterPlusMinis(s, o[a], s + o[a])); return e.correctAfterPlusMinis(s, r, s + r) } } return t + n } return e.correctAfterPlusMinis(t, n, t + n) }, e.correctAfterMultiple = function (t, n, o) { var r = e.countDecimals(t) + e.countDecimals(n); return r > 0 && (o = parseFloat(o.toFixed(r))), o }, e.convertArrayValueToObject = function (t, n, o) { void 0 === o && (o = void 0); var r = new Array; if (!t || !Array.isArray(t)) return r; for (var i = 0; i < t.length; i++) { var s = void 0; Array.isArray(o) && (s = e.findObjByPropValue(o, n, t[i])), s || ((s = {})[n] = t[i]), r.push(s) } return r }, e.findObjByPropValue = function (t, n, o) { for (var r = 0; r < t.length; r++)if (e.isTwoValueEquals(t[r][n], o)) return t[r] }, e.convertArrayObjectToValue = function (t, n) { var o = new Array; if (!t || !Array.isArray(t)) return o; for (var r = 0; r < t.length; r++) { var i = t[r] ? t[r][n] : void 0; e.isValueEmpty(i) || o.push(i) } return o }, e.convertDateToString = function (e) { var t = function (e) { return e < 10 ? "0" + e.toString() : e.toString() }; return e.getFullYear() + "-" + t(e.getMonth() + 1) + "-" + t(e.getDate()) }, e.convertDateTimeToString = function (e) { var t = function (e) { return e < 10 ? "0" + e.toString() : e.toString() }; return this.convertDateToString(e) + " " + t(e.getHours()) + ":" + t(e.getMinutes()) }, e.convertValToQuestionVal = function (t, n) { return t instanceof Date ? "datetime" === n ? e.convertDateTimeToString(t) : e.convertDateToString(t) : t }, e }(); String.prototype.format || (String.prototype.format = function () { var e = arguments; return this.replace(/{(\d+)}/g, (function (t, n) { return void 0 !== e[n] ? e[n] : t })) }); var i = { pagePrevText: "Previous", pageNextText: "Next", completeText: "Complete", previewText: "Preview", editText: "Edit", startSurveyText: "Start", otherItemText: "Other (describe)", noneItemText: "None", selectAllItemText: "Select All", progressText: "Page {0} of {1}", indexText: "{0} of {1}", panelDynamicProgressText: "{0} of {1}", questionsProgressText: "Answered {0}/{1} questions", emptySurvey: "The survey doesn't contain visible pages or questions.", completingSurvey: "Thank you for completing the survey", completingSurveyBefore: "Our records show that you have already completed this survey.", loadingSurvey: "Loading Survey...", placeholder: "Select...", ratingOptionsCaption: "Tap to rate here...", value: "value", requiredError: "Response required.", requiredErrorInPanel: "Response required: answer at least one question.", requiredInAllRowsError: "Response required: answer questions in all rows.", numericError: "The value should be numeric.", minError: "The value should not be less than {0}", maxError: "The value should not be greater than {0}", textMinLength: "Please enter at least {0} character(s).", textMaxLength: "Please enter no more than {0} character(s).", textMinMaxLength: "Please enter at least {0} and no more than {1} characters.", minRowCountError: "Please fill in at least {0} row(s).", minSelectError: "Please select at least {0} variant(s).", maxSelectError: "Please select no more than {0} variant(s).", numericMinMax: "The '{0}' should be at least {1} and at most {2}", numericMin: "The '{0}' should be at least {1}", numericMax: "The '{0}' should be at most {1}", invalidEmail: "Please enter a valid e-mail address.", invalidExpression: "The expression: {0} should return 'true'.", urlRequestError: "The request returned error '{0}'. {1}", urlGetChoicesError: "The request returned empty data or the 'path' property is incorrect", exceedMaxSize: "The file size should not exceed {0}.", otherRequiredError: "Response required: enter another value.", uploadingFile: "Your file is uploading. Please wait several seconds and try again.", loadingFile: "Loading...", chooseFile: "Choose file(s)...", noFileChosen: "No file chosen", fileDragAreaPlaceholder: "Drop a file here or click the button below to load the file.", confirmDelete: "Do you want to delete the record?", keyDuplicationError: "This value should be unique.", addColumn: "Add Column", addRow: "Add Row", removeRow: "Remove", emptyRowsText: "There are no rows.", addPanel: "Add new", removePanel: "Remove", choices_Item: "item", matrix_column: "Column", matrix_row: "Row", multipletext_itemname: "text", savingData: "The results are being saved on the server...", savingDataError: "An error occurred and we could not save the results.", savingDataSuccess: "The results were saved successfully!", saveAgainButton: "Try again", timerMin: "min", timerSec: "sec", timerSpentAll: "You have spent {0} on this page and {1} in total.", timerSpentPage: "You have spent {0} on this page.", timerSpentSurvey: "You have spent {0} in total.", timerLimitAll: "You have spent {0} of {1} on this page and {2} of {3} in total.", timerLimitPage: "You have spent {0} of {1} on this page.", timerLimitSurvey: "You have spent {0} of {1} in total.", clearCaption: "Clear", signaturePlaceHolder: "Sign here", chooseFileCaption: "Choose file", removeFileCaption: "Remove this file", booleanCheckedLabel: "Yes", booleanUncheckedLabel: "No", confirmRemoveFile: "Are you sure that you want to remove this file: {0}?", confirmRemoveAllFiles: "Are you sure that you want to remove all files?", questionTitlePatternText: "Question Title", modalCancelButtonText: "Cancel", modalApplyButtonText: "Apply", filterStringPlaceholder: "Type to search...", emptyMessage: "No data to display", noEntriesText: "There are no entries yet.\nClick the button below to add a new entry.", noEntriesReadonlyText: "There are no entries.", more: "More", tagboxDoneButtonCaption: "Done" }, s = { currentLocaleValue: "", defaultLocaleValue: "en", locales: {}, localeNames: {}, supportedLocales: [], get currentLocale() { return this.currentLocaleValue === this.defaultLocaleValue ? "" : this.currentLocaleValue }, set currentLocale(e) { "cz" === e && (e = "cs"), this.currentLocaleValue = e }, get defaultLocale() { return this.defaultLocaleValue }, set defaultLocale(e) { "cz" === e && (e = "cs"), this.defaultLocaleValue = e }, getLocaleStrings: function (e) { return this.locales[e] }, getCurrentStrings: function (e) { var t = e && this.locales[e]; return t || (t = this.currentLocale ? this.locales[this.currentLocale] : this.locales[this.defaultLocale]), t || (t = this.locales[this.defaultLocale]), t || (t = this.locales.en), t }, getString: function (e, t) { void 0 === t && (t = null); var n = t; t = t || this.currentLocale || this.defaultLocale; var o = this.getCurrentStrings(t); if (o[e]) return o[e]; var r = t ? t.indexOf("-") : -1; if (r > -1) return this.getString(e, t.substring(0, r)); var i = (o = this.locales[this.defaultLocale])[e]; return void 0 === i && (i = this.locales.en[e]), void 0 === i ? this.onGetExternalString(e, n) : i }, getLocales: function (e) { void 0 === e && (e = !1); var t = []; t.push(""); var n = this.locales; if (this.supportedLocales && this.supportedLocales.length > 0) { n = {}; for (var o = 0; o < this.supportedLocales.length; o++)n[this.supportedLocales[o]] = !0 } for (var r in n) e && r == this.defaultLocale || t.push(r); var i = function (e) { if (!e) return ""; var t = s.localeNames[e]; return t || (t = e), t.toLowerCase() }; return t.sort((function (e, t) { var n = i(e), o = i(t); return n === o ? 0 : n < o ? -1 : 1 })), t }, onGetExternalString: function (e, t) { } }, a = i; s.locales.en = i, s.localeNames.en = "english"; var l, u = function () { function e(e, t, n) { void 0 === t && (t = !1), this.owner = e, this.useMarkdown = t, this.name = n, this.values = {}, this.htmlValues = {}, this.onStringChanged = new de, this.onCreating() } return Object.defineProperty(e, "defaultLocale", { get: function () { return o.defaultLocaleName }, set: function (e) { o.defaultLocaleName = e }, enumerable: !1, configurable: !0 }), e.prototype.getIsMultiple = function () { return !1 }, Object.defineProperty(e.prototype, "locale", { get: function () { if (this.owner && this.owner.getLocale) { var e = this.owner.getLocale(); if (e || !this.sharedData) return e } return this.sharedData ? this.sharedData.locale : "" }, enumerable: !1, configurable: !0 }), e.prototype.strChanged = function () { this.searchableText = void 0, void 0 !== this.renderedText && (this.calculatedTextValue = this.calcText(), this.renderedText !== this.calculatedTextValue && (this.renderedText = void 0, this.calculatedTextValue = void 0), this.htmlValues = {}, this.onChanged(), this.onStringChanged.fire(this, {})) }, Object.defineProperty(e.prototype, "text", { get: function () { return this.pureText }, set: function (e) { this.setLocaleText(this.locale, e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(e.prototype, "calculatedText", { get: function () { return this.renderedText = void 0 !== this.calculatedTextValue ? this.calculatedTextValue : this.calcText(), this.calculatedTextValue = void 0, this.renderedText }, enumerable: !1, configurable: !0 }), e.prototype.calcText = function () { var e = this.pureText; return e && this.owner && this.owner.getProcessedText && e.indexOf("{") > -1 && (e = this.owner.getProcessedText(e)), this.onGetTextCallback && (e = this.onGetTextCallback(e)), e }, Object.defineProperty(e.prototype, "pureText", { get: function () { var e = this.locale; e || (e = this.defaultLoc); var t = this.getValue(e); if (t || e !== this.defaultLoc || (t = this.getValue(s.defaultLocale)), !t) { var n = this.getRootDialect(e); n && (t = this.getValue(n)) } return t || e === this.defaultLoc || (t = this.getValue(this.defaultLoc)), !t && this.getLocalizationName() && (t = this.getLocalizationStr(), this.onGetLocalizationTextCallback && (t = this.onGetLocalizationTextCallback(t))), t || (t = ""), t }, enumerable: !1, configurable: !0 }), e.prototype.getRootDialect = function (e) { if (!e) return e; var t = e.indexOf("-"); return t > -1 ? e.substring(0, t) : "" }, e.prototype.getLocalizationName = function () { return this.sharedData ? this.sharedData.localizationName : this.localizationName }, e.prototype.getLocalizationStr = function () { var e = this.getLocalizationName(); return e ? s.getString(e, this.locale) : "" }, Object.defineProperty(e.prototype, "hasHtml", { get: function () { return this.hasHtmlValue() }, enumerable: !1, configurable: !0 }), Object.defineProperty(e.prototype, "html", { get: function () { return this.hasHtml ? this.getHtmlValue() : "" }, enumerable: !1, configurable: !0 }), Object.defineProperty(e.prototype, "isEmpty", { get: function () { return 0 == this.getValuesKeys().length }, enumerable: !1, configurable: !0 }), Object.defineProperty(e.prototype, "textOrHtml", { get: function () { return this.hasHtml ? this.getHtmlValue() : this.calculatedText }, enumerable: !1, configurable: !0 }), Object.defineProperty(e.prototype, "renderedHtml", { get: function () { return this.textOrHtml }, enumerable: !1, configurable: !0 }), e.prototype.getLocaleText = function (e) { e || (e = this.defaultLoc); var t = this.getValue(e); return t || "" }, e.prototype.getLocaleTextWithDefault = function (e) { var t = this.getLocaleText(e); return !t && this.onGetDefaultTextCallback ? this.onGetDefaultTextCallback() : t }, e.prototype.setLocaleText = function (e, t) { if (this.storeDefaultText || t != this.getLocaleTextWithDefault(e)) { if (o.storeDuplicatedTranslations || !t || !e || e == this.defaultLoc || this.getValue(e) || t != this.getLocaleText(this.defaultLoc)) { var n = this.locale; e || (e = this.defaultLoc), n || (n = this.defaultLoc); var r = this.onStrChanged && e === n ? this.pureText : void 0; delete this.htmlValues[e], t ? "string" == typeof t && (this.canRemoveLocValue(e, t) ? this.setLocaleText(e, null) : (this.setValue(e, t), e == this.defaultLoc && this.deleteValuesEqualsToDefault(t))) : this.getValue(e) && this.deleteValue(e), this.fireStrChanged(r, t) } } else { if (t || e && e !== this.defaultLoc) return; var i = s.defaultLocale, a = this.getValue(i); i && a && (this.setValue(i, t), this.fireStrChanged(a, t)) } }, e.prototype.canRemoveLocValue = function (e, t) { if (o.storeDuplicatedTranslations) return !1; if (e === this.defaultLoc) return !1; var n = this.getRootDialect(e); if (n) { var r = this.getLocaleText(n); return r ? r == t : this.canRemoveLocValue(n, t) } return t == this.getLocaleText(this.defaultLoc) }, e.prototype.fireStrChanged = function (e, t) { this.strChanged(), this.onStrChanged && e !== t && this.onStrChanged(e, t) }, e.prototype.hasNonDefaultText = function () { var e = this.getValuesKeys(); return 0 != e.length && (e.length > 1 || e[0] != this.defaultLoc) }, e.prototype.getLocales = function () { var e = this.getValuesKeys(); return 0 == e.length ? [] : e }, e.prototype.getJson = function () { if (this.sharedData) return this.sharedData.getJson(); var e = this.getValuesKeys(); return 0 == e.length ? null : 1 != e.length || e[0] != o.defaultLocaleName || o.serializeLocalizableStringAsObject ? this.values : this.values[e[0]] }, e.prototype.setJson = function (e) { if (this.sharedData) this.sharedData.setJson(e); else if (this.values = {}, this.htmlValues = {}, e) { if ("string" == typeof e) this.setLocaleText(null, e); else for (var t in e) this.setLocaleText(t, e[t]); this.strChanged() } }, Object.defineProperty(e.prototype, "renderAs", { get: function () { return this.owner && "function" == typeof this.owner.getRenderer && this.owner.getRenderer(this.name) || e.defaultRenderer }, enumerable: !1, configurable: !0 }), Object.defineProperty(e.prototype, "renderAsData", { get: function () { return this.owner && "function" == typeof this.owner.getRendererContext && this.owner.getRendererContext(this) || this }, enumerable: !1, configurable: !0 }), e.prototype.equals = function (e) { return this.sharedData ? this.sharedData.equals(e) : !(!e || !e.values) && r.isTwoValueEquals(this.values, e.values, !1, !0, !1) }, e.prototype.setFindText = function (e) { if (this.searchText != e) { if (this.searchText = e, !this.searchableText) { var t = this.textOrHtml; this.searchableText = t ? t.toLowerCase() : "" } var n = this.searchableText, o = n && e ? n.indexOf(e) : void 0; return o < 0 && (o = void 0), null == o && this.searchIndex == o || (this.searchIndex = o, this.onSearchChanged && this.onSearchChanged()), null != this.searchIndex } }, e.prototype.onChanged = function () { }, e.prototype.onCreating = function () { }, e.prototype.hasHtmlValue = function () { if (!this.owner || !this.useMarkdown) return !1; var e = this.locale; if (e || (e = this.defaultLoc), void 0 !== this.htmlValues[e]) return !!this.htmlValues[e]; var t = this.calculatedText; if (!t) return !1; if (this.getLocalizationName() && t === this.getLocalizationStr()) return !1; var n = this.owner.getMarkdownHtml(t, this.name); return this.htmlValues[e] = n, !!n }, e.prototype.getHtmlValue = function () { var e = this.locale; return e || (e = this.defaultLoc), this.htmlValues[e] }, e.prototype.deleteValuesEqualsToDefault = function (e) { for (var t = this.getValuesKeys(), n = 0; n < t.length; n++)t[n] != this.defaultLoc && this.getValue(t[n]) == e && this.deleteValue(t[n]) }, e.prototype.getValue = function (e) { return this.sharedData ? this.sharedData.getValue(e) : this.values[e] }, e.prototype.setValue = function (e, t) { this.sharedData ? this.sharedData.setValue(e, t) : this.values[e] = t }, e.prototype.deleteValue = function (e) { this.sharedData ? this.sharedData.deleteValue(e) : delete this.values[e] }, e.prototype.getValuesKeys = function () { return this.sharedData ? this.sharedData.getValuesKeys() : Object.keys(this.values) }, Object.defineProperty(e.prototype, "defaultLoc", { get: function () { return o.defaultLocaleName }, enumerable: !1, configurable: !0 }), e.SerializeAsObject = !1, e.defaultRenderer = "sv-string-viewer", e.editableRenderer = "sv-string-editor", e }(), c = function () { function e(e) { this.owner = e, this.values = {} } return e.prototype.getIsMultiple = function () { return !0 }, Object.defineProperty(e.prototype, "locale", { get: function () { return this.owner && this.owner.getLocale ? this.owner.getLocale() : "" }, enumerable: !1, configurable: !0 }), Object.defineProperty(e.prototype, "value", { get: function () { return this.getValue("") }, set: function (e) { this.setValue("", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(e.prototype, "text", { get: function () { return Array.isArray(this.value) ? this.value.join("\n") : "" }, set: function (e) { this.value = e ? e.split("\n") : [] }, enumerable: !1, configurable: !0 }), e.prototype.getLocaleText = function (e) { var t = this.getValueCore(e, !e || e === this.locale); return t && Array.isArray(t) && 0 != t.length ? t.join("\n") : "" }, e.prototype.setLocaleText = function (e, t) { var n = t ? t.split("\n") : null; this.setValue(e, n) }, e.prototype.getValue = function (e) { return this.getValueCore(e) }, e.prototype.getValueCore = function (e, t) { if (void 0 === t && (t = !0), e = this.getLocale(e), this.values[e]) return this.values[e]; if (t) { var n = o.defaultLocaleName; if (e !== n && this.values[n]) return this.values[n] } return [] }, e.prototype.setValue = function (e, t) { e = this.getLocale(e); var n = r.createCopy(this.values); t && 0 != t.length ? this.values[e] = t : delete this.values[e], this.onValueChanged && this.onValueChanged(n, this.values) }, e.prototype.hasValue = function (e) { return void 0 === e && (e = ""), !this.isEmpty && this.getValue(e).length > 0 }, Object.defineProperty(e.prototype, "isEmpty", { get: function () { return 0 == this.getValuesKeys().length }, enumerable: !1, configurable: !0 }), e.prototype.getLocale = function (e) { return e || ((e = this.locale) || o.defaultLocaleName) }, e.prototype.getLocales = function () { var e = this.getValuesKeys(); return 0 == e.length ? [] : e }, e.prototype.getJson = function () { var e = this.getValuesKeys(); return 0 == e.length ? null : 1 != e.length || e[0] != o.defaultLocaleName || o.serializeLocalizableStringAsObject ? r.createCopy(this.values) : this.values[e[0]] }, e.prototype.setJson = function (e) { if (this.values = {}, e) if (Array.isArray(e)) this.setValue(null, e); else for (var t in e) this.setValue(t, e[t]) }, e.prototype.getValuesKeys = function () { return Object.keys(this.values) }, e }(), p = (l = function (e, t) { return (l = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (e, t) { e.__proto__ = t } || function (e, t) { for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]) })(e, t) }, function (e, t) { if ("function" != typeof t && null !== t) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); function n() { this.constructor = e } l(e, t), e.prototype = null === t ? Object.create(t) : (n.prototype = t.prototype, new n) }), h = function (e, t) { for (var n = 0, o = t.length, r = e.length; n < o; n++, r++)e[r] = t[n]; return e }; function d(e, t, n) { var o = e.getLocalizableString(n); o || (o = e.createLocalizableString(n, e, !0), "object" == typeof t.localizable && "function" == typeof t.localizable.onGetTextCallback && (o.onGetTextCallback = t.localizable.onGetTextCallback)) } function f(e) { return function (t, n) { var o = function (e, t) { if (t && "object" == typeof t && t.type === ue.ComputedUpdaterType) { ce.startCollectDependencies((function () { return e[n] = t.updater() }), e, n); var o = t.updater(), r = ce.finishCollectDependencies(); return t.setDependencies(r), o } return t }; e && e.localizable ? (Object.defineProperty(t, n, { get: function () { return function (e, t, n) { d(e, t, n); var o = e.getLocalizableStringText(n); if (o) return o; if ("object" == typeof t.localizable && t.localizable.defaultStr) { var r = e.getLocale ? e.getLocale() : ""; return s.getString(t.localizable.defaultStr, r) } return "" }(this, e, n) }, set: function (t) { d(this, e, n); var r = o(this, t); this.setLocalizableStringText(n, r), e && e.onSet && e.onSet(r, this) } }), Object.defineProperty(t, "object" == typeof e.localizable && e.localizable.name ? e.localizable.name : "loc" + n.charAt(0).toUpperCase() + n.slice(1), { get: function () { return d(this, e, n), this.getLocalizableString(n) } })) : Object.defineProperty(t, n, { get: function () { var t = this.getPropertyValue(n); if (void 0 !== t) return t; if (e) { if ("function" == typeof e.getDefaultValue) return e.getDefaultValue(this); if (void 0 !== e.defaultValue) return e.defaultValue } }, set: function (t) { var r = o(this, t); this.setPropertyValue(n, r), e && e.onSet && e.onSet(r, this) } }) } } function g(e, t, n) { e.ensureArray(n, (function (n, o) { var r = t ? t.onPush : null; r && r(n, o, e) }), (function (n, o) { var r = t ? t.onRemove : null; r && r(n, o, e) })) } function y(e) { return function (t, n) { Object.defineProperty(t, n, { get: function () { return g(this, e, n), this.getPropertyValue(n) }, set: function (t) { g(this, e, n); var o = this.getPropertyValue(n); t !== o && (o ? o.splice.apply(o, h([0, o.length], t || [])) : this.setPropertyValue(n, t), e && e.onSet && e.onSet(t, this)) } }) } } var m = function () { function e(t, n, o) { void 0 === o && (o = !1), this.name = n, this.isRequiredValue = !1, this.isUniqueValue = !1, this.isSerializable = !0, this.isLightSerializable = !0, this.isCustom = !1, this.isDynamicChoices = !1, this.isBindable = !1, this.category = "", this.categoryIndex = -1, this.visibleIndex = -1, this.maxLength = -1, this.isArray = !1, this.classInfoValue = t, this.isRequiredValue = o, this.idValue = e.Index++ } return Object.defineProperty(e.prototype, "id", { get: function () { return this.idValue }, enumerable: !1, configurable: !0 }), Object.defineProperty(e.prototype, "classInfo", { get: function () { return this.classInfoValue }, enumerable: !1, configurable: !0 }), Object.defineProperty(e.prototype, "type", { get: function () { return this.typeValue ? this.typeValue : "string" }, set: function (e) { "itemvalues" === e && (e = "itemvalue[]"), "textitems" === e && (e = "textitem[]"), this.typeValue = e, this.typeValue.indexOf("[]") === this.typeValue.length - 2 && (this.isArray = !0, this.className = this.typeValue.substring(0, this.typeValue.length - 2)) }, enumerable: !1, configurable: !0 }), Object.defineProperty(e.prototype, "isRequired", { get: function () { return this.isRequiredValue }, set: function (e) { this.isRequiredValue = e }, enumerable: !1, configurable: !0 }), Object.defineProperty(e.prototype, "isUnique", { get: function () { return this.isUniqueValue }, set: function (e) { this.isUniqueValue = e }, enumerable: !1, configurable: !0 }), Object.defineProperty(e.prototype, "uniquePropertyName", { get: function () { return this.uniquePropertyValue }, set: function (e) { this.uniquePropertyValue = e }, enumerable: !1, configurable: !0 }), Object.defineProperty(e.prototype, "hasToUseGetValue", { get: function () { return this.onGetValue || this.serializationProperty }, enumerable: !1, configurable: !0 }), Object.defineProperty(e.prototype, "defaultValue", { get: function () { var t = this.defaultValueFunc ? this.defaultValueFunc() : this.defaultValueValue; return e.getItemValuesDefaultValue && S.metaData.isDescendantOf(this.className, "itemvalue") && (t = e.getItemValuesDefaultValue(this.defaultValueValue || [], this.className)), t }, set: function (e) { this.defaultValueValue = e }, enumerable: !1, configurable: !0 }), e.prototype.isDefaultValue = function (e) { return r.isValueEmpty(this.defaultValue) ? !1 === e && ("boolean" == this.type || "switch" == this.type) || "" === e || r.isValueEmpty(e) : r.isTwoValueEquals(e, this.defaultValue, !1, !0, !1) }, e.prototype.getValue = function (e) { return this.onGetValue ? this.onGetValue(e) : this.serializationProperty && e[this.serializationProperty] ? e[this.serializationProperty].getJson() : e[this.name] }, e.prototype.getPropertyValue = function (e) { return this.isLocalizable ? e[this.serializationProperty] ? e[this.serializationProperty].text : null : this.getValue(e) }, Object.defineProperty(e.prototype, "hasToUseSetValue", { get: function () { return this.onSetValue || this.serializationProperty }, enumerable: !1, configurable: !0 }), e.prototype.settingValue = function (e, t) { return !this.onSettingValue || e.isLoadingFromJson ? t : this.onSettingValue(e, t) }, e.prototype.setValue = function (e, t, n) { this.onSetValue ? this.onSetValue(e, t, n) : this.serializationProperty && e[this.serializationProperty] ? e[this.serializationProperty].setJson(t) : (t && "string" == typeof t && ("number" == this.type && (t = parseInt(t)), "boolean" != this.type && "switch" != this.type || (t = "true" === t.toLowerCase())), e[this.name] = t) }, e.prototype.getObjType = function (e) { return this.classNamePart ? e.replace(this.classNamePart, "") : e }, e.prototype.getClassName = function (e) { return e && (e = e.toLowerCase()), this.classNamePart && e.indexOf(this.classNamePart) < 0 ? e + this.classNamePart : e }, Object.defineProperty(e.prototype, "choices", { get: function () { return this.getChoices(null) }, enumerable: !1, configurable: !0 }), Object.defineProperty(e.prototype, "hasChoices", { get: function () { return !!this.choicesValue || !!this.choicesfunc }, enumerable: !1, configurable: !0 }), e.prototype.getChoices = function (e, t) { return void 0 === t && (t = null), null != this.choicesValue ? this.choicesValue : null != this.choicesfunc ? this.choicesfunc(e, t) : null }, e.prototype.setChoices = function (e, t) { void 0 === t && (t = null), this.choicesValue = e, this.choicesfunc = t }, e.prototype.getBaseValue = function () { return this.baseValue ? "function" == typeof this.baseValue ? this.baseValue() : this.baseValue : "" }, e.prototype.setBaseValue = function (e) { this.baseValue = e }, Object.defineProperty(e.prototype, "readOnly", { get: function () { return null != this.readOnlyValue && this.readOnlyValue }, set: function (e) { this.readOnlyValue = e }, enumerable: !1, configurable: !0 }), e.prototype.isVisible = function (e, t) { void 0 === t && (t = null); var n = !this.layout || this.layout == e; return !(!this.visible || !n) && (!this.visibleIf || !t || this.visibleIf(t)) }, Object.defineProperty(e.prototype, "visible", { get: function () { return null == this.visibleValue || this.visibleValue }, set: function (e) { this.visibleValue = e }, enumerable: !1, configurable: !0 }), Object.defineProperty(e.prototype, "isLocalizable", { get: function () { return null != this.isLocalizableValue && this.isLocalizableValue }, set: function (e) { this.isLocalizableValue = e }, enumerable: !1, configurable: !0 }), Object.defineProperty(e.prototype, "dataList", { get: function () { return Array.isArray(this.dataListValue) ? this.dataListValue : [] }, set: function (e) { this.dataListValue = e }, enumerable: !1, configurable: !0 }), e.prototype.mergeWith = function (t) { for (var n = e.mergableValues, o = 0; o < n.length; o++)this.mergeValue(t, n[o]) }, e.prototype.addDependedProperty = function (e) { this.dependedProperties || (this.dependedProperties = []), this.dependedProperties.indexOf(e) < 0 && this.dependedProperties.push(e) }, e.prototype.getDependedProperties = function () { return this.dependedProperties ? this.dependedProperties : [] }, e.prototype.schemaType = function () { return this.className || this.baseClassName ? "array" : "boolean" == this.type || "number" == this.type ? this.type : "string" }, e.prototype.mergeValue = function (e, t) { null == this[t] && null != e[t] && (this[t] = e[t]) }, e.Index = 1, e.mergableValues = ["typeValue", "choicesValue", "baseValue", "readOnlyValue", "visibleValue", "isSerializable", "isLightSerializable", "isCustom", "isBindable", "isUnique", "uniquePropertyName", "isDynamicChoices", "isLocalizableValue", "className", "alternativeName", "layout", "classNamePart", "baseClassName", "defaultValue", "defaultValueFunc", "serializationProperty", "onGetValue", "onSetValue", "onSettingValue", "displayName", "category", "categoryIndex", "visibleIndex", "nextToProperty", "showMode", "dependedProperties", "visibleIf", "onExecuteExpression", "onPropertyEditorUpdate", "maxLength", "maxValue", "minValue", "dataListValue"], e }(), v = function () { function e() { } return e.addProperty = function (t, n) { t = t.toLowerCase(); var o = e.properties; o[t] || (o[t] = []), o[t].push(n) }, e.removeProperty = function (t, n) { t = t.toLowerCase(); var o = e.properties; if (o[t]) for (var r = o[t], i = 0; i < r.length; i++)if (r[i].name == n) { o[t].splice(i, 1); break } }, e.removeAllProperties = function (t) { t = t.toLowerCase(), delete e.properties[t] }, e.addClass = function (t, n) { t = t.toLowerCase(), n && (n = n.toLowerCase()), e.parentClasses[t] = n }, e.getProperties = function (t) { t = t.toLowerCase(); for (var n = [], o = e.properties; t;) { var r = o[t]; if (r) for (var i = 0; i < r.length; i++)n.push(r[i]); t = e.parentClasses[t] } return n }, e.createProperties = function (t) { t && t.getType && e.createPropertiesCore(t, t.getType()) }, e.createPropertiesCore = function (t, n) { var o = e.properties; o[n] && e.createPropertiesInObj(t, o[n]); var r = e.parentClasses[n]; r && e.createPropertiesCore(t, r) }, e.createPropertiesInObj = function (t, n) { for (var o = 0; o < n.length; o++)e.createPropertyInObj(t, n[o]) }, e.createPropertyInObj = function (t, n) { if (!(e.checkIsPropertyExists(t, n.name) || n.serializationProperty && e.checkIsPropertyExists(t, n.serializationProperty))) { if (n.isLocalizable && n.serializationProperty && t.createCustomLocalizableObj) { t.createCustomLocalizableObj(n.name); var o = { get: function () { return t.getLocalizableString(n.name) } }; Object.defineProperty(t, n.serializationProperty, o); var r = { get: function () { return t.getLocalizableStringText(n.name, n.defaultValue) }, set: function (e) { t.setLocalizableStringText(n.name, e) } }; Object.defineProperty(t, n.name, r) } else { var i = n.defaultValue, s = n.isArray || "multiplevalues" === n.type; if ("function" == typeof t.createNewArray && (S.metaData.isDescendantOf(n.className, "itemvalue") ? (t.createNewArray(n.name, (function (e) { e.locOwner = t, e.ownerPropertyName = n.name })), s = !0) : s && t.createNewArray(n.name), s && (Array.isArray(i) && t.setPropertyValue(n.name, i), i = null)), t.getPropertyValue && t.setPropertyValue) { r = { get: function () { return n.onGetValue ? n.onGetValue(t) : t.getPropertyValue(n.name, i) }, set: function (e) { n.onSetValue ? n.onSetValue(t, e, null) : t.setPropertyValue(n.name, e) } }; Object.defineProperty(t, n.name, r) } } "condition" !== n.type && "expression" !== n.type || n.onExecuteExpression && t.addExpressionProperty(n.name, n.onExecuteExpression) } }, e.checkIsPropertyExists = function (e, t) { return e.hasOwnProperty(t) || e[t] }, e.properties = {}, e.parentClasses = {}, e }(), b = function () { function e(e, t, n, o) { void 0 === n && (n = null), void 0 === o && (o = null), this.name = e, this.creator = n, this.parentName = o, e = e.toLowerCase(), this.isCustomValue = !n && "survey" !== e, this.parentName && (this.parentName = this.parentName.toLowerCase(), v.addClass(e, this.parentName), n && this.makeParentRegularClass()), this.properties = new Array; for (var r = 0; r < t.length; r++)this.createProperty(t[r], this.isCustom) } return e.prototype.find = function (e) { for (var t = 0; t < this.properties.length; t++)if (this.properties[t].name == e) return this.properties[t]; return null }, e.prototype.findProperty = function (e) { return this.fillAllProperties(), this.hashProperties[e] }, e.prototype.getAllProperties = function () { return this.fillAllProperties(), this.allProperties }, e.prototype.resetAllProperties = function () { this.allProperties = void 0, this.hashProperties = void 0; for (var e = _.getChildrenClasses(this.name), t = 0; t < e.length; t++)e[t].resetAllProperties() }, Object.defineProperty(e.prototype, "isCustom", { get: function () { return this.isCustomValue }, enumerable: !1, configurable: !0 }), e.prototype.fillAllProperties = function () { var e = this; if (!this.allProperties) { this.allProperties = [], this.hashProperties = {}; var t = {}; this.properties.forEach((function (e) { return t[e.name] = e })); var n = this.parentName ? _.findClass(this.parentName) : null; if (n) n.getAllProperties().forEach((function (n) { var o = t[n.name]; o ? (o.mergeWith(n), e.addPropCore(o)) : e.addPropCore(n) })); this.properties.forEach((function (t) { e.hashProperties[t.name] || e.addPropCore(t) })) } }, e.prototype.addPropCore = function (e) { this.allProperties.push(e), this.hashProperties[e.name] = e, e.alternativeName && (this.hashProperties[e.alternativeName] = e) }, e.prototype.isOverridedProp = function (e) { return !!this.parentName && !!_.findProperty(this.parentName, e) }, e.prototype.hasRegularChildClass = function () { if (this.isCustom) { this.isCustomValue = !1; for (var e = 0; e < this.properties.length; e++)this.properties[e].isCustom = !1; v.removeAllProperties(this.name), this.makeParentRegularClass() } }, e.prototype.makeParentRegularClass = function () { if (this.parentName) { var e = _.findClass(this.parentName); e && e.hasRegularChildClass() } }, e.prototype.createProperty = function (t, n) { void 0 === n && (n = !1); var o = "string" == typeof t ? t : t.name; if (o) { var i = null, s = o.indexOf(e.typeSymbol); s > -1 && (i = o.substring(s + 1), o = o.substring(0, s)); var a = this.getIsPropertyNameRequired(o) || !!t.isRequired; o = this.getPropertyName(o); var l = new m(this, o, a); if (i && (l.type = i), "object" == typeof t) { if (t.type && (l.type = t.type), void 0 !== t.default && (l.defaultValue = t.default), void 0 !== t.defaultFunc && (l.defaultValueFunc = t.defaultFunc), r.isValueEmpty(t.isSerializable) || (l.isSerializable = t.isSerializable), r.isValueEmpty(t.isLightSerializable) || (l.isLightSerializable = t.isLightSerializable), r.isValueEmpty(t.maxLength) || (l.maxLength = t.maxLength), r.isValueEmpty(t.displayName) || (l.displayName = t.displayName), r.isValueEmpty(t.category) || (l.category = t.category), r.isValueEmpty(t.categoryIndex) || (l.categoryIndex = t.categoryIndex), r.isValueEmpty(t.nextToProperty) || (l.nextToProperty = t.nextToProperty), r.isValueEmpty(t.visibleIndex) || (l.visibleIndex = t.visibleIndex), r.isValueEmpty(t.showMode) || (l.showMode = t.showMode), r.isValueEmpty(t.maxValue) || (l.maxValue = t.maxValue), r.isValueEmpty(t.minValue) || (l.minValue = t.minValue), r.isValueEmpty(t.dataList) || (l.dataList = t.dataList), r.isValueEmpty(t.isDynamicChoices) || (l.isDynamicChoices = t.isDynamicChoices), r.isValueEmpty(t.isBindable) || (l.isBindable = t.isBindable), r.isValueEmpty(t.isUnique) || (l.isUnique = t.isUnique), r.isValueEmpty(t.uniqueProperty) || (l.uniquePropertyName = t.uniqueProperty), r.isValueEmpty(t.isArray) || (l.isArray = t.isArray), !0 !== t.visible && !1 !== t.visible || (l.visible = t.visible), t.visibleIf && (l.visibleIf = t.visibleIf), t.onExecuteExpression && (l.onExecuteExpression = t.onExecuteExpression), t.onPropertyEditorUpdate && (l.onPropertyEditorUpdate = t.onPropertyEditorUpdate), !0 === t.readOnly && (l.readOnly = !0), t.choices) { var u = "function" == typeof t.choices ? t.choices : null, c = "function" != typeof t.choices ? t.choices : null; l.setChoices(c, u) } if (t.baseValue && l.setBaseValue(t.baseValue), t.onGetValue && (l.onGetValue = t.onGetValue), t.onSetValue && (l.onSetValue = t.onSetValue), t.onSettingValue && (l.onSettingValue = t.onSettingValue), t.isLocalizable && (t.serializationProperty = "loc" + l.name), t.serializationProperty) l.serializationProperty = t.serializationProperty, l.serializationProperty && 0 == l.serializationProperty.indexOf("loc") && (l.isLocalizable = !0); t.isLocalizable && (l.isLocalizable = t.isLocalizable), t.className && (l.className = t.className), t.baseClassName && (l.baseClassName = t.baseClassName), t.classNamePart && (l.classNamePart = t.classNamePart), t.alternativeName && (l.alternativeName = t.alternativeName), t.layout && (l.layout = t.layout), t.dependsOn && this.addDependsOnProperties(l, t.dependsOn) } return this.properties.push(l), n && !this.isOverridedProp(l.name) && (l.isCustom = !0, v.addProperty(this.name, l)), l } }, e.prototype.addDependsOnProperties = function (e, t) { if (Array.isArray(t)) for (var n = 0; n < t.length; n++)this.addDependsOnProperty(e, t[n]); else this.addDependsOnProperty(e, t) }, e.prototype.addDependsOnProperty = function (e, t) { var n = this.find(t); n || (n = _.findProperty(this.parentName, t)), n && n.addDependedProperty(e.name) }, e.prototype.getIsPropertyNameRequired = function (t) { return t.length > 0 && t[0] == e.requiredSymbol }, e.prototype.getPropertyName = function (e) { return this.getIsPropertyNameRequired(e) ? e = e.slice(1) : e }, e.requiredSymbol = "!", e.typeSymbol = ":", e }(), C = function () { function e() { this.classes = {}, this.alternativeNames = {}, this.childrenClasses = {} } return e.prototype.getObjPropertyValue = function (e, t) { if (this.isObjWrapper(e)) { var n = e.getOriginalObj(); if (o = _.findProperty(n.getType(), t)) return this.getObjPropertyValueCore(n, o) } var o; return (o = _.findProperty(e.getType(), t)) ? this.getObjPropertyValueCore(e, o) : e[t] }, e.prototype.setObjPropertyValue = function (e, t, n) { if (e[t] !== n) if (e[t] && e[t].setJson) e[t].setJson(n); else { if (Array.isArray(n)) { for (var o = [], r = 0; r < n.length; r++)o.push(n[r]); n = o } e[t] = n } }, e.prototype.getObjPropertyValueCore = function (e, t) { if (!t.isSerializable) return e[t.name]; if (t.isLocalizable) { if (t.isArray) return e[t.name]; if (t.serializationProperty) return e[t.serializationProperty].text } return e.getPropertyValue(t.name) }, e.prototype.isObjWrapper = function (e) { return !!e.getOriginalObj && !!e.getOriginalObj() }, e.prototype.addClass = function (e, t, n, o) { void 0 === n && (n = null), void 0 === o && (o = null), e = e.toLowerCase(); var r = new b(e, t, n, o); (this.classes[e] = r, o) && (o = o.toLowerCase(), this.childrenClasses[o] || (this.childrenClasses[o] = []), this.childrenClasses[o].push(r)); return r }, e.prototype.removeClass = function (e) { var t = this.findClass(e); if (t && (delete this.classes[t.name], t.parentName)) { var n = this.childrenClasses[t.parentName].indexOf(t); n > -1 && this.childrenClasses[t.parentName].splice(n, 1) } }, e.prototype.overrideClassCreatore = function (e, t) { this.overrideClassCreator(e, t) }, e.prototype.overrideClassCreator = function (e, t) { e = e.toLowerCase(); var n = this.findClass(e); n && (n.creator = t) }, e.prototype.getProperties = function (e) { var t = this.findClass(e); return t ? t.getAllProperties() : [] }, e.prototype.getPropertiesByObj = function (e) { if (!e || !e.getType) return []; for (var t = {}, n = this.getProperties(e.getType()), o = 0; o < n.length; o++)t[n[o].name] = n[o]; var r = e.getDynamicType ? this.getProperties(e.getDynamicType()) : null; if (r && r.length > 0) for (o = 0; o < r.length; o++) { var i = r[o]; t[i.name] || (t[i.name] = i) } return Object.keys(t).map((function (e) { return t[e] })) }, e.prototype.getDynamicPropertiesByObj = function (e, t) { if (void 0 === t && (t = null), !e || !e.getType || !e.getDynamicType && !t) return []; var n = t || e.getDynamicType(); if (!n) return []; var o = this.getProperties(n); if (!o || 0 == o.length) return []; for (var r = {}, i = this.getProperties(e.getType()), s = 0; s < i.length; s++)r[i[s].name] = i[s]; var a = []; for (s = 0; s < o.length; s++) { var l = o[s]; r[l.name] || a.push(l) } return a }, e.prototype.hasOriginalProperty = function (e, t) { return !!this.getOriginalProperty(e, t) }, e.prototype.getOriginalProperty = function (e, t) { var n = this.findProperty(e.getType(), t); return n || (this.isObjWrapper(e) ? this.findProperty(e.getOriginalObj().getType(), t) : null) }, e.prototype.getProperty = function (e, t) { var n = this.findProperty(e, t); if (!n) return n; var o = this.findClass(e); if (n.classInfo === o) return n; var r = new m(o, n.name, n.isRequired); return r.mergeWith(n), r.isArray = n.isArray, o.properties.push(r), o.resetAllProperties(), r }, e.prototype.findProperty = function (e, t) { var n = this.findClass(e); return n ? n.findProperty(t) : null }, e.prototype.findProperties = function (e, t) { var n = new Array, o = this.findClass(e); if (!o) return n; for (var r = 0; r < t.length; r++) { var i = o.findProperty(t[r]); i && n.push(i) } return n }, e.prototype.getAllPropertiesByName = function (e) { for (var t = new Array, n = this.getAllClasses(), o = 0; o < n.length; o++)for (var r = this.findClass(n[o]), i = 0; i < r.properties.length; i++)if (r.properties[i].name == e) { t.push(r.properties[i]); break } return t }, e.prototype.getAllClasses = function () { var e = new Array; for (var t in this.classes) e.push(t); return e }, e.prototype.createClass = function (e, t) { void 0 === t && (t = void 0), e = e.toLowerCase(); var n = this.findClass(e); if (!n) return null; if (n.creator) return n.creator(t); for (var o = n.parentName; o;) { if (!(n = this.findClass(o))) return null; if (o = n.parentName, n.creator) return this.createCustomType(e, n.creator, t) } return null }, e.prototype.createCustomType = function (e, t, n) { void 0 === n && (n = void 0), e = e.toLowerCase(); var o = t(n), r = e, i = o.getTemplate ? o.getTemplate() : o.getType(); return o.getType = function () { return r }, o.getTemplate = function () { return i }, v.createProperties(o), o }, e.prototype.getChildrenClasses = function (e, t) { void 0 === t && (t = !1), e = e.toLowerCase(); var n = []; return this.fillChildrenClasses(e, t, n), n }, e.prototype.getRequiredProperties = function (e) { for (var t = this.getProperties(e), n = [], o = 0; o < t.length; o++)t[o].isRequired && n.push(t[o].name); return n }, e.prototype.addProperties = function (e, t) { e = e.toLowerCase(); for (var n = this.findClass(e), o = 0; o < t.length; o++)this.addCustomPropertyCore(n, t[o]) }, e.prototype.addProperty = function (e, t) { return this.addCustomPropertyCore(this.findClass(e), t) }, e.prototype.addCustomPropertyCore = function (e, t) { if (!e) return null; var n = e.createProperty(t, !0); return n && e.resetAllProperties(), n }, e.prototype.removeProperty = function (e, t) { var n = this.findClass(e); if (!n) return !1; var o = n.find(t); o && (this.removePropertyFromClass(n, o), n.resetAllProperties(), v.removeProperty(n.name, t)) }, e.prototype.removePropertyFromClass = function (e, t) { var n = e.properties.indexOf(t); n < 0 || e.properties.splice(n, 1) }, e.prototype.fillChildrenClasses = function (e, t, n) { var o = this.childrenClasses[e]; if (o) for (var r = 0; r < o.length; r++)t && !o[r].creator || n.push(o[r]), this.fillChildrenClasses(o[r].name, t, n) }, e.prototype.findClass = function (e) { e = e.toLowerCase(); var t = this.classes[e]; if (!t) { var n = this.alternativeNames[e]; if (n && n != e) return this.findClass(n) } return t }, e.prototype.isDescendantOf = function (e, t) { if (!e || !t) return !1; e = e.toLowerCase(), t = t.toLowerCase(); var n = this.findClass(e); if (!n) return !1; var o = n; do { if (o.name === t) return !0; o = this.classes[o.parentName] } while (o); return !1 }, e.prototype.addAlterNativeClassName = function (e, t) { this.alternativeNames[t.toLowerCase()] = e.toLowerCase() }, e.prototype.generateSchema = function (e) { void 0 === e && (e = void 0), e || (e = "survey"); var t = this.findClass(e); if (!t) return null; var n = { $schema: "http://json-schema.org/draft-07/schema#", title: "SurveyJS Library json schema", type: "object", properties: {}, definitions: {} }; return this.generateSchemaProperties(t, n.properties, n.definitions), n }, e.prototype.generateSchemaProperties = function (e, t, n) { if (e) for (var o = 0; o < e.properties.length; o++) { var r = e.properties[o]; t[r.name] = this.generateSchemaProperty(r, n) } }, e.prototype.generateSchemaProperty = function (e, t) { var n = { type: e.schemaType() }; if (e.hasChoices && (n.enum = e.getChoices(null)), e.className && (n.items = { $ref: "#" + e.className }, this.generateChemaClass(e.className, t)), e.baseClassName) { var o = this.getChildrenClasses(e.baseClassName, !0); "question" == e.baseClassName && o.push(this.findClass("panel")), n.items = []; for (var r = 0; r < o.length; r++) { var i = o[r].name; n.items.push({ $ref: "#" + i }), this.generateChemaClass(i, t) } } return n }, e.prototype.generateChemaClass = function (e, t) { if (!t[e]) { var n = this.findClass(e); if (n) { var o = !!n.parentName && "base" != n.parentName; o && this.generateChemaClass(n.parentName, t); var r = { type: "object", $id: "#" + e }; t[e] = r; var i = {}; this.generateSchemaProperties(n, i, t), o ? r.allOff = [{ $ref: "#" + n.parentName }, { properties: i }] : r.properties = i } } }, e.prototype.fillProperties = function (e, t, n) { var o = this.findClass(e); if (o) { o.parentName && this.fillProperties(o.parentName, t, n); for (var r = 0; r < o.properties.length; r++) { var i = o.properties[r]; this.addPropertyCore(i, t, n), n[i.name] = i, i.alternativeName && (n[i.alternativeName] = i) } } }, e.prototype.addPropertyCore = function (e, t, n) { if (n[e.name]) { for (var o = -1, r = 0; r < t.length; r++)if (t[r].name == e.name || t[r].alternativeName == e.name) { o = r; break } e.mergeWith(t[o]), t[o] = e } else t.push(e) }, e }(), P = function () { function e(e, t) { this.type = e, this.message = t, this.description = "", this.at = -1 } return e.prototype.getFullDescription = function () { return this.message + (this.description ? "\n" + this.description : "") }, e }(), w = function (e) { function t(t, n) { var o = e.call(this, "unknownproperty", "The property '" + t + "' in class '" + n + "' is unknown.") || this; o.propertyName = t, o.className = n; var r = S.metaData.getProperties(n); if (r) { o.description = "The list of available properties are: "; for (var i = 0; i < r.length; i++)i > 0 && (o.description += ", "), o.description += r[i].name; o.description += "." } return o } return p(t, e), t }(P), V = function (e) { function t(t, n, o) { var r = e.call(this, n, o) || this; r.baseClassName = t, r.type = n, r.message = o, r.description = "The following types are available: "; for (var i = S.metaData.getChildrenClasses(t, !0), s = 0; s < i.length; s++)s > 0 && (r.description += ", "), r.description += "'" + i[s].name + "'"; return r.description += ".", r } return p(t, e), t }(P), x = function (e) { function t(t, n) { var o = e.call(this, n, "missingtypeproperty", "The property type is missing in the object. Please take a look at property: '" + t + "'.") || this; return o.propertyName = t, o.baseClassName = n, o } return p(t, e), t }(V), O = function (e) { function t(t, n) { var o = e.call(this, n, "incorrecttypeproperty", "The property type is incorrect in the object. Please take a look at property: '" + t + "'.") || this; return o.propertyName = t, o.baseClassName = n, o } return p(t, e), t }(V), T = function (e) { function t(t, n) { var o = e.call(this, "requiredproperty", "The property '" + t + "' is required in class '" + n + "'.") || this; return o.propertyName = t, o.className = n, o } return p(t, e), t }(P), S = function () { function e() { this.errors = new Array, this.lightSerializing = !1 } return Object.defineProperty(e, "metaData", { get: function () { return e.metaDataValue }, enumerable: !1, configurable: !0 }), e.prototype.toJsonObject = function (e, t) { return void 0 === t && (t = !1), this.toJsonObjectCore(e, null, t) }, e.prototype.toObject = function (e, t) { this.toObjectCore(e, t); var n = this.getRequiredError(t, e); n && this.addNewError(n, e) }, e.prototype.toObjectCore = function (t, n) { if (t) { var o = null, r = void 0, i = !0; if (n.getType && (r = n.getType(), o = e.metaData.getProperties(r), i = !!r && !e.metaData.isDescendantOf(r, "itemvalue")), o) { for (var s in n.startLoadingFromJson && n.startLoadingFromJson(t), o = this.addDynamicProperties(n, t, o), t) if (s !== e.typePropertyName) if (s !== e.positionPropertyName) { var a = this.findProperty(o, s); a ? this.valueToObj(t[s], n, a) : i && this.addNewError(new w(s.toString(), r), t) } else n[s] = t[s]; n.endLoadingFromJson && n.endLoadingFromJson() } } }, e.prototype.toJsonObjectCore = function (t, n, o) { if (void 0 === o && (o = !1), !t || !t.getType) return t; if ("function" == typeof t.getData) return t.getData(); var r = {}; return null == n || n.className || (r[e.typePropertyName] = n.getObjType(t.getType())), this.propertiesToJson(t, e.metaData.getProperties(t.getType()), r, o), this.propertiesToJson(t, this.getDynamicProperties(t), r, o), r }, e.prototype.getDynamicProperties = function (e) { return _.getDynamicPropertiesByObj(e) }, e.prototype.addDynamicProperties = function (e, t, n) { if (!e.getDynamicPropertyName) return n; var o = e.getDynamicPropertyName(); if (!o) return n; t[o] && (e[o] = t[o]); for (var r = this.getDynamicProperties(e), i = [], s = 0; s < n.length; s++)i.push(n[s]); for (s = 0; s < r.length; s++)i.push(r[s]); return i }, e.prototype.propertiesToJson = function (e, t, n, o) { void 0 === o && (o = !1); for (var r = 0; r < t.length; r++)this.valueToJson(e, n, t[r], o) }, e.prototype.valueToJson = function (e, t, n, o) { if (void 0 === o && (o = !1), !(!1 === n.isSerializable || !1 === n.isLightSerializable && this.lightSerializing)) { var r = n.getValue(e); if (o || !n.isDefaultValue(r)) { if (this.isValueArray(r)) { for (var i = [], s = 0; s < r.length; s++)i.push(this.toJsonObjectCore(r[s], n, o)); r = i.length > 0 ? i : null } else r = this.toJsonObjectCore(r, n, o); var a = "function" == typeof e.getPropertyValue && null !== e.getPropertyValue(n.name, null); (o && a || !n.isDefaultValue(r)) && (_.onSerializingProperty && _.onSerializingProperty(e, n, r, t) || (t[n.name] = r)) } } }, e.prototype.valueToObj = function (e, t, n) { if (null != e) if (this.removePos(n, e), null != n && n.hasToUseSetValue) n.setValue(t, e, this); else if (this.isValueArray(e)) this.valueToArray(e, t, n.name, n); else { var o = this.createNewObj(e, n); o.newObj && (this.toObjectCore(e, o.newObj), e = o.newObj), o.error || (null != n ? n.setValue(t, e, this) : t[n.name] = e) } }, e.prototype.removePos = function (e, t) { !e || !e.type || e.type.indexOf("value") < 0 || this.removePosFromObj(t) }, e.prototype.removePosFromObj = function (t) { if (t) { if (Array.isArray(t)) for (var n = 0; n < t.length; n++)this.removePosFromObj(t[n]); t[e.positionPropertyName] && delete t[e.positionPropertyName] } }, e.prototype.isValueArray = function (e) { return e && Array.isArray(e) }, e.prototype.createNewObj = function (t, n) { var o = { newObj: null, error: null }, r = t[e.typePropertyName]; return !r && null != n && n.className && (r = n.className), r = n.getClassName(r), o.newObj = r ? e.metaData.createClass(r, t) : null, o.error = this.checkNewObjectOnErrors(o.newObj, t, n, r), o }, e.prototype.checkNewObjectOnErrors = function (e, t, n, o) { var r = null; return e ? r = this.getRequiredError(e, t) : n.baseClassName && (r = o ? new O(n.name, n.baseClassName) : new x(n.name, n.baseClassName)), r && this.addNewError(r, t), r }, e.prototype.getRequiredError = function (t, n) { if (!t.getType || "function" == typeof t.getData) return null; var o = t.getType(), i = e.metaData.getRequiredProperties(o); if (!Array.isArray(i)) return null; for (var s = 0; s < i.length; s++) { var a = _.findProperty(o, i[s]); if (a && r.isValueEmpty(a.defaultValue) && !n[a.name]) return new T(a.name, o) } return null }, e.prototype.addNewError = function (t, n) { n && n[e.positionPropertyName] && (t.at = n[e.positionPropertyName].start), this.errors.push(t) }, e.prototype.valueToArray = function (e, t, n, o) { if (!t[n] || this.isValueArray(t[n])) { t[n] && e.length > 0 && t[n].splice(0, t[n].length); var r = t[n] ? t[n] : []; this.addValuesIntoArray(e, r, o), t[n] || (t[n] = r) } }, e.prototype.addValuesIntoArray = function (e, t, n) { for (var o = 0; o < e.length; o++) { var r = this.createNewObj(e[o], n); r.newObj ? (e[o].name && (r.newObj.name = e[o].name), t.push(r.newObj), this.toObjectCore(e[o], r.newObj)) : r.error || t.push(e[o]) } }, e.prototype.findProperty = function (e, t) { if (!e) return null; for (var n = 0; n < e.length; n++) { var o = e[n]; if (o.name == t || o.alternativeName == t) return o } return null }, e.typePropertyName = "type", e.positionPropertyName = "pos", e.metaDataValue = new C, e }(), _ = S.metaData, I = function () { function e() { this.values = null, this.properties = null } return e.prototype.getFirstName = function (e, t) { if (void 0 === t && (t = null), !e) return e; var n = ""; if (t && (n = this.getFirstPropertyName(e, t))) return n; for (var o = 0; o < e.length; o++) { var r = e[o]; if ("." == r || "[" == r) break; n += r } return n }, e.prototype.hasValue = function (e, t) { return void 0 === t && (t = null), t || (t = this.values), this.getValueCore(e, t).hasValue }, e.prototype.getValue = function (e, t) { return void 0 === t && (t = null), t || (t = this.values), this.getValueCore(e, t).value }, e.prototype.setValue = function (e, t, n) { if (t) { var o = this.getNonNestedObject(e, t, !0); o && (e = o.value, t = o.text, e && t && (e[t] = n)) } }, e.prototype.getValueInfo = function (e) { if (e.path) return e.value = this.getValueFromPath(e.path, this.values), e.hasValue = null !== e.value && !r.isValueEmpty(e.value), void (!e.hasValue && e.path.length > 1 && "length" == e.path[e.path.length - 1] && (e.hasValue = !0, e.value = 0)); var t = this.getValueCore(e.name, this.values); e.value = t.value, e.hasValue = t.hasValue, e.path = t.hasValue ? t.path : null }, e.prototype.getValueFromPath = function (e, t) { if (2 === e.length && "@survey" === e[0]) return this.getValueFromSurvey(e[1]); for (var n = 0; t && n < e.length;) { var o = e[n]; if (r.isNumber(o) && Array.isArray(t) && o >= t.length) return null; t = t[o], n++ } return t }, e.prototype.getValueCore = function (e, t) { var n = this.getQuestionDirectly(e); if (n) return { hasValue: !0, value: n.value, path: [e] }; var o = this.getValueFromValues(e, t); if (e && !o.hasValue) { var r = this.getValueFromSurvey(e); void 0 !== r && (o.hasValue = !0, o.value = r, o.path = ["@survey", e]) } return o }, e.prototype.getQuestionDirectly = function (e) { if (this.properties && this.properties.survey) return this.properties.survey.getQuestionByValueName(e) }, e.prototype.getValueFromSurvey = function (e) { if (this.properties && this.properties.survey) return this.properties.survey.getBuiltInVariableValue(e.toLocaleLowerCase()) }, e.prototype.getValueFromValues = function (e, t) { var n = { hasValue: !1, value: null, path: null }, o = t; if (!o && 0 !== o && !1 !== o) return n; e && e.lastIndexOf(".length") > -1 && e.lastIndexOf(".length") === e.length - ".length".length && (n.value = 0, n.hasValue = !0); var i = this.getNonNestedObject(o, e, !1); return i ? (n.path = i.path, n.value = i.text ? this.getObjectValue(i.value, i.text) : i.value, n.hasValue = !r.isValueEmpty(n.value), n) : n }, e.prototype.getNonNestedObject = function (e, t, n) { for (var o = this.getFirstPropertyName(t, e, n), i = o ? [o] : null; t != o && e;) { if ("[" == t[0]) { var s = this.getObjInArray(e, t); if (!s) return null; e = s.value, t = s.text, i.push(s.index) } else { if (!o && t == this.getFirstName(t)) return { value: e, text: t, path: i }; if (e = this.getObjectValue(e, o), r.isValueEmpty(e) && !n) return null; t = t.substring(o.length) } t && "." == t[0] && (t = t.substring(1)), (o = this.getFirstPropertyName(t, e, n)) && i.push(o) } return { value: e, text: t, path: i } }, e.prototype.getObjInArray = function (e, t) { if (!Array.isArray(e)) return null; for (var n = 1, o = ""; n < t.length && "]" != t[n];)o += t[n], n++; return t = n < t.length ? t.substring(n + 1) : "", (n = this.getIntValue(o)) < 0 || n >= e.length ? null : { value: e[n], text: t, index: n } }, e.prototype.getFirstPropertyName = function (e, t, n) { if (void 0 === n && (n = !1), !e) return e; if (t || (t = {}), t.hasOwnProperty(e)) return e; var o = e.toLowerCase(), r = o[0], i = r.toUpperCase(); for (var s in t) { var a = s[0]; if (a === i || a === r) { var l = s.toLowerCase(); if (l == o) return s; if (o.length <= l.length) continue; var u = o[l.length]; if ("." != u && "[" != u) continue; if (l == o.substring(0, l.length)) return s } } if (n && "[" !== e[0]) { var c = e.indexOf("."); return c > -1 && (t[e = e.substring(0, c)] = {}), e } return "" }, e.prototype.getObjectValue = function (e, t) { return t ? e[t] : null }, e.prototype.getIntValue = function (e) { return "0" == e || (0 | e) > 0 && e % 1 == 0 ? Number(e) : -1 }, e }(), R = function () { function e() { this.functionHash = {}, this.isAsyncHash = {} } return e.prototype.register = function (e, t, n) { void 0 === n && (n = !1), this.functionHash[e] = t, n && (this.isAsyncHash[e] = !0) }, e.prototype.unregister = function (e) { delete this.functionHash[e], delete this.isAsyncHash[e] }, e.prototype.hasFunction = function (e) { return !!this.functionHash[e] }, e.prototype.isAsyncFunction = function (e) { return !!this.isAsyncHash[e] }, e.prototype.clear = function () { this.functionHash = {} }, e.prototype.getAll = function () { var e = []; for (var t in this.functionHash) e.push(t); return e.sort() }, e.prototype.run = function (e, t, n) { void 0 === n && (n = null); var o = this.functionHash[e]; if (!o) return null; var r = { func: o }; if (n) for (var i in n) r[i] = n[i]; return r.func(t) }, e.Instance = new e, e }(), E = R.Instance.register; function D(e, t) { if (null != e) if (Array.isArray(e)) for (var n = 0; n < e.length; n++)D(e[n], t); else r.isNumber(e) && (e = r.getNumber(e)), t.push(e) } function A(e) { var t = []; D(e, t); for (var n = 0, o = 0; o < t.length; o++)n = r.correctAfterPlusMinis(n, t[o], n + t[o]); return n } function L(e, t) { var n = []; D(e, n); for (var o = void 0, r = 0; r < n.length; r++)void 0 === o && (o = n[r]), t ? o > n[r] && (o = n[r]) : o < n[r] && (o = n[r]); return o } function j(e, t, n, o, i) { return !e || r.isValueEmpty(e[t]) ? n : o(n, i ? function (e) { return "string" == typeof e ? r.isNumber(e) ? r.getNumber(e) : void 0 : e }(e[t]) : 1) } function N(e, t, n) { void 0 === n && (n = !0); var o = function (e) { if (2 != e.length) return null; var t = e[0]; if (!t) return null; if (!Array.isArray(t) && !Array.isArray(Object.keys(t))) return null; var n = e[1]; return "string" == typeof n || n instanceof String ? { data: t, name: n } : null }(e); if (o) { var r = void 0; if (Array.isArray(o.data)) for (var i = 0; i < o.data.length; i++)r = j(o.data[i], o.name, r, t, n); else for (var s in o.data) r = j(o.data[s], o.name, r, t, n); return r } } function M(e) { var t = N(e, (function (e, t) { return null == e && (e = 0), null == t || null == t ? e : r.correctAfterPlusMinis(e, t, e + t) })); return void 0 !== t ? t : 0 } function F(e) { var t = N(e, (function (e, t) { return null == e && (e = 0), null == t || null == t ? e : e + 1 }), !1); return void 0 !== t ? t : 0 } function q(e) { if (!e) return !1; for (var t = e.questions, n = 0; n < t.length; n++)if (!t[n].validate(!1)) return !1; return !0 } R.Instance.register("sum", A), R.Instance.register("min", (function (e) { return L(e, !0) })), R.Instance.register("max", (function (e) { return L(e, !1) })), R.Instance.register("count", (function (e) { var t = []; return D(e, t), t.length })), R.Instance.register("avg", (function (e) { var t = []; D(e, t); var n = A(e); return t.length > 0 ? n / t.length : 0 })), R.Instance.register("sumInArray", M), R.Instance.register("minInArray", (function (e) { return N(e, (function (e, t) { return null == e ? t : null == t || null == t || e < t ? e : t })) })), R.Instance.register("maxInArray", (function (e) { return N(e, (function (e, t) { return null == e ? t : null == t || null == t || e > t ? e : t })) })), R.Instance.register("countInArray", F), R.Instance.register("avgInArray", (function (e) { var t = F(e); return 0 == t ? 0 : M(e) / t })), R.Instance.register("iif", (function (e) { return e || 3 === e.length ? e[0] ? e[1] : e[2] : "" })), R.Instance.register("getDate", (function (e) { return !e && e.length < 1 ? null : e[0] ? new Date(e[0]) : null })), R.Instance.register("age", (function (e) { if (!e && e.length < 1) return null; if (!e[0]) return null; var t = new Date(e[0]), n = new Date, o = n.getFullYear() - t.getFullYear(), r = n.getMonth() - t.getMonth(); return (r < 0 || 0 === r && n.getDate() < t.getDate()) && (o -= o > 0 ? 1 : 0), o })), R.Instance.register("isContainerReady", (function (e) { if (!e && e.length < 1) return !1; if (!e[0] || !this.survey) return !1; var t = e[0], n = this.survey.getPageByName(t); if (n || (n = this.survey.getPanelByName(t)), !n) { var o = this.survey.getQuestionByName(t); if (!o || !Array.isArray(o.panels)) return !1; if (!(e.length > 1)) { for (var r = 0; r < o.panels.length; r++)if (!q(o.panels[r])) return !1; return !0 } e[1] < o.panels.length && (n = o.panels[e[1]]) } return q(n) })), R.Instance.register("isDisplayMode", (function () { return this.survey && this.survey.isDisplayMode })), R.Instance.register("currentDate", (function () { return new Date })), R.Instance.register("today", (function (e) { var t = new Date; return o.useLocalTimeZone ? t.setHours(0, 0, 0, 0) : t.setUTCHours(0, 0, 0, 0), Array.isArray(e) && 1 == e.length && t.setDate(t.getDate() + e[0]), t })), R.Instance.register("getYear", (function (e) { if (1 === e.length && e[0]) return new Date(e[0]).getFullYear() })), R.Instance.register("currentYear", (function () { return (new Date).getFullYear() })), R.Instance.register("diffDays", (function (e) { if (!Array.isArray(e) || 2 !== e.length) return 0; if (!e[0] || !e[1]) return 0; var t = new Date(e[0]), n = new Date(e[1]), o = Math.abs(n - t); return Math.ceil(o / 864e5) })); var k = function () { var e = function (t, n) { return (e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (e, t) { e.__proto__ = t } || function (e, t) { for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]) })(t, n) }; return function (t, n) { if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null"); function o() { this.constructor = t } e(t, n), t.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o) } }(), B = function () { function e() { } return e.prototype.toString = function (e) { return void 0 === e && (e = void 0), "" }, e.prototype.hasFunction = function () { return !1 }, e.prototype.hasAsyncFunction = function () { return !1 }, e.prototype.addToAsyncList = function (e) { }, e.prototype.isEqual = function (e) { return !!e && e.getType() === this.getType() && this.isContentEqual(e) }, e.prototype.areOperatorsEquals = function (e, t) { return !e && !t || !!e && e.isEqual(t) }, e }(), Q = function (e) { function t(t, n, o, r) { void 0 === n && (n = null), void 0 === o && (o = null), void 0 === r && (r = !1); var i = e.call(this) || this; return i.operatorName = t, i.left = n, i.right = o, i.isArithmeticValue = r, i.consumer = r ? G.binaryFunctions.arithmeticOp(t) : G.binaryFunctions[t], null == i.consumer && G.throwInvalidOperatorError(t), i } return k(t, e), t.prototype.getType = function () { return "binary" }, Object.defineProperty(t.prototype, "isArithmetic", { get: function () { return this.isArithmeticValue }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "isConjunction", { get: function () { return "or" == this.operatorName || "and" == this.operatorName }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "conjunction", { get: function () { return this.isConjunction ? this.operatorName : "" }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "operator", { get: function () { return this.operatorName }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "leftOperand", { get: function () { return this.left }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "rightOperand", { get: function () { return this.right }, enumerable: !1, configurable: !0 }), t.prototype.isContentEqual = function (e) { var t = e; return t.operator === this.operator && this.areOperatorsEquals(this.left, t.left) && this.areOperatorsEquals(this.right, t.right) }, t.prototype.evaluateParam = function (e, t) { return null == e ? null : e.evaluate(t) }, t.prototype.evaluate = function (e) { return this.consumer.call(this, this.evaluateParam(this.left, e), this.evaluateParam(this.right, e)) }, t.prototype.toString = function (e) { if (void 0 === e && (e = void 0), e) { var t = e(this); if (t) return t } return "(" + G.safeToString(this.left, e) + " " + G.operatorToString(this.operatorName) + " " + G.safeToString(this.right, e) + ")" }, t.prototype.setVariables = function (e) { null != this.left && this.left.setVariables(e), null != this.right && this.right.setVariables(e) }, t.prototype.hasFunction = function () { return !!this.left && this.left.hasFunction() || !!this.right && this.right.hasFunction() }, t.prototype.hasAsyncFunction = function () { return !!this.left && this.left.hasAsyncFunction() || !!this.right && this.right.hasAsyncFunction() }, t.prototype.addToAsyncList = function (e) { this.left && this.left.addToAsyncList(e), this.right && this.right.addToAsyncList(e) }, t }(B), H = function (e) { function t(t, n) { var o = e.call(this) || this; return o.expressionValue = t, o.operatorName = n, o.consumer = G.unaryFunctions[n], null == o.consumer && G.throwInvalidOperatorError(n), o } return k(t, e), Object.defineProperty(t.prototype, "operator", { get: function () { return this.operatorName }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "expression", { get: function () { return this.expressionValue }, enumerable: !1, configurable: !0 }), t.prototype.getType = function () { return "unary" }, t.prototype.toString = function (e) { if (void 0 === e && (e = void 0), e) { var t = e(this); if (t) return t } return G.operatorToString(this.operatorName) + " " + this.expression.toString(e) }, t.prototype.isContentEqual = function (e) { var t = e; return t.operator == this.operator && this.areOperatorsEquals(this.expression, t.expression) }, t.prototype.evaluate = function (e) { var t = this.expression.evaluate(e); return this.consumer.call(this, t) }, t.prototype.setVariables = function (e) { this.expression.setVariables(e) }, t }(B), z = function (e) { function t(t) { var n = e.call(this) || this; return n.values = t, n } return k(t, e), t.prototype.getType = function () { return "array" }, t.prototype.toString = function (e) { if (void 0 === e && (e = void 0), e) { var t = e(this); if (t) return t } return "[" + this.values.map((function (t) { return t.toString(e) })).join(", ") + "]" }, t.prototype.evaluate = function (e) { return this.values.map((function (t) { return t.evaluate(e) })) }, t.prototype.setVariables = function (e) { this.values.forEach((function (t) { t.setVariables(e) })) }, t.prototype.hasFunction = function () { return this.values.some((function (e) { return e.hasFunction() })) }, t.prototype.hasAsyncFunction = function () { return this.values.some((function (e) { return e.hasAsyncFunction() })) }, t.prototype.addToAsyncList = function (e) { this.values.forEach((function (t) { return t.addToAsyncList(e) })) }, t.prototype.isContentEqual = function (e) { var t = e; if (t.values.length !== this.values.length) return !1; for (var n = 0; n < this.values.length; n++)if (!t.values[n].isEqual(this.values[n])) return !1; return !0 }, t }(B), U = function (e) { function t(t) { var n = e.call(this) || this; return n.value = t, n } return k(t, e), t.prototype.getType = function () { return "const" }, t.prototype.toString = function (e) { if (void 0 === e && (e = void 0), e) { var t = e(this); if (t) return t } return this.value.toString() }, Object.defineProperty(t.prototype, "correctValue", { get: function () { return this.getCorrectValue(this.value) }, enumerable: !1, configurable: !0 }), t.prototype.evaluate = function () { return this.getCorrectValue(this.value) }, t.prototype.setVariables = function (e) { }, t.prototype.getCorrectValue = function (e) { return e && "string" == typeof e ? this.isBooleanValue(e) ? "true" === e.toLowerCase() : e.length > 1 && this.isQuote(e[0]) && this.isQuote(e[e.length - 1]) ? e.substring(1, e.length - 1) : G.isNumeric(e) ? 0 == e.indexOf("0x") ? parseInt(e) : e.length > 1 && "0" == e[0] ? e : parseFloat(e) : e : e }, t.prototype.isContentEqual = function (e) { return e.value == this.value }, t.prototype.isQuote = function (e) { return "'" == e || '"' == e }, t.prototype.isBooleanValue = function (e) { return e && ("true" === e.toLowerCase() || "false" === e.toLowerCase()) }, t }(B), W = function (e) { function t(n) { var o = e.call(this, n) || this; return o.variableName = n, o.valueInfo = {}, o.useValueAsItIs = !1, o.variableName && o.variableName.length > 1 && o.variableName[0] === t.DisableConversionChar && (o.variableName = o.variableName.substring(1), o.useValueAsItIs = !0), o } return k(t, e), Object.defineProperty(t, "DisableConversionChar", { get: function () { return o.expressionDisableConversionChar }, set: function (e) { o.expressionDisableConversionChar = e }, enumerable: !1, configurable: !0 }), t.prototype.getType = function () { return "variable" }, t.prototype.toString = function (e) { if (void 0 === e && (e = void 0), e) { var n = e(this); if (n) return n } return "{" + (this.useValueAsItIs ? t.DisableConversionChar : "") + this.variableName + "}" }, Object.defineProperty(t.prototype, "variable", { get: function () { return this.variableName }, enumerable: !1, configurable: !0 }), t.prototype.evaluate = function (e) { return this.valueInfo.name = this.variableName, e.getValueInfo(this.valueInfo), this.valueInfo.hasValue ? this.getCorrectValue(this.valueInfo.value) : null }, t.prototype.setVariables = function (e) { e.push(this.variableName) }, t.prototype.getCorrectValue = function (t) { return this.useValueAsItIs ? t : e.prototype.getCorrectValue.call(this, t) }, t.prototype.isContentEqual = function (e) { return e.variable == this.variable }, t }(U), J = function (e) { function t(t, n) { var o = e.call(this) || this; return o.originalValue = t, o.parameters = n, o.isReadyValue = !1, Array.isArray(n) && 0 === n.length && (o.parameters = new z([])), o } return k(t, e), t.prototype.getType = function () { return "function" }, t.prototype.evaluateAsync = function (e) { var t = this; this.isReadyValue = !1; var n = new I; n.values = r.createCopy(e.values), n.properties = r.createCopy(e.properties), n.properties.returnResult = function (e) { t.asynResult = e, t.isReadyValue = !0, t.onAsyncReady() }, this.evaluateCore(n) }, t.prototype.evaluate = function (e) { return this.isReady ? this.asynResult : this.evaluateCore(e) }, t.prototype.evaluateCore = function (e) { return R.Instance.run(this.originalValue, this.parameters.evaluate(e), e.properties) }, t.prototype.toString = function (e) { if (void 0 === e && (e = void 0), e) { var t = e(this); if (t) return t } return this.originalValue + "(" + this.parameters.toString(e) + ")" }, t.prototype.setVariables = function (e) { this.parameters.setVariables(e) }, Object.defineProperty(t.prototype, "isReady", { get: function () { return this.isReadyValue }, enumerable: !1, configurable: !0 }), t.prototype.hasFunction = function () { return !0 }, t.prototype.hasAsyncFunction = function () { return R.Instance.isAsyncFunction(this.originalValue) }, t.prototype.addToAsyncList = function (e) { this.hasAsyncFunction() && e.push(this) }, t.prototype.isContentEqual = function (e) { var t = e; return t.originalValue == this.originalValue && this.areOperatorsEquals(t.parameters, this.parameters) }, t }(B), G = function () { function e() { } return e.throwInvalidOperatorError = function (e) { throw new Error("Invalid operator: '" + e + "'") }, e.safeToString = function (e, t) { return null == e ? "" : e.toString(t) }, e.toOperandString = function (t) { return !t || e.isNumeric(t) || e.isBooleanValue(t) || (t = "'" + t + "'"), t }, e.isSpaceString = function (e) { return !!e && !e.replace(" ", "") }, e.isNumeric = function (t) { return (!t || !(t.indexOf("-") > -1 || t.indexOf("+") > 1 || t.indexOf("*") > -1 || t.indexOf("^") > -1 || t.indexOf("/") > -1 || t.indexOf("%") > -1)) && (!e.isSpaceString(t) && r.isNumber(t)) }, e.isBooleanValue = function (e) { return !!e && ("true" === e.toLowerCase() || "false" === e.toLowerCase()) }, e.countDecimals = function (e) { if (r.isNumber(e) && Math.floor(e) !== e) { var t = e.toString().split("."); return t.length > 1 && t[1].length || 0 } return 0 }, e.plusMinus = function (t, n, o) { var r = e.countDecimals(t), i = e.countDecimals(n); if (r > 0 || i > 0) { var s = Math.max(r, i); o = parseFloat(o.toFixed(s)) } return o }, e.isTwoValueEquals = function (e, t) { return "undefined" === e && (e = void 0), "undefined" === t && (t = void 0), r.isTwoValueEquals(e, t, !0) }, e.operatorToString = function (t) { var n = e.signs[t]; return null == n ? t : n }, e.unaryFunctions = { empty: function (e) { return r.isValueEmpty(e) }, notempty: function (t) { return !e.unaryFunctions.empty(t) }, negate: function (e) { return !e } }, e.binaryFunctions = { arithmeticOp: function (t) { var n = function (e, t) { return r.isValueEmpty(e) ? "number" == typeof t ? 0 : "string" == typeof e ? e : "string" == typeof t ? "" : Array.isArray(t) ? [] : 0 : e }; return function (o, r) { o = n(o, r), r = n(r, o); var i = e.binaryFunctions[t]; return null == i ? null : i.call(this, o, r) } }, and: function (e, t) { return e && t }, or: function (e, t) { return e || t }, plus: function (e, t) { return r.sumAnyValues(e, t) }, minus: function (e, t) { return r.correctAfterPlusMinis(e, t, e - t) }, mul: function (e, t) { return r.correctAfterMultiple(e, t, e * t) }, div: function (e, t) { return t ? e / t : null }, mod: function (e, t) { return t ? e % t : null }, power: function (e, t) { return Math.pow(e, t) }, greater: function (e, t) { return null != e && null != t && e > t }, less: function (e, t) { return null != e && null != t && e < t }, greaterorequal: function (t, n) { return !!e.binaryFunctions.equal(t, n) || e.binaryFunctions.greater(t, n) }, lessorequal: function (t, n) { return !!e.binaryFunctions.equal(t, n) || e.binaryFunctions.less(t, n) }, equal: function (t, n) { return e.isTwoValueEquals(t, n) }, notequal: function (t, n) { return !e.binaryFunctions.equal(t, n) }, contains: function (t, n) { return e.binaryFunctions.containsCore(t, n, !0) }, notcontains: function (t, n) { return !t && !r.isValueEmpty(n) || e.binaryFunctions.containsCore(t, n, !1) }, anyof: function (t, n) { if (r.isValueEmpty(t) && r.isValueEmpty(n)) return !0; if (r.isValueEmpty(t) || !Array.isArray(t) && 0 === t.length) return !1; if (r.isValueEmpty(n)) return !0; if (!Array.isArray(t)) return e.binaryFunctions.contains(n, t); if (!Array.isArray(n)) return e.binaryFunctions.contains(t, n); for (var o = 0; o < n.length; o++)if (e.binaryFunctions.contains(t, n[o])) return !0; return !1 }, allof: function (t, n) { if (!t && !r.isValueEmpty(n)) return !1; if (!Array.isArray(n)) return e.binaryFunctions.contains(t, n); for (var o = 0; o < n.length; o++)if (!e.binaryFunctions.contains(t, n[o])) return !1; return !0 }, containsCore: function (t, n, o) { if (!t && 0 !== t && !1 !== t) return !1; if (t.length || (t = t.toString(), ("string" == typeof n || n instanceof String) && (t = t.toUpperCase(), n = n.toUpperCase())), "string" == typeof t || t instanceof String) { if (!n) return !1; n = n.toString(); var r = t.indexOf(n) > -1; return o ? r : !r } for (var i = Array.isArray(n) ? n : [n], s = 0; s < i.length; s++) { var a = 0; for (n = i[s]; a < t.length && !e.isTwoValueEquals(t[a], n); a++); if (a == t.length) return !o } return o } }, e.signs = { less: "<", lessorequal: "<=", greater: ">", greaterorequal: ">=", equal: "==", notequal: "!=", plus: "+", minus: "-", mul: "*", div: "/", and: "and", or: "or", power: "^", mod: "%", negate: "!" }, e }(), $ = function () { var e = function (t, n) { return (e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (e, t) { e.__proto__ = t } || function (e, t) { for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]) })(t, n) }; return function (t, n) { if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null"); function o() { this.constructor = t } e(t, n), t.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o) } }(), K = function (e) { function t(n, o, r, i) { var s = e.call(this) || this; return s.message = n, s.expected = o, s.found = r, s.location = i, s.name = "SyntaxError", "function" == typeof Error.captureStackTrace && Error.captureStackTrace(s, t), s } return $(t, e), t.buildMessage = function (e, t) { function n(e) { return e.charCodeAt(0).toString(16).toUpperCase() } function o(e) { return e.replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/\0/g, "\\0").replace(/\t/g, "\\t").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/[\x00-\x0F]/g, (function (e) { return "\\x0" + n(e) })).replace(/[\x10-\x1F\x7F-\x9F]/g, (function (e) { return "\\x" + n(e) })) } function r(e) { return e.replace(/\\/g, "\\\\").replace(/\]/g, "\\]").replace(/\^/g, "\\^").replace(/-/g, "\\-").replace(/\0/g, "\\0").replace(/\t/g, "\\t").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/[\x00-\x0F]/g, (function (e) { return "\\x0" + n(e) })).replace(/[\x10-\x1F\x7F-\x9F]/g, (function (e) { return "\\x" + n(e) })) } function i(e) { switch (e.type) { case "literal": return '"' + o(e.text) + '"'; case "class": var t = e.parts.map((function (e) { return Array.isArray(e) ? r(e[0]) + "-" + r(e[1]) : r(e) })); return "[" + (e.inverted ? "^" : "") + t + "]"; case "any": return "any character"; case "end": return "end of input"; case "other": return e.description } } return "Expected " + function (e) { var t, n, o = e.map(i); if (o.sort(), o.length > 0) { for (t = 1, n = 1; t < o.length; t++)o[t - 1] !== o[t] && (o[n] = o[t], n++); o.length = n } switch (o.length) { case 1: return o[0]; case 2: return o[0] + " or " + o[1]; default: return o.slice(0, -1).join(", ") + ", or " + o[o.length - 1] } }(e) + " but " + (((s = t) ? '"' + o(s) + '"' : "end of input") + " found."); var s }, t }(Error); var X = function (e, t) { t = void 0 !== t ? t : {}; var n, o = {}, r = { Expression: $e }, i = $e, s = function (e, t) { return bt(e, t, !0) }, a = Qe("||", !1), l = Qe("or", !0), u = Qe("&&", !1), c = Qe("and", !0), p = function (e, t) { return bt(e, t) }, h = Qe("<=", !1), d = Qe("lessorequal", !0), f = Qe(">=", !1), g = Qe("greaterorequal", !0), y = Qe("==", !1), m = Qe("equal", !0), v = Qe("=", !1), b = Qe("!=", !1), C = Qe("notequal", !0), P = Qe("<", !1), w = Qe("less", !0), V = Qe(">", !1), x = Qe("greater", !0), O = Qe("+", !1), T = Qe("-", !1), S = Qe("*", !1), _ = Qe("/", !1), I = Qe("%", !1), R = Qe("^", !1), E = Qe("power", !0), D = Qe("*=", !1), A = Qe("contains", !0), L = Qe("contain", !0), j = Qe("notcontains", !0), N = Qe("notcontain", !0), M = Qe("anyof", !0), F = Qe("allof", !0), q = Qe("(", !1), k = Qe(")", !1), B = Qe("!", !1), G = Qe("negate", !0), $ = Qe("empty", !0), X = Qe("notempty", !0), Y = Qe("undefined", !1), Z = Qe("null", !1), ee = Qe("{", !1), te = Qe("}", !1), ne = Qe("''", !1), oe = Qe('""', !1), re = Qe("'", !1), ie = function (e) { return "'" + e + "'" }, se = Qe('"', !1), ae = Qe("[", !1), le = Qe("]", !1), ue = Qe(",", !1), ce = Qe("true", !0), pe = Qe("false", !0), he = Qe("0x", !1), de = /^[\-]/, fe = He(["-"], !1, !1), ge = Qe(".", !1), ye = Qe("0", !1), me = function (e) { return e.join("") }, ve = Qe("\\'", !1), be = Qe('\\"', !1), Ce = /^[^"']/, Pe = He(['"', "'"], !0, !1), we = function () { return Be() }, Ve = /^[^{}]/, xe = He(["{", "}"], !0, !1), Oe = /^[0-9]/, Te = He([["0", "9"]], !1, !1), Se = /^[1-9]/, _e = He([["1", "9"]], !1, !1), Ie = /^[a-zA-Z_]/, Re = He([["a", "z"], ["A", "Z"], "_"], !1, !1), Ee = ze("whitespace"), De = /^[ \t\n\r]/, Ae = He([" ", "\t", "\n", "\r"], !1, !1), Le = 0, je = 0, Ne = [{ line: 1, column: 1 }], Me = 0, Fe = [], qe = 0, ke = {}; if (void 0 !== t.startRule) { if (!(t.startRule in r)) throw new Error("Can't start parsing from rule \"" + t.startRule + '".'); i = r[t.startRule] } function Be() { return e.substring(je, Le) } function Qe(e, t) { return { type: "literal", text: e, ignoreCase: t } } function He(e, t, n) { return { type: "class", parts: e, inverted: t, ignoreCase: n } } function ze(e) { return { type: "other", description: e } } function Ue(t) { var n, o = Ne[t]; if (o) return o; for (n = t - 1; !Ne[n];)n--; for (o = { line: (o = Ne[n]).line, column: o.column }; n < t;)10 === e.charCodeAt(n) ? (o.line++, o.column = 1) : o.column++, n++; return Ne[t] = o, o } function We(e, t) { var n = Ue(e), o = Ue(t); return { start: { offset: e, line: n.line, column: n.column }, end: { offset: t, line: o.line, column: o.column } } } function Je(e) { Le < Me || (Le > Me && (Me = Le, Fe = []), Fe.push(e)) } function Ge(e, t, n) { return new K(K.buildMessage(e, t), e, t, n) } function $e() { var e, t, n, r, i, a, l, u, c = 34 * Le + 0, p = ke[c]; if (p) return Le = p.nextPos, p.result; if (e = Le, vt() !== o) if ((t = Xe()) !== o) { for (n = [], r = Le, (i = vt()) !== o && (a = Ke()) !== o && (l = vt()) !== o && (u = Xe()) !== o ? r = i = [i, a, l, u] : (Le = r, r = o); r !== o;)n.push(r), r = Le, (i = vt()) !== o && (a = Ke()) !== o && (l = vt()) !== o && (u = Xe()) !== o ? r = i = [i, a, l, u] : (Le = r, r = o); n !== o && (r = vt()) !== o ? (je = e, e = s(t, n)) : (Le = e, e = o) } else Le = e, e = o; else Le = e, e = o; return ke[c] = { nextPos: Le, result: e }, e } function Ke() { var t, n, r = 34 * Le + 1, i = ke[r]; return i ? (Le = i.nextPos, i.result) : (t = Le, "||" === e.substr(Le, 2) ? (n = "||", Le += 2) : (n = o, 0 === qe && Je(a)), n === o && ("or" === e.substr(Le, 2).toLowerCase() ? (n = e.substr(Le, 2), Le += 2) : (n = o, 0 === qe && Je(l))), n !== o && (je = t, n = "or"), t = n, ke[r] = { nextPos: Le, result: t }, t) } function Xe() { var e, t, n, r, i, a, l, u, c = 34 * Le + 2, p = ke[c]; if (p) return Le = p.nextPos, p.result; if (e = Le, (t = Ze()) !== o) { for (n = [], r = Le, (i = vt()) !== o && (a = Ye()) !== o && (l = vt()) !== o && (u = Ze()) !== o ? r = i = [i, a, l, u] : (Le = r, r = o); r !== o;)n.push(r), r = Le, (i = vt()) !== o && (a = Ye()) !== o && (l = vt()) !== o && (u = Ze()) !== o ? r = i = [i, a, l, u] : (Le = r, r = o); n !== o ? (je = e, e = t = s(t, n)) : (Le = e, e = o) } else Le = e, e = o; return ke[c] = { nextPos: Le, result: e }, e } function Ye() { var t, n, r = 34 * Le + 3, i = ke[r]; return i ? (Le = i.nextPos, i.result) : (t = Le, "&&" === e.substr(Le, 2) ? (n = "&&", Le += 2) : (n = o, 0 === qe && Je(u)), n === o && ("and" === e.substr(Le, 3).toLowerCase() ? (n = e.substr(Le, 3), Le += 3) : (n = o, 0 === qe && Je(c))), n !== o && (je = t, n = "and"), t = n, ke[r] = { nextPos: Le, result: t }, t) } function Ze() { var e, t, n, r, i, s, a, l, u = 34 * Le + 4, c = ke[u]; if (c) return Le = c.nextPos, c.result; if (e = Le, (t = tt()) !== o) { for (n = [], r = Le, (i = vt()) !== o && (s = et()) !== o && (a = vt()) !== o && (l = tt()) !== o ? r = i = [i, s, a, l] : (Le = r, r = o); r !== o;)n.push(r), r = Le, (i = vt()) !== o && (s = et()) !== o && (a = vt()) !== o && (l = tt()) !== o ? r = i = [i, s, a, l] : (Le = r, r = o); n !== o ? (je = e, e = t = p(t, n)) : (Le = e, e = o) } else Le = e, e = o; return ke[u] = { nextPos: Le, result: e }, e } function et() { var t, n, r = 34 * Le + 5, i = ke[r]; return i ? (Le = i.nextPos, i.result) : (t = Le, "<=" === e.substr(Le, 2) ? (n = "<=", Le += 2) : (n = o, 0 === qe && Je(h)), n === o && ("lessorequal" === e.substr(Le, 11).toLowerCase() ? (n = e.substr(Le, 11), Le += 11) : (n = o, 0 === qe && Je(d))), n !== o && (je = t, n = "lessorequal"), (t = n) === o && (t = Le, ">=" === e.substr(Le, 2) ? (n = ">=", Le += 2) : (n = o, 0 === qe && Je(f)), n === o && ("greaterorequal" === e.substr(Le, 14).toLowerCase() ? (n = e.substr(Le, 14), Le += 14) : (n = o, 0 === qe && Je(g))), n !== o && (je = t, n = "greaterorequal"), (t = n) === o && (t = Le, "==" === e.substr(Le, 2) ? (n = "==", Le += 2) : (n = o, 0 === qe && Je(y)), n === o && ("equal" === e.substr(Le, 5).toLowerCase() ? (n = e.substr(Le, 5), Le += 5) : (n = o, 0 === qe && Je(m))), n !== o && (je = t, n = "equal"), (t = n) === o && (t = Le, 61 === e.charCodeAt(Le) ? (n = "=", Le++) : (n = o, 0 === qe && Je(v)), n === o && ("equal" === e.substr(Le, 5).toLowerCase() ? (n = e.substr(Le, 5), Le += 5) : (n = o, 0 === qe && Je(m))), n !== o && (je = t, n = "equal"), (t = n) === o && (t = Le, "!=" === e.substr(Le, 2) ? (n = "!=", Le += 2) : (n = o, 0 === qe && Je(b)), n === o && ("notequal" === e.substr(Le, 8).toLowerCase() ? (n = e.substr(Le, 8), Le += 8) : (n = o, 0 === qe && Je(C))), n !== o && (je = t, n = "notequal"), (t = n) === o && (t = Le, 60 === e.charCodeAt(Le) ? (n = "<", Le++) : (n = o, 0 === qe && Je(P)), n === o && ("less" === e.substr(Le, 4).toLowerCase() ? (n = e.substr(Le, 4), Le += 4) : (n = o, 0 === qe && Je(w))), n !== o && (je = t, n = "less"), (t = n) === o && (t = Le, 62 === e.charCodeAt(Le) ? (n = ">", Le++) : (n = o, 0 === qe && Je(V)), n === o && ("greater" === e.substr(Le, 7).toLowerCase() ? (n = e.substr(Le, 7), Le += 7) : (n = o, 0 === qe && Je(x))), n !== o && (je = t, n = "greater"), t = n)))))), ke[r] = { nextPos: Le, result: t }, t) } function tt() { var e, t, n, r, i, a, l, u, c = 34 * Le + 6, p = ke[c]; if (p) return Le = p.nextPos, p.result; if (e = Le, (t = ot()) !== o) { for (n = [], r = Le, (i = vt()) !== o && (a = nt()) !== o && (l = vt()) !== o && (u = ot()) !== o ? r = i = [i, a, l, u] : (Le = r, r = o); r !== o;)n.push(r), r = Le, (i = vt()) !== o && (a = nt()) !== o && (l = vt()) !== o && (u = ot()) !== o ? r = i = [i, a, l, u] : (Le = r, r = o); n !== o ? (je = e, e = t = s(t, n)) : (Le = e, e = o) } else Le = e, e = o; return ke[c] = { nextPos: Le, result: e }, e } function nt() { var t, n, r = 34 * Le + 7, i = ke[r]; return i ? (Le = i.nextPos, i.result) : (t = Le, 43 === e.charCodeAt(Le) ? (n = "+", Le++) : (n = o, 0 === qe && Je(O)), n !== o && (je = t, n = "plus"), (t = n) === o && (t = Le, 45 === e.charCodeAt(Le) ? (n = "-", Le++) : (n = o, 0 === qe && Je(T)), n !== o && (je = t, n = "minus"), t = n), ke[r] = { nextPos: Le, result: t }, t) } function ot() { var e, t, n, r, i, a, l, u, c = 34 * Le + 8, p = ke[c]; if (p) return Le = p.nextPos, p.result; if (e = Le, (t = it()) !== o) { for (n = [], r = Le, (i = vt()) !== o && (a = rt()) !== o && (l = vt()) !== o && (u = it()) !== o ? r = i = [i, a, l, u] : (Le = r, r = o); r !== o;)n.push(r), r = Le, (i = vt()) !== o && (a = rt()) !== o && (l = vt()) !== o && (u = it()) !== o ? r = i = [i, a, l, u] : (Le = r, r = o); n !== o ? (je = e, e = t = s(t, n)) : (Le = e, e = o) } else Le = e, e = o; return ke[c] = { nextPos: Le, result: e }, e } function rt() { var t, n, r = 34 * Le + 9, i = ke[r]; return i ? (Le = i.nextPos, i.result) : (t = Le, 42 === e.charCodeAt(Le) ? (n = "*", Le++) : (n = o, 0 === qe && Je(S)), n !== o && (je = t, n = "mul"), (t = n) === o && (t = Le, 47 === e.charCodeAt(Le) ? (n = "/", Le++) : (n = o, 0 === qe && Je(_)), n !== o && (je = t, n = "div"), (t = n) === o && (t = Le, 37 === e.charCodeAt(Le) ? (n = "%", Le++) : (n = o, 0 === qe && Je(I)), n !== o && (je = t, n = "mod"), t = n)), ke[r] = { nextPos: Le, result: t }, t) } function it() { var e, t, n, r, i, a, l, u, c = 34 * Le + 10, p = ke[c]; if (p) return Le = p.nextPos, p.result; if (e = Le, (t = at()) !== o) { for (n = [], r = Le, (i = vt()) !== o && (a = st()) !== o && (l = vt()) !== o && (u = at()) !== o ? r = i = [i, a, l, u] : (Le = r, r = o); r !== o;)n.push(r), r = Le, (i = vt()) !== o && (a = st()) !== o && (l = vt()) !== o && (u = at()) !== o ? r = i = [i, a, l, u] : (Le = r, r = o); n !== o ? (je = e, e = t = s(t, n)) : (Le = e, e = o) } else Le = e, e = o; return ke[c] = { nextPos: Le, result: e }, e } function st() { var t, n, r = 34 * Le + 11, i = ke[r]; return i ? (Le = i.nextPos, i.result) : (t = Le, 94 === e.charCodeAt(Le) ? (n = "^", Le++) : (n = o, 0 === qe && Je(R)), n === o && ("power" === e.substr(Le, 5).toLowerCase() ? (n = e.substr(Le, 5), Le += 5) : (n = o, 0 === qe && Je(E))), n !== o && (je = t, n = "power"), t = n, ke[r] = { nextPos: Le, result: t }, t) } function at() { var e, t, n, r, i, s, a, l, u = 34 * Le + 12, c = ke[u]; if (c) return Le = c.nextPos, c.result; if (e = Le, (t = ut()) !== o) { for (n = [], r = Le, (i = vt()) !== o && (s = lt()) !== o && (a = vt()) !== o ? ((l = ut()) === o && (l = null), l !== o ? r = i = [i, s, a, l] : (Le = r, r = o)) : (Le = r, r = o); r !== o;)n.push(r), r = Le, (i = vt()) !== o && (s = lt()) !== o && (a = vt()) !== o ? ((l = ut()) === o && (l = null), l !== o ? r = i = [i, s, a, l] : (Le = r, r = o)) : (Le = r, r = o); n !== o ? (je = e, e = t = p(t, n)) : (Le = e, e = o) } else Le = e, e = o; return ke[u] = { nextPos: Le, result: e }, e } function lt() { var t, n, r = 34 * Le + 13, i = ke[r]; return i ? (Le = i.nextPos, i.result) : (t = Le, "*=" === e.substr(Le, 2) ? (n = "*=", Le += 2) : (n = o, 0 === qe && Je(D)), n === o && ("contains" === e.substr(Le, 8).toLowerCase() ? (n = e.substr(Le, 8), Le += 8) : (n = o, 0 === qe && Je(A)), n === o && ("contain" === e.substr(Le, 7).toLowerCase() ? (n = e.substr(Le, 7), Le += 7) : (n = o, 0 === qe && Je(L)))), n !== o && (je = t, n = "contains"), (t = n) === o && (t = Le, "notcontains" === e.substr(Le, 11).toLowerCase() ? (n = e.substr(Le, 11), Le += 11) : (n = o, 0 === qe && Je(j)), n === o && ("notcontain" === e.substr(Le, 10).toLowerCase() ? (n = e.substr(Le, 10), Le += 10) : (n = o, 0 === qe && Je(N))), n !== o && (je = t, n = "notcontains"), (t = n) === o && (t = Le, "anyof" === e.substr(Le, 5).toLowerCase() ? (n = e.substr(Le, 5), Le += 5) : (n = o, 0 === qe && Je(M)), n !== o && (je = t, n = "anyof"), (t = n) === o && (t = Le, "allof" === e.substr(Le, 5).toLowerCase() ? (n = e.substr(Le, 5), Le += 5) : (n = o, 0 === qe && Je(F)), n !== o && (je = t, n = "allof"), t = n))), ke[r] = { nextPos: Le, result: t }, t) } function ut() { var t, n, r, i, s = 34 * Le + 14, a = ke[s]; return a ? (Le = a.nextPos, a.result) : (t = Le, 40 === e.charCodeAt(Le) ? (n = "(", Le++) : (n = o, 0 === qe && Je(q)), n !== o && vt() !== o && (r = $e()) !== o && vt() !== o ? (41 === e.charCodeAt(Le) ? (i = ")", Le++) : (i = o, 0 === qe && Je(k)), i === o && (i = null), i !== o ? (je = t, t = n = r) : (Le = t, t = o)) : (Le = t, t = o), t === o && (t = function () { var t, n, r, i, s, a = 34 * Le + 15, l = ke[a]; if (l) return Le = l.nextPos, l.result; t = Le, (n = gt()) !== o ? (40 === e.charCodeAt(Le) ? (r = "(", Le++) : (r = o, 0 === qe && Je(q)), r !== o && (i = pt()) !== o ? (41 === e.charCodeAt(Le) ? (s = ")", Le++) : (s = o, 0 === qe && Je(k)), s === o && (s = null), s !== o ? (je = t, n = new J(n, i), t = n) : (Le = t, t = o)) : (Le = t, t = o)) : (Le = t, t = o); return ke[a] = { nextPos: Le, result: t }, t }()) === o && (t = function () { var t, n, r, i = 34 * Le + 16, s = ke[i]; if (s) return Le = s.nextPos, s.result; t = Le, 33 === e.charCodeAt(Le) ? (n = "!", Le++) : (n = o, 0 === qe && Je(B)); n === o && ("negate" === e.substr(Le, 6).toLowerCase() ? (n = e.substr(Le, 6), Le += 6) : (n = o, 0 === qe && Je(G))); n !== o && vt() !== o && (r = $e()) !== o ? (je = t, n = new H(r, "negate"), t = n) : (Le = t, t = o); t === o && (t = Le, (n = ct()) !== o && vt() !== o && (r = function () { var t, n, r = 34 * Le + 17, i = ke[r]; if (i) return Le = i.nextPos, i.result; t = Le, "empty" === e.substr(Le, 5).toLowerCase() ? (n = e.substr(Le, 5), Le += 5) : (n = o, 0 === qe && Je($)); n !== o && (je = t, n = "empty"); (t = n) === o && (t = Le, "notempty" === e.substr(Le, 8).toLowerCase() ? (n = e.substr(Le, 8), Le += 8) : (n = o, 0 === qe && Je(X)), n !== o && (je = t, n = "notempty"), t = n); return ke[r] = { nextPos: Le, result: t }, t }()) !== o ? (je = t, n = function (e, t) { return new H(e, t) }(n, r), t = n) : (Le = t, t = o)); return ke[i] = { nextPos: Le, result: t }, t }()) === o && (t = ct()) === o && (t = function () { var t, n, r, i, s = 34 * Le + 20, a = ke[s]; if (a) return Le = a.nextPos, a.result; t = Le, 91 === e.charCodeAt(Le) ? (n = "[", Le++) : (n = o, 0 === qe && Je(ae)); n !== o && (r = pt()) !== o ? (93 === e.charCodeAt(Le) ? (i = "]", Le++) : (i = o, 0 === qe && Je(le)), i !== o ? (je = t, t = n = r) : (Le = t, t = o)) : (Le = t, t = o); return ke[s] = { nextPos: Le, result: t }, t }()), ke[s] = { nextPos: Le, result: t }, t) } function ct() { var t, n, r, i, s = 34 * Le + 18, a = ke[s]; return a ? (Le = a.nextPos, a.result) : (t = Le, vt() !== o ? ("undefined" === e.substr(Le, 9) ? (n = "undefined", Le += 9) : (n = o, 0 === qe && Je(Y)), n === o && ("null" === e.substr(Le, 4) ? (n = "null", Le += 4) : (n = o, 0 === qe && Je(Z))), n !== o ? (je = t, t = null) : (Le = t, t = o)) : (Le = t, t = o), t === o && (t = Le, vt() !== o && (n = function () { var t, n, r, i, s = 34 * Le + 19, a = ke[s]; if (a) return Le = a.nextPos, a.result; t = Le, (n = function () { var t, n, r = 34 * Le + 22, i = ke[r]; if (i) return Le = i.nextPos, i.result; t = Le, "true" === e.substr(Le, 4).toLowerCase() ? (n = e.substr(Le, 4), Le += 4) : (n = o, 0 === qe && Je(ce)); n !== o && (je = t, n = !0); (t = n) === o && (t = Le, "false" === e.substr(Le, 5).toLowerCase() ? (n = e.substr(Le, 5), Le += 5) : (n = o, 0 === qe && Je(pe)), n !== o && (je = t, n = !1), t = n); return ke[r] = { nextPos: Le, result: t }, t }()) !== o && (je = t, n = n); (t = n) === o && (t = Le, (n = function () { var t, n, r, i = 34 * Le + 23, s = ke[i]; if (s) return Le = s.nextPos, s.result; t = Le, "0x" === e.substr(Le, 2) ? (n = "0x", Le += 2) : (n = o, 0 === qe && Je(he)); n !== o && (r = yt()) !== o ? (je = t, n = parseInt(Be(), 16), t = n) : (Le = t, t = o); t === o && (t = Le, de.test(e.charAt(Le)) ? (n = e.charAt(Le), Le++) : (n = o, 0 === qe && Je(fe)), n === o && (n = null), n !== o && (r = function () { var t, n, r, i = 34 * Le + 24, s = ke[i]; if (s) return Le = s.nextPos, s.result; t = Le, (n = yt()) !== o ? (46 === e.charCodeAt(Le) ? (r = ".", Le++) : (r = o, 0 === qe && Je(ge)), r !== o && yt() !== o ? (je = t, n = parseFloat(Be()), t = n) : (Le = t, t = o)) : (Le = t, t = o); t === o && (t = Le, (n = function () { var t, n, r = 34 * Le + 31, i = ke[r]; if (i) return Le = i.nextPos, i.result; t = [], Se.test(e.charAt(Le)) ? (n = e.charAt(Le), Le++) : (n = o, 0 === qe && Je(_e)); if (n !== o) for (; n !== o;)t.push(n), Se.test(e.charAt(Le)) ? (n = e.charAt(Le), Le++) : (n = o, 0 === qe && Je(_e)); else t = o; return ke[r] = { nextPos: Le, result: t }, t }()) !== o ? ((r = yt()) === o && (r = null), r !== o ? (je = t, n = parseInt(Be(), 10), t = n) : (Le = t, t = o)) : (Le = t, t = o), t === o && (t = Le, 48 === e.charCodeAt(Le) ? (n = "0", Le++) : (n = o, 0 === qe && Je(ye)), n !== o && (je = t, n = 0), t = n)); return ke[i] = { nextPos: Le, result: t }, t }()) !== o ? (je = t, a = r, t = n = null == n ? a : -a) : (Le = t, t = o)); var a; return ke[i] = { nextPos: Le, result: t }, t }()) !== o && (je = t, n = n), (t = n) === o && (t = Le, (n = gt()) !== o && (je = t, n = n), (t = n) === o && (t = Le, "''" === e.substr(Le, 2) ? (n = "''", Le += 2) : (n = o, 0 === qe && Je(ne)), n !== o && (je = t, n = ""), (t = n) === o && (t = Le, '""' === e.substr(Le, 2) ? (n = '""', Le += 2) : (n = o, 0 === qe && Je(oe)), n !== o && (je = t, n = ""), (t = n) === o && (t = Le, 39 === e.charCodeAt(Le) ? (n = "'", Le++) : (n = o, 0 === qe && Je(re)), n !== o && (r = ht()) !== o ? (39 === e.charCodeAt(Le) ? (i = "'", Le++) : (i = o, 0 === qe && Je(re)), i !== o ? (je = t, n = ie(r), t = n) : (Le = t, t = o)) : (Le = t, t = o), t === o && (t = Le, 34 === e.charCodeAt(Le) ? (n = '"', Le++) : (n = o, 0 === qe && Je(se)), n !== o && (r = ht()) !== o ? (34 === e.charCodeAt(Le) ? (i = '"', Le++) : (i = o, 0 === qe && Je(se)), i !== o ? (je = t, n = ie(r), t = n) : (Le = t, t = o)) : (Le = t, t = o))))))); return ke[s] = { nextPos: Le, result: t }, t }()) !== o ? (je = t, t = new U(n)) : (Le = t, t = o), t === o && (t = Le, vt() !== o ? (123 === e.charCodeAt(Le) ? (n = "{", Le++) : (n = o, 0 === qe && Je(ee)), n !== o && (r = function () { var e, t, n, r = 34 * Le + 25, i = ke[r]; if (i) return Le = i.nextPos, i.result; if (e = Le, t = [], (n = ft()) !== o) for (; n !== o;)t.push(n), n = ft(); else t = o; t !== o && (je = e, t = me(t)); return e = t, ke[r] = { nextPos: Le, result: e }, e }()) !== o ? (125 === e.charCodeAt(Le) ? (i = "}", Le++) : (i = o, 0 === qe && Je(te)), i !== o ? (je = t, t = function (e) { return new W(e) }(r)) : (Le = t, t = o)) : (Le = t, t = o)) : (Le = t, t = o))), ke[s] = { nextPos: Le, result: t }, t) } function pt() { var t, n, r, i, s, a, l, u, c = 34 * Le + 21, p = ke[c]; if (p) return Le = p.nextPos, p.result; if (t = Le, (n = $e()) === o && (n = null), n !== o) { for (r = [], i = Le, (s = vt()) !== o ? (44 === e.charCodeAt(Le) ? (a = ",", Le++) : (a = o, 0 === qe && Je(ue)), a !== o && (l = vt()) !== o && (u = $e()) !== o ? i = s = [s, a, l, u] : (Le = i, i = o)) : (Le = i, i = o); i !== o;)r.push(i), i = Le, (s = vt()) !== o ? (44 === e.charCodeAt(Le) ? (a = ",", Le++) : (a = o, 0 === qe && Je(ue)), a !== o && (l = vt()) !== o && (u = $e()) !== o ? i = s = [s, a, l, u] : (Le = i, i = o)) : (Le = i, i = o); r !== o ? (je = t, t = n = function (e, t) { if (null == e) return new z([]); var n = [e]; if (Array.isArray(t)) for (var o = function (e) { return [].concat.apply([], e) }(t), r = 3; r < o.length; r += 4)n.push(o[r]); return new z(n) }(n, r)) : (Le = t, t = o) } else Le = t, t = o; return ke[c] = { nextPos: Le, result: t }, t } function ht() { var e, t, n, r = 34 * Le + 26, i = ke[r]; if (i) return Le = i.nextPos, i.result; if (e = Le, t = [], (n = dt()) !== o) for (; n !== o;)t.push(n), n = dt(); else t = o; return t !== o && (je = e, t = me(t)), e = t, ke[r] = { nextPos: Le, result: e }, e } function dt() { var t, n, r = 34 * Le + 27, i = ke[r]; return i ? (Le = i.nextPos, i.result) : (t = Le, "\\'" === e.substr(Le, 2) ? (n = "\\'", Le += 2) : (n = o, 0 === qe && Je(ve)), n !== o && (je = t, n = "'"), (t = n) === o && (t = Le, '\\"' === e.substr(Le, 2) ? (n = '\\"', Le += 2) : (n = o, 0 === qe && Je(be)), n !== o && (je = t, n = '"'), (t = n) === o && (t = Le, Ce.test(e.charAt(Le)) ? (n = e.charAt(Le), Le++) : (n = o, 0 === qe && Je(Pe)), n !== o && (je = t, n = we()), t = n)), ke[r] = { nextPos: Le, result: t }, t) } function ft() { var t, n, r = 34 * Le + 28, i = ke[r]; return i ? (Le = i.nextPos, i.result) : (t = Le, Ve.test(e.charAt(Le)) ? (n = e.charAt(Le), Le++) : (n = o, 0 === qe && Je(xe)), n !== o && (je = t, n = we()), t = n, ke[r] = { nextPos: Le, result: t }, t) } function gt() { var e, t, n, r, i, s, a = 34 * Le + 29, l = ke[a]; if (l) return Le = l.nextPos, l.result; if (e = Le, mt() !== o) { if (t = [], n = Le, (r = yt()) !== o) { for (i = [], s = mt(); s !== o;)i.push(s), s = mt(); i !== o ? n = r = [r, i] : (Le = n, n = o) } else Le = n, n = o; for (; n !== o;)if (t.push(n), n = Le, (r = yt()) !== o) { for (i = [], s = mt(); s !== o;)i.push(s), s = mt(); i !== o ? n = r = [r, i] : (Le = n, n = o) } else Le = n, n = o; t !== o ? (je = e, e = we()) : (Le = e, e = o) } else Le = e, e = o; return ke[a] = { nextPos: Le, result: e }, e } function yt() { var t, n, r = 34 * Le + 30, i = ke[r]; if (i) return Le = i.nextPos, i.result; if (t = [], Oe.test(e.charAt(Le)) ? (n = e.charAt(Le), Le++) : (n = o, 0 === qe && Je(Te)), n !== o) for (; n !== o;)t.push(n), Oe.test(e.charAt(Le)) ? (n = e.charAt(Le), Le++) : (n = o, 0 === qe && Je(Te)); else t = o; return ke[r] = { nextPos: Le, result: t }, t } function mt() { var t, n, r = 34 * Le + 32, i = ke[r]; if (i) return Le = i.nextPos, i.result; if (t = [], Ie.test(e.charAt(Le)) ? (n = e.charAt(Le), Le++) : (n = o, 0 === qe && Je(Re)), n !== o) for (; n !== o;)t.push(n), Ie.test(e.charAt(Le)) ? (n = e.charAt(Le), Le++) : (n = o, 0 === qe && Je(Re)); else t = o; return ke[r] = { nextPos: Le, result: t }, t } function vt() { var t, n, r = 34 * Le + 33, i = ke[r]; if (i) return Le = i.nextPos, i.result; for (qe++, t = [], De.test(e.charAt(Le)) ? (n = e.charAt(Le), Le++) : (n = o, 0 === qe && Je(Ae)); n !== o;)t.push(n), De.test(e.charAt(Le)) ? (n = e.charAt(Le), Le++) : (n = o, 0 === qe && Je(Ae)); return qe--, t === o && (n = o, 0 === qe && Je(Ee)), ke[r] = { nextPos: Le, result: t }, t } function bt(e, t, n) { return void 0 === n && (n = !1), t.reduce((function (e, t) { return new Q(t[1], e, t[3], n) }), e) } if ((n = i()) !== o && Le === e.length) return n; throw n !== o && Le < e.length && Je({ type: "end" }), Ge(Fe, Me < e.length ? e.charAt(Me) : null, Me < e.length ? We(Me, Me + 1) : We(Me, Me)) }, Y = function (e, t) { this.at = e, this.code = t }, Z = function () { function e() { } return e.prototype.patchExpression = function (e) { return e.replace(/=>/g, ">=").replace(/=</g, "<=").replace(/<>/g, "!=").replace(/equals/g, "equal ").replace(/notequals/g, "notequal ") }, e.prototype.createCondition = function (e) { return this.parseExpression(e) }, e.prototype.parseExpression = function (t) { try { var n = e.parserCache[t]; return void 0 === n && ((n = X(this.patchExpression(t))).hasAsyncFunction() || (e.parserCache[t] = n)), n } catch (e) { e instanceof K && (this.conditionError = new Y(e.location.start.offset, e.message)) } }, Object.defineProperty(e.prototype, "error", { get: function () { return this.conditionError }, enumerable: !1, configurable: !0 }), e.parserCache = {}, e }(), ee = function () { var e = function (t, n) { return (e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (e, t) { e.__proto__ = t } || function (e, t) { for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]) })(t, n) }; return function (t, n) { if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null"); function o() { this.constructor = t } e(t, n), t.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o) } }(), te = function () { function e(e) { this.processValue = new I, this.parser = new Z, this.isAsyncValue = !1, this.hasFunctionValue = !1, this.setExpression(e) } return Object.defineProperty(e.prototype, "expression", { get: function () { return this.expressionValue }, enumerable: !1, configurable: !0 }), e.prototype.setExpression = function (e) { this.expression !== e && (this.expressionValue = e, this.operand = this.parser.parseExpression(e), this.hasFunctionValue = !!this.canRun() && this.operand.hasFunction(), this.isAsyncValue = !!this.hasFunction() && this.operand.hasAsyncFunction()) }, e.prototype.getVariables = function () { if (!this.operand) return []; var e = []; return this.operand.setVariables(e), e }, e.prototype.hasFunction = function () { return this.hasFunctionValue }, Object.defineProperty(e.prototype, "isAsync", { get: function () { return this.isAsyncValue }, enumerable: !1, configurable: !0 }), e.prototype.canRun = function () { return !!this.operand }, e.prototype.run = function (e, t) { var n = this; if (void 0 === t && (t = null), !this.operand) return null; if (this.processValue.values = e, this.processValue.properties = t, !this.isAsync) return this.runValues(); this.asyncFuncList = [], this.operand.addToAsyncList(this.asyncFuncList); for (var o = 0; o < this.asyncFuncList.length; o++)this.asyncFuncList[o].onAsyncReady = function () { n.doAsyncFunctionReady() }; for (o = 0; o < this.asyncFuncList.length; o++)this.asyncFuncList[o].evaluateAsync(this.processValue); return !1 }, e.prototype.doAsyncFunctionReady = function () { for (var e = 0; e < this.asyncFuncList.length; e++)if (!this.asyncFuncList[e].isReady) return; this.runValues() }, e.prototype.runValues = function () { var e = this.operand.evaluate(this.processValue); return this.onComplete && this.onComplete(e), e }, e.createExpressionExecutor = function (t) { return new e(t) }, e }(), ne = function () { function e(e) { this.expression = e } return Object.defineProperty(e.prototype, "expression", { get: function () { return this.expressionExecutor ? this.expressionExecutor.expression : "" }, set: function (e) { var t = this; this.expressionExecutor && e === this.expression || (this.expressionExecutor = te.createExpressionExecutor(e), this.expressionExecutor.onComplete = function (e) { t.doOnComplete(e) }) }, enumerable: !1, configurable: !0 }), e.prototype.getVariables = function () { return this.expressionExecutor.getVariables() }, e.prototype.hasFunction = function () { return this.expressionExecutor.hasFunction() }, Object.defineProperty(e.prototype, "isAsync", { get: function () { return this.expressionExecutor.isAsync }, enumerable: !1, configurable: !0 }), e.prototype.canRun = function () { return this.expressionExecutor.canRun() }, e.prototype.runCore = function (e, t) { return void 0 === t && (t = null), this.expressionExecutor.run(e, t) }, e.prototype.doOnComplete = function (e) { }, e }(), oe = function (e) { function t() { return null !== e && e.apply(this, arguments) || this } return ee(t, e), t.prototype.run = function (e, t) { return void 0 === t && (t = null), 1 == this.runCore(e, t) }, t.prototype.doOnComplete = function (e) { this.onRunComplete && this.onRunComplete(1 == e) }, t }(ne), re = function (e) { function t() { return null !== e && e.apply(this, arguments) || this } return ee(t, e), t.prototype.run = function (e, t) { return void 0 === t && (t = null), this.runCore(e, t) }, t.prototype.doOnComplete = function (e) { this.onRunComplete && this.onRunComplete(e) }, t }(ne), ie = function () { var e = function (t, n) { return (e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (e, t) { e.__proto__ = t } || function (e, t) { for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]) })(t, n) }; return function (t, n) { if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null"); function o() { this.constructor = t } e(t, n), t.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o) } }(), se = function (e, t) { for (var n = 0, o = t.length, r = e.length; n < o; n++, r++)e[r] = t[n]; return e }, ae = function () { function e(e) { this.obj = e, this.properties = null, this.values = null } return e.prototype.getType = function () { return "bindings" }, e.prototype.getNames = function () { var e = []; this.fillProperties(); for (var t = 0; t < this.properties.length; t++)this.properties[t].isVisible("", this.obj) && e.push(this.properties[t].name); return e }, e.prototype.getProperties = function () { var e = []; this.fillProperties(); for (var t = 0; t < this.properties.length; t++)e.push(this.properties[t]); return e }, e.prototype.setBinding = function (e, t) { this.values || (this.values = {}); var n = this.getJson(); n !== t && (t ? this.values[e] = t : (delete this.values[e], 0 == Object.keys(this.values).length && (this.values = null)), this.onChangedJSON(n)) }, e.prototype.clearBinding = function (e) { this.setBinding(e, "") }, e.prototype.isEmpty = function () { if (!this.values) return !0; for (var e in this.values) return !1; return !0 }, e.prototype.getValueNameByPropertyName = function (e) { if (this.values) return this.values[e] }, e.prototype.getPropertiesByValueName = function (e) { if (!this.values) return []; var t = []; for (var n in this.values) this.values[n] == e && t.push(n); return t }, e.prototype.getJson = function () { if (!this.isEmpty()) { var e = {}; for (var t in this.values) e[t] = this.values[t]; return e } }, e.prototype.setJson = function (e) { var t = this.getJson(); if (this.values = null, e) for (var n in this.values = {}, e) this.values[n] = e[n]; this.onChangedJSON(t) }, e.prototype.fillProperties = function () { if (null === this.properties) { this.properties = []; for (var e = _.getPropertiesByObj(this.obj), t = 0; t < e.length; t++)e[t].isBindable && this.properties.push(e[t]) } }, e.prototype.onChangedJSON = function (e) { this.obj && this.obj.onBindingChanged(e, this.getJson()) }, e }(), le = function () { function e(t, n, o) { this.currentDependency = t, this.target = n, this.property = o, this.dependencies = [], this.id = "" + ++e.DependenciesCount } return e.prototype.addDependency = function (e, t) { this.target === e && this.property === t || this.dependencies.some((function (n) { return n.obj === e && n.prop === t })) || (this.dependencies.push({ obj: e, prop: t, id: this.id }), e.registerPropertyChangedHandlers([t], this.currentDependency, this.id)) }, e.prototype.dispose = function () { this.dependencies.forEach((function (e) { e.obj.unregisterPropertyChangedHandlers([e.prop], e.id) })) }, e.DependenciesCount = 0, e }(), ue = function () { function e(t) { this._updater = t, this.dependencies = void 0, this.type = e.ComputedUpdaterType } return Object.defineProperty(e.prototype, "updater", { get: function () { return this._updater }, enumerable: !1, configurable: !0 }), e.prototype.setDependencies = function (e) { this.clearDependencies(), this.dependencies = e }, e.prototype.getDependencies = function () { return this.dependencies }, e.prototype.clearDependencies = function () { this.dependencies && (this.dependencies.dispose(), this.dependencies = void 0) }, e.prototype.dispose = function () { this.clearDependencies() }, e.ComputedUpdaterType = "__dependency_computed", e }(), ce = function () { function e() { this.propertyHash = {}, this.eventList = [], this.isLoadingFromJsonValue = !1, this.loadingOwner = null, this.onPropertyChanged = this.addEvent(), this.onItemValuePropertyChanged = this.addEvent(), this.isCreating = !0, this.bindingsValue = new ae(this), v.createProperties(this), this.onBaseCreating(), this.isCreating = !1 } return e.finishCollectDependencies = function () { var t = e.currentDependencis; return e.currentDependencis = void 0, t }, e.startCollectDependencies = function (t, n, o) { if (void 0 !== e.currentDependencis) throw new Error("Attempt to collect nested dependencies. Nested dependencies are not supported."); e.currentDependencis = new le(t, n, o) }, e.collectDependency = function (t, n) { void 0 !== e.currentDependencis && e.currentDependencis.addDependency(t, n) }, Object.defineProperty(e, "commentSuffix", { get: function () { return o.commentSuffix }, set: function (e) { o.commentSuffix = e }, enumerable: !1, configurable: !0 }), Object.defineProperty(e, "commentPrefix", { get: function () { return e.commentSuffix }, set: function (t) { e.commentSuffix = t }, enumerable: !1, configurable: !0 }), e.prototype.isValueEmpty = function (e, t) { return void 0 === t && (t = !0), t && (e = this.trimValue(e)), r.isValueEmpty(e) }, e.prototype.trimValue = function (e) { return e && ("string" == typeof e || e instanceof String) ? e.trim() : e }, e.prototype.isPropertyEmpty = function (e) { return "" !== e && this.isValueEmpty(e) }, e.prototype.dispose = function () { for (var e = 0; e < this.eventList.length; e++)this.eventList[e].clear(); this.onPropertyValueChangedCallback = void 0, this.isDisposedValue = !0 }, Object.defineProperty(e.prototype, "isDisposed", { get: function () { return !0 === this.isDisposedValue }, enumerable: !1, configurable: !0 }), e.prototype.addEvent = function () { var e = new de; return this.eventList.push(e), e }, e.prototype.onBaseCreating = function () { }, e.prototype.getType = function () { return "base" }, e.prototype.isDescendantOf = function (e) { return _.isDescendantOf(this.getType(), e) }, e.prototype.getSurvey = function (e) { return void 0 === e && (e = !1), null }, Object.defineProperty(e.prototype, "isDesignMode", { get: function () { var e = this.getSurvey(); return !!e && e.isDesignMode }, enumerable: !1, configurable: !0 }), Object.defineProperty(e.prototype, "inSurvey", { get: function () { return !!this.getSurvey(!0) }, enumerable: !1, configurable: !0 }), Object.defineProperty(e.prototype, "bindings", { get: function () { return this.bindingsValue }, enumerable: !1, configurable: !0 }), e.prototype.checkBindings = function (e, t) { }, e.prototype.updateBindings = function (e, t) { var n = this.bindings.getValueNameByPropertyName(e); n && this.updateBindingValue(n, t) }, e.prototype.updateBindingValue = function (e, t) { }, e.prototype.getTemplate = function () { return this.getType() }, Object.defineProperty(e.prototype, "isLoadingFromJson", { get: function () { return this.isLoadingFromJsonValue || this.getIsLoadingFromJson() }, enumerable: !1, configurable: !0 }), e.prototype.getIsLoadingFromJson = function () { return !(!this.loadingOwner || !this.loadingOwner.isLoadingFromJson) || this.isLoadingFromJsonValue }, e.prototype.startLoadingFromJson = function (e) { this.isLoadingFromJsonValue = !0 }, e.prototype.endLoadingFromJson = function () { this.isLoadingFromJsonValue = !1 }, e.prototype.toJSON = function () { return (new S).toJsonObject(this) }, e.prototype.fromJSON = function (e) { (new S).toObject(e, this), this.onSurveyLoad() }, e.prototype.onSurveyLoad = function () { }, e.prototype.clone = function () { var e = _.createClass(this.getType()); return e.fromJSON(this.toJSON()), e }, e.prototype.getPropertyByName = function (e) { return this.classMetaData || (this.classMetaData = _.findClass(this.getType())), this.classMetaData ? this.classMetaData.findProperty(e) : null }, e.prototype.isPropertyVisible = function (e) { var t = this.getPropertyByName(e); return !!t && t.isVisible("", this) }, e.createProgressInfo = function () { return { questionCount: 0, answeredQuestionCount: 0, requiredQuestionCount: 0, requiredAnsweredQuestionCount: 0 } }, e.prototype.getProgressInfo = function () { return e.createProgressInfo() }, e.prototype.localeChanged = function () { }, e.prototype.locStrsChanged = function () { if (this.arraysInfo) for (var t in this.arraysInfo) { if ((o = this.arraysInfo[t]) && o.isItemValues) { var n = this.getPropertyValue(t); n && e.itemValueLocStrChanged && e.itemValueLocStrChanged(n) } } if (this.localizableStrings) for (var t in this.localizableStrings) { var o; (o = this.getLocalizableString(t)) && o.strChanged() } }, e.prototype.getPropertyValue = function (e, t) { void 0 === t && (t = null); var n = this.getPropertyValueCore(this.propertyHash, e); if (this.isPropertyEmpty(n)) { if (null != t) return t; var o = this.getDefaultValueFromProperty(e); if (void 0 !== o) return o } return n }, e.prototype.getDefaultValueFromProperty = function (e) { var t = this.getPropertyByName(e); if (!(!t || t.isCustom && this.isCreating)) { var n = t.defaultValue; return this.isPropertyEmpty(n) || Array.isArray(n) ? "boolean" != t.type && "switch" != t.type && (t.isCustom && t.onGetValue ? t.onGetValue(this) : void 0) : n } }, e.prototype.getPropertyValueCore = function (t, n) { return this.isLoadingFromJson || e.collectDependency(this, n), this.getPropertyValueCoreHandler ? this.getPropertyValueCoreHandler(t, n) : t[n] }, e.prototype.geValueFromHash = function () { return this.propertyHash.value }, e.prototype.setPropertyValueCore = function (e, t, n) { this.setPropertyValueCoreHandler ? this.isDisposedValue ? console.warn("Attempt to set property '" + t + "' of a disposed object '" + this.getType() + "'") : this.setPropertyValueCoreHandler(e, t, n) : e[t] = n }, Object.defineProperty(e.prototype, "isEditingSurveyElement", { get: function () { var e = this.getSurvey(); return !!e && e.isEditingSurveyElement }, enumerable: !1, configurable: !0 }), e.prototype.iteratePropertiesHash = function (e) { var t = this, n = []; for (var o in this.propertyHash) "value" === o && this.isEditingSurveyElement && Array.isArray(this.value) || n.push(o); n.forEach((function (n) { return e(t.propertyHash, n) })) }, e.prototype.setPropertyValue = function (e, t) { if (!this.isLoadingFromJson) { var n = this.getPropertyByName(e); n && (t = n.settingValue(this, t)) } var o = this.getPropertyValue(e); if (o && Array.isArray(o) && this.arraysInfo && (!t || Array.isArray(t))) { if (this.isTwoValueEquals(o, t)) return; this.setArrayPropertyDirectly(e, t) } else this.setPropertyValueDirectly(e, t), this.isDisposedValue || this.isTwoValueEquals(o, t) || this.propertyValueChanged(e, o, t) }, e.prototype.setArrayPropertyDirectly = function (e, t, n) { void 0 === n && (n = !0); var o = this.arraysInfo[e]; this.setArray(e, this.getPropertyValue(e), t, !!o && o.isItemValues, o ? n && o.onPush : null) }, e.prototype.setPropertyValueDirectly = function (e, t) { this.setPropertyValueCore(this.propertyHash, e, t) }, e.prototype.clearPropertyValue = function (e) { this.setPropertyValueCore(this.propertyHash, e, null), delete this.propertyHash[e] }, e.prototype.onPropertyValueChangedCallback = function (e, t, n, o, r) { }, e.prototype.itemValuePropertyChanged = function (e, t, n, o) { this.onItemValuePropertyChanged.fire(this, { obj: e, name: t, oldValue: n, newValue: o, propertyName: e.ownerPropertyName }) }, e.prototype.onPropertyValueChanged = function (e, t, n) { }, e.prototype.propertyValueChanged = function (e, t, n, o, r) { if (!this.isLoadingFromJson && (this.updateBindings(e, n), this.onPropertyValueChanged(e, t, n), this.onPropertyChanged.fire(this, { name: e, oldValue: t, newValue: n }), this.doPropertyValueChangedCallback(e, t, n, o, this), this.checkConditionPropertyChanged(e), this.onPropChangeFunctions)) for (var i = 0; i < this.onPropChangeFunctions.length; i++)this.onPropChangeFunctions[i].name == e && this.onPropChangeFunctions[i].func(n) }, e.prototype.onBindingChanged = function (e, t) { this.isLoadingFromJson || this.doPropertyValueChangedCallback("bindings", e, t) }, Object.defineProperty(e.prototype, "isInternal", { get: function () { return !1 }, enumerable: !1, configurable: !0 }), e.prototype.doPropertyValueChangedCallback = function (e, t, n, o, r) { if (!this.isInternal) { r || (r = this); var i = this.getSurvey(); i || (i = this), i.onPropertyValueChangedCallback && i.onPropertyValueChangedCallback(e, t, n, r, o), i !== this && this.onPropertyValueChangedCallback && this.onPropertyValueChangedCallback(e, t, n, r, o) } }, e.prototype.addExpressionProperty = function (e, t, n) { this.expressionInfo || (this.expressionInfo = {}), this.expressionInfo[e] = { onExecute: t, canRun: n } }, e.prototype.getDataFilteredValues = function () { return {} }, e.prototype.getDataFilteredProperties = function () { return {} }, e.prototype.runConditionCore = function (e, t) { if (this.expressionInfo) for (var n in this.expressionInfo) this.runConditionItemCore(n, e, t) }, e.prototype.canRunConditions = function () { return !this.isDesignMode }, e.prototype.checkConditionPropertyChanged = function (e) { this.expressionInfo && this.expressionInfo[e] && this.canRunConditions() && this.runConditionItemCore(e, this.getDataFilteredValues(), this.getDataFilteredProperties()) }, e.prototype.runConditionItemCore = function (e, t, n) { var o = this, r = this.expressionInfo[e], i = this.getPropertyValue(e); i && (r.canRun && !r.canRun(this) || (r.runner || (r.runner = new re(i), r.runner.onRunComplete = function (e) { r.onExecute(o, e) }), r.runner.expression = i, r.runner.run(t, n))) }, e.prototype.registerPropertyChangedHandlers = function (e, t, n) { void 0 === n && (n = null); for (var o = 0; o < e.length; o++)this.registerFunctionOnPropertyValueChanged(e[o], t, n) }, e.prototype.unregisterPropertyChangedHandlers = function (e, t) { void 0 === t && (t = null); for (var n = 0; n < e.length; n++)this.unRegisterFunctionOnPropertyValueChanged(e[n], t) }, e.prototype.registerFunctionOnPropertyValueChanged = function (e, t, n) { if (void 0 === n && (n = null), this.onPropChangeFunctions || (this.onPropChangeFunctions = []), n) for (var o = 0; o < this.onPropChangeFunctions.length; o++) { var r = this.onPropChangeFunctions[o]; if (r.name == e && r.key == n) return void (r.func = t) } this.onPropChangeFunctions.push({ name: e, func: t, key: n }) }, e.prototype.registerFunctionOnPropertiesValueChanged = function (e, t, n) { void 0 === n && (n = null), this.registerPropertyChangedHandlers(e, t, n) }, e.prototype.unRegisterFunctionOnPropertyValueChanged = function (e, t) { if (void 0 === t && (t = null), this.onPropChangeFunctions) for (var n = 0; n < this.onPropChangeFunctions.length; n++) { var o = this.onPropChangeFunctions[n]; if (o.name == e && o.key == t) return void this.onPropChangeFunctions.splice(n, 1) } }, e.prototype.unRegisterFunctionOnPropertiesValueChanged = function (e, t) { void 0 === t && (t = null), this.unregisterPropertyChangedHandlers(e, t) }, e.prototype.createCustomLocalizableObj = function (e) { this.getLocalizableString(e) || this.createLocalizableString(e, this, !1, !0) }, e.prototype.getLocale = function () { var e = this.getSurvey(); return e ? e.getLocale() : "" }, e.prototype.getLocalizationString = function (e) { return s.getString(e, this.getLocale()) }, e.prototype.getLocalizationFormatString = function (e) { for (var t = [], n = 1; n < arguments.length; n++)t[n - 1] = arguments[n]; var o = this.getLocalizationString(e); return o && o.format ? o.format.apply(o, t) : "" }, e.prototype.createLocalizableString = function (e, t, n, o) { var r = this; void 0 === n && (n = !1), void 0 === o && (o = !1); var i = new u(t, n, e); return o && (i.localizationName = !0 === o ? e : o), i.onStrChanged = function (t, n) { r.propertyValueChanged(e, t, n) }, this.localizableStrings || (this.localizableStrings = {}), this.localizableStrings[e] = i, i }, e.prototype.getLocalizableString = function (e) { return this.localizableStrings ? this.localizableStrings[e] : null }, e.prototype.getLocalizableStringText = function (t, n) { void 0 === n && (n = ""), e.collectDependency(this, t); var o = this.getLocalizableString(t); if (!o) return ""; var r = o.text; return r || n }, e.prototype.setLocalizableStringText = function (e, t) { var n = this.getLocalizableString(e); n && (n.text != t && (n.text = t)) }, e.prototype.addUsedLocales = function (e) { if (this.localizableStrings) for (var t in this.localizableStrings) { (r = this.getLocalizableString(t)) && this.AddLocStringToUsedLocales(r, e) } if (this.arraysInfo) for (var t in this.arraysInfo) { var n = this.getPropertyValue(t); if (n && n.length) for (var o = 0; o < n.length; o++) { var r; (r = n[o]) && r.addUsedLocales && r.addUsedLocales(e) } } }, e.prototype.searchText = function (e, t) { var n = []; this.getSearchableLocalizedStrings(n); for (var o = 0; o < n.length; o++)n[o].setFindText(e) && t.push({ element: this, str: n[o] }) }, e.prototype.getSearchableLocalizedStrings = function (e) { if (this.localizableStrings) { var t = []; this.getSearchableLocKeys(t); for (var n = 0; n < t.length; n++) { var o = this.getLocalizableString(t[n]); o && e.push(o) } } if (this.arraysInfo) { var r = []; this.getSearchableItemValueKeys(r); for (n = 0; n < r.length; n++) { var i = this.getPropertyValue(r[n]); if (i) for (var s = 0; s < i.length; s++)e.push(i[s].locText) } } }, e.prototype.getSearchableLocKeys = function (e) { }, e.prototype.getSearchableItemValueKeys = function (e) { }, e.prototype.AddLocStringToUsedLocales = function (e, t) { for (var n = e.getLocales(), o = 0; o < n.length; o++)t.indexOf(n[o]) < 0 && t.push(n[o]) }, e.prototype.createItemValues = function (e) { var t = this, n = this.createNewArray(e, (function (n) { if (n.locOwner = t, n.ownerPropertyName = e, "function" == typeof n.getSurvey) { var o = n.getSurvey(); o && "function" == typeof o.makeReactive && o.makeReactive(n) } })); return this.arraysInfo[e].isItemValues = !0, n }, e.prototype.notifyArrayChanged = function (e, t) { e.onArrayChanged && e.onArrayChanged(t) }, e.prototype.createNewArrayCore = function (e) { var t = null; return this.createArrayCoreHandler && (t = this.createArrayCoreHandler(this.propertyHash, e)), t || (t = new Array, this.setPropertyValueCore(this.propertyHash, e, t)), t }, e.prototype.ensureArray = function (e, t, n) { if (void 0 === t && (t = null), void 0 === n && (n = null), !this.arraysInfo || !this.arraysInfo[e]) return this.createNewArray(e, t, n) }, e.prototype.createNewArray = function (e, t, n) { void 0 === t && (t = null), void 0 === n && (n = null); var o = this.createNewArrayCore(e); this.arraysInfo || (this.arraysInfo = {}), this.arraysInfo[e] = { onPush: t, isItemValues: !1 }; var r = this; return o.push = function (n) { var i = Object.getPrototypeOf(o).push.call(o, n); if (!r.isDisposedValue) { t && t(n, o.length - 1); var s = new pe(o.length - 1, 0, [n], []); r.propertyValueChanged(e, o, o, s), r.notifyArrayChanged(o, s) } return i }, o.shift = function () { var t = Object.getPrototypeOf(o).shift.call(o); if (!r.isDisposedValue && t) { n && n(t); var i = new pe(o.length - 1, 1, [], []); r.propertyValueChanged(e, o, o, i), r.notifyArrayChanged(o, i) } return t }, o.unshift = function (n) { var i = Object.getPrototypeOf(o).unshift.call(o, n); if (!r.isDisposedValue) { t && t(n, o.length - 1); var s = new pe(0, 0, [n], []); r.propertyValueChanged(e, o, o, s), r.notifyArrayChanged(o, s) } return i }, o.pop = function () { var t = Object.getPrototypeOf(o).pop.call(o); if (!r.isDisposedValue) { n && n(t); var i = new pe(o.length - 1, 1, [], []); r.propertyValueChanged(e, o, o, i), r.notifyArrayChanged(o, i) } return t }, o.splice = function (i, s) { for (var a, l = [], u = 2; u < arguments.length; u++)l[u - 2] = arguments[u]; i || (i = 0), s || (s = 0); var c = (a = Object.getPrototypeOf(o).splice).call.apply(a, se([o, i, s], l)); if (l || (l = []), !r.isDisposedValue) { if (n && c) for (var p = 0; p < c.length; p++)n(c[p]); if (t) for (p = 0; p < l.length; p++)t(l[p], i + p); var h = new pe(i, s, l, c); r.propertyValueChanged(e, o, o, h), r.notifyArrayChanged(o, h) } return c }, o }, e.prototype.getItemValueType = function () { }, e.prototype.setArray = function (t, n, o, r, i) { var s = [].concat(n); if (Object.getPrototypeOf(n).splice.call(n, 0, n.length), o) for (var a = 0; a < o.length; a++) { var l = o[a]; r && e.createItemValue && (l = e.createItemValue(l, this.getItemValueType())), Object.getPrototypeOf(n).push.call(n, l), i && i(n[a]) } var u = new pe(0, s.length, n, s); this.propertyValueChanged(t, s, n, u), this.notifyArrayChanged(n, u) }, e.prototype.isTwoValueEquals = function (e, t, n, o) { return void 0 === n && (n = !1), void 0 === o && (o = !1), r.isTwoValueEquals(e, t, !1, !n, o) }, e.copyObject = function (e, t) { for (var n in t) { var o = t[n]; "object" == typeof o && (o = {}, this.copyObject(o, t[n])), e[n] = o } }, e.prototype.copyCssClasses = function (t, n) { n && ("string" == typeof n || n instanceof String ? t.root = n : e.copyObject(t, n)) }, e.prototype.getValueInLowCase = function (e) { return e && "string" == typeof e ? e.toLowerCase() : e }, e.prototype.getElementsInDesign = function (e) { return void 0 === e && (e = !1), [] }, e.currentDependencis = void 0, e }(), pe = function (e, t, n, o) { this.index = e, this.deleteCount = t, this.itemsToAdd = n, this.deletedItems = o }, he = function () { function e() { } return Object.defineProperty(e.prototype, "isEmpty", { get: function () { return 0 === this.length }, enumerable: !1, configurable: !0 }), Object.defineProperty(e.prototype, "length", { get: function () { return this.callbacks ? this.callbacks.length : 0 }, enumerable: !1, configurable: !0 }), e.prototype.fireByCreatingOptions = function (e, t) { if (this.callbacks) for (var n = 0; n < this.callbacks.length; n++)if (this.callbacks[n](e, t()), !this.callbacks) return }, e.prototype.fire = function (e, t) { if (this.callbacks) for (var n = 0; n < this.callbacks.length; n++)if (this.callbacks[n](e, t), !this.callbacks) return }, e.prototype.clear = function () { this.callbacks = void 0 }, e.prototype.add = function (e) { this.hasFunc(e) || (this.callbacks || (this.callbacks = new Array), this.callbacks.push(e), this.fireCallbackChanged()) }, e.prototype.remove = function (e) { if (this.hasFunc(e)) { var t = this.callbacks.indexOf(e, 0); this.callbacks.splice(t, 1), this.fireCallbackChanged() } }, e.prototype.hasFunc = function (e) { return null != this.callbacks && this.callbacks.indexOf(e, 0) > -1 }, e.prototype.fireCallbackChanged = function () { this.onCallbacksChanged && this.onCallbacksChanged() }, e }(), de = function (e) { function t() { return null !== e && e.apply(this, arguments) || this } return ie(t, e), t }(he), fe = function () { function e(e, t) { void 0 === e && (e = null), void 0 === t && (t = null), this.text = e, this.errorOwner = t, this.visible = !0, this.onUpdateErrorTextCallback = void 0 } return e.prototype.equalsTo = function (e) { return !(!e || !e.getErrorType) && (this.getErrorType() === e.getErrorType() && (this.text === e.text && this.visible === e.visible)) }, Object.defineProperty(e.prototype, "locText", { get: function () { return this.locTextValue || (this.locTextValue = new u(this.errorOwner, !0), this.locTextValue.storeDefaultText = !0, this.locTextValue.text = this.getText()), this.locTextValue }, enumerable: !1, configurable: !0 }), e.prototype.getText = function () { var e = this.text; return e || (e = this.getDefaultText()), this.errorOwner && (e = this.errorOwner.getErrorCustomText(e, this)), e }, e.prototype.getErrorType = function () { return "base" }, e.prototype.getDefaultText = function () { return "" }, e.prototype.getLocale = function () { return this.errorOwner ? this.errorOwner.getLocale() : "" }, e.prototype.getLocalizationString = function (e) { return s.getString(e, this.getLocale()) }, e.prototype.updateText = function () { this.onUpdateErrorTextCallback && this.onUpdateErrorTextCallback(this), this.locText.text = this.getText() }, e }(), ge = function () { var e = function (t, n) { return (e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (e, t) { e.__proto__ = t } || function (e, t) { for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]) })(t, n) }; return function (t, n) { if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null"); function o() { this.constructor = t } e(t, n), t.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o) } }(), ye = function (e) { function t(t, n) { void 0 === t && (t = null), void 0 === n && (n = null); var o = e.call(this, t, n) || this; return o.text = t, o } return ge(t, e), t.prototype.getErrorType = function () { return "required" }, t.prototype.getDefaultText = function () { return this.getLocalizationString("requiredError") }, t }(fe), me = function (e) { function t(t, n) { void 0 === t && (t = null), void 0 === n && (n = null); var o = e.call(this, t, n) || this; return o.text = t, o } return ge(t, e), t.prototype.getErrorType = function () { return "requireoneanswer" }, t.prototype.getDefaultText = function () { return this.getLocalizationString("requiredErrorInPanel") }, t }(fe), ve = function (e) { function t(t, n) { void 0 === t && (t = null), void 0 === n && (n = null); var o = e.call(this, t, n) || this; return o.text = t, o } return ge(t, e), t.prototype.getErrorType = function () { return "requirenumeric" }, t.prototype.getDefaultText = function () { return this.getLocalizationString("numericError") }, t }(fe), be = function (e) { function t(t, n) { void 0 === n && (n = null); var o = e.call(this, null, n) || this; return o.maxSize = t, o.locText.text = o.getText(), o } return ge(t, e), t.prototype.getErrorType = function () { return "exceedsize" }, t.prototype.getDefaultText = function () { return s.getString("exceedMaxSize").format(this.getTextSize()) }, t.prototype.getTextSize = function () { if (0 === this.maxSize) return "0 Byte"; var e = Math.floor(Math.log(this.maxSize) / Math.log(1024)); return (this.maxSize / Math.pow(1024, e)).toFixed([0, 0, 2, 3, 3][e]) + " " + ["Bytes", "KB", "MB", "GB", "TB"][e] }, t }(fe), Ce = function (e) { function t(t, n, o) { void 0 === o && (o = null); var r = e.call(this, null, o) || this; return r.status = t, r.response = n, r } return ge(t, e), t.prototype.getErrorType = function () { return "webrequest" }, t.prototype.getDefaultText = function () { var e = this.getLocalizationString("urlRequestError"); return e ? e.format(this.status, this.response) : "" }, t }(fe), Pe = function (e) { function t(t, n) { void 0 === n && (n = null); var o = e.call(this, t, n) || this; return o.text = t, o } return ge(t, e), t.prototype.getErrorType = function () { return "webrequestempty" }, t.prototype.getDefaultText = function () { return this.getLocalizationString("urlGetChoicesError") }, t }(fe), we = function (e) { function t(t, n) { void 0 === n && (n = null); var o = e.call(this, t, n) || this; return o.text = t, o } return ge(t, e), t.prototype.getErrorType = function () { return "otherempty" }, t.prototype.getDefaultText = function () { return this.getLocalizationString("otherRequiredError") }, t }(fe), Ve = function (e) { function t(t, n) { void 0 === n && (n = null); var o = e.call(this, t, n) || this; return o.text = t, o } return ge(t, e), t.prototype.getErrorType = function () { return "uploadingfile" }, t.prototype.getDefaultText = function () { return this.getLocalizationString("uploadingFile") }, t }(fe), xe = function (e) { function t(t, n) { void 0 === n && (n = null); var o = e.call(this, t, n) || this; return o.text = t, o } return ge(t, e), t.prototype.getErrorType = function () { return "requiredinallrowserror" }, t.prototype.getDefaultText = function () { return this.getLocalizationString("requiredInAllRowsError") }, t }(fe), Oe = function (e) { function t(t, n) { void 0 === n && (n = null); var o = e.call(this, null, n) || this; return o.minRowCount = t, o } return ge(t, e), t.prototype.getErrorType = function () { return "minrowcounterror" }, t.prototype.getDefaultText = function () { return s.getString("minRowCountError").format(this.minRowCount) }, t }(fe), Te = function (e) { function t(t, n) { void 0 === n && (n = null); var o = e.call(this, t, n) || this; return o.text = t, o } return ge(t, e), t.prototype.getErrorType = function () { return "keyduplicationerror" }, t.prototype.getDefaultText = function () { return this.getLocalizationString("keyDuplicationError") }, t }(fe), Se = function (e) { function t(t, n) { void 0 === n && (n = null); var o = e.call(this, t, n) || this; return o.text = t, o } return ge(t, e), t.prototype.getErrorType = function () { return "custom" }, t }(fe), _e = function () { var e = function (t, n) { return (e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (e, t) { e.__proto__ = t } || function (e, t) { for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]) })(t, n) }; return function (t, n) { if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null"); function o() { this.constructor = t } e(t, n), t.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o) } }(), Ie = function (e, t) { void 0 === t && (t = null), this.value = e, this.error = t }, Re = function (e) { function t() { var t = e.call(this) || this; return t.createLocalizableString("text", t, !0), t } return _e(t, e), t.prototype.getSurvey = function (e) { return void 0 === e && (e = !1), this.errorOwner && this.errorOwner.getSurvey ? this.errorOwner.getSurvey() : null }, Object.defineProperty(t.prototype, "text", { get: function () { return this.getLocalizableStringText("text") }, set: function (e) { this.setLocalizableStringText("text", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "isValidateAllValues", { get: function () { return !1 }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "locText", { get: function () { return this.getLocalizableString("text") }, enumerable: !1, configurable: !0 }), t.prototype.getErrorText = function (e) { return this.text ? this.text : this.getDefaultErrorText(e) }, t.prototype.getDefaultErrorText = function (e) { return "" }, t.prototype.validate = function (e, t, n, o) { return void 0 === t && (t = null), void 0 === n && (n = null), void 0 === o && (o = null), null }, Object.defineProperty(t.prototype, "isRunning", { get: function () { return !1 }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "isAsync", { get: function () { return !1 }, enumerable: !1, configurable: !0 }), t.prototype.getLocale = function () { return this.errorOwner ? this.errorOwner.getLocale() : "" }, t.prototype.getMarkdownHtml = function (e, t) { return this.errorOwner ? this.errorOwner.getMarkdownHtml(e, t) : void 0 }, t.prototype.getRenderer = function (e) { return this.errorOwner ? this.errorOwner.getRenderer(e) : null }, t.prototype.getRendererContext = function (e) { return this.errorOwner ? this.errorOwner.getRendererContext(e) : e }, t.prototype.getProcessedText = function (e) { return this.errorOwner ? this.errorOwner.getProcessedText(e) : e }, t.prototype.createCustomError = function (e) { var t = this, n = new Se(this.getErrorText(e), this.errorOwner); return n.onUpdateErrorTextCallback = function (n) { return n.text = t.getErrorText(e) }, n }, t.prototype.toString = function () { var e = this.getType().replace("validator", ""); return this.text && (e += ", " + this.text), e }, t }(ce), Ee = function () { function e() { } return e.prototype.run = function (e) { var t = this, n = [], o = null, r = null; this.prepareAsyncValidators(); for (var i = [], s = e.getValidators(), a = 0; a < s.length; a++) { var l = s[a]; !o && l.isValidateAllValues && (o = e.getDataFilteredValues(), r = e.getDataFilteredProperties()), l.isAsync && (this.asyncValidators.push(l), l.onAsyncCompleted = function (e) { if (e && e.error && i.push(e.error), t.onAsyncCompleted) { for (var n = 0; n < t.asyncValidators.length; n++)if (t.asyncValidators[n].isRunning) return; t.onAsyncCompleted(i) } }) } s = e.getValidators(); for (a = 0; a < s.length; a++) { var u = (l = s[a]).validate(e.validatedValue, e.getValidatorTitle(), o, r); u && u.error && n.push(u.error) } return 0 == this.asyncValidators.length && this.onAsyncCompleted && this.onAsyncCompleted([]), n }, e.prototype.prepareAsyncValidators = function () { if (this.asyncValidators) for (var e = 0; e < this.asyncValidators.length; e++)this.asyncValidators[e].onAsyncCompleted = null; this.asyncValidators = [] }, e }(), De = function (e) { function t(t, n) { void 0 === t && (t = null), void 0 === n && (n = null); var o = e.call(this) || this; return o.minValue = t, o.maxValue = n, o } return _e(t, e), t.prototype.getType = function () { return "numericvalidator" }, t.prototype.validate = function (e, t, n, o) { if (void 0 === t && (t = null), void 0 === n && (n = null), void 0 === o && (o = null), this.isValueEmpty(e)) return null; if (!r.isNumber(e)) return new Ie(null, new ve(null, this.errorOwner)); var i = new Ie(r.getNumber(e)); return null !== this.minValue && this.minValue > i.value || null !== this.maxValue && this.maxValue < i.value ? (i.error = this.createCustomError(t), i) : "number" == typeof e ? null : i }, t.prototype.getDefaultErrorText = function (e) { var t = e || this.getLocalizationString("value"); return null !== this.minValue && null !== this.maxValue ? this.getLocalizationFormatString("numericMinMax", t, this.minValue, this.maxValue) : null !== this.minValue ? this.getLocalizationFormatString("numericMin", t, this.minValue) : this.getLocalizationFormatString("numericMax", t, this.maxValue) }, Object.defineProperty(t.prototype, "minValue", { get: function () { return this.getPropertyValue("minValue") }, set: function (e) { this.setPropertyValue("minValue", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "maxValue", { get: function () { return this.getPropertyValue("maxValue") }, set: function (e) { this.setPropertyValue("maxValue", e) }, enumerable: !1, configurable: !0 }), t }(Re), Ae = function (e) { function t() { return e.call(this) || this } return _e(t, e), t.prototype.getType = function () { return "textvalidator" }, t.prototype.validate = function (e, t, n, o) { if (void 0 === t && (t = null), void 0 === n && (n = null), void 0 === o && (o = null), this.isValueEmpty(e)) return null; if (!this.allowDigits) { if (!/^[A-Za-z\s]*$/.test(e)) return new Ie(null, this.createCustomError(t)) } return this.minLength > 0 && e.length < this.minLength || this.maxLength > 0 && e.length > this.maxLength ? new Ie(null, this.createCustomError(t)) : null }, t.prototype.getDefaultErrorText = function (e) { return this.minLength > 0 && this.maxLength > 0 ? this.getLocalizationFormatString("textMinMaxLength", this.minLength, this.maxLength) : this.minLength > 0 ? this.getLocalizationFormatString("textMinLength", this.minLength) : this.getLocalizationFormatString("textMaxLength", this.maxLength) }, Object.defineProperty(t.prototype, "minLength", { get: function () { return this.getPropertyValue("minLength") }, set: function (e) { this.setPropertyValue("minLength", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "maxLength", { get: function () { return this.getPropertyValue("maxLength") }, set: function (e) { this.setPropertyValue("maxLength", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "allowDigits", { get: function () { return this.getPropertyValue("allowDigits") }, set: function (e) { this.setPropertyValue("allowDigits", e) }, enumerable: !1, configurable: !0 }), t }(Re), Le = function (e) { function t(t, n) { void 0 === t && (t = null), void 0 === n && (n = null); var o = e.call(this) || this; return o.minCount = t, o.maxCount = n, o } return _e(t, e), t.prototype.getType = function () { return "answercountvalidator" }, t.prototype.validate = function (e, t, n, o) { if (void 0 === t && (t = null), void 0 === n && (n = null), void 0 === o && (o = null), null == e || e.constructor != Array) return null; var r = e.length; return 0 == r ? null : this.minCount && r < this.minCount ? new Ie(null, this.createCustomError(this.getLocalizationFormatString("minSelectError", this.minCount))) : this.maxCount && r > this.maxCount ? new Ie(null, this.createCustomError(this.getLocalizationFormatString("maxSelectError", this.maxCount))) : null }, t.prototype.getDefaultErrorText = function (e) { return e }, Object.defineProperty(t.prototype, "minCount", { get: function () { return this.getPropertyValue("minCount") }, set: function (e) { this.setPropertyValue("minCount", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "maxCount", { get: function () { return this.getPropertyValue("maxCount") }, set: function (e) { this.setPropertyValue("maxCount", e) }, enumerable: !1, configurable: !0 }), t }(Re), je = function (e) { function t(t) { void 0 === t && (t = null); var n = e.call(this) || this; return n.regex = t, n } return _e(t, e), t.prototype.getType = function () { return "regexvalidator" }, t.prototype.validate = function (e, t, n, o) { if (void 0 === t && (t = null), void 0 === n && (n = null), void 0 === o && (o = null), !this.regex || this.isValueEmpty(e)) return null; var r = new RegExp(this.regex); if (Array.isArray(e)) for (var i = 0; i < e.length; i++) { var s = this.hasError(r, e[i], t); if (s) return s } return this.hasError(r, e, t) }, t.prototype.hasError = function (e, t, n) { return e.test(t) ? null : new Ie(t, this.createCustomError(n)) }, Object.defineProperty(t.prototype, "regex", { get: function () { return this.getPropertyValue("regex") }, set: function (e) { this.setPropertyValue("regex", e) }, enumerable: !1, configurable: !0 }), t }(Re), Ne = function (e) { function t() { var t = e.call(this) || this; return t.re = /^(([^<>()\[\]\.,;:\s@\"]+(\.[^<>()\[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()=[\]\.,;:\s@\"]+\.)+[^<>()=[\]\.,;:\s@\"]{2,})$/i, t } return _e(t, e), t.prototype.getType = function () { return "emailvalidator" }, t.prototype.validate = function (e, t, n, o) { return void 0 === t && (t = null), void 0 === n && (n = null), void 0 === o && (o = null), e ? this.re.test(e) ? null : new Ie(e, this.createCustomError(t)) : null }, t.prototype.getDefaultErrorText = function (e) { return this.getLocalizationString("invalidEmail") }, t }(Re), Me = function (e) { function t(t) { void 0 === t && (t = null); var n = e.call(this) || this; return n.conditionRunner = null, n.isRunningValue = !1, n.expression = t, n } return _e(t, e), t.prototype.getType = function () { return "expressionvalidator" }, Object.defineProperty(t.prototype, "isValidateAllValues", { get: function () { return !0 }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "isAsync", { get: function () { return !!this.ensureConditionRunner() && this.conditionRunner.isAsync }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "isRunning", { get: function () { return this.isRunningValue }, enumerable: !1, configurable: !0 }), t.prototype.validate = function (e, t, n, o) { var r = this; if (void 0 === t && (t = null), void 0 === n && (n = null), void 0 === o && (o = null), !this.ensureConditionRunner()) return null; this.conditionRunner.onRunComplete = function (n) { r.isRunningValue = !1, r.onAsyncCompleted && r.onAsyncCompleted(r.generateError(n, e, t)) }, this.isRunningValue = !0; var i = this.conditionRunner.run(n, o); return this.conditionRunner.isAsync ? null : (this.isRunningValue = !1, this.generateError(i, e, t)) }, t.prototype.generateError = function (e, t, n) { return e ? null : new Ie(t, this.createCustomError(n)) }, t.prototype.getDefaultErrorText = function (e) { return this.getLocalizationFormatString("invalidExpression", this.expression) }, t.prototype.ensureConditionRunner = function () { return this.conditionRunner ? (this.conditionRunner.expression = this.expression, !0) : !!this.expression && (this.conditionRunner = new oe(this.expression), !0) }, Object.defineProperty(t.prototype, "expression", { get: function () { return this.getPropertyValue("expression") }, set: function (e) { this.setPropertyValue("expression", e) }, enumerable: !1, configurable: !0 }), t }(Re); _.addClass("surveyvalidator", [{ name: "text", serializationProperty: "locText" }]), _.addClass("numericvalidator", ["minValue:number", "maxValue:number"], (function () { return new De }), "surveyvalidator"), _.addClass("textvalidator", [{ name: "minLength:number", default: 0 }, { name: "maxLength:number", default: 0 }, { name: "allowDigits:boolean", default: !0 }], (function () { return new Ae }), "surveyvalidator"), _.addClass("answercountvalidator", ["minCount:number", "maxCount:number"], (function () { return new Le }), "surveyvalidator"), _.addClass("regexvalidator", ["regex"], (function () { return new je }), "surveyvalidator"), _.addClass("emailvalidator", [], (function () { return new Ne }), "surveyvalidator"), _.addClass("expressionvalidator", ["expression:condition"], (function () { return new Me }), "surveyvalidator"); var Fe = function () { var e = function (t, n) { return (e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (e, t) { e.__proto__ = t } || function (e, t) { for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]) })(t, n) }; return function (t, n) { if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null"); function o() { this.constructor = t } e(t, n), t.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o) } }(), qe = function (e) { function t(t, n, o) { void 0 === n && (n = null), void 0 === o && (o = "itemvalue"); var i = e.call(this) || this; return i.typeName = o, i.ownerPropertyName = "", i.locTextValue = new u(i, !0, "text"), i.locTextValue.onStrChanged = function (e, t) { t == i.value && (t = void 0), i.propertyValueChanged("text", e, t) }, i.locTextValue.onGetTextCallback = function (e) { return e || (r.isValueEmpty(i.value) ? null : i.value.toString()) }, n && (i.locText.text = n), t && "object" == typeof t ? i.setData(t) : i.value = t, "itemvalue" != i.getType() && v.createProperties(i), i.onCreating(), i } return Fe(t, e), t.prototype.getMarkdownHtml = function (e, t) { return this.locOwner ? this.locOwner.getMarkdownHtml(e, t) : void 0 }, t.prototype.getRenderer = function (e) { return this.locOwner ? this.locOwner.getRenderer(e) : null }, t.prototype.getRendererContext = function (e) { return this.locOwner ? this.locOwner.getRendererContext(e) : e }, t.prototype.getProcessedText = function (e) { return this.locOwner ? this.locOwner.getProcessedText(e) : e }, Object.defineProperty(t, "Separator", { get: function () { return o.itemValueSeparator }, set: function (e) { o.itemValueSeparator = e }, enumerable: !1, configurable: !0 }), t.setData = function (e, t, n) { e.length = 0; for (var o = 0; o < t.length; o++) { var r = t[o], i = r && "function" == typeof r.getType ? r.getType() : null != n ? n : "itemvalue", s = _.createClass(i); s.setData(r), r.originalItem && (s.originalItem = r.originalItem), e.push(s) } }, t.getData = function (e) { for (var t = [], n = 0; n < e.length; n++)t.push(e[n].getData()); return t }, t.getItemByValue = function (e, t) { if (!Array.isArray(e)) return null; for (var n = r.isValueEmpty(t), o = 0; o < e.length; o++) { if (n && r.isValueEmpty(e[o].value)) return e[o]; if (r.isTwoValueEquals(e[o].value, t, !1, !0, !1)) return e[o] } return null }, t.getTextOrHtmlByValue = function (e, n) { var o = t.getItemByValue(e, n); return null !== o ? o.locText.textOrHtml : "" }, t.locStrsChanged = function (e) { for (var t = 0; t < e.length; t++)e[t].locStrsChanged() }, t.runConditionsForItems = function (e, n, o, r, i, s, a) { return void 0 === s && (s = !0), t.runConditionsForItemsCore(e, n, o, r, i, !0, s, a) }, t.runEnabledConditionsForItems = function (e, n, o, r, i) { return t.runConditionsForItemsCore(e, null, n, o, r, !1, !0, i) }, t.runConditionsForItemsCore = function (e, t, n, o, r, i, s, a) { void 0 === s && (s = !0), o || (o = {}); for (var l = o.item, u = o.choice, c = !1, p = 0; p < e.length; p++) { var h = e[p]; o.item = h.value, o.choice = h.value; var d = !(!s || !h.getConditionRunner) && h.getConditionRunner(i); d || (d = n); var f = !0; d && (f = d.run(o, r)), a && (f = a(h, f)), t && f && t.push(h), f != (i ? h.isVisible : h.isEnabled) && (c = !0, i ? h.setIsVisible && h.setIsVisible(f) : h.setIsEnabled && h.setIsEnabled(f)) } return l ? o.item = l : delete o.item, u ? o.choice = u : delete o.choice, c }, t.prototype.onCreating = function () { }, t.prototype.getType = function () { return this.typeName ? this.typeName : "itemvalue" }, t.prototype.getSurvey = function (e) { return void 0 === e && (e = !1), this.locOwner && this.locOwner.getSurvey ? this.locOwner.getSurvey() : null }, t.prototype.getLocale = function () { return this.locOwner && this.locOwner.getLocale ? this.locOwner.getLocale() : "" }, Object.defineProperty(t.prototype, "locText", { get: function () { return this.locTextValue }, enumerable: !1, configurable: !0 }), t.prototype.setLocText = function (e) { this.locTextValue = e }, Object.defineProperty(t.prototype, "locOwner", { get: function () { return this._locOwner }, set: function (e) { this._locOwner = e }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "value", { get: function () { return this.getPropertyValue("value") }, set: function (e) { var t = void 0; if (!r.isValueEmpty(e)) { var n = e.toString(), i = n.indexOf(o.itemValueSeparator); i > -1 && (e = n.slice(0, i), t = n.slice(i + 1)) } this.setPropertyValue("value", e), t && (this.text = t) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "hasText", { get: function () { return !!this.locText.pureText }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "pureText", { get: function () { return this.locText.pureText }, set: function (e) { this.text = e }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "text", { get: function () { return this.locText.calculatedText }, set: function (e) { this.locText.text = e }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "calculatedText", { get: function () { return this.locText.calculatedText }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "shortcutText", { get: function () { return this.text }, enumerable: !1, configurable: !0 }), t.prototype.canSerializeValue = function () { var e = this.value; return null != e && (!Array.isArray(e) && "object" != typeof e) }, t.prototype.getData = function () { var e = this.toJSON(); if (e.value && e.value.pos && delete e.value.pos, r.isValueEmpty(e.value)) return e; var t = this.canSerializeValue(); return t && (o.itemValueAlwaysSerializeAsObject || o.itemValueAlwaysSerializeText) || 1 != Object.keys(e).length ? (o.itemValueAlwaysSerializeText && void 0 === e.text && t && (e.text = this.value.toString()), e) : this.value }, t.prototype.toJSON = function () { var e = {}, t = _.getProperties(this.getType()); t && 0 != t.length || (t = _.getProperties("itemvalue")); for (var n = new S, o = 0; o < t.length; o++) { var i = t[o]; "text" === i.name && !this.locText.hasNonDefaultText() && r.isTwoValueEquals(this.value, this.text, !1, !0, !1) || n.valueToJson(this, e, i) } return e }, t.prototype.setData = function (e) { if (!r.isValueEmpty(e)) { if (void 0 === e.value && void 0 !== e.text && 1 === Object.keys(e).length && (e.value = e.text), void 0 !== e.value) { var t = void 0; t = "function" == typeof e.toJSON ? e.toJSON() : e, (new S).toObject(t, this) } else this.value = e; this.locText.strChanged() } }, Object.defineProperty(t.prototype, "visibleIf", { get: function () { return this.getPropertyValue("visibleIf", "") }, set: function (e) { this.setPropertyValue("visibleIf", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "enableIf", { get: function () { return this.getPropertyValue("enableIf", "") }, set: function (e) { this.setPropertyValue("enableIf", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "isVisible", { get: function () { return this.getPropertyValue("isVisible", !0) }, enumerable: !1, configurable: !0 }), t.prototype.setIsVisible = function (e) { this.setPropertyValue("isVisible", e) }, Object.defineProperty(t.prototype, "isEnabled", { get: function () { return this.getPropertyValue("isEnabled", !0) }, enumerable: !1, configurable: !0 }), t.prototype.setIsEnabled = function (e) { this.setPropertyValue("isEnabled", e) }, t.prototype.addUsedLocales = function (e) { this.AddLocStringToUsedLocales(this.locTextValue, e) }, t.prototype.locStrsChanged = function () { e.prototype.locStrsChanged.call(this), this.locText.strChanged() }, t.prototype.onPropertyValueChanged = function (e, t, n) { "value" !== e || this.hasText || this.locText.strChanged(); this.locOwner && this.locOwner.itemValuePropertyChanged && this.locOwner.itemValuePropertyChanged(this, e, t, n) }, t.prototype.getConditionRunner = function (e) { return e ? this.getVisibleConditionRunner() : this.getEnableConditionRunner() }, t.prototype.getVisibleConditionRunner = function () { return this.visibleIf ? (this.visibleConditionRunner || (this.visibleConditionRunner = new oe(this.visibleIf)), this.visibleConditionRunner.expression = this.visibleIf, this.visibleConditionRunner) : null }, t.prototype.getEnableConditionRunner = function () { return this.enableIf ? (this.enableConditionRunner || (this.enableConditionRunner = new oe(this.enableIf)), this.enableConditionRunner.expression = this.enableIf, this.enableConditionRunner) : null }, t }(ce); ce.createItemValue = function (e, t) { var n = null; return (n = t ? S.metaData.createClass(t, {}) : "function" == typeof e.getType ? new qe(null, void 0, e.getType()) : new qe(null)).setData(e), n }, ce.itemValueLocStrChanged = function (e) { qe.locStrsChanged(e) }, m.getItemValuesDefaultValue = function (e, t) { var n = new Array; return qe.setData(n, Array.isArray(e) ? e : [], t), n }, _.addClass("itemvalue", ["!value", { name: "text", serializationProperty: "locText" }, { name: "visibleIf:condition", showMode: "form" }, { name: "enableIf:condition", showMode: "form", visibleIf: function (e) { return !e || "rateValues" !== e.ownerPropertyName } }], (function (e) { return new qe(e) })); var ke = n(1); function Be(e) { return o && o.confirmActionFunc ? o.confirmActionFunc(e) : confirm(e) } function Qe() { if ("undefined" == typeof window) return !1; if (void 0 === Qe.isIEOrEdge) { var e = window.navigator.userAgent, t = e.indexOf("MSIE "), n = e.indexOf("Trident/"), o = e.indexOf("Edge/"); Qe.isIEOrEdge = o > 0 || n > 0 || t > 0 } return Qe.isIEOrEdge } function He(e, t) { try { for (var n = atob(e.split(",")[1]), o = e.split(",")[0].split(":")[1].split(";")[0], r = new ArrayBuffer(n.length), i = new Uint8Array(r), s = 0; s < n.length; s++)i[s] = n.charCodeAt(s); var a = new Blob([r], { type: o }); "undefined" != typeof window && window.navigator && window.navigator.msSaveBlob && window.navigator.msSaveOrOpenBlob(a, t) } catch (e) { } } function ze(e) { return e ? e.scrollHeight > e.clientHeight && ("scroll" === getComputedStyle(e).overflowY || "auto" === getComputedStyle(e).overflowY) || e.scrollWidth > e.clientWidth && ("scroll" === getComputedStyle(e).overflowX || "auto" === getComputedStyle(e).overflowX) ? e : ze(e.parentElement) : document.documentElement } function Ue(e, t, n, r, i, s) { if (i) { "auto" !== e && (i.style.width = (e || t || 16) + "px", i.style.height = (e || n || 16) + "px"); var a = i.childNodes[0], l = function (e) { if (!e) return e; var t = o.customIcons[e]; return t || e }(r); a.setAttributeNS("http://www.w3.org/1999/xlink", "xlink:href", "#" + l); var u = i.getElementsByTagName("title")[0]; s ? (u || (u = document.createElementNS("http://www.w3.org/2000/svg", "title"), i.appendChild(u)), u.textContent = s) : u && i.removeChild(u) } } function We(e) { return "function" != typeof e ? e : e() } function Je(e) { if ("number" == typeof e) return e + "px"; if (e && "string" == typeof e && e.length > 0) { var t = e[e.length - 1]; if (t >= "0" && t <= "9" || "." == t) try { return parseFloat(e) + "px" } catch (e) { } } return e } function Ge(e) { var t = e.target; t && t.classList && t.classList.remove("sv-focused--by-key") } function $e(e, t) { if (!e.target || "true" !== e.target.contentEditable) { var n = e.target; if (n) { var o = e.which || e.keyCode; 9 === o ? n.classList && !n.classList.contains("sv-focused--by-key") && n.classList.add("sv-focused--by-key") : 13 === o || 32 === o ? n.click && n.click() : t && !t.processEsc || 27 !== o || n.blur && n.blur() } } } function Ke(e, t) { if (void 0 === t && (t = { processEsc: !0 }), !e.target || "true" !== e.target.contentEditable) { var n = e.which || e.keyCode, o = [13, 32]; t.processEsc && o.push(27), -1 !== o.indexOf(n) && e.preventDefault() } } function Xe(e, t) { if (e) { t || (t = function (e) { return window.getComputedStyle(e) }); var n = t(e); e.style.height = "auto", e.style.height = e.scrollHeight + parseFloat(n.borderTopWidth) + parseFloat(n.borderBottomWidth) + "px" } } function Ye(e) { return e.originalEvent || e } function Ze(e) { e.preventDefault(), e.stopPropagation() } function et(e) { return getComputedStyle ? Number.parseFloat(getComputedStyle(e).width) : e.offsetWidth } function tt(e) { return !!(e.offsetWidth || e.offsetHeight || e.getClientRects().length) } function nt(e) { if (window.getSelection && document.createRange && e.childNodes.length > 0) { var t = document.getSelection(), n = t.getRangeAt(0); n.setStart(n.endContainer, n.endOffset), n.setEndAfter(e.lastChild), t.removeAllRanges(), t.addRange(n); var o = t.toString().replace(/\n/g, "").length; e.innerText = e.innerText.replace(/\n/g, ""), (n = document.createRange()).setStart(e.childNodes[0], e.innerText.length - o), n.collapse(!0), t.removeAllRanges(), t.addRange(n) } } function ot(e, t) { if (t && e && "object" == typeof t) for (var n in e) { var o = e[n]; o && "object" == typeof o ? (t[n] && "object" == typeof t[n] || (t[n] = {}), ot(o, t[n])) : t[n] = o } } !function () { function e() { this._result = "" } e.prototype.log = function (e) { this._result += "->" + e }, Object.defineProperty(e.prototype, "result", { get: function () { return this._result }, enumerable: !1, configurable: !0 }) }(); var rt = function () { var e = function (t, n) { return (e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (e, t) { e.__proto__ = t } || function (e, t) { for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]) })(t, n) }; return function (t, n) { if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null"); function o() { this.constructor = t } e(t, n), t.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o) } }(), it = function () { function e(e, t, n, o) { var r = this; void 0 === o && (o = null), this.container = e, this.model = t, this.itemsSelector = n, this.dotsItemSize = o, this.resizeObserver = void 0, this.isInitialized = !1, this.minDimensionConst = 56, this.separatorSize = 17, this.separatorAddConst = 1, this.paddingSizeConst = 8, this.dotsSizeConst = 48, this.recalcMinDimensionConst = !0, this.getComputedStyle = window.getComputedStyle.bind(window), this.model.updateCallback = function (e) { e ? r.isInitialized = !1 : Object(ke.setTimeout)((function () { r.process() }), 1) }, "undefined" != typeof ResizeObserver && (this.resizeObserver = new ResizeObserver((function (e) { return r.process() })), this.resizeObserver.observe(this.container.parentElement)) } return e.prototype.getDimensions = function (e) { return { scroll: e.scrollWidth, offset: e.offsetWidth } }, e.prototype.getAvailableSpace = function () { var e = this.getComputedStyle(this.container), t = this.container.offsetWidth; return "border-box" === e.boxSizing && (t -= parseFloat(e.paddingLeft) + parseFloat(e.paddingRight)), t }, e.prototype.calcItemSize = function (e) { return e.offsetWidth }, e.prototype.calcMinDimension = function (e) { var t = this.minDimensionConst; return e.iconSize && this.recalcMinDimensionConst && (t = 2 * e.iconSize + this.paddingSizeConst), e.canShrink ? t + (e.needSeparator ? this.separatorSize : 0) : e.maxDimension }, e.prototype.calcItemsSizes = function () { var e = this, t = this.model.actions; this.container.querySelectorAll(this.itemsSelector).forEach((function (n, o) { var r = t[o]; e.calcActionDimensions(r, n) })) }, e.prototype.calcActionDimensions = function (e, t) { e.maxDimension = this.calcItemSize(t), e.minDimension = this.calcMinDimension(e) }, Object.defineProperty(e.prototype, "isContainerVisible", { get: function () { return tt(this.container) }, enumerable: !1, configurable: !0 }), e.prototype.process = function () { var e; if (this.isContainerVisible && !this.model.isResponsivenessDisabled) { this.isInitialized || (this.model.setActionsMode("large"), this.calcItemsSizes(), this.isInitialized = !0); var t = this.dotsItemSize; if (!this.dotsItemSize) { var n = null === (e = this.container) || void 0 === e ? void 0 : e.querySelector(".sv-dots"); t = n && this.calcItemSize(n) || this.dotsSizeConst } this.model.fit(this.getAvailableSpace(), t) } }, e.prototype.dispose = function () { this.model.updateCallback = void 0, this.resizeObserver && this.resizeObserver.disconnect() }, e }(), st = function (e) { function t(t, n, o, r, i) { void 0 === i && (i = 40); var s = e.call(this, t, n, o, r) || this; return s.minDimensionConst = i, s.recalcMinDimensionConst = !1, s } return rt(t, e), t.prototype.getDimensions = function () { return { scroll: this.container.scrollHeight, offset: this.container.offsetHeight } }, t.prototype.getAvailableSpace = function () { var e = this.getComputedStyle(this.container), t = this.container.offsetHeight; return "border-box" === e.boxSizing && (t -= parseFloat(e.paddingTop) + parseFloat(e.paddingBottom)), t }, t.prototype.calcItemSize = function (e) { return e.offsetHeight }, t.prototype.calcActionDimensions = function (e, t) { e.maxDimension = this.calcItemSize(t), e.minDimension = this.calcItemSize(t) }, t }(it), at = function () { function e() { this.classes = [] } return e.prototype.isEmpty = function () { return "" === this.toString() }, e.prototype.append = function (e, t) { return void 0 === t && (t = !0), e && t && ("string" == typeof e && (e = e.trim()), this.classes.push(e)), this }, e.prototype.toString = function () { return this.classes.join(" ") }, e }(), lt = function () { var e = function (t, n) { return (e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (e, t) { e.__proto__ = t } || function (e, t) { for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]) })(t, n) }; return function (t, n) { if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null"); function o() { this.constructor = t } e(t, n), t.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o) } }(), ut = function (e, t, n, o) { var r, i = arguments.length, s = i < 3 ? t : null === o ? o = Object.getOwnPropertyDescriptor(t, n) : o; if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) s = Reflect.decorate(e, t, n, o); else for (var a = e.length - 1; a >= 0; a--)(r = e[a]) && (s = (i < 3 ? r(s) : i > 3 ? r(t, n, s) : r(t, n)) || s); return i > 3 && s && Object.defineProperty(t, n, s), s }, ct = { root: "sv-action-bar", defaultSizeMode: "sv-action-bar--default-size-mode", smallSizeMode: "sv-action-bar--small-size-mode", item: "sv-action-bar-item", itemActive: "sv-action-bar-item--active", itemPressed: "sv-action-bar-item--pressed", itemIcon: "sv-action-bar-item__icon", itemTitle: "sv-action-bar-item__title", itemTitleWithIcon: "sv-action-bar-item__title--with-icon" }, pt = function (e) { function t() { var t = null !== e && e.apply(this, arguments) || this; return t.sizeMode = "default", t } return lt(t, e), t.prototype.getMarkdownHtml = function (e, t) { return this.locOwner ? this.locOwner.getMarkdownHtml(e, t) : void 0 }, t.prototype.getRenderer = function (e) { return this.locOwner ? this.locOwner.getRenderer(e) : null }, t.prototype.getRendererContext = function (e) { return this.locOwner ? this.locOwner.getRendererContext(e) : e }, t.prototype.getProcessedText = function (e) { return this.locOwner ? this.locOwner.getProcessedText(e) : e }, t.prototype.getLocale = function () { return this.locOwner ? this.locOwner.getLocale() : "" }, t.prototype.getRenderedActions = function () { return this.actions }, t.prototype.locStrsChanged = function () { e.prototype.locStrsChanged.call(this), this.actions.forEach((function (e) { return e.locStrsChanged() })) }, t.prototype.raiseUpdate = function (e) { this.isEmpty = !this.actions.some((function (e) { return e.visible })), this.updateCallback && this.updateCallback(e) }, t.prototype.onSet = function () { var e = this; this.actions.forEach((function (t) { e.setActionCssClasses(t) })), this.raiseUpdate(!0) }, t.prototype.onPush = function (e) { this.setActionCssClasses(e), e.owner = this, this.raiseUpdate(!0) }, t.prototype.onRemove = function (e) { e.owner = null, this.raiseUpdate(!0) }, t.prototype.setActionCssClasses = function (e) { e.cssClasses = this.cssClasses }, Object.defineProperty(t.prototype, "hasActions", { get: function () { return (this.actions || []).length > 0 }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "renderedActions", { get: function () { return this.getRenderedActions() }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "visibleActions", { get: function () { return this.actions.filter((function (e) { return !1 !== e.visible })) }, enumerable: !1, configurable: !0 }), t.prototype.getRootCss = function () { var e = "small" === this.sizeMode ? this.cssClasses.smallSizeMode : this.cssClasses.defaultSizeMode; return (new at).append(this.cssClasses.root + (e ? " " + e : "") + (this.containerCss ? " " + this.containerCss : "")).append(this.cssClasses.root + "--empty", this.isEmpty).toString() }, t.prototype.getDefaultCssClasses = function () { return ct }, Object.defineProperty(t.prototype, "cssClasses", { get: function () { return this.cssClassesValue || (this.cssClassesValue = this.getDefaultCssClasses()), this.cssClassesValue }, set: function (e) { var t = this; this.cssClassesValue = {}, this.copyCssClasses(this.cssClassesValue, this.getDefaultCssClasses()), ot(e, this.cssClasses), this.actions.forEach((function (e) { t.setActionCssClasses(e) })) }, enumerable: !1, configurable: !0 }), t.prototype.createAction = function (e) { return e instanceof Tt ? e : new Tt(e) }, t.prototype.addAction = function (e, t) { void 0 === t && (t = !0); var n = this.createAction(e); return this.actions.push(n), this.sortItems(), n }, t.prototype.sortItems = function () { this.actions = [].concat(this.actions.filter((function (e) { return void 0 === e.visibleIndex || e.visibleIndex >= 0 }))).sort((function (e, t) { return e.visibleIndex - t.visibleIndex })) }, t.prototype.setItems = function (e, t) { var n = this; void 0 === t && (t = !0), this.actions = e.map((function (e) { return n.createAction(e) })), t && this.sortItems() }, t.prototype.initResponsivityManager = function (e) { }, t.prototype.resetResponsivityManager = function () { }, t.prototype.getActionById = function (e) { for (var t = 0; t < this.actions.length; t++)if (this.actions[t].id === e) return this.actions[t]; return null }, ut([y({ onSet: function (e, t) { t.onSet() }, onPush: function (e, t, n) { n.onPush(e) }, onRemove: function (e, t, n) { n.onRemove(e) } })], t.prototype, "actions", void 0), ut([f({ defaultValue: !1 })], t.prototype, "isEmpty", void 0), t }(ce), ht = function () { function e() { } return e.focusElement = function (e) { e && e.focus() }, e.visibility = function (e) { var t = window.getComputedStyle(e); return "none" !== t.display && "hidden" !== t.visibility && (!e.parentElement || this.visibility(e.parentElement)) }, e.getNextElementPreorder = function (e) { var t = e.nextElementSibling ? e.nextElementSibling : e.parentElement.firstElementChild; return this.visibility(t) ? t : this.getNextElementPreorder(t) }, e.getNextElementPostorder = function (e) { var t = e.previousElementSibling ? e.previousElementSibling : e.parentElement.lastElementChild; return this.visibility(t) ? t : this.getNextElementPostorder(t) }, e.hasHorizontalScroller = function (e) { return !!e && e.scrollWidth > e.offsetWidth }, e.hasVerticalScroller = function (e) { return !!e && e.scrollHeight > e.offsetHeight }, e }(), dt = function () { var e = function (t, n) { return (e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (e, t) { e.__proto__ = t } || function (e, t) { for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]) })(t, n) }; return function (t, n) { if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null"); function o() { this.constructor = t } e(t, n), t.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o) } }(), ft = function (e, t, n, o) { var r, i = arguments.length, s = i < 3 ? t : null === o ? o = Object.getOwnPropertyDescriptor(t, n) : o; if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) s = Reflect.decorate(e, t, n, o); else for (var a = e.length - 1; a >= 0; a--)(r = e[a]) && (s = (i < 3 ? r(s) : i > 3 ? r(t, n, s) : r(t, n)) || s); return i > 3 && s && Object.defineProperty(t, n, s), s }, gt = { root: "sv-list__container", item: "sv-list__item", searchClearButtonIcon: "sv-list__filter-clear-button", loadingIndicator: "sv-list__loading-indicator", itemSelected: "sv-list__item--selected", itemWithIcon: "sv-list__item--with-icon", itemDisabled: "sv-list__item--disabled", itemFocused: "sv-list__item--focused", itemIcon: "sv-list__item-icon", itemSeparator: "sv-list__item-separator", itemBody: "sv-list__item-body", itemsContainer: "sv-list", filter: "sv-list__filter", filterIcon: "sv-list__filter-icon", filterInput: "sv-list__input", emptyContainer: "sv-list__empty-container", emptyText: "sv-list__empty-text" }, yt = function (e) { function t(n, o, r, i, s) { var a = e.call(this) || this; return a.onSelectionChanged = o, a.allowSelection = r, a.onFilterStringChangedCallback = s, a.onItemClick = function (e) { a.isItemDisabled(e) || a.isItemSelected(e) || (a.isExpanded = !1, a.allowSelection && (a.selectedItem = e), a.onSelectionChanged && a.onSelectionChanged(e)) }, a.isItemDisabled = function (e) { return void 0 !== e.enabled && !e.enabled }, a.isItemSelected = function (e) { return !!a.selectedItem && a.selectedItem.id == e.id }, a.isItemFocused = function (e) { return !!a.focusedItem && a.focusedItem.id == e.id }, a.getItemClass = function (e) { return (new at).append(a.cssClasses.item).append(a.cssClasses.itemWithIcon, !!e.iconName).append(a.cssClasses.itemDisabled, a.isItemDisabled(e)).append(a.cssClasses.itemFocused, a.isItemFocused(e)).append(a.cssClasses.itemSelected, a.isItemSelected(e)).append(e.css).toString() }, a.getItemIndent = function (e) { return ((e.level || 0) + 1) * t.INDENT + "px" }, a.setItems(n), a.selectedItem = i, a } return dt(t, e), t.prototype.hasText = function (e, t) { return !t || (e.title || "").toLocaleLowerCase().indexOf(t.toLocaleLowerCase()) > -1 }, t.prototype.isItemVisible = function (e) { return e.visible && (!this.shouldProcessFilter || this.hasText(e, this.filterString)) }, Object.defineProperty(t.prototype, "visibleItems", { get: function () { var e = this; return this.visibleActions.filter((function (t) { return e.isItemVisible(t) })) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "shouldProcessFilter", { get: function () { return !this.onFilterStringChangedCallback }, enumerable: !1, configurable: !0 }), t.prototype.onFilterStringChanged = function (e) { var t = this; this.isEmpty = 0 === this.renderedActions.filter((function (e) { return t.isItemVisible(e) })).length, this.onFilterStringChangedCallback && this.onFilterStringChangedCallback(e) }, t.prototype.setItems = function (t, n) { void 0 === n && (n = !0), e.prototype.setItems.call(this, t, n), !this.isAllDataLoaded && this.actions.length && this.actions.push(this.loadingIndicator) }, t.prototype.onSet = function () { this.showFilter = this.searchEnabled && (this.actions || []).length > t.MINELEMENTCOUNT, e.prototype.onSet.call(this) }, t.prototype.getDefaultCssClasses = function () { return gt }, t.prototype.updateItemActiveState = function () { var e = this; this.actions.forEach((function (t) { return t.active = e.isItemSelected(t) })) }, Object.defineProperty(t.prototype, "filterStringPlaceholder", { get: function () { return this.getLocalizationString("filterStringPlaceholder") }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "emptyMessage", { get: function () { return this.getLocalizationString("emptyMessage") }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "scrollableContainer", { get: function () { return this.listContainerHtmlElement.querySelector("." + this.getDefaultCssClasses().itemsContainer) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "loadingText", { get: function () { return this.getLocalizationString("loadingFile") }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "loadingIndicator", { get: function () { return this.loadingIndicatorValue || (this.loadingIndicatorValue = new Tt({ id: "loadingIndicator", title: this.loadingText, action: function () { }, css: this.cssClasses.loadingIndicator })), this.loadingIndicatorValue }, enumerable: !1, configurable: !0 }), t.prototype.goToItems = function (e) { if ("ArrowDown" === e.key || 40 === e.keyCode) { var t = e.target.parentElement.parentElement.querySelector("ul"); t && t.firstElementChild && (ht.focusElement(t.firstElementChild), e.preventDefault()) } }, t.prototype.onMouseMove = function (e) { this.resetFocusedItem() }, t.prototype.onKeyDown = function (e) { var t = e.target; "ArrowDown" === e.key || 40 === e.keyCode ? (ht.focusElement(ht.getNextElementPreorder(t)), e.preventDefault()) : "ArrowUp" !== e.key && 38 !== e.keyCode || (ht.focusElement(ht.getNextElementPostorder(t)), e.preventDefault()) }, t.prototype.onPointerDown = function (e, t) { }, t.prototype.refresh = function () { this.filterString = "", this.resetFocusedItem() }, t.prototype.onClickSearchClearButton = function (e) { e.currentTarget.parentElement.querySelector("input").focus(), this.refresh() }, t.prototype.resetFocusedItem = function () { this.focusedItem = void 0 }, t.prototype.focusFirstVisibleItem = function () { this.focusedItem = this.visibleItems[0] }, t.prototype.focusLastVisibleItem = function () { this.focusedItem = this.visibleItems[this.visibleItems.length - 1] }, t.prototype.initFocusedItem = function () { var e = this; this.focusedItem = this.visibleItems.filter((function (t) { return t.visible && e.isItemSelected(t) }))[0], this.focusedItem || this.focusFirstVisibleItem() }, t.prototype.focusNextVisibleItem = function () { if (this.focusedItem) { var e = this.visibleItems, t = e.indexOf(this.focusedItem), n = e[t + 1]; n ? this.focusedItem = n : this.focusFirstVisibleItem() } else this.initFocusedItem() }, t.prototype.focusPrevVisibleItem = function () { if (this.focusedItem) { var e = this.visibleItems, t = e.indexOf(this.focusedItem), n = e[t - 1]; n ? this.focusedItem = n : this.focusLastVisibleItem() } else this.initFocusedItem() }, t.prototype.selectFocusedItem = function () { this.focusedItem && this.onItemClick(this.focusedItem) }, t.prototype.initListContainerHtmlElement = function (e) { this.listContainerHtmlElement = e }, t.prototype.onLastItemRended = function (e) { this.isAllDataLoaded || e === this.actions[this.actions.length - 1] && this.listContainerHtmlElement && (this.hasVerticalScroller = ht.hasVerticalScroller(this.scrollableContainer)) }, t.prototype.scrollToFocusedItem = function () { var e = this; setTimeout((function () { if (e.listContainerHtmlElement) { var t = e.listContainerHtmlElement.querySelector("." + e.getDefaultCssClasses().itemFocused); t && t.scrollIntoView({ behavior: "smooth", block: "nearest", inline: "start" }) } }), 0) }, t.prototype.addScrollEventListener = function (e) { e && (this.scrollHandler = e), this.scrollHandler && this.scrollableContainer.addEventListener("scroll", this.scrollHandler) }, t.prototype.removeScrollEventListener = function () { this.scrollHandler && this.scrollableContainer.removeEventListener("scroll", this.scrollHandler) }, t.INDENT = 16, t.MINELEMENTCOUNT = 10, ft([f({ defaultValue: !0, onSet: function (e, t) { t.onSet() } })], t.prototype, "searchEnabled", void 0), ft([f({ defaultValue: !1 })], t.prototype, "showFilter", void 0), ft([f({ defaultValue: !1 })], t.prototype, "isExpanded", void 0), ft([f({ onSet: function (e, t) { t.updateItemActiveState() } })], t.prototype, "selectedItem", void 0), ft([f()], t.prototype, "focusedItem", void 0), ft([f({ onSet: function (e, t) { t.onFilterStringChanged(t.filterString) } })], t.prototype, "filterString", void 0), ft([f({ defaultValue: !1 })], t.prototype, "hasVerticalScroller", void 0), ft([f({ defaultValue: !0 })], t.prototype, "isAllDataLoaded", void 0), ft([f({ defaultValue: !1 })], t.prototype, "showSearchClearButton", void 0), t }(pt), mt = function () { var e = function (t, n) { return (e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (e, t) { e.__proto__ = t } || function (e, t) { for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]) })(t, n) }; return function (t, n) { if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null"); function o() { this.constructor = t } e(t, n), t.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o) } }(), vt = function (e, t, n, o) { var r, i = arguments.length, s = i < 3 ? t : null === o ? o = Object.getOwnPropertyDescriptor(t, n) : o; if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) s = Reflect.decorate(e, t, n, o); else for (var a = e.length - 1; a >= 0; a--)(r = e[a]) && (s = (i < 3 ? r(s) : i > 3 ? r(t, n, s) : r(t, n)) || s); return i > 3 && s && Object.defineProperty(t, n, s), s }, bt = function (e) { function t(t, n, o, r, i, s, a, l, u, c, p, h) { void 0 === o && (o = "bottom"), void 0 === r && (r = "left"), void 0 === i && (i = !0), void 0 === s && (s = !1), void 0 === a && (a = function () { }), void 0 === l && (l = function () { return !0 }), void 0 === u && (u = function () { }), void 0 === c && (c = function () { }), void 0 === p && (p = ""), void 0 === h && (h = ""); var d = e.call(this) || this; return d.focusFirstInputSelector = "", d.onVisibilityChanged = d.addEvent(), d.onFooterActionsCreated = d.addEvent(), d.onRecalculatePosition = d.addEvent(), d.contentComponentName = t, d.contentComponentData = n, d.verticalPosition = o, d.horizontalPosition = r, d.showPointer = i, d.isModal = s, d.onCancel = a, d.onApply = l, d.onHide = u, d.onShow = c, d.cssClass = p, d.title = h, d } return mt(t, e), Object.defineProperty(t.prototype, "isVisible", { get: function () { return this.getPropertyValue("isVisible", !1) }, set: function (e) { if (this.isVisible !== e) if (this.setPropertyValue("isVisible", e), this.onVisibilityChanged.fire(this, { model: this, isVisible: e }), this.isVisible) { var t = this.contentComponentData.model; t && t.refresh && t.refresh(), this.onShow() } else this.onHide() }, enumerable: !1, configurable: !0 }), t.prototype.toggleVisibility = function () { this.isVisible = !this.isVisible }, t.prototype.recalculatePosition = function (e) { this.onRecalculatePosition.fire(this, { isResetHeight: e }) }, t.prototype.updateFooterActions = function (e) { var t = { actions: e }; return this.onFooterActionsCreated.fire(this, t), t.actions }, vt([f()], t.prototype, "contentComponentName", void 0), vt([f()], t.prototype, "contentComponentData", void 0), vt([f({ defaultValue: "bottom" })], t.prototype, "verticalPosition", void 0), vt([f({ defaultValue: "left" })], t.prototype, "horizontalPosition", void 0), vt([f({ defaultValue: !1 })], t.prototype, "showPointer", void 0), vt([f({ defaultValue: !1 })], t.prototype, "isModal", void 0), vt([f({ defaultValue: !0 })], t.prototype, "isFocusedContent", void 0), vt([f({ defaultValue: function () { } })], t.prototype, "onCancel", void 0), vt([f({ defaultValue: function () { return !0 } })], t.prototype, "onApply", void 0), vt([f({ defaultValue: function () { } })], t.prototype, "onHide", void 0), vt([f({ defaultValue: function () { } })], t.prototype, "onShow", void 0), vt([f({ defaultValue: "" })], t.prototype, "cssClass", void 0), vt([f({ defaultValue: "" })], t.prototype, "title", void 0), vt([f({ defaultValue: "popup" })], t.prototype, "displayMode", void 0), vt([f({ defaultValue: "flex" })], t.prototype, "positionMode", void 0), t }(ce); function Ct(e, t, n, o, r, i, s, a, l) { return void 0 === r && (r = function () { }), void 0 === i && (i = function () { }), void 0 === l && (l = "popup"), { componentName: e, data: t, onApply: n, onCancel: o, onHide: r, onShow: i, cssClass: s, title: a, displayMode: l } } var Pt = function () { var e = function (t, n) { return (e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (e, t) { e.__proto__ = t } || function (e, t) { for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]) })(t, n) }; return function (t, n) { if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null"); function o() { this.constructor = t } e(t, n), t.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o) } }(), wt = function (e, t, n, o) { var r, i = arguments.length, s = i < 3 ? t : null === o ? o = Object.getOwnPropertyDescriptor(t, n) : o; if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) s = Reflect.decorate(e, t, n, o); else for (var a = e.length - 1; a >= 0; a--)(r = e[a]) && (s = (i < 3 ? r(s) : i > 3 ? r(t, n, s) : r(t, n)) || s); return i > 3 && s && Object.defineProperty(t, n, s), s }; function Vt(e, t, n) { return xt(e, t, t, n) } function xt(e, t, n, o) { var r = new yt(t.items, (function (e) { t.onSelectionChanged(e), i.toggleVisibility() }), t.allowSelection, t.selectedItem, t.onFilterStringChangedCallback); r.locOwner = o; var i = new bt("sv-list", { model: r }, null == n ? void 0 : n.verticalPosition, null == n ? void 0 : n.horizontalPosition, null == n ? void 0 : n.showPointer, null == n ? void 0 : n.isModal, null == n ? void 0 : n.onCancel, null == n ? void 0 : n.onApply, null == n ? void 0 : n.onHide, null == n ? void 0 : n.onShow, null == n ? void 0 : n.cssClass, null == n ? void 0 : n.title); i.displayMode = null == n ? void 0 : n.displayMode; var s = Object.assign({}, e, { component: "sv-action-bar-item-dropdown", popupModel: i, action: function () { e.action && e.action(), i.toggleVisibility() } }), a = new Tt(s); return a.data = r, a } var Ot, Tt = function (e) { function t(t) { var n = e.call(this) || this; if (n.innerItem = t, n.iconSize = 24, n.locTitleChanged = function () { var e = n.locTitle.renderedHtml; n.setPropertyValue("title", e || void 0) }, n.locTitle = t ? t.locTitle : null, t) for (var o in t) n[o] = t[o]; return n.locTitleName && n.locTitleChanged(), n.locStrChangedInPopupModel(), n } return Pt(t, e), t.prototype.raiseUpdate = function () { this.updateCallback && this.updateCallback() }, t.prototype.createLocTitle = function () { return this.createLocalizableString("title", this, !0) }, Object.defineProperty(t.prototype, "locTitle", { get: function () { return this.locTitleValue }, set: function (e) { e || this.locTitleValue || (e = this.createLocTitle()), this.locTitleValue && this.locTitleValue.onStringChanged.remove(this.locTitleChanged), this.locTitleValue = e, this.locTitleValue.onStringChanged.add(this.locTitleChanged), this.locTitleChanged() }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "locTitleName", { get: function () { return this.locTitle.localizationName }, set: function (e) { this.locTitle.localizationName = e }, enumerable: !1, configurable: !0 }), t.prototype.locStrsChanged = function () { e.prototype.locStrsChanged.call(this), this.locTooltipChanged(), this.locStrChangedInPopupModel() }, t.prototype.locStrChangedInPopupModel = function () { if (this.popupModel && this.popupModel.contentComponentData && this.popupModel.contentComponentData.model) { var e = this.popupModel.contentComponentData.model; if (Array.isArray(e.actions)) e.actions.forEach((function (e) { e.locStrsChanged && e.locStrsChanged() })) } }, t.prototype.locTooltipChanged = function () { this.locTooltipName && (this.tooltip = s.getString(this.locTooltipName, this.locTitle.locale)) }, Object.defineProperty(t.prototype, "cssClasses", { get: function () { return this.cssClassesValue || ct }, set: function (e) { this.cssClassesValue = e }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "disabled", { get: function () { return void 0 !== this.enabled && !this.enabled }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "hasTitle", { get: function () { return ("small" != this.mode && (this.showTitle || void 0 === this.showTitle) || !this.iconName) && !!this.title }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "isVisible", { get: function () { return this.visible && "popup" !== this.mode }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "canShrink", { get: function () { return !!this.iconName }, enumerable: !1, configurable: !0 }), t.prototype.getActionRootCss = function () { return (new at).append("sv-action").append(this.css).append("sv-action--space", this.needSpace).append("sv-action--hidden", !this.isVisible).toString() }, t.prototype.getActionBarItemTitleCss = function () { return (new at).append(this.cssClasses.itemTitle).append(this.cssClasses.itemTitleWithIcon, !!this.iconName).toString() }, t.prototype.getActionBarItemCss = function () { return (new at).append(this.cssClasses.item).append(this.cssClasses.itemAsIcon, !this.hasTitle).append(this.cssClasses.itemActive, !!this.active).append(this.cssClasses.itemPressed, !!this.pressed).append(this.innerCss).toString() }, t.prototype.getTooltip = function () { return this.tooltip || this.title }, t.prototype.getLocale = function () { return this.owner ? this.owner.getLocale() : "" }, t.prototype.getMarkdownHtml = function (e, t) { return this.owner ? this.owner.getMarkdownHtml(e, t) : void 0 }, t.prototype.getProcessedText = function (e) { return this.owner ? this.owner.getProcessedText(e) : e }, t.prototype.getRenderer = function (e) { return this.owner ? this.owner.getRenderer(e) : null }, t.prototype.getRendererContext = function (e) { return this.owner ? this.owner.getRendererContext(e) : e }, wt([f()], t.prototype, "id", void 0), wt([f()], t.prototype, "iconName", void 0), wt([f()], t.prototype, "iconSize", void 0), wt([f({ defaultValue: !0, onSet: function (e, t) { t.raiseUpdate() } })], t.prototype, "visible", void 0), wt([f()], t.prototype, "tooltip", void 0), wt([f({ onSet: function (e, t) { t.locTooltipChanged() } })], t.prototype, "locTooltipName", void 0), wt([f()], t.prototype, "enabled", void 0), wt([f()], t.prototype, "showTitle", void 0), wt([f()], t.prototype, "action", void 0), wt([f()], t.prototype, "css", void 0), wt([f()], t.prototype, "innerCss", void 0), wt([f()], t.prototype, "data", void 0), wt([f()], t.prototype, "popupModel", void 0), wt([f()], t.prototype, "needSeparator", void 0), wt([f()], t.prototype, "active", void 0), wt([f()], t.prototype, "pressed", void 0), wt([f()], t.prototype, "template", void 0), wt([f()], t.prototype, "component", void 0), wt([f()], t.prototype, "items", void 0), wt([f()], t.prototype, "visibleIndex", void 0), wt([f({ defaultValue: "large" })], t.prototype, "mode", void 0), wt([f()], t.prototype, "disableTabStop", void 0), wt([f()], t.prototype, "disableShrink", void 0), wt([f()], t.prototype, "disableHide", void 0), wt([f({ defaultValue: !1 })], t.prototype, "needSpace", void 0), wt([f()], t.prototype, "ariaChecked", void 0), wt([f()], t.prototype, "ariaExpanded", void 0), wt([f({ defaultValue: "button" })], t.prototype, "ariaRole", void 0), wt([f({ onSet: function (e, t) { t.locTitleValue.text !== e && (t.locTitleValue.text = e) } })], t.prototype, "title", void 0), t }(ce), St = function () { function e(e) { this.item = e, this.funcKey = "sv-dropdown-action", this.setupPopupCallbacks() } return e.prototype.setupPopupCallbacks = function () { var e = this, t = this.popupModel = this.item.popupModel; t && t.registerPropertyChangedHandlers(["isVisible"], (function () { t.isVisible ? e.item.pressed = !0 : e.item.pressed = !1 }), this.funcKey) }, e.prototype.removePopupCallbacks = function () { this.popupModel && this.popupModel.unregisterPropertyChangedHandlers(["isVisible"], this.funcKey) }, e.prototype.dispose = function () { this.removePopupCallbacks() }, e }(), _t = function () { var e = function (t, n) { return (e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (e, t) { e.__proto__ = t } || function (e, t) { for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]) })(t, n) }; return function (t, n) { if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null"); function o() { this.constructor = t } e(t, n), t.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o) } }(), It = function (e) { function t() { var n = e.call(this) || this; return n.minVisibleItemsCount = 0, n.isResponsivenessDisabled = !1, n.dotsItem = xt({ id: "dotsItem-id" + t.ContainerID++, css: "sv-dots", innerCss: "sv-dots__item", iconName: "icon-more", visible: !1, tooltip: s.getString("more") }, { items: [], onSelectionChanged: function (e) { n.hiddenItemSelected(e) }, allowSelection: !1 }), n } return _t(t, e), t.prototype.hideItemsGreaterN = function (e) { var t = this.visibleActions.filter((function (e) { return !e.disableHide })); e = Math.max(e, this.minVisibleItemsCount) - (this.visibleActions.length - t.length); var n = []; t.forEach((function (t) { e <= 0 && (t.mode = "popup", n.push(t.innerItem)), e-- })), this.hiddenItemsListModel.setItems(n) }, t.prototype.getVisibleItemsCount = function (e) { for (var t = this.visibleActions.map((function (e) { return e.minDimension })), n = 0, o = 0; o < t.length; o++)if ((n += t[o]) > e) return o; return o }, t.prototype.updateItemMode = function (e, t) { for (var n = this.visibleActions, o = n.length - 1; o >= 0; o--)t > e && !n[o].disableShrink ? (t -= n[o].maxDimension - n[o].minDimension, n[o].mode = "small") : n[o].mode = "large" }, Object.defineProperty(t.prototype, "hiddenItemsListModel", { get: function () { return this.dotsItem.data }, enumerable: !1, configurable: !0 }), t.prototype.hiddenItemSelected = function (e) { e && "function" == typeof e.action && e.action() }, t.prototype.onSet = function () { var t = this; this.actions.forEach((function (e) { return e.updateCallback = function () { return t.raiseUpdate(!1) } })), e.prototype.onSet.call(this) }, t.prototype.onPush = function (t) { var n = this; t.updateCallback = function () { return n.raiseUpdate(!1) }, e.prototype.onPush.call(this, t) }, t.prototype.getRenderedActions = function () { return 1 === this.actions.length && this.actions[0].iconName ? this.actions : this.actions.concat([this.dotsItem]) }, t.prototype.raiseUpdate = function (t) { this.isResponsivenessDisabled || e.prototype.raiseUpdate.call(this, t) }, t.prototype.fit = function (e, t) { if (!(e <= 0)) { this.dotsItem.visible = !1; var n = 0, o = 0; this.visibleActions.forEach((function (e) { n += e.minDimension, o += e.maxDimension })), e >= o ? this.setActionsMode("large") : e < n ? (this.setActionsMode("small"), this.hideItemsGreaterN(this.getVisibleItemsCount(e - t)), this.dotsItem.visible = !0) : this.updateItemMode(e, o) } }, t.prototype.initResponsivityManager = function (e) { this.responsivityManager = new it(e, this, ".sv-action:not(.sv-dots)>.sv-action__content") }, t.prototype.resetResponsivityManager = function () { this.responsivityManager && (this.responsivityManager.dispose(), this.responsivityManager = void 0) }, t.prototype.setActionsMode = function (e) { this.actions.forEach((function (t) { return t.mode = e })) }, t.prototype.dispose = function () { e.prototype.dispose.call(this), this.resetResponsivityManager() }, t.ContainerID = 1, t }(pt), Rt = function () { var e = function (t, n) { return (e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (e, t) { e.__proto__ = t } || function (e, t) { for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]) })(t, n) }; return function (t, n) { if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null"); function o() { this.constructor = t } e(t, n), t.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o) } }(), Et = function (e, t, n, o) { var r, i = arguments.length, s = i < 3 ? t : null === o ? o = Object.getOwnPropertyDescriptor(t, n) : o; if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) s = Reflect.decorate(e, t, n, o); else for (var a = e.length - 1; a >= 0; a--)(r = e[a]) && (s = (i < 3 ? r(s) : i > 3 ? r(t, n, s) : r(t, n)) || s); return i > 3 && s && Object.defineProperty(t, n, s), s }, Dt = function (e) { function t() { var t = e.call(this) || this; return t.createLocTitleProperty(), t } return Rt(t, e), t.prototype.createLocTitleProperty = function () { return this.createLocalizableString("title", this, !0) }, Object.defineProperty(t.prototype, "title", { get: function () { return this.getLocalizableStringText("title", this.getDefaultTitleValue()) }, set: function (e) { this.setLocalizableStringText("title", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "locTitle", { get: function () { return this.getLocalizableString("title") }, enumerable: !1, configurable: !0 }), t.prototype.getDefaultTitleValue = function () { }, t.prototype.updateDescriptionVisibility = function (e) { this.hasDescription = !!e }, Object.defineProperty(t.prototype, "locDescription", { get: function () { return this.getLocalizableString("description") }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "titleTagName", { get: function () { var e = this.getDefaultTitleTagName(), t = this.getSurvey(); return t ? t.getElementTitleTagName(this, e) : e }, enumerable: !1, configurable: !0 }), t.prototype.getDefaultTitleTagName = function () { return o.titleTags[this.getType()] }, Object.defineProperty(t.prototype, "hasTitle", { get: function () { return this.title.length > 0 }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "hasTitleActions", { get: function () { return !1 }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "hasTitleEvents", { get: function () { return this.hasTitleActions }, enumerable: !1, configurable: !0 }), t.prototype.getTitleToolbar = function () { return null }, t.prototype.getTitleOwner = function () { }, Object.defineProperty(t.prototype, "isTitleOwner", { get: function () { return !!this.getTitleOwner() }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "isTitleRenderedAsString", { get: function () { return this.getIsTitleRenderedAsString() }, enumerable: !1, configurable: !0 }), t.prototype.toggleState = function () { }, Object.defineProperty(t.prototype, "cssClasses", { get: function () { return {} }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "cssTitle", { get: function () { return "" }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "ariaTitleId", { get: function () { }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "titleTabIndex", { get: function () { }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "titleAriaExpanded", { get: function () { }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "ariaLabel", { get: function () { return this.locTitle.renderedHtml }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "titleAriaLabel", { get: function () { return this.ariaLabel }, enumerable: !1, configurable: !0 }), t.prototype.getIsTitleRenderedAsString = function () { return !this.isTitleOwner }, Et([f()], t.prototype, "hasDescription", void 0), Et([f({ localizable: !0, onSet: function (e, t) { t.updateDescriptionVisibility(t, e) } })], t.prototype, "description", void 0), t }(ce); !function (e) { e[e.InsideEmptyPanel = 1] = "InsideEmptyPanel", e[e.MultilineRight = 2] = "MultilineRight", e[e.MultilineLeft = 3] = "MultilineLeft" }(Ot || (Ot = {})); var At = function (e) { function t(n) { var o = e.call(this) || this; return o.selectedElementInDesignValue = o, o.disableDesignActions = t.CreateDisabledDesignElements, o.parentQuestionValue = null, o.isContentElement = !1, o.isEditableTemplateElement = !1, o.isInteractiveDesignElement = !0, o.isSingleInRow = !0, o.name = n, o.createNewArray("errors"), o.createNewArray("titleActions"), o.registerPropertyChangedHandlers(["isReadOnly"], (function () { o.onReadOnlyChanged() })), o.registerPropertyChangedHandlers(["errors"], (function () { o.updateVisibleErrors() })), o.registerPropertyChangedHandlers(["isSingleInRow"], (function () { o.updateElementCss(!1) })), o } return Rt(t, e), t.getProgressInfoByElements = function (e, t) { for (var n = ce.createProgressInfo(), o = 0; o < e.length; o++)if (e[o].isVisible) { var r = e[o].getProgressInfo(); n.questionCount += r.questionCount, n.answeredQuestionCount += r.answeredQuestionCount, n.requiredQuestionCount += r.requiredQuestionCount, n.requiredAnsweredQuestionCount += r.requiredAnsweredQuestionCount } return t && n.questionCount > 0 && (0 == n.requiredQuestionCount && (n.requiredQuestionCount = 1), n.answeredQuestionCount > 0 && (n.requiredAnsweredQuestionCount = 1)), n }, t.ScrollElementToTop = function (e) { if (!e || "undefined" == typeof document) return !1; var t = document.getElementById(e); if (!t || !t.scrollIntoView) return !1; var n = t.getBoundingClientRect().top; return n < 0 && t.scrollIntoView(), n < 0 }, t.GetFirstNonTextElement = function (e, t) { if (void 0 === t && (t = !1), !e || !e.length || 0 == e.length) return null; if (t) { var n = e[0]; "#text" === n.nodeName && (n.data = ""), "#text" === (n = e[e.length - 1]).nodeName && (n.data = "") } for (var o = 0; o < e.length; o++)if ("#text" != e[o].nodeName && "#comment" != e[o].nodeName) return e[o]; return null }, t.FocusElement = function (e) { if (!e || "undefined" == typeof document) return !1; var n = t.focusElementCore(e); return n || setTimeout((function () { t.focusElementCore(e) }), 10), n }, t.focusElementCore = function (e) { if (!document) return !1; var t = document.getElementById(e); return !(!t || t.disabled) && (t.focus(), !0) }, t.prototype.onPropertyValueChanged = function (t, n, o) { e.prototype.onPropertyValueChanged.call(this, t, n, o), "state" === t && (this.updateElementCss(!1), this.stateChangedCallback && this.stateChangedCallback()) }, t.prototype.getSkeletonComponentNameCore = function () { return this.survey ? this.survey.getSkeletonComponentName(this) : "" }, Object.defineProperty(t.prototype, "parentQuestion", { get: function () { return this.parentQuestionValue }, enumerable: !1, configurable: !0 }), t.prototype.setParentQuestion = function (e) { this.parentQuestionValue = e, this.onParentQuestionChanged() }, t.prototype.onParentQuestionChanged = function () { }, Object.defineProperty(t.prototype, "skeletonComponentName", { get: function () { return this.getSkeletonComponentNameCore() }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "state", { get: function () { return this.getPropertyValue("state") }, set: function (e) { this.setPropertyValue("state", e), this.notifyStateChanged() }, enumerable: !1, configurable: !0 }), t.prototype.notifyStateChanged = function () { this.survey && this.survey.elementContentVisibilityChanged(this) }, Object.defineProperty(t.prototype, "isCollapsed", { get: function () { if (!this.isDesignMode) return "collapsed" === this.state }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "isExpanded", { get: function () { return "expanded" === this.state }, enumerable: !1, configurable: !0 }), t.prototype.collapse = function () { this.isDesignMode || (this.state = "collapsed") }, t.prototype.expand = function () { this.state = "expanded" }, t.prototype.toggleState = function () { return this.isCollapsed ? (this.expand(), !0) : !this.isExpanded || (this.collapse(), !1) }, Object.defineProperty(t.prototype, "hasStateButton", { get: function () { return this.isExpanded || this.isCollapsed }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "shortcutText", { get: function () { return this.title || this.name }, enumerable: !1, configurable: !0 }), t.prototype.getTitleToolbar = function () { return this.titleToolbarValue || (this.titleToolbarValue = this.createActionContainer(!0), this.titleToolbarValue.containerCss = (this.isPanel ? this.cssClasses.panel.titleBar : this.cssClasses.titleBar) || "sv-action-title-bar", this.titleToolbarValue.setItems(this.getTitleActions())), this.titleToolbarValue }, t.prototype.createActionContainer = function (e) { var t = e ? new It : new pt; return this.survey && this.survey.getCss().actionBar && (t.cssClasses = this.survey.getCss().actionBar), t }, Object.defineProperty(t.prototype, "titleActions", { get: function () { return this.getPropertyValue("titleActions") }, enumerable: !1, configurable: !0 }), t.prototype.getTitleActions = function () { return this.isTitleActionRequested || (this.updateTitleActions(), this.isTitleActionRequested = !0), this.titleActions }, t.prototype.getDefaultTitleActions = function () { return [] }, t.prototype.updateTitleActions = function () { var e = this.getDefaultTitleActions(); this.survey && (e = this.survey.getUpdatedElementTitleActions(this, e)), this.setPropertyValue("titleActions", e) }, Object.defineProperty(t.prototype, "hasTitleActions", { get: function () { return this.getTitleActions().length > 0 }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "hasTitleEvents", { get: function () { return void 0 !== this.state && "default" !== this.state }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "titleTabIndex", { get: function () { return this.isPage || "default" === this.state ? void 0 : 0 }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "titleAriaExpanded", { get: function () { if (!this.isPage && "default" !== this.state) return "expanded" === this.state ? "true" : "false" }, enumerable: !1, configurable: !0 }), t.prototype.setSurveyImpl = function (e, t) { this.surveyImplValue = e, this.surveyImplValue ? (this.surveyDataValue = this.surveyImplValue.getSurveyData(), this.setSurveyCore(this.surveyImplValue.getSurvey()), this.textProcessorValue = this.surveyImplValue.getTextProcessor(), this.onSetData()) : (this.setSurveyCore(null), this.surveyDataValue = null), this.survey && this.clearCssClasses() }, t.prototype.canRunConditions = function () { return e.prototype.canRunConditions.call(this) && !!this.data }, t.prototype.getDataFilteredValues = function () { return this.data ? this.data.getFilteredValues() : null }, t.prototype.getDataFilteredProperties = function () { var e = this.data ? this.data.getFilteredProperties() : {}; return e.question = this, e }, Object.defineProperty(t.prototype, "surveyImpl", { get: function () { return this.surveyImplValue }, enumerable: !1, configurable: !0 }), t.prototype.__setData = function (e) { o.supportCreatorV2 && (this.surveyDataValue = e) }, Object.defineProperty(t.prototype, "data", { get: function () { return this.surveyDataValue }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "survey", { get: function () { return this.getSurvey() }, enumerable: !1, configurable: !0 }), t.prototype.getSurvey = function (e) { return void 0 === e && (e = !1), this.surveyValue || this.surveyImplValue && this.setSurveyCore(this.surveyImplValue.getSurvey()), this.surveyValue }, t.prototype.setSurveyCore = function (e) { this.surveyValue = e, this.surveyChangedCallback && this.surveyChangedCallback() }, Object.defineProperty(t.prototype, "isInternal", { get: function () { return this.isContentElement }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "areInvisibleElementsShowing", { get: function () { return !!this.survey && this.survey.areInvisibleElementsShowing && !this.isContentElement }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "isVisible", { get: function () { return !0 }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "isReadOnly", { get: function () { return !1 }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "readOnly", { get: function () { return this.getPropertyValue("readOnly", !1) }, set: function (e) { this.readOnly != e && (this.setPropertyValue("readOnly", e), this.isLoadingFromJson || this.setPropertyValue("isReadOnly", this.isReadOnly)) }, enumerable: !1, configurable: !0 }), t.prototype.onReadOnlyChanged = function () { this.readOnlyChangedCallback && this.readOnlyChangedCallback() }, Object.defineProperty(t.prototype, "css", { get: function () { return this.survey ? this.survey.getCss() : {} }, enumerable: !1, configurable: !0 }), t.prototype.ensureCssClassesValue = function () { this.cssClassesValue || (this.cssClassesValue = this.calcCssClasses(this.css), this.updateElementCssCore(this.cssClassesValue)) }, Object.defineProperty(t.prototype, "cssClasses", { get: function () { return this.survey ? (this.ensureCssClassesValue(), this.cssClassesValue) : this.calcCssClasses(this.css) }, enumerable: !1, configurable: !0 }), t.prototype.calcCssClasses = function (e) { }, t.prototype.updateElementCssCore = function (e) { }, Object.defineProperty(t.prototype, "cssError", { get: function () { return "" }, enumerable: !1, configurable: !0 }), t.prototype.updateElementCss = function (e) { this.clearCssClasses() }, t.prototype.clearCssClasses = function () { this.cssClassesValue = void 0 }, t.prototype.getIsLoadingFromJson = function () { return !!e.prototype.getIsLoadingFromJson.call(this) || !!this.survey && this.survey.isLoadingFromJson }, Object.defineProperty(t.prototype, "name", { get: function () { return this.getPropertyValue("name", "") }, set: function (e) { var t = this.name; this.setPropertyValue("name", this.getValidName(e)), !this.isLoadingFromJson && t && this.onNameChanged(t) }, enumerable: !1, configurable: !0 }), t.prototype.getValidName = function (e) { return e }, t.prototype.onNameChanged = function (e) { }, t.prototype.updateBindingValue = function (e, t) { this.data && !this.isTwoValueEquals(t, this.data.getValue(e)) && this.data.setValue(e, t, !1) }, Object.defineProperty(t.prototype, "errors", { get: function () { return this.getPropertyValue("errors") }, set: function (e) { this.setPropertyValue("errors", e) }, enumerable: !1, configurable: !0 }), t.prototype.updateVisibleErrors = function () { for (var e = 0, t = 0; t < this.errors.length; t++)this.errors[t].visible && e++; this.hasVisibleErrors = e > 0 }, Object.defineProperty(t.prototype, "containsErrors", { get: function () { return this.getPropertyValue("containsErrors", !1) }, enumerable: !1, configurable: !0 }), t.prototype.updateContainsErrors = function () { this.setPropertyValue("containsErrors", this.getContainsErrors()) }, t.prototype.getContainsErrors = function () { return this.errors.length > 0 }, Object.defineProperty(t.prototype, "selectedElementInDesign", { get: function () { return this.selectedElementInDesignValue }, set: function (e) { this.selectedElementInDesignValue = e }, enumerable: !1, configurable: !0 }), t.prototype.updateCustomWidgets = function () { }, t.prototype.onSurveyLoad = function () { }, t.prototype.onFirstRendering = function () { this.ensureCssClassesValue() }, t.prototype.endLoadingFromJson = function () { e.prototype.endLoadingFromJson.call(this), this.survey || this.onSurveyLoad() }, t.prototype.setVisibleIndex = function (e) { return 0 }, Object.defineProperty(t.prototype, "isPage", { get: function () { return !1 }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "isPanel", { get: function () { return !1 }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "isQuestion", { get: function () { return !1 }, enumerable: !1, configurable: !0 }), t.prototype.delete = function () { }, t.prototype.getLocale = function () { return this.survey ? this.survey.getLocale() : this.locOwner ? this.locOwner.getLocale() : "" }, t.prototype.getMarkdownHtml = function (e, t) { return this.survey ? this.survey.getSurveyMarkdownHtml(this, e, t) : this.locOwner ? this.locOwner.getMarkdownHtml(e, t) : void 0 }, t.prototype.getRenderer = function (e) { return this.survey && "function" == typeof this.survey.getRendererForString ? this.survey.getRendererForString(this, e) : this.locOwner && "function" == typeof this.locOwner.getRenderer ? this.locOwner.getRenderer(e) : null }, t.prototype.getRendererContext = function (e) { return this.survey && "function" == typeof this.survey.getRendererContextForString ? this.survey.getRendererContextForString(this, e) : this.locOwner && "function" == typeof this.locOwner.getRendererContext ? this.locOwner.getRendererContext(e) : e }, t.prototype.getProcessedText = function (e) { return this.isLoadingFromJson ? e : this.textProcessor ? this.textProcessor.processText(e, this.getUseDisplayValuesInDynamicTexts()) : this.locOwner ? this.locOwner.getProcessedText(e) : e }, t.prototype.getUseDisplayValuesInDynamicTexts = function () { return !0 }, t.prototype.removeSelfFromList = function (e) { if (e && Array.isArray(e)) { var t = e.indexOf(this); t > -1 && e.splice(t, 1) } }, Object.defineProperty(t.prototype, "textProcessor", { get: function () { return this.textProcessorValue }, enumerable: !1, configurable: !0 }), t.prototype.getProcessedHtml = function (e) { return e && this.textProcessor ? this.textProcessor.processText(e, !0) : e }, t.prototype.onSetData = function () { }, Object.defineProperty(t.prototype, "parent", { get: function () { return this.getPropertyValue("parent", null) }, set: function (e) { this.setPropertyValue("parent", e) }, enumerable: !1, configurable: !0 }), t.prototype.getPage = function (e) { for (; e && e.parent;)e = e.parent; return e && "page" == e.getType() ? e : null }, t.prototype.moveToBase = function (e, t, n) { if (void 0 === n && (n = null), !t) return !1; e.removeElement(this); var o = -1; return r.isNumber(n) && (o = parseInt(n)), -1 == o && n && n.getType && (o = t.indexOf(n)), t.addElement(this, o), !0 }, t.prototype.setPage = function (e, t) { var n = this.getPage(e); "string" == typeof t && this.getSurvey().pages.forEach((function (e) { t === e.name && (t = e) })); n !== t && (e && e.removeElement(this), t && t.addElement(this, -1)) }, t.prototype.getSearchableLocKeys = function (e) { e.push("title"), e.push("description") }, Object.defineProperty(t.prototype, "isDefaultV2Theme", { get: function () { return this.survey && "sd-root-modern" == this.survey.getCss().root }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "isErrorsModeTooltip", { get: function () { return this.getIsErrorsModeTooltip() }, enumerable: !1, configurable: !0 }), t.prototype.getIsErrorsModeTooltip = function () { return this.isDefaultV2Theme && this.hasParent && this.getIsTooltipErrorSupportedByParent() }, t.prototype.getIsTooltipErrorSupportedByParent = function () { var e; return null === (e = this.parent) || void 0 === e ? void 0 : e.getIsTooltipErrorInsideSupported() }, t.prototype.getIsTooltipErrorInsideSupported = function () { return !1 }, Object.defineProperty(t.prototype, "hasParent", { get: function () { return this.parent && !this.parent.isPage || void 0 === this.parent }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "hasFrameV2", { get: function () { return !this.hasParent && this.isDefaultV2Theme && !this.isDesignMode && this.isSingleInRow }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "width", { get: function () { return this.getPropertyValue("width", "") }, set: function (e) { this.setPropertyValue("width", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "minWidth", { get: function () { return this.getPropertyValue("minWidth") }, set: function (e) { this.setPropertyValue("minWidth", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "maxWidth", { get: function () { return this.getPropertyValue("maxWidth") }, set: function (e) { this.setPropertyValue("maxWidth", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "renderWidth", { get: function () { return this.getPropertyValue("renderWidth", "") }, set: function (e) { this.setPropertyValue("renderWidth", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "indent", { get: function () { return this.getPropertyValue("indent") }, set: function (e) { this.setPropertyValue("indent", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "rightIndent", { get: function () { return this.getPropertyValue("rightIndent", 0) }, set: function (e) { this.setPropertyValue("rightIndent", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "paddingLeft", { get: function () { return this.getPropertyValue("paddingLeft", "") }, set: function (e) { this.setPropertyValue("paddingLeft", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "paddingRight", { get: function () { return this.getPropertyValue("paddingRight", "") }, set: function (e) { this.setPropertyValue("paddingRight", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "rootStyle", { get: function () { var e = {}; return this.allowRootStyle && this.renderWidth && (e.flexGrow = 1, e.flexShrink = 1, e.flexBasis = this.renderWidth, e.minWidth = this.minWidth, e.maxWidth = this.maxWidth), e }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "clickTitleFunction", { get: function () { var e = this; if (this.needClickTitleFunction()) return function () { return e.processTitleClick() } }, enumerable: !1, configurable: !0 }), t.prototype.needClickTitleFunction = function () { return "default" !== this.state }, t.prototype.processTitleClick = function () { "default" !== this.state && this.toggleState() }, t.prototype.localeChanged = function () { e.prototype.localeChanged.call(this), this.updateDescriptionVisibility(this.description), this.errors.length > 0 && this.errors.forEach((function (e) { e.updateText() })) }, t.CreateDisabledDesignElements = !1, Et([f({ defaultValue: null })], t.prototype, "dragTypeOverMe", void 0), Et([f({ defaultValue: !1 })], t.prototype, "isDragMe", void 0), Et([f()], t.prototype, "cssClassesValue", void 0), Et([f({ defaultValue: !1 })], t.prototype, "hasVisibleErrors", void 0), Et([f({ defaultValue: !0 })], t.prototype, "isSingleInRow", void 0), Et([f({ defaultValue: !0 })], t.prototype, "allowRootStyle", void 0), t }(Dt), Lt = function () { var e = function (t, n) { return (e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (e, t) { e.__proto__ = t } || function (e, t) { for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]) })(t, n) }; return function (t, n) { if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null"); function o() { this.constructor = t } e(t, n), t.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o) } }(), jt = function (e) { function t(t, n) { void 0 === t && (t = null), void 0 === n && (n = null); var o = e.call(this) || this; return o.expressionIsRunning = !1, o.isCalculated = !1, t && (o.name = t), n && (o.expression = n), o } return Lt(t, e), t.prototype.setOwner = function (e) { this.data = e, this.rerunExpression() }, t.prototype.getType = function () { return "calculatedvalue" }, t.prototype.getSurvey = function (e) { return void 0 === e && (e = !1), this.data && this.data.getSurvey ? this.data.getSurvey() : null }, Object.defineProperty(t.prototype, "owner", { get: function () { return this.data }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "name", { get: function () { return this.getPropertyValue("name", "") }, set: function (e) { this.setPropertyValue("name", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "includeIntoResult", { get: function () { return this.getPropertyValue("includeIntoResult", !1) }, set: function (e) { this.setPropertyValue("includeIntoResult", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "expression", { get: function () { return this.getPropertyValue("expression", "") }, set: function (e) { this.setPropertyValue("expression", e), this.rerunExpression() }, enumerable: !1, configurable: !0 }), t.prototype.locCalculation = function () { this.expressionIsRunning = !0 }, t.prototype.unlocCalculation = function () { this.expressionIsRunning = !1 }, t.prototype.resetCalculation = function () { this.isCalculated = !1 }, t.prototype.doCalculation = function (e, t, n) { this.isCalculated || (this.runExpressionCore(e, t, n), this.isCalculated = !0) }, t.prototype.runExpression = function (e, t) { this.runExpressionCore(null, e, t) }, Object.defineProperty(t.prototype, "value", { get: function () { if (this.data) return this.data.getVariable(this.name) }, enumerable: !1, configurable: !0 }), t.prototype.setValue = function (e) { this.data && this.data.setVariable(this.name, e) }, Object.defineProperty(t.prototype, "canRunExpression", { get: function () { return !(!this.data || this.isLoadingFromJson || !this.expression || this.expressionIsRunning || !this.name) }, enumerable: !1, configurable: !0 }), t.prototype.rerunExpression = function () { this.canRunExpression && this.runExpression(this.data.getFilteredValues(), this.data.getFilteredProperties()) }, t.prototype.runExpressionCore = function (e, t, n) { this.canRunExpression && (this.ensureExpression(t), this.locCalculation(), e && this.runDependentExpressions(e, t, n), this.expressionRunner.run(t, n)) }, t.prototype.runDependentExpressions = function (e, t, n) { var o = this.expressionRunner.getVariables(); if (o) for (var r = 0; r < e.length; r++) { var i = e[r]; i === this || o.indexOf(i.name) < 0 || (i.doCalculation(e, t, n), t[i.name] = i.value) } }, t.prototype.ensureExpression = function (e) { var t = this; this.expressionRunner || (this.expressionRunner = new re(this.expression), this.expressionRunner.onRunComplete = function (e) { r.isTwoValueEquals(e, t.value) || t.setValue(e), t.unlocCalculation() }) }, t }(ce); _.addClass("calculatedvalue", [{ name: "!name", isUnique: !0 }, "expression:expression", "includeIntoResult:boolean"], (function () { return new jt }), "base"); var Nt = function () { var e = function (t, n) { return (e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (e, t) { e.__proto__ = t } || function (e, t) { for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]) })(t, n) }; return function (t, n) { if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null"); function o() { this.constructor = t } e(t, n), t.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o) } }(), Mt = function (e) { function t(t) { void 0 === t && (t = null); var n = e.call(this) || this; return n.expression = t, n } return Nt(t, e), t.prototype.getType = function () { return "expressionitem" }, t.prototype.runCondition = function (e, t) { return !!this.expression && new oe(this.expression).run(e, t) }, Object.defineProperty(t.prototype, "expression", { get: function () { return this.getPropertyValue("expression", "") }, set: function (e) { this.setPropertyValue("expression", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "locHtml", { get: function () { return this.getLocalizableString("html") }, enumerable: !1, configurable: !0 }), t.prototype.getLocale = function () { return this.locOwner ? this.locOwner.getLocale() : "" }, t.prototype.getMarkdownHtml = function (e, t) { return this.locOwner ? this.locOwner.getMarkdownHtml(e, t) : void 0 }, t.prototype.getRenderer = function (e) { return this.locOwner ? this.locOwner.getRenderer(e) : null }, t.prototype.getRendererContext = function (e) { return this.locOwner ? this.locOwner.getRendererContext(e) : e }, t.prototype.getProcessedText = function (e) { return this.locOwner ? this.locOwner.getProcessedText(e) : e }, t.prototype.getSurvey = function (e) { return void 0 === e && (e = !1), this.locOwner }, t }(ce), Ft = function (e) { function t(t, n) { void 0 === t && (t = null), void 0 === n && (n = null); var o = e.call(this, t) || this; return o.createLocalizableString("html", o), o.html = n, o } return Nt(t, e), t.prototype.getType = function () { return "htmlconditionitem" }, Object.defineProperty(t.prototype, "html", { get: function () { return this.getLocalizableStringText("html") }, set: function (e) { this.setLocalizableStringText("html", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "locHtml", { get: function () { return this.getLocalizableString("html") }, enumerable: !1, configurable: !0 }), t }(Mt), qt = function (e) { function t(t, n) { void 0 === t && (t = null), void 0 === n && (n = null); var o = e.call(this, t) || this; return o.createLocalizableString("url", o), o.url = n, o } return Nt(t, e), t.prototype.getType = function () { return "urlconditionitem" }, Object.defineProperty(t.prototype, "url", { get: function () { return this.getLocalizableStringText("url") }, set: function (e) { this.setLocalizableStringText("url", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "locUrl", { get: function () { return this.getLocalizableString("url") }, enumerable: !1, configurable: !0 }), t }(Mt); _.addClass("expressionitem", ["expression:condition"], (function () { return new Mt }), "base"), _.addClass("htmlconditionitem", [{ name: "html:html", serializationProperty: "locHtml" }], (function () { return new Ft }), "expressionitem"), _.addClass("urlconditionitem", [{ name: "url:string", serializationProperty: "locUrl" }], (function () { return new qt }), "expressionitem"); var kt = function () { var e = function (t, n) { return (e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (e, t) { e.__proto__ = t } || function (e, t) { for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]) })(t, n) }; return function (t, n) { if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null"); function o() { this.constructor = t } e(t, n), t.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o) } }(), Bt = function () { function e() { this.parser = new DOMParser } return e.prototype.assignValue = function (e, t, n) { Array.isArray(e[t]) ? e[t].push(n) : void 0 !== e[t] ? e[t] = [e[t]].concat(n) : "object" == typeof n && 1 === Object.keys(n).length && Object.keys(n)[0] === t ? e[t] = n[t] : e[t] = n }, e.prototype.xml2Json = function (e, t) { if (e.children && e.children.length > 0) for (var n = 0; n < e.children.length; n++) { var o = e.children[n], r = {}; this.xml2Json(o, r), this.assignValue(t, o.nodeName, r) } else this.assignValue(t, e.nodeName, e.textContent) }, e.prototype.parseXmlString = function (e) { var t = this.parser.parseFromString(e, "text/xml"), n = {}; return this.xml2Json(t, n), n }, e }(), Qt = function (e) { function t() { var t = e.call(this) || this; return t.lastObjHash = "", t.isRunningValue = !1, t.processedUrl = "", t.processedPath = "", t.isUsingCacheFromUrl = void 0, t.error = null, t.createItemValue = function (e) { return new qe(e) }, t } return kt(t, e), Object.defineProperty(t, "EncodeParameters", { get: function () { return o.webserviceEncodeParameters }, set: function (e) { o.webserviceEncodeParameters = e }, enumerable: !1, configurable: !0 }), t.clearCache = function () { t.itemsResult = {}, t.sendingSameRequests = {} }, t.addSameRequest = function (e) { if (!e.isUsingCache) return !1; var n = e.objHash, o = t.sendingSameRequests[n]; return o ? (o.push(e), e.isRunningValue = !0, !0) : (t.sendingSameRequests[e.objHash] = [], !1) }, t.unregisterSameRequests = function (e, n) { if (e.isUsingCache) { var o = t.sendingSameRequests[e.objHash]; if (delete t.sendingSameRequests[e.objHash], o) for (var r = 0; r < o.length; r++)o[r].isRunningValue = !1, o[r].getResultCallback && o[r].getResultCallback(n) } }, t.getCachedItemsResult = function (e) { var n = e.objHash, o = t.itemsResult[n]; return !!o && (e.getResultCallback && e.getResultCallback(o), !0) }, t.prototype.getSurvey = function (e) { return void 0 === e && (e = !1), this.owner ? this.owner.survey : null }, t.prototype.run = function (e) { if (void 0 === e && (e = null), this.url && this.getResultCallback) { if (this.processedText(e), !this.processedUrl) return this.doEmptyResultCallback({}), void (this.lastObjHash = this.objHash); this.lastObjHash !== this.objHash && (this.lastObjHash = this.objHash, this.error = null, this.useChangedItemsResults() || t.addSameRequest(this) || this.sendRequest()) } }, Object.defineProperty(t.prototype, "isUsingCache", { get: function () { return !0 === this.isUsingCacheFromUrl || !1 !== this.isUsingCacheFromUrl && o.useCachingForChoicesRestful }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "isRunning", { get: function () { return this.getIsRunning() }, enumerable: !1, configurable: !0 }), t.prototype.getIsRunning = function () { return this.isRunningValue }, Object.defineProperty(t.prototype, "isWaitingForParameters", { get: function () { return this.url && !this.processedUrl }, enumerable: !1, configurable: !0 }), t.prototype.useChangedItemsResults = function () { return t.getCachedItemsResult(this) }, t.prototype.doEmptyResultCallback = function (e) { var t = []; this.updateResultCallback && (t = this.updateResultCallback(t, e)), this.getResultCallback(t) }, t.prototype.processedText = function (e) { var n = this.url; if (n && (n = n.replace(t.cacheText, "").replace(t.noCacheText, "")), e) { var r = e.processTextEx(n, !1, o.webserviceEncodeParameters), i = e.processTextEx(this.path, !1, o.webserviceEncodeParameters); r.hasAllValuesOnLastRun && i.hasAllValuesOnLastRun ? (this.processedUrl = r.text, this.processedPath = i.text) : (this.processedUrl = "", this.processedPath = "") } else this.processedUrl = n, this.processedPath = this.path; this.onProcessedUrlCallback && this.onProcessedUrlCallback(this.processedUrl, this.processedPath) }, t.prototype.parseResponse = function (e) { var t; if (e && "function" == typeof e.indexOf && 0 === e.indexOf("<")) t = (new Bt).parseXmlString(e); else try { t = JSON.parse(e) } catch (n) { t = (e || "").split("\n").map((function (e) { return e.trim(" ") })).filter((function (e) { return !!e })) } return t }, t.prototype.sendRequest = function () { var e = new XMLHttpRequest; e.open("GET", this.processedUrl), e.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); var n = this, o = this.objHash; e.onload = function () { n.beforeLoadRequest(), 200 === e.status ? n.onLoad(n.parseResponse(e.response), o) : n.onError(e.statusText, e.responseText) }; var r = { request: e }; t.onBeforeSendRequest && t.onBeforeSendRequest(this, r), this.beforeSendRequest(), r.request.send() }, t.prototype.getType = function () { return "choicesByUrl" }, Object.defineProperty(t.prototype, "isEmpty", { get: function () { return !(this.url || this.path || this.valueName || this.titleName || this.imageLinkName) }, enumerable: !1, configurable: !0 }), t.prototype.getCustomPropertiesNames = function () { for (var e = this.getCustomProperties(), t = new Array, n = 0; n < e.length; n++)t.push(this.getCustomPropertyName(e[n].name)); return t }, t.prototype.getCustomPropertyName = function (e) { return e + "Name" }, t.prototype.getCustomProperties = function () { for (var e = _.getProperties(this.itemValueType), t = [], n = 0; n < e.length; n++)"value" !== e[n].name && "text" !== e[n].name && "visibleIf" !== e[n].name && "enableIf" !== e[n].name && t.push(e[n]); return t }, t.prototype.setData = function (e) { this.clear(), e.url && (this.url = e.url), e.path && (this.path = e.path), e.valueName && (this.valueName = e.valueName), e.titleName && (this.titleName = e.titleName), e.imageLinkName && (this.imageLinkName = e.imageLinkName), void 0 !== e.allowEmptyResponse && (this.allowEmptyResponse = e.allowEmptyResponse), void 0 !== e.attachOriginalItems && (this.attachOriginalItems = e.attachOriginalItems); for (var t = this.getCustomPropertiesNames(), n = 0; n < t.length; n++)e[t[n]] && (this[t[n]] = e[t[n]]) }, t.prototype.getData = function () { if (this.isEmpty) return null; var e = {}; this.url && (e.url = this.url), this.path && (e.path = this.path), this.valueName && (e.valueName = this.valueName), this.titleName && (e.titleName = this.titleName), this.imageLinkName && (e.imageLinkName = this.imageLinkName), this.allowEmptyResponse && (e.allowEmptyResponse = this.allowEmptyResponse), this.attachOriginalItems && (e.attachOriginalItems = this.attachOriginalItems); for (var t = this.getCustomPropertiesNames(), n = 0; n < t.length; n++)this[t[n]] && (e[t[n]] = this[t[n]]); return e }, Object.defineProperty(t.prototype, "url", { get: function () { return this.getPropertyValue("url", "") }, set: function (e) { this.setPropertyValue("url", e), this.isUsingCacheFromUrl = void 0, e && (e.indexOf(t.cacheText) > -1 ? this.isUsingCacheFromUrl = !0 : e.indexOf(t.noCacheText) > -1 && (this.isUsingCacheFromUrl = !1)) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "path", { get: function () { return this.getPropertyValue("path", "") }, set: function (e) { this.setPropertyValue("path", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "valueName", { get: function () { return this.getPropertyValue("valueName", "") }, set: function (e) { this.setPropertyValue("valueName", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "titleName", { get: function () { return this.getPropertyValue("titleName", "") }, set: function (e) { this.setPropertyValue("titleName", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "imageLinkName", { get: function () { return this.getPropertyValue("imageLinkName", "") }, set: function (e) { this.setPropertyValue("imageLinkName", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "allowEmptyResponse", { get: function () { return this.getPropertyValue("allowEmptyResponse") }, set: function (e) { this.setPropertyValue("allowEmptyResponse", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "attachOriginalItems", { get: function () { return this.getPropertyValue("attachOriginalItems") }, set: function (e) { this.setPropertyValue("attachOriginalItems", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "itemValueType", { get: function () { if (!this.owner) return "itemvalue"; var e = _.findProperty(this.owner.getType(), "choices"); return e ? "itemvalue[]" == e.type ? "itemvalue" : e.type : "itemvalue" }, enumerable: !1, configurable: !0 }), t.prototype.clear = function () { this.url = "", this.path = "", this.valueName = "", this.titleName = "", this.imageLinkName = ""; for (var e = this.getCustomPropertiesNames(), t = 0; t < e.length; t++)this[e[t]] && (this[e[t]] = "") }, t.prototype.beforeSendRequest = function () { this.isRunningValue = !0, this.beforeSendRequestCallback && this.beforeSendRequestCallback() }, t.prototype.beforeLoadRequest = function () { this.isRunningValue = !1 }, t.prototype.onLoad = function (e, n) { void 0 === n && (n = null), n || (n = this.objHash); var o = new Array, r = this.getResultAfterPath(e); if (r && r.length) for (var i = 0; i < r.length; i++) { var s = r[i]; if (s) { var a = this.getItemValueCallback ? this.getItemValueCallback(s) : this.getValue(s), l = this.createItemValue(a); this.setTitle(l, s), this.setCustomProperties(l, s), this.attachOriginalItems && (l.originalItem = s); var u = this.getImageLink(s); u && (l.imageLink = u), o.push(l) } } else this.allowEmptyResponse || (this.error = new Pe(null, this.owner)); this.updateResultCallback && (o = this.updateResultCallback(o, e)), this.isUsingCache && (t.itemsResult[n] = o), this.callResultCallback(o, n), t.unregisterSameRequests(this, o) }, t.prototype.callResultCallback = function (e, t) { t == this.objHash && this.getResultCallback(e) }, t.prototype.setCustomProperties = function (e, t) { for (var n = this.getCustomProperties(), o = 0; o < n.length; o++) { var r = n[o], i = this.getValueCore(t, this.getPropertyBinding(r.name)); this.isValueEmpty(i) || (e[r.name] = i) } }, t.prototype.getPropertyBinding = function (e) { return this[this.getCustomPropertyName(e)] ? this[this.getCustomPropertyName(e)] : this[e] ? this[e] : e }, t.prototype.onError = function (e, n) { this.error = new Ce(e, n, this.owner), this.doEmptyResultCallback(n), t.unregisterSameRequests(this, []) }, t.prototype.getResultAfterPath = function (e) { if (!e) return e; if (!this.processedPath) return e; for (var t = this.getPathes(), n = 0; n < t.length; n++)if (!(e = e[t[n]])) return null; return e }, t.prototype.getPathes = function () { var e = []; return 0 == (e = this.processedPath.indexOf(";") > -1 ? this.path.split(";") : this.processedPath.split(",")).length && e.push(this.processedPath), e }, t.prototype.getValue = function (e) { return e ? this.valueName ? this.getValueCore(e, this.valueName) : e instanceof Object ? Object.keys(e).length < 1 ? null : e[Object.keys(e)[0]] : e : null }, t.prototype.setTitle = function (e, t) { var n = this.titleName ? this.titleName : "title", o = this.getValueCore(t, n); o && ("string" == typeof o ? e.text = o : e.locText.setJson(o)) }, t.prototype.getImageLink = function (e) { var t = this.imageLinkName ? this.imageLinkName : "imageLink"; return this.getValueCore(e, t) }, t.prototype.getValueCore = function (e, t) { if (!e) return null; if (t.indexOf(".") < 0) return e[t]; for (var n = t.split("."), o = 0; o < n.length; o++)if (!(e = e[n[o]])) return null; return e }, Object.defineProperty(t.prototype, "objHash", { get: function () { return this.processedUrl + ";" + this.processedPath + ";" + this.valueName + ";" + this.titleName + ";" + this.imageLinkName }, enumerable: !1, configurable: !0 }), t.cacheText = "{CACHE}", t.noCacheText = "{NOCACHE}", t.itemsResult = {}, t.sendingSameRequests = {}, t }(ce), Ht = function (e) { function t() { return null !== e && e.apply(this, arguments) || this } return kt(t, e), Object.defineProperty(t, "EncodeParameters", { get: function () { return Qt.EncodeParameters }, set: function (e) { Qt.EncodeParameters = e }, enumerable: !1, configurable: !0 }), t.clearCache = function () { Qt.clearCache() }, Object.defineProperty(t, "onBeforeSendRequest", { get: function () { return Qt.onBeforeSendRequest }, set: function (e) { Qt.onBeforeSendRequest = e }, enumerable: !1, configurable: !0 }), t }(Qt); _.addClass("choicesByUrl", ["url", "path", "valueName", "titleName", { name: "imageLinkName", visibleIf: function (e) { return !!e && !!e.owner && "imagepicker" == e.owner.getType() } }, { name: "allowEmptyResponse:boolean" }, { name: "attachOriginalItems:boolean", visible: !1 }], (function () { return new Qt })); var zt = function () { function e(e, t) { this.name = e, this.widgetJson = t, this.htmlTemplate = t.htmlTemplate ? t.htmlTemplate : "" } return e.prototype.afterRender = function (e, t) { var n = this; this.widgetJson.afterRender && (e.localeChangedCallback = function () { n.widgetJson.willUnmount && n.widgetJson.willUnmount(e, t), n.widgetJson.afterRender(e, t) }, this.widgetJson.afterRender(e, t)) }, e.prototype.willUnmount = function (e, t) { this.widgetJson.willUnmount && this.widgetJson.willUnmount(e, t) }, e.prototype.getDisplayValue = function (e, t) { return void 0 === t && (t = void 0), this.widgetJson.getDisplayValue ? this.widgetJson.getDisplayValue(e, t) : null }, e.prototype.isFit = function (e) { return !(!this.isLibraryLoaded() || !this.widgetJson.isFit) && this.widgetJson.isFit(e) }, Object.defineProperty(e.prototype, "canShowInToolbox", { get: function () { return !1 !== this.widgetJson.showInToolbox && ("customtype" == Ut.Instance.getActivatedBy(this.name) && (!this.widgetJson.widgetIsLoaded || this.widgetJson.widgetIsLoaded())) }, enumerable: !1, configurable: !0 }), Object.defineProperty(e.prototype, "showInToolbox", { get: function () { return !1 !== this.widgetJson.showInToolbox }, set: function (e) { this.widgetJson.showInToolbox = e }, enumerable: !1, configurable: !0 }), e.prototype.init = function () { this.widgetJson.init && this.widgetJson.init() }, e.prototype.activatedByChanged = function (e) { this.isLibraryLoaded() && this.widgetJson.activatedByChanged && this.widgetJson.activatedByChanged(e) }, e.prototype.isLibraryLoaded = function () { return !this.widgetJson.widgetIsLoaded || 1 == this.widgetJson.widgetIsLoaded() }, Object.defineProperty(e.prototype, "isDefaultRender", { get: function () { return this.widgetJson.isDefaultRender }, enumerable: !1, configurable: !0 }), Object.defineProperty(e.prototype, "pdfQuestionType", { get: function () { return this.widgetJson.pdfQuestionType }, enumerable: !1, configurable: !0 }), Object.defineProperty(e.prototype, "pdfRender", { get: function () { return this.widgetJson.pdfRender }, enumerable: !1, configurable: !0 }), e }(), Ut = function () { function e() { this.widgetsValues = [], this.widgetsActivatedBy = {}, this.onCustomWidgetAdded = new he } return Object.defineProperty(e.prototype, "widgets", { get: function () { return this.widgetsValues }, enumerable: !1, configurable: !0 }), e.prototype.add = function (e, t) { void 0 === t && (t = "property"), this.addCustomWidget(e, t) }, e.prototype.addCustomWidget = function (e, t) { void 0 === t && (t = "property"); var n = e.name; n || (n = "widget_" + this.widgets.length + 1); var o = new zt(n, e); return this.widgetsValues.push(o), o.init(), this.widgetsActivatedBy[n] = t, o.activatedByChanged(t), this.onCustomWidgetAdded.fire(o, null), o }, e.prototype.getActivatedBy = function (e) { var t = this.widgetsActivatedBy[e]; return t || "property" }, e.prototype.setActivatedBy = function (e, t) { if (e && t) { var n = this.getCustomWidgetByName(e); n && (this.widgetsActivatedBy[e] = t, n.activatedByChanged(t)) } }, e.prototype.clear = function () { this.widgetsValues = [] }, e.prototype.getCustomWidgetByName = function (e) { for (var t = 0; t < this.widgets.length; t++)if (this.widgets[t].name == e) return this.widgets[t]; return null }, e.prototype.getCustomWidget = function (e) { for (var t = 0; t < this.widgetsValues.length; t++)if (this.widgetsValues[t].isFit(e)) return this.widgetsValues[t]; return null }, e.Instance = new e, e }(), Wt = function () { function e() { this.renderersHash = {} } return e.prototype.unregisterRenderer = function (e, t) { delete this.renderersHash[e][t] }, e.prototype.registerRenderer = function (e, t, n) { this.renderersHash[e] || (this.renderersHash[e] = {}), this.renderersHash[e][t] = n }, e.prototype.getRenderer = function (e, t) { return this.renderersHash[e] && this.renderersHash[e][t] || "default" }, e.prototype.getRendererByQuestion = function (e) { return this.getRenderer(e.getType(), e.renderAs) }, e.prototype.clear = function () { this.renderersHash = {} }, e.Instance = new e, e }(), Jt = function () { var e = function (t, n) { return (e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (e, t) { e.__proto__ = t } || function (e, t) { for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]) })(t, n) }; return function (t, n) { if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null"); function o() { this.constructor = t } e(t, n), t.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o) } }(), Gt = function (e, t, n, o) { var r, i = arguments.length, s = i < 3 ? t : null === o ? o = Object.getOwnPropertyDescriptor(t, n) : o; if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) s = Reflect.decorate(e, t, n, o); else for (var a = e.length - 1; a >= 0; a--)(r = e[a]) && (s = (i < 3 ? r(s) : i > 3 ? r(t, n, s) : r(t, n)) || s); return i > 3 && s && Object.defineProperty(t, n, s), s }, $t = function (e) { function t(n) { var o = e.call(this, n) || this; return o.customWidgetData = { isNeedRender: !0 }, o.isReadyValue = !0, o.onReadyChanged = o.addEvent(), o.isRunningValidatorsValue = !1, o.isValueChangedInSurvey = !1, o.allowNotifyValueChanged = !0, o.id = t.getQuestionId(), o.onCreating(), o.createNewArray("validators", (function (e) { e.errorOwner = o })), o.addExpressionProperty("visibleIf", (function (e, t) { o.visible = !0 === t }), (function (e) { return !o.areInvisibleElementsShowing })), o.addExpressionProperty("enableIf", (function (e, t) { o.readOnly = !1 === t })), o.addExpressionProperty("requiredIf", (function (e, t) { o.isRequired = !0 === t })), o.createLocalizableString("commentText", o, !0, "otherItemText"), o.locTitle.onGetDefaultTextCallback = function () { return o.name }, o.locTitle.storeDefaultText = !0, o.createLocalizableString("requiredErrorText", o), o.registerPropertyChangedHandlers(["width"], (function () { o.updateQuestionCss(), o.parent && o.parent.elementWidthChanged(o) })), o.registerPropertyChangedHandlers(["isRequired"], (function () { !o.isRequired && o.errors.length > 0 && o.validate(), o.locTitle.strChanged(), o.clearCssClasses() })), o.registerPropertyChangedHandlers(["indent", "rightIndent"], (function () { o.onIndentChanged() })), o.registerPropertyChangedHandlers(["showCommentArea", "showOtherItem"], (function () { o.initCommentFromSurvey() })), o.registerPropertyChangedHandlers(["isMobile"], (function () { o.onMobileChanged() })), o } return Jt(t, e), t.getQuestionId = function () { return "sq_" + t.questionCounter++ }, t.prototype.isReadOnlyRenderDiv = function () { return this.isReadOnly && "div" === o.readOnlyCommentRenderMode }, t.prototype.createLocTitleProperty = function () { var t = this, n = e.prototype.createLocTitleProperty.call(this); return n.onGetTextCallback = function (e) { return e || (e = t.name), t.survey ? t.survey.getUpdatedQuestionTitle(t, e) : e }, this.locProcessedTitle = new u(this, !0), this.locProcessedTitle.sharedData = n, n }, t.prototype.getSurvey = function (t) { return void 0 === t && (t = !1), t ? this.parent ? this.parent.getSurvey(t) : null : this.onGetSurvey ? this.onGetSurvey() : e.prototype.getSurvey.call(this) }, t.prototype.getValueName = function () { return this.valueName ? this.valueName.toString() : this.name }, Object.defineProperty(t.prototype, "valueName", { get: function () { return this.getPropertyValue("valueName", "") }, set: function (e) { var t = this.getValueName(); this.setPropertyValue("valueName", e), this.onValueNameChanged(t) }, enumerable: !1, configurable: !0 }), t.prototype.onValueNameChanged = function (e) { this.survey && (this.survey.questionRenamed(this, this.name, e || this.name), this.initDataFromSurvey()) }, t.prototype.onNameChanged = function (e) { this.locTitle.strChanged(), this.survey && this.survey.questionRenamed(this, e, this.valueName ? this.valueName : e) }, Object.defineProperty(t.prototype, "isReady", { get: function () { return this.isReadyValue }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "ariaRequired", { get: function () { return this.isRequired ? "true" : "false" }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "ariaInvalid", { get: function () { return this.errors.length > 0 ? "true" : "false" }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "ariaLabelledBy", { get: function () { return this.hasTitle ? this.ariaTitleId : null }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "ariaDescribedBy", { get: function () { return this.errors.length > 0 ? this.id + "_errors" : null }, enumerable: !1, configurable: !0 }), t.prototype.choicesLoaded = function () { }, Object.defineProperty(t.prototype, "page", { get: function () { return this.getPage(this.parent) }, set: function (e) { this.setPage(this.parent, e) }, enumerable: !1, configurable: !0 }), t.prototype.getPanel = function () { return null }, t.prototype.delete = function () { this.parent && this.removeSelfFromList(this.parent.elements) }, Object.defineProperty(t.prototype, "isFlowLayout", { get: function () { return "flow" === this.getLayoutType() }, enumerable: !1, configurable: !0 }), t.prototype.getLayoutType = function () { return this.parent ? this.parent.getChildrenLayoutType() : "row" }, t.prototype.isLayoutTypeSupported = function (e) { return "flow" !== e }, Object.defineProperty(t.prototype, "visible", { get: function () { return this.getPropertyValue("visible", !0) }, set: function (e) { e != this.visible && (this.setPropertyValue("visible", e), this.onVisibleChanged(), this.notifySurveyVisibilityChanged()) }, enumerable: !1, configurable: !0 }), t.prototype.onVisibleChanged = function () { this.setPropertyValue("isVisible", this.isVisible), !this.isVisible && this.errors && this.errors.length > 0 && (this.errors = []) }, Object.defineProperty(t.prototype, "useDisplayValuesInDynamicTexts", { get: function () { return this.getPropertyValue("useDisplayValuesInDynamicTexts") }, set: function (e) { this.setPropertyValue("useDisplayValuesInDynamicTexts", e) }, enumerable: !1, configurable: !0 }), t.prototype.getUseDisplayValuesInDynamicTexts = function () { return this.useDisplayValuesInDynamicTexts }, Object.defineProperty(t.prototype, "visibleIf", { get: function () { return this.getPropertyValue("visibleIf", "") }, set: function (e) { this.setPropertyValue("visibleIf", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "isVisible", { get: function () { return !(this.survey && this.survey.areEmptyElementsHidden && this.isEmpty()) && (this.visible || this.areInvisibleElementsShowing) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "visibleIndex", { get: function () { return this.getPropertyValue("visibleIndex", -1) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "hideNumber", { get: function () { return this.getPropertyValue("hideNumber") }, set: function (e) { this.setPropertyValue("hideNumber", e), this.notifySurveyVisibilityChanged() }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "isAllowTitleLeft", { get: function () { return !0 }, enumerable: !1, configurable: !0 }), t.prototype.getType = function () { return "question" }, Object.defineProperty(t.prototype, "isQuestion", { get: function () { return !0 }, enumerable: !1, configurable: !0 }), t.prototype.moveTo = function (e, t) { return void 0 === t && (t = null), this.moveToBase(this.parent, e, t) }, t.prototype.getProgressInfo = function () { return this.hasInput ? { questionCount: 1, answeredQuestionCount: this.isEmpty() ? 0 : 1, requiredQuestionCount: this.isRequired ? 1 : 0, requiredAnsweredQuestionCount: !this.isEmpty() && this.isRequired ? 1 : 0 } : e.prototype.getProgressInfo.call(this) }, t.prototype.runConditions = function () { this.data && !this.isLoadingFromJson && (this.isDesignMode || this.runCondition(this.getDataFilteredValues(), this.getDataFilteredProperties()), this.locStrsChanged()) }, t.prototype.setSurveyImpl = function (t, n) { e.prototype.setSurveyImpl.call(this, t), this.survey && (this.survey.questionCreated(this), !0 !== n && this.runConditions()) }, Object.defineProperty(t.prototype, "parent", { get: function () { return this.getPropertyValue("parent", null) }, set: function (e) { this.parent !== e && (this.delete(), this.setPropertyValue("parent", e), this.updateQuestionCss(), this.onParentChanged()) }, enumerable: !1, configurable: !0 }), t.prototype.onParentChanged = function () { }, Object.defineProperty(t.prototype, "hasTitle", { get: function () { return "hidden" !== this.getTitleLocation() }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "titleLocation", { get: function () { return this.getPropertyValue("titleLocation") }, set: function (e) { var t = "hidden" == this.titleLocation || "hidden" == e; this.setPropertyValue("titleLocation", e.toLowerCase()), this.updateQuestionCss(), t && this.notifySurveyVisibilityChanged() }, enumerable: !1, configurable: !0 }), t.prototype.getTitleOwner = function () { return this }, t.prototype.getIsTitleRenderedAsString = function () { return "hidden" === this.titleLocation }, t.prototype.notifySurveyVisibilityChanged = function () { this.survey && !this.isLoadingFromJson && (this.survey.questionVisibilityChanged(this, this.isVisible), this.isClearValueOnHidden && (this.visible || this.clearValueIfInvisible(), this.isVisible && this.updateValueWithDefaults())) }, t.prototype.getTitleLocation = function () { if (this.isFlowLayout) return "hidden"; var e = this.getTitleLocationCore(); return "left" !== e || this.isAllowTitleLeft || (e = "top"), e }, t.prototype.getTitleLocationCore = function () { return "default" !== this.titleLocation ? this.titleLocation : this.parent ? this.parent.getQuestionTitleLocation() : this.survey ? this.survey.questionTitleLocation : "top" }, Object.defineProperty(t.prototype, "hasTitleOnLeft", { get: function () { return this.hasTitle && "left" === this.getTitleLocation() }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "hasTitleOnTop", { get: function () { return this.hasTitle && "top" === this.getTitleLocation() }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "hasTitleOnBottom", { get: function () { return this.hasTitle && "bottom" === this.getTitleLocation() }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "hasTitleOnLeftTop", { get: function () { if (!this.hasTitle) return !1; var e = this.getTitleLocation(); return "left" === e || "top" === e }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "errorLocation", { get: function () { return this.survey ? this.survey.questionErrorLocation : "top" }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "hasInput", { get: function () { return !0 }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "hasSingleInput", { get: function () { return this.hasInput }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "inputId", { get: function () { return this.id + "i" }, enumerable: !1, configurable: !0 }), t.prototype.getDefaultTitleValue = function () { return this.name }, t.prototype.getDefaultTitleTagName = function () { return o.titleTags.question }, Object.defineProperty(t.prototype, "descriptionLocation", { get: function () { return this.getPropertyValue("descriptionLocation") }, set: function (e) { this.setPropertyValue("descriptionLocation", e), this.updateQuestionCss() }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "hasDescriptionUnderTitle", { get: function () { return "underTitle" == this.getDescriptionLocation() }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "hasDescriptionUnderInput", { get: function () { return "underInput" == this.getDescriptionLocation() }, enumerable: !1, configurable: !0 }), t.prototype.getDescriptionLocation = function () { return "default" !== this.descriptionLocation ? this.descriptionLocation : this.survey ? this.survey.questionDescriptionLocation : "underTitle" }, t.prototype.needClickTitleFunction = function () { return e.prototype.needClickTitleFunction.call(this) || this.hasInput }, t.prototype.processTitleClick = function () { var t = this; if (e.prototype.processTitleClick.call(this), !this.isCollapsed) return setTimeout((function () { t.focus() }), 1), !0 }, Object.defineProperty(t.prototype, "requiredErrorText", { get: function () { return this.getLocalizableStringText("requiredErrorText") }, set: function (e) { this.setLocalizableStringText("requiredErrorText", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "locRequiredErrorText", { get: function () { return this.getLocalizableString("requiredErrorText") }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "commentText", { get: function () { return this.getLocalizableStringText("commentText") }, set: function (e) { this.setLocalizableStringText("commentText", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "locCommentText", { get: function () { return this.getLocalizableString("commentText") }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "commentPlaceHolder", { get: function () { return this.commentPlaceholder }, set: function (e) { this.commentPlaceholder = e }, enumerable: !1, configurable: !0 }), t.prototype.getAllErrors = function () { return this.errors.slice() }, t.prototype.getErrorByType = function (e) { for (var t = 0; t < this.errors.length; t++)if (this.errors[t].getErrorType() === e) return this.errors[t]; return null }, Object.defineProperty(t.prototype, "customWidget", { get: function () { return this.isCustomWidgetRequested || this.customWidgetValue || (this.isCustomWidgetRequested = !0, this.updateCustomWidget()), this.customWidgetValue }, enumerable: !1, configurable: !0 }), t.prototype.updateCustomWidget = function () { this.customWidgetValue = Ut.Instance.getCustomWidget(this) }, t.prototype.localeChanged = function () { e.prototype.localeChanged.call(this), this.localeChangedCallback && this.localeChangedCallback() }, Object.defineProperty(t.prototype, "isCompositeQuestion", { get: function () { return !1 }, enumerable: !1, configurable: !0 }), t.prototype.updateCommentElements = function () { if (this.autoGrowComment && Array.isArray(this.commentElements)) for (var e = 0; e < this.commentElements.length; e++) { var t = this.commentElements[e]; t && Xe(t) } }, t.prototype.onCommentInput = function (e) { this.isInputTextUpdate ? e.target && (this.comment = e.target.value) : this.updateCommentElements() }, t.prototype.onCommentChange = function (e) { this.comment = e.target.value, this.comment !== e.target.value && (e.target.value = this.comment) }, t.prototype.afterRenderQuestionElement = function (e) { this.survey && this.hasSingleInput && this.survey.afterRenderQuestionInput(this, e) }, t.prototype.afterRender = function (e) { var t = this; this.survey && (this.survey.afterRenderQuestion(this, e), this.afterRenderQuestionCallback && this.afterRenderQuestionCallback(this, e), (this.supportComment() || this.supportOther()) && (this.commentElements = [], this.getCommentElementsId().forEach((function (e) { var n = document.getElementById(e); n && t.commentElements.push(n) })), this.updateCommentElements()), this.checkForResponsiveness(e)) }, t.prototype.getCommentElementsId = function () { return [this.commentId] }, t.prototype.beforeDestroyQuestionElement = function (e) { this.commentElements = void 0 }, Object.defineProperty(t.prototype, "processedTitle", { get: function () { var e = this.locProcessedTitle.textOrHtml; return e || this.name }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "fullTitle", { get: function () { return this.locTitle.renderedHtml }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "titlePattern", { get: function () { return this.survey ? this.survey.questionTitlePattern : "numTitleRequire" }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "isRequireTextOnStart", { get: function () { return this.isRequired && "requireNumTitle" == this.titlePattern }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "isRequireTextBeforeTitle", { get: function () { return this.isRequired && "numRequireTitle" == this.titlePattern && "" !== this.requiredText }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "isRequireTextAfterTitle", { get: function () { return this.isRequired && "numTitleRequire" == this.titlePattern && "" !== this.requiredText }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "startWithNewLine", { get: function () { return this.getPropertyValue("startWithNewLine") }, set: function (e) { this.startWithNewLine != e && this.setPropertyValue("startWithNewLine", e) }, enumerable: !1, configurable: !0 }), t.prototype.calcCssClasses = function (e) { var t = { error: {} }; return this.copyCssClasses(t, e.question), this.copyCssClasses(t.error, e.error), this.updateCssClasses(t, e), this.survey && this.survey.updateQuestionCssClasses(this, t), this.onUpdateCssClassesCallback && this.onUpdateCssClassesCallback(t), t }, Object.defineProperty(t.prototype, "cssRoot", { get: function () { return this.ensureElementCss(), this.getPropertyValue("cssRoot", "") }, enumerable: !1, configurable: !0 }), t.prototype.setCssRoot = function (e) { this.setPropertyValue("cssRoot", e) }, t.prototype.getCssRoot = function (e) { return (new at).append(this.isFlowLayout && !this.isDesignMode ? e.flowRoot : e.mainRoot).append(e.titleLeftRoot, !this.isFlowLayout && this.hasTitleOnLeft).append(e.hasError, this.errors.length > 0).append(e.small, !this.width).append(e.answered, this.isAnswered).append(e.expanded, !!this.isExpanded).append(e.collapsed, !!this.isCollapsed).append(e.withFrame, this.hasFrameV2).append(e.nested, (this.hasParent || !this.isSingleInRow) && this.isDefaultV2Theme).toString() }, Object.defineProperty(t.prototype, "cssHeader", { get: function () { return this.ensureElementCss(), this.getPropertyValue("cssHeader", "") }, enumerable: !1, configurable: !0 }), t.prototype.setCssHeader = function (e) { this.setPropertyValue("cssHeader", e) }, t.prototype.getCssHeader = function (e) { return (new at).append(e.header).append(e.headerTop, this.hasTitleOnTop).append(e.headerLeft, this.hasTitleOnLeft).append(e.headerBottom, this.hasTitleOnBottom).toString() }, Object.defineProperty(t.prototype, "cssContent", { get: function () { return this.ensureElementCss(), this.getPropertyValue("cssContent", "") }, enumerable: !1, configurable: !0 }), t.prototype.setCssContent = function (e) { this.setPropertyValue("cssContent", e) }, t.prototype.getCssContent = function (e) { return (new at).append(e.content).append(e.contentLeft, this.hasTitleOnLeft).toString() }, Object.defineProperty(t.prototype, "cssTitle", { get: function () { return this.ensureElementCss(), this.getPropertyValue("cssTitle", "") }, enumerable: !1, configurable: !0 }), t.prototype.setCssTitle = function (e) { this.setPropertyValue("cssTitle", e) }, t.prototype.getCssTitle = function (e) { return (new at).append(e.title).append(e.titleExpandable, "default" !== this.state).append(e.titleExpanded, this.isExpanded).append(e.titleCollapsed, this.isCollapsed).append(e.titleDisabled, this.isReadOnly).append(e.titleOnError, this.containsErrors).append(e.titleOnAnswer, !this.containsErrors && this.isAnswered).toString() }, Object.defineProperty(t.prototype, "cssDescription", { get: function () { return this.ensureElementCss(), this.getPropertyValue("cssDescription", "") }, enumerable: !1, configurable: !0 }), t.prototype.setCssDescription = function (e) { this.setPropertyValue("cssDescription", e) }, t.prototype.getCssDescription = function (e) { return (new at).append(e.description, this.hasDescriptionUnderTitle).append(e.descriptionUnderInput, this.hasDescriptionUnderInput).toString() }, t.prototype.getIsErrorsModeTooltip = function () { return e.prototype.getIsErrorsModeTooltip.call(this) && !this.customWidget }, t.prototype.showErrorOnCore = function (e) { return !this.isErrorsModeTooltip && !this.showErrorsAboveQuestion && !this.showErrorsBelowQuestion && this.errorLocation === e }, Object.defineProperty(t.prototype, "showErrorOnTop", { get: function () { return this.showErrorOnCore("top") }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "showErrorOnBottom", { get: function () { return this.showErrorOnCore("bottom") }, enumerable: !1, configurable: !0 }), t.prototype.getIsTooltipErrorSupportedByParent = function () { return this.parentQuestion ? this.parentQuestion.getIsTooltipErrorInsideSupported() : e.prototype.getIsTooltipErrorSupportedByParent.call(this) }, Object.defineProperty(t.prototype, "showErrorsOutsideQuestion", { get: function () { return this.isDefaultV2Theme && !(this.hasParent && this.getIsTooltipErrorSupportedByParent()) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "showErrorsAboveQuestion", { get: function () { return this.showErrorsOutsideQuestion && "top" === this.errorLocation }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "showErrorsBelowQuestion", { get: function () { return this.showErrorsOutsideQuestion && "bottom" === this.errorLocation }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "cssError", { get: function () { return this.ensureElementCss(), this.getPropertyValue("cssError", "") }, enumerable: !1, configurable: !0 }), t.prototype.setCssError = function (e) { this.setPropertyValue("cssError", e) }, t.prototype.getCssError = function (e) { return (new at).append(e.error.root).append(e.error.outsideQuestion, this.showErrorsBelowQuestion || this.showErrorsAboveQuestion).append(e.error.belowQuestion, this.showErrorsBelowQuestion).append(e.error.aboveQuestion, this.showErrorsAboveQuestion).append(e.error.tooltip, this.isErrorsModeTooltip).append(e.error.locationTop, this.showErrorOnTop).append(e.error.locationBottom, this.showErrorOnBottom).toString() }, t.prototype.getRootCss = function () { return (new at).append(this.cssRoot).append(this.cssClasses.disabled, this.isReadOnly).append(this.cssClasses.invisible, !this.isDesignMode && this.areInvisibleElementsShowing && !this.visible).toString() }, t.prototype.updateElementCss = function (t) { e.prototype.updateElementCss.call(this, t), t && this.updateQuestionCss(!0), this.onIndentChanged() }, t.prototype.updateQuestionCss = function (e) { this.isLoadingFromJson || !this.survey || !0 !== e && !this.cssClassesValue || this.updateElementCssCore(this.cssClasses) }, t.prototype.ensureElementCss = function () { this.cssClassesValue || this.updateQuestionCss(!0) }, t.prototype.updateElementCssCore = function (e) { this.setCssRoot(this.getCssRoot(e)), this.setCssHeader(this.getCssHeader(e)), this.setCssContent(this.getCssContent(e)), this.setCssTitle(this.getCssTitle(e)), this.setCssDescription(this.getCssDescription(e)), this.setCssError(this.getCssError(e)) }, t.prototype.updateCssClasses = function (e, t) { if (t.question) { var n = t[this.getCssType()], o = (new at).append(e.title).append(t.question.titleRequired, this.isRequired); e.title = o.toString(); var r = (new at).append(e.root).append(n, this.isRequired && !!t.question.required); if (null == n) e.root = r.toString(); else if ("string" == typeof n || n instanceof String) e.root = r.append(n.toString()).toString(); else for (var i in e.root = r.toString(), n) e[i] = n[i] } }, t.prototype.getCssType = function () { return this.getType() }, Object.defineProperty(t.prototype, "renderCssRoot", { get: function () { return this.cssClasses.root || void 0 }, enumerable: !1, configurable: !0 }), t.prototype.onIndentChanged = function () { this.paddingLeft = this.getIndentSize(this.indent), this.paddingRight = this.getIndentSize(this.rightIndent) }, t.prototype.getIndentSize = function (e) { return e < 1 || !this.getSurvey() || !this.cssClasses || !this.cssClasses.indent ? "" : e * this.cssClasses.indent + "px" }, t.prototype.focus = function (e) { if (void 0 === e && (e = !1), !this.isDesignMode) { this.survey && (this.expandAllParents(this), this.survey.scrollElementToTop(this, this, null, this.id)); var t = e ? this.getFirstErrorInputElementId() : this.getFirstInputElementId(); At.FocusElement(t) && this.fireCallback(this.focusCallback) } }, t.prototype.expandAllParents = function (e) { e && (e.isCollapsed && e.expand(), this.expandAllParents(e.parent), this.expandAllParents(e.parentQuestion)) }, t.prototype.focusIn = function () { this.survey && this.survey.whenQuestionFocusIn(this) }, t.prototype.fireCallback = function (e) { e && e() }, t.prototype.getOthersMaxLength = function () { return this.survey && this.survey.maxOthersLength > 0 ? this.survey.maxOthersLength : null }, t.prototype.onCreating = function () { }, t.prototype.getFirstQuestionToFocus = function (e) { return this.hasInput && (!e || this.currentErrorCount > 0) ? this : null }, t.prototype.getFirstInputElementId = function () { return this.inputId }, t.prototype.getFirstErrorInputElementId = function () { return this.getFirstInputElementId() }, t.prototype.getProcessedTextValue = function (e) { var n = e.name.toLocaleLowerCase(); e.isExists = -1 !== Object.keys(t.TextPreprocessorValuesMap).indexOf(n) || void 0 !== this[e.name], e.value = this[t.TextPreprocessorValuesMap[n] || e.name] }, t.prototype.supportComment = function () { var e = this.getPropertyByName("showCommentArea"); return !e || e.visible }, t.prototype.supportOther = function () { return !1 }, Object.defineProperty(t.prototype, "isRequired", { get: function () { return this.getPropertyValue("isRequired") }, set: function (e) { this.setPropertyValue("isRequired", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "requiredIf", { get: function () { return this.getPropertyValue("requiredIf", "") }, set: function (e) { this.setPropertyValue("requiredIf", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "showCommentArea", { get: function () { return this.getPropertyValue("showCommentArea", !1) }, set: function (e) { this.supportComment() && this.setPropertyValue("showCommentArea", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "hasComment", { get: function () { return this.showCommentArea }, set: function (e) { this.showCommentArea = e }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "id", { get: function () { return this.getPropertyValue("id") }, set: function (e) { this.setPropertyValue("id", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "ariaTitleId", { get: function () { return this.id + "_ariaTitle" }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "commentId", { get: function () { return this.id + "_comment" }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "ariaRole", { get: function () { return "textbox" }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "showOtherItem", { get: function () { return this.getPropertyValue("showOtherItem", !1) }, set: function (e) { this.supportOther() && this.showOtherItem != e && (this.setPropertyValue("showOtherItem", e), this.hasOtherChanged()) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "hasOther", { get: function () { return this.showOtherItem }, set: function (e) { this.showOtherItem = e }, enumerable: !1, configurable: !0 }), t.prototype.hasOtherChanged = function () { }, Object.defineProperty(t.prototype, "requireUpdateCommentValue", { get: function () { return this.hasComment || this.hasOther }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "isReadOnly", { get: function () { var e = !!this.parent && this.parent.isReadOnly, t = !!this.parentQuestion && this.parentQuestion.isReadOnly, n = !!this.survey && this.survey.isDisplayMode; return this.readOnly || e || n || t }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "isInputReadOnly", { get: function () { var e = o.supportCreatorV2 && this.isDesignMode; return this.isReadOnly || e }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "renderedInputReadOnly", { get: function () { return this.isInputReadOnly ? "" : void 0 }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "renderedInputDisabled", { get: function () { return this.isInputReadOnly ? "" : void 0 }, enumerable: !1, configurable: !0 }), t.prototype.onReadOnlyChanged = function () { this.setPropertyValue("isInputReadOnly", this.isInputReadOnly), e.prototype.onReadOnlyChanged.call(this) }, Object.defineProperty(t.prototype, "enableIf", { get: function () { return this.getPropertyValue("enableIf", "") }, set: function (e) { this.setPropertyValue("enableIf", e) }, enumerable: !1, configurable: !0 }), t.prototype.surveyChoiceItemVisibilityChange = function () { }, t.prototype.runCondition = function (e, t) { this.isDesignMode || (t || (t = {}), t.question = this, this.runConditionCore(e, t), this.isValueChangedDirectly || (this.defaultValueRunner = this.getDefaultRunner(this.defaultValueRunner, this.defaultValueExpression), this.runDefaultValueExpression(this.defaultValueRunner, e, t))) }, Object.defineProperty(t.prototype, "no", { get: function () { return this.getPropertyValue("no") }, enumerable: !1, configurable: !0 }), t.prototype.calcNo = function () { if (!this.hasTitle || this.hideNumber) return ""; var e = r.getNumberByIndex(this.visibleIndex, this.getStartIndex()); return this.survey && (e = this.survey.getUpdatedQuestionNo(this, e)), e }, t.prototype.getStartIndex = function () { return this.parent ? this.parent.getQuestionStartIndex() : this.survey ? this.survey.questionStartIndex : "" }, t.prototype.onSurveyLoad = function () { this.isCustomWidgetRequested = !1, this.fireCallback(this.surveyLoadCallback), this.updateValueWithDefaults(), this.isEmpty() && this.initDataFromSurvey() }, t.prototype.onSetData = function () { e.prototype.onSetData.call(this), this.survey && (this.initDataFromSurvey(), this.onSurveyValueChanged(this.value), this.updateValueWithDefaults(), this.onIndentChanged(), this.updateQuestionCss(), this.updateIsAnswered()) }, t.prototype.initDataFromSurvey = function () { if (this.data) { var e = this.data.getValue(this.getValueName()); r.isValueEmpty(e) && this.isLoadingFromJson || this.updateValueFromSurvey(e), this.initCommentFromSurvey() } }, t.prototype.initCommentFromSurvey = function () { this.data && this.requireUpdateCommentValue ? this.updateCommentFromSurvey(this.data.getComment(this.getValueName())) : this.updateCommentFromSurvey("") }, t.prototype.runExpression = function (e) { if (this.survey && e) return this.survey.runExpression(e) }, Object.defineProperty(t.prototype, "autoGrowComment", { get: function () { return this.survey && this.survey.autoGrowComment }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "questionValue", { get: function () { return this.getPropertyValue("value") }, set: function (e) { this.setPropertyValue("value", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "questionComment", { get: function () { return this.getPropertyValue("comment") }, set: function (e) { this.setPropertyValue("comment", e), this.fireCallback(this.commentChangedCallback) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "value", { get: function () { return this.getValueCore() }, set: function (e) { this.setNewValue(e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "valueForSurvey", { get: function () { return this.valueToDataCallback ? this.valueToDataCallback(this.value) : this.value }, enumerable: !1, configurable: !0 }), t.prototype.clearValue = function () { void 0 !== this.value && (this.value = void 0), this.comment && (this.comment = void 0) }, t.prototype.unbindValue = function () { this.clearValue() }, t.prototype.createValueCopy = function () { return this.getUnbindValue(this.value) }, t.prototype.getUnbindValue = function (e) { return this.isValueSurveyElement(e) ? e : r.getUnbindValue(e) }, t.prototype.isValueSurveyElement = function (e) { return !!e && (Array.isArray(e) ? e.length > 0 && this.isValueSurveyElement(e[0]) : !!e.getType && !!e.onPropertyChanged) }, t.prototype.canClearValueAsInvisible = function () { return (!this.isVisible || !this.isParentVisible) && ((!this.page || !this.page.isStartPage) && (!this.survey || !this.valueName || !this.survey.hasVisibleQuestionByValueName(this.valueName))) }, Object.defineProperty(t.prototype, "isParentVisible", { get: function () { for (var e = this.parent; e;) { if (!e.isVisible) return !1; e = e.parent } return !0 }, enumerable: !1, configurable: !0 }), t.prototype.clearValueIfInvisible = function (e) { void 0 === e && (e = "onHidden"), "none" !== this.clearIfInvisible && ("onHidden" === e && "onComplete" === this.clearIfInvisible || ("none" !== e || "default" !== this.clearIfInvisible && "none" !== this.clearIfInvisible) && this.clearValueIfInvisibleCore()) }, t.prototype.clearValueIfInvisibleCore = function () { this.canClearValueAsInvisible() && this.clearValue() }, Object.defineProperty(t.prototype, "clearIfInvisible", { get: function () { return this.getPropertyValue("clearIfInvisible") }, set: function (e) { this.setPropertyValue("clearIfInvisible", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "displayValue", { get: function () { return this.isLoadingFromJson ? "" : this.getDisplayValue(!0) }, enumerable: !1, configurable: !0 }), t.prototype.getDisplayValue = function (e, t) { void 0 === t && (t = void 0); var n = this.calcDisplayValue(e, t); return this.survey && (n = this.survey.getQuestionDisplayValue(this, n)), this.displayValueCallback ? this.displayValueCallback(n) : n }, t.prototype.calcDisplayValue = function (e, t) { if (void 0 === t && (t = void 0), this.customWidget) { var n = this.customWidget.getDisplayValue(this, t); if (n) return n } return t = null == t ? this.createValueCopy() : t, this.isValueEmpty(t) ? this.getDisplayValueEmpty() : this.getDisplayValueCore(e, t) }, t.prototype.getDisplayValueCore = function (e, t) { return t }, t.prototype.getDisplayValueEmpty = function () { return "" }, Object.defineProperty(t.prototype, "defaultValue", { get: function () { return this.getPropertyValue("defaultValue") }, set: function (e) { this.isValueExpression(e) ? this.defaultValueExpression = e.substring(1) : (this.setPropertyValue("defaultValue", this.convertDefaultValue(e)), this.updateValueWithDefaults()) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "defaultValueExpression", { get: function () { return this.getPropertyValue("defaultValueExpression") }, set: function (e) { this.setPropertyValue("defaultValueExpression", e), this.defaultValueRunner = void 0, this.updateValueWithDefaults() }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "resizeStyle", { get: function () { return this.autoGrowComment ? "none" : "both" }, enumerable: !1, configurable: !0 }), t.prototype.getPlainData = function (e) { var t = this; if (e || (e = { includeEmpty: !0, includeQuestionTypes: !1 }), e.includeEmpty || !this.isEmpty()) { var n = { name: this.name, title: this.locTitle.renderedHtml, value: this.value, displayValue: this.displayValue, isNode: !1, getString: function (e) { return "object" == typeof e ? JSON.stringify(e) : e } }; return !0 === e.includeQuestionTypes && (n.questionType = this.getType()), (e.calculations || []).forEach((function (e) { n[e.propertyName] = t[e.propertyName] })), this.hasComment && (n.isNode = !0, n.data = [{ name: 0, isComment: !0, title: "Comment", value: o.commentSuffix, displayValue: this.comment, getString: function (e) { return "object" == typeof e ? JSON.stringify(e) : e }, isNode: !1 }]), n } }, Object.defineProperty(t.prototype, "correctAnswer", { get: function () { return this.getPropertyValue("correctAnswer") }, set: function (e) { this.setPropertyValue("correctAnswer", this.convertDefaultValue(e)) }, enumerable: !1, configurable: !0 }), t.prototype.convertDefaultValue = function (e) { return e }, Object.defineProperty(t.prototype, "quizQuestionCount", { get: function () { return this.isVisible && this.hasInput && !this.isValueEmpty(this.correctAnswer) ? this.getQuizQuestionCount() : 0 }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "correctAnswerCount", { get: function () { return this.isEmpty() || this.isValueEmpty(this.correctAnswer) ? 0 : this.getCorrectAnswerCount() }, enumerable: !1, configurable: !0 }), t.prototype.getQuizQuestionCount = function () { return 1 }, t.prototype.getCorrectAnswerCount = function () { return this.isTwoValueEquals(this.value, this.correctAnswer, !o.comparator.caseSensitive, !0) ? 1 : 0 }, t.prototype.isAnswerCorrect = function () { return this.correctAnswerCount == this.quizQuestionCount }, t.prototype.updateValueWithDefaults = function () { this.isLoadingFromJson || !this.isDesignMode && this.isDefaultValueEmpty() || (this.isDesignMode || this.isEmpty()) && (this.isEmpty() && this.isDefaultValueEmpty() || this.isClearValueOnHidden && !this.isVisible || this.isDesignMode && this.isContentElement && this.isDefaultValueEmpty() || this.setDefaultValue()) }, Object.defineProperty(t.prototype, "isClearValueOnHidden", { get: function () { return "none" !== this.clearIfInvisible && "onComplete" !== this.clearIfInvisible && ("onHidden" === this.clearIfInvisible || !!this.survey && this.survey.isClearValueOnHidden) }, enumerable: !1, configurable: !0 }), t.prototype.getQuestionFromArray = function (e, t) { return null }, t.prototype.getDefaultValue = function () { return this.defaultValue }, t.prototype.isDefaultValueEmpty = function () { return !this.defaultValueExpression && this.isValueEmpty(this.defaultValue) }, t.prototype.getDefaultRunner = function (e, t) { return !e && t && (e = new re(t)), e && (e.expression = t), e }, t.prototype.setDefaultValue = function () { var e = this; this.defaultValueRunner = this.getDefaultRunner(this.defaultValueRunner, this.defaultValueExpression), this.setValueAndRunExpression(this.defaultValueRunner, this.getUnbindValue(this.defaultValue), (function (t) { e.value = t })) }, t.prototype.isValueExpression = function (e) { return !!e && "string" == typeof e && e.length > 0 && "=" == e[0] }, t.prototype.setValueAndRunExpression = function (e, t, n, o, r) { var i = this; void 0 === o && (o = null), void 0 === r && (r = null); var s = function (e) { i.runExpressionSetValue(e, n) }; this.runDefaultValueExpression(e, o, r, s) || s(t) }, t.prototype.convertFuncValuetoQuestionValue = function (e) { return r.convertValToQuestionVal(e) }, t.prototype.runExpressionSetValue = function (e, t) { t(this.convertFuncValuetoQuestionValue(e)) }, t.prototype.runDefaultValueExpression = function (e, t, n, o) { var r = this; return void 0 === t && (t = null), void 0 === n && (n = null), !(!e || !this.data) && (o || (o = function (e) { r.runExpressionSetValue(e, (function (e) { r.value = e })) }), t || (t = this.data.getFilteredValues()), n || (n = this.data.getFilteredProperties()), e && e.canRun && (e.onRunComplete = function (e) { null == e && (e = r.defaultValue), r.isChangingViaDefaultValue = !0, o(e), r.isChangingViaDefaultValue = !1 }, e.run(t, n)), !0) }, Object.defineProperty(t.prototype, "comment", { get: function () { return this.getQuestionComment() }, set: function (e) { if (e) { var t = e.toString().trim(); t !== e && (e = t) === this.comment && this.setPropertyValueDirectly("comment", e) } this.comment != e && (this.setQuestionComment(e), this.updateCommentElements()) }, enumerable: !1, configurable: !0 }), t.prototype.getCommentAreaCss = function (e) { return void 0 === e && (e = !1), (new at).append("form-group", e).append(this.cssClasses.formGroup, !e).append(this.cssClasses.commentArea).toString() }, t.prototype.getQuestionComment = function () { return this.questionComment }, t.prototype.setQuestionComment = function (e) { this.setNewComment(e) }, t.prototype.isEmpty = function () { return this.isValueEmpty(this.value) }, Object.defineProperty(t.prototype, "isAnswered", { get: function () { return this.getPropertyValue("isAnswered") }, set: function (e) { this.setPropertyValue("isAnswered", e) }, enumerable: !1, configurable: !0 }), t.prototype.updateIsAnswered = function () { var e = this.isAnswered; this.setPropertyValue("isAnswered", this.getIsAnswered()), e !== this.isAnswered && this.updateQuestionCss() }, t.prototype.getIsAnswered = function () { return !this.isEmpty() }, Object.defineProperty(t.prototype, "validators", { get: function () { return this.getPropertyValue("validators") }, set: function (e) { this.setPropertyValue("validators", e) }, enumerable: !1, configurable: !0 }), t.prototype.getValidators = function () { return this.validators }, t.prototype.getSupportedValidators = function () { for (var e = [], t = this.getType(); t;) { var n = o.supportedValidators[t]; if (n) for (var r = n.length - 1; r >= 0; r--)e.splice(0, 0, n[r]); t = _.findClass(t).parentName } return e }, t.prototype.addSupportedValidators = function (e, t) { }, t.prototype.addConditionObjectsByContext = function (e, t) { e.push({ name: this.getValueName(), text: this.processedTitle, question: this }) }, t.prototype.getConditionJson = function (e, t) { void 0 === e && (e = null), void 0 === t && (t = null); var n = (new S).toJsonObject(this); return n.type = this.getType(), n }, t.prototype.hasErrors = function (e, t) { void 0 === e && (e = !0), void 0 === t && (t = null); var n = this.errors.length > 0, o = this.checkForErrors(!!t && !0 === t.isOnValueChanged); return e && (this.survey && this.survey.beforeSettingQuestionErrors(this, o), this.errors = o), this.updateContainsErrors(), n != o.length > 0 && this.updateQuestionCss(), this.isCollapsed && t && e && o.length > 0 && this.expand(), o.length > 0 }, t.prototype.validate = function (e, t) { return void 0 === e && (e = !0), void 0 === t && (t = null), !this.hasErrors(e, t) }, Object.defineProperty(t.prototype, "currentErrorCount", { get: function () { return this.errors.length }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "requiredText", { get: function () { return null != this.survey && this.isRequired ? this.survey.requiredText : "" }, enumerable: !1, configurable: !0 }), t.prototype.addError = function (e) { if (e) { var t = null; t = "string" == typeof e || e instanceof String ? new Se(e, this.survey) : e, this.errors.push(t) } }, t.prototype.removeError = function (e) { var t = this.errors, n = t.indexOf(e); -1 !== n && t.splice(n, 1) }, t.prototype.checkForErrors = function (e) { var t = new Array; return this.isVisible && this.canCollectErrors() && this.collectErrors(t, e), t }, t.prototype.canCollectErrors = function () { return !this.isReadOnly }, t.prototype.collectErrors = function (e, t) { if (this.onCheckForErrors(e, t), !(e.length > 0) && this.canRunValidators(t)) { var n = this.runValidators(); if (n.length > 0) { e.length = 0; for (var o = 0; o < n.length; o++)e.push(n[o]) } if (this.survey && 0 == e.length) { var r = this.fireSurveyValidation(); r && e.push(r) } } }, t.prototype.canRunValidators = function (e) { return !0 }, t.prototype.fireSurveyValidation = function () { return this.validateValueCallback ? this.validateValueCallback() : this.survey ? this.survey.validateQuestion(this) : null }, t.prototype.onCheckForErrors = function (e, t) { var n = this; if (!t && this.hasRequiredError()) { var o = new ye(this.requiredErrorText, this); o.onUpdateErrorTextCallback = function (e) { e.text = n.requiredErrorText }, e.push(o) } }, t.prototype.hasRequiredError = function () { return this.isRequired && this.isEmpty() }, Object.defineProperty(t.prototype, "isRunningValidators", { get: function () { return this.getIsRunningValidators() }, enumerable: !1, configurable: !0 }), t.prototype.getIsRunningValidators = function () { return this.isRunningValidatorsValue }, t.prototype.runValidators = function () { var e = this; return this.validatorRunner && (this.validatorRunner.onAsyncCompleted = null), this.validatorRunner = new Ee, this.isRunningValidatorsValue = !0, this.validatorRunner.onAsyncCompleted = function (t) { e.doOnAsyncCompleted(t) }, this.validatorRunner.run(this) }, t.prototype.doOnAsyncCompleted = function (e) { for (var t = 0; t < e.length; t++)this.errors.push(e[t]); this.isRunningValidatorsValue = !1, this.raiseOnCompletedAsyncValidators() }, t.prototype.raiseOnCompletedAsyncValidators = function () { this.onCompletedAsyncValidators && !this.isRunningValidators && (this.onCompletedAsyncValidators(this.getAllErrors().length > 0), this.onCompletedAsyncValidators = null) }, t.prototype.setNewValue = function (e) { var t = this.isAnswered; this.setNewValueInData(e), this.allowNotifyValueChanged && this.onValueChanged(), this.isAnswered != t && this.updateQuestionCss() }, t.prototype.isTextValue = function () { return !1 }, Object.defineProperty(t.prototype, "isSurveyInputTextUpdate", { get: function () { return !!this.survey && this.survey.isUpdateValueTextOnTyping }, enumerable: !1, configurable: !0 }), t.prototype.getDataLocNotification = function () { return !!this.isInputTextUpdate && "text" }, Object.defineProperty(t.prototype, "isInputTextUpdate", { get: function () { return this.isSurveyInputTextUpdate && this.isTextValue() }, enumerable: !1, configurable: !0 }), t.prototype.setNewValueInData = function (e) { e = this.valueToData(e), this.isValueChangedInSurvey || this.setValueCore(e) }, t.prototype.getValueCore = function () { return this.questionValue }, t.prototype.setValueCore = function (e) { this.setQuestionValue(e), null != this.data && this.canSetValueToSurvey() && (e = this.valueForSurvey, this.data.setValue(this.getValueName(), e, this.getDataLocNotification(), this.allowNotifyValueChanged)) }, t.prototype.canSetValueToSurvey = function () { return !0 }, t.prototype.valueFromData = function (e) { return e }, t.prototype.valueToData = function (e) { return e }, t.prototype.onValueChanged = function () { }, t.prototype.setNewComment = function (e) { this.questionComment !== e && (this.questionComment = e, null != this.data && this.data.setComment(this.getValueName(), e, !!this.isSurveyInputTextUpdate && "text")) }, t.prototype.getValidName = function (e) { return e ? e.trim().replace(/[\{\}]+/g, "") : e }, t.prototype.updateValueFromSurvey = function (e) { e = this.getUnbindValue(e), this.valueFromDataCallback && (e = this.valueFromDataCallback(e)), this.setQuestionValue(this.valueFromData(e)), this.updateIsAnswered() }, t.prototype.updateCommentFromSurvey = function (e) { this.questionComment = e }, t.prototype.onChangeQuestionValue = function (e) { }, t.prototype.setValueChangedDirectly = function () { this.isValueChangedDirectly = !0 }, t.prototype.setQuestionValue = function (e, t) { void 0 === t && (t = !0); var n = this.isTwoValueEquals(this.questionValue, e); n || this.isChangingViaDefaultValue || this.setValueChangedDirectly(), this.questionValue = e, n || this.onChangeQuestionValue(e), !n && this.allowNotifyValueChanged && this.fireCallback(this.valueChangedCallback), t && this.updateIsAnswered() }, t.prototype.onSurveyValueChanged = function (e) { }, t.prototype.setVisibleIndex = function (e) { return (!this.isVisible || !this.hasTitle && !o.setQuestionVisibleIndexForHiddenTitle || this.hideNumber && !o.setQuestionVisibleIndexForHiddenNumber) && (e = -1), this.setPropertyValue("visibleIndex", e), this.setPropertyValue("no", this.calcNo()), e < 0 ? 0 : 1 }, t.prototype.removeElement = function (e) { return !1 }, t.prototype.supportGoNextPageAutomatic = function () { return !1 }, t.prototype.supportGoNextPageError = function () { return !0 }, t.prototype.clearIncorrectValues = function () { }, t.prototype.clearOnDeletingContainer = function () { }, t.prototype.clearErrors = function () { this.errors = [] }, t.prototype.clearUnusedValues = function () { }, t.prototype.onAnyValueChanged = function (e) { }, t.prototype.checkBindings = function (e, t) { if (!this.bindings.isEmpty() && this.data) for (var n = this.bindings.getPropertiesByValueName(e), o = 0; o < n.length; o++) { var i = n[o]; this.isValueEmpty(t) && r.isNumber(this[i]) && (t = 0), this[i] = t } }, t.prototype.getComponentName = function () { return Wt.Instance.getRendererByQuestion(this) }, t.prototype.isDefaultRendering = function () { return !!this.customWidget || "default" === this.renderAs || "default" === this.getComponentName() }, t.prototype.getErrorCustomText = function (e, t) { return this.survey ? this.survey.getSurveyErrorCustomText(this, e, t) : e }, t.prototype.getValidatorTitle = function () { return null }, Object.defineProperty(t.prototype, "validatedValue", { get: function () { return this.value }, set: function (e) { this.value = e }, enumerable: !1, configurable: !0 }), t.prototype.getAllValues = function () { return this.data ? this.data.getAllValues() : null }, t.prototype.transformToMobileView = function () { }, t.prototype.transformToDesktopView = function () { }, t.prototype.needResponsiveWidth = function () { return !1 }, t.prototype.supportResponsiveness = function () { return !1 }, t.prototype.needResponsiveness = function () { return this.supportResponsiveness() && this.isDefaultV2Theme && !this.isDesignMode }, t.prototype.checkForResponsiveness = function (e) { var t = this; if (this.needResponsiveness()) if (this.isCollapsed) { this.registerPropertyChangedHandlers(["state"], (function () { t.isExpanded && (t.initResponsiveness(e), t.unregisterPropertyChangedHandlers(["state"], "for-responsiveness")) }), "for-responsiveness") } else this.initResponsiveness(e) }, t.prototype.getObservedElementSelector = function () { return ".sd-scrollable-container" }, t.prototype.onMobileChanged = function () { this.onMobileChangedCallback && this.onMobileChangedCallback() }, t.prototype.initResponsiveness = function (e) { var t = this; if (this.destroyResizeObserver(), e && this.isDefaultRendering()) { var n = this.getObservedElementSelector(); if (!n) return; if (!e.querySelector(n)) return; var o = !1, r = void 0; this.resizeObserver = new ResizeObserver((function () { var i = e.querySelector(n); !r && t.isDefaultRendering() && (r = i.scrollWidth), o = !(o || !tt(i)) && t.processResponsiveness(r, et(i)) })), this.onMobileChangedCallback = function () { setTimeout((function () { var o = e.querySelector(n); t.processResponsiveness(r, et(o)) }), 0) }, this.resizeObserver.observe(e) } }, t.prototype.getCompactRenderAs = function () { return "default" }, t.prototype.getDesktopRenderAs = function () { return "default" }, t.prototype.processResponsiveness = function (e, t) { if (t = Math.round(t), Math.abs(e - t) > 2) { var n = this.renderAs; return this.renderAs = e > t ? this.getCompactRenderAs() : this.getDesktopRenderAs(), n !== this.renderAs } return !1 }, t.prototype.destroyResizeObserver = function () { this.resizeObserver && (this.resizeObserver.disconnect(), this.resizeObserver = void 0, this.onMobileChangedCallback = void 0, this.renderAs = this.getDesktopRenderAs()) }, t.prototype.dispose = function () { e.prototype.dispose.call(this), this.destroyResizeObserver() }, t.TextPreprocessorValuesMap = { title: "processedTitle", require: "requiredText" }, t.questionCounter = 100, Gt([f({ defaultValue: !1 })], t.prototype, "isMobile", void 0), Gt([f({ localizable: !0 })], t.prototype, "commentPlaceholder", void 0), Gt([f({ defaultValue: "default" })], t.prototype, "renderAs", void 0), t }(At); function Kt(e) { return e && e[0] === o.expressionDisableConversionChar ? e.substring(1) : e } _.addClass("question", [{ name: "!name", onSettingValue: function (e, t) { return Kt(t) } }, { name: "state", default: "default", choices: ["default", "collapsed", "expanded"] }, { name: "visible:switch", default: !0 }, { name: "useDisplayValuesInDynamicTexts:boolean", alternativeName: "useDisplayValuesInTitle", default: !0, layout: "row" }, "visibleIf:condition", { name: "width" }, { name: "minWidth", defaultFunc: function () { return o.minWidth } }, { name: "maxWidth", defaultFunc: function () { return o.maxWidth } }, { name: "startWithNewLine:boolean", default: !0, layout: "row" }, { name: "indent:number", default: 0, choices: [0, 1, 2, 3], layout: "row" }, { name: "page", isSerializable: !1, visibleIf: function (e) { var t = e ? e.survey : null; return !t || !t.pages || t.pages.length > 1 }, choices: function (e) { var t = e ? e.survey : null; return t ? t.pages.map((function (e) { return { value: e.name, text: e.title } })) : [] } }, { name: "title:text", serializationProperty: "locTitle", layout: "row", dependsOn: "name", onPropertyEditorUpdate: function (e, t) { e && t && (t.placeholder = e.name) } }, { name: "titleLocation", default: "default", choices: ["default", "top", "bottom", "left", "hidden"], layout: "row" }, { name: "description:text", serializationProperty: "locDescription", layout: "row" }, { name: "descriptionLocation", default: "default", choices: ["default", "underInput", "underTitle"] }, { name: "hideNumber:boolean", dependsOn: "titleLocation", visibleIf: function (e) { if (!e) return !0; if ("hidden" === e.titleLocation) return !1; var t = e ? e.parent : null; if (!(!t || "off" !== t.showQuestionNumbers)) return !1; var n = e ? e.survey : null; return !n || "off" !== n.showQuestionNumbers || !!t && "onpanel" === t.showQuestionNumbers } }, { name: "valueName", onSettingValue: function (e, t) { return Kt(t) } }, "enableIf:condition", "defaultValue:value", { name: "defaultValueExpression:expression", category: "logic" }, "correctAnswer:value", { name: "clearIfInvisible", default: "default", choices: ["default", "none", "onComplete", "onHidden"] }, "isRequired:switch", "requiredIf:condition", { name: "requiredErrorText:text", serializationProperty: "locRequiredErrorText" }, "readOnly:switch", { name: "validators:validators", baseClassName: "surveyvalidator", classNamePart: "validator" }, { name: "bindings:bindings", serializationProperty: "bindings", visibleIf: function (e) { return e.bindings.getNames().length > 0 } }, { name: "renderAs", default: "default", visible: !1 }, { name: "showCommentArea", visible: !1, default: !1, alternativeName: "hasComment", category: "general" }, { name: "commentText", dependsOn: "showCommentArea", visibleIf: function (e) { return e.showCommentArea }, serializationProperty: "locCommentText", layout: "row" }, { name: "commentPlaceholder", alternativeName: "commentPlaceHolder", serializationProperty: "locCommentPlaceholder", dependsOn: "showCommentArea", visibleIf: function (e) { return e.hasComment } }]), _.addAlterNativeClassName("question", "questionbase"); var Xt = function () { var e = function (t, n) { return (e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (e, t) { e.__proto__ = t } || function (e, t) { for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]) })(t, n) }; return function (t, n) { if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null"); function o() { this.constructor = t } e(t, n), t.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o) } }(), Yt = function (e, t, n, o) { var r, i = arguments.length, s = i < 3 ? t : null === o ? o = Object.getOwnPropertyDescriptor(t, n) : o; if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) s = Reflect.decorate(e, t, n, o); else for (var a = e.length - 1; a >= 0; a--)(r = e[a]) && (s = (i < 3 ? r(s) : i > 3 ? r(t, n, s) : r(t, n)) || s); return i > 3 && s && Object.defineProperty(t, n, s), s }, Zt = function (e) { function t(t) { var n = e.call(this, t) || this; return n.generatedVisibleRows = null, n.generatedTotalRow = null, n.filteredRows = null, n.filteredColumns = null, n.columns = n.createColumnValues(), n.rows = n.createItemValues("rows"), n } return Xt(t, e), t.prototype.createColumnValues = function () { return this.createItemValues("columns") }, t.prototype.getType = function () { return "matrixbase" }, t.prototype.endLoadingFromJson = function () { e.prototype.endLoadingFromJson.call(this), this.updateVisibilityBasedOnRows() }, Object.defineProperty(t.prototype, "isCompositeQuestion", { get: function () { return !0 }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "showHeader", { get: function () { return this.getPropertyValue("showHeader") }, set: function (e) { this.setPropertyValue("showHeader", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "columns", { get: function () { return this.getPropertyValue("columns") }, set: function (e) { this.setPropertyValue("columns", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "visibleColumns", { get: function () { return this.filteredColumns ? this.filteredColumns : this.columns }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "rows", { get: function () { return this.getPropertyValue("rows") }, set: function (e) { var t = this.processRowsOnSet(e); this.setPropertyValue("rows", t), this.filterItems() }, enumerable: !1, configurable: !0 }), t.prototype.processRowsOnSet = function (e) { return e }, t.prototype.getVisibleRows = function () { return [] }, Object.defineProperty(t.prototype, "visibleRows", { get: function () { return this.getVisibleRows() }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "rowsVisibleIf", { get: function () { return this.getPropertyValue("rowsVisibleIf", "") }, set: function (e) { this.setPropertyValue("rowsVisibleIf", e), this.filterItems() }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "columnsVisibleIf", { get: function () { return this.getPropertyValue("columnsVisibleIf", "") }, set: function (e) { this.setPropertyValue("columnsVisibleIf", e), this.filterItems() }, enumerable: !1, configurable: !0 }), t.prototype.runCondition = function (t, n) { e.prototype.runCondition.call(this, t, n), this.runItemsCondition(t, n) }, t.prototype.filterItems = function () { return this.areInvisibleElementsShowing ? (this.onRowsChanged(), !1) : !(this.isLoadingFromJson || !this.data) && this.runItemsCondition(this.getDataFilteredValues(), this.getDataFilteredProperties()) }, t.prototype.onColumnsChanged = function () { }, t.prototype.onRowsChanged = function () { this.updateVisibilityBasedOnRows(), this.fireCallback(this.visibleRowsChangedCallback) }, t.prototype.updateVisibilityBasedOnRows = function () { this.hideIfRowsEmpty && (this.visible = this.rows.length > 0 && (!this.filteredRows || this.filteredRows.length > 0)) }, t.prototype.shouldRunColumnExpression = function () { return !this.survey || !this.survey.areInvisibleElementsShowing }, t.prototype.hasRowsAsItems = function () { return !0 }, t.prototype.runItemsCondition = function (e, t) { var n = null; if (this.filteredRows && !r.isValueEmpty(this.defaultValue)) { n = []; for (var o = 0; o < this.filteredRows.length; o++)n.push(this.filteredRows[o]) } var i = this.hasRowsAsItems() && this.runConditionsForRows(e, t), s = this.runConditionsForColumns(e, t); return (i = s || i) && (this.isClearValueOnHidden && (this.filteredColumns || this.filteredRows) && this.clearIncorrectValues(), n && this.restoreNewVisibleRowsValues(n), this.clearGeneratedRows(), s && this.onColumnsChanged(), this.onRowsChanged()), i }, t.prototype.clearGeneratedRows = function () { this.generatedVisibleRows = null }, t.prototype.runConditionsForRows = function (e, t) { var n = !!this.survey && this.survey.areInvisibleElementsShowing, o = !n && this.rowsVisibleIf ? new oe(this.rowsVisibleIf) : null; this.filteredRows = []; var r = qe.runConditionsForItems(this.rows, this.filteredRows, o, e, t, !n); return this.filteredRows.length === this.rows.length && (this.filteredRows = null), r }, t.prototype.runConditionsForColumns = function (e, t) { var n = !!this.survey && !this.survey.areInvisibleElementsShowing && this.columnsVisibleIf ? new oe(this.columnsVisibleIf) : null; this.filteredColumns = []; var o = qe.runConditionsForItems(this.columns, this.filteredColumns, n, e, t, this.shouldRunColumnExpression()); return this.filteredColumns.length === this.columns.length && (this.filteredColumns = null), o }, t.prototype.clearIncorrectValues = function () { var t = this.value; if (t) { var n = null, o = !1, r = this.filteredRows ? this.filteredRows : this.rows, i = this.filteredColumns ? this.filteredColumns : this.columns; for (var s in t) qe.getItemByValue(r, s) && qe.getItemByValue(i, t[s]) ? (null == n && (n = {}), n[s] = t[s]) : o = !0; o && (this.value = n), e.prototype.clearIncorrectValues.call(this) } }, t.prototype.clearInvisibleValuesInRows = function () { if (!this.isEmpty()) { for (var e = this.getUnbindValue(this.value), t = this.rows, n = 0; n < t.length; n++) { var o = t[n].value; e[o] && !t[n].isVisible && delete e[o] } this.isTwoValueEquals(e, this.value) || (this.value = e) } }, t.prototype.restoreNewVisibleRowsValues = function (e) { var t = this.filteredRows ? this.filteredRows : this.rows, n = this.defaultValue, o = this.getUnbindValue(this.value), r = !1; for (var i in n) qe.getItemByValue(t, i) && !qe.getItemByValue(e, i) && (null == o && (o = {}), o[i] = n[i], r = !0); r && (this.value = o) }, t.prototype.needResponsiveWidth = function () { return !0 }, t.prototype.getTableCss = function () { return (new at).append(this.cssClasses.root).append(this.cssClasses.rootAlternateRows, this.alternateRows).append(this.cssClasses.rootVerticalAlignTop, "top" === this.verticalAlign).append(this.cssClasses.rootVerticalAlignMiddle, "middle" === this.verticalAlign).toString() }, Object.defineProperty(t.prototype, "columnMinWidth", { get: function () { return this.getPropertyValue("columnMinWidth", "") }, set: function (e) { this.setPropertyValue("columnMinWidth", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "rowTitleWidth", { get: function () { return this.getPropertyValue("rowTitleWidth", "") }, set: function (e) { this.setPropertyValue("rowTitleWidth", e) }, enumerable: !1, configurable: !0 }), Yt([f({ defaultValue: "middle" })], t.prototype, "verticalAlign", void 0), Yt([f({ defaultValue: !1 })], t.prototype, "alternateRows", void 0), t }($t); _.addClass("matrixbase", [{ name: "showCommentArea:switch", layout: "row", visible: !0, category: "general" }, "columnsVisibleIf:condition", "rowsVisibleIf:condition", "columnMinWidth", { name: "showHeader:boolean", default: !0 }, { name: "verticalAlign", choices: ["top", "middle"], default: "middle" }, { name: "alternateRows:boolean", default: !1 }], void 0, "question"); var en = function () { }, tn = function (e, t) { this.name = e, this.returnDisplayValue = t, this.isExists = !1, this.canProcess = !0 }, nn = function () { function e() { this._unObservableValues = [void 0] } return Object.defineProperty(e.prototype, "hasAllValuesOnLastRunValue", { get: function () { return this._unObservableValues[0] }, set: function (e) { this._unObservableValues[0] = e }, enumerable: !1, configurable: !0 }), e.prototype.process = function (e, t, n) { if (void 0 === t && (t = !1), void 0 === n && (n = !1), this.hasAllValuesOnLastRunValue = !0, !e) return e; if (!this.onProcess) return e; for (var o = this.getItems(e), i = o.length - 1; i >= 0; i--) { var s = o[i], a = this.getName(e.substring(s.start + 1, s.end)); if (a) { var l = new tn(a, t); if (this.onProcess(l), l.isExists) { r.isValueEmpty(l.value) && (this.hasAllValuesOnLastRunValue = !1); var u = r.isValueEmpty(l.value) ? "" : l.value; n && (u = encodeURIComponent(u)), e = e.substring(0, s.start) + u + e.substring(s.end + 1) } else l.canProcess && (this.hasAllValuesOnLastRunValue = !1) } } return e }, e.prototype.processValue = function (e, t) { var n = new tn(e, t); return this.onProcess && this.onProcess(n), n }, Object.defineProperty(e.prototype, "hasAllValuesOnLastRun", { get: function () { return !!this.hasAllValuesOnLastRunValue }, enumerable: !1, configurable: !0 }), e.prototype.getItems = function (e) { for (var t = [], n = e.length, o = -1, r = "", i = 0; i < n; i++)if ("{" == (r = e[i]) && (o = i), "}" == r) { if (o > -1) { var s = new en; s.start = o, s.end = i, t.push(s) } o = -1 } return t }, e.prototype.getName = function (e) { if (e) return e.trim() }, e }(), on = function () { function e(e) { var t = this; this.variableName = e, this.textPreProcessor = new nn, this.textPreProcessor.onProcess = function (e) { t.getProcessedTextValue(e) } } return e.prototype.processValue = function (e, t) { return this.textPreProcessor.processValue(e, t) }, Object.defineProperty(e.prototype, "survey", { get: function () { return null }, enumerable: !1, configurable: !0 }), Object.defineProperty(e.prototype, "panel", { get: function () { return null }, enumerable: !1, configurable: !0 }), e.prototype.getValues = function () { return this.panel ? this.panel.getValue() : null }, e.prototype.getQuestionByName = function (e) { return this.panel ? this.panel.getQuestionByValueName(e) : null }, e.prototype.getParentTextProcessor = function () { return null }, e.prototype.onCustomProcessText = function (e) { return !1 }, e.prototype.getQuestionDisplayText = function (e) { return e.displayValue }, e.prototype.getProcessedTextValue = function (e) { if (e && !this.onCustomProcessText(e)) { var t = (new I).getFirstName(e.name); if (e.isExists = t == this.variableName, e.canProcess = e.isExists, e.canProcess) { e.name = e.name.replace(this.variableName + ".", ""); t = (new I).getFirstName(e.name); var n = this.getQuestionByName(t), o = {}; if (n) o[t] = e.returnDisplayValue ? this.getQuestionDisplayText(n) : n.value; else { var r = this.panel ? this.getValues() : null; r && (o[t] = r[t]) } e.value = (new I).getValue(e.name, o) } } }, e.prototype.processText = function (e, t) { return this.survey && this.survey.isDesignMode ? e : (e = this.textPreProcessor.process(e, t), e = this.processTextCore(this.getParentTextProcessor(), e, t), this.processTextCore(this.survey, e, t)) }, e.prototype.processTextEx = function (e, t) { e = this.processText(e, t); var n = this.textPreProcessor.hasAllValuesOnLastRun, o = { hasAllValuesOnLastRun: !0, text: e }; return this.survey && (o = this.survey.processTextEx(e, t, !1)), o.hasAllValuesOnLastRun = o.hasAllValuesOnLastRun && n, o }, e.prototype.processTextCore = function (e, t, n) { return e ? e.processText(t, n) : t }, e }(), rn = function () { function e() { this.creatorHash = {} } return Object.defineProperty(e, "DefaultChoices", { get: function () { return [s.getString("choices_Item") + "1", s.getString("choices_Item") + "2", s.getString("choices_Item") + "3"] }, enumerable: !1, configurable: !0 }), Object.defineProperty(e, "DefaultColums", { get: function () { var e = s.getString("matrix_column") + " "; return [e + "1", e + "2", e + "3"] }, enumerable: !1, configurable: !0 }), Object.defineProperty(e, "DefaultRows", { get: function () { var e = s.getString("matrix_row") + " "; return [e + "1", e + "2"] }, enumerable: !1, configurable: !0 }), Object.defineProperty(e, "DefaultMutlipleTextItems", { get: function () { var e = s.getString("multipletext_itemname"); return [e + "1", e + "2"] }, enumerable: !1, configurable: !0 }), e.prototype.registerQuestion = function (e, t) { this.creatorHash[e] = t }, e.prototype.unregisterElement = function (e) { delete this.creatorHash[e] }, e.prototype.clear = function () { this.creatorHash = {} }, e.prototype.getAllTypes = function () { var e = new Array; for (var t in this.creatorHash) e.push(t); return e.sort() }, e.prototype.createQuestion = function (e, t) { var n = this.creatorHash[e]; return null == n ? null : n(t) }, e.Instance = new e, e }(), sn = function () { function e() { this.creatorHash = {} } return e.prototype.registerElement = function (e, t) { this.creatorHash[e] = t }, e.prototype.clear = function () { this.creatorHash = {} }, e.prototype.unregisterElement = function (e, t) { void 0 === t && (t = !1), delete this.creatorHash[e], rn.Instance.unregisterElement(e), t && _.removeClass(e) }, e.prototype.getAllTypes = function () { var e = rn.Instance.getAllTypes(); for (var t in this.creatorHash) e.push(t); return e.sort() }, e.prototype.createElement = function (e, t) { var n = this.creatorHash[e]; return null == n ? rn.Instance.createQuestion(e, t) : n(t) }, e.Instance = new e, e }(), an = function () { var e = function (t, n) { return (e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (e, t) { e.__proto__ = t } || function (e, t) { for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]) })(t, n) }; return function (t, n) { if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null"); function o() { this.constructor = t } e(t, n), t.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o) } }(), ln = function (e) { function t(t) { var n = e.call(this, t) || this; return n.createLocalizableString("format", n), n.registerPropertyChangedHandlers(["expression"], (function () { n.expressionRunner && (n.expressionRunner = new re(n.expression)) })), n.registerPropertyChangedHandlers(["format", "currency", "displayStyle"], (function () { n.updateFormatedValue() })), n } return an(t, e), t.prototype.getType = function () { return "expression" }, Object.defineProperty(t.prototype, "hasInput", { get: function () { return !1 }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "format", { get: function () { return this.getLocalizableStringText("format", "") }, set: function (e) { this.setLocalizableStringText("format", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "locFormat", { get: function () { return this.getLocalizableString("format") }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "expression", { get: function () { return this.getPropertyValue("expression", "") }, set: function (e) { this.setPropertyValue("expression", e) }, enumerable: !1, configurable: !0 }), t.prototype.locCalculation = function () { this.expressionIsRunning = !0 }, t.prototype.unlocCalculation = function () { this.expressionIsRunning = !1 }, t.prototype.runCondition = function (t, n) { var o = this; e.prototype.runCondition.call(this, t, n), !this.expression || this.expressionIsRunning || !this.runIfReadOnly && this.isReadOnly || (this.locCalculation(), this.expressionRunner || (this.expressionRunner = new re(this.expression)), this.expressionRunner.onRunComplete = function (e) { r.isTwoValueEquals(e, o.value) || (o.value = e), o.unlocCalculation() }, this.expressionRunner.run(t, n)) }, t.prototype.canCollectErrors = function () { return !0 }, t.prototype.hasRequiredError = function () { return !1 }, Object.defineProperty(t.prototype, "maximumFractionDigits", { get: function () { return this.getPropertyValue("maximumFractionDigits") }, set: function (e) { e < -1 || e > 20 || this.setPropertyValue("maximumFractionDigits", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "minimumFractionDigits", { get: function () { return this.getPropertyValue("minimumFractionDigits") }, set: function (e) { e < -1 || e > 20 || this.setPropertyValue("minimumFractionDigits", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "runIfReadOnly", { get: function () { return !0 === this.runIfReadOnlyValue }, set: function (e) { this.runIfReadOnlyValue = e }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "formatedValue", { get: function () { return this.getPropertyValue("formatedValue", "") }, enumerable: !1, configurable: !0 }), t.prototype.updateFormatedValue = function () { this.setPropertyValue("formatedValue", this.getDisplayValueCore(!1, this.value)) }, t.prototype.onValueChanged = function () { this.updateFormatedValue() }, t.prototype.updateValueFromSurvey = function (t) { e.prototype.updateValueFromSurvey.call(this, t), this.updateFormatedValue() }, t.prototype.getDisplayValueCore = function (e, t) { var n = this.isValueEmpty(t) ? this.defaultValue : t, o = ""; if (!this.isValueEmpty(n)) { var r = this.getValueAsStr(n); o = this.format ? this.format.format(r) : r } return this.survey && (o = this.survey.getExpressionDisplayValue(this, n, o)), o }, Object.defineProperty(t.prototype, "displayStyle", { get: function () { return this.getPropertyValue("displayStyle") }, set: function (e) { this.setPropertyValue("displayStyle", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "currency", { get: function () { return this.getPropertyValue("currency") }, set: function (e) { ["AED", "AFN", "ALL", "AMD", "ANG", "AOA", "ARS", "AUD", "AWG", "AZN", "BAM", "BBD", "BDT", "BGN", "BHD", "BIF", "BMD", "BND", "BOB", "BOV", "BRL", "BSD", "BTN", "BWP", "BYN", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLF", "CLP", "CNY", "COP", "COU", "CRC", "CUC", "CUP", "CVE", "CZK", "DJF", "DKK", "DOP", "DZD", "EGP", "ERN", "ETB", "EUR", "FJD", "FKP", "GBP", "GEL", "GHS", "GIP", "GMD", "GNF", "GTQ", "GYD", "HKD", "HNL", "HRK", "HTG", "HUF", "IDR", "ILS", "INR", "IQD", "IRR", "ISK", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LYD", "MAD", "MDL", "MGA", "MKD", "MMK", "MNT", "MOP", "MRO", "MUR", "MVR", "MWK", "MXN", "MXV", "MYR", "MZN", "NAD", "NGN", "NIO", "NOK", "NPR", "NZD", "OMR", "PAB", "PEN", "PGK", "PHP", "PKR", "PLN", "PYG", "QAR", "RON", "RSD", "RUB", "RWF", "SAR", "SBD", "SCR", "SDG", "SEK", "SGD", "SHP", "SLL", "SOS", "SRD", "SSP", "STD", "SVC", "SYP", "SZL", "THB", "TJS", "TMT", "TND", "TOP", "TRY", "TTD", "TWD", "TZS", "UAH", "UGX", "USD", "USN", "UYI", "UYU", "UZS", "VEF", "VND", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XOF", "XPD", "XPF", "XPT", "XSU", "XTS", "XUA", "XXX", "YER", "ZAR", "ZMW", "ZWL"].indexOf(e) < 0 || this.setPropertyValue("currency", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "useGrouping", { get: function () { return this.getPropertyValue("useGrouping") }, set: function (e) { this.setPropertyValue("useGrouping", e) }, enumerable: !1, configurable: !0 }), t.prototype.getValueAsStr = function (e) { if ("date" == this.displayStyle) { var t = new Date(e); if (t && t.toLocaleDateString) return t.toLocaleDateString() } if ("none" != this.displayStyle && r.isNumber(e)) { var n = this.getLocale(); n || (n = "en"); var o = { style: this.displayStyle, currency: this.currency, useGrouping: this.useGrouping }; return this.maximumFractionDigits > -1 && (o.maximumFractionDigits = this.maximumFractionDigits), this.minimumFractionDigits > -1 && (o.minimumFractionDigits = this.minimumFractionDigits), e.toLocaleString(n, o) } return e.toString() }, t }($t); _.addClass("expression", ["expression:expression", { name: "format", serializationProperty: "locFormat" }, { name: "displayStyle", default: "none", choices: ["none", "decimal", "currency", "percent", "date"] }, { name: "currency", choices: function () { return ["AED", "AFN", "ALL", "AMD", "ANG", "AOA", "ARS", "AUD", "AWG", "AZN", "BAM", "BBD", "BDT", "BGN", "BHD", "BIF", "BMD", "BND", "BOB", "BOV", "BRL", "BSD", "BTN", "BWP", "BYN", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLF", "CLP", "CNY", "COP", "COU", "CRC", "CUC", "CUP", "CVE", "CZK", "DJF", "DKK", "DOP", "DZD", "EGP", "ERN", "ETB", "EUR", "FJD", "FKP", "GBP", "GEL", "GHS", "GIP", "GMD", "GNF", "GTQ", "GYD", "HKD", "HNL", "HRK", "HTG", "HUF", "IDR", "ILS", "INR", "IQD", "IRR", "ISK", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LYD", "MAD", "MDL", "MGA", "MKD", "MMK", "MNT", "MOP", "MRO", "MUR", "MVR", "MWK", "MXN", "MXV", "MYR", "MZN", "NAD", "NGN", "NIO", "NOK", "NPR", "NZD", "OMR", "PAB", "PEN", "PGK", "PHP", "PKR", "PLN", "PYG", "QAR", "RON", "RSD", "RUB", "RWF", "SAR", "SBD", "SCR", "SDG", "SEK", "SGD", "SHP", "SLL", "SOS", "SRD", "SSP", "STD", "SVC", "SYP", "SZL", "THB", "TJS", "TMT", "TND", "TOP", "TRY", "TTD", "TWD", "TZS", "UAH", "UGX", "USD", "USN", "UYI", "UYU", "UZS", "VEF", "VND", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XOF", "XPD", "XPF", "XPT", "XSU", "XTS", "XUA", "XXX", "YER", "ZAR", "ZMW", "ZWL"] }, default: "USD" }, { name: "maximumFractionDigits:number", default: -1 }, { name: "minimumFractionDigits:number", default: -1 }, { name: "useGrouping:boolean", default: !0 }, { name: "enableIf", visible: !1 }, { name: "isRequired", visible: !1 }, { name: "readOnly", visible: !1 }, { name: "requiredErrorText", visible: !1 }, { name: "defaultValueExpression", visible: !1 }, { name: "defaultValue", visible: !1 }, { name: "correctAnswer", visible: !1 }, { name: "requiredIf", visible: !1 }], (function () { return new ln("") }), "question"), rn.Instance.registerQuestion("expression", (function (e) { return new ln(e) })); var un = function () { var e = function (t, n) { return (e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (e, t) { e.__proto__ = t } || function (e, t) { for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]) })(t, n) }; return function (t, n) { if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null"); function o() { this.constructor = t } e(t, n), t.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o) } }(); function cn(e, t, n, o) { e.storeOthersAsComment = !!n && n.storeOthersAsComment, e.choices && 0 != e.choices.length || !e.choicesByUrl.isEmpty || (e.choices = n.choices), e.choicesByUrl.isEmpty || e.choicesByUrl.run(o.getTextProcessor()) } var pn = { dropdown: { onCellQuestionUpdate: function (e, t, n, o) { cn(e, 0, n, o), e.locPlaceholder && e.locPlaceholder.isEmpty && !n.locPlaceholder.isEmpty && (e.optionsCaption = n.optionsCaption) } }, checkbox: { onCellQuestionUpdate: function (e, t, n, o) { cn(e, 0, n, o), e.colCount = t.colCount > -1 ? t.colCount : n.columnColCount } }, radiogroup: { onCellQuestionUpdate: function (e, t, n, o) { cn(e, 0, n, o), e.colCount = t.colCount > -1 ? t.colCount : n.columnColCount } }, tagbox: {}, text: {}, comment: {}, boolean: { onCellQuestionUpdate: function (e, t, n, o) { e.renderAs = t.renderAs } }, expression: {}, rating: {} }, hn = function (e) { function t(t, n) { void 0 === n && (n = null); var o = e.call(this) || this; return o.colOwnerValue = null, o.indexValue = -1, o._isVisible = !0, o._hasVisibleCell = !0, o.previousChoicesId = void 0, o.createLocalizableString("totalFormat", o), o.createLocalizableString("cellHint", o), o.registerPropertyChangedHandlers(["showInMultipleColumns"], (function () { o.doShowInMultipleColumnsChanged() })), o.updateTemplateQuestion(), o.name = t, n ? o.title = n : o.templateQuestion.locTitle.strChanged(), o } return un(t, e), t.getColumnTypes = function () { var e = []; for (var t in pn) e.push(t); return e }, t.prototype.getOriginalObj = function () { return this.templateQuestion }, t.prototype.getClassNameProperty = function () { return "cellType" }, t.prototype.getSurvey = function (e) { return void 0 === e && (e = !1), this.colOwner ? this.colOwner.survey : null }, t.prototype.endLoadingFromJson = function () { var t = this; e.prototype.endLoadingFromJson.call(this), this.templateQuestion.autoOtherMode = this.isShowInMultipleColumns, this.templateQuestion.endLoadingFromJson(), this.templateQuestion.onGetSurvey = function () { return t.getSurvey() } }, t.prototype.getDynamicPropertyName = function () { return "cellType" }, t.prototype.getDynamicType = function () { return "default" === this.cellType ? "question" : this.calcCellQuestionType(null) }, Object.defineProperty(t.prototype, "colOwner", { get: function () { return this.colOwnerValue }, set: function (e) { this.colOwnerValue = e, e && (this.updateTemplateQuestion(), this.setParentQuestionToTemplate(this.templateQuestion)) }, enumerable: !1, configurable: !0 }), t.prototype.locStrsChanged = function () { e.prototype.locStrsChanged.call(this), this.locTitle.strChanged() }, t.prototype.addUsedLocales = function (t) { e.prototype.addUsedLocales.call(this, t), this.templateQuestion.addUsedLocales(t) }, Object.defineProperty(t.prototype, "index", { get: function () { return this.indexValue }, enumerable: !1, configurable: !0 }), t.prototype.setIndex = function (e) { this.indexValue = e }, t.prototype.getType = function () { return "matrixdropdowncolumn" }, Object.defineProperty(t.prototype, "cellType", { get: function () { return this.getPropertyValue("cellType") }, set: function (e) { e = e.toLocaleLowerCase(), this.updateTemplateQuestion(e), this.setPropertyValue("cellType", e), this.colOwner && this.colOwner.onColumnCellTypeChanged(this) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "templateQuestion", { get: function () { return this.templateQuestionValue }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "value", { get: function () { return this.templateQuestion.name }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "isVisible", { get: function () { return this._isVisible }, enumerable: !1, configurable: !0 }), t.prototype.setIsVisible = function (e) { this._isVisible = e }, Object.defineProperty(t.prototype, "hasVisibleCell", { get: function () { return this._hasVisibleCell }, set: function (e) { this._hasVisibleCell = e }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "name", { get: function () { return this.templateQuestion.name }, set: function (e) { this.templateQuestion.name = e }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "title", { get: function () { return this.templateQuestion.title }, set: function (e) { this.templateQuestion.title = e }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "locTitle", { get: function () { return this.templateQuestion.locTitle }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "fullTitle", { get: function () { return this.locTitle.textOrHtml }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "isRequired", { get: function () { return this.templateQuestion.isRequired }, set: function (e) { this.templateQuestion.isRequired = e }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "isRenderedRequired", { get: function () { return this.getPropertyValue("isRenderedRequired", this.isRequired) }, set: function (e) { this.setPropertyValue("isRenderedRequired", e) }, enumerable: !1, configurable: !0 }), t.prototype.updateIsRenderedRequired = function (e) { this.isRenderedRequired = e || this.isRequired }, Object.defineProperty(t.prototype, "requiredText", { get: function () { return this.isRenderedRequired && this.getSurvey() ? this.getSurvey().requiredText : this.templateQuestion.requiredText }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "requiredErrorText", { get: function () { return this.templateQuestion.requiredErrorText }, set: function (e) { this.templateQuestion.requiredErrorText = e }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "locRequiredErrorText", { get: function () { return this.templateQuestion.locRequiredErrorText }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "readOnly", { get: function () { return this.templateQuestion.readOnly }, set: function (e) { this.templateQuestion.readOnly = e }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "hasOther", { get: function () { return this.templateQuestion.hasOther }, set: function (e) { this.templateQuestion.hasOther = e }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "visibleIf", { get: function () { return this.templateQuestion.visibleIf }, set: function (e) { this.templateQuestion.visibleIf = e }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "enableIf", { get: function () { return this.templateQuestion.enableIf }, set: function (e) { this.templateQuestion.enableIf = e }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "requiredIf", { get: function () { return this.templateQuestion.requiredIf }, set: function (e) { this.templateQuestion.requiredIf = e }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "isUnique", { get: function () { return this.getPropertyValue("isUnique") }, set: function (e) { this.setPropertyValue("isUnique", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "showInMultipleColumns", { get: function () { return this.getPropertyValue("showInMultipleColumns", !1) }, set: function (e) { this.setPropertyValue("showInMultipleColumns", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "isSupportMultipleColumns", { get: function () { return ["checkbox", "radiogroup"].indexOf(this.cellType) > -1 }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "isShowInMultipleColumns", { get: function () { return this.showInMultipleColumns && this.isSupportMultipleColumns }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "validators", { get: function () { return this.templateQuestion.validators }, set: function (e) { this.templateQuestion.validators = e }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "totalType", { get: function () { return this.getPropertyValue("totalType") }, set: function (e) { this.setPropertyValue("totalType", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "totalExpression", { get: function () { return this.getPropertyValue("totalExpression") }, set: function (e) { this.setPropertyValue("totalExpression", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "hasTotal", { get: function () { return "none" != this.totalType || !!this.totalExpression }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "totalFormat", { get: function () { return this.getLocalizableStringText("totalFormat", "") }, set: function (e) { this.setLocalizableStringText("totalFormat", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "locTotalFormat", { get: function () { return this.getLocalizableString("totalFormat") }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "cellHint", { get: function () { return this.getLocalizableStringText("cellHint", "") }, set: function (e) { this.setLocalizableStringText("cellHint", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "locCellHint", { get: function () { return this.getLocalizableString("cellHint") }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "renderAs", { get: function () { return this.getPropertyValue("renderAs") }, set: function (e) { this.setPropertyValue("renderAs", e), this.templateQuestion && (this.templateQuestion.renderAs = e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "totalMaximumFractionDigits", { get: function () { return this.getPropertyValue("totalMaximumFractionDigits") }, set: function (e) { e < -1 || e > 20 || this.setPropertyValue("totalMaximumFractionDigits", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "totalMinimumFractionDigits", { get: function () { return this.getPropertyValue("totalMinimumFractionDigits") }, set: function (e) { e < -1 || e > 20 || this.setPropertyValue("totalMinimumFractionDigits", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "totalDisplayStyle", { get: function () { return this.getPropertyValue("totalDisplayStyle") }, set: function (e) { this.setPropertyValue("totalDisplayStyle", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "totalCurrency", { get: function () { return this.getPropertyValue("totalCurrency") }, set: function (e) { ["AED", "AFN", "ALL", "AMD", "ANG", "AOA", "ARS", "AUD", "AWG", "AZN", "BAM", "BBD", "BDT", "BGN", "BHD", "BIF", "BMD", "BND", "BOB", "BOV", "BRL", "BSD", "BTN", "BWP", "BYN", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLF", "CLP", "CNY", "COP", "COU", "CRC", "CUC", "CUP", "CVE", "CZK", "DJF", "DKK", "DOP", "DZD", "EGP", "ERN", "ETB", "EUR", "FJD", "FKP", "GBP", "GEL", "GHS", "GIP", "GMD", "GNF", "GTQ", "GYD", "HKD", "HNL", "HRK", "HTG", "HUF", "IDR", "ILS", "INR", "IQD", "IRR", "ISK", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LYD", "MAD", "MDL", "MGA", "MKD", "MMK", "MNT", "MOP", "MRO", "MUR", "MVR", "MWK", "MXN", "MXV", "MYR", "MZN", "NAD", "NGN", "NIO", "NOK", "NPR", "NZD", "OMR", "PAB", "PEN", "PGK", "PHP", "PKR", "PLN", "PYG", "QAR", "RON", "RSD", "RUB", "RWF", "SAR", "SBD", "SCR", "SDG", "SEK", "SGD", "SHP", "SLL", "SOS", "SRD", "SSP", "STD", "SVC", "SYP", "SZL", "THB", "TJS", "TMT", "TND", "TOP", "TRY", "TTD", "TWD", "TZS", "UAH", "UGX", "USD", "USN", "UYI", "UYU", "UZS", "VEF", "VND", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XOF", "XPD", "XPF", "XPT", "XSU", "XTS", "XUA", "XXX", "YER", "ZAR", "ZMW", "ZWL"].indexOf(e) < 0 || this.setPropertyValue("totalCurrency", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "minWidth", { get: function () { return this.getPropertyValue("minWidth", "") }, set: function (e) { this.setPropertyValue("minWidth", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "width", { get: function () { return this.getPropertyValue("width", "") }, set: function (e) { this.setPropertyValue("width", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "colCount", { get: function () { return this.getPropertyValue("colCount") }, set: function (e) { e < -1 || e > 4 || this.setPropertyValue("colCount", e) }, enumerable: !1, configurable: !0 }), t.prototype.getLocale = function () { return this.colOwner ? this.colOwner.getLocale() : "" }, t.prototype.getMarkdownHtml = function (e, t) { return this.colOwner ? this.colOwner.getMarkdownHtml(e, t) : void 0 }, t.prototype.getRenderer = function (e) { return this.colOwner ? this.colOwner.getRenderer(e) : null }, t.prototype.getRendererContext = function (e) { return this.colOwner ? this.colOwner.getRendererContext(e) : e }, t.prototype.getProcessedText = function (e) { return this.colOwner ? this.colOwner.getProcessedText(e) : e }, t.prototype.createCellQuestion = function (e) { var t = this.calcCellQuestionType(e), n = this.createNewQuestion(t); return this.callOnCellQuestionUpdate(n, e), n }, t.prototype.startLoadingFromJson = function (t) { e.prototype.startLoadingFromJson.call(this, t), t && !t.cellType && t.choices && (t.cellType = this.colOwner.getCellType()) }, t.prototype.updateCellQuestion = function (e, t, n) { void 0 === n && (n = null), this.setQuestionProperties(e, n) }, t.prototype.callOnCellQuestionUpdate = function (e, t) { var n = e.getType(), o = pn[n]; o && o.onCellQuestionUpdate && o.onCellQuestionUpdate(e, this, this.colOwner, t) }, t.prototype.defaultCellTypeChanged = function () { this.updateTemplateQuestion() }, t.prototype.calcCellQuestionType = function (e) { var t = this.getDefaultCellQuestionType(); return e && this.colOwner && (t = this.colOwner.getCustomCellType(this, e, t)), t }, t.prototype.getDefaultCellQuestionType = function (e) { return e || (e = this.cellType), "default" !== e ? e : this.colOwner ? this.colOwner.getCellType() : o.matrixDefaultCellType }, t.prototype.updateTemplateQuestion = function (e) { var t = this, n = this.getDefaultCellQuestionType(e), o = this.templateQuestion ? this.templateQuestion.getType() : ""; n !== o && (this.templateQuestion && this.removeProperties(o), this.templateQuestionValue = this.createNewQuestion(n), this.templateQuestion.locOwner = this, this.addProperties(n), this.templateQuestion.onPropertyChanged.add((function (e, n) { t.propertyValueChanged(n.name, n.oldValue, n.newValue) })), this.templateQuestion.onItemValuePropertyChanged.add((function (e, n) { t.doItemValuePropertyChanged(n.propertyName, n.obj, n.name, n.newValue, n.oldValue) })), this.templateQuestion.isContentElement = !0, this.isLoadingFromJson || (this.templateQuestion.onGetSurvey = function () { return t.getSurvey() }), this.templateQuestion.locTitle.strChanged()) }, t.prototype.createNewQuestion = function (e) { var t = _.createClass(e); return t || (t = _.createClass("text")), t.loadingOwner = this, t.isEditableTemplateElement = !0, t.autoOtherMode = this.isShowInMultipleColumns, this.setQuestionProperties(t), this.setParentQuestionToTemplate(t), t }, t.prototype.setParentQuestionToTemplate = function (e) { this.colOwner && this.colOwner.isQuestion && e.setParentQuestion(this.colOwner) }, t.prototype.setQuestionProperties = function (e, t) { var n = this; if (void 0 === t && (t = null), this.templateQuestion) { var o = (new S).toJsonObject(this.templateQuestion, !0); t && t(o), o.type = e.getType(), "default" === this.cellType && this.colOwner && this.colOwner.hasChoices() && delete o.choices, delete o.itemComponent, (new S).toObject(o, e), e.isContentElement = this.templateQuestion.isContentElement, this.previousChoicesId = void 0, e.loadedChoicesFromServerCallback = function () { if (n.isShowInMultipleColumns && (!n.previousChoicesId || n.previousChoicesId === e.id)) { n.previousChoicesId = e.id; var t = e.visibleChoices; n.templateQuestion.choices = t, n.propertyValueChanged("choices", t, t) } } } }, t.prototype.propertyValueChanged = function (t, n, o) { e.prototype.propertyValueChanged.call(this, t, n, o), "isRequired" === t && this.updateIsRenderedRequired(o), this.colOwner && !this.isLoadingFromJson && (this.isShowInMultipleColumns && ["visibleChoices", "choices"].indexOf(t) > -1 && this.colOwner.onShowInMultipleColumnsChanged(this), _.hasOriginalProperty(this, t) && this.colOwner.onColumnPropertyChanged(this, t, o)) }, t.prototype.doItemValuePropertyChanged = function (e, t, n, o, r) { _.hasOriginalProperty(t, n) && (null == this.colOwner || this.isLoadingFromJson || this.colOwner.onColumnItemValuePropertyChanged(this, e, t, n, o, r)) }, t.prototype.doShowInMultipleColumnsChanged = function () { null == this.colOwner || this.isLoadingFromJson || this.colOwner.onShowInMultipleColumnsChanged(this), this.templateQuestion && (this.templateQuestion.autoOtherMode = this.isShowInMultipleColumns) }, t.prototype.getProperties = function (e) { return _.getDynamicPropertiesByObj(this, e) }, t.prototype.removeProperties = function (e) { for (var t = this.getProperties(e), n = 0; n < t.length; n++) { var o = t[n]; delete this[o.name], o.serializationProperty && delete this[o.serializationProperty] } }, t.prototype.addProperties = function (e) { for (var t = this.templateQuestion, n = this.getProperties(e), o = 0; o < n.length; o++) { var r = n[o]; this.addProperty(t, r.name, !1), r.serializationProperty && this.addProperty(t, r.serializationProperty, !0), r.alternativeName && this.addProperty(t, r.alternativeName, !1) } }, t.prototype.addProperty = function (e, t, n) { var o = { configurable: !0, get: function () { return e[t] } }; n || (o.set = function (n) { e[t] = n }), Object.defineProperty(this, t, o) }, t }(ce); _.addClass("matrixdropdowncolumn", [{ name: "!name", isUnique: !0 }, { name: "title", serializationProperty: "locTitle", dependsOn: "name", onPropertyEditorUpdate: function (e, t) { e && t && (t.placeholder = e.name) } }, { name: "cellHint", serializationProperty: "locCellHint", visible: !1 }, { name: "cellType", default: "default", choices: function () { var e = hn.getColumnTypes(); return e.splice(0, 0, "default"), e } }, { name: "colCount", default: -1, choices: [-1, 0, 1, 2, 3, 4] }, "isRequired:boolean", "isUnique:boolean", { name: "requiredErrorText:text", serializationProperty: "locRequiredErrorText" }, "readOnly:boolean", "minWidth", "width", "visibleIf:condition", "enableIf:condition", "requiredIf:condition", { name: "showInMultipleColumns:boolean", dependsOn: "cellType", visibleIf: function (e) { return !!e && e.isSupportMultipleColumns } }, { name: "validators:validators", baseClassName: "surveyvalidator", classNamePart: "validator" }, { name: "totalType", default: "none", choices: ["none", "sum", "count", "min", "max", "avg"] }, "totalExpression:expression", { name: "totalFormat", serializationProperty: "locTotalFormat" }, { name: "totalDisplayStyle", default: "none", choices: ["none", "decimal", "currency", "percent"] }, { name: "totalCurrency", choices: function () { return ["AED", "AFN", "ALL", "AMD", "ANG", "AOA", "ARS", "AUD", "AWG", "AZN", "BAM", "BBD", "BDT", "BGN", "BHD", "BIF", "BMD", "BND", "BOB", "BOV", "BRL", "BSD", "BTN", "BWP", "BYN", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLF", "CLP", "CNY", "COP", "COU", "CRC", "CUC", "CUP", "CVE", "CZK", "DJF", "DKK", "DOP", "DZD", "EGP", "ERN", "ETB", "EUR", "FJD", "FKP", "GBP", "GEL", "GHS", "GIP", "GMD", "GNF", "GTQ", "GYD", "HKD", "HNL", "HRK", "HTG", "HUF", "IDR", "ILS", "INR", "IQD", "IRR", "ISK", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LYD", "MAD", "MDL", "MGA", "MKD", "MMK", "MNT", "MOP", "MRO", "MUR", "MVR", "MWK", "MXN", "MXV", "MYR", "MZN", "NAD", "NGN", "NIO", "NOK", "NPR", "NZD", "OMR", "PAB", "PEN", "PGK", "PHP", "PKR", "PLN", "PYG", "QAR", "RON", "RSD", "RUB", "RWF", "SAR", "SBD", "SCR", "SDG", "SEK", "SGD", "SHP", "SLL", "SOS", "SRD", "SSP", "STD", "SVC", "SYP", "SZL", "THB", "TJS", "TMT", "TND", "TOP", "TRY", "TTD", "TWD", "TZS", "UAH", "UGX", "USD", "USN", "UYI", "UYU", "UZS", "VEF", "VND", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XOF", "XPD", "XPF", "XPT", "XSU", "XTS", "XUA", "XXX", "YER", "ZAR", "ZMW", "ZWL"] }, default: "USD" }, { name: "totalMaximumFractionDigits:number", default: -1 }, { name: "totalMinimumFractionDigits:number", default: -1 }, { name: "renderAs", default: "default", visible: !1 }], (function () { return new hn("") })); var dn = function () { var e = function (t, n) { return (e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (e, t) { e.__proto__ = t } || function (e, t) { for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]) })(t, n) }; return function (t, n) { if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null"); function o() { this.constructor = t } e(t, n), t.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o) } }(), fn = function (e, t, n, o) { var r, i = arguments.length, s = i < 3 ? t : null === o ? o = Object.getOwnPropertyDescriptor(t, n) : o; if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) s = Reflect.decorate(e, t, n, o); else for (var a = e.length - 1; a >= 0; a--)(r = e[a]) && (s = (i < 3 ? r(s) : i > 3 ? r(t, n, s) : r(t, n)) || s); return i > 3 && s && Object.defineProperty(t, n, s), s }, gn = function () { function e() { this.minWidth = "", this.width = "", this.colSpans = 1, this.isActionsCell = !1, this.isDragHandlerCell = !1, this.classNameValue = "", this.idValue = e.counter++ } return Object.defineProperty(e.prototype, "hasQuestion", { get: function () { return !!this.question }, enumerable: !1, configurable: !0 }), Object.defineProperty(e.prototype, "hasTitle", { get: function () { return !!this.locTitle }, enumerable: !1, configurable: !0 }), Object.defineProperty(e.prototype, "hasPanel", { get: function () { return !!this.panel }, enumerable: !1, configurable: !0 }), Object.defineProperty(e.prototype, "id", { get: function () { return this.idValue }, enumerable: !1, configurable: !0 }), Object.defineProperty(e.prototype, "showErrorOnTop", { get: function () { return this.showErrorOnCore("top") }, enumerable: !1, configurable: !0 }), Object.defineProperty(e.prototype, "showErrorOnBottom", { get: function () { return this.showErrorOnCore("bottom") }, enumerable: !1, configurable: !0 }), e.prototype.showErrorOnCore = function (e) { return this.getShowErrorLocation(e) && (!this.isChoice || this.isFirstChoice) }, e.prototype.getShowErrorLocation = function (e) { return this.hasQuestion && this.question.showErrorOnCore(e) }, Object.defineProperty(e.prototype, "item", { get: function () { return this.itemValue }, set: function (e) { this.itemValue = e, e && (e.hideCaption = !0) }, enumerable: !1, configurable: !0 }), Object.defineProperty(e.prototype, "isChoice", { get: function () { return !!this.item }, enumerable: !1, configurable: !0 }), Object.defineProperty(e.prototype, "isItemChoice", { get: function () { return this.isChoice && !this.isOtherChoice }, enumerable: !1, configurable: !0 }), Object.defineProperty(e.prototype, "choiceValue", { get: function () { return this.isChoice ? this.item.value : null }, enumerable: !1, configurable: !0 }), Object.defineProperty(e.prototype, "isCheckbox", { get: function () { return this.isItemChoice && this.question.isDescendantOf("checkbox") }, enumerable: !1, configurable: !0 }), Object.defineProperty(e.prototype, "isRadio", { get: function () { return this.isItemChoice && this.question.isDescendantOf("radiogroup") }, enumerable: !1, configurable: !0 }), Object.defineProperty(e.prototype, "isFirstChoice", { get: function () { return 0 === this.choiceIndex }, enumerable: !1, configurable: !0 }), Object.defineProperty(e.prototype, "className", { get: function () { var e = (new at).append(this.classNameValue); return this.hasQuestion && e.append(this.question.cssClasses.hasError, this.question.errors.length > 0).append(this.question.cssClasses.answered, this.question.isAnswered), e.toString() }, set: function (e) { this.classNameValue = e }, enumerable: !1, configurable: !0 }), Object.defineProperty(e.prototype, "headers", { get: function () { if (this.cell && this.cell.column) { if (" " === this.cell.column.cellHint) return ""; if (this.cell.column.cellHint) return this.cell.column.locCellHint.renderedHtml; if (this.cell.column.isShowInMultipleColumns) return this.item.locText.renderedHtml } return this.question && this.question.isVisible ? this.question.locTitle.renderedHtml : this.hasTitle && this.locTitle.renderedHtml || "" }, enumerable: !1, configurable: !0 }), e.prototype.getTitle = function () { return this.matrix && this.matrix.showHeader ? this.headers : "" }, e.prototype.calculateFinalClassName = function (e) { var t = this.cell.question.cssClasses, n = (new at).append(t.itemValue, !!t).append(t.asCell, !!t); return n.append(e.cell, n.isEmpty() && !!e).append(e.choiceCell, this.isChoice).toString() }, e.counter = 1, e }(), yn = function (e) { function t(n, o) { void 0 === o && (o = !1); var r = e.call(this) || this; return r.cssClasses = n, r.isDetailRow = o, r.cells = [], r.idValue = t.counter++, r } return dn(t, e), Object.defineProperty(t.prototype, "id", { get: function () { return this.idValue }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "attributes", { get: function () { return this.row ? { "data-sv-drop-target-matrix-row": this.row.id } : {} }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "className", { get: function () { return (new at).append(this.cssClasses.row).append(this.cssClasses.detailRow, this.isDetailRow).append(this.cssClasses.ghostRow, this.isGhostRow).append(this.cssClasses.rowAdditional, this.isAdditionalClasses).toString() }, enumerable: !1, configurable: !0 }), t.counter = 1, fn([f({ defaultValue: null })], t.prototype, "isGhostRow", void 0), fn([f({ defaultValue: !1 })], t.prototype, "isAdditionalClasses", void 0), t }(ce), mn = function (e) { function t(t) { var n = e.call(this) || this; return n.matrix = t, n.renderedRowsChangedCallback = function () { }, n.hasActionCellInRowsValues = {}, n.build(), n } return dn(t, e), Object.defineProperty(t.prototype, "showTable", { get: function () { return this.getPropertyValue("showTable", !0) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "showHeader", { get: function () { return this.getPropertyValue("showHeader") }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "showAddRowOnTop", { get: function () { return this.getPropertyValue("showAddRowOnTop", !1) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "showAddRowOnBottom", { get: function () { return this.getPropertyValue("showAddRowOnBottom", !1) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "showFooter", { get: function () { return this.matrix.hasFooter && this.matrix.isColumnLayoutHorizontal }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "hasFooter", { get: function () { return !!this.footerRow }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "hasRemoveRows", { get: function () { return this.hasRemoveRowsValue }, enumerable: !1, configurable: !0 }), t.prototype.isRequireReset = function () { return this.hasRemoveRows != this.matrix.canRemoveRows || !this.matrix.isColumnLayoutHorizontal }, Object.defineProperty(t.prototype, "headerRow", { get: function () { return this.headerRowValue }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "footerRow", { get: function () { return this.footerRowValue }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "allowRowsDragAndDrop", { get: function () { return this.matrix.allowRowsDragAndDrop && this.matrix.isColumnLayoutHorizontal }, enumerable: !1, configurable: !0 }), t.prototype.build = function () { this.hasRemoveRowsValue = this.matrix.canRemoveRows; this.matrix.visibleRows; this.cssClasses = this.matrix.cssClasses, this.buildRowsActions(), this.buildHeader(), this.buildRows(), this.buildFooter(), this.updateShowTableAndAddRow() }, t.prototype.updateShowTableAndAddRow = function () { var e = this.rows.length > 0 || this.matrix.isDesignMode || !this.matrix.getShowColumnsIfEmpty(); this.setPropertyValue("showTable", e); var t = this.matrix.canAddRow && e, n = t, o = t; n && (n = "default" === this.matrix.getAddRowLocation() ? !this.matrix.isColumnLayoutHorizontal : "bottom" !== this.matrix.getAddRowLocation()), o && "topBottom" !== this.matrix.getAddRowLocation() && (o = !n), this.setPropertyValue("showAddRowOnTop", n), this.setPropertyValue("showAddRowOnBottom", o) }, t.prototype.onAddedRow = function () { if (!(this.getRenderedDataRowCount() >= this.matrix.visibleRows.length)) { var e = this.matrix.visibleRows[this.matrix.visibleRows.length - 1]; this.rowsActions.push(this.buildRowActions(e)), this.addHorizontalRow(this.rows, e, 1 == this.matrix.visibleRows.length && !this.matrix.showHeader), this.updateShowTableAndAddRow() } }, t.prototype.getRenderedDataRowCount = function () { for (var e = 0, t = 0; t < this.rows.length; t++)this.rows[t].isDetailRow || e++; return e }, t.prototype.onRemovedRow = function (e) { var t = this.getRenderedRowIndex(e); if (!(t < 0)) { this.rowsActions.splice(t, 1); var n = 1; t < this.rows.length - 1 && this.rows[t + 1].isDetailRow && n++, this.rows.splice(t, n), this.updateShowTableAndAddRow() } }, t.prototype.onDetailPanelChangeVisibility = function (e, t) { var n = this.getRenderedRowIndex(e); if (!(n < 0)) { var o = n < this.rows.length - 1 && this.rows[n + 1].isDetailRow ? n + 1 : -1; if (!(t && o > -1 || !t && o < 0)) if (t) { var r = this.createDetailPanelRow(e, this.rows[n]); this.rows.splice(n + 1, 0, r) } else this.rows.splice(o, 1) } }, t.prototype.getRenderedRowIndex = function (e) { for (var t = 0; t < this.rows.length; t++)if (this.rows[t].row == e) return t; return -1 }, t.prototype.buildRowsActions = function () { this.rowsActions = []; for (var e = this.matrix.visibleRows, t = 0; t < e.length; t++)this.rowsActions.push(this.buildRowActions(e[t])) }, t.prototype.createRenderedRow = function (e, t) { return void 0 === t && (t = !1), new yn(e, t) }, t.prototype.buildHeader = function () { var e = this.matrix.isColumnLayoutHorizontal && this.matrix.showHeader || this.matrix.hasRowText && !this.matrix.isColumnLayoutHorizontal; if (this.setPropertyValue("showHeader", e), e) { if (this.headerRowValue = this.createRenderedRow(this.cssClasses), this.allowRowsDragAndDrop && this.headerRow.cells.push(this.createHeaderCell(null)), this.hasActionCellInRows("start") && this.headerRow.cells.push(this.createHeaderCell(null)), this.matrix.hasRowText && this.matrix.showHeader && this.headerRow.cells.push(this.createHeaderCell(null)), this.matrix.isColumnLayoutHorizontal) for (var t = 0; t < this.matrix.visibleColumns.length; t++) { var n = this.matrix.visibleColumns[t]; n.hasVisibleCell && (n.isShowInMultipleColumns ? this.createMutlipleColumnsHeader(n) : this.headerRow.cells.push(this.createHeaderCell(n))) } else { var o = this.matrix.visibleRows; for (t = 0; t < o.length; t++) { var r = this.createTextCell(o[t].locText); r.row = o[t], this.headerRow.cells.push(r) } this.matrix.hasFooter && this.headerRow.cells.push(this.createTextCell(this.matrix.getFooterText())) } this.hasActionCellInRows("end") && this.headerRow.cells.push(this.createHeaderCell(null)) } }, t.prototype.buildFooter = function () { if (this.showFooter) { this.footerRowValue = this.createRenderedRow(this.cssClasses), this.allowRowsDragAndDrop && this.footerRow.cells.push(this.createHeaderCell(null)), this.hasActionCellInRows("start") && this.footerRow.cells.push(this.createHeaderCell(null)), this.matrix.hasRowText && this.footerRow.cells.push(this.createTextCell(this.matrix.getFooterText())); for (var e = this.matrix.visibleTotalRow.cells, t = 0; t < e.length; t++) { var n = e[t]; if (n.column.hasVisibleCell) if (n.column.isShowInMultipleColumns) this.createMutlipleColumnsFooter(this.footerRow, n); else { var o = this.createEditCell(n); n.column && this.setHeaderCellWidth(n.column, o), this.footerRow.cells.push(o) } } this.hasActionCellInRows("end") && this.footerRow.cells.push(this.createHeaderCell(null)) } }, t.prototype.buildRows = function () { var e = this.matrix.isColumnLayoutHorizontal ? this.buildHorizontalRows() : this.buildVerticalRows(); this.rows = e }, t.prototype.hasActionCellInRows = function (e) { return void 0 === this.hasActionCellInRowsValues[e] && (this.hasActionCellInRowsValues[e] = this.hasActionsCellInLocaltion(e)), this.hasActionCellInRowsValues[e] }, t.prototype.hasActionsCellInLocaltion = function (e) { var t = this; return !("end" != e || !this.hasRemoveRows) || this.matrix.visibleRows.some((function (n, o) { return !t.isValueEmpty(t.getRowActions(o, e)) })) }, t.prototype.canRemoveRow = function (e) { return this.matrix.canRemoveRow(e) }, t.prototype.buildHorizontalRows = function () { for (var e = this.matrix.visibleRows, t = [], n = 0; n < e.length; n++)this.addHorizontalRow(t, e[n], 0 == n && !this.matrix.showHeader); return t }, t.prototype.addHorizontalRow = function (e, t, n) { var o = this.createHorizontalRow(t, n); o.row = t, e.push(o), t.isDetailPanelShowing && e.push(this.createDetailPanelRow(t, o)) }, t.prototype.getRowDragCell = function (e) { var t = new gn; return t.isDragHandlerCell = !0, t.className = this.getActionsCellClassName(), t.row = this.matrix.visibleRows[e], t }, t.prototype.getActionsCellClassName = function () { return (new at).append(this.cssClasses.actionsCell).append(this.cssClasses.verticalCell, !this.matrix.isColumnLayoutHorizontal).toString() }, t.prototype.getRowActionsCell = function (e, t) { var n = this.getRowActions(e, t); if (!this.isValueEmpty(n)) { var o = new gn, r = this.matrix.allowAdaptiveActions ? new It : new pt; this.matrix.survey && this.matrix.survey.getCss().actionBar && (r.cssClasses = this.matrix.survey.getCss().actionBar), r.setItems(n); var i = new qe(r); return o.item = i, o.isActionsCell = !0, o.className = this.getActionsCellClassName(), o.row = this.matrix.visibleRows[e], o } return null }, t.prototype.getRowActions = function (e, t) { var n = this.rowsActions[e]; return Array.isArray(n) ? n.filter((function (e) { return e.location || (e.location = "start"), e.location === t })) : [] }, t.prototype.buildRowActions = function (e) { var t = []; return this.setDefaultRowActions(e, t), this.matrix.survey && (t = this.matrix.survey.getUpdatedMatrixRowActions(this.matrix, e, t)), t }, Object.defineProperty(t.prototype, "showRemoveButtonAsIcon", { get: function () { return o.matrixRenderRemoveAsIcon && this.matrix.survey && "sd-root-modern" === this.matrix.survey.css.root }, enumerable: !1, configurable: !0 }), t.prototype.setDefaultRowActions = function (e, t) { var n = this.matrix; this.hasRemoveRows && this.canRemoveRow(e) && (this.showRemoveButtonAsIcon ? t.push(new Tt({ id: "remove-row", iconName: "icon-delete", component: "sv-action-bar-item", innerCss: (new at).append(this.matrix.cssClasses.button).append(this.matrix.cssClasses.buttonRemove).toString(), location: "end", showTitle: !1, title: n.removeRowText, enabled: !n.isInputReadOnly, data: { row: e, question: n }, action: function () { n.removeRowUI(e) } })) : t.push(new Tt({ id: "remove-row", location: "end", enabled: !this.matrix.isInputReadOnly, component: "sv-matrix-remove-button", data: { row: e, question: this.matrix } }))), e.hasPanel && t.push(new Tt({ id: "show-detail", title: this.matrix.getLocalizationString("editText"), showTitle: !1, location: "start", component: "sv-matrix-detail-button", data: { row: e, question: this.matrix } })) }, t.prototype.createHorizontalRow = function (e, t) { var n = this.createRenderedRow(this.cssClasses); if (this.allowRowsDragAndDrop) { var o = this.matrix.visibleRows.indexOf(e); n.cells.push(this.getRowDragCell(o)) } (this.addRowActionsCell(e, n, "start"), this.matrix.hasRowText) && ((s = this.createTextCell(e.locText)).row = e, n.cells.push(s), t && this.setHeaderCellWidth(null, s), s.className = (new at).append(s.className).append(this.cssClasses.rowTextCell).append(this.cssClasses.detailRowText, e.hasPanel).toString()); for (var r = 0; r < e.cells.length; r++) { var i = e.cells[r]; if (i.column.hasVisibleCell) if (i.column.isShowInMultipleColumns) this.createMutlipleEditCells(n, i); else { var s = this.createEditCell(i); n.cells.push(s), t && this.setHeaderCellWidth(i.column, s) } } return this.addRowActionsCell(e, n, "end"), n }, t.prototype.addRowActionsCell = function (e, t, n) { var o = this.matrix.visibleRows.indexOf(e); if (this.hasActionCellInRows(n)) { var r = this.getRowActionsCell(o, n); if (r) t.cells.push(r); else { var i = new gn; i.isEmpty = !0, t.cells.push(i) } } }, t.prototype.createDetailPanelRow = function (e, t) { var n = this.matrix.isDesignMode, o = this.createRenderedRow(this.cssClasses, !0); o.row = e; var r = new gn; this.matrix.hasRowText && (r.colSpans = 2), r.isEmpty = !0, n || o.cells.push(r); var i = null; this.hasActionCellInRows("end") && ((i = new gn).isEmpty = !0); var s = new gn; return s.panel = e.detailPanel, s.colSpans = t.cells.length - (n ? 0 : r.colSpans) - (i ? i.colSpans : 0), s.className = this.cssClasses.detailPanelCell, o.cells.push(s), i && o.cells.push(i), "function" == typeof this.matrix.onCreateDetailPanelRenderedRowCallback && this.matrix.onCreateDetailPanelRenderedRowCallback(o), o }, t.prototype.buildVerticalRows = function () { for (var e = this.matrix.columns, t = [], n = 0; n < e.length; n++) { var o = e[n]; o.isVisible && o.hasVisibleCell && (o.isShowInMultipleColumns ? this.createMutlipleVerticalRows(t, o, n) : t.push(this.createVerticalRow(o, n))) } return this.hasActionCellInRows("end") && t.push(this.createEndVerticalActionRow()), t }, t.prototype.createMutlipleVerticalRows = function (e, t, n) { var o = this.getMultipleColumnChoices(t); if (o) for (var r = 0; r < o.length; r++)e.push(this.createVerticalRow(t, n, o[r], r)) }, t.prototype.createVerticalRow = function (e, t, n, o) { void 0 === n && (n = null), void 0 === o && (o = -1); var r = this.createRenderedRow(this.cssClasses); if (this.matrix.showHeader) { var i = n ? n.locText : e.locTitle, s = this.createTextCell(i); s.column = e, s.className = (new at).append(s.className).append(this.cssClasses.rowTextCell).toString(), n || this.setRequriedToHeaderCell(e, s), r.cells.push(s) } for (var a = this.matrix.visibleRows, l = 0; l < a.length; l++) { var u = n, c = o >= 0 ? o : l, p = a[l].cells[t], h = n ? p.question.visibleChoices : void 0; h && c < h.length && (u = h[c]); var d = this.createEditCell(p, u); d.item = u, d.choiceIndex = c, r.cells.push(d) } return this.matrix.hasTotal && r.cells.push(this.createEditCell(this.matrix.visibleTotalRow.cells[t])), r }, t.prototype.createEndVerticalActionRow = function () { var e = this.createRenderedRow(this.cssClasses); this.matrix.showHeader && e.cells.push(this.createEmptyCell()); for (var t = this.matrix.visibleRows, n = 0; n < t.length; n++)e.cells.push(this.getRowActionsCell(n, "end")); return this.matrix.hasTotal && e.cells.push(this.createEmptyCell()), e }, t.prototype.createMutlipleEditCells = function (e, t, n) { void 0 === n && (n = !1); var o = n ? this.getMultipleColumnChoices(t.column) : t.question.visibleChoices; if (o) for (var r = 0; r < o.length; r++) { var i = this.createEditCell(t, n ? void 0 : o[r]); n || (this.setItemCellCssClasses(i), i.choiceIndex = r), e.cells.push(i) } }, t.prototype.setItemCellCssClasses = function (e) { e.className = (new at).append(this.cssClasses.itemCell).append(this.cssClasses.radioCell, e.isRadio).append(this.cssClasses.checkboxCell, e.isCheckbox).toString() }, t.prototype.createEditCell = function (e, t) { void 0 === t && (t = void 0); var n = new gn; return n.cell = e, n.row = e.row, n.question = e.question, n.matrix = this.matrix, n.item = t, n.isOtherChoice = !!t && !!e.question && e.question.otherItem === t, n.className = n.calculateFinalClassName(this.cssClasses), n }, t.prototype.createMutlipleColumnsFooter = function (e, t) { this.createMutlipleEditCells(e, t, !0) }, t.prototype.createMutlipleColumnsHeader = function (e) { var t = this.getMultipleColumnChoices(e); if (t) for (var n = 0; n < t.length; n++) { var o = this.createTextCell(t[n].locText); this.setHeaderCell(e, o), this.setHeaderCellCssClasses(o), this.headerRow.cells.push(o) } }, t.prototype.getMultipleColumnChoices = function (e) { var t = e.templateQuestion.choices; return t && Array.isArray(t) && 0 == t.length ? this.matrix.choices : (t = e.templateQuestion.visibleChoices) && Array.isArray(t) ? t : null }, t.prototype.setHeaderCellCssClasses = function (e, t) { e.className = (new at).append(this.cssClasses.headerCell).append(this.cssClasses.emptyCell, !!e.isEmpty).append(this.cssClasses.cell + "--" + t, !!t).toString() }, t.prototype.createHeaderCell = function (e) { var t = e ? this.createTextCell(e.locTitle) : this.createEmptyCell(); t.column = e, this.setHeaderCell(e, t); var n = e && "default" !== e.cellType ? e.cellType : this.matrix.cellType; return this.setHeaderCellCssClasses(t, n), t }, t.prototype.setHeaderCell = function (e, t) { this.setHeaderCellWidth(e, t), this.setRequriedToHeaderCell(e, t) }, t.prototype.setHeaderCellWidth = function (e, t) { t.minWidth = null != e ? this.matrix.getColumnWidth(e) : this.matrix.getRowTitleWidth(), t.width = null != e ? e.width : this.matrix.getRowTitleWidth() }, t.prototype.setRequriedToHeaderCell = function (e, t) { e && e.isRequired && this.matrix.survey && (t.requiredText = this.matrix.survey.requiredText) }, t.prototype.createRemoveRowCell = function (e) { var t = new gn; return t.row = e, t.isRemoveRow = this.canRemoveRow(e), this.cssClasses.cell && (t.className = this.cssClasses.cell), t }, t.prototype.createTextCell = function (e) { var t = new gn; return t.locTitle = e, e && e.strChanged(), this.cssClasses.cell && (t.className = this.cssClasses.cell), t }, t.prototype.createEmptyCell = function () { var e = this.createTextCell(null); return e.isEmpty = !0, e }, fn([y({ onPush: function (e, t, n) { n.renderedRowsChangedCallback() } })], t.prototype, "rows", void 0), t }(ce), vn = function () { var e = function (t, n) { return (e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (e, t) { e.__proto__ = t } || function (e, t) { for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]) })(t, n) }; return function (t, n) { if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null"); function o() { this.constructor = t } e(t, n), t.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o) } }(), bn = function () { function e(e, t, n) { this.column = e, this.row = t, this.data = n, this.questionValue = this.createQuestion(e, t, n), this.questionValue.updateCustomWidget() } return e.prototype.locStrsChanged = function () { this.question.locStrsChanged() }, e.prototype.createQuestion = function (e, t, n) { var o = n.createQuestion(this.row, this.column); return o.validateValueCallback = function () { return n.validateCell(t, e.name, t.value) }, v.getProperties(e.getType()).forEach((function (t) { var n = t.name; void 0 !== e[n] && (o[n] = e[n]) })), o }, Object.defineProperty(e.prototype, "question", { get: function () { return this.questionValue }, enumerable: !1, configurable: !0 }), Object.defineProperty(e.prototype, "value", { get: function () { return this.question.value }, set: function (e) { this.question.value = e }, enumerable: !1, configurable: !0 }), e.prototype.runCondition = function (e, t) { this.question.runCondition(e, t) }, e }(), Cn = function (e) { function t(t, n, o) { var r = e.call(this, t, n, o) || this; return r.column = t, r.row = n, r.data = o, r.updateCellQuestion(), r } return vn(t, e), t.prototype.createQuestion = function (e, t, n) { var o = _.createClass("expression"); return o.setSurveyImpl(t), o }, t.prototype.locStrsChanged = function () { this.updateCellQuestion(), e.prototype.locStrsChanged.call(this) }, t.prototype.updateCellQuestion = function () { this.question.locCalculation(), this.column.updateCellQuestion(this.question, null, (function (e) { delete e.defaultValue })), this.question.expression = this.getTotalExpression(), this.question.format = this.column.totalFormat, this.question.currency = this.column.totalCurrency, this.question.displayStyle = this.column.totalDisplayStyle, this.question.maximumFractionDigits = this.column.totalMaximumFractionDigits, this.question.minimumFractionDigits = this.column.totalMinimumFractionDigits, this.question.unlocCalculation(), this.question.runIfReadOnly = !0 }, t.prototype.getTotalExpression = function () { if (this.column.totalExpression) return this.column.totalExpression; if ("none" == this.column.totalType) return ""; var e = this.column.totalType + "InArray"; return R.Instance.hasFunction(e) ? e + "({self}, '" + this.column.name + "')" : "" }, t }(bn), Pn = function (e) { function t(t, n, o) { var r = e.call(this, n) || this; return r.row = t, r.variableName = n, r.parentTextProcessor = o, r } return vn(t, e), t.prototype.getParentTextProcessor = function () { return this.parentTextProcessor }, Object.defineProperty(t.prototype, "survey", { get: function () { return this.row.getSurvey() }, enumerable: !1, configurable: !0 }), t.prototype.getValues = function () { return this.row.value }, t.prototype.getQuestionByName = function (e) { return this.row.getQuestionByName(e) }, t.prototype.onCustomProcessText = function (e) { return e.name == wn.IndexVariableName ? (e.isExists = !0, e.value = this.row.rowIndex, !0) : e.name == wn.RowValueVariableName && (e.isExists = !0, e.value = this.row.rowName, !0) }, t }(on), wn = function () { function e(t, n) { var o = this; this.isSettingValue = !1, this.detailPanelValue = null, this.cells = [], this.isCreatingDetailPanel = !1, this.data = t, this.subscribeToChanges(n), this.textPreProcessor = new Pn(this, e.RowVariableName, t ? t.getParentTextProcessor() : null), this.showHideDetailPanelClick = function () { if (o.getSurvey().isDesignMode) return !0; o.showHideDetailPanel() }, this.idValue = e.getId() } return e.getId = function () { return "srow_" + e.idCounter++ }, Object.defineProperty(e.prototype, "id", { get: function () { return this.idValue }, enumerable: !1, configurable: !0 }), Object.defineProperty(e.prototype, "rowName", { get: function () { return null }, enumerable: !1, configurable: !0 }), Object.defineProperty(e.prototype, "text", { get: function () { return this.rowName }, enumerable: !1, configurable: !0 }), Object.defineProperty(e.prototype, "value", { get: function () { for (var e = {}, t = this.questions, n = 0; n < t.length; n++) { var o = t[n]; o.isEmpty() || (e[o.getValueName()] = o.value), o.comment && this.getSurvey() && this.getSurvey().storeOthersAsComment && (e[o.getValueName() + ce.commentSuffix] = o.comment) } return e }, set: function (e) { this.isSettingValue = !0, this.subscribeToChanges(e); for (var t = this.questions, n = 0; n < t.length; n++) { var o = t[n], r = this.getCellValue(e, o.getValueName()), i = o.comment, s = e ? e[o.getValueName() + ce.commentSuffix] : ""; null == s && (s = ""), o.updateValueFromSurvey(r), (s || this.isTwoValueEquals(i, o.comment)) && o.updateCommentFromSurvey(s), o.onSurveyValueChanged(r) } this.isSettingValue = !1 }, enumerable: !1, configurable: !0 }), Object.defineProperty(e.prototype, "locText", { get: function () { return null }, enumerable: !1, configurable: !0 }), Object.defineProperty(e.prototype, "hasPanel", { get: function () { return !!this.data && this.data.hasDetailPanel(this) }, enumerable: !1, configurable: !0 }), Object.defineProperty(e.prototype, "detailPanel", { get: function () { return this.detailPanelValue }, enumerable: !1, configurable: !0 }), Object.defineProperty(e.prototype, "detailPanelId", { get: function () { return this.detailPanel ? this.detailPanel.id : "" }, enumerable: !1, configurable: !0 }), Object.defineProperty(e.prototype, "isDetailPanelShowing", { get: function () { return !!this.data && this.data.getIsDetailPanelShowing(this) }, enumerable: !1, configurable: !0 }), e.prototype.setIsDetailPanelShowing = function (e) { this.data && this.data.setIsDetailPanelShowing(this, e), this.onDetailPanelShowingChanged && this.onDetailPanelShowingChanged() }, e.prototype.showHideDetailPanel = function () { this.isDetailPanelShowing ? this.hideDetailPanel() : this.showDetailPanel() }, e.prototype.showDetailPanel = function () { this.ensureDetailPanel(), this.detailPanelValue && this.setIsDetailPanelShowing(!0) }, e.prototype.hideDetailPanel = function (e) { void 0 === e && (e = !1), this.setIsDetailPanelShowing(!1), e && (this.detailPanelValue = null) }, e.prototype.ensureDetailPanel = function () { if (!this.isCreatingDetailPanel && !this.detailPanelValue && this.hasPanel && this.data) { this.isCreatingDetailPanel = !0, this.detailPanelValue = this.data.createRowDetailPanel(this); var e = this.detailPanelValue.questions, t = this.data.getRowValue(this.data.getRowIndex(this)); if (!r.isValueEmpty(t)) for (var n = 0; n < e.length; n++) { var o = e[n].getValueName(); r.isValueEmpty(t[o]) || (e[n].value = t[o]) } this.detailPanelValue.setSurveyImpl(this), this.isCreatingDetailPanel = !1 } }, e.prototype.getAllValues = function () { return this.value }, e.prototype.getFilteredValues = function () { var e = this.getAllValues(), t = { row: e }; for (var n in e) t[n] = e[n]; return t }, e.prototype.getFilteredProperties = function () { return { survey: this.getSurvey(), row: this } }, e.prototype.runCondition = function (t, n) { this.data && (t[e.OwnerVariableName] = this.data.value), t[e.IndexVariableName] = this.rowIndex, t[e.RowValueVariableName] = this.rowName, n || (n = {}), n[e.RowVariableName] = this; for (var o = 0; o < this.cells.length; o++)t[e.RowVariableName] = this.value, this.cells[o].runCondition(t, n); this.detailPanel && this.detailPanel.runCondition(t, n) }, e.prototype.clearValue = function () { for (var e = this.questions, t = 0; t < e.length; t++)e[t].clearValue() }, e.prototype.onAnyValueChanged = function (e) { for (var t = this.questions, n = 0; n < t.length; n++)t[n].onAnyValueChanged(e) }, e.prototype.getDataValueCore = function (e, t) { var n = this.getSurvey(); return n ? n.getDataValueCore(e, t) : e[t] }, e.prototype.getValue = function (e) { var t = this.getQuestionByName(e); return t ? t.value : null }, e.prototype.setValue = function (e, t) { this.setValueCore(e, t, !1) }, e.prototype.getVariable = function (e) { }, e.prototype.setVariable = function (e, t) { }, e.prototype.getComment = function (e) { var t = this.getQuestionByName(e); return t ? t.comment : "" }, e.prototype.setComment = function (e, t, n) { this.setValueCore(e, t, !0) }, e.prototype.findQuestionByName = function (t) { if (t) { var n = e.RowVariableName + "."; if (0 === t.indexOf(n)) return this.getQuestionByName(t.substring(n.length)); var o = this.getSurvey(); return o ? o.getQuestionByName(t) : null } }, e.prototype.setValueCore = function (t, n, o) { if (!this.isSettingValue) { this.updateQuestionsValue(t, n, o); var r = this.value, i = o ? t + ce.commentSuffix : t, s = n, a = this.getQuestionByName(t), l = this.data.onRowChanging(this, i, r); if (a && !this.isTwoValueEquals(l, s) && (this.isSettingValue = !0, o ? a.comment = l : a.value = l, this.isSettingValue = !1, r = this.value), !this.data.isValidateOnValueChanging || !this.hasQuestonError(a)) { var u = null == n && !a || o && !n && !!a && a.autoOtherMode; this.data.onRowChanged(this, i, r, u), this.onAnyValueChanged(e.RowVariableName) } } }, e.prototype.updateQuestionsValue = function (e, t, n) { if (this.detailPanel) { var o = this.getQuestionByColumnName(e), r = this.detailPanel.getQuestionByName(e); if (o && r) { var i = this.isTwoValueEquals(t, n ? o.comment : o.value) ? r : o; this.isSettingValue = !0, n ? i.comment = t : i.value = t, this.isSettingValue = !1 } } }, e.prototype.hasQuestonError = function (e) { if (!e) return !1; if (e.hasErrors(!0, { isOnValueChanged: !this.data.isValidateOnValueChanging })) return !0; if (e.isEmpty()) return !1; var t = this.getCellByColumnName(e.name); return !!(t && t.column && t.column.isUnique) && this.data.checkIfValueInRowDuplicated(this, e) }, Object.defineProperty(e.prototype, "isEmpty", { get: function () { var e = this.value; if (r.isValueEmpty(e)) return !0; for (var t in e) if (void 0 !== e[t] && null !== e[t]) return !1; return !0 }, enumerable: !1, configurable: !0 }), e.prototype.getQuestionByColumn = function (e) { var t = this.getCellByColumn(e); return t ? t.question : null }, e.prototype.getCellByColumn = function (e) { for (var t = 0; t < this.cells.length; t++)if (this.cells[t].column == e) return this.cells[t]; return null }, e.prototype.getCellByColumnName = function (e) { for (var t = 0; t < this.cells.length; t++)if (this.cells[t].column.name == e) return this.cells[t]; return null }, e.prototype.getQuestionByColumnName = function (e) { var t = this.getCellByColumnName(e); return t ? t.question : null }, Object.defineProperty(e.prototype, "questions", { get: function () { for (var e = [], t = 0; t < this.cells.length; t++)e.push(this.cells[t].question); var n = this.detailPanel ? this.detailPanel.questions : []; for (t = 0; t < n.length; t++)e.push(n[t]); return e }, enumerable: !1, configurable: !0 }), e.prototype.getQuestionByName = function (e) { var t = this.getQuestionByColumnName(e); return t || (this.detailPanel ? this.detailPanel.getQuestionByName(e) : null) }, e.prototype.getQuestionsByName = function (e) { var t = [], n = this.getQuestionByColumnName(e); return n && t.push(n), this.detailPanel && (n = this.detailPanel.getQuestionByName(e)) && t.push(n), t }, e.prototype.getSharedQuestionByName = function (e) { return this.data ? this.data.getSharedQuestionByName(e, this) : null }, e.prototype.clearIncorrectValues = function (e) { for (var t in e) { var n = this.getQuestionByName(t); if (n) { var r = n.value; n.clearIncorrectValues(), this.isTwoValueEquals(r, n.value) || this.setValue(t, n.value) } else !this.getSharedQuestionByName(t) && t.indexOf(o.matrixTotalValuePostFix) < 0 && this.setValue(t, null) } }, e.prototype.getLocale = function () { return this.data ? this.data.getLocale() : "" }, e.prototype.getMarkdownHtml = function (e, t) { return this.data ? this.data.getMarkdownHtml(e, t) : void 0 }, e.prototype.getRenderer = function (e) { return this.data ? this.data.getRenderer(e) : null }, e.prototype.getRendererContext = function (e) { return this.data ? this.data.getRendererContext(e) : e }, e.prototype.getProcessedText = function (e) { return this.data ? this.data.getProcessedText(e) : e }, e.prototype.locStrsChanged = function () { for (var e = 0; e < this.cells.length; e++)this.cells[e].locStrsChanged(); this.detailPanel && this.detailPanel.locStrsChanged() }, e.prototype.updateCellQuestionOnColumnChanged = function (e, t, n) { var o = this.getCellByColumn(e); o && this.updateCellOnColumnChanged(o, t, n) }, e.prototype.updateCellQuestionOnColumnItemValueChanged = function (e, t, n, o, r, i) { var s = this.getCellByColumn(e); s && this.updateCellOnColumnItemValueChanged(s, t, n, o, r, i) }, e.prototype.onQuestionReadOnlyChanged = function (e) { for (var t = this.questions, n = 0; n < t.length; n++) { var o = t[n]; o.setPropertyValue("isReadOnly", o.isReadOnly) } this.detailPanel && (this.detailPanel.readOnly = e) }, e.prototype.hasErrors = function (e, t, n) { var o = !1, r = this.cells; if (!r) return o; for (var i = 0; i < r.length; i++)if (r[i]) { var s = r[i].question; s && s.visible && (s.onCompletedAsyncValidators = function (e) { n() }, t && !0 === t.isOnValueChanged && s.isEmpty() || (o = s.hasErrors(e, t) || o)) } if (this.hasPanel) { this.ensureDetailPanel(); var a = this.detailPanel.hasErrors(e, !1, t); !t.hideErroredPanel && a && e && (t.isSingleDetailPanel && (t.hideErroredPanel = !0), this.showDetailPanel()), o = a || o } return o }, e.prototype.updateCellOnColumnChanged = function (e, t, n) { e.question[t] = n }, e.prototype.updateCellOnColumnItemValueChanged = function (e, t, n, o, r, i) { var s = e.question[t]; if (Array.isArray(s)) { var a = "value" === o ? i : n.value, l = qe.getItemByValue(s, a); l && (l[o] = r) } }, e.prototype.buildCells = function (e) { this.isSettingValue = !0; for (var t = this.data.columns, n = 0; n < t.length; n++) { var o = t[n]; if (o.isVisible) { var i = this.createCell(o); this.cells.push(i); var s = this.getCellValue(e, o.name); if (!r.isValueEmpty(s)) { i.question.value = s; var a = o.name + ce.commentSuffix; e && !r.isValueEmpty(e[a]) && (i.question.comment = e[a]) } } } this.isSettingValue = !1 }, e.prototype.isTwoValueEquals = function (e, t) { return r.isTwoValueEquals(e, t, !1, !0, !1) }, e.prototype.getCellValue = function (e, t) { return this.editingObj ? _.getObjPropertyValue(this.editingObj, t) : e ? e[t] : void 0 }, e.prototype.createCell = function (e) { return new bn(e, this, this.data) }, e.prototype.getSurveyData = function () { return this }, e.prototype.getSurvey = function () { return this.data ? this.data.getSurvey() : null }, e.prototype.getTextProcessor = function () { return this.textPreProcessor }, Object.defineProperty(e.prototype, "rowIndex", { get: function () { return this.data ? this.data.getRowIndex(this) + 1 : -1 }, enumerable: !1, configurable: !0 }), Object.defineProperty(e.prototype, "editingObj", { get: function () { return this.editingObjValue }, enumerable: !1, configurable: !0 }), e.prototype.dispose = function () { this.editingObj && (this.editingObj.onPropertyChanged.remove(this.onEditingObjPropertyChanged), this.editingObjValue = null) }, e.prototype.subscribeToChanges = function (e) { var t = this; e && e.getType && e.onPropertyChanged && e !== this.editingObj && (this.editingObjValue = e, this.onEditingObjPropertyChanged = function (e, n) { t.updateOnSetValue(n.name, n.newValue) }, this.editingObj.onPropertyChanged.add(this.onEditingObjPropertyChanged)) }, e.prototype.updateOnSetValue = function (e, t) { this.isSettingValue = !0; for (var n = this.getQuestionsByName(e), o = 0; o < n.length; o++)n[o].value = t; this.isSettingValue = !1 }, e.RowVariableName = "row", e.OwnerVariableName = "self", e.IndexVariableName = "rowIndex", e.RowValueVariableName = "rowValue", e.idCounter = 1, e }(), Vn = function (e) { function t(t) { var n = e.call(this, t, null) || this; return n.buildCells(null), n } return vn(t, e), t.prototype.createCell = function (e) { return new Cn(e, this, this.data) }, t.prototype.setValue = function (e, t) { this.data && !this.isSettingValue && this.data.onTotalValueChanged() }, t.prototype.runCondition = function (t, n) { var o, i = 0; do { o = r.getUnbindValue(this.value), e.prototype.runCondition.call(this, t, n), i++ } while (!r.isTwoValueEquals(o, this.value) && i < 3) }, t.prototype.updateCellOnColumnChanged = function (e, t, n) { e.updateCellQuestion() }, t }(wn), xn = function (e) { function t(t) { var n = e.call(this, t) || this; return n.isRowChanging = !1, n.lockResetRenderedTable = !1, n.isDoingonAnyValueChanged = !1, n.createItemValues("choices"), n.createLocalizableString("placeholder", n, !1, !0), n.createLocalizableString("keyDuplicationError", n, !1, !0), n.detailPanelValue = n.createNewDetailPanel(), n.detailPanel.selectedElementInDesign = n, n.detailPanel.renderWidth = "100%", n.detailPanel.isInteractiveDesignElement = !1, n.detailPanel.showTitle = !1, n.registerPropertyChangedHandlers(["columns", "cellType"], (function () { n.updateColumnsAndRows() })), n.registerPropertyChangedHandlers(["placeholder", "columnColCount", "rowTitleWidth", "choices"], (function () { n.clearRowsAndResetRenderedTable() })), n.registerPropertyChangedHandlers(["columnLayout", "addRowLocation", "hideColumnsIfEmpty", "showHeader", "minRowCount", "isReadOnly", "rowCount", "hasFooter", "detailPanelMode"], (function () { n.resetRenderedTable() })), n.registerPropertyChangedHandlers(["isMobile"], (function () { "vertical" === n.columnLayout && n.resetRenderedTable() })), n } return vn(t, e), Object.defineProperty(t, "defaultCellType", { get: function () { return o.matrixDefaultCellType }, set: function (e) { o.matrixDefaultCellType = e }, enumerable: !1, configurable: !0 }), t.addDefaultColumns = function (e) { for (var t = rn.DefaultColums, n = 0; n < t.length; n++)e.addColumn(t[n]) }, t.prototype.createColumnValues = function () { var e = this; return this.createNewArray("columns", (function (t) { t.colOwner = e, e.onAddColumn && e.onAddColumn(t), e.survey && e.survey.matrixColumnAdded(e, t) }), (function (t) { t.colOwner = null, e.onRemoveColumn && e.onRemoveColumn(t) })) }, t.prototype.getType = function () { return "matrixdropdownbase" }, t.prototype.dispose = function () { e.prototype.dispose.call(this), this.clearGeneratedRows() }, Object.defineProperty(t.prototype, "hasSingleInput", { get: function () { return !1 }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "isRowsDynamic", { get: function () { return !1 }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "isUpdateLocked", { get: function () { return this.isLoadingFromJson || this.isUpdating }, enumerable: !1, configurable: !0 }), t.prototype.beginUpdate = function () { this.isUpdating = !0 }, t.prototype.endUpdate = function () { this.isUpdating = !1, this.updateColumnsAndRows() }, t.prototype.updateColumnsAndRows = function () { this.updateColumnsIndexes(this.columns), this.updateColumnsCellType(), this.generatedTotalRow = null, this.clearRowsAndResetRenderedTable() }, t.prototype.itemValuePropertyChanged = function (t, n, o, r) { e.prototype.itemValuePropertyChanged.call(this, t, n, o, r), "choices" === t.ownerPropertyName && this.clearRowsAndResetRenderedTable() }, Object.defineProperty(t.prototype, "columnLayout", { get: function () { return this.getPropertyValue("columnLayout") }, set: function (e) { this.setPropertyValue("columnLayout", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "columnsLocation", { get: function () { return this.columnLayout }, set: function (e) { this.columnLayout = e }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "isColumnLayoutHorizontal", { get: function () { return !!this.isMobile || "vertical" != this.columnLayout }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "isUniqueCaseSensitive", { get: function () { return void 0 !== this.isUniqueCaseSensitiveValue ? this.isUniqueCaseSensitiveValue : o.comparator.caseSensitive }, set: function (e) { this.isUniqueCaseSensitiveValue = e }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "detailPanelMode", { get: function () { return this.getPropertyValue("detailPanelMode") }, set: function (e) { this.setPropertyValue("detailPanelMode", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "detailPanel", { get: function () { return this.detailPanelValue }, enumerable: !1, configurable: !0 }), t.prototype.getPanel = function () { return this.detailPanel }, Object.defineProperty(t.prototype, "detailElements", { get: function () { return this.detailPanel.elements }, enumerable: !1, configurable: !0 }), t.prototype.createNewDetailPanel = function () { return _.createClass("panel") }, Object.defineProperty(t.prototype, "hasRowText", { get: function () { return !0 }, enumerable: !1, configurable: !0 }), t.prototype.getFooterText = function () { return null }, Object.defineProperty(t.prototype, "canAddRow", { get: function () { return !1 }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "canRemoveRows", { get: function () { return !1 }, enumerable: !1, configurable: !0 }), t.prototype.canRemoveRow = function (e) { return !0 }, t.prototype.onPointerDown = function (e, t) { }, t.prototype.onRowsChanged = function () { this.resetRenderedTable(), e.prototype.onRowsChanged.call(this) }, t.prototype.onStartRowAddingRemoving = function () { this.lockResetRenderedTable = !0, this.setValueChangedDirectly() }, t.prototype.onEndRowAdding = function () { this.lockResetRenderedTable = !1, this.renderedTable && (this.renderedTable.isRequireReset() ? this.resetRenderedTable() : this.renderedTable.onAddedRow()) }, t.prototype.onEndRowRemoving = function (e) { this.lockResetRenderedTable = !1, this.renderedTable.isRequireReset() ? this.resetRenderedTable() : e && this.renderedTable.onRemovedRow(e) }, Object.defineProperty(t.prototype, "renderedTableValue", { get: function () { return this.getPropertyValue("renderedTable", null) }, set: function (e) { this.setPropertyValue("renderedTable", e) }, enumerable: !1, configurable: !0 }), t.prototype.clearRowsAndResetRenderedTable = function () { this.clearGeneratedRows(), this.resetRenderedTable(), this.fireCallback(this.columnsChangedCallback) }, t.prototype.resetRenderedTable = function () { this.lockResetRenderedTable || this.isUpdateLocked || (this.renderedTableValue = null, this.fireCallback(this.onRenderedTableResetCallback)) }, t.prototype.clearGeneratedRows = function () { if (this.generatedVisibleRows) { for (var t = 0; t < this.generatedVisibleRows.length; t++)this.generatedVisibleRows[t].dispose(); e.prototype.clearGeneratedRows.call(this) } }, Object.defineProperty(t.prototype, "renderedTable", { get: function () { return this.renderedTableValue || (this.renderedTableValue = this.createRenderedTable(), this.onRenderedTableCreatedCallback && this.onRenderedTableCreatedCallback(this.renderedTableValue)), this.renderedTableValue }, enumerable: !1, configurable: !0 }), t.prototype.createRenderedTable = function () { return new mn(this) }, t.prototype.onMatrixRowCreated = function (e) { if (this.survey) for (var t = { rowValue: e.value, row: e, column: null, columnName: null, cell: null, cellQuestion: null, value: null }, n = 0; n < this.visibleColumns.length; n++) { t.column = this.visibleColumns[n], t.columnName = t.column.name; var o = e.cells[n]; t.cell = o, t.cellQuestion = o.question, t.value = o.value, this.onCellCreatedCallback && this.onCellCreatedCallback(t), this.survey.matrixCellCreated(this, t) } }, Object.defineProperty(t.prototype, "cellType", { get: function () { return this.getPropertyValue("cellType", o.matrixDefaultCellType) }, set: function (e) { e = e.toLowerCase(), this.setPropertyValue("cellType", e) }, enumerable: !1, configurable: !0 }), t.prototype.updateColumnsCellType = function () { for (var e = 0; e < this.columns.length; e++)this.columns[e].defaultCellTypeChanged() }, t.prototype.updateColumnsIndexes = function (e) { for (var t = 0; t < e.length; t++)e[t].setIndex(t) }, Object.defineProperty(t.prototype, "columnColCount", { get: function () { return this.getPropertyValue("columnColCount") }, set: function (e) { e < 0 || e > 4 || this.setPropertyValue("columnColCount", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "horizontalScroll", { get: function () { return this.getPropertyValue("horizontalScroll", !1) }, set: function (e) { this.setPropertyValue("horizontalScroll", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "allowAdaptiveActions", { get: function () { return this.getPropertyValue("allowAdaptiveActions") }, set: function (e) { this.setPropertyValue("allowAdaptiveActions", e), this.detailPanel && (this.detailPanel.allowAdaptiveActions = e) }, enumerable: !1, configurable: !0 }), t.prototype.getRequiredText = function () { return this.survey ? this.survey.requiredText : "" }, t.prototype.hasChoices = function () { return this.choices.length > 0 }, t.prototype.onColumnPropertyChanged = function (e, t, n) { if (this.updateHasFooter(), this.generatedVisibleRows) { for (var o = 0; o < this.generatedVisibleRows.length; o++)this.generatedVisibleRows[o].updateCellQuestionOnColumnChanged(e, t, n); this.generatedTotalRow && this.generatedTotalRow.updateCellQuestionOnColumnChanged(e, t, n), this.onColumnsChanged(), "isRequired" == t && this.resetRenderedTable() } }, t.prototype.onColumnItemValuePropertyChanged = function (e, t, n, o, r, i) { if (this.generatedVisibleRows) for (var s = 0; s < this.generatedVisibleRows.length; s++)this.generatedVisibleRows[s].updateCellQuestionOnColumnItemValueChanged(e, t, n, o, r, i) }, t.prototype.onShowInMultipleColumnsChanged = function (e) { this.clearGeneratedRows(), this.resetRenderedTable() }, t.prototype.onColumnCellTypeChanged = function (e) { this.clearGeneratedRows(), this.resetRenderedTable() }, t.prototype.getRowTitleWidth = function () { return "" }, Object.defineProperty(t.prototype, "hasFooter", { get: function () { return this.getPropertyValue("hasFooter", !1) }, enumerable: !1, configurable: !0 }), t.prototype.getAddRowLocation = function () { return "default" }, t.prototype.getShowColumnsIfEmpty = function () { return !1 }, t.prototype.updateShowTableAndAddRow = function () { this.renderedTable && this.renderedTable.updateShowTableAndAddRow() }, t.prototype.updateHasFooter = function () { this.setPropertyValue("hasFooter", this.hasTotal) }, Object.defineProperty(t.prototype, "hasTotal", { get: function () { for (var e = 0; e < this.columns.length; e++)if (this.columns[e].hasTotal) return !0; return !1 }, enumerable: !1, configurable: !0 }), t.prototype.getCellType = function () { return this.cellType }, t.prototype.getCustomCellType = function (e, t, n) { if (!this.survey) return n; var o = { rowValue: t.value, row: t, column: e, columnName: e.name, cellType: n }; return this.survey.matrixCellCreating(this, o), o.cellType }, t.prototype.getConditionJson = function (t, n) { if (void 0 === t && (t = null), void 0 === n && (n = null), !n) return e.prototype.getConditionJson.call(this); for (var o = "", r = n.length - 1; r >= 0 && "." != n[r]; r--)o = n[r] + o; var i = this.getColumnByName(o); if (!i) return null; var s = i.createCellQuestion(null); return s ? s.getConditionJson(t) : null }, t.prototype.clearIncorrectValues = function () { var e = this.visibleRows; if (e) for (var t = 0; t < e.length; t++)e[t].clearIncorrectValues(this.getRowValue(t)) }, t.prototype.clearErrors = function () { e.prototype.clearErrors.call(this), this.runFuncForCellQuestions((function (e) { e.clearErrors() })) }, t.prototype.localeChanged = function () { e.prototype.localeChanged.call(this), this.runFuncForCellQuestions((function (e) { e.localeChanged() })) }, t.prototype.runFuncForCellQuestions = function (e) { if (this.generatedVisibleRows) for (var t = 0; t < this.generatedVisibleRows.length; t++)for (var n = this.generatedVisibleRows[t], o = 0; o < n.cells.length; o++)e(n.cells[o].question) }, t.prototype.runCondition = function (t, n) { e.prototype.runCondition.call(this, t, n); var o, i = 0; do { o = r.getUnbindValue(this.totalValue), this.runCellsCondition(t, n), this.runTotalsCondition(t, n), i++ } while (!r.isTwoValueEquals(o, this.totalValue) && i < 3) }, t.prototype.shouldRunColumnExpression = function () { return !1 }, t.prototype.runCellsCondition = function (e, t) { if (this.generatedVisibleRows) { for (var n = this.getRowConditionValues(e), o = this.generatedVisibleRows, r = 0; r < o.length; r++)o[r].runCondition(n, t); this.checkColumnsVisibility(), this.checkColumnsRenderedRequired() } }, t.prototype.checkColumnsVisibility = function () { for (var e = !1, t = 0; t < this.visibleColumns.length; t++)this.visibleColumns[t].visibleIf && (e = this.isColumnVisibilityChanged(this.visibleColumns[t]) || e); e && this.resetRenderedTable() }, t.prototype.checkColumnsRenderedRequired = function () { for (var e = this.generatedVisibleRows, t = 0; t < this.visibleColumns.length; t++) { var n = this.visibleColumns[t]; if (n.requiredIf) { for (var o = e.length > 0, r = 0; r < e.length; r++)if (!e[r].cells[t].question.isRequired) { o = !1; break } n.updateIsRenderedRequired(o) } } }, t.prototype.isColumnVisibilityChanged = function (e) { for (var t = e.hasVisibleCell, n = !1, o = this.generatedVisibleRows, r = 0; r < o.length; r++) { var i = o[r].cells[e.index]; if (i && i.question && i.question.isVisible) { n = !0; break } } return t != n && (e.hasVisibleCell = n), t != n }, t.prototype.runTotalsCondition = function (e, t) { this.generatedTotalRow && this.generatedTotalRow.runCondition(this.getRowConditionValues(e), t) }, t.prototype.getRowConditionValues = function (e) { var t = e; t || (t = {}); var n = {}; return this.isValueEmpty(this.totalValue) || (n = JSON.parse(JSON.stringify(this.totalValue))), t.row = {}, t.totalRow = n, t }, t.prototype.locStrsChanged = function () { e.prototype.locStrsChanged.call(this); for (var t = this.columns, n = 0; n < t.length; n++)t[n].locStrsChanged(); var o = this.generatedVisibleRows; if (o) { for (n = 0; n < o.length; n++)o[n].locStrsChanged(); this.generatedTotalRow && this.generatedTotalRow.locStrsChanged() } }, t.prototype.getColumnByName = function (e) { for (var t = 0; t < this.columns.length; t++)if (this.columns[t].name == e) return this.columns[t]; return null }, t.prototype.getColumnName = function (e) { return this.getColumnByName(e) }, t.prototype.getColumnWidth = function (e) { return e.minWidth ? e.minWidth : this.columnMinWidth }, Object.defineProperty(t.prototype, "choices", { get: function () { return this.getPropertyValue("choices") }, set: function (e) { this.setPropertyValue("choices", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "placeholder", { get: function () { return this.getLocalizableStringText("placeholder") }, set: function (e) { this.setLocalizableStringText("placeholder", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "locPlaceholder", { get: function () { return this.getLocalizableString("placeholder") }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "optionsCaption", { get: function () { return this.placeholder }, set: function (e) { this.placeholder = e }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "keyDuplicationError", { get: function () { return this.getLocalizableStringText("keyDuplicationError") }, set: function (e) { this.setLocalizableStringText("keyDuplicationError", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "locKeyDuplicationError", { get: function () { return this.getLocalizableString("keyDuplicationError") }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "storeOthersAsComment", { get: function () { return !!this.survey && this.survey.storeOthersAsComment }, enumerable: !1, configurable: !0 }), t.prototype.addColumn = function (e, t) { void 0 === t && (t = null); var n = new hn(e, t); return this.columns.push(n), n }, t.prototype.getVisibleRows = function () { var e = this; return this.isUpdateLocked ? null : (this.generatedVisibleRows || (this.generatedVisibleRows = this.generateRows(), this.generatedVisibleRows.forEach((function (t) { return e.onMatrixRowCreated(t) })), this.data && this.runCellsCondition(this.data.getFilteredValues(), this.data.getFilteredProperties()), this.updateValueOnRowsGeneration(this.generatedVisibleRows), this.updateIsAnswered()), this.generatedVisibleRows) }, t.prototype.updateValueOnRowsGeneration = function (e) { for (var t = this.createNewValue(!0), n = this.createNewValue(), o = 0; o < e.length; o++) { var r = e[o]; if (!r.editingObj) { var i = this.getRowValue(o), s = r.value; this.isTwoValueEquals(i, s) || (n = this.getNewValueOnRowChanged(r, "", s, !1, n).value) } } this.isTwoValueEquals(t, n) || (this.isRowChanging = !0, this.setNewValue(n), this.isRowChanging = !1) }, Object.defineProperty(t.prototype, "totalValue", { get: function () { return this.hasTotal && this.visibleTotalRow ? this.visibleTotalRow.value : {} }, enumerable: !1, configurable: !0 }), t.prototype.getVisibleTotalRow = function () { if (this.isUpdateLocked) return null; if (this.hasTotal) { if (!this.generatedTotalRow && (this.generatedTotalRow = this.generateTotalRow(), this.data)) { var e = { survey: this.survey }; this.runTotalsCondition(this.data.getAllValues(), e) } } else this.generatedTotalRow = null; return this.generatedTotalRow }, Object.defineProperty(t.prototype, "visibleTotalRow", { get: function () { return this.getVisibleTotalRow() }, enumerable: !1, configurable: !0 }), t.prototype.onSurveyLoad = function () { e.prototype.onSurveyLoad.call(this), this.updateColumnsIndexes(this.columns), this.clearGeneratedRows(), this.generatedTotalRow = null, this.updateHasFooter() }, t.prototype.getRowValue = function (e) { if (e < 0) return null; var t = this.visibleRows; if (e >= t.length) return null; var n = this.createNewValue(); return this.getRowValueCore(t[e], n) }, t.prototype.checkIfValueInRowDuplicated = function (e, t) { if (!this.generatedVisibleRows) return !1; for (var n = !1, o = 0; o < this.generatedVisibleRows.length; o++) { var i = this.generatedVisibleRows[o]; if (e !== i && r.isTwoValueEquals(i.getValue(t.name), t.value, !0, this.isUniqueCaseSensitive)) { n = !0; break } } return n ? this.addDuplicationError(t) : t.clearErrors(), n }, t.prototype.setRowValue = function (e, t) { if (e < 0) return null; var n = this.visibleRows; if (e >= n.length) return null; n[e].value = t, this.onRowChanged(n[e], "", t, !1) }, t.prototype.generateRows = function () { return null }, t.prototype.generateTotalRow = function () { return new Vn(this) }, t.prototype.createNewValue = function (e) { void 0 === e && (e = !1); var t = this.value ? this.createValueCopy() : {}; return e && this.isMatrixValueEmpty(t) ? null : t }, t.prototype.getRowValueCore = function (e, t, n) { void 0 === n && (n = !1); var o = t && t[e.rowName] ? t[e.rowName] : null; return !o && n && (o = {}, t && (t[e.rowName] = o)), o }, t.prototype.getRowObj = function (e) { var t = this.getRowValueCore(e, this.value); return t && t.getType ? t : null }, t.prototype.getRowDisplayValue = function (e, t, n) { if (!n) return n; if (t.editingObj) return n; for (var o = Object.keys(n), r = 0; r < o.length; r++) { var i = o[r], s = t.getQuestionByName(i); if (s || (s = this.getSharedQuestionByName(i, t)), s) { var a = s.getDisplayValue(e, n[i]); e && s.title && s.title !== i ? (n[s.title] = a, delete n[i]) : n[i] = a } } return n }, t.prototype.getPlainData = function (t) { var n = this; void 0 === t && (t = { includeEmpty: !0 }); var o = e.prototype.getPlainData.call(this, t); return o && (o.isNode = !0, o.data = this.visibleRows.map((function (e) { var o = { name: e.rowName, title: e.text, value: e.value, displayValue: n.getRowDisplayValue(!1, e, e.value), getString: function (e) { return "object" == typeof e ? JSON.stringify(e) : e }, isNode: !0, data: e.cells.map((function (e) { return e.question.getPlainData(t) })).filter((function (e) { return !!e })) }; return (t.calculations || []).forEach((function (t) { o[t.propertyName] = e[t.propertyName] })), o }))), o }, t.prototype.addConditionObjectsByContext = function (e, t) { var n = !!t && (!0 === t || this.columns.indexOf(t) > -1), o = this.getConditionObjectsRowIndeces(); n && o.push(-1); for (var r = 0; r < o.length; r++) { var i = o[r], s = i > -1 ? this.getConditionObjectRowName(i) : "row"; if (s) for (var a = i > -1 ? this.getConditionObjectRowText(i) : "row", l = i > -1 || !0 === t, u = l && -1 === i ? "." : "", c = (l ? this.getValueName() : "") + u + s + ".", p = (l ? this.processedTitle : "") + u + a + ".", h = 0; h < this.columns.length; h++) { var d = this.columns[h]; if (-1 !== i || t !== d) { var f = { name: c + d.name, text: p + d.fullTitle, question: this }; -1 === i && !0 === t && (f.context = this), e.push(f) } } } }, t.prototype.getConditionObjectRowName = function (e) { return "" }, t.prototype.getConditionObjectRowText = function (e) { return this.getConditionObjectRowName(e) }, t.prototype.getConditionObjectsRowIndeces = function () { return [] }, t.prototype.getProgressInfo = function () { if (this.generatedVisibleRows) return At.getProgressInfoByElements(this.getCellQuestions(), this.isRequired); var e = ce.createProgressInfo(); return this.updateProgressInfoByValues(e), 0 === e.requiredQuestionCount && this.isRequired && (e.requiredQuestionCount = 1, e.requiredAnsweredQuestionCount = this.isEmpty() ? 0 : 1), e }, t.prototype.updateProgressInfoByValues = function (e) { }, t.prototype.updateProgressInfoByRow = function (e, t) { for (var n = 0; n < this.columns.length; n++) { var o = this.columns[n]; if (o.templateQuestion.hasInput) { e.questionCount += 1, e.requiredQuestionCount += o.isRequired; var i = !r.isValueEmpty(t[o.name]); e.answeredQuestionCount += i ? 1 : 0, e.requiredAnsweredQuestionCount += i && o.isRequired ? 1 : 0 } } }, t.prototype.getCellQuestions = function () { var e = []; return this.runFuncForCellQuestions((function (t) { e.push(t) })), e }, t.prototype.onBeforeValueChanged = function (e) { }, t.prototype.onSetQuestionValue = function () { if (!this.isRowChanging && (this.onBeforeValueChanged(this.value), this.generatedVisibleRows && 0 != this.generatedVisibleRows.length)) { this.isRowChanging = !0; for (var e = this.createNewValue(), t = 0; t < this.generatedVisibleRows.length; t++) { var n = this.generatedVisibleRows[t]; this.generatedVisibleRows[t].value = this.getRowValueCore(n, e) } this.isRowChanging = !1 } }, t.prototype.setQuestionValue = function (t) { e.prototype.setQuestionValue.call(this, t, !1), this.onSetQuestionValue(), this.updateIsAnswered() }, t.prototype.supportGoNextPageAutomatic = function () { var e = this.generatedVisibleRows; if (e || (e = this.visibleRows), !e) return !0; for (var t = 0; t < e.length; t++) { var n = this.generatedVisibleRows[t].cells; if (n) for (var o = 0; o < n.length; o++) { var r = n[o].question; if (r && (!r.supportGoNextPageAutomatic() || !r.value)) return !1 } } return !0 }, t.prototype.getContainsErrors = function () { return e.prototype.getContainsErrors.call(this) || this.checkForAnswersOrErrors((function (e) { return e.containsErrors }), !1) }, t.prototype.getIsAnswered = function () { return e.prototype.getIsAnswered.call(this) && this.checkForAnswersOrErrors((function (e) { return e.isAnswered }), !0) }, t.prototype.checkForAnswersOrErrors = function (e, t) { void 0 === t && (t = !1); var n = this.generatedVisibleRows; if (!n) return !1; for (var o = 0; o < n.length; o++) { var r = n[o].cells; if (r) for (var i = 0; i < r.length; i++)if (r[i]) { var s = r[i].question; if (s && s.isVisible) if (e(s)) { if (!t) return !0 } else if (t) return !1 } } return !!t }, t.prototype.hasErrors = function (t, n) { void 0 === t && (t = !0), void 0 === n && (n = null); var o = this.hasErrorInRows(t, n), r = this.isValueDuplicated(); return e.prototype.hasErrors.call(this, t, n) || o || r }, t.prototype.getIsRunningValidators = function () { if (e.prototype.getIsRunningValidators.call(this)) return !0; if (!this.generatedVisibleRows) return !1; for (var t = 0; t < this.generatedVisibleRows.length; t++) { var n = this.generatedVisibleRows[t].cells; if (n) for (var o = 0; o < n.length; o++)if (n[o]) { var r = n[o].question; if (r && r.isRunningValidators) return !0 } } return !1 }, t.prototype.getAllErrors = function () { var t = e.prototype.getAllErrors.call(this), n = this.generatedVisibleRows; if (null === n) return t; for (var o = 0; o < n.length; o++)for (var r = n[o], i = 0; i < r.cells.length; i++) { var s = r.cells[i].question.getAllErrors(); s && s.length > 0 && (t = t.concat(s)) } return t }, t.prototype.hasErrorInRows = function (e, t) { var n = this, o = this.generatedVisibleRows; this.generatedVisibleRows || (o = this.visibleRows); var r = !1; if (t || (t = {}), !o) return t; t.isSingleDetailPanel = "underRowSingle" === this.detailPanelMode; for (var i = 0; i < o.length; i++)r = o[i].hasErrors(e, t, (function () { n.raiseOnCompletedAsyncValidators() })) || r; return r }, t.prototype.isValueDuplicated = function () { if (!this.generatedVisibleRows) return !1; for (var e = this.getUniqueColumns(), t = !1, n = 0; n < e.length; n++)t = this.isValueInColumnDuplicated(e[n]) || t; return t }, t.prototype.isValueInColumnDuplicated = function (e) { for (var t = [], n = !1, o = 0; o < this.generatedVisibleRows.length; o++)n = this.isValueDuplicatedInRow(this.generatedVisibleRows[o], e, t) || n; return n }, t.prototype.getUniqueColumns = function () { for (var e = new Array, t = 0; t < this.columns.length; t++)this.columns[t].isUnique && e.push(this.columns[t]); return e }, t.prototype.isValueDuplicatedInRow = function (e, t, n) { var o = e.getQuestionByColumn(t); if (!o || o.isEmpty()) return !1; for (var i = o.value, s = 0; s < n.length; s++)if (r.isTwoValueEquals(i, n[s], !0, this.isUniqueCaseSensitive)) return this.addDuplicationError(o), !0; return n.push(i), !1 }, t.prototype.addDuplicationError = function (e) { e.addError(new Te(this.keyDuplicationError, this)) }, t.prototype.getFirstQuestionToFocus = function (e) { return this.getFirstCellQuestion(e) }, t.prototype.getFirstInputElementId = function () { var t = this.getFirstCellQuestion(!1); return t ? t.inputId : e.prototype.getFirstInputElementId.call(this) }, t.prototype.getFirstErrorInputElementId = function () { var t = this.getFirstCellQuestion(!0); return t ? t.inputId : e.prototype.getFirstErrorInputElementId.call(this) }, t.prototype.getFirstCellQuestion = function (e) { if (!this.generatedVisibleRows) return null; for (var t = 0; t < this.generatedVisibleRows.length; t++)for (var n = this.generatedVisibleRows[t].cells, o = 0; o < n.length; o++) { if (!e) return n[o].question; if (n[o].question.currentErrorCount > 0) return n[o].question } return null }, t.prototype.onReadOnlyChanged = function () { if (e.prototype.onReadOnlyChanged.call(this), this.generateRows) for (var t = 0; t < this.visibleRows.length; t++)this.visibleRows[t].onQuestionReadOnlyChanged(this.isReadOnly) }, t.prototype.createQuestion = function (e, t) { return this.createQuestionCore(e, t) }, t.prototype.createQuestionCore = function (e, t) { var n = t.createCellQuestion(e); return n.setSurveyImpl(e), n.setParentQuestion(this), n }, t.prototype.deleteRowValue = function (e, t) { return e ? (delete e[t.rowName], this.isObject(e) && 0 == Object.keys(e).length ? null : e) : e }, t.prototype.onAnyValueChanged = function (e) { if (!this.isUpdateLocked && !this.isDoingonAnyValueChanged && this.generatedVisibleRows) { this.isDoingonAnyValueChanged = !0; for (var t = this.visibleRows, n = 0; n < t.length; n++)t[n].onAnyValueChanged(e); var o = this.visibleTotalRow; o && o.onAnyValueChanged(e), this.isDoingonAnyValueChanged = !1 } }, t.prototype.isObject = function (e) { return null !== e && "object" == typeof e }, t.prototype.getOnCellValueChangedOptions = function (e, t, n) { return { row: e, columnName: t, rowValue: n, value: n ? n[t] : null, getCellQuestion: function (t) { for (var n = 0; n < e.cells.length; n++) { var o = e.cells[n].column; if (o && o.name === t) return e.cells[n].question } return null } } }, t.prototype.onCellValueChanged = function (e, t, n) { if (this.survey) { var o = this.getOnCellValueChangedOptions(e, t, n); this.onCellValueChangedCallback && this.onCellValueChangedCallback(o), this.survey.matrixCellValueChanged(this, o) } }, t.prototype.validateCell = function (e, t, n) { if (this.survey) { var o = this.getOnCellValueChangedOptions(e, t, n); return this.survey.matrixCellValidate(this, o) } }, Object.defineProperty(t.prototype, "isValidateOnValueChanging", { get: function () { return !!this.survey && this.survey.isValidateOnValueChanging }, enumerable: !1, configurable: !0 }), t.prototype.onRowChanging = function (e, t, n) { if (!this.survey) return n ? n[t] : null; var o = this.getOnCellValueChangedOptions(e, t, n), r = this.getRowValueCore(e, this.createNewValue(), !0); return o.oldValue = r ? r[t] : null, this.survey.matrixCellValueChanging(this, o), o.value }, t.prototype.onRowChanged = function (e, t, n, o) { var r = t ? this.getRowObj(e) : null; if (r) { var i = null; n && !o && (i = n[t]), this.isRowChanging = !0, r[t] = i, this.isRowChanging = !1, this.onCellValueChanged(e, t, r) } else { var s = this.createNewValue(!0), a = this.getNewValueOnRowChanged(e, t, n, o, this.createNewValue()); if (this.isTwoValueEquals(s, a.value)) return; this.isRowChanging = !0, this.setNewValue(a.value), this.isRowChanging = !1, t && this.onCellValueChanged(e, t, a.rowValue) } }, t.prototype.getNewValueOnRowChanged = function (e, t, n, o, r) { var i = this.getRowValueCore(e, r, !0); o && delete i[t]; for (var s = 0; s < e.cells.length; s++) { delete i[a = e.cells[s].question.getValueName()] } if (n) for (var a in n = JSON.parse(JSON.stringify(n))) this.isValueEmpty(n[a]) || (i[a] = n[a]); return this.isObject(i) && 0 === Object.keys(i).length && (r = this.deleteRowValue(r, e)), { value: r, rowValue: i } }, t.prototype.getRowIndex = function (e) { return this.generatedVisibleRows ? this.visibleRows.indexOf(e) : -1 }, t.prototype.getElementsInDesign = function (t) { var n; return void 0 === t && (t = !1), n = "none" == this.detailPanelMode ? e.prototype.getElementsInDesign.call(this, t) : t ? [this.detailPanel] : this.detailElements, this.columns.concat(n) }, t.prototype.hasDetailPanel = function (e) { return "none" != this.detailPanelMode && (!!this.isDesignMode || (this.onHasDetailPanelCallback ? this.onHasDetailPanelCallback(e) : this.detailElements.length > 0)) }, t.prototype.getIsDetailPanelShowing = function (e) { if ("none" == this.detailPanelMode) return !1; if (this.isDesignMode) { var t = 0 == this.visibleRows.indexOf(e); return t && (e.detailPanel || e.showDetailPanel()), t } return this.getPropertyValue("isRowShowing" + e.id, !1) }, t.prototype.setIsDetailPanelShowing = function (e, t) { if (t != this.getIsDetailPanelShowing(e) && (this.setPropertyValue("isRowShowing" + e.id, t), this.updateDetailPanelButtonCss(e), this.renderedTable && this.renderedTable.onDetailPanelChangeVisibility(e, t), t && "underRowSingle" === this.detailPanelMode)) for (var n = this.visibleRows, o = 0; o < n.length; o++)n[o].id !== e.id && n[o].isDetailPanelShowing && n[o].hideDetailPanel() }, t.prototype.getDetailPanelButtonCss = function (e) { var t = (new at).append(this.getPropertyValue("detailButtonCss" + e.id)); return t.append(this.cssClasses.detailButton, "" === t.toString()).toString() }, t.prototype.getDetailPanelIconCss = function (e) { var t = (new at).append(this.getPropertyValue("detailIconCss" + e.id)); return t.append(this.cssClasses.detailIcon, "" === t.toString()).toString() }, t.prototype.getDetailPanelIconId = function (e) { return this.getIsDetailPanelShowing(e) ? this.cssClasses.detailIconExpandedId : this.cssClasses.detailIconId }, t.prototype.updateDetailPanelButtonCss = function (e) { var t = this.cssClasses, n = this.getIsDetailPanelShowing(e), o = (new at).append(t.detailIcon).append(t.detailIconExpanded, n); this.setPropertyValue("detailIconCss" + e.id, o.toString()); var r = (new at).append(t.detailButton).append(t.detailButtonExpanded, n); this.setPropertyValue("detailButtonCss" + e.id, r.toString()) }, t.prototype.createRowDetailPanel = function (e) { if (this.isDesignMode) return this.detailPanel; var t = this.createNewDetailPanel(); t.readOnly = this.isReadOnly; var n = this.detailPanel.toJSON(); return (new S).toObject(n, t), t.renderWidth = "100%", t.updateCustomWidgets(), this.onCreateDetailPanelCallback && this.onCreateDetailPanelCallback(e, t), t }, t.prototype.getSharedQuestionByName = function (e, t) { if (!this.survey || !this.valueName) return null; var n = this.getRowIndex(t); return n < 0 ? null : this.survey.getQuestionByValueNameFromArray(this.valueName, e, n) }, t.prototype.onTotalValueChanged = function () { this.data && this.visibleTotalRow && !this.isUpdateLocked && !this.isSett && this.data.setValue(this.getValueName() + o.matrixTotalValuePostFix, this.totalValue, !1) }, t.prototype.getParentTextProcessor = function () { if (!this.parentQuestion || !this.parent) return null; var e = this.parent.data; return e && e.getTextProcessor ? e.getTextProcessor() : null }, t.prototype.getQuestionFromArray = function (e, t) { return t >= this.visibleRows.length ? null : this.visibleRows[t].getQuestionByName(e) }, t.prototype.isMatrixValueEmpty = function (e) { if (e) { if (Array.isArray(e)) { for (var t = 0; t < e.length; t++)if (this.isObject(e[t]) && Object.keys(e[t]).length > 0) return !1; return !0 } return 0 == Object.keys(e).length } }, Object.defineProperty(t.prototype, "SurveyModel", { get: function () { return this.survey }, enumerable: !1, configurable: !0 }), t.prototype.getCellTemplateData = function (e) { return this.SurveyModel.getMatrixCellTemplateData(e) }, t.prototype.getCellWrapperComponentName = function (e) { return this.SurveyModel.getElementWrapperComponentName(e, "cell") }, t.prototype.getCellWrapperComponentData = function (e) { return this.SurveyModel.getElementWrapperComponentData(e, "cell") }, t.prototype.getColumnHeaderWrapperComponentName = function (e) { return this.SurveyModel.getElementWrapperComponentName(e, "column-header") }, t.prototype.getColumnHeaderWrapperComponentData = function (e) { return this.SurveyModel.getElementWrapperComponentData(e, "column-header") }, t.prototype.getRowHeaderWrapperComponentName = function (e) { return this.SurveyModel.getElementWrapperComponentName(e, "row-header") }, t.prototype.getRowHeaderWrapperComponentData = function (e) { return this.SurveyModel.getElementWrapperComponentData(e, "row-header") }, Object.defineProperty(t.prototype, "showHorizontalScroll", { get: function () { return !this.isDefaultV2Theme && this.horizontalScroll }, enumerable: !1, configurable: !0 }), t.prototype.getRootCss = function () { return (new at).append(e.prototype.getRootCss.call(this)).append(this.cssClasses.rootScroll, this.horizontalScroll).toString() }, t.prototype.getIsTooltipErrorInsideSupported = function () { return !0 }, t }(Zt); _.addClass("matrixdropdownbase", [{ name: "columns:matrixdropdowncolumns", className: "matrixdropdowncolumn" }, { name: "columnLayout", alternativeName: "columnsLocation", default: "horizontal", choices: ["horizontal", "vertical"] }, { name: "detailElements", visible: !1, isLightSerializable: !1 }, { name: "detailPanelMode", choices: ["none", "underRow", "underRowSingle"], default: "none" }, "horizontalScroll:boolean", { name: "choices:itemvalue[]", uniqueProperty: "value" }, { name: "placeholder", alternativeName: "optionsCaption", serializationProperty: "locPlaceholder" }, { name: "keyDuplicationError", serializationProperty: "locKeyDuplicationError" }, { name: "cellType", default: "dropdown", choices: function () { return hn.getColumnTypes() } }, { name: "columnColCount", default: 0, choices: [0, 1, 2, 3, 4] }, "columnMinWidth", { name: "allowAdaptiveActions:boolean", default: !1, visible: !1 }], (function () { return new xn("") }), "matrixbase"); var On = function () { var e = function (t, n) { return (e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (e, t) { e.__proto__ = t } || function (e, t) { for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]) })(t, n) }; return function (t, n) { if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null"); function o() { this.constructor = t } e(t, n), t.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o) } }(), Tn = function (e) { function t(t, n, o, r) { var i = e.call(this, o, r) || this; return i.name = t, i.item = n, i.buildCells(r), i } return On(t, e), Object.defineProperty(t.prototype, "rowName", { get: function () { return this.name }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "text", { get: function () { return this.item.text }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "locText", { get: function () { return this.item.locText }, enumerable: !1, configurable: !0 }), t }(wn), Sn = function (e) { function t(t) { var n = e.call(this, t) || this; return n.createLocalizableString("totalText", n, !0), n.registerPropertyChangedHandlers(["rows"], (function () { n.clearGeneratedRows(), n.resetRenderedTable(), n.filterItems() || n.onRowsChanged(), n.clearIncorrectValues() })), n.registerPropertyChangedHandlers(["hideIfRowsEmpty"], (function () { n.updateVisibilityBasedOnRows() })), n } return On(t, e), t.prototype.getType = function () { return "matrixdropdown" }, Object.defineProperty(t.prototype, "totalText", { get: function () { return this.getLocalizableStringText("totalText", "") }, set: function (e) { this.setLocalizableStringText("totalText", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "locTotalText", { get: function () { return this.getLocalizableString("totalText") }, enumerable: !1, configurable: !0 }), t.prototype.getFooterText = function () { return this.locTotalText }, t.prototype.getRowTitleWidth = function () { return this.rowTitleWidth }, Object.defineProperty(t.prototype, "hideIfRowsEmpty", { get: function () { return this.getPropertyValue("hideIfRowsEmpty", !1) }, set: function (e) { this.setPropertyValue("hideIfRowsEmpty", e) }, enumerable: !1, configurable: !0 }), t.prototype.getDisplayValueCore = function (e, t) { if (!t) return t; var n = this.visibleRows, o = {}; if (!n) return o; for (var r = 0; r < n.length; r++) { var i = n[r].rowName, s = t[i]; if (s) { if (e) { var a = qe.getTextOrHtmlByValue(this.rows, i); a && (i = a) } o[i] = this.getRowDisplayValue(e, n[r], s) } } return o }, t.prototype.getConditionObjectRowName = function (e) { return "." + this.rows[e].value }, t.prototype.getConditionObjectRowText = function (e) { return "." + this.rows[e].calculatedText }, t.prototype.getConditionObjectsRowIndeces = function () { for (var e = [], t = 0; t < this.rows.length; t++)e.push(t); return e }, t.prototype.setNewValue = function (t) { t && "object" != typeof t || e.prototype.setNewValue.call(this, t) }, t.prototype.clearIncorrectValues = function () { var t = this.value; if (t) { var n = null, o = !1, r = this.filteredRows ? this.filteredRows : this.rows; for (var i in t) qe.getItemByValue(r, i) ? (null == n && (n = {}), n[i] = t[i]) : o = !0; o && (this.value = n), e.prototype.clearIncorrectValues.call(this) } }, t.prototype.clearValueIfInvisibleCore = function () { e.prototype.clearValueIfInvisibleCore.call(this), this.clearInvisibleValuesInRows() }, t.prototype.generateRows = function () { var e = new Array, t = this.filteredRows ? this.filteredRows : this.rows; if (!t || 0 === t.length) return e; var n = this.value; n || (n = {}); for (var o = 0; o < t.length; o++)t[o].value && e.push(this.createMatrixRow(t[o], n[t[o].value])); return e }, t.prototype.createMatrixRow = function (e, t) { return new Tn(e.value, e, this, t) }, t.prototype.getSearchableItemValueKeys = function (e) { e.push("rows") }, t.prototype.updateProgressInfoByValues = function (e) { var t = this.value; t || (t = {}); for (var n = 0; n < this.rows.length; n++) { var o = t[this.rows[n].value]; this.updateProgressInfoByRow(e, o || {}) } }, t }(xn); _.addClass("matrixdropdown", [{ name: "rows:itemvalue[]", uniqueProperty: "value" }, "rowsVisibleIf:condition", "rowTitleWidth", { name: "totalText", serializationProperty: "locTotalText" }, "hideIfRowsEmpty:boolean"], (function () { return new Sn("") }), "matrixdropdownbase"), rn.Instance.registerQuestion("matrixdropdown", (function (e) { var t = new Sn(e); return t.choices = [1, 2, 3, 4, 5], t.rows = rn.DefaultRows, xn.addDefaultColumns(t), t })); var _n, In = !1, Rn = null; "undefined" != typeof navigator && "undefined" != typeof window && navigator && window && (Rn = navigator.userAgent || navigator.vendor || window.opera), (_n = Rn) && ("MacIntel" === navigator.platform && navigator.maxTouchPoints > 0 || "iPad" === navigator.platform || /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(_n) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(_n.substring(0, 4))) && (In = !0); var En = In || !1, Dn = !1; "undefined" != typeof window && (Dn = "ontouchstart" in window || navigator.maxTouchPoints > 0); var An = En && Dn; function Ln(e) { An = e } var jn = function () { var e = function (t, n) { return (e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (e, t) { e.__proto__ = t } || function (e, t) { for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]) })(t, n) }; return function (t, n) { if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null"); function o() { this.constructor = t } e(t, n), t.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o) } }(), Nn = function (e, t, n, o) { var r, i = arguments.length, s = i < 3 ? t : null === o ? o = Object.getOwnPropertyDescriptor(t, n) : o; if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) s = Reflect.decorate(e, t, n, o); else for (var a = e.length - 1; a >= 0; a--)(r = e[a]) && (s = (i < 3 ? r(s) : i > 3 ? r(t, n, s) : r(t, n)) || s); return i > 3 && s && Object.defineProperty(t, n, s), s }; "undefined" != typeof window && window.addEventListener("touchmove", (function (e) { Mn.PreventScrolling && e.preventDefault() }), { passive: !1 }); var Mn = function (e) { function t(n, o, r) { var i = e.call(this) || this; return i.surveyValue = n, i.creator = o, i.longTap = r, i.onGhostPositionChanged = new de, i.onBeforeDrop = new de, i.onAfterDrop = new de, i.draggedElement = null, i.dropTarget = null, i.prevDropTarget = null, i.draggedElementShortcut = null, i.scrollIntervalId = null, i.allowDropHere = !1, i.stopLongTapIfMoveEnough = function (e) { e.preventDefault(), i.currentX = e.pageX, i.currentY = e.pageY, i.isMicroMovement || (document.body.style.setProperty("touch-action", ""), document.body.style.setProperty("user-select", ""), document.body.style.setProperty("-webkit-user-select", ""), i.stopLongTap()) }, i.stopLongTap = function (e) { clearTimeout(i.timeoutID), i.timeoutID = null, document.removeEventListener("pointerup", i.stopLongTap), document.removeEventListener("pointermove", i.stopLongTapIfMoveEnough) }, i.onContextMenu = function (e) { e.preventDefault(), e.stopPropagation() }, i.dragOver = function (e) { i.moveShortcutElement(e), i.draggedElementShortcut.style.cursor = "grabbing"; var t = i.findDropTargetNodeFromPoint(e.clientX, e.clientY); if (t) { i.dropTarget = i.getDropTargetByNode(t, e); var n = i.isDropTargetValid(i.dropTarget, t); if (i.doDragOver(t, e), n) { var o = i.calculateIsBottom(e.clientY, t); i.allowDropHere = !0, i.isDropTargetDoesntChanged(o) || (i.isBottom = null, i.isBottom = o, i.afterDragOver(t, e), i.prevDropTarget = i.dropTarget) } else i.banDropHere() } else i.banDropHere() }, i.drop = function () { if (i.allowDropHere) { var e = i.draggedElement.parent; i.onBeforeDrop.fire(i, { fromElement: e, draggedElement: i.draggedElement }); var t = i.doDrop(); i.onAfterDrop.fire(i, { fromElement: e, draggedElement: t, toElement: i.dropTarget }) } i.clear() }, i.handlePointerCancel = function (e) { i.clear() }, i.handleEscapeButton = function (e) { 27 == e.keyCode && i.clear() }, i.banDropHere = function () { i.allowDropHere = !1, i.doBanDropHere(), i.dropTarget = null, i.draggedElementShortcut.style.cursor = "not-allowed", i.isBottom = null }, i.doBanDropHere = function () { }, i.clear = function () { cancelAnimationFrame(i.scrollIntervalId), document.removeEventListener("pointermove", i.dragOver), document.removeEventListener("pointercancel", i.handlePointerCancel), document.removeEventListener("keydown", i.handleEscapeButton), document.removeEventListener("pointerup", i.drop), i.draggedElementShortcut.removeEventListener("pointerup", i.drop), An && i.draggedElementShortcut.removeEventListener("contextmenu", i.onContextMenu), document.body.removeChild(i.draggedElementShortcut), i.doClear(), i.dropTarget = null, i.draggedElementShortcut = null, i.draggedElement = null, i.isBottom = null, i.parentElement = null, i.scrollIntervalId = null, An && (i.savedTargetNode && document.body.removeChild(i.savedTargetNode), t.PreventScrolling = !1), document.body.style.setProperty("touch-action", ""), document.body.style.setProperty("user-select", ""), document.body.style.setProperty("-webkit-user-select", "") }, i } return jn(t, e), t.prototype.ghostPositionChanged = function () { this.onGhostPositionChanged.fire({}, {}) }, Object.defineProperty(t.prototype, "dropTargetDataAttributeName", { get: function () { return "[data-sv-drop-target-" + this.draggedElementType + "]" }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "survey", { get: function () { return this.surveyValue || this.creator.survey }, enumerable: !1, configurable: !0 }), t.prototype.startDrag = function (e, t, n, o, r) { void 0 === r && (r = !1), An ? this.startLongTapProcessing(e, t, n, o, r) : this.doStartDrag(e, t, n, o) }, t.prototype.startLongTapProcessing = function (e, t, n, o, r) { var i = this; void 0 === r && (r = !1), this.startX = e.pageX, this.startY = e.pageY, document.body.style.setProperty("touch-action", "none", "important"), document.body.style.setProperty("user-select", "none", "important"), document.body.style.setProperty("-webkit-user-select", "none", "important"), this.timeoutID = setTimeout((function () { i.doStartDrag(e, t, n, o), r || (i.savedTargetNode = e.target, i.savedTargetNode.style.cssText = "\n position: absolute;\n height: 1px!important;\n width: 1px!important;\n overflow: hidden;\n clip: rect(1px 1px 1px 1px);\n clip: rect(1px, 1px, 1px, 1px);\n ", document.body.appendChild(i.savedTargetNode)), i.stopLongTap() }), this.longTap ? 500 : 0), document.addEventListener("pointerup", this.stopLongTap), document.addEventListener("pointermove", this.stopLongTapIfMoveEnough) }, Object.defineProperty(t.prototype, "isMicroMovement", { get: function () { var e = Math.abs(this.currentX - this.startX), t = Math.abs(this.currentY - this.startY); return e < 5 && t < 5 }, enumerable: !1, configurable: !0 }), t.prototype.doStartDrag = function (e, n, o, r) { if (An && (t.PreventScrolling = !0), 3 !== e.which) { this.draggedElement = n, this.parentElement = o, this.onStartDrag(); var i = this.getShortcutText(this.draggedElement); this.draggedElementShortcut = this.createDraggedElementShortcut(i, r, e), document.body.append(this.draggedElementShortcut), this.moveShortcutElement(e), document.addEventListener("pointermove", this.dragOver), document.addEventListener("pointercancel", this.handlePointerCancel), document.addEventListener("keydown", this.handleEscapeButton), document.addEventListener("pointerup", this.drop), An ? this.draggedElementShortcut.addEventListener("contextmenu", this.onContextMenu) : this.draggedElementShortcut.addEventListener("pointerup", this.drop) } }, t.prototype.isDropTargetDoesntChanged = function (e) { return this.dropTarget === this.prevDropTarget && e === this.isBottom }, t.prototype.onStartDrag = function () { }, t.prototype.getShortcutText = function (e) { return e.shortcutText }, t.prototype.createDraggedElementShortcut = function (e, t, n) { var o = document.createElement("div"); return o.innerText = e, o.className = this.getDraggedElementClass(), o }, t.prototype.getDraggedElementClass = function () { return "sv-dragged-element-shortcut" }, t.prototype.doDragOver = function (e, t) { }, t.prototype.afterDragOver = function (e, t) { }, t.prototype.getGhostPosition = function (e) { return this.dropTarget !== e ? null : this.isBottom ? "bottom" : "top" }, t.prototype.moveShortcutElement = function (e) { this.doScroll(e.clientY, e.clientX); var t = this.draggedElementShortcut.offsetHeight, n = this.draggedElementShortcut.offsetWidth, o = this.draggedElementShortcut.shortcutXOffset || n / 2, r = this.draggedElementShortcut.shortcutYOffset || t / 2; 0 !== document.querySelectorAll("[dir='rtl']").length && (o = n / 2, r = t / 2); var i = document.documentElement.clientHeight, s = document.documentElement.clientWidth, a = this.getShortcutBottomCoordinate(e.clientY, t, r); return this.getShortcutRightCoordinate(e.clientX, n, o) >= s ? (this.draggedElementShortcut.style.left = e.pageX - e.clientX + s - n + "px", void (this.draggedElementShortcut.style.top = e.pageY - r + "px")) : e.clientX - o <= 0 ? (this.draggedElementShortcut.style.left = e.pageX - e.clientX + "px", void (this.draggedElementShortcut.style.top = e.pageY - r + "px")) : a >= i ? (this.draggedElementShortcut.style.left = e.pageX - o + "px", void (this.draggedElementShortcut.style.top = e.pageY - e.clientY + i - t + "px")) : e.clientY - r <= 0 ? (this.draggedElementShortcut.style.left = e.pageX - o + "px", void (this.draggedElementShortcut.style.top = e.pageY - e.clientY + "px")) : (this.draggedElementShortcut.style.left = e.pageX - o + "px", void (this.draggedElementShortcut.style.top = e.pageY - r + "px")) }, t.prototype.getShortcutBottomCoordinate = function (e, t, n) { return e + t - n }, t.prototype.getShortcutRightCoordinate = function (e, t, n) { return e + t - n }, t.prototype.doScroll = function (e, t) { var n = this; cancelAnimationFrame(this.scrollIntervalId); this.draggedElementShortcut.hidden = !0; var o = document.elementFromPoint(t, e); this.draggedElementShortcut.hidden = !1; var r, i, s, a, l = ze(o); "HTML" === l.tagName ? (r = 0, i = document.documentElement.clientHeight, s = 0, a = document.documentElement.clientWidth) : (r = l.getBoundingClientRect().top, i = l.getBoundingClientRect().bottom, s = l.getBoundingClientRect().left, a = l.getBoundingClientRect().right); var u = function () { e - r <= 50 ? l.scrollTop -= 15 : i - e <= 50 ? l.scrollTop += 15 : a - t <= 50 ? l.scrollLeft += 15 : t - s <= 50 && (l.scrollLeft -= 15), n.scrollIntervalId = requestAnimationFrame(u) }; this.scrollIntervalId = requestAnimationFrame(u) }, t.prototype.getDataAttributeValueByNode = function (e) { var t = this, n = "svDropTarget"; return this.draggedElementType.split("-").forEach((function (e) { n += t.capitalizeFirstLetter(e) })), e.dataset[n] }, t.prototype.getDropTargetByNode = function (e, t) { var n = this.getDataAttributeValueByNode(e); return this.getDropTargetByDataAttributeValue(n, e, t) }, t.prototype.capitalizeFirstLetter = function (e) { return e.charAt(0).toUpperCase() + e.slice(1) }, t.prototype.calculateVerticalMiddleOfHTMLElement = function (e) { var t = e.getBoundingClientRect(); return t.y + t.height / 2 }, t.prototype.calculateHorizontalMiddleOfHTMLElement = function (e) { var t = e.getBoundingClientRect(); return t.x + t.width / 2 }, t.prototype.findDropTargetNodeFromPoint = function (e, t) { this.draggedElementShortcut.hidden = !0; var n = document.elementFromPoint(e, t); return this.draggedElementShortcut.hidden = !1, n ? this.findDropTargetNodeByDragOverNode(n) : null }, t.prototype.findDropTargetNodeByDragOverNode = function (e) { return e.querySelector(this.dropTargetDataAttributeName) || e.closest(this.dropTargetDataAttributeName) }, t.prototype.doClear = function () { }, t.PreventScrolling = !1, Nn([f({ defaultValue: null, onSet: function (e, t) { t.ghostPositionChanged() } })], t.prototype, "isBottom", void 0), t }(ce), Fn = function () { var e = function (t, n) { return (e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (e, t) { e.__proto__ = t } || function (e, t) { for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]) })(t, n) }; return function (t, n) { if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null"); function o() { this.constructor = t } e(t, n), t.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o) } }(), qn = function (e) { function t() { var t = null !== e && e.apply(this, arguments) || this; return t.fromIndex = null, t.toIndex = null, t.doDrop = function () { return t.parentElement.moveRowByIndex(t.fromIndex, t.toIndex), t.parentElement }, t } return Fn(t, e), Object.defineProperty(t.prototype, "draggedElementType", { get: function () { return "matrix-row" }, enumerable: !1, configurable: !0 }), t.prototype.createDraggedElementShortcut = function (e, t, n) { var o = this, r = document.createElement("div"); r.style.cssText = " \n cursor: grabbing;\n position: absolute;\n z-index: 1000;\n font-family: var(--font-family, $font-family);\n "; var i = t.closest("[data-sv-drop-target-matrix-row]"), s = i.cloneNode(!0); s.style.cssText = "\n box-shadow: rgb(0 0 0 / 10%) 0px 8px 16px;\n background-color: white;\n display: flex;\n flex-grow: 0;\n flex-shrink: 0;\n align-items: center;\n line-height: 0;\n width: " + i.offsetWidth + "px;\n ", s.classList.remove("sv-matrix__drag-drop--moveup"), s.classList.remove("sv-matrix__drag-drop--movedown"), this.draggedElement.isDragDropMoveDown = !1, this.draggedElement.isDragDropMoveUp = !1, r.appendChild(s); var a = t.getBoundingClientRect(); return r.shortcutXOffset = n.clientX - a.x, r.shortcutYOffset = n.clientY - a.y, this.parentElement.renderedTable.rows.forEach((function (e, t) { e.row === o.draggedElement && (e.isGhostRow = !0) })), this.fromIndex = this.parentElement.visibleRows.indexOf(this.draggedElement), r }, t.prototype.getDropTargetByDataAttributeValue = function (e) { return this.parentElement.renderedTable.rows.filter((function (t) { return t.row.id === e }))[0].row }, t.prototype.isDropTargetValid = function (e) { return !0 }, t.prototype.findDropTargetNodeByDragOverNode = function (e) { return e.closest(this.dropTargetDataAttributeName) }, t.prototype.calculateIsBottom = function (e) { var t = this.parentElement.renderedTable.rows.map((function (e) { return e.row })); return t.indexOf(this.dropTarget) - t.indexOf(this.draggedElement) > 0 }, t.prototype.afterDragOver = function (t) { var n = this; if (!this.isDropTargetDoesntChanged(this.isBottom) && this.dropTarget !== this.draggedElement) { var o, r, i, s = this.parentElement.renderedTable.rows; s.forEach((function (e, t) { e.row === n.dropTarget && (o = t), e.row === n.draggedElement && (r = t, (i = e).isGhostRow = !0) })), s.splice(r, 1), s.splice(o, 0, i), this.toIndex = o, e.prototype.ghostPositionChanged.call(this) } }, t.prototype.doClear = function () { this.parentElement.resetRenderedTable(), this.fromIndex = null, this.toIndex = null }, t }(Mn), kn = function () { function e(e) { var t = this; this.dragHandler = e, this.onPointerUp = function (e) { t.clearListeners() }, this.tryToStartDrag = function (e) { if (t.currentX = e.pageX, t.currentY = e.pageY, !t.isMicroMovement) return t.clearListeners(), t.dragHandler(t.pointerDownEvent, t.currentTarget, t.itemModel), !0 } } return e.prototype.onPointerDown = function (e, t) { An ? this.dragHandler(e, e.currentTarget, t) : (this.pointerDownEvent = e, this.currentTarget = e.currentTarget, this.startX = e.pageX, this.startY = e.pageY, document.addEventListener("pointermove", this.tryToStartDrag), this.currentTarget.addEventListener("pointerup", this.onPointerUp), this.itemModel = t) }, Object.defineProperty(e.prototype, "isMicroMovement", { get: function () { var e = Math.abs(this.currentX - this.startX), t = Math.abs(this.currentY - this.startY); return e < 10 && t < 10 }, enumerable: !1, configurable: !0 }), e.prototype.clearListeners = function () { this.pointerDownEvent && (document.removeEventListener("pointermove", this.tryToStartDrag), this.currentTarget.removeEventListener("pointerup", this.onPointerUp)) }, e }(), Bn = function () { var e = function (t, n) { return (e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (e, t) { e.__proto__ = t } || function (e, t) { for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]) })(t, n) }; return function (t, n) { if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null"); function o() { this.constructor = t } e(t, n), t.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o) } }(), Qn = function (e) { function t(t, n, o) { var r = e.call(this, n, o) || this; return r.index = t, r.buildCells(o), r } return Bn(t, e), Object.defineProperty(t.prototype, "rowName", { get: function () { return this.id }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "shortcutText", { get: function () { var e = this.data.visibleRows.indexOf(this) + 1, t = this.cells.length > 1 ? this.cells[1].questionValue : void 0, n = this.cells.length > 0 ? this.cells[0].questionValue : void 0; return t && t.value || n && n.value || "" + e }, enumerable: !1, configurable: !0 }), t }(wn), Hn = function (e) { function t(t) { var n = e.call(this, t) || this; return n.rowCounter = 0, n.initialRowCount = 2, n.setRowCountValueFromData = !1, n.startDragMatrixRow = function (e, t) { n.dragDropMatrixRows.startDrag(e, n.draggedRow, n, e.target) }, n.moveRowByIndex = function (e, t) { var o = n.createNewValue(); if (o) { var r = o[e]; r && (o.splice(e, 1), o.splice(t, 0, r), n.value = o) } }, n.createLocalizableString("confirmDeleteText", n, !1, "confirmDelete"), n.createLocalizableString("addRowText", n).onGetTextCallback = function (e) { return e || n.defaultAddRowText }, n.createLocalizableString("removeRowText", n, !1, "removeRow"), n.createLocalizableString("emptyRowsText", n, !1, !0), n.registerPropertyChangedHandlers(["hideColumnsIfEmpty", "allowAddRows"], (function () { n.updateShowTableAndAddRow() })), n.registerPropertyChangedHandlers(["allowRowsDragAndDrop"], (function () { n.clearRowsAndResetRenderedTable() })), n.dragOrClickHelper = new kn(n.startDragMatrixRow), n } return Bn(t, e), t.prototype.setSurveyImpl = function (t, n) { e.prototype.setSurveyImpl.call(this, t, n), this.dragDropMatrixRows = new qn(this.survey, null, !0) }, t.prototype.isBanStartDrag = function (e) { var t = e.target; return "true" === t.getAttribute("contenteditable") || "INPUT" === t.nodeName }, t.prototype.onPointerDown = function (e, t) { t && this.allowRowsDragAndDrop && (this.isBanStartDrag(e) || t.isDetailPanelShowing || (this.draggedRow = t, this.dragOrClickHelper.onPointerDown(e))) }, t.prototype.getType = function () { return "matrixdynamic" }, Object.defineProperty(t.prototype, "isRowsDynamic", { get: function () { return !0 }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "confirmDelete", { get: function () { return this.getPropertyValue("confirmDelete", !1) }, set: function (e) { this.setPropertyValue("confirmDelete", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "keyName", { get: function () { return this.getPropertyValue("keyName", "") }, set: function (e) { this.setPropertyValue("keyName", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "defaultRowValue", { get: function () { return this.getPropertyValue("defaultRowValue") }, set: function (e) { this.setPropertyValue("defaultRowValue", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "defaultValueFromLastRow", { get: function () { return this.getPropertyValue("defaultValueFromLastRow", !1) }, set: function (e) { this.setPropertyValue("defaultValueFromLastRow", e) }, enumerable: !1, configurable: !0 }), t.prototype.isDefaultValueEmpty = function () { return e.prototype.isDefaultValueEmpty.call(this) && this.isValueEmpty(this.defaultRowValue) }, t.prototype.valueFromData = function (t) { if (this.minRowCount < 1) return e.prototype.valueFromData.call(this, t); Array.isArray(t) || (t = []); for (var n = t.length; n < this.minRowCount; n++)t.push({}); return t }, t.prototype.setDefaultValue = function () { if (!this.isValueEmpty(this.defaultRowValue) && this.isValueEmpty(this.defaultValue)) { if (this.isEmpty() && 0 != this.rowCount) { for (var t = [], n = 0; n < this.rowCount; n++)t.push(this.defaultRowValue); this.value = t } } else e.prototype.setDefaultValue.call(this) }, Object.defineProperty(t.prototype, "rowCount", { get: function () { return this.rowCountValue }, set: function (e) { if (!(e < 0 || e > o.matrixMaximumRowCount)) { this.setRowCountValueFromData = !1; var t = this.rowCountValue; if (this.rowCountValue = e, this.value && this.value.length > e) { var n = this.value; n.splice(e), this.value = n } if (this.isUpdateLocked) this.initialRowCount = e; else { if (this.generatedVisibleRows || 0 == t) { this.generatedVisibleRows || (this.generatedVisibleRows = []), this.generatedVisibleRows.splice(e); for (var r = t; r < e; r++) { var i = this.createMatrixRow(this.getValueForNewRow()); this.generatedVisibleRows.push(i), this.onMatrixRowCreated(i) } this.runCondition(this.getDataFilteredValues(), this.getDataFilteredProperties()) } this.onRowsChanged() } } }, enumerable: !1, configurable: !0 }), t.prototype.updateProgressInfoByValues = function (e) { var t = this.value; Array.isArray(t) || (t = []); for (var n = 0; n < this.rowCount; n++) { var o = n < t.length ? t[n] : {}; this.updateProgressInfoByRow(e, o) } }, t.prototype.getValueForNewRow = function () { var e = null; return this.onGetValueForNewRowCallBack && (e = this.onGetValueForNewRowCallBack(this)), e }, Object.defineProperty(t.prototype, "allowRowsDragAndDrop", { get: function () { return !this.readOnly && this.getPropertyValue("allowRowsDragAndDrop") }, set: function (e) { this.setPropertyValue("allowRowsDragAndDrop", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "iconDragElement", { get: function () { return this.cssClasses.iconDragElement }, enumerable: !1, configurable: !0 }), t.prototype.createRenderedTable = function () { return new zn(this) }, Object.defineProperty(t.prototype, "rowCountValue", { get: function () { return this.getPropertyValue("rowCount") }, set: function (e) { this.setPropertyValue("rowCount", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "minRowCount", { get: function () { return this.getPropertyValue("minRowCount") }, set: function (e) { e < 0 && (e = 0), this.setPropertyValue("minRowCount", e), e > this.maxRowCount && (this.maxRowCount = e), this.rowCount < e && (this.rowCount = e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "maxRowCount", { get: function () { return this.getPropertyValue("maxRowCount") }, set: function (e) { e <= 0 || (e > o.matrixMaximumRowCount && (e = o.matrixMaximumRowCount), e != this.maxRowCount && (this.setPropertyValue("maxRowCount", e), e < this.minRowCount && (this.minRowCount = e), this.rowCount > e && (this.rowCount = e))) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "allowAddRows", { get: function () { return this.getPropertyValue("allowAddRows") }, set: function (e) { this.setPropertyValue("allowAddRows", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "allowRemoveRows", { get: function () { return this.getPropertyValue("allowRemoveRows") }, set: function (e) { this.setPropertyValue("allowRemoveRows", e), this.isUpdateLocked || this.resetRenderedTable() }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "canAddRow", { get: function () { return this.allowAddRows && !this.isReadOnly && this.rowCount < this.maxRowCount }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "canRemoveRows", { get: function () { var e = this.allowRemoveRows && !this.isReadOnly && this.rowCount > this.minRowCount; return this.canRemoveRowsCallback ? this.canRemoveRowsCallback(e) : e }, enumerable: !1, configurable: !0 }), t.prototype.canRemoveRow = function (e) { return !this.survey || this.survey.matrixAllowRemoveRow(this, e.index, e) }, t.prototype.addRowUI = function () { this.addRow(!0) }, t.prototype.getQuestionToFocusOnAddingRow = function () { for (var e = this.visibleRows[this.visibleRows.length - 1], t = 0; t < e.cells.length; t++) { var n = e.cells[t].question; if (n && n.isVisible && !n.isReadOnly) return n } return null }, t.prototype.addRow = function (e) { var t = this.rowCount, n = { question: this, canAddRow: this.canAddRow }; if (this.survey && this.survey.matrixBeforeRowAdded(n), n.canAddRow && (this.onStartRowAddingRemoving(), this.addRowCore(), this.onEndRowAdding(), this.detailPanelShowOnAdding && this.visibleRows.length > 0 && this.visibleRows[this.visibleRows.length - 1].showDetailPanel(), e && t !== this.rowCount)) { var o = this.getQuestionToFocusOnAddingRow(); o && o.focus() } }, Object.defineProperty(t.prototype, "detailPanelShowOnAdding", { get: function () { return this.getPropertyValue("detailPanelShowOnAdding") }, set: function (e) { this.setPropertyValue("detailPanelShowOnAdding", e) }, enumerable: !1, configurable: !0 }), t.prototype.hasRowsAsItems = function () { return !1 }, t.prototype.unbindValue = function () { this.clearGeneratedRows(), this.clearPropertyValue("value"), this.rowCountValue = 0, e.prototype.unbindValue.call(this) }, t.prototype.isValueSurveyElement = function (t) { return this.isEditingSurveyElement || e.prototype.isValueSurveyElement.call(this, t) }, t.prototype.addRowCore = function () { var e = this.rowCount; this.rowCount = this.rowCount + 1; var t = this.getDefaultRowValue(!0), n = null; if (this.isValueEmpty(t) || (n = this.createNewValue()).length == this.rowCount && (n[n.length - 1] = t, this.value = n), this.data && (this.runCellsCondition(this.getDataFilteredValues(), this.getDataFilteredProperties()), this.isValueEmpty(t))) { var o = this.visibleRows[this.rowCount - 1]; this.isValueEmpty(o.value) || (n || (n = this.createNewValue()), this.isValueSurveyElement(n) || this.isTwoValueEquals(n[n.length - 1], o.value) || (n[n.length - 1] = o.value, this.value = n)) } this.survey && e + 1 == this.rowCount && (this.survey.matrixRowAdded(this, this.visibleRows[this.visibleRows.length - 1]), this.onRowsChanged()) }, t.prototype.getDefaultRowValue = function (e) { for (var t = null, n = 0; n < this.columns.length; n++) { var o = this.columns[n].templateQuestion; o && !this.isValueEmpty(o.getDefaultValue()) && ((t = t || {})[this.columns[n].name] = o.getDefaultValue()) } if (!this.isValueEmpty(this.defaultRowValue)) for (var r in this.defaultRowValue) (t = t || {})[r] = this.defaultRowValue[r]; if (e && this.defaultValueFromLastRow) { var i = this.value; if (i && Array.isArray(i) && i.length >= this.rowCount - 1) { var s = i[this.rowCount - 2]; for (var r in s) (t = t || {})[r] = s[r] } } return t }, t.prototype.removeRowUI = function (e) { if (e && e.rowName) { var t = this.visibleRows.indexOf(e); if (t < 0) return; e = t } this.removeRow(e) }, t.prototype.isRequireConfirmOnRowDelete = function (e) { if (!this.confirmDelete) return !1; if (e < 0 || e >= this.rowCount) return !1; var t = this.createNewValue(); return !(this.isValueEmpty(t) || !Array.isArray(t)) && (!(e >= t.length) && !this.isValueEmpty(t[e])) }, t.prototype.removeRow = function (e, t) { if (this.canRemoveRows && !(e < 0 || e >= this.rowCount)) { var n = this.visibleRows && e < this.visibleRows.length ? this.visibleRows[e] : null; void 0 === t && (t = this.isRequireConfirmOnRowDelete(e)), t && !Be(this.confirmDeleteText) || n && this.survey && !this.survey.matrixRowRemoving(this, e, n) || (this.onStartRowAddingRemoving(), this.removeRowCore(e), this.onEndRowRemoving(n)) } }, t.prototype.removeRowCore = function (e) { var t = this.generatedVisibleRows ? this.generatedVisibleRows[e] : null; if (this.generatedVisibleRows && e < this.generatedVisibleRows.length && this.generatedVisibleRows.splice(e, 1), this.rowCountValue--, this.value) { var n = []; (n = Array.isArray(this.value) && e < this.value.length ? this.createValueCopy() : this.createNewValue()).splice(e, 1), n = this.deleteRowValue(n, null), this.isRowChanging = !0, this.value = n, this.isRowChanging = !1 } this.onRowsChanged(), this.survey && this.survey.matrixRowRemoved(this, e, t) }, Object.defineProperty(t.prototype, "confirmDeleteText", { get: function () { return this.getLocalizableStringText("confirmDeleteText") }, set: function (e) { this.setLocalizableStringText("confirmDeleteText", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "locConfirmDeleteText", { get: function () { return this.getLocalizableString("confirmDeleteText") }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "addRowText", { get: function () { return this.getLocalizableStringText("addRowText", this.defaultAddRowText) }, set: function (e) { this.setLocalizableStringText("addRowText", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "locAddRowText", { get: function () { return this.getLocalizableString("addRowText") }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "defaultAddRowText", { get: function () { return this.getLocalizationString(this.isColumnLayoutHorizontal ? "addRow" : "addColumn") }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "addRowLocation", { get: function () { return this.getPropertyValue("addRowLocation") }, set: function (e) { this.setPropertyValue("addRowLocation", e) }, enumerable: !1, configurable: !0 }), t.prototype.getAddRowLocation = function () { return this.addRowLocation }, Object.defineProperty(t.prototype, "hideColumnsIfEmpty", { get: function () { return this.getPropertyValue("hideColumnsIfEmpty") }, set: function (e) { this.setPropertyValue("hideColumnsIfEmpty", e) }, enumerable: !1, configurable: !0 }), t.prototype.getShowColumnsIfEmpty = function () { return this.hideColumnsIfEmpty }, Object.defineProperty(t.prototype, "removeRowText", { get: function () { return this.getLocalizableStringText("removeRowText") }, set: function (e) { this.setLocalizableStringText("removeRowText", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "locRemoveRowText", { get: function () { return this.getLocalizableString("removeRowText") }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "emptyRowsText", { get: function () { return this.getLocalizableStringText("emptyRowsText") }, set: function (e) { this.setLocalizableStringText("emptyRowsText", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "locEmptyRowsText", { get: function () { return this.getLocalizableString("emptyRowsText") }, enumerable: !1, configurable: !0 }), t.prototype.getDisplayValueCore = function (e, t) { if (!t || !Array.isArray(t)) return t; for (var n = this.getUnbindValue(t), o = this.visibleRows, r = 0; r < o.length && r < n.length; r++) { var i = n[r]; i && (n[r] = this.getRowDisplayValue(e, o[r], i)) } return n }, t.prototype.getConditionObjectRowName = function (e) { return "[" + e.toString() + "]" }, t.prototype.getConditionObjectsRowIndeces = function () { for (var e = [], t = Math.max(this.rowCount, 1), n = 0; n < Math.min(o.matrixMaxRowCountInCondition, t); n++)e.push(n); return e }, t.prototype.supportGoNextPageAutomatic = function () { return !1 }, Object.defineProperty(t.prototype, "hasRowText", { get: function () { return !1 }, enumerable: !1, configurable: !0 }), t.prototype.onCheckForErrors = function (t, n) { e.prototype.onCheckForErrors.call(this, t, n), !n && this.hasErrorInMinRows() && t.push(new Oe(this.minRowCount, this)) }, t.prototype.hasErrorInMinRows = function () { if (this.minRowCount <= 0 || !this.isRequired || !this.generatedVisibleRows) return !1; for (var e = 0, t = 0; t < this.generatedVisibleRows.length; t++) { this.generatedVisibleRows[t].isEmpty || e++ } return e < this.minRowCount }, t.prototype.getUniqueColumns = function () { var t = e.prototype.getUniqueColumns.call(this); if (this.keyName) { var n = this.getColumnByName(this.keyName); n && t.indexOf(n) < 0 && t.push(n) } return t }, t.prototype.generateRows = function () { var e = new Array; if (0 === this.rowCount) return e; for (var t = this.createNewValue(), n = 0; n < this.rowCount; n++)e.push(this.createMatrixRow(this.getRowValueByIndex(t, n))); return this.isValueEmpty(this.getDefaultRowValue(!1)) || (this.value = t), e }, t.prototype.createMatrixRow = function (e) { return new Qn(this.rowCounter++, this, e) }, t.prototype.onBeforeValueChanged = function (e) { if (e && Array.isArray(e)) { var t = e.length; if (t != this.rowCount && (this.setRowCountValueFromData || !(t < this.initialRowCount)) && (this.setRowCountValueFromData = !0, this.rowCountValue = t, this.generatedVisibleRows)) { if (t == this.generatedVisibleRows.length + 1) { this.onStartRowAddingRemoving(); var n = this.getRowValueByIndex(e, t - 1), o = this.createMatrixRow(n); this.generatedVisibleRows.push(o), this.onMatrixRowCreated(o), this.onEndRowAdding() } else this.clearGeneratedRows(), this.generatedVisibleRows = this.visibleRows, this.onRowsChanged(); this.setRowCountValueFromData = !1 } } }, t.prototype.createNewValue = function () { var e = this.createValueCopy(); e && Array.isArray(e) || (e = []), e.length > this.rowCount && e.splice(this.rowCount); var t = this.getDefaultRowValue(!1); t = t || {}; for (var n = e.length; n < this.rowCount; n++)e.push(this.getUnbindValue(t)); return e }, t.prototype.deleteRowValue = function (e, t) { for (var n = !0, o = 0; o < e.length; o++)if (this.isObject(e[o]) && Object.keys(e[o]).length > 0) { n = !1; break } return n ? null : e }, t.prototype.getRowValueByIndex = function (e, t) { return Array.isArray(e) && t >= 0 && t < e.length ? e[t] : null }, t.prototype.getRowValueCore = function (e, t, n) { if (void 0 === n && (n = !1), !this.generatedVisibleRows) return {}; var o = this.getRowValueByIndex(t, this.generatedVisibleRows.indexOf(e)); return !o && n && (o = {}), o }, t.prototype.getAddRowButtonCss = function (e) { return void 0 === e && (e = !1), (new at).append(this.cssClasses.button).append(this.cssClasses.buttonAdd).append(this.cssClasses.emptyRowsButton, e).toString() }, t.prototype.getRemoveRowButtonCss = function () { return (new at).append(this.cssClasses.button).append(this.cssClasses.buttonRemove).toString() }, t.prototype.getRootCss = function () { var t; return (new at).append(e.prototype.getRootCss.call(this)).append(this.cssClasses.empty, !(null === (t = this.renderedTable) || void 0 === t ? void 0 : t.showTable)).toString() }, t }(xn), zn = function (e) { function t() { return null !== e && e.apply(this, arguments) || this } return Bn(t, e), t.prototype.setDefaultRowActions = function (t, n) { e.prototype.setDefaultRowActions.call(this, t, n) }, t }(mn); _.addClass("matrixdynamic", [{ name: "rowsVisibleIf:condition", visible: !1 }, { name: "allowAddRows:boolean", default: !0 }, { name: "allowRemoveRows:boolean", default: !0 }, { name: "rowCount:number", default: 2, minValue: 0, isBindable: !0 }, { name: "minRowCount:number", default: 0, minValue: 0 }, { name: "maxRowCount:number", default: o.matrixMaximumRowCount }, { name: "keyName" }, "defaultRowValue:rowvalue", "defaultValueFromLastRow:boolean", { name: "confirmDelete:boolean" }, { name: "confirmDeleteText", dependsOn: "confirmDelete", visibleIf: function (e) { return !e || e.confirmDelete }, serializationProperty: "locConfirmDeleteText" }, { name: "addRowLocation", default: "default", choices: ["default", "top", "bottom", "topBottom"] }, { name: "addRowText", serializationProperty: "locAddRowText" }, { name: "removeRowText", serializationProperty: "locRemoveRowText" }, "hideColumnsIfEmpty:boolean", { name: "emptyRowsText:text", serializationProperty: "locEmptyRowsText", dependsOn: "hideColumnsIfEmpty", visibleIf: function (e) { return !e || e.hideColumnsIfEmpty } }, { name: "detailPanelShowOnAdding:boolean", dependsOn: "detailPanelMode", visibleIf: function (e) { return "none" !== e.detailPanelMode } }, "allowRowsDragAndDrop:switch"], (function () { return new Hn("") }), "matrixdropdownbase"), rn.Instance.registerQuestion("matrixdynamic", (function (e) { var t = new Hn(e); return t.choices = [1, 2, 3, 4, 5], xn.addDefaultColumns(t), t })); var Un = { currentType: "", getCss: function () { var e = this.currentType ? this[this.currentType] : Wn; return e || (e = Wn), e }, getAvailableThemes: function () { return Object.keys(this).filter((function (e) { return -1 === ["currentType", "getCss", "getAvailableThemes"].indexOf(e) })) } }, Wn = { root: "sd-root-modern", rootMobile: "sd-root-modern--mobile", rootReadOnly: "sd-root--readonly", container: "sd-container-modern", header: "sd-title sd-container-modern__title", body: "sd-body", bodyWithTimer: "sd-body--with-timer", clockTimerRoot: "sd-timer", clockTimerRootTop: "sd-timer--top", clockTimerRootBottom: "sd-timer--bottom", clockTimerProgress: "sd-timer__progress", clockTimerProgressAnimation: "sd-timer__progress--animation", clockTimerTextContainer: "sd-timer__text-container", clockTimerMinorText: "sd-timer__text--minor", clockTimerMajorText: "sd-timer__text--major", bodyEmpty: "sd-body sd-body--empty", footer: "sd-footer sd-body__navigation sd-clearfix", title: "sd-title", description: "sd-description", logo: "sd-logo", logoImage: "sd-logo__image", headerText: "sd-header__text", headerClose: "sd-hidden", navigationButton: "", bodyNavigationButton: "sd-btn", completedPage: "sd-completedpage", timerRoot: "sd-body__timer", navigation: { complete: "sd-btn--action sd-navigation__complete-btn", prev: "sd-navigation__prev-btn", next: "sd-navigation__next-btn", start: "sd-navigation__start-btn", preview: "sd-navigation__preview-btn", edit: "" }, panel: { number: "sd-element__num", title: "sd-title sd-element__title sd-panel__title", titleExpandable: "sd-element__title--expandable", titleExpanded: "sd-element__title--expanded", titleCollapsed: "sd-element__title--collapsed", titleDisabled: "sd-element__title--disabled", titleOnExpand: "sd-panel__title--expanded", titleOnError: "sd-panel__title--error", titleBar: "sd-action-title-bar", description: "sd-description sd-panel__description", container: "sd-element sd-element--complex sd-panel sd-row__panel", withFrame: "sd-element--with-frame", content: "sd-panel__content", icon: "sd-panel__icon", iconExpanded: "sd-panel__icon--expanded", footer: "sd-panel__footer", requiredText: "sd-panel__required-text", header: "sd-panel__header sd-element__header sd-element__header--location-top", collapsed: "sd-element--collapsed", expanded: "sd-element--expanded", nested: "sd-element--nested", invisible: "sd-element--invisible", navigationButton: "" }, paneldynamic: { mainRoot: "sd-element sd-question sd-question--paneldynamic sd-element--complex sd-question--complex sd-row__question", empty: "sd-question--empty", root: "sd-paneldynamic", navigation: "sd-paneldynamic__navigation", title: "sd-title sd-element__title sd-question__title", button: "sd-action sd-paneldynamic__btn", buttonRemove: "sd-action--negative sd-paneldynamic__remove-btn", buttonAdd: "sd-paneldynamic__add-btn", buttonPrev: "sd-paneldynamic__prev-btn sd-action--icon sd-action", buttonPrevDisabled: "sd-action--disabled", buttonNextDisabled: "sd-action--disabled", buttonNext: "sd-paneldynamic__next-btn sd-action--icon sd-action", progressContainer: "sd-paneldynamic__progress-container", progress: "sd-progress", progressBar: "sd-progress__bar", progressText: "sd-paneldynamic__progress-text", separator: "sd-paneldynamic__separator", panelWrapper: "sd-paneldynamic__panel-wrapper", footer: "sd-paneldynamic__footer", panelFooter: "sd-paneldynamic__panel-footer", footerButtonsContainer: "sd-paneldynamic__buttons-container", panelWrapperInRow: "sd-paneldynamic__panel-wrapper--in-row", progressBtnIcon: "icon-progressbuttonv2", noEntriesPlaceholder: "sd-paneldynamic__placeholder sd-question__placeholder" }, progress: "sd-progress sd-body__progress", progressTop: "sd-body__progress--top", progressBottom: "sd-body__progress--bottom", progressBar: "sd-progress__bar", progressText: "sd-progress__text", progressButtonsContainerCenter: "sd-progress-buttons__container-center", progressButtonsContainer: "sd-progress-buttons__container", progressButtonsImageButtonLeft: "sd-progress-buttons__image-button-left", progressButtonsImageButtonRight: "sd-progress-buttons__image-button-right", progressButtonsImageButtonHidden: "sd-progress-buttons__image-button--hidden", progressButtonsListContainer: "sd-progress-buttons__list-container", progressButtonsList: "sd-progress-buttons__list", progressButtonsListElementPassed: "sd-progress-buttons__list-element--passed", progressButtonsListElementCurrent: "sd-progress-buttons__list-element--current", progressButtonsListElementNonClickable: "sd-progress-buttons__list-element--nonclickable", progressButtonsPageTitle: "sd-progress-buttons__page-title", progressButtonsPageDescription: "sd-progress-buttons__page-description", progressTextInBar: "sd-hidden", page: { root: "sd-page sd-body__page", emptyHeaderRoot: "sd-page__empty-header", title: "sd-title sd-page__title", description: "sd-description sd-page__description" }, pageTitle: "sd-title sd-page__title", pageDescription: "sd-description sd-page__description", row: "sd-row sd-clearfix", rowMultiple: "sd-row--multiple", pageRow: "sd-page__row", question: { mainRoot: "sd-element sd-question sd-row__question", flowRoot: "sd-element sd-question sd-row__question sd-row__question--flow", withFrame: "sd-element--with-frame", asCell: "sd-table__cell", answered: "sd-question--answered", header: "sd-question__header sd-element__header", headerLeft: "sd-question__header--location--left", headerTop: "sd-question__header--location-top sd-element__header--location-top", headerBottom: "sd-question__header--location--bottom", content: "sd-question__content", contentLeft: "sd-question__content--left", titleLeftRoot: "sd-question--left", titleOnAnswer: "sd-question__title--answer", titleOnError: "sd-question__title--error", title: "sd-title sd-element__title sd-question__title", titleExpandable: "sd-element__title--expandable", titleExpanded: "sd-element__title--expanded", titleCollapsed: "sd-element__title--collapsed", titleDisabled: "sd-element__title--disabled", titleBar: "sd-action-title-bar", requiredText: "sd-question__required-text", number: "sd-element__num", description: "sd-description sd-question__description", descriptionUnderInput: "sd-description sd-question__description sd-question__description--under-input", comment: "sd-input sd-comment", other: "sd-input sd-comment", required: "sd-question--required", titleRequired: "sd-question__title--required", indent: 20, footer: "sd-question__footer", commentArea: "sd-question__comment-area", formGroup: "sd-question__form-group", hasError: "sd-question--error", collapsed: "sd-element--collapsed", expanded: "sd-element--expanded", nested: "sd-element--nested", invisible: "sd-element--invisible", composite: "sd-element--complex", disabled: "sd-question--disabled" }, image: { mainRoot: "sd-question sd-question--image", root: "sd-image", image: "sd-image__image", adaptive: "sd-image__image--adaptive", withFrame: "" }, html: { mainRoot: "sd-question sd-row__question sd-question--html", root: "sd-html", withFrame: "" }, error: { root: "sd-question__erbox", icon: "", item: "", tooltip: "sd-question__erbox--tooltip", outsideQuestion: "sd-question__erbox--outside-question", aboveQuestion: "sd-question__erbox--above-question", belowQuestion: "sd-question__erbox--below-question", locationTop: "sd-question__erbox--location--top", locationBottom: "sd-question__erbox--location--bottom" }, checkbox: { root: "sd-selectbase", rootRow: "sd-selectbase--row", rootMultiColumn: "sd-selectbase--multi-column", item: "sd-item sd-checkbox sd-selectbase__item", itemOnError: "sd-item--error", itemSelectAll: "sd-checkbox--selectall", itemNone: "sd-checkbox--none", itemDisabled: "sd-item--disabled sd-checkbox--disabled", itemChecked: "sd-item--checked sd-checkbox--checked", itemHover: "sd-item--allowhover sd-checkbox--allowhover", itemInline: "sd-selectbase__item--inline", label: "sd-selectbase__label", labelChecked: "", itemControl: "sd-visuallyhidden sd-item__control sd-checkbox__control", itemDecorator: "sd-item__svg sd-checkbox__svg", itemSvgIconId: "#icon-v2check", controlLabel: "sd-item__control-label", materialDecorator: "sd-item__decorator sd-checkbox__decorator", other: "sd-input sd-comment sd-selectbase__other", column: "sd-selectbase__column" }, radiogroup: { root: "sd-selectbase", rootRow: "sd-selectbase--row", rootMultiColumn: "sd-selectbase--multi-column", item: "sd-item sd-radio sd-selectbase__item", itemOnError: "sd-item--error", itemInline: "sd-selectbase__item--inline", label: "sd-selectbase__label", labelChecked: "", itemDisabled: "sd-item--disabled sd-radio--disabled", itemChecked: "sd-item--checked sd-radio--checked", itemHover: "sd-item--allowhover sd-radio--allowhover", itemControl: "sd-visuallyhidden sd-item__control sd-radio__control", itemDecorator: "sd-item__svg sd-radio__svg", controlLabel: "sd-item__control-label", materialDecorator: "sd-item__decorator sd-radio__decorator", other: "sd-input sd-comment sd-selectbase__other", clearButton: "", column: "sd-selectbase__column" }, boolean: { mainRoot: "sd-element sd-question sd-row__question sd-question--boolean", root: "sv_qcbc sv_qbln sd-scrollable-container", rootRadio: "sv_qcbc sv_qbln sd-scrollable-container sd-scrollable-container--compact", item: "sd-boolean", itemOnError: "sd-boolean--error", control: "sd-boolean__control sd-visuallyhidden", itemChecked: "sd-boolean--checked", itemIndeterminate: "sd-boolean--indeterminate", itemDisabled: "sd-boolean--disabled", label: "sd-boolean__label", switch: "sd-boolean__switch", disabledLabel: "sd-checkbox__label--disabled", sliderText: "sd-boolean__thumb-text", slider: "sd-boolean__thumb", radioItem: "sd-item", radioItemChecked: "sd-item--checked sd-radio--checked", radioLabel: "sd-selectbase__label", radioControlLabel: "sd-item__control-label", radioFieldset: "sd-selectbase", itemRadioDecorator: "sd-item__svg sd-radio__svg", materialRadioDecorator: "sd-item__decorator sd-radio__decorator", itemRadioControl: "sd-visuallyhidden sd-item__control sd-radio__control", rootCheckbox: "sd-selectbase", checkboxItem: "sd-item sd-selectbase__item sd-checkbox", checkboxLabel: "sd-selectbase__label", checkboxItemOnError: "sd-item--error", checkboxItemIndeterminate: "sd-checkbox--intermediate", checkboxItemChecked: "sd-item--checked sd-checkbox--checked", checkboxItemDecorator: "sd-item__svg sd-checkbox__svg", checkboxItemDisabled: "sd-checkbox--disabled", controlCheckbox: "sd-visuallyhidden sd-item__control sd-checkbox__control", checkboxMaterialDecorator: "sd-item__decorator sd-checkbox__decorator", checkboxControlLabel: "sd-item__control-label", svgIconCheckedId: "#icon-v2check" }, text: { root: "sd-input sd-text", small: "sd-row__question--small", controlDisabled: "sd-input--disabled", content: "sd-text__content sd-question__content", remainingCharacterCounter: "sd-remaining-character-counter", onError: "sd-input--error" }, multipletext: { root: "sd-multipletext", itemLabel: "sd-multipletext__item-container sd-input", itemLabelOnError: "sd-multipletext__item-container--error", item: "sd-multipletext__item", itemTitle: "sd-multipletext__item-title", row: "sd-multipletext__row", cell: "sd-multipletext__cell" }, dropdown: { root: "sd-selectbase", popup: "sv-dropdown-popup", small: "sd-row__question--small", selectWrapper: "", other: "sd-input sd-comment sd-selectbase__other", onError: "sd-input--error", label: "sd-selectbase__label", item: "sd-item sd-radio sd-selectbase__item", itemDisabled: "sd-item--disabled sd-radio--disabled", itemChecked: "sd-item--checked sd-radio--checked", itemHover: "sd-item--allowhover sd-radio--allowhover", itemControl: "sd-visuallyhidden sd-item__control sd-radio__control", itemDecorator: "sd-item__svg sd-radio__svg", cleanButton: "sd-dropdown_clean-button", cleanButtonSvg: "sd-dropdown_clean-button-svg", cleanButtonIconId: "icon-clear", control: "sd-input sd-dropdown", controlInputFieldComponent: "sd-dropdown__input-field-component", controlValue: "sd-dropdown__value", controlDisabled: "sd-input--disabled", controlEmpty: "sd-dropdown--empty", controlLabel: "sd-item__control-label", filterStringInput: "sd-dropdown__filter-string-input", materialDecorator: "sd-item__decorator sd-radio__decorator" }, imagepicker: { mainRoot: "sd-element sd-question sd-row__question", root: "sd-selectbase sd-imagepicker", rootColumn: "sd-imagepicker--column", item: "sd-imagepicker__item", itemOnError: "sd-imagepicker__item--error", itemInline: "sd-imagepicker__item--inline", itemChecked: "sd-imagepicker__item--checked", itemDisabled: "sd-imagepicker__item--disabled", itemHover: "sd-imagepicker__item--allowhover", label: "sd-imagepicker__label", itemDecorator: "sd-imagepicker__item-decorator", imageContainer: "sd-imagepicker__image-container", itemControl: "sd-imagepicker__control sd-visuallyhidden", image: "sd-imagepicker__image", itemText: "sd-imagepicker__text", other: "sd-input sd-comment", itemNoImage: "sd-imagepicker__no-image", itemNoImageSvgIcon: "sd-imagepicker__no-image-svg", itemNoImageSvgIconId: "#icon-no-image", column: "sd-selectbase__column sd-imagepicker__column", checkedItemDecorator: "sd-imagepicker__check-decorator", checkedItemSvgIcon: "sd-imagepicker__check-icon", checkedItemSvgIconId: "icon-v2check_24x24" }, matrix: { mainRoot: "sd-element sd-question sd-row__question sd-element--complex sd-question--complex sd-question--table", tableWrapper: "sd-matrix sd-table-wrapper", root: "sd-table sd-matrix__table", rootVerticalAlignTop: "sd-table--align-top", rootVerticalAlignMiddle: "sd-table--align-middle", rootAlternateRows: "sd-table--alternate-rows", rowError: "sd-matrix__row--error", cell: "sd-table__cell sd-matrix__cell", row: "sd-table__row", headerCell: "sd-table__cell sd-table__cell--header", rowTextCell: "sd-table__cell sd-matrix__cell sd-table__cell--row-text", label: "sd-item sd-radio sd-matrix__label", itemOnError: "sd-item--error", itemValue: "sd-visuallyhidden sd-item__control sd-radio__control", itemChecked: "sd-item--checked sd-radio--checked", itemDisabled: "sd-item--disabled sd-radio--disabled", itemHover: "sd-radio--allowhover", materialDecorator: "sd-item__decorator sd-radio__decorator", itemDecorator: "sd-item__svg sd-radio__svg", cellText: "sd-matrix__text", cellTextSelected: "sd-matrix__text--checked", cellTextDisabled: "sd-matrix__text--disabled", cellResponsiveTitle: "sd-matrix__responsive-title" }, matrixdropdown: { mainRoot: "sd-element sd-question sd-row__question sd-element--complex sd-question--complex sd-question--table", rootScroll: "sd-question--scroll", root: "sd-table sd-matrixdropdown", rootVerticalAlignTop: "sd-table--align-top", rootVerticalAlignMiddle: "sd-table--align-middle", tableWrapper: "sd-table-wrapper", rootAlternateRows: "sd-table--alternate-rows", cell: "sd-table__cell", itemCell: "sd-table__cell--item", row: "sd-table__row", headerCell: "sd-table__cell sd-table__cell--header", rowTextCell: "sd-table__cell sd-table__cell--row-text", cellRequiredText: "sd-question__required-text", detailButton: "sd-table__cell--detail-button", detailButtonExpanded: "sd-table__cell--detail-button--expanded", detailIcon: "sd-detail-panel__icon", detailIconExpanded: "sd-detail-panel__icon--expanded", detailIconId: "icon-expanddetail", detailIconExpandedId: "icon-collapsedetail", actionsCell: "sd-table__cell sd-table__cell--actions", emptyCell: "sd-table__cell--empty", verticalCell: "sd-table__cell--vertical", cellQuestionWrapper: "sd-table__question-wrapper" }, matrixdynamic: { mainRoot: "sd-element sd-question sd-row__question sd-element--complex sd-question--complex sd-question--table", rootScroll: "sd-question--scroll", empty: "sd-question--empty", root: "sd-table sd-matrixdynamic", tableWrapper: "sd-table-wrapper", cell: "sd-table__cell", row: "sd-table__row", itemCell: "sd-table__cell--item", headerCell: "sd-table__cell sd-table__cell--header", rowTextCell: "sd-table__cell sd-table__cell--row-text", cellRequiredText: "sd-question__required-text", button: "sd-action sd-matrixdynamic__btn", detailRow: "sd-table__row sd-table__row--detail", detailButton: "sd-table__cell--detail-button", detailButtonExpanded: "sd-table__cell--detail-button--expanded", detailIcon: "sd-detail-panel__icon", detailIconExpanded: "sd-detail-panel__icon--expanded", detailIconId: "icon-expanddetail", detailIconExpandedId: "icon-collapsedetail", detailPanelCell: "sd-table__cell--detail-panel", actionsCell: "sd-table__cell sd-table__cell--actions", buttonAdd: "sd-matrixdynamic__add-btn", buttonRemove: "sd-action--negative sd-matrixdynamic__remove-btn", iconAdd: "", iconRemove: "", dragElementDecorator: "sd-drag-element__svg", iconDragElement: "#icon-v2dragelement_16x16", footer: "sd-matrixdynamic__footer", emptyRowsSection: "sd-matrixdynamic__placeholder sd-question__placeholder", iconDrag: "sv-matrixdynamic__drag-icon", ghostRow: "sv-matrix-row--drag-drop-ghost-mod", emptyCell: "sd-table__cell--empty", verticalCell: "sd-table__cell--vertical", cellQuestionWrapper: "sd-table__question-wrapper" }, rating: { rootDropdown: "sd-scrollable-container sd-scrollable-container--compact sd-selectbase", root: "sd-scrollable-container sd-rating", rootWrappable: "sd-scrollable-container sd-rating sd-rating--wrappable", item: "sd-rating__item", itemOnError: "sd-rating__item--error", itemHover: "sd-rating__item--allowhover", selected: "sd-rating__item--selected", minText: "sd-rating__item-text sd-rating__min-text", itemText: "sd-rating__item-text", maxText: "sd-rating__item-text sd-rating__max-text", itemDisabled: "sd-rating__item--disabled", control: "sd-input sd-dropdown", controlValue: "sd-dropdown__value", controlDisabled: "sd-input--disabled", controlEmpty: "sd-dropdown--empty", filterStringInput: "sd-dropdown__filter-string-input", popup: "sv-dropdown-popup", onError: "sd-input--error" }, comment: { root: "sd-input sd-comment", small: "sd-row__question--small", controlDisabled: "sd-input--disabled", content: "sd-comment__content sd-question__content", remainingCharacterCounter: "sd-remaining-character-counter", onError: "sd-input--error" }, expression: "sd-expression", file: { root: "sd-file", other: "sd-input sd-comment", placeholderInput: "sd-visuallyhidden", preview: "sd-file__preview", fileSign: "", fileList: "sd-file__list", fileSignBottom: "sd-file__sign", dragArea: "sd-file__drag-area", dragAreaActive: "sd-file__drag-area--active", fileDecorator: "sd-file__decorator", onError: "sd-file__decorator--error", fileDecoratorDrag: "sd-file__decorator--drag", fileInput: "sd-visuallyhidden", noFileChosen: "sd-description sd-file__no-file-chosen", chooseFile: "sd-file__choose-btn", chooseFileAsText: "sd-action sd-file__choose-btn--text", chooseFileAsTextDisabled: "sd-action--disabled", chooseFileAsIcon: "sd-context-btn sd-file__choose-btn--icon", chooseFileIconId: "icon-choosefile", disabled: "sd-file__choose-btn--disabled", removeButton: "sd-context-btn sd-context-btn--negative sd-file__btn sd-file__clean-btn", removeButtonBottom: "", removeButtonIconId: "icon-clear", removeFile: "sd-hidden", removeFileSvg: "", removeFileSvgIconId: "icon-delete", wrapper: "sd-file__wrapper", defaultImage: "sd-file__default-image", defaultImageIconId: "icon-defaultfile", leftIconId: "icon-arrowleft", rightIconId: "icon-arrowright", removeFileButton: "sd-context-btn sd-context-btn--negative sd-file__remove-file-button", dragAreaPlaceholder: "sd-file__drag-area-placeholder", imageWrapper: "sd-file__image-wrapper", single: "sd-file--single", singleImage: "sd-file--single-image", mobile: "sd-file--mobile" }, signaturepad: { mainRoot: "sd-element sd-question sd-question--signature sd-row__question", root: "sd-signaturepad sjs_sp_container", small: "sd-row__question--small", controls: "sjs_sp_controls sd-signaturepad__controls", placeholder: "sjs_sp_placeholder", clearButton: "sjs_sp_clear sd-context-btn sd-context-btn--negative sd-signaturepad__clear", clearButtonIconId: "icon-clear" }, saveData: { root: "sv-save-data_root", info: "sv-save-data_info", error: "sv-save-data_error", success: "sv-save-data_success", button: "sv-save-data_button" }, window: { root: "sv_window", body: "sv_window_content", header: { root: "sv_window_title", title: "", button: "", buttonExpanded: "", buttonCollapsed: "" } }, ranking: { root: "sv-ranking", rootMobileMod: "sv-ranking--mobile", rootDragMod: "sv-ranking--drag", rootDisabled: "sd-ranking--disabled", rootDesignMode: "sv-ranking--design-mode", rootDragHandleAreaIcon: "sv-ranking--drag-handle-area-icon", item: "sv-ranking-item", itemContent: "sv-ranking-item__content sd-ranking-item__content", itemIndex: "sv-ranking-item__index sd-ranking-item__index", itemIndexEmptyMode: "sv-ranking-item__index--empty sd-ranking-item__index--empty", controlLabel: "sv-ranking-item__text", itemGhostNode: "sv-ranking-item__ghost", itemIconContainer: "sv-ranking-item__icon-container", itemIcon: "sv-ranking-item__icon", itemIconHoverMod: "sv-ranking-item__icon--hover", itemIconFocusMod: "sv-ranking-item__icon--focus", itemGhostMod: "sv-ranking-item--ghost", itemDragMod: "sv-ranking--drag", itemOnError: "sv-ranking-item--error" }, buttongroup: { root: "sv-button-group", item: "sv-button-group__item", itemIcon: "sv-button-group__item-icon", itemDecorator: "sv-button-group__item-decorator", itemCaption: "sv-button-group__item-caption", itemHover: "sv-button-group__item--hover", itemSelected: "sv-button-group__item--selected", itemDisabled: "sv-button-group__item--disabled", itemControl: "sv-visuallyhidden" }, list: { root: "sv-list__container sd-list", item: "sv-list__item sd-list__item", itemBody: "sv-list__item-body sd-list__item-body", itemSelected: "sv-list__item--selected sd-list__item--selected" }, actionBar: { root: "sd-action-bar", item: "sd-action", defaultSizeMode: "", smallSizeMode: "", itemPressed: "sd-action--pressed", itemAsIcon: "sd-action--icon", itemIcon: "sd-action__icon", itemTitle: "sd-action__title" }, variables: { mobileWidth: "--sd-mobile-width", imagepickerGapBetweenItems: "--sd-imagepicker-gap", themeMark: "--sv-defaultV2-mark" }, tagbox: { root: "sd-selectbase", popup: "sv-dropdown-popup", small: "sd-row__question--small", selectWrapper: "", other: "sd-input sd-comment sd-selectbase__other", onError: "sd-input--error", label: "sd-selectbase__label", item: "sd-item sd-radio sd-selectbase__item", itemDisabled: "sd-item--disabled sd-radio--disabled", itemChecked: "sd-item--checked sd-radio--checked", itemHover: "sd-item--allowhover sd-radio--allowhover", itemControl: "sd-visuallyhidden sd-item__control sd-radio__control", itemDecorator: "sd-item__svg sd-radio__svg", cleanButton: "sd-tagbox_clean-button sd-dropdown_clean-button", cleanButtonSvg: "sd-tagbox_clean-button-svg sd-dropdown_clean-button-svg", cleanButtonIconId: "icon-clear", cleanItemButton: "sd-tagbox-item_clean-button", cleanItemButtonSvg: "sd-tagbox-item_clean-button-svg", cleanItemButtonIconId: "icon-clear_16x16", control: "sd-input sd-tagbox sd-dropdown", controlValue: "sd-tagbox__value sd-dropdown__value", controlValueItems: "sd-tagbox__value-items", placeholderInput: "sd-tagbox__placeholder", controlDisabled: "sd-input--disabled", controlEmpty: "sd-dropdown--empty sd-tagbox--empty", controlLabel: "sd-item__control-label", filterStringInput: "sd-tagbox__filter-string-input sd-dropdown__filter-string-input", materialDecorator: "sd-item__decorator sd-checkbox__decorator" } }, Jn = "defaultV2"; Un[Jn] = Wn; var Gn = function () { function e() { } return Object.defineProperty(e, "serviceUrl", { get: function () { return o.surveyServiceUrl }, set: function (e) { o.surveyServiceUrl = e }, enumerable: !1, configurable: !0 }), e.prototype.loadSurvey = function (t, n) { var o = new XMLHttpRequest; o.open("GET", e.serviceUrl + "/getSurvey?surveyId=" + t), o.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"), o.onload = function () { var e = JSON.parse(o.response); n(200 == o.status, e, o.response) }, o.send() }, e.prototype.getSurveyJsonAndIsCompleted = function (t, n, o) { var r = new XMLHttpRequest; r.open("GET", e.serviceUrl + "/getSurveyAndIsCompleted?surveyId=" + t + "&clientId=" + n), r.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"), r.onload = function () { var e = JSON.parse(r.response), t = e ? e.survey : null, n = e ? e.isCompleted : null; o(200 == r.status, t, n, r.response) }, r.send() }, e.prototype.sendResult = function (t, n, o, r, i) { void 0 === r && (r = null), void 0 === i && (i = !1); var s = new XMLHttpRequest; s.open("POST", e.serviceUrl + "/post/"), s.setRequestHeader("Content-Type", "application/json; charset=utf-8"); var a = { postId: t, surveyResult: JSON.stringify(n) }; r && (a.clientId = r), i && (a.isPartialCompleted = !0); var l = JSON.stringify(a); s.onload = s.onerror = function () { o && o(200 === s.status, s.response, s) }, s.send(l) }, e.prototype.sendFile = function (t, n, o) { var r = new XMLHttpRequest; r.onload = r.onerror = function () { o && o(200 == r.status, JSON.parse(r.response)) }, r.open("POST", e.serviceUrl + "/upload/", !0); var i = new FormData; i.append("file", n), i.append("postId", t), r.send(i) }, e.prototype.getResult = function (t, n, o) { var r = new XMLHttpRequest, i = "resultId=" + t + "&name=" + n; r.open("GET", e.serviceUrl + "/getResult?" + i), r.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); r.onload = function () { var e = null, t = null; if (200 == r.status) for (var n in t = [], (e = JSON.parse(r.response)).QuestionResult) { var i = { name: n, value: e.QuestionResult[n] }; t.push(i) } o(200 == r.status, e, t, r.response) }, r.send() }, e.prototype.isCompleted = function (t, n, o) { var r = new XMLHttpRequest, i = "resultId=" + t + "&clientId=" + n; r.open("GET", e.serviceUrl + "/isCompleted?" + i), r.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); r.onload = function () { var e = null; 200 == r.status && (e = JSON.parse(r.response)), o(200 == r.status, e, r.response) }, r.send() }, e }(), $n = { "$main-color": "#1ab394", "$add-button-color": "#1948b3", "$remove-button-color": "#ff1800", "$disable-color": "#dbdbdb", "$progress-text-color": "#9d9d9d", "$disabled-label-color": "rgba(64, 64, 64, 0.5)", "$slider-color": "white", "$disabled-slider-color": "#cfcfcf", "$error-color": "#d52901", "$text-color": "#404040", "$light-text-color": "#fff", "$checkmark-color": "#fff", "$progress-buttons-color": "#8dd9ca", "$inputs-background-color": "transparent", "$main-hover-color": "#9f9f9f", "$body-container-background-color": "#f4f4f4", "$text-border-color": "#d4d4d4", "$disabled-text-color": "rgba(64, 64, 64, 0.5)", "$border-color": "rgb(64, 64, 64, 0.5)", "$header-background-color": "#e7e7e7", "$answer-background-color": "rgba(26, 179, 148, 0.2)", "$error-background-color": "rgba(213, 41, 1, 0.2)", "$radio-checked-color": "#404040", "$clean-button-color": "#1948b3", "$body-background-color": "#ffffff", "$foreground-light": "#909090" }, Kn = { "$header-background-color": "#e7e7e7", "$body-container-background-color": "#f4f4f4", "$main-color": "#1ab394", "$main-hover-color": "#0aa384", "$body-background-color": "white", "$inputs-background-color": "white", "$text-color": "#6d7072", "$text-input-color": "#6d7072", "$header-color": "#6d7072", "$border-color": "#e7e7e7", "$error-color": "#ed5565", "$error-background-color": "#fcdfe2", "$progress-text-color": "#9d9d9d", "$disable-color": "#dbdbdb", "$disabled-label-color": "rgba(64, 64, 64, 0.5)", "$slider-color": "white", "$disabled-switch-color": "#9f9f9f", "$disabled-slider-color": "#cfcfcf", "$foreground-light": "#909090", "$foreground-disabled": "#161616", "$background-dim": "#f3f3f3", "$progress-buttons-color": "#8dd9ca", "$progress-buttons-line-color": "#d4d4d4" }, Xn = { "$header-background-color": "#4a4a4a", "$body-container-background-color": "#f8f8f8", "$main-color": "#f78119", "$main-hover-color": "#e77109", "$body-background-color": "white", "$inputs-background-color": "white", "$text-color": "#4a4a4a", "$text-input-color": "#4a4a4a", "$header-color": "#f78119", "$border-color": "#e7e7e7", "$error-color": "#ed5565", "$error-background-color": "#fcdfe2", "$progress-text-color": "#9d9d9d", "$disable-color": "#dbdbdb", "$disabled-label-color": "rgba(64, 64, 64, 0.5)", "$slider-color": "white", "$disabled-switch-color": "#9f9f9f", "$disabled-slider-color": "#cfcfcf", "$foreground-light": "#909090", "$foreground-disabled": "#161616", "$background-dim": "#f3f3f3", "$progress-buttons-color": "#f7b781", "$progress-buttons-line-color": "#d4d4d4" }, Yn = { "$header-background-color": "#d9d8dd", "$body-container-background-color": "#f6f7f2", "$main-color": "#3c4f6d", "$main-hover-color": "#2c3f5d", "$body-background-color": "white", "$inputs-background-color": "white", "$text-color": "#4a4a4a", "$text-input-color": "#4a4a4a", "$header-color": "#6d7072", "$border-color": "#e7e7e7", "$error-color": "#ed5565", "$error-background-color": "#fcdfe2", "$progress-text-color": "#9d9d9d", "$disable-color": "#dbdbdb", "$disabled-label-color": "rgba(64, 64, 64, 0.5)", "$slider-color": "white", "$disabled-switch-color": "#9f9f9f", "$disabled-slider-color": "#cfcfcf", "$foreground-light": "#909090", "$foreground-disabled": "#161616", "$background-dim": "#f3f3f3", "$progress-buttons-color": "#839ec9", "$progress-buttons-line-color": "#d4d4d4" }, Zn = { "$header-background-color": "#ddd2ce", "$body-container-background-color": "#f7efed", "$main-color": "#68656e", "$main-hover-color": "#58555e", "$body-background-color": "white", "$inputs-background-color": "white", "$text-color": "#4a4a4a", "$text-input-color": "#4a4a4a", "$header-color": "#6d7072", "$border-color": "#e7e7e7", "$error-color": "#ed5565", "$error-background-color": "#fcdfe2", "$progress-text-color": "#9d9d9d", "$disable-color": "#dbdbdb", "$disabled-label-color": "rgba(64, 64, 64, 0.5)", "$slider-color": "white", "$disabled-switch-color": "#9f9f9f", "$disabled-slider-color": "#cfcfcf", "$foreground-light": "#909090", "$foreground-disabled": "#161616", "$background-dim": "#f3f3f3", "$progress-buttons-color": "#c6bed4", "$progress-buttons-line-color": "#d4d4d4" }, eo = { "$header-background-color": "#cdccd2", "$body-container-background-color": "#efedf4", "$main-color": "#0f0f33", "$main-hover-color": "#191955", "$body-background-color": "white", "$inputs-background-color": "white", "$text-color": "#0f0f33", "$text-input-color": "#0f0f33", "$header-color": "#0f0f33", "$border-color": "#e7e7e7", "$error-color": "#ed5565", "$error-background-color": "#fcdfe2", "$progress-text-color": "#9d9d9d", "$disable-color": "#dbdbdb", "$disabled-label-color": "rgba(64, 64, 64, 0.5)", "$slider-color": "white", "$disabled-switch-color": "#9f9f9f", "$disabled-slider-color": "#cfcfcf", "$foreground-light": "#909090", "$foreground-disabled": "#161616", "$background-dim": "#f3f3f3", "$progress-buttons-color": "#747491", "$progress-buttons-line-color": "#d4d4d4" }, to = { "$header-background-color": "#82b8da", "$body-container-background-color": "#dae1e7", "$main-color": "#3c3b40", "$main-hover-color": "#1e1d20", "$body-background-color": "white", "$inputs-background-color": "white", "$text-color": "#000", "$text-input-color": "#000", "$header-color": "#000", "$border-color": "#e7e7e7", "$error-color": "#ed5565", "$error-background-color": "#fcdfe2", "$disable-color": "#dbdbdb", "$progress-text-color": "#9d9d9d", "$disabled-label-color": "rgba(64, 64, 64, 0.5)", "$slider-color": "white", "$disabled-switch-color": "#9f9f9f", "$disabled-slider-color": "#cfcfcf", "$foreground-light": "#909090", "$foreground-disabled": "#161616", "$background-dim": "#f3f3f3", "$progress-buttons-color": "#d1c9f5", "$progress-buttons-line-color": "#d4d4d4" }, no = { "$header-background-color": "#323232", "$body-container-background-color": "#f8f8f8", "$main-color": "#5ac8fa", "$main-hover-color": "#06a1e7", "$body-background-color": "white", "$inputs-background-color": "white", "$text-color": "#000", "$text-input-color": "#000", "$header-color": "#000", "$border-color": "#e7e7e7", "$error-color": "#ed5565", "$error-background-color": "#fcdfe2", "$disable-color": "#dbdbdb", "$progress-text-color": "#9d9d9d", "$disabled-label-color": "rgba(64, 64, 64, 0.5)", "$slider-color": "white", "$disabled-switch-color": "#9f9f9f", "$disabled-slider-color": "#cfcfcf", "$foreground-light": "#909090", "$foreground-disabled": "#161616", "$background-dim": "#f3f3f3", "$progress-buttons-color": "#acdcf2", "$progress-buttons-line-color": "#d4d4d4" }; var oo = function () { function e() { e.autoApplyTheme() } return e.autoApplyTheme = function () { if ("bootstrap" !== Un.currentType && "bootstrapmaterial" !== Un.currentType) { var t = e.getIncludedThemeCss(); 1 === t.length && e.applyTheme(t[0].name) } }, e.getAvailableThemes = function () { return Un.getAvailableThemes().filter((function (e) { return -1 !== ["defaultV2", "default", "modern"].indexOf(e) })).map((function (e) { return { name: e, theme: Un[e] } })) }, e.getIncludedThemeCss = function () { var t = e.getAvailableThemes(); if (document && document.body) { var n = getComputedStyle(document.body); if (n.length) return t.filter((function (e) { return e.theme.variables && n.getPropertyValue(e.theme.variables.themeMark) })) } return [] }, e.findSheet = function (e) { if ("undefined" == typeof document) return null; for (var t = 0; t < document.styleSheets.length; t++)if (document.styleSheets[t].ownerNode && document.styleSheets[t].ownerNode.id === e) return document.styleSheets[t]; return null }, e.createSheet = function (t) { var n = document.createElement("style"); return n.id = t, n.appendChild(document.createTextNode("")), document.head.appendChild(n), e.Logger && e.Logger.log("style sheet " + t + " created"), n.sheet }, e.applyTheme = function (t, n) { if (void 0 === t && (t = "default"), Un.currentType = t, e.Enabled) { if ("bootstrap" !== t && "bootstrapmaterial" !== t) return l = e.ThemeColors[t], u = document.body, Object.keys(l || {}).forEach((function (e) { var t = e.substring(1); u.style.setProperty("--" + t, l[e]) })), void (e.Logger && e.Logger.log("apply theme " + t + " completed")); var o = e.ThemeCss[t]; if (!o) return void (Un.currentType = "defaultV2"); e.insertStylesRulesIntoDocument(); var r = n || e.ThemeSelector[t] || e.ThemeSelector.default, i = (t + r).trim(), s = e.findSheet(i); if (!s) { s = e.createSheet(i); var a = e.ThemeColors[t] || e.ThemeColors.default; Object.keys(o).forEach((function (e) { var t = o[e]; Object.keys(a || {}).forEach((function (e) { return t = t.replace(new RegExp("\\" + e, "g"), a[e]) })); try { 0 === e.indexOf("body") ? s.insertRule(e + " { " + t + " }", 0) : s.insertRule(r + e + " { " + t + " }", 0) } catch (e) { } })) } } var l, u; e.Logger && e.Logger.log("apply theme " + t + " completed") }, e.insertStylesRulesIntoDocument = function () { if (e.Enabled) { var t = e.findSheet(e.SurveyJSStylesSheetId); t || (t = e.createSheet(e.SurveyJSStylesSheetId)), Object.keys(e.Styles).length && Object.keys(e.Styles).forEach((function (n) { try { t.insertRule(n + " { " + e.Styles[n] + " }", 0) } catch (e) { } })), Object.keys(e.Media).length && Object.keys(e.Media).forEach((function (n) { try { t.insertRule(e.Media[n].media + " { " + n + " { " + e.Media[n].style + " } }", 0) } catch (e) { } })) } }, e.SurveyJSStylesSheetId = "surveyjs-styles", e.Styles = {}, e.Media = {}, e.ThemeColors = { modern: $n, default: Kn, orange: Xn, darkblue: Yn, darkrose: Zn, stone: eo, winter: to, winterstone: no }, e.ThemeCss = {}, e.ThemeSelector = { default: ".sv_main ", modern: ".sv-root-modern " }, e.Enabled = !0, e }(), ro = function (e) { return "undefined" == typeof window ? 0 : window.setTimeout(e, 1e3) }, io = function (e) { "undefined" != typeof window && window.clearTimeout(e) }, so = function () { function e() { this.listenerCounter = 0, this.timerId = -1, this.onTimer = new he } return Object.defineProperty(e, "instance", { get: function () { return e.instanceValue || (e.instanceValue = new e), e.instanceValue }, enumerable: !1, configurable: !0 }), e.prototype.start = function (e) { var t = this; void 0 === e && (e = null), e && this.onTimer.add(e), this.timerId < 0 && (this.timerId = ro((function () { t.doTimer() }))), this.listenerCounter++ }, e.prototype.stop = function (e) { void 0 === e && (e = null), e && this.onTimer.remove(e), this.listenerCounter--, 0 == this.listenerCounter && this.timerId > -1 && (io(this.timerId), this.timerId = -1) }, e.prototype.doTimer = function () { var e = this; if ((this.onTimer.isEmpty || 0 == this.listenerCounter) && (this.timerId = -1), !(this.timerId < 0)) { var t = this.timerId; this.onTimer.fire(this, {}), t === this.timerId && (this.timerId = ro((function () { e.doTimer() }))) } }, e.instanceValue = null, e }(), ao = function () { var e = function (t, n) { return (e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (e, t) { e.__proto__ = t } || function (e, t) { for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]) })(t, n) }; return function (t, n) { if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null"); function o() { this.constructor = t } e(t, n), t.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o) } }(), lo = function (e, t, n, o) { var r, i = arguments.length, s = i < 3 ? t : null === o ? o = Object.getOwnPropertyDescriptor(t, n) : o; if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) s = Reflect.decorate(e, t, n, o); else for (var a = e.length - 1; a >= 0; a--)(r = e[a]) && (s = (i < 3 ? r(s) : i > 3 ? r(t, n, s) : r(t, n)) || s); return i > 3 && s && Object.defineProperty(t, n, s), s }, uo = function (e) { function t(t) { var n = e.call(this) || this; return n.timerFunc = null, n.surveyValue = t, n.onCreating(), n } return ao(t, e), Object.defineProperty(t.prototype, "survey", { get: function () { return this.surveyValue }, enumerable: !1, configurable: !0 }), t.prototype.onCreating = function () { }, t.prototype.start = function () { var e = this; this.survey && (this.isRunning || this.isDesignMode || (this.survey.onCurrentPageChanged.add((function () { e.update() })), this.timerFunc = function () { e.doTimer() }, this.setIsRunning(!0), this.update(), so.instance.start(this.timerFunc))) }, t.prototype.stop = function () { this.isRunning && (this.setIsRunning(!1), so.instance.stop(this.timerFunc)) }, Object.defineProperty(t.prototype, "isRunning", { get: function () { return this.getPropertyValue("isRunning", !1) }, enumerable: !1, configurable: !0 }), t.prototype.setIsRunning = function (e) { this.setPropertyValue("isRunning", e) }, t.prototype.update = function () { this.updateText(), this.updateProgress() }, t.prototype.doTimer = function () { var e = this.survey.currentPage; e && (e.timeSpent = e.timeSpent + 1), this.spent = this.spent + 1, this.update(), this.onTimer && this.onTimer(e) }, t.prototype.updateProgress = function () { var e = this, t = this.survey.timerInfo, n = t.spent, o = t.limit; o ? 0 == n ? (this.progress = 0, setTimeout((function () { e.progress = Math.floor((n + 1) / o * 100) / 100 }), 0)) : n !== o && (this.progress = Math.floor((n + 1) / o * 100) / 100) : this.progress = void 0 }, t.prototype.updateText = function () { var e = this.survey.timerClock; this.clockMajorText = e.majorText, this.clockMinorText = e.minorText, this.text = this.survey.timerInfoText }, Object.defineProperty(t.prototype, "showProgress", { get: function () { return void 0 !== this.progress }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "showTimerAsClock", { get: function () { return !!this.survey.getCss().clockTimerRoot }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "rootCss", { get: function () { return (new at).append(this.survey.getCss().clockTimerRoot).append(this.survey.getCss().clockTimerRootTop, this.survey.isTimerPanelShowingOnTop).append(this.survey.getCss().clockTimerRootBottom, this.survey.isTimerPanelShowingOnBottom).toString() }, enumerable: !1, configurable: !0 }), t.prototype.getProgressCss = function () { return (new at).append(this.survey.getCss().clockTimerProgress).append(this.survey.getCss().clockTimerProgressAnimation, this.progress > 0).toString() }, Object.defineProperty(t.prototype, "textContainerCss", { get: function () { return this.survey.getCss().clockTimerTextContainer }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "minorTextCss", { get: function () { return this.survey.getCss().clockTimerMinorText }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "majorTextCss", { get: function () { return this.survey.getCss().clockTimerMajorText }, enumerable: !1, configurable: !0 }), lo([f()], t.prototype, "text", void 0), lo([f()], t.prototype, "progress", void 0), lo([f()], t.prototype, "clockMajorText", void 0), lo([f()], t.prototype, "clockMinorText", void 0), lo([f({ defaultValue: 0 })], t.prototype, "spent", void 0), t }(ce), co = function () { var e = function (t, n) { return (e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (e, t) { e.__proto__ = t } || function (e, t) { for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]) })(t, n) }; return function (t, n) { if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null"); function o() { this.constructor = t } e(t, n), t.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o) } }(), po = function (e, t, n, o) { var r, i = arguments.length, s = i < 3 ? t : null === o ? o = Object.getOwnPropertyDescriptor(t, n) : o; if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) s = Reflect.decorate(e, t, n, o); else for (var a = e.length - 1; a >= 0; a--)(r = e[a]) && (s = (i < 3 ? r(s) : i > 3 ? r(t, n, s) : r(t, n)) || s); return i > 3 && s && Object.defineProperty(t, n, s), s }, ho = function (e) { function t(t) { var n = e.call(this) || this; return n.cssClasses = t, n.timeout = o.notifications.lifetime, n.timer = void 0, n.actionsVisibility = {}, n.actionBar = new pt, n.actionBar.updateCallback = function (e) { n.actionBar.actions.forEach((function (e) { return e.cssClasses = {} })) }, n } return co(t, e), t.prototype.getCssClass = function (e) { return (new at).append(this.cssClasses.root).append(this.cssClasses.info, "error" !== e && "success" !== e).append(this.cssClasses.error, "error" === e).append(this.cssClasses.success, "success" === e).toString() }, t.prototype.updateActionsVisibility = function (e) { var t = this; this.actionBar.actions.forEach((function (n) { return n.visible = t.actionsVisibility[n.id] === e })) }, t.prototype.notify = function (e, t) { var n = this; void 0 === t && (t = "info"), this.updateActionsVisibility(t), this.message = e, this.active = !0, this.css = this.getCssClass(t), this.timer && (clearTimeout(this.timer), this.timer = void 0), this.timer = setTimeout((function () { n.timer = void 0, n.active = !1 }), this.timeout) }, t.prototype.addAction = function (e, t) { e.visible = !1, e.innerCss = this.cssClasses.button; var n = this.actionBar.addAction(e); this.actionsVisibility[n.id] = t }, po([f({ defaultValue: !1 })], t.prototype, "active", void 0), po([f()], t.prototype, "message", void 0), po([f()], t.prototype, "css", void 0), t }(ce), fo = function () { var e = function (t, n) { return (e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (e, t) { e.__proto__ = t } || function (e, t) { for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]) })(t, n) }; return function (t, n) { if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null"); function o() { this.constructor = t } e(t, n), t.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o) } }(), go = function (e, t, n, o) { var r, i = arguments.length, s = i < 3 ? t : null === o ? o = Object.getOwnPropertyDescriptor(t, n) : o; if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) s = Reflect.decorate(e, t, n, o); else for (var a = e.length - 1; a >= 0; a--)(r = e[a]) && (s = (i < 3 ? r(s) : i > 3 ? r(t, n, s) : r(t, n)) || s); return i > 3 && s && Object.defineProperty(t, n, s), s }, yo = function (e) { function t(n, o) { void 0 === n && (n = null), void 0 === o && (o = null); var r = e.call(this) || this; r.valuesHash = {}, r.variablesHash = {}, r.onTriggerExecuted = r.addEvent(), r.onCompleting = r.addEvent(), r.onComplete = r.addEvent(), r.onShowingPreview = r.addEvent(), r.onNavigateToUrl = r.addEvent(), r.onStarted = r.addEvent(), r.onPartialSend = r.addEvent(), r.onCurrentPageChanging = r.addEvent(), r.onCurrentPageChanged = r.addEvent(), r.onValueChanging = r.addEvent(), r.onValueChanged = r.addEvent(), r.onVariableChanged = r.addEvent(), r.onQuestionVisibleChanged = r.addEvent(), r.onVisibleChanged = r.onQuestionVisibleChanged, r.onPageVisibleChanged = r.addEvent(), r.onPanelVisibleChanged = r.addEvent(), r.onQuestionCreated = r.addEvent(), r.onQuestionAdded = r.addEvent(), r.onQuestionRemoved = r.addEvent(), r.onPanelAdded = r.addEvent(), r.onPanelRemoved = r.addEvent(), r.onPageAdded = r.addEvent(), r.onValidateQuestion = r.addEvent(), r.onSettingQuestionErrors = r.addEvent(), r.onServerValidateQuestions = r.addEvent(), r.onValidatePanel = r.addEvent(), r.onErrorCustomText = r.addEvent(), r.onValidatedErrorsOnCurrentPage = r.addEvent(), r.onProcessHtml = r.addEvent(), r.onGetQuestionDisplayValue = r.addEvent(), r.onGetQuestionTitle = r.addEvent(), r.onGetTitleTagName = r.addEvent(), r.onGetQuestionNo = r.addEvent(), r.onProgressText = r.addEvent(), r.onTextMarkdown = r.addEvent(), r.onTextRenderAs = r.addEvent(), r.onSendResult = r.addEvent(), r.onGetResult = r.addEvent(), r.onUploadFiles = r.addEvent(), r.onDownloadFile = r.addEvent(), r.onClearFiles = r.addEvent(), r.onLoadChoicesFromServer = r.addEvent(), r.onLoadedSurveyFromService = r.addEvent(), r.onProcessTextValue = r.addEvent(), r.onUpdateQuestionCssClasses = r.addEvent(), r.onUpdatePanelCssClasses = r.addEvent(), r.onUpdatePageCssClasses = r.addEvent(), r.onUpdateChoiceItemCss = r.addEvent(), r.onAfterRenderSurvey = r.addEvent(), r.onAfterRenderHeader = r.addEvent(), r.onAfterRenderPage = r.addEvent(), r.onAfterRenderQuestion = r.addEvent(), r.onAfterRenderQuestionInput = r.addEvent(), r.onAfterRenderPanel = r.addEvent(), r.onFocusInQuestion = r.addEvent(), r.onFocusInPanel = r.addEvent(), r.onShowingChoiceItem = r.addEvent(), r.onChoicesLazyLoad = r.addEvent(), r.onGetChoiceDisplayValue = r.addEvent(), r.onMatrixRowAdded = r.addEvent(), r.onMatrixBeforeRowAdded = r.addEvent(), r.onMatrixRowRemoving = r.addEvent(), r.onMatrixRowRemoved = r.addEvent(), r.onMatrixAllowRemoveRow = r.addEvent(), r.onMatrixCellCreating = r.addEvent(), r.onMatrixCellCreated = r.addEvent(), r.onMatrixAfterCellRender = r.addEvent(), r.onMatrixCellValueChanged = r.addEvent(), r.onMatrixCellValueChanging = r.addEvent(), r.onMatrixCellValidate = r.addEvent(), r.onMatrixColumnAdded = r.addEvent(), r.onMultipleTextItemAdded = r.addEvent(), r.onDynamicPanelAdded = r.addEvent(), r.onDynamicPanelRemoved = r.addEvent(), r.onDynamicPanelRemoving = r.addEvent(), r.onTimer = r.addEvent(), r.onTimerPanelInfoText = r.addEvent(), r.onDynamicPanelItemValueChanged = r.addEvent(), r.onIsAnswerCorrect = r.addEvent(), r.onDragDropAllow = r.addEvent(), r.onScrollingElementToTop = r.addEvent(), r.onLocaleChangedEvent = r.addEvent(), r.onGetQuestionTitleActions = r.addEvent(), r.onGetPanelTitleActions = r.addEvent(), r.onGetPageTitleActions = r.addEvent(), r.onGetPanelFooterActions = r.addEvent(), r.onGetMatrixRowActions = r.addEvent(), r.onElementContentVisibilityChanged = r.addEvent(), r.onGetExpressionDisplayValue = r.addEvent(), r.jsonErrors = null, r.cssValue = null, r.hideRequiredErrors = !1, r._isMobile = !1, r._isDesignMode = !1, r.ignoreValidation = !1, r.isNavigationButtonPressed = !1, r.mouseDownPage = null, r.isCalculatingProgressText = !1, r.isFirstPageRendering = !0, r.isCurrentPageRendering = !0, r.isTriggerIsRunning = !1, r.triggerValues = null, r.triggerKeys = null, r.conditionValues = null, r.isValueChangedOnRunningCondition = !1, r.conditionRunnerCounter = 0, r.conditionUpdateVisibleIndexes = !1, r.conditionNotifyElementsOnAnyValueOrVariableChanged = !1, r.isEndLoadingFromJson = null, r.questionHashes = { names: {}, namesInsensitive: {}, valueNames: {}, valueNamesInsensitive: {} }, r.afterRenderPageTasks = [], r.needRenderIcons = !0, r.skippedPages = [], r.skeletonComponentName = "sv-skeleton", "undefined" != typeof document && (t.stylesManager = new oo); var i = function (e) { return "<h3>" + e + "</h3>" }; return r.createHtmlLocString("completedHtml", "completingSurvey", i), r.createHtmlLocString("completedBeforeHtml", "completingSurveyBefore", i), r.createHtmlLocString("loadingHtml", "loadingSurvey", i), r.createLocalizableString("logo", r, !1), r.createLocalizableString("startSurveyText", r, !1, !0), r.createLocalizableString("pagePrevText", r, !1, !0), r.createLocalizableString("pageNextText", r, !1, !0), r.createLocalizableString("completeText", r, !1, !0), r.createLocalizableString("previewText", r, !1, !0), r.createLocalizableString("editText", r, !1, !0), r.createLocalizableString("questionTitleTemplate", r, !0), r.textPreProcessor = new nn, r.textPreProcessor.onProcess = function (e) { r.getProcessedTextValue(e) }, r.timerModelValue = new uo(r), r.timerModelValue.onTimer = function (e) { r.doTimer(e) }, r.createNewArray("pages", (function (e) { r.doOnPageAdded(e) }), (function (e) { r.doOnPageRemoved(e) })), r.createNewArray("triggers", (function (e) { e.setOwner(r) })), r.createNewArray("calculatedValues", (function (e) { e.setOwner(r) })), r.createNewArray("completedHtmlOnCondition", (function (e) { e.locOwner = r })), r.createNewArray("navigateToUrlOnCondition", (function (e) { e.locOwner = r })), r.registerPropertyChangedHandlers(["locale"], (function () { r.onSurveyLocaleChanged() })), r.registerPropertyChangedHandlers(["firstPageIsStarted"], (function () { r.onFirstPageIsStartedChanged() })), r.registerPropertyChangedHandlers(["mode"], (function () { r.onModeChanged() })), r.registerPropertyChangedHandlers(["progressBarType"], (function () { r.updateProgressText() })), r.registerPropertyChangedHandlers(["questionStartIndex", "requiredText", "questionTitlePattern"], (function () { r.resetVisibleIndexes() })), r.registerPropertyChangedHandlers(["isLoading", "isCompleted", "isCompletedBefore", "mode", "isStartedState", "currentPage"], (function () { r.updateState() })), r.registerPropertyChangedHandlers(["state", "currentPage", "showPreviewBeforeComplete"], (function () { r.onStateAndCurrentPageChanged() })), r.registerPropertyChangedHandlers(["logo", "logoPosition"], (function () { r.updateHasLogo() })), r.onGetQuestionNo.onCallbacksChanged = function () { r.resetVisibleIndexes() }, r.onProgressText.onCallbacksChanged = function () { r.updateProgressText() }, r.onTextMarkdown.onCallbacksChanged = function () { r.locStrsChanged() }, r.onProcessHtml.onCallbacksChanged = function () { r.locStrsChanged() }, r.onGetQuestionTitle.onCallbacksChanged = function () { r.locStrsChanged() }, r.onUpdatePageCssClasses.onCallbacksChanged = function () { r.currentPage && r.currentPage.updateElementCss() }, r.onUpdatePanelCssClasses.onCallbacksChanged = function () { r.currentPage && r.currentPage.updateElementCss() }, r.onUpdateQuestionCssClasses.onCallbacksChanged = function () { r.currentPage && r.currentPage.updateElementCss() }, r.onShowingChoiceItem.onCallbacksChanged = function () { r.rebuildQuestionChoices() }, r.navigationBarValue = r.createNavigationBar(), r.navigationBar.locOwner = r, r.onBeforeCreating(), n && (("string" == typeof n || n instanceof String) && (n = JSON.parse(n)), n && n.clientId && (r.clientId = n.clientId), r.fromJSON(n), r.surveyId && r.loadSurveyFromService(r.surveyId, r.clientId)), r.onCreating(), o && r.render(o), r.updateCss(), r.setCalculatedWidthModeUpdater(), r.notifier = new ho(r.css.saveData), r.notifier.addAction({ id: "save-again", title: r.getLocalizationString("saveAgainButton"), action: function () { r.doComplete() } }, "error"), r } return fo(t, e), Object.defineProperty(t, "cssType", { get: function () { return Un.currentType }, set: function (e) { oo.applyTheme(e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "platformName", { get: function () { return t.platform }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "commentSuffix", { get: function () { return o.commentSuffix }, set: function (e) { o.commentSuffix = e }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "commentPrefix", { get: function () { return this.commentSuffix }, set: function (e) { this.commentSuffix = e }, enumerable: !1, configurable: !0 }), t.prototype.createHtmlLocString = function (e, t, n) { this.createLocalizableString(e, this, !1, t).onGetLocalizationTextCallback = n }, t.prototype.getType = function () { return "survey" }, t.prototype.onPropertyValueChanged = function (e, t, n) { "questionsOnPageMode" === e && this.onQuestionsOnPageModeChanged(t) }, Object.defineProperty(t.prototype, "pages", { get: function () { return this.getPropertyValue("pages") }, enumerable: !1, configurable: !0 }), t.prototype.render = function (e) { void 0 === e && (e = null), this.renderCallback && this.renderCallback() }, t.prototype.updateSurvey = function (e, t) { var n = function () { if ("model" == r || "children" == r) return "continue"; if (0 == r.indexOf("on") && o[r] && o[r].add) { var t = e[r]; o[r].add((function (e, n) { t(e, n) })) } else o[r] = e[r] }, o = this; for (var r in e) n(); e && e.data && this.onValueChanged.add((function (t, n) { e.data[n.name] = n.value })) }, t.prototype.getCss = function () { return this.css }, t.prototype.updateCompletedPageCss = function () { this.containerCss = this.css.container, this.completedCss = (new at).append(this.css.body).append(this.css.completedPage).toString() }, t.prototype.updateCss = function () { this.rootCss = this.getRootCss(), this.updateNavigationCss(), this.updateCompletedPageCss() }, Object.defineProperty(t.prototype, "css", { get: function () { return this.cssValue || (this.cssValue = {}, this.copyCssClasses(this.cssValue, Un.getCss())), this.cssValue }, set: function (e) { this.setCss(e) }, enumerable: !1, configurable: !0 }), t.prototype.setCss = function (e, t) { void 0 === t && (t = !0), t ? this.mergeValues(e, this.css) : this.cssValue = e, this.updateCss(), this.updateElementCss(!1) }, Object.defineProperty(t.prototype, "cssTitle", { get: function () { return this.css.title }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "cssNavigationComplete", { get: function () { return this.getNavigationCss(this.cssSurveyNavigationButton, this.css.navigation.complete) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "cssNavigationPreview", { get: function () { return this.getNavigationCss(this.cssSurveyNavigationButton, this.css.navigation.preview) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "cssNavigationEdit", { get: function () { return this.getNavigationCss(this.css.navigationButton, this.css.navigation.edit) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "cssNavigationPrev", { get: function () { return this.getNavigationCss(this.cssSurveyNavigationButton, this.css.navigation.prev) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "cssNavigationStart", { get: function () { return this.getNavigationCss(this.cssSurveyNavigationButton, this.css.navigation.start) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "cssNavigationNext", { get: function () { return this.getNavigationCss(this.cssSurveyNavigationButton, this.css.navigation.next) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "cssSurveyNavigationButton", { get: function () { return (new at).append(this.css.navigationButton).append(this.css.bodyNavigationButton).toString() }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "bodyCss", { get: function () { return (new at).append(this.css.body).append(this.css.bodyWithTimer, "none" != this.showTimerPanel && "running" === this.state).append(this.css.body + "--" + this.calculatedWidthMode).toString() }, enumerable: !1, configurable: !0 }), t.prototype.getNavigationCss = function (e, t) { return (new at).append(e).append(t).toString() }, Object.defineProperty(t.prototype, "lazyRendering", { get: function () { return !0 === this.lazyRenderingValue }, set: function (e) { if (this.lazyRendering !== e) { this.lazyRenderingValue = e; var t = this.currentPage; t && t.updateRows() } }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "isLazyRendering", { get: function () { return this.lazyRendering || o.lazyRowsRendering }, enumerable: !1, configurable: !0 }), t.prototype.updateLazyRenderingRowsOnRemovingElements = function () { if (this.isLazyRendering) { var e = this.currentPage; e && function (e) { if (document) { var t = document.getElementById(e); if (t) { var n = ze(t); n && n.dispatchEvent(new CustomEvent("scroll")) } } }(e.id) } }, Object.defineProperty(t.prototype, "triggers", { get: function () { return this.getPropertyValue("triggers") }, set: function (e) { this.setPropertyValue("triggers", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "calculatedValues", { get: function () { return this.getPropertyValue("calculatedValues") }, set: function (e) { this.setPropertyValue("calculatedValues", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "surveyId", { get: function () { return this.getPropertyValue("surveyId", "") }, set: function (e) { this.setPropertyValue("surveyId", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "surveyPostId", { get: function () { return this.getPropertyValue("surveyPostId", "") }, set: function (e) { this.setPropertyValue("surveyPostId", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "clientId", { get: function () { return this.getPropertyValue("clientId", "") }, set: function (e) { this.setPropertyValue("clientId", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "cookieName", { get: function () { return this.getPropertyValue("cookieName", "") }, set: function (e) { this.setPropertyValue("cookieName", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "sendResultOnPageNext", { get: function () { return this.getPropertyValue("sendResultOnPageNext", !1) }, set: function (e) { this.setPropertyValue("sendResultOnPageNext", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "surveyShowDataSaving", { get: function () { return this.getPropertyValue("surveyShowDataSaving", !1) }, set: function (e) { this.setPropertyValue("surveyShowDataSaving", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "focusFirstQuestionAutomatic", { get: function () { return this.getPropertyValue("focusFirstQuestionAutomatic") }, set: function (e) { this.setPropertyValue("focusFirstQuestionAutomatic", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "focusOnFirstError", { get: function () { return this.getPropertyValue("focusOnFirstError") }, set: function (e) { this.setPropertyValue("focusOnFirstError", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "showNavigationButtons", { get: function () { return this.getPropertyValue("showNavigationButtons") }, set: function (e) { !0 !== e && void 0 !== e || (e = "bottom"), !1 === e && (e = "none"), this.setPropertyValue("showNavigationButtons", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "showPrevButton", { get: function () { return this.getPropertyValue("showPrevButton") }, set: function (e) { this.setPropertyValue("showPrevButton", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "showTitle", { get: function () { return this.getPropertyValue("showTitle") }, set: function (e) { this.setPropertyValue("showTitle", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "showPageTitles", { get: function () { return this.getPropertyValue("showPageTitles") }, set: function (e) { this.setPropertyValue("showPageTitles", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "showCompletedPage", { get: function () { return this.getPropertyValue("showCompletedPage") }, set: function (e) { this.setPropertyValue("showCompletedPage", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "navigateToUrl", { get: function () { return this.getPropertyValue("navigateToUrl") }, set: function (e) { this.setPropertyValue("navigateToUrl", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "navigateToUrlOnCondition", { get: function () { return this.getPropertyValue("navigateToUrlOnCondition") }, set: function (e) { this.setPropertyValue("navigateToUrlOnCondition", e) }, enumerable: !1, configurable: !0 }), t.prototype.getNavigateToUrl = function () { var e = this.getExpressionItemOnRunCondition(this.navigateToUrlOnCondition), t = e ? e.url : this.navigateToUrl; return t && (t = this.processText(t, !1)), t }, t.prototype.navigateTo = function () { var e = { url: this.getNavigateToUrl(), allow: !0 }; this.onNavigateToUrl.fire(this, e), e.url && e.allow && function (e) { e && "undefined" != typeof window && window.location && (window.location.href = e) }(e.url) }, Object.defineProperty(t.prototype, "requiredText", { get: function () { return this.getPropertyValue("requiredText", "*") }, set: function (e) { this.setPropertyValue("requiredText", e) }, enumerable: !1, configurable: !0 }), t.prototype.beforeSettingQuestionErrors = function (e, t) { this.maakeRequiredErrorsInvisibgle(t), this.onSettingQuestionErrors.fire(this, { question: e, errors: t }) }, t.prototype.beforeSettingPanelErrors = function (e, t) { this.maakeRequiredErrorsInvisibgle(t) }, t.prototype.maakeRequiredErrorsInvisibgle = function (e) { if (this.hideRequiredErrors) for (var t = 0; t < e.length; t++) { var n = e[t].getErrorType(); "required" != n && "requireoneanswer" != n || (e[t].visible = !1) } }, Object.defineProperty(t.prototype, "questionStartIndex", { get: function () { return this.getPropertyValue("questionStartIndex", "") }, set: function (e) { this.setPropertyValue("questionStartIndex", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "storeOthersAsComment", { get: function () { return this.getPropertyValue("storeOthersAsComment") }, set: function (e) { this.setPropertyValue("storeOthersAsComment", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "maxTextLength", { get: function () { return this.getPropertyValue("maxTextLength") }, set: function (e) { this.setPropertyValue("maxTextLength", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "maxOthersLength", { get: function () { return this.getPropertyValue("maxOthersLength") }, set: function (e) { this.setPropertyValue("maxOthersLength", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "goNextPageAutomatic", { get: function () { return this.getPropertyValue("goNextPageAutomatic", !1) }, set: function (e) { this.setPropertyValue("goNextPageAutomatic", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "allowCompleteSurveyAutomatic", { get: function () { return this.getPropertyValue("allowCompleteSurveyAutomatic", !0) }, set: function (e) { this.setPropertyValue("allowCompleteSurveyAutomatic", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "checkErrorsMode", { get: function () { return this.getPropertyValue("checkErrorsMode") }, set: function (e) { this.setPropertyValue("checkErrorsMode", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "autoGrowComment", { get: function () { return this.getPropertyValue("autoGrowComment") }, set: function (e) { this.setPropertyValue("autoGrowComment", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "textUpdateMode", { get: function () { return this.getPropertyValue("textUpdateMode") }, set: function (e) { this.setPropertyValue("textUpdateMode", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "clearInvisibleValues", { get: function () { return this.getPropertyValue("clearInvisibleValues") }, set: function (e) { !0 === e && (e = "onComplete"), !1 === e && (e = "none"), this.setPropertyValue("clearInvisibleValues", e) }, enumerable: !1, configurable: !0 }), t.prototype.clearIncorrectValues = function (e) { void 0 === e && (e = !1); for (var t = 0; t < this.pages.length; t++)this.pages[t].clearIncorrectValues(); if (e) { var n = this.data, r = !1; for (var i in n) if (!this.getQuestionByValueName(i) && !this.iscorrectValueWithPostPrefix(i, o.commentSuffix) && !this.iscorrectValueWithPostPrefix(i, o.matrixTotalValuePostFix)) { var s = this.getCalculatedValueByName(i); s && s.includeIntoResult || (r = !0, delete n[i]) } r && (this.data = n) } }, t.prototype.iscorrectValueWithPostPrefix = function (e, t) { return e.indexOf(t) === e.length - t.length && !!this.getQuestionByValueName(e.substring(0, e.indexOf(t))) }, Object.defineProperty(t.prototype, "keepIncorrectValues", { get: function () { return this.getPropertyValue("keepIncorrectValues", !1) }, set: function (e) { this.setPropertyValue("keepIncorrectValues", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "locale", { get: function () { return this.getPropertyValue("locale", s.currentLocale) }, set: function (e) { e !== s.defaultLocale || s.currentLocale || (e = ""), this.setPropertyValue("locale", e) }, enumerable: !1, configurable: !0 }), t.prototype.onSurveyLocaleChanged = function () { this.notifyElementsOnAnyValueOrVariableChanged("locale"), this.localeChanged(), this.onLocaleChangedEvent.fire(this, this.locale) }, t.prototype.getUsedLocales = function () { var e = new Array; this.addUsedLocales(e); var t = e.indexOf("default"); if (t > -1) { var n = s.defaultLocale, o = e.indexOf(n); o > -1 && e.splice(o, 1), t = e.indexOf("default"), e[t] = n } return e }, t.prototype.localeChanged = function () { for (var e = 0; e < this.pages.length; e++)this.pages[e].localeChanged() }, t.prototype.getLocale = function () { return this.locale }, t.prototype.locStrsChanged = function () { if (e.prototype.locStrsChanged.call(this), this.currentPage) { this.isShowStartingPage || this.updateProgressText(); var t = this.activePage; t && t.locStrsChanged(); for (var n = this.visiblePages, o = 0; o < n.length; o++)n[o].navigationLocStrChanged(); this.navigationBar.locStrsChanged() } }, t.prototype.getMarkdownHtml = function (e, t) { return this.getSurveyMarkdownHtml(this, e, t) }, t.prototype.getRenderer = function (e) { return this.getRendererForString(this, e) }, t.prototype.getRendererContext = function (e) { return this.getRendererContextForString(this, e) }, t.prototype.getRendererForString = function (e, t) { var n = { element: e, name: t, renderAs: this.getBuiltInRendererForString(e, t) }; return this.onTextRenderAs.fire(this, n), n.renderAs }, t.prototype.getRendererContextForString = function (e, t) { return t }, t.prototype.getExpressionDisplayValue = function (e, t, n) { var o = { question: e, value: t, displayValue: n }; return this.onGetExpressionDisplayValue.fire(this, o), o.displayValue }, t.prototype.getBuiltInRendererForString = function (e, t) { if (this.isDesignMode) return u.editableRenderer }, t.prototype.getProcessedText = function (e) { return this.processText(e, !0) }, t.prototype.getLocString = function (e) { return this.getLocalizationString(e) }, t.prototype.getErrorCustomText = function (e, t) { return this.getSurveyErrorCustomText(this, e, t) }, t.prototype.getSurveyErrorCustomText = function (e, t, n) { var o = { text: t, name: n.getErrorType(), obj: e, error: n }; return this.onErrorCustomText.fire(this, o), o.text }, t.prototype.getQuestionDisplayValue = function (e, t) { var n = { question: e, displayValue: t }; return this.onGetQuestionDisplayValue.fire(this, n), n.displayValue }, Object.defineProperty(t.prototype, "emptySurveyText", { get: function () { return this.getLocalizationString("emptySurvey") }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "logo", { get: function () { return this.getLocalizableStringText("logo") }, set: function (e) { this.setLocalizableStringText("logo", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "locLogo", { get: function () { return this.getLocalizableString("logo") }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "logoWidth", { get: function () { return Je(this.getPropertyValue("logoWidth")) }, set: function (e) { this.setPropertyValue("logoWidth", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "logoHeight", { get: function () { return Je(this.getPropertyValue("logoHeight")) }, set: function (e) { this.setPropertyValue("logoHeight", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "logoPosition", { get: function () { return this.getPropertyValue("logoPosition") }, set: function (e) { this.setPropertyValue("logoPosition", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "hasLogo", { get: function () { return this.getPropertyValue("hasLogo", !1) }, enumerable: !1, configurable: !0 }), t.prototype.updateHasLogo = function () { this.setPropertyValue("hasLogo", !!this.logo && "none" !== this.logoPosition) }, Object.defineProperty(t.prototype, "isLogoBefore", { get: function () { return !this.isDesignMode && (this.renderedHasLogo && ("left" === this.logoPosition || "top" === this.logoPosition)) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "isLogoAfter", { get: function () { return this.isDesignMode ? this.renderedHasLogo : this.renderedHasLogo && ("right" === this.logoPosition || "bottom" === this.logoPosition) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "logoClassNames", { get: function () { return (new at).append(this.css.logo).append({ left: "sv-logo--left", right: "sv-logo--right", top: "sv-logo--top", bottom: "sv-logo--bottom" }[this.logoPosition]).toString() }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "renderedHasTitle", { get: function () { return this.isDesignMode ? this.isPropertyVisible("title") : !this.locTitle.isEmpty && this.showTitle }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "renderedHasDescription", { get: function () { return this.isDesignMode ? this.isPropertyVisible("description") : !!this.hasDescription }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "hasTitle", { get: function () { return this.renderedHasTitle }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "renderedHasLogo", { get: function () { return this.isDesignMode ? this.isPropertyVisible("logo") : this.hasLogo }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "renderedHasHeader", { get: function () { return this.renderedHasTitle || this.renderedHasLogo }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "logoFit", { get: function () { return this.getPropertyValue("logoFit") }, set: function (e) { this.setPropertyValue("logoFit", e) }, enumerable: !1, configurable: !0 }), t.prototype.setIsMobile = function (e) { void 0 === e && (e = !0), this.isMobile !== e && (this._isMobile = e, this.updateCss(), this.getAllQuestions().map((function (t) { return t.isMobile = e }))) }, Object.defineProperty(t.prototype, "isMobile", { get: function () { return this._isMobile }, enumerable: !1, configurable: !0 }), t.prototype.isLogoImageChoosen = function () { return this.locLogo.renderedHtml }, Object.defineProperty(t.prototype, "titleMaxWidth", { get: function () { if (!("undefined" != typeof window && void 0 !== window.orientation || this.isMobile || this.isValueEmpty(this.isLogoImageChoosen()) || o.supportCreatorV2)) { var e = this.logoWidth; if ("left" === this.logoPosition || "right" === this.logoPosition) return "calc(100% - 5px - 2em - " + e + ")" } return "" }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "completedHtml", { get: function () { return this.getLocalizableStringText("completedHtml") }, set: function (e) { this.setLocalizableStringText("completedHtml", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "locCompletedHtml", { get: function () { return this.getLocalizableString("completedHtml") }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "completedHtmlOnCondition", { get: function () { return this.getPropertyValue("completedHtmlOnCondition") }, set: function (e) { this.setPropertyValue("completedHtmlOnCondition", e) }, enumerable: !1, configurable: !0 }), t.prototype.runExpression = function (e) { if (!e) return null; var t = this.getFilteredValues(), n = this.getFilteredProperties(); return new re(e).run(t, n) }, t.prototype.runCondition = function (e) { if (!e) return !1; var t = this.getFilteredValues(), n = this.getFilteredProperties(); return new oe(e).run(t, n) }, t.prototype.runTriggers = function () { this.checkTriggers(this.getFilteredValues(), !1) }, Object.defineProperty(t.prototype, "renderedCompletedHtml", { get: function () { var e = this.getExpressionItemOnRunCondition(this.completedHtmlOnCondition); return e ? e.html : this.completedHtml }, enumerable: !1, configurable: !0 }), t.prototype.getExpressionItemOnRunCondition = function (e) { if (0 == e.length) return null; for (var t = this.getFilteredValues(), n = this.getFilteredProperties(), o = 0; o < e.length; o++)if (e[o].runCondition(t, n)) return e[o]; return null }, Object.defineProperty(t.prototype, "completedBeforeHtml", { get: function () { return this.getLocalizableStringText("completedBeforeHtml") }, set: function (e) { this.setLocalizableStringText("completedBeforeHtml", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "locCompletedBeforeHtml", { get: function () { return this.getLocalizableString("completedBeforeHtml") }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "loadingHtml", { get: function () { return this.getLocalizableStringText("loadingHtml") }, set: function (e) { this.setLocalizableStringText("loadingHtml", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "locLoadingHtml", { get: function () { return this.getLocalizableString("loadingHtml") }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "defaultLoadingHtml", { get: function () { return "<h3>" + this.getLocalizationString("loadingSurvey") + "</h3>" }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "navigationBar", { get: function () { return this.navigationBarValue }, enumerable: !1, configurable: !0 }), t.prototype.addNavigationItem = function (e) { return e.component || (e.component = "sv-nav-btn"), e.innerCss || (e.innerCss = this.cssSurveyNavigationButton), this.navigationBar.addAction(e) }, Object.defineProperty(t.prototype, "startSurveyText", { get: function () { return this.getLocalizableStringText("startSurveyText") }, set: function (e) { this.setLocalizableStringText("startSurveyText", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "locStartSurveyText", { get: function () { return this.getLocalizableString("startSurveyText") }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "pagePrevText", { get: function () { return this.getLocalizableStringText("pagePrevText") }, set: function (e) { this.setLocalizableStringText("pagePrevText", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "locPagePrevText", { get: function () { return this.getLocalizableString("pagePrevText") }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "pageNextText", { get: function () { return this.getLocalizableStringText("pageNextText") }, set: function (e) { this.setLocalizableStringText("pageNextText", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "locPageNextText", { get: function () { return this.getLocalizableString("pageNextText") }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "completeText", { get: function () { return this.getLocalizableStringText("completeText") }, set: function (e) { this.setLocalizableStringText("completeText", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "locCompleteText", { get: function () { return this.getLocalizableString("completeText") }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "previewText", { get: function () { return this.getLocalizableStringText("previewText") }, set: function (e) { this.setLocalizableStringText("previewText", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "locPreviewText", { get: function () { return this.getLocalizableString("previewText") }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "editText", { get: function () { return this.getLocalizableStringText("editText") }, set: function (e) { this.setLocalizableStringText("editText", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "locEditText", { get: function () { return this.getLocalizableString("editText") }, enumerable: !1, configurable: !0 }), t.prototype.getElementTitleTagName = function (e, t) { if (this.onGetTitleTagName.isEmpty) return t; var n = { element: e, tagName: t }; return this.onGetTitleTagName.fire(this, n), n.tagName }, Object.defineProperty(t.prototype, "questionTitlePattern", { get: function () { return this.getPropertyValue("questionTitlePattern", "numTitleRequire") }, set: function (e) { "numRequireTitle" !== e && "requireNumTitle" !== e && "numTitle" != e && (e = "numTitleRequire"), this.setPropertyValue("questionTitlePattern", e) }, enumerable: !1, configurable: !0 }), t.prototype.getQuestionTitlePatternOptions = function () { var e = new Array, t = this.getLocalizationString("questionTitlePatternText"), n = this.questionStartIndex ? this.questionStartIndex : "1."; return e.push({ value: "numTitleRequire", text: n + " " + t + " " + this.requiredText }), e.push({ value: "numRequireTitle", text: n + " " + this.requiredText + " " + t }), e.push({ value: "requireNumTitle", text: this.requiredText + " " + n + " " + t }), e.push({ value: "numTitle", text: n + " " + t }), e }, Object.defineProperty(t.prototype, "questionTitleTemplate", { get: function () { return this.getLocalizableStringText("questionTitleTemplate") }, set: function (e) { this.setLocalizableStringText("questionTitleTemplate", e), this.questionTitlePattern = this.getNewTitlePattern(e), this.questionStartIndex = this.getNewQuestionTitleElement(e, "no", this.questionStartIndex, "1"), this.requiredText = this.getNewQuestionTitleElement(e, "require", this.requiredText, "*") }, enumerable: !1, configurable: !0 }), t.prototype.getNewTitlePattern = function (e) { if (e) { for (var t = []; e.indexOf("{") > -1;) { var n = (e = e.substring(e.indexOf("{") + 1)).indexOf("}"); if (n < 0) break; t.push(e.substring(0, n)), e = e.substring(n + 1) } if (t.length > 1) { if ("require" == t[0]) return "requireNumTitle"; if ("require" == t[1] && 3 == t.length) return "numRequireTitle"; if (t.indexOf("require") < 0) return "numTitle" } if (1 == t.length && "title" == t[0]) return "numTitle" } return "numTitleRequire" }, t.prototype.getNewQuestionTitleElement = function (e, t, n, o) { if (t = "{" + t + "}", !e || e.indexOf(t) < 0) return n; for (var r = e.indexOf(t), i = "", s = "", a = r - 1; a >= 0 && "}" != e[a]; a--); for (a < r - 1 && (i = e.substring(a + 1, r)), a = r += t.length; a < e.length && "{" != e[a]; a++); for (a > r && (s = e.substring(r, a)), a = 0; a < i.length && i.charCodeAt(a) < 33;)a++; for (i = i.substring(a), a = s.length - 1; a >= 0 && s.charCodeAt(a) < 33;)a--; return s = s.substring(0, a + 1), i || s ? i + (n || o) + s : n }, Object.defineProperty(t.prototype, "locQuestionTitleTemplate", { get: function () { return this.getLocalizableString("questionTitleTemplate") }, enumerable: !1, configurable: !0 }), t.prototype.getUpdatedQuestionTitle = function (e, t) { if (this.onGetQuestionTitle.isEmpty) return t; var n = { question: e, title: t }; return this.onGetQuestionTitle.fire(this, n), n.title }, t.prototype.getUpdatedQuestionNo = function (e, t) { if (this.onGetQuestionNo.isEmpty) return t; var n = { question: e, no: t }; return this.onGetQuestionNo.fire(this, n), n.no }, Object.defineProperty(t.prototype, "showPageNumbers", { get: function () { return this.getPropertyValue("showPageNumbers", !1) }, set: function (e) { e !== this.showPageNumbers && (this.setPropertyValue("showPageNumbers", e), this.updateVisibleIndexes()) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "showQuestionNumbers", { get: function () { return this.getPropertyValue("showQuestionNumbers") }, set: function (e) { !0 === e && (e = "on"), !1 === e && (e = "off"), (e = "onpage" === (e = e.toLowerCase()) ? "onPage" : e) !== this.showQuestionNumbers && (this.setPropertyValue("showQuestionNumbers", e), this.updateVisibleIndexes()) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "showProgressBar", { get: function () { return this.getPropertyValue("showProgressBar") }, set: function (e) { this.setPropertyValue("showProgressBar", e.toLowerCase()) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "progressBarType", { get: function () { return this.getPropertyValue("progressBarType") }, set: function (e) { "correctquestion" === e && (e = "correctQuestion"), "requiredquestion" === e && (e = "requiredQuestion"), this.setPropertyValue("progressBarType", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "isShowProgressBarOnTop", { get: function () { return !!this.canShowProresBar() && ("top" === this.showProgressBar || "both" === this.showProgressBar) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "isShowProgressBarOnBottom", { get: function () { return !!this.canShowProresBar() && ("bottom" === this.showProgressBar || "both" === this.showProgressBar) }, enumerable: !1, configurable: !0 }), t.prototype.getProgressCssClasses = function () { return (new at).append(this.css.progress).append(this.css.progressTop, this.isShowProgressBarOnTop).append(this.css.progressBottom, this.isShowProgressBarOnBottom).toString() }, t.prototype.canShowProresBar = function () { return !this.isShowingPreview || "showAllQuestions" != this.showPreviewBeforeComplete }, Object.defineProperty(t.prototype, "processedTitle", { get: function () { return this.locTitle.renderedHtml }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "questionTitleLocation", { get: function () { return this.getPropertyValue("questionTitleLocation") }, set: function (e) { this.setPropertyValue("questionTitleLocation", e.toLowerCase()), this.isLoadingFromJson || this.updateElementCss(!0) }, enumerable: !1, configurable: !0 }), t.prototype.updateElementCss = function (e) { this.startedPage && this.startedPage.updateElementCss(e); for (var t = this.visiblePages, n = 0; n < t.length; n++)t[n].updateElementCss(e) }, Object.defineProperty(t.prototype, "questionErrorLocation", { get: function () { return this.getPropertyValue("questionErrorLocation") }, set: function (e) { this.setPropertyValue("questionErrorLocation", e.toLowerCase()) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "questionDescriptionLocation", { get: function () { return this.getPropertyValue("questionDescriptionLocation") }, set: function (e) { this.setPropertyValue("questionDescriptionLocation", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "mode", { get: function () { return this.getPropertyValue("mode") }, set: function (e) { (e = e.toLowerCase()) != this.mode && ("edit" != e && "display" != e || this.setPropertyValue("mode", e)) }, enumerable: !1, configurable: !0 }), t.prototype.onModeChanged = function () { for (var e = 0; e < this.pages.length; e++) { var t = this.pages[e]; t.setPropertyValue("isReadOnly", t.isReadOnly) } this.updateButtonsVisibility(), this.updateCss() }, Object.defineProperty(t.prototype, "data", { get: function () { for (var e = {}, t = this.getValuesKeys(), n = 0; n < t.length; n++) { var o = t[n], r = this.getDataValueCore(this.valuesHash, o); void 0 !== r && (e[o] = r) } return this.setCalculatedValuesIntoResult(e), e }, set: function (e) { this.valuesHash = {}, this.setDataCore(e) }, enumerable: !1, configurable: !0 }), t.prototype.mergeData = function (e) { if (e) { var t = this.data; this.mergeValues(e, t), this.setDataCore(t) } }, t.prototype.setDataCore = function (e) { if (e) for (var t in e) this.setDataValueCore(this.valuesHash, t, e[t]); this.updateAllQuestionsValue(), this.notifyAllQuestionsOnValueChanged(), this.notifyElementsOnAnyValueOrVariableChanged(""), this.runConditions(), this.updateAllQuestionsValue() }, Object.defineProperty(t.prototype, "editingObj", { get: function () { return this.editingObjValue }, set: function (e) { var t = this; if (this.editingObj != e && (this.editingObj && this.editingObj.onPropertyChanged.remove(this.onEditingObjPropertyChanged), this.editingObjValue = e, !this.isDisposed)) { if (!e) for (var n = this.getAllQuestions(), o = 0; o < n.length; o++)n[o].unbindValue(); this.editingObj && (this.setDataCore({}), this.onEditingObjPropertyChanged = function (e, n) { _.hasOriginalProperty(t.editingObj, n.name) && t.updateOnSetValue(n.name, t.editingObj[n.name], n.oldValue) }, this.editingObj.onPropertyChanged.add(this.onEditingObjPropertyChanged)) } }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "isEditingSurveyElement", { get: function () { return !!this.editingObj }, enumerable: !1, configurable: !0 }), t.prototype.setCalculatedValuesIntoResult = function (e) { for (var t = 0; t < this.calculatedValues.length; t++) { var n = this.calculatedValues[t]; n.includeIntoResult && n.name && void 0 !== this.getVariable(n.name) && (e[n.name] = this.getVariable(n.name)) } }, t.prototype.getAllValues = function () { return this.data }, t.prototype.getPlainData = function (e) { e || (e = { includeEmpty: !0, includeQuestionTypes: !1, includeValues: !1 }); var t = [], n = []; if (this.getAllQuestions().forEach((function (o) { var r = o.getPlainData(e); r && (t.push(r), n.push(o.valueName || o.name)) })), e.includeValues) for (var o = this.getValuesKeys(), r = 0; r < o.length; r++) { var i = o[r]; if (-1 == n.indexOf(i)) { var s = this.getDataValueCore(this.valuesHash, i); s && t.push({ name: i, title: i, value: s, displayValue: s, isNode: !1, getString: function (e) { return "object" == typeof e ? JSON.stringify(e) : e } }) } } return t }, t.prototype.getFilteredValues = function () { var e = {}; for (var t in this.variablesHash) e[t] = this.variablesHash[t]; this.addCalculatedValuesIntoFilteredValues(e); for (var n = this.getValuesKeys(), o = 0; o < n.length; o++) { e[t = n[o]] = this.getDataValueCore(this.valuesHash, t) } return e }, t.prototype.addCalculatedValuesIntoFilteredValues = function (e) { for (var t = this.calculatedValues, n = 0; n < t.length; n++)e[t[n].name] = t[n].value }, t.prototype.getFilteredProperties = function () { return { survey: this } }, t.prototype.getValuesKeys = function () { if (!this.editingObj) return Object.keys(this.valuesHash); for (var e = _.getPropertiesByObj(this.editingObj), t = [], n = 0; n < e.length; n++)t.push(e[n].name); return t }, t.prototype.getDataValueCore = function (e, t) { return this.editingObj ? _.getObjPropertyValue(this.editingObj, t) : this.getDataFromValueHash(e, t) }, t.prototype.setDataValueCore = function (e, t, n) { this.editingObj ? _.setObjPropertyValue(this.editingObj, t, n) : this.setDataToValueHash(e, t, n) }, t.prototype.deleteDataValueCore = function (e, t) { this.editingObj ? this.editingObj[t] = null : this.deleteDataFromValueHash(e, t) }, t.prototype.getDataFromValueHash = function (e, t) { return this.valueHashGetDataCallback ? this.valueHashGetDataCallback(e, t) : e[t] }, t.prototype.setDataToValueHash = function (e, t, n) { this.valueHashSetDataCallback ? this.valueHashSetDataCallback(e, t, n) : e[t] = n }, t.prototype.deleteDataFromValueHash = function (e, t) { this.valueHashDeleteDataCallback ? this.valueHashDeleteDataCallback(e, t) : delete e[t] }, Object.defineProperty(t.prototype, "comments", { get: function () { for (var e = {}, t = this.getValuesKeys(), n = 0; n < t.length; n++) { var o = t[n]; o.indexOf(this.commentSuffix) > 0 && (e[o] = this.getDataValueCore(this.valuesHash, o)) } return e }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "visiblePages", { get: function () { if (this.isDesignMode) return this.pages; for (var e = new Array, t = 0; t < this.pages.length; t++)this.isPageInVisibleList(this.pages[t]) && e.push(this.pages[t]); return e }, enumerable: !1, configurable: !0 }), t.prototype.isPageInVisibleList = function (e) { return this.isDesignMode || e.isVisible && !e.isStartPage }, Object.defineProperty(t.prototype, "isEmpty", { get: function () { return 0 == this.pages.length }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "PageCount", { get: function () { return this.pageCount }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "pageCount", { get: function () { return this.pages.length }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "visiblePageCount", { get: function () { return this.visiblePages.length }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "startedPage", { get: function () { var e = this.firstPageIsStarted && this.pages.length > 1 ? this.pages[0] : null; return e && (e.onFirstRendering(), e.setWasShown(!0)), e }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "currentPage", { get: function () { return this.getPropertyValue("currentPage", null) }, set: function (e) { if (!this.isLoadingFromJson) { var t = this.getPageByObject(e); if ((!e || t) && (t || !this.isCurrentPageAvailable)) { var n = this.visiblePages; if (!(null != t && n.indexOf(t) < 0) && t != this.currentPage) { var o = this.currentPage; this.currentPageChanging(t, o) && (this.setPropertyValue("currentPage", t), t && (t.onFirstRendering(), t.updateCustomWidgets(), t.setWasShown(!0)), this.locStrsChanged(), this.currentPageChanged(t, o)) } } } }, enumerable: !1, configurable: !0 }), t.prototype.updateCurrentPage = function () { this.isCurrentPageAvailable || (this.currentPage = this.firstVisiblePage) }, Object.defineProperty(t.prototype, "isCurrentPageAvailable", { get: function () { var e = this.currentPage; return !!e && this.isPageInVisibleList(e) && this.isPageExistsInSurvey(e) }, enumerable: !1, configurable: !0 }), t.prototype.isPageExistsInSurvey = function (e) { return this.pages.indexOf(e) > -1 || !!this.onContainsPageCallback && this.onContainsPageCallback(e) }, Object.defineProperty(t.prototype, "activePage", { get: function () { return this.getPropertyValue("activePage") }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "isShowStartingPage", { get: function () { return "starting" === this.state }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "isShowingPage", { get: function () { return "running" == this.state || "preview" == this.state || this.isShowStartingPage }, enumerable: !1, configurable: !0 }), t.prototype.updateActivePage = function () { var e = this.isShowStartingPage ? this.startedPage : this.currentPage; this.setPropertyValue("activePage", e) }, t.prototype.onStateAndCurrentPageChanged = function () { this.updateActivePage(), this.updateButtonsVisibility() }, t.prototype.getPageByObject = function (e) { if (!e) return null; if (e.getType && "page" == e.getType()) return e; if ("string" == typeof e || e instanceof String) return this.getPageByName(String(e)); if (!isNaN(e)) { var t = Number(e), n = this.visiblePages; return e < 0 || e >= n.length ? null : n[t] } return e }, Object.defineProperty(t.prototype, "currentPageNo", { get: function () { return this.visiblePages.indexOf(this.currentPage) }, set: function (e) { var t = this.visiblePages; e < 0 || e >= t.length || (this.currentPage = t[e]) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "questionsOrder", { get: function () { return this.getPropertyValue("questionsOrder") }, set: function (e) { this.setPropertyValue("questionsOrder", e) }, enumerable: !1, configurable: !0 }), t.prototype.focusFirstQuestion = function () { if (!this.isFocusingQuestion) { var e = this.activePage; e && (e.scrollToTop(), e.focusFirstQuestion()) } }, t.prototype.scrollToTopOnPageChange = function (e) { void 0 === e && (e = !0); var t = this.activePage; t && (e && t.scrollToTop(), this.isCurrentPageRendering && this.focusFirstQuestionAutomatic && !this.isFocusingQuestion && (t.focusFirstQuestion(), this.isCurrentPageRendering = !1)) }, Object.defineProperty(t.prototype, "state", { get: function () { return this.getPropertyValue("state", "empty") }, enumerable: !1, configurable: !0 }), t.prototype.updateState = function () { this.setPropertyValue("state", this.calcState()) }, t.prototype.calcState = function () { return this.isLoading ? "loading" : this.isCompleted ? "completed" : this.isCompletedBefore ? "completedbefore" : !this.isDesignMode && this.isEditMode && this.isStartedState && this.startedPage ? "starting" : this.isShowingPreview ? this.currentPage ? "preview" : "empty" : this.currentPage ? "running" : "empty" }, Object.defineProperty(t.prototype, "isCompleted", { get: function () { return this.getPropertyValue("isCompleted", !1) }, set: function (e) { this.setPropertyValue("isCompleted", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "isShowingPreview", { get: function () { return this.getPropertyValue("isShowingPreview", !1) }, set: function (e) { this.isShowingPreview != e && (this.setPropertyValue("isShowingPreview", e), this.onShowingPreviewChanged()) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "isStartedState", { get: function () { return this.getPropertyValue("isStartedState", !1) }, set: function (e) { this.setPropertyValue("isStartedState", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "isCompletedBefore", { get: function () { return this.getPropertyValue("isCompletedBefore", !1) }, set: function (e) { this.setPropertyValue("isCompletedBefore", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "isLoading", { get: function () { return this.getPropertyValue("isLoading", !1) }, set: function (e) { this.setPropertyValue("isLoading", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "completedState", { get: function () { return this.getPropertyValue("completedState", "") }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "completedStateText", { get: function () { return this.getPropertyValue("completedStateText", "") }, enumerable: !1, configurable: !0 }), t.prototype.setCompletedState = function (e, t) { this.setPropertyValue("completedState", e), t || ("saving" == e && (t = this.getLocalizationString("savingData")), "error" == e && (t = this.getLocalizationString("savingDataError")), "success" == e && (t = this.getLocalizationString("savingDataSuccess"))), this.setPropertyValue("completedStateText", t), "completed" === this.state && this.showCompletedPage && this.completedState && this.notify(this.completedStateText, this.completedState) }, t.prototype.notify = function (e, t) { this.notifier.notify(e, t) }, t.prototype.clear = function (e, t) { void 0 === e && (e = !0), void 0 === t && (t = !0), this.isCompleted = !1, this.isCompletedBefore = !1, this.isLoading = !1, this.canBeCompletedByTrigger = !1, e && (this.data = null, this.variablesHash = {}), this.timerModel.spent = 0; for (var n = 0; n < this.pages.length; n++)this.pages[n].timeSpent = 0, this.pages[n].setWasShown(!1), this.pages[n].passed = !1; this.onFirstPageIsStartedChanged(), t && (this.currentPage = this.firstVisiblePage), e && this.updateValuesWithDefaults() }, t.prototype.mergeValues = function (e, t) { ot(e, t) }, t.prototype.updateValuesWithDefaults = function () { if (!this.isDesignMode && !this.isLoading) for (var e = 0; e < this.pages.length; e++)for (var t = this.pages[e].questions, n = 0; n < t.length; n++)t[n].updateValueWithDefaults() }, t.prototype.updateCustomWidgets = function (e) { e && e.updateCustomWidgets() }, t.prototype.currentPageChanging = function (e, t) { var n = { oldCurrentPage: t, newCurrentPage: e, allowChanging: !0, allow: !0, isNextPage: this.isNextPage(e, t), isPrevPage: this.isPrevPage(e, t) }; this.onCurrentPageChanging.fire(this, n); var o = n.allowChanging && n.allow; return o && (this.isCurrentPageRendering = !0), o }, t.prototype.currentPageChanged = function (e, t) { var n = this.isNextPage(e, t); n && (t.passed = !0), this.onCurrentPageChanged.fire(this, { oldCurrentPage: t, newCurrentPage: e, isNextPage: n, isPrevPage: this.isPrevPage(e, t) }) }, t.prototype.isNextPage = function (e, t) { return !(!e || !t) && e.visibleIndex == t.visibleIndex + 1 }, t.prototype.isPrevPage = function (e, t) { return !(!e || !t) && e.visibleIndex + 1 == t.visibleIndex }, t.prototype.getProgress = function () { if (null == this.currentPage) return 0; if ("pages" !== this.progressBarType) { var e = this.getProgressInfo(); return "requiredQuestions" === this.progressBarType ? e.requiredQuestionCount >= 1 ? Math.ceil(100 * e.requiredAnsweredQuestionCount / e.requiredQuestionCount) : 100 : e.questionCount >= 1 ? Math.ceil(100 * e.answeredQuestionCount / e.questionCount) : 100 } var t = this.visiblePages, n = t.indexOf(this.currentPage) + 1; return Math.ceil(100 * n / t.length) }, Object.defineProperty(t.prototype, "progressValue", { get: function () { return this.getPropertyValue("progressValue", 0) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "isNavigationButtonsShowing", { get: function () { if (this.isDesignMode) return "none"; var e = this.currentPage; return e ? "show" === e.navigationButtonsVisibility ? "bottom" : "hide" === e.navigationButtonsVisibility ? "none" : this.showNavigationButtons : "none" }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "isNavigationButtonsShowingOnTop", { get: function () { return this.getIsNavigationButtonsShowingOn("top") }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "isNavigationButtonsShowingOnBottom", { get: function () { return this.getIsNavigationButtonsShowingOn("bottom") }, enumerable: !1, configurable: !0 }), t.prototype.getIsNavigationButtonsShowingOn = function (e) { var t = this.isNavigationButtonsShowing; return "both" == t || t == e }, Object.defineProperty(t.prototype, "isEditMode", { get: function () { return "edit" == this.mode }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "isDisplayMode", { get: function () { return "display" == this.mode || "preview" == this.state }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "isUpdateValueTextOnTyping", { get: function () { return "onTyping" == this.textUpdateMode }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "isDesignMode", { get: function () { return this._isDesignMode }, enumerable: !1, configurable: !0 }), t.prototype.setDesignMode = function (e) { this._isDesignMode = e, this.onQuestionsOnPageModeChanged("standard") }, Object.defineProperty(t.prototype, "showInvisibleElements", { get: function () { return this.getPropertyValue("showInvisibleElements", !1) }, set: function (e) { var t = this.visiblePages; this.setPropertyValue("showInvisibleElements", e), this.isLoadingFromJson || (this.runConditions(), this.updateAllElementsVisibility(t)) }, enumerable: !1, configurable: !0 }), t.prototype.updateAllElementsVisibility = function (e) { for (var t = 0; t < this.pages.length; t++) { var n = this.pages[t]; n.updateElementVisibility(), e.indexOf(n) > -1 != n.isVisible && this.onPageVisibleChanged.fire(this, { page: n, visible: n.isVisible }) } }, Object.defineProperty(t.prototype, "areInvisibleElementsShowing", { get: function () { return this.isDesignMode || this.showInvisibleElements }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "areEmptyElementsHidden", { get: function () { return this.isShowingPreview && "showAnsweredQuestions" == this.showPreviewBeforeComplete }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "hasCookie", { get: function () { if (!this.cookieName || "undefined" == typeof document) return !1; var e = document.cookie; return e && e.indexOf(this.cookieName + "=true") > -1 }, enumerable: !1, configurable: !0 }), t.prototype.setCookie = function () { this.cookieName && "undefined" != typeof document && (document.cookie = this.cookieName + "=true; expires=Fri, 31 Dec 9999 0:0:0 GMT") }, t.prototype.deleteCookie = function () { this.cookieName && (document.cookie = this.cookieName + "=;") }, t.prototype.nextPage = function () { return !this.isLastPage && this.doCurrentPageComplete(!1) }, t.prototype.hasErrorsOnNavigate = function (e) { var t = this; if (this.ignoreValidation || !this.isEditMode) return !1; var n = function (n) { n || t.doCurrentPageCompleteCore(e) }; return "onComplete" === this.checkErrorsMode ? !!this.isLastPage && !0 !== this.validate(!0, !0, n) : !0 !== this.validateCurrentPage(n) }, t.prototype.checkForAsyncQuestionValidation = function (e, t) { var n = this; this.clearAsyncValidationQuesitons(); for (var o = function () { if (e[i].isRunningValidators) { var o = e[i]; o.onCompletedAsyncValidators = function (e) { n.onCompletedAsyncQuestionValidators(o, t, e) }, r.asyncValidationQuesitons.push(e[i]) } }, r = this, i = 0; i < e.length; i++)o(); return this.asyncValidationQuesitons.length > 0 }, t.prototype.clearAsyncValidationQuesitons = function () { if (this.asyncValidationQuesitons) for (var e = this.asyncValidationQuesitons, t = 0; t < e.length; t++)e[t].onCompletedAsyncValidators = null; this.asyncValidationQuesitons = [] }, t.prototype.onCompletedAsyncQuestionValidators = function (e, t, n) { if (n) { if (this.clearAsyncValidationQuesitons(), t(!0), this.focusOnFirstError && e && e.page && e.page === this.currentPage) { for (var o = this.currentPage.questions, r = 0; r < o.length; r++)if (o[r] !== e && o[r].errors.length > 0) return; e.focus(!0) } } else { for (var i = this.asyncValidationQuesitons, s = 0; s < i.length; s++)if (i[s].isRunningValidators) return; t(!1) } }, Object.defineProperty(t.prototype, "isCurrentPageHasErrors", { get: function () { return this.checkIsCurrentPageHasErrors() }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "isCurrentPageValid", { get: function () { return !this.checkIsCurrentPageHasErrors() }, enumerable: !1, configurable: !0 }), t.prototype.hasCurrentPageErrors = function (e) { return this.hasPageErrors(void 0, e) }, t.prototype.validateCurrentPage = function (e) { return this.validatePage(void 0, e) }, t.prototype.hasPageErrors = function (e, t) { var n = this.validatePage(e, t); return void 0 === n ? n : !n }, t.prototype.validatePage = function (e, t) { return e || (e = this.activePage), !e || !this.checkIsPageHasErrors(e) && (!t || (!this.checkForAsyncQuestionValidation(e.questions, (function (e) { return t(e) })) || void 0)) }, t.prototype.hasErrors = function (e, t, n) { void 0 === e && (e = !0), void 0 === t && (t = !1); var o = this.validate(e, t, n); return void 0 === o ? o : !o }, t.prototype.validate = function (e, t, n) { void 0 === e && (e = !0), void 0 === t && (t = !1), n && (e = !0); for (var o = this.visiblePages, r = null, i = !0, s = 0; s < o.length; s++)o[s].validate(e, !1) || (r || (r = o[s]), i = !1); if (t && r) { this.currentPage = r; var a = r.questions; for (s = 0; s < a.length; s++)if (a[s].errors.length > 0) { a[s].focus(!0); break } } return i && n ? !this.checkForAsyncQuestionValidation(this.getAllQuestions(), (function (e) { return n(e) })) || void 0 : i }, t.prototype.ensureUniqueNames = function (e) { if (void 0 === e && (e = null), null == e) for (var t = 0; t < this.pages.length; t++)this.ensureUniqueName(this.pages[t]); else this.ensureUniqueName(e) }, t.prototype.ensureUniqueName = function (e) { if (e.isPage && this.ensureUniquePageName(e), e.isPanel && this.ensureUniquePanelName(e), e.isPage || e.isPanel) for (var t = e.elements, n = 0; n < t.length; n++)this.ensureUniqueNames(t[n]); else this.ensureUniqueQuestionName(e) }, t.prototype.ensureUniquePageName = function (e) { var t = this; return this.ensureUniqueElementName(e, (function (e) { return t.getPageByName(e) })) }, t.prototype.ensureUniquePanelName = function (e) { var t = this; return this.ensureUniqueElementName(e, (function (e) { return t.getPanelByName(e) })) }, t.prototype.ensureUniqueQuestionName = function (e) { var t = this; return this.ensureUniqueElementName(e, (function (e) { return t.getQuestionByName(e) })) }, t.prototype.ensureUniqueElementName = function (e, t) { var n = t(e.name); if (n && n != e) { for (var o = this.getNewName(e.name); t(o);)o = this.getNewName(e.name); e.name = o } }, t.prototype.getNewName = function (e) { for (var t = e.length; t > 0 && e[t - 1] >= "0" && e[t - 1] <= "9";)t--; var n = e.substring(0, t), o = 0; return t < e.length && (o = parseInt(e.substring(t))), n + ++o }, t.prototype.checkIsCurrentPageHasErrors = function (e) { return void 0 === e && (e = void 0), this.checkIsPageHasErrors(this.activePage, e) }, t.prototype.checkIsPageHasErrors = function (e, t) { if (void 0 === t && (t = void 0), void 0 === t && (t = this.focusOnFirstError), !e) return !0; var n = !e.validate(!0, t); return this.fireValidatedErrorsOnPage(e), n }, t.prototype.fireValidatedErrorsOnPage = function (e) { if (!this.onValidatedErrorsOnCurrentPage.isEmpty && e) { for (var t = e.questions, n = new Array, o = new Array, r = 0; r < t.length; r++) { var i = t[r]; if (i.errors.length > 0) { n.push(i); for (var s = 0; s < i.errors.length; s++)o.push(i.errors[s]) } } this.onValidatedErrorsOnCurrentPage.fire(this, { questions: n, errors: o, page: e }) } }, t.prototype.prevPage = function () { var e = this; if (this.isFirstPage || "starting" === this.state) return !1; this.resetNavigationButton(); var t = this.skippedPages.find((function (t) { return t.to == e.currentPage })); if (t) this.currentPage = t.from, this.skippedPages.splice(this.skippedPages.indexOf(t), 1); else { var n = this.visiblePages, o = n.indexOf(this.currentPage); this.currentPage = n[o - 1] } return !0 }, t.prototype.completeLastPage = function () { var e = this.doCurrentPageComplete(!0); return e && this.cancelPreview(), e }, t.prototype.navigationMouseDown = function () { return this.isNavigationButtonPressed = !0, !0 }, t.prototype.resetNavigationButton = function () { this.isNavigationButtonPressed = !1 }, t.prototype.nextPageUIClick = function () { this.mouseDownPage && this.mouseDownPage !== this.activePage || (this.mouseDownPage = null, this.nextPage()) }, t.prototype.nextPageMouseDown = function () { return this.mouseDownPage = this.activePage, this.navigationMouseDown() }, t.prototype.showPreview = function () { return this.resetNavigationButton(), !this.hasErrorsOnNavigate(!0) && (!this.doServerValidation(!0, !0) && (this.showPreviewCore(), !0)) }, t.prototype.showPreviewCore = function () { var e = { allowShowPreview: !0, allow: !0 }; this.onShowingPreview.fire(this, e), this.isShowingPreview = e.allowShowPreview && e.allow }, t.prototype.cancelPreview = function (e) { void 0 === e && (e = null), this.isShowingPreview && (this.isShowingPreview = !1, r.isValueEmpty(e) && this.visiblePageCount > 0 && (e = this.visiblePageCount - 1), null !== e && (this.currentPage = e)) }, t.prototype.cancelPreviewByPage = function (e) { this.cancelPreview(e.originalPage) }, t.prototype.doCurrentPageComplete = function (e) { return !this.isValidatingOnServer && (this.resetNavigationButton(), !this.hasErrorsOnNavigate(e) && this.doCurrentPageCompleteCore(e)) }, t.prototype.doCurrentPageCompleteCore = function (e) { return !this.doServerValidation(e) && (e ? (this.currentPage.passed = !0, this.doComplete()) : (this.doNextPage(), !0)) }, Object.defineProperty(t.prototype, "isSinglePage", { get: function () { return "singlePage" == this.questionsOnPageMode }, set: function (e) { this.questionsOnPageMode = e ? "singlePage" : "standard" }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "questionsOnPageMode", { get: function () { return this.getPropertyValue("questionsOnPageMode") }, set: function (e) { this.setPropertyValue("questionsOnPageMode", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "firstPageIsStarted", { get: function () { return this.getPropertyValue("firstPageIsStarted", !1) }, set: function (e) { this.setPropertyValue("firstPageIsStarted", e) }, enumerable: !1, configurable: !0 }), t.prototype.isPageStarted = function (e) { return this.firstPageIsStarted && this.pages.length > 1 && this.pages[0] === e }, Object.defineProperty(t.prototype, "showPreviewBeforeComplete", { get: function () { return this.getPropertyValue("showPreviewBeforeComplete") }, set: function (e) { this.setPropertyValue("showPreviewBeforeComplete", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "isShowPreviewBeforeComplete", { get: function () { var e = this.showPreviewBeforeComplete; return "showAllQuestions" == e || "showAnsweredQuestions" == e }, enumerable: !1, configurable: !0 }), t.prototype.onFirstPageIsStartedChanged = function () { this.isStartedState = this.firstPageIsStarted && this.pages.length > 1, this.pageVisibilityChanged(this.pages[0], !this.isStartedState) }, t.prototype.onShowingPreviewChanged = function () { this.isDesignMode || (this.isShowingPreview ? (this.runningPages = this.pages.slice(0, this.pages.length), this.setupPagesForPageModes(!0)) : (this.runningPages && this.restoreOrigionalPages(this.runningPages), this.runningPages = void 0), this.runConditions(), this.updateAllElementsVisibility(this.pages), this.updateVisibleIndexes(), this.currentPageNo = 0) }, t.prototype.onQuestionsOnPageModeChanged = function (e) { this.isShowingPreview || ("standard" == this.questionsOnPageMode || this.isDesignMode ? (this.origionalPages && this.restoreOrigionalPages(this.origionalPages), this.origionalPages = void 0) : (e && "standard" != e || (this.origionalPages = this.pages.slice(0, this.pages.length)), this.setupPagesForPageModes(this.isSinglePage)), this.runConditions(), this.updateVisibleIndexes()) }, t.prototype.restoreOrigionalPages = function (e) { this.questionHashesClear(), this.pages.splice(0, this.pages.length); for (var t = 0; t < e.length; t++)this.pages.push(e[t]) }, t.prototype.getPageStartIndex = function () { return this.firstPageIsStarted && this.pages.length > 0 ? 1 : 0 }, t.prototype.setupPagesForPageModes = function (t) { this.questionHashesClear(); var n = this.getPageStartIndex(); e.prototype.startLoadingFromJson.call(this); var o = this.createPagesForQuestionOnPageMode(t, n), r = this.pages.length - n; this.pages.splice(n, r); for (var i = 0; i < o.length; i++)this.pages.push(o[i]); e.prototype.endLoadingFromJson.call(this); for (i = 0; i < o.length; i++)o[i].setSurveyImpl(this, !0); this.doElementsOnLoad(), this.updateCurrentPage() }, t.prototype.createPagesForQuestionOnPageMode = function (e, t) { return e ? [this.createSinglePage(t)] : this.createPagesForEveryQuestion(t) }, t.prototype.createSinglePage = function (e) { var t = this.createNewPage("all"); t.setSurveyImpl(this); for (var n = e; n < this.pages.length; n++) { var o = this.pages[n], r = _.createClass("panel"); r.originalPage = o, t.addPanel(r); var i = (new S).toJsonObject(o); (new S).toObject(i, r), this.showPageTitles || (r.title = "") } return t }, t.prototype.createPagesForEveryQuestion = function (e) { for (var t = [], n = e; n < this.pages.length; n++) { var o = this.pages[n]; o.setWasShown(!0); for (var r = 0; r < o.elements.length; r++) { var i = o.elements[r], s = _.createClass(i.getType()); if (s) { var a = new S; a.lightSerializing = !0; var l = a.toJsonObject(o), u = _.createClass(o.getType()); u.fromJSON(l), u.name = i.name, u.setSurveyImpl(this), t.push(u); var c = (new S).toJsonObject(i); u.addElement(s), (new S).toObject(c, s); for (var p = 0; p < u.questions.length; p++)this.questionHashesAdded(u.questions[p]) } } } return t }, Object.defineProperty(t.prototype, "isFirstPage", { get: function () { return this.getPropertyValue("isFirstPage") }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "isLastPage", { get: function () { return this.getPropertyValue("isLastPage") }, enumerable: !1, configurable: !0 }), t.prototype.updateButtonsVisibility = function () { this.updateIsFirstLastPageState(), this.setPropertyValue("isShowPrevButton", this.calcIsShowPrevButton()), this.setPropertyValue("isShowNextButton", this.calcIsShowNextButton()), this.setPropertyValue("isCompleteButtonVisible", this.calcIsCompleteButtonVisible()), this.setPropertyValue("isPreviewButtonVisible", this.calcIsPreviewButtonVisible()), this.setPropertyValue("isCancelPreviewButtonVisible", this.calcIsCancelPreviewButtonVisible()) }, Object.defineProperty(t.prototype, "isShowPrevButton", { get: function () { return this.getPropertyValue("isShowPrevButton") }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "isShowNextButton", { get: function () { return this.getPropertyValue("isShowNextButton") }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "isCompleteButtonVisible", { get: function () { return this.getPropertyValue("isCompleteButtonVisible") }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "isPreviewButtonVisible", { get: function () { return this.getPropertyValue("isPreviewButtonVisible") }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "isCancelPreviewButtonVisible", { get: function () { return this.getPropertyValue("isCancelPreviewButtonVisible") }, enumerable: !1, configurable: !0 }), t.prototype.updateIsFirstLastPageState = function () { var e = this.currentPage; this.setPropertyValue("isFirstPage", !!e && e === this.firstVisiblePage), this.setPropertyValue("isLastPage", !!e && e === this.lastVisiblePage) }, t.prototype.calcIsShowPrevButton = function () { if (this.isFirstPage || !this.showPrevButton || "running" !== this.state) return !1; var e = this.visiblePages[this.currentPageNo - 1]; return this.getPageMaxTimeToFinish(e) <= 0 }, t.prototype.calcIsShowNextButton = function () { return "running" === this.state && !this.isLastPage && !this.canBeCompletedByTrigger }, t.prototype.calcIsCompleteButtonVisible = function () { var e = this.state; return this.isEditMode && ("running" === this.state && (this.isLastPage && !this.isShowPreviewBeforeComplete || this.canBeCompletedByTrigger) || "preview" === e) }, t.prototype.calcIsPreviewButtonVisible = function () { return this.isEditMode && this.isShowPreviewBeforeComplete && "running" == this.state && this.isLastPage }, t.prototype.calcIsCancelPreviewButtonVisible = function () { return this.isEditMode && this.isShowPreviewBeforeComplete && "preview" == this.state }, Object.defineProperty(t.prototype, "firstVisiblePage", { get: function () { for (var e = this.pages, t = 0; t < e.length; t++)if (this.isPageInVisibleList(e[t])) return e[t]; return null }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "lastVisiblePage", { get: function () { for (var e = this.pages, t = e.length - 1; t >= 0; t--)if (this.isPageInVisibleList(e[t])) return e[t]; return null }, enumerable: !1, configurable: !0 }), t.prototype.doComplete = function (e) { var t = this; if (void 0 === e && (e = !1), !this.isCompleted) { if (!this.checkOnCompletingEvent(e)) return this.isCompleted = !1, !1; var n = this.hasCookie; this.stopTimer(), this.isCompleted = !0, this.clearUnusedValues(), this.setCookie(); var o = function (e) { a = !0, t.setCompletedState("saving", e) }, r = function (e) { t.setCompletedState("error", e) }, i = function (e) { t.setCompletedState("success", e), t.navigateTo() }, s = function (e) { t.setCompletedState("", "") }, a = !1, l = { isCompleteOnTrigger: e, showSaveInProgress: o, showSaveError: r, showSaveSuccess: i, clearSaveMessages: s, showDataSaving: o, showDataSavingError: r, showDataSavingSuccess: i, showDataSavingClear: s }; return this.onComplete.fire(this, l), !n && this.surveyPostId && this.sendResult(), a || this.navigateTo(), !0 } }, t.prototype.checkOnCompletingEvent = function (e) { var t = { allowComplete: !0, allow: !0, isCompleteOnTrigger: e }; return this.onCompleting.fire(this, t), t.allowComplete && t.allow }, t.prototype.start = function () { return !!this.firstPageIsStarted && (!this.checkIsPageHasErrors(this.startedPage, !0) && (this.isStartedState = !1, this.startTimerFromUI(), this.onStarted.fire(this, {}), this.updateVisibleIndexes(), this.currentPage && this.currentPage.locStrsChanged(), !0)) }, Object.defineProperty(t.prototype, "isValidatingOnServer", { get: function () { return this.getPropertyValue("isValidatingOnServer", !1) }, enumerable: !1, configurable: !0 }), t.prototype.setIsValidatingOnServer = function (e) { e != this.isValidatingOnServer && (this.setPropertyValue("isValidatingOnServer", e), this.onIsValidatingOnServerChanged()) }, t.prototype.createServerValidationOptions = function (e, t) { var n = this, o = { data: {}, errors: {}, survey: this, complete: function () { n.completeServerValidation(o, t) } }; if (e && "onComplete" === this.checkErrorsMode) o.data = this.data; else for (var r = this.activePage.questions, i = 0; i < r.length; i++) { var s = r[i]; if (s.visible) { var a = this.getValue(s.getValueName()); this.isValueEmpty(a) || (o.data[s.getValueName()] = a) } } return o }, t.prototype.onIsValidatingOnServerChanged = function () { }, t.prototype.doServerValidation = function (e, t) { var n = this; if (void 0 === t && (t = !1), !this.onServerValidateQuestions || this.onServerValidateQuestions.isEmpty) return !1; if (!e && "onComplete" === this.checkErrorsMode) return !1; this.setIsValidatingOnServer(!0); var o = "function" == typeof this.onServerValidateQuestions; return this.serverValidationEventCount = o ? 1 : this.onServerValidateQuestions.length, o ? this.onServerValidateQuestions(this, this.createServerValidationOptions(e, t)) : this.onServerValidateQuestions.fireByCreatingOptions(this, (function () { return n.createServerValidationOptions(e, t) })), !0 }, t.prototype.completeServerValidation = function (e, t) { if (!(this.serverValidationEventCount > 1 && (this.serverValidationEventCount--, e && e.errors && 0 === Object.keys(e.errors).length)) && (this.serverValidationEventCount = 0, this.setIsValidatingOnServer(!1), e || e.survey)) { var n = e.survey, o = !1; if (e.errors) { var r = this.focusOnFirstError; for (var i in e.errors) { var s = n.getQuestionByName(i); s && s.errors && (o = !0, s.addError(new Se(e.errors[i], this)), r && (r = !1, s.page && (this.currentPage = s.page), s.focus(!0))) } this.fireValidatedErrorsOnPage(this.currentPage) } o || (t ? this.showPreviewCore() : n.isLastPage ? n.doComplete() : n.doNextPage()) } }, t.prototype.doNextPage = function () { var e = this.currentPage; if (this.checkOnPageTriggers(), this.isCompleted) this.doComplete(!0); else if (this.sendResultOnPageNext && this.sendResult(this.surveyPostId, this.clientId, !0), e === this.currentPage) { var t = this.visiblePages, n = t.indexOf(this.currentPage); this.currentPage = t[n + 1] } }, t.prototype.setCompleted = function () { this.doComplete(!0) }, t.prototype.canBeCompleted = function () { o.changeNavigationButtonsOnCompleteTrigger && (this.canBeCompletedByTrigger || (this.canBeCompletedByTrigger = !0, this.updateButtonsVisibility())) }, Object.defineProperty(t.prototype, "processedCompletedHtml", { get: function () { var e = this.renderedCompletedHtml; return e ? this.processHtml(e) : "" }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "processedCompletedBeforeHtml", { get: function () { return this.processHtml(this.completedBeforeHtml) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "processedLoadingHtml", { get: function () { return this.processHtml(this.loadingHtml) }, enumerable: !1, configurable: !0 }), t.prototype.getProgressInfo = function () { var e = this.isDesignMode ? this.pages : this.visiblePages; return At.getProgressInfoByElements(e, !1) }, Object.defineProperty(t.prototype, "progressText", { get: function () { var e = this.getPropertyValue("progressText", ""); return e || (this.updateProgressText(), e = this.getPropertyValue("progressText", "")), e }, enumerable: !1, configurable: !0 }), t.prototype.updateProgressText = function (e) { void 0 === e && (e = !1), this.isCalculatingProgressText || e && "pages" == this.progressBarType && this.onProgressText.isEmpty || (this.isCalculatingProgressText = !0, this.setPropertyValue("progressText", this.getProgressText()), this.setPropertyValue("progressValue", this.getProgress()), this.isCalculatingProgressText = !1) }, t.prototype.getProgressText = function () { if (!this.isDesignMode && null == this.currentPage) return ""; var e = { questionCount: 0, answeredQuestionCount: 0, requiredQuestionCount: 0, requiredAnsweredQuestionCount: 0, text: "" }, t = this.progressBarType.toLowerCase(); if ("questions" === t || "requiredquestions" === t || "correctquestions" === t || !this.onProgressText.isEmpty) { var n = this.getProgressInfo(); e.questionCount = n.questionCount, e.answeredQuestionCount = n.answeredQuestionCount, e.requiredQuestionCount = n.requiredQuestionCount, e.requiredAnsweredQuestionCount = n.requiredAnsweredQuestionCount } return e.text = this.getProgressTextCore(e), this.onProgressText.fire(this, e), e.text }, t.prototype.getProgressTextCore = function (e) { var t = this.progressBarType.toLowerCase(); if ("questions" === t) return this.getLocalizationFormatString("questionsProgressText", e.answeredQuestionCount, e.questionCount); if ("requiredquestions" === t) return this.getLocalizationFormatString("questionsProgressText", e.requiredAnsweredQuestionCount, e.requiredQuestionCount); if ("correctquestions" === t) { var n = this.getCorrectedAnswerCount(); return this.getLocalizationFormatString("questionsProgressText", n, e.questionCount) } var o = this.isDesignMode ? this.pages : this.visiblePages, r = o.indexOf(this.currentPage) + 1; return this.getLocalizationFormatString("progressText", r, o.length) }, t.prototype.getRootCss = function () { return (new at).append(this.css.root).append(this.css.rootMobile, this.isMobile).append(this.css.rootReadOnly, "display" === this.mode).toString() }, t.prototype.afterRenderSurvey = function (e) { var t = this; this.destroyResizeObserver(), Array.isArray(e) && (e = At.GetFirstNonTextElement(e)); var n = e, o = this.css.variables; if (o) { var r = Number.parseFloat(window.getComputedStyle(n).getPropertyValue(o.mobileWidth)); if (r) { var i = !1; this.resizeObserver = new ResizeObserver((function () { i = !(i || !tt(n)) && t.processResponsiveness(n.offsetWidth, r) })), this.resizeObserver.observe(n) } } this.onAfterRenderSurvey.fire(this, { survey: this, htmlElement: e }) }, t.prototype.processResponsiveness = function (e, t) { var n = e < t; return this.isMobile !== n && (this.setIsMobile(n), !0) }, t.prototype.destroyResizeObserver = function () { this.resizeObserver && (this.resizeObserver.disconnect(), this.resizeObserver = void 0) }, t.prototype.updateQuestionCssClasses = function (e, t) { this.onUpdateQuestionCssClasses.fire(this, { question: e, cssClasses: t }) }, t.prototype.updatePanelCssClasses = function (e, t) { this.onUpdatePanelCssClasses.fire(this, { panel: e, cssClasses: t }) }, t.prototype.updatePageCssClasses = function (e, t) { this.onUpdatePageCssClasses.fire(this, { page: e, cssClasses: t }) }, t.prototype.updateChoiceItemCss = function (e, t) { t.question = e, this.onUpdateChoiceItemCss.fire(this, t) }, t.prototype.afterRenderPage = function (e) { var t = this; for (this.isDesignMode || this.isFocusingQuestion || setTimeout((function () { return t.scrollToTopOnPageChange(!t.isFirstPageRendering) }), 1); this.afterRenderPageTasks.length > 0;)this.afterRenderPageTasks.shift()(); this.isFirstPageRendering = !1, this.onAfterRenderPage.isEmpty || this.onAfterRenderPage.fire(this, { page: this.activePage, htmlElement: e }) }, t.prototype.afterRenderHeader = function (e) { this.onAfterRenderHeader.isEmpty || this.onAfterRenderHeader.fire(this, { htmlElement: e }) }, t.prototype.afterRenderQuestion = function (e, t) { this.onAfterRenderQuestion.fire(this, { question: e, htmlElement: t }) }, t.prototype.afterRenderQuestionInput = function (e, t) { if (!this.onAfterRenderQuestionInput.isEmpty) { var n = e.inputId; if (n && t.id !== n && "undefined" != typeof document) { var o = document.getElementById(n); o && (t = o) } this.onAfterRenderQuestionInput.fire(this, { question: e, htmlElement: t }) } }, t.prototype.afterRenderPanel = function (e, t) { this.onAfterRenderPanel.fire(this, { panel: e, htmlElement: t }) }, t.prototype.whenQuestionFocusIn = function (e) { this.onFocusInQuestion.fire(this, { question: e }) }, t.prototype.whenPanelFocusIn = function (e) { this.onFocusInPanel.fire(this, { panel: e }) }, t.prototype.rebuildQuestionChoices = function () { this.getAllQuestions().forEach((function (e) { return e.surveyChoiceItemVisibilityChange() })) }, t.prototype.canChangeChoiceItemsVisibility = function () { return !this.onShowingChoiceItem.isEmpty }, t.prototype.getChoiceItemVisibility = function (e, t, n) { var o = { question: e, item: t, visible: n }; return this.onShowingChoiceItem.fire(this, o), o.visible }, t.prototype.loadQuestionChoices = function (e) { this.onChoicesLazyLoad.fire(this, e) }, t.prototype.getChoiceDisplayValue = function (e) { this.onGetChoiceDisplayValue.fire(this, e) }, t.prototype.matrixBeforeRowAdded = function (e) { this.onMatrixBeforeRowAdded.fire(this, e) }, t.prototype.matrixRowAdded = function (e, t) { this.onMatrixRowAdded.fire(this, { question: e, row: t }) }, t.prototype.matrixColumnAdded = function (e, t) { this.onMatrixColumnAdded.fire(this, { question: e, column: t }) }, t.prototype.multipleTextItemAdded = function (e, t) { this.onMultipleTextItemAdded.fire(this, { question: e, item: t }) }, t.prototype.getQuestionByValueNameFromArray = function (e, t, n) { var o = this.getQuestionsByValueName(e); if (o) { for (var r = 0; r < o.length; r++) { var i = o[r].getQuestionFromArray(t, n); if (i) return i } return null } }, t.prototype.matrixRowRemoved = function (e, t, n) { this.onMatrixRowRemoved.fire(this, { question: e, rowIndex: t, row: n }) }, t.prototype.matrixRowRemoving = function (e, t, n) { var o = { question: e, rowIndex: t, row: n, allow: !0 }; return this.onMatrixRowRemoving.fire(this, o), o.allow }, t.prototype.matrixAllowRemoveRow = function (e, t, n) { var o = { question: e, rowIndex: t, row: n, allow: !0 }; return this.onMatrixAllowRemoveRow.fire(this, o), o.allow }, t.prototype.matrixCellCreating = function (e, t) { t.question = e, this.onMatrixCellCreating.fire(this, t) }, t.prototype.matrixCellCreated = function (e, t) { t.question = e, this.onMatrixCellCreated.fire(this, t) }, t.prototype.matrixAfterCellRender = function (e, t) { t.question = e, this.onMatrixAfterCellRender.fire(this, t) }, t.prototype.matrixCellValueChanged = function (e, t) { t.question = e, this.onMatrixCellValueChanged.fire(this, t) }, t.prototype.matrixCellValueChanging = function (e, t) { t.question = e, this.onMatrixCellValueChanging.fire(this, t) }, Object.defineProperty(t.prototype, "isValidateOnValueChanging", { get: function () { return "onValueChanging" === this.checkErrorsMode }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "isValidateOnValueChanged", { get: function () { return "onValueChanged" === this.checkErrorsMode }, enumerable: !1, configurable: !0 }), t.prototype.matrixCellValidate = function (e, t) { return t.question = e, this.onMatrixCellValidate.fire(this, t), t.error ? new Se(t.error, this) : null }, t.prototype.dynamicPanelAdded = function (e, t, n) { if (this.isLoadingFromJson || this.updateVisibleIndexes(), !this.onDynamicPanelAdded.isEmpty) { var o = e.panels; void 0 === t && (n = o[t = o.length - 1]), this.onDynamicPanelAdded.fire(this, { question: e, panel: n, panelIndex: t }) } }, t.prototype.dynamicPanelRemoved = function (e, t, n) { for (var o = n ? n.questions : [], r = 0; r < o.length; r++)o[r].clearOnDeletingContainer(); this.updateVisibleIndexes(), this.onDynamicPanelRemoved.fire(this, { question: e, panelIndex: t, panel: n }) }, t.prototype.dynamicPanelRemoving = function (e, t, n) { var o = { question: e, panelIndex: t, panel: n, allow: !0 }; return this.onDynamicPanelRemoving.fire(this, o), o.allow }, t.prototype.dynamicPanelItemValueChanged = function (e, t) { t.question = e, t.panelIndex = t.itemIndex, t.panelData = t.itemValue, this.onDynamicPanelItemValueChanged.fire(this, t) }, t.prototype.dragAndDropAllow = function (e) { return e.allow = !0, this.onDragDropAllow.fire(this, e), e.allow }, t.prototype.elementContentVisibilityChanged = function (e) { this.currentPage && this.currentPage.ensureRowsVisibility(), this.onElementContentVisibilityChanged.fire(this, { element: e }) }, t.prototype.getUpdatedPanelFooterActions = function (e, t, n) { var o = { question: n, panel: e, actions: t }; return this.onGetPanelFooterActions.fire(this, o), o.actions }, t.prototype.getUpdatedElementTitleActions = function (e, t) { return e.isPage ? this.getUpdatedPageTitleActions(e, t) : e.isPanel ? this.getUpdatedPanelTitleActions(e, t) : this.getUpdatedQuestionTitleActions(e, t) }, t.prototype.getUpdatedQuestionTitleActions = function (e, t) { var n = { question: e, titleActions: t }; return this.onGetQuestionTitleActions.fire(this, n), n.titleActions }, t.prototype.getUpdatedPanelTitleActions = function (e, t) { var n = { panel: e, titleActions: t }; return this.onGetPanelTitleActions.fire(this, n), n.titleActions }, t.prototype.getUpdatedPageTitleActions = function (e, t) { var n = { page: e, titleActions: t }; return this.onGetPageTitleActions.fire(this, n), n.titleActions }, t.prototype.getUpdatedMatrixRowActions = function (e, t, n) { var o = { question: e, actions: n, row: t }; return this.onGetMatrixRowActions.fire(this, o), o.actions }, t.prototype.scrollElementToTop = function (e, t, n, o) { var r = { element: e, question: t, page: n, elementId: o, cancel: !1 }; this.onScrollingElementToTop.fire(this, r), r.cancel || At.ScrollElementToTop(r.elementId) }, t.prototype.uploadFiles = function (e, t, n, o) { this.onUploadFiles.isEmpty ? o("error", n) : this.onUploadFiles.fire(this, { question: e, name: t, files: n || [], callback: o }), this.surveyPostId && this.uploadFilesCore(t, n, o) }, t.prototype.downloadFile = function (e, t, n, o) { this.onDownloadFile.isEmpty && o && o("success", n.content || n), this.onDownloadFile.fire(this, { question: e, name: t, content: n.content || n, fileValue: n, callback: o }) }, t.prototype.clearFiles = function (e, t, n, o, r) { this.onClearFiles.isEmpty && r && r("success", n), this.onClearFiles.fire(this, { question: e, name: t, value: n, fileName: o, callback: r }) }, t.prototype.updateChoicesFromServer = function (e, t, n) { var o = { question: e, choices: t, serverResult: n }; return this.onLoadChoicesFromServer.fire(this, o), o.choices }, t.prototype.loadedChoicesFromServer = function (e) { this.locStrsChanged() }, t.prototype.createSurveyService = function () { return new Gn }, t.prototype.uploadFilesCore = function (e, t, n) { var o = this, r = []; t.forEach((function (e) { n && n("uploading", e), o.createSurveyService().sendFile(o.surveyPostId, e, (function (o, i) { o ? (r.push({ content: i, file: e }), r.length === t.length && n && n("success", r)) : n && n("error", { response: i, file: e }) })) })) }, t.prototype.getPage = function (e) { return this.pages[e] }, t.prototype.addPage = function (e, t) { void 0 === t && (t = -1), null != e && (t < 0 || t >= this.pages.length ? this.pages.push(e) : this.pages.splice(t, 0, e)) }, t.prototype.addNewPage = function (e, t) { void 0 === e && (e = null), void 0 === t && (t = -1); var n = this.createNewPage(e); return this.addPage(n, t), n }, t.prototype.removePage = function (e) { var t = this.pages.indexOf(e); t < 0 || (this.pages.splice(t, 1), this.currentPage == e && (this.currentPage = this.pages.length > 0 ? this.pages[0] : null)) }, t.prototype.getQuestionByName = function (e, t) { if (void 0 === t && (t = !1), !e) return null; t && (e = e.toLowerCase()); var n = (t ? this.questionHashes.namesInsensitive : this.questionHashes.names)[e]; return n ? n[0] : null }, t.prototype.findQuestionByName = function (e) { return this.getQuestionByName(e) }, t.prototype.getQuestionByValueName = function (e, t) { void 0 === t && (t = !1); var n = this.getQuestionsByValueName(e, t); return n ? n[0] : null }, t.prototype.getQuestionsByValueName = function (e, t) { void 0 === t && (t = !1); var n = (t ? this.questionHashes.valueNamesInsensitive : this.questionHashes.valueNames)[e]; return n || null }, t.prototype.getCalculatedValueByName = function (e) { for (var t = 0; t < this.calculatedValues.length; t++)if (e == this.calculatedValues[t].name) return this.calculatedValues[t]; return null }, t.prototype.getQuestionsByNames = function (e, t) { void 0 === t && (t = !1); var n = []; if (!e) return n; for (var o = 0; o < e.length; o++)if (e[o]) { var r = this.getQuestionByName(e[o], t); r && n.push(r) } return n }, t.prototype.getPageByElement = function (e) { for (var t = 0; t < this.pages.length; t++) { var n = this.pages[t]; if (n.containsElement(e)) return n } return null }, t.prototype.getPageByQuestion = function (e) { return this.getPageByElement(e) }, t.prototype.getPageByName = function (e) { for (var t = 0; t < this.pages.length; t++)if (this.pages[t].name == e) return this.pages[t]; return null }, t.prototype.getPagesByNames = function (e) { var t = []; if (!e) return t; for (var n = 0; n < e.length; n++)if (e[n]) { var o = this.getPageByName(e[n]); o && t.push(o) } return t }, t.prototype.getAllQuestions = function (e, t) { void 0 === e && (e = !1), void 0 === t && (t = !1); for (var n = new Array, o = 0; o < this.pages.length; o++)this.pages[o].addQuestionsToList(n, e, t); return n }, t.prototype.getQuizQuestions = function () { for (var e = new Array, t = this.getPageStartIndex(); t < this.pages.length; t++)if (this.pages[t].isVisible) for (var n = this.pages[t].questions, o = 0; o < n.length; o++) { var r = n[o]; r.quizQuestionCount > 0 && e.push(r) } return e }, t.prototype.getPanelByName = function (e, t) { void 0 === t && (t = !1); var n = this.getAllPanels(); t && (e = e.toLowerCase()); for (var o = 0; o < n.length; o++) { var r = n[o].name; if (t && (r = r.toLowerCase()), r == e) return n[o] } return null }, t.prototype.getAllPanels = function (e, t) { void 0 === e && (e = !1), void 0 === t && (t = !1); for (var n = new Array, o = 0; o < this.pages.length; o++)this.pages[o].addPanelsIntoList(n, e, t); return n }, t.prototype.createNewPage = function (e) { var t = _.createClass("page"); return t.name = e, t }, t.prototype.questionOnValueChanging = function (e, t) { if (this.editingObj) { var n = _.findProperty(this.editingObj.getType(), e); n && (t = n.settingValue(this.editingObj, t)) } if (this.onValueChanging.isEmpty) return t; var o = { name: e, question: this.getQuestionByValueName(e), value: this.getUnbindValue(t), oldValue: this.getValue(e) }; return this.onValueChanging.fire(this, o), o.value }, t.prototype.updateQuestionValue = function (e, t) { if (!this.isLoadingFromJson) { var n = this.getQuestionsByValueName(e); if (n) for (var o = 0; o < n.length; o++) { var r = n[o].value; (r === t && Array.isArray(r) && this.editingObj || !this.isTwoValueEquals(r, t)) && n[o].updateValueFromSurvey(t) } } }, t.prototype.checkQuestionErrorOnValueChanged = function (e) { !this.isNavigationButtonPressed && ("onValueChanged" === this.checkErrorsMode || e.getAllErrors().length > 0) && this.checkQuestionErrorOnValueChangedCore(e) }, t.prototype.checkQuestionErrorOnValueChangedCore = function (e) { var t = e.getAllErrors().length, n = !e.validate(!0, { isOnValueChanged: !this.isValidateOnValueChanging }), o = this.checkErrorsMode.indexOf("Value") > -1; return e.page && o && (t > 0 || e.getAllErrors().length > 0) && this.fireValidatedErrorsOnPage(e.page), n }, t.prototype.checkErrorsOnValueChanging = function (e, t) { if (this.isLoadingFromJson) return !1; var n = this.getQuestionsByValueName(e); if (!n) return !1; for (var o = !1, r = 0; r < n.length; r++) { var i = n[r]; this.isTwoValueEquals(i.valueForSurvey, t) || (i.value = t), this.checkQuestionErrorOnValueChangedCore(i) && (o = !0), o = o || i.errors.length > 0 } return o }, t.prototype.notifyQuestionOnValueChanged = function (e, t) { if (!this.isLoadingFromJson) { var n = this.getQuestionsByValueName(e); if (n) for (var o = 0; o < n.length; o++) { var r = n[o]; this.checkQuestionErrorOnValueChanged(r), r.onSurveyValueChanged(t), this.onValueChanged.fire(this, { name: e, question: r, value: t }) } else this.onValueChanged.fire(this, { name: e, question: null, value: t }); this.isDisposed || (this.checkElementsBindings(e, t), this.notifyElementsOnAnyValueOrVariableChanged(e)) } }, t.prototype.checkElementsBindings = function (e, t) { this.isRunningElementsBindings = !0; for (var n = 0; n < this.pages.length; n++)this.pages[n].checkBindings(e, t); this.isRunningElementsBindings = !1, this.updateVisibleIndexAfterBindings && (this.updateVisibleIndexes(), this.updateVisibleIndexAfterBindings = !1) }, t.prototype.notifyElementsOnAnyValueOrVariableChanged = function (e) { if ("processing" !== this.isEndLoadingFromJson) if (this.isRunningConditions) this.conditionNotifyElementsOnAnyValueOrVariableChanged = !0; else { for (var t = 0; t < this.pages.length; t++)this.pages[t].onAnyValueChanged(e); this.isEndLoadingFromJson || this.locStrsChanged() } }, t.prototype.updateAllQuestionsValue = function () { for (var e = this.getAllQuestions(), t = 0; t < e.length; t++) { var n = e[t], o = n.getValueName(); n.updateValueFromSurvey(this.getValue(o)), n.requireUpdateCommentValue && n.updateCommentFromSurvey(this.getComment(o)) } }, t.prototype.notifyAllQuestionsOnValueChanged = function () { for (var e = this.getAllQuestions(), t = 0; t < e.length; t++)e[t].onSurveyValueChanged(this.getValue(e[t].getValueName())) }, t.prototype.checkOnPageTriggers = function () { for (var e = this.getCurrentPageQuestions(!0), t = {}, n = 0; n < e.length; n++) { var o = e[n].getValueName(); t[o] = this.getValue(o) } this.addCalculatedValuesIntoFilteredValues(t), this.checkTriggers(t, !0) }, t.prototype.getCurrentPageQuestions = function (e) { void 0 === e && (e = !1); var t = [], n = this.currentPage; if (!n) return t; for (var o = 0; o < n.questions.length; o++) { var r = n.questions[o]; (e || r.visible) && r.name && t.push(r) } return t }, t.prototype.checkTriggers = function (e, t) { if (!this.isCompleted && 0 != this.triggers.length && !this.isDisplayMode) if (this.isTriggerIsRunning) for (var n in this.triggerValues = this.getFilteredValues(), e) this.triggerKeys[n] = e[n]; else { this.isTriggerIsRunning = !0, this.triggerKeys = e, this.triggerValues = this.getFilteredValues(); var o = this.getFilteredProperties(), r = this.canBeCompletedByTrigger; this.canBeCompletedByTrigger = !1; for (var i = 0; i < this.triggers.length; i++)this.triggers[i].checkExpression(t, this.triggerKeys, this.triggerValues, o); r !== this.canBeCompletedByTrigger && this.updateButtonsVisibility(), this.isTriggerIsRunning = !1 } }, t.prototype.doElementsOnLoad = function () { for (var e = 0; e < this.pages.length; e++)this.pages[e].onSurveyLoad() }, Object.defineProperty(t.prototype, "isRunningConditions", { get: function () { return !!this.conditionValues }, enumerable: !1, configurable: !0 }), t.prototype.runConditions = function () { if (!this.isCompleted && "processing" !== this.isEndLoadingFromJson && !this.isRunningConditions) { this.conditionValues = this.getFilteredValues(); var e = this.getFilteredProperties(), t = this.pages.indexOf(this.currentPage); this.runConditionsCore(e), this.checkIfNewPagesBecomeVisible(t), this.conditionValues = null, this.isValueChangedOnRunningCondition && this.conditionRunnerCounter < o.maximumConditionRunCountOnValueChanged ? (this.isValueChangedOnRunningCondition = !1, this.conditionRunnerCounter++, this.runConditions()) : (this.isValueChangedOnRunningCondition = !1, this.conditionRunnerCounter = 0, this.conditionUpdateVisibleIndexes && (this.conditionUpdateVisibleIndexes = !1, this.updateVisibleIndexes()), this.conditionNotifyElementsOnAnyValueOrVariableChanged && (this.conditionNotifyElementsOnAnyValueOrVariableChanged = !1, this.notifyElementsOnAnyValueOrVariableChanged(""))) } }, t.prototype.runConditionOnValueChanged = function (e, t) { this.isRunningConditions ? (this.conditionValues[e] = t, this.isValueChangedOnRunningCondition = !0) : this.runConditions() }, t.prototype.runConditionsCore = function (t) { for (var n = this.pages, o = 0; o < this.calculatedValues.length; o++)this.calculatedValues[o].resetCalculation(); for (o = 0; o < this.calculatedValues.length; o++)this.calculatedValues[o].doCalculation(this.calculatedValues, this.conditionValues, t); e.prototype.runConditionCore.call(this, this.conditionValues, t); for (o = 0; o < n.length; o++)n[o].runCondition(this.conditionValues, t) }, t.prototype.checkIfNewPagesBecomeVisible = function (e) { var t = this.pages.indexOf(this.currentPage); if (!(t <= e + 1)) for (var n = e + 1; n < t; n++)if (this.pages[n].isVisible) { this.currentPage = this.pages[n]; break } }, t.prototype.sendResult = function (e, t, n) { if (void 0 === e && (e = null), void 0 === t && (t = null), void 0 === n && (n = !1), this.isEditMode && (n && this.onPartialSend && this.onPartialSend.fire(this, null), !e && this.surveyPostId && (e = this.surveyPostId), e && (t && (this.clientId = t), !n || this.clientId))) { var o = this; this.surveyShowDataSaving && this.setCompletedState("saving", ""), this.createSurveyService().sendResult(e, this.data, (function (e, t, n) { o.surveyShowDataSaving && (e ? o.setCompletedState("success", "") : o.setCompletedState("error", t)), o.onSendResult.fire(o, { success: e, response: t, request: n }) }), this.clientId, n) } }, t.prototype.getResult = function (e, t) { var n = this; this.createSurveyService().getResult(e, t, (function (e, t, o, r) { n.onGetResult.fire(n, { success: e, data: t, dataList: o, response: r }) })) }, t.prototype.loadSurveyFromService = function (e, t) { void 0 === e && (e = null), void 0 === t && (t = null), e && (this.surveyId = e), t && (this.clientId = t); var n = this; this.isLoading = !0, this.onLoadingSurveyFromService(), t ? this.createSurveyService().getSurveyJsonAndIsCompleted(this.surveyId, this.clientId, (function (e, t, o, r) { n.isLoading = !1, e && (n.isCompletedBefore = "completed" == o, n.loadSurveyFromServiceJson(t)) })) : this.createSurveyService().loadSurvey(this.surveyId, (function (e, t, o) { n.isLoading = !1, e && n.loadSurveyFromServiceJson(t) })) }, t.prototype.loadSurveyFromServiceJson = function (e) { e && (this.fromJSON(e), this.notifyAllQuestionsOnValueChanged(), this.onLoadSurveyFromService(), this.onLoadedSurveyFromService.fire(this, {})) }, t.prototype.onLoadingSurveyFromService = function () { }, t.prototype.onLoadSurveyFromService = function () { }, t.prototype.resetVisibleIndexes = function () { for (var e = this.getAllQuestions(!0), t = 0; t < e.length; t++)e[t].setVisibleIndex(-1); this.updateVisibleIndexes() }, t.prototype.updateVisibleIndexes = function () { if (!this.isLoadingFromJson && !this.isEndLoadingFromJson) if (this.isRunningConditions && this.onQuestionVisibleChanged.isEmpty && this.onPageVisibleChanged.isEmpty) this.conditionUpdateVisibleIndexes = !0; else if (this.isRunningElementsBindings) this.updateVisibleIndexAfterBindings = !0; else { if (this.updatePageVisibleIndexes(this.showPageNumbers), "onPage" == this.showQuestionNumbers) for (var e = this.visiblePages, t = 0; t < e.length; t++)e[t].setVisibleIndex(0); else { var n = "on" == this.showQuestionNumbers ? 0 : -1; for (t = 0; t < this.pages.length; t++)n += this.pages[t].setVisibleIndex(n) } this.updateProgressText(!0) } }, t.prototype.updatePageVisibleIndexes = function (e) { this.updateButtonsVisibility(); for (var t = 0, n = 0; n < this.pages.length; n++) { var o = this.pages[n], r = o.isVisible && (n > 0 || !o.isStartPage); o.visibleIndex = r ? t++ : -1, o.num = r ? o.visibleIndex + 1 : -1 } }, t.prototype.fromJSON = function (e) { if (e) { this.questionHashesClear(), this.jsonErrors = null; var t = new S; t.toObject(e, this), t.errors.length > 0 && (this.jsonErrors = t.errors), this.onStateAndCurrentPageChanged(), this.updateState() } }, t.prototype.setJsonObject = function (e) { this.fromJSON(e) }, t.prototype.endLoadingFromJson = function () { this.isEndLoadingFromJson = "processing", this.onFirstPageIsStartedChanged(), this.onQuestionsOnPageModeChanged("standard"), e.prototype.endLoadingFromJson.call(this), this.hasCookie && this.doComplete(), this.doElementsOnLoad(), this.isEndLoadingFromJson = "conditions", this.runConditions(), this.notifyElementsOnAnyValueOrVariableChanged(""), this.isEndLoadingFromJson = null, this.updateVisibleIndexes(), this.updateHasLogo(), this.updateCurrentPage(), this.hasDescription = !!this.description, this.setCalculatedWidthModeUpdater() }, t.prototype.updateNavigationCss = function () { this.navigationBar && (this.updateNavigationBarCss(), this.updateNavigationItemCssCallback && this.updateNavigationItemCssCallback()) }, t.prototype.updateNavigationBarCss = function () { var e = this.navigationBar; e.cssClasses = this.css.actionBar, e.containerCss = this.css.footer }, t.prototype.createNavigationBar = function () { var e = new pt; return e.setItems(this.createNavigationActions()), e }, t.prototype.createNavigationActions = function () { var e = this, t = new Tt({ id: "sv-nav-start", visible: new ue((function () { return e.isShowStartingPage })), visibleIndex: 10, locTitle: this.locStartSurveyText, action: function () { return e.start() }, component: "sv-nav-btn" }), n = new Tt({ id: "sv-nav-prev", visible: new ue((function () { return e.isShowPrevButton })), visibleIndex: 20, data: { mouseDown: function () { return e.navigationMouseDown() } }, locTitle: this.locPagePrevText, action: function () { return e.prevPage() }, component: "sv-nav-btn" }), o = new Tt({ id: "sv-nav-next", visible: new ue((function () { return e.isShowNextButton })), visibleIndex: 30, data: { mouseDown: function () { return e.nextPageMouseDown() } }, locTitle: this.locPageNextText, action: function () { return e.nextPageUIClick() }, component: "sv-nav-btn" }), r = new Tt({ id: "sv-nav-preview", visible: new ue((function () { return e.isPreviewButtonVisible })), visibleIndex: 40, data: { mouseDown: function () { return e.navigationMouseDown() } }, locTitle: this.locPreviewText, action: function () { return e.showPreview() }, component: "sv-nav-btn" }), i = new Tt({ id: "sv-nav-complete", visible: new ue((function () { return e.isCompleteButtonVisible })), visibleIndex: 50, data: { mouseDown: function () { return e.navigationMouseDown() } }, locTitle: this.locCompleteText, action: function () { return e.completeLastPage() }, component: "sv-nav-btn" }); return this.updateNavigationItemCssCallback = function () { t.innerCss = e.cssNavigationStart, n.innerCss = e.cssNavigationPrev, o.innerCss = e.cssNavigationNext, r.innerCss = e.cssNavigationPreview, i.innerCss = e.cssNavigationComplete }, [t, n, o, r, i] }, t.prototype.onBeforeCreating = function () { }, t.prototype.onCreating = function () { }, t.prototype.getProcessedTextValue = function (e) { if (this.getProcessedTextValueCore(e), !this.onProcessTextValue.isEmpty) { var t = this.isValueEmpty(e.value); this.onProcessTextValue.fire(this, e), e.isExists = e.isExists || t && !this.isValueEmpty(e.value) } }, t.prototype.getBuiltInVariableValue = function (e) { if ("pageno" === e) { var t = this.currentPage; return null != t ? this.visiblePages.indexOf(t) + 1 : 0 } return "pagecount" === e ? this.visiblePageCount : "correctedanswers" === e || "correctanswers" === e || "correctedanswercount" === e ? this.getCorrectedAnswerCount() : "incorrectedanswers" === e || "incorrectanswers" === e || "incorrectedanswercount" === e ? this.getInCorrectedAnswerCount() : "questioncount" === e ? this.getQuizQuestionCount() : void 0 }, t.prototype.getProcessedTextValueCore = function (e) { var t = e.name.toLocaleLowerCase(); if (-1 === ["no", "require", "title"].indexOf(t)) { var n = this.getBuiltInVariableValue(t); if (void 0 !== n) return e.isExists = !0, void (e.value = n); if ("locale" === t) return e.isExists = !0, void (e.value = this.locale ? this.locale : s.defaultLocale); var o = this.getVariable(t); if (void 0 !== o) return e.isExists = !0, void (e.value = o); var r = this.getFirstName(t); if (r) { var i = r.useDisplayValuesInDynamicTexts; e.isExists = !0; var a = r.getValueName().toLowerCase(); t = (t = a + t.substring(a.length)).toLocaleLowerCase(); var l = {}; return l[a] = e.returnDisplayValue && i ? r.getDisplayValue(!1, void 0) : r.value, void (e.value = (new I).getValue(t, l)) } this.getProcessedValuesWithoutQuestion(e) } }, t.prototype.getProcessedValuesWithoutQuestion = function (e) { var t = this.getValue(e.name); if (void 0 !== t) return e.isExists = !0, void (e.value = t); var n = new I, o = n.getFirstName(e.name); if (o !== e.name) { var i = {}, s = this.getValue(o); r.isValueEmpty(s) && (s = this.getVariable(o)), r.isValueEmpty(s) || (i[o] = s, e.value = n.getValue(e.name, i), e.isExists = n.hasValue(e.name, i)) } }, t.prototype.getFirstName = function (e) { var t; e = e.toLowerCase(); do { t = this.getQuestionByValueName(e, !0), e = this.reduceFirstName(e) } while (!t && e); return t }, t.prototype.reduceFirstName = function (e) { var t = e.lastIndexOf("."), n = e.lastIndexOf("["); if (t < 0 && n < 0) return ""; var o = Math.max(t, n); return e.substring(0, o) }, t.prototype.clearUnusedValues = function () { for (var e = this.getAllQuestions(), t = 0; t < e.length; t++)e[t].clearUnusedValues(); this.clearInvisibleQuestionValues() }, t.prototype.hasVisibleQuestionByValueName = function (e) { var t = this.getQuestionsByValueName(e); if (!t) return !1; for (var n = 0; n < t.length; n++) { var o = t[n]; if (o.isVisible && o.isParentVisible && !o.parentQuestion) return !0 } return !1 }, t.prototype.questionCountByValueName = function (e) { var t = this.getQuestionsByValueName(e); return t ? t.length : 0 }, t.prototype.clearInvisibleQuestionValues = function () { for (var e = "none" === this.clearInvisibleValues ? "none" : "onComplete", t = this.getAllQuestions(), n = 0; n < t.length; n++)t[n].clearValueIfInvisible(e) }, t.prototype.getVariable = function (e) { if (!e) return null; e = e.toLowerCase(); var t = this.variablesHash[e]; return this.isValueEmpty(t) && (e.indexOf(".") > -1 || e.indexOf("[") > -1) && (new I).hasValue(e, this.variablesHash) ? (new I).getValue(e, this.variablesHash) : t }, t.prototype.setVariable = function (e, t) { e && (e = e.toLowerCase(), this.variablesHash[e] = t, this.notifyElementsOnAnyValueOrVariableChanged(e), this.runConditionOnValueChanged(e, t), this.onVariableChanged.fire(this, { name: e, value: t })) }, t.prototype.getVariableNames = function () { var e = []; for (var t in this.variablesHash) e.push(t); return e }, t.prototype.getUnbindValue = function (e) { return this.editingObj ? e : r.getUnbindValue(e) }, t.prototype.getValue = function (e) { if (!e || 0 == e.length) return null; var t = this.getDataValueCore(this.valuesHash, e); return this.getUnbindValue(t) }, t.prototype.setValue = function (e, t, n, o) { void 0 === n && (n = !1), void 0 === o && (o = !0); var r = t; if (o && (r = this.questionOnValueChanging(e, t)), (!this.isValidateOnValueChanging || !this.checkErrorsOnValueChanging(e, r)) && (this.editingObj || !this.isValueEqual(e, r) || !this.isTwoValueEquals(r, t))) { var i = this.getValue(e); this.isValueEmpty(r) ? this.deleteDataValueCore(this.valuesHash, e) : (r = this.getUnbindValue(r), this.setDataValueCore(this.valuesHash, e, r)), this.updateOnSetValue(e, r, i, n, o) } }, t.prototype.updateOnSetValue = function (e, t, n, o, r) { if (void 0 === o && (o = !1), void 0 === r && (r = !0), this.updateQuestionValue(e, t), !0 !== o && !this.isDisposed && !this.isRunningElementsBindings) { var i = {}; i[e] = { newValue: t, oldValue: n }, this.runConditionOnValueChanged(e, t), this.checkTriggers(i, !1), r && this.notifyQuestionOnValueChanged(e, t), "text" !== o && this.tryGoNextPageAutomatic(e) } }, t.prototype.isValueEqual = function (e, t) { "" !== t && void 0 !== t || (t = null); var n = this.getValue(e); return "" !== n && void 0 !== n || (n = null), null === t || null === n ? t === n : this.isTwoValueEquals(t, n) }, t.prototype.doOnPageAdded = function (e) { e.setSurveyImpl(this), e.name || (e.name = this.generateNewName(this.pages, "page")), this.questionHashesPanelAdded(e), this.updateVisibleIndexes(), this.isLoadingFromJson || (this.updateProgressText(), this.updateCurrentPage()); var t = { page: e }; this.onPageAdded.fire(this, t) }, t.prototype.doOnPageRemoved = function (e) { e.setSurveyImpl(null), e === this.currentPage && this.updateCurrentPage(), this.updateVisibleIndexes(), this.updateProgressText(), this.updateLazyRenderingRowsOnRemovingElements() }, t.prototype.generateNewName = function (e, t) { for (var n = {}, o = 0; o < e.length; o++)n[e[o].name] = !0; for (var r = 1; n[t + r];)r++; return t + r }, t.prototype.tryGoNextPageAutomatic = function (e) { if (!this.isEndLoadingFromJson && this.goNextPageAutomatic && this.currentPage) { var t = this.getQuestionByValueName(e); if (t && (!t || t.visible && t.supportGoNextPageAutomatic()) && (t.validate(!1) || t.supportGoNextPageError())) { var n = this.getCurrentPageQuestions(); if (!(n.indexOf(t) < 0)) { for (var o = 0; o < n.length; o++)if (n[o].hasInput && n[o].isEmpty()) return; this.checkIsCurrentPageHasErrors(!1) || (this.isLastPage ? !0 === this.goNextPageAutomatic && this.allowCompleteSurveyAutomatic && (this.isShowPreviewBeforeComplete ? this.showPreview() : this.completeLastPage()) : this.nextPage()) } } } }, t.prototype.getComment = function (e) { return this.getValue(e + this.commentSuffix) || "" }, t.prototype.setComment = function (e, t, n) { if (void 0 === n && (n = !1), t || (t = ""), !this.isTwoValueEquals(t, this.getComment(e))) { var o = e + this.commentSuffix; this.isValueEmpty(t) ? this.deleteDataValueCore(this.valuesHash, o) : this.setDataValueCore(this.valuesHash, o, t); var r = this.getQuestionsByValueName(e); if (r) for (var i = 0; i < r.length; i++)r[i].updateCommentFromSurvey(t), this.checkQuestionErrorOnValueChanged(r[i]); n || this.runConditionOnValueChanged(e, this.getValue(e)), "text" !== n && this.tryGoNextPageAutomatic(e); var s = this.getQuestionByName(e); s && this.onValueChanged.fire(this, { name: o, question: s, value: t }) } }, t.prototype.clearValue = function (e) { this.setValue(e, null), this.setComment(e, null) }, Object.defineProperty(t.prototype, "clearValueOnDisableItems", { get: function () { return this.getPropertyValue("clearValueOnDisableItems", !1) }, set: function (e) { this.setPropertyValue("clearValueOnDisableItems", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "isClearValueOnHidden", { get: function () { return "onHidden" == this.clearInvisibleValues || this.isClearValueOnHiddenContainer }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "isClearValueOnHiddenContainer", { get: function () { return "onHiddenContainer" == this.clearInvisibleValues && !this.isShowingPreview && !this.runningPages }, enumerable: !1, configurable: !0 }), t.prototype.questionVisibilityChanged = function (e, t) { this.updateVisibleIndexes(), this.onQuestionVisibleChanged.fire(this, { question: e, name: e.name, visible: t }) }, t.prototype.pageVisibilityChanged = function (e, t) { this.isLoadingFromJson || ((t && !this.currentPage || e === this.currentPage) && this.updateCurrentPage(), this.updateVisibleIndexes(), this.onPageVisibleChanged.fire(this, { page: e, visible: t })) }, t.prototype.panelVisibilityChanged = function (e, t) { this.updateVisibleIndexes(), this.onPanelVisibleChanged.fire(this, { panel: e, visible: t }) }, t.prototype.questionCreated = function (e) { this.onQuestionCreated.fire(this, { question: e }) }, t.prototype.questionAdded = function (e, t, n, r) { e.name || (e.name = this.generateNewName(this.getAllQuestions(!1, !0), "question")), e.page && this.questionHashesAdded(e), this.currentPage || this.updateCurrentPage(), this.updateVisibleIndexes(), this.setCalculatedWidthModeUpdater(), (!this.isMovingQuestion || this.isDesignMode && !o.supportCreatorV2) && this.onQuestionAdded.fire(this, { question: e, name: e.name, index: t, parent: n, page: r, parentPanel: n, rootPanel: r }) }, t.prototype.questionRemoved = function (e) { this.questionHashesRemoved(e, e.name, e.getValueName()), this.updateVisibleIndexes(), this.onQuestionRemoved.fire(this, { question: e, name: e.name }), this.updateLazyRenderingRowsOnRemovingElements() }, t.prototype.questionRenamed = function (e, t, n) { this.questionHashesRemoved(e, t, n), this.questionHashesAdded(e) }, t.prototype.questionHashesClear = function () { this.questionHashes.names = {}, this.questionHashes.namesInsensitive = {}, this.questionHashes.valueNames = {}, this.questionHashes.valueNamesInsensitive = {} }, t.prototype.questionHashesPanelAdded = function (e) { if (!this.isLoadingFromJson) for (var t = e.questions, n = 0; n < t.length; n++)this.questionHashesAdded(t[n]) }, t.prototype.questionHashesAdded = function (e) { this.questionHashAddedCore(this.questionHashes.names, e, e.name), this.questionHashAddedCore(this.questionHashes.namesInsensitive, e, e.name.toLowerCase()), this.questionHashAddedCore(this.questionHashes.valueNames, e, e.getValueName()), this.questionHashAddedCore(this.questionHashes.valueNamesInsensitive, e, e.getValueName().toLowerCase()) }, t.prototype.questionHashesRemoved = function (e, t, n) { t && (this.questionHashRemovedCore(this.questionHashes.names, e, t), this.questionHashRemovedCore(this.questionHashes.namesInsensitive, e, t.toLowerCase())), n && (this.questionHashRemovedCore(this.questionHashes.valueNames, e, n), this.questionHashRemovedCore(this.questionHashes.valueNamesInsensitive, e, n.toLowerCase())) }, t.prototype.questionHashAddedCore = function (e, t, n) { var o; (o = e[n]) ? (o = e[n]).indexOf(t) < 0 && o.push(t) : e[n] = [t] }, t.prototype.questionHashRemovedCore = function (e, t, n) { var o = e[n]; if (o) { var r = o.indexOf(t); r > -1 && o.splice(r, 1), 0 == o.length && delete e[n] } }, t.prototype.panelAdded = function (e, t, n, o) { e.name || (e.name = this.generateNewName(this.getAllPanels(!1, !0), "panel")), this.questionHashesPanelAdded(e), this.updateVisibleIndexes(), this.onPanelAdded.fire(this, { panel: e, name: e.name, index: t, parent: n, page: o, parentPanel: n, rootPanel: o }) }, t.prototype.panelRemoved = function (e) { this.updateVisibleIndexes(), this.onPanelRemoved.fire(this, { panel: e, name: e.name }), this.updateLazyRenderingRowsOnRemovingElements() }, t.prototype.validateQuestion = function (e) { if (this.onValidateQuestion.isEmpty) return null; var t = { name: e.name, question: e, value: e.value, error: null }; return this.onValidateQuestion.fire(this, t), t.error ? new Se(t.error, this) : null }, t.prototype.validatePanel = function (e) { if (this.onValidatePanel.isEmpty) return null; var t = { name: e.name, panel: e, error: null }; return this.onValidatePanel.fire(this, t), t.error ? new Se(t.error, this) : null }, t.prototype.processHtml = function (e) { var t = { html: e }; return this.onProcessHtml.fire(this, t), this.processText(t.html, !0) }, t.prototype.processText = function (e, t) { return this.processTextEx(e, t, !1).text }, t.prototype.processTextEx = function (e, t, n) { var o = { text: this.processTextCore(e, t, n), hasAllValuesOnLastRun: !0 }; return o.hasAllValuesOnLastRun = this.textPreProcessor.hasAllValuesOnLastRun, o }, t.prototype.processTextCore = function (e, t, n) { return void 0 === n && (n = !1), this.isDesignMode ? e : this.textPreProcessor.process(e, t, n) }, t.prototype.getSurveyMarkdownHtml = function (e, t, n) { var o = { element: e, text: t, name: n, html: null }; return this.onTextMarkdown.fire(this, o), o.html }, t.prototype.getCorrectedAnswerCount = function () { return this.getCorrectedAnswerCountCore(!0) }, t.prototype.getCorrectAnswerCount = function () { return this.getCorrectedAnswerCountCore(!0) }, t.prototype.getQuizQuestionCount = function () { for (var e = this.getQuizQuestions(), t = 0, n = 0; n < e.length; n++)t += e[n].quizQuestionCount; return t }, t.prototype.getInCorrectedAnswerCount = function () { return this.getCorrectedAnswerCountCore(!1) }, t.prototype.getInCorrectAnswerCount = function () { return this.getCorrectedAnswerCountCore(!1) }, t.prototype.getCorrectedAnswerCountCore = function (e) { for (var t = this.getQuizQuestions(), n = 0, o = { question: null, result: !1, correctAnswers: 0, incorrectAnswers: 0 }, r = 0; r < t.length; r++) { var i = t[r], s = i.quizQuestionCount; if (o.question = i, o.correctAnswers = i.correctAnswerCount, o.incorrectAnswers = s - o.correctAnswers, o.result = o.question.isAnswerCorrect(), this.onIsAnswerCorrect.fire(this, o), e) { if (o.result || o.correctAnswers < s) { var a = o.correctAnswers; 0 == a && o.result && (a = 1), n += a } } else (!o.result || o.incorrectAnswers < s) && (n += o.incorrectAnswers) } return n }, t.prototype.getCorrectedAnswers = function () { return this.getCorrectedAnswerCount() }, t.prototype.getInCorrectedAnswers = function () { return this.getInCorrectedAnswerCount() }, Object.defineProperty(t.prototype, "showTimerPanel", { get: function () { return this.getPropertyValue("showTimerPanel") }, set: function (e) { this.setPropertyValue("showTimerPanel", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "isTimerPanelShowingOnTop", { get: function () { return this.timerModel.isRunning && "top" == this.showTimerPanel }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "isTimerPanelShowingOnBottom", { get: function () { return this.timerModel.isRunning && "bottom" == this.showTimerPanel }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "showTimerPanelMode", { get: function () { return this.getPropertyValue("showTimerPanelMode") }, set: function (e) { this.setPropertyValue("showTimerPanelMode", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "widthMode", { get: function () { return this.getPropertyValue("widthMode") }, set: function (e) { this.setPropertyValue("widthMode", e) }, enumerable: !1, configurable: !0 }), t.prototype.setCalculatedWidthModeUpdater = function () { var e = this; this.calculatedWidthModeUpdater && this.calculatedWidthModeUpdater.dispose(), this.calculatedWidthModeUpdater = new ue((function () { return e.calculateWidthMode() })), this.calculatedWidthMode = this.calculatedWidthModeUpdater }, t.prototype.calculateWidthMode = function () { if ("auto" == this.widthMode) { var e = !1; return this.pages.forEach((function (t) { t.needResponsiveWidth() && (e = !0) })), e ? "responsive" : "static" } return this.widthMode }, Object.defineProperty(t.prototype, "width", { get: function () { return this.getPropertyValue("width") }, set: function (e) { this.setPropertyValue("width", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "renderedWidth", { get: function () { var e = this.getPropertyValue("width"); return e && !isNaN(e) && (e += "px"), "static" == this.getPropertyValue("calculatedWidthMode") && e || void 0 }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "timerInfo", { get: function () { return this.getTimerInfo() }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "timerClock", { get: function () { var e, t; if (this.currentPage) { var n = this.getTimerInfo(), o = n.spent, r = n.limit, i = n.minorSpent, s = n.minorLimit; e = r > 0 ? this.getDisplayClockTime(r - o) : this.getDisplayClockTime(o), void 0 !== i && (t = s > 0 ? this.getDisplayClockTime(s - i) : this.getDisplayClockTime(i)) } return { majorText: e, minorText: t } }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "timerInfoText", { get: function () { var e = { text: this.getTimerInfoText() }; this.onTimerPanelInfoText.fire(this, e); var t = new u(this, !0); return t.text = e.text, t.textOrHtml }, enumerable: !1, configurable: !0 }), t.prototype.getTimerInfo = function () { var e = this.currentPage; if (!e) return { spent: 0, limit: 0 }; var t = e.timeSpent, n = this.timeSpent, o = this.getPageMaxTimeToFinish(e), r = this.maxTimeToFinish; return "page" == this.showTimerPanelMode ? { spent: t, limit: o } : "survey" == this.showTimerPanelMode ? { spent: n, limit: r } : o > 0 && r > 0 ? { spent: t, limit: o, minorSpent: n, minorLimit: r } : o > 0 ? { spent: t, limit: o, minorSpent: n } : r > 0 ? { spent: n, limit: r, minorSpent: t } : { spent: t, minorSpent: n } }, t.prototype.getTimerInfoText = function () { var e = this.currentPage; if (!e) return ""; var t = this.getDisplayTime(e.timeSpent), n = this.getDisplayTime(this.timeSpent), o = this.getPageMaxTimeToFinish(e), r = this.getDisplayTime(o), i = this.getDisplayTime(this.maxTimeToFinish); return "page" == this.showTimerPanelMode ? this.getTimerInfoPageText(e, t, r) : "survey" == this.showTimerPanelMode ? this.getTimerInfoSurveyText(n, i) : "all" == this.showTimerPanelMode ? o <= 0 && this.maxTimeToFinish <= 0 ? this.getLocalizationFormatString("timerSpentAll", t, n) : o > 0 && this.maxTimeToFinish > 0 ? this.getLocalizationFormatString("timerLimitAll", t, r, n, i) : this.getTimerInfoPageText(e, t, r) + " " + this.getTimerInfoSurveyText(n, i) : "" }, t.prototype.getTimerInfoPageText = function (e, t, n) { return this.getPageMaxTimeToFinish(e) > 0 ? this.getLocalizationFormatString("timerLimitPage", t, n) : this.getLocalizationFormatString("timerSpentPage", t, n) }, t.prototype.getTimerInfoSurveyText = function (e, t) { var n = this.maxTimeToFinish > 0 ? "timerLimitSurvey" : "timerSpentSurvey"; return this.getLocalizationFormatString(n, e, t) }, t.prototype.getDisplayClockTime = function (e) { var t = Math.floor(e / 60), n = e % 60, o = n.toString(); return n < 10 && (o = "0" + o), t + ":" + o }, t.prototype.getDisplayTime = function (e) { var t = Math.floor(e / 60), n = e % 60, o = ""; return t > 0 && (o += t + " " + this.getLocalizationString("timerMin")), o && 0 == n ? o : (o && (o += " "), o + n + " " + this.getLocalizationString("timerSec")) }, Object.defineProperty(t.prototype, "timerModel", { get: function () { return this.timerModelValue }, enumerable: !1, configurable: !0 }), t.prototype.startTimer = function () { this.timerModel.start() }, t.prototype.startTimerFromUI = function () { "none" != this.showTimerPanel && "running" === this.state && this.startTimer() }, t.prototype.stopTimer = function () { this.timerModel.stop() }, Object.defineProperty(t.prototype, "timeSpent", { get: function () { return this.timerModel.spent }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "maxTimeToFinish", { get: function () { return this.getPropertyValue("maxTimeToFinish", 0) }, set: function (e) { this.setPropertyValue("maxTimeToFinish", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "maxTimeToFinishPage", { get: function () { return this.getPropertyValue("maxTimeToFinishPage", 0) }, set: function (e) { this.setPropertyValue("maxTimeToFinishPage", e) }, enumerable: !1, configurable: !0 }), t.prototype.getPageMaxTimeToFinish = function (e) { return !e || e.maxTimeToFinish < 0 ? 0 : e.maxTimeToFinish > 0 ? e.maxTimeToFinish : this.maxTimeToFinishPage }, t.prototype.doTimer = function (e) { if (this.onTimer.fire(this, {}), this.maxTimeToFinish > 0 && this.maxTimeToFinish == this.timeSpent && this.completeLastPage(), e) { var t = this.getPageMaxTimeToFinish(e); t > 0 && t == e.timeSpent && (this.isLastPage ? this.completeLastPage() : this.nextPage()) } }, Object.defineProperty(t.prototype, "inSurvey", { get: function () { return !0 }, enumerable: !1, configurable: !0 }), t.prototype.getSurveyData = function () { return this }, t.prototype.getSurvey = function () { return this }, t.prototype.getTextProcessor = function () { return this }, t.prototype.getObjects = function (e, t) { var n = []; return Array.prototype.push.apply(n, this.getPagesByNames(e)), Array.prototype.push.apply(n, this.getQuestionsByNames(t)), n }, t.prototype.setTriggerValue = function (e, t, n) { if (e) if (n) this.setVariable(e, t); else { var o = this.getQuestionByName(e); if (o) o.value = t; else { var r = new I, i = r.getFirstName(e); if (i == e) this.setValue(e, t); else { if (!this.getQuestionByName(i)) return; var s = this.getUnbindValue(this.getFilteredValues()); r.setValue(s, e, t), this.setValue(i, s[i]) } } } }, t.prototype.copyTriggerValue = function (e, t) { if (e && t) { var n = (new I).getValue(t, this.getFilteredValues()); this.setTriggerValue(e, n, !1) } }, t.prototype.triggerExecuted = function (e) { this.onTriggerExecuted.fire(this, { trigger: e }) }, t.prototype.startMovingQuestion = function () { this.isMovingQuestion = !0 }, t.prototype.stopMovingQuestion = function () { this.isMovingQuestion = !1 }, t.prototype.focusQuestion = function (e) { var t = this, n = this.getQuestionByName(e, !0); if (!n || !n.isVisible || !n.page) return !1; this.isFocusingQuestion = !0, this.skippedPages.push({ from: this.currentPage, to: n.page }); var o = this.currentPage !== n.page, r = function () { n.focus(), t.isFocusingQuestion = !1, t.isCurrentPageRendering = !1 }; return this.afterRenderPageTasks.push(r), this.currentPage = n.page, o || (r(), this.afterRenderPageTasks.splice(this.afterRenderPageTasks.indexOf(r), 1)), !0 }, t.prototype.getElementWrapperComponentName = function (e, n) { return "logo-image" === n ? "sv-logo-image" : t.TemplateRendererComponentName }, t.prototype.getQuestionContentWrapperComponentName = function (e) { return t.TemplateRendererComponentName }, t.prototype.getRowWrapperComponentName = function (e) { return t.TemplateRendererComponentName }, t.prototype.getElementWrapperComponentData = function (e, t) { return e }, t.prototype.getRowWrapperComponentData = function (e) { return e }, t.prototype.getItemValueWrapperComponentName = function (e, n) { return t.TemplateRendererComponentName }, t.prototype.getItemValueWrapperComponentData = function (e, t) { return e }, t.prototype.getMatrixCellTemplateData = function (e) { return e.question }, t.prototype.searchText = function (e) { e && (e = e.toLowerCase()); for (var t = [], n = 0; n < this.pages.length; n++)this.pages[n].searchText(e, t); return t }, t.prototype.getSkeletonComponentName = function (e) { return this.skeletonComponentName }, t.prototype.dispose = function () { if (this.currentPage = null, this.destroyResizeObserver(), e.prototype.dispose.call(this), this.editingObj = null, this.pages) { for (var t = 0; t < this.pages.length; t++)this.pages[t].setSurveyImpl(void 0), this.pages[t].dispose(); this.pages.splice(0, this.pages.length), this.disposeCallback && this.disposeCallback() } }, t.TemplateRendererComponentName = "sv-template-renderer", t.stylesManager = null, t.platform = "unknown", go([f()], t.prototype, "completedCss", void 0), go([f()], t.prototype, "containerCss", void 0), go([f({ defaultValue: !1 })], t.prototype, "showBrandInfo", void 0), go([f()], t.prototype, "_isMobile", void 0), go([f()], t.prototype, "rootCss", void 0), go([f()], t.prototype, "calculatedWidthMode", void 0), t }(Dt); _.addClass("survey", [{ name: "locale", choices: function () { return s.getLocales(!0) }, onGetValue: function (e) { return e.locale == s.defaultLocale ? null : e.locale } }, { name: "title", serializationProperty: "locTitle", dependsOn: "locale" }, { name: "description:text", serializationProperty: "locDescription", dependsOn: "locale" }, { name: "logo", serializationProperty: "locLogo" }, { name: "logoWidth", default: "300px", minValue: 0 }, { name: "logoHeight", default: "200px", minValue: 0 }, { name: "logoFit", default: "contain", choices: ["none", "contain", "cover", "fill"] }, { name: "logoPosition", default: "left", choices: ["none", "left", "right", "top", "bottom"] }, { name: "focusFirstQuestionAutomatic:boolean", default: !0 }, { name: "focusOnFirstError:boolean", default: !0 }, { name: "completedHtml:html", serializationProperty: "locCompletedHtml" }, { name: "completedBeforeHtml:html", serializationProperty: "locCompletedBeforeHtml" }, { name: "completedHtmlOnCondition:htmlconditions", className: "htmlconditionitem" }, { name: "loadingHtml:html", serializationProperty: "locLoadingHtml" }, { name: "pages:surveypages", className: "page" }, { name: "questions", alternativeName: "elements", baseClassName: "question", visible: !1, isLightSerializable: !1, onGetValue: function (e) { return null }, onSetValue: function (e, t, n) { e.pages.splice(0, e.pages.length); var o = e.addNewPage(""); n.toObject({ questions: t }, o) } }, { name: "triggers:triggers", baseClassName: "surveytrigger", classNamePart: "trigger" }, { name: "calculatedValues:calculatedvalues", className: "calculatedvalue" }, { name: "surveyId", visible: !1 }, { name: "surveyPostId", visible: !1 }, { name: "surveyShowDataSaving:boolean", visible: !1 }, "cookieName", "sendResultOnPageNext:boolean", { name: "showNavigationButtons", default: "bottom", choices: ["none", "top", "bottom", "both"] }, { name: "showPrevButton:boolean", default: !0 }, { name: "showTitle:boolean", default: !0 }, { name: "showPageTitles:boolean", default: !0 }, { name: "showCompletedPage:boolean", default: !0 }, "navigateToUrl", { name: "navigateToUrlOnCondition:urlconditions", className: "urlconditionitem" }, { name: "questionsOrder", default: "initial", choices: ["initial", "random"] }, "showPageNumbers:boolean", { name: "showQuestionNumbers", default: "on", choices: ["on", "onPage", "off"] }, { name: "questionTitleLocation", default: "top", choices: ["top", "bottom", "left"] }, { name: "questionDescriptionLocation", default: "underTitle", choices: ["underInput", "underTitle"] }, { name: "questionErrorLocation", default: "top", choices: ["top", "bottom"] }, { name: "showProgressBar", default: "off", choices: ["off", "top", "bottom", "both"] }, { name: "progressBarType", default: "pages", choices: ["pages", "questions", "requiredQuestions", "correctQuestions", "buttons"] }, { name: "mode", default: "edit", choices: ["edit", "display"] }, { name: "storeOthersAsComment:boolean", default: !0 }, { name: "maxTextLength:number", default: 0, minValue: 0 }, { name: "maxOthersLength:number", default: 0, minValue: 0 }, { name: "goNextPageAutomatic:boolean", onSetValue: function (e, t) { "autogonext" !== t && (t = r.isTwoValueEquals(t, !0)), e.setPropertyValue("goNextPageAutomatic", t) } }, { name: "clearInvisibleValues", default: "onComplete", choices: ["none", "onComplete", "onHidden", "onHiddenContainer"] }, { name: "checkErrorsMode", default: "onNextPage", choices: ["onNextPage", "onValueChanged", "onValueChanging", "onComplete"] }, { name: "textUpdateMode", default: "onBlur", choices: ["onBlur", "onTyping"] }, { name: "autoGrowComment:boolean", default: !1 }, { name: "startSurveyText", serializationProperty: "locStartSurveyText" }, { name: "pagePrevText", serializationProperty: "locPagePrevText" }, { name: "pageNextText", serializationProperty: "locPageNextText" }, { name: "completeText", serializationProperty: "locCompleteText" }, { name: "previewText", serializationProperty: "locPreviewText" }, { name: "editText", serializationProperty: "locEditText" }, { name: "requiredText", default: "*" }, { name: "questionStartIndex", dependsOn: ["showQuestionNumbers"], visibleIf: function (e) { return !e || "off" !== e.showQuestionNumbers } }, { name: "questionTitlePattern", default: "numTitleRequire", dependsOn: ["questionStartIndex", "requiredText"], choices: function (e) { return e ? e.getQuestionTitlePatternOptions() : [] } }, { name: "questionTitleTemplate", visible: !1, isSerializable: !1, serializationProperty: "locQuestionTitleTemplate" }, { name: "firstPageIsStarted:boolean", default: !1 }, { name: "isSinglePage:boolean", default: !1, visible: !1, isSerializable: !1 }, { name: "questionsOnPageMode", default: "standard", choices: ["singlePage", "standard", "questionPerPage"] }, { name: "showPreviewBeforeComplete", default: "noPreview", choices: ["noPreview", "showAllQuestions", "showAnsweredQuestions"] }, { name: "maxTimeToFinish:number", default: 0, minValue: 0 }, { name: "maxTimeToFinishPage:number", default: 0, minValue: 0 }, { name: "showTimerPanel", default: "none", choices: ["none", "top", "bottom"] }, { name: "showTimerPanelMode", default: "all", choices: ["all", "page", "survey"] }, { name: "widthMode", default: "auto", choices: ["auto", "static", "responsive"] }, "width", { name: "showBrandInfo:boolean", default: !1, visible: !1 }]); var mo = function () { var e = function (t, n) { return (e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (e, t) { e.__proto__ = t } || function (e, t) { for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]) })(t, n) }; return function (t, n) { if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null"); function o() { this.constructor = t } e(t, n), t.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o) } }(), vo = function (e, t, n, o) { var r, i = arguments.length, s = i < 3 ? t : null === o ? o = Object.getOwnPropertyDescriptor(t, n) : o; if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) s = Reflect.decorate(e, t, n, o); else for (var a = e.length - 1; a >= 0; a--)(r = e[a]) && (s = (i < 3 ? r(s) : i > 3 ? r(t, n, s) : r(t, n)) || s); return i > 3 && s && Object.defineProperty(t, n, s), s }, bo = function (e) { function t(t) { var n = e.call(this, t) || this; n.otherItemValue = new qe("other"), n.dependedQuestions = [], n.noneItemValue = new qe(o.noneItemValue), n.isSettingDefaultValue = !1, n.isSettingComment = !1, n.isRunningChoices = !1, n.isFirstLoadChoicesFromUrl = !0, n.isUpdatingChoicesDependedQuestions = !1, n.prevIsOtherSelected = !1; var r = n.createLocalizableString("noneText", n.noneItemValue, !0, "noneItemText"); n.noneItemValue.locOwner = n, n.noneItemValue.setLocText(r), n.createItemValues("choices"), n.registerPropertyChangedHandlers(["choices"], (function () { n.filterItems() || n.onVisibleChoicesChanged() })), n.registerPropertyChangedHandlers(["choicesFromQuestion", "choicesFromQuestionMode", "showNoneItem"], (function () { n.onVisibleChoicesChanged() })), n.registerPropertyChangedHandlers(["hideIfChoicesEmpty"], (function () { n.updateVisibilityBasedOnChoices() })), n.createNewArray("visibleChoices"), n.setNewRestfulProperty(); var i = n.createLocalizableString("otherText", n.otherItemValue, !0, "otherItemText"); return n.createLocalizableString("otherErrorText", n, !0, "otherRequiredError"), n.otherItemValue.locOwner = n, n.otherItemValue.setLocText(i), n.choicesByUrl.createItemValue = function (e) { return n.createItemValue(e) }, n.choicesByUrl.beforeSendRequestCallback = function () { n.onBeforeSendRequest() }, n.choicesByUrl.getResultCallback = function (e) { n.onLoadChoicesFromUrl(e) }, n.choicesByUrl.updateResultCallback = function (e, t) { return n.survey ? n.survey.updateChoicesFromServer(n, e, t) : e }, n } return mo(t, e), t.prototype.getType = function () { return "selectbase" }, t.prototype.dispose = function () { e.prototype.dispose.call(this); for (var t = 0; t < this.dependedQuestions.length; t++)this.dependedQuestions[t].choicesFromQuestion = ""; this.removeFromDependedQuestion(this.getQuestionWithChoices()) }, Object.defineProperty(t.prototype, "otherId", { get: function () { return this.id + "_other" }, enumerable: !1, configurable: !0 }), t.prototype.getCommentElementsId = function () { return [this.commentId, this.otherId] }, t.prototype.getItemValueType = function () { return "itemvalue" }, t.prototype.createItemValue = function (e) { return _.createClass(this.getItemValueType(), e) }, t.prototype.supportGoNextPageError = function () { return !this.isOtherSelected || !!this.otherValue }, t.prototype.isLayoutTypeSupported = function (e) { return !0 }, t.prototype.localeChanged = function () { e.prototype.localeChanged.call(this), "none" !== this.choicesOrder && this.updateVisibleChoices() }, t.prototype.locStrsChanged = function () { e.prototype.locStrsChanged.call(this), this.choicesFromUrl && (qe.locStrsChanged(this.choicesFromUrl), qe.locStrsChanged(this.visibleChoices)) }, Object.defineProperty(t.prototype, "otherValue", { get: function () { return this.showCommentArea ? this.otherValueCore : this.comment }, set: function (e) { this.showCommentArea ? this.setOtherValueInternally(e) : this.comment = e }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "otherValueCore", { get: function () { return this.getPropertyValue("otherValue") }, set: function (e) { this.setPropertyValue("otherValue", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "otherItem", { get: function () { return this.otherItemValue }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "isOtherSelected", { get: function () { return this.hasOther && this.getHasOther(this.renderedValue) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "isNoneSelected", { get: function () { return this.hasNone && this.getIsItemValue(this.renderedValue, this.noneItem) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "showNoneItem", { get: function () { return this.getPropertyValue("showNoneItem", !1) }, set: function (e) { this.setPropertyValue("showNoneItem", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "hasNone", { get: function () { return this.showNoneItem }, set: function (e) { this.showNoneItem = e }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "noneItem", { get: function () { return this.noneItemValue }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "noneText", { get: function () { return this.getLocalizableStringText("noneText") }, set: function (e) { this.setLocalizableStringText("noneText", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "locNoneText", { get: function () { return this.getLocalizableString("noneText") }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "choicesVisibleIf", { get: function () { return this.getPropertyValue("choicesVisibleIf", "") }, set: function (e) { this.setPropertyValue("choicesVisibleIf", e), this.filterItems() }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "choicesEnableIf", { get: function () { return this.getPropertyValue("choicesEnableIf", "") }, set: function (e) { this.setPropertyValue("choicesEnableIf", e), this.filterItems() }, enumerable: !1, configurable: !0 }), t.prototype.surveyChoiceItemVisibilityChange = function () { this.filterItems() }, t.prototype.runCondition = function (t, n) { e.prototype.runCondition.call(this, t, n), this.isUsingCarrayForward || (this.runItemsEnableCondition(t, n), this.runItemsCondition(t, n)) }, t.prototype.isTextValue = function () { return !0 }, t.prototype.setDefaultValue = function () { this.isSettingDefaultValue = !this.isValueEmpty(this.defaultValue) && this.hasUnknownValue(this.defaultValue), this.prevOtherValue = void 0, e.prototype.setDefaultValue.call(this), this.isSettingDefaultValue = !1 }, t.prototype.getIsMultipleValue = function () { return !1 }, t.prototype.convertDefaultValue = function (e) { if (null == e || null == e) return e; if (this.getIsMultipleValue()) { if (!Array.isArray(e)) return [e] } else if (Array.isArray(e) && e.length > 0) return e[0]; return e }, t.prototype.filterItems = function () { if (this.isLoadingFromJson || !this.data || this.areInvisibleElementsShowing) return !1; var e = this.getDataFilteredValues(), t = this.getDataFilteredProperties(); return this.runItemsEnableCondition(e, t), this.runItemsCondition(e, t) }, t.prototype.runItemsCondition = function (e, t) { this.setConditionalChoicesRunner(); var n = this.runConditionsForItems(e, t); return this.filteredChoicesValue && this.filteredChoicesValue.length === this.activeChoices.length && (this.filteredChoicesValue = void 0), n && (this.onVisibleChoicesChanged(), this.clearIncorrectValues()), n }, t.prototype.runItemsEnableCondition = function (e, t) { var n = this; this.setConditionalEnableChoicesRunner(), qe.runEnabledConditionsForItems(this.activeChoices, this.conditionChoicesEnableIfRunner, e, t, (function (e, t) { return t && n.onEnableItemCallBack(e) })) && this.clearDisabledValues(), this.onAfterRunItemsEnableCondition() }, t.prototype.onAfterRunItemsEnableCondition = function () { }, t.prototype.onEnableItemCallBack = function (e) { return !0 }, t.prototype.setConditionalChoicesRunner = function () { this.choicesVisibleIf ? (this.conditionChoicesVisibleIfRunner || (this.conditionChoicesVisibleIfRunner = new oe(this.choicesVisibleIf)), this.conditionChoicesVisibleIfRunner.expression = this.choicesVisibleIf) : this.conditionChoicesVisibleIfRunner = null }, t.prototype.setConditionalEnableChoicesRunner = function () { this.choicesEnableIf ? (this.conditionChoicesEnableIfRunner || (this.conditionChoicesEnableIfRunner = new oe(this.choicesEnableIf)), this.conditionChoicesEnableIfRunner.expression = this.choicesEnableIf) : this.conditionChoicesEnableIfRunner = null }, t.prototype.canSurveyChangeItemVisibility = function () { return !!this.survey && this.survey.canChangeChoiceItemsVisibility() }, t.prototype.changeItemVisisbility = function () { var e = this; return this.canSurveyChangeItemVisibility() ? function (t, n) { return e.survey.getChoiceItemVisibility(e, t, n) } : null }, t.prototype.runConditionsForItems = function (e, t) { this.filteredChoicesValue = []; var n = this.changeItemVisisbility(); return qe.runConditionsForItems(this.activeChoices, this.getFilteredChoices(), this.areInvisibleElementsShowing ? null : this.conditionChoicesVisibleIfRunner, e, t, !this.survey || !this.survey.areInvisibleElementsShowing, (function (e, t) { return n ? n(e, t) : t })) }, t.prototype.getHasOther = function (e) { return this.getIsItemValue(e, this.otherItem) }, t.prototype.getIsItemValue = function (e, t) { return e === t.value }, Object.defineProperty(t.prototype, "validatedValue", { get: function () { return this.rendredValueToDataCore(this.value) }, enumerable: !1, configurable: !0 }), t.prototype.createRestful = function () { return new Qt }, t.prototype.setNewRestfulProperty = function () { this.setPropertyValue("choicesByUrl", this.createRestful()), this.choicesByUrl.owner = this, this.choicesByUrl.loadingOwner = this }, Object.defineProperty(t.prototype, "autoOtherMode", { get: function () { return this.getPropertyValue("autoOtherMode") }, set: function (e) { this.setPropertyValue("autoOtherMode", e) }, enumerable: !1, configurable: !0 }), t.prototype.getQuestionComment = function () { return this.showCommentArea ? e.prototype.getQuestionComment.call(this) : this.otherValueCore ? this.otherValueCore : this.hasComment || this.getStoreOthersAsComment() ? e.prototype.getQuestionComment.call(this) : this.otherValueCore }, t.prototype.selectOtherValueFromComment = function (e) { this.value = e ? this.otherItem.value : void 0 }, t.prototype.setQuestionComment = function (t) { this.showCommentArea ? e.prototype.setQuestionComment.call(this, t) : (this.onUpdateCommentOnAutoOtherMode(t), this.getStoreOthersAsComment() ? e.prototype.setQuestionComment.call(this, t) : this.setOtherValueInternally(t), this.updateChoicesDependedQuestions()) }, t.prototype.onUpdateCommentOnAutoOtherMode = function (e) { if (this.autoOtherMode) { this.prevOtherValue = void 0; var t = this.isOtherSelected; (!t && e || t && !e) && this.selectOtherValueFromComment(!!e) } }, t.prototype.setOtherValueInternally = function (e) { this.isSettingComment || e == this.otherValueCore || (this.isSettingComment = !0, this.otherValueCore = e, this.isOtherSelected && !this.isRenderedValueSetting && (this.value = this.rendredValueToData(this.renderedValue)), this.isSettingComment = !1) }, t.prototype.clearValue = function () { e.prototype.clearValue.call(this), this.prevOtherValue = void 0 }, t.prototype.updateCommentFromSurvey = function (t) { e.prototype.updateCommentFromSurvey.call(this, t), this.prevOtherValue = void 0 }, Object.defineProperty(t.prototype, "renderedValue", { get: function () { return this.getPropertyValue("renderedValue", null) }, set: function (e) { this.setPropertyValue("renderedValue", e); e = this.rendredValueToData(e); this.isTwoValueEquals(e, this.value) || (this.value = e) }, enumerable: !1, configurable: !0 }), t.prototype.setQuestionValue = function (t, n, o) { if (void 0 === n && (n = !0), void 0 === o && (o = !0), !this.isLoadingFromJson && !this.isTwoValueEquals(this.value, t) && (e.prototype.setQuestionValue.call(this, t, n), this.setPropertyValue("renderedValue", this.rendredValueFromData(t)), this.updateChoicesDependedQuestions(), !this.hasComment && o)) { var r = this.isOtherSelected; if (r && this.prevOtherValue) { var i = this.prevOtherValue; this.prevOtherValue = void 0, this.otherValue = i } !r && this.otherValue && (this.getStoreOthersAsComment() && !this.autoOtherMode && (this.prevOtherValue = this.otherValue), this.otherValue = "") } }, t.prototype.setNewValue = function (t) { this.resetSelectedItemValues(), t = this.valueFromData(t), (this.choicesByUrl.isRunning || this.choicesByUrl.isWaitingForParameters) && this.isValueEmpty(t) || (this.cachedValueForUrlRequests = t), e.prototype.setNewValue.call(this, t) }, t.prototype.valueFromData = function (t) { var n = qe.getItemByValue(this.activeChoices, t); return n ? n.value : e.prototype.valueFromData.call(this, t) }, t.prototype.rendredValueFromData = function (e) { return this.getStoreOthersAsComment() ? e : this.renderedValueFromDataCore(e) }, t.prototype.rendredValueToData = function (e) { return this.getStoreOthersAsComment() ? e : this.rendredValueToDataCore(e) }, t.prototype.renderedValueFromDataCore = function (e) { return this.hasUnknownValue(e, !0, !1) ? (this.otherValue = e, this.otherItem.value) : this.valueFromData(e) }, t.prototype.rendredValueToDataCore = function (e) { return e == this.otherItem.value && this.needConvertRenderedOtherToDataValue() && (e = this.otherValue), e }, t.prototype.needConvertRenderedOtherToDataValue = function () { var e = this.otherValue; return !!e && (!!(e = e.trim()) && this.hasUnknownValue(e, !0, !1)) }, t.prototype.updateSelectedItemValues = function () { var e = this; if (this.survey && !this.isEmpty() && 0 === this.choices.length) { var t = this.getIsMultipleValue(); this.survey.getChoiceDisplayValue({ question: this, values: t ? this.value : [this.value], setItems: function (n) { n && n.length && (e.selectedItemValues = t ? n.map((function (t, n) { return new qe(e.value[n], t) })) : new qe(e.value, n[0])) } }) } }, t.prototype.resetSelectedItemValues = function () { this.selectedItemValues = null }, t.prototype.hasUnknownValue = function (e, t, n, o) { if (void 0 === t && (t = !1), void 0 === n && (n = !0), void 0 === o && (o = !1), !o && this.isValueEmpty(e)) return !1; if (t && e == this.otherItem.value) return !1; if (this.hasNone && e == this.noneItem.value) return !1; var r = n ? this.getFilteredChoices() : this.activeChoices; return null == qe.getItemByValue(r, e) }, t.prototype.isValueDisabled = function (e) { var t = qe.getItemByValue(this.getFilteredChoices(), e); return !!t && !t.isEnabled }, Object.defineProperty(t.prototype, "choicesByUrl", { get: function () { return this.getPropertyValue("choicesByUrl") }, set: function (e) { e && (this.setNewRestfulProperty(), this.choicesByUrl.fromJSON(e.toJSON())) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "choices", { get: function () { return this.getPropertyValue("choices") }, set: function (e) { this.setPropertyValue("choices", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "choicesFromQuestion", { get: function () { return this.getPropertyValue("choicesFromQuestion") }, set: function (e) { var t = this.getQuestionWithChoices(); t && t.removeFromDependedQuestion(this), this.setPropertyValue("choicesFromQuestion", e) }, enumerable: !1, configurable: !0 }), t.prototype.addIntoDependedQuestion = function (e) { !e || e.dependedQuestions.indexOf(this) > -1 || e.dependedQuestions.push(this) }, t.prototype.removeFromDependedQuestion = function (e) { if (e) { var t = e.dependedQuestions.indexOf(this); t > -1 && e.dependedQuestions.splice(t, 1) } }, Object.defineProperty(t.prototype, "choicesFromQuestionMode", { get: function () { return this.getPropertyValue("choicesFromQuestionMode") }, set: function (e) { this.setPropertyValue("choicesFromQuestionMode", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "hideIfChoicesEmpty", { get: function () { return this.getPropertyValue("hideIfChoicesEmpty", !1) }, set: function (e) { this.setPropertyValue("hideIfChoicesEmpty", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "keepIncorrectValues", { get: function () { return this.getPropertyValue("keepIncorrectValues", !1) }, set: function (e) { this.setPropertyValue("keepIncorrectValues", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "storeOthersAsComment", { get: function () { return this.getPropertyValue("storeOthersAsComment") }, set: function (e) { this.setPropertyValue("storeOthersAsComment", e) }, enumerable: !1, configurable: !0 }), t.prototype.hasOtherChanged = function () { this.onVisibleChoicesChanged() }, Object.defineProperty(t.prototype, "choicesOrder", { get: function () { return this.getPropertyValue("choicesOrder") }, set: function (e) { (e = e.toLowerCase()) != this.choicesOrder && (this.setPropertyValue("choicesOrder", e), this.onVisibleChoicesChanged()) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "otherText", { get: function () { return this.getLocalizableStringText("otherText") }, set: function (e) { this.setLocalizableStringText("otherText", e), this.onVisibleChoicesChanged() }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "locOtherText", { get: function () { return this.getLocalizableString("otherText") }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "otherPlaceHolder", { get: function () { return this.otherPlaceholder }, set: function (e) { this.otherPlaceholder = e }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "otherErrorText", { get: function () { return this.getLocalizableStringText("otherErrorText") }, set: function (e) { this.setLocalizableStringText("otherErrorText", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "locOtherErrorText", { get: function () { return this.getLocalizableString("otherErrorText") }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "visibleChoices", { get: function () { return this.getPropertyValue("visibleChoices") }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "enabledChoices", { get: function () { for (var e = [], t = this.visibleChoices, n = 0; n < t.length; n++)t[n].isEnabled && e.push(t[n]); return e }, enumerable: !1, configurable: !0 }), t.prototype.updateVisibleChoices = function () { if (!this.isLoadingFromJson) { var e = new Array, t = this.calcVisibleChoices(); t || (t = []); for (var n = 0; n < t.length; n++)e.push(t[n]); this.setPropertyValue("visibleChoices", e) } }, t.prototype.calcVisibleChoices = function () { if (this.canUseFilteredChoices()) return this.getFilteredChoices(); var e = this.sortVisibleChoices(this.getFilteredChoices().slice()); return this.addToVisibleChoices(e, this.isAddDefaultItems), e }, t.prototype.canUseFilteredChoices = function () { return !this.isAddDefaultItems && !this.hasNone && !this.hasOther && "none" == this.choicesOrder }, t.prototype.setCanShowOptionItemCallback = function (e) { this.canShowOptionItemCallback = e, e && this.onVisibleChoicesChanged() }, Object.defineProperty(t.prototype, "newItem", { get: function () { return this.newItemValue }, enumerable: !1, configurable: !0 }), t.prototype.addToVisibleChoices = function (e, t) { t && (this.newItemValue || (this.newItemValue = new qe("newitem")), this.canShowOptionItem(this.newItemValue, t, !1) && e.push(this.newItemValue)), this.supportNone() && this.canShowOptionItem(this.noneItem, t, this.hasNone) && e.push(this.noneItem), this.supportOther() && this.canShowOptionItem(this.otherItem, t, this.hasOther) && e.push(this.otherItem) }, t.prototype.canShowOptionItem = function (e, t, n) { var o = t && (!this.canShowOptionItemCallback || this.canShowOptionItemCallback(e)) || n; return this.canSurveyChangeItemVisibility() ? this.changeItemVisisbility()(e, o) : o }, t.prototype.isItemInList = function (e) { return e === this.otherItem ? this.hasOther : e === this.noneItem ? this.hasNone : e !== this.newItemValue }, Object.defineProperty(t.prototype, "isAddDefaultItems", { get: function () { return o.supportCreatorV2 && o.showDefaultItemsInCreatorV2 && this.isDesignMode && !this.customWidget && !this.isContentElement }, enumerable: !1, configurable: !0 }), t.prototype.getPlainData = function (t) { var n = this; void 0 === t && (t = { includeEmpty: !0, includeQuestionTypes: !1 }); var o = e.prototype.getPlainData.call(this, t); if (o) { var r = Array.isArray(this.value) ? this.value : [this.value]; o.isNode = !0, o.data = (o.data || []).concat(r.map((function (e, o) { var r = qe.getItemByValue(n.visibleChoices, e), i = { name: o, title: "Choice", value: e, displayValue: n.getChoicesDisplayValue(n.visibleChoices, e), getString: function (e) { return "object" == typeof e ? JSON.stringify(e) : e }, isNode: !1 }; return r && (t.calculations || []).forEach((function (e) { i[e.propertyName] = r[e.propertyName] })), n.isOtherSelected && n.otherItemValue === r && (i.isOther = !0, i.displayValue = n.otherValue), i }))) } return o }, t.prototype.getDisplayValueCore = function (e, t) { return this.getChoicesDisplayValue(this.visibleChoices, t) }, t.prototype.getDisplayValueEmpty = function () { return qe.getTextOrHtmlByValue(this.visibleChoices, void 0) }, t.prototype.getChoicesDisplayValue = function (e, t) { if (t == this.otherItemValue.value) return this.otherValue ? this.otherValue : this.locOtherText.textOrHtml; var n = qe.getTextOrHtmlByValue(e, t); return "" == n && t ? t : n }, t.prototype.getDisplayArrayValue = function (e, t, n) { for (var o = this.visibleChoices, r = [], i = 0; i < t.length; i++) { var s = n ? n(i) : t[i], a = this.getChoicesDisplayValue(o, s); a && r.push(a) } return r.join(", ") }, t.prototype.getFilteredChoices = function () { return this.filteredChoicesValue ? this.filteredChoicesValue : this.activeChoices }, Object.defineProperty(t.prototype, "activeChoices", { get: function () { var e = this.getQuestionWithChoices(); return this.isUsingCarrayForward = !!e, this.isUsingCarrayForward ? (this.addIntoDependedQuestion(e), this.getChoicesFromQuestion(e)) : this.choicesFromUrl ? this.choicesFromUrl : this.getChoices() }, enumerable: !1, configurable: !0 }), t.prototype.getQuestionWithChoices = function () { if (!this.choicesFromQuestion || !this.data) return null; var e = this.data.findQuestionByName(this.choicesFromQuestion); return e && e.visibleChoices && Array.isArray(e.dependedQuestions) && e !== this ? e : null }, t.prototype.getChoicesFromQuestion = function (e) { for (var t = [], n = "selected" == this.choicesFromQuestionMode || "unselected" != this.choicesFromQuestionMode && void 0, o = e.visibleChoices, r = 0; r < o.length; r++)if (!this.isBuiltInChoice(o[r], e)) if (void 0 !== n) { var i = e.isItemSelected(o[r]); (i && n || !i && !n) && t.push(o[r]) } else t.push(o[r]); return "selected" === this.choicesFromQuestionMode && e.isOtherSelected && e.comment && t.push(new qe(e.otherItem.value, e.comment)), t }, Object.defineProperty(t.prototype, "hasActiveChoices", { get: function () { var e = this.visibleChoices; e && 0 != e.length || (this.onVisibleChoicesChanged(), e = this.visibleChoices); for (var t = 0; t < e.length; t++)if (!this.isBuiltInChoice(e[t], this)) return !0; return !1 }, enumerable: !1, configurable: !0 }), t.prototype.isHeadChoice = function (e, t) { return !1 }, t.prototype.isFootChoice = function (e, t) { return e === t.noneItem || e === t.otherItem || e === t.newItemValue }, t.prototype.isBuiltInChoice = function (e, t) { return this.isHeadChoice(e, t) || this.isFootChoice(e, t) }, t.prototype.getChoices = function () { return this.choices }, t.prototype.supportOther = function () { return this.isSupportProperty("showOtherItem") }, t.prototype.supportNone = function () { return this.isSupportProperty("showNoneItem") }, t.prototype.isSupportProperty = function (e) { return !this.isDesignMode || this.getPropertyByName(e).visible }, t.prototype.onCheckForErrors = function (t, n) { var o = this; if (e.prototype.onCheckForErrors.call(this, t, n), this.hasOther && this.isOtherSelected && !this.otherValue) { var r = new we(this.otherErrorText, this); r.onUpdateErrorTextCallback = function (e) { e.text = o.otherErrorText }, t.push(r) } }, t.prototype.setSurveyImpl = function (t, n) { e.prototype.setSurveyImpl.call(this, t, n), this.runChoicesByUrl(), this.isAddDefaultItems && this.updateVisibleChoices() }, t.prototype.setSurveyCore = function (t) { e.prototype.setSurveyCore.call(this, t), t && this.choicesFromQuestion && this.onVisibleChoicesChanged() }, t.prototype.getStoreOthersAsComment = function () { return !this.isSettingDefaultValue && (!this.showCommentArea && (!0 === this.storeOthersAsComment || "default" == this.storeOthersAsComment && (null == this.survey || this.survey.storeOthersAsComment) || !this.choicesByUrl.isEmpty && !this.choicesFromUrl)) }, t.prototype.onSurveyLoad = function () { this.runChoicesByUrl(), this.onVisibleChoicesChanged(), e.prototype.onSurveyLoad.call(this) }, t.prototype.onAnyValueChanged = function (t) { e.prototype.onAnyValueChanged.call(this, t), t != this.getValueName() && this.runChoicesByUrl(), t && t == this.choicesFromQuestion && this.onVisibleChoicesChanged() }, t.prototype.updateValueFromSurvey = function (t) { var n = ""; this.hasOther && !this.isRunningChoices && !this.choicesByUrl.isRunning && this.getStoreOthersAsComment() && (this.hasUnknownValue(t) && !this.getHasOther(t) ? (n = this.getCommentFromValue(t), t = this.setOtherValueIntoValue(t)) : n = this.data.getComment(this.getValueName())), e.prototype.updateValueFromSurvey.call(this, t), n && this.setNewComment(n) }, t.prototype.getCommentFromValue = function (e) { return e }, t.prototype.setOtherValueIntoValue = function (e) { return this.otherItem.value }, t.prototype.onOtherValueInput = function (e) { this.isInputTextUpdate ? e.target && (this.otherValue = e.target.value) : this.updateCommentElements() }, t.prototype.onOtherValueChange = function (e) { this.otherValue = e.target.value, this.otherValue !== e.target.value && (e.target.value = this.otherValue) }, t.prototype.runChoicesByUrl = function () { if (this.choicesByUrl && !this.isLoadingFromJson && !this.isRunningChoices) { var e = this.surveyImpl ? this.surveyImpl.getTextProcessor() : this.textProcessor; e || (e = this.survey), e && (this.isReadyValue = this.isChoicesLoaded || this.choicesByUrl.isEmpty, this.isRunningChoices = !0, this.choicesByUrl.run(e), this.isRunningChoices = !1) } }, t.prototype.onBeforeSendRequest = function () { !0 !== o.disableOnGettingChoicesFromWeb || this.isReadOnly || (this.enableOnLoadingChoices = !0, this.readOnly = !0) }, t.prototype.onLoadChoicesFromUrl = function (e) { if (this.enableOnLoadingChoices && (this.readOnly = !1), !this.isReadOnly) { var t = []; this.choicesByUrl && this.choicesByUrl.error && t.push(this.choicesByUrl.error), this.errors = t } var n = null, o = !0; this.isFirstLoadChoicesFromUrl && !this.cachedValueForUrlRequests && this.defaultValue && (this.cachedValueForUrlRequests = this.defaultValue, o = !1), this.isValueEmpty(this.cachedValueForUrlRequests) && (this.cachedValueForUrlRequests = this.value), this.isFirstLoadChoicesFromUrl = !1; var r = this.createCachedValueForUrlRequests(this.cachedValueForUrlRequests, o); if (e && (e.length > 0 || this.choicesByUrl.allowEmptyResponse) && (n = new Array, qe.setData(n, e)), n) for (var i = 0; i < n.length; i++)n[i].locOwner = this; if (this.choicesFromUrl = n, this.filterItems(), this.onVisibleChoicesChanged(), n) { var s = this.updateCachedValueForUrlRequests(r, n); if (s && !this.isReadOnly) { var a = !this.isTwoValueEquals(this.value, s.value); try { this.isValueEmpty(s.value) || (this.allowNotifyValueChanged = !1, this.setQuestionValue(void 0, !0, !1)), this.allowNotifyValueChanged = a, a ? this.value = s.value : this.setQuestionValue(s.value) } finally { this.allowNotifyValueChanged = !0 } } } this.choicesLoaded() }, t.prototype.createCachedValueForUrlRequests = function (e, t) { if (this.isValueEmpty(e)) return null; if (Array.isArray(e)) { for (var n = [], o = 0; o < e.length; o++)n.push(this.createCachedValueForUrlRequests(e[o], !0)); return n } return { value: e, isExists: !t || !this.hasUnknownValue(e) } }, t.prototype.updateCachedValueForUrlRequests = function (e, t) { if (this.isValueEmpty(e)) return null; if (Array.isArray(e)) { for (var n = [], o = 0; o < e.length; o++) { var r = this.updateCachedValueForUrlRequests(e[o], t); if (r && !this.isValueEmpty(r.value)) { var i = r.value; (s = qe.getItemByValue(t, r.value)) && (i = s.value), n.push(i) } } return { value: n } } var s, a = e.isExists && this.hasUnknownValue(e.value) ? null : e.value; return (s = qe.getItemByValue(t, a)) && (a = s.value), { value: a } }, t.prototype.updateChoicesDependedQuestions = function () { if (!this.isLoadingFromJson && !this.isUpdatingChoicesDependedQuestions) { this.isUpdatingChoicesDependedQuestions = !0; for (var e = 0; e < this.dependedQuestions.length; e++)this.dependedQuestions[e].onVisibleChoicesChanged(); this.isUpdatingChoicesDependedQuestions = !1 } }, t.prototype.onSurveyValueChanged = function (t) { e.prototype.onSurveyValueChanged.call(this, t), this.updateChoicesDependedQuestions() }, t.prototype.onVisibleChoicesChanged = function () { this.isLoadingFromJson || (this.updateVisibleChoices(), this.updateVisibilityBasedOnChoices(), this.visibleChoicesChangedCallback && this.visibleChoicesChangedCallback(), this.updateChoicesDependedQuestions()) }, t.prototype.updateVisibilityBasedOnChoices = function () { if (this.hideIfChoicesEmpty) { var e = this.getFilteredChoices(); this.visible = !e || e.length > 0 } }, t.prototype.sortVisibleChoices = function (e) { var t = this.choicesOrder.toLowerCase(); return "asc" == t ? this.sortArray(e, 1) : "desc" == t ? this.sortArray(e, -1) : "random" == t ? this.randomizeArray(e) : e }, t.prototype.sortArray = function (e, t) { return e.sort((function (e, n) { return e.calculatedText < n.calculatedText ? -1 * t : e.calculatedText > n.calculatedText ? 1 * t : 0 })) }, t.prototype.randomizeArray = function (e) { return r.randomizeArray(e) }, t.prototype.clearIncorrectValues = function () { this.hasValueToClearIncorrectValues() && (this.survey && this.survey.questionCountByValueName(this.getValueName()) > 1 || (!this.choicesByUrl || this.choicesByUrl.isEmpty || this.choicesFromUrl && 0 != this.choicesFromUrl.length) && (this.clearIncorrectValuesCallback ? this.clearIncorrectValuesCallback() : this.clearIncorrectValuesCore())) }, t.prototype.hasValueToClearIncorrectValues = function () { return (!this.survey || !this.survey.keepIncorrectValues) && (!this.keepIncorrectValues && !this.isEmpty()) }, t.prototype.clearValueIfInvisibleCore = function () { e.prototype.clearValueIfInvisibleCore.call(this), this.clearIncorrectValues() }, t.prototype.isItemSelected = function (e) { return e === this.otherItem ? this.isOtherSelected : this.isItemSelectedCore(e) }, t.prototype.isItemSelectedCore = function (e) { return e.value === this.value }, t.prototype.clearDisabledValues = function () { this.survey && this.survey.clearValueOnDisableItems && this.clearDisabledValuesCore() }, t.prototype.clearIncorrectValuesCore = function () { var e = this.value; this.canClearValueAnUnknow(e) && this.clearValue() }, t.prototype.canClearValueAnUnknow = function (e) { return !(!this.getStoreOthersAsComment() && this.isOtherSelected) && this.hasUnknownValue(e, !0, !0, !0) }, t.prototype.clearDisabledValuesCore = function () { this.isValueDisabled(this.value) && this.clearValue() }, t.prototype.clearUnusedValues = function () { e.prototype.clearUnusedValues.call(this), this.isOtherSelected || (this.otherValue = ""), this.showCommentArea || this.getStoreOthersAsComment() || this.isOtherSelected || (this.comment = "") }, t.prototype.getColumnClass = function () { return (new at).append(this.cssClasses.column).append("sv-q-column-" + this.colCount, this.hasColumns).toString() }, t.prototype.getItemIndex = function (e) { return this.visibleChoices.indexOf(e) }, t.prototype.getItemClass = function (e) { var t = { item: e }, n = this.getItemClassCore(e, t); return t.css = n, this.survey && this.survey.updateChoiceItemCss(this, t), t.css }, t.prototype.getCurrentColCount = function () { return this.colCount }, t.prototype.getItemClassCore = function (e, t) { var n = (new at).append(this.cssClasses.item).append(this.cssClasses.itemInline, !this.hasColumns && 0 === this.colCount).append("sv-q-col-" + this.getCurrentColCount(), !this.hasColumns && 0 !== this.colCount).append(this.cssClasses.itemOnError, this.errors.length > 0), o = this.isReadOnly || !e.isEnabled, r = this.isItemSelected(e) || this.isOtherSelected && this.otherItem.value === e.value, i = !(o || r || this.survey && this.survey.isDesignMode), s = e === this.noneItem; return t.isDisabled = o, t.isChecked = r, t.isNone = s, n.append(this.cssClasses.itemDisabled, o).append(this.cssClasses.itemChecked, r).append(this.cssClasses.itemHover, i).append(this.cssClasses.itemNone, s).toString() }, t.prototype.getLabelClass = function (e) { return (new at).append(this.cssClasses.label).append(this.cssClasses.labelChecked, this.isItemSelected(e)).toString() }, t.prototype.getControlLabelClass = function (e) { return (new at).append(this.cssClasses.controlLabel).append(this.cssClasses.controlLabelChecked, this.isItemSelected(e)).toString() || void 0 }, Object.defineProperty(t.prototype, "headItems", { get: function () { var e = this; return this.separateSpecialChoices || this.isDesignMode ? this.visibleChoices.filter((function (t) { return e.isHeadChoice(t, e) })) : [] }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "footItems", { get: function () { var e = this; return this.separateSpecialChoices || this.isDesignMode ? this.visibleChoices.filter((function (t) { return e.isFootChoice(t, e) })) : [] }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "dataChoices", { get: function () { var e = this; return this.visibleChoices.filter((function (t) { return !e.isBuiltInChoice(t, e) })) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "bodyItems", { get: function () { return this.hasHeadItems || this.hasFootItems ? this.dataChoices : this.visibleChoices }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "hasHeadItems", { get: function () { return this.headItems.length > 0 }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "hasFootItems", { get: function () { return this.footItems.length > 0 }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "columns", { get: function () { var e = [], t = this.getCurrentColCount(); if (this.hasColumns && this.visibleChoices.length > 0) { var n = this.separateSpecialChoices || this.isDesignMode ? this.dataChoices : this.visibleChoices; if ("column" == o.showItemsInOrder) for (var r = 0, i = n.length % t, s = 0; s < t; s++) { for (var a = [], l = r; l < r + Math.floor(n.length / t); l++)a.push(n[l]); i > 0 && (i--, a.push(n[l]), l++), r = l, e.push(a) } else for (s = 0; s < t; s++) { for (a = [], l = s; l < n.length; l += t)a.push(n[l]); e.push(a) } } return e }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "hasColumns", { get: function () { return !this.isMobile && this.getCurrentColCount() > 1 }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "rowLayout", { get: function () { return 0 == this.getCurrentColCount() && !(this.hasFootItems || this.hasHeadItems) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "blockedRow", { get: function () { return 0 == this.getCurrentColCount() && (this.hasFootItems || this.hasHeadItems) }, enumerable: !1, configurable: !0 }), t.prototype.choicesLoaded = function () { this.isChoicesLoaded = !0; var e = this.isReadyValue; this.isReadyValue = !0, this.onReadyChanged && this.onReadyChanged.fire(this, { question: this, isReady: !0, oldIsReady: e }), this.survey && this.survey.loadedChoicesFromServer(this), this.loadedChoicesFromServerCallback && this.loadedChoicesFromServerCallback() }, t.prototype.getItemValueWrapperComponentName = function (e) { var t = this.survey; return t ? t.getItemValueWrapperComponentName(e, this) : yo.TemplateRendererComponentName }, t.prototype.getItemValueWrapperComponentData = function (e) { var t = this.survey; return t ? t.getItemValueWrapperComponentData(e, this) : e }, t.prototype.ariaItemChecked = function (e) { return this.renderedValue === e.value ? "true" : "false" }, t.prototype.isOtherItem = function (e) { return this.hasOther && e.value == this.otherItem.value }, Object.defineProperty(t.prototype, "itemSvgIcon", { get: function () { return this.cssClasses.itemSvgIconId }, enumerable: !1, configurable: !0 }), t.prototype.getSelectBaseRootCss = function () { return (new at).append(this.cssClasses.root).append(this.cssClasses.rootRow, this.rowLayout).toString() }, t.prototype.getAriaItemLabel = function (e) { return e.locText.renderedHtml }, t.prototype.getItemId = function (e) { return this.inputId + "_" + this.getItemIndex(e) }, Object.defineProperty(t.prototype, "questionName", { get: function () { return this.name + "_" + this.id }, enumerable: !1, configurable: !0 }), t.prototype.getItemEnabled = function (e) { return !this.isInputReadOnly && e.isEnabled }, t.prototype.afterRender = function (t) { e.prototype.afterRender.call(this, t), this.rootElement = t }, t.prototype.beforeDestroyQuestionElement = function (t) { e.prototype.beforeDestroyQuestionElement.call(this, t), this.rootElement = void 0 }, t.prototype.focusOtherComment = function () { var e = this; this.rootElement && setTimeout((function () { var t = e.rootElement.querySelector("textarea"); t && t.focus() }), 10) }, t.prototype.onValueChanged = function () { e.prototype.onValueChanged.call(this), this.isDesignMode || this.prevIsOtherSelected || !this.isOtherSelected || this.focusOtherComment(), this.prevIsOtherSelected = this.isOtherSelected }, t.prototype.getDefaultItemComponent = function () { return "" }, Object.defineProperty(t.prototype, "itemComponent", { get: function () { return this.getPropertyValue("itemComponent", this.getDefaultItemComponent()) }, set: function (e) { this.setPropertyValue("itemComponent", e) }, enumerable: !1, configurable: !0 }), t.prototype.updateCssClasses = function (t, n) { if (e.prototype.updateCssClasses.call(this, t, n), this.dropdownListModel) { var o = {}; ot(n.list, o), ot(t.list, o), t.list = o } }, t.prototype.calcCssClasses = function (t) { var n = e.prototype.calcCssClasses.call(this, t); return this.dropdownListModel && this.dropdownListModel.updateCssClasses(n.popup, n.list), n }, vo([f()], t.prototype, "selectedItemValues", void 0), vo([f({ defaultValue: !1 })], t.prototype, "separateSpecialChoices", void 0), vo([f({ localizable: !0 })], t.prototype, "otherPlaceholder", void 0), t }($t), Co = function (e) { function t(t) { return e.call(this, t) || this } return mo(t, e), Object.defineProperty(t.prototype, "colCount", { get: function () { return this.getPropertyValue("colCount", this.isFlowLayout ? 0 : 1) }, set: function (e) { e < 0 || e > 5 || this.isFlowLayout || (this.setPropertyValue("colCount", e), this.fireCallback(this.colCountChangedCallback)) }, enumerable: !1, configurable: !0 }), t.prototype.clickItemHandler = function (e, t) { var n = [].concat(this.renderedValue || []), o = n.indexOf(e.value); t ? o < 0 && n.push(e.value) : o > -1 && n.splice(o, 1), this.renderedValue = n }, t.prototype.onParentChanged = function () { e.prototype.onParentChanged.call(this), this.isFlowLayout && this.setPropertyValue("colCount", null) }, t.prototype.onParentQuestionChanged = function () { this.onVisibleChoicesChanged() }, t.prototype.getSearchableItemValueKeys = function (e) { e.push("choices") }, t }(bo); _.addClass("selectbase", [{ name: "showCommentArea:switch", layout: "row", visible: !0, category: "general" }, "choicesFromQuestion:question_selectbase", { name: "choices:itemvalue[]", uniqueProperty: "value", baseValue: function () { return s.getString("choices_Item") }, dependsOn: "choicesFromQuestion", visibleIf: function (e) { return !e.choicesFromQuestion } }, { name: "choicesFromQuestionMode", default: "all", choices: ["all", "selected", "unselected"], dependsOn: "choicesFromQuestion", visibleIf: function (e) { return !!e.choicesFromQuestion } }, { name: "choicesOrder", default: "none", choices: ["none", "asc", "desc", "random"], dependsOn: "choicesFromQuestion", visibleIf: function (e) { return !e.choicesFromQuestion } }, { name: "choicesByUrl:restfull", className: "ChoicesRestful", onGetValue: function (e) { return e.choicesByUrl.getData() }, onSetValue: function (e, t) { e.choicesByUrl.setData(t) } }, "hideIfChoicesEmpty:boolean", { name: "choicesVisibleIf:condition", dependsOn: "choicesFromQuestion", visibleIf: function (e) { return !e.choicesFromQuestion } }, { name: "choicesEnableIf:condition", dependsOn: "choicesFromQuestion", visibleIf: function (e) { return !e.choicesFromQuestion } }, { name: "separateSpecialChoices:boolean", visible: !1 }, { name: "showOtherItem:boolean", alternativeName: "hasOther" }, { name: "showNoneItem:boolean", alternativeName: "hasNone" }, { name: "otherPlaceholder", alternativeName: "otherPlaceHolder", serializationProperty: "locOtherPlaceholder", dependsOn: "showOtherItem", visibleIf: function (e) { return e.hasOther } }, { name: "noneText", serializationProperty: "locNoneText", dependsOn: "showNoneItem", visibleIf: function (e) { return e.hasNone } }, { name: "otherText", serializationProperty: "locOtherText", dependsOn: "showOtherItem", visibleIf: function (e) { return e.hasOther } }, { name: "otherErrorText", serializationProperty: "locOtherErrorText", dependsOn: "showOtherItem", visibleIf: function (e) { return e.hasOther } }, { name: "storeOthersAsComment", default: "default", choices: ["default", !0, !1], visible: !1 }], null, "question"), _.addClass("checkboxbase", [{ name: "colCount:number", default: 1, choices: [0, 1, 2, 3, 4, 5], layout: "row" }], null, "selectbase"); var Po = function () { var e = function (t, n) { return (e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (e, t) { e.__proto__ = t } || function (e, t) { for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]) })(t, n) }; return function (t, n) { if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null"); function o() { this.constructor = t } e(t, n), t.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o) } }(), wo = function (e, t, n, o) { var r, i = arguments.length, s = i < 3 ? t : null === o ? o = Object.getOwnPropertyDescriptor(t, n) : o; if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) s = Reflect.decorate(e, t, n, o); else for (var a = e.length - 1; a >= 0; a--)(r = e[a]) && (s = (i < 3 ? r(s) : i > 3 ? r(t, n, s) : r(t, n)) || s); return i > 3 && s && Object.defineProperty(t, n, s), s }, Vo = function (e) { function t(t, n) { var o = e.call(this) || this; return o.question = t, o.onSelectionChanged = n, o.minPageSize = 25, o.loadingItemHeight = 40, o.selectedItemSelector = ".sv-list__item--selected", o.itemSelector = ".sv-list__item", o.itemsSettings = { skip: 0, take: 0, totalCount: 0, items: [] }, o.isRunningLoadQuestionChoices = !1, o.popupCssClasses = "sv-single-select-list", o.listModel = o.createListModel(), o.updateAfterListModelCreated(o.listModel), o.setSearchEnabled(o.question.searchEnabled), o.createPopup(), o.resetItemsSettings(), o } return Po(t, e), Object.defineProperty(t.prototype, "focusFirstInputSelector", { get: function () { return this.getFocusFirstInputSelector() }, enumerable: !1, configurable: !0 }), t.prototype.getFocusFirstInputSelector = function () { return An ? this.isValueEmpty(this.question.value) ? this.itemSelector : this.selectedItemSelector : !this.listModel.showFilter && this.question.value ? this.selectedItemSelector : "" }, t.prototype.resetItemsSettings = function () { this.itemsSettings.skip = 0, this.itemsSettings.take = Math.max(this.minPageSize, this.question.choicesLazyLoadPageSize), this.itemsSettings.totalCount = 0, this.itemsSettings.items = [] }, t.prototype.updateListItems = function () { this.listModel.setItems(this.getAvailableItems()) }, t.prototype.setItems = function (e, t) { this.itemsSettings.items = [].concat(this.itemsSettings.items, e), this.question.choices = this.itemsSettings.items, this.itemsSettings.totalCount = t, this.listModel.isAllDataLoaded = this.question.choicesLazyLoadEnabled && this.question.choices.length == this.itemsSettings.totalCount, this.updateListItems() }, t.prototype.updateQuestionChoices = function (e) { var t = this; if (!this.isRunningLoadQuestionChoices) { var n = this.itemsSettings.skip + 1 < this.itemsSettings.totalCount; this.itemsSettings.skip && !n || (this.isRunningLoadQuestionChoices = !0, this.question.survey.loadQuestionChoices({ question: this.question, filter: this.filterString, skip: this.itemsSettings.skip, take: this.itemsSettings.take, setItems: function (n, o) { t.isRunningLoadQuestionChoices = !1, t.setItems(n || [], o || 0), t.popupRecalculatePosition(t.itemsSettings.skip === t.itemsSettings.take), e && e() } }), this.itemsSettings.skip += this.itemsSettings.take) } }, t.prototype.updatePopupFocusFirstInputSelector = function () { this._popupModel.focusFirstInputSelector = this.focusFirstInputSelector }, t.prototype.createPopup = function () { var e = this; this._popupModel = new bt("sv-list", { model: this.listModel }, "bottom", "center", !1), this._popupModel.displayMode = An ? "overlay" : "popup", this._popupModel.positionMode = "fixed", this._popupModel.isFocusedContent = An, this._popupModel.setWidthByTarget = !An, this.updatePopupFocusFirstInputSelector(), this.listModel.registerPropertyChangedHandlers(["showFilter"], (function () { e.updatePopupFocusFirstInputSelector() })), this._popupModel.cssClass = this.popupCssClasses, this._popupModel.onVisibilityChanged.add((function (t, n) { n.isVisible && e.question.choicesLazyLoadEnabled && (e.listModel.actions = [], e.updateQuestionChoices()), n.isVisible && e.question.onOpenedCallBack && (e.updatePopupFocusFirstInputSelector(), e.question.onOpenedCallBack()), n.isVisible || (e.onHidePopup(), e.question.choicesLazyLoadEnabled && e.resetItemsSettings()) })) }, t.prototype.setFilterStringToListModel = function (e) { this.listModel.filterString = e, this.listModel.focusedItem && this.listModel.isItemVisible(this.listModel.focusedItem) || this.listModel.focusFirstVisibleItem() }, t.prototype.popupRecalculatePosition = function (e) { var t = this; setTimeout((function () { t.popupModel.recalculatePosition(e) }), 1) }, t.prototype.onHidePopup = function () { this.resetFilterString(), this.listModel.refresh() }, t.prototype.getAvailableItems = function () { var e = this; return this.question.visibleChoices.map((function (t) { return new Tt({ id: new ue((function () { return t.value })), data: t, locTitle: t.locText, component: new ue((function () { return e.question.itemComponent })), visible: new ue((function () { return t.isVisible })), enabled: new ue((function () { return t.isEnabled })) }) })) }, t.prototype.createListModel = function () { var e = this, t = this.getAvailableItems(), n = this.onSelectionChanged; return n || (n = function (t) { e.question.value = t.id, e._popupModel.toggleVisibility() }), new yt(t, n, !1) }, t.prototype.updateAfterListModelCreated = function (e) { var t = this; e.isItemSelected = function (e) { var n = t.question, o = qe.getItemByValue(n.visibleChoices, e.id); return !!o && n.isItemSelected(o) }, e.locOwner = this.question, e.onPropertyChanged.add((function (e, n) { "hasVerticalScroller" == n.name && (t.hasScroll = n.newValue) })), e.isAllDataLoaded = !this.question.choicesLazyLoadEnabled }, t.prototype.updateCssClasses = function (e, t) { this.popupModel.cssClass = (new at).append(e).append(this.popupCssClasses).toString(), this.listModel.cssClasses = t }, t.prototype.resetFilterString = function () { this.filterString && (this.filterString = void 0) }, t.prototype.onSetFilterString = function () { var e = this; this.filterString && !this.popupModel.isVisible && (this.popupModel.isVisible = !0), this.setInputHasValue(!!this.filterString); var t = function () { e.setFilterStringToListModel(e.filterString), e.popupRecalculatePosition(!0) }; this.question.choicesLazyLoadEnabled ? (this.resetItemsSettings(), this.updateQuestionChoices(t)) : t() }, t.prototype.setInputHasValue = function (e) { this.question.inputHasValue = e }, Object.defineProperty(t.prototype, "popupModel", { get: function () { return this._popupModel }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "inputReadOnly", { get: function () { return this.question.isInputReadOnly || this.searchEnabled }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "filterStringEnabled", { get: function () { return !this.question.isInputReadOnly && this.searchEnabled }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "inputMode", { get: function () { return An ? "none" : "text" }, enumerable: !1, configurable: !0 }), t.prototype.setSearchEnabled = function (e) { this.listModel.searchEnabled = An, this.listModel.showSearchClearButton = An, this.searchEnabled = e }, t.prototype.updateItems = function () { this.updateListItems() }, t.prototype.onClick = function (e) { if (this._popupModel.toggleVisibility(), this.listModel.focusNextVisibleItem(), this.searchEnabled && e && e.target) { var t = e.target.querySelector("input"); t && t.focus() } }, t.prototype.onClear = function (e) { this.question.clearValue(), this.resetFilterString(), e.preventDefault(), e.stopPropagation() }, t.prototype.getSelectedAction = function () { var e = this; return this.question.selectedItem ? this.listModel.actions.filter((function (t) { return e.question.selectedItem.value === t.id }))[0] : null }, t.prototype.keyHandler = function (e) { var t = e.which || e.keyCode; this.popupModel.isVisible && 38 === e.keyCode ? (this.listModel.focusPrevVisibleItem(), this.scrollToFocusedItem(), e.preventDefault(), e.stopPropagation()) : 40 === e.keyCode ? (this.popupModel.isVisible || this.popupModel.toggleVisibility(), this.listModel.focusNextVisibleItem(), this.scrollToFocusedItem(), e.preventDefault(), e.stopPropagation()) : !this.popupModel.isVisible || 13 !== e.keyCode && 32 !== e.keyCode ? 46 === t ? this.onClear(e) : 27 === e.keyCode ? this.popupModel.isVisible = !1 : (38 !== e.keyCode && 40 !== e.keyCode && 32 !== e.keyCode || (e.preventDefault(), e.stopPropagation()), $e(e, { processEsc: !1, disableTabStop: this.question.isInputReadOnly })) : (this.listModel.selectFocusedItem(), e.preventDefault(), e.stopPropagation()) }, t.prototype.onScroll = function (e) { var t = e.target; t.scrollHeight - (t.scrollTop + t.offsetHeight) <= this.loadingItemHeight && this.updateQuestionChoices() }, t.prototype.onBlur = function (e) { this.popupModel.isVisible && An ? this._popupModel.isVisible = !0 : (this.popupModel.isVisible && this.filterString && this.listModel.selectFocusedItem(), this.resetFilterString(), this._popupModel.isVisible = !1, this.setInputHasValue(!1), Ge(e)) }, t.prototype.scrollToFocusedItem = function () { this.listModel.scrollToFocusedItem() }, wo([f({ defaultValue: !0 })], t.prototype, "searchEnabled", void 0), wo([f({ defaultValue: "", onSet: function (e, t) { t.onSetFilterString() } })], t.prototype, "filterString", void 0), wo([f({ defaultValue: !1, onSet: function (e, t) { e ? t.listModel.addScrollEventListener((function (e) { t.onScroll(e) })) : t.listModel.removeScrollEventListener() } })], t.prototype, "hasScroll", void 0), t }(ce), xo = function () { var e = function (t, n) { return (e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (e, t) { e.__proto__ = t } || function (e, t) { for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]) })(t, n) }; return function (t, n) { if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null"); function o() { this.constructor = t } e(t, n), t.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o) } }(), Oo = function (e, t, n, o) { var r, i = arguments.length, s = i < 3 ? t : null === o ? o = Object.getOwnPropertyDescriptor(t, n) : o; if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) s = Reflect.decorate(e, t, n, o); else for (var a = e.length - 1; a >= 0; a--)(r = e[a]) && (s = (i < 3 ? r(s) : i > 3 ? r(t, n, s) : r(t, n)) || s); return i > 3 && s && Object.defineProperty(t, n, s), s }, To = function (e) { function t(t) { var n = e.call(this, t) || this; return n.lastSelectedItemValue = null, n.minMaxChoices = [], n.onOpened = n.addEvent(), n.createLocalizableString("placeholder", n, !1, !0), n.createLocalizableString("clearCaption", n, !1, !0), n.registerPropertyChangedHandlers(["choicesMin", "choicesMax", "choicesStep"], (function () { n.onVisibleChoicesChanged() })), n.registerPropertyChangedHandlers(["value", "renderAs", "showOtherItem", "otherText", "placeholder", "choices"], (function () { n.updateReadOnlyText() })), n.updateReadOnlyText(), n } return xo(t, e), t.prototype.updateReadOnlyText = function () { var e = this.selectedItem ? "" : this.placeholder; "select" == this.renderAs && (this.isOtherSelected ? e = this.otherText : this.isNoneSelected ? e = this.noneText : this.selectedItem && (e = this.selectedItemText)), this.readOnlyText = e }, t.prototype.locStrsChanged = function () { e.prototype.locStrsChanged.call(this), this.updateReadOnlyText() }, Object.defineProperty(t.prototype, "showOptionsCaption", { get: function () { return this.allowClear }, set: function (e) { this.allowClear = e }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "optionsCaption", { get: function () { return this.placeholder }, set: function (e) { this.placeholder = e }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "placeholder", { get: function () { return this.getLocalizableStringText("placeholder") }, set: function (e) { this.setLocalizableStringText("placeholder", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "locPlaceholder", { get: function () { return this.getLocalizableString("placeholder") }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "clearCaption", { get: function () { return this.getLocalizableStringText("clearCaption") }, set: function (e) { this.setLocalizableStringText("clearCaption", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "locClearCaption", { get: function () { return this.getLocalizableString("clearCaption") }, enumerable: !1, configurable: !0 }), t.prototype.getType = function () { return "dropdown" }, Object.defineProperty(t.prototype, "ariaRole", { get: function () { return "combobox" }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "selectedItem", { get: function () { var e = this.selectedItemValues; if (this.isEmpty()) return null; var t = qe.getItemByValue(this.visibleChoices, this.value); return t ? this.lastSelectedItemValue = t : e || this.updateSelectedItemValues(), this.lastSelectedItemValue || e || new qe(this.value) }, enumerable: !1, configurable: !0 }), t.prototype.supportGoNextPageAutomatic = function () { return !0 }, t.prototype.getChoices = function () { var t = e.prototype.getChoices.call(this); if (this.choicesMax <= this.choicesMin) return t; for (var n = [], o = 0; o < t.length; o++)n.push(t[o]); if (0 === this.minMaxChoices.length || this.minMaxChoices.length !== (this.choicesMax - this.choicesMin) / this.choicesStep + 1) { this.minMaxChoices = []; for (o = this.choicesMin; o <= this.choicesMax; o += this.choicesStep)this.minMaxChoices.push(new qe(o)) } return n = n.concat(this.minMaxChoices) }, Object.defineProperty(t.prototype, "choicesMin", { get: function () { return this.getPropertyValue("choicesMin") }, set: function (e) { this.setPropertyValue("choicesMin", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "choicesMax", { get: function () { return this.getPropertyValue("choicesMax") }, set: function (e) { this.setPropertyValue("choicesMax", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "choicesStep", { get: function () { return this.getPropertyValue("choicesStep") }, set: function (e) { e < 1 && (e = 1), this.setPropertyValue("choicesStep", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "autocomplete", { get: function () { return this.getPropertyValue("autocomplete", "") }, set: function (e) { this.setPropertyValue("autocomplete", e) }, enumerable: !1, configurable: !0 }), t.prototype.getControlClass = function () { return (new at).append(this.cssClasses.control).append(this.cssClasses.controlEmpty, this.isEmpty()).append(this.cssClasses.onError, this.errors.length > 0).append(this.cssClasses.controlDisabled, this.isReadOnly).append(this.cssClasses.controlInputFieldComponent, !!this.inputFieldComponentName).toString() }, Object.defineProperty(t.prototype, "selectedItemLocText", { get: function () { var e = this.selectedItem; return null == e ? void 0 : e.locText }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "inputFieldComponentName", { get: function () { return this.inputFieldComponent || this.itemComponent }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "showSelectedItemLocText", { get: function () { return !this.inputHasValue && !this.inputFieldComponentName && !!this.selectedItemLocText }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "showInputFieldComponent", { get: function () { return !this.inputHasValue && !!this.inputFieldComponentName && !this.isEmpty() }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "selectedItemText", { get: function () { var e = this.selectedItem; return e ? e.text : "" }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "popupModel", { get: function () { var e; return "select" === this.renderAs || this.dropdownListModel || (this.dropdownListModel = new Vo(this)), null === (e = this.dropdownListModel) || void 0 === e ? void 0 : e.popupModel }, enumerable: !1, configurable: !0 }), t.prototype.onOpenedCallBack = function () { this.onOpened.fire(this, { question: this, choices: this.choices }) }, t.prototype.onVisibleChoicesChanged = function () { e.prototype.onVisibleChoicesChanged.call(this), this.popupModel && this.dropdownListModel.updateItems() }, t.prototype.getFirstInputElementId = function () { return this.inputId + (this.searchEnabled ? "_0" : "") }, t.prototype.getInputId = function () { return this.inputId + "_0" }, t.prototype.clearValue = function () { e.prototype.clearValue.call(this), this.lastSelectedItemValue = null }, t.prototype.onClick = function (e) { this.onOpenedCallBack && this.onOpenedCallBack() }, t.prototype.onKeyUp = function (e) { 46 === (e.which || e.keyCode) && (this.clearValue(), e.preventDefault(), e.stopPropagation()) }, Oo([f({ defaultValue: !0 })], t.prototype, "allowClear", void 0), Oo([f({ defaultValue: !0, onSet: function (e, t) { t.dropdownListModel && t.dropdownListModel.setSearchEnabled(e) } })], t.prototype, "searchEnabled", void 0), Oo([f({ defaultValue: !1 })], t.prototype, "inputHasValue", void 0), Oo([f({ defaultValue: "" })], t.prototype, "readOnlyText", void 0), Oo([f({ defaultValue: !1 })], t.prototype, "choicesLazyLoadEnabled", void 0), Oo([f({ defaultValue: 25 })], t.prototype, "choicesLazyLoadPageSize", void 0), t }(bo); _.addClass("dropdown", [{ name: "placeholder", alternativeName: "optionsCaption", serializationProperty: "locPlaceholder" }, { name: "allowClear:boolean", alternativeName: "showOptionsCaption", default: !0 }, { name: "choicesMin:number", default: 0 }, { name: "choicesMax:number", default: 0 }, { name: "choicesStep:number", default: 1, minValue: 1 }, { name: "autocomplete", alternativeName: "autoComplete", choices: o.questions.dataList }, { name: "renderAs", default: "default", visible: !1 }, { name: "searchEnabled:boolean", default: !0, visible: !1 }, { name: "choicesLazyLoadEnabled:boolean", default: !1, visible: !1 }, { name: "choicesLazyLoadPageSize:number", default: 25, visible: !1 }, { name: "inputFieldComponent", visible: !1 }, { name: "itemComponent", visible: !1, default: "" }], (function () { return new To("") }), "selectbase"), rn.Instance.registerQuestion("dropdown", (function (e) { var t = new To(e); return t.choices = rn.DefaultChoices, t })); var So = function () { var e = function (t, n) { return (e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (e, t) { e.__proto__ = t } || function (e, t) { for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]) })(t, n) }; return function (t, n) { if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null"); function o() { this.constructor = t } e(t, n), t.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o) } }(), _o = function (e) { function t(t, n, o, r) { var i = e.call(this) || this; return i.fullName = n, i.item = t, i.data = o, i.value = r, i.cellClick = function (e) { i.value = e.value }, i.registerPropertyChangedHandlers(["value"], (function () { i.data && i.data.onMatrixRowChanged(i) })), i } return So(t, e), Object.defineProperty(t.prototype, "name", { get: function () { return this.item.value }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "text", { get: function () { return this.item.text }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "locText", { get: function () { return this.item.locText }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "value", { get: function () { return this.getPropertyValue("value") }, set: function (e) { e = this.data.getCorrectedRowValue(e), this.setPropertyValue("value", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "rowClasses", { get: function () { var e = this.data.cssClasses, t = !!this.data.getErrorByType("requiredinallrowserror"); return (new at).append(e.row).append(e.rowError, t && this.isValueEmpty(this.value)).toString() }, enumerable: !1, configurable: !0 }), t }(ce), Io = function () { function e(e) { this.cellsOwner = e, this.values = {} } return Object.defineProperty(e.prototype, "isEmpty", { get: function () { return 0 == Object.keys(this.values).length }, enumerable: !1, configurable: !0 }), e.prototype.valuesChanged = function () { this.onValuesChanged && this.onValuesChanged() }, e.prototype.setCellText = function (e, t, n) { if (e = this.getCellRowColumnValue(e, this.rows), t = this.getCellRowColumnValue(t, this.columns), e && t) { if (n) this.values[e] || (this.values[e] = {}), this.values[e][t] || (this.values[e][t] = this.createString()), this.values[e][t].text = n; else if (this.values[e] && this.values[e][t]) { var o = this.values[e][t]; o.text = "", o.isEmpty && (delete this.values[e][t], 0 == Object.keys(this.values[e]).length && delete this.values[e]) } this.valuesChanged() } }, e.prototype.setDefaultCellText = function (e, t) { this.setCellText(o.matrixDefaultRowName, e, t) }, e.prototype.getCellLocText = function (e, t) { return e = this.getCellRowColumnValue(e, this.rows), t = this.getCellRowColumnValue(t, this.columns), e && t && this.values[e] && this.values[e][t] ? this.values[e][t] : null }, e.prototype.getDefaultCellLocText = function (e, t) { return this.getCellLocText(o.matrixDefaultRowName, e) }, e.prototype.getCellDisplayLocText = function (e, t) { var n = this.getCellLocText(e, t); return n && !n.isEmpty || (n = this.getCellLocText(o.matrixDefaultRowName, t)) && !n.isEmpty ? n : ("number" == typeof t && (t = t >= 0 && t < this.columns.length ? this.columns[t] : null), t && t.locText ? t.locText : null) }, e.prototype.getCellText = function (e, t) { var n = this.getCellLocText(e, t); return n ? n.calculatedText : null }, e.prototype.getDefaultCellText = function (e) { var t = this.getCellLocText(o.matrixDefaultRowName, e); return t ? t.calculatedText : null }, e.prototype.getCellDisplayText = function (e, t) { var n = this.getCellDisplayLocText(e, t); return n ? n.calculatedText : null }, Object.defineProperty(e.prototype, "rows", { get: function () { return this.cellsOwner ? this.cellsOwner.getRows() : [] }, enumerable: !1, configurable: !0 }), Object.defineProperty(e.prototype, "columns", { get: function () { return this.cellsOwner ? this.cellsOwner.getColumns() : [] }, enumerable: !1, configurable: !0 }), e.prototype.getCellRowColumnValue = function (e, t) { if (null == e) return null; if ("number" == typeof e) { if (e < 0 || e >= t.length) return null; e = t[e].value } return e.value ? e.value : e }, e.prototype.getJson = function () { if (this.isEmpty) return null; var e = {}; for (var t in this.values) { var n = {}, o = this.values[t]; for (var r in o) n[r] = o[r].getJson(); e[t] = n } return e }, e.prototype.setJson = function (e) { if (this.values = {}, e) for (var t in e) if ("pos" != t) { var n = e[t]; for (var o in this.values[t] = {}, n) if ("pos" != o) { var r = this.createString(); r.setJson(n[o]), this.values[t][o] = r } } this.valuesChanged() }, e.prototype.locStrsChanged = function () { if (!this.isEmpty) for (var e in this.values) { var t = this.values[e]; for (var n in t) t[n].strChanged() } }, e.prototype.createString = function () { return new u(this.cellsOwner, !0) }, e }(), Ro = function (e) { function t(t) { var n = e.call(this, t) || this; return n.isRowChanging = !1, n.emptyLocalizableString = new u(n), n.cellsValue = new Io(n), n.cellsValue.onValuesChanged = function () { n.updateHasCellText(), n.propertyValueChanged("cells", n.cells, n.cells) }, n.registerPropertyChangedHandlers(["columns"], (function () { n.onColumnsChanged() })), n.registerPropertyChangedHandlers(["rows"], (function () { n.filterItems() || n.onRowsChanged() })), n.registerPropertyChangedHandlers(["hideIfRowsEmpty"], (function () { n.updateVisibilityBasedOnRows() })), n } return So(t, e), t.prototype.getType = function () { return "matrix" }, Object.defineProperty(t.prototype, "hasSingleInput", { get: function () { return !1 }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "isAllRowRequired", { get: function () { return this.getPropertyValue("isAllRowRequired", !1) }, set: function (e) { this.setPropertyValue("isAllRowRequired", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "hasRows", { get: function () { return this.rows.length > 0 }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "rowsOrder", { get: function () { return this.getPropertyValue("rowsOrder") }, set: function (e) { (e = e.toLowerCase()) != this.rowsOrder && (this.setPropertyValue("rowsOrder", e), this.onRowsChanged()) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "hideIfRowsEmpty", { get: function () { return this.getPropertyValue("hideIfRowsEmpty") }, set: function (e) { this.setPropertyValue("hideIfRowsEmpty", e) }, enumerable: !1, configurable: !0 }), t.prototype.getRows = function () { return this.rows }, t.prototype.getColumns = function () { return this.visibleColumns }, t.prototype.addColumn = function (e, t) { var n = new qe(e, t); return this.columns.push(n), n }, t.prototype.getItemClass = function (e, t) { var n = e.value == t.value, o = this.isReadOnly, r = !n && !o; return (new at).append(this.cssClasses.cell, this.hasCellText).append(this.hasCellText ? this.cssClasses.cellText : this.cssClasses.label).append(this.cssClasses.itemOnError, !this.hasCellText && this.errors.length > 0).append(this.hasCellText ? this.cssClasses.cellTextSelected : this.cssClasses.itemChecked, n).append(this.hasCellText ? this.cssClasses.cellTextDisabled : this.cssClasses.itemDisabled, o).append(this.cssClasses.itemHover, r && !this.hasCellText).toString() }, Object.defineProperty(t.prototype, "itemSvgIcon", { get: function () { return this.cssClasses.itemSvgIconId }, enumerable: !1, configurable: !0 }), t.prototype.locStrsChanged = function () { e.prototype.locStrsChanged.call(this), this.cells.locStrsChanged() }, t.prototype.getQuizQuestionCount = function () { for (var e = 0, t = 0; t < this.rows.length; t++)this.isValueEmpty(this.correctAnswer[this.rows[t].value]) || e++; return e }, t.prototype.getCorrectAnswerCount = function () { for (var e = 0, t = this.value, n = 0; n < this.rows.length; n++) { var o = this.rows[n].value; !this.isValueEmpty(t[o]) && this.isTwoValueEquals(this.correctAnswer[o], t[o]) && e++ } return e }, t.prototype.getVisibleRows = function () { var e = new Array, t = this.value; t || (t = {}); for (var n = this.filteredRows ? this.filteredRows : this.rows, o = 0; o < n.length; o++) { var r = n[o]; this.isValueEmpty(r.value) || e.push(this.createMatrixRow(r, this.id + "_" + r.value.toString().replace(/\s/g, "_"), t[r.value])) } return this.generatedVisibleRows = e, e }, t.prototype.sortVisibleRows = function (e) { return this.survey && this.survey.isDesignMode ? e : "random" === this.rowsOrder.toLowerCase() ? r.randomizeArray(e) : e }, t.prototype.endLoadingFromJson = function () { e.prototype.endLoadingFromJson.call(this), this.rows = this.sortVisibleRows(this.rows) }, t.prototype.processRowsOnSet = function (e) { return this.sortVisibleRows(e) }, Object.defineProperty(t.prototype, "visibleRows", { get: function () { return this.getVisibleRows() }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "cells", { get: function () { return this.cellsValue }, set: function (e) { this.cells.setJson(e && e.getJson ? e.getJson() : null) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "hasCellText", { get: function () { return this.getPropertyValue("hasCellText", !1) }, enumerable: !1, configurable: !0 }), t.prototype.updateHasCellText = function () { this.setPropertyValue("hasCellText", !this.cells.isEmpty) }, t.prototype.setCellText = function (e, t, n) { this.cells.setCellText(e, t, n) }, t.prototype.getCellText = function (e, t) { return this.cells.getCellText(e, t) }, t.prototype.setDefaultCellText = function (e, t) { this.cells.setDefaultCellText(e, t) }, t.prototype.getDefaultCellText = function (e) { return this.cells.getDefaultCellText(e) }, t.prototype.getCellDisplayText = function (e, t) { return this.cells.getCellDisplayText(e, t) }, t.prototype.getCellDisplayLocText = function (e, t) { var n = this.cells.getCellDisplayLocText(e, t); return n || this.emptyLocalizableString }, t.prototype.supportGoNextPageAutomatic = function () { return this.hasValuesInAllRows() }, t.prototype.onCheckForErrors = function (t, n) { e.prototype.onCheckForErrors.call(this, t, n), (!n || this.errors.length > 0) && this.hasErrorInRows() && t.push(new xe(null, this)) }, t.prototype.hasErrorInRows = function () { return !!this.isAllRowRequired && !this.hasValuesInAllRows() }, t.prototype.hasValuesInAllRows = function () { var e = this.generatedVisibleRows; if (e || (e = this.visibleRows), !e) return !0; for (var t = 0; t < e.length; t++)if (this.isValueEmpty(e[t].value)) return !1; return !0 }, t.prototype.getIsAnswered = function () { return e.prototype.getIsAnswered.call(this) && this.hasValuesInAllRows() }, t.prototype.createMatrixRow = function (e, t, n) { var o = new _o(e, t, this, n); return this.onMatrixRowCreated(o), o }, t.prototype.onMatrixRowCreated = function (e) { }, t.prototype.setQuestionValue = function (t, n) { if (void 0 === n && (n = !0), e.prototype.setQuestionValue.call(this, t, this.isRowChanging || n), this.generatedVisibleRows && 0 != this.generatedVisibleRows.length) { this.isRowChanging = !0; var o = this.value; if (o || (o = {}), 0 == this.rows.length) this.generatedVisibleRows[0].value = o; else for (var r = 0; r < this.generatedVisibleRows.length; r++) { var i = o[this.generatedVisibleRows[r].name]; this.isValueEmpty(i) && (i = null), this.generatedVisibleRows[r].value = i } this.updateIsAnswered(), this.isRowChanging = !1 } }, t.prototype.getDisplayValueCore = function (e, t) { var n = {}; for (var o in t) { var r = e ? qe.getTextOrHtmlByValue(this.rows, o) : o; r || (r = o); var i = qe.getTextOrHtmlByValue(this.columns, t[o]); i || (i = t[o]), n[r] = i } return n }, t.prototype.getPlainData = function (t) { var n = this; void 0 === t && (t = { includeEmpty: !0 }); var o = e.prototype.getPlainData.call(this, t); if (o) { var r = this.createValueCopy(); o.isNode = !0, o.data = Object.keys(r || {}).map((function (e) { var o = n.rows.filter((function (t) { return t.value === e }))[0], i = { name: e, title: o ? o.text : "row", value: r[e], displayValue: qe.getTextOrHtmlByValue(n.visibleColumns, r[e]), getString: function (e) { return "object" == typeof e ? JSON.stringify(e) : e }, isNode: !1 }, s = qe.getItemByValue(n.visibleColumns, r[e]); return s && (t.calculations || []).forEach((function (e) { i[e.propertyName] = s[e.propertyName] })), i })) } return o }, t.prototype.addConditionObjectsByContext = function (e, t) { for (var n = 0; n < this.rows.length; n++) { var o = this.rows[n]; o.value && e.push({ name: this.getValueName() + "." + o.value, text: this.processedTitle + "." + o.calculatedText, question: this }) } }, t.prototype.getConditionJson = function (t, n) { if (void 0 === t && (t = null), void 0 === n && (n = null), !n) return e.prototype.getConditionJson.call(this); var o = new To(n); o.choices = this.columns; var r = (new S).toJsonObject(o); return r.type = o.getType(), r }, t.prototype.clearValueIfInvisibleCore = function () { e.prototype.clearValueIfInvisibleCore.call(this), this.hasRows && this.clearInvisibleValuesInRows() }, t.prototype.getFirstInputElementId = function () { var t = this.generatedVisibleRows; return t || (t = this.visibleRows), t.length > 0 && this.visibleColumns.length > 0 ? this.inputId + "_" + t[0].name + "_0" : e.prototype.getFirstInputElementId.call(this) }, t.prototype.onMatrixRowChanged = function (e) { if (!this.isRowChanging) { if (this.isRowChanging = !0, this.hasRows) { var t = this.value; t || (t = {}), t[e.name] = e.value, this.setNewValue(t) } else this.setNewValue(e.value); this.isRowChanging = !1 } }, t.prototype.getCorrectedRowValue = function (e) { for (var t = 0; t < this.columns.length; t++)if (e === this.columns[t].value) return e; for (t = 0; t < this.columns.length; t++)if (this.isTwoValueEquals(e, this.columns[t].value)) return this.columns[t].value; return e }, t.prototype.getSearchableItemValueKeys = function (e) { e.push("columns"), e.push("rows") }, Object.defineProperty(t.prototype, "SurveyModel", { get: function () { return this.survey }, enumerable: !1, configurable: !0 }), t.prototype.getColumnHeaderWrapperComponentName = function (e) { return this.SurveyModel.getElementWrapperComponentName({ column: e }, "column-header") }, t.prototype.getColumnHeaderWrapperComponentData = function (e) { return this.SurveyModel.getElementWrapperComponentData({ column: e }, "column-header") }, t.prototype.getRowHeaderWrapperComponentName = function (e) { return this.SurveyModel.getElementWrapperComponentName({ row: e }, "row-header") }, t.prototype.getRowHeaderWrapperComponentData = function (e) { return this.SurveyModel.getElementWrapperComponentData({ row: e }, "row-header") }, t }(Zt); _.addClass("matrix", ["rowTitleWidth", { name: "columns:itemvalue[]", uniqueProperty: "value", baseValue: function () { return s.getString("matrix_column") } }, { name: "rows:itemvalue[]", uniqueProperty: "value", baseValue: function () { return s.getString("matrix_row") } }, { name: "cells:cells", serializationProperty: "cells" }, { name: "rowsOrder", default: "initial", choices: ["initial", "random"] }, "isAllRowRequired:boolean", "hideIfRowsEmpty:boolean"], (function () { return new Ro("") }), "matrixbase"), rn.Instance.registerQuestion("matrix", (function (e) { var t = new Ro(e); return t.rows = rn.DefaultRows, t.columns = rn.DefaultColums, t })); var Eo = function () { var e = function (t, n) { return (e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (e, t) { e.__proto__ = t } || function (e, t) { for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]) })(t, n) }; return function (t, n) { if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null"); function o() { this.constructor = t } e(t, n), t.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o) } }(), Do = function (e, t, n, o) { var r, i = arguments.length, s = i < 3 ? t : null === o ? o = Object.getOwnPropertyDescriptor(t, n) : o; if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) s = Reflect.decorate(e, t, n, o); else for (var a = e.length - 1; a >= 0; a--)(r = e[a]) && (s = (i < 3 ? r(s) : i > 3 ? r(t, n, s) : r(t, n)) || s); return i > 3 && s && Object.defineProperty(t, n, s), s }, Ao = function (e) { function t() { return null !== e && e.apply(this, arguments) || this } return Eo(t, e), t.prototype.updateRemainingCharacterCounter = function (e, t) { this.remainingCharacterCounter = r.getRemainingCharacterCounterText(e, t) }, Do([f()], t.prototype, "remainingCharacterCounter", void 0), t }(ce), Lo = function (e) { function t(t) { var n = e.call(this, t) || this; return n.characterCounter = new Ao, n } return Eo(t, e), t.prototype.isTextValue = function () { return !0 }, Object.defineProperty(t.prototype, "maxLength", { get: function () { return this.getPropertyValue("maxLength") }, set: function (e) { this.setPropertyValue("maxLength", e), this.updateRemainingCharacterCounter(this.value) }, enumerable: !1, configurable: !0 }), t.prototype.getMaxLength = function () { return r.getMaxLength(this.maxLength, this.survey ? this.survey.maxTextLength : -1) }, t.prototype.updateRemainingCharacterCounter = function (e) { this.characterCounter.updateRemainingCharacterCounter(e, this.getMaxLength()) }, Object.defineProperty(t.prototype, "placeHolder", { get: function () { return this.placeholder }, set: function (e) { this.placeholder = e }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "locPlaceHolder", { get: function () { return this.locPlaceholder }, enumerable: !1, configurable: !0 }), t.prototype.getType = function () { return "textbase" }, t.prototype.isEmpty = function () { return e.prototype.isEmpty.call(this) || "" === this.value }, Object.defineProperty(t.prototype, "textUpdateMode", { get: function () { return this.getPropertyValue("textUpdateMode") }, set: function (e) { this.setPropertyValue("textUpdateMode", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "isSurveyInputTextUpdate", { get: function () { return "default" == this.textUpdateMode ? !!this.survey && this.survey.isUpdateValueTextOnTyping : "onTyping" == this.textUpdateMode }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "renderedPlaceholder", { get: function () { return this.getPropertyValue("renderedPlaceholder") }, enumerable: !1, configurable: !0 }), t.prototype.setRenderedPlaceholder = function (e) { this.setPropertyValue("renderedPlaceholder", e) }, t.prototype.onReadOnlyChanged = function () { e.prototype.onReadOnlyChanged.call(this), this.calcRenderedPlaceholder() }, t.prototype.onSurveyLoad = function () { this.calcRenderedPlaceholder(), e.prototype.onSurveyLoad.call(this) }, t.prototype.localeChanged = function () { e.prototype.localeChanged.call(this), this.calcRenderedPlaceholder() }, t.prototype.calcRenderedPlaceholder = function () { var e = this.placeHolder; e && !this.hasPlaceHolder() && (e = void 0), this.setRenderedPlaceholder(e) }, t.prototype.hasPlaceHolder = function () { return !this.isReadOnly }, t.prototype.setNewValue = function (t) { e.prototype.setNewValue.call(this, t), this.updateRemainingCharacterCounter(t) }, t.prototype.getControlClass = function () { return (new at).append(this.cssClasses.root).append(this.cssClasses.onError, this.errors.length > 0).append(this.cssClasses.controlDisabled, this.isReadOnly).toString() }, Object.defineProperty(t.prototype, "ariaRole", { get: function () { return "textbox" }, enumerable: !1, configurable: !0 }), Do([f({ localizable: !0, onSet: function (e, t) { return t.calcRenderedPlaceholder() } })], t.prototype, "placeholder", void 0), t }($t); _.addClass("textbase", [], (function () { return new Lo("") }), "question"); var jo = function () { var e = function (t, n) { return (e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (e, t) { e.__proto__ = t } || function (e, t) { for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]) })(t, n) }; return function (t, n) { if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null"); function o() { this.constructor = t } e(t, n), t.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o) } }(), No = function (e) { function t(t) { var n = e.call(this, t) || this; return n._isWaitingForEnter = !1, n.onCompositionUpdate = function (e) { n.isInputTextUpdate && setTimeout((function () { n.updateValueOnEvent(e) }), 1), n.updateRemainingCharacterCounter(e.target.value) }, n.onKeyUp = function (e) { n.isInputTextUpdate ? n._isWaitingForEnter && 13 !== e.keyCode || (n.updateValueOnEvent(e), n._isWaitingForEnter = !1) : 13 === e.keyCode && n.updateValueOnEvent(e), n.updateRemainingCharacterCounter(e.target.value) }, n.onKeyDown = function (e) { n.isInputTextUpdate && (n._isWaitingForEnter = 229 === e.keyCode) }, n.onChange = function (e) { e.target === document.activeElement ? n.isInputTextUpdate && n.updateValueOnEvent(e) : n.updateValueOnEvent(e), n.updateRemainingCharacterCounter(e.target.value) }, n.onBlur = function (e) { n.updateValueOnEvent(e), n.updateRemainingCharacterCounter(e.target.value) }, n.createLocalizableString("minErrorText", n, !0, "minError"), n.createLocalizableString("maxErrorText", n, !0, "maxError"), n.locDataListValue = new c(n), n.locDataListValue.onValueChanged = function (e, t) { n.propertyValueChanged("dataList", e, t) }, n.registerPropertyChangedHandlers(["min", "max", "inputType", "minValueExpression", "maxValueExpression"], (function () { n.setRenderedMinMax() })), n.registerPropertyChangedHandlers(["inputType", "size"], (function () { n.updateInputSize(), n.calcRenderedPlaceholder() })), n } return jo(t, e), t.prototype.isTextValue = function () { return ["text", "number", "password"].indexOf(this.inputType) > -1 }, t.prototype.getType = function () { return "text" }, t.prototype.onSurveyLoad = function () { e.prototype.onSurveyLoad.call(this), this.setRenderedMinMax(), this.updateInputSize() }, Object.defineProperty(t.prototype, "inputType", { get: function () { return this.getPropertyValue("inputType") }, set: function (e) { "datetime_local" == (e = e.toLowerCase()) && (e = "datetime-local"), this.setPropertyValue("inputType", e.toLowerCase()), this.isLoadingFromJson || (this.min = void 0, this.max = void 0, this.step = void 0) }, enumerable: !1, configurable: !0 }), t.prototype.runCondition = function (t, n) { e.prototype.runCondition.call(this, t, n), (this.minValueExpression || this.maxValueExpression) && this.setRenderedMinMax(t, n) }, t.prototype.getValidators = function () { var t = e.prototype.getValidators.call(this); return "email" !== this.inputType || this.validators.some((function (e) { return "emailvalidator" === e.getType() })) || t.push(new Ne), t }, t.prototype.isLayoutTypeSupported = function (e) { return !0 }, Object.defineProperty(t.prototype, "size", { get: function () { return this.getPropertyValue("size") }, set: function (e) { this.setPropertyValue("size", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "isTextInput", { get: function () { return ["text", "search", "tel", "url", "email", "password"].indexOf(this.inputType) > -1 }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "inputSize", { get: function () { return this.getPropertyValue("inputSize", 0) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "renderedInputSize", { get: function () { return this.getPropertyValue("inputSize") || null }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "inputWidth", { get: function () { return this.getPropertyValue("inputWidth") }, enumerable: !1, configurable: !0 }), t.prototype.updateInputSize = function () { var e = this.isTextInput && this.size > 0 ? this.size : 0; this.isTextInput && e < 1 && this.parent && this.parent.itemSize && (e = this.parent.itemSize), this.setPropertyValue("inputSize", e), this.setPropertyValue("inputWidth", e > 0 ? "auto" : "") }, Object.defineProperty(t.prototype, "autocomplete", { get: function () { return this.getPropertyValue("autocomplete", "") }, set: function (e) { this.setPropertyValue("autocomplete", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "min", { get: function () { return this.getPropertyValue("min") }, set: function (e) { this.isValueExpression(e) ? this.minValueExpression = e.substring(1) : this.setPropertyValue("min", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "max", { get: function () { return this.getPropertyValue("max") }, set: function (e) { this.isValueExpression(e) ? this.maxValueExpression = e.substring(1) : this.setPropertyValue("max", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "minValueExpression", { get: function () { return this.getPropertyValue("minValueExpression", "") }, set: function (e) { this.setPropertyValue("minValueExpression", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "maxValueExpression", { get: function () { return this.getPropertyValue("maxValueExpression", "") }, set: function (e) { this.setPropertyValue("maxValueExpression", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "renderedMin", { get: function () { return this.getPropertyValue("renderedMin") }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "renderedMax", { get: function () { return this.getPropertyValue("renderedMax") }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "minErrorText", { get: function () { return this.getLocalizableStringText("minErrorText") }, set: function (e) { this.setLocalizableStringText("minErrorText", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "locMinErrorText", { get: function () { return this.getLocalizableString("minErrorText") }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "maxErrorText", { get: function () { return this.getLocalizableStringText("maxErrorText") }, set: function (e) { this.setLocalizableStringText("maxErrorText", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "locMaxErrorText", { get: function () { return this.getLocalizableString("maxErrorText") }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "isMinMaxType", { get: function () { return Fo(this) }, enumerable: !1, configurable: !0 }), t.prototype.onCheckForErrors = function (t, n) { var o = this; if (e.prototype.onCheckForErrors.call(this, t, n), !n) { if (this.isValueLessMin) { var r = new Se(this.getMinMaxErrorText(this.minErrorText, this.getCalculatedMinMax(this.renderedMin)), this); r.onUpdateErrorTextCallback = function (e) { e.text = o.getMinMaxErrorText(o.minErrorText, o.getCalculatedMinMax(o.renderedMin)) }, t.push(r) } if (this.isValueGreaterMax) { var i = new Se(this.getMinMaxErrorText(this.maxErrorText, this.getCalculatedMinMax(this.renderedMax)), this); i.onUpdateErrorTextCallback = function (e) { e.text = o.getMinMaxErrorText(o.maxErrorText, o.getCalculatedMinMax(o.renderedMax)) }, t.push(i) } } }, t.prototype.canSetValueToSurvey = function () { if (!this.isMinMaxType) return !0; var e = !this.isValueLessMin && !this.isValueGreaterMax; return "number" === this.inputType && this.survey && (this.survey.isValidateOnValueChanging || this.survey.isValidateOnValueChanged) && this.hasErrors(), e }, t.prototype.convertFuncValuetoQuestionValue = function (e) { var t = this.inputType.replace("-local", ""); return r.convertValToQuestionVal(e, t) }, t.prototype.getMinMaxErrorText = function (e, t) { if (r.isValueEmpty(t)) return e; var n = t.toString(); return "date" === this.inputType && t.toDateString && (n = t.toDateString()), e.replace("{0}", n) }, Object.defineProperty(t.prototype, "isValueLessMin", { get: function () { return !this.isValueEmpty(this.renderedMin) && this.getCalculatedMinMax(this.value) < this.getCalculatedMinMax(this.renderedMin) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "isValueGreaterMax", { get: function () { return !this.isValueEmpty(this.renderedMax) && this.getCalculatedMinMax(this.value) > this.getCalculatedMinMax(this.renderedMax) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "isDateInputType", { get: function () { return "date" === this.inputType || "datetime-local" === this.inputType }, enumerable: !1, configurable: !0 }), t.prototype.getCalculatedMinMax = function (e) { return this.isValueEmpty(e) ? e : this.isDateInputType ? new Date(e) : e }, t.prototype.setRenderedMinMax = function (e, t) { var n = this; void 0 === e && (e = null), void 0 === t && (t = null), this.minValueRunner = this.getDefaultRunner(this.minValueRunner, this.minValueExpression), this.setValueAndRunExpression(this.minValueRunner, this.min, (function (e) { !e && n.isDateInputType && o.minDate && (e = o.minDate), n.setPropertyValue("renderedMin", e) }), e, t), this.maxValueRunner = this.getDefaultRunner(this.maxValueRunner, this.maxValueExpression), this.setValueAndRunExpression(this.maxValueRunner, this.max, (function (e) { !e && n.isDateInputType && (e = o.maxDate ? o.maxDate : "2999-12-31"), n.setPropertyValue("renderedMax", e) }), e, t) }, Object.defineProperty(t.prototype, "step", { get: function () { return this.getPropertyValue("step") }, set: function (e) { this.setPropertyValue("step", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "renderedStep", { get: function () { return this.isValueEmpty(this.step) ? "number" !== this.inputType ? void 0 : "any" : this.step }, enumerable: !1, configurable: !0 }), t.prototype.supportGoNextPageAutomatic = function () { return ["date", "datetime", "datetime-local"].indexOf(this.inputType) < 0 }, t.prototype.supportGoNextPageError = function () { return ["date", "datetime", "datetime-local"].indexOf(this.inputType) < 0 }, Object.defineProperty(t.prototype, "dataList", { get: function () { return this.locDataList.value }, set: function (e) { this.locDataList.value = e }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "locDataList", { get: function () { return this.locDataListValue }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "dataListId", { get: function () { return this.locDataList.hasValue() ? this.id + "_datalist" : void 0 }, enumerable: !1, configurable: !0 }), t.prototype.canRunValidators = function (e) { return this.errors.length > 0 || !e || this.supportGoNextPageError() }, t.prototype.setNewValue = function (t) { t = this.correctValueType(t), e.prototype.setNewValue.call(this, t) }, t.prototype.correctValueType = function (e) { return e && ("number" == this.inputType || "range" == this.inputType) ? r.isNumber(e) ? r.getNumber(e) : "" : e }, t.prototype.hasPlaceHolder = function () { return !this.isReadOnly && "range" !== this.inputType }, t.prototype.isReadOnlyRenderDiv = function () { return this.isReadOnly && "div" === o.readOnlyTextRenderMode }, Object.defineProperty(t.prototype, "inputStyle", { get: function () { var e = {}; return e.width = this.inputWidth, e }, enumerable: !1, configurable: !0 }), t.prototype.updateValueOnEvent = function (e) { var t = e.target.value; r.isTwoValueEquals(this.value, t) || (this.value = t) }, t }(Lo), Mo = ["number", "range", "date", "datetime", "datetime-local", "month", "time", "week"]; function Fo(e) { var t = e ? e.inputType : ""; return !!t && Mo.indexOf(t) > -1 } function qo(e, t) { var n = e.split(t); return 2 !== n.length ? -1 : r.isNumber(n[0]) && r.isNumber(n[1]) ? 60 * parseFloat(n[0]) + parseFloat(n[1]) : -1 } function ko(e, t, n, o) { var i = o ? n : t; if (!Fo(e)) return i; if (r.isValueEmpty(t) || r.isValueEmpty(n)) return i; if (0 === e.inputType.indexOf("date") || "month" === e.inputType) { var s = "month" === e.inputType, a = new Date(s ? t + "-1" : t), l = new Date(s ? n + "-1" : n); if (!a || !l) return i; if (a > l) return o ? t : n } if ("week" === e.inputType || "time" === e.inputType) return function (e, t, n) { var o = qo(e, n), r = qo(t, n); return !(o < 0 || r < 0) && o > r }(t, n, "week" === e.inputType ? "-W" : ":") ? o ? t : n : i; if ("number" === e.inputType) { if (!r.isNumber(t) || !r.isNumber(n)) return i; if (r.getNumber(t) > r.getNumber(n)) return o ? t : n } return "string" == typeof t || "string" == typeof n ? i : t > n ? o ? t : n : i } _.addClass("text", [{ name: "inputType", default: "text", choices: o.questions.inputTypes }, { name: "size:number", minValue: 0, dependsOn: "inputType", visibleIf: function (e) { return !!e && e.isTextInput } }, { name: "textUpdateMode", default: "default", choices: ["default", "onBlur", "onTyping"], dependsOn: "inputType", visibleIf: function (e) { return !!e && e.isTextInput } }, { name: "autocomplete", alternativeName: "autoComplete", choices: o.questions.dataList }, { name: "min", dependsOn: "inputType", visibleIf: function (e) { return Fo(e) }, onPropertyEditorUpdate: function (e, t) { e && e.inputType && (t.inputType = "range" !== e.inputType ? e.inputType : "number") }, onSettingValue: function (e, t) { return ko(e, t, e.max, !1) } }, { name: "max", dependsOn: "inputType", nextToProperty: "*min", visibleIf: function (e) { return Fo(e) }, onSettingValue: function (e, t) { return ko(e, e.min, t, !0) }, onPropertyEditorUpdate: function (e, t) { e && e.inputType && (t.inputType = "range" !== e.inputType ? e.inputType : "number") } }, { name: "minValueExpression:expression", category: "logic", dependsOn: "inputType", visibleIf: function (e) { return Fo(e) } }, { name: "maxValueExpression:expression", category: "logic", dependsOn: "inputType", visibleIf: function (e) { return Fo(e) } }, { name: "minErrorText", serializationProperty: "locMinErrorText", dependsOn: "inputType", visibleIf: function (e) { return Fo(e) } }, { name: "maxErrorText", serializationProperty: "locMaxErrorText", dependsOn: "inputType", visibleIf: function (e) { return Fo(e) } }, { name: "step:number", dependsOn: "inputType", visibleIf: function (e) { return !!e && ("number" === e.inputType || "range" === e.inputType) } }, { name: "maxLength:number", default: -1, dependsOn: "inputType", visibleIf: function (e) { return !!e && e.isTextInput } }, { name: "placeholder", alternativeName: "placeHolder", serializationProperty: "locPlaceholder", dependsOn: "inputType", visibleIf: function (e) { return !!e && e.isTextInput } }, { name: "dataList:string[]", serializationProperty: "locDataList", dependsOn: "inputType", visibleIf: function (e) { return !!e && "text" === e.inputType } }], (function () { return new No("") }), "textbase"), rn.Instance.registerQuestion("text", (function (e) { return new No(e) })); var Bo = function () { var e = function (t, n) { return (e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (e, t) { e.__proto__ = t } || function (e, t) { for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]) })(t, n) }; return function (t, n) { if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null"); function o() { this.constructor = t } e(t, n), t.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o) } }(), Qo = function (e) { function t(t, n) { void 0 === t && (t = null), void 0 === n && (n = null); var o = e.call(this) || this; return o.editorValue = o.createEditor(t), o.editor.questionTitleTemplateCallback = function () { return "" }, o.editor.titleLocation = "left", n && (o.title = n), o } return Bo(t, e), t.prototype.getType = function () { return "multipletextitem" }, Object.defineProperty(t.prototype, "id", { get: function () { return this.editor.id }, enumerable: !1, configurable: !0 }), t.prototype.getOriginalObj = function () { return this.editor }, Object.defineProperty(t.prototype, "name", { get: function () { return this.editor.name }, set: function (e) { this.editor.name = e }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "question", { get: function () { return this.data }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "editor", { get: function () { return this.editorValue }, enumerable: !1, configurable: !0 }), t.prototype.createEditor = function (e) { return new No(e) }, t.prototype.addUsedLocales = function (t) { e.prototype.addUsedLocales.call(this, t), this.editor.addUsedLocales(t) }, t.prototype.localeChanged = function () { e.prototype.localeChanged.call(this), this.editor.localeChanged() }, t.prototype.locStrsChanged = function () { e.prototype.locStrsChanged.call(this), this.editor.locStrsChanged() }, t.prototype.setData = function (e) { this.data = e, e && (this.editor.defaultValue = e.getItemDefaultValue(this.name), this.editor.setSurveyImpl(this), this.editor.parent = e) }, Object.defineProperty(t.prototype, "isRequired", { get: function () { return this.editor.isRequired }, set: function (e) { this.editor.isRequired = e }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "inputType", { get: function () { return this.editor.inputType }, set: function (e) { this.editor.inputType = e }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "title", { get: function () { return this.editor.title }, set: function (e) { this.editor.title = e }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "locTitle", { get: function () { return this.editor.locTitle }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "fullTitle", { get: function () { return this.editor.fullTitle }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "maxLength", { get: function () { return this.editor.maxLength }, set: function (e) { this.editor.maxLength = e }, enumerable: !1, configurable: !0 }), t.prototype.getMaxLength = function () { var e = this.getSurvey(); return r.getMaxLength(this.maxLength, e ? e.maxTextLength : -1) }, Object.defineProperty(t.prototype, "placeholder", { get: function () { return this.editor.placeholder }, set: function (e) { this.editor.placeholder = e }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "locPlaceholder", { get: function () { return this.editor.locPlaceholder }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "placeHolder", { get: function () { return this.placeholder }, set: function (e) { this.placeholder = e }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "locPlaceHolder", { get: function () { return this.locPlaceholder }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "requiredErrorText", { get: function () { return this.editor.requiredErrorText }, set: function (e) { this.editor.requiredErrorText = e }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "locRequiredErrorText", { get: function () { return this.editor.locRequiredErrorText }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "size", { get: function () { return this.editor.size }, set: function (e) { this.editor.size = e }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "validators", { get: function () { return this.editor.validators }, set: function (e) { this.editor.validators = e }, enumerable: !1, configurable: !0 }), t.prototype.getValidators = function () { return this.validators }, Object.defineProperty(t.prototype, "value", { get: function () { return this.data ? this.data.getMultipleTextValue(this.name) : null }, set: function (e) { null != this.data && this.data.setMultipleTextValue(this.name, e) }, enumerable: !1, configurable: !0 }), t.prototype.isEmpty = function () { return this.editor.isEmpty() }, t.prototype.onValueChanged = function (e) { this.valueChangedCallback && this.valueChangedCallback(e) }, t.prototype.getSurveyData = function () { return this }, t.prototype.getSurvey = function () { return this.data ? this.data.getSurvey() : null }, t.prototype.getTextProcessor = function () { return this.data ? this.data.getTextProcessor() : null }, t.prototype.getValue = function (e) { return this.data ? this.data.getMultipleTextValue(e) : null }, t.prototype.setValue = function (e, t) { this.data && this.data.setMultipleTextValue(e, t) }, t.prototype.getVariable = function (e) { }, t.prototype.setVariable = function (e, t) { }, t.prototype.getComment = function (e) { return null }, t.prototype.setComment = function (e, t) { }, t.prototype.getAllValues = function () { return this.data ? this.data.getAllValues() : this.value }, t.prototype.getFilteredValues = function () { return this.getAllValues() }, t.prototype.getFilteredProperties = function () { return { survey: this.getSurvey() } }, t.prototype.findQuestionByName = function (e) { var t = this.getSurvey(); return t ? t.getQuestionByName(e) : null }, t.prototype.getValidatorTitle = function () { return this.title }, Object.defineProperty(t.prototype, "validatedValue", { get: function () { return this.value }, set: function (e) { this.value = e }, enumerable: !1, configurable: !0 }), t.prototype.getDataFilteredValues = function () { return this.getFilteredValues() }, t.prototype.getDataFilteredProperties = function () { return this.getFilteredProperties() }, t }(ce), Ho = function (e) { function t(t) { var n = e.call(this, t) || this; return n.isMultipleItemValueChanging = !1, n.createNewArray("items", (function (e) { e.setData(n), n.survey && n.survey.multipleTextItemAdded(n, e) })), n.registerPropertyChangedHandlers(["items", "colCount"], (function () { n.fireCallback(n.colCountChangedCallback) })), n.registerPropertyChangedHandlers(["itemSize"], (function () { n.updateItemsSize() })), n } return Bo(t, e), t.addDefaultItems = function (e) { for (var t = rn.DefaultMutlipleTextItems, n = 0; n < t.length; n++)e.addItem(t[n]) }, t.prototype.getType = function () { return "multipletext" }, t.prototype.setSurveyImpl = function (t, n) { e.prototype.setSurveyImpl.call(this, t, n); for (var o = 0; o < this.items.length; o++)this.items[o].setData(this) }, Object.defineProperty(t.prototype, "isAllowTitleLeft", { get: function () { return !1 }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "hasSingleInput", { get: function () { return !1 }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "id", { get: function () { return this.getPropertyValue("id") }, set: function (e) { var t; null === (t = this.items) || void 0 === t || t.map((function (t, n) { return t.editor.id = e + "_" + n })), this.setPropertyValue("id", e) }, enumerable: !1, configurable: !0 }), t.prototype.onSurveyLoad = function () { this.editorsOnSurveyLoad(), e.prototype.onSurveyLoad.call(this), this.fireCallback(this.colCountChangedCallback) }, t.prototype.setQuestionValue = function (t, n) { void 0 === n && (n = !0), e.prototype.setQuestionValue.call(this, t, n), this.performForEveryEditor((function (e) { e.editor.updateValueFromSurvey(e.value) })), this.updateIsAnswered() }, t.prototype.onSurveyValueChanged = function (t) { e.prototype.onSurveyValueChanged.call(this, t), this.performForEveryEditor((function (e) { e.editor.onSurveyValueChanged(e.value) })) }, t.prototype.updateItemsSize = function () { this.performForEveryEditor((function (e) { e.editor.updateInputSize() })) }, t.prototype.editorsOnSurveyLoad = function () { this.performForEveryEditor((function (e) { e.editor.onSurveyLoad() })) }, t.prototype.performForEveryEditor = function (e) { for (var t = 0; t < this.items.length; t++) { var n = this.items[t]; n.editor && e(n) } }, Object.defineProperty(t.prototype, "items", { get: function () { return this.getPropertyValue("items") }, set: function (e) { this.setPropertyValue("items", e) }, enumerable: !1, configurable: !0 }), t.prototype.addItem = function (e, t) { void 0 === t && (t = null); var n = this.createTextItem(e, t); return this.items.push(n), n }, t.prototype.getItemByName = function (e) { for (var t = 0; t < this.items.length; t++)if (this.items[t].name == e) return this.items[t]; return null }, t.prototype.addConditionObjectsByContext = function (e, t) { for (var n = 0; n < this.items.length; n++) { var o = this.items[n]; e.push({ name: this.getValueName() + "." + o.name, text: this.processedTitle + "." + o.fullTitle, question: this }) } }, t.prototype.getConditionJson = function (t, n) { if (void 0 === t && (t = null), void 0 === n && (n = null), !n) return e.prototype.getConditionJson.call(this); var o = this.getItemByName(n); if (!o) return null; var r = (new S).toJsonObject(o); return r.type = "text", r }, t.prototype.locStrsChanged = function () { e.prototype.locStrsChanged.call(this); for (var t = 0; t < this.items.length; t++)this.items[t].locStrsChanged() }, t.prototype.localeChanged = function () { e.prototype.localeChanged.call(this); for (var t = 0; t < this.items.length; t++)this.items[t].localeChanged() }, t.prototype.supportGoNextPageAutomatic = function () { for (var e = 0; e < this.items.length; e++)if (this.items[e].isEmpty()) return !1; return !0 }, Object.defineProperty(t.prototype, "colCount", { get: function () { return this.getPropertyValue("colCount") }, set: function (e) { e < 1 || e > 5 || this.setPropertyValue("colCount", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "itemSize", { get: function () { return this.getPropertyValue("itemSize") }, set: function (e) { this.setPropertyValue("itemSize", e) }, enumerable: !1, configurable: !0 }), t.prototype.getRows = function () { for (var e = this.colCount, t = this.items, n = [], o = 0, r = 0; r < t.length; r++)0 == o && n.push([]), n[n.length - 1].push(t[r]), ++o >= e && (o = 0); return n }, t.prototype.onValueChanged = function () { e.prototype.onValueChanged.call(this), this.onItemValueChanged() }, t.prototype.createTextItem = function (e, t) { return new Qo(e, t) }, t.prototype.onItemValueChanged = function () { if (!this.isMultipleItemValueChanging) for (var e = 0; e < this.items.length; e++) { var t = null; this.value && this.items[e].name in this.value && (t = this.value[this.items[e].name]), this.items[e].onValueChanged(t) } }, t.prototype.getIsRunningValidators = function () { if (e.prototype.getIsRunningValidators.call(this)) return !0; for (var t = 0; t < this.items.length; t++)if (this.items[t].editor.isRunningValidators) return !0; return !1 }, t.prototype.hasErrors = function (t, n) { var o = this; void 0 === t && (t = !0), void 0 === n && (n = null); for (var r = !1, i = 0; i < this.items.length; i++)this.items[i].editor.onCompletedAsyncValidators = function (e) { o.raiseOnCompletedAsyncValidators() }, n && !0 === n.isOnValueChanged && this.items[i].editor.isEmpty() || (r = this.items[i].editor.hasErrors(t, n) || r); return e.prototype.hasErrors.call(this, t) || r }, t.prototype.getAllErrors = function () { for (var t = e.prototype.getAllErrors.call(this), n = 0; n < this.items.length; n++) { var o = this.items[n].editor.getAllErrors(); o && o.length > 0 && (t = t.concat(o)) } return t }, t.prototype.clearErrors = function () { e.prototype.clearErrors.call(this); for (var t = 0; t < this.items.length; t++)this.items[t].editor.clearErrors() }, t.prototype.getContainsErrors = function () { var t = e.prototype.getContainsErrors.call(this); if (t) return t; for (var n = this.items, o = 0; o < n.length; o++)if (n[o].editor.containsErrors) return !0; return !1 }, t.prototype.getIsAnswered = function () { if (!e.prototype.getIsAnswered.call(this)) return !1; for (var t = 0; t < this.items.length; t++) { var n = this.items[t].editor; if (n.isVisible && !n.isAnswered) return !1 } return !0 }, t.prototype.getProgressInfo = function () { for (var e = [], t = 0; t < this.items.length; t++)e.push(this.items[t].editor); return At.getProgressInfoByElements(e, this.isRequired) }, t.prototype.getDisplayValueCore = function (e, t) { if (!t) return t; for (var n = {}, o = 0; o < this.items.length; o++) { var i = this.items[o], s = t[i.name]; if (!r.isValueEmpty(s)) { var a = i.name; e && i.title && (a = i.title), n[a] = i.editor.getDisplayValue(e, s) } } return n }, t.prototype.getMultipleTextValue = function (e) { return this.value ? this.value[e] : null }, t.prototype.setMultipleTextValue = function (e, t) { this.isMultipleItemValueChanging = !0, this.isValueEmpty(t) && (t = void 0); var n = this.value; n || (n = {}), n[e] = t, this.setNewValue(n), this.isMultipleItemValueChanging = !1 }, t.prototype.getItemDefaultValue = function (e) { return this.defaultValue ? this.defaultValue[e] : null }, t.prototype.getTextProcessor = function () { return this.textProcessor }, t.prototype.getAllValues = function () { return this.data ? this.data.getAllValues() : null }, t.prototype.getIsRequiredText = function () { return this.survey ? this.survey.requiredText : "" }, t.prototype.addElement = function (e, t) { }, t.prototype.removeElement = function (e) { return !1 }, t.prototype.getQuestionTitleLocation = function () { return "left" }, t.prototype.getQuestionStartIndex = function () { return this.getStartIndex() }, t.prototype.getChildrenLayoutType = function () { return "row" }, t.prototype.elementWidthChanged = function (e) { }, Object.defineProperty(t.prototype, "elements", { get: function () { return [] }, enumerable: !1, configurable: !0 }), t.prototype.indexOf = function (e) { return -1 }, t.prototype.ensureRowsVisibility = function () { }, t.prototype.getItemLabelCss = function (e) { return (new at).append(this.cssClasses.itemLabel).append(this.cssClasses.itemLabelOnError, e.editor.errors.length > 0).toString() }, t.prototype.getItemCss = function () { return (new at).append(this.cssClasses.item).toString() }, t.prototype.getItemTitleCss = function () { return (new at).append(this.cssClasses.itemTitle).toString() }, t.prototype.getIsTooltipErrorInsideSupported = function () { return !0 }, t }($t); _.addClass("multipletextitem", ["name", "isRequired:boolean", { name: "placeholder", alternativeName: "placeHolder", serializationProperty: "locPlaceholder" }, { name: "inputType", default: "text", choices: o.questions.inputTypes }, { name: "title", serializationProperty: "locTitle" }, { name: "maxLength:number", default: -1 }, { name: "size:number", minValue: 0 }, { name: "requiredErrorText:text", serializationProperty: "locRequiredErrorText" }, { name: "validators:validators", baseClassName: "surveyvalidator", classNamePart: "validator" }], (function () { return new Qo("") })), _.addClass("multipletext", [{ name: "!items:textitems", className: "multipletextitem" }, { name: "itemSize:number", minValue: 0 }, { name: "colCount:number", default: 1, choices: [1, 2, 3, 4, 5] }], (function () { return new Ho("") }), "question"), rn.Instance.registerQuestion("multipletext", (function (e) { var t = new Ho(e); return Ho.addDefaultItems(t), t })); var zo = function () { var e = function (t, n) { return (e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (e, t) { e.__proto__ = t } || function (e, t) { for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]) })(t, n) }; return function (t, n) { if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null"); function o() { this.constructor = t } e(t, n), t.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o) } }(), Uo = function (e, t, n, o) { var r, i = arguments.length, s = i < 3 ? t : null === o ? o = Object.getOwnPropertyDescriptor(t, n) : o; if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) s = Reflect.decorate(e, t, n, o); else for (var a = e.length - 1; a >= 0; a--)(r = e[a]) && (s = (i < 3 ? r(s) : i > 3 ? r(t, n, s) : r(t, n)) || s); return i > 3 && s && Object.defineProperty(t, n, s), s }, Wo = function (e, t, n) { void 0 === n && (n = -1), this.source = e, this.target = t, this.nestedPanelDepth = n }, Jo = function (e) { function t(n) { var o = e.call(this) || this; return o.panel = n, o._scrollableParent = void 0, o._updateVisibility = void 0, o.idValue = t.getRowId(), o.visible = n.areInvisibleElementsShowing, o.createNewArray("elements"), o.createNewArray("visibleElements"), o } return zo(t, e), t.getRowId = function () { return "pr_" + t.rowCounter++ }, t.prototype.startLazyRendering = function (e, t) { var n = this; void 0 === t && (t = ze), this._scrollableParent = t(e), this._scrollableParent === document.documentElement && (this._scrollableParent = window); var o = this._scrollableParent.scrollHeight > this._scrollableParent.clientHeight; this.isNeedRender = !o, o && (this._updateVisibility = function () { var t = function (e, t) { if (void 0 === t && (t = 0), "undefined" == typeof document) return !1; var n = e.getBoundingClientRect(), o = -t, r = Math.max(document.documentElement.clientHeight, window.innerHeight) + t, i = n.top, s = n.bottom; return Math.max(o, i) <= Math.min(r, s) }(e, 50); !n.isNeedRender && t && (n.isNeedRender = !0, n.stopLazyRendering()) }, setTimeout((function () { n._scrollableParent && n._scrollableParent.addEventListener && n._scrollableParent.addEventListener("scroll", n._updateVisibility), n.ensureVisibility() }), 10)) }, t.prototype.ensureVisibility = function () { this._updateVisibility && this._updateVisibility() }, t.prototype.stopLazyRendering = function () { this._scrollableParent && this._updateVisibility && this._scrollableParent.removeEventListener && this._scrollableParent.removeEventListener("scroll", this._updateVisibility), this._scrollableParent = void 0, this._updateVisibility = void 0 }, t.prototype.setIsLazyRendering = function (e) { this.isLazyRenderingValue = e, this.isNeedRender = !e }, t.prototype.isLazyRendering = function () { return !0 === this.isLazyRenderingValue }, Object.defineProperty(t.prototype, "id", { get: function () { return this.idValue }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "elements", { get: function () { return this.getPropertyValue("elements") }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "visibleElements", { get: function () { return this.getPropertyValue("visibleElements") }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "visible", { get: function () { return this.getPropertyValue("visible", !0) }, set: function (e) { this.setPropertyValue("visible", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "isNeedRender", { get: function () { return this.getPropertyValue("isneedrender", !0) }, set: function (e) { this.setPropertyValue("isneedrender", e) }, enumerable: !1, configurable: !0 }), t.prototype.updateVisible = function () { var e = this.calcVisible(); this.setWidth(), this.visible = e }, t.prototype.addElement = function (e) { this.elements.push(e), this.updateVisible() }, Object.defineProperty(t.prototype, "index", { get: function () { return this.panel.rows.indexOf(this) }, enumerable: !1, configurable: !0 }), t.prototype.setWidth = function () { var e, t = this.visibleElements.length; if (0 != t) { for (var n = 1 === this.visibleElements.length, o = 0, r = [], i = 0; i < this.elements.length; i++) { var s = this.elements[i]; if (this.setElementMaxMinWidth(s), s.isVisible) { s.isSingleInRow = n; var a = this.getElementWidth(s); a && (s.renderWidth = this.getRenderedWidthFromWidth(a), r.push(s)), this.panel.isDefaultV2Theme || (null === (e = this.panel.parentQuestion) || void 0 === e ? void 0 : e.isDefaultV2Theme) || (s.rightIndent = o < t - 1 ? 1 : 0), o++ } else s.renderWidth = "" } for (i = 0; i < this.elements.length; i++) { !(s = this.elements[i]).isVisible || r.indexOf(s) > -1 || (0 == r.length ? s.renderWidth = (100 / t).toFixed(6) + "%" : s.renderWidth = this.getRenderedCalcWidth(s, r, t)) } } }, t.prototype.setElementMaxMinWidth = function (e) { e.width && "string" == typeof e.width && -1 === e.width.indexOf("%") && (e.minWidth = e.width, e.maxWidth = e.width) }, t.prototype.getRenderedCalcWidth = function (e, t, n) { for (var o = "100%", r = 0; r < t.length; r++)o += " - " + t[r].renderWidth; var i = n - t.length; return i > 1 && (o = "(" + o + ")/" + i.toString()), "calc(" + o + ")" }, t.prototype.getElementWidth = function (e) { var t = e.width; return t && "string" == typeof t ? t.trim() : "" }, t.prototype.getRenderedWidthFromWidth = function (e) { return r.isNumber(e) ? e + "px" : e }, t.prototype.calcVisible = function () { for (var e = [], t = 0; t < this.elements.length; t++)this.elements[t].isVisible && e.push(this.elements[t]); return this.needToUpdateVisibleElements(e) && this.setPropertyValue("visibleElements", e), e.length > 0 }, t.prototype.needToUpdateVisibleElements = function (e) { if (e.length !== this.visibleElements.length) return !0; for (var t = 0; t < e.length; t++)if (e[t] !== this.visibleElements[t]) return !0; return !1 }, t.prototype.dispose = function () { e.prototype.dispose.call(this), this.stopLazyRendering() }, t.prototype.getRowCss = function () { return (new at).append(this.panel.cssClasses.row).append(this.panel.cssClasses.pageRow, this.panel.isPage).append(this.panel.cssClasses.rowMultiple, this.visibleElements.length > 1).toString() }, t.rowCounter = 100, t }(ce), Go = function (e) { function t(n) { void 0 === n && (n = ""); var o = e.call(this, n) || this; return o.isQuestionsReady = !1, o.questionsValue = new Array, o.isRandomizing = !1, o.createNewArray("rows"), o.elementsValue = o.createNewArray("elements", o.onAddElement.bind(o), o.onRemoveElement.bind(o)), o.id = t.getPanelId(), o.addExpressionProperty("visibleIf", (function (e, t) { o.visible = !0 === t }), (function (e) { return !o.areInvisibleElementsShowing })), o.addExpressionProperty("enableIf", (function (e, t) { o.readOnly = !1 === t })), o.addExpressionProperty("requiredIf", (function (e, t) { o.isRequired = !0 === t })), o.createLocalizableString("requiredErrorText", o), o.registerPropertyChangedHandlers(["questionTitleLocation"], (function () { o.onVisibleChanged.bind(o), o.updateElementCss(!0) })), o.registerPropertyChangedHandlers(["questionStartIndex", "showQuestionNumbers"], (function () { o.updateVisibleIndexes() })), o } return zo(t, e), t.getPanelId = function () { return "sp_" + t.panelCounter++ }, t.prototype.getType = function () { return "panelbase" }, t.prototype.setSurveyImpl = function (t, n) { e.prototype.setSurveyImpl.call(this, t, n), this.isDesignMode && this.onVisibleChanged(); for (var o = 0; o < this.elements.length; o++)this.elements[o].setSurveyImpl(t, n) }, t.prototype.endLoadingFromJson = function () { e.prototype.endLoadingFromJson.call(this), this.updateDescriptionVisibility(this.description), this.markQuestionListDirty(), this.onRowsChanged() }, Object.defineProperty(t.prototype, "hasTitle", { get: function () { return this.canShowTitle() && this.title.length > 0 || this.showTitle && this.isDesignMode && o.allowShowEmptyTitleInDesignMode }, enumerable: !1, configurable: !0 }), t.prototype.canShowTitle = function () { return !0 }, Object.defineProperty(t.prototype, "_showDescription", { get: function () { return this.survey && this.survey.showPageTitles && this.hasDescription || this.showDescription && this.isDesignMode && o.allowShowEmptyTitleInDesignMode && o.allowShowEmptyDescriptionInDesignMode }, enumerable: !1, configurable: !0 }), t.prototype.localeChanged = function () { e.prototype.localeChanged.call(this); for (var t = 0; t < this.elements.length; t++)this.elements[t].localeChanged() }, t.prototype.locStrsChanged = function () { e.prototype.locStrsChanged.call(this); for (var t = 0; t < this.elements.length; t++)this.elements[t].locStrsChanged() }, Object.defineProperty(t.prototype, "requiredText", { get: function () { return this.survey && this.isRequired ? this.survey.requiredText : "" }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "titlePattern", { get: function () { return this.survey ? this.survey.questionTitlePattern : "numTitleRequire" }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "isRequireTextOnStart", { get: function () { return this.isRequired && "requireNumTitle" == this.titlePattern }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "isRequireTextBeforeTitle", { get: function () { return this.isRequired && "numRequireTitle" == this.titlePattern }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "isRequireTextAfterTitle", { get: function () { return this.isRequired && "numTitleRequire" == this.titlePattern }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "requiredErrorText", { get: function () { return this.getLocalizableStringText("requiredErrorText") }, set: function (e) { this.setLocalizableStringText("requiredErrorText", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "locRequiredErrorText", { get: function () { return this.getLocalizableString("requiredErrorText") }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "questionsOrder", { get: function () { return this.getPropertyValue("questionsOrder") }, set: function (e) { this.setPropertyValue("questionsOrder", e) }, enumerable: !1, configurable: !0 }), t.prototype.canRandomize = function (e) { return e && "initial" !== this.questionsOrder || "random" === this.questionsOrder }, t.prototype.randomizeElements = function (e) { if (this.canRandomize(e) && !this.isRandomizing) { this.isRandomizing = !0; for (var t = [], n = this.elements, o = 0; o < n.length; o++)t.push(n[o]); var i = r.randomizeArray(t); this.setArrayPropertyDirectly("elements", i, !1), this.updateRows(), this.updateVisibleIndexes(), this.isRandomizing = !1 } }, Object.defineProperty(t.prototype, "areQuestionsRandomized", { get: function () { return "random" == ("default" == this.questionsOrder && this.survey ? this.survey.questionsOrder : this.questionsOrder) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "parent", { get: function () { return this.getPropertyValue("parent", null) }, set: function (e) { this.setPropertyValue("parent", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "depth", { get: function () { return null == this.parent ? 0 : this.parent.depth + 1 }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "visibleIf", { get: function () { return this.getPropertyValue("visibleIf", "") }, set: function (e) { this.setPropertyValue("visibleIf", e) }, enumerable: !1, configurable: !0 }), t.prototype.calcCssClasses = function (e) { var t = { panel: {}, error: {}, row: "", rowMultiple: "" }; return this.copyCssClasses(t.panel, e.panel), this.copyCssClasses(t.error, e.error), e.row && (t.row = e.row), e.rowMultiple && (t.rowMultiple = e.rowMultiple), this.survey && this.survey.updatePanelCssClasses(this, t), t }, Object.defineProperty(t.prototype, "id", { get: function () { return this.getPropertyValue("id") }, set: function (e) { this.setPropertyValue("id", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "isPanel", { get: function () { return !1 }, enumerable: !1, configurable: !0 }), t.prototype.getPanel = function () { return this }, t.prototype.getLayoutType = function () { return "row" }, t.prototype.isLayoutTypeSupported = function (e) { return "flow" !== e }, Object.defineProperty(t.prototype, "questions", { get: function () { if (!this.isQuestionsReady) { this.questionsValue = []; for (var e = 0; e < this.elements.length; e++) { var t = this.elements[e]; if (t.isPanel) for (var n = t.questions, o = 0; o < n.length; o++)this.questionsValue.push(n[o]); else this.questionsValue.push(t) } this.isQuestionsReady = !0 } return this.questionsValue }, enumerable: !1, configurable: !0 }), t.prototype.getValidName = function (e) { return e ? e.trim() : e }, t.prototype.getQuestionByName = function (e) { for (var t = this.questions, n = 0; n < t.length; n++)if (t[n].name == e) return t[n]; return null }, t.prototype.getElementByName = function (e) { for (var t = this.elements, n = 0; n < t.length; n++) { var o = t[n]; if (o.name == e) return o; var r = o.getPanel(); if (r) { var i = r.getElementByName(e); if (i) return i } } return null }, t.prototype.getQuestionByValueName = function (e) { for (var t = this.questions, n = 0; n < t.length; n++)if (t[n].getValueName() == e) return t[n]; return null }, t.prototype.getValue = function () { for (var e = {}, t = this.questions, n = 0; n < t.length; n++) { var o = t[n]; if (!o.isEmpty()) { var r = o.getValueName(); if (e[r] = o.value, this.data) { var i = this.data.getComment(r); i && (e[r + ce.commentSuffix] = i) } } } return e }, t.prototype.getDisplayValue = function (e) { for (var t = {}, n = this.questions, o = 0; o < n.length; o++) { var r = n[o]; if (!r.isEmpty()) t[e ? r.title : r.getValueName()] = r.getDisplayValue(e) } return t }, t.prototype.getComments = function () { var e = {}; if (!this.data) return e; for (var t = this.questions, n = 0; n < t.length; n++) { var o = t[n], r = this.data.getComment(o.getValueName()); r && (e[o.getValueName()] = r) } return e }, t.prototype.clearIncorrectValues = function () { for (var e = 0; e < this.elements.length; e++)this.elements[e].clearIncorrectValues() }, t.prototype.clearErrors = function () { for (var e = 0; e < this.elements.length; e++)this.elements[e].clearErrors(); this.errors = [] }, t.prototype.markQuestionListDirty = function () { this.isQuestionsReady = !1, this.parent && this.parent.markQuestionListDirty() }, Object.defineProperty(t.prototype, "elements", { get: function () { return this.elementsValue }, enumerable: !1, configurable: !0 }), t.prototype.getElementsInDesign = function (e) { return void 0 === e && (e = !1), this.elements }, t.prototype.containsElement = function (e) { for (var t = 0; t < this.elements.length; t++) { var n = this.elements[t]; if (n == e) return !0; var o = n.getPanel(); if (o && o.containsElement(e)) return !0 } return !1 }, Object.defineProperty(t.prototype, "isRequired", { get: function () { return this.getPropertyValue("isRequired", !1) }, set: function (e) { this.setPropertyValue("isRequired", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "requiredIf", { get: function () { return this.getPropertyValue("requiredIf", "") }, set: function (e) { this.setPropertyValue("requiredIf", e) }, enumerable: !1, configurable: !0 }), t.prototype.searchText = function (t, n) { e.prototype.searchText.call(this, t, n); for (var o = 0; o < this.elements.length; o++)this.elements[o].searchText(t, n) }, t.prototype.hasErrors = function (e, t, n) { return void 0 === e && (e = !0), void 0 === t && (t = !1), void 0 === n && (n = null), !this.validate(e, t, n) }, t.prototype.validate = function (e, t, n) { return void 0 === e && (e = !0), void 0 === t && (t = !1), void 0 === n && (n = null), !0 !== (n = n || { fireCallback: e, focuseOnFirstError: t, firstErrorQuestion: null, result: !1 }).result && (n.result = !1), this.hasErrorsCore(n), n.firstErrorQuestion && n.firstErrorQuestion.focus(!0), !n.result }, t.prototype.hasErrorsInPanels = function (e) { var t = []; if (this.hasRequiredError(e, t), this.survey) { var n = this.survey.validatePanel(this); n && (t.push(n), e.result = !0) } e.fireCallback && (this.survey && this.survey.beforeSettingPanelErrors(this, t), this.errors = t) }, t.prototype.getErrorCustomText = function (e, t) { return this.survey ? this.survey.getSurveyErrorCustomText(this, e, t) : e }, t.prototype.hasRequiredError = function (e, t) { if (this.isRequired) { var n = []; if (this.addQuestionsToList(n, !0), 0 != n.length) { for (var o = 0; o < n.length; o++)if (!n[o].isEmpty()) return; e.result = !0, t.push(new me(this.requiredErrorText, this)), e.focuseOnFirstError && !e.firstErrorQuestion && (e.firstErrorQuestion = n[0]) } } }, t.prototype.hasErrorsCore = function (e) { for (var t = this.elements, n = null, o = 0; o < t.length; o++)if ((n = t[o]).isVisible) if (n.isPanel) n.hasErrorsCore(e); else { var r = n; if (r.isReadOnly) continue; r.validate(e.fireCallback, e) || (e.focuseOnFirstError && null == e.firstErrorQuestion && (e.firstErrorQuestion = r), e.result = !0) } this.hasErrorsInPanels(e), this.updateContainsErrors() }, t.prototype.getContainsErrors = function () { var t = e.prototype.getContainsErrors.call(this); if (t) return t; for (var n = this.elements, o = 0; o < n.length; o++)if (n[o].containsErrors) return !0; return !1 }, t.prototype.updateElementVisibility = function () { for (var e = 0; e < this.elements.length; e++) { var t = this.elements[e]; t.setPropertyValue("isVisible", t.isVisible), t.isPanel && t.updateElementVisibility() } }, t.prototype.getFirstQuestionToFocus = function (e, t) { if (void 0 === e && (e = !1), void 0 === t && (t = !1), !e && !t && this.isCollapsed) return null; for (var n = this.elements, o = 0; o < n.length; o++) { var r = n[o]; if (r.isVisible && (t || !r.isCollapsed)) if (r.isPanel) { var i = r.getFirstQuestionToFocus(e, t); if (i) return i } else { var s = r.getFirstQuestionToFocus(e); if (s) return s } } return null }, t.prototype.focusFirstQuestion = function () { var e = this.getFirstQuestionToFocus(); e && e.focus() }, t.prototype.focusFirstErrorQuestion = function () { var e = this.getFirstQuestionToFocus(!0); e && e.focus() }, t.prototype.addQuestionsToList = function (e, t, n) { void 0 === t && (t = !1), void 0 === n && (n = !1), this.addElementsToList(e, t, n, !1) }, t.prototype.addPanelsIntoList = function (e, t, n) { void 0 === t && (t = !1), void 0 === n && (n = !1), this.addElementsToList(e, t, n, !0) }, t.prototype.addElementsToList = function (e, t, n, o) { t && !this.visible || this.addElementsToListCore(e, this.elements, t, n, o) }, t.prototype.addElementsToListCore = function (e, t, n, o, r) { for (var i = 0; i < t.length; i++) { var s = t[i]; n && !s.visible || ((r && s.isPanel || !r && !s.isPanel) && e.push(s), s.isPanel ? s.addElementsToListCore(e, s.elements, n, o, r) : o && this.addElementsToListCore(e, s.getElementsInDesign(!1), n, o, r)) } }, t.prototype.updateCustomWidgets = function () { for (var e = 0; e < this.elements.length; e++)this.elements[e].updateCustomWidgets() }, Object.defineProperty(t.prototype, "questionTitleLocation", { get: function () { return this.getPropertyValue("questionTitleLocation") }, set: function (e) { this.setPropertyValue("questionTitleLocation", e.toLowerCase()) }, enumerable: !1, configurable: !0 }), t.prototype.getQuestionTitleLocation = function () { return this.onGetQuestionTitleLocation ? this.onGetQuestionTitleLocation() : "default" != this.questionTitleLocation ? this.questionTitleLocation : this.parent ? this.parent.getQuestionTitleLocation() : this.survey ? this.survey.questionTitleLocation : "top" }, t.prototype.getStartIndex = function () { return this.parent ? this.parent.getQuestionStartIndex() : this.survey ? this.survey.questionStartIndex : "" }, t.prototype.getQuestionStartIndex = function () { return this.getStartIndex() }, t.prototype.getChildrenLayoutType = function () { return "row" }, t.prototype.getProgressInfo = function () { return At.getProgressInfoByElements(this.elements, this.isRequired) }, Object.defineProperty(t.prototype, "root", { get: function () { for (var e = this; e.parent;)e = e.parent; return e }, enumerable: !1, configurable: !0 }), t.prototype.childVisibilityChanged = function () { this.getIsPageVisible(null) !== this.getPropertyValue("isVisible", !0) && this.onVisibleChanged() }, t.prototype.createRowAndSetLazy = function (e) { var t = this.createRow(); return t.setIsLazyRendering(this.isLazyRenderInRow(e)), t }, t.prototype.createRow = function () { return new Jo(this) }, t.prototype.onSurveyLoad = function () { for (var e = 0; e < this.elements.length; e++)this.elements[e].onSurveyLoad(); this.onElementVisibilityChanged(this) }, t.prototype.onFirstRendering = function () { e.prototype.onFirstRendering.call(this); for (var t = 0; t < this.elements.length; t++)this.elements[t].onFirstRendering(); this.onRowsChanged() }, t.prototype.updateRows = function () { if (!this.isLoadingFromJson) { for (var e = 0; e < this.elements.length; e++)this.elements[e].isPanel && this.elements[e].updateRows(); this.onRowsChanged() } }, Object.defineProperty(t.prototype, "rows", { get: function () { return this.getPropertyValue("rows") }, enumerable: !1, configurable: !0 }), t.prototype.ensureRowsVisibility = function () { this.rows.forEach((function (e) { e.ensureVisibility() })) }, t.prototype.onRowsChanged = function () { this.isLoadingFromJson || this.setArrayPropertyDirectly("rows", this.buildRows()) }, t.prototype.onAddElement = function (e, t) { var n = this; if (e.setSurveyImpl(this.surveyImpl), e.parent = this, this.markQuestionListDirty(), this.updateRowsOnElementAdded(e, t), e.isPanel) { var o = e; this.survey && this.survey.panelAdded(o, t, this, this.root) } else if (this.survey) { var r = e; this.survey.questionAdded(r, t, this, this.root) } this.addElementCallback && this.addElementCallback(e); e.registerPropertyChangedHandlers(["visible", "isVisible"], (function () { n.onElementVisibilityChanged(e) }), this.id), e.registerPropertyChangedHandlers(["startWithNewLine"], (function () { n.onElementStartWithNewLineChanged(e) }), this.id), this.onElementVisibilityChanged(this) }, t.prototype.onRemoveElement = function (e) { e.parent = null, this.markQuestionListDirty(), e.unregisterPropertyChangedHandlers(["visible", "isVisible", "startWithNewLine"], this.id), this.updateRowsOnElementRemoved(e), this.isRandomizing || (e.isPanel ? this.survey && this.survey.panelRemoved(e) : this.survey && this.survey.questionRemoved(e), this.removeElementCallback && this.removeElementCallback(e), this.onElementVisibilityChanged(this)) }, t.prototype.onElementVisibilityChanged = function (e) { this.isLoadingFromJson || this.isRandomizing || (this.updateRowsVisibility(e), this.childVisibilityChanged(), this.parent && this.parent.onElementVisibilityChanged(this)) }, t.prototype.onElementStartWithNewLineChanged = function (e) { this.onRowsChanged() }, t.prototype.updateRowsVisibility = function (e) { for (var t = this.rows, n = 0; n < t.length; n++) { var o = t[n]; if (o.elements.indexOf(e) > -1) { o.updateVisible(), o.visible && !o.isNeedRender && (o.isNeedRender = !0); break } } }, t.prototype.canBuildRows = function () { return !this.isLoadingFromJson && "row" == this.getChildrenLayoutType() }, t.prototype.buildRows = function () { if (!this.canBuildRows()) return []; for (var e = new Array, t = 0; t < this.elements.length; t++) { var n = this.elements[t], o = 0 == t || n.startWithNewLine, r = o ? this.createRowAndSetLazy(e.length) : e[e.length - 1]; o && e.push(r), r.addElement(n) } for (t = 0; t < e.length; t++)e[t].updateVisible(); return e }, t.prototype.isLazyRenderInRow = function (e) { return !(!this.survey || !this.survey.isLazyRendering) && (e >= o.lazyRowsRenderingStartRow || !this.canRenderFirstRows()) }, t.prototype.canRenderFirstRows = function () { return this.isPage }, t.prototype.getDragDropInfo = function () { var e = this.getPage(this.parent); return e ? e.getDragDropInfo() : void 0 }, t.prototype.updateRowsOnElementAdded = function (e, t) { if (this.canBuildRows()) { var n = o.supportCreatorV2 ? this.getDragDropInfo() : void 0; n || ((n = new Wo(null, e)).target = e, n.isEdge = this.elements.length > 1, this.elements.length < 2 ? n.destination = this : (n.isBottom = t > 0, n.destination = 0 == t ? this.elements[1] : this.elements[t - 1])), this.dragDropAddTargetToRow(n, null) } }, t.prototype.updateRowsOnElementRemoved = function (e) { this.canBuildRows() && this.updateRowsRemoveElementFromRow(e, this.findRowByElement(e)) }, t.prototype.updateRowsRemoveElementFromRow = function (e, t) { if (t && t.panel) { var n = t.elements.indexOf(e); n < 0 || (t.elements.splice(n, 1), t.elements.length > 0 ? (t.elements[0].startWithNewLine = !0, t.updateVisible()) : t.index >= 0 && t.panel.rows.splice(t.index, 1)) } }, t.prototype.findRowByElement = function (e) { for (var t = this.rows, n = 0; n < t.length; n++)if (t[n].elements.indexOf(e) > -1) return t[n]; return null }, t.prototype.elementWidthChanged = function (e) { if (!this.isLoadingFromJson) { var t = this.findRowByElement(e); t && t.updateVisible() } }, Object.defineProperty(t.prototype, "processedTitle", { get: function () { return this.getRenderedTitle(this.locTitle.textOrHtml) }, enumerable: !1, configurable: !0 }), t.prototype.getRenderedTitle = function (e) { return null != this.textProcessor ? this.textProcessor.processText(e, !0) : e }, Object.defineProperty(t.prototype, "visible", { get: function () { return this.getPropertyValue("visible", !0) }, set: function (e) { e !== this.visible && (this.setPropertyValue("visible", e), this.setPropertyValue("isVisible", this.isVisible), this.isLoadingFromJson || this.onVisibleChanged()) }, enumerable: !1, configurable: !0 }), t.prototype.onVisibleChanged = function () { if (!this.isRandomizing && (this.setPropertyValue("isVisible", this.isVisible), this.survey && this.survey.isClearValueOnHiddenContainer && !this.isLoadingFromJson)) for (var e = this.questions, t = 0; t < e.length; t++)this.isVisible ? e[t].updateValueWithDefaults() : e[t].clearValueIfInvisible() }, Object.defineProperty(t.prototype, "isVisible", { get: function () { return this.areInvisibleElementsShowing || this.getIsPageVisible(null) }, enumerable: !1, configurable: !0 }), t.prototype.getIsPageVisible = function (e) { if (!this.visible) return !1; for (var t = 0; t < this.elements.length; t++)if (this.elements[t] != e && this.elements[t].isVisible) return !0; return !1 }, t.prototype.setVisibleIndex = function (e) { if (!this.isVisible || e < 0) return this.resetVisibleIndexes(), 0; this.lastVisibleIndex = e; var t = e; e += this.beforeSetVisibleIndex(e); for (var n = this.getPanelStartIndex(e), o = n, r = 0; r < this.elements.length; r++)o += this.elements[r].setVisibleIndex(o); return this.isContinueNumbering() && (e += o - n), e - t }, t.prototype.updateVisibleIndexes = function () { void 0 !== this.lastVisibleIndex && (this.resetVisibleIndexes(), this.setVisibleIndex(this.lastVisibleIndex)) }, t.prototype.resetVisibleIndexes = function () { for (var e = 0; e < this.elements.length; e++)this.elements[e].setVisibleIndex(-1) }, t.prototype.beforeSetVisibleIndex = function (e) { return 0 }, t.prototype.getPanelStartIndex = function (e) { return e }, t.prototype.isContinueNumbering = function () { return !0 }, Object.defineProperty(t.prototype, "isReadOnly", { get: function () { var e = !!this.parent && this.parent.isReadOnly, t = !!this.survey && this.survey.isDisplayMode; return this.readOnly || e || t }, enumerable: !1, configurable: !0 }), t.prototype.onReadOnlyChanged = function () { for (var t = 0; t < this.elements.length; t++) { var n = this.elements[t]; n.setPropertyValue("isReadOnly", n.isReadOnly) } e.prototype.onReadOnlyChanged.call(this) }, t.prototype.updateElementCss = function (t) { e.prototype.updateElementCss.call(this, t); for (var n = 0; n < this.elements.length; n++) { this.elements[n].updateElementCss(t) } }, Object.defineProperty(t.prototype, "enableIf", { get: function () { return this.getPropertyValue("enableIf", "") }, set: function (e) { this.setPropertyValue("enableIf", e) }, enumerable: !1, configurable: !0 }), t.prototype.addElement = function (e, t) { return void 0 === t && (t = -1), !!this.canAddElement(e) && (t < 0 || t >= this.elements.length ? this.elements.push(e) : this.elements.splice(t, 0, e), !0) }, t.prototype.insertElementAfter = function (e, t) { var n = this.elements.indexOf(t); n >= 0 && this.addElement(e, n + 1) }, t.prototype.insertElementBefore = function (e, t) { var n = this.elements.indexOf(t); n >= 0 && this.addElement(e, n) }, t.prototype.canAddElement = function (e) { return !!e && e.isLayoutTypeSupported(this.getChildrenLayoutType()) }, t.prototype.addQuestion = function (e, t) { return void 0 === t && (t = -1), this.addElement(e, t) }, t.prototype.addPanel = function (e, t) { return void 0 === t && (t = -1), this.addElement(e, t) }, t.prototype.addNewQuestion = function (e, t, n) { void 0 === t && (t = null), void 0 === n && (n = -1); var o = rn.Instance.createQuestion(e, t); return this.addQuestion(o, n) ? o : null }, t.prototype.addNewPanel = function (e) { void 0 === e && (e = null); var t = this.createNewPanel(e); return this.addPanel(t) ? t : null }, t.prototype.indexOf = function (e) { return this.elements.indexOf(e) }, t.prototype.createNewPanel = function (e) { var t = _.createClass("panel"); return t.name = e, t }, t.prototype.removeElement = function (e) { var t = this.elements.indexOf(e); if (t < 0) { for (var n = 0; n < this.elements.length; n++)if (this.elements[n].removeElement(e)) return !0; return !1 } return this.elements.splice(t, 1), !0 }, t.prototype.removeQuestion = function (e) { this.removeElement(e) }, t.prototype.runCondition = function (e, t) { if (!this.isDesignMode && !this.isLoadingFromJson) { for (var n = this.elements.slice(), o = 0; o < n.length; o++)n[o].runCondition(e, t); this.runConditionCore(e, t) } }, t.prototype.onAnyValueChanged = function (e) { for (var t = this.elements, n = 0; n < t.length; n++)t[n].onAnyValueChanged(e) }, t.prototype.checkBindings = function (e, t) { for (var n = this.elements, o = 0; o < n.length; o++)n[o].checkBindings(e, t) }, t.prototype.dragDropAddTarget = function (e) { var t = this.dragDropFindRow(e.target); this.dragDropAddTargetToRow(e, t) && this.updateRowsRemoveElementFromRow(e.target, t) }, t.prototype.dragDropFindRow = function (e) { if (!e || e.isPage) return null; for (var t = e, n = this.rows, o = 0; o < n.length; o++)if (n[o].elements.indexOf(t) > -1) return n[o]; for (o = 0; o < this.elements.length; o++) { var r = this.elements[o].getPanel(); if (r) { var i = r.dragDropFindRow(t); if (i) return i } } return null }, t.prototype.dragDropAddTargetToRow = function (e, t) { if (!e.destination) return !0; if (this.dragDropAddTargetToEmptyPanel(e)) return !0; var n = e.destination, r = this.dragDropFindRow(n); return !r || (o.supportCreatorV2 && this.isDesignMode ? r.elements.length > 1 ? this.dragDropAddTargetToExistingRow(e, r, t) : this.dragDropAddTargetToNewRow(e, r, t) : e.target.startWithNewLine ? this.dragDropAddTargetToNewRow(e, r, t) : this.dragDropAddTargetToExistingRow(e, r, t)) }, t.prototype.dragDropAddTargetToEmptyPanel = function (e) { if (e.destination.isPage) return this.dragDropAddTargetToEmptyPanelCore(this.root, e.target, e.isBottom), !0; var t = e.destination; if (t.isPanel && !e.isEdge) { var n = t; if (e.target.template === t) return !1; if (e.nestedPanelDepth < 0 || e.nestedPanelDepth >= n.depth) return this.dragDropAddTargetToEmptyPanelCore(t, e.target, e.isBottom), !0 } return !1 }, t.prototype.dragDropAddTargetToExistingRow = function (e, t, n) { var r = t.elements.indexOf(e.destination); if (0 == r && !e.isBottom) if (this.isDesignMode && o.supportCreatorV2); else if (t.elements[0].startWithNewLine) return t.index > 0 ? (e.isBottom = !0, t = t.panel.rows[t.index - 1], e.destination = t.elements[t.elements.length - 1], this.dragDropAddTargetToExistingRow(e, t, n)) : this.dragDropAddTargetToNewRow(e, t, n); var i = -1; n == t && (i = t.elements.indexOf(e.target)), e.isBottom && r++; var s = this.findRowByElement(e.source); return (s != t || s.elements.indexOf(e.source) != r) && (r != i && (i > -1 && (t.elements.splice(i, 1), i < r && r--), t.elements.splice(r, 0, e.target), t.updateVisible(), i < 0)) }, t.prototype.dragDropAddTargetToNewRow = function (e, t, n) { var r = t.panel.createRowAndSetLazy(t.panel.rows.length); this.isDesignMode && o.supportCreatorV2 && r.setIsLazyRendering(!1), r.addElement(e.target); var i = t.index; if (e.isBottom && i++, n && n.panel == r.panel && n.index == i) return !1; var s = this.findRowByElement(e.source); return (!s || s.panel != r.panel || 1 != s.elements.length || s.index != i) && (t.panel.rows.splice(i, 0, r), !0) }, t.prototype.dragDropAddTargetToEmptyPanelCore = function (e, t, n) { var o = e.createRow(); o.addElement(t), 0 == e.elements.length || n ? e.rows.push(o) : e.rows.splice(0, 0, o) }, t.prototype.dragDropMoveElement = function (e, t, n) { n > e.parent.elements.indexOf(e) && n--, this.removeElement(e), this.addElement(t, n) }, t.prototype.needResponsiveWidth = function () { var e = !1; return this.elements.forEach((function (t) { t.needResponsiveWidth() && (e = !0) })), this.rows.forEach((function (t) { t.elements.length > 1 && (e = !0) })), e }, Object.defineProperty(t.prototype, "hasDescriptionUnderTitle", { get: function () { return this.hasDescription }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "cssHeader", { get: function () { return this.cssClasses.panel.header }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "cssDescription", { get: function () { return this.cssClasses.panel.description }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "no", { get: function () { return "" }, enumerable: !1, configurable: !0 }), t.prototype.dispose = function () { if (e.prototype.dispose.call(this), this.rows) { for (var t = 0; t < this.rows.length; t++)this.rows[t].dispose(); this.rows.splice(0, this.rows.length) } for (t = 0; t < this.elements.length; t++)this.elements[t].dispose(); this.elements.splice(0, this.elements.length) }, t.panelCounter = 100, Uo([f({ defaultValue: !0 })], t.prototype, "showTitle", void 0), Uo([f({ defaultValue: !0 })], t.prototype, "showDescription", void 0), t }(At), $o = function (e) { function t(t) { void 0 === t && (t = ""); var n = e.call(this, t) || this; return n.createNewArray("footerActions"), n.registerPropertyChangedHandlers(["width"], (function () { n.parent && n.parent.elementWidthChanged(n) })), n.registerPropertyChangedHandlers(["indent", "innerIndent", "rightIndent"], (function () { n.onIndentChanged() })), n } return zo(t, e), t.prototype.getType = function () { return "panel" }, Object.defineProperty(t.prototype, "contentId", { get: function () { return this.id + "_content" }, enumerable: !1, configurable: !0 }), t.prototype.getSurvey = function (t) { return void 0 === t && (t = !1), t ? this.parent ? this.parent.getSurvey(t) : null : e.prototype.getSurvey.call(this, t) }, t.prototype.onSurveyLoad = function () { e.prototype.onSurveyLoad.call(this), this.onIndentChanged() }, t.prototype.onSetData = function () { e.prototype.onSetData.call(this), this.onIndentChanged() }, Object.defineProperty(t.prototype, "isPanel", { get: function () { return !0 }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "page", { get: function () { return this.getPage(this.parent) }, set: function (e) { this.setPage(this.parent, e) }, enumerable: !1, configurable: !0 }), t.prototype.delete = function () { this.parent && this.removeSelfFromList(this.parent.elements) }, t.prototype.moveTo = function (e, t) { return void 0 === t && (t = null), this.moveToBase(this.parent, e, t) }, Object.defineProperty(t.prototype, "visibleIndex", { get: function () { return this.getPropertyValue("visibleIndex", -1) }, enumerable: !1, configurable: !0 }), t.prototype.getTitleOwner = function () { return this }, Object.defineProperty(t.prototype, "showNumber", { get: function () { return this.getPropertyValue("showNumber", !1) }, set: function (e) { this.setPropertyValue("showNumber", e), this.notifySurveyOnVisibilityChanged() }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "showQuestionNumbers", { get: function () { return this.getPropertyValue("showQuestionNumbers") }, set: function (e) { this.setPropertyValue("showQuestionNumbers", e), this.notifySurveyOnVisibilityChanged() }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "questionStartIndex", { get: function () { return this.getPropertyValue("questionStartIndex", "") }, set: function (e) { this.setPropertyValue("questionStartIndex", e) }, enumerable: !1, configurable: !0 }), t.prototype.getQuestionStartIndex = function () { return this.questionStartIndex ? this.questionStartIndex : e.prototype.getQuestionStartIndex.call(this) }, Object.defineProperty(t.prototype, "no", { get: function () { return this.getPropertyValue("no", "") }, enumerable: !1, configurable: !0 }), t.prototype.setNo = function (e) { this.setPropertyValue("no", r.getNumberByIndex(this.visibleIndex, this.getStartIndex())) }, t.prototype.beforeSetVisibleIndex = function (e) { var t = -1; return !this.showNumber || !this.isDesignMode && this.locTitle.isEmpty || (t = e), this.setPropertyValue("visibleIndex", t), this.setNo(t), t < 0 ? 0 : 1 }, t.prototype.getPanelStartIndex = function (e) { return "off" == this.showQuestionNumbers ? -1 : "onpanel" == this.showQuestionNumbers ? 0 : e }, t.prototype.isContinueNumbering = function () { return "off" != this.showQuestionNumbers && "onpanel" != this.showQuestionNumbers }, t.prototype.notifySurveyOnVisibilityChanged = function () { null == this.survey || this.isLoadingFromJson || this.survey.panelVisibilityChanged(this, this.isVisible) }, t.prototype.hasErrorsCore = function (t) { e.prototype.hasErrorsCore.call(this, t), this.isCollapsed && t.result && t.fireCallback && this.expand() }, t.prototype.getRenderedTitle = function (t) { if (!t) { if (this.isCollapsed || this.isExpanded) return this.name; if (this.isDesignMode) return "[" + this.name + "]" } return e.prototype.getRenderedTitle.call(this, t) }, Object.defineProperty(t.prototype, "innerIndent", { get: function () { return this.getPropertyValue("innerIndent") }, set: function (e) { this.setPropertyValue("innerIndent", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "startWithNewLine", { get: function () { return this.getPropertyValue("startWithNewLine") }, set: function (e) { this.setPropertyValue("startWithNewLine", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "allowAdaptiveActions", { get: function () { return this.getPropertyValue("allowAdaptiveActions") }, set: function (e) { this.setPropertyValue("allowAdaptiveActions", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "innerPaddingLeft", { get: function () { return this.getPropertyValue("innerPaddingLeft", "") }, set: function (e) { this.setPropertyValue("innerPaddingLeft", e) }, enumerable: !1, configurable: !0 }), t.prototype.onIndentChanged = function () { this.getSurvey() && (this.innerPaddingLeft = this.getIndentSize(this.innerIndent), this.paddingLeft = this.getIndentSize(this.indent), this.paddingRight = this.getIndentSize(this.rightIndent)) }, t.prototype.getIndentSize = function (e) { if (e < 1) return ""; var t = this.survey.css; return t && t.question.indent ? e * t.question.indent + "px" : "" }, t.prototype.clearOnDeletingContainer = function () { this.elements.forEach((function (e) { (e instanceof $t || e instanceof t) && e.clearOnDeletingContainer() })) }, Object.defineProperty(t.prototype, "footerActions", { get: function () { return this.getPropertyValue("footerActions") }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "footerToolbarCss", { get: function () { var e; return this.footerToolbarCssValue || (null === (e = this.cssClasses.panel) || void 0 === e ? void 0 : e.footer) }, set: function (e) { this.footerToolbarCssValue = e }, enumerable: !1, configurable: !0 }), t.prototype.getFooterToolbar = function () { var e, t = this; if (!this.footerToolbarValue) { var n = this.footerActions; this.hasEditButton && n.push({ id: "cancel-preview", title: this.survey.editText, innerCss: this.survey.cssNavigationEdit, action: function () { t.cancelPreview() } }), n = this.onGetFooterActionsCallback ? this.onGetFooterActionsCallback() : null === (e = this.survey) || void 0 === e ? void 0 : e.getUpdatedPanelFooterActions(this, n), this.footerToolbarValue = this.createActionContainer(this.allowAdaptiveActions), this.footerToolbarValue.containerCss = this.footerToolbarCss, this.footerToolbarValue.setItems(n) } return this.footerToolbarValue }, Object.defineProperty(t.prototype, "hasEditButton", { get: function () { return !(!this.survey || "preview" !== this.survey.state) && 1 === this.depth }, enumerable: !1, configurable: !0 }), t.prototype.cancelPreview = function () { this.hasEditButton && this.survey.cancelPreviewByPage(this) }, Object.defineProperty(t.prototype, "cssTitle", { get: function () { return (new at).append(this.cssClasses.panel.title).append(this.cssClasses.panel.titleExpandable, "default" !== this.state).append(this.cssClasses.panel.titleExpanded, this.isExpanded).append(this.cssClasses.panel.titleCollapsed, this.isCollapsed).append(this.cssClasses.panel.titleDisabled, this.isReadOnly).append(this.cssClasses.panel.titleOnError, this.containsErrors).toString() }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "cssError", { get: function () { return this.getCssError(this.cssClasses) }, enumerable: !1, configurable: !0 }), t.prototype.getCssError = function (e) { var t = (new at).append(this.cssClasses.error.root); return t.append("panel-error-root", t.isEmpty()).toString() }, t.prototype.onVisibleChanged = function () { e.prototype.onVisibleChanged.call(this), this.notifySurveyOnVisibilityChanged() }, t.prototype.needResponsiveWidth = function () { return !this.startWithNewLine || e.prototype.needResponsiveWidth.call(this) }, t.prototype.focusIn = function () { this.survey && this.survey.whenPanelFocusIn(this) }, t.prototype.getContainerCss = function () { return (new at).append(this.cssClasses.panel.container).append(this.cssClasses.panel.withFrame, this.hasFrameV2).append(this.cssClasses.panel.nested, !(!(this.parent && this.parent.isPanel || !this.isSingleInRow) || this.isDesignMode)).append(this.cssClasses.panel.collapsed, !!this.isCollapsed).append(this.cssClasses.panel.expanded, !!this.isExpanded).append(this.cssClasses.panel.invisible, !this.isDesignMode && this.areInvisibleElementsShowing && !this.visible).toString() }, t }(Go); _.addClass("panelbase", ["name", { name: "elements", alternativeName: "questions", baseClassName: "question", visible: !1, isLightSerializable: !1 }, { name: "visible:switch", default: !0 }, "visibleIf:condition", "enableIf:condition", "requiredIf:condition", "readOnly:boolean", { name: "questionTitleLocation", default: "default", choices: ["default", "top", "bottom", "left", "hidden"] }, { name: "title:text", serializationProperty: "locTitle" }, { name: "description:text", serializationProperty: "locDescription" }, { name: "questionsOrder", default: "default", choices: ["default", "initial", "random"] }], (function () { return new Go })), _.addClass("panel", [{ name: "state", default: "default", choices: ["default", "collapsed", "expanded"] }, "isRequired:switch", { name: "requiredErrorText:text", serializationProperty: "locRequiredErrorText" }, { name: "startWithNewLine:boolean", default: !0 }, "width", { name: "minWidth", defaultFunc: function () { return "auto" } }, { name: "maxWidth", defaultFunc: function () { return o.maxWidth } }, { name: "innerIndent:number", default: 0, choices: [0, 1, 2, 3] }, { name: "indent:number", default: 0, choices: [0, 1, 2, 3] }, { name: "page", isSerializable: !1, visibleIf: function (e) { var t = e ? e.survey : null; return !t || !t.pages || t.pages.length > 1 }, choices: function (e) { var t = e ? e.survey : null; return t ? t.pages.map((function (e) { return { value: e.name, text: e.title } })) : [] } }, "showNumber:boolean", { name: "showQuestionNumbers", default: "default", choices: ["default", "onpanel", "off"] }, "questionStartIndex", { name: "allowAdaptiveActions:boolean", default: !0, visible: !1 }], (function () { return new $o }), "panelbase"), sn.Instance.registerElement("panel", (function (e) { return new $o(e) })); var Ko = function () { var e = function (t, n) { return (e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (e, t) { e.__proto__ = t } || function (e, t) { for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]) })(t, n) }; return function (t, n) { if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null"); function o() { this.constructor = t } e(t, n), t.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o) } }(), Xo = function (e) { function t(t) { void 0 === t && (t = ""); var n = e.call(this, t) || this; return n.createLocalizableString("content", n, !0), n.registerPropertyChangedHandlers(["content"], (function () { n.onContentChanged() })), n } return Ko(t, e), t.prototype.getType = function () { return "flowpanel" }, t.prototype.getChildrenLayoutType = function () { return "flow" }, t.prototype.onSurveyLoad = function () { e.prototype.onSurveyLoad.call(this), this.onContentChanged() }, Object.defineProperty(t.prototype, "content", { get: function () { return this.getLocalizableStringText("content") }, set: function (e) { this.setLocalizableStringText("content", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "locContent", { get: function () { return this.getLocalizableString("content") }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "html", { get: function () { return this.getPropertyValue("html", "") }, set: function (e) { this.setPropertyValue("html", e) }, enumerable: !1, configurable: !0 }), t.prototype.onContentChanged = function () { var e = ""; e = this.onCustomHtmlProducing ? this.onCustomHtmlProducing() : this.produceHtml(), this.html = e, this.contentChangedCallback && this.contentChangedCallback() }, t.prototype.produceHtml = function () { for (var e = [], t = /{(.*?(element:)[^$].*?)}/g, n = this.content, o = 0, r = null; null !== (r = t.exec(n));) { r.index > o && (e.push(n.substring(o, r.index)), o = r.index); var i = this.getQuestionFromText(r[0]); i ? e.push(this.getHtmlForQuestion(i)) : e.push(n.substring(o, r.index + r[0].length)), o = r.index + r[0].length } return o < n.length && e.push(n.substring(o, n.length)), e.join("").replace(new RegExp("<br>", "g"), "<br/>") }, t.prototype.getQuestionFromText = function (e) { return e = (e = e.substring(1, e.length - 1)).replace(t.contentElementNamePrefix, "").trim(), this.getQuestionByName(e) }, t.prototype.getHtmlForQuestion = function (e) { return this.onGetHtmlForQuestion ? this.onGetHtmlForQuestion(e) : "" }, t.prototype.getQuestionHtmlId = function (e) { return this.name + "_" + e.id }, t.prototype.onAddElement = function (t, n) { e.prototype.onAddElement.call(this, t, n), this.addElementToContent(t), t.renderWidth = "" }, t.prototype.onRemoveElement = function (t) { var n = this.getElementContentText(t); this.content = this.content.replace(n, ""), e.prototype.onRemoveElement.call(this, t) }, t.prototype.dragDropMoveElement = function (e, t, n) { }, t.prototype.addElementToContent = function (e) { if (!this.isLoadingFromJson) { var t = this.getElementContentText(e); this.insertTextAtCursor(t) || (this.content = this.content + t) } }, t.prototype.insertTextAtCursor = function (e, t) { if (void 0 === t && (t = null), !this.isDesignMode || "undefined" == typeof document || !window.getSelection) return !1; var n = window.getSelection(); if (n.getRangeAt && n.rangeCount) { var o = n.getRangeAt(0); o.deleteContents(), o.insertNode(document.createTextNode(e)); if (this.getContent) { var r = this.getContent(t); this.content = r } return !0 } return !1 }, t.prototype.getElementContentText = function (e) { return "{" + t.contentElementNamePrefix + e.name + "}" }, t.contentElementNamePrefix = "element:", t }($o); _.addClass("flowpanel", [{ name: "content:html", serializationProperty: "locContent" }], (function () { return new Xo }), "panel"); var Yo = function () { var e = function (t, n) { return (e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (e, t) { e.__proto__ = t } || function (e, t) { for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]) })(t, n) }; return function (t, n) { if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null"); function o() { this.constructor = t } e(t, n), t.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o) } }(), Zo = function (e, t, n, o) { var r, i = arguments.length, s = i < 3 ? t : null === o ? o = Object.getOwnPropertyDescriptor(t, n) : o; if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) s = Reflect.decorate(e, t, n, o); else for (var a = e.length - 1; a >= 0; a--)(r = e[a]) && (s = (i < 3 ? r(s) : i > 3 ? r(t, n, s) : r(t, n)) || s); return i > 3 && s && Object.defineProperty(t, n, s), s }, er = function (e) { function t(t) { void 0 === t && (t = ""); var n = e.call(this, t) || this; return n.hasShownValue = !1, n.timeSpent = 0, n.locTitle.onGetTextCallback = function (e) { return n.canShowPageNumber() && e ? n.num + ". " + e : e }, n.createLocalizableString("navigationTitle", n, !0), n.createLocalizableString("navigationDescription", n, !0), n } return Yo(t, e), t.prototype.getType = function () { return "page" }, t.prototype.toString = function () { return this.name }, Object.defineProperty(t.prototype, "isPage", { get: function () { return !0 }, enumerable: !1, configurable: !0 }), t.prototype.canShowPageNumber = function () { return this.survey && this.survey.showPageNumbers }, t.prototype.canShowTitle = function () { return this.survey && this.survey.showPageTitles }, Object.defineProperty(t.prototype, "navigationTitle", { get: function () { return this.getLocalizableStringText("navigationTitle") }, set: function (e) { this.setLocalizableStringText("navigationTitle", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "locNavigationTitle", { get: function () { return this.getLocalizableString("navigationTitle") }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "navigationDescription", { get: function () { return this.getLocalizableStringText("navigationDescription") }, set: function (e) { this.setLocalizableStringText("navigationDescription", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "locNavigationDescription", { get: function () { return this.getLocalizableString("navigationDescription") }, enumerable: !1, configurable: !0 }), t.prototype.navigationLocStrChanged = function () { this.locNavigationTitle.strChanged(), this.locNavigationDescription.strChanged() }, Object.defineProperty(t.prototype, "passed", { get: function () { return this.getPropertyValue("passed", !1) }, set: function (e) { this.setPropertyValue("passed", e) }, enumerable: !1, configurable: !0 }), t.prototype.delete = function () { this.survey && this.removeSelfFromList(this.survey.pages) }, t.prototype.onFirstRendering = function () { this.wasShown || e.prototype.onFirstRendering.call(this) }, Object.defineProperty(t.prototype, "visibleIndex", { get: function () { return this.getPropertyValue("visibleIndex", -1) }, set: function (e) { this.setPropertyValue("visibleIndex", e) }, enumerable: !1, configurable: !0 }), t.prototype.canRenderFirstRows = function () { return !this.isDesignMode || 0 == this.visibleIndex }, Object.defineProperty(t.prototype, "isStartPage", { get: function () { return this.survey && this.survey.isPageStarted(this) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "isStarted", { get: function () { return this.isStartPage }, enumerable: !1, configurable: !0 }), t.prototype.calcCssClasses = function (e) { var t = { page: {}, pageTitle: "", pageDescription: "", row: "", rowMultiple: "", pageRow: "" }; return this.copyCssClasses(t.page, e.page), e.pageTitle && (t.pageTitle = e.pageTitle), e.pageDescription && (t.pageDescription = e.pageDescription), e.row && (t.row = e.row), e.pageRow && (t.pageRow = e.pageRow), e.rowMultiple && (t.rowMultiple = e.rowMultiple), this.survey && this.survey.updatePageCssClasses(this, t), t }, Object.defineProperty(t.prototype, "cssTitle", { get: function () { return this.cssClasses.page ? (new at).append(this.cssClasses.page.title).toString() : "" }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "cssRoot", { get: function () { return this.cssClasses.page && this.survey ? (new at).append(this.cssClasses.page.root).append(this.cssClasses.page.emptyHeaderRoot, !(this.survey.renderedHasHeader || this.survey.isShowProgressBarOnTop && !this.survey.isStaring)).toString() : "" }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "navigationButtonsVisibility", { get: function () { return this.getPropertyValue("navigationButtonsVisibility") }, set: function (e) { this.setPropertyValue("navigationButtonsVisibility", e.toLowerCase()) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "isActive", { get: function () { return !!this.survey && this.survey.currentPage === this }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "wasShown", { get: function () { return this.hasShownValue }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "hasShown", { get: function () { return this.wasShown }, enumerable: !1, configurable: !0 }), t.prototype.setWasShown = function (e) { if (e != this.hasShownValue && (this.hasShownValue = e, !this.isDesignMode && !0 === e)) { for (var t = this.elements, n = 0; n < t.length; n++)t[n].isPanel && t[n].randomizeElements(this.areQuestionsRandomized); this.randomizeElements(this.areQuestionsRandomized) } }, t.prototype.scrollToTop = function () { this.survey && this.survey.scrollElementToTop(this, null, this, this.id) }, t.prototype.getAllPanels = function (e, t) { void 0 === e && (e = !1), void 0 === t && (t = !1); var n = new Array; return this.addPanelsIntoList(n, e, t), n }, t.prototype.getPanels = function (e, t) { return void 0 === e && (e = !1), void 0 === t && (t = !1), this.getAllPanels(e, t) }, Object.defineProperty(t.prototype, "maxTimeToFinish", { get: function () { return this.getPropertyValue("maxTimeToFinish", 0) }, set: function (e) { this.setPropertyValue("maxTimeToFinish", e) }, enumerable: !1, configurable: !0 }), t.prototype.onNumChanged = function (e) { }, t.prototype.onVisibleChanged = function () { this.isRandomizing || (e.prototype.onVisibleChanged.call(this), null != this.survey && this.survey.pageVisibilityChanged(this, this.isVisible)) }, t.prototype.getDragDropInfo = function () { return this.dragDropInfo }, t.prototype.dragDropStart = function (e, t, n) { void 0 === n && (n = -1), this.dragDropInfo = new Wo(e, t, n) }, t.prototype.dragDropMoveTo = function (e, t, n) { if (void 0 === t && (t = !1), void 0 === n && (n = !1), !this.dragDropInfo) return !1; if (this.dragDropInfo.destination = e, this.dragDropInfo.isBottom = t, this.dragDropInfo.isEdge = n, this.correctDragDropInfo(this.dragDropInfo), !this.dragDropCanDropTagert()) return !1; if (!this.dragDropCanDropSource() || !this.dragDropAllowFromSurvey()) { if (this.dragDropInfo.source) { var o = this.dragDropFindRow(this.dragDropInfo.target); this.updateRowsRemoveElementFromRow(this.dragDropInfo.target, o) } return !1 } return this.dragDropAddTarget(this.dragDropInfo), !0 }, t.prototype.correctDragDropInfo = function (e) { if (e.destination) { var t = e.destination.isPanel ? e.destination : null; t && (e.target.isLayoutTypeSupported(t.getChildrenLayoutType()) || (e.isEdge = !0)) } }, t.prototype.dragDropAllowFromSurvey = function () { var e = this.dragDropInfo.destination; if (!e || !this.survey) return !0; var t = null, n = null, o = e.isPage || !this.dragDropInfo.isEdge && e.isPanel ? e : e.parent; if (!e.isPage) { var r = e.parent; if (r) { var i = r.elements, s = i.indexOf(e); s > -1 && (t = e, n = e, this.dragDropInfo.isBottom ? t = s < i.length - 1 ? i[s + 1] : null : n = s > 0 ? i[s - 1] : null) } } var a = { target: this.dragDropInfo.target, source: this.dragDropInfo.source, parent: o, insertAfter: n, insertBefore: t }; return this.survey.dragAndDropAllow(a) }, t.prototype.dragDropFinish = function (e) { if (void 0 === e && (e = !1), this.dragDropInfo) { var t = this.dragDropInfo.target, n = this.dragDropInfo.source, r = this.dragDropInfo.destination, i = this.dragDropFindRow(t), s = this.dragDropGetElementIndex(t, i); this.updateRowsRemoveElementFromRow(t, i); var a = [], l = []; if (!e && i) { if (this.isDesignMode && o.supportCreatorV2) { var u = n && n.parent && n.parent.dragDropFindRow(n); i.panel.elements[s] && i.panel.elements[s].startWithNewLine && i.elements.length > 1 && i.panel.elements[s] === r && (a.push(t), l.push(i.panel.elements[s])), !(t.startWithNewLine && i.elements.length > 1) || i.panel.elements[s] && i.panel.elements[s].startWithNewLine || l.push(t), u && u.elements[0] === n && u.elements[1] && a.push(u.elements[1]), i.elements.length <= 1 && a.push(t), t.startWithNewLine && i.elements.length > 1 && i.elements[0] !== r && l.push(t) } n && n.parent && (this.survey.startMovingQuestion(), i.panel == n.parent ? (i.panel.dragDropMoveElement(n, t, s), s = -1) : n.parent.removeElement(n)), s > -1 && i.panel.addElement(t, s), this.survey.stopMovingQuestion() } return a.map((function (e) { e.startWithNewLine = !0 })), l.map((function (e) { e.startWithNewLine = !1 })), this.dragDropInfo = null, e ? null : t } }, t.prototype.dragDropGetElementIndex = function (e, t) { if (!t) return -1; var n = t.elements.indexOf(e); if (0 == t.index) return n; var o = t.panel.rows[t.index - 1], r = o.elements[o.elements.length - 1]; return n + t.panel.elements.indexOf(r) + 1 }, t.prototype.dragDropCanDropTagert = function () { var e = this.dragDropInfo.destination; return !(e && !e.isPage) || this.dragDropCanDropCore(this.dragDropInfo.target, e) }, t.prototype.dragDropCanDropSource = function () { var e = this.dragDropInfo.source; if (!e) return !0; var t = this.dragDropInfo.destination; if (!this.dragDropCanDropCore(e, t)) return !1; if (this.isDesignMode && o.supportCreatorV2) { if (this.dragDropFindRow(e) !== this.dragDropFindRow(t)) { if (!e.startWithNewLine && t.startWithNewLine) return !0; if (e.startWithNewLine && !t.startWithNewLine) return !0 } var n = this.dragDropFindRow(t); if (n && 1 == n.elements.length) return !0 } return this.dragDropCanDropNotNext(e, t, this.dragDropInfo.isEdge, this.dragDropInfo.isBottom) }, t.prototype.dragDropCanDropCore = function (e, t) { if (!t) return !0; if (this.dragDropIsSameElement(t, e)) return !1; if (e.isPanel) { var n = e; if (n.containsElement(t) || n.getElementByName(t.name)) return !1 } return !0 }, t.prototype.dragDropCanDropNotNext = function (e, t, n, o) { if (!t || t.isPanel && !n) return !0; if (void 0 === e.parent || e.parent !== t.parent) return !0; var r = e.parent, i = r.elements.indexOf(e), s = r.elements.indexOf(t); return s < i && !o && s--, o && s++, i < s ? s - i > 1 : i - s > 0 }, t.prototype.dragDropIsSameElement = function (e, t) { return e == t || e.name == t.name }, t.prototype.ensureRowsVisibility = function () { e.prototype.ensureRowsVisibility.call(this), this.getPanels().forEach((function (e) { return e.ensureRowsVisibility() })) }, Zo([f({ defaultValue: -1, onSet: function (e, t) { return t.onNumChanged(e) } })], t.prototype, "num", void 0), t }(Go); _.addClass("page", [{ name: "navigationButtonsVisibility", default: "inherit", choices: ["inherit", "show", "hide"] }, { name: "maxTimeToFinish:number", default: 0, minValue: 0 }, { name: "navigationTitle", visibleIf: function (e) { return !!e.survey && "buttons" === e.survey.progressBarType }, serializationProperty: "locNavigationTitle" }, { name: "navigationDescription", visibleIf: function (e) { return !!e.survey && "buttons" === e.survey.progressBarType }, serializationProperty: "locNavigationDescription" }, { name: "title:text", serializationProperty: "locTitle" }, { name: "description:text", serializationProperty: "locDescription" }], (function () { return new er }), "panelbase"); var tr = function () { function e() { } return e.getIconCss = function (e, t) { return (new at).append(e.icon).append(e.iconExpanded, !t).toString() }, e }(), nr = function () { var e = function (t, n) { return (e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (e, t) { e.__proto__ = t } || function (e, t) { for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]) })(t, n) }; return function (t, n) { if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null"); function o() { this.constructor = t } e(t, n), t.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o) } }(), or = function (e) { function t(t) { return e.call(this, t) || this } return nr(t, e), t.prototype.getType = function () { return "nonvalue" }, Object.defineProperty(t.prototype, "hasInput", { get: function () { return !1 }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "hasTitle", { get: function () { return !1 }, enumerable: !1, configurable: !0 }), t.prototype.getTitleLocation = function () { return "" }, Object.defineProperty(t.prototype, "hasComment", { get: function () { return !1 }, enumerable: !1, configurable: !0 }), t.prototype.hasErrors = function (e, t) { return void 0 === e && (e = !0), void 0 === t && (t = null), !1 }, t.prototype.getAllErrors = function () { return [] }, t.prototype.supportGoNextPageAutomatic = function () { return !1 }, t.prototype.addConditionObjectsByContext = function (e, t) { }, t.prototype.getConditionJson = function (e, t) { return void 0 === e && (e = null), void 0 === t && (t = null), null }, t }($t); _.addClass("nonvalue", [{ name: "title", visible: !1 }, { name: "description", visible: !1 }, { name: "valueName", visible: !1 }, { name: "enableIf", visible: !1 }, { name: "defaultValue", visible: !1 }, { name: "correctAnswer", visible: !1 }, { name: "clearIfInvisible", visible: !1 }, { name: "isRequired", visible: !1, isSerializable: !1 }, { name: "requiredErrorText", visible: !1 }, { name: "readOnly", visible: !1 }, { name: "requiredIf", visible: !1 }, { name: "validators", visible: !1 }, { name: "titleLocation", visible: !1 }, { name: "showCommentArea", visible: !1 }, { name: "useDisplayValuesInDynamicTexts", alternativeName: "useDisplayValuesInTitle", visible: !1 }], (function () { return new or("") }), "question"); var rr = function () { var e = function (t, n) { return (e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (e, t) { e.__proto__ = t } || function (e, t) { for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]) })(t, n) }; return function (t, n) { if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null"); function o() { this.constructor = t } e(t, n), t.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o) } }(), ir = function (e) { function t(t) { return e.call(this, t) || this } return rr(t, e), t.prototype.getType = function () { return "empty" }, t }($t); _.addClass("empty", [], (function () { return new ir("") }), "question"); var sr = function () { var e = function (t, n) { return (e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (e, t) { e.__proto__ = t } || function (e, t) { for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]) })(t, n) }; return function (t, n) { if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null"); function o() { this.constructor = t } e(t, n), t.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o) } }(), ar = function (e) { function t(t) { var n = e.call(this, t) || this; n.selectAllItemValue = new qe("selectall"), n.invisibleOldValues = {}, n.isChangingValueOnClearIncorrect = !1; var o = n.createLocalizableString("selectAllText", n.selectAllItem, !0, "selectAllItemText"); return n.selectAllItem.locOwner = n, n.selectAllItem.setLocText(o), n.registerPropertyChangedHandlers(["showSelectAllItem", "selectAllText"], (function () { n.onVisibleChoicesChanged() })), n } return sr(t, e), t.prototype.getDefaultItemComponent = function () { return "survey-checkbox-item" }, Object.defineProperty(t.prototype, "ariaRole", { get: function () { return "listbox" }, enumerable: !1, configurable: !0 }), t.prototype.getType = function () { return "checkbox" }, t.prototype.onCreating = function () { e.prototype.onCreating.call(this), this.createNewArray("renderedValue"), this.createNewArray("value") }, t.prototype.getFirstInputElementId = function () { return this.inputId + "_0" }, Object.defineProperty(t.prototype, "valuePropertyName", { get: function () { return this.getPropertyValue("valuePropertyName") }, set: function (e) { this.setPropertyValue("valuePropertyName", e) }, enumerable: !1, configurable: !0 }), t.prototype.getQuestionFromArray = function (e, t) { if (e && e === this.valuePropertyName) { var n = this.value; if (Array.isArray(n) && t < n.length) return this } return null }, Object.defineProperty(t.prototype, "selectAllItem", { get: function () { return this.selectAllItemValue }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "selectAllText", { get: function () { return this.getLocalizableStringText("selectAllText") }, set: function (e) { this.setLocalizableStringText("selectAllText", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "locSelectAllText", { get: function () { return this.getLocalizableString("selectAllText") }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "showSelectAllItem", { get: function () { return this.getPropertyValue("showSelectAllItem", !1) }, set: function (e) { this.setPropertyValue("showSelectAllItem", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "hasSelectAll", { get: function () { return this.showSelectAllItem }, set: function (e) { this.showSelectAllItem = e }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "isAllSelected", { get: function () { var e = this.value; if (!e || !Array.isArray(e)) return !1; if (this.isItemSelected(this.noneItem)) return !1; var t = this.visibleChoices.length; this.hasOther && t--, this.hasNone && t--, this.hasSelectAll && t--; var n = e.length; return this.isOtherSelected && n--, n === t }, set: function (e) { e ? this.selectAll() : this.clearValue() }, enumerable: !1, configurable: !0 }), t.prototype.toggleSelectAll = function () { this.isAllSelected = !this.isAllSelected }, t.prototype.selectAll = function () { for (var e = [], t = 0; t < this.visibleChoices.length; t++) { var n = this.visibleChoices[t]; n !== this.noneItem && n !== this.otherItem && n !== this.selectAllItem && e.push(n.value) } this.renderedValue = e }, t.prototype.isItemSelectedCore = function (e) { if (e === this.selectAllItem) return this.isAllSelected; var t = this.renderedValue; if (!t || !Array.isArray(t)) return !1; for (var n = 0; n < t.length; n++)if (this.isTwoValueEquals(t[n], e.value)) return !0; return !1 }, t.prototype.getRealValue = function (e) { return e && this.valuePropertyName ? e[this.valuePropertyName] : e }, Object.defineProperty(t.prototype, "maxSelectedChoices", { get: function () { return this.getPropertyValue("maxSelectedChoices") }, set: function (e) { e < 0 && (e = 0), this.setPropertyValue("maxSelectedChoices", e), this.filterItems() }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "selectedChoices", { get: function () { var e = this.selectedItemValues; if (this.isEmpty()) return []; var t = this.renderedValue, n = this.initialSelectedItemValues ? [].concat(this.initialSelectedItemValues, this.visibleChoices) : this.visibleChoices, o = t.map((function (e) { return qe.getItemByValue(n, e) })).filter((function (e) { return !!e })); return o.length || e || this.updateSelectedItemValues(), o.length ? o : e && e.length ? (this.initialSelectedItemValues = [].concat(e), e) : t.map((function (e) { return new qe(e) })) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "selectedItems", { get: function () { return this.selectedChoices }, enumerable: !1, configurable: !0 }), t.prototype.onEnableItemCallBack = function (e) { return !this.shouldCheckMaxSelectedChoices() || this.isItemSelected(e) }, t.prototype.onAfterRunItemsEnableCondition = function () { if (this.maxSelectedChoices < 1) return this.selectAllItem.setIsEnabled(!0), void this.otherItem.setIsEnabled(!0); this.hasSelectAll && this.selectAllItem.setIsEnabled(this.maxSelectedChoices >= this.activeChoices.length), this.hasOther && this.otherItem.setIsEnabled(!this.shouldCheckMaxSelectedChoices() || this.isOtherSelected) }, t.prototype.shouldCheckMaxSelectedChoices = function () { if (this.maxSelectedChoices < 1) return !1; var e = this.value; return (Array.isArray(e) ? e.length : 0) >= this.maxSelectedChoices }, t.prototype.getItemClassCore = function (t, n) { this.value; return n.isSelectAllItem = t === this.selectAllItem, (new at).append(e.prototype.getItemClassCore.call(this, t, n)).append(this.cssClasses.itemSelectAll, n.isSelectAllItem).toString() }, t.prototype.updateValueFromSurvey = function (t) { e.prototype.updateValueFromSurvey.call(this, t), this.invisibleOldValues = {} }, t.prototype.setDefaultValue = function () { e.prototype.setDefaultValue.call(this); var t = this.defaultValue; if (Array.isArray(t)) for (var n = 0; n < t.length; n++) { var o = this.getRealValue(t[n]); this.canClearValueAnUnknow(o) && this.addIntoInvisibleOldValues(o) } }, t.prototype.addIntoInvisibleOldValues = function (e) { this.invisibleOldValues[e] = e }, t.prototype.hasValueToClearIncorrectValues = function () { return e.prototype.hasValueToClearIncorrectValues.call(this) || !r.isValueEmpty(this.invisibleOldValues) }, t.prototype.setNewValue = function (t) { this.isChangingValueOnClearIncorrect || (this.invisibleOldValues = {}), t = this.valueFromData(t); var n = this.value; if (t || (t = []), n || (n = []), !this.isTwoValueEquals(n, t)) { if (this.hasNone) { var o = this.noneIndexInArray(n), r = this.noneIndexInArray(t); o > -1 ? r > -1 && t.length > 1 && t.splice(r, 1) : r > -1 && (t.splice(0, t.length), t.push(this.noneItem.value)) } e.prototype.setNewValue.call(this, t) } }, t.prototype.getIsMultipleValue = function () { return !0 }, t.prototype.getCommentFromValue = function (e) { var t = this.getFirstUnknownIndex(e); return t < 0 ? "" : e[t] }, t.prototype.setOtherValueIntoValue = function (e) { var t = this.getFirstUnknownIndex(e); return t < 0 || e.splice(t, 1, this.otherItem.value), e }, t.prototype.getFirstUnknownIndex = function (e) { if (!Array.isArray(e)) return -1; for (var t = 0; t < e.length; t++)if (this.hasUnknownValue(e[t], !1, !1)) return t; return -1 }, t.prototype.noneIndexInArray = function (e) { if (!e || !Array.isArray(e)) return -1; for (var t = this.noneItem.value, n = 0; n < e.length; n++)if (e[n] == t) return n; return -1 }, t.prototype.canUseFilteredChoices = function () { return !this.hasSelectAll && e.prototype.canUseFilteredChoices.call(this) }, t.prototype.supportSelectAll = function () { return this.isSupportProperty("showSelectAllItem") }, t.prototype.addToVisibleChoices = function (t, n) { this.supportSelectAll() && this.canShowOptionItem(this.selectAllItem, n, this.hasSelectAll) && t.unshift(this.selectAllItem), e.prototype.addToVisibleChoices.call(this, t, n) }, t.prototype.isHeadChoice = function (e, t) { return e === t.selectAllItem }, t.prototype.isItemInList = function (t) { return t == this.selectAllItem ? this.hasSelectAll : e.prototype.isItemInList.call(this, t) }, t.prototype.getDisplayValueCore = function (t, n) { if (!Array.isArray(n)) return e.prototype.getDisplayValueCore.call(this, t, n); var o = this.valuePropertyName; return this.getDisplayArrayValue(t, n, (function (e) { var t = n[e]; return o && t[o] && (t = t[o]), t })) }, t.prototype.clearIncorrectValuesCore = function () { this.clearIncorrectAndDisabledValues(!1) }, t.prototype.clearDisabledValuesCore = function () { this.clearIncorrectAndDisabledValues(!0) }, t.prototype.clearIncorrectAndDisabledValues = function (e) { var t = this.value, n = !1, o = this.restoreValuesFromInvisible(); if (t || 0 != o.length) { if (!Array.isArray(t) || 0 == t.length) { if (this.isChangingValueOnClearIncorrect = !0, e || (this.hasComment ? this.value = null : this.clearValue()), this.isChangingValueOnClearIncorrect = !1, 0 == o.length) return; t = [] } for (var r = [], i = 0; i < t.length; i++) { var s = this.getRealValue(t[i]), a = this.canClearValueAnUnknow(s); !e && !a || e && !this.isValueDisabled(s) ? r.push(t[i]) : (n = !0, a && this.addIntoInvisibleOldValues(t[i])) } for (i = 0; i < o.length; i++)r.push(o[i]), n = !0; n && (this.isChangingValueOnClearIncorrect = !0, 0 == r.length ? this.clearValue() : this.value = r, this.isChangingValueOnClearIncorrect = !1) } }, t.prototype.restoreValuesFromInvisible = function () { for (var e = [], t = this.visibleChoices, n = 0; n < t.length; n++) { var o = t[n].value; r.isTwoValueEquals(o, this.invisibleOldValues[o]) && (this.isItemSelected(t[n]) || e.push(o), delete this.invisibleOldValues[o]) } return e }, t.prototype.getConditionJson = function (t, n) { void 0 === t && (t = null), void 0 === n && (n = null); var o = e.prototype.getConditionJson.call(this); return "contains" != t && "notcontains" != t || (o.type = "radiogroup"), o }, t.prototype.isAnswerCorrect = function () { return r.isArrayContainsEqual(this.value, this.correctAnswer) }, t.prototype.setDefaultValueWithOthers = function () { this.value = this.renderedValueFromDataCore(this.defaultValue) }, t.prototype.getIsItemValue = function (e, t) { return !(!e || !Array.isArray(e)) && e.indexOf(t.value) >= 0 }, t.prototype.valueFromData = function (t) { if (!t) return t; if (!Array.isArray(t)) return [e.prototype.valueFromData.call(this, t)]; for (var n = [], o = 0; o < t.length; o++) { var r = qe.getItemByValue(this.activeChoices, t[o]); r ? n.push(r.value) : n.push(t[o]) } return n }, t.prototype.rendredValueFromData = function (t) { return t = this.convertValueFromObject(t), e.prototype.rendredValueFromData.call(this, t) }, t.prototype.rendredValueToData = function (t) { return t = e.prototype.rendredValueToData.call(this, t), this.convertValueToObject(t) }, t.prototype.convertValueFromObject = function (e) { return this.valuePropertyName ? r.convertArrayObjectToValue(e, this.valuePropertyName) : e }, t.prototype.convertValueToObject = function (e) { if (!this.valuePropertyName) return e; var t = void 0; return this.survey && this.survey.questionCountByValueName(this.getValueName()) > 1 && (t = this.data.getValue(this.getValueName())), r.convertArrayValueToObject(e, this.valuePropertyName, t) }, t.prototype.renderedValueFromDataCore = function (e) { if (e && Array.isArray(e) || (e = []), !this.hasActiveChoices) return e; for (var t = 0; t < e.length; t++) { if (e[t] == this.otherItem.value) return e; if (this.hasUnknownValue(e[t], !0, !1)) { this.otherValue = e[t]; var n = e.slice(); return n[t] = this.otherItem.value, n } } return e }, t.prototype.rendredValueToDataCore = function (e) { if (!e || !e.length) return e; for (var t = 0; t < e.length; t++)if (e[t] == this.otherItem.value && this.needConvertRenderedOtherToDataValue()) { var n = e.slice(); return n[t] = this.otherValue, n } return e }, t.prototype.selectOtherValueFromComment = function (e) { var t = [], n = this.renderedValue; if (Array.isArray(n)) for (var o = 0; o < n.length; o++)n[o] !== this.otherItem.value && t.push(n[o]); e && t.push(this.otherItem.value), this.value = t }, Object.defineProperty(t.prototype, "checkBoxSvgPath", { get: function () { return "M5,13l2-2l3,3l7-7l2,2l-9,9L5,13z" }, enumerable: !1, configurable: !0 }), t }(Co); _.addClass("checkbox", [{ name: "showSelectAllItem:boolean", alternativeName: "hasSelectAll" }, { name: "separateSpecialChoices", visible: !0 }, { name: "maxSelectedChoices:number", default: 0 }, { name: "selectAllText", serializationProperty: "locSelectAllText", dependsOn: "showSelectAllItem", visibleIf: function (e) { return e.hasSelectAll } }, { name: "valuePropertyName", category: "data" }, { name: "itemComponent", visible: !1, default: "survey-checkbox-item" }], (function () { return new ar("") }), "checkboxbase"), rn.Instance.registerQuestion("checkbox", (function (e) { var t = new ar(e); return t.choices = rn.DefaultChoices, t })); var lr = function () { var e = function (t, n) { return (e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (e, t) { e.__proto__ = t } || function (e, t) { for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]) })(t, n) }; return function (t, n) { if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null"); function o() { this.constructor = t } e(t, n), t.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o) } }(), ur = function (e, t, n, o) { var r, i = arguments.length, s = i < 3 ? t : null === o ? o = Object.getOwnPropertyDescriptor(t, n) : o; if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) s = Reflect.decorate(e, t, n, o); else for (var a = e.length - 1; a >= 0; a--)(r = e[a]) && (s = (i < 3 ? r(s) : i > 3 ? r(t, n, s) : r(t, n)) || s); return i > 3 && s && Object.defineProperty(t, n, s), s }, cr = function (e) { function t(t, n, o, r, i) { var s = e.call(this, t, n, o, void 0, i) || this; return s.onItemClick = function (e) { s.isExpanded = !1, s.isItemSelected(e) ? (s.selectedItems.splice(s.selectedItems.indexOf(e), 1)[0], s.onSelectionChanged && s.onSelectionChanged(e, "removed")) : (s.selectedItems.push(e), s.onSelectionChanged && s.onSelectionChanged(e, "added")) }, s.isItemDisabled = function (e) { return void 0 !== e.enabled && !e.enabled }, s.isItemSelected = function (e) { return !!s.allowSelection && s.selectedItems.filter((function (t) { return t.id == e.id })).length > 0 }, s.setSelectedItems(r || []), s } return lr(t, e), t.prototype.updateItemState = function () { var e = this; this.actions.forEach((function (t) { var n = e.isItemSelected(t); t.active = n, t.visible = !e.hideSelectedItems || !n })) }, t.prototype.updateState = function () { var e = this; this.updateItemState(), this.isEmpty = 0 === this.renderedActions.filter((function (t) { return e.isItemVisible(t) })).length }, t.prototype.setSelectedItems = function (e) { this.selectedItems = e, this.updateState() }, t.prototype.selectFocusedItem = function () { e.prototype.selectFocusedItem.call(this), this.hideSelectedItems && this.focusNextVisibleItem() }, ur([f()], t.prototype, "hideSelectedItems", void 0), t }(yt), pr = function () { var e = function (t, n) { return (e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (e, t) { e.__proto__ = t } || function (e, t) { for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]) })(t, n) }; return function (t, n) { if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null"); function o() { this.constructor = t } e(t, n), t.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o) } }(), hr = function (e, t, n, o) { var r, i = arguments.length, s = i < 3 ? t : null === o ? o = Object.getOwnPropertyDescriptor(t, n) : o; if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) s = Reflect.decorate(e, t, n, o); else for (var a = e.length - 1; a >= 0; a--)(r = e[a]) && (s = (i < 3 ? r(s) : i > 3 ? r(t, n, s) : r(t, n)) || s); return i > 3 && s && Object.defineProperty(t, n, s), s }, dr = function (e) { function t(t, n) { var o = e.call(this, t, n) || this; return o.popupCssClasses = "sv-multi-select-list", o.setHideSelectedItems(t.hideSelectedItems), o.syncFilterStringPlaceholder(), o.closeOnSelect = t.closeOnSelect, o } return pr(t, e), t.prototype.updateListState = function () { this.listModel.updateState(), this.syncFilterStringPlaceholder() }, t.prototype.syncFilterStringPlaceholder = function (e) { (e || this.getSelectedActions()).length || this.question.selectedItems.length ? this.filterStringPlaceholder = void 0 : this.filterStringPlaceholder = this.question.placeholder }, t.prototype.getSelectedActions = function (e) { var t = this; return (e || this.listModel.actions).filter((function (e) { return t.question.isAllSelected && "selectall" === e.id || !!qe.getItemByValue(t.question.selectedItems, e.id) })) }, t.prototype.getFocusFirstInputSelector = function () { return this.listModel.hideSelectedItems && An && !this.isValueEmpty(this.question.value) ? this.itemSelector : e.prototype.getFocusFirstInputSelector.call(this) }, t.prototype.createListModel = function () { var e = this, t = this.getAvailableItems(), n = this.onSelectionChanged; return n || (n = function (t, n) { e.resetFilterString(), "selectall" === t.id ? e.selectAllItems() : "added" === n && t.id === o.noneItemValue ? e.selectNoneItem() : "added" === n ? e.selectItem(t.id) : "removed" === n && e.deselectItem(t.id), e.popupRecalculatePosition(!1), e.closeOnSelect && (e.popupModel.isVisible = !1) }), new cr(t, n, !1) }, Object.defineProperty(t.prototype, "shouldResetAfterCancel", { get: function () { return An && !this.closeOnSelect }, enumerable: !1, configurable: !0 }), t.prototype.createPopup = function () { var t = this; e.prototype.createPopup.call(this), this.popupModel.onFooterActionsCreated.add((function (e, n) { t.shouldResetAfterCancel && (n.actions[0].needSpace = !0, n.actions = [{ id: "sv-dropdown-done-button", title: t.doneButtonCaption, innerCss: "sv-popup__button--done", action: function () { t.popupModel.isVisible = !1 }, enabled: new ue((function () { return !t.isTwoValueEquals(t.question.renderedValue, t.previousValue) })) }].concat(n.actions)) })), this.popupModel.onVisibilityChanged.add((function (e, n) { t.shouldResetAfterCancel && n.isVisible && (t.previousValue = [].concat(t.question.renderedValue || [])) })), this.popupModel.onCancel = function () { t.shouldResetAfterCancel && (t.question.renderedValue = t.previousValue, t.updateListState()) } }, t.prototype.selectAllItems = function () { this.question.toggleSelectAll(), this.updateListState() }, t.prototype.selectNoneItem = function () { this.question.renderedValue = [o.noneItemValue], this.updateListState() }, t.prototype.selectItem = function (e) { var t = [].concat(this.question.renderedValue || []); t.push(e), this.question.renderedValue = t, this.updateListState() }, t.prototype.deselectItem = function (e) { var t = [].concat(this.question.renderedValue || []); t.splice(t.indexOf(e), 1), this.question.renderedValue = t, this.updateListState() }, t.prototype.onClear = function (t) { e.prototype.onClear.call(this, t), this.updateListState() }, t.prototype.setHideSelectedItems = function (e) { this.listModel.hideSelectedItems = e, this.updateListState() }, t.prototype.removeLastSelectedItem = function () { this.deselectItem(this.question.renderedValue[this.question.renderedValue.length - 1]), this.popupRecalculatePosition(!1) }, t.prototype.inputKeyHandler = function (e) { 8 !== e.keyCode || this.filterString || (this.removeLastSelectedItem(), e.preventDefault(), e.stopPropagation()) }, hr([f({ defaultValue: "" })], t.prototype, "filterStringPlaceholder", void 0), hr([f({ defaultValue: !0 })], t.prototype, "closeOnSelect", void 0), hr([f()], t.prototype, "previousValue", void 0), hr([f({ localizable: { defaultStr: "tagboxDoneButtonCaption" } })], t.prototype, "doneButtonCaption", void 0), t }(Vo), fr = function () { var e = function (t, n) { return (e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (e, t) { e.__proto__ = t } || function (e, t) { for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]) })(t, n) }; return function (t, n) { if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null"); function o() { this.constructor = t } e(t, n), t.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o) } }(), gr = function (e, t, n, o) { var r, i = arguments.length, s = i < 3 ? t : null === o ? o = Object.getOwnPropertyDescriptor(t, n) : o; if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) s = Reflect.decorate(e, t, n, o); else for (var a = e.length - 1; a >= 0; a--)(r = e[a]) && (s = (i < 3 ? r(s) : i > 3 ? r(t, n, s) : r(t, n)) || s); return i > 3 && s && Object.defineProperty(t, n, s), s }, yr = function (e) { function t(t) { var n = e.call(this, t) || this; return n.onOpened = n.addEvent(), n.createLocalizableString("placeholder", n, !1, !0), n.createLocalizableString("clearCaption", n, !1, !0), n } return fr(t, e), t.prototype.getDefaultItemComponent = function () { return "" }, Object.defineProperty(t.prototype, "readOnlyText", { get: function () { return this.displayValue || this.placeholder }, enumerable: !1, configurable: !0 }), t.prototype.onSurveyLoad = function () { e.prototype.onSurveyLoad.call(this), this.dropdownListModel || (this.dropdownListModel = new dr(this)) }, Object.defineProperty(t.prototype, "placeholder", { get: function () { return this.getLocalizableStringText("placeholder") }, set: function (e) { this.setLocalizableStringText("placeholder", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "locPlaceholder", { get: function () { return this.getLocalizableString("placeholder") }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "clearCaption", { get: function () { return this.getLocalizableStringText("clearCaption") }, set: function (e) { this.setLocalizableStringText("clearCaption", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "locClearCaption", { get: function () { return this.getLocalizableString("clearCaption") }, enumerable: !1, configurable: !0 }), t.prototype.getType = function () { return "tagbox" }, Object.defineProperty(t.prototype, "ariaRole", { get: function () { return "combobox" }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "popupModel", { get: function () { var e; return null === (e = this.dropdownListModel) || void 0 === e ? void 0 : e.popupModel }, enumerable: !1, configurable: !0 }), t.prototype.getControlClass = function () { return (new at).append(this.cssClasses.control).append(this.cssClasses.controlEmpty, this.isEmpty()).append(this.cssClasses.onError, this.errors.length > 0).append(this.cssClasses.controlDisabled, this.isReadOnly).toString() }, t.prototype.onOpenedCallBack = function () { this.onOpened.fire(this, { question: this, choices: this.choices }) }, t.prototype.onVisibleChoicesChanged = function () { e.prototype.onVisibleChoicesChanged.call(this), this.popupModel && this.dropdownListModel.updateItems() }, t.prototype.getFirstInputElementId = function () { return this.inputId + (this.searchEnabled ? "_0" : "") }, t.prototype.getInputId = function () { return this.inputId + "_0" }, gr([f({ defaultValue: !0 })], t.prototype, "allowClear", void 0), gr([f({ defaultValue: !0, onSet: function (e, t) { t.dropdownListModel && t.dropdownListModel.setSearchEnabled(e) } })], t.prototype, "searchEnabled", void 0), gr([f({ defaultValue: !1, onSet: function (e, t) { t.dropdownListModel && t.dropdownListModel.setHideSelectedItems(e) } })], t.prototype, "hideSelectedItems", void 0), gr([f({ defaultValue: !1 })], t.prototype, "choicesLazyLoadEnabled", void 0), gr([f({ defaultValue: 25 })], t.prototype, "choicesLazyLoadPageSize", void 0), t }(ar); _.addClass("tagbox", [{ name: "placeholder", serializationProperty: "locPlaceholder" }, { name: "allowClear:boolean", default: !0 }, { name: "searchEnabled:boolean", default: !0 }, { name: "choicesLazyLoadEnabled:boolean", default: !1, visible: !1 }, { name: "choicesLazyLoadPageSize:number", default: 25, visible: !1 }, { name: "hideSelectedItems:boolean", default: !1 }, { name: "closeOnSelect:boolean", default: !0 }, { name: "itemComponent", visible: !1, default: "" }], (function () { return new yr("") }), "checkbox"), rn.Instance.registerQuestion("tagbox", (function (e) { var t = new yr(e); return t.choices = rn.DefaultChoices, t })); var mr = function () { var e = function (t, n) { return (e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (e, t) { e.__proto__ = t } || function (e, t) { for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]) })(t, n) }; return function (t, n) { if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null"); function o() { this.constructor = t } e(t, n), t.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o) } }(), vr = function (e) { function t() { var t = null !== e && e.apply(this, arguments) || this; return t.doDragOver = function () { "imagepicker" !== t.parentElement.getType() && (t.draggedElementShortcut.querySelector(".svc-item-value-controls__button").style.cursor = "grabbing") }, t.doBanDropHere = function () { "imagepicker" !== t.parentElement.getType() && (t.draggedElementShortcut.querySelector(".svc-item-value-controls__button").style.cursor = "not-allowed") }, t } return mr(t, e), Object.defineProperty(t.prototype, "draggedElementType", { get: function () { return "item-value" }, enumerable: !1, configurable: !0 }), t.prototype.createDraggedElementShortcut = function (e, t, n) { if ("imagepicker" === this.parentElement.getType()) return this.createImagePickerShortcut(this.draggedElement, e, t, n); var o = document.createElement("div"); o.style.cssText = " \n cursor: grabbing;\n position: absolute;\n z-index: 1000;\n font-family: var(--font-family, $font-family);\n "; var r = t.closest("[data-sv-drop-target-item-value]").cloneNode(!0); r.style.cssText = "\n min-width: 100px;\n box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.1);\n background-color: var(--background, white);\n border-radius: 36px;\n padding-right: 16px;\n margin-left: 0;\n ", r.querySelector(".svc-item-value-controls__drag-icon").style.visibility = "visible", r.querySelector(".svc-item-value-controls__remove").style.backgroundColor = "transparent", r.classList.remove("svc-item-value--moveup"), r.classList.remove("svc-item-value--movedown"), this.draggedElement.isDragDropMoveDown = !1, this.draggedElement.isDragDropMoveUp = !1, o.appendChild(r); var i = t.getBoundingClientRect(); return o.shortcutXOffset = n.clientX - i.x, o.shortcutYOffset = n.clientY - i.y, this.isBottom = null, o }, t.prototype.createImagePickerShortcut = function (e, t, n, o) { var r = document.createElement("div"); r.style.cssText = " \n cursor: grabbing;\n position: absolute;\n z-index: 1000;\n box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.1);\n padding: 4px;\n border-radius: 4px;\n background: white;\n "; var i = n.closest("[data-sv-drop-target-item-value]"), s = i.querySelector(".svc-image-item-value-controls"), a = i.querySelector(".sd-imagepicker__image-container"), l = i.querySelector(e.imageLink ? "img" : ".sd-imagepicker__no-image").cloneNode(!0); return s.style.display = "none", a.style.width = l.width + "px", a.style.height = l.height + "px", l.style.objectFit = "cover", l.style.borderRadius = "4px", r.appendChild(l), r }, t.prototype.findDropTargetNodeByDragOverNode = function (e) { return e.closest(this.dropTargetDataAttributeName) }, t.prototype.getDropTargetByDataAttributeValue = function (e) { return this.parentElement.choices.filter((function (t) { return "" + t.value == e }))[0] }, t.prototype.getVisibleChoices = function () { var e = this.parentElement; return "ranking" === e.getType() ? e.rankingChoices : e.visibleChoices }, t.prototype.isDropTargetValid = function (e) { var t = this.getVisibleChoices(); if ("imagepicker" !== this.parentElement.getType()) { var n = t.indexOf(this.dropTarget), o = t.indexOf(this.draggedElement); if (o > n && this.dropTarget.isDragDropMoveUp) return this.dropTarget.isDragDropMoveUp = !1, !1; if (o < n && this.dropTarget.isDragDropMoveDown) return this.dropTarget.isDragDropMoveDown = !1, !1 } return -1 !== t.indexOf(e) }, t.prototype.calculateIsBottom = function (e) { var t = this.getVisibleChoices(); return t.indexOf(this.dropTarget) - t.indexOf(this.draggedElement) > 0 }, t.prototype.afterDragOver = function (t) { if (!this.isDropTargetDoesntChanged(this.isBottom) && this.dropTarget !== this.draggedElement) { var n = this.getVisibleChoices(), o = n.indexOf(this.dropTarget), r = n.indexOf(this.draggedElement); n.splice(r, 1), n.splice(o, 0, this.draggedElement), "imagepicker" !== this.parentElement.getType() && (r !== o && (t.classList.remove("svc-item-value--moveup"), t.classList.remove("svc-item-value--movedown"), this.dropTarget.isDragDropMoveDown = !1, this.dropTarget.isDragDropMoveUp = !1), r > o && (this.dropTarget.isDragDropMoveDown = !0), r < o && (this.dropTarget.isDragDropMoveUp = !0), e.prototype.ghostPositionChanged.call(this)) } }, t.prototype.doDrop = function () { var e = this.parentElement.choices, t = this.getVisibleChoices().filter((function (t) { return -1 !== e.indexOf(t) })), n = e.indexOf(this.draggedElement), o = t.indexOf(this.draggedElement); return e.splice(n, 1), e.splice(o, 0, this.draggedElement), this.parentElement }, t.prototype.doClear = function () { this.updateVisibleChoices() }, t.prototype.updateVisibleChoices = function () { var e = this.parentElement; "ranking" === this.parentElement.getType() ? e.updateRankingChoices() : e.updateVisibleChoices() }, t }(Mn), br = function () { var e = function (t, n) { return (e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (e, t) { e.__proto__ = t } || function (e, t) { for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]) })(t, n) }; return function (t, n) { if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null"); function o() { this.constructor = t } e(t, n), t.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o) } }(), Cr = function (e) { function t() { var t = null !== e && e.apply(this, arguments) || this; return t.isDragOverRootNode = !1, t.doDragOver = function () { t.draggedElementShortcut.querySelector(".sv-ranking-item").style.cursor = "grabbing" }, t.doBanDropHere = function () { t.isDragOverRootNode ? t.allowDropHere = !0 : t.draggedElementShortcut.querySelector(".sv-ranking-item").style.cursor = "not-allowed" }, t.doDrop = function () { return t.parentElement.setValue(), t.parentElement }, t.doClear = function () { t.parentElement.dropTargetNodeMove = null, t.parentElement.updateRankingChoices(!0) }, t } return br(t, e), Object.defineProperty(t.prototype, "draggedElementType", { get: function () { return "ranking-item" }, enumerable: !1, configurable: !0 }), t.prototype.createDraggedElementShortcut = function (e, t, n) { var o = document.createElement("div"); o.className = this.shortcutClass + " sv-ranking-shortcut", o.style.cssText = " \n cursor: grabbing;\n position: absolute;\n z-index: 1000;\n border-radius: 36px;\n min-width: 100px;\n box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.1);\n background-color: var(--background, white);\n font-family: var(--font-family, $font-family);\n "; var r = t.cloneNode(!0); o.appendChild(r); var i = t.getBoundingClientRect(); return o.shortcutXOffset = n.clientX - i.x, o.shortcutYOffset = n.clientY - i.y, o }, Object.defineProperty(t.prototype, "shortcutClass", { get: function () { return (new at).append(this.parentElement.cssClasses.root).append(this.parentElement.cssClasses.rootMobileMod, En).toString() }, enumerable: !1, configurable: !0 }), t.prototype.getDropTargetByDataAttributeValue = function (e) { return this.parentElement.rankingChoices[e] }, t.prototype.findDropTargetNodeByDragOverNode = function (e) { return this.isDragOverRootNode = this.getIsDragOverRootNode(e), e.closest(this.dropTargetDataAttributeName) }, t.prototype.getIsDragOverRootNode = function (e) { return "string" == typeof e.className && -1 !== e.className.indexOf("sv-ranking") }, t.prototype.isDropTargetValid = function (e, t) { var n = this.parentElement.rankingChoices, o = n.indexOf(this.dropTarget), r = n.indexOf(this.draggedElement); return r > o && t.classList.contains("sv-dragdrop-moveup") || r < o && t.classList.contains("sv-dragdrop-movedown") ? (this.parentElement.dropTargetNodeMove = null, !1) : -1 !== n.indexOf(e) }, t.prototype.calculateIsBottom = function (e) { var t = this.parentElement.rankingChoices; return t.indexOf(this.dropTarget) - t.indexOf(this.draggedElement) > 0 }, t.prototype.afterDragOver = function (e) { var t = this.parentElement.rankingChoices, n = t.indexOf(this.dropTarget), o = t.indexOf(this.draggedElement); t.splice(o, 1), t.splice(n, 0, this.draggedElement), this.parentElement.setPropertyValue("rankingChoices", t), this.updateDraggedElementShortcut(n + 1), o !== n && (e.classList.remove("sv-dragdrop-moveup"), e.classList.remove("sv-dragdrop-movedown"), this.parentElement.dropTargetNodeMove = null), o > n && (this.parentElement.dropTargetNodeMove = "down"), o < n && (this.parentElement.dropTargetNodeMove = "up") }, t.prototype.updateDraggedElementShortcut = function (e) { var t = e + ""; this.draggedElementShortcut.querySelector(".sv-ranking-item__index").innerText = t }, t.prototype.ghostPositionChanged = function () { this.parentElement.currentDropTarget = this.draggedElement, e.prototype.ghostPositionChanged.call(this) }, t }(vr), Pr = function () { var e = function (t, n) { return (e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (e, t) { e.__proto__ = t } || function (e, t) { for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]) })(t, n) }; return function (t, n) { if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null"); function o() { this.constructor = t } e(t, n), t.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o) } }(), wr = function (e, t, n, o) { var r, i = arguments.length, s = i < 3 ? t : null === o ? o = Object.getOwnPropertyDescriptor(t, n) : o; if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) s = Reflect.decorate(e, t, n, o); else for (var a = e.length - 1; a >= 0; a--)(r = e[a]) && (s = (i < 3 ? r(s) : i > 3 ? r(t, n, s) : r(t, n)) || s); return i > 3 && s && Object.defineProperty(t, n, s), s }, Vr = function (e) { function t(t) { var n = e.call(this, t) || this; return n.domNode = null, n.onVisibleChoicesChanged = function () { if (e.prototype.onVisibleChoicesChanged.call(n), 1 === n.visibleChoices.length) return n.value = [], void n.updateRankingChoices(); n.isEmpty() || (n.visibleChoices.length > n.value.length && n.addToValueByVisibleChoices(), n.visibleChoices.length < n.value.length && n.removeFromValueByVisibleChoices()), n.updateRankingChoices() }, n.localeChanged = function () { e.prototype.localeChanged.call(n), n.updateRankingChoices() }, n.handlePointerDown = function (e, t, o) { var r = e.target; n.isDragStartNodeValid(r) && n.allowStartDrag && n.dragDropRankingChoices.startDrag(e, t, n, o) }, n.handleKeydown = function (e, t) { if (!n.isDesignMode) { var o = e.key, r = n.rankingChoices.indexOf(t); "ArrowUp" === o && r && (n.handleArrowUp(r, t), e.preventDefault()), "ArrowDown" === o && r !== n.rankingChoices.length - 1 && (n.handleArrowDown(r, t), e.preventDefault()) } }, n.handleArrowUp = function (e, t) { var o = n.rankingChoices; o.splice(e, 1), o.splice(e - 1, 0, t), n.setValue(), setTimeout((function () { n.focusItem(e - 1) }), 1) }, n.handleArrowDown = function (e, t) { var o = n.rankingChoices; o.splice(e, 1), o.splice(e + 1, 0, t), n.setValue(), setTimeout((function () { n.focusItem(e + 1) }), 1) }, n.focusItem = function (e) { n.domNode.querySelectorAll("." + n.cssClasses.item)[e].focus() }, n.setValue = function () { var e = []; n.rankingChoices.forEach((function (t) { e.push(t.value) })), n.value = e }, n.createNewArray("rankingChoices"), n } return Pr(t, e), t.prototype.getDefaultItemComponent = function () { return "" }, t.prototype.getType = function () { return "ranking" }, t.prototype.getItemTabIndex = function (e) { return this.isDesignMode ? void 0 : 0 }, Object.defineProperty(t.prototype, "rootClass", { get: function () { return (new at).append(this.cssClasses.root).append(this.cssClasses.rootMobileMod, En).append(this.cssClasses.rootDisabled, this.isReadOnly).append(this.cssClasses.rootDesignMode, !!this.isDesignMode).append(this.cssClasses.itemOnError, this.errors.length > 0).append(this.cssClasses.rootDragHandleAreaIcon, "icon" === o.rankingDragHandleArea).toString() }, enumerable: !1, configurable: !0 }), t.prototype.getItemClassCore = function (t, n) { var o = this.rankingChoices.indexOf(t), r = this.rankingChoices.indexOf(this.currentDropTarget); return (new at).append(e.prototype.getItemClassCore.call(this, t, n)).append(this.cssClasses.itemGhostMod, this.currentDropTarget === t).append("sv-dragdrop-movedown", o === r + 1 && "down" === this.dropTargetNodeMove).append("sv-dragdrop-moveup", o === r - 1 && "up" === this.dropTargetNodeMove).toString() }, t.prototype.isItemCurrentDropTarget = function (e) { return this.dragDropRankingChoices.dropTarget === e }, Object.defineProperty(t.prototype, "ghostPositionCssClass", { get: function () { return "top" === this.ghostPosition ? this.cssClasses.dragDropGhostPositionTop : "bottom" === this.ghostPosition ? this.cssClasses.dragDropGhostPositionBottom : "" }, enumerable: !1, configurable: !0 }), t.prototype.getItemIndexClasses = function () { return (new at).append(this.cssClasses.itemIndex).append(this.cssClasses.itemIndexEmptyMode, this.isEmpty()).toString() }, t.prototype.getNumberByIndex = function (e) { return this.isEmpty() ? "" : e + 1 + "" }, t.prototype.setSurveyImpl = function (t, n) { e.prototype.setSurveyImpl.call(this, t, n), this.updateRankingChoices() }, t.prototype.isAnswerCorrect = function () { return r.isArraysEqual(this.value, this.correctAnswer, !1) }, t.prototype.onSurveyValueChanged = function (t) { e.prototype.onSurveyValueChanged.call(this, t), this.isLoadingFromJson || this.updateRankingChoices() }, t.prototype.addToValueByVisibleChoices = function () { var e = this.value.slice(); this.visibleChoices.forEach((function (t) { -1 === e.indexOf(t.value) && e.push(t.value) })), this.value = e }, t.prototype.removeFromValueByVisibleChoices = function () { var e = this, t = this.value.slice(); this.value.forEach((function (n, o) { var r = !0; e.visibleChoices.forEach((function (e) { e.value === n && (r = !1) })), r && t.splice(o, 1) })), this.value = t }, Object.defineProperty(t.prototype, "rankingChoices", { get: function () { return this.getPropertyValue("rankingChoices", []) }, enumerable: !1, configurable: !0 }), t.prototype.updateRankingChoices = function (e) { var t = this; void 0 === e && (e = !1); var n = []; 1 !== this.visibleChoices.length ? (e && this.setPropertyValue("rankingChoices", []), this.isEmpty() ? this.setPropertyValue("rankingChoices", this.visibleChoices) : (this.value.forEach((function (e) { t.visibleChoices.forEach((function (t) { t.value === e && n.push(t) })) })), this.setPropertyValue("rankingChoices", n))) : this.setPropertyValue("rankingChoices", n) }, t.prototype.endLoadingFromJson = function () { e.prototype.endLoadingFromJson.call(this), this.dragDropRankingChoices = new Cr(this.survey, null, this.longTap) }, t.prototype.isDragStartNodeValid = function (e) { return "icon" !== o.rankingDragHandleArea || e.classList.contains(this.cssClasses.itemIconHoverMod) }, Object.defineProperty(t.prototype, "allowStartDrag", { get: function () { return !this.isReadOnly && !this.isDesignMode }, enumerable: !1, configurable: !0 }), t.prototype.afterRenderQuestionElement = function (t) { this.domNode = t, e.prototype.afterRenderQuestionElement.call(this, t) }, t.prototype.beforeDestroyQuestionElement = function (t) { e.prototype.beforeDestroyQuestionElement.call(this, t) }, t.prototype.supportSelectAll = function () { return !1 }, t.prototype.supportOther = function () { return !1 }, t.prototype.supportNone = function () { return !1 }, t.prototype.getIconHoverCss = function () { return (new at).append(this.cssClasses.itemIcon).append(this.cssClasses.itemIconHoverMod).toString() }, t.prototype.getIconFocusCss = function () { return (new at).append(this.cssClasses.itemIcon).append(this.cssClasses.itemIconFocusMod).toString() }, Object.defineProperty(t.prototype, "longTap", { get: function () { return this.getPropertyValue("longTap") }, set: function (e) { this.setPropertyValue("longTap", e) }, enumerable: !1, configurable: !0 }), wr([f({ defaultValue: null })], t.prototype, "currentDropTarget", void 0), wr([f({ defaultValue: null })], t.prototype, "dropTargetNodeMove", void 0), t }(ar); _.addClass("ranking", [{ name: "showOtherItem", visible: !1, isSerializable: !1 }, { name: "otherText", visible: !1, isSerializable: !1 }, { name: "otherErrorText", visible: !1, isSerializable: !1 }, { name: "storeOthersAsComment", visible: !1, isSerializable: !1 }, { name: "showNoneItem", visible: !1, isSerializable: !1 }, { name: "noneText", visible: !1, isSerializable: !1 }, { name: "showSelectAllItem", visible: !1, isSerializable: !1 }, { name: "selectAllText", visible: !1, isSerializable: !1 }, { name: "colCount:number", visible: !1, isSerializable: !1 }, { name: "maxSelectedChoices", visible: !1, isSerializable: !1 }, { name: "separateSpecialChoices", visible: !1, isSerializable: !1 }, { name: "longTap", default: !0, visible: !1, isSerializable: !1 }, { name: "itemComponent", visible: !1, default: "" }], (function () { return new Vr("") }), "checkbox"), rn.Instance.registerQuestion("ranking", (function (e) { var t = new Vr(e); return t.choices = rn.DefaultChoices, t })); var xr = function () { var e = function (t, n) { return (e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (e, t) { e.__proto__ = t } || function (e, t) { for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]) })(t, n) }; return function (t, n) { if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null"); function o() { this.constructor = t } e(t, n), t.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o) } }(), Or = function (e) { function t() { return null !== e && e.apply(this, arguments) || this } return xr(t, e), Object.defineProperty(t.prototype, "rows", { get: function () { return this.getPropertyValue("rows") }, set: function (e) { this.setPropertyValue("rows", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "cols", { get: function () { return this.getPropertyValue("cols") }, set: function (e) { this.setPropertyValue("cols", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "acceptCarriageReturn", { get: function () { return this.getPropertyValue("acceptCarriageReturn") }, set: function (e) { this.setPropertyValue("acceptCarriageReturn", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "autoGrow", { get: function () { return this.getPropertyValue("autoGrow") || this.survey && this.survey.autoGrowComment }, set: function (e) { this.setPropertyValue("autoGrow", e) }, enumerable: !1, configurable: !0 }), t.prototype.getType = function () { return "comment" }, t.prototype.afterRenderQuestionElement = function (t) { this.element = document.getElementById(this.inputId) || t, this.updateElement(), e.prototype.afterRenderQuestionElement.call(this, t) }, t.prototype.updateElement = function () { var e = this; this.element && this.autoGrow && setTimeout((function () { return Xe(e.element) }), 1) }, t.prototype.beforeDestroyQuestionElement = function (t) { e.prototype.beforeDestroyQuestionElement.call(this, t), this.element = void 0 }, t.prototype.onInput = function (e) { this.isInputTextUpdate ? this.value = e.target.value : this.updateElement(), this.updateRemainingCharacterCounter(e.target.value) }, t.prototype.onKeyDown = function (e) { this.acceptCarriageReturn || "Enter" !== e.key && 13 !== e.keyCode || (e.preventDefault(), e.stopPropagation()) }, t.prototype.onValueChanged = function () { e.prototype.onValueChanged.call(this), this.updateElement() }, t.prototype.setNewValue = function (t) { !this.acceptCarriageReturn && t && (t = t.replace(new RegExp("(\r\n|\n|\r)", "gm"), "")), e.prototype.setNewValue.call(this, t) }, Object.defineProperty(t.prototype, "className", { get: function () { return (this.cssClasses ? this.getControlClass() : "panel-comment-root") || void 0 }, enumerable: !1, configurable: !0 }), t }(Lo); _.addClass("comment", [{ name: "maxLength:number", default: -1 }, { name: "cols:number", default: 50 }, { name: "rows:number", default: 4 }, { name: "placeholder", alternativeName: "placeHolder", serializationProperty: "locPlaceholder" }, { name: "textUpdateMode", default: "default", choices: ["default", "onBlur", "onTyping"] }, { name: "autoGrow:boolean" }, { name: "acceptCarriageReturn:boolean", default: !0, visible: !1 }], (function () { return new Or("") }), "textbase"), rn.Instance.registerQuestion("comment", (function (e) { return new Or(e) })); var Tr = function () { var e = function (t, n) { return (e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (e, t) { e.__proto__ = t } || function (e, t) { for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]) })(t, n) }; return function (t, n) { if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null"); function o() { this.constructor = t } e(t, n), t.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o) } }(), Sr = function (e, t, n, o) { var r, i = arguments.length, s = i < 3 ? t : null === o ? o = Object.getOwnPropertyDescriptor(t, n) : o; if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) s = Reflect.decorate(e, t, n, o); else for (var a = e.length - 1; a >= 0; a--)(r = e[a]) && (s = (i < 3 ? r(s) : i > 3 ? r(t, n, s) : r(t, n)) || s); return i > 3 && s && Object.defineProperty(t, n, s), s }, _r = function (e) { function t(t) { var n = e.call(this, t) || this; return n.isUploading = !1, n.isDragging = !1, n.onUploadStateChanged = n.addEvent(), n.onStateChanged = n.addEvent(), n.mobileFileNavigator = new pt, n.dragCounter = 0, n.onDragEnter = function (e) { n.isInputReadOnly || (e.preventDefault(), n.isDragging = !0, n.dragCounter++) }, n.onDragOver = function (e) { if (n.isInputReadOnly) return e.returnValue = !1, !1; e.dataTransfer.dropEffect = "copy", e.preventDefault() }, n.onDrop = function (e) { if (!n.isInputReadOnly) { n.isDragging = !1, n.dragCounter = 0, e.preventDefault(); var t = e.dataTransfer; n.onChange(t) } }, n.onDragLeave = function (e) { n.isInputReadOnly || (n.dragCounter--, 0 === n.dragCounter && (n.isDragging = !1)) }, n.doChange = function (e) { var t = e.target || e.srcElement; n.onChange(t) }, n.doClean = function (e) { e.currentTarget || e.srcElement; if (n.needConfirmRemoveFile && !Be(n.confirmRemoveAllMessage)) return; n.rootElement && (n.rootElement.querySelectorAll("input")[0].value = ""), n.clear() }, n.doDownloadFile = function (e, t) { Qe() && (e.preventDefault(), He(t.content, t.name)) }, n.fileIndexAction = new Tt({ id: "fileIndex", title: n.getFileIndexCaption(), enabled: !1 }), n.prevFileAction = new Tt({ id: "prevPage", iconSize: 16, action: function () { n.indexToShow = n.previewValue.length && (n.indexToShow - 1 + n.previewValue.length) % n.previewValue.length || 0, n.fileIndexAction.title = n.getFileIndexCaption() } }), n.nextFileAction = new Tt({ id: "nextPage", iconSize: 16, action: function () { n.indexToShow = n.previewValue.length && (n.indexToShow + 1) % n.previewValue.length || 0, n.fileIndexAction.title = n.getFileIndexCaption() } }), n.mobileFileNavigator.actions = [n.prevFileAction, n.fileIndexAction, n.nextFileAction], n } return Tr(t, e), Object.defineProperty(t.prototype, "mobileFileNavigatorVisible", { get: function () { return this.isMobile && this.containsMultiplyFiles }, enumerable: !1, configurable: !0 }), t.prototype.updateElementCssCore = function (t) { e.prototype.updateElementCssCore.call(this, t), this.prevFileAction.iconName = this.cssClasses.leftIconId, this.nextFileAction.iconName = this.cssClasses.rightIconId }, t.prototype.getFileIndexCaption = function () { return this.getLocalizationFormatString("indexText", this.indexToShow + 1, this.previewValue.length) }, t.prototype.isPreviewVisible = function (e) { return !this.isMobile || e === this.indexToShow }, t.prototype.getType = function () { return "file" }, t.prototype.clearOnDeletingContainer = function () { this.survey && this.survey.clearFiles(this, this.name, this.value, null, (function () { })) }, Object.defineProperty(t.prototype, "showPreview", { get: function () { return this.getPropertyValue("showPreview") }, set: function (e) { this.setPropertyValue("showPreview", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "allowMultiple", { get: function () { return this.getPropertyValue("allowMultiple", !1) }, set: function (e) { this.setPropertyValue("allowMultiple", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "imageHeight", { get: function () { return this.getPropertyValue("imageHeight") }, set: function (e) { this.setPropertyValue("imageHeight", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "imageWidth", { get: function () { return this.getPropertyValue("imageWidth") }, set: function (e) { this.setPropertyValue("imageWidth", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "acceptedTypes", { get: function () { return this.getPropertyValue("acceptedTypes") }, set: function (e) { this.setPropertyValue("acceptedTypes", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "storeDataAsText", { get: function () { return this.getPropertyValue("storeDataAsText") }, set: function (e) { this.setPropertyValue("storeDataAsText", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "waitForUpload", { get: function () { return this.getPropertyValue("waitForUpload") }, set: function (e) { this.setPropertyValue("waitForUpload", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "allowImagesPreview", { get: function () { return this.getPropertyValue("allowImagesPreview") }, set: function (e) { this.setPropertyValue("allowImagesPreview", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "maxSize", { get: function () { return this.getPropertyValue("maxSize") }, set: function (e) { this.setPropertyValue("maxSize", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "needConfirmRemoveFile", { get: function () { return this.getPropertyValue("needConfirmRemoveFile") }, set: function (e) { this.setPropertyValue("needConfirmRemoveFile", e) }, enumerable: !1, configurable: !0 }), t.prototype.getConfirmRemoveMessage = function (e) { return this.confirmRemoveMessage.format(e) }, Object.defineProperty(t.prototype, "inputTitle", { get: function () { return this.isUploading ? this.loadingFileTitle : this.isEmpty() ? this.chooseFileTitle : " " }, enumerable: !1, configurable: !0 }), t.prototype.clear = function (e) { var t = this; this.survey && (this.containsMultiplyFiles = !1, this.survey.clearFiles(this, this.name, this.value, null, (function (n, o) { "success" === n && (t.value = void 0, t.errors = [], e && e(), t.indexToShow = 0, t.fileIndexAction.title = t.getFileIndexCaption()) }))) }, Object.defineProperty(t.prototype, "multipleRendered", { get: function () { return this.allowMultiple ? "multiple" : void 0 }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "showRemoveButton", { get: function () { return !this.isReadOnly && !this.isEmpty() && this.cssClasses.removeButton }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "showRemoveButtonBottom", { get: function () { return !this.isReadOnly && !this.isEmpty() && this.cssClasses.removeButtonBottom }, enumerable: !1, configurable: !0 }), t.prototype.defaultImage = function (e) { return !this.canPreviewImage(e) && !!this.cssClasses.defaultImage }, t.prototype.removeFile = function (e) { this.removeFileByContent(this.value.filter((function (t) { return t.name === e }))[0]) }, t.prototype.removeFileByContent = function (e) { var t = this; this.survey && this.survey.clearFiles(this, this.name, this.value, e.name, (function (n, o) { if ("success" === n) { var i = t.value; Array.isArray(i) ? t.value = i.filter((function (t) { return !r.isTwoValueEquals(t, e, !0) })) : t.value = void 0 } })) }, t.prototype.loadFiles = function (e) { var t = this; if (this.survey && (this.errors = [], this.allFilesOk(e))) { var n = function () { t.stateChanged("loading"); var n = []; t.storeDataAsText ? e.forEach((function (o) { var r = new FileReader; r.onload = function (i) { (n = n.concat([{ name: o.name, type: o.type, content: r.result }])).length === e.length && (t.value = (t.value || []).concat(n)) }, r.readAsDataURL(o) })) : t.survey && t.survey.uploadFiles(t, t.name, e, (function (e, n) { "error" === e && t.stateChanged("error"), "success" === e && (t.value = (t.value || []).concat(n.map((function (e) { return { name: e.file.name, type: e.file.type, content: e.content } })))) })) }; this.allowMultiple ? n() : this.clear(n) } }, t.prototype.canPreviewImage = function (e) { return this.allowImagesPreview && !!e && this.isFileImage(e) }, t.prototype.loadPreview = function (e) { var t = this; if (this.previewValue.splice(0, this.previewValue.length), this.showPreview && e) { var n = Array.isArray(e) ? e : e ? [e] : []; this.storeDataAsText ? n.forEach((function (e) { var n = e.content || e; t.previewValue.push({ name: e.name, type: e.type, content: n }) })) : (this._previewLoader && this._previewLoader.dispose(), this.isReadyValue = !1, this._previewLoader = new Ir(this, (function (e, n) { "loaded" === e && n.forEach((function (e) { t.previewValue.push(e) })), t.isReadyValue = !0, t.onReadyChanged && t.onReadyChanged.fire(t, { question: t, isReady: !0, oldIsReady: !1 }), t._previewLoader.dispose(), t._previewLoader = void 0 })), this._previewLoader.load(n)), this.indexToShow = this.previewValue.length > 0 && this.indexToShow > 0 ? this.indexToShow - 1 : 0, this.fileIndexAction.title = this.getFileIndexCaption(), this.containsMultiplyFiles = this.previewValue.length > 1 } }, t.prototype.onCheckForErrors = function (t, n) { e.prototype.onCheckForErrors.call(this, t, n), this.isUploading && this.waitForUpload && t.push(new Ve(this.getLocalizationString("uploadingFile"), this)) }, t.prototype.stateChanged = function (e) { this.currentState != e && ("loading" === e && (this.isUploading = !0), "loaded" === e && (this.isUploading = !1), "error" === e && (this.isUploading = !1), this.currentState = e, this.onStateChanged.fire(this, { state: e }), this.onUploadStateChanged.fire(this, { state: e })) }, t.prototype.allFilesOk = function (e) { var t = this, n = this.errors ? this.errors.length : 0; return (e || []).forEach((function (e) { t.maxSize > 0 && e.size > t.maxSize && t.errors.push(new be(t.maxSize, t)) })), n === this.errors.length }, t.prototype.isFileImage = function (e) { if (!e) return !1; var t = e.content && e.content.substring(0, "data:image".length); return "data:image" === (t = t && t.toLowerCase()) || !!e.type && 0 === e.type.toLowerCase().indexOf("image/") }, t.prototype.getPlainData = function (t) { void 0 === t && (t = { includeEmpty: !0 }); var n = e.prototype.getPlainData.call(this, t); if (n && !this.isEmpty()) { n.isNode = !1; var o = Array.isArray(this.value) ? this.value : [this.value]; n.data = o.map((function (e, t) { return { name: t, title: "File", value: e.content && e.content || e, displayValue: e.name && e.name || e, getString: function (e) { return "object" == typeof e ? JSON.stringify(e) : e }, isNode: !1 } })) } return n }, t.prototype.getChooseFileCss = function () { var e = this.isAnswered; return (new at).append(this.cssClasses.chooseFile).append(this.cssClasses.controlDisabled, this.isReadOnly).append(this.cssClasses.chooseFileAsText, !e).append(this.cssClasses.chooseFileAsTextDisabled, !e && this.isInputReadOnly).append(this.cssClasses.chooseFileAsIcon, e).toString() }, t.prototype.getReadOnlyFileCss = function () { return (new at).append("form-control").append(this.cssClasses.placeholderInput).toString() }, Object.defineProperty(t.prototype, "fileRootCss", { get: function () { return (new at).append(this.cssClasses.root).append(this.cssClasses.single, !this.allowMultiple).append(this.cssClasses.singleImage, !this.allowMultiple && this.isAnswered && this.canPreviewImage(this.value[0])).append(this.cssClasses.mobile, this.isMobile).toString() }, enumerable: !1, configurable: !0 }), t.prototype.getFileDecoratorCss = function () { return (new at).append(this.cssClasses.fileDecorator).append(this.cssClasses.onError, this.errors.length > 0).append(this.cssClasses.fileDecoratorDrag, this.isDragging).toString() }, t.prototype.onChange = function (e) { if (window.FileReader && e && e.files && !(e.files.length < 1)) { for (var t = [], n = this.allowMultiple ? e.files.length : 1, o = 0; o < n; o++)t.push(e.files[o]); e.value = "", this.loadFiles(t) } }, t.prototype.onChangeQuestionValue = function (t) { e.prototype.onChangeQuestionValue.call(this, t), this.stateChanged(this.isEmpty() ? "empty" : "loaded"), this.isLoadingFromJson || this.loadPreview(t) }, t.prototype.endLoadingFromJson = function () { e.prototype.endLoadingFromJson.call(this), this.loadPreview(this.value) }, t.prototype.afterRender = function (t) { this.rootElement = t, e.prototype.afterRender.call(this, t) }, t.prototype.doRemoveFile = function (e) { if (this.needConfirmRemoveFile && !Be(this.getConfirmRemoveMessage(e.name))) return; var t = this.previewValue.indexOf(e); this.removeFileByContent(-1 === t ? e : this.value[t]) }, Sr([f()], t.prototype, "isDragging", void 0), Sr([y({})], t.prototype, "previewValue", void 0), Sr([f({ defaultValue: "empty" })], t.prototype, "currentState", void 0), Sr([f({ defaultValue: 0 })], t.prototype, "indexToShow", void 0), Sr([f({ defaultValue: !1 })], t.prototype, "containsMultiplyFiles", void 0), Sr([f({ localizable: { defaultStr: "confirmRemoveFile" } })], t.prototype, "confirmRemoveMessage", void 0), Sr([f({ localizable: { defaultStr: "confirmRemoveAllFiles" } })], t.prototype, "confirmRemoveAllMessage", void 0), Sr([f({ localizable: { defaultStr: "noFileChosen" } })], t.prototype, "noFileChosenCaption", void 0), Sr([f({ localizable: { defaultStr: "chooseFileCaption" } })], t.prototype, "chooseButtonCaption", void 0), Sr([f({ localizable: { defaultStr: "clearCaption" } })], t.prototype, "clearButtonCaption", void 0), Sr([f({ localizable: { defaultStr: "removeFileCaption" } })], t.prototype, "removeFileCaption", void 0), Sr([f({ localizable: { defaultStr: "loadingFile" } })], t.prototype, "loadingFileTitle", void 0), Sr([f({ localizable: { defaultStr: "chooseFile" } })], t.prototype, "chooseFileTitle", void 0), Sr([f({ localizable: { defaultStr: "fileDragAreaPlaceholder" } })], t.prototype, "dragAreaPlaceholder", void 0), t }($t); _.addClass("file", [{ name: "showCommentArea:switch", layout: "row", visible: !0, category: "general" }, { name: "showPreview:boolean", default: !0 }, "allowMultiple:boolean", { name: "allowImagesPreview:boolean", default: !0 }, "imageHeight", "imageWidth", "acceptedTypes", { name: "storeDataAsText:boolean", default: !0 }, { name: "waitForUpload:boolean", default: !1 }, { name: "maxSize:number", default: 0 }, { name: "defaultValue", visible: !1 }, { name: "correctAnswer", visible: !1 }, { name: "validators", visible: !1 }, { name: "needConfirmRemoveFile:boolean" }], (function () { return new _r("") }), "question"), rn.Instance.registerQuestion("file", (function (e) { return new _r(e) })); var Ir = function () { function e(e, t) { this.fileQuestion = e, this.callback = t, this.loaded = [] } return e.prototype.load = function (e) { var t = this; e.forEach((function (n) { t.fileQuestion.survey && t.fileQuestion.survey.downloadFile(t.fileQuestion, t.fileQuestion.name, n, (function (o, r) { t.fileQuestion && t.callback && ("success" === o ? (t.loaded.push({ content: r, name: n.name, type: n.type }), t.loaded.length === e.length && t.callback("loaded", t.loaded)) : t.callback("error", t.loaded)) })) })) }, e.prototype.dispose = function () { this.fileQuestion = void 0, this.callback = void 0 }, e }(), Rr = function () { var e = function (t, n) { return (e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (e, t) { e.__proto__ = t } || function (e, t) { for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]) })(t, n) }; return function (t, n) { if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null"); function o() { this.constructor = t } e(t, n), t.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o) } }(), Er = function (e) { function t(t) { var n = e.call(this, t) || this; return n.createLocalizableString("html", n).onGetTextCallback = function (e) { return n.survey && !n.ignoreHtmlProgressing ? n.survey.processHtml(e) : e }, n } return Rr(t, e), t.prototype.getType = function () { return "html" }, Object.defineProperty(t.prototype, "isCompositeQuestion", { get: function () { return !0 }, enumerable: !1, configurable: !0 }), t.prototype.getProcessedText = function (t) { return this.ignoreHtmlProgressing ? t : e.prototype.getProcessedText.call(this, t) }, Object.defineProperty(t.prototype, "html", { get: function () { return this.getLocalizableStringText("html", "") }, set: function (e) { this.setLocalizableStringText("html", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "locHtml", { get: function () { return this.getLocalizableString("html") }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "processedHtml", { get: function () { return this.survey ? this.survey.processHtml(this.html) : this.html }, enumerable: !1, configurable: !0 }), t }(or); _.addClass("html", [{ name: "html:html", serializationProperty: "locHtml" }], (function () { return new Er("") }), "nonvalue"), rn.Instance.registerQuestion("html", (function (e) { return new Er(e) })); var Dr = function () { var e = function (t, n) { return (e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (e, t) { e.__proto__ = t } || function (e, t) { for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]) })(t, n) }; return function (t, n) { if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null"); function o() { this.constructor = t } e(t, n), t.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o) } }(), Ar = function (e) { function t(t) { return e.call(this, t) || this } return Dr(t, e), t.prototype.getDefaultItemComponent = function () { return "survey-radiogroup-item" }, t.prototype.getType = function () { return "radiogroup" }, Object.defineProperty(t.prototype, "ariaRole", { get: function () { return "radiogroup" }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "titleAriaLabel", { get: function () { return null }, enumerable: !1, configurable: !0 }), t.prototype.getFirstInputElementId = function () { return this.inputId + "_0" }, Object.defineProperty(t.prototype, "selectedItem", { get: function () { var e = this.selectedItemValues; if (this.isEmpty()) return null; var t = qe.getItemByValue(this.visibleChoices, this.value); return t || e || this.updateSelectedItemValues(), t || e || new qe(this.value) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "showClearButton", { get: function () { return this.getPropertyValue("showClearButton") }, set: function (e) { this.setPropertyValue("showClearButton", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "canShowClearButton", { get: function () { return this.showClearButton && !this.isReadOnly }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "clearButtonCaption", { get: function () { return this.getLocalizationString("clearCaption") }, enumerable: !1, configurable: !0 }), t.prototype.supportGoNextPageAutomatic = function () { return !0 }, Object.defineProperty(t.prototype, "showClearButtonInContent", { get: function () { return !this.isDefaultV2Theme && this.canShowClearButton }, enumerable: !1, configurable: !0 }), t.prototype.clickItemHandler = function (e) { this.renderedValue = e.value }, t.prototype.getDefaultTitleActions = function () { var e = this, t = []; if (this.isDefaultV2Theme && !this.isDesignMode) { var n = new Tt({ title: this.clearButtonCaption, id: "sv-clr-btn-" + this.id, action: function () { e.clearValue() }, innerCss: this.cssClasses.clearButton, visible: new ue((function () { return e.canShowClearButton })) }); t.push(n) } return t }, t }(Co); _.addClass("radiogroup", [{ name: "showClearButton:boolean", default: !1 }, { name: "separateSpecialChoices", visible: !0 }, { name: "itemComponent", visible: !1, default: "survey-radiogroup-item" }], (function () { return new Ar("") }), "checkboxbase"), rn.Instance.registerQuestion("radiogroup", (function (e) { var t = new Ar(e); return t.choices = rn.DefaultChoices, t })); var Lr = function () { var e = function (t, n) { return (e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (e, t) { e.__proto__ = t } || function (e, t) { for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]) })(t, n) }; return function (t, n) { if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null"); function o() { this.constructor = t } e(t, n), t.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o) } }(), jr = function (e, t, n, o) { var r, i = arguments.length, s = i < 3 ? t : null === o ? o = Object.getOwnPropertyDescriptor(t, n) : o; if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) s = Reflect.decorate(e, t, n, o); else for (var a = e.length - 1; a >= 0; a--)(r = e[a]) && (s = (i < 3 ? r(s) : i > 3 ? r(t, n, s) : r(t, n)) || s); return i > 3 && s && Object.defineProperty(t, n, s), s }, Nr = function (e) { function t(t, n) { void 0 === n && (n = null); var o = e.call(this) || this; return o.itemValue = t, o.locString = n, o } return Lr(t, e), Object.defineProperty(t.prototype, "value", { get: function () { return this.itemValue.getPropertyValue("value") }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "locText", { get: function () { return this.locString || this.itemValue.locText }, enumerable: !1, configurable: !0 }), t }(ce), Mr = function (e) { function t(t) { var n = e.call(this, t) || this; return n.createItemValues("rateValues"), n.createRenderedRateItems(), n.createLocalizableString("ratingOptionsCaption", n, !1, !0), n.registerFunctionOnPropertiesValueChanged(["rateValues", "rateMin", "rateMax", "minRateDescription", "maxRateDescription", "rateStep", "displayRateDescriptionsAsExtremeItems"], (function () { return n.createRenderedRateItems() })), n.createLocalizableString("minRateDescription", n, !0), n.createLocalizableString("maxRateDescription", n, !0), n } return Lr(t, e), t.prototype.endLoadingFromJson = function () { e.prototype.endLoadingFromJson.call(this), this.hasMinRateDescription = !!this.minRateDescription, this.hasMaxRateDescription = !!this.maxRateDescription, this.createRenderedRateItems() }, Object.defineProperty(t.prototype, "rateValues", { get: function () { return this.getPropertyValue("rateValues") }, set: function (e) { this.setPropertyValue("rateValues", e), this.createRenderedRateItems() }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "rateMin", { get: function () { return this.getPropertyValue("rateMin") }, set: function (e) { this.setPropertyValue("rateMin", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "rateMax", { get: function () { return this.getPropertyValue("rateMax") }, set: function (e) { this.setPropertyValue("rateMax", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "rateStep", { get: function () { return this.getPropertyValue("rateStep") }, set: function (e) { this.setPropertyValue("rateStep", e) }, enumerable: !1, configurable: !0 }), t.prototype.getDisplayValueCore = function (e, t) { var n = qe.getTextOrHtmlByValue(this.visibleRateValues, t); return n || t }, Object.defineProperty(t.prototype, "visibleRateValues", { get: function () { return this.renderedRateItems.map((function (e) { return e.itemValue })) }, enumerable: !1, configurable: !0 }), t.prototype.itemValuePropertyChanged = function (t, n, o, r) { 0 === this.rateValues.length && void 0 !== r && this.setPropertyValue("rateValues", this.visibleRateValues), e.prototype.itemValuePropertyChanged.call(this, t, n, o, r) }, t.prototype.createRenderedRateItems = function () { var e = this, t = []; if (this.rateValues.length > 0) t = this.rateValues; else { for (var n = [], r = this.rateMin, i = this.rateStep; r <= this.rateMax && n.length < o.ratingMaximumRateValueCount;) { var s = new qe(r); s.locOwner = this, s.ownerPropertyName = "rateValues", n.push(s), r = this.correctValue(r + i, i) } t = n } this.renderedRateItems = t.map((function (n, o) { if (e.displayRateDescriptionsAsExtremeItems) { if (0 == o) return new Nr(n, e.minRateDescription && e.locMinRateDescription || n.locText); if (o == t.length - 1) return new Nr(n, e.maxRateDescription && e.locMaxRateDescription || n.locText) } return new Nr(n) })) }, t.prototype.correctValue = function (e, t) { if (!e) return e; if (Math.round(e) == e) return e; for (var n = 0; Math.round(t) != t;)t *= 10, n++; return parseFloat(e.toFixed(n)) }, t.prototype.getType = function () { return "rating" }, t.prototype.getFirstInputElementId = function () { return this.inputId + "_0" }, t.prototype.getInputId = function (e) { return this.inputId + "_" + e }, t.prototype.supportGoNextPageAutomatic = function () { return !0 }, t.prototype.supportOther = function () { return !1 }, Object.defineProperty(t.prototype, "minRateDescription", { get: function () { return this.getLocalizableStringText("minRateDescription") }, set: function (e) { this.setLocalizableStringText("minRateDescription", e), this.hasMinRateDescription = !!this.minRateDescription }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "locMinRateDescription", { get: function () { return this.getLocalizableString("minRateDescription") }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "maxRateDescription", { get: function () { return this.getLocalizableStringText("maxRateDescription") }, set: function (e) { this.setLocalizableStringText("maxRateDescription", e), this.hasMaxRateDescription = !!this.maxRateDescription }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "locMaxRateDescription", { get: function () { return this.getLocalizableString("maxRateDescription") }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "hasMinLabel", { get: function () { return !this.displayRateDescriptionsAsExtremeItems && !!this.hasMinRateDescription }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "hasMaxLabel", { get: function () { return !this.displayRateDescriptionsAsExtremeItems && !!this.hasMaxRateDescription }, enumerable: !1, configurable: !0 }), t.prototype.valueToData = function (e) { if (this.rateValues.length > 0) { var t = qe.getItemByValue(this.rateValues, e); return t ? t.value : e } return isNaN(e) ? e : parseFloat(e) }, t.prototype.setValueFromClick = function (e) { this.value === parseFloat(e) ? this.clearValue() : this.value = e }, Object.defineProperty(t.prototype, "ratingRootCss", { get: function () { return ("buttons" == this.displayMode || this.survey && this.survey.isDesignMode) && this.cssClasses.rootWrappable ? this.cssClasses.rootWrappable : this.cssClasses.root }, enumerable: !1, configurable: !0 }), t.prototype.getItemClass = function (e) { var t = this.value == e.value, n = !(this.isReadOnly || !e.isEnabled || t || this.survey && this.survey.isDesignMode); return (new at).append(this.cssClasses.item).append(this.cssClasses.selected, this.value == e.value).append(this.cssClasses.itemDisabled, this.isReadOnly).append(this.cssClasses.itemHover, n).append(this.cssClasses.itemOnError, this.errors.length > 0).toString() }, t.prototype.getControlClass = function () { return this.isEmpty(), (new at).append(this.cssClasses.control).append(this.cssClasses.controlEmpty, this.isEmpty()).append(this.cssClasses.onError, this.errors.length > 0).append(this.cssClasses.controlDisabled, this.isReadOnly).toString() }, Object.defineProperty(t.prototype, "placeholder", { get: function () { return this.getLocalizableStringText("ratingOptionsCaption") }, set: function (e) { this.setLocalizableStringText("ratingOptionsCaption", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "locPlaceholder", { get: function () { return this.getLocalizableString("ratingOptionsCaption") }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "allowClear", { get: function () { return !0 }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "searchEnabled", { get: function () { return !1 }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "renderedValue", { get: function () { return this.value }, set: function (e) { this.value = e }, enumerable: !1, configurable: !0 }), t.prototype.isItemSelected = function (e) { return e.value == this.value }, Object.defineProperty(t.prototype, "visibleChoices", { get: function () { return this.visibleRateValues }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "readOnlyText", { get: function () { return this.displayValue || this.placeholder }, enumerable: !1, configurable: !0 }), t.prototype.needResponsiveWidth = function () { this.getPropertyValue("rateValues"); var e = this.getPropertyValue("rateStep"), t = this.getPropertyValue("rateMax"), n = this.getPropertyValue("rateMin"); return "dropdown" != this.displayMode && !!(this.hasMinRateDescription || this.hasMaxRateDescription || e && (t - n) / e > 9) }, t.prototype.supportResponsiveness = function () { return !0 }, t.prototype.getCompactRenderAs = function () { return "buttons" == this.displayMode ? "default" : "dropdown" }, t.prototype.getDesktopRenderAs = function () { return "dropdown" == this.displayMode ? "dropdown" : "default" }, Object.defineProperty(t.prototype, "dropdownListModel", { get: function () { return this.dropdownListModelValue }, set: function (e) { this.dropdownListModelValue = e, this.updateElementCss() }, enumerable: !1, configurable: !0 }), t.prototype.updateCssClasses = function (t, n) { if (e.prototype.updateCssClasses.call(this, t, n), this.dropdownListModel) { var o = {}; ot(n.list, o), ot(t.list, o), t.list = o } }, t.prototype.calcCssClasses = function (t) { var n = e.prototype.calcCssClasses.call(this, t); return this.dropdownListModel && this.dropdownListModel.updateCssClasses(n.popup, n.list), n }, jr([y()], t.prototype, "renderedRateItems", void 0), jr([f({ defaultValue: !1 })], t.prototype, "hasMinRateDescription", void 0), jr([f({ defaultValue: !1 })], t.prototype, "hasMaxRateDescription", void 0), jr([f({ defaultValue: !1 })], t.prototype, "displayRateDescriptionsAsExtremeItems", void 0), jr([f({ defaultValue: "auto", onSet: function (e, t) { t.isDesignMode || (t.renderAs = "dropdown" === e ? "dropdown" : "default") } })], t.prototype, "displayMode", void 0), t }($t); _.addClass("rating", [{ name: "showCommentArea:switch", layout: "row", visible: !0, category: "general" }, { name: "rateValues:itemvalue[]", baseValue: function () { return s.getString("choices_Item") } }, { name: "rateMin:number", default: 1, onSettingValue: function (e, t) { return t > e.rateMax - e.rateStep ? e.rateMax - e.rateStep : t } }, { name: "rateMax:number", default: 5, onSettingValue: function (e, t) { return t < e.rateMin + e.rateStep ? e.rateMin + e.rateStep : t } }, { name: "rateStep:number", default: 1, minValue: .1, onSettingValue: function (e, t) { return t <= 0 && (t = 1), t > e.rateMax - e.rateMin && (t = e.rateMax - e.rateMin), t } }, { name: "minRateDescription", alternativeName: "mininumRateDescription", serializationProperty: "locMinRateDescription" }, { name: "maxRateDescription", alternativeName: "maximumRateDescription", serializationProperty: "locMaxRateDescription" }, { name: "displayRateDescriptionsAsExtremeItems:boolean", default: !1 }, { name: "displayMode", default: "auto", choices: ["auto", "buttons", "dropdown"] }], (function () { return new Mr("") }), "question"), rn.Instance.registerQuestion("rating", (function (e) { return new Mr(e) })); var Fr = function () { var e = function (t, n) { return (e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (e, t) { e.__proto__ = t } || function (e, t) { for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]) })(t, n) }; return function (t, n) { if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null"); function o() { this.constructor = t } e(t, n), t.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o) } }(), qr = function (e, t, n, o) { var r, i = arguments.length, s = i < 3 ? t : null === o ? o = Object.getOwnPropertyDescriptor(t, n) : o; if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) s = Reflect.decorate(e, t, n, o); else for (var a = e.length - 1; a >= 0; a--)(r = e[a]) && (s = (i < 3 ? r(s) : i > 3 ? r(t, n, s) : r(t, n)) || s); return i > 3 && s && Object.defineProperty(t, n, s), s }, kr = function (e) { function t(t) { var n = e.call(this, t) || this; return n.createLocalizableString("labelFalse", n, !0, "booleanUncheckedLabel"), n.createLocalizableString("labelTrue", n, !0, "booleanCheckedLabel"), n } return Fr(t, e), t.prototype.getType = function () { return "boolean" }, t.prototype.isLayoutTypeSupported = function (e) { return !0 }, t.prototype.supportGoNextPageAutomatic = function () { return "checkbox" !== this.renderAs }, Object.defineProperty(t.prototype, "isIndeterminate", { get: function () { return this.isEmpty() }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "hasTitle", { get: function () { return !0 }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "booleanValue", { get: function () { return this.isEmpty() ? null : this.value == this.getValueTrue() }, set: function (e) { this.isReadOnly || this.setBooleanValue(e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "checkedValue", { get: function () { return this.booleanValue }, set: function (e) { this.booleanValue = e }, enumerable: !1, configurable: !0 }), t.prototype.setBooleanValue = function (e) { this.isValueEmpty(e) ? (this.value = null, this.booleanValueRendered = null) : (this.value = 1 == e ? this.getValueTrue() : this.getValueFalse(), this.booleanValueRendered = e) }, Object.defineProperty(t.prototype, "defaultValue", { get: function () { return this.getPropertyValue("defaultValue") }, set: function (e) { !0 === e && (e = "true"), !1 === e && (e = "false"), void 0 === e && (e = "indeterminate"), this.setPropertyValue("defaultValue", e), this.updateValueWithDefaults() }, enumerable: !1, configurable: !0 }), t.prototype.getDefaultValue = function () { return "indeterminate" == this.defaultValue || void 0 === this.defaultValue ? null : "true" == this.defaultValue ? this.getValueTrue() : this.getValueFalse() }, Object.defineProperty(t.prototype, "locTitle", { get: function () { var e = this.getLocalizableString("title"); return !this.isValueEmpty(this.locLabel.text) && (this.isValueEmpty(e.text) || this.isLabelRendered && !this.showTitle) ? this.locLabel : e }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "labelRenderedAriaID", { get: function () { return this.isLabelRendered ? this.ariaTitleId : null }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "isLabelRendered", { get: function () { return "hidden" === this.titleLocation }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "canRenderLabelDescription", { get: function () { return this.isLabelRendered && this.hasDescription && (this.hasDescriptionUnderTitle || this.hasDescriptionUnderInput) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "labelTrue", { get: function () { return this.getLocalizableStringText("labelTrue") }, set: function (e) { this.setLocalizableStringText("labelTrue", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "locLabelTrue", { get: function () { return this.getLocalizableString("labelTrue") }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "isDeterminated", { get: function () { return null !== this.booleanValue }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "labelFalse", { get: function () { return this.getLocalizableStringText("labelFalse") }, set: function (e) { this.setLocalizableStringText("labelFalse", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "locLabelFalse", { get: function () { return this.getLocalizableString("labelFalse") }, enumerable: !1, configurable: !0 }), t.prototype.getValueTrue = function () { return void 0 === this.valueTrue || this.valueTrue }, t.prototype.getValueFalse = function () { return void 0 !== this.valueFalse && this.valueFalse }, t.prototype.setDefaultValue = function () { this.isDefaultValueSet("true", this.valueTrue) && this.setBooleanValue(!0), this.isDefaultValueSet("false", this.valueFalse) && this.setBooleanValue(!1), "indeterminate" == this.defaultValue && this.setBooleanValue(null) }, t.prototype.isDefaultValueSet = function (e, t) { return this.defaultValue == e || void 0 !== t && this.defaultValue === t }, t.prototype.getDisplayValueCore = function (e, t) { return t == this.getValueTrue() ? this.locLabelTrue.textOrHtml : this.locLabelFalse.textOrHtml }, t.prototype.getItemCssValue = function (e) { return (new at).append(e.item).append(e.itemOnError, this.errors.length > 0).append(e.itemDisabled, this.isReadOnly).append(e.itemChecked, !!this.booleanValue).append(e.itemIndeterminate, null === this.booleanValue).toString() }, t.prototype.getItemCss = function () { return this.getItemCssValue(this.cssClasses) }, t.prototype.getCheckboxItemCss = function () { return this.getItemCssValue({ item: this.cssClasses.checkboxItem, itemOnError: this.cssClasses.checkboxItemOnError, itemDisabled: this.cssClasses.checkboxItemDisabled, itemChecked: this.cssClasses.checkboxItemChecked, itemIndeterminate: this.cssClasses.checkboxItemIndeterminate }) }, t.prototype.getLabelCss = function (e) { return (new at).append(this.cssClasses.label).append(this.cssClasses.disabledLabel, this.booleanValue === !e || this.isReadOnly).toString() }, Object.defineProperty(t.prototype, "svgIcon", { get: function () { return this.booleanValue && this.cssClasses.svgIconCheckedId ? this.cssClasses.svgIconCheckedId : null === this.booleanValue && this.cssClasses.svgIconIndId ? this.cssClasses.svgIconIndId : !this.booleanValue && this.cssClasses.svgIconUncheckedId ? this.cssClasses.svgIconUncheckedId : this.cssClasses.svgIconId }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "allowClick", { get: function () { return this.isIndeterminate && !this.isInputReadOnly }, enumerable: !1, configurable: !0 }), t.prototype.getCheckedLabel = function () { return !0 === this.booleanValue ? this.locLabelTrue : !1 === this.booleanValue ? this.locLabelFalse : void 0 }, t.prototype.setQuestionValue = function (t, n) { void 0 === n && (n = !0), "true" === t && "true" !== this.valueTrue && (t = !0), "false" === t && "false" !== this.valueFalse && (t = !1), "indeterminate" === t && (t = null), e.prototype.setQuestionValue.call(this, t, n) }, t.prototype.onLabelClick = function (e, t) { return this.allowClick && (Ze(e), this.booleanValue = t), !0 }, t.prototype.calculateBooleanValueByEvent = function (e, t) { var n = "rtl" == document.defaultView.getComputedStyle(e.target).direction; this.booleanValue = n ? !t : t }, t.prototype.onSwitchClickModel = function (e) { if (!this.allowClick) return !0; Ze(e); var t = e.offsetX / e.target.offsetWidth > .5; this.calculateBooleanValueByEvent(e, t) }, t.prototype.onKeyDownCore = function (e) { return "ArrowLeft" !== e.key && "ArrowRight" !== e.key || (Ze(e), void this.calculateBooleanValueByEvent(e, "ArrowRight" === e.key)) }, t.prototype.getRadioItemClass = function (e, t) { var n = void 0; return e.radioItem && (n = e.radioItem), e.radioItemChecked && t === this.booleanValue && (n = (n ? n + " " : "") + e.radioItemChecked), n }, t.prototype.supportResponsiveness = function () { return !0 }, t.prototype.getCompactRenderAs = function () { return "radio" }, t.prototype.createActionContainer = function (t) { return e.prototype.createActionContainer.call(this, "checkbox" !== this.renderAs) }, qr([f()], t.prototype, "booleanValueRendered", void 0), qr([f()], t.prototype, "showTitle", void 0), qr([f({ localizable: !0 })], t.prototype, "label", void 0), qr([f()], t.prototype, "valueTrue", void 0), qr([f()], t.prototype, "valueFalse", void 0), t }($t); _.addClass("boolean", [{ name: "showCommentArea:switch", layout: "row", visible: !0, category: "general" }, { name: "label:text", serializationProperty: "locLabel", isSerializable: !1, visible: !1 }, { name: "labelTrue:text", serializationProperty: "locLabelTrue" }, { name: "labelFalse:text", serializationProperty: "locLabelFalse" }, "valueTrue", "valueFalse", { name: "renderAs", default: "default", visible: !1 }], (function () { return new kr("") }), "question"), rn.Instance.registerQuestion("boolean", (function (e) { return new kr(e) })); var Br = function () { var e = function (t, n) { return (e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (e, t) { e.__proto__ = t } || function (e, t) { for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]) })(t, n) }; return function (t, n) { if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null"); function o() { this.constructor = t } e(t, n), t.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o) } }(), Qr = function (e, t, n, o) { var r, i = arguments.length, s = i < 3 ? t : null === o ? o = Object.getOwnPropertyDescriptor(t, n) : o; if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) s = Reflect.decorate(e, t, n, o); else for (var a = e.length - 1; a >= 0; a--)(r = e[a]) && (s = (i < 3 ? r(s) : i > 3 ? r(t, n, s) : r(t, n)) || s); return i > 3 && s && Object.defineProperty(t, n, s), s }, Hr = function (e) { function t(t, n, o) { void 0 === n && (n = null), void 0 === o && (o = "imageitemvalue"); var r = e.call(this, t, n, o) || this; return r.typeName = o, r.createLocalizableString("imageLink", r, !1), r } return Br(t, e), t.prototype.getType = function () { return this.typeName ? this.typeName : "itemvalue" }, Object.defineProperty(t.prototype, "imageLink", { get: function () { return this.getLocalizableStringText("imageLink") }, set: function (e) { this.setLocalizableStringText("imageLink", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "locImageLink", { get: function () { return this.getLocalizableString("imageLink") }, enumerable: !1, configurable: !0 }), t.prototype.getLocale = function () { return this.locOwner ? this.locOwner.getLocale() : "" }, t.prototype.getMarkdownHtml = function (e, t) { return this.locOwner ? this.locOwner.getMarkdownHtml(e, t) : void 0 }, t.prototype.getRenderer = function (e) { return this.locOwner ? this.locOwner.getRenderer(e) : null }, t.prototype.getRendererContext = function (e) { return this.locOwner ? this.locOwner.getRendererContext(e) : e }, t.prototype.getProcessedText = function (e) { return this.locOwner ? this.locOwner.getProcessedText(e) : e }, t }(qe), zr = function (e) { function t(t) { var n = e.call(this, t) || this; return n.isResponsiveValue = !1, n.onContentLoaded = function (e, t) { var o = t.target; "video" == n.contentMode ? e.aspectRatio = o.videoWidth / o.videoHeight : e.aspectRatio = o.naturalWidth / o.naturalHeight, n._width && n.processResponsiveness(0, n._width) }, n.colCount = 0, n.registerPropertyChangedHandlers(["minImageWidth", "maxImageWidth", "minImageHeight", "maxImageHeight", "visibleChoices", "colCount", "isResponsiveValue"], (function () { n._width && n.processResponsiveness(0, n._width) })), n.registerPropertyChangedHandlers(["imageWidth", "imageHeight"], (function () { n.calcIsResponsive() })), n.calcIsResponsive(), n } return Br(t, e), t.prototype.getType = function () { return "imagepicker" }, t.prototype.supportGoNextPageAutomatic = function () { return !this.multiSelect }, Object.defineProperty(t.prototype, "hasSingleInput", { get: function () { return !1 }, enumerable: !1, configurable: !0 }), t.prototype.getItemValueType = function () { return "imageitemvalue" }, Object.defineProperty(t.prototype, "isCompositeQuestion", { get: function () { return !0 }, enumerable: !1, configurable: !0 }), t.prototype.supportOther = function () { return !1 }, t.prototype.supportNone = function () { return !1 }, t.prototype.isAnswerCorrect = function () { return this.multiSelect ? r.isArrayContainsEqual(this.value, this.correctAnswer) : e.prototype.isAnswerCorrect.call(this) }, Object.defineProperty(t.prototype, "multiSelect", { get: function () { return this.getPropertyValue("multiSelect") }, set: function (e) { this.setPropertyValue("multiSelect", e) }, enumerable: !1, configurable: !0 }), t.prototype.isItemSelected = function (e) { var t = this.value; if (this.isValueEmpty(t)) return !1; if (!this.multiSelect) return this.isTwoValueEquals(t, e.value); if (!Array.isArray(t)) return !1; for (var n = 0; n < t.length; n++)if (this.isTwoValueEquals(t[n], e.value)) return !0; return !1 }, t.prototype.clearIncorrectValues = function () { if (this.multiSelect) { var t = this.value; if (!t) return; if (!Array.isArray(t) || 0 == t.length) return void this.clearValue(); for (var n = [], o = 0; o < t.length; o++)this.hasUnknownValue(t[o], !0) || n.push(t[o]); if (n.length == t.length) return; 0 == n.length ? this.clearValue() : this.value = n } else e.prototype.clearIncorrectValues.call(this) }, t.prototype.getDisplayValueCore = function (t, n) { return this.multiSelect || Array.isArray(n) ? this.getDisplayArrayValue(t, n) : e.prototype.getDisplayValueCore.call(this, t, n) }, Object.defineProperty(t.prototype, "showLabel", { get: function () { return this.getPropertyValue("showLabel") }, set: function (e) { this.setPropertyValue("showLabel", e) }, enumerable: !1, configurable: !0 }), t.prototype.endLoadingFromJson = function () { e.prototype.endLoadingFromJson.call(this), !this.isDesignMode && this.multiSelect && (this.createNewArray("renderedValue"), this.createNewArray("value")), this.calcIsResponsive() }, t.prototype.getValueCore = function () { var t = e.prototype.getValueCore.call(this); return void 0 !== t ? t : this.multiSelect ? [] : t }, t.prototype.convertValToArrayForMultSelect = function (e) { return this.multiSelect ? this.isValueEmpty(e) || Array.isArray(e) ? e : [e] : e }, t.prototype.renderedValueFromDataCore = function (e) { return this.convertValToArrayForMultSelect(e) }, t.prototype.rendredValueToDataCore = function (e) { return this.convertValToArrayForMultSelect(e) }, Object.defineProperty(t.prototype, "imageHeight", { get: function () { return this.getPropertyValue("imageHeight") }, set: function (e) { this.setPropertyValue("imageHeight", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "renderedImageHeight", { get: function () { var e = this.isResponsive ? this.responsiveImageHeight : this.imageHeight; return (e || 150) + "px" }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "imageWidth", { get: function () { return this.getPropertyValue("imageWidth") }, set: function (e) { this.setPropertyValue("imageWidth", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "renderedImageWidth", { get: function () { var e = this.isResponsive ? this.responsiveImageWidth : this.imageWidth; return (e || 200) + "px" }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "imageFit", { get: function () { return this.getPropertyValue("imageFit") }, set: function (e) { this.setPropertyValue("imageFit", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "contentMode", { get: function () { return this.getPropertyValue("contentMode") }, set: function (e) { this.setPropertyValue("contentMode", e), "video" === e && (this.showLabel = !0) }, enumerable: !1, configurable: !0 }), t.prototype.convertDefaultValue = function (e) { return e }, Object.defineProperty(t.prototype, "inputType", { get: function () { return this.multiSelect ? "checkbox" : "radio" }, enumerable: !1, configurable: !0 }), t.prototype.isFootChoice = function (e, t) { return !1 }, t.prototype.getSelectBaseRootCss = function () { return (new at).append(e.prototype.getSelectBaseRootCss.call(this)).append(this.cssClasses.rootColumn, 1 == this.getCurrentColCount()).toString() }, Object.defineProperty(t.prototype, "isResponsive", { get: function () { return this.isResponsiveValue && this.isDefaultV2Theme }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "exactSizesAreEmpty", { get: function () { var e = this; return !["imageHeight", "imageWidth"].some((function (t) { return void 0 !== e[t] && null !== e[t] })) }, enumerable: !1, configurable: !0 }), t.prototype.calcIsResponsive = function () { this.isResponsiveValue = this.exactSizesAreEmpty }, t.prototype.getObservedElementSelector = function () { return this.cssClasses.root.replace(/\s*?([\w-]+)\s*?/g, ".$1") }, t.prototype.supportResponsiveness = function () { return !0 }, t.prototype.needResponsiveness = function () { return this.supportResponsiveness() && this.isDefaultV2Theme }, t.prototype.getCurrentColCount = function () { return void 0 === this.responsiveColCount || 0 === this.colCount ? this.colCount : this.responsiveColCount }, t.prototype.processResponsiveness = function (e, t) { this._width = t = Math.floor(t); var n = function (e, t, n) { var o = Math.floor(e / (t + n)); return (o + 1) * (t + n) - n <= e && o++, o }; if (this.isResponsive) { var o, r = this.choices.length + (this.isDesignMode ? 1 : 0), i = this.gapBetweenItems || 0, s = this.minImageWidth, a = this.maxImageWidth, l = this.maxImageHeight, u = this.minImageHeight, c = this.colCount; if (0 === c) if ((i + s) * r - i > t) { var p = n(t, s, i); o = Math.floor((t - i * (p - 1)) / p) } else o = Math.floor((t - i * (r - 1)) / r); else { var h = n(t, s, i); h < c ? (this.responsiveColCount = h >= 1 ? h : 1, c = this.responsiveColCount) : this.responsiveColCount = c, o = Math.floor((t - i * (c - 1)) / c) } o = Math.max(s, Math.min(o, a)); var d = Number.MIN_VALUE; this.choices.forEach((function (e) { var t = o / e.aspectRatio; d = t > d ? t : d })), d > l ? d = l : d < u && (d = u); var f = this.responsiveImageWidth, g = this.responsiveImageHeight; return this.responsiveImageWidth = o, this.responsiveImageHeight = d, f !== this.responsiveImageWidth || g !== this.responsiveImageHeight } return !1 }, t.prototype.afterRender = function (t) { e.prototype.afterRender.call(this, t); var n = this.survey.getCss().variables; n && (this.gapBetweenItems = Number.parseInt(window.getComputedStyle(t).getPropertyValue(n.imagepickerGapBetweenItems)) || 0) }, Qr([f({})], t.prototype, "responsiveImageHeight", void 0), Qr([f({})], t.prototype, "responsiveImageWidth", void 0), Qr([f({})], t.prototype, "isResponsiveValue", void 0), Qr([f({})], t.prototype, "maxImageWidth", void 0), Qr([f({})], t.prototype, "minImageWidth", void 0), Qr([f({})], t.prototype, "maxImageHeight", void 0), Qr([f({})], t.prototype, "minImageHeight", void 0), Qr([f({})], t.prototype, "responsiveColCount", void 0), t }(Co); _.addClass("imageitemvalue", [], (function (e) { return new Hr(e) }), "itemvalue"), _.addProperty("imageitemvalue", { name: "imageLink", serializationProperty: "locImageLink" }), _.addClass("responsiveImageSize", [], void 0, "number"), _.addClass("imagepicker", [{ name: "showOtherItem", visible: !1 }, { name: "otherText", visible: !1 }, { name: "showNoneItem", visible: !1 }, { name: "noneText", visible: !1 }, { name: "optionsCaption", visible: !1 }, { name: "otherErrorText", visible: !1 }, { name: "storeOthersAsComment", visible: !1 }, { name: "contentMode", default: "image", choices: ["image", "video"] }, { name: "imageFit", default: "contain", choices: ["none", "contain", "cover", "fill"] }, { name: "imageHeight:number", minValue: 0 }, { name: "imageWidth:number", minValue: 0 }, { name: "minImageWidth:responsiveImageSize", default: 200, minValue: 0, visibleIf: function () { return o.supportCreatorV2 } }, { name: "minImageHeight:responsiveImageSize", default: 133, minValue: 0, visibleIf: function () { return o.supportCreatorV2 } }, { name: "maxImageWidth:responsiveImageSize", default: 400, minValue: 0, visibleIf: function () { return o.supportCreatorV2 } }, { name: "maxImageHeight:responsiveImageSize", default: 266, minValue: 0, visibleIf: function () { return o.supportCreatorV2 } }], (function () { return new zr("") }), "checkboxbase"), _.addProperty("imagepicker", { name: "showLabel:boolean", default: !1 }), _.addProperty("imagepicker", { name: "colCount:number", default: 0, choices: [0, 1, 2, 3, 4, 5] }), _.addProperty("imagepicker", { name: "multiSelect:boolean", default: !1 }), _.addProperty("imagepicker", { name: "choices:imageitemvalue[]" }), rn.Instance.registerQuestion("imagepicker", (function (e) { return new zr(e) })); var Ur = function () { var e = function (t, n) { return (e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (e, t) { e.__proto__ = t } || function (e, t) { for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]) })(t, n) }; return function (t, n) { if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null"); function o() { this.constructor = t } e(t, n), t.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o) } }(), Wr = ["youtube.com", "youtu.be"], Jr = [".mp4", ".mov", ".wmv", ".flv", ".avi", ".mkv"]; function Gr(e) { if (!e) return !1; e = e.toLowerCase(); for (var t = 0; t < Wr.length; t++)if (-1 !== e.indexOf(Wr[t])) return !0; return !1 } var $r = function (e) { function t(t) { var n = e.call(this, t) || this; return n.createLocalizableString("imageLink", n, !1).onGetTextCallback = function (e) { return function (e) { if (!e || !Gr(e)) return e; if (e.toLocaleLowerCase().indexOf("embed") > -1) return e; for (var t = "", n = e.length - 1; n >= 0 && ("=" !== e[n] && "/" !== e[n]); n--)t = e[n] + t; return "https://www.youtube.com/embed/" + t }(e) }, n.createLocalizableString("altText", n, !1), n.registerPropertyChangedHandlers(["contentMode", "imageLink"], (function () { return n.calculateRenderedMode() })), n } return Ur(t, e), t.prototype.getType = function () { return "image" }, Object.defineProperty(t.prototype, "isCompositeQuestion", { get: function () { return !1 }, enumerable: !1, configurable: !0 }), t.prototype.onSurveyLoad = function () { e.prototype.onSurveyLoad.call(this), this.calculateRenderedMode() }, Object.defineProperty(t.prototype, "imageLink", { get: function () { return this.getLocalizableStringText("imageLink") }, set: function (e) { this.setLocalizableStringText("imageLink", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "locImageLink", { get: function () { return this.getLocalizableString("imageLink") }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "altText", { get: function () { return this.getLocalizableStringText("altText") }, set: function (e) { this.setLocalizableStringText("altText", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "locAltText", { get: function () { return this.getLocalizableString("altText") }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "imageHeight", { get: function () { return this.getPropertyValue("imageHeight") }, set: function (e) { this.setPropertyValue("imageHeight", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "renderedHeight", { get: function () { return this.imageHeight ? this.imageHeight + "px" : void 0 }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "imageWidth", { get: function () { return this.getPropertyValue("imageWidth") }, set: function (e) { this.setPropertyValue("imageWidth", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "renderedWidth", { get: function () { return this.imageWidth ? this.imageWidth + "px" : void 0 }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "imageFit", { get: function () { return this.getPropertyValue("imageFit") }, set: function (e) { this.setPropertyValue("imageFit", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "contentMode", { get: function () { return this.getPropertyValue("contentMode") }, set: function (e) { this.setPropertyValue("contentMode", e), "video" === e && (this.showLabel = !0) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "renderedMode", { get: function () { return this.getPropertyValue("renderedMode", "image") }, enumerable: !1, configurable: !0 }), t.prototype.getImageCss = function () { var e = this.getPropertyByName("imageHeight"), t = this.getPropertyByName("imageWidth"), n = e.isDefaultValue(this.imageHeight) && t.isDefaultValue(this.imageWidth); return (new at).append(this.cssClasses.image).append(this.cssClasses.adaptive, n).toString() }, t.prototype.setRenderedMode = function (e) { this.setPropertyValue("renderedMode", e) }, t.prototype.calculateRenderedMode = function () { "auto" !== this.contentMode ? this.setRenderedMode(this.contentMode) : this.isYoutubeVideo() ? this.setRenderedMode("youtube") : this.isVideo() ? this.setRenderedMode("video") : this.setRenderedMode("image") }, t.prototype.isYoutubeVideo = function () { return Gr(this.imageLink) }, t.prototype.isVideo = function () { var e = this.imageLink; if (!e) return !1; e = e.toLowerCase(); for (var t = 0; t < Jr.length; t++)if (e.endsWith(Jr[t])) return !0; return !1 }, t }(or); /*! * Signature Pad v2.3.2 * https://github.com/szimek/signature_pad * * Copyright 2017 Szymon Nowak * Released under the MIT license * * The main idea and some parts of the code (e.g. drawing variable width Bézier curve) are taken from: * http://corner.squareup.com/2012/07/smoother-signatures.html * * Implementation of interpolation using cubic Bézier curves is taken from: * http://benknowscode.wordpress.com/2012/09/14/path-interpolation-using-cubic-bezier-and-control-point-estimation-in-javascript * * Algorithm for approximated length of a Bézier curve is taken from: * http://www.lemoda.net/maths/bezier-length/index.html * */ function Kr(e, t, n) { this.x = e, this.y = t, this.time = n || (new Date).getTime() } function Xr(e, t, n, o) { this.startPoint = e, this.control1 = t, this.control2 = n, this.endPoint = o } function Yr(e, t) { var n = this, o = t || {}; this.velocityFilterWeight = o.velocityFilterWeight || .7, this.minWidth = o.minWidth || .5, this.maxWidth = o.maxWidth || 2.5, this.throttle = "throttle" in o ? o.throttle : 16, this.minDistance = "minDistance" in o ? o.minDistance : 5, this.throttle ? this._strokeMoveUpdate = function (e, t, n) { var o, r, i, s = null, a = 0; n || (n = {}); var l = function () { a = !1 === n.leading ? 0 : Date.now(), s = null, i = e.apply(o, r), s || (o = r = null) }; return function () { var u = Date.now(); a || !1 !== n.leading || (a = u); var c = t - (u - a); return o = this, r = arguments, c <= 0 || c > t ? (s && (clearTimeout(s), s = null), a = u, i = e.apply(o, r), s || (o = r = null)) : s || !1 === n.trailing || (s = setTimeout(l, c)), i } }(Yr.prototype._strokeUpdate, this.throttle) : this._strokeMoveUpdate = Yr.prototype._strokeUpdate, this.dotSize = o.dotSize || function () { return (this.minWidth + this.maxWidth) / 2 }, this.penColor = o.penColor || "black", this.backgroundColor = o.backgroundColor || "rgba(0,0,0,0)", this.onBegin = o.onBegin, this.onEnd = o.onEnd, this._canvas = e, this._ctx = e.getContext("2d"), this.clear(), this._handleMouseDown = function (e) { 1 === e.which && (n._mouseButtonDown = !0, n._strokeBegin(e)) }, this._handleMouseMove = function (e) { n._mouseButtonDown && n._strokeMoveUpdate(e) }, this._handleMouseUp = function (e) { 1 === e.which && n._mouseButtonDown && (n._mouseButtonDown = !1, n._strokeEnd(e)) }, this._handleTouchStart = function (e) { if (1 === e.targetTouches.length) { var t = e.changedTouches[0]; n._strokeBegin(t) } }, this._handleTouchMove = function (e) { e.preventDefault(); var t = e.targetTouches[0]; n._strokeMoveUpdate(t) }, this._handleTouchEnd = function (e) { e.target === n._canvas && (e.preventDefault(), n._strokeEnd(e)) }, this.on() } _.addClass("image", [{ name: "imageLink", serializationProperty: "locImageLink" }, { name: "altText", serializationProperty: "locAltText", alternativeName: "text", category: "general" }, { name: "contentMode", default: "auto", choices: ["auto", "image", "video", "youtube"] }, { name: "imageFit", default: "contain", choices: ["none", "contain", "cover", "fill"] }, { name: "imageHeight:number", default: 150, minValue: 0 }, { name: "imageWidth:number", default: 200, minValue: 0 }], (function () { return new $r("") }), "nonvalue"), rn.Instance.registerQuestion("image", (function (e) { return new $r(e) })), Kr.prototype.velocityFrom = function (e) { return this.time !== e.time ? this.distanceTo(e) / (this.time - e.time) : 1 }, Kr.prototype.distanceTo = function (e) { return Math.sqrt(Math.pow(this.x - e.x, 2) + Math.pow(this.y - e.y, 2)) }, Kr.prototype.equals = function (e) { return this.x === e.x && this.y === e.y && this.time === e.time }, Xr.prototype.length = function () { for (var e = 0, t = void 0, n = void 0, o = 0; o <= 10; o += 1) { var r = o / 10, i = this._point(r, this.startPoint.x, this.control1.x, this.control2.x, this.endPoint.x), s = this._point(r, this.startPoint.y, this.control1.y, this.control2.y, this.endPoint.y); if (o > 0) { var a = i - t, l = s - n; e += Math.sqrt(a * a + l * l) } t = i, n = s } return e }, Xr.prototype._point = function (e, t, n, o, r) { return t * (1 - e) * (1 - e) * (1 - e) + 3 * n * (1 - e) * (1 - e) * e + 3 * o * (1 - e) * e * e + r * e * e * e }, Yr.prototype.clear = function () { var e = this._ctx, t = this._canvas; e.fillStyle = this.backgroundColor, e.clearRect(0, 0, t.width, t.height), e.fillRect(0, 0, t.width, t.height), this._data = [], this._reset(), this._isEmpty = !0 }, Yr.prototype.fromDataURL = function (e) { var t = this, n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, o = new Image, r = n.ratio || window.devicePixelRatio || 1, i = n.width || this._canvas.width / r, s = n.height || this._canvas.height / r; this._reset(), o.src = e, o.onload = function () { t._ctx.drawImage(o, 0, 0, i, s) }, this._isEmpty = !1 }, Yr.prototype.toDataURL = function (e) { var t; switch (e) { case "image/svg+xml": return this._toSVG(); default: for (var n = arguments.length, o = Array(n > 1 ? n - 1 : 0), r = 1; r < n; r++)o[r - 1] = arguments[r]; return (t = this._canvas).toDataURL.apply(t, [e].concat(o)) } }, Yr.prototype.on = function () { this._handleMouseEvents(), this._handleTouchEvents() }, Yr.prototype.off = function () { this._canvas.removeEventListener("mousedown", this._handleMouseDown), this._canvas.removeEventListener("mousemove", this._handleMouseMove), document.removeEventListener("mouseup", this._handleMouseUp), this._canvas.removeEventListener("touchstart", this._handleTouchStart), this._canvas.removeEventListener("touchmove", this._handleTouchMove), this._canvas.removeEventListener("touchend", this._handleTouchEnd) }, Yr.prototype.isEmpty = function () { return this._isEmpty }, Yr.prototype._strokeBegin = function (e) { this._data.push([]), this._reset(), this._strokeUpdate(e), "function" == typeof this.onBegin && this.onBegin(e) }, Yr.prototype._strokeUpdate = function (e) { var t = e.clientX, n = e.clientY, o = this._createPoint(t, n), r = this._data[this._data.length - 1], i = r && r[r.length - 1], s = i && o.distanceTo(i) < this.minDistance; if (!i || !s) { var a = this._addPoint(o), l = a.curve, u = a.widths; l && u && this._drawCurve(l, u.start, u.end), this._data[this._data.length - 1].push({ x: o.x, y: o.y, time: o.time, color: this.penColor }) } }, Yr.prototype._strokeEnd = function (e) { var t = this.points.length > 2, n = this.points[0]; if (!t && n && this._drawDot(n), n) { var o = this._data[this._data.length - 1], r = o[o.length - 1]; n.equals(r) || o.push({ x: n.x, y: n.y, time: n.time, color: this.penColor }) } "function" == typeof this.onEnd && this.onEnd(e) }, Yr.prototype._handleMouseEvents = function () { this._mouseButtonDown = !1, this._canvas.addEventListener("mousedown", this._handleMouseDown), this._canvas.addEventListener("mousemove", this._handleMouseMove), document.addEventListener("mouseup", this._handleMouseUp) }, Yr.prototype._handleTouchEvents = function () { this._canvas.style.msTouchAction = "none", this._canvas.style.touchAction = "none", this._canvas.addEventListener("touchstart", this._handleTouchStart), this._canvas.addEventListener("touchmove", this._handleTouchMove), this._canvas.addEventListener("touchend", this._handleTouchEnd) }, Yr.prototype._reset = function () { this.points = [], this._lastVelocity = 0, this._lastWidth = (this.minWidth + this.maxWidth) / 2, this._ctx.fillStyle = this.penColor }, Yr.prototype._createPoint = function (e, t, n) { var o = this._canvas.getBoundingClientRect(); return new Kr(e - o.left, t - o.top, n || (new Date).getTime()) }, Yr.prototype._addPoint = function (e) { var t = this.points; if (t.push(e), t.length > 2) { 3 === t.length && t.unshift(t[0]); var n = this._calculateCurveControlPoints(t[0], t[1], t[2]).c2, o = this._calculateCurveControlPoints(t[1], t[2], t[3]).c1, r = new Xr(t[1], n, o, t[2]), i = this._calculateCurveWidths(r); return t.shift(), { curve: r, widths: i } } return {} }, Yr.prototype._calculateCurveControlPoints = function (e, t, n) { var o = e.x - t.x, r = e.y - t.y, i = t.x - n.x, s = t.y - n.y, a = (e.x + t.x) / 2, l = (e.y + t.y) / 2, u = (t.x + n.x) / 2, c = (t.y + n.y) / 2, p = Math.sqrt(o * o + r * r), h = Math.sqrt(i * i + s * s), d = h / (p + h), f = u + (a - u) * d, g = c + (l - c) * d, y = t.x - f, m = t.y - g; return { c1: new Kr(a + y, l + m), c2: new Kr(u + y, c + m) } }, Yr.prototype._calculateCurveWidths = function (e) { var t = e.startPoint, n = e.endPoint, o = { start: null, end: null }, r = this.velocityFilterWeight * n.velocityFrom(t) + (1 - this.velocityFilterWeight) * this._lastVelocity, i = this._strokeWidth(r); return o.start = this._lastWidth, o.end = i, this._lastVelocity = r, this._lastWidth = i, o }, Yr.prototype._strokeWidth = function (e) { return Math.max(this.maxWidth / (e + 1), this.minWidth) }, Yr.prototype._drawPoint = function (e, t, n) { var o = this._ctx; o.moveTo(e, t), o.arc(e, t, n, 0, 2 * Math.PI, !1), this._isEmpty = !1 }, Yr.prototype._drawCurve = function (e, t, n) { var o = this._ctx, r = n - t, i = Math.floor(e.length()); o.beginPath(); for (var s = 0; s < i; s += 1) { var a = s / i, l = a * a, u = l * a, c = 1 - a, p = c * c, h = p * c, d = h * e.startPoint.x; d += 3 * p * a * e.control1.x, d += 3 * c * l * e.control2.x, d += u * e.endPoint.x; var f = h * e.startPoint.y; f += 3 * p * a * e.control1.y, f += 3 * c * l * e.control2.y, f += u * e.endPoint.y; var g = t + u * r; this._drawPoint(d, f, g) } o.closePath(), o.fill() }, Yr.prototype._drawDot = function (e) { var t = this._ctx, n = "function" == typeof this.dotSize ? this.dotSize() : this.dotSize; t.beginPath(), this._drawPoint(e.x, e.y, n), t.closePath(), t.fill() }, Yr.prototype._fromData = function (e, t, n) { for (var o = 0; o < e.length; o += 1) { var r = e[o]; if (r.length > 1) for (var i = 0; i < r.length; i += 1) { var s = r[i], a = new Kr(s.x, s.y, s.time), l = s.color; if (0 === i) this.penColor = l, this._reset(), this._addPoint(a); else if (i !== r.length - 1) { var u = this._addPoint(a), c = u.curve, p = u.widths; c && p && t(c, p, l) } } else this._reset(), n(r[0]) } }, Yr.prototype._toSVG = function () { var e = this, t = this._data, n = this._canvas, o = Math.max(window.devicePixelRatio || 1, 1), r = n.width / o, i = n.height / o, s = document.createElementNS("http://www.w3.org/2000/svg", "svg"); s.setAttributeNS(null, "width", n.width), s.setAttributeNS(null, "height", n.height), this._fromData(t, (function (e, t, n) { var o = document.createElement("path"); if (!(isNaN(e.control1.x) || isNaN(e.control1.y) || isNaN(e.control2.x) || isNaN(e.control2.y))) { var r = "M " + e.startPoint.x.toFixed(3) + "," + e.startPoint.y.toFixed(3) + " C " + e.control1.x.toFixed(3) + "," + e.control1.y.toFixed(3) + " " + e.control2.x.toFixed(3) + "," + e.control2.y.toFixed(3) + " " + e.endPoint.x.toFixed(3) + "," + e.endPoint.y.toFixed(3); o.setAttribute("d", r), o.setAttribute("stroke-width", (2.25 * t.end).toFixed(3)), o.setAttribute("stroke", n), o.setAttribute("fill", "none"), o.setAttribute("stroke-linecap", "round"), s.appendChild(o) } }), (function (t) { var n = document.createElement("circle"), o = "function" == typeof e.dotSize ? e.dotSize() : e.dotSize; n.setAttribute("r", o), n.setAttribute("cx", t.x), n.setAttribute("cy", t.y), n.setAttribute("fill", t.color), s.appendChild(n) })); var a = '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 ' + r + " " + i + '" width="' + r + '" height="' + i + '">', l = s.innerHTML; if (void 0 === l) { var u = document.createElement("dummy"), c = s.childNodes; u.innerHTML = ""; for (var p = 0; p < c.length; p += 1)u.appendChild(c[p].cloneNode(!0)); l = u.innerHTML } return "data:image/svg+xml;base64," + btoa(a + l + "</svg>") }, Yr.prototype.fromData = function (e) { var t = this; this.clear(), this._fromData(e, (function (e, n) { return t._drawCurve(e, n.start, n.end) }), (function (e) { return t._drawDot(e) })), this._data = e }, Yr.prototype.toData = function () { return this._data }; var Zr = Yr, ei = function () { var e = function (t, n) { return (e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (e, t) { e.__proto__ = t } || function (e, t) { for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]) })(t, n) }; return function (t, n) { if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null"); function o() { this.constructor = t } e(t, n), t.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o) } }(), ti = function (e, t, n, o) { var r, i = arguments.length, s = i < 3 ? t : null === o ? o = Object.getOwnPropertyDescriptor(t, n) : o; if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) s = Reflect.decorate(e, t, n, o); else for (var a = e.length - 1; a >= 0; a--)(r = e[a]) && (s = (i < 3 ? r(s) : i > 3 ? r(t, n, s) : r(t, n)) || s); return i > 3 && s && Object.defineProperty(t, n, s), s }; var ni = function (e) { function t(t) { return e.call(this, t) || this } return ei(t, e), t.prototype.getCssRoot = function (t) { return (new at).append(e.prototype.getCssRoot.call(this, t)).append(t.small, "300" === this.signatureWidth.toString()).toString() }, t.prototype.updateValue = function () { if (this.signaturePad) { var e = this.signaturePad.toDataURL(this.dataFormat); this.value = e } }, t.prototype.getType = function () { return "signaturepad" }, t.prototype.afterRenderQuestionElement = function (t) { t && this.initSignaturePad(t), e.prototype.afterRenderQuestionElement.call(this, t) }, t.prototype.beforeDestroyQuestionElement = function (e) { e && this.destroySignaturePad(e) }, t.prototype.initSignaturePad = function (e) { var t = this, n = e.getElementsByTagName("canvas")[0], o = new Zr(n, { backgroundColor: "#ffffff" }); this.isInputReadOnly && o.off(), this.readOnlyChangedCallback = function () { t.isInputReadOnly ? o.off() : o.on() }, o.penColor = this.penColor, o.backgroundColor = this.backgroundColor, o.onBegin = function () { t.isDrawingValue = !0, n.focus() }, o.onEnd = function () { t.isDrawingValue = !1, t.updateValue() }; var r = function () { var e = t.value; n.width = t.signatureWidth || 300, n.height = t.signatureHeight || 200, function (e) { var t = e.getContext("2d"), n = (window.devicePixelRatio || 1) / (t.webkitBackingStorePixelRatio || t.mozBackingStorePixelRatio || t.msBackingStorePixelRatio || t.oBackingStorePixelRatio || t.backingStorePixelRatio || 1), o = e.width, r = e.height; e.width = o * n, e.height = r * n, e.style.width = o + "px", e.style.height = r + "px", t.scale(n, n) }(n), e ? o.fromDataURL(e) : o.clear() }; r(), this.readOnlyChangedCallback(), this.signaturePad = o; var i = function (e, t) { "signatureWidth" !== t.name && "signatureHeight" !== t.name && "value" !== t.name || r() }; this.onPropertyChanged.add(i), this.signaturePad.propertyChangedHandler = i }, t.prototype.destroySignaturePad = function (e) { this.signaturePad && (this.onPropertyChanged.remove(this.signaturePad.propertyChangedHandler), this.signaturePad.off()), this.readOnlyChangedCallback = null, this.signaturePad = null }, Object.defineProperty(t.prototype, "signatureWidth", { get: function () { return this.getPropertyValue("signatureWidth") }, set: function (e) { this.setPropertyValue("signatureWidth", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "signatureHeight", { get: function () { return this.getPropertyValue("signatureHeight") }, set: function (e) { this.setPropertyValue("signatureHeight", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "height", { get: function () { return this.getPropertyValue("height") }, set: function (e) { this.setPropertyValue("height", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "allowClear", { get: function () { return this.getPropertyValue("allowClear") }, set: function (e) { this.setPropertyValue("allowClear", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "canShowClearButton", { get: function () { return !this.isInputReadOnly && this.allowClear }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "penColor", { get: function () { return this.getPropertyValue("penColor") }, set: function (e) { this.setPropertyValue("penColor", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "backgroundColor", { get: function () { return this.getPropertyValue("backgroundColor") }, set: function (e) { this.setPropertyValue("backgroundColor", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "clearButtonCaption", { get: function () { return this.getLocalizationString("clearCaption") }, enumerable: !1, configurable: !0 }), t.prototype.needShowPlaceholder = function () { return !this.isDrawingValue && this.isEmpty() }, Object.defineProperty(t.prototype, "placeHolderText", { get: function () { return this.getLocalizationString("signaturePlaceHolder") }, enumerable: !1, configurable: !0 }), t.prototype.endLoadingFromJson = function () { e.prototype.endLoadingFromJson.call(this), 300 === this.signatureWidth && this.width && "number" == typeof this.width && this.width && (console.warn("Use signatureWidth property to set width for the signature pad"), this.signatureWidth = this.width, this.width = void 0), 200 === this.signatureHeight && this.height && (console.warn("Use signatureHeight property to set width for the signature pad"), this.signatureHeight = this.height, this.height = void 0) }, ti([f({ defaultValue: !1 })], t.prototype, "isDrawingValue", void 0), ti([f({ defaultValue: "" })], t.prototype, "dataFormat", void 0), t }($t); _.addClass("signaturepad", [{ name: "signatureWidth:number", category: "general", default: 300 }, { name: "signatureHeight:number", category: "general", default: 200 }, { name: "height:number", category: "general", visible: !1 }, { name: "allowClear:boolean", category: "general", default: !0 }, { name: "penColor:color", category: "general", default: "#1ab394" }, { name: "backgroundColor:color", category: "general", default: "#ffffff" }, { name: "dataFormat", category: "general", default: "", choices: [{ value: "", text: "PNG" }, { value: "image/jpeg", text: "JPEG" }, { value: "image/svg+xml", text: "SVG" }] }, { name: "defaultValue", visible: !1 }, { name: "correctAnswer", visible: !1 }], (function () { return new ni("") }), "question"), rn.Instance.registerQuestion("signaturepad", (function (e) { return new ni(e) })); var oi = function () { var e = function (t, n) { return (e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (e, t) { e.__proto__ = t } || function (e, t) { for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]) })(t, n) }; return function (t, n) { if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null"); function o() { this.constructor = t } e(t, n), t.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o) } }(), ri = function (e, t, n, o) { var r, i = arguments.length, s = i < 3 ? t : null === o ? o = Object.getOwnPropertyDescriptor(t, n) : o; if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) s = Reflect.decorate(e, t, n, o); else for (var a = e.length - 1; a >= 0; a--)(r = e[a]) && (s = (i < 3 ? r(s) : i > 3 ? r(t, n, s) : r(t, n)) || s); return i > 3 && s && Object.defineProperty(t, n, s), s }, ii = function (e, t) { for (var n = 0, o = t.length, r = e.length; n < o; n++, r++)e[r] = t[n]; return e }, si = function (e) { function t(t, n, o) { var r = e.call(this, o) || this; return r.data = t, r.panelItem = n, r.variableName = o, r.sharedQuestions = {}, r } return oi(t, e), Object.defineProperty(t.prototype, "survey", { get: function () { return this.panelItem.getSurvey() }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "panel", { get: function () { return this.panelItem.panel }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "panelIndex", { get: function () { return this.data ? this.data.getItemIndex(this.panelItem) : -1 }, enumerable: !1, configurable: !0 }), t.prototype.getValues = function () { return this.panelItem.getAllValues() }, t.prototype.getQuestionByName = function (t) { var n = e.prototype.getQuestionByName.call(this, t); if (n) return n; var o = this.panelIndex, r = (n = o > -1 ? this.data.getSharedQuestionFromArray(t, o) : void 0) ? n.name : t; return this.sharedQuestions[r] = t, n }, t.prototype.getQuestionDisplayText = function (t) { var n = this.sharedQuestions[t.name]; if (!n) return e.prototype.getQuestionDisplayText.call(this, t); var o = this.panelItem.getValue(n); return t.getDisplayValue(!0, o) }, t.prototype.onCustomProcessText = function (e) { if (e.name == ai.IndexVariableName) { var n = this.panelIndex; if (n > -1) return e.isExists = !0, e.value = n + 1, !0 } if (0 == e.name.toLowerCase().indexOf(ai.ParentItemVariableName + ".")) { var o = this.data; if (o && o.parentQuestion && o.parent && o.parent.data) { var r = new t(o.parentQuestion, o.parent.data, ai.ItemVariableName), i = ai.ItemVariableName + e.name.substring(ai.ParentItemVariableName.length), s = r.processValue(i, e.returnDisplayValue); e.isExists = s.isExists, e.value = s.value } return !0 } return !1 }, t }(on), ai = function () { function e(t, n) { this.data = t, this.panelValue = n, this.textPreProcessor = new si(t, this, e.ItemVariableName), this.setSurveyImpl() } return Object.defineProperty(e.prototype, "panel", { get: function () { return this.panelValue }, enumerable: !1, configurable: !0 }), e.prototype.setSurveyImpl = function () { this.panel.setSurveyImpl(this) }, e.prototype.getValue = function (e) { return this.getAllValues()[e] }, e.prototype.setValue = function (e, t) { var n = this.data.getPanelItemData(this), o = n ? n[e] : void 0; if (!r.isTwoValueEquals(t, o)) { this.data.setPanelItemData(this, e, r.getUnbindValue(t)); for (var i = this.panel.questions, s = 0; s < i.length; s++)i[s].getValueName() !== e && i[s].checkBindings(e, t) } }, e.prototype.getVariable = function (e) { }, e.prototype.setVariable = function (e, t) { }, e.prototype.getComment = function (e) { var t = this.getValue(e + o.commentSuffix); return t || "" }, e.prototype.setComment = function (e, t, n) { this.setValue(e + o.commentSuffix, t) }, e.prototype.findQuestionByName = function (t) { if (t) { var n = e.ItemVariableName + "."; if (0 === t.indexOf(n)) return this.panel.getQuestionByName(t.substring(n.length)); var o = this.getSurvey(); return o ? o.getQuestionByName(t) : null } }, e.prototype.getAllValues = function () { return this.data.getPanelItemData(this) }, e.prototype.getFilteredValues = function () { var t = {}, n = this.data && this.data.getRootData() ? this.data.getRootData().getFilteredValues() : {}; for (var o in n) t[o] = n[o]; if (t[e.ItemVariableName] = this.getAllValues(), this.data) { t[e.IndexVariableName.toLowerCase()] = this.data.getItemIndex(this); var r = this.data; r && r.parentQuestion && r.parent && (t[e.ParentItemVariableName] = r.parent.getValue()) } return t }, e.prototype.getFilteredProperties = function () { return this.data && this.data.getRootData() ? this.data.getRootData().getFilteredProperties() : { survey: this.getSurvey() } }, e.prototype.getSurveyData = function () { return this }, e.prototype.getSurvey = function () { return this.data ? this.data.getSurvey() : null }, e.prototype.getTextProcessor = function () { return this.textPreProcessor }, e.ItemVariableName = "panel", e.ParentItemVariableName = "parentpanel", e.IndexVariableName = "panelIndex", e }(), li = function () { function e(e) { this.data = e } return e.prototype.getSurveyData = function () { return null }, e.prototype.getSurvey = function () { return this.data.getSurvey() }, e.prototype.getTextProcessor = function () { return null }, e }(), ui = function (e) { function t(t) { var n = e.call(this, t) || this; return n.loadingPanelCount = 0, n.isAddingNewPanels = !1, n.onReadyChangedCallback = function () { n.recalculateIsReadyValue() }, n.isSetPanelItemData = {}, n.createNewArray("panels"), n.templateValue = n.createAndSetupNewPanelObject(), n.template.renderWidth = "100%", n.template.selectedElementInDesign = n, n.template.addElementCallback = function (e) { n.addOnPropertyChangedCallback(e), n.rebuildPanels() }, n.template.removeElementCallback = function () { n.rebuildPanels() }, n.createLocalizableString("confirmDeleteText", n, !1, "confirmDelete"), n.createLocalizableString("keyDuplicationError", n, !1, !0), n.createLocalizableString("panelAddText", n, !1, "addPanel"), n.createLocalizableString("panelRemoveText", n, !1, "removePanel"), n.createLocalizableString("panelPrevText", n, !1, "pagePrevText"), n.createLocalizableString("panelNextText", n, !1, "pageNextText"), n.createLocalizableString("noEntriesText", n, !1, "noEntriesText"), n.registerPropertyChangedHandlers(["panelsState"], (function () { n.setPanelsState() })), n.registerPropertyChangedHandlers(["isMobile"], (function () { n.updateFooterActions() })), n } return oi(t, e), Object.defineProperty(t.prototype, "hasSingleInput", { get: function () { return !1 }, enumerable: !1, configurable: !0 }), t.prototype.getFirstQuestionToFocus = function (e) { for (var t = 0; t < this.panels.length; t++) { var n = this.panels[t].getFirstQuestionToFocus(e); if (n) return n } return null }, t.prototype.setSurveyImpl = function (t, n) { e.prototype.setSurveyImpl.call(this, t, n), this.setTemplatePanelSurveyImpl(), this.setPanelsSurveyImpl() }, t.prototype.assignOnPropertyChangedToTemplate = function () { for (var e = this.template.elements, t = 0; t < e.length; t++)this.addOnPropertyChangedCallback(e[t]) }, t.prototype.addOnPropertyChangedCallback = function (e) { var t = this; e.isQuestion && e.setParentQuestion(this), e.onPropertyChanged.add((function (e, n) { t.onTemplateElementPropertyChanged(e, n) })), e.isPanel && (e.addElementCallback = function (e) { t.addOnPropertyChangedCallback(e) }) }, t.prototype.onTemplateElementPropertyChanged = function (e, t) { if (!this.isLoadingFromJson && !this.useTemplatePanel && 0 != this.panels.length && _.findProperty(e.getType(), t.name)) for (var n = this.panels, o = 0; o < n.length; o++) { var r = n[o].getQuestionByName(e.name); r && r[t.name] !== t.newValue && (r[t.name] = t.newValue) } }, Object.defineProperty(t.prototype, "useTemplatePanel", { get: function () { return this.isDesignMode && !this.isContentElement }, enumerable: !1, configurable: !0 }), t.prototype.getType = function () { return "paneldynamic" }, Object.defineProperty(t.prototype, "isCompositeQuestion", { get: function () { return !0 }, enumerable: !1, configurable: !0 }), t.prototype.clearOnDeletingContainer = function () { this.panels.forEach((function (e) { e.clearOnDeletingContainer() })) }, Object.defineProperty(t.prototype, "isAllowTitleLeft", { get: function () { return !1 }, enumerable: !1, configurable: !0 }), t.prototype.removeElement = function (e) { return this.template.removeElement(e) }, Object.defineProperty(t.prototype, "template", { get: function () { return this.templateValue }, enumerable: !1, configurable: !0 }), t.prototype.getPanel = function () { return this.template }, Object.defineProperty(t.prototype, "templateElements", { get: function () { return this.template.elements }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "templateTitle", { get: function () { return this.template.title }, set: function (e) { this.template.title = e }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "locTemplateTitle", { get: function () { return this.template.locTitle }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "templateDescription", { get: function () { return this.template.description }, set: function (e) { this.template.description = e }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "locTemplateDescription", { get: function () { return this.template.locDescription }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "items", { get: function () { for (var e = [], t = 0; t < this.panels.length; t++)e.push(this.panels[t].data); return e }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "panels", { get: function () { return this.getPropertyValue("panels") }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "currentIndex", { get: function () { return this.isRenderModeList ? -1 : this.useTemplatePanel ? 0 : (this.currentIndexValue < 0 && this.panelCount > 0 && (this.currentIndexValue = 0), this.currentIndexValue >= this.panelCount && (this.currentIndexValue = this.panelCount - 1), this.currentIndexValue) }, set: function (e) { this.currentIndexValue !== e && (e >= this.panelCount && (e = this.panelCount - 1), this.currentIndexValue = e, this.updateFooterActions(), this.fireCallback(this.currentIndexChangedCallback)) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "currentIndexValue", { get: function () { return this.getPropertyValue("currentIndexValue", -1) }, set: function (e) { this.setPropertyValue("currentIndexValue", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "currentPanel", { get: function () { var e = this.currentIndex; return e < 0 || e >= this.panels.length ? null : this.panels[e] }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "confirmDelete", { get: function () { return this.getPropertyValue("confirmDelete", !1) }, set: function (e) { this.setPropertyValue("confirmDelete", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "keyName", { get: function () { return this.getPropertyValue("keyName", "") }, set: function (e) { this.setPropertyValue("keyName", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "confirmDeleteText", { get: function () { return this.getLocalizableStringText("confirmDeleteText") }, set: function (e) { this.setLocalizableStringText("confirmDeleteText", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "locConfirmDeleteText", { get: function () { return this.getLocalizableString("confirmDeleteText") }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "keyDuplicationError", { get: function () { return this.getLocalizableStringText("keyDuplicationError") }, set: function (e) { this.setLocalizableStringText("keyDuplicationError", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "locKeyDuplicationError", { get: function () { return this.getLocalizableString("keyDuplicationError") }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "panelPrevText", { get: function () { return this.getLocalizableStringText("panelPrevText") }, set: function (e) { this.setLocalizableStringText("panelPrevText", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "locPanelPrevText", { get: function () { return this.getLocalizableString("panelPrevText") }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "panelNextText", { get: function () { return this.getLocalizableStringText("panelNextText") }, set: function (e) { this.setLocalizableStringText("panelNextText", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "locPanelNextText", { get: function () { return this.getLocalizableString("panelNextText") }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "panelAddText", { get: function () { return this.getLocalizableStringText("panelAddText") }, set: function (e) { this.setLocalizableStringText("panelAddText", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "locPanelAddText", { get: function () { return this.getLocalizableString("panelAddText") }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "panelRemoveText", { get: function () { return this.getLocalizableStringText("panelRemoveText") }, set: function (e) { this.setLocalizableStringText("panelRemoveText", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "locPanelRemoveText", { get: function () { return this.getLocalizableString("panelRemoveText") }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "isProgressTopShowing", { get: function () { return "progressTop" === this.renderMode || "progressTopBottom" === this.renderMode }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "isProgressBottomShowing", { get: function () { return "progressBottom" === this.renderMode || "progressTopBottom" === this.renderMode }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "isPrevButtonVisible", { get: function () { return this.currentIndex > 0 }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "isPrevButtonShowing", { get: function () { return this.isPrevButtonVisible }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "isNextButtonVisible", { get: function () { return this.currentIndex >= 0 && this.currentIndex < this.panelCount - 1 }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "isNextButtonShowing", { get: function () { return this.isNextButtonVisible }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "isRangeShowing", { get: function () { return this.showRangeInProgress && this.currentIndex >= 0 && this.panelCount > 1 }, enumerable: !1, configurable: !0 }), t.prototype.getElementsInDesign = function (e) { return void 0 === e && (e = !1), e ? [this.template] : this.templateElements }, t.prototype.prepareValueForPanelCreating = function () { this.addingNewPanelsValue = this.value, this.isAddingNewPanels = !0, this.isNewPanelsValueChanged = !1 }, t.prototype.setValueAfterPanelsCreating = function () { this.isAddingNewPanels = !1, this.isNewPanelsValueChanged && (this.isValueChangingInternally = !0, this.value = this.addingNewPanelsValue, this.isValueChangingInternally = !1) }, t.prototype.getValueCore = function () { return this.isAddingNewPanels ? this.addingNewPanelsValue : e.prototype.getValueCore.call(this) }, t.prototype.setValueCore = function (t) { this.isAddingNewPanels ? (this.isNewPanelsValueChanged = !0, this.addingNewPanelsValue = t) : e.prototype.setValueCore.call(this, t) }, Object.defineProperty(t.prototype, "panelCount", { get: function () { return this.isLoadingFromJson || this.useTemplatePanel ? this.loadingPanelCount : this.panels.length }, set: function (e) { if (!(e < 0)) if (this.isLoadingFromJson || this.useTemplatePanel) this.loadingPanelCount = e; else if (e != this.panels.length && !this.useTemplatePanel) { this.updateBindings("panelCount", e), this.prepareValueForPanelCreating(); for (var t = this.panelCount; t < e; t++) { var n = this.createNewPanel(); this.panels.push(n), "list" == this.renderMode && "default" != this.panelsState && ("expand" === this.panelsState ? n.expand() : n.title && n.collapse()) } e < this.panelCount && this.panels.splice(e, this.panelCount - e), this.setValueAfterPanelsCreating(), this.setValueBasedOnPanelCount(), this.reRunCondition(), this.updateFooterActions(), this.fireCallback(this.panelCountChangedCallback) } }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "panelsState", { get: function () { return this.getPropertyValue("panelsState") }, set: function (e) { this.setPropertyValue("panelsState", e) }, enumerable: !1, configurable: !0 }), t.prototype.setTemplatePanelSurveyImpl = function () { this.template.setSurveyImpl(this.useTemplatePanel ? this.surveyImpl : new li(this)) }, t.prototype.setPanelsSurveyImpl = function () { for (var e = 0; e < this.panels.length; e++) { var t = this.panels[e]; t != this.template && t.setSurveyImpl(t.data) } }, t.prototype.setPanelsState = function () { if (!this.useTemplatePanel && "list" == this.renderMode && this.templateTitle) for (var e = 0; e < this.panels.length; e++) { var t = this.panelsState; "firstExpanded" === t && (t = 0 === e ? "expanded" : "collapsed"), this.panels[e].state = t } }, t.prototype.setValueBasedOnPanelCount = function () { var e = this.value; if (e && Array.isArray(e) || (e = []), e.length != this.panelCount) { for (var t = e.length; t < this.panelCount; t++)e.push({}); e.length > this.panelCount && e.splice(this.panelCount, e.length - this.panelCount), this.isValueChangingInternally = !0, this.value = e, this.isValueChangingInternally = !1 } }, Object.defineProperty(t.prototype, "minPanelCount", { get: function () { return this.getPropertyValue("minPanelCount") }, set: function (e) { e < 0 && (e = 0), e != this.minPanelCount && (this.setPropertyValue("minPanelCount", e), e > this.maxPanelCount && (this.maxPanelCount = e), this.panelCount < e && (this.panelCount = e)) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "maxPanelCount", { get: function () { return this.getPropertyValue("maxPanelCount") }, set: function (e) { e <= 0 || (e > o.panelMaximumPanelCount && (e = o.panelMaximumPanelCount), e != this.maxPanelCount && (this.setPropertyValue("maxPanelCount", e), e < this.minPanelCount && (this.minPanelCount = e), this.panelCount > e && (this.panelCount = e))) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "allowAddPanel", { get: function () { return this.getPropertyValue("allowAddPanel") }, set: function (e) { this.setPropertyValue("allowAddPanel", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "allowRemovePanel", { get: function () { return this.getPropertyValue("allowRemovePanel") }, set: function (e) { this.setPropertyValue("allowRemovePanel", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "templateTitleLocation", { get: function () { return this.getPropertyValue("templateTitleLocation") }, set: function (e) { this.setPropertyValue("templateTitleLocation", e.toLowerCase()) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "showQuestionNumbers", { get: function () { return this.getPropertyValue("showQuestionNumbers") }, set: function (e) { this.setPropertyValue("showQuestionNumbers", e), !this.isLoadingFromJson && this.survey && this.survey.questionVisibilityChanged(this, this.visible) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "panelRemoveButtonLocation", { get: function () { return this.getPropertyValue("panelRemoveButtonLocation") }, set: function (e) { this.setPropertyValue("panelRemoveButtonLocation", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "showRangeInProgress", { get: function () { return this.getPropertyValue("showRangeInProgress") }, set: function (e) { this.setPropertyValue("showRangeInProgress", e), this.updateFooterActions(), this.fireCallback(this.currentIndexChangedCallback) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "renderMode", { get: function () { return this.getPropertyValue("renderMode") }, set: function (e) { this.setPropertyValue("renderMode", e), this.updateFooterActions(), this.fireCallback(this.renderModeChangedCallback) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "isRenderModeList", { get: function () { return "list" === this.renderMode }, enumerable: !1, configurable: !0 }), t.prototype.setVisibleIndex = function (t) { if (!this.isVisible) return 0; for (var n = "onSurvey" == this.showQuestionNumbers ? t : 0, o = 0; o < this.panels.length; o++) { var r = this.setPanelVisibleIndex(this.panels[o], n, "off" != this.showQuestionNumbers); "onSurvey" == this.showQuestionNumbers && (n += r) } return e.prototype.setVisibleIndex.call(this, "onSurvey" != this.showQuestionNumbers ? t : -1), "onSurvey" != this.showQuestionNumbers ? 1 : n - t }, t.prototype.setPanelVisibleIndex = function (e, t, n) { return n ? e.setVisibleIndex(t) : (e.setVisibleIndex(-1), 0) }, Object.defineProperty(t.prototype, "canAddPanel", { get: function () { return !this.isDesignMode && (!(this.isDefaultV2Theme && !this.legacyNavigation && !this.isRenderModeList && this.currentIndex < this.panelCount - 1) && (this.allowAddPanel && !this.isReadOnly && this.panelCount < this.maxPanelCount)) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "canRemovePanel", { get: function () { return !this.isDesignMode && (this.allowRemovePanel && !this.isReadOnly && this.panelCount > this.minPanelCount) }, enumerable: !1, configurable: !0 }), t.prototype.rebuildPanels = function () { var e; if (!this.isLoadingFromJson) { this.prepareValueForPanelCreating(); var t = []; if (this.useTemplatePanel) new ai(this, this.template), t.push(this.template); else for (var n = 0; n < this.panelCount; n++)this.createNewPanel(), t.push(this.createNewPanel()); (e = this.panels).splice.apply(e, ii([0, this.panels.length], t)), this.setValueAfterPanelsCreating(), this.setPanelsState(), this.reRunCondition(), this.updateFooterActions(), this.fireCallback(this.panelCountChangedCallback) } }, Object.defineProperty(t.prototype, "defaultPanelValue", { get: function () { return this.getPropertyValue("defaultPanelValue") }, set: function (e) { this.setPropertyValue("defaultPanelValue", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "defaultValueFromLastPanel", { get: function () { return this.getPropertyValue("defaultValueFromLastPanel", !1) }, set: function (e) { this.setPropertyValue("defaultValueFromLastPanel", e) }, enumerable: !1, configurable: !0 }), t.prototype.isDefaultValueEmpty = function () { return e.prototype.isDefaultValueEmpty.call(this) && this.isValueEmpty(this.defaultPanelValue) }, t.prototype.setDefaultValue = function () { if (!this.isValueEmpty(this.defaultPanelValue) && this.isValueEmpty(this.defaultValue)) { if (this.isEmpty() && 0 != this.panelCount) { for (var t = [], n = 0; n < this.panelCount; n++)t.push(this.defaultPanelValue); this.value = t } } else e.prototype.setDefaultValue.call(this) }, t.prototype.isEmpty = function () { var e = this.value; if (!e || !Array.isArray(e)) return !0; for (var t = 0; t < e.length; t++)if (!this.isRowEmpty(e[t])) return !1; return !0 }, t.prototype.getProgressInfo = function () { return At.getProgressInfoByElements(this.panels, this.isRequired) }, t.prototype.isRowEmpty = function (e) { for (var t in e) if (e.hasOwnProperty(t)) return !1; return !0 }, t.prototype.addPanelUI = function () { if (!this.canAddPanel) return null; if (!this.canLeaveCurrentPanel()) return null; var e = this.addPanel(); return "list" === this.renderMode && "default" !== this.panelsState && e.expand(), e }, t.prototype.addPanel = function () { this.panelCount++, this.isRenderModeList || (this.currentIndex = this.panelCount - 1); var e = this.value, t = !1; return this.isValueEmpty(this.defaultPanelValue) || e && Array.isArray(e) && e.length == this.panelCount && (t = !0, this.copyValue(e[e.length - 1], this.defaultPanelValue)), this.defaultValueFromLastPanel && e && Array.isArray(e) && e.length > 1 && e.length == this.panelCount && (t = !0, this.copyValue(e[e.length - 1], e[e.length - 2])), t && (this.value = e), this.survey && this.survey.dynamicPanelAdded(this), this.panels[this.panelCount - 1] }, t.prototype.canLeaveCurrentPanel = function () { return !("list" !== this.renderMode && this.currentPanel && this.currentPanel.hasErrors(!0, !0)) }, t.prototype.copyValue = function (e, t) { for (var n in t) e[n] = t[n] }, t.prototype.removePanelUI = function (e) { this.canRemovePanel && (this.confirmDelete && !Be(this.confirmDeleteText) || this.removePanel(e)) }, t.prototype.goToNextPanel = function () { return !(this.currentIndex < 0) && (!!this.canLeaveCurrentPanel() && (this.currentIndex++, !0)) }, t.prototype.goToPrevPanel = function () { this.currentIndex < 0 || this.currentIndex-- }, t.prototype.removePanel = function (e) { var t = this.getPanelIndex(e); if (!(t < 0 || t >= this.panelCount)) { var n = this.panels[t]; if (!this.survey || this.survey.dynamicPanelRemoving(this, t, n)) this.panels.splice(t, 1), this.updateBindings("panelCount", this.panelCount), !(e = this.value) || !Array.isArray(e) || t >= e.length || (this.isValueChangingInternally = !0, e.splice(t, 1), this.value = e, this.updateFooterActions(), this.fireCallback(this.panelCountChangedCallback), this.survey && this.survey.dynamicPanelRemoved(this, t, n), this.isValueChangingInternally = !1) } }, t.prototype.getPanelIndex = function (e) { if (r.isNumber(e)) return e; for (var t = this.items, n = 0; n < this.panels.length; n++)if (this.panels[n] === e || t[n] === e) return n; return -1 }, t.prototype.locStrsChanged = function () { e.prototype.locStrsChanged.call(this); for (var t = this.panels, n = 0; n < t.length; n++)t[n].locStrsChanged() }, t.prototype.clearIncorrectValues = function () { for (var e = 0; e < this.panels.length; e++)this.clearIncorrectValuesInPanel(e) }, t.prototype.clearErrors = function () { e.prototype.clearErrors.call(this); for (var t = 0; t < this.panels.length; t++)this.panels[t].clearErrors() }, t.prototype.getQuestionFromArray = function (e, t) { return t >= this.panelCount ? null : this.panels[t].getQuestionByName(e) }, t.prototype.clearIncorrectValuesInPanel = function (e) { var t = this.panels[e]; t.clearIncorrectValues(); var n = this.value, r = n && e < n.length ? n[e] : null; if (r) { var i = !1; for (var s in r) { if (!this.getSharedQuestionFromArray(s, e)) t.getQuestionByName(s) || this.iscorrectValueWithPostPrefix(t, s, o.commentSuffix) || this.iscorrectValueWithPostPrefix(t, s, o.matrixTotalValuePostFix) || (delete r[s], i = !0) } i && (n[e] = r, this.value = n) } }, t.prototype.iscorrectValueWithPostPrefix = function (e, t, n) { return t.indexOf(n) === t.length - n.length && !!e.getQuestionByName(t.substring(0, t.indexOf(n))) }, t.prototype.getSharedQuestionFromArray = function (e, t) { return this.survey && this.valueName ? this.survey.getQuestionByValueNameFromArray(this.valueName, e, t) : null }, t.prototype.addConditionObjectsByContext = function (e, t) { for (var n = !!t && (!0 === t || this.template.questions.indexOf(t) > -1), r = new Array, i = this.template.questions, s = 0; s < i.length; s++)i[s].addConditionObjectsByContext(r, t); for (var a = 0; a < o.panelDynamicMaxPanelCountInCondition; a++) { var l = "[" + a + "].", u = this.getValueName() + l, c = this.processedTitle + l; for (s = 0; s < r.length; s++)e.push({ name: u + r[s].name, text: c + r[s].text, question: r[s].question }) } if (n) for (u = !0 === t ? this.getValueName() + "." : "", c = !0 === t ? this.processedTitle + "." : "", s = 0; s < r.length; s++)if (r[s].question != t) { var p = { name: u + "panel." + r[s].name, text: c + "panel." + r[s].text, question: r[s].question }; !0 === t && (p.context = this), e.push(p) } }, t.prototype.getConditionJson = function (t, n) { if (void 0 === t && (t = null), void 0 === n && (n = null), !n) return e.prototype.getConditionJson.call(this, t, n); var o = n, r = n.indexOf("."); r > -1 && (o = n.substring(0, r), n = n.substring(r + 1)); var i = this.template.getQuestionByName(o); return i ? i.getConditionJson(t, n) : null }, t.prototype.onReadOnlyChanged = function () { var t = this.isReadOnly; this.template.readOnly = t; for (var n = 0; n < this.panels.length; n++)this.panels[n].readOnly = t; this.updateNoEntriesTextDefaultLoc(), e.prototype.onReadOnlyChanged.call(this) }, t.prototype.updateNoEntriesTextDefaultLoc = function () { var e = this.getLocalizableString("noEntriesText"); e && (e.localizationName = this.isReadOnly ? "noEntriesReadonlyText" : "noEntriesText", e.strChanged()) }, t.prototype.onSurveyLoad = function () { if (this.template.readOnly = this.isReadOnly, this.template.onSurveyLoad(), this.loadingPanelCount > 0 && (this.panelCount = this.loadingPanelCount), this.useTemplatePanel && this.rebuildPanels(), this.setPanelsSurveyImpl(), this.setPanelsState(), this.assignOnPropertyChangedToTemplate(), this.survey) for (var t = 0; t < this.panelCount; t++)this.survey.dynamicPanelAdded(this); this.recalculateIsReadyValue(), this.isReadOnly && this.updateNoEntriesTextDefaultLoc(), e.prototype.onSurveyLoad.call(this) }, t.prototype.onFirstRendering = function () { this.template.onFirstRendering(); for (var t = 0; t < this.panels.length; t++)this.panels[t].onFirstRendering(); e.prototype.onFirstRendering.call(this) }, t.prototype.localeChanged = function () { e.prototype.localeChanged.call(this); for (var t = 0; t < this.panels.length; t++)this.panels[t].localeChanged() }, t.prototype.runCondition = function (t, n) { e.prototype.runCondition.call(this, t, n), this.runPanelsCondition(t, n) }, t.prototype.reRunCondition = function () { this.data && this.runCondition(this.getDataFilteredValues(), this.getDataFilteredProperties()) }, t.prototype.runPanelsCondition = function (e, t) { var n = {}; e && e instanceof Object && (n = JSON.parse(JSON.stringify(e))), this.parentQuestion && this.parent && (n[ai.ParentItemVariableName] = this.parent.getValue()); for (var o = 0; o < this.panels.length; o++) { var i = this.getPanelItemData(this.panels[o].data), s = r.createCopy(n); s[ai.ItemVariableName.toLowerCase()] = i, s[ai.IndexVariableName.toLowerCase()] = o, this.panels[o].runCondition(s, t) } }, t.prototype.onAnyValueChanged = function (t) { e.prototype.onAnyValueChanged.call(this, t); for (var n = 0; n < this.panels.length; n++)this.panels[n].onAnyValueChanged(t), this.panels[n].onAnyValueChanged(ai.ItemVariableName) }, t.prototype.hasKeysDuplicated = function (e, t) { void 0 === t && (t = null); for (var n, o = [], r = 0; r < this.panels.length; r++)n = this.isValueDuplicated(this.panels[r], o, t, e) || n; return n }, t.prototype.updatePanelsContainsErrors = function () { for (var e = this.changingValueQuestion.parent; e;)e.updateContainsErrors(), e = e.parent; this.updateContainsErrors() }, t.prototype.hasErrors = function (t, n) { if (void 0 === t && (t = !0), void 0 === n && (n = null), this.isValueChangingInternally) return !1; var o = !1; if (this.changingValueQuestion) { o = this.changingValueQuestion.hasErrors(t, n); return o = this.hasKeysDuplicated(t, n) || o, this.updatePanelsContainsErrors(), o } var r = this.hasErrorInPanels(t, n); return e.prototype.hasErrors.call(this, t) || r }, t.prototype.getContainsErrors = function () { var t = e.prototype.getContainsErrors.call(this); if (t) return t; for (var n = this.panels, o = 0; o < n.length; o++)if (n[o].containsErrors) return !0; return !1 }, t.prototype.getIsAnswered = function () { if (!e.prototype.getIsAnswered.call(this)) return !1; for (var t = this.panels, n = 0; n < t.length; n++) { var o = []; t[n].addQuestionsToList(o, !0); for (var r = 0; r < o.length; r++)if (!o[r].isAnswered) return !1 } return !0 }, t.prototype.clearValueIfInvisibleCore = function () { for (var t = 0; t < this.panels.length; t++) { var n = this.panels[t].questions; this.isSetPanelItemData = {}; for (var o = 0; o < n.length; o++) { var r = n[o]; r.clearValueIfInvisible(), this.isSetPanelItemData[r.getValueName()] = this.maxCheckCount + 1 } } this.isSetPanelItemData = {}, e.prototype.clearValueIfInvisibleCore.call(this) }, t.prototype.getIsRunningValidators = function () { if (e.prototype.getIsRunningValidators.call(this)) return !0; for (var t = 0; t < this.panels.length; t++)for (var n = this.panels[t].questions, o = 0; o < n.length; o++)if (n[o].isRunningValidators) return !0; return !1 }, t.prototype.getAllErrors = function () { for (var t = e.prototype.getAllErrors.call(this), n = 0; n < this.panels.length; n++)for (var o = this.panels[n].questions, r = 0; r < o.length; r++) { var i = o[r].getAllErrors(); i && i.length > 0 && (t = t.concat(i)) } return t }, t.prototype.getDisplayValueCore = function (e, t) { var n = this.getUnbindValue(t); if (!n || !Array.isArray(n)) return n; for (var o = 0; o < this.panels.length && o < n.length; o++) { var r = n[o]; r && (n[o] = this.getPanelDisplayValue(o, r, e)) } return n }, t.prototype.getPanelDisplayValue = function (e, t, n) { if (!t) return t; for (var o = this.panels[e], r = Object.keys(t), i = 0; i < r.length; i++) { var s = r[i], a = o.getQuestionByValueName(s); if (a || (a = this.getSharedQuestionFromArray(s, e)), a) { var l = a.getDisplayValue(n, t[s]); t[s] = l, n && a.title && a.title !== s && (t[a.title] = l, delete t[s]) } } return t }, t.prototype.hasErrorInPanels = function (e, t) { for (var n = !1, o = this.panels, r = [], i = 0; i < o.length; i++)this.setOnCompleteAsyncInPanel(o[i]); for (i = 0; i < o.length; i++) { var s = o[i].hasErrors(e, !!t && t.focuseOnFirstError, t); s = this.isValueDuplicated(o[i], r, t, e) || s, this.isRenderModeList || !s || n || (this.currentIndex = i), n = s || n } return n }, t.prototype.setOnCompleteAsyncInPanel = function (e) { for (var t = this, n = e.questions, o = 0; o < n.length; o++)n[o].onCompletedAsyncValidators = function (e) { t.raiseOnCompletedAsyncValidators() } }, t.prototype.isValueDuplicated = function (e, t, n, o) { if (!this.keyName) return !1; var r = e.getQuestionByValueName(this.keyName); if (!r || r.isEmpty()) return !1; var i = r.value; this.changingValueQuestion && r != this.changingValueQuestion && r.hasErrors(o, n); for (var s = 0; s < t.length; s++)if (i == t[s]) return o && r.addError(new Te(this.keyDuplicationError, this)), n && !n.firstErrorQuestion && (n.firstErrorQuestion = r), !0; return t.push(i), !1 }, t.prototype.getPanelActions = function (e) { var t = this, n = e.footerActions; return "right" !== this.panelRemoveButtonLocation && n.push(new Tt({ id: "remove-panel-" + e.id, component: "sv-paneldynamic-remove-btn", visible: new ue((function () { return [t.canRemovePanel, "collapsed" !== e.state, "right" !== t.panelRemoveButtonLocation].every((function (e) { return !0 === e })) })), data: { question: this, panel: e } })), this.survey && (n = this.survey.getUpdatedPanelFooterActions(e, n, this)), n }, t.prototype.createNewPanel = function () { var e = this, t = this.createAndSetupNewPanelObject(), n = this.template.toJSON(); (new S).toObject(n, t), t.renderWidth = "100%", t.updateCustomWidgets(), new ai(this, t), t.onFirstRendering(); for (var o = t.questions, r = 0; r < o.length; r++)o[r].setParentQuestion(this); return t.locStrsChanged(), t.onGetFooterActionsCallback = function () { return e.getPanelActions(t) }, t.footerToolbarCss = this.cssClasses.panelFooter, t }, t.prototype.createAndSetupNewPanelObject = function () { var e = this.createNewPanelObject(); e.isInteractiveDesignElement = !1, e.setParentQuestion(this); var t = this; return e.onGetQuestionTitleLocation = function () { return t.getTemplateQuestionTitleLocation() }, e }, t.prototype.getTemplateQuestionTitleLocation = function () { return "default" != this.templateTitleLocation ? this.templateTitleLocation : this.getTitleLocationCore() }, t.prototype.createNewPanelObject = function () { return _.createClass("panel") }, t.prototype.setPanelCountBasedOnValue = function () { if (!this.isValueChangingInternally && !this.useTemplatePanel) { var e = this.value, t = e && Array.isArray(e) ? e.length : 0; 0 == t && this.loadingPanelCount > 0 && (t = this.loadingPanelCount), this.panelCount = t } }, t.prototype.setQuestionValue = function (t) { e.prototype.setQuestionValue.call(this, t, !1), this.setPanelCountBasedOnValue(); for (var n = 0; n < this.panels.length; n++)this.panelUpdateValueFromSurvey(this.panels[n]); this.updateIsAnswered() }, t.prototype.onSurveyValueChanged = function (t) { if (void 0 !== t || !this.isAllPanelsEmpty()) { e.prototype.onSurveyValueChanged.call(this, t); for (var n = 0; n < this.panels.length; n++)this.panelSurveyValueChanged(this.panels[n]); void 0 === t && this.setValueBasedOnPanelCount(), this.recalculateIsReadyValue() } }, t.prototype.isAllPanelsEmpty = function () { for (var e = 0; e < this.panels.length; e++)if (!r.isValueEmpty(this.panels[e].getValue())) return !1; return !0 }, t.prototype.panelUpdateValueFromSurvey = function (e) { for (var t = e.questions, n = this.getPanelItemData(e.data), r = 0; r < t.length; r++) { var i = t[r]; i.updateValueFromSurvey(n[i.getValueName()]), i.updateCommentFromSurvey(n[i.getValueName() + o.commentSuffix]) } }, t.prototype.panelSurveyValueChanged = function (e) { for (var t = e.questions, n = this.getPanelItemData(e.data), o = 0; o < t.length; o++) { var r = t[o]; r.onSurveyValueChanged(n[r.getValueName()]) } }, t.prototype.recalculateIsReadyValue = function () { var e = this, t = this.isReadyValue, n = !0; this.panels.forEach((function (t) { t.questions.forEach((function (t) { t.isReady ? t.onReadyChanged.remove(e.onReadyChangedCallback) : (n = !1, t.onReadyChanged.add(e.onReadyChangedCallback)) })) })), this.isReadyValue = n, t != this.isReadyValue && this.onReadyChanged.fire(this, { question: this, oldIsReady: t, isReady: this.isReadyValue }) }, t.prototype.onSetData = function () { e.prototype.onSetData.call(this), this.useTemplatePanel && (this.setTemplatePanelSurveyImpl(), this.rebuildPanels()) }, t.prototype.getItemIndex = function (e) { var t = this.items.indexOf(e); return t > -1 ? t : this.items.length }, t.prototype.getPanelItemData = function (e) { var t = this.items, n = t.indexOf(e), o = this.value; return n < 0 && Array.isArray(o) && o.length > t.length && (n = t.length), n < 0 || !o || !Array.isArray(o) || o.length <= n ? {} : o[n] }, t.prototype.setPanelItemData = function (e, t, n) { if (!(this.isSetPanelItemData[t] > this.maxCheckCount)) { this.isSetPanelItemData[t] || (this.isSetPanelItemData[t] = 0), this.isSetPanelItemData[t]++; var o = this.items, r = o.indexOf(e); r < 0 && (r = o.length); var i = this.getUnbindValue(this.value); if (i && Array.isArray(i) || (i = []), i.length <= r) for (var s = i.length; s <= r; s++)i.push({}); if (i[r] || (i[r] = {}), this.isValueEmpty(n) ? delete i[r][t] : i[r][t] = n, r >= 0 && r < this.panels.length && (this.changingValueQuestion = this.panels[r].getQuestionByValueName(t)), this.value = i, this.changingValueQuestion = null, this.survey) { var a = { question: this, panel: e.panel, name: t, itemIndex: r, itemValue: i[r], value: n }; this.survey.dynamicPanelItemValueChanged(this, a) } this.isSetPanelItemData[t]--, this.isSetPanelItemData[t] - 1 && delete this.isSetPanelItemData[t] } }, t.prototype.getRootData = function () { return this.data }, t.prototype.getPlainData = function (t) { void 0 === t && (t = { includeEmpty: !0 }); var n = e.prototype.getPlainData.call(this, t); return n && (n.isNode = !0, n.data = this.panels.map((function (e, n) { var o = { name: e.name || n, title: e.title || "Panel", value: e.getValue(), displayValue: e.getValue(), getString: function (e) { return "object" == typeof e ? JSON.stringify(e) : e }, isNode: !0, data: e.questions.map((function (e) { return e.getPlainData(t) })).filter((function (e) { return !!e })) }; return (t.calculations || []).forEach((function (t) { o[t.propertyName] = e[t.propertyName] })), o }))), n }, t.prototype.updateElementCss = function (t) { e.prototype.updateElementCss.call(this, t); for (var n = 0; n < this.panels.length; n++) { this.panels[n].updateElementCss(t) } }, Object.defineProperty(t.prototype, "progressText", { get: function () { var e = this.panelCount; return this.getLocalizationFormatString("panelDynamicProgressText", this.currentIndex + 1, e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "progress", { get: function () { return (this.currentIndex + 1) / this.panelCount * 100 + "%" }, enumerable: !1, configurable: !0 }), t.prototype.getRootCss = function () { return (new at).append(e.prototype.getRootCss.call(this)).append(this.cssClasses.empty, this.getShowNoEntriesPlaceholder()).toString() }, t.prototype.getPanelWrapperCss = function () { return (new at).append(this.cssClasses.panelWrapper).append(this.cssClasses.panelWrapperInRow, "right" === this.panelRemoveButtonLocation).toString() }, t.prototype.getPanelRemoveButtonCss = function () { return (new at).append(this.cssClasses.button).append(this.cssClasses.buttonRemove).append(this.cssClasses.buttonRemoveRight, "right" === this.panelRemoveButtonLocation).toString() }, t.prototype.getAddButtonCss = function () { return (new at).append(this.cssClasses.button).append(this.cssClasses.buttonAdd).append(this.cssClasses.buttonAdd + "--list-mode", "list" === this.renderMode).toString() }, t.prototype.getPrevButtonCss = function () { return (new at).append(this.cssClasses.buttonPrev).append(this.cssClasses.buttonPrevDisabled, !this.isPrevButtonVisible).toString() }, t.prototype.getNextButtonCss = function () { return (new at).append(this.cssClasses.buttonNext).append(this.cssClasses.buttonNextDisabled, !this.isNextButtonVisible).toString() }, Object.defineProperty(t.prototype, "noEntriesText", { get: function () { return this.getLocalizableStringText("noEntriesText") }, set: function (e) { this.setLocalizableStringText("noEntriesText", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "locNoEntriesText", { get: function () { return this.getLocalizableString("noEntriesText") }, enumerable: !1, configurable: !0 }), t.prototype.getShowNoEntriesPlaceholder = function () { return !!this.cssClasses.noEntriesPlaceholder && !this.isDesignMode && 0 === this.panelCount }, t.prototype.needResponsiveWidth = function () { var e = this.getPanel(); return !(!e || !e.needResponsiveWidth()) }, Object.defineProperty(t.prototype, "footerToolbar", { get: function () { return this.footerToolbarValue || this.initFooterToolbar(), this.footerToolbarValue }, enumerable: !1, configurable: !0 }), t.prototype.updateFooterActions = function () { this.updateFooterActionsCallback && this.updateFooterActionsCallback() }, t.prototype.initFooterToolbar = function () { var e = this; this.footerToolbarValue = this.createActionContainer(); var t = [], n = new Tt({ id: "sv-pd-prev-btn", title: this.panelPrevText, action: function () { e.goToPrevPanel() } }), o = new Tt({ id: "sv-pd-next-btn", title: this.panelNextText, action: function () { e.goToNextPanel() } }), r = new Tt({ id: "sv-pd-add-btn", component: "sv-paneldynamic-add-btn", visible: new ue((function () { return e.canAddPanel })), data: { question: this } }), i = new Tt({ id: "sv-prev-btn-icon", component: "sv-paneldynamic-prev-btn", data: { question: this } }), s = new Tt({ id: "sv-pd-progress-text", component: "sv-paneldynamic-progress-text", data: { question: this } }), a = new Tt({ id: "sv-pd-next-btn-icon", component: "sv-paneldynamic-next-btn", data: { question: this } }); t.push(n, o, r, i, s, a), this.updateFooterActionsCallback = function () { var t = e.legacyNavigation, l = e.isRenderModeList, u = e.isMobile, c = !t && !l; n.visible = c && e.currentIndex > 0, o.visible = c && e.currentIndex < e.panelCount - 1, o.needSpace = u && o.visible && n.visible, r.needSpace = e.isMobile && !o.visible && n.visible, s.visible = !e.isRenderModeList && !u, s.needSpace = !t && !e.isMobile; var p = t && !l; i.visible = p, a.visible = p, i.needSpace = p }, this.updateFooterActionsCallback(), this.footerToolbarValue.setItems(t) }, Object.defineProperty(t.prototype, "showLegacyNavigation", { get: function () { return !this.isDefaultV2Theme }, enumerable: !1, configurable: !0 }), t.maxCheckCount = 3, ri([f({ defaultValue: !1, onSet: function (e, t) { t.updateFooterActions() } })], t.prototype, "legacyNavigation", void 0), t }($t); _.addClass("paneldynamic", [{ name: "showCommentArea:switch", layout: "row", visible: !0, category: "general" }, { name: "templateElements", alternativeName: "questions", baseClassName: "question", visible: !1, isLightSerializable: !1 }, { name: "templateTitle:text", serializationProperty: "locTemplateTitle" }, { name: "templateDescription:text", serializationProperty: "locTemplateDescription" }, { name: "minWidth", defaultFunc: function () { return "auto" } }, { name: "noEntriesText:text", serializationProperty: "locNoEntriesText" }, { name: "allowAddPanel:boolean", default: !0 }, { name: "allowRemovePanel:boolean", default: !0 }, { name: "panelCount:number", isBindable: !0, default: 0, choices: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10] }, { name: "minPanelCount:number", default: 0, minValue: 0 }, { name: "maxPanelCount:number", default: o.panelMaximumPanelCount }, "defaultPanelValue:panelvalue", "defaultValueFromLastPanel:boolean", { name: "panelsState", default: "default", choices: ["default", "collapsed", "expanded", "firstExpanded"] }, { name: "keyName" }, { name: "keyDuplicationError", serializationProperty: "locKeyDuplicationError" }, { name: "confirmDelete:boolean" }, { name: "confirmDeleteText", serializationProperty: "locConfirmDeleteText" }, { name: "panelAddText", serializationProperty: "locPanelAddText" }, { name: "panelRemoveText", serializationProperty: "locPanelRemoveText" }, { name: "panelPrevText", serializationProperty: "locPanelPrevText" }, { name: "panelNextText", serializationProperty: "locPanelNextText" }, { name: "showQuestionNumbers", default: "off", choices: ["off", "onPanel", "onSurvey"] }, { name: "showRangeInProgress:boolean", default: !0 }, { name: "renderMode", default: "list", choices: ["list", "progressTop", "progressBottom", "progressTopBottom"] }, { name: "templateTitleLocation", default: "default", choices: ["default", "top", "bottom", "left"] }, { name: "panelRemoveButtonLocation", default: "bottom", choices: ["bottom", "right"] }], (function () { return new ui("") }), "question"), rn.Instance.registerQuestion("paneldynamic", (function (e) { return new ui(e) })); var ci = function () { function e() { } return e.getProgressTextInBarCss = function (e) { return (new at).append(e.progressText).append(e.progressTextInBar).toString() }, e.getProgressTextUnderBarCss = function (e) { return (new at).append(e.progressText).append(e.progressTextUnderBar).toString() }, e }(), pi = function () { function e(e) { this.survey = e } return e.prototype.isListElementClickable = function (e) { return !(this.survey.onServerValidateQuestions && !this.survey.onServerValidateQuestions.isEmpty && "onComplete" !== this.survey.checkErrorsMode) || e <= this.survey.currentPageNo + 1 }, e.prototype.getListElementCss = function (e) { if (!(e >= this.survey.visiblePages.length)) return (new at).append(this.survey.css.progressButtonsListElementPassed, this.survey.visiblePages[e].passed).append(this.survey.css.progressButtonsListElementCurrent, this.survey.currentPageNo === e).append(this.survey.css.progressButtonsListElementNonClickable, !this.isListElementClickable(e)).toString() }, e.prototype.getScrollButtonCss = function (e, t) { return (new at).append(this.survey.css.progressButtonsImageButtonLeft, t).append(this.survey.css.progressButtonsImageButtonRight, !t).append(this.survey.css.progressButtonsImageButtonHidden, !e).toString() }, e.prototype.clickListElement = function (e) { if (!this.survey.isDesignMode) if (e < this.survey.currentPageNo) this.survey.currentPageNo = e; else if (e > this.survey.currentPageNo) for (var t = this.survey.currentPageNo; t < e && this.survey.nextPage(); t++); }, e }(), hi = function () { var e = function (t, n) { return (e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (e, t) { e.__proto__ = t } || function (e, t) { for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]) })(t, n) }; return function (t, n) { if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null"); function o() { this.constructor = t } e(t, n), t.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o) } }(), di = function (e) { function t() { var t = e.call(this) || this; return t.usedNames = [], t.registerPropertyChangedHandlers(["operator", "value", "name"], (function () { t.oldPropertiesChanged() })), t.registerPropertyChangedHandlers(["expression"], (function () { t.onExpressionChanged() })), t } return hi(t, e), Object.defineProperty(t, "operators", { get: function () { return null != t.operatorsValue || (t.operatorsValue = { empty: function (e, t) { return !e }, notempty: function (e, t) { return !!e }, equal: function (e, t) { return e == t }, notequal: function (e, t) { return e != t }, contains: function (e, t) { return e && e.indexOf && e.indexOf(t) > -1 }, notcontains: function (e, t) { return !e || !e.indexOf || -1 == e.indexOf(t) }, greater: function (e, t) { return e > t }, less: function (e, t) { return e < t }, greaterorequal: function (e, t) { return e >= t }, lessorequal: function (e, t) { return e <= t } }), t.operatorsValue }, enumerable: !1, configurable: !0 }), t.prototype.getType = function () { return "triggerbase" }, t.prototype.toString = function () { var e = this.getType().replace("trigger", ""), t = this.expression ? this.expression : this.buildExpression(); return t && (e += ", " + t), e }, Object.defineProperty(t.prototype, "operator", { get: function () { return this.getPropertyValue("operator", "equal") }, set: function (e) { e && (e = e.toLowerCase(), t.operators[e] && this.setPropertyValue("operator", e)) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "value", { get: function () { return this.getPropertyValue("value", null) }, set: function (e) { this.setPropertyValue("value", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "name", { get: function () { return this.getPropertyValue("name", "") }, set: function (e) { this.setPropertyValue("name", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "expression", { get: function () { return this.getPropertyValue("expression", "") }, set: function (e) { this.setPropertyValue("expression", e) }, enumerable: !1, configurable: !0 }), t.prototype.canBeExecuted = function (e) { return !0 }, t.prototype.checkExpression = function (e, t, n, o) { void 0 === o && (o = null), this.isExecutingOnNextPage = e, this.canBeExecuted(e) && this.isCheckRequired(t) && this.conditionRunner && this.perform(n, o) }, t.prototype.check = function (e) { t.operators[this.operator](e, this.value) ? this.onSuccess({}, null) : this.onFailure() }, t.prototype.perform = function (e, t) { var n = this; this.conditionRunner.onRunComplete = function (o) { n.triggerResult(o, e, t) }, this.conditionRunner.run(e, t) }, t.prototype.triggerResult = function (e, t, n) { e ? (this.onSuccess(t, n), this.onSuccessExecuted()) : this.onFailure() }, t.prototype.onSuccess = function (e, t) { }, t.prototype.onFailure = function () { }, t.prototype.onSuccessExecuted = function () { }, t.prototype.endLoadingFromJson = function () { e.prototype.endLoadingFromJson.call(this), this.oldPropertiesChanged() }, t.prototype.oldPropertiesChanged = function () { this.onExpressionChanged() }, t.prototype.onExpressionChanged = function () { this.usedNames = [], this.hasFunction = !1, this.conditionRunner = null }, t.prototype.buildExpression = function () { return this.name ? this.isValueEmpty(this.value) && this.isRequireValue ? "" : "{" + this.name + "} " + this.operator + " " + G.toOperandString(this.value) : "" }, t.prototype.isCheckRequired = function (e) { if (!e) return !1; if (this.buildUsedNames(), !0 === this.hasFunction) return !0; for (var t = new I, n = 0; n < this.usedNames.length; n++) { var o = this.usedNames[n]; if (e.hasOwnProperty(o)) return !0; var r = t.getFirstName(o); if (e.hasOwnProperty(r)) { if (o == r) return !0; var i = e[r]; if (null != i) { if (!i.hasOwnProperty("oldValue") || !i.hasOwnProperty("newValue")) return !0; var s = {}; s[r] = i.oldValue; var a = t.getValue(o, s); s[r] = i.newValue; var l = t.getValue(o, s); return !this.isTwoValueEquals(a, l) } } } return !1 }, t.prototype.buildUsedNames = function () { if (!this.conditionRunner) { var e = this.expression; e || (e = this.buildExpression()), e && (this.conditionRunner = new oe(e), this.hasFunction = this.conditionRunner.hasFunction(), this.usedNames = this.conditionRunner.getVariables()) } }, Object.defineProperty(t.prototype, "isRequireValue", { get: function () { return "empty" !== this.operator && "notempty" != this.operator }, enumerable: !1, configurable: !0 }), t.operatorsValue = null, t }(ce), fi = function (e) { function t() { var t = e.call(this) || this; return t.ownerValue = null, t } return hi(t, e), Object.defineProperty(t.prototype, "owner", { get: function () { return this.ownerValue }, enumerable: !1, configurable: !0 }), t.prototype.setOwner = function (e) { this.ownerValue = e }, t.prototype.getSurvey = function (e) { return void 0 === e && (e = !1), this.owner && this.owner.getSurvey ? this.owner.getSurvey() : null }, t.prototype.isRealExecution = function () { return !0 }, t.prototype.onSuccessExecuted = function () { this.owner && this.isRealExecution() && this.owner.triggerExecuted(this) }, t }(di), gi = function (e) { function t() { var t = e.call(this) || this; return t.pages = [], t.questions = [], t } return hi(t, e), t.prototype.getType = function () { return "visibletrigger" }, t.prototype.onSuccess = function (e, t) { this.onTrigger(this.onItemSuccess) }, t.prototype.onFailure = function () { this.onTrigger(this.onItemFailure) }, t.prototype.onTrigger = function (e) { if (this.owner) for (var t = this.owner.getObjects(this.pages, this.questions), n = 0; n < t.length; n++)e(t[n]) }, t.prototype.onItemSuccess = function (e) { e.visible = !0 }, t.prototype.onItemFailure = function (e) { e.visible = !1 }, t }(fi), yi = function (e) { function t() { return e.call(this) || this } return hi(t, e), t.prototype.getType = function () { return "completetrigger" }, t.prototype.isRealExecution = function () { return !o.executeCompleteTriggerOnValueChanged === this.isExecutingOnNextPage }, t.prototype.onSuccess = function (e, t) { this.owner && (this.isRealExecution() ? this.owner.setCompleted() : this.owner.canBeCompleted()) }, t }(fi), mi = function (e) { function t() { return e.call(this) || this } return hi(t, e), t.prototype.getType = function () { return "setvaluetrigger" }, t.prototype.canBeExecuted = function (e) { return !e && !!this.setToName }, t.prototype.onPropertyValueChanged = function (t, n, o) { if (e.prototype.onPropertyValueChanged.call(this, t, n, o), "setToName" === t) { var r = this.getSurvey(); r && !r.isLoadingFromJson && r.isDesignMode && (this.setValue = void 0) } }, Object.defineProperty(t.prototype, "setToName", { get: function () { return this.getPropertyValue("setToName", "") }, set: function (e) { this.setPropertyValue("setToName", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "setValue", { get: function () { return this.getPropertyValue("setValue") }, set: function (e) { this.setPropertyValue("setValue", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "isVariable", { get: function () { return this.getPropertyValue("isVariable", !1) }, set: function (e) { this.setPropertyValue("isVariable", e) }, enumerable: !1, configurable: !0 }), t.prototype.onSuccess = function (e, t) { this.setToName && this.owner && this.owner.setTriggerValue(this.setToName, this.setValue, this.isVariable) }, t }(fi), vi = function (e) { function t() { return e.call(this) || this } return hi(t, e), t.prototype.getType = function () { return "skiptrigger" }, Object.defineProperty(t.prototype, "gotoName", { get: function () { return this.getPropertyValue("gotoName", "") }, set: function (e) { this.setPropertyValue("gotoName", e) }, enumerable: !1, configurable: !0 }), t.prototype.canBeExecuted = function (e) { return e === !o.executeSkipTriggerOnValueChanged }, t.prototype.onSuccess = function (e, t) { this.gotoName && this.owner && this.owner.focusQuestion(this.gotoName) }, t }(fi), bi = function (e) { function t() { return e.call(this) || this } return hi(t, e), t.prototype.getType = function () { return "runexpressiontrigger" }, Object.defineProperty(t.prototype, "setToName", { get: function () { return this.getPropertyValue("setToName", "") }, set: function (e) { this.setPropertyValue("setToName", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "runExpression", { get: function () { return this.getPropertyValue("runExpression", "") }, set: function (e) { this.setPropertyValue("runExpression", e) }, enumerable: !1, configurable: !0 }), t.prototype.onSuccess = function (e, t) { var n = this; if (this.owner && this.runExpression) { var o = new re(this.runExpression); o.canRun && (o.onRunComplete = function (e) { n.onCompleteRunExpression(e) }, o.run(e, t)) } }, t.prototype.onCompleteRunExpression = function (e) { this.setToName && void 0 !== e && this.owner.setTriggerValue(this.setToName, r.convertValToQuestionVal(e), !1) }, t }(fi), Ci = function (e) { function t() { return e.call(this) || this } return hi(t, e), t.prototype.canBeExecuted = function (e) { return !e && !!this.setToName && !!this.fromName }, Object.defineProperty(t.prototype, "setToName", { get: function () { return this.getPropertyValue("setToName", "") }, set: function (e) { this.setPropertyValue("setToName", e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "fromName", { get: function () { return this.getPropertyValue("fromName", "") }, set: function (e) { this.setPropertyValue("fromName", e) }, enumerable: !1, configurable: !0 }), t.prototype.getType = function () { return "copyvaluetrigger" }, t.prototype.onSuccess = function (e, t) { this.setToName && this.owner && this.owner.copyTriggerValue(this.setToName, this.fromName) }, t }(fi); _.addClass("trigger", [{ name: "operator", default: "equal", visible: !1 }, { name: "value", visible: !1 }, "expression:condition"]), _.addClass("surveytrigger", [{ name: "name", visible: !1 }], null, "trigger"), _.addClass("visibletrigger", ["pages:pages", "questions:questions"], (function () { return new gi }), "surveytrigger"), _.addClass("completetrigger", [], (function () { return new yi }), "surveytrigger"), _.addClass("setvaluetrigger", [{ name: "!setToName:questionvalue" }, { name: "setValue:triggervalue", dependsOn: "setToName", visibleIf: function (e) { return !!e && !!e.setToName } }, { name: "isVariable:boolean", visible: !1 }], (function () { return new mi }), "surveytrigger"), _.addClass("copyvaluetrigger", [{ name: "!fromName:questionvalue" }, { name: "!setToName:questionvalue" }], (function () { return new Ci }), "surveytrigger"), _.addClass("skiptrigger", [{ name: "!gotoName:question" }], (function () { return new vi }), "surveytrigger"), _.addClass("runexpressiontrigger", [{ name: "setToName:questionvalue" }, "runExpression:expression"], (function () { return new bi }), "surveytrigger"); var Pi = function () { var e = function (t, n) { return (e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (e, t) { e.__proto__ = t } || function (e, t) { for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]) })(t, n) }; return function (t, n) { if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null"); function o() { this.constructor = t } e(t, n), t.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o) } }(), wi = function (e, t, n, o) { var r, i = arguments.length, s = i < 3 ? t : null === o ? o = Object.getOwnPropertyDescriptor(t, n) : o; if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) s = Reflect.decorate(e, t, n, o); else for (var a = e.length - 1; a >= 0; a--)(r = e[a]) && (s = (i < 3 ? r(s) : i > 3 ? r(t, n, s) : r(t, n)) || s); return i > 3 && s && Object.defineProperty(t, n, s), s }, Vi = function (e) { function t(t, n) { void 0 === n && (n = null); var o = e.call(this) || this; return o.closeOnCompleteTimeout = 0, o.surveyValue = n || o.createSurvey(t), o.surveyValue.showTitle = !1, "undefined" != typeof document && (o.windowElement = document.createElement("div")), o.survey.onComplete.add((function (e, t) { o.onSurveyComplete() })), o.registerPropertyChangedHandlers(["isShowing"], (function () { o.showingChangedCallback && o.showingChangedCallback() })), o.registerPropertyChangedHandlers(["isExpanded"], (function () { o.onExpandedChanged() })), o.width = new ue((function () { return o.survey.width })), o.width = o.survey.width, o.updateCss(), o.onCreating(), o } return Pi(t, e), t.prototype.onCreating = function () { }, t.prototype.getType = function () { return "popupsurvey" }, Object.defineProperty(t.prototype, "survey", { get: function () { return this.surveyValue }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "isShowing", { get: function () { return this.getPropertyValue("isShowing", !1) }, set: function (e) { this.setPropertyValue("isShowing", e) }, enumerable: !1, configurable: !0 }), t.prototype.show = function () { this.isShowing = !0 }, t.prototype.hide = function () { this.isShowing = !1 }, Object.defineProperty(t.prototype, "isExpanded", { get: function () { return this.getPropertyValue("isExpanded", !1) }, set: function (e) { this.setPropertyValue("isExpanded", e) }, enumerable: !1, configurable: !0 }), t.prototype.onExpandedChanged = function () { this.expandedChangedCallback && this.expandedChangedCallback(), this.updateCssButton() }, Object.defineProperty(t.prototype, "title", { get: function () { return this.survey.title }, set: function (e) { this.survey.title = e }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "locTitle", { get: function () { return this.survey.locTitle }, enumerable: !1, configurable: !0 }), t.prototype.expand = function () { this.isExpanded = !0 }, t.prototype.collapse = function () { this.isExpanded = !1 }, t.prototype.changeExpandCollapse = function () { this.isExpanded = !this.isExpanded }, Object.defineProperty(t.prototype, "css", { get: function () { return this.survey.css }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "cssButton", { get: function () { return this.getPropertyValue("cssButton", "") }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "cssRoot", { get: function () { return this.getPropertyValue("cssRoot", "") }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "cssBody", { get: function () { return this.getPropertyValue("cssBody", "") }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "cssHeaderRoot", { get: function () { return this.getPropertyValue("cssHeaderRoot", "") }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "cssHeaderTitle", { get: function () { return this.getPropertyValue("cssHeaderTitle", "") }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "renderedWidth", { get: function () { var e = this.getPropertyValue("width", "60%"); return e && !isNaN(e) && (e += "px"), e }, enumerable: !1, configurable: !0 }), t.prototype.updateCss = function () { if (this.css && this.css.window) { var e = this.css.window; this.setPropertyValue("cssRoot", e.root), this.setPropertyValue("cssBody", e.body); var t = e.header; t && (this.setPropertyValue("cssHeaderRoot", t.root), this.setPropertyValue("cssHeaderTitle", t.title), this.updateCssButton()) } }, t.prototype.updateCssButton = function () { var e = this.css.window ? this.css.window.header : null; e && this.setCssButton(this.isExpanded ? e.buttonExpanded : e.buttonCollapsed) }, t.prototype.setCssButton = function (e) { e && this.setPropertyValue("cssButton", e) }, t.prototype.createSurvey = function (e) { return new yo(e) }, t.prototype.onSurveyComplete = function () { if (!(this.closeOnCompleteTimeout < 0)) if (0 == this.closeOnCompleteTimeout) this.hide(); else { var e = this, t = null; t = "undefined" != typeof window ? window.setInterval((function () { e.hide(), "undefined" != typeof window && window.clearInterval(t) }), 1e3 * this.closeOnCompleteTimeout) : 0 } }, wi([f()], t.prototype, "width", void 0), t }(ce), xi = function (e) { function t() { return null !== e && e.apply(this, arguments) || this } return Pi(t, e), t }(Vi), Oi = function () { var e = function (t, n) { return (e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (e, t) { e.__proto__ = t } || function (e, t) { for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]) })(t, n) }; return function (t, n) { if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null"); function o() { this.constructor = t } e(t, n), t.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o) } }(), Ti = function () { function e(e, t) { this.name = e, this.json = t; var n = this; _.addClass(e, [], (function (e) { return Si.Instance.createQuestion(e ? e.name : "", n) }), "question"), this.onInit() } return e.prototype.onInit = function () { this.json.onInit && this.json.onInit() }, e.prototype.onCreated = function (e) { this.json.onCreated && this.json.onCreated(e) }, e.prototype.onLoaded = function (e) { this.json.onLoaded && this.json.onLoaded(e) }, e.prototype.onAfterRender = function (e, t) { this.json.onAfterRender && this.json.onAfterRender(e, t) }, e.prototype.onAfterRenderContentElement = function (e, t, n) { this.json.onAfterRenderContentElement && this.json.onAfterRenderContentElement(e, t, n) }, e.prototype.onUpdateQuestionCssClasses = function (e, t, n) { this.json.onUpdateQuestionCssClasses && this.json.onUpdateQuestionCssClasses(e, t, n) }, e.prototype.onPropertyChanged = function (e, t, n) { this.json.onPropertyChanged && this.json.onPropertyChanged(e, t, n) }, e.prototype.onValueChanged = function (e, t, n) { this.json.onValueChanged && this.json.onValueChanged(e, t, n) }, e.prototype.onItemValuePropertyChanged = function (e, t, n, o, r) { this.json.onItemValuePropertyChanged && this.json.onItemValuePropertyChanged(e, { obj: t, propertyName: n, name: o, newValue: r }) }, e.prototype.getDisplayValue = function (e, t, n) { return this.json.getDisplayValue ? this.json.getDisplayValue(n) : n.getDisplayValue(e, t) }, Object.defineProperty(e.prototype, "isComposite", { get: function () { return !!this.json.elementsJSON || !!this.json.createElements }, enumerable: !1, configurable: !0 }), e }(), Si = function () { function e() { this.customQuestionValues = [] } return e.prototype.add = function (e) { if (e) { var t = e.name; if (!t) throw "Attribute name is missed"; if (t = t.toLowerCase(), this.getCustomQuestionByName(t)) throw "There is already registered custom question with name '" + t + "'"; if (_.findClass(t)) throw "There is already class with name '" + t + "'"; var n = new Ti(t, e); this.onAddingJson && this.onAddingJson(t, n.isComposite), this.customQuestionValues.push(n) } }, Object.defineProperty(e.prototype, "items", { get: function () { return this.customQuestionValues }, enumerable: !1, configurable: !0 }), e.prototype.getCustomQuestionByName = function (e) { for (var t = 0; t < this.customQuestionValues.length; t++)if (this.customQuestionValues[t].name == e) return this.customQuestionValues[t]; return null }, e.prototype.clear = function () { for (var e = 0; e < this.customQuestionValues.length; e++)_.removeClass(this.customQuestionValues[e].name); this.customQuestionValues = [] }, e.prototype.createQuestion = function (e, t) { return t.isComposite ? this.createCompositeModel(e, t) : this.createCustomModel(e, t) }, e.prototype.createCompositeModel = function (e, t) { return this.onCreateComposite ? this.onCreateComposite(e, t) : new Ei(e, t) }, e.prototype.createCustomModel = function (e, t) { return this.onCreateCustom ? this.onCreateCustom(e, t) : new Ii(e, t) }, e.Instance = new e, e }(), _i = function (e) { function t(t, n) { var o = e.call(this, t) || this; return o.customQuestion = n, v.createProperties(o), At.CreateDisabledDesignElements = !0, o.createWrapper(), At.CreateDisabledDesignElements = !1, o.customQuestion && o.customQuestion.onCreated(o), o } return Oi(t, e), t.prototype.getType = function () { return this.customQuestion ? this.customQuestion.name : "custom" }, t.prototype.locStrsChanged = function () { e.prototype.locStrsChanged.call(this), this.getElement() && this.getElement().locStrsChanged() }, t.prototype.createWrapper = function () { }, t.prototype.onPropertyValueChanged = function (t, n, o) { e.prototype.onPropertyValueChanged.call(this, t, n, o), this.customQuestion && !this.isLoadingFromJson && this.customQuestion.onPropertyChanged(this, t, o) }, t.prototype.itemValuePropertyChanged = function (t, n, o, r) { e.prototype.itemValuePropertyChanged.call(this, t, n, o, r), this.customQuestion && !this.isLoadingFromJson && this.customQuestion.onItemValuePropertyChanged(this, t, t.ownerPropertyName, n, r) }, t.prototype.onFirstRendering = function () { var t = this.getElement(); t && t.onFirstRendering(), e.prototype.onFirstRendering.call(this) }, t.prototype.getProgressInfo = function () { var t = e.prototype.getProgressInfo.call(this); return this.getElement() && (t = this.getElement().getProgressInfo()), this.isRequired && 0 == t.requiredQuestionCount && (t.requiredQuestionCount = 1, this.isEmpty() || (t.answeredQuestionCount = 1)), t }, t.prototype.initElement = function (e) { e && (e.setSurveyImpl(this), e.disableDesignActions = !0) }, t.prototype.setSurveyImpl = function (t, n) { e.prototype.setSurveyImpl.call(this, t, n), this.initElement(this.getElement()) }, t.prototype.onSurveyLoad = function () { e.prototype.onSurveyLoad.call(this), this.getElement() && (this.getElement().onSurveyLoad(), this.customQuestion.onLoaded(this)) }, t.prototype.afterRenderQuestionElement = function (e) { }, t.prototype.afterRender = function (t) { e.prototype.afterRender.call(this, t), this.customQuestion && this.customQuestion.onAfterRender(this, t) }, t.prototype.onUpdateQuestionCssClasses = function (e, t) { this.customQuestion && this.customQuestion.onUpdateQuestionCssClasses(this, e, t) }, t.prototype.setQuestionValue = function (t, n) { void 0 === n && (n = !0), e.prototype.setQuestionValue.call(this, t, n), this.updateElementCss() }, t.prototype.setNewValue = function (t) { e.prototype.setNewValue.call(this, t), this.updateElementCss() }, t.prototype.getSurveyData = function () { return this }, t.prototype.getTextProcessor = function () { return this.textProcessor }, t.prototype.getValue = function (e) { return this.value }, t.prototype.setValue = function (e, t, n, o) { if (this.data) { var r = this.convertDataName(e); this.data.setValue(r, this.convertDataValue(e, t), n, o), this.updateIsAnswered(), this.updateElementCss(), this.customQuestion && this.customQuestion.onValueChanged(this, e, t) } }, t.prototype.convertDataName = function (e) { return this.getValueName() }, t.prototype.convertDataValue = function (e, t) { return t }, t.prototype.getVariable = function (e) { return this.data ? this.data.getVariable(e) : null }, t.prototype.setVariable = function (e, t) { this.data && this.data.setVariable(e, t) }, t.prototype.getComment = function (e) { return this.data ? this.data.getComment(this.getValueName()) : "" }, t.prototype.setComment = function (e, t, n) { this.data && this.data.setComment(this.getValueName(), t, n) }, t.prototype.getAllValues = function () { return this.data ? this.data.getAllValues() : {} }, t.prototype.getFilteredValues = function () { return this.data ? this.data.getFilteredValues() : {} }, t.prototype.getFilteredProperties = function () { return this.data ? this.data.getFilteredProperties() : {} }, t.prototype.findQuestionByName = function (e) { return this.data ? this.data.findQuestionByName(e) : null }, t.prototype.addElement = function (e, t) { }, t.prototype.removeElement = function (e) { return !1 }, t.prototype.getQuestionTitleLocation = function () { return "left" }, t.prototype.getQuestionStartIndex = function () { return this.getStartIndex() }, t.prototype.getChildrenLayoutType = function () { return "row" }, t.prototype.elementWidthChanged = function (e) { }, Object.defineProperty(t.prototype, "elements", { get: function () { return [] }, enumerable: !1, configurable: !0 }), t.prototype.indexOf = function (e) { return -1 }, t.prototype.ensureRowsVisibility = function () { }, t.prototype.getContentDisplayValueCore = function (t, n, o) { return o ? this.customQuestion.getDisplayValue(t, n, o) : e.prototype.getDisplayValueCore.call(this, t, n) }, t }($t), Ii = function (e) { function t() { return null !== e && e.apply(this, arguments) || this } return Oi(t, e), t.prototype.getTemplate = function () { return "custom" }, t.prototype.createWrapper = function () { this.questionWrapper = this.createQuestion() }, t.prototype.getElement = function () { return this.contentQuestion }, t.prototype.onAnyValueChanged = function (t) { e.prototype.onAnyValueChanged.call(this, t), this.contentQuestion && this.contentQuestion.onAnyValueChanged(t) }, t.prototype.hasErrors = function (t, n) { if (void 0 === t && (t = !0), void 0 === n && (n = null), !this.contentQuestion) return !1; var o = this.contentQuestion.hasErrors(t, n); this.errors = []; for (var r = 0; r < this.contentQuestion.errors.length; r++)this.errors.push(this.contentQuestion.errors[r]); return o || (o = e.prototype.hasErrors.call(this, t, n)), this.updateElementCss(), o }, t.prototype.focus = function (t) { void 0 === t && (t = !1), this.contentQuestion ? this.contentQuestion.focus(t) : e.prototype.focus.call(this, t) }, Object.defineProperty(t.prototype, "contentQuestion", { get: function () { return this.questionWrapper }, enumerable: !1, configurable: !0 }), t.prototype.createQuestion = function () { var e = this, t = this.customQuestion.json, n = null; if (t.questionJSON) { var o = t.questionJSON.type; if (!o || !_.findClass(o)) throw "type attribute in questionJSON is empty or incorrect"; n = _.createClass(o), this.initElement(n), n.fromJSON(t.questionJSON) } else t.createQuestion && (n = t.createQuestion(), this.initElement(n)); return n && (n.isContentElement = !0, n.name || (n.name = "question"), n.onUpdateCssClassesCallback = function (t) { e.onUpdateQuestionCssClasses(n, t) }), n }, t.prototype.onSurveyLoad = function () { e.prototype.onSurveyLoad.call(this), this.contentQuestion && this.isEmpty() && !this.contentQuestion.isEmpty() && (this.value = this.contentQuestion.value) }, t.prototype.runCondition = function (t, n) { e.prototype.runCondition.call(this, t, n), this.contentQuestion && this.contentQuestion.runCondition(t, n) }, t.prototype.convertDataName = function (t) { if (!this.contentQuestion) return e.prototype.convertDataName.call(this, t); var n = t.replace(this.contentQuestion.getValueName(), this.getValueName()); return 0 == n.indexOf(this.getValueName()) ? n : e.prototype.convertDataName.call(this, t) }, t.prototype.convertDataValue = function (t, n) { return this.convertDataName(t) == e.prototype.convertDataName.call(this, t) ? this.contentQuestion.value : n }, t.prototype.canSetValueToSurvey = function () { return !1 }, t.prototype.setQuestionValue = function (t, n) { void 0 === n && (n = !0), e.prototype.setQuestionValue.call(this, t, n), this.isLoadingFromJson || !this.contentQuestion || this.isTwoValueEquals(this.contentQuestion.value, t) || (this.contentQuestion.value = this.getUnbindValue(t)) }, t.prototype.onSurveyValueChanged = function (t) { e.prototype.onSurveyValueChanged.call(this, t), this.contentQuestion && this.contentQuestion.onSurveyValueChanged(t) }, t.prototype.getValueCore = function () { return this.contentQuestion ? this.contentQuestion.value : e.prototype.getValueCore.call(this) }, t.prototype.initElement = function (t) { var n = this; e.prototype.initElement.call(this, t), t && (t.parent = this, t.afterRenderQuestionCallback = function (e, t) { n.customQuestion && n.customQuestion.onAfterRenderContentElement(n, e, t) }) }, t.prototype.updateElementCss = function (t) { this.contentQuestion && this.questionWrapper.updateElementCss(t), e.prototype.updateElementCss.call(this, t) }, t.prototype.updateElementCssCore = function (t) { this.contentQuestion && (t = this.contentQuestion.cssClasses), e.prototype.updateElementCssCore.call(this, t) }, t.prototype.getDisplayValueCore = function (t, n) { return e.prototype.getContentDisplayValueCore.call(this, t, n, this.contentQuestion) }, t }(_i), Ri = function (e) { function t(t, n) { var o = e.call(this, n) || this; return o.composite = t, o.variableName = n, o } return Oi(t, e), Object.defineProperty(t.prototype, "survey", { get: function () { return this.composite.survey }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "panel", { get: function () { return this.composite.contentPanel }, enumerable: !1, configurable: !0 }), t }(on), Ei = function (e) { function t(n, o) { var r = e.call(this, n, o) || this; return r.customQuestion = o, r.settingNewValue = !1, r.textProcessing = new Ri(r, t.ItemVariableName), r } return Oi(t, e), t.prototype.createWrapper = function () { this.panelWrapper = this.createPanel() }, t.prototype.getTemplate = function () { return "composite" }, t.prototype.getElement = function () { return this.contentPanel }, t.prototype.getCssRoot = function (t) { return (new at).append(e.prototype.getCssRoot.call(this, t)).append(t.composite).toString() }, Object.defineProperty(t.prototype, "contentPanel", { get: function () { return this.panelWrapper }, enumerable: !1, configurable: !0 }), t.prototype.hasErrors = function (t, n) { void 0 === t && (t = !0), void 0 === n && (n = null); var o = e.prototype.hasErrors.call(this, t, n); return this.contentPanel && this.contentPanel.hasErrors(t, !1, n) || o }, t.prototype.updateElementCss = function (t) { e.prototype.updateElementCss.call(this, t), this.contentPanel && this.contentPanel.updateElementCss(t) }, t.prototype.getTextProcessor = function () { return this.textProcessing }, t.prototype.findQuestionByName = function (t) { if (this.contentPanel) { var n = this.contentPanel.getQuestionByName(t); if (n) return n } return e.prototype.findQuestionByName.call(this, t) }, t.prototype.clearValueIfInvisibleCore = function () { e.prototype.clearValueIfInvisibleCore.call(this); for (var t = this.contentPanel.questions, n = 0; n < t.length; n++)t[n].clearValueIfInvisible() }, t.prototype.onAnyValueChanged = function (t) { e.prototype.onAnyValueChanged.call(this, t); for (var n = this.contentPanel.questions, o = 0; o < n.length; o++)n[o].onAnyValueChanged(t) }, t.prototype.createPanel = function () { var e = this, t = _.createClass("panel"); t.showQuestionNumbers = "off", t.renderWidth = "100%"; var n = this.customQuestion.json; return n.elementsJSON && t.fromJSON({ elements: n.elementsJSON }), n.createElements && n.createElements(t, this), this.initElement(t), t.readOnly = this.isReadOnly, t.questions.forEach((function (t) { return t.onUpdateCssClassesCallback = function (n) { e.onUpdateQuestionCssClasses(t, n) } })), this.setAfterRenderCallbacks(t), t }, t.prototype.onReadOnlyChanged = function () { this.contentPanel && (this.contentPanel.readOnly = this.isReadOnly), e.prototype.onReadOnlyChanged.call(this) }, t.prototype.onSurveyLoad = function () { if (this.contentPanel && (this.contentPanel.readOnly = this.isReadOnly, this.setIsContentElement(this.contentPanel)), e.prototype.onSurveyLoad.call(this), this.contentPanel) { var t = this.contentPanel.getValue(); r.isValueEmpty(t) || (this.value = t) } }, t.prototype.setIsContentElement = function (e) { e.isContentElement = !0; for (var t = e.elements, n = 0; n < t.length; n++) { var o = t[n]; o.isPanel ? this.setIsContentElement(o) : o.isContentElement = !0 } }, t.prototype.setVisibleIndex = function (t) { var n = e.prototype.setVisibleIndex.call(this, t); return this.isVisible && this.contentPanel && (n += this.contentPanel.setVisibleIndex(t)), n }, t.prototype.runCondition = function (n, o) { if (e.prototype.runCondition.call(this, n, o), this.contentPanel) { var r = n[t.ItemVariableName]; n[t.ItemVariableName] = this.contentPanel.getValue(), this.contentPanel.runCondition(n, o), delete n[t.ItemVariableName], r && (n[t.ItemVariableName] = r) } }, t.prototype.getValue = function (e) { var t = this.value; return t ? t[e] : null }, t.prototype.setValue = function (t, n, o, r) { if (!this.settingNewValue) { if (this.settingNewValue = !0, !this.isEditingSurveyElement && this.contentPanel) { var i = this.contentPanel.getValue(); this.isTwoValueEquals(this.getValueCore(), i) || this.setValueCore(i) } if (e.prototype.setValue.call(this, t, n, o, r), this.contentPanel) { var s = this.contentPanel.getQuestionByName(t); s && !this.isTwoValueEquals(n, s.value) && (s.value = n) } this.settingNewValue = !1 } }, t.prototype.addConditionObjectsByContext = function (e, t) { if (this.contentPanel) for (var n = this.contentPanel.questions, o = this.name, r = this.title, i = 0; i < n.length; i++)e.push({ name: o + "." + n[i].name, text: r + "." + n[i].title, question: n[i] }) }, t.prototype.convertDataValue = function (e, t) { var n = this.value; return n || (n = {}), this.isValueEmpty(t) && !this.isEditingSurveyElement ? delete n[e] : n[e] = t, n }, t.prototype.setQuestionValue = function (t, n) { void 0 === n && (n = !0), e.prototype.setQuestionValue.call(this, t, n), this.settingNewValue = !0; for (var o = this.contentPanel.questions, r = 0; r < o.length; r++) { var i = o[r].getValueName(); o[r].value = t ? t[i] : void 0 } this.settingNewValue = !1 }, t.prototype.getDisplayValueCore = function (t, n) { return e.prototype.getContentDisplayValueCore.call(this, t, n, this.contentPanel) }, t.prototype.setAfterRenderCallbacks = function (e) { var t = this; if (e && this.customQuestion) for (var n = e.questions, o = 0; o < n.length; o++)n[o].afterRenderQuestionCallback = function (e, n) { t.customQuestion.onAfterRenderContentElement(t, e, n) } }, t.ItemVariableName = "composite", t }(_i), Di = function () { var e = function (t, n) { return (e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (e, t) { e.__proto__ = t } || function (e, t) { for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]) })(t, n) }; return function (t, n) { if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null"); function o() { this.constructor = t } e(t, n), t.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o) } }(), Ai = function (e, t, n, o) { var r, i = arguments.length, s = i < 3 ? t : null === o ? o = Object.getOwnPropertyDescriptor(t, n) : o; if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) s = Reflect.decorate(e, t, n, o); else for (var a = e.length - 1; a >= 0; a--)(r = e[a]) && (s = (i < 3 ? r(s) : i > 3 ? r(t, n, s) : r(t, n)) || s); return i > 3 && s && Object.defineProperty(t, n, s), s }, Li = 'input:not(:disabled):not([readonly]):not([type=hidden]),select:not(:disabled):not([readonly]),textarea:not(:disabled):not([readonly]), button:not(:disabled):not([readonly]), [tabindex]:not([tabindex^="-"])', ji = function (e) { function t(t) { var n = e.call(this) || this; return n.model = t, n } return Di(t, e), t.prototype.getLocale = function () { return this.locale ? this.locale : e.prototype.getLocale.call(this) }, t.prototype.hidePopup = function () { this.model.isVisible = !1 }, t.prototype.getStyleClass = function () { return (new at).append(this.model.cssClass).append("sv-popup--" + this.model.displayMode, this.isOverlay) }, t.prototype.getShowFooter = function () { return this.isOverlay }, t.prototype.getShowHeader = function () { return !1 }, t.prototype.getPopupHeaderTemplate = function () { }, t.prototype.createFooterActionBar = function () { var e = this; this.footerToolbarValue = new pt, this.footerToolbar.updateCallback = function (t) { e.footerToolbarValue.actions.forEach((function (e) { return e.cssClasses = { item: "sv-popup__body-footer-item sv-popup__button" } })) }; var t = [{ id: "cancel", visibleIndex: 10, title: this.cancelButtonText, innerCss: "sv-popup__button--cancel", action: function () { e.cancel() } }]; t = this.model.updateFooterActions(t), this.footerToolbarValue.setItems(t) }, t.prototype.setupModel = function (e) { var t = this; this.model && this.model.unregisterPropertyChangedHandlers(["isVisible"], "PopupBaseViewModel"), this._model = e; var n = function () { e.isVisible || t.updateOnHiding(), t.isVisible = e.isVisible }; e.registerPropertyChangedHandlers(["isVisible"], n, "PopupBaseViewModel"), n() }, Object.defineProperty(t.prototype, "model", { get: function () { return this._model }, set: function (e) { this.setupModel(e) }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "title", { get: function () { return this.model.title }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "contentComponentName", { get: function () { return this.model.contentComponentName }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "contentComponentData", { get: function () { return this.model.contentComponentData }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "isModal", { get: function () { return this.model.isModal }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "isFocusedContent", { get: function () { return this.model.isFocusedContent }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "showFooter", { get: function () { return this.getShowFooter() }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "showHeader", { get: function () { return this.getShowHeader() }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "popupHeaderTemplate", { get: function () { return this.getPopupHeaderTemplate() }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "isOverlay", { get: function () { return "overlay" === this.model.displayMode }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "styleClass", { get: function () { return this.getStyleClass().toString() }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "cancelButtonText", { get: function () { return this.getLocalizationString("modalCancelButtonText") }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "footerToolbar", { get: function () { return this.footerToolbarValue || this.createFooterActionBar(), this.footerToolbarValue }, enumerable: !1, configurable: !0 }), t.prototype.onKeyDown = function (e) { "Tab" === e.key || 9 === e.keyCode ? this.trapFocus(e) : "Escape" !== e.key && 27 !== e.keyCode || this.hidePopup() }, t.prototype.trapFocus = function (e) { var t = this.container.querySelectorAll(Li), n = t[0], o = t[t.length - 1]; e.shiftKey ? document.activeElement === n && (o.focus(), e.preventDefault()) : document.activeElement === o && (n.focus(), e.preventDefault()) }, t.prototype.switchFocus = function () { this.isFocusedContent && this.focusFirstInput() }, t.prototype.updateOnShowing = function () { this.prevActiveElement = document.activeElement, this.isOverlay && (this.top = null, this.left = null, this.height = null, this.width = null, this.minWidth = null), this.switchFocus() }, t.prototype.updateOnHiding = function () { this.prevActiveElement && this.prevActiveElement.focus() }, t.prototype.focusFirstInput = function () { var e = this; setTimeout((function () { if (e.container) { var t = e.container.querySelector(e.model.focusFirstInputSelector || Li); t ? t.focus() : e.container.children[0].focus() } }), 100) }, t.prototype.clickOutside = function () { this.hidePopup() }, t.prototype.cancel = function () { this.model.onCancel(), this.hidePopup() }, t.prototype.dispose = function () { e.prototype.dispose.call(this), this.unmountPopupContainer(), this.container = void 0, this.model.onVisibilityChanged.clear(), this.model.onRecalculatePosition.clear() }, t.prototype.initializePopupContainer = function () { if (!this.createdContainer) { var e = document.createElement("div"); this.container = this.createdContainer = e } var t = document.body.querySelector(".sv-popup-mount"); t ? t.appendChild(this.container) : document.body.appendChild(this.container) }, t.prototype.unmountPopupContainer = function () { this.createdContainer.remove() }, Ai([f({ defaultValue: "0px" })], t.prototype, "top", void 0), Ai([f({ defaultValue: "0px" })], t.prototype, "left", void 0), Ai([f({ defaultValue: "auto" })], t.prototype, "height", void 0), Ai([f({ defaultValue: "auto" })], t.prototype, "width", void 0), Ai([f({ defaultValue: "auto" })], t.prototype, "minWidth", void 0), Ai([f({ defaultValue: !1 })], t.prototype, "isVisible", void 0), Ai([f()], t.prototype, "locale", void 0), t }(ce), Ni = function () { function e() { } return e.calculatePosition = function (e, t, n, o, r, i, s) { void 0 === s && (s = "flex"); var a = e.left, l = e.top; return "flex" === s && (a = "center" == r ? (e.left + e.right - n) / 2 : "left" == r ? e.left - n : e.right), l = "middle" == o ? (e.top + e.bottom - t) / 2 : "top" == o ? e.top - t : e.bottom, i && "center" != r && "middle" != o && ("top" == o ? l += e.height : l -= e.height), { left: Math.round(a), top: Math.round(l) } }, e.updateVerticalDimensions = function (t, n, o) { var r; if (t < 0) r = { height: n + t, top: 0 }; else if (n + t > o) { r = { height: Math.min(n, o - t - e.bottomIndent), top: t } } return r }, e.updateHorizontalDimensions = function (e, t, n, o, r, i) { void 0 === r && (r = "flex"), void 0 === i && (i = { left: 0, right: 0 }), t += i.left + i.right; var s = void 0, a = e; return "center" === o && ("fixed" === r ? (e + t > n && (s = n - e), a -= i.left) : e < 0 ? (a = i.left, s = Math.min(t, n)) : t + e > n && (a = n - t, a = Math.max(a, i.left), s = Math.min(t, n))), "left" === o && e < 0 && (a = i.left, s = Math.min(t, n)), "right" === o && t + e > n && (s = n - e), { width: s - i.left - i.right, left: a } }, e.updateVerticalPosition = function (e, t, n, o, r) { var i = t - (e.top + (o ? e.height : 0)), s = t + e.bottom - (o ? e.height : 0) - r; return i > 0 && s <= 0 && "top" == n ? n = "bottom" : s > 0 && i <= 0 && "bottom" == n ? n = "top" : s > 0 && i > 0 && (n = i < s ? "top" : "bottom"), n }, e.calculatePopupDirection = function (e, t) { var n; return "center" == t && "middle" != e ? n = e : "center" != t && (n = t), n }, e.calculatePointerTarget = function (e, t, n, o, r, i, s) { void 0 === i && (i = 0), void 0 === s && (s = 0); var a = {}; return "center" != r ? (a.top = e.top + e.height / 2, a.left = e[r]) : "middle" != o && (a.top = e[o], a.left = e.left + e.width / 2), a.left = Math.round(a.left - n), a.top = Math.round(a.top - t), "left" == r && (a.left -= i + s), "center" === r && (a.left -= i), a }, e.bottomIndent = 16, e }(), Mi = function () { var e = function (t, n) { return (e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (e, t) { e.__proto__ = t } || function (e, t) { for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]) })(t, n) }; return function (t, n) { if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null"); function o() { this.constructor = t } e(t, n), t.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o) } }(), Fi = function (e, t, n, o) { var r, i = arguments.length, s = i < 3 ? t : null === o ? o = Object.getOwnPropertyDescriptor(t, n) : o; if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) s = Reflect.decorate(e, t, n, o); else for (var a = e.length - 1; a >= 0; a--)(r = e[a]) && (s = (i < 3 ? r(s) : i > 3 ? r(t, n, s) : r(t, n)) || s); return i > 3 && s && Object.defineProperty(t, n, s), s }, qi = function (e) { function t(t, n) { var o = e.call(this, t) || this; return o.targetElement = n, o.scrollEventCallBack = function (e) { if (o.isOverlay && An) return e.stopPropagation(), void e.preventDefault(); o.hidePopup() }, o.resizeEventCallback = function () { var e = window.visualViewport; document.documentElement.style.setProperty("--sv-popup-overlay-height", e.height * e.scale + "px") }, o.clientY = 0, o.touchStartEventCallback = function (e) { o.clientY = e.touches[0].clientY }, o.touchMoveEventCallback = function (e) { for (var t = e.target; t !== o.container;) { if ("auto" === window.getComputedStyle(t).overflowY && t.scrollHeight !== t.offsetHeight) { var n = t.scrollHeight, r = t.scrollTop, i = t.clientHeight, s = o.clientY - e.changedTouches[0].clientY; if (!(s > 0 && Math.abs(n - i - r) < 1 || s < 0 && r <= 0)) return } t = t.parentElement } e.preventDefault() }, o.model.onRecalculatePosition.add((function (e, t) { o.isOverlay || o.updatePosition(t.isResetHeight) })), o } return Mi(t, e), t.prototype._updatePosition = function () { if (this.targetElement) { var e = this.targetElement.getBoundingClientRect(), t = this.container.children[0]; if (t) { var n = t.children[0]; if (n) { var o = n.querySelector(".sv-popup__scrolling-content"), r = window.getComputedStyle(n), i = parseFloat(r.marginLeft) || 0, s = parseFloat(r.marginRight) || 0, a = n.offsetHeight - o.offsetHeight + o.scrollHeight, l = n.getBoundingClientRect().width; this.model.setWidthByTarget && (this.minWidth = e.width + "px"); var u = this.model.verticalPosition, c = this.getActualHorizontalPosition(); window && (a = Math.ceil(Math.min(a, .9 * window.innerHeight, window.visualViewport.height)), u = Ni.updateVerticalPosition(e, a, this.model.verticalPosition, this.model.showPointer, window.innerHeight)), this.popupDirection = Ni.calculatePopupDirection(u, c); var p = Ni.calculatePosition(e, a, l + i + s, u, c, this.showHeader, this.model.positionMode); if (window) { var h = Ni.updateVerticalDimensions(p.top, a, window.innerHeight); h && (this.height = h.height + "px", p.top = h.top); var d = Ni.updateHorizontalDimensions(p.left, l, window.innerWidth, c, this.model.positionMode, { left: i, right: s }); d && (this.width = d.width ? d.width + "px" : void 0, p.left = d.left) } this.left = p.left + "px", this.top = p.top + "px", this.showHeader && (this.pointerTarget = Ni.calculatePointerTarget(e, p.top, p.left, u, c, i, s)), this.pointerTarget.top += "px", this.pointerTarget.left += "px" } } } }, t.prototype.getActualHorizontalPosition = function () { var e = this.model.horizontalPosition; return !!document && "rtl" == document.defaultView.getComputedStyle(document.body).direction && ("left" === this.model.horizontalPosition ? e = "right" : "right" === this.model.horizontalPosition && (e = "left")), e }, t.prototype.getStyleClass = function () { return e.prototype.getStyleClass.call(this).append("sv-popup--dropdown", !this.isOverlay).append("sv-popup--show-pointer", !this.isOverlay && this.showHeader).append("sv-popup--" + this.popupDirection, !this.isOverlay && this.showHeader) }, t.prototype.getShowHeader = function () { return this.model.showPointer && !this.isOverlay }, t.prototype.getPopupHeaderTemplate = function () { return "popup-pointer" }, t.prototype.updateOnShowing = function () { this.prevActiveElement = document.activeElement, this.isOverlay ? (this.top = null, this.left = null, this.height = null, this.width = null, this.minWidth = null) : this.updatePosition(!0, !1), this.switchFocus(), this.shouldCreateResizeCallback && (window.visualViewport.addEventListener("resize", this.resizeEventCallback), this.container && (this.container.addEventListener("touchstart", this.touchStartEventCallback), this.container.addEventListener("touchmove", this.touchMoveEventCallback)), this.resizeEventCallback()), window.addEventListener("scroll", this.scrollEventCallBack) }, Object.defineProperty(t.prototype, "shouldCreateResizeCallback", { get: function () { return !!window.visualViewport && this.isOverlay && An }, enumerable: !1, configurable: !0 }), t.prototype.updatePosition = function (e, t) { var n = this; void 0 === t && (t = !0), e && (this.height = "auto"), t ? setTimeout((function () { n._updatePosition() }), 1) : this._updatePosition() }, t.prototype.updateOnHiding = function () { e.prototype.updateOnHiding.call(this), this.shouldCreateResizeCallback && (window.visualViewport.removeEventListener("resize", this.resizeEventCallback), this.container && (this.container.removeEventListener("touchstart", this.touchStartEventCallback), this.container.removeEventListener("touchmove", this.touchMoveEventCallback))), window.removeEventListener("scroll", this.scrollEventCallBack), this.isDisposed || (this.top = void 0, this.left = void 0, this.height = void 0, this.width = void 0, this.minWidth = void 0) }, Fi([f({ defaultValue: "left" })], t.prototype, "popupDirection", void 0), Fi([f({ defaultValue: { left: "0px", top: "0px" } })], t.prototype, "pointerTarget", void 0), t }(ji), ki = function () { var e = function (t, n) { return (e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (e, t) { e.__proto__ = t } || function (e, t) { for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]) })(t, n) }; return function (t, n) { if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null"); function o() { this.constructor = t } e(t, n), t.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o) } }(), Bi = function (e) { function t(t) { return e.call(this, t) || this } return ki(t, e), t.prototype.getStyleClass = function () { return e.prototype.getStyleClass.call(this).append("sv-popup--modal", !this.isOverlay) }, t.prototype.getShowFooter = function () { return !0 }, t.prototype.createFooterActionBar = function () { var t = this; e.prototype.createFooterActionBar.call(this), this.footerToolbarValue.addAction({ id: "apply", visibleIndex: 20, title: this.applyButtonText, innerCss: "sv-popup__body-footer-item sv-popup__button sv-popup__button--apply", action: function () { t.apply() } }) }, Object.defineProperty(t.prototype, "applyButtonText", { get: function () { return this.getLocalizationString("modalApplyButtonText") }, enumerable: !1, configurable: !0 }), t.prototype.apply = function () { this.model.onApply && !this.model.onApply() || this.hidePopup() }, t.prototype.clickOutside = function () { }, t.prototype.onKeyDown = function (t) { "Escape" !== t.key && 27 !== t.keyCode || this.model.onCancel(), e.prototype.onKeyDown.call(this, t) }, t }(ji); function Qi(e) { var t = new bt(e.componentName, e.data, "top", "left", !1, !0, e.onCancel, e.onApply, e.onHide, e.onShow, e.cssClass, e.title); t.displayMode = e.displayMode || "popup"; var n = new Bi(t); return n.initializePopupContainer(), n } function Hi(e, t) { return e.isModal ? new Bi(e) : new qi(e, t) } var zi = function () { var e = function (t, n) { return (e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (e, t) { e.__proto__ = t } || function (e, t) { for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]) })(t, n) }; return function (t, n) { if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null"); function o() { this.constructor = t } e(t, n), t.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o) } }(), Ui = function (e, t, n, o) { var r, i = arguments.length, s = i < 3 ? t : null === o ? o = Object.getOwnPropertyDescriptor(t, n) : o; if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) s = Reflect.decorate(e, t, n, o); else for (var a = e.length - 1; a >= 0; a--)(r = e[a]) && (s = (i < 3 ? r(s) : i > 3 ? r(t, n, s) : r(t, n)) || s); return i > 3 && s && Object.defineProperty(t, n, s), s }, Wi = function (e) { function t(t, n, o) { void 0 === n && (n = null), void 0 === o && (o = "buttongroupitemvalue"); var r = e.call(this, t, n, o) || this; return r.typeName = o, r } return zi(t, e), t.prototype.getType = function () { return this.typeName ? this.typeName : "buttongroupitemvalue" }, Ui([f()], t.prototype, "iconName", void 0), Ui([f()], t.prototype, "iconSize", void 0), Ui([f()], t.prototype, "showCaption", void 0), t }(qe), Ji = function (e) { function t(t) { return e.call(this, t) || this } return zi(t, e), t.prototype.getType = function () { return "buttongroup" }, t.prototype.getItemValueType = function () { return "buttongroupitemvalue" }, t.prototype.supportOther = function () { return !1 }, t }(Co); _.addClass("buttongroup", [{ name: "choices:buttongroupitemvalue[]" }], (function () { return new Ji("") }), "checkboxbase"), _.addClass("buttongroupitemvalue", [{ name: "showCaption:boolean", default: !0 }, { name: "iconName:text" }, { name: "iconSize:number" }], (function (e) { return new Wi(e) }), "itemvalue"); var Gi, $i = function () { function e(e, t, n) { this.question = e, this.item = t, this.index = n } return Object.defineProperty(e.prototype, "value", { get: function () { return this.item.value }, enumerable: !1, configurable: !0 }), Object.defineProperty(e.prototype, "iconName", { get: function () { return this.item.iconName }, enumerable: !1, configurable: !0 }), Object.defineProperty(e.prototype, "iconSize", { get: function () { return this.item.iconSize || 24 }, enumerable: !1, configurable: !0 }), Object.defineProperty(e.prototype, "caption", { get: function () { return this.item.locText }, enumerable: !1, configurable: !0 }), Object.defineProperty(e.prototype, "showCaption", { get: function () { return this.item.showCaption || void 0 === this.item.showCaption }, enumerable: !1, configurable: !0 }), Object.defineProperty(e.prototype, "isRequired", { get: function () { return this.question.isRequired }, enumerable: !1, configurable: !0 }), Object.defineProperty(e.prototype, "selected", { get: function () { return this.question.isItemSelected(this.item) }, enumerable: !1, configurable: !0 }), Object.defineProperty(e.prototype, "readOnly", { get: function () { return this.question.isInputReadOnly || !this.item.isEnabled }, enumerable: !1, configurable: !0 }), Object.defineProperty(e.prototype, "name", { get: function () { return this.question.name + "_" + this.question.id }, enumerable: !1, configurable: !0 }), Object.defineProperty(e.prototype, "id", { get: function () { return this.question.inputId + "_" + this.index }, enumerable: !1, configurable: !0 }), Object.defineProperty(e.prototype, "hasErrors", { get: function () { return this.question.errors.length > 0 }, enumerable: !1, configurable: !0 }), Object.defineProperty(e.prototype, "describedBy", { get: function () { return this.question.errors.length > 0 ? this.question.id + "_errors" : null }, enumerable: !1, configurable: !0 }), Object.defineProperty(e.prototype, "labelClass", { get: function () { return (new at).append(this.question.cssClasses.item).append(this.question.cssClasses.itemSelected, this.selected).append(this.question.cssClasses.itemHover, !this.readOnly && !this.selected).append(this.question.cssClasses.itemDisabled, this.question.isReadOnly || !this.item.isEnabled).toString() }, enumerable: !1, configurable: !0 }), Object.defineProperty(e.prototype, "css", { get: function () { return { label: this.labelClass, icon: this.question.cssClasses.itemIcon, control: this.question.cssClasses.itemControl, caption: this.question.cssClasses.itemCaption, decorator: this.question.cssClasses.itemDecorator } }, enumerable: !1, configurable: !0 }), e.prototype.onChange = function () { this.question.renderedValue = this.item.value }, e }(), Ki = function () { var e = function (t, n) { return (e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (e, t) { e.__proto__ = t } || function (e, t) { for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]) })(t, n) }; return function (t, n) { if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null"); function o() { this.constructor = t } e(t, n), t.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o) } }(), Xi = function (e) { function t() { var t = null !== e && e.apply(this, arguments) || this; return t.isEdge = !1, t.prevIsEdge = null, t.ghostSurveyElement = null, t.isDraggedElementSelected = !1, t.doBanDropHere = function () { t.removeGhostElementFromSurvey(), t.isEdge = null }, t.doDrop = function () { return t.dropTarget ? (document.activeElement.blur(), t.insertRealElementIntoSurvey()) : null }, t.doClear = function () { t.removeGhostElementFromSurvey(), t.isEdge = null, t.ghostSurveyElement = null, t.draggedElement && (t.draggedElement.isDragMe = !1), t.isRight = null }, t } return Ki(t, e), Object.defineProperty(t.prototype, "draggedElementType", { get: function () { return "survey-element" }, enumerable: !1, configurable: !0 }), t.prototype.startDragToolboxItem = function (e, t, n) { var o = this.createElementFromJson(t); o.toolboxItemTitle = n, this.startDrag(e, o, null, null, !0) }, t.prototype.startDragSurveyElement = function (e, t, n) { this.isDraggedElementSelected = n, this.startDrag(e, t) }, t.prototype.getShortcutText = function (t) { return t.toolboxItemTitle || e.prototype.getShortcutText.call(this, t) }, t.prototype.createDraggedElementShortcut = function (e, t, n) { var o = document.createElement("div"), r = document.createElement("span"); return r.className = "svc-dragged-element-shortcut__text", r.innerText = e, o.appendChild(this.createDraggedElementIcon()), o.appendChild(r), o.className = this.getDraggedElementClass(), o }, t.prototype.createDraggedElementIcon = function () { var e = document.createElement("span"), t = '<svg class="sv-svg-icon" role="img" style="width: 24px; height: 24px;"><use xlink:href="#icon-' + this.draggedElement.getType() + '"></use></svg>'; return e.className = "svc-dragged-element-shortcut__icon", e.innerHTML = t, e }, t.prototype.getDraggedElementClass = function () { var e = "svc-dragged-element-shortcut"; return this.isDraggedElementSelected && (e += " svc-dragged-element-shortcut--selected"), e }, t.prototype.createElementFromJson = function (e) { var t = this.createNewElement(e); return t.setSurveyImpl ? t.setSurveyImpl(this.survey) : t.setData(this.survey), t.renderWidth = "100%", t }, t.prototype.createNewElement = function (e) { var t = _.createClass(e.type); return (new S).toObject(e, t), t }, t.prototype.getDropTargetByDataAttributeValue = function (e, n, o) { if (this.isEdge = this.calculateIsEdge(n, o.clientY), !e) { var r = n.parentElement.closest(this.dropTargetDataAttributeName); e = this.getDataAttributeValueByNode(r) } if (!e) throw new Error("Can't find drop target survey element name"); if (e === t.ghostSurveyElementName) return this.prevDropTarget; if ("newGhostPage" === e) return t.newGhostPage; var i, s, a = this.survey.getPageByName(e); if (a) return 0 !== a.elements.length ? null : a; if (this.survey.pages.forEach((function (t) { (s = t.getElementByName(e)) && (i = s) })), "paneldynamic" !== i.getType() || this.isEdge || (i = i.template), "matrixdropdown" !== i.getType() && "matrixdynamic" !== i.getType() || "none" === i.detailPanelMode || this.isEdge ? i.isPanel && (i = this.getPanelDropTarget(n, i, o)) : i = i.detailPanel, !i.page) { var l = n.parentElement.closest("[data-sv-drop-target-page]"); e = l.dataset.svDropTargetPage; var u = this.survey.getPageByName(e); i.__page = u } return i }, t.prototype.isDropTargetValid = function () { return !!this.dropTarget && (this.dropTarget !== this.draggedElement && (("paneldynamic" !== this.draggedElement.getType() || this.dropTarget !== this.draggedElement.template) && (!t.restrictDragQuestionBetweenPages || !this.shouldRestricDragQuestionBetweenPages(this.dropTarget)))) }, t.prototype.calculateIsBottom = function (e, n) { return this.getDataAttributeValueByNode(n) === t.ghostSurveyElementName ? this.isBottom : e >= this.calculateVerticalMiddleOfHTMLElement(n) }, t.prototype.calculateIsRight = function (e, n) { return this.getDataAttributeValueByNode(n) === t.ghostSurveyElementName ? this.isRight : e >= this.calculateHorizontalMiddleOfHTMLElement(n) }, t.prototype.isDropTargetDoesntChanged = function (e) { return this.dropTarget === this.ghostSurveyElement || this.dropTarget === this.prevDropTarget && e === this.isBottom && this.isEdge === this.prevIsEdge && this.isRight === this.prevIsRight }, t.prototype.shouldRestricDragQuestionBetweenPages = function (e) { var t = this.draggedElement.page, n = e.isPage ? e : e.page; return t && t !== n }, t.prototype.getPanelDropTarget = function (e, t, n) { return this.isEdge || 0 === t.questions.length || (e = this.findDeepestDropTargetChild(e), t = this.getDropTargetByNode(e, n)), t }, t.prototype.findDeepestDropTargetChild = function (e) { for (var t = this.dropTargetDataAttributeName, n = e; e;)n = e, e = e.querySelector(t); return n }, t.prototype.calculateIsEdge = function (e, n) { var o = e.getBoundingClientRect(); return n - o.top <= t.edgeHeight || o.bottom - n <= t.edgeHeight }, t.prototype.doDragOver = function (e, t) { this.isRight = this.calculateIsRight(t.clientX, e) }, t.prototype.afterDragOver = function (e, t) { this.prevIsEdge = this.isEdge, this.prevIsRight = this.isRight, this.insertGhostElementIntoSurvey() }, t.prototype.onStartDrag = function () { this.ghostSurveyElement = this.createGhostSurveyElement(), this.draggedElement.isDragMe = !0 }, t.prototype.insertGhostElementIntoSurvey = function () { this.removeGhostElementFromSurvey(); var e = this.calcTargetRowMultiple(); if (this.ghostSurveyElement = this.createGhostSurveyElement(e), this.ghostSurveyElement.name = t.ghostSurveyElementName, this.parentElement = this.dropTarget.isPage ? this.dropTarget : this.dropTarget.page || this.dropTarget.__page, this.isDragOverInsideEmptyPanel()) this.dropTarget.dragTypeOverMe = Ot.InsideEmptyPanel; else { if (this.isEdge || !e) return this.parentElement.dragDropStart(this.draggedElement, this.ghostSurveyElement, t.nestedPanelDepth), this.parentElement.dragDropMoveTo(this.dropTarget, e ? this.isRight : this.isBottom, this.isEdge); this.dropTarget.dragTypeOverMe = this.isRight ? Ot.MultilineRight : Ot.MultilineLeft } }, t.prototype.calcTargetRowMultiple = function () { var e = this.getTargetParent(this.dropTarget), t = this.getTargetRow(this.dropTarget), n = t && t.elements.length > 1, o = e.isPanel && !e.name; return this.isEdge && n && !o ? (e.__page = this.dropTarget.page || this.dropTarget.__page, this.dropTarget = e, !1) : n }, t.prototype.getTargetParent = function (e) { var t = e.isPage || e.isPanel ? e : e.parent; return "paneldynamic" === e.getType() && (t = e.templateValue), t }, t.prototype.getTargetRow = function (e) { var t; return this.getTargetParent(e).rows.forEach((function (n) { -1 !== n.elements.indexOf(e) && (t = n) })), t }, t.prototype.isDragOverInsideEmptyPanel = function () { var e = this.dropTarget.isPanel && 0 === this.dropTarget.questions.length, t = !this.isEdge; return e && t }, t.prototype.removeGhostElementFromSurvey = function () { var e = this.prevDropTarget || this.dropTarget; e && (e.dragTypeOverMe = null), this.parentElement && this.parentElement.dragDropFinish(!0) }, t.prototype.insertRealElementIntoSurvey = function () { this.removeGhostElementFromSurvey(); var e = this.calcTargetRowMultiple(); this.dropTarget.isPage && this.dropTarget._isGhost && this.dropTarget._addGhostPageViewModel(); var n = (new S).toJsonObject(this.draggedElement); n.type = this.draggedElement.getType(); var o = this.createFakeTargetElement(this.draggedElement.name, n); return this.parentElement.dragDropStart(this.draggedElement, o, t.nestedPanelDepth), this.parentElement.dragDropMoveTo(this.dropTarget, e ? this.isRight : this.isBottom, this.isEdge), this.parentElement.dragDropFinish() }, t.prototype.createFakeTargetElement = function (e, t) { if (!e || !t) return null; var n = null; return n = _.createClass(t.type), (new S).toObject(t, n), n.name = e, n.setSurveyImpl ? n.setSurveyImpl(this.survey) : n.setData(this.survey), n.renderWidth = "100%", n }, t.prototype.createGhostSurveyElement = function (e) { void 0 === e && (e = !1); var n = "sv-drag-drop-ghost", o = "300px"; e && (o = "4px", n += " sv-drag-drop-ghost--vertical"); var r = { type: "html", minWidth: o, name: t.ghostSurveyElementName, html: '<div class="' + n + '"></div>' }, i = this.createElementFromJson(r); return i.startWithNewLine = !e, e && (i.maxWidth = "4px", i.renderWidth = "0px", i.paddingRight = "0px", i.paddingLeft = "0px"), i }, t.newGhostPage = null, t.restrictDragQuestionBetweenPages = !1, t.edgeHeight = 30, t.nestedPanelDepth = -1, t.ghostSurveyElementName = "sv-drag-drop-ghost-survey-element-name", t }(Mn); function Yi(e, t) { if (Gi != e) { var n = "survey-core has version '" + Gi + "' and " + t + " has version '" + e + "'. SurveyJS libraries should have the same versions to work correctly."; console.error(n) } } Gi = "1.9.75"; var Zi = { root: "sv_main sv_default_css", container: "sv_container", header: "sv_header", body: "sv_body", bodyEmpty: "sv_body sv_body_empty", footer: "sv_nav", title: "", description: "", logo: "sv_logo", logoImage: "sv_logo__image", headerText: "sv_header__text", navigationButton: "sv_nav_btn", completedPage: "sv_completed_page", navigation: { complete: "sv_complete_btn", prev: "sv_prev_btn", next: "sv_next_btn", start: "sv_start_btn", preview: "sv_preview_btn", edit: "sv_edit_btn" }, progress: "sv_progress", progressBar: "sv_progress_bar", progressTextInBar: "sv-hidden", progressButtonsContainerCenter: "sv_progress-buttons__container-center", progressButtonsContainer: "sv_progress-buttons__container", progressButtonsImageButtonLeft: "sv_progress-buttons__image-button-left", progressButtonsImageButtonRight: "sv_progress-buttons__image-button-right", progressButtonsImageButtonHidden: "sv_progress-buttons__image-button--hidden", progressButtonsListContainer: "sv_progress-buttons__list-container", progressButtonsList: "sv_progress-buttons__list", progressButtonsListElementPassed: "sv_progress-buttons__list-element--passed", progressButtonsListElementCurrent: "sv_progress-buttons__list-element--current", progressButtonsListElementNonClickable: "sv_progress-buttons__list-element--nonclickable", progressButtonsPageTitle: "sv_progress-buttons__page-title", progressButtonsPageDescription: "sv_progress-buttons__page-description", page: { root: "sv_p_root", title: "sv_page_title", description: "" }, pageTitle: "sv_page_title", pageDescription: "", row: "sv_row", question: { mainRoot: "sv_q sv_qstn", flowRoot: "sv_q_flow sv_qstn", header: "", headerLeft: "title-left", content: "", contentLeft: "content-left", titleLeftRoot: "sv_qstn_left", requiredText: "sv_q_required_text", title: "sv_q_title", titleExpandable: "sv_q_title_expandable", titleExpanded: "sv_q_title_expanded", titleCollapsed: "sv_q_title_collapsed", number: "sv_q_num", description: "sv_q_description", comment: "", required: "", titleRequired: "", hasError: "", indent: 20, footer: "sv_q_footer", formGroup: "form-group", asCell: "sv_matrix_cell", icon: "sv_question_icon", iconExpanded: "sv_expanded", disabled: "sv_q--disabled" }, panel: { title: "sv_p_title", titleExpandable: "sv_p_title_expandable", titleExpanded: "sv_p_title_expanded", titleCollapsed: "sv_p_title_collapsed", titleOnError: "", icon: "sv_panel_icon", iconExpanded: "sv_expanded", description: "sv_p_description", container: "sv_p_container", footer: "sv_p_footer", number: "sv_q_num", requiredText: "sv_q_required_text" }, error: { root: "sv_q_erbox", icon: "", item: "", locationTop: "sv_qstn_error_top", locationBottom: "sv_qstn_error_bottom" }, boolean: { root: "sv_qcbc sv_qbln", rootRadio: "sv_qcbc sv_qbln", item: "sv-boolean", control: "sv-visuallyhidden", itemChecked: "sv-boolean--checked checked", itemIndeterminate: "sv-boolean--indeterminate", itemDisabled: "sv-boolean--disabled", switch: "sv-boolean__switch", slider: "sv-boolean__slider", label: "sv-boolean__label ", disabledLabel: "sv-boolean__label--disabled", rootCheckbox: "sv_qcbc sv_qbln", checkboxItem: "sv-boolean", checkboxItemChecked: "sv-boolean--checked", controlCheckbox: "sv-visuallyvisible", checkboxControlLabel: "sv-boolean__label", checkboxItemIndeterminate: "sv-boolean--indeterminate", checkboxItemDisabled: "sv-item--disabled sv-boolean--disabled", checkboxMaterialDecorator: "sv-item__decorator sv-boolean__decorator", checkboxItemDecorator: "sv-item__svg sv-boolean__svg" }, checkbox: { root: "sv_qcbc sv_qcbx", item: "sv_q_checkbox", itemSelectAll: "sv_q_checkbox_selectall", itemNone: "sv_q_checkbox_none", itemChecked: "checked", itemInline: "sv_q_checkbox_inline", label: "sv_q_checkbox_label", labelChecked: "", itemControl: "sv_q_checkbox_control_item", itemDecorator: "sv-hidden", controlLabel: "sv_q_checkbox_control_label", other: "sv_q_other sv_q_checkbox_other", column: "sv_q_select_column" }, ranking: { root: "sv-ranking", rootMobileMod: "sv-ranking--mobile", rootDragMod: "sv-ranking--drag", rootDisabled: "sv-ranking--disabled", rootDragHandleAreaIcon: "sv-ranking--drag-handle-area-icon", item: "sv-ranking-item", itemContent: "sv-ranking-item__content", itemIndex: "sv-ranking-item__index", itemIndexEmptyMode: "sv-ranking-item__index--empty", controlLabel: "sv-ranking-item__text", itemGhostNode: "sv-ranking-item__ghost", itemIconContainer: "sv-ranking-item__icon-container", itemIcon: "sv-ranking-item__icon", itemIconHoverMod: "sv-ranking-item__icon--hover", itemIconFocusMod: "sv-ranking-item__icon--focus", itemGhostMod: "sv-ranking-item--ghost", itemDragMod: "sv-ranking-item--drag" }, comment: { remainingCharacterCounter: "sv-remaining-character-counter" }, dropdown: { root: "", popup: "sv-dropdown-popup", control: "sv_q_dropdown_control", controlInputFieldComponent: "sv_q_dropdown_control__input-field-component", selectWrapper: "sv_select_wrapper", other: "sv_q_dd_other", cleanButton: "sv_q_dropdown_clean-button", cleanButtonSvg: "sv_q_dropdown_clean-button-svg", cleanButtonIconId: "icon-clear_16x16", controlValue: "sv_q_dropdown__value", filterStringInput: "sv_q_dropdown__filter-string-input" }, html: { root: "" }, image: { root: "sv_q_image", image: "sv_image_image" }, matrix: { root: "sv_q_matrix", label: "sv_q_m_label", itemChecked: "checked", itemDecorator: "sv-hidden", cell: "sv_q_m_cell", cellText: "sv_q_m_cell_text", cellTextSelected: "sv_q_m_cell_selected", cellLabel: "sv_q_m_cell_label", cellResponsiveTitle: "sv-hidden" }, matrixdropdown: { root: "sv_q_matrix_dropdown", cell: "sv_matrix_cell", headerCell: "sv_matrix_cell_header", row: "sv_matrix_row", rowAdditional: "sv-matrix__row--additional", detailRow: "sv_matrix_detail_row", detailRowText: "sv_matrix_cell_detail_rowtext", detailCell: "sv_matrix_cell_detail", choiceCell: "sv-table__cell--choice", detailButton: "sv_matrix_cell_detail_button", detailButtonExpanded: "sv_matrix_cell_detail_button_expanded", detailIcon: "sv_detail_panel_icon", detailIconExpanded: "sv_detail_expanded", detailPanelCell: "sv_matrix_cell_detail_panel", actionsCell: "sv_matrix_cell sv_matrix_cell_actions" }, matrixdynamic: { root: "sv_q_matrix_dynamic", button: "sv_matrix_dynamic_button", buttonAdd: "", buttonRemove: "", iconAdd: "", iconRemove: "", iconDrag: "sv-matrixdynamic__drag-icon", cell: "sv_matrix_cell", headerCell: "sv_matrix_cell_header", row: "sv_matrix_row", detailRow: "sv_matrix_detail_row", detailCell: "sv_matrix_cell_detail", choiceCell: "sv-table__cell--choice", detailButton: "sv_matrix_cell_detail_button", detailButtonExpanded: "sv_matrix_cell_detail_button_expanded", detailIcon: "sv_detail_panel_icon", detailIconExpanded: "sv_detail_expanded", detailPanelCell: "sv_matrix_cell_detail_panel", actionsCell: "sv_matrix_cell sv_matrix_cell_actions", emptyRowsSection: "sv_matrix_empty_rows_section", emptyRowsText: "sv_matrix_empty_rows_text", emptyRowsButton: "", ghostRow: "sv-matrix-row--drag-drop-ghost-mod" }, paneldynamic: { root: "sv_panel_dynamic", title: "sv_p_title", button: "", buttonAdd: "sv-paneldynamic__add-btn", buttonRemove: "sv_p_remove_btn", buttonRemoveRight: "sv_p_remove_btn_right", buttonPrev: "sv-paneldynamic__prev-btn", buttonPrevDisabled: "sv-paneldynamic__prev-btn--disabled", buttonNextDisabled: "sv-paneldynamic__next-btn--disabled", buttonNext: "sv-paneldynamic__next-btn", progressContainer: "sv-paneldynamic__progress-container", progress: "sv-progress", progressBar: "sv-progress__bar", progressText: "sv-paneldynamic__progress-text", panelWrapper: "sv_p_wrapper", panelWrapperInRow: "sv_p_wrapper_in_row", footer: "", progressBtnIcon: "icon-progressbutton" }, multipletext: { root: "sv_q_mt", itemTitle: "sv_q_mt_title", item: "sv_q_mt_item", row: "sv_q_mt_row", itemLabel: "sv_q_mt_label", itemValue: "sv_q_mt_item_value sv_q_text_root" }, radiogroup: { root: "sv_qcbc", item: "sv_q_radiogroup", itemChecked: "checked", itemInline: "sv_q_radiogroup_inline", itemDecorator: "sv-hidden", label: "sv_q_radiogroup_label", labelChecked: "", itemControl: "sv_q_radiogroup_control_item", controlLabel: "", other: "sv_q_other sv_q_radiogroup_other", clearButton: "sv_q_radiogroup_clear", column: "sv_q_select_column" }, buttongroup: { root: "sv-button-group", item: "sv-button-group__item", itemIcon: "sv-button-group__item-icon", itemDecorator: "sv-button-group__item-decorator", itemCaption: "sv-button-group__item-caption", itemHover: "sv-button-group__item--hover", itemSelected: "sv-button-group__item--selected", itemDisabled: "sv-button-group__item--disabled", itemControl: "sv-visuallyhidden" }, imagepicker: { root: "sv_imgsel", item: "sv_q_imgsel", itemChecked: "checked", label: "sv_q_imgsel_label", itemControl: "sv_q_imgsel_control_item", image: "sv_q_imgsel_image", itemInline: "sv_q_imagepicker_inline", itemText: "sv_q_imgsel_text", clearButton: "sv_q_radiogroup_clear", column: "sv_q_select_column" }, rating: { root: "sv_q_rating", item: "sv_q_rating_item", selected: "active", minText: "sv_q_rating_min_text", itemText: "sv_q_rating_item_text", maxText: "sv_q_rating_max_text" }, text: { root: "sv_q_text_root", remainingCharacterCounter: "sv-remaining-character-counter" }, expression: "", file: { root: "sv_q_file", placeholderInput: "sv-visuallyhidden", preview: "sv_q_file_preview", removeButton: "sv_q_file_remove_button", fileInput: "sv-visuallyhidden", removeFile: "sv_q_file_remove", fileDecorator: "sv-file__decorator", fileSign: "sv_q_file_sign", chooseFile: "sv_q_file_choose_button", noFileChosen: "sv_q_file_placeholder", dragAreaPlaceholder: "sv-hidden", fileList: "" }, signaturepad: { root: "sv_q_signaturepad sjs_sp_container", controls: "sjs_sp_controls", placeholder: "sjs_sp_placeholder", clearButton: "sjs_sp_clear" }, saveData: { root: "sv-save-data_root", info: "sv-save-data_info", error: "sv-save-data_error", success: "sv-save-data_success", button: "sv-save-data_button" }, window: { root: "sv_window", body: "sv_window_content", header: { root: "sv_window_title", title: "", button: "", buttonExpanded: "", buttonCollapsed: "" } }, variables: { themeMark: "--sv-default-mark" }, tagbox: { root: "", popup: "sv-dropdown-popup", small: "sv_q_row__question--small", selectWrapper: "sv_select_wrapper sv_q_tagbox_wrapper", other: "sv_q_input sv_q_comment sv_q_selectbase__other", cleanButton: "sv_q_tagbox_clean-button sv_q_dropdown_clean-button", cleanButtonSvg: "sv_q_tagbox_clean-button-svg sv_q_dropdown_clean-button-svg", cleanButtonIconId: "icon-clear_16x16", cleanItemButton: "sv_q_tagbox-item_clean-button", cleanItemButtonSvg: "sv_q_tagbox-item_clean-button-svg", cleanItemButtonIconId: "icon-clear_16x16", control: "sv_q_input sv_q_tagbox sv_q_dropdown_control", controlValue: "sv_q_tagbox__value sv_q_dropdown__value", controlEmpty: "sv_q_dropdown--empty sv_q_tagbox--empty", placeholderInput: "sv_q_tagbox__placeholder", filterStringInput: "sv_q_tagbox__filter-string-input sv_q_dropdown__filter-string-input" } }; Un.default = Zi, Un.orange = Zi, Un.darkblue = Zi, Un.darkrose = Zi, Un.stone = Zi, Un.winter = Zi, Un.winterstone = Zi; var es = { root: "sv-root-modern", timerRoot: "sv-body__timer", container: "sv-container-modern", header: "sv-title sv-container-modern__title", headerClose: "sv-container-modern__close", body: "sv-body", bodyEmpty: "sv-body sv-body--empty", footer: "sv-footer sv-body__footer sv-clearfix", title: "", description: "", logo: "sv-logo", logoImage: "sv-logo__image", headerText: "sv-header__text", navigationButton: "sv-btn sv-btn--navigation", completedPage: "sv-completedpage", navigation: { complete: "sv-footer__complete-btn", prev: "sv-footer__prev-btn", next: "sv-footer__next-btn", start: "sv-footer__start-btn", preview: "sv-footer__preview-btn", edit: "sv-footer__edit-btn" }, panel: { title: "sv-title sv-panel__title", titleExpandable: "sv-panel__title--expandable", titleExpanded: "sv-panel__title--expanded", titleCollapsed: "sv-panel__title--collapsed", titleOnError: "sv-panel__title--error", description: "sv-description sv-panel__description", container: "sv-panel sv-row__panel", content: "sv-panel__content", icon: "sv-panel__icon", iconExpanded: "sv-panel__icon--expanded", footer: "sv-panel__footer", requiredText: "sv-panel__required-text", number: "sv-question__num" }, paneldynamic: { root: "sv-paneldynamic", navigation: "sv-paneldynamic__navigation", title: "sv-title sv-question__title", button: "sv-btn", buttonRemove: "sv-paneldynamic__remove-btn", buttonRemoveRight: "sv-paneldynamic__remove-btn--right", buttonAdd: "sv-paneldynamic__add-btn", progressTop: "sv-paneldynamic__progress sv-paneldynamic__progress--top", progressBottom: "sv-paneldynamic__progress sv-paneldynamic__progress--bottom", buttonPrev: "sv-paneldynamic__prev-btn", buttonNext: "sv-paneldynamic__next-btn", buttonPrevDisabled: "sv-paneldynamic__prev-btn--disabled", buttonNextDisabled: "sv-paneldynamic__next-btn--disabled", progressContainer: "sv-paneldynamic__progress-container", progress: "sv-progress", progressBar: "sv-progress__bar", progressText: "sv-paneldynamic__progress-text", separator: "sv-paneldynamic__separator", panelWrapper: "sv-paneldynamic__panel-wrapper", panelWrapperInRow: "sv-paneldynamic__panel-wrapper--in-row", progressBtnIcon: "icon-progressbutton", footer: "" }, progress: "sv-progress sv-body__progress", progressBar: "sv-progress__bar", progressText: "sv-progress__text", progressTextInBar: "sv-hidden", progressButtonsContainerCenter: "sv_progress-buttons__container-center", progressButtonsContainer: "sv_progress-buttons__container", progressButtonsImageButtonLeft: "sv_progress-buttons__image-button-left", progressButtonsImageButtonRight: "sv_progress-buttons__image-button-right", progressButtonsImageButtonHidden: "sv_progress-buttons__image-button--hidden", progressButtonsListContainer: "sv_progress-buttons__list-container", progressButtonsList: "sv_progress-buttons__list", progressButtonsListElementPassed: "sv_progress-buttons__list-element--passed", progressButtonsListElementCurrent: "sv_progress-buttons__list-element--current", progressButtonsListElementNonClickable: "sv_progress-buttons__list-element--nonclickable", progressButtonsPageTitle: "sv_progress-buttons__page-title", progressButtonsPageDescription: "sv_progress-buttons__page-description", page: { root: "sv-page sv-body__page", title: "sv-title sv-page__title", description: "sv-description sv-page__description" }, pageTitle: "sv-title sv-page__title", pageDescription: "sv-description sv-page__description", row: "sv-row sv-clearfix", question: { mainRoot: "sv-question sv-row__question", flowRoot: "sv-question sv-row__question sv-row__question--flow", asCell: "sv-table__cell", header: "sv-question__header", headerLeft: "sv-question__header--location--left", headerTop: "sv-question__header--location--top", headerBottom: "sv-question__header--location--bottom", content: "sv-question__content", contentLeft: "sv-question__content--left", titleLeftRoot: "", answered: "sv-question--answered", titleOnAnswer: "sv-question__title--answer", titleOnError: "sv-question__title--error", title: "sv-title sv-question__title", titleExpandable: "sv-question__title--expandable", titleExpanded: "sv-question__title--expanded", titleCollapsed: "sv-question__title--collapsed", icon: "sv-question__icon", iconExpanded: "sv-question__icon--expanded", requiredText: "sv-question__required-text", number: "sv-question__num", description: "sv-description sv-question__description", descriptionUnderInput: "sv-description sv-question__description", comment: "sv-comment", required: "sv-question--required", titleRequired: "sv-question__title--required", indent: 20, footer: "sv-question__footer", formGroup: "sv-question__form-group", hasError: "", disabled: "sv-question--disabled" }, image: { root: "sv-image", image: "sv_image_image" }, error: { root: "sv-question__erbox", icon: "", item: "", locationTop: "sv-question__erbox--location--top", locationBottom: "sv-question__erbox--location--bottom" }, checkbox: { root: "sv-selectbase", item: "sv-item sv-checkbox sv-selectbase__item", itemSelectAll: "sv-checkbox--selectall", itemNone: "sv-checkbox--none", itemDisabled: "sv-item--disabled sv-checkbox--disabled", itemChecked: "sv-checkbox--checked", itemHover: "sv-checkbox--allowhover", itemInline: "sv-selectbase__item--inline", label: "sv-selectbase__label", labelChecked: "", itemControl: "sv-visuallyhidden sv-item__control", itemDecorator: "sv-item__svg sv-checkbox__svg", itemSvgIconId: "#icon-moderncheck", controlLabel: "sv-item__control-label", materialDecorator: "sv-item__decorator sv-selectbase__decorator sv-checkbox__decorator", other: "sv-comment sv-question__other", column: "sv-selectbase__column" }, ranking: { root: "sv-ranking", rootMobileMod: "sv-ranking--mobile", rootDragMod: "sv-ranking--drag", rootDisabled: "sv-ranking--disabled", rootDragHandleAreaIcon: "sv-ranking--drag-handle-area-icon", item: "sv-ranking-item", itemContent: "sv-ranking-item__content", itemIndex: "sv-ranking-item__index", itemIndexEmptyMode: "sv-ranking-item__index--empty", controlLabel: "sv-ranking-item__text", itemGhostNode: "sv-ranking-item__ghost", itemIconContainer: "sv-ranking-item__icon-container", itemIcon: "sv-ranking-item__icon", itemIconHoverMod: "sv-ranking-item__icon--hover", itemIconFocusMod: "sv-ranking-item__icon--focus", itemGhostMod: "sv-ranking-item--ghost", itemDragMod: "sv-ranking-item--drag" }, radiogroup: { root: "sv-selectbase", item: "sv-item sv-radio sv-selectbase__item", itemInline: "sv-selectbase__item--inline", label: "sv-selectbase__label", labelChecked: "", itemDisabled: "sv-item--disabled sv-radio--disabled", itemChecked: "sv-radio--checked", itemHover: "sv-radio--allowhover", itemControl: "sv-visuallyhidden sv-item__control", itemDecorator: "sv-item__svg sv-radio__svg", itemSvgIconId: "#icon-modernradio", controlLabel: "sv-item__control-label", materialDecorator: "sv-item__decorator sv-selectbase__decorator sv-radio__decorator", other: "sv-comment sv-question__other", clearButton: "sv-btn sv-selectbase__clear-btn", column: "sv-selectbase__column" }, buttongroup: { root: "sv-button-group", item: "sv-button-group__item", itemIcon: "sv-button-group__item-icon", itemDecorator: "sv-button-group__item-decorator", itemCaption: "sv-button-group__item-caption", itemSelected: "sv-button-group__item--selected", itemHover: "sv-button-group__item--hover", itemDisabled: "sv-button-group__item--disabled", itemControl: "sv-visuallyhidden" }, boolean: { root: "sv_qbln", rootRadio: "sv_qbln", small: "sv-row__question--small", item: "sv-boolean sv-item", control: "sv-visuallyhidden", itemChecked: "sv-boolean--checked", itemIndeterminate: "sv-boolean--indeterminate", itemDisabled: "sv-item--disabled sv-boolean--disabled", switch: "sv-boolean__switch", slider: "sv-boolean__slider", label: "sv-boolean__label", disabledLabel: "sv-boolean__label--disabled", rootCheckbox: "sv_qbln", checkboxItem: "sv-boolean sv-item", checkboxItemChecked: "sv-boolean--checked", controlCheckbox: "sv-visuallyhidden", checkboxControlLabel: "sv-boolean__label", checkboxItemIndeterminate: "sv-boolean--indeterminate", checkboxItemDisabled: "sv-item--disabled sv-boolean--disabled", checkboxMaterialDecorator: "sv-item__decorator sv-boolean__decorator ", checkboxItemDecorator: "sv-item__svg sv-boolean__svg", indeterminatePath: "sv-boolean__indeterminate-path", svgIconCheckedId: "#icon-modernbooleancheckchecked", svgIconUncheckedId: "#icon-modernbooleancheckunchecked", svgIconIndId: "#icon-modernbooleancheckind" }, text: { root: "sv-text", small: "sv-row__question--small", remainingCharacterCounter: "sv-remaining-character-counter", onError: "sv-text--error" }, multipletext: { root: "sv-multipletext", item: "sv-multipletext__item", itemLabel: "sv-multipletext__item-label", itemTitle: "sv-multipletext__item-title", row: "sv-multipletext__row", cell: "sv-multipletext__cell" }, dropdown: { root: "", popup: "sv-dropdown-popup", small: "sv-row__question--small", control: "sv-dropdown", selectWrapper: "", other: "sv-comment sv-question__other", onError: "sv-dropdown--error", cleanButton: "sv-dropdown_clean-button", cleanButtonSvg: "sv-dropdown_clean-button-svg", cleanButtonIconId: "icon-clear_16x16", filterStringInput: "sv-dropdown__filter-string-input", controlValue: "sv-dropdown__value", controlInputFieldComponent: "sv_dropdown_control__input-field-component" }, tagbox: { root: "", popup: "sv-dropdown-popup", small: "sv-row__question--small", selectWrapper: "sv_select_wrapper sv-tagbox_wrapper", other: "sv-input sv-comment sv-selectbase__other", cleanButton: "sv-tagbox_clean-button sv-dropdown_clean-button", cleanButtonSvg: "sv-tagbox_clean-button-svg sv-dropdown_clean-button-svg", cleanButtonIconId: "icon-clear_16x16", cleanItemButton: "sv-tagbox__item_clean-button", cleanItemButtonSvg: "sv-tagbox__item_clean-button-svg", cleanItemButtonIconId: "icon-clear_16x16", control: "sv-input sv-tagbox sv-dropdown", controlValue: "sv-tagbox__value sv-dropdown__value", controlEmpty: "sv-dropdown--empty sv-tagbox--empty", placeholderInput: "sv-tagbox__placeholder", filterStringInput: "sv-tagbox__filter-string-input sv-dropdown__filter-string-input" }, imagepicker: { root: "sv-selectbase sv-imagepicker", column: "sv-selectbase__column", item: "sv-imagepicker__item", itemInline: "sv-imagepicker__item--inline", itemChecked: "sv-imagepicker__item--checked", itemDisabled: "sv-imagepicker__item--disabled", itemHover: "sv-imagepicker__item--allowhover", label: "sv-imagepicker__label", itemControl: "sv-imagepicker__control sv-visuallyhidden", image: "sv-imagepicker__image", itemText: "sv-imagepicker__text", clearButton: "sv-btn", other: "sv-comment sv-question__other" }, matrix: { tableWrapper: "sv-matrix", root: "sv-table sv-matrix-root", rowError: "sv-matrix__row--error", cell: "sv-table__cell sv-matrix__cell", headerCell: "sv-table__cell sv-table__cell--header", label: "sv-item sv-radio sv-matrix__label", itemValue: "sv-visuallyhidden sv-item__control sv-radio__control", itemChecked: "sv-radio--checked", itemDisabled: "sv-item--disabled sv-radio--disabled", itemHover: "sv-radio--allowhover", materialDecorator: "sv-item__decorator sv-radio__decorator", itemDecorator: "sv-item__svg sv-radio__svg", cellText: "sv-matrix__text", cellTextSelected: "sv-matrix__text--checked", cellTextDisabled: "sv-matrix__text--disabled", cellResponsiveTitle: "sv-hidden", itemSvgIconId: "#icon-modernradio" }, matrixdropdown: { root: "sv-table sv-matrixdropdown", cell: "sv-table__cell", headerCell: "sv-table__cell sv-table__cell--header", row: "sv-table__row", rowAdditional: "sv-table__row--additional", detailRow: "sv-table__row--detail", detailRowText: "sv-table__cell--detail-rowtext", detailCell: "sv-table__cell--detail", choiceCell: "sv-table__cell--choice", detailButton: "sv-table__cell--detail-button", detailButtonExpanded: "sv-table__cell--detail-button--expanded", detailIcon: "sv-detail-panel__icon", detailIconExpanded: "sv-detail-panel__icon--expanded", detailPanelCell: "sv-table__cell--detail-panel", actionsCell: "sv-table__cell sv-table__cell--actions" }, matrixdynamic: { root: "sv-table sv-matrixdynamic", cell: "sv-table__cell", headerCell: "sv-table__cell sv-table__cell--header", button: "sv-btn", buttonAdd: "sv-matrixdynamic__add-btn", buttonRemove: "sv-matrixdynamic__remove-btn", iconAdd: "", iconRemove: "", iconDrag: "sv-matrixdynamic__drag-icon", row: "sv-table__row", detailRow: "sv-table__row--detail", detailCell: "sv-table__cell--detail", choiceCell: "sv-table__cell--choice", detailButton: "sv-table__cell--detail-button", detailButtonExpanded: "sv-table__cell--detail-button--expanded", detailIcon: "sv-detail-panel__icon", detailIconExpanded: "sv-detail-panel__icon--expanded", detailPanelCell: "sv-table__cell--detail-panel", actionsCell: "sv-table__cell sv-table__cell--actions", emptyRowsSection: "sv-table__empty--rows--section", emptyRowsText: "sv-table__empty--rows--text", emptyRowsButton: "", ghostRow: "sv-matrix-row--drag-drop-ghost-mod" }, rating: { root: "sv-rating", item: "sv-rating__item", selected: "sv-rating__item--selected", minText: "sv-rating__min-text", itemText: "sv-rating__item-text", maxText: "sv-rating__max-text", itemDisabled: "sv-rating--disabled", filterStringInput: "sv-dropdown__filter-string-input", control: "sv-dropdown", cleanButton: "sv-dropdown_clean-button", cleanButtonSvg: "sv-dropdown_clean-button-svg", cleanButtonIconId: "icon-clear_16x16", controlValue: "sv-dropdown__value", controlInputFieldComponent: "sv_dropdown_control__input-field-component" }, comment: { root: "sv-comment", small: "sv-row__question--small", remainingCharacterCounter: "sv-remaining-character-counter" }, expression: "", file: { root: "sv-file", other: "sv-comment sv-question__other", placeholderInput: "sv-visuallyhidden", preview: "sv-file__preview", fileSignBottom: "sv-file__sign", fileDecorator: "sv-file__decorator", fileInput: "sv-visuallyhidden", noFileChosen: "sv-description sv-file__no-file-chosen", chooseFile: "sv-btn sv-file__choose-btn", controlDisabled: "sv-file__choose-btn--disabled", removeButton: "sv-hidden", removeButtonBottom: "sv-btn sv-file__clean-btn", removeFile: "sv-hidden", removeFileSvg: "sv-file__remove-svg", removeFileSvgIconId: "icon-removefile", wrapper: "sv-file__wrapper", dragAreaPlaceholder: "sv-hidden", fileList: "" }, signaturepad: { root: "sv-signaturepad sjs_sp_container", small: "sv-row__question--small", controls: "sjs_sp_controls", placeholder: "sjs_sp_placeholder", clearButton: "sjs_sp_clear" }, saveData: { root: "sv-save-data_root", info: "sv-save-data_info", error: "sv-save-data_error", success: "sv-save-data_success", button: "sv-save-data_button" }, window: { root: "sv_window", body: "sv_window_content", header: { root: "sv_window_title", title: "", button: "", buttonExpanded: "", buttonCollapsed: "" } }, variables: { themeMark: "--sv-modern-mark" } }; Un.modern = es; var ts = function () { function e() { this.icons = {}, this.iconPrefix = "icon-" } return e.prototype.registerIconFromSymbol = function (e, t) { this.icons[e] = t }, e.prototype.registerIconFromSvgViaElement = function (e, t, n) { void 0 === n && (n = this.iconPrefix); var o = document.createElement("div"); o.innerHTML = t; var r = document.createElement("symbol"), i = o.querySelector("svg"); r.innerHTML = i.innerHTML; for (var s = 0; s < i.attributes.length; s++)r.setAttributeNS("http://www.w3.org/2000/svg", i.attributes[s].name, i.attributes[s].value); r.id = n + e, this.registerIconFromSymbol(e, r.outerHTML) }, e.prototype.registerIconFromSvg = function (e, t, n) { void 0 === n && (n = this.iconPrefix); var o = (t = t.trim()).toLowerCase(); return "<svg " === o.substring(0, "<svg ".length) && "</svg>" === o.substring(o.length - "</svg>".length, o.length) && (this.registerIconFromSymbol(e, '<symbol id="' + n + e + '" ' + t.substring("<svg ".length, o.length - "</svg>".length) + "</symbol>"), !0) }, e.prototype.registerIconsFromFolder = function (e) { var t = this; e.keys().forEach((function (n) { t.registerIconFromSvg(n.substring(2, n.length - 4).toLowerCase(), e(n)) })) }, e.prototype.iconsRenderedHtml = function () { var e = this; return Object.keys(this.icons).map((function (t) { return e.icons[t] })).join("") }, e.prototype.renderIcons = function () { if (!document.getElementById("sv-icon-holder-global-container")) { var e = document.createElement("div"); e.id = "sv-icon-holder-global-container", e.innerHTML = "<svg>" + this.iconsRenderedHtml() + "</svg>", e.style.display = "none", document.head.insertBefore(e, document.head.firstChild) } }, e }(), ns = new ts, os = n(4); ns.registerIconsFromFolder(os); var rs = function () { function e(e) { var t = this; this.tooltipElement = e, this.onMouseMoveCallback = function (e) { t.tooltipElement.style.left = e.clientX + 12 + "px", t.tooltipElement.style.top = e.clientY + 12 + "px" }, this.targetElement = e.parentElement, this.targetElement.addEventListener("mousemove", this.onMouseMoveCallback) } return e.prototype.dispose = function () { this.targetElement.removeEventListener("mousemove", this.onMouseMoveCallback) }, e }() }]) }));
| ver. 1.4 |
Github
|
.
| PHP 7.2.34 | Generation time: 0.42 |
proxy
|
phpinfo
|
Settings