` element with a non-editable question value within it.\n *\n * - `textRenderMode`: `\"input\"` (default) | `\"div\"`\\\n * Specifies how to render the input field of [Text](https://surveyjs.io/form-library/documentation/api-reference/text-entry-question-model) questions in [read-only](https://surveyjs.io/form-library/documentation/api-reference/text-entry-question-model#readOnly) mode: as a disabled `
` element with a non-editable question value within it.\n */\n readOnly: {\n enableValidation: false,\n commentRenderMode: \"textarea\",\n textRenderMode: \"input\"\n },\n //#region readOnly section, Obsolete properties\n get readOnlyCommentRenderMode() { return this.readOnly.commentRenderMode; },\n set readOnlyCommentRenderMode(val) { this.readOnly.commentRenderMode = val; },\n get readOnlyTextRenderMode() { return this.readOnly.textRenderMode; },\n set readOnlyTextRenderMode(val) { this.readOnly.textRenderMode = val; },\n //#endregion\n /**\n * An object with properties that configure question numbering.\n *\n * Nested properties:\n *\n * - `includeQuestionsWithHiddenNumber`: `boolean`\\\n * Specifies whether to number questions whose [`hideNumber`](https://surveyjs.io/form-library/documentation/api-reference/question#hideNumber) property is enabled. Default value: `false`.\n *\n * - `includeQuestionsWithHiddenTitle`: `boolean`\\\n * Specifies whether to number questions whose [`titleLocation`](https://surveyjs.io/form-library/documentation/api-reference/question#titleLocation) property is set to `\"hidden\"`. Default value: `false`.\n */\n numbering: {\n includeQuestionsWithHiddenNumber: false,\n includeQuestionsWithHiddenTitle: false\n },\n //#region numbering section, Obsolete properties\n get setQuestionVisibleIndexForHiddenTitle() { return this.numbering.includeQuestionsWithHiddenTitle; },\n set setQuestionVisibleIndexForHiddenTitle(val) { this.numbering.includeQuestionsWithHiddenTitle = val; },\n get setQuestionVisibleIndexForHiddenNumber() { return this.numbering.includeQuestionsWithHiddenNumber; },\n set setQuestionVisibleIndexForHiddenNumber(val) { this.numbering.includeQuestionsWithHiddenNumber = val; },\n //#endregion\n /**\n * Specifies an action to perform when users press the Enter key within a survey.\n *\n * Possible values:\n *\n * - `\"moveToNextEditor\"` - Moves focus to the next editor.\n * - `\"loseFocus\"` - Removes focus from the current editor.\n * - `\"default\"` - Behaves as a standard `
` element.\n */\n enterKeyAction: \"default\",\n /**\n * An object that configures string comparison.\n *\n * Nested properties:\n *\n * - `trimStrings`: `boolean`\\\n * Specifies whether to remove whitespace from both ends of a string before the comparison. Default value: `true`.\n *\n * - `caseSensitive`: `boolean`\\\n * Specifies whether to differentiate between capital and lower-case letters. Default value: `false`.\n */\n comparator: {\n trimStrings: true,\n caseSensitive: false,\n normalizeTextCallback: function (str, reason) { return str; }\n },\n expressionDisableConversionChar: \"#\",\n get commentPrefix() { return settings.commentSuffix; },\n set commentPrefix(val) { settings.commentSuffix = val; },\n /**\n * A suffix added to the name of the property that stores comments.\n *\n * Default value: \"-Comment\"\n *\n * You can specify this setting for an individual survey: [`commentSuffix`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#commentSuffix).\n */\n commentSuffix: \"-Comment\",\n /**\n * A separator used in a shorthand notation that specifies a value and display text for an [`ItemValue`](https://surveyjs.io/form-library/documentation/api-reference/itemvalue) object: `\"value|text\"`.\n *\n * Default value: `\"|\"`\n * @see [settings.choicesSeparator](https://surveyjs.io/form-library/documentation/api-reference/settings#choicesSeparator)\n */\n itemValueSeparator: \"|\",\n /**\n * A maximum number of rate values in a [Rating](https://surveyjs.io/form-library/documentation/api-reference/rating-scale-question-model) question.\n *\n * Default value: 20\n */\n ratingMaximumRateValueCount: 20,\n /**\n * Specifies whether to close the drop-down menu of a [Multi-Select Dropdown (Tag Box)](https://surveyjs.io/form-library/examples/how-to-create-multiselect-tag-box/) question after a user selects a value.\n *\n * This setting applies to all Multi-Select Dropdown questions on a web page. You can use the [`closeOnSelect`](https://surveyjs.io/form-library/documentation/api-reference/dropdown-tag-box-model#closeOnSelect) property to specify the same setting for an individual Multi-Select Dropdown question.\n */\n tagboxCloseOnSelect: false,\n /**\n * A time interval in milliseconds between the last entered character and the beginning of search in [Single-](https://surveyjs.io/form-library/examples/create-dropdown-menu-in-javascript/) and [Multi-Select Dropdown](https://surveyjs.io/form-library/examples/how-to-create-multiselect-tag-box/) questions. Applies only to questions with the [`choicesLazyLoadEnabled`](https://surveyjs.io/form-library/documentation/api-reference/dropdown-menu-model#choicesLazyLoadEnabled) property set to `true`.\n *\n * Default value: 500\n *\n * [View Demo](https://surveyjs.io/form-library/examples/lazy-loading-dropdown/ (linkStyle))\n */\n dropdownSearchDelay: 500,\n /**\n * A function that activates a browser confirm dialog.\n *\n * Use the following code to execute this function:\n *\n * ```js\n * import { settings } from \"survey-core\";\n *\n * // `result` contains `true` if the action was confirmed or `false` otherwise\n * const result = settings.confirmActionFunc(\"Are you sure?\");\n * ```\n *\n * You can redefine the `confirmActionFunc` function if you want to display a custom dialog window. Your function should return `true` if a user confirms an action or `false` otherwise.\n * @param message A message to be displayed in the confirm dialog window.\n */\n confirmActionFunc: function (message) {\n return confirm(message);\n },\n /**\n * A function that activates a proprietary SurveyJS confirm dialog.\n *\n * Use the following code to execute this function:\n *\n * ```js\n * import { settings } from \"survey-core\";\n *\n * settings.confirmActionAsync(\"Are you sure?\", (confirmed) => {\n * if (confirmed) {\n * // ...\n * // Proceed with the action\n * // ...\n * } else {\n * // ...\n * // Cancel the action\n * // ...\n * }\n * });\n * ```\n *\n * You can redefine the `confirmActionAsync` function if you want to display a custom dialog window. Your function should return `true` to be enabled; otherwise, a survey executes the [`confirmActionFunc`](#confirmActionFunc) function. Pass the dialog result as the `callback` parameter: `true` if a user confirms an action, `false` otherwise.\n * @param message A message to be displayed in the confirm dialog window.\n * @param callback A callback function that should be called with `true` if a user confirms an action or `false` otherwise.\n */\n confirmActionAsync: function (message, callback, applyTitle, locale, rootElement) {\n return showConfirmDialog(message, callback, applyTitle, locale, rootElement);\n },\n /**\n * A minimum width value for all survey elements.\n *\n * Default value: `\"300px\"`\n *\n * You can override this setting for individual elements: [`minWidth`](https://surveyjs.io/form-library/documentation/api-reference/surveyelement#minWidth).\n */\n minWidth: \"300px\",\n /**\n * A maximum width value for all survey elements.\n *\n * Default value: `\"100%\"`\n *\n * You can override this setting for individual elements: [`maxWidth`](https://surveyjs.io/form-library/documentation/api-reference/surveyelement#maxWidth).\n */\n maxWidth: \"100%\",\n /**\n * Specifies how many times surveys can re-evaluate expressions when a question value changes. This limit helps avoid recursions in expressions.\n *\n * Default value: 10\n */\n maxConditionRunCountOnValueChanged: 10,\n /**\n * An object that configures notifications.\n *\n * Nested properties:\n *\n * - `lifetime`: `number`\\\n * Specifies a time period during which a notification is displayed; measured in milliseconds. Default value: 2000.\n */\n notifications: {\n lifetime: 2000\n },\n /**\n * Specifies how many milliseconds a survey should wait before it automatically switches to the next page. Applies only when [auto-advance](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#goNextPageAutomatic) is enabled.\n *\n * Default value: 300\n */\n autoAdvanceDelay: 300,\n /**\n * Specifies the direction in which to lay out Checkbox and Radiogroup items. This setting affects the resulting UI when items are arranged in [more than one column](https://surveyjs.io/form-library/documentation/api-reference/checkbox-question-model#colCount).\n *\n * Possible values:\n *\n * - `\"row\"` (default) - Items fill the current row, then move on to the next row.\n * - `\"column\"` - Items fill the current column, then move on to the next column.\n */\n showItemsInOrder: \"default\",\n /**\n * A value to save in survey results when respondents select the \"None\" choice item.\n *\n * Default value: `\"none\"`\n */\n noneItemValue: \"none\",\n /**\n * A value to save in survey results when respondents select the \"Refuse to answer\" choice item.\n *\n * Default value: `\"refused\"`\n */\n refuseItemValue: \"refused\",\n /**\n * A value to save in survey results when respondents select the \"Don't know\" choice item.\n *\n * Default value: `\"dontknow\"`\n */\n dontKnowItemValue: \"dontknow\",\n /**\n * An object whose properties specify the order of the special choice items (\"None\", \"Other\", \"Select All\", \"Refuse to answer\", \"Don't know\") in select-based questions.\n *\n * Default value: `{ selectAllItem: [-1], noneItem: [1], otherItem: [2], dontKnowItem: [3], otherItem: [4] }`\n *\n * Use this object to reorder special choices. Each property accepts an array of integer numbers. Negative numbers place a special choice item above regular choice items, positive numbers place it below them. For instance, the code below specifies the following order of choices: None, Select All, regular choices, Other.\n *\n * ```js\n * import { settings } from \"survey-core\";\n *\n * settings.specialChoicesOrder.noneItem = [-2];\n * settings.specialChoicesOrder.selectAllItem = [-1];\n * settings.specialChoicesOrder.otherItem = [1];\n * ```\n *\n * If you want to duplicate a special choice item above and below other choices, add two numbers to the corresponding array:\n *\n * ```js\n * settings.specialChoicesOrder.selectAllItem = [-1, 3] // Displays Select All above and below other choices\n * ```\n */\n specialChoicesOrder: {\n selectAllItem: [-1],\n noneItem: [1],\n refuseItem: [2],\n dontKnowItem: [3],\n otherItem: [4]\n },\n /**\n * One or several characters used to separate choice options in a list.\n *\n * Default value: `\", \"`\n * @see [settings.itemValueSeparator](https://surveyjs.io/form-library/documentation/api-reference/settings#itemValueSeparator)\n */\n choicesSeparator: \", \",\n /**\n * A list of supported validators by question type.\n */\n supportedValidators: {\n question: [\"expression\"],\n comment: [\"text\", \"regex\"],\n text: [\"numeric\", \"text\", \"regex\", \"email\"],\n checkbox: [\"answercount\"],\n imagepicker: [\"answercount\"],\n },\n /**\n * Specifies a minimum date that users can enter into a [Text](https://surveyjs.io/form-library/documentation/api-reference/text-entry-question-model) question with [`inputType`](https://surveyjs.io/form-library/documentation/api-reference/text-entry-question-model#inputType) set to `\"date\"` or `\"datetime-local\"`. Set this property to a string with the folllowing format: `\"yyyy-mm-dd\"`.\n */\n minDate: \"\",\n /**\n * Specifies a maximum date that users can enter into a [Text](https://surveyjs.io/form-library/documentation/api-reference/text-entry-question-model) question with [`inputType`](https://surveyjs.io/form-library/documentation/api-reference/text-entry-question-model#inputType) set to `\"date\"` or `\"datetime-local\"`. Set this property to a string with the folllowing format: `\"yyyy-mm-dd\"`.\n */\n maxDate: \"\",\n showModal: undefined,\n showDialog: undefined,\n supportCreatorV2: false,\n showDefaultItemsInCreatorV2: true,\n /**\n * An object that specifies icon replacements. Object keys are built-in icon names. To use a custom icon, assign its name to the key of the icon you want to replace:\n *\n * ```js\n * import { settings } from \"survey-core\";\n *\n * settings.customIcons[\"icon-redo\"] = \"custom-redo-icon\";\n * ```\n *\n * For more information about icons in SurveyJS, refer to the following help topic: [UI Icons](https://surveyjs.io/form-library/documentation/icons).\n */\n customIcons: {},\n /**\n * Specifies which part of a choice item responds to a drag gesture in Ranking questions.\n *\n * Possible values:\n *\n * - `\"entireItem\"` (default) - Users can use the entire choice item as a drag handle.\n * - `\"icon\"` - Users can only use the choice item icon as a drag handle.\n */\n rankingDragHandleArea: \"entireItem\",\n environment: defaultEnvironment,\n /**\n * Allows you to hide the maximum length indicator in text input questions.\n *\n * If you specify a question's [`maxLength`](https://surveyjs.io/form-library/documentation/api-reference/text-entry-question-model#maxLength) property or a survey's [`maxTextLength`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#maxTextLength) property, text input questions indicate the number of entered characters and the character limit. Assign `false` to the `settings.showMaxLengthIndicator` property if you want to hide this indicator.\n *\n * Default value: `true`\n */\n showMaxLengthIndicator: true,\n /**\n * Specifies whether to animate survey elements.\n *\n * Default value: `true`\n */\n animationEnabled: true,\n /**\n * An object that specifies heading levels (`
`, ``, etc.) to use when rendering survey, page, panel, and question titles.\n *\n * Default value: `{ survey: \"h3\", page: \"h4\", panel: \"h4\", question: \"h5\" }`\n *\n * If you want to modify heading levels for individual titles, handle `SurveyModel`'s [`onGetTitleTagName`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#onGetTitleTagName) event.\n */\n titleTags: {\n survey: \"h3\",\n page: \"h4\",\n panel: \"h4\",\n question: \"h5\",\n },\n questions: {\n inputTypes: [\n \"color\",\n \"date\",\n \"datetime-local\",\n \"email\",\n \"month\",\n \"number\",\n \"password\",\n \"range\",\n \"tel\",\n \"text\",\n \"time\",\n \"url\",\n \"week\",\n ],\n dataList: [\n \"\",\n \"name\",\n \"honorific-prefix\",\n \"given-name\",\n \"additional-name\",\n \"family-name\",\n \"honorific-suffix\",\n \"nickname\",\n \"organization-title\",\n \"username\",\n \"new-password\",\n \"current-password\",\n \"organization\",\n \"street-address\",\n \"address-line1\",\n \"address-line2\",\n \"address-line3\",\n \"address-level4\",\n \"address-level3\",\n \"address-level2\",\n \"address-level1\",\n \"country\",\n \"country-name\",\n \"postal-code\",\n \"cc-name\",\n \"cc-given-name\",\n \"cc-additional-name\",\n \"cc-family-name\",\n \"cc-number\",\n \"cc-exp\",\n \"cc-exp-month\",\n \"cc-exp-year\",\n \"cc-csc\",\n \"cc-type\",\n \"transaction-currency\",\n \"transaction-amount\",\n \"language\",\n \"bday\",\n \"bday-day\",\n \"bday-month\",\n \"bday-year\",\n \"sex\",\n \"url\",\n \"photo\",\n \"tel\",\n \"tel-country-code\",\n \"tel-national\",\n \"tel-area-code\",\n \"tel-local\",\n \"tel-local-prefix\",\n \"tel-local-suffix\",\n \"tel-extension\",\n \"email\",\n \"impp\",\n ]\n },\n legacyProgressBarView: false,\n /**\n * An object with properties that configure input masks.\n *\n * Nested properties:\n *\n * - `patternPlaceholderChar`: `string`\\\n * A symbol used as a placeholder for characters to be entered in [pattern masks](https://surveyjs.io/form-library/documentation/api-reference/inputmaskpattern). Default value: `\"_\"`.\n *\n * - `patternEscapeChar`: `string`\\\n * A symbol used to insert literal representations of special characters in [pattern masks](https://surveyjs.io/form-library/documentation/api-reference/inputmaskpattern). Default value: `\"\\\\\"`.\n *\n * - `patternDefinitions`: `<{ [key: string]: RegExp }>`\\\n * An object that maps placeholder symbols to regular expressions in [pattern masks](https://surveyjs.io/form-library/documentation/api-reference/inputmaskpattern). Default value: `{ \"9\": /[0-9]/, \"a\": /[a-zA-Z]/, \"#\": /[a-zA-Z0-9]/ }`.\n */\n maskSettings: {\n patternPlaceholderChar: \"_\",\n patternEscapeChar: \"\\\\\",\n patternDefinitions: {\n \"9\": /[0-9]/,\n \"a\": /[a-zA-Z]/,\n \"#\": /[a-zA-Z0-9]/\n }\n },\n /**\n * Specifies whether to store date-time values in the following format: `\"YYYY-MM-DDThh:mm:ss.sssZ\"`. Applies only to form fields with [`inputType`](https://surveyjs.io/form-library/documentation/api-reference/text-entry-question-model#inputType) set to `\"datetime-local\"`.\n *\n * Default value: `false`\n *\n * If you enable this setting, date-time values are converted from local time to UTC when they are saved to the survey's [`data`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#data) object, while the question values remain in local time. Therefore, when you specify default values using a question's [`defaultValue`](https://surveyjs.io/form-library/documentation/api-reference/text-entry-question-model#defaultValue) property, you need to use local time, but if you specify them using the `data` object, use a UTC date-time value in the following format: `\"YYYY-MM-DDThh:mm:ss.sssZ\"`.\n *\n * ```js\n * const surveyJson = {\n * \"elements\": [{\n * \"name\": \"datetime\",\n * \"type\": \"text\",\n * \"title\": \"Select a date and time\",\n * \"inputType\": \"datetime-local\",\n * \"defaultValue\": \"2024-07-16T12:15:00\" // Local date-time value\n * }]\n * }\n * ```\n *\n * ```js\n * import { Model } from \"survey-core\";\n * const surveyJson = { ... }\n * const survey = new Model(surveyJson);\n *\n * survey.data = {\n * datetime: \"2024-07-16T12:15:00.000Z\" // UTC date-time value\n * }\n * ```\n */\n storeUtcDates: false,\n // @param reason \"function-[functionname]\", \"question-[questionname]\", \"expression-operand\"\n onDateCreated: function (newDate, reason, val) {\n return newDate;\n },\n /**\n * A function that allows you to define custom parsing rules for numbers represented as string values.\n *\n * The following code shows a template that you can use to implement the `parseNumber` function:\n *\n * ```js\n * import { settings } from \"survey-core\";\n *\n * settings.parseNumber = (stringValue, numericValue) => {\n * if (typeof stringValue !== \"string\" || !stringValue)\n * return numericValue;\n * let parsedNumber = numericValue;\n * // ...\n * // Parsing the number according to custom parsing rules\n * // ...\n * return parsedNumber;\n * };\n * ```\n * @param stringValue A number represented as a string value.\n * @param numericValue A number parsed using a default parsing function. `NaN` if the original string is not a number.\n * @returns A number that results from parsing the string value.\n * @see [settings.serialization](https://surveyjs.io/form-library/documentation/api-reference/settings#serialization)\n */\n parseNumber: function (stringValue, numericValue) { return numericValue; },\n};\n\n// CONCATENATED MODULE: ./packages/survey-core/src/survey-error.ts\n\n\nvar survey_error_SurveyError = /** @class */ (function () {\n function SurveyError(text, errorOwner) {\n if (text === void 0) { text = null; }\n if (errorOwner === void 0) { errorOwner = null; }\n this.text = text;\n this.errorOwner = errorOwner;\n this.visible = true;\n this.onUpdateErrorTextCallback = undefined;\n }\n SurveyError.prototype.equals = function (error) {\n if (!error || !error.getErrorType)\n return false;\n if (this.getErrorType() !== error.getErrorType())\n return false;\n return this.text === error.text && this.visible === error.visible;\n };\n Object.defineProperty(SurveyError.prototype, \"locText\", {\n get: function () {\n if (!this.locTextValue) {\n this.locTextValue = new localizablestring_LocalizableString(this.errorOwner, true);\n this.locTextValue.storeDefaultText = true;\n this.locTextValue.text = this.getText();\n }\n return this.locTextValue;\n },\n enumerable: false,\n configurable: true\n });\n SurveyError.prototype.getText = function () {\n var res = this.text;\n if (!res)\n res = this.getDefaultText();\n if (!!this.errorOwner) {\n res = this.errorOwner.getErrorCustomText(res, this);\n }\n return res;\n };\n SurveyError.prototype.getErrorType = function () {\n return \"base\";\n };\n SurveyError.prototype.getDefaultText = function () {\n return \"\";\n };\n SurveyError.prototype.getLocale = function () {\n return !!this.errorOwner ? this.errorOwner.getLocale() : \"\";\n };\n SurveyError.prototype.getLocalizationString = function (locStrName) {\n return getLocaleString(locStrName, this.getLocale());\n };\n SurveyError.prototype.updateText = function () {\n if (this.onUpdateErrorTextCallback) {\n this.onUpdateErrorTextCallback(this);\n }\n this.locText.text = this.getText();\n };\n return SurveyError;\n}());\n\n\n// CONCATENATED MODULE: ./packages/survey-core/src/error.ts\nvar error_extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n\n\nvar AnswerRequiredError = /** @class */ (function (_super) {\n error_extends(AnswerRequiredError, _super);\n function AnswerRequiredError(text, errorOwner) {\n if (text === void 0) { text = null; }\n if (errorOwner === void 0) { errorOwner = null; }\n var _this = _super.call(this, text, errorOwner) || this;\n _this.text = text;\n return _this;\n }\n AnswerRequiredError.prototype.getErrorType = function () {\n return \"required\";\n };\n AnswerRequiredError.prototype.getDefaultText = function () {\n return this.getLocalizationString(\"requiredError\");\n };\n return AnswerRequiredError;\n}(survey_error_SurveyError));\n\nvar OneAnswerRequiredError = /** @class */ (function (_super) {\n error_extends(OneAnswerRequiredError, _super);\n function OneAnswerRequiredError(text, errorOwner) {\n if (text === void 0) { text = null; }\n if (errorOwner === void 0) { errorOwner = null; }\n var _this = _super.call(this, text, errorOwner) || this;\n _this.text = text;\n return _this;\n }\n OneAnswerRequiredError.prototype.getErrorType = function () {\n return \"requireoneanswer\";\n };\n OneAnswerRequiredError.prototype.getDefaultText = function () {\n return this.getLocalizationString(\"requiredErrorInPanel\");\n };\n return OneAnswerRequiredError;\n}(survey_error_SurveyError));\n\nvar RequreNumericError = /** @class */ (function (_super) {\n error_extends(RequreNumericError, _super);\n function RequreNumericError(text, errorOwner) {\n if (text === void 0) { text = null; }\n if (errorOwner === void 0) { errorOwner = null; }\n var _this = _super.call(this, text, errorOwner) || this;\n _this.text = text;\n return _this;\n }\n RequreNumericError.prototype.getErrorType = function () {\n return \"requirenumeric\";\n };\n RequreNumericError.prototype.getDefaultText = function () {\n return this.getLocalizationString(\"numericError\");\n };\n return RequreNumericError;\n}(survey_error_SurveyError));\n\nvar error_ExceedSizeError = /** @class */ (function (_super) {\n error_extends(ExceedSizeError, _super);\n function ExceedSizeError(maxSize, errorOwner) {\n if (errorOwner === void 0) { errorOwner = null; }\n var _this = _super.call(this, null, errorOwner) || this;\n _this.maxSize = maxSize;\n _this.locText.text = _this.getText();\n return _this;\n }\n ExceedSizeError.prototype.getErrorType = function () {\n return \"exceedsize\";\n };\n ExceedSizeError.prototype.getDefaultText = function () {\n return getLocaleString(\"exceedMaxSize\")[\"format\"](this.getTextSize());\n };\n ExceedSizeError.prototype.getTextSize = function () {\n var sizes = [\"Bytes\", \"KB\", \"MB\", \"GB\", \"TB\"];\n var fixed = [0, 0, 2, 3, 3];\n if (this.maxSize === 0) {\n return \"0 Byte\";\n }\n var i = Math.floor(Math.log(this.maxSize) / Math.log(1024));\n var value = this.maxSize / Math.pow(1024, i);\n return value.toFixed(fixed[i]) + \" \" + sizes[i];\n };\n return ExceedSizeError;\n}(survey_error_SurveyError));\n\nvar WebRequestError = /** @class */ (function (_super) {\n error_extends(WebRequestError, _super);\n function WebRequestError(status, response, errorOwner) {\n if (errorOwner === void 0) { errorOwner = null; }\n var _this = _super.call(this, null, errorOwner) || this;\n _this.status = status;\n _this.response = response;\n return _this;\n }\n WebRequestError.prototype.getErrorType = function () {\n return \"webrequest\";\n };\n WebRequestError.prototype.getDefaultText = function () {\n var str = this.getLocalizationString(\"urlRequestError\");\n return !!str ? str[\"format\"](this.status, this.response) : \"\";\n };\n return WebRequestError;\n}(survey_error_SurveyError));\n\nvar WebRequestEmptyError = /** @class */ (function (_super) {\n error_extends(WebRequestEmptyError, _super);\n function WebRequestEmptyError(text, errorOwner) {\n if (errorOwner === void 0) { errorOwner = null; }\n var _this = _super.call(this, text, errorOwner) || this;\n _this.text = text;\n return _this;\n }\n WebRequestEmptyError.prototype.getErrorType = function () {\n return \"webrequestempty\";\n };\n WebRequestEmptyError.prototype.getDefaultText = function () {\n return this.getLocalizationString(\"urlGetChoicesError\");\n };\n return WebRequestEmptyError;\n}(survey_error_SurveyError));\n\nvar OtherEmptyError = /** @class */ (function (_super) {\n error_extends(OtherEmptyError, _super);\n function OtherEmptyError(text, errorOwner) {\n if (errorOwner === void 0) { errorOwner = null; }\n var _this = _super.call(this, text, errorOwner) || this;\n _this.text = text;\n return _this;\n }\n OtherEmptyError.prototype.getErrorType = function () {\n return \"otherempty\";\n };\n OtherEmptyError.prototype.getDefaultText = function () {\n return this.getLocalizationString(\"otherRequiredError\");\n };\n return OtherEmptyError;\n}(survey_error_SurveyError));\n\nvar UploadingFileError = /** @class */ (function (_super) {\n error_extends(UploadingFileError, _super);\n function UploadingFileError(text, errorOwner) {\n if (errorOwner === void 0) { errorOwner = null; }\n var _this = _super.call(this, text, errorOwner) || this;\n _this.text = text;\n return _this;\n }\n UploadingFileError.prototype.getErrorType = function () {\n return \"uploadingfile\";\n };\n UploadingFileError.prototype.getDefaultText = function () {\n return this.getLocalizationString(\"uploadingFile\");\n };\n return UploadingFileError;\n}(survey_error_SurveyError));\n\nvar RequiredInAllRowsError = /** @class */ (function (_super) {\n error_extends(RequiredInAllRowsError, _super);\n function RequiredInAllRowsError(text, errorOwner) {\n if (errorOwner === void 0) { errorOwner = null; }\n var _this = _super.call(this, text, errorOwner) || this;\n _this.text = text;\n return _this;\n }\n RequiredInAllRowsError.prototype.getErrorType = function () {\n return \"requiredinallrowserror\";\n };\n RequiredInAllRowsError.prototype.getDefaultText = function () {\n return this.getLocalizationString(\"requiredInAllRowsError\");\n };\n return RequiredInAllRowsError;\n}(survey_error_SurveyError));\n\nvar EachRowUniqueError = /** @class */ (function (_super) {\n error_extends(EachRowUniqueError, _super);\n function EachRowUniqueError(text, errorOwner) {\n if (errorOwner === void 0) { errorOwner = null; }\n var _this = _super.call(this, text, errorOwner) || this;\n _this.text = text;\n return _this;\n }\n EachRowUniqueError.prototype.getErrorType = function () {\n return \"eachrowuniqueeerror\";\n };\n EachRowUniqueError.prototype.getDefaultText = function () {\n return this.getLocalizationString(\"eachRowUniqueError\");\n };\n return EachRowUniqueError;\n}(survey_error_SurveyError));\n\nvar error_MinRowCountError = /** @class */ (function (_super) {\n error_extends(MinRowCountError, _super);\n function MinRowCountError(minRowCount, errorOwner) {\n if (errorOwner === void 0) { errorOwner = null; }\n var _this = _super.call(this, null, errorOwner) || this;\n _this.minRowCount = minRowCount;\n return _this;\n }\n MinRowCountError.prototype.getErrorType = function () {\n return \"minrowcounterror\";\n };\n MinRowCountError.prototype.getDefaultText = function () {\n return getLocaleString(\"minRowCountError\")[\"format\"](this.minRowCount);\n };\n return MinRowCountError;\n}(survey_error_SurveyError));\n\nvar KeyDuplicationError = /** @class */ (function (_super) {\n error_extends(KeyDuplicationError, _super);\n function KeyDuplicationError(text, errorOwner) {\n if (errorOwner === void 0) { errorOwner = null; }\n var _this = _super.call(this, text, errorOwner) || this;\n _this.text = text;\n return _this;\n }\n KeyDuplicationError.prototype.getErrorType = function () {\n return \"keyduplicationerror\";\n };\n KeyDuplicationError.prototype.getDefaultText = function () {\n return this.getLocalizationString(\"keyDuplicationError\");\n };\n return KeyDuplicationError;\n}(survey_error_SurveyError));\n\nvar CustomError = /** @class */ (function (_super) {\n error_extends(CustomError, _super);\n function CustomError(text, errorOwner) {\n if (errorOwner === void 0) { errorOwner = null; }\n var _this = _super.call(this, text, errorOwner) || this;\n _this.text = text;\n return _this;\n }\n CustomError.prototype.getErrorType = function () {\n return \"custom\";\n };\n return CustomError;\n}(survey_error_SurveyError));\n\n\n// CONCATENATED MODULE: ./packages/survey-core/src/validator.ts\nvar validator_extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n\n\n\n\n\nvar ValidatorResult = /** @class */ (function () {\n function ValidatorResult(value, error) {\n if (error === void 0) { error = null; }\n this.value = value;\n this.error = error;\n }\n return ValidatorResult;\n}());\n\n/**\n * A base class for all classes that implement validators.\n *\n * [View Demo](https://surveyjs.io/form-library/examples/javascript-form-validation/ (linkStyle))\n */\nvar validator_SurveyValidator = /** @class */ (function (_super) {\n validator_extends(SurveyValidator, _super);\n function SurveyValidator() {\n var _this = _super.call(this) || this;\n _this.createLocalizableString(\"text\", _this, true);\n return _this;\n }\n Object.defineProperty(SurveyValidator.prototype, \"isValidator\", {\n get: function () { return true; },\n enumerable: false,\n configurable: true\n });\n SurveyValidator.prototype.getSurvey = function (live) {\n if (live === void 0) { live = false; }\n return !!this.errorOwner && !!this.errorOwner[\"getSurvey\"]\n ? this.errorOwner.getSurvey()\n : null;\n };\n Object.defineProperty(SurveyValidator.prototype, \"text\", {\n /**\n * An error message to display when a value fails validation.\n */\n get: function () {\n return this.getLocalizableStringText(\"text\");\n },\n set: function (value) {\n this.setLocalizableStringText(\"text\", value);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(SurveyValidator.prototype, \"isValidateAllValues\", {\n get: function () {\n return false;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(SurveyValidator.prototype, \"locText\", {\n get: function () {\n return this.getLocalizableString(\"text\");\n },\n enumerable: false,\n configurable: true\n });\n SurveyValidator.prototype.getErrorText = function (name) {\n if (this.text)\n return this.text;\n return this.getDefaultErrorText(name);\n };\n SurveyValidator.prototype.getDefaultErrorText = function (name) {\n return \"\";\n };\n SurveyValidator.prototype.validate = function (value, name, values, properties) {\n if (name === void 0) { name = null; }\n if (values === void 0) { values = null; }\n if (properties === void 0) { properties = null; }\n return null;\n };\n Object.defineProperty(SurveyValidator.prototype, \"isRunning\", {\n get: function () {\n return false;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(SurveyValidator.prototype, \"isAsync\", {\n get: function () {\n return false;\n },\n enumerable: false,\n configurable: true\n });\n SurveyValidator.prototype.getLocale = function () {\n return !!this.errorOwner ? this.errorOwner.getLocale() : \"\";\n };\n SurveyValidator.prototype.getMarkdownHtml = function (text, name) {\n return !!this.errorOwner\n ? this.errorOwner.getMarkdownHtml(text, name)\n : undefined;\n };\n SurveyValidator.prototype.getRenderer = function (name) {\n return !!this.errorOwner ? this.errorOwner.getRenderer(name) : null;\n };\n SurveyValidator.prototype.getRendererContext = function (locStr) {\n return !!this.errorOwner ? this.errorOwner.getRendererContext(locStr) : locStr;\n };\n SurveyValidator.prototype.getProcessedText = function (text) {\n return !!this.errorOwner ? this.errorOwner.getProcessedText(text) : text;\n };\n SurveyValidator.prototype.createCustomError = function (name) {\n var _this = this;\n var err = new CustomError(this.getErrorText(name), this.errorOwner);\n err.onUpdateErrorTextCallback = (function (err) { return err.text = _this.getErrorText(name); });\n return err;\n };\n SurveyValidator.prototype.toString = function () {\n var res = this.getType().replace(\"validator\", \"\");\n if (!!this.text) {\n res += \", \" + this.text;\n }\n return res;\n };\n return SurveyValidator;\n}(base_Base));\n\nvar ValidatorRunner = /** @class */ (function () {\n function ValidatorRunner() {\n }\n ValidatorRunner.prototype.run = function (owner) {\n var _this = this;\n var res = [];\n var values = null;\n var properties = null;\n this.prepareAsyncValidators();\n var asyncResults = [];\n var validators = owner.getValidators();\n for (var i = 0; i < validators.length; i++) {\n var validator = validators[i];\n if (!values && validator.isValidateAllValues) {\n values = owner.getDataFilteredValues();\n properties = owner.getDataFilteredProperties();\n }\n if (validator.isAsync) {\n this.asyncValidators.push(validator);\n validator.onAsyncCompleted = function (result) {\n if (!!result && !!result.error)\n asyncResults.push(result.error);\n if (!_this.onAsyncCompleted)\n return;\n for (var i = 0; i < _this.asyncValidators.length; i++) {\n if (_this.asyncValidators[i].isRunning)\n return;\n }\n _this.onAsyncCompleted(asyncResults);\n };\n }\n }\n validators = owner.getValidators();\n for (var i = 0; i < validators.length; i++) {\n var validator = validators[i];\n var validatorResult = validator.validate(owner.validatedValue, owner.getValidatorTitle(), values, properties);\n if (!!validatorResult && !!validatorResult.error) {\n res.push(validatorResult.error);\n }\n }\n if (this.asyncValidators.length == 0 && !!this.onAsyncCompleted)\n this.onAsyncCompleted([]);\n return res;\n };\n ValidatorRunner.prototype.prepareAsyncValidators = function () {\n if (!!this.asyncValidators) {\n for (var i = 0; i < this.asyncValidators.length; i++) {\n this.asyncValidators[i].onAsyncCompleted = null;\n }\n }\n this.asyncValidators = [];\n };\n return ValidatorRunner;\n}());\n\n/**\n * A class that implements a validator for numeric values.\n *\n * [View Demo](https://surveyjs.io/form-library/examples/javascript-form-validation/ (linkStyle))\n */\nvar validator_NumericValidator = /** @class */ (function (_super) {\n validator_extends(NumericValidator, _super);\n function NumericValidator(minValue, maxValue) {\n if (minValue === void 0) { minValue = null; }\n if (maxValue === void 0) { maxValue = null; }\n var _this = _super.call(this) || this;\n _this.minValue = minValue;\n _this.maxValue = maxValue;\n return _this;\n }\n NumericValidator.prototype.getType = function () {\n return \"numericvalidator\";\n };\n NumericValidator.prototype.validate = function (value, name, values, properties) {\n if (name === void 0) { name = null; }\n if (values === void 0) { values = null; }\n if (properties === void 0) { properties = null; }\n if (this.isValueEmpty(value))\n return null;\n if (!helpers_Helpers.isNumber(value)) {\n return new ValidatorResult(null, new RequreNumericError(this.text, this.errorOwner));\n }\n var result = new ValidatorResult(helpers_Helpers.getNumber(value));\n if (this.minValue !== null && this.minValue > result.value) {\n result.error = this.createCustomError(name);\n return result;\n }\n if (this.maxValue !== null && this.maxValue < result.value) {\n result.error = this.createCustomError(name);\n return result;\n }\n return typeof value === \"number\" ? null : result;\n };\n NumericValidator.prototype.getDefaultErrorText = function (name) {\n var vName = name ? name : this.getLocalizationString(\"value\");\n if (this.minValue !== null && this.maxValue !== null) {\n return this.getLocalizationFormatString(\"numericMinMax\", vName, this.minValue, this.maxValue);\n }\n else {\n if (this.minValue !== null) {\n return this.getLocalizationFormatString(\"numericMin\", vName, this.minValue);\n }\n return this.getLocalizationFormatString(\"numericMax\", vName, this.maxValue);\n }\n };\n Object.defineProperty(NumericValidator.prototype, \"minValue\", {\n /**\n * A minimum allowed numeric value.\n *\n * [View Demo](https://surveyjs.io/form-library/examples/javascript-form-validation/ (linkStyle))\n */\n get: function () {\n return this.getPropertyValue(\"minValue\");\n },\n set: function (val) {\n this.setPropertyValue(\"minValue\", val);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(NumericValidator.prototype, \"maxValue\", {\n /**\n * A maximum allowed numeric value.\n *\n * [View Demo](https://surveyjs.io/form-library/examples/javascript-form-validation/ (linkStyle))\n */\n get: function () {\n return this.getPropertyValue(\"maxValue\");\n },\n set: function (val) {\n this.setPropertyValue(\"maxValue\", val);\n },\n enumerable: false,\n configurable: true\n });\n return NumericValidator;\n}(validator_SurveyValidator));\n\n/**\n * A class that implements a validator for text values.\n *\n * [View Demo](https://surveyjs.io/form-library/examples/javascript-form-validation/ (linkStyle))\n */\nvar TextValidator = /** @class */ (function (_super) {\n validator_extends(TextValidator, _super);\n function TextValidator() {\n return _super.call(this) || this;\n }\n TextValidator.prototype.getType = function () {\n return \"textvalidator\";\n };\n TextValidator.prototype.validate = function (value, name, values, properties) {\n if (name === void 0) { name = null; }\n if (values === void 0) { values = null; }\n if (properties === void 0) { properties = null; }\n if (this.isValueEmpty(value))\n return null;\n if (!this.allowDigits) {\n var reg = /\\d+$/;\n if (reg.test(value)) {\n return new ValidatorResult(null, this.createCustomError(\"textNoDigitsAllow\"));\n }\n }\n if (this.minLength > 0 && value.length < this.minLength) {\n return new ValidatorResult(null, this.createCustomError(name));\n }\n if (this.maxLength > 0 && value.length > this.maxLength) {\n return new ValidatorResult(null, this.createCustomError(name));\n }\n return null;\n };\n TextValidator.prototype.getDefaultErrorText = function (name) {\n if (name === \"textNoDigitsAllow\")\n return this.getLocalizationString(name);\n if (this.minLength > 0 && this.maxLength > 0)\n return this.getLocalizationFormatString(\"textMinMaxLength\", this.minLength, this.maxLength);\n if (this.minLength > 0)\n return this.getLocalizationFormatString(\"textMinLength\", this.minLength);\n return this.getLocalizationFormatString(\"textMaxLength\", this.maxLength);\n };\n Object.defineProperty(TextValidator.prototype, \"minLength\", {\n /**\n * The minimum length of a text value measured in characters.\n *\n * Default value: 0\n *\n * [View Demo](https://surveyjs.io/form-library/examples/javascript-form-validation/ (linkStyle))\n */\n get: function () {\n return this.getPropertyValue(\"minLength\");\n },\n set: function (val) {\n this.setPropertyValue(\"minLength\", val);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextValidator.prototype, \"maxLength\", {\n /**\n * The maximum length of a text value measured in characters.\n *\n * Default value: 0 (unlimited)\n *\n * [View Demo](https://surveyjs.io/form-library/examples/javascript-form-validation/ (linkStyle))\n */\n get: function () {\n return this.getPropertyValue(\"maxLength\");\n },\n set: function (val) {\n this.setPropertyValue(\"maxLength\", val);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextValidator.prototype, \"allowDigits\", {\n /**\n * Specifies whether a text value can include numerical digits.\n *\n * Default value: `true`\n */\n get: function () {\n return this.getPropertyValue(\"allowDigits\");\n },\n set: function (val) {\n this.setPropertyValue(\"allowDigits\", val);\n },\n enumerable: false,\n configurable: true\n });\n return TextValidator;\n}(validator_SurveyValidator));\n\n/**\n * A class that implements answer count validation in the question types that can have multiple values (for instance, [Checkboxes](https://surveyjs.io/form-library/documentation/api-reference/checkbox-question-model)).\n *\n * [View Demo](https://surveyjs.io/form-library/examples/javascript-form-validation/ (linkStyle))\n */\nvar AnswerCountValidator = /** @class */ (function (_super) {\n validator_extends(AnswerCountValidator, _super);\n function AnswerCountValidator(minCount, maxCount) {\n if (minCount === void 0) { minCount = null; }\n if (maxCount === void 0) { maxCount = null; }\n var _this = _super.call(this) || this;\n _this.minCount = minCount;\n _this.maxCount = maxCount;\n return _this;\n }\n AnswerCountValidator.prototype.getType = function () {\n return \"answercountvalidator\";\n };\n AnswerCountValidator.prototype.validate = function (value, name, values, properties) {\n if (name === void 0) { name = null; }\n if (values === void 0) { values = null; }\n if (properties === void 0) { properties = null; }\n if (value == null || value.constructor != Array)\n return null;\n var count = value.length;\n if (count == 0)\n return null;\n if (this.minCount && count < this.minCount) {\n return new ValidatorResult(null, this.createCustomError(this.getLocalizationFormatString(\"minSelectError\", this.minCount)));\n }\n if (this.maxCount && count > this.maxCount) {\n return new ValidatorResult(null, this.createCustomError(this.getLocalizationFormatString(\"maxSelectError\", this.maxCount)));\n }\n return null;\n };\n AnswerCountValidator.prototype.getDefaultErrorText = function (name) {\n return name;\n };\n Object.defineProperty(AnswerCountValidator.prototype, \"minCount\", {\n /**\n * A minimum number of selected answers.\n *\n * [View Demo](https://surveyjs.io/form-library/examples/javascript-form-validation/ (linkStyle))\n */\n get: function () {\n return this.getPropertyValue(\"minCount\");\n },\n set: function (val) {\n this.setPropertyValue(\"minCount\", val);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(AnswerCountValidator.prototype, \"maxCount\", {\n /**\n * A maximum number of selected answers.\n *\n * [View Demo](https://surveyjs.io/form-library/examples/javascript-form-validation/ (linkStyle))\n */\n get: function () {\n return this.getPropertyValue(\"maxCount\");\n },\n set: function (val) {\n this.setPropertyValue(\"maxCount\", val);\n },\n enumerable: false,\n configurable: true\n });\n return AnswerCountValidator;\n}(validator_SurveyValidator));\n\n/**\n * A class that implements validation using regular expressions.\n *\n * [View Demo](https://surveyjs.io/form-library/examples/javascript-form-validation/ (linkStyle))\n */\nvar RegexValidator = /** @class */ (function (_super) {\n validator_extends(RegexValidator, _super);\n function RegexValidator(regex) {\n if (regex === void 0) { regex = null; }\n var _this = _super.call(this) || this;\n _this.regex = regex;\n return _this;\n }\n RegexValidator.prototype.getType = function () {\n return \"regexvalidator\";\n };\n RegexValidator.prototype.validate = function (value, name, values, properties) {\n if (name === void 0) { name = null; }\n if (values === void 0) { values = null; }\n if (properties === void 0) { properties = null; }\n if (!this.regex || this.isValueEmpty(value))\n return null;\n var re = this.createRegExp();\n if (Array.isArray(value)) {\n for (var i = 0; i < value.length; i++) {\n var res = this.hasError(re, value[i], name);\n if (res)\n return res;\n }\n }\n return this.hasError(re, value, name);\n };\n RegexValidator.prototype.hasError = function (re, value, name) {\n if (re.test(value))\n return null;\n return new ValidatorResult(value, this.createCustomError(name));\n };\n Object.defineProperty(RegexValidator.prototype, \"regex\", {\n /**\n * A regular expression used to validate values.\n *\n * [View Demo](https://surveyjs.io/form-library/examples/javascript-form-validation/ (linkStyle))\n */\n get: function () {\n return this.getPropertyValue(\"regex\");\n },\n set: function (val) {\n this.setPropertyValue(\"regex\", val);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(RegexValidator.prototype, \"caseInsensitive\", {\n /**\n * Specifies whether uppercase and lowercase letters must be treated as distinct or equivalent when validating values.\n *\n * Default value: `false` (uppercase and lowercase letters are treated as distinct)\n */\n get: function () {\n return this.getPropertyValue(\"caseInsensitive\");\n },\n set: function (val) {\n this.setPropertyValue(\"caseInsensitive\", val);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(RegexValidator.prototype, \"insensitive\", {\n get: function () { return this.caseInsensitive; },\n set: function (val) {\n this.caseInsensitive = val;\n },\n enumerable: false,\n configurable: true\n });\n RegexValidator.prototype.createRegExp = function () {\n return new RegExp(this.regex, this.caseInsensitive ? \"i\" : \"\");\n };\n return RegexValidator;\n}(validator_SurveyValidator));\n\n/**\n * A class that implements a validator for e-mail addresses.\n *\n * [View Demo](https://surveyjs.io/form-library/examples/javascript-form-validation/ (linkStyle))\n */\nvar EmailValidator = /** @class */ (function (_super) {\n validator_extends(EmailValidator, _super);\n function EmailValidator() {\n var _this = _super.call(this) || this;\n _this.re = /^(([^<>()\\[\\]\\.,;:\\s@\\\"]+(\\.[^<>()\\[\\]\\.,;:\\s@\\\"]+)*)|(\\\".+\\\"))@(([^<>()=[\\]\\.,;:\\s@\\\"]+\\.)+[^<>()=[\\]\\.,;:\\s@\\\"]{2,})$/i;\n return _this;\n }\n EmailValidator.prototype.getType = function () {\n return \"emailvalidator\";\n };\n EmailValidator.prototype.validate = function (value, name, values, properties) {\n if (name === void 0) { name = null; }\n if (values === void 0) { values = null; }\n if (properties === void 0) { properties = null; }\n if (!value)\n return null;\n if (this.re.test(value))\n return null;\n return new ValidatorResult(value, this.createCustomError(name));\n };\n EmailValidator.prototype.getDefaultErrorText = function (name) {\n return this.getLocalizationString(\"invalidEmail\");\n };\n return EmailValidator;\n}(validator_SurveyValidator));\n\n/**\n * A class that implements validation using [expressions](https://surveyjs.io/form-library/documentation/design-survey/conditional-logic#expressions).\n *\n * [View Demo](https://surveyjs.io/form-library/examples/javascript-form-validation/ (linkStyle))\n */\nvar validator_ExpressionValidator = /** @class */ (function (_super) {\n validator_extends(ExpressionValidator, _super);\n function ExpressionValidator(expression) {\n if (expression === void 0) { expression = null; }\n var _this = _super.call(this) || this;\n _this.conditionRunner = null;\n _this.isRunningValue = false;\n _this.expression = expression;\n return _this;\n }\n ExpressionValidator.prototype.getType = function () {\n return \"expressionvalidator\";\n };\n Object.defineProperty(ExpressionValidator.prototype, \"isValidateAllValues\", {\n get: function () {\n return true;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ExpressionValidator.prototype, \"isAsync\", {\n get: function () {\n if (!this.ensureConditionRunner())\n return false;\n return this.conditionRunner.isAsync;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ExpressionValidator.prototype, \"isRunning\", {\n get: function () {\n return this.isRunningValue;\n },\n enumerable: false,\n configurable: true\n });\n ExpressionValidator.prototype.validate = function (value, name, values, properties) {\n var _this = this;\n if (name === void 0) { name = null; }\n if (values === void 0) { values = null; }\n if (properties === void 0) { properties = null; }\n if (!this.ensureConditionRunner())\n return null;\n this.conditionRunner.onRunComplete = function (res) {\n _this.isRunningValue = false;\n if (!!_this.onAsyncCompleted) {\n _this.onAsyncCompleted(_this.generateError(res, value, name));\n }\n };\n this.isRunningValue = true;\n var res = this.conditionRunner.run(values, properties);\n if (this.conditionRunner.isAsync)\n return null;\n this.isRunningValue = false;\n return this.generateError(res, value, name);\n };\n ExpressionValidator.prototype.generateError = function (res, value, name) {\n if (!res) {\n return new ValidatorResult(value, this.createCustomError(name));\n }\n return null;\n };\n ExpressionValidator.prototype.getDefaultErrorText = function (name) {\n return this.getLocalizationFormatString(\"invalidExpression\", this.expression);\n };\n ExpressionValidator.prototype.ensureConditionRunner = function () {\n if (!!this.conditionRunner) {\n this.conditionRunner.expression = this.expression;\n return true;\n }\n if (!this.expression)\n return false;\n this.conditionRunner = new ConditionRunner(this.expression);\n return true;\n };\n Object.defineProperty(ExpressionValidator.prototype, \"expression\", {\n /**\n * A Boolean [expression](https://surveyjs.io/form-library/documentation/design-survey/conditional-logic#expressions). If it evaluates to `false`, validation fails.\n *\n * [View Demo](https://surveyjs.io/form-library/examples/javascript-form-validation/ (linkStyle))\n */\n get: function () {\n return this.getPropertyValue(\"expression\");\n },\n set: function (val) {\n this.setPropertyValue(\"expression\", val);\n },\n enumerable: false,\n configurable: true\n });\n return ExpressionValidator;\n}(validator_SurveyValidator));\n\nSerializer.addClass(\"surveyvalidator\", [\n { name: \"text\", serializationProperty: \"locText\" },\n]);\nSerializer.addClass(\"numericvalidator\", [\"minValue:number\", \"maxValue:number\"], function () {\n return new validator_NumericValidator();\n}, \"surveyvalidator\");\nSerializer.addClass(\"textvalidator\", [{ name: \"minLength:number\", default: 0 },\n { name: \"maxLength:number\", default: 0 },\n { name: \"allowDigits:boolean\", default: true }], function () {\n return new TextValidator();\n}, \"surveyvalidator\");\nSerializer.addClass(\"answercountvalidator\", [\"minCount:number\", \"maxCount:number\"], function () {\n return new AnswerCountValidator();\n}, \"surveyvalidator\");\nSerializer.addClass(\"regexvalidator\", [\"regex\", { name: \"caseInsensitive:boolean\", alternativeName: \"insensitive\" }], function () {\n return new RegexValidator();\n}, \"surveyvalidator\");\nSerializer.addClass(\"emailvalidator\", [], function () {\n return new EmailValidator();\n}, \"surveyvalidator\");\nSerializer.addClass(\"expressionvalidator\", [\"expression:condition\"], function () {\n return new validator_ExpressionValidator();\n}, \"surveyvalidator\");\n\n// CONCATENATED MODULE: ./packages/survey-core/src/questionCustomWidgets.ts\n\nvar QuestionCustomWidget = /** @class */ (function () {\n function QuestionCustomWidget(name, widgetJson) {\n this.name = name;\n this.widgetJson = widgetJson;\n this.htmlTemplate = widgetJson.htmlTemplate ? widgetJson.htmlTemplate : \"\";\n }\n QuestionCustomWidget.prototype.afterRender = function (question, el) {\n var _this = this;\n if (!this.widgetJson.afterRender)\n return;\n question.localeChangedCallback = function () {\n if (_this.widgetJson.willUnmount) {\n _this.widgetJson.willUnmount(question, el);\n }\n _this.widgetJson.afterRender(question, el);\n };\n this.widgetJson.afterRender(question, el);\n };\n QuestionCustomWidget.prototype.willUnmount = function (question, el) {\n if (this.widgetJson.willUnmount)\n this.widgetJson.willUnmount(question, el);\n };\n QuestionCustomWidget.prototype.getDisplayValue = function (question, value) {\n if (value === void 0) { value = undefined; }\n if (this.widgetJson.getDisplayValue)\n return this.widgetJson.getDisplayValue(question, value);\n return null;\n };\n QuestionCustomWidget.prototype.validate = function (question) {\n if (this.widgetJson.validate)\n return this.widgetJson.validate(question);\n return undefined;\n };\n QuestionCustomWidget.prototype.isFit = function (question) {\n if (this.isLibraryLoaded() && this.widgetJson.isFit)\n return this.widgetJson.isFit(question);\n return false;\n };\n Object.defineProperty(QuestionCustomWidget.prototype, \"canShowInToolbox\", {\n get: function () {\n if (this.widgetJson.showInToolbox === false)\n return false;\n if (questionCustomWidgets_CustomWidgetCollection.Instance.getActivatedBy(this.name) != \"customtype\")\n return false;\n return !this.widgetJson.widgetIsLoaded || this.widgetJson.widgetIsLoaded();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(QuestionCustomWidget.prototype, \"showInToolbox\", {\n get: function () {\n return this.widgetJson.showInToolbox !== false;\n },\n set: function (val) {\n this.widgetJson.showInToolbox = val;\n },\n enumerable: false,\n configurable: true\n });\n QuestionCustomWidget.prototype.init = function () {\n if (this.widgetJson.init) {\n this.widgetJson.init();\n }\n };\n QuestionCustomWidget.prototype.activatedByChanged = function (activatedBy) {\n if (this.isLibraryLoaded() && this.widgetJson.activatedByChanged) {\n this.widgetJson.activatedByChanged(activatedBy);\n }\n };\n QuestionCustomWidget.prototype.isLibraryLoaded = function () {\n if (this.widgetJson.widgetIsLoaded)\n return this.widgetJson.widgetIsLoaded() == true;\n return true;\n };\n Object.defineProperty(QuestionCustomWidget.prototype, \"isDefaultRender\", {\n get: function () {\n return this.widgetJson.isDefaultRender;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(QuestionCustomWidget.prototype, \"pdfQuestionType\", {\n get: function () {\n return this.widgetJson.pdfQuestionType;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(QuestionCustomWidget.prototype, \"pdfRender\", {\n get: function () {\n return this.widgetJson.pdfRender;\n },\n enumerable: false,\n configurable: true\n });\n return QuestionCustomWidget;\n}());\n\nvar questionCustomWidgets_CustomWidgetCollection = /** @class */ (function () {\n function CustomWidgetCollection() {\n this.widgetsValues = [];\n this.widgetsActivatedBy = {};\n this.onCustomWidgetAdded = new Event();\n }\n Object.defineProperty(CustomWidgetCollection.prototype, \"widgets\", {\n get: function () {\n return this.widgetsValues;\n },\n enumerable: false,\n configurable: true\n });\n CustomWidgetCollection.prototype.add = function (widgetJson, activatedBy) {\n if (activatedBy === void 0) { activatedBy = \"property\"; }\n this.addCustomWidget(widgetJson, activatedBy);\n };\n CustomWidgetCollection.prototype.addCustomWidget = function (widgetJson, activatedBy) {\n if (activatedBy === void 0) { activatedBy = \"property\"; }\n var name = widgetJson.name;\n if (!name) {\n name = \"widget_\" + this.widgets.length + 1;\n }\n var customWidget = new QuestionCustomWidget(name, widgetJson);\n this.widgetsValues.push(customWidget);\n customWidget.init();\n this.widgetsActivatedBy[name] = activatedBy;\n customWidget.activatedByChanged(activatedBy);\n this.onCustomWidgetAdded.fire(customWidget, null);\n return customWidget;\n };\n /**\n * Returns the way the custom wiget is activated. It can be activated by a property (\"property\"), question type (\"type\") or by new/custom question type (\"customtype\").\n * @param widgetName the custom widget name\n * @see setActivatedBy\n */\n CustomWidgetCollection.prototype.getActivatedBy = function (widgetName) {\n var res = this.widgetsActivatedBy[widgetName];\n return res ? res : \"property\";\n };\n /**\n * Sets the way the custom wiget is activated. The activation types are: property (\"property\"), question type (\"type\") or new/custom question type (\"customtype\"). A custom wiget may support all or only some of this activation types.\n * @param widgetName\n * @param activatedBy there are three possible variants: \"property\", \"type\" and \"customtype\"\n */\n CustomWidgetCollection.prototype.setActivatedBy = function (widgetName, activatedBy) {\n if (!widgetName || !activatedBy)\n return;\n var widget = this.getCustomWidgetByName(widgetName);\n if (!widget)\n return;\n this.widgetsActivatedBy[widgetName] = activatedBy;\n widget.activatedByChanged(activatedBy);\n };\n CustomWidgetCollection.prototype.clear = function () {\n this.widgetsValues = [];\n };\n CustomWidgetCollection.prototype.getCustomWidgetByName = function (name) {\n for (var i = 0; i < this.widgets.length; i++) {\n if (this.widgets[i].name == name)\n return this.widgets[i];\n }\n return null;\n };\n CustomWidgetCollection.prototype.getCustomWidget = function (question) {\n for (var i = 0; i < this.widgetsValues.length; i++) {\n if (this.widgetsValues[i].isFit(question))\n return this.widgetsValues[i];\n }\n return null;\n };\n CustomWidgetCollection.Instance = new CustomWidgetCollection();\n return CustomWidgetCollection;\n}());\n\n\n// CONCATENATED MODULE: ./packages/survey-core/src/rendererFactory.ts\nvar RendererFactory = /** @class */ (function () {\n function RendererFactory() {\n this.renderersHash = {};\n this.defaultHash = {};\n }\n RendererFactory.prototype.unregisterRenderer = function (questionType, rendererAs) {\n delete this.renderersHash[questionType][rendererAs];\n if (this.defaultHash[questionType] === rendererAs) {\n delete this.defaultHash[questionType];\n }\n };\n RendererFactory.prototype.registerRenderer = function (questionType, renderAs, renderer, useAsDefault) {\n if (useAsDefault === void 0) { useAsDefault = false; }\n if (!this.renderersHash[questionType]) {\n this.renderersHash[questionType] = {};\n }\n this.renderersHash[questionType][renderAs] = renderer;\n if (useAsDefault) {\n this.defaultHash[questionType] = renderAs;\n }\n };\n RendererFactory.prototype.getRenderer = function (questionType, renderAs) {\n var qHash = this.renderersHash[questionType];\n if (!!qHash) {\n if (!!renderAs && qHash[renderAs])\n return qHash[renderAs];\n var dVal = this.defaultHash[questionType];\n if (!!dVal && qHash[dVal])\n return qHash[dVal];\n }\n return \"default\";\n };\n RendererFactory.prototype.getRendererByQuestion = function (question) {\n return this.getRenderer(question.getType(), question.renderAs);\n };\n RendererFactory.prototype.clear = function () {\n this.renderersHash = {};\n };\n RendererFactory.Instance = new RendererFactory();\n return RendererFactory;\n}());\n\n\n// CONCATENATED MODULE: ./packages/survey-core/src/utils/text-area.ts\n\nvar text_area_TextAreaModel = /** @class */ (function () {\n function TextAreaModel(options) {\n var _this = this;\n this.options = options;\n this.onPropertyChangedCallback = function () {\n if (_this.element) {\n _this.element.value = _this.getTextValue();\n _this.updateElement();\n }\n };\n this.question.registerFunctionOnPropertyValueChanged(this.options.propertyName, this.onPropertyChangedCallback, \"__textarea\");\n }\n TextAreaModel.prototype.updateElement = function () {\n var _this = this;\n if (this.element && this.autoGrow) {\n setTimeout(function () { return increaseHeightByContent(_this.element); }, 1);\n }\n };\n TextAreaModel.prototype.setElement = function (element) {\n if (!!element) {\n this.element = element;\n this.updateElement();\n }\n };\n TextAreaModel.prototype.resetElement = function () {\n this.element = undefined;\n };\n TextAreaModel.prototype.getTextValue = function () {\n if (!!this.options.getTextValue)\n return this.options.getTextValue() || \"\";\n return \"\";\n };\n TextAreaModel.prototype.onTextAreaChange = function (event) {\n if (!!this.options.onTextAreaChange)\n this.options.onTextAreaChange(event);\n };\n TextAreaModel.prototype.onTextAreaInput = function (event) {\n if (!!this.options.onTextAreaInput)\n this.options.onTextAreaInput(event);\n if (this.element && this.autoGrow) {\n increaseHeightByContent(this.element);\n }\n };\n TextAreaModel.prototype.onTextAreaKeyDown = function (event) {\n if (!!this.options.onTextAreaKeyDown)\n this.options.onTextAreaKeyDown(event);\n };\n TextAreaModel.prototype.onTextAreaBlur = function (event) {\n this.onTextAreaChange(event);\n if (!!this.options.onTextAreaBlur)\n this.options.onTextAreaBlur(event);\n };\n TextAreaModel.prototype.onTextAreaFocus = function (event) {\n if (!!this.options.onTextAreaFocus)\n this.options.onTextAreaFocus(event);\n };\n Object.defineProperty(TextAreaModel.prototype, \"question\", {\n get: function () {\n return this.options.question;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextAreaModel.prototype, \"id\", {\n get: function () {\n return this.options.id();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextAreaModel.prototype, \"placeholder\", {\n get: function () {\n return this.options.placeholder();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextAreaModel.prototype, \"className\", {\n get: function () {\n return this.options.className();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextAreaModel.prototype, \"maxLength\", {\n get: function () {\n if (this.options.maxLength)\n return this.options.maxLength();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextAreaModel.prototype, \"autoGrow\", {\n get: function () {\n if (this.options.autoGrow)\n return this.options.autoGrow();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextAreaModel.prototype, \"rows\", {\n get: function () {\n if (this.options.rows)\n return this.options.rows();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextAreaModel.prototype, \"cols\", {\n get: function () {\n if (this.options.cols)\n return this.options.cols();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextAreaModel.prototype, \"isDisabledAttr\", {\n get: function () {\n return this.options.isDisabledAttr();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextAreaModel.prototype, \"isReadOnlyAttr\", {\n get: function () {\n if (this.options.isReadOnlyAttr)\n return this.options.isReadOnlyAttr();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextAreaModel.prototype, \"ariaRequired\", {\n get: function () {\n if (this.options.ariaRequired)\n return this.options.ariaRequired();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextAreaModel.prototype, \"ariaLabel\", {\n get: function () {\n if (this.options.ariaLabel)\n return this.options.ariaLabel();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextAreaModel.prototype, \"ariaInvalid\", {\n get: function () {\n if (this.options.ariaInvalid)\n return this.options.ariaInvalid();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextAreaModel.prototype, \"ariaLabelledBy\", {\n get: function () {\n if (this.options.ariaLabelledBy)\n return this.options.ariaLabelledBy();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextAreaModel.prototype, \"ariaDescribedBy\", {\n get: function () {\n if (this.options.ariaDescribedBy)\n return this.options.ariaDescribedBy();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextAreaModel.prototype, \"ariaErrormessage\", {\n get: function () {\n if (this.options.ariaErrormessage)\n return this.options.ariaErrormessage();\n },\n enumerable: false,\n configurable: true\n });\n TextAreaModel.prototype.dispose = function () {\n if (this.question) {\n this.question.unRegisterFunctionOnPropertyValueChanged(this.options.propertyName, \"__textarea\");\n }\n this.resetElement();\n };\n return TextAreaModel;\n}());\n\n\n// CONCATENATED MODULE: ./packages/survey-core/src/question.ts\nvar question_extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar question_decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nvar TriggerExpressionInfo = /** @class */ (function () {\n function TriggerExpressionInfo(name, canRun, doComplete) {\n this.name = name;\n this.canRun = canRun;\n this.doComplete = doComplete;\n this.runSecondCheck = function (keys) { return false; };\n }\n return TriggerExpressionInfo;\n}());\n/**\n * A base class for all questions.\n */\nvar question_Question = /** @class */ (function (_super) {\n question_extends(Question, _super);\n function Question(name) {\n var _this = _super.call(this, name) || this;\n _this.customWidgetData = { isNeedRender: true };\n _this.hasCssErrorCallback = function () { return false; };\n _this.isReadyValue = true;\n _this.dependedQuestions = [];\n /**\n * An event that is raised when the question's ready state has changed (expressions are evaluated, choices are loaded from a web resource specified by the `choicesByUrl` property, etc.).\n *\n * Parameters:\n *\n * - `sender`: `SurveyModel`\\\n * A survey instance that contains the question whose ready state has changed.\n * - `options.isReady`: `boolean`\\\n * Indicates whether the question is ready.\n * - `options.oldIsReady`: `boolean`\\\n * Indicates the previous ready state.\n */\n _this.onReadyChanged = _this.addEvent();\n _this.triggersInfo = [];\n _this.isRunningValidatorsValue = false;\n _this.isValueChangedInSurvey = false;\n _this.allowNotifyValueChanged = true;\n _this.id = Question.getQuestionId();\n _this.onCreating();\n _this.createNewArray(\"validators\", function (validator) {\n validator.errorOwner = _this;\n });\n _this.commentTextAreaModel = new text_area_TextAreaModel(_this.getCommentTextAreaOptions());\n _this.addExpressionProperty(\"visibleIf\", function (obj, res) { _this.visible = res === true; });\n _this.addExpressionProperty(\"enableIf\", function (obj, res) { _this.readOnly = res === false; });\n _this.addExpressionProperty(\"requiredIf\", function (obj, res) { _this.isRequired = res === true; });\n _this.createLocalizableString(\"commentText\", _this, true, \"otherItemText\");\n _this.createLocalizableString(\"requiredErrorText\", _this);\n _this.addTriggerInfo(\"resetValueIf\", function () { return !_this.isEmpty(); }, function () {\n _this.startSetValueOnExpression();\n _this.clearValue();\n _this.updateValueWithDefaults();\n _this.finishSetValueOnExpression();\n });\n var setValueIfInfo = _this.addTriggerInfo(\"setValueIf\", function () { return true; }, function () { return _this.runSetValueExpression(); });\n setValueIfInfo.runSecondCheck = function (keys) { return _this.checkExpressionIf(keys); };\n _this.registerPropertyChangedHandlers([\"width\"], function () {\n _this.updateQuestionCss();\n if (!!_this.parent) {\n _this.parent.elementWidthChanged(_this);\n }\n });\n _this.registerPropertyChangedHandlers([\"isRequired\"], function () {\n if (!_this.isRequired && _this.errors.length > 0) {\n _this.validate();\n }\n _this.locTitle.strChanged();\n _this.clearCssClasses();\n });\n _this.registerPropertyChangedHandlers([\"indent\", \"rightIndent\"], function () {\n _this.onIndentChanged();\n });\n _this.registerPropertyChangedHandlers([\"showCommentArea\", \"showOtherItem\"], function () {\n _this.initCommentFromSurvey();\n });\n _this.registerFunctionOnPropertiesValueChanged([\"no\", \"readOnly\", \"hasVisibleErrors\", \"containsErrors\"], function () {\n _this.updateQuestionCss();\n });\n _this.registerPropertyChangedHandlers([\"_isMobile\"], function () { _this.onMobileChanged(); });\n _this.registerPropertyChangedHandlers([\"colSpan\"], function () { var _a; (_a = _this.parent) === null || _a === void 0 ? void 0 : _a.updateColumns(); });\n return _this;\n }\n Question.getQuestionId = function () {\n return \"sq_\" + Question.questionCounter++;\n };\n Question.prototype.getCommentTextAreaOptions = function () {\n var _this = this;\n var options = {\n question: this,\n id: function () { return _this.commentId; },\n propertyName: \"comment\",\n className: function () { return _this.cssClasses.comment; },\n placeholder: function () { return _this.renderedCommentPlaceholder; },\n isDisabledAttr: function () { return _this.isInputReadOnly || false; },\n rows: function () { return _this.commentAreaRows; },\n autoGrow: function () { return _this.autoGrowComment; },\n maxLength: function () { return _this.getOthersMaxLength(); },\n ariaRequired: function () { return _this.a11y_input_ariaRequired; },\n ariaLabel: function () { return _this.a11y_input_ariaLabel; },\n getTextValue: function () { return _this.comment; },\n onTextAreaChange: function (e) { _this.onCommentChange(e); },\n onTextAreaInput: function (e) { _this.onCommentInput(e); },\n };\n return options;\n };\n Question.prototype.isReadOnlyRenderDiv = function () {\n return this.isReadOnly && settings.readOnly.commentRenderMode === \"div\";\n };\n Question.prototype.allowMobileInDesignMode = function () {\n return false;\n };\n Question.prototype.updateIsMobileFromSurvey = function () {\n this.setIsMobile(this.survey._isMobile);\n };\n Question.prototype.setIsMobile = function (val) {\n var newVal = val && (this.allowMobileInDesignMode() || !this.isDesignMode);\n this.isMobile = newVal;\n };\n Question.prototype.getIsMobile = function () {\n return this._isMobile;\n };\n Object.defineProperty(Question.prototype, \"isMobile\", {\n get: function () {\n return this.getIsMobile();\n },\n set: function (val) {\n this._isMobile = val;\n },\n enumerable: false,\n configurable: true\n });\n Question.prototype.themeChanged = function (theme) { };\n Question.prototype.getDefaultTitle = function () { return this.name; };\n Question.prototype.createLocTitleProperty = function () {\n var _this = this;\n var locTitleValue = _super.prototype.createLocTitleProperty.call(this);\n locTitleValue.storeDefaultText = true;\n locTitleValue.onGetTextCallback = function (text) {\n if (!text) {\n text = _this.getDefaultTitle();\n }\n if (!_this.survey)\n return text;\n return _this.survey.getUpdatedQuestionTitle(_this, text);\n };\n this.locProcessedTitle = new localizablestring_LocalizableString(this, true);\n this.locProcessedTitle.sharedData = locTitleValue;\n return locTitleValue;\n };\n Question.prototype.getSurvey = function (live) {\n if (live === void 0) { live = false; }\n if (live) {\n return !!this.parent ? this.parent.getSurvey(live) : null;\n }\n if (!!this.onGetSurvey)\n return this.onGetSurvey();\n return _super.prototype.getSurvey.call(this);\n };\n Question.prototype.getValueName = function () {\n if (!!this.valueName)\n return this.valueName.toString();\n return this.name;\n };\n Object.defineProperty(Question.prototype, \"valueName\", {\n /**\n * Specifies an object property that should store the question value.\n *\n * Refer to the [Merge Question Values](https://surveyjs.io/form-library/documentation/design-survey-merge-question-values) help topic for more information.\n */\n get: function () {\n return this.getPropertyValue(\"valueName\", \"\");\n },\n set: function (val) {\n var oldValueName = this.getValueName();\n this.setPropertyValue(\"valueName\", val);\n this.onValueNameChanged(oldValueName);\n },\n enumerable: false,\n configurable: true\n });\n Question.prototype.onValueNameChanged = function (oldValue) {\n if (!this.survey)\n return;\n this.survey.questionRenamed(this, this.name, !!oldValue ? oldValue : this.name);\n this.initDataFromSurvey();\n };\n Question.prototype.onNameChanged = function (oldValue) {\n this.locTitle.strChanged();\n if (!this.survey)\n return;\n this.survey.questionRenamed(this, oldValue, this.valueName ? this.valueName : oldValue);\n };\n Object.defineProperty(Question.prototype, \"isReady\", {\n get: function () {\n return this.isReadyValue;\n },\n enumerable: false,\n configurable: true\n });\n Question.prototype.onAsyncRunningChanged = function () {\n this.updateIsReady();\n };\n Question.prototype.updateIsReady = function () {\n var res = this.getIsQuestionReady();\n if (res) {\n var questions = this.getIsReadyDependsOn();\n for (var i = 0; i < questions.length; i++) {\n if (!questions[i].getIsQuestionReady()) {\n res = false;\n break;\n }\n }\n }\n this.setIsReady(res);\n };\n Question.prototype.getIsQuestionReady = function () {\n return !this.isAsyncExpressionRunning && this.getAreNestedQuestionsReady();\n };\n Question.prototype.getAreNestedQuestionsReady = function () {\n var questions = this.getIsReadyNestedQuestions();\n if (!Array.isArray(questions))\n return true;\n for (var i = 0; i < questions.length; i++) {\n if (!questions[i].isReady)\n return false;\n }\n return true;\n };\n Question.prototype.getIsReadyNestedQuestions = function () {\n return this.getNestedQuestions();\n };\n Question.prototype.setIsReady = function (val) {\n var oldIsReady = this.isReadyValue;\n this.isReadyValue = val;\n if (oldIsReady != val) {\n this.getIsReadyDependends().forEach(function (q) { return q.updateIsReady(); });\n this.onReadyChanged.fire(this, {\n question: this,\n isReady: val,\n oldIsReady: oldIsReady,\n });\n }\n };\n Question.prototype.getIsReadyDependsOn = function () {\n return this.getIsReadyDependendCore(true);\n };\n Question.prototype.getIsReadyDependends = function () {\n return this.getIsReadyDependendCore(false);\n };\n Question.prototype.getIsReadyDependendCore = function (isDependOn) {\n var _this = this;\n if (!this.survey)\n return [];\n var questions = this.survey.questionsByValueName(this.getValueName());\n var res = new Array();\n questions.forEach(function (q) { if (q !== _this)\n res.push(q); });\n if (!isDependOn) {\n if (this.parentQuestion) {\n res.push(this.parentQuestion);\n }\n if (this.dependedQuestions.length > 0) {\n this.dependedQuestions.forEach(function (q) { return res.push(q); });\n }\n }\n return res;\n };\n Question.prototype.choicesLoaded = function () { };\n Object.defineProperty(Question.prototype, \"page\", {\n /**\n * Returns a page to which the question belongs and allows you to move this question to a different page.\n */\n get: function () {\n if (!!this.parentQuestion)\n return this.parentQuestion.page;\n return this.getPage(this.parent);\n },\n set: function (val) {\n this.setPage(this.parent, val);\n },\n enumerable: false,\n configurable: true\n });\n Question.prototype.getPanel = function () {\n return null;\n };\n Question.prototype.delete = function (doDispose) {\n if (doDispose === void 0) { doDispose = true; }\n this.removeFromParent();\n if (doDispose) {\n this.dispose();\n }\n else {\n this.resetDependedQuestions();\n }\n };\n Question.prototype.removeFromParent = function () {\n if (!!this.parent) {\n this.removeSelfFromList(this.parent.elements);\n }\n };\n Question.prototype.addDependedQuestion = function (question) {\n if (!question || this.dependedQuestions.indexOf(question) > -1)\n return;\n this.dependedQuestions.push(question);\n };\n Question.prototype.removeDependedQuestion = function (question) {\n if (!question)\n return;\n var index = this.dependedQuestions.indexOf(question);\n if (index > -1) {\n this.dependedQuestions.splice(index, 1);\n }\n };\n Question.prototype.updateDependedQuestions = function () {\n for (var i = 0; i < this.dependedQuestions.length; i++) {\n this.dependedQuestions[i].updateDependedQuestion();\n }\n };\n Question.prototype.updateDependedQuestion = function () { };\n Question.prototype.resetDependedQuestion = function () { };\n Object.defineProperty(Question.prototype, \"isFlowLayout\", {\n get: function () {\n return this.getLayoutType() === \"flow\";\n },\n enumerable: false,\n configurable: true\n });\n Question.prototype.getLayoutType = function () {\n if (!!this.parent)\n return this.parent.getChildrenLayoutType();\n return \"row\";\n };\n Question.prototype.isLayoutTypeSupported = function (layoutType) {\n return layoutType !== \"flow\";\n };\n Object.defineProperty(Question.prototype, \"visible\", {\n /**\n * Gets or sets question visibility.\n *\n * If you want to display or hide a question based on a condition, specify the [`visibleIf`](https://surveyjs.io/form-library/documentation/question#visibleIf) property. Refer to the following help topic for information: [Conditional Visibility](https://surveyjs.io/form-library/documentation/design-survey-conditional-logic#conditional-visibility).\n * @see isVisible\n * @see visibleIf\n */\n get: function () {\n return this.getPropertyValue(\"visible\", true);\n },\n set: function (val) {\n if (val == this.visible)\n return;\n this.setPropertyValue(\"visible\", val);\n this.onVisibleChanged();\n this.notifySurveyVisibilityChanged();\n },\n enumerable: false,\n configurable: true\n });\n Question.prototype.onVisibleChanged = function () {\n this.updateIsVisibleProp();\n if (!this.isVisible && this.errors && this.errors.length > 0) {\n this.errors = [];\n }\n };\n Question.prototype.notifyStateChanged = function (prevState) {\n _super.prototype.notifyStateChanged.call(this, prevState);\n if (this.isCollapsed) {\n this.onHidingContent();\n }\n };\n Question.prototype.updateElementVisibility = function () {\n this.updateIsVisibleProp();\n };\n Question.prototype.updateIsVisibleProp = function () {\n var prev = this.getPropertyValue(\"isVisible\");\n var val = this.isVisible;\n if (prev !== val) {\n this.setPropertyValue(\"isVisible\", val);\n if (!val) {\n this.onHidingContent();\n }\n }\n if (val !== this.visible && this.areInvisibleElementsShowing) {\n this.updateQuestionCss(true);\n }\n };\n Object.defineProperty(Question.prototype, \"useDisplayValuesInDynamicTexts\", {\n /**\n * Specifies whether to use display names for question values in placeholders.\n *\n * Default value: `true`\n *\n * This property applies to questions whose values are defined as objects with the `value` and `text` properties (for example, [choice items](https://surveyjs.io/form-library/documentation/questionradiogroupmodel#choices) in Radiogroup, Checkbox, and Dropdown questions).\n *\n * You can use question values as placeholders in the following places:\n *\n * - Survey element titles and descriptions\n * - The [`html`](https://surveyjs.io/form-library/documentation/questionhtmlmodel#html) property of the [HTML](https://surveyjs.io/form-library/documentation/questionhtmlmodel) question\n *\n * To use a question value as a placeholder, specify the question `name` in curly brackets: `{questionName}`. Refer to the following help topic for more information: [Dynamic Texts - Question Values](https://surveyjs.io/form-library/documentation/design-survey-conditional-logic#question-values).\n */\n get: function () {\n return this.getPropertyValue(\"useDisplayValuesInDynamicTexts\");\n },\n set: function (val) {\n this.setPropertyValue(\"useDisplayValuesInDynamicTexts\", val);\n },\n enumerable: false,\n configurable: true\n });\n Question.prototype.getUseDisplayValuesInDynamicTexts = function () { return this.useDisplayValuesInDynamicTexts; };\n Object.defineProperty(Question.prototype, \"visibleIf\", {\n /**\n * A Boolean expression. If it evaluates to `false`, this question becomes hidden.\n *\n * A survey parses and runs all expressions on startup. If any values used in the expression change, the survey re-evaluates it.\n *\n * Refer to the following help topic for more information: [Conditional Visibility](https://surveyjs.io/form-library/documentation/design-survey-conditional-logic#conditional-visibility).\n * @see visible\n * @see isVisible\n */\n get: function () {\n return this.getPropertyValue(\"visibleIf\", \"\");\n },\n set: function (val) {\n this.setPropertyValue(\"visibleIf\", val);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Question.prototype, \"isVisible\", {\n /**\n * Returns `true` if the question is visible or the survey is currently in design mode.\n *\n * If you want to display or hide a question based on a condition, specify the [`visibleIf`](https://surveyjs.io/form-library/documentation/question#visibleIf) property. Refer to the following help topic for information: [Conditional Visibility](https://surveyjs.io/form-library/documentation/design-survey-conditional-logic#conditional-visibility).\n * @see visibleIf\n * @see visible\n * @see isParentVisible\n */\n get: function () {\n if (this.survey && this.survey.areEmptyElementsHidden && this.isEmpty())\n return false;\n if (this.areInvisibleElementsShowing)\n return true;\n return this.isVisibleCore();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Question.prototype, \"isVisibleInSurvey\", {\n get: function () {\n return this.isVisible && this.isParentVisible;\n },\n enumerable: false,\n configurable: true\n });\n Question.prototype.isVisibleCore = function () {\n return this.visible;\n };\n Object.defineProperty(Question.prototype, \"visibleIndex\", {\n /**\n * Returns the visible index of the question in the survey. It can be from 0 to all visible questions count - 1\n * The visibleIndex is -1 if the title is 'hidden' or hideNumber is true\n * @see titleLocation\n * @see hideNumber\n */\n get: function () {\n return this.getPropertyValue(\"visibleIndex\", -1);\n },\n enumerable: false,\n configurable: true\n });\n Question.prototype.onHidingContent = function () { };\n Object.defineProperty(Question.prototype, \"hideNumber\", {\n /**\n * Hides the question number from the title and excludes the question from numbering.\n *\n * If you want to disable question numbering in the entire survey, set `SurveyModel`'s `showQuestionNumbers` property to `false`.\n * @see SurveyModel.showQuestionNumbers\n */\n get: function () {\n return this.getPropertyValue(\"hideNumber\");\n },\n set: function (val) {\n this.setPropertyValue(\"hideNumber\", val);\n this.notifySurveyVisibilityChanged();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Question.prototype, \"isAllowTitleLeft\", {\n /**\n * Returns `true` if the question can display its title to the left of the input field.\n * @see titleLocation\n * @see getTitleLocation\n * @see hasTitle\n */\n get: function () {\n return true;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Returns the question type.\n * Possible values:\n * - [*\"boolean\"*](https://surveyjs.io/Documentation/Library?id=questionbooleanmodel)\n * - [*\"checkbox\"*](https://surveyjs.io/Documentation/Library?id=questioncheckboxmodel)\n * - [*\"comment\"*](https://surveyjs.io/Documentation/Library?id=questioncommentmodel)\n * - [*\"dropdown\"*](https://surveyjs.io/Documentation/Library?id=questiondropdownmodel)\n * - [*\"tagbox\"*](https://surveyjs.io/form-library/documentation/questiontagboxmodel)\n * - [*\"expression\"*](https://surveyjs.io/Documentation/Library?id=questionexpressionmodel)\n * - [*\"file\"*](https://surveyjs.io/Documentation/Library?id=questionfilemodel)\n * - [*\"html\"*](https://surveyjs.io/Documentation/Library?id=questionhtmlmodel)\n * - [*\"image\"*](https://surveyjs.io/Documentation/Library?id=questionimagemodel)\n * - [*\"imagepicker\"*](https://surveyjs.io/Documentation/Library?id=questionimagepickermodel)\n * - [*\"matrix\"*](https://surveyjs.io/Documentation/Library?id=questionmatrixmodel)\n * - [*\"matrixdropdown\"*](https://surveyjs.io/Documentation/Library?id=questionmatrixdropdownmodel)\n * - [*\"matrixdynamic\"*](https://surveyjs.io/Documentation/Library?id=questionmatrixdynamicmodel)\n * - [*\"multipletext\"*](https://surveyjs.io/Documentation/Library?id=questionmultipletextmodel)\n * - [*\"panel\"*](https://surveyjs.io/Documentation/Library?id=panelmodel)\n * - [*\"paneldynamic\"*](https://surveyjs.io/Documentation/Library?id=questionpaneldynamicmodel)\n * - [*\"radiogroup\"*](https://surveyjs.io/Documentation/Library?id=questionradiogroupmodel)\n * - [*\"rating\"*](https://surveyjs.io/Documentation/Library?id=questionratingmodel)\n * - [*\"ranking\"*](https://surveyjs.io/Documentation/Library?id=questionrankingmodel)\n * - [*\"signaturepad\"*](https://surveyjs.io/Documentation/Library?id=questionsignaturepadmodel)\n * - [*\"text\"*](https://surveyjs.io/Documentation/Library?id=questiontextmodel)\n */\n Question.prototype.getType = function () {\n return \"question\";\n };\n Object.defineProperty(Question.prototype, \"isQuestion\", {\n get: function () {\n return true;\n },\n enumerable: false,\n configurable: true\n });\n Question.prototype.moveTo = function (container, insertBefore) {\n if (insertBefore === void 0) { insertBefore = null; }\n return this.moveToBase(this.parent, container, insertBefore);\n };\n Question.prototype.getProgressInfo = function () {\n if (!this.hasInput)\n return _super.prototype.getProgressInfo.call(this);\n return {\n questionCount: 1,\n answeredQuestionCount: !this.isEmpty() ? 1 : 0,\n requiredQuestionCount: this.isRequired ? 1 : 0,\n requiredAnsweredQuestionCount: !this.isEmpty() && this.isRequired ? 1 : 0,\n };\n };\n Question.prototype.ensureSetValueExpressionRunner = function () {\n var _this = this;\n if (!this.setValueExpressionRunner) {\n this.setValueExpressionRunner = new ExpressionRunner(this.setValueExpression);\n this.setValueExpressionRunner.onRunComplete = function (res) {\n _this.runExpressionSetValue(res);\n };\n }\n else {\n this.setValueExpressionRunner.expression = this.setValueExpression;\n }\n };\n Question.prototype.runSetValueExpression = function () {\n if (!this.setValueExpression) {\n this.clearValue();\n }\n else {\n this.ensureSetValueExpressionRunner();\n this.setValueExpressionRunner.run(this.getDataFilteredValues(), this.getDataFilteredProperties());\n }\n };\n Question.prototype.checkExpressionIf = function (keys) {\n this.ensureSetValueExpressionRunner();\n if (!this.setValueExpressionRunner)\n return false;\n return new conditionProcessValue_ProcessValue().isAnyKeyChanged(keys, this.setValueExpressionRunner.getVariables());\n };\n Question.prototype.addTriggerInfo = function (name, canRun, doComplete) {\n var info = new TriggerExpressionInfo(name, canRun, doComplete);\n this.triggersInfo.push(info);\n return info;\n };\n Question.prototype.runTriggerInfo = function (info, name, value) {\n var expression = this[info.name];\n var keys = {};\n keys[name] = value;\n if (!expression || info.isRunning || !info.canRun()) {\n if (info.runSecondCheck(keys)) {\n info.doComplete();\n }\n return;\n }\n if (!info.runner) {\n info.runner = new ExpressionRunner(expression);\n info.runner.onRunComplete = function (res) {\n if (res === true) {\n info.doComplete();\n }\n info.isRunning = false;\n };\n }\n else {\n info.runner.expression = expression;\n }\n if (!new conditionProcessValue_ProcessValue().isAnyKeyChanged(keys, info.runner.getVariables()) && !info.runSecondCheck(keys))\n return;\n info.isRunning = true;\n info.runner.run(this.getDataFilteredValues(), this.getDataFilteredProperties());\n };\n Question.prototype.runTriggers = function (name, value) {\n var _this = this;\n if (this.isSettingQuestionValue || (this.parentQuestion && this.parentQuestion.getValueName() === name))\n return;\n this.triggersInfo.forEach(function (info) {\n _this.runTriggerInfo(info, name, value);\n });\n };\n Question.prototype.runConditions = function () {\n if (this.data && !this.isLoadingFromJson) {\n if (!this.isDesignMode) {\n this.runCondition(this.getDataFilteredValues(), this.getDataFilteredProperties());\n }\n this.locStrsChanged();\n }\n };\n Question.prototype.setSurveyImpl = function (value, isLight) {\n _super.prototype.setSurveyImpl.call(this, value);\n if (!this.survey)\n return;\n this.survey.questionCreated(this);\n if (isLight !== true) {\n this.runConditions();\n }\n this.calcRenderedCommentPlaceholder();\n if (!this.visible) {\n this.updateIsVisibleProp();\n }\n this.updateIsMobileFromSurvey();\n };\n Object.defineProperty(Question.prototype, \"parent\", {\n /**\n * Returns a survey element (panel or page) that contains the question and allows you to move this question to a different survey element.\n */\n get: function () {\n return this.getPropertyValue(\"parent\", null);\n },\n set: function (val) {\n if (this.parent === val)\n return;\n this.removeFromParent();\n this.setPropertyValue(\"parent\", val);\n this.updateQuestionCss();\n this.onParentChanged();\n },\n enumerable: false,\n configurable: true\n });\n Question.prototype.onParentChanged = function () { };\n Object.defineProperty(Question.prototype, \"hasTitle\", {\n /**\n * Returns `false` if the `titleLocation` property is set to `\"hidden\"` or if the question cannot have a title (for example, an [HTML](https://surveyjs.io/form-library/documentation/questionhtmlmodel) question).\n *\n * If the `title` property is `undefined` or set to an empty string, the `hasTitle` property returns `true`, because the question uses its `name` as a title in this case.\n * @see title\n * @see titleLocation\n */\n get: function () {\n return this.getTitleLocation() !== \"hidden\";\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Question.prototype, \"titleLocation\", {\n /**\n * Sets question title location relative to the input field. Overrides the `questionTitleLocation` property specified for the question's container (survey, page, or panel).\n *\n * Possible values:\n *\n * - `\"default\"` (default) - Inherits the setting from the `questionTitleLocation` property specified for the question's container.\n * - `\"top\"` - Displays the title above the input field.\n * - `\"bottom\"` - Displays the title below the input field.\n * - `\"left\"` - Displays the title to the left of the input field.\n * - `\"hidden\"` - Hides the question title.\n *\n * > Certain question types (Matrix, Multiple Text) do not support the `\"left\"` value. For them, the `\"top\"` value is used.\n * @see SurveyModel.questionTitleLocation\n * @see getTitleLocation\n * @see isAllowTitleLeft\n */\n get: function () {\n return this.getPropertyValue(\"titleLocation\");\n },\n set: function (value) {\n var isVisibilityChanged = this.titleLocation == \"hidden\" || value == \"hidden\";\n this.setPropertyValue(\"titleLocation\", value.toLowerCase());\n this.updateQuestionCss();\n if (isVisibilityChanged) {\n this.notifySurveyVisibilityChanged();\n }\n },\n enumerable: false,\n configurable: true\n });\n Question.prototype.getTitleOwner = function () { return this; };\n Question.prototype.getIsTitleRenderedAsString = function () { return this.titleLocation === \"hidden\"; };\n Question.prototype.notifySurveyOnChildrenVisibilityChanged = function () { return false; };\n Question.prototype.notifySurveyVisibilityChanged = function () {\n if (!this.survey || this.isLoadingFromJson)\n return;\n this.survey.questionVisibilityChanged(this, this.isVisible, !this.parentQuestion || this.parentQuestion.notifySurveyOnChildrenVisibilityChanged());\n var isClearOnHidden = this.isClearValueOnHidden;\n if (!this.visible) {\n this.clearValueOnHidding(isClearOnHidden);\n }\n if (isClearOnHidden && this.isVisibleInSurvey) {\n this.updateValueWithDefaults();\n }\n };\n Question.prototype.clearValueOnHidding = function (isClearOnHidden) {\n if (isClearOnHidden) {\n this.clearValueIfInvisible();\n }\n };\n Object.defineProperty(Question.prototype, \"titleWidth\", {\n get: function () {\n if (this.parent && this.getTitleLocation() === \"left\") {\n var columns = this.parent.getColumsForElement(this);\n var columnCount = columns.length;\n if (columnCount !== 0 && !!columns[0].questionTitleWidth)\n return columns[0].questionTitleWidth;\n var percentWidth = this.getPercentQuestionTitleWidth();\n if (!percentWidth && !!this.parent) {\n var width = this.parent.getQuestionTitleWidth();\n if (width && !isNaN(width))\n width = width + \"px\";\n return width;\n }\n return (percentWidth / (columnCount || 1)) + \"%\";\n }\n return undefined;\n },\n enumerable: false,\n configurable: true\n });\n Question.prototype.getPercentQuestionTitleWidth = function () {\n var width = !!this.parent && this.parent.getQuestionTitleWidth();\n if (!!width && width[width.length - 1] === \"%\") {\n return parseInt(width);\n }\n return undefined;\n };\n /**\n * Returns title location calculated based on the question's `titleLocation` property and the `questionTitleLocation` property of the question's containers (survey, page, or panel).\n * @see titleLocation\n * @see SurveyModel.questionTitleLocation\n */\n Question.prototype.getTitleLocation = function () {\n if (this.isFlowLayout)\n return \"hidden\";\n var location = this.getTitleLocationCore();\n if (location === \"left\" && !this.isAllowTitleLeft)\n location = \"top\";\n return location;\n };\n Question.prototype.getTitleLocationCore = function () {\n if (this.titleLocation !== \"default\")\n return this.titleLocation;\n if (!!this.parent)\n return this.parent.getQuestionTitleLocation();\n if (!!this.survey)\n return this.survey.questionTitleLocation;\n return \"top\";\n };\n Object.defineProperty(Question.prototype, \"hasTitleOnLeft\", {\n get: function () {\n return this.hasTitle && this.getTitleLocation() === \"left\";\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Question.prototype, \"hasTitleOnTop\", {\n get: function () {\n return this.hasTitle && this.getTitleLocation() === \"top\";\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Question.prototype, \"hasTitleOnBottom\", {\n get: function () {\n return this.hasTitle && this.getTitleLocation() === \"bottom\";\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Question.prototype, \"hasTitleOnLeftTop\", {\n get: function () {\n if (!this.hasTitle)\n return false;\n var location = this.getTitleLocation();\n return location === \"left\" || location === \"top\";\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Question.prototype, \"errorLocation\", {\n /**\n * Specifies the error message position. Overrides the `questionErrorLocation` property specified for the question's container ([survey](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#questionErrorLocation), [page](https://surveyjs.io/form-library/documentation/api-reference/page-model#questionErrorLocation), or [panel](https://surveyjs.io/form-library/documentation/api-reference/panel-model#questionErrorLocation)).\n *\n * Possible values:\n *\n * - `\"default\"` (default) - Inherits the setting from the `questionErrorLocation` property specified for the question's container.\n * - `\"top\"` - Displays error messages above questions.\n * - `\"bottom\"` - Displays error messages below questions.\n */\n get: function () {\n return this.getPropertyValue(\"errorLocation\");\n },\n set: function (val) {\n this.setPropertyValue(\"errorLocation\", val);\n },\n enumerable: false,\n configurable: true\n });\n Question.prototype.getErrorLocation = function () {\n if (this.errorLocation !== \"default\")\n return this.errorLocation;\n if (this.parentQuestion)\n return this.parentQuestion.getChildErrorLocation(this);\n if (this.parent)\n return this.parent.getQuestionErrorLocation();\n return this.survey ? this.survey.questionErrorLocation : \"top\";\n };\n Question.prototype.getChildErrorLocation = function (child) {\n return this.getErrorLocation();\n };\n Object.defineProperty(Question.prototype, \"hasInput\", {\n /**\n * Returns `false` if the question has no input fields ([HTML](https://surveyjs.io/form-library/documentation/questionhtmlmodel), [Image](https://surveyjs.io/form-library/documentation/questionimagemodel), and similar question types).\n * @see hasSingleInput\n */\n get: function () {\n return true;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Question.prototype, \"hasSingleInput\", {\n /**\n * Returns `false` if the question has no input fields ([HTML](https://surveyjs.io/form-library/documentation/questionhtmlmodel), [Image](https://surveyjs.io/form-library/documentation/questionimagemodel)) or has multiple input fields ([Matrix](https://surveyjs.io/form-library/documentation/questionmatrixmodel), [Multiple Text](https://surveyjs.io/form-library/documentation/questionmultipletextmodel)).\n * @see hasInput\n */\n get: function () {\n return this.hasInput;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Question.prototype, \"inputId\", {\n get: function () {\n return this.id + \"i\";\n },\n enumerable: false,\n configurable: true\n });\n Question.prototype.getDefaultTitleValue = function () { return this.name; };\n Question.prototype.getDefaultTitleTagName = function () {\n return settings.titleTags.question;\n };\n Object.defineProperty(Question.prototype, \"descriptionLocation\", {\n /**\n * Specifies where to display a question description.\n *\n * Possible values:\n *\n * - `\"default\"` (default) - Inherits the setting from the Survey's [`questionDescriptionLocation`](https://surveyjs.io/form-library/documentation/surveymodel#questionDescriptionLocation) property.\n * - `\"underTitle\"` - Displays the description under the question title.\n * - `\"underInput\"` - Displays the description under the interactive area.\n * @see description\n * @see hasDescription\n */\n get: function () {\n return this.getPropertyValue(\"descriptionLocation\");\n },\n set: function (val) {\n this.setPropertyValue(\"descriptionLocation\", val);\n this.updateQuestionCss();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Question.prototype, \"hasDescriptionUnderTitle\", {\n get: function () {\n return this.getDescriptionLocation() == \"underTitle\" && this.hasDescription;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Question.prototype, \"hasDescriptionUnderInput\", {\n get: function () {\n return this.getDescriptionLocation() == \"underInput\" && this.hasDescription;\n },\n enumerable: false,\n configurable: true\n });\n Question.prototype.getDescriptionLocation = function () {\n if (this.descriptionLocation !== \"default\")\n return this.descriptionLocation;\n return !!this.survey\n ? this.survey.questionDescriptionLocation\n : \"underTitle\";\n };\n Question.prototype.needClickTitleFunction = function () {\n return _super.prototype.needClickTitleFunction.call(this) || this.hasInput;\n };\n Question.prototype.processTitleClick = function () {\n var _this = this;\n _super.prototype.processTitleClick.call(this);\n if (this.isCollapsed)\n return;\n setTimeout(function () {\n _this.focus();\n }, 1);\n return true;\n };\n Object.defineProperty(Question.prototype, \"requiredErrorText\", {\n /**\n * Specifies a custom error message for a required form field.\n * @see isRequired\n */\n get: function () {\n return this.getLocalizableStringText(\"requiredErrorText\");\n },\n set: function (val) {\n this.setLocalizableStringText(\"requiredErrorText\", val);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Question.prototype, \"locRequiredErrorText\", {\n get: function () {\n return this.getLocalizableString(\"requiredErrorText\");\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Question.prototype, \"commentText\", {\n /**\n * Specifies a caption displayed above the comment area. Applies when the `showCommentArea` property is `true`.\n * @see showCommentArea\n * @see comment\n */\n get: function () {\n return this.getLocalizableStringText(\"commentText\");\n },\n set: function (val) {\n this.setLocalizableStringText(\"commentText\", val);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Question.prototype, \"locCommentText\", {\n get: function () {\n return this.getLocalizableString(\"commentText\");\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Question.prototype, \"commentPlaceHolder\", {\n get: function () {\n return this.commentPlaceholder;\n },\n set: function (newValue) {\n this.commentPlaceholder = newValue;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Question.prototype, \"renderedCommentPlaceholder\", {\n get: function () {\n return this.getPropertyValue(\"renderedCommentPlaceholder\");\n },\n enumerable: false,\n configurable: true\n });\n Question.prototype.calcRenderedCommentPlaceholder = function () {\n var res = !this.isReadOnly ? this.commentPlaceHolder : undefined;\n this.setPropertyValue(\"renderedCommentPlaceholder\", res);\n };\n Question.prototype.getAllErrors = function () {\n return this.errors.slice();\n };\n Question.prototype.getErrorByType = function (errorType) {\n for (var i = 0; i < this.errors.length; i++) {\n if (this.errors[i].getErrorType() === errorType)\n return this.errors[i];\n }\n return null;\n };\n Object.defineProperty(Question.prototype, \"customWidget\", {\n get: function () {\n if (!this.isCustomWidgetRequested && !this.customWidgetValue) {\n this.isCustomWidgetRequested = true;\n this.updateCustomWidget();\n }\n return this.customWidgetValue;\n },\n enumerable: false,\n configurable: true\n });\n Question.prototype.updateCustomWidget = function () {\n this.customWidgetValue = questionCustomWidgets_CustomWidgetCollection.Instance.getCustomWidget(this);\n };\n Question.prototype.localeChanged = function () {\n _super.prototype.localeChanged.call(this);\n this.calcRenderedCommentPlaceholder();\n if (!!this.localeChangedCallback) {\n this.localeChangedCallback();\n }\n };\n Object.defineProperty(Question.prototype, \"isCompositeQuestion\", {\n get: function () {\n return false;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Question.prototype, \"isContainer\", {\n get: function () { return false; },\n enumerable: false,\n configurable: true\n });\n Question.prototype.updateCommentElements = function () {\n };\n Question.prototype.onCommentInput = function (event) {\n if (this.isInputTextUpdate) {\n if (event.target) {\n this.comment = event.target.value;\n }\n }\n else {\n this.updateCommentElements();\n }\n };\n Question.prototype.onCommentChange = function (event) {\n this.comment = event.target.value;\n if (this.comment !== event.target.value) {\n event.target.value = this.comment;\n }\n };\n Question.prototype.afterRenderQuestionElement = function (el) {\n if (!this.survey || !this.hasSingleInput)\n return;\n this.survey.afterRenderQuestionInput(this, el);\n };\n Question.prototype.afterRender = function (el) {\n var _this = this;\n this.afterRenderCore(el);\n if (!this.survey)\n return;\n this.survey.afterRenderQuestion(this, el);\n if (!!this.afterRenderQuestionCallback) {\n this.afterRenderQuestionCallback(this, el);\n }\n if (this.supportComment() || this.supportOther()) {\n this.commentElements = [];\n this.getCommentElementsId().forEach(function (id) {\n var root = settings.environment.root;\n var el = root.getElementById(id);\n if (el)\n _this.commentElements.push(el);\n });\n this.updateCommentElements();\n }\n this.checkForResponsiveness(el);\n };\n Question.prototype.afterRenderCore = function (element) {\n _super.prototype.afterRenderCore.call(this, element);\n };\n Question.prototype.getCommentElementsId = function () {\n return [this.commentId];\n };\n Question.prototype.beforeDestroyQuestionElement = function (el) {\n this.commentElements = undefined;\n };\n Object.defineProperty(Question.prototype, \"processedTitle\", {\n get: function () {\n var res = this.locProcessedTitle.textOrHtml;\n return res ? res : this.name;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Question.prototype, \"fullTitle\", {\n get: function () {\n return this.locTitle.renderedHtml;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Question.prototype, \"titlePattern\", {\n get: function () {\n return !!this.survey ? this.survey.questionTitlePattern : \"numTitleRequire\";\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Question.prototype, \"isRequireTextOnStart\", {\n get: function () {\n return this.isRequired && this.titlePattern == \"requireNumTitle\";\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Question.prototype, \"isRequireTextBeforeTitle\", {\n get: function () {\n return this.isRequired && this.titlePattern == \"numRequireTitle\" && this.requiredText !== \"\";\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Question.prototype, \"isRequireTextAfterTitle\", {\n get: function () {\n return this.isRequired && this.titlePattern == \"numTitleRequire\" && this.requiredText !== \"\";\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Question.prototype, \"startWithNewLine\", {\n /**\n * Disable this property if you want to render the current question on the same line or row with the previous question or panel.\n */\n get: function () {\n return this.getPropertyValue(\"startWithNewLine\");\n },\n set: function (val) {\n if (this.startWithNewLine == val)\n return;\n this.setPropertyValue(\"startWithNewLine\", val);\n },\n enumerable: false,\n configurable: true\n });\n Question.prototype.calcCssClasses = function (css) {\n var classes = { error: {} };\n this.copyCssClasses(classes, css.question);\n this.copyCssClasses(classes.error, css.error);\n this.updateCssClasses(classes, css);\n if (this.survey) {\n this.survey.updateQuestionCssClasses(this, classes);\n }\n if (this.onUpdateCssClassesCallback) {\n this.onUpdateCssClassesCallback(classes);\n }\n return classes;\n };\n Object.defineProperty(Question.prototype, \"cssRoot\", {\n get: function () {\n this.ensureElementCss();\n return this.getPropertyValue(\"cssRoot\", \"\");\n },\n enumerable: false,\n configurable: true\n });\n Question.prototype.setCssRoot = function (val) {\n this.setPropertyValue(\"cssRoot\", val);\n };\n Question.prototype.getCssRoot = function (cssClasses) {\n var hasError = this.hasCssError();\n return new CssClassBuilder()\n .append(_super.prototype.getCssRoot.call(this, cssClasses))\n .append(this.isFlowLayout && !this.isDesignMode\n ? cssClasses.flowRoot\n : cssClasses.mainRoot)\n .append(cssClasses.titleLeftRoot, !this.isFlowLayout && this.hasTitleOnLeft)\n .append(cssClasses.titleTopRoot, !this.isFlowLayout && this.hasTitleOnTop)\n .append(cssClasses.titleBottomRoot, !this.isFlowLayout && this.hasTitleOnBottom)\n .append(cssClasses.descriptionUnderInputRoot, !this.isFlowLayout && this.hasDescriptionUnderInput)\n .append(cssClasses.hasError, hasError)\n .append(cssClasses.hasErrorTop, hasError && this.getErrorLocation() == \"top\")\n .append(cssClasses.hasErrorBottom, hasError && this.getErrorLocation() == \"bottom\")\n .append(cssClasses.small, !this.width)\n .append(cssClasses.answered, this.isAnswered)\n .append(cssClasses.noPointerEventsMode, this.isReadOnlyAttr)\n .toString();\n };\n Object.defineProperty(Question.prototype, \"cssHeader\", {\n get: function () {\n this.ensureElementCss();\n return this.getPropertyValue(\"cssHeader\", \"\");\n },\n enumerable: false,\n configurable: true\n });\n Question.prototype.setCssHeader = function (val) {\n this.setPropertyValue(\"cssHeader\", val);\n };\n Question.prototype.getCssHeader = function (cssClasses) {\n return new CssClassBuilder()\n .append(cssClasses.header)\n .append(cssClasses.headerTop, this.hasTitleOnTop)\n .append(cssClasses.headerLeft, this.hasTitleOnLeft)\n .append(cssClasses.headerBottom, this.hasTitleOnBottom)\n .toString();\n };\n Question.prototype.supportContainerQueries = function () {\n return false;\n };\n Object.defineProperty(Question.prototype, \"cssContent\", {\n get: function () {\n this.ensureElementCss();\n return this.getPropertyValue(\"cssContent\", \"\");\n },\n enumerable: false,\n configurable: true\n });\n Question.prototype.setCssContent = function (val) {\n this.setPropertyValue(\"cssContent\", val);\n };\n Question.prototype.getCssContent = function (cssClasses) {\n return new CssClassBuilder()\n .append(cssClasses.content)\n .append(cssClasses.contentSupportContainerQueries, this.supportContainerQueries())\n .append(cssClasses.contentLeft, this.hasTitleOnLeft)\n .toString();\n };\n Object.defineProperty(Question.prototype, \"cssTitle\", {\n get: function () {\n this.ensureElementCss();\n return this.getPropertyValue(\"cssTitle\", \"\");\n },\n enumerable: false,\n configurable: true\n });\n Question.prototype.setCssTitle = function (val) {\n this.setPropertyValue(\"cssTitle\", val);\n };\n Question.prototype.getCssTitle = function (cssClasses) {\n return new CssClassBuilder()\n .append(_super.prototype.getCssTitle.call(this, cssClasses))\n .append(cssClasses.titleOnAnswer, !this.containsErrors && this.isAnswered)\n .append(cssClasses.titleEmpty, !this.title.trim())\n .toString();\n };\n Object.defineProperty(Question.prototype, \"cssDescription\", {\n get: function () {\n this.ensureElementCss();\n return this.getPropertyValue(\"cssDescription\", \"\");\n },\n enumerable: false,\n configurable: true\n });\n Question.prototype.setCssDescription = function (val) {\n this.setPropertyValue(\"cssDescription\", val);\n };\n Question.prototype.getCssDescription = function (cssClasses) {\n return new CssClassBuilder()\n .append(cssClasses.description, this.hasDescriptionUnderTitle)\n .append(cssClasses.descriptionUnderInput, this.hasDescriptionUnderInput)\n .toString();\n };\n Question.prototype.showErrorOnCore = function (location) {\n return !this.showErrorsAboveQuestion && !this.showErrorsBelowQuestion && this.getErrorLocation() === location;\n };\n Object.defineProperty(Question.prototype, \"showErrorOnTop\", {\n get: function () {\n return this.showErrorOnCore(\"top\");\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Question.prototype, \"showErrorOnBottom\", {\n get: function () {\n return this.showErrorOnCore(\"bottom\");\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Question.prototype, \"showErrorsOutsideQuestion\", {\n get: function () {\n return this.isDefaultV2Theme;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Question.prototype, \"showErrorsAboveQuestion\", {\n get: function () {\n return this.showErrorsOutsideQuestion && this.getErrorLocation() === \"top\";\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Question.prototype, \"showErrorsBelowQuestion\", {\n get: function () {\n return this.showErrorsOutsideQuestion && this.getErrorLocation() === \"bottom\";\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Question.prototype, \"cssError\", {\n get: function () {\n this.ensureElementCss();\n return this.getPropertyValue(\"cssError\", \"\");\n },\n enumerable: false,\n configurable: true\n });\n Question.prototype.setCssError = function (val) {\n this.setPropertyValue(\"cssError\", val);\n };\n Question.prototype.getCssError = function (cssClasses) {\n return new CssClassBuilder()\n .append(cssClasses.error.root)\n .append(cssClasses.errorsContainer, this.showErrorsBelowQuestion || this.showErrorsAboveQuestion)\n .append(cssClasses.errorsContainerTop, this.showErrorsAboveQuestion)\n .append(cssClasses.errorsContainerBottom, this.showErrorsBelowQuestion)\n .append(cssClasses.error.locationTop, this.showErrorOnTop)\n .append(cssClasses.error.locationBottom, this.showErrorOnBottom)\n .toString();\n };\n Question.prototype.hasCssError = function () {\n return this.errors.length > 0 || this.hasCssErrorCallback();\n };\n Question.prototype.getRootCss = function () {\n return new CssClassBuilder()\n .append(this.cssRoot)\n .append(this.cssClasses.mobile, this.isMobile)\n .append(this.cssClasses.readOnly, this.isReadOnlyStyle)\n .append(this.cssClasses.disabled, this.isDisabledStyle)\n .append(this.cssClasses.preview, this.isPreviewStyle)\n .append(this.cssClasses.invisible, !this.isDesignMode && this.areInvisibleElementsShowing && !this.visible)\n .toString();\n };\n Question.prototype.getQuestionRootCss = function () {\n return new CssClassBuilder()\n .append(this.cssClasses.root)\n .append(this.cssClasses.rootMobile, this.isMobile)\n .toString();\n };\n Question.prototype.updateElementCss = function (reNew) {\n _super.prototype.updateElementCss.call(this, reNew);\n if (reNew) {\n this.updateQuestionCss(true);\n }\n this.onIndentChanged();\n };\n Question.prototype.updateQuestionCss = function (reNew) {\n if (this.isLoadingFromJson ||\n !this.survey ||\n (reNew !== true && !this.cssClassesValue))\n return;\n this.updateElementCssCore(this.cssClasses);\n };\n Question.prototype.ensureElementCss = function () {\n if (!this.cssClassesValue) {\n this.updateQuestionCss(true);\n }\n };\n Question.prototype.updateElementCssCore = function (cssClasses) {\n this.setCssRoot(this.getCssRoot(cssClasses));\n this.setCssHeader(this.getCssHeader(cssClasses));\n this.setCssContent(this.getCssContent(cssClasses));\n this.setCssTitle(this.getCssTitle(cssClasses));\n this.setCssDescription(this.getCssDescription(cssClasses));\n this.setCssError(this.getCssError(cssClasses));\n };\n Question.prototype.updateCssClasses = function (res, css) {\n if (!css.question)\n return;\n var objCss = css[this.getCssType()];\n var titleBuilder = new CssClassBuilder().append(res.title)\n .append(css.question.titleRequired, this.isRequired);\n res.title = titleBuilder.toString();\n var rootBuilder = new CssClassBuilder().append(res.root)\n .append(objCss, this.isRequired && !!css.question.required);\n if (objCss === undefined || objCss === null) {\n res.root = rootBuilder.toString();\n }\n else if (typeof objCss === \"string\" || objCss instanceof String) {\n res.root = rootBuilder.append(objCss.toString()).toString();\n }\n else {\n res.root = rootBuilder.toString();\n for (var key in objCss) {\n res[key] = objCss[key];\n }\n }\n };\n Question.prototype.getCssType = function () {\n return this.getType();\n };\n Object.defineProperty(Question.prototype, \"renderCssRoot\", {\n get: function () {\n return this.cssClasses.root || undefined;\n },\n enumerable: false,\n configurable: true\n });\n Question.prototype.onIndentChanged = function () {\n this.paddingLeft = this.getIndentSize(this.indent);\n this.paddingRight = this.getIndentSize(this.rightIndent);\n };\n Question.prototype.getIndentSize = function (indent) {\n if (indent < 1 || !this.getSurvey() || !this.cssClasses || !this.cssClasses.indent)\n return \"\";\n return indent * this.cssClasses.indent + \"px\";\n };\n /**\n * Moves focus to the input field of this question.\n * @param onError Pass `true` if you want to focus an input field with the first validation error. Default value: `false` (focuses the first input field). Applies to question types with multiple input fields.\n */\n Question.prototype.focus = function (onError, scrollIfVisible) {\n var _this = this;\n if (onError === void 0) { onError = false; }\n if (this.isDesignMode || !this.isVisible || !this.survey)\n return;\n var page = this.page;\n var shouldChangePage = !!page && this.survey.activePage !== page;\n if (shouldChangePage) {\n this.survey.focusQuestionByInstance(this, onError);\n }\n else {\n if (!!this.survey) {\n this.expandAllParents();\n var scrollOptions = this.survey[\"isSmoothScrollEnabled\"] ? { behavior: \"smooth\" } : undefined;\n this.survey.scrollElementToTop(this, this, null, this.id, scrollIfVisible, scrollOptions, undefined, function () {\n _this.focusInputElement(onError);\n });\n }\n else {\n this.focusInputElement(onError);\n }\n }\n };\n Question.prototype.focusInputElement = function (onError) {\n var _a;\n var id = !onError ? this.getFirstInputElementId() : this.getFirstErrorInputElementId();\n var surveyRoot = (_a = this.survey) === null || _a === void 0 ? void 0 : _a.rootElement;\n if (survey_element_SurveyElement.FocusElement(id, false, surveyRoot)) {\n this.fireCallback(this.focusCallback);\n }\n };\n Object.defineProperty(Question.prototype, \"isValidateVisitedEmptyFields\", {\n get: function () {\n return this.supportEmptyValidation() && !!this.survey && this.survey.getValidateVisitedEmptyFields() && this.isEmpty();\n },\n enumerable: false,\n configurable: true\n });\n Question.prototype.supportEmptyValidation = function () { return false; };\n Question.prototype.onBlur = function (event) {\n this.onBlurCore(event);\n };\n Question.prototype.onFocus = function (event) {\n this.onFocusCore(event);\n };\n Question.prototype.onBlurCore = function (event) {\n if (this.isFocusEmpty && this.isEmpty()) {\n this.validate(true);\n }\n };\n Question.prototype.onFocusCore = function (event) {\n this.isFocusEmpty = this.isValidateVisitedEmptyFields;\n };\n Question.prototype.expandAllParents = function () {\n this.expandAllParentsCore(this);\n };\n Question.prototype.expandAllParentsCore = function (element) {\n if (!element)\n return;\n if (element.isCollapsed) {\n element.expand();\n }\n this.expandAllParentsCore(element.parent);\n this.expandAllParentsCore(element.parentQuestion);\n };\n Question.prototype.focusIn = function () {\n if (!this.survey || this.isDisposed || this.isContainer)\n return;\n this.survey.whenQuestionFocusIn(this);\n };\n Question.prototype.fireCallback = function (callback) {\n if (callback)\n callback();\n };\n Question.prototype.getOthersMaxLength = function () {\n if (!this.survey)\n return null;\n return this.survey.maxOthersLength > 0 ? this.survey.maxOthersLength : null;\n };\n Question.prototype.onCreating = function () { };\n Question.prototype.getFirstQuestionToFocus = function (withError) {\n return this.hasInput && (!withError || this.currentErrorCount > 0) ? this : null;\n };\n Question.prototype.getFirstInputElementId = function () {\n return this.inputId;\n };\n Question.prototype.getFirstErrorInputElementId = function () {\n return this.getFirstInputElementId();\n };\n Question.prototype.getProcessedTextValue = function (textValue) {\n var name = textValue.name.toLocaleLowerCase();\n textValue.isExists =\n Object.keys(Question.TextPreprocessorValuesMap).indexOf(name) !== -1 ||\n this[textValue.name] !== undefined;\n textValue.value = this[Question.TextPreprocessorValuesMap[name] || textValue.name];\n };\n Question.prototype.supportComment = function () {\n var prop = this.getPropertyByName(\"showCommentArea\");\n return !prop || prop.visible;\n };\n Question.prototype.supportOther = function () {\n return false;\n };\n Object.defineProperty(Question.prototype, \"isRequired\", {\n /**\n * Makes the question required. If a respondent skips a required question, the survey displays a validation error.\n * @see requiredIf\n * @see [Data Validation](https://surveyjs.io/form-library/documentation/data-validation)\n */\n get: function () {\n return this.getPropertyValue(\"isRequired\");\n },\n set: function (val) {\n this.setPropertyValue(\"isRequired\", val);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Question.prototype, \"requiredIf\", {\n /**\n * A Boolean expression. If it evaluates to `true`, this question becomes required.\n *\n * A survey parses and runs all expressions on startup. If any values used in the expression change, the survey re-evaluates it.\n *\n * Refer to the following help topic for more information: [Conditional Visibility](https://surveyjs.io/form-library/documentation/design-survey-conditional-logic#conditional-visibility).\n * @see isRequired\n */\n get: function () {\n return this.getPropertyValue(\"requiredIf\", \"\");\n },\n set: function (val) {\n this.setPropertyValue(\"requiredIf\", val);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Question.prototype, \"showCommentArea\", {\n /**\n * Specifies whether to display a comment area. Incompatible with the `showOtherItem` property.\n * @see comment\n * @see commentText\n * @see showOtherItem\n */\n get: function () {\n return this.getPropertyValue(\"showCommentArea\", false);\n },\n set: function (val) {\n if (!this.supportComment())\n return;\n this.setPropertyValue(\"showCommentArea\", val);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Question.prototype, \"hasComment\", {\n get: function () {\n return this.showCommentArea;\n },\n set: function (val) {\n this.showCommentArea = val;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Question.prototype, \"id\", {\n /**\n * A value to assign to the `id` attribute of the rendered HTML element. A default `id` is generated automatically.\n */\n get: function () {\n return this.getPropertyValue(\"id\");\n },\n set: function (val) {\n this.setPropertyValue(\"id\", val);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Question.prototype, \"ariaTitleId\", {\n get: function () {\n return this.id + \"_ariaTitle\";\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Question.prototype, \"ariaDescriptionId\", {\n get: function () {\n return this.id + \"_ariaDescription\";\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Question.prototype, \"commentId\", {\n get: function () {\n return this.id + \"_comment\";\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Question.prototype, \"showOtherItem\", {\n /**\n * Specifies whether to display the \"Other\" choice item. Incompatible with the `showCommentArea` property.\n *\n * @see otherText\n * @see otherItem\n * @see otherErrorText\n * @see showCommentArea\n * @see [settings.specialChoicesOrder](https://surveyjs.io/form-library/documentation/api-reference/settings#specialChoicesOrder)\n */\n get: function () {\n return this.getPropertyValue(\"showOtherItem\", false);\n },\n set: function (val) {\n if (!this.supportOther() || this.showOtherItem == val)\n return;\n this.setPropertyValue(\"showOtherItem\", val);\n this.hasOtherChanged();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Question.prototype, \"hasOther\", {\n get: function () {\n return this.showOtherItem;\n },\n set: function (val) {\n this.showOtherItem = val;\n },\n enumerable: false,\n configurable: true\n });\n Question.prototype.hasOtherChanged = function () { };\n Object.defineProperty(Question.prototype, \"requireUpdateCommentValue\", {\n get: function () {\n return this.hasComment || this.hasOther;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Question.prototype, \"isReadOnly\", {\n get: function () {\n var isParentReadOnly = !!this.parent && this.parent.isReadOnly;\n var isPareQuestionReadOnly = !!this.parentQuestion && this.parentQuestion.isReadOnly;\n var isSurveyReadOnly = !!this.survey && this.survey.isDisplayMode;\n var callbackVal = !!this.readOnlyCallback && this.readOnlyCallback();\n return this.readOnly || isParentReadOnly || isSurveyReadOnly || isPareQuestionReadOnly || callbackVal;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Question.prototype, \"isInputReadOnly\", {\n get: function () {\n if (this.forceIsInputReadOnly !== undefined) {\n return this.forceIsInputReadOnly;\n }\n return this.isReadOnly || this.isDesignModeV2;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Question.prototype, \"renderedInputReadOnly\", {\n get: function () {\n return this.isInputReadOnly ? \"\" : undefined;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Question.prototype, \"renderedInputDisabled\", {\n get: function () {\n return this.isInputReadOnly ? \"\" : undefined;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Question.prototype, \"isReadOnlyAttr\", {\n get: function () {\n return this.isReadOnly;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Question.prototype, \"isDisabledAttr\", {\n get: function () {\n return this.isDesignModeV2 || (!!this.readOnlyCallback && this.readOnlyCallback());\n },\n enumerable: false,\n configurable: true\n });\n Question.prototype.onReadOnlyChanged = function () {\n this.setPropertyValue(\"isInputReadOnly\", this.isInputReadOnly);\n _super.prototype.onReadOnlyChanged.call(this);\n if (this.isReadOnly) {\n this.clearErrors();\n }\n this.updateQuestionCss();\n this.calcRenderedCommentPlaceholder();\n };\n Object.defineProperty(Question.prototype, \"enableIf\", {\n /**\n * A Boolean expression. If it evaluates to `false`, this question becomes read-only.\n *\n * A survey parses and runs all expressions on startup. If any values used in the expression change, the survey re-evaluates it.\n *\n * Refer to the following help topic for more information: [Conditional Visibility](https://surveyjs.io/form-library/documentation/design-survey-conditional-logic#conditional-visibility).\n *\n * [View Demo](https://surveyjs.io/form-library/examples/how-to-conditionally-make-input-field-read-only/ (linkStyle))\n * @see readOnly\n * @see isReadOnly\n */\n get: function () {\n return this.getPropertyValue(\"enableIf\", \"\");\n },\n set: function (val) {\n this.setPropertyValue(\"enableIf\", val);\n },\n enumerable: false,\n configurable: true\n });\n Question.prototype.surveyChoiceItemVisibilityChange = function () { };\n Question.prototype.runCondition = function (values, properties) {\n if (this.isDesignMode)\n return;\n if (!properties)\n properties = {};\n properties[\"question\"] = this;\n this.runConditionCore(values, properties);\n if (!this.isValueChangedDirectly && (!this.isClearValueOnHidden || this.isVisibleInSurvey)) {\n this.defaultValueRunner = this.getDefaultRunner(this.defaultValueRunner, this.defaultValueExpression);\n this.runDefaultValueExpression(this.defaultValueRunner, values, properties);\n }\n };\n Object.defineProperty(Question.prototype, \"isInDesignMode\", {\n get: function () {\n return !this.isContentElement && this.isDesignMode;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Question.prototype, \"isInDesignModeV2\", {\n get: function () {\n return !this.isContentElement && this.isDesignModeV2;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Question.prototype, \"no\", {\n /**\n * A question number or letter (depends on the `questionStartIndex` property of the question container (panel, page, or survey)).\n *\n * When the question number, title, or the entire question is invisible, this property returns an empty string.\n * @see SurveyModel.questionStartIndex\n * @see hideNumber\n * @see titleLocation\n * @see visibleIf\n */\n get: function () {\n return this.getPropertyValue(\"no\");\n },\n enumerable: false,\n configurable: true\n });\n Question.prototype.calcNo = function () {\n var _a;\n if (!this.hasTitle || this.hideNumber)\n return \"\";\n var parentIndex = (_a = this.parent) === null || _a === void 0 ? void 0 : _a.visibleIndex;\n var no = helpers_Helpers.getNumberByIndex(this.visibleIndex, this.getStartIndex(), parentIndex);\n if (!!this.survey) {\n no = this.survey.getUpdatedQuestionNo(this, no);\n }\n return no;\n };\n Question.prototype.getStartIndex = function () {\n if (!!this.parent)\n return this.parent.getQuestionStartIndex();\n if (!!this.survey)\n return this.survey.questionStartIndex;\n return \"\";\n };\n Question.prototype.onSurveyLoad = function () {\n this.isCustomWidgetRequested = false;\n this.fireCallback(this.surveyLoadCallback);\n this.updateValueWithDefaults();\n if (this.isEmpty()) {\n this.initDataFromSurvey();\n }\n this.calcRenderedCommentPlaceholder();\n this.onIndentChanged();\n };\n Question.prototype.onSetData = function () {\n _super.prototype.onSetData.call(this);\n if (!this.survey)\n return;\n this.onIndentChanged();\n if (!this.isDesignMode) {\n this.initDataFromSurvey();\n this.onSurveyValueChanged(this.value);\n this.updateValueWithDefaults();\n this.updateIsAnswered();\n }\n };\n Question.prototype.initDataFromSurvey = function () {\n if (!!this.data) {\n var val = this.data.getValue(this.getValueName());\n if (!helpers_Helpers.isValueEmpty(val) || !this.isLoadingFromJson) {\n this.updateValueFromSurvey(val);\n }\n this.initCommentFromSurvey();\n }\n };\n Question.prototype.initCommentFromSurvey = function () {\n if (!!this.data && this.requireUpdateCommentValue) {\n this.updateCommentFromSurvey(this.data.getComment(this.getValueName()));\n }\n else {\n this.updateCommentFromSurvey(\"\");\n }\n };\n Question.prototype.runExpression = function (expression) {\n if (!this.survey || !expression)\n return undefined;\n return this.survey.runExpression(expression);\n };\n Object.defineProperty(Question.prototype, \"commentAreaRows\", {\n get: function () {\n return this.survey && this.survey.commentAreaRows;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Question.prototype, \"autoGrowComment\", {\n get: function () {\n return this.survey && this.survey.autoGrowComment;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Question.prototype, \"allowResizeComment\", {\n get: function () {\n return this.survey && this.survey.allowResizeComment;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Question.prototype, \"questionValue\", {\n get: function () {\n return this.getPropertyValueWithoutDefault(\"value\");\n },\n set: function (val) {\n this.setPropertyValue(\"value\", val);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Question.prototype, \"questionComment\", {\n get: function () {\n return this.getPropertyValueWithoutDefault(\"comment\");\n },\n set: function (val) {\n this.setPropertyValue(\"comment\", val);\n this.fireCallback(this.commentChangedCallback);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Question.prototype, \"isValueArray\", {\n get: function () { return false; },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Question.prototype, \"value\", {\n /**\n * Gets or sets the question value.\n *\n * The following table illustrates how the value type depends on the question type:\n *\n * | Question type | Value type(s) |\n * | ------------- | ------------- |\n * | Checkboxes | Array<string | number>
|\n * | Dropdown | `string` \\| `number` |\n * | Dynamic Matrix | `Array