@syncfusion/ej2-form-renderer 34.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (214) hide show
  1. package/README.md +60 -0
  2. package/common.d.ts +4 -0
  3. package/common.js +4 -0
  4. package/dist/ej2-form-renderer.umd.min.js +11 -0
  5. package/dist/ej2-form-renderer.umd.min.js.map +1 -0
  6. package/dist/es6/ej2-form-renderer.es2015.js +6787 -0
  7. package/dist/es6/ej2-form-renderer.es2015.js.map +1 -0
  8. package/dist/es6/ej2-form-renderer.es5.js +7055 -0
  9. package/dist/es6/ej2-form-renderer.es5.js.map +1 -0
  10. package/dist/global/ej2-form-renderer.min.js +11 -0
  11. package/dist/global/ej2-form-renderer.min.js.map +1 -0
  12. package/dist/global/index.d.ts +14 -0
  13. package/form-renderer.d.ts +4 -0
  14. package/form-renderer.js +4 -0
  15. package/index.d.ts +4 -0
  16. package/index.js +4 -0
  17. package/license +10 -0
  18. package/package.json +41 -0
  19. package/src/common/checkbox-group.d.ts +55 -0
  20. package/src/common/checkbox-group.js +241 -0
  21. package/src/common/conditional-rule-engine.d.ts +241 -0
  22. package/src/common/conditional-rule-engine.js +505 -0
  23. package/src/common/custom-validation-engine.d.ts +57 -0
  24. package/src/common/custom-validation-engine.js +152 -0
  25. package/src/common/datagrid-component.d.ts +156 -0
  26. package/src/common/datagrid-component.js +410 -0
  27. package/src/common/expressions/dependency-tracker.d.ts +29 -0
  28. package/src/common/expressions/dependency-tracker.js +137 -0
  29. package/src/common/expressions/expression-engine.d.ts +94 -0
  30. package/src/common/expressions/expression-engine.js +514 -0
  31. package/src/common/expressions/expression-parser.d.ts +40 -0
  32. package/src/common/expressions/expression-parser.js +270 -0
  33. package/src/common/expressions/grid-expressions.d.ts +24 -0
  34. package/src/common/expressions/grid-expressions.js +92 -0
  35. package/src/common/expressions/index.d.ts +4 -0
  36. package/src/common/expressions/index.js +4 -0
  37. package/src/common/index.d.ts +10 -0
  38. package/src/common/index.js +10 -0
  39. package/src/common/json-converter.d.ts +945 -0
  40. package/src/common/json-converter.js +1110 -0
  41. package/src/common/minmax-rule-engine.d.ts +105 -0
  42. package/src/common/minmax-rule-engine.js +380 -0
  43. package/src/common/option-fetcher.d.ts +30 -0
  44. package/src/common/option-fetcher.js +139 -0
  45. package/src/common/parser.d.ts +98 -0
  46. package/src/common/parser.js +788 -0
  47. package/src/common/static-html-renderer.d.ts +45 -0
  48. package/src/common/static-html-renderer.js +77 -0
  49. package/src/common/utils.d.ts +116 -0
  50. package/src/common/utils.js +484 -0
  51. package/src/form-renderer/form-renderer-model.d.ts +65 -0
  52. package/src/form-renderer/form-renderer.d.ts +425 -0
  53. package/src/form-renderer/form-renderer.js +2277 -0
  54. package/src/form-renderer/index.d.ts +6 -0
  55. package/src/form-renderer/index.js +5 -0
  56. package/src/form-renderer/render-form-field.d.ts +31 -0
  57. package/src/form-renderer/render-form-field.js +816 -0
  58. package/src/form-renderer/types/form-schema.d.ts +452 -0
  59. package/src/form-renderer/types/form-schema.js +32 -0
  60. package/src/global.js +1 -0
  61. package/src/index.d.ts +4 -0
  62. package/src/index.js +4 -0
  63. package/styles/bds-lite.css +599 -0
  64. package/styles/bds-lite.scss +2 -0
  65. package/styles/bds.css +599 -0
  66. package/styles/bds.scss +2 -0
  67. package/styles/bootstrap-dark-lite.css +608 -0
  68. package/styles/bootstrap-dark-lite.scss +2 -0
  69. package/styles/bootstrap-dark.css +608 -0
  70. package/styles/bootstrap-dark.scss +2 -0
  71. package/styles/bootstrap-lite.css +595 -0
  72. package/styles/bootstrap-lite.scss +2 -0
  73. package/styles/bootstrap.css +595 -0
  74. package/styles/bootstrap.scss +2 -0
  75. package/styles/bootstrap4-lite.css +595 -0
  76. package/styles/bootstrap4-lite.scss +2 -0
  77. package/styles/bootstrap4.css +595 -0
  78. package/styles/bootstrap4.scss +2 -0
  79. package/styles/bootstrap5-dark-lite.css +595 -0
  80. package/styles/bootstrap5-dark-lite.scss +2 -0
  81. package/styles/bootstrap5-dark.css +595 -0
  82. package/styles/bootstrap5-dark.scss +2 -0
  83. package/styles/bootstrap5-lite.css +595 -0
  84. package/styles/bootstrap5-lite.scss +2 -0
  85. package/styles/bootstrap5.3-lite.css +679 -0
  86. package/styles/bootstrap5.3-lite.scss +2 -0
  87. package/styles/bootstrap5.3.css +679 -0
  88. package/styles/bootstrap5.3.scss +2 -0
  89. package/styles/bootstrap5.css +595 -0
  90. package/styles/bootstrap5.scss +2 -0
  91. package/styles/fabric-dark-lite.css +608 -0
  92. package/styles/fabric-dark-lite.scss +2 -0
  93. package/styles/fabric-dark.css +608 -0
  94. package/styles/fabric-dark.scss +2 -0
  95. package/styles/fabric-lite.css +595 -0
  96. package/styles/fabric-lite.scss +2 -0
  97. package/styles/fabric.css +595 -0
  98. package/styles/fabric.scss +2 -0
  99. package/styles/fluent-dark-lite.css +595 -0
  100. package/styles/fluent-dark-lite.scss +2 -0
  101. package/styles/fluent-dark.css +595 -0
  102. package/styles/fluent-dark.scss +2 -0
  103. package/styles/fluent-lite.css +595 -0
  104. package/styles/fluent-lite.scss +2 -0
  105. package/styles/fluent.css +595 -0
  106. package/styles/fluent.scss +2 -0
  107. package/styles/fluent2-lite.css +681 -0
  108. package/styles/fluent2-lite.scss +2 -0
  109. package/styles/fluent2.css +681 -0
  110. package/styles/fluent2.scss +2 -0
  111. package/styles/form-renderer/_all.scss +2 -0
  112. package/styles/form-renderer/_bds-definition.scss +8 -0
  113. package/styles/form-renderer/_bootstrap-dark-definition.scss +8 -0
  114. package/styles/form-renderer/_bootstrap-definition.scss +8 -0
  115. package/styles/form-renderer/_bootstrap4-definition.scss +8 -0
  116. package/styles/form-renderer/_bootstrap5-dark-definition.scss +8 -0
  117. package/styles/form-renderer/_bootstrap5-definition.scss +8 -0
  118. package/styles/form-renderer/_bootstrap5.3-definition.scss +8 -0
  119. package/styles/form-renderer/_fabric-dark-definition.scss +8 -0
  120. package/styles/form-renderer/_fabric-definition.scss +8 -0
  121. package/styles/form-renderer/_fluent-dark-definition.scss +8 -0
  122. package/styles/form-renderer/_fluent-definition.scss +8 -0
  123. package/styles/form-renderer/_fluent2-definition.scss +8 -0
  124. package/styles/form-renderer/_highcontrast-definition.scss +8 -0
  125. package/styles/form-renderer/_highcontrast-light-definition.scss +8 -0
  126. package/styles/form-renderer/_layout.scss +480 -0
  127. package/styles/form-renderer/_material-dark-definition.scss +8 -0
  128. package/styles/form-renderer/_material-definition.scss +8 -0
  129. package/styles/form-renderer/_material3-dark-definition.scss +8 -0
  130. package/styles/form-renderer/_material3-definition.scss +8 -0
  131. package/styles/form-renderer/_mixin.scss +26 -0
  132. package/styles/form-renderer/_tailwind-dark-definition.scss +8 -0
  133. package/styles/form-renderer/_tailwind-definition.scss +8 -0
  134. package/styles/form-renderer/_tailwind3-definition.scss +8 -0
  135. package/styles/form-renderer/_theme.scss +69 -0
  136. package/styles/form-renderer/_variables.scss +2 -0
  137. package/styles/form-renderer/bds.css +599 -0
  138. package/styles/form-renderer/bds.scss +2 -0
  139. package/styles/form-renderer/bootstrap-dark.css +608 -0
  140. package/styles/form-renderer/bootstrap-dark.scss +2 -0
  141. package/styles/form-renderer/bootstrap.css +595 -0
  142. package/styles/form-renderer/bootstrap.scss +2 -0
  143. package/styles/form-renderer/bootstrap4.css +595 -0
  144. package/styles/form-renderer/bootstrap4.scss +2 -0
  145. package/styles/form-renderer/bootstrap5-dark.css +595 -0
  146. package/styles/form-renderer/bootstrap5-dark.scss +2 -0
  147. package/styles/form-renderer/bootstrap5.3.css +679 -0
  148. package/styles/form-renderer/bootstrap5.3.scss +2 -0
  149. package/styles/form-renderer/bootstrap5.css +595 -0
  150. package/styles/form-renderer/bootstrap5.scss +2 -0
  151. package/styles/form-renderer/fabric-dark.css +608 -0
  152. package/styles/form-renderer/fabric-dark.scss +2 -0
  153. package/styles/form-renderer/fabric.css +595 -0
  154. package/styles/form-renderer/fabric.scss +2 -0
  155. package/styles/form-renderer/fluent-dark.css +595 -0
  156. package/styles/form-renderer/fluent-dark.scss +2 -0
  157. package/styles/form-renderer/fluent.css +595 -0
  158. package/styles/form-renderer/fluent.scss +2 -0
  159. package/styles/form-renderer/fluent2.css +681 -0
  160. package/styles/form-renderer/fluent2.scss +2 -0
  161. package/styles/form-renderer/highcontrast-light.css +595 -0
  162. package/styles/form-renderer/highcontrast-light.scss +2 -0
  163. package/styles/form-renderer/highcontrast.css +608 -0
  164. package/styles/form-renderer/highcontrast.scss +2 -0
  165. package/styles/form-renderer/material-dark.css +608 -0
  166. package/styles/form-renderer/material-dark.scss +2 -0
  167. package/styles/form-renderer/material.css +595 -0
  168. package/styles/form-renderer/material.scss +2 -0
  169. package/styles/form-renderer/material3-dark.css +677 -0
  170. package/styles/form-renderer/material3-dark.scss +2 -0
  171. package/styles/form-renderer/material3.css +679 -0
  172. package/styles/form-renderer/material3.scss +2 -0
  173. package/styles/form-renderer/tailwind-dark.css +595 -0
  174. package/styles/form-renderer/tailwind-dark.scss +2 -0
  175. package/styles/form-renderer/tailwind.css +595 -0
  176. package/styles/form-renderer/tailwind.scss +2 -0
  177. package/styles/form-renderer/tailwind3.css +669 -0
  178. package/styles/form-renderer/tailwind3.scss +2 -0
  179. package/styles/highcontrast-light-lite.css +595 -0
  180. package/styles/highcontrast-light-lite.scss +2 -0
  181. package/styles/highcontrast-light.css +595 -0
  182. package/styles/highcontrast-light.scss +2 -0
  183. package/styles/highcontrast-lite.css +608 -0
  184. package/styles/highcontrast-lite.scss +2 -0
  185. package/styles/highcontrast.css +608 -0
  186. package/styles/highcontrast.scss +2 -0
  187. package/styles/material-dark-lite.css +608 -0
  188. package/styles/material-dark-lite.scss +2 -0
  189. package/styles/material-dark.css +608 -0
  190. package/styles/material-dark.scss +2 -0
  191. package/styles/material-lite.css +595 -0
  192. package/styles/material-lite.scss +2 -0
  193. package/styles/material.css +595 -0
  194. package/styles/material.scss +2 -0
  195. package/styles/material3-dark-lite.css +677 -0
  196. package/styles/material3-dark-lite.scss +2 -0
  197. package/styles/material3-dark.css +677 -0
  198. package/styles/material3-dark.scss +2 -0
  199. package/styles/material3-lite.css +679 -0
  200. package/styles/material3-lite.scss +2 -0
  201. package/styles/material3.css +679 -0
  202. package/styles/material3.scss +2 -0
  203. package/styles/tailwind-dark-lite.css +595 -0
  204. package/styles/tailwind-dark-lite.scss +2 -0
  205. package/styles/tailwind-dark.css +595 -0
  206. package/styles/tailwind-dark.scss +2 -0
  207. package/styles/tailwind-lite.css +595 -0
  208. package/styles/tailwind-lite.scss +2 -0
  209. package/styles/tailwind.css +595 -0
  210. package/styles/tailwind.scss +2 -0
  211. package/styles/tailwind3-lite.css +669 -0
  212. package/styles/tailwind3-lite.scss +2 -0
  213. package/styles/tailwind3.css +669 -0
  214. package/styles/tailwind3.scss +2 -0
package/README.md ADDED
@@ -0,0 +1,60 @@
1
+ # JavaScript Form Renderer
2
+
3
+ The Syncfusion EJ2 **Form Renderer** is a schema-driven form rendering control. It consumes a JSON form schema and renders a fully functional, Syncfusion-based form that supports field mapping, validations, conditional visibility/disabling, expression-based value computation, custom validation, and data submission.
4
+
5
+ ## Key features
6
+
7
+ * **Schema-driven rendering** — Consumes a JSON schema describing the form's version, fields, layout, and global settings, then renders the form automatically.
8
+ * **Supported form fields** — Supports 25+ field types in the control.
9
+ * **Built-in validation** — Natively supports validation with `required`, `minLength`, `maxLength`, `min`, `max`, `regex`, auto-applied email/URL regex for `textbox` with `textboxType`, and `customValidation` expression rules.
10
+ * **Conditional logic** — Visbility, required, read only, conditional default value based on conditions with other form fields. The choice-based field filtering for dropdowns, and `conditionalData` for data grids are also supported.
11
+ * **Expression** — Computed fields with topological evaluation order, cycle detection, and per-target-type coercion.
12
+ * **Layouts & composition** — Single/Two/Three/Four column layouts, panels, tables, tabs, cards, and per-column width control.
13
+ * Localization & RTL — Localization and RTL support are available in every rendered Syncfusion control.
14
+
15
+ ## Setup
16
+
17
+ To install the Form Renderer in your application, use the following command.
18
+
19
+ ```sh
20
+ npm install @syncfusion/ej2-form-renderer
21
+ ```
22
+
23
+ ## Supported frameworks
24
+
25
+ The Form Renderer is available in the following list of frameworks.
26
+
27
+ | [<img src="https://ej2.syncfusion.com/github/images/js.svg" height="50" />](https://www.syncfusion.com/javascript-ui-controls?utm_medium=listing&utm_source=github)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[JavaScript](https://www.syncfusion.com/javascript-ui-controls?utm_medium=listing&utm_source=github)&nbsp;&nbsp;&nbsp;&nbsp; | [<img src="https://ej2.syncfusion.com/github/images/angular-new.svg" height="50" />](https://www.syncfusion.com/angular-components/?utm_medium=listing&utm_source=github)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Angular](https://www.syncfusion.com/angular-components/?utm_medium=listing&utm_source=github)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | [<img src="https://ej2.syncfusion.com/github/images/react.svg" height="50" />](https://www.syncfusion.com/react-ui-components?utm_medium=listing&utm_source=github)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[React](https://www.syncfusion.com/react-ui-components?utm_medium=listing&utm_source=github)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | [<img src="https://ej2.syncfusion.com/github/images/vue.svg" height="50" />](https://www.syncfusion.com/vue-ui-components?utm_medium=listing&utm_source=github)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Vue](https://www.syncfusion.com/vue-ui-components?utm_medium=listing&utm_source=github)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | [<img src="https://ej2.syncfusion.com/github/images/netcore.svg" height="50" />](https://www.syncfusion.com/aspnet-core-ui-controls?utm_medium=listing&utm_source=github)<br/>&nbsp;&nbsp;[ASP.NET&nbsp;Core](https://www.syncfusion.com/aspnet-core-ui-controls?utm_medium=listing&utm_source=github)&nbsp;&nbsp; |
28
+ | :-----: | :-----: | :-----: | :-----: | :-----: |
29
+
30
+ ## Resources
31
+
32
+ * [Documentation](https://ej2.syncfusion.com/documentation/introduction)
33
+ * [Theme Studio](https://ej2.syncfusion.com/themestudio/)
34
+ * [What's New](https://www.syncfusion.com/products/whatsnew?utm_medium=listing&utm_source=github)
35
+ * [Road Map](https://www.syncfusion.com/products/roadmap)
36
+ * [E-Books](https://www.syncfusion.com/succinctly-free-ebooks)
37
+
38
+ ## Support
39
+
40
+ Product support is available through following mediums.
41
+
42
+ * [Support ticket](https://support.syncfusion.com/support/tickets/create) - Guaranteed Response in 24 hours | Unlimited tickets | Holiday support
43
+ * [Community forum](https://www.syncfusion.com/forums?utm_source=npm&utm_campaign=form-renderer-npm)
44
+ * [GitHub issues](https://github.com/syncfusion/ej2-javascript-ui-controls/issues/new)
45
+ * [Request feature or report bug](https://www.syncfusion.com/feedback?utm_medium=listing&utm_source=github)
46
+ * Live chat
47
+
48
+ ## Changelog
49
+
50
+ Check the changelog [here](https://github.com/syncfusion/ej2-javascript-ui-controls/blob/master/components/form-renderer/CHANGELOG.md). Get minor improvements and bug fixes every week to stay up to date with frequent updates.
51
+
52
+ ## License and copyright
53
+
54
+ > This is a commercial product and requires a paid license for possession or use. Syncfusion<sup>®</sup> licensed software, including this component, is subject to the terms and conditions of Syncfusion<sup>®</sup> [EULA](https://www.syncfusion.com/eula/es/). To acquire a license for 140+ Syncfusion UI components, you can [purchase](https://www.syncfusion.com/sales/products) or [start a free 30-day trial](https://www.syncfusion.com/account/manage-trials/start-trials).
55
+
56
+ > A free community [license](https://www.syncfusion.com/products/communitylicense) is also available for companies and individuals whose organizations have less than $1 million USD in annual gross revenue and five or fewer developers.
57
+
58
+ See [LICENSE FILE](license) for more info.
59
+
60
+ © Copyright 2026 Syncfusion<sup>®</sup> Inc. All Rights Reserved. The Syncfusion<sup>®</sup> Essential Studio<sup>®</sup> license and copyright applies to this distribution.
package/common.d.ts ADDED
@@ -0,0 +1,4 @@
1
+ /**
2
+ * common
3
+ */
4
+ export * from './src/common/index';
package/common.js ADDED
@@ -0,0 +1,4 @@
1
+ /**
2
+ * common
3
+ */
4
+ export * from './src/common/index';
@@ -0,0 +1,11 @@
1
+ /*!
2
+ * filename: ej2-form-renderer.umd.min.js
3
+ * version : 34.2.2
4
+ * Copyright Syncfusion Inc. 2001 - 2025. All rights reserved.
5
+ * Use of this code is subject to the terms of our license.
6
+ * A copy of the current license can be obtained at any time by e-mailing
7
+ * licensing@syncfusion.com. Any infringement will be prosecuted under
8
+ * applicable laws.
9
+ */
10
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@syncfusion/ej2-base"),require("@syncfusion/ej2-navigations"),require("@syncfusion/ej2-popups"),require("@syncfusion/ej2-inputs"),require("@syncfusion/ej2-buttons"),require("@syncfusion/ej2-splitbuttons"),require("@syncfusion/ej2-dropdowns"),require("@syncfusion/ej2-calendars"),require("@syncfusion/ej2-notifications"),require("@syncfusion/ej2-image-editor"),require("@syncfusion/ej2-richtexteditor"),require("@syncfusion/ej2-data"),require("@syncfusion/ej2-grids")):"function"==typeof define&&define.amd?define(["exports","@syncfusion/ej2-base","@syncfusion/ej2-navigations","@syncfusion/ej2-popups","@syncfusion/ej2-inputs","@syncfusion/ej2-buttons","@syncfusion/ej2-splitbuttons","@syncfusion/ej2-dropdowns","@syncfusion/ej2-calendars","@syncfusion/ej2-notifications","@syncfusion/ej2-image-editor","@syncfusion/ej2-richtexteditor","@syncfusion/ej2-data","@syncfusion/ej2-grids"],t):t((e=e||self).ej={},e.ej2Base,e.ej2Navigations,e.ej2Popups,e.ej2Inputs,e.ej2Buttons,e.ej2Splitbuttons,e.ej2Dropdowns,e.ej2Calendars,e.ej2Notifications,e.ej2ImageEditor,e.ej2Richtexteditor,e.ej2Data,e.ej2Grids)}(this,function(e,_,N,S,z,q,Q,W,H,X,ee,G,h,r){"use strict";t.evaluateCondition=function(e,t){try{return"field"in e&&"operator"in e&&"value"in e?this.evaluateSimpleRule(e,t):"condition"in e&&"rules"in e&&this.evaluateCompositeRule(e,t)}catch(e){return!1}},t.evaluateSimpleRule=function(e,t){try{var n=t[e.field],i=e.operator.toLowerCase();if(void 0===n)if(-1===["equal","equals","notequal","notequals","isempty","isnotempty"].indexOf(i))return!1;var a=Array.isArray(n),r=new _.Internationalization;switch(i){case"equal":case"equals":return n===e.value;case"notequal":case"notequals":return n!==e.value;case"startswith":return n.startsWith(e.value);case"doesnotstartswith":return!n.startsWith(e.value);case"greaterthan":case"lessthan":case"greaterthanorequal":case"lessthanorequal":var o=Number(n),s=Number(e.value);return Number.isNaN(o)||Number.isNaN(s)?!1:"greaterthan"===i?s<o:"lessthan"===i?o<s:"greaterthanorequal"===i?s<=o:o<=s;case"dategreaterthan":case"datelessthan":var l=r.parseDate(n,{format:"MM/dd/yyyy"}),d=r.parseDate(e.value,{format:"MM/dd/yyyy"});return null!==l&&null!==d?"dategreaterthan"===i?d<l:"datelessthan"===i?l<d:l<=d:!1;case"timegreaterthan":case"timelessthan":var c=r.parseDate(n,{format:"hh:mm a",type:"time"}),u=r.parseDate(e.value,{format:"hh:mm a",type:"time"});if(null!==c&&null!==u){if("timegreaterthan"===i)return u<c;if("timelessthan"===i)return c<u}return!1;case"datetimegreaterthan":case"datetimelessthan":var p=r.parseDate(n,{format:"MM/dd/yyyy hh:mm a",type:"dateTime"}),h=r.parseDate(e.value,{format:"MM/dd/yyyy hh:mm a",type:"dateTime"});if(null!==p&&null!==h){if("datetimegreaterthan"===i)return h<p;if("datetimelessthan"===i)return p<h}return!1;case"contains":return a?"string"==typeof e.value&&-1!==e.value.indexOf(",")?e.value.split(",").map(function(e){return e.trim()}).some(function(e){return-1!==n.indexOf(e)}):-1!==n.indexOf(e.value):-1!==String(n).indexOf(String(e.value));case"notcontains":return a?"string"==typeof e.value&&-1!==e.value.indexOf(",")?!e.value.split(",").map(function(e){return e.trim()}).some(function(e){return-1!==n.indexOf(e)}):-1===n.indexOf(e.value):-1===String(n).indexOf(String(e.value));case"isempty":return a?0===n.length:!n||0===String(n).length;case"isnotempty":return a?0<n.length:!!n&&0<String(n).length;default:return!1}}catch(e){return!1}},t.evaluateCompositeRule=function(e,t){var n,i=this;try{return Array.isArray(e.rules)&&0!==e.rules.length?"and"===(n=e.condition.toLowerCase())?e.rules.every(function(e){return i.evaluateCondition(e,t)}):"or"===n&&e.rules.some(function(e){return i.evaluateCondition(e,t)}):!1}catch(e){return!1}},t.isFieldVisible=function(e,t){try{return e&&e.visibleWhen?this.evaluateCondition(e.visibleWhen,t):!0}catch(e){return!0}},t.isFieldReadOnly=function(e,t){try{return e&&e.readOnlyWhen?this.evaluateCondition(e.readOnlyWhen,t):!1}catch(e){return!1}},t.isFieldDisabled=function(e,t){try{return e&&e.disabledWhen?this.evaluateCondition(e.disabledWhen,t):!1}catch(e){return!1}},t.isFieldHidden=function(e,t){try{return e&&e.hideWhen?this.evaluateCondition(e.hideWhen,t):!1}catch(e){return!1}},t.isFieldRequired=function(e,t){try{return e&&e.requiredWhen?this.evaluateCondition(e.requiredWhen,t):!1}catch(e){return!1}},t.getConditionalValue=function(e,t){try{return e&&e.setValueWhen?this.evaluateCondition(e.setValueWhen.condition,t)?e.setValueWhen.value:void 0:void 0}catch(e){}},t.evaluateConditionalDataRules=function(e,t){if(e&&Array.isArray(e))for(var n=0;n<e.length;n++){var i=e[n];if(this.evaluateCondition(i.condition,t))return n}return-1},t.getChoiceBasedOptions=function(e,t,n,i){try{var a,r=n&&n[i];return null==r?e.showAllWhenNotMapped?t:[]:(a=String(r))in e.choiceMapping?e.choiceMapping[a].filter(function(e){return-1!==t.indexOf(e)}):e.showAllWhenNotMapped?t:[]}catch(e){return t}};var $=t;function t(){}var d=function(){return(d=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e}).apply(this,arguments)},c=function(e){return e+"_"+Date.now()+"_"+Math.floor(1e3*Math.random())};function E(t){for(var o=new Map,e=0,n=Object.keys(t.properties);e<n.length;e++){var i=n[e];o.set(i,t.properties[i])}function s(e){for(var r=[],t=function(e){if("field"===e.type){var t=e;if(l.has(t.propertyId))return"continue";l.add(t.propertyId);var n=o.get(t.propertyId);n?r.push(T(n)):(n={id:t.propertyId||c("textbox"),name:""+"_"+Math.floor(1e3*Math.random()),type:"textbox",label:"Unknown Field",_configured:!0},r.push(n))}else{var i,a;"table"===e.type?(i=d({id:(t=e).id||c("table"),name:t.name,type:"table",label:t.label||"Table",cssClass:t.cssClass,hideBorders:t.hideBorders,rows:t.rows,columns:t.cols,columnWidths:t.columnWidths,tableCells:[],_configured:!0},t.conditions?{conditions:t.conditions}:{}),t.cells.forEach(function(e){var t=[];e.forEach(function(e){e=s(e.children);t.push(e)}),i.tableCells.push(t)}),r.push(i)):"panel"===e.type?(t=d({id:(n=e).id||c("panel"),type:"panel",name:n.name,cssClass:n.cssClass,hideBorders:n.hideBorders,hideLabel:n.hideLabel,label:n.label||"Panel",children:s(n.children),_configured:!0},n.conditions?{conditions:n.conditions}:{}),r.push(t)):"tabs"===e.type?(a=d({id:(n=e).id||c("tabs"),type:"tabs",name:n.name,label:n.label||"Tabs",cssClass:n.cssClass,tabOptions:n.tabOptions,tabItems:[],_configured:!0},n.conditions?{conditions:n.conditions}:{}),n.tabs.forEach(function(e){a.tabItems.push({header:e.header,content:s(e.children)})}),r.push(a)):"card"===e.type&&(n=d({id:(t=e).id||c("card"),type:"card",name:t.name,label:t.label||"Card",cssClass:t.cssClass,hideLabel:t.hideLabel,children:s(t.children),_configured:!0},t.conditions?{conditions:t.conditions}:{}),void 0!==t.cardTitle&&(n.cardTitle=t.cardTitle),void 0!==t.cardSubtitle&&(n.cardSubtitle=t.cardSubtitle),r.push(n))}},n=0,i=e;n<i.length;n++)t(i[n]);return r}var a,l=new Set;return a=t.layout&&0!==t.layout.length?s(t.layout):Object.keys(t.properties).map(function(e){return T(t.properties[e])}),d({version:t.version,components:a},t.settings?{settings:t.settings}:{})}function T(t){var e=void 0!==t.options&&0<t.options.length,n={id:t.id||c(t.widget||A(t.type,t.format,e)),name:t.name,type:t.widget||A(t.type,t.format,e),label:t.label||t.id},i=new Set(["id","type","name","label","format","widget","defaultValue","required","options","expressionValue","minLength","maxLength","minimum","maximum","minValue","maxValue","minDate","maxDate","minTime","maxTime","regex","pattern","content","buttonType","textboxType"]);return Object.keys(t).forEach(function(e){i.has(e)||"id"===e||"name"===e||"type"===e||"label"===e||(n[e]=t[e])}),void 0!==t.defaultValue&&(n.defaultValue=t.defaultValue),void 0!==t.expressionValue&&(n.expressionValue=t.expressionValue),void 0!==t.required&&(n.required=t.required),void 0!==t.content&&(n.content=t.content),void 0!==t.buttonType&&(n.buttonType=t.buttonType),void 0!==t.textboxType&&(n.textboxType=t.textboxType),void 0!==t.options&&(n.options=t.options),void 0!==t.minLength&&(n.minLength=t.minLength),void 0!==t.maxLength&&(n.maxLength=t.maxLength),void 0!==t.minValue&&(n.minValue=t.minValue),void 0!==t.maxValue&&(n.maxValue=t.maxValue),void 0!==t.minDate&&(n.minDate=t.minDate),void 0!==t.maxDate&&(n.maxDate=t.maxDate),void 0!==t.minTime&&(n.minTime=t.minTime),void 0!==t.maxTime&&(n.maxTime=t.maxTime),void 0!==t.pattern&&(n.regex=t.pattern),n}function A(e,t,n){return"string"===e?"date"===t?"date":"date-time"===t?"dateTime":"time"===t?"time":"email"===t?"email":"url"===t?"url":n?"dropdown":"textbox":"number"===e?"number":"boolean"===e?"checkbox":"array"===e?"multiselect":"button"===e?"button":"message"===e?"message":"sign"===e?"signature":"image"===e?"imageEditor":"file"===e?"fileUpload":"color"===e?"colorPicker":"grid"===e?"dataGrid":"textbox"}n.prototype.setAvailableFields=function(e){var t=this;this.availableFields.clear(),e.forEach(function(e){t.availableFields.set(e.name,e)})},n.prototype.validateFieldOperations=function(e){var t=[];if(0!==this.availableFields.size)for(var n=["-","*","/","%","^"],i=["-","*","/","%","^","+"],a=new Set,r=/(\{[^}]+\})/g;null!==(u=r.exec(e));){var o,s,l,d,c,u,p,h,m=u[0],f=m.slice(1,-1),y=this.availableFields.get(f);y&&(m=(u=u.index)+m.length,p=e.substring(Math.max(0,u-10),u),o=e.substring(m,Math.min(e.length,m+10)),s=p.replace(/\s+$/,"").slice(-1),l=o.replace(/^\s+/,"").charAt(0),d=p.replace(/\s+$/,""),c=o.replace(/^\s+/,""),u=u-(p.length-d.length)-1,p=m+(o.length-c.length),"string"!==y.type||y.format||(s&&-1!==n.indexOf(s)&&!a.has(h=u+":"+s)&&(t.push("Cannot perform '"+s+"' operation on string field '{"+f+"}'"),a.add(h)),!l)||-1===n.indexOf(l)||a.has(h=p+":"+l)||(t.push("Cannot perform '"+l+"' operation on string field '{"+f+"}'"),a.add(h)),"date"!==y.format&&"date-time"!==y.format&&"time"!==y.format||(s&&-1!==i.indexOf(s)&&!a.has(h=u+":"+s)&&(t.push("Cannot perform '"+s+"' operation on date field '{"+f+"}'"),a.add(h)),!l)||-1===i.indexOf(l)||a.has(h=p+":"+l)||(t.push("Cannot perform '"+l+"' operation on date field '{"+f+"}'"),a.add(h)))}return t},n.prototype.validate=function(e){var t=[];if(!e||""===e.trim())return{valid:!0,errors:[]};(e.match(/\{/g)||[]).length!==(e.match(/\}/g)||[]).length&&t.push("Unbalanced braces in expression");(e.match(/\(/g)||[]).length!==(e.match(/\)/g)||[]).length&&t.push("Unbalanced parentheses in expression");for(var n=/(\w+)\s*\(/g;null!==(i=n.exec(e));){var i=i[1].toUpperCase();i===i.toUpperCase()&&-1===this.supportedFunctions.indexOf(i)&&t.push("Unknown function: "+i)}var a=this.validateFieldOperations(e);return t.push.apply(t,a),{valid:0===t.length,errors:t}},n.prototype.compile=function(e,t){void 0===t&&(t={});try{var n;return t.availableFields&&Array.isArray(t.availableFields)&&this.setAvailableFields(t.availableFields),this.validate(e).valid?(n=e,n=this.compileFieldReferences(e),n=t.isCustomValidation?this.compileInputReferences(n):n,n=this.compileBareFunctionCalls(n),n=this.compileMatrixExpressions(n),function(e){try{return new Function("context","\n try {\n return "+n+";\n } catch (e) {\n return null;\n }\n ")(e)}catch(e){return null}}):function(){return null}}catch(e){return function(){return null}}},n.prototype.compileMatrixExpressions=function(e){var i=["PI","TRUE","FALSE","NULL","UNDEFINED","Math"],a=["SUM","AVG","MIN","MAX","COUNT","ROUND","FLOOR","CEIL","ABS","SQRT","UPPER","LOWER","CONCAT","LENGTH","TRIM","SUBSTRING","TODAY","AGE","DATEFORMAT","DATEDIFF","ADDDAYS","SUBDAYS"];return e.replace(/\$?\{([^}]+)\}/g,function(e,t){var n=t;return a.forEach(function(e){var t=new RegExp("(?<!context\\.)\\b"+e+"\\b(?=\\s*\\()","g");n=n.replace(t,"context."+e)}),i.forEach(function(e){var t=new RegExp("\\b"+e+"\\b","g");n=n.replace(t,"context."+e)}),"("+n+")"})},n.prototype.compileBareFunctionCalls=function(e){var n=e;return["SUM","AVG","MIN","MAX","COUNT","ROUND","FLOOR","CEIL","ABS","SQRT","UPPER","LOWER","CONCAT","LENGTH","TRIM","SUBSTRING","TODAY","AGE","DATEFORMAT","DATEDIFF","ADDDAYS","SUBDAYS"].forEach(function(e){var t=new RegExp("(?<!context\\.)\\b"+e+"\\b(?=\\s*\\()","g");n=n.replace(t,"context."+e)}),n},n.prototype.compileFieldReferences=function(e){return e.replace(/\{([^{}]+)\}/g,function(e,t){return t.startsWith("\\")&&t.endsWith("\\")?e:"context['"+t.replace(/\./g,"'].[")+"']"})},n.prototype.compileInputReferences=function(e){var t=[],n=e=(e=(e=e.replace(/(['"`])(?:(?=(\\?))\2.)*?\1/g,function(e){return t.push(e),"__STRING_"+(t.length-1)+"__"})).replace(/(?<!context\[')\binput\./g,"context['input'].")).replace(/(?<!context\[')\binput\b(?!\s*[(\.])/g,"context['input']");return t.forEach(function(e,t){n=n.replace("__STRING_"+t+"__",e)}),n};var D=n;function n(){this.supportedFunctions=["SUM","AVG","MIN","MAX","COUNT","ROUND","FLOOR","CEIL","ABS","SQRT","UPPER","LOWER","CONCAT","LENGTH","TRIM","SUBSTRING","TODAY","AGE","DATEFORMAT","DATEDIFF","ADDDAYS","SUBDAYS","INCLUDES","CONTAINS","ISNAN","SUPPORTEDVALUESOF","TOSTRING","DATE","GETTIME","EVERY","SOME"],this.availableFields=new Map}i.prototype.extractFieldReferences=function(e){if(!e)return[];for(var t,n=new Set,i=e.replace(this.escapedBracePattern,""),a=/\{([^{}]+)\}/g;null!==(t=a.exec(i));){var r=t[1].trim();this.isFunctionCall(r)||this.isOperator(r)||(r=r.split(/[.\[\]]/)[0].trim())&&!this.isKeyword(r)&&n.add(r)}for(var o=/\$\{([^}]+)\}/g;null!==(t=o.exec(i));)for(var s=t[1],l=/\b([a-zA-Z_][a-zA-Z0-9_]*)\b(?!\s*[(\.])/g;null!==(d=l.exec(s));){var d=d[1];this.isKeyword(d)||"Math"===d||n.add(d)}return Array.from(n)},i.prototype.buildGraph=function(e){for(var t={},n=0,i=Object.keys(e);n<i.length;n++){var a=i[n],r=this.extractFieldReferences(e[a]);t[a]=r}return t},i.prototype.detectCircularDependencies=function(o){for(var s=new Set,l=new Set,d=[],c=function(e,t){s.add(e),l.add(e),t.push(e);for(var n=0,i=o[e]||[];n<i.length;n++){var a,r=i[n];s.has(r)?l.has(r)&&(a=t.indexOf(r),d.push(t.slice(a).concat([r]))):c(r,t.slice())}l.delete(e)},e=0,t=Object.keys(o);e<t.length;e++){var n=t[e];s.has(n)||c(n,[])}return d},i.prototype.getTopologicalOrder=function(a){for(var r=new Set,o=[],s=function(e){if(!r.has(e)){r.add(e);for(var t=0,n=a[e]||[];t<n.length;t++){var i=n[t];a[i]&&s(i)}o.push(e)}},e=0,t=Object.keys(a);e<t.length;e++){var n=t[e];s(n)}return o},i.prototype.isFunctionCall=function(e){return/^\w+\s*\(/.test(e)},i.prototype.isOperator=function(e){return/^[+\-*/()=!<>&|]/.test(e)},i.prototype.isKeyword=function(e){return-1!==["PI","TRUE","FALSE","NULL","UNDEFINED","and","or","in"].indexOf(e.toUpperCase())};var V=i;function i(){this.escapedBracePattern=/\\{.*?\\}/g}var O=function(){return(O=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e}).apply(this,arguments)},a=(o.prototype.evaluate=function(e,t,n,i){void 0===n&&(n={}),void 0===i&&(i=!1);try{if(!e||""===e.trim())return null;var a=n.timeout,r=void 0===a?5e3:a,o=n.maxDepth,s=void 0===o?10:o,l=n.locale,d=void 0===l?"en-US":l,c=n.throwOnError,u=void 0!==c&&c,p=this.getCacheKey(e,t);if(!i&&this.evaluationCache.has(p))return this.evaluationCache.get(p);var h=this.compiledFunctions.get(e),m=(h||(h=this.parser.compile(e,{timeout:r,maxDepth:s,locale:d,isCustomValidation:i}),this.compiledFunctions.set(e,h)),this.buildContext(t)),f=Date.now(),y=h(m);if(Date.now()-f>r){var v=new Error("Expression evaluation exceeded timeout of "+r+"ms");if(u)throw v;return null}return this.evaluationCache.set(p,y),y}catch(v){if(n.throwOnError)throw v;return null}},o.prototype.extractDependencies=function(e){return e?this.dependencyTracker.extractFieldReferences(e):[]},o.prototype.buildDependencyGraph=function(e){var n=this,i={};return e.forEach(function(e){var t;e.expressionValue&&(t=n.extractDependencies(e.expressionValue),i[e.name]=t)}),i},o.prototype.detectCircularDependencies=function(o){for(var s=new Set,l=new Set,d=[],c=function(e,t){s.add(e),l.add(e),t.push(e);for(var n=0,i=o[e]||[];n<i.length;n++){var a,r=i[n];s.has(r)?l.has(r)&&(a=t.indexOf(r),d.push(t.slice(a).concat([r]))):c(r,t.slice())}l.delete(e)},e=0,t=Object.keys(o);e<t.length;e++){var n=t[e];s.has(n)||c(n,[])}return d},o.prototype.getTopologicalOrder=function(a){for(var r=new Set,o=[],s=function(e){if(!r.has(e)){r.add(e);for(var t=0,n=a[e]||[];t<n.length;t++){var i=n[t];s(i)}o.push(e)}},e=0,t=Object.keys(a);e<t.length;e++){var n=t[e];s(n)}return o},o.prototype.clearCache=function(){this.evaluationCache.clear(),this.compiledFunctions.clear()},o.prototype.getCacheKey=function(e,t){return e+":"+JSON.stringify(t)},o.prototype.buildContext=function(e){var n=new _.Internationalization,i=n.getDateFormat({format:"MM/dd/yyyy",type:"date"});return O({},e,{PI:Math.PI,TRUE:!0,FALSE:!1,NULL:null,UNDEFINED:void 0,Math:Math,SUM:function(e){return Array.isArray(e)?e.reduce(function(e,t){return Number(e)+Number(t)},0):0},AVG:function(e){return Array.isArray(e)&&0!==e.length?e.reduce(function(e,t){return Number(e)+Number(t)},0)/e.length:0},MIN:function(e){return Array.isArray(e)&&0<e.length?Math.min.apply(Math,e.map(Number)):0},MAX:function(e){return Array.isArray(e)&&0<e.length?Math.max.apply(Math,e.map(Number)):0},COUNT:function(e){return Array.isArray(e)?e.length:0},ROUND:function(e,t){return void 0===t&&(t=0),Math.round(e*Math.pow(10,t))/Math.pow(10,t)},FLOOR:Math.floor,CEIL:Math.ceil,ABS:Math.abs,SQRT:Math.sqrt,UPPER:function(e){return String(e).toUpperCase()},LOWER:function(e){return String(e).toLowerCase()},CONCAT:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.map(String).join("")},LENGTH:function(e){return String(e).length},TRIM:function(e){return String(e).trim()},SUBSTRING:function(e,t,n){return void 0!==n?String(e).substr(t,n):String(e).substr(t)},TODAY:function(){return i(new Date)},AGE:function(e){var e="string"==typeof e?new Date(e):e,t=new Date,n=t.getFullYear()-e.getFullYear(),i=t.getMonth()-e.getMonth();return(i<0||0==i&&t.getDate()<e.getDate())&&n--,n},DATEFORMAT:function(e,t){e="string"==typeof e?new Date(e):e;return n.getDateFormat({format:t,type:"date"})(e)},DATEDIFF:function(e,t){e="string"==typeof e?new Date(e):e,t="string"==typeof t?new Date(t):t;return Math.floor((t.getTime()-e.getTime())/864e5)},ADDDAYS:function(e,t){e=new Date(e);return e.setDate(e.getDate()+Number(t)),i(e)},SUBDAYS:function(e,t){e=new Date(e);return e.setDate(e.getDate()-Number(t)),i(e)}})},o);function o(){this.evaluationCache=new Map,this.compiledFunctions=new Map,this.parser=new D,this.dependencyTracker=new V}function te(e){return{primary:"e-primary",flat:"e-flat",information:"e-info",error:"e-danger",success:"e-success",warning:"e-warning"}[e||"primary"]||"e-primary"}function ne(e){return"submit"===e||"reset"===e?e:"button"}function ie(e){return{Left:"flex-start",Right:"flex-end",Center:"center"}[e||"Left"]||"flex-start"}var u={EMAIL:/^(?!.*\.\.)[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}$/,URL:/^(https?:\/\/)?([a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}(\/[^\s]*)?$/,DATE_ISO:/^([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$/,DIGITS:/^[0-9]*$/,PHONE:/^[+]?[0-9]{9,13}$/,CREDIT_CARD:/^\d{13,16}$/};function I(t,e){function n(e){e.forEach(function(e){e.name&&e.id in t&&(i[e.name]=t[e.id]),e.children&&n(e.children),e.tabItems&&e.tabItems.forEach(function(e){return e.content&&n(e.content)}),e.tableCells&&e.tableCells.forEach(function(e){return e.forEach(n)})})}var i={};return n(e),i}function F(t,e,n){if("string"!=typeof t||!/{[^}]+}/.test(t))return t;n=n?I(e,n):e;try{var i=M.evaluate(t,n);return null!=i?String(i):""}catch(e){return t}}function J(e,t,n){return e&&"object"==typeof e&&!Array.isArray(e)&&"lookup"===e.type&&n?n&&0<n.length?n:[]:e&&"object"==typeof e&&!Array.isArray(e)&&"url"===e.type?0<t.length?t:[]:Array.isArray(e)?e:e&&"object"==typeof e&&!Array.isArray(e)&&"raw"===e.type&&Array.isArray(e.data)?e.data:[]}var M=new a;j.fetch=function(e,d,c,u){var p;return e&&"object"==typeof e&&!Array.isArray(e)&&"url"===e.type&&e.url?(p=e,new Promise(function(t){try{var e,n,i,a={},r=(p.headers&&Array.isArray(p.headers)&&p.headers.forEach(function(e){e.key&&e.key.trim()&&(a[e.key]=e.value)}),new h.DataManager({url:p.url,adaptor:function(e){switch(e){case"WebApiAdaptor":return new h.WebApiAdaptor;case"ODataV4Adaptor":return new h.ODataV4Adaptor;default:return new h.UrlAdaptor}}(p.adaptorType),headers:Object.keys(a).length?a:void 0})),o=new h.Query,s=(p.search&&p.search.enabled&&p.search.fields&&0<p.search.fields.length&&(e=p.search.key||"search",n=c?F(e,c,u):/[{}]/.test(e)?"":e,o=o.search(n,p.search.fields)),p.sort&&p.sort.enabled&&p.sort.field&&(i="descending"===p.sort.direction?"descending":"ascending",o=o.sortBy(p.sort.field,i)),p.filters&&Array.isArray(p.filters)&&0<p.filters.length&&p.filters.forEach(function(e){var t;e.field&&e.operator&&void 0!==e.value&&""!==e.value&&""!==(t=c?F(e.value,c,u):/[{}]/.test(e.value)?"":e.value)&&(o=o.where(e.field,e.operator,t))}),p.queryParams&&Object.keys(p.queryParams).forEach(function(e){o=o.addParams(e,p.queryParams[e])}),p.skip&&(o=o.skip(p.skip)),p.take&&(o=o.take(p.take)),!1),l=setTimeout(function(){s=!0,t({id:d,options:[]})},15e3);r.executeQuery(o).then(function(e){s||(clearTimeout(l),e=e.result,p.dataPath&&(e=function(e,t){if(!t||null==e)return e;for(var n=e,i=0,a=t.split(/\.(?![^\[]*\])/);i<a.length;i++){var r=a[i];if(null==n)return null;var o,s=r.match(/^(\w*)\[(\d+)\]$/);n=s?(o=s[1],s=parseInt(s[2]),o?n[o]&&n[o][s]:n[s]):n[r]}return n}(e,p.dataPath)),e=Array.isArray(e)?e:"string"==typeof e?[e]:[],t({id:d,options:e}))}).catch(function(e){s||(clearTimeout(l),t({id:d,options:[]}))})}catch(e){t({id:d,options:[]})}})):Promise.resolve({id:d,options:[]})};var Y=j;function j(){}s.prototype.getSelectedItems=function(){var e=this.formState?this.formState.values[this.component.id]:_.isNullOrUndefined(this.valueProp())?this.component.defaultValue:this.valueProp();return Array.isArray(e)?e:[]},s.prototype.valueProp=function(){return this._value},s.prototype.setValue=function(e){this._value=e},s.prototype.handleCheckboxChange=function(t,e){var n=this.getSelectedItems(),e=e?n.concat([t]):n.filter(function(e){return e!==t});this.formState&&this.onChangeCb(e)},Object.defineProperty(s.prototype,"sizeCssClass",{get:function(){return(this.component.cssClass||"")+("Small"===this.component.size?" e-small":"Bigger"===this.component.size?" e-bigger":"")},enumerable:!0,configurable:!0}),s.prototype.render=function(e){var a=this,r=this.component,t=r.label&&r.required?r.label+" *":r.label||"",e=e||this.target,n=document.createElement("div"),o=(n.className=("checkbox-group "+(r.cssClass||"")).trim(),n.setAttribute("role","group"),n.setAttribute("aria-label",t),n.title=r.tooltip||"",(t=r.htmlAttributes)?Array.isArray(t)?t.reduce(function(e,t){return t&&t.key&&void 0!==t.value&&(e[t.key]=t.value),e},{}):t:{}),t=(Object.keys(o).forEach(function(e){"class"!==e&&"className"!==e&&"style"!==e&&n.setAttribute(e,String(o[e]))}),"display:flex;flex-direction:"+("row"===r.layoutDirection?"row":"column")+";gap:"+(r.gap||"8px")+";align-items:flex-start;"),s=(n.setAttribute("style",t),document.createElement("div")),t=(s.className="checkbox-group-items","display:flex;flex-direction:"+("row"===r.layoutDirection?"row":"column")+";flex-wrap:wrap;gap:"+(r.gap||"2px")+";width:100%;"),t=(s.setAttribute("style",t),Array.isArray(r.options)?r.options:["Option 1"]),l=this.getSelectedItems();return t.forEach(function(e,t){var n="string"==typeof e?e:null!=e.value?e.value:null!=e.label?e.label:e.key,e="string"==typeof e?e:null!=e.label?e.label:null!=e.value?e.value:String(n),i=document.createElement("div"),e=(s.appendChild(i),new q.CheckBox({label:e,enableRtl:a.enableRtl,checked:-1!==l.indexOf(n),disabled:!!r.disabled,labelPosition:r.checkboxLabelPosition||"After",cssClass:a.sizeCssClass.trim(),htmlAttributes:o,change:function(e){a.handleCheckboxChange(n,e.checked)}})),i=(e.appendTo(i),a.ref(e,t),i.querySelector('input[type="checkbox"]'));i&&(i.id=a.component.id+"_"+t),a.optionRef&&a.optionRef(e,t),a.checkboxes.push(e)}),n.appendChild(s),e&&e.appendChild(n),this.container=n,this.itemsContainer=s,n},s.prototype.refreshSelection=function(){var n=this,i=this.getSelectedItems();(Array.isArray(this.component.options)?this.component.options:["Option 1"]).forEach(function(e,t){e="string"==typeof e?e:null!=e.value?e.value:null!=e.label?e.label:e.key,t=n.checkboxes[t];t&&(t.checked=-1!==i.indexOf(e))})},s.prototype.destroy=function(){for(var e=0,t=this.checkboxes;e<t.length;e++){var n=t[e];try{n.destroy()}catch(e){}}this.checkboxes=[],this.container&&this.container.parentNode&&this.container.parentNode.removeChild(this.container),this.container=null,this.itemsContainer=null},s.prototype.setOptions=function(e){var a=this;if(this.component.options=e,this.itemsContainer){for(var t=0,n=this.checkboxes;t<n.length;t++){var i=n[t];try{i.destroy()}catch(e){}}for(this.checkboxes=[];this.itemsContainer.firstChild;)this.itemsContainer.removeChild(this.itemsContainer.firstChild);var r=this.getSelectedItems();e.forEach(function(e,t){var n="string"==typeof e?e:e.value||e.label||e.key,e="string"==typeof e?e:e.label||e.value||String(n),i=document.createElement("div"),e=(a.itemsContainer.appendChild(i),new q.CheckBox({label:e,enableRtl:a.enableRtl,checked:-1!==r.indexOf(n),disabled:!!a.component.disabled,labelPosition:a.component.checkboxLabelPosition||"After",cssClass:a.sizeCssClass.trim(),change:function(e){a.handleCheckboxChange(n,e.checked)}})),i=(e.appendTo(i),a.ref(e,t),i.querySelector('input[type="checkbox"]'));i&&(i.id=a.component.id+"_"+t),a.optionRef&&a.optionRef(e,t),a.checkboxes.push(e)})}};var ae=s;function s(e){this.checkboxes=[],this.component=e.component,this.formState=e.formState,this.onChangeCb=e.onChange,this.optionRef=e.optionRef,this.enableRtl=e.enableRtl,this.target=e.target,this.container=null,this.itemsContainer=null,this.ref=e.ref}var L=function(){return(L=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e}).apply(this,arguments)},P=(l.prototype.parseColumnValue=function(e,t){var n;return null==e||""===e?e:"number"===t?(n=parseFloat(String(e)),isNaN(n)?0:n):"boolean"!==t||"boolean"==typeof e?e:"true"===e||"1"===e||1===e||!0===e},l.prototype.evaluateRowExpressions=function(e,i){for(var a=this,r=L({},e),e=i.filter(function(e){return e.expression&&e.expression.toString().trim()}),o=this,t=0,n=e;t<n.length;t++)!function(t){if(!t.expression)return;try{var n={},e=(i.forEach(function(e){var t=r[e.field];n[e.field]=a.parseColumnValue(t,e.type)}),o.engine.evaluate(t.expression,n,{throwOnError:!1}));r[t.field]=e}catch(e){r[t.field]=null}}(n[t]);return r},l.prototype.extractCalculatedColumns=function(e){return e.filter(function(e){return e.expression&&e.expression.toString().trim()})},l.prototype.getEngine=function(){return this.engine},l);function l(){this.engine=new a}var B=function(){return(B=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e}).apply(this,arguments)},U=(p.prototype.validate=function(e,t,n){if(!e||""===e.trim())return!0;try{var i,a,r=B({},n,{input:t,valid:!0}),o=e.match(/valid\s*=\s*(.+?)\s*\?\s*true\s*:\s*['"](.+?)['"]\s*$/);return o?(i=o[1].trim(),a=o[2],!0===this.expressionEngine.evaluate(i,r,{throwOnError:!1},!0)||a):"Invalid validation expression format"}catch(e){return"Validation expression error"}},p.prototype.extractDependencies=function(e){var t;return e?(t=(t=e.match(/valid\s*=\s*(.+)/))?t[1]:e,this.expressionEngine.extractDependencies(t).filter(function(e){return"input"!==e})):[]},p.prototype.validateConditionSyntax=function(e,t){if(!e||""===e.trim())return["Condition cannot be empty"];var n=[],i=(e.match(/\(/g)||[]).length,a=(e.match(/\)/g)||[]).length,i=(i!==a&&n.push("Unbalanced parentheses ("+i+" open, "+a+" close)"),(e.match(/\{/g)||[]).length),a=(e.match(/\}/g)||[]).length;i!==a&&n.push("Unbalanced braces ("+i+" open, "+a+" close)");i=this.extractDependencies(e).filter(function(e){return-1===t.indexOf(e)});return 0<i.length&&n.push("Unknown field references: "+i.join(", ")),n},p.prototype.buildExpression=function(e,t){return"valid = "+e.trim()+" ? true : '"+t.replace(/'/g,"\\'")+"'"},p.prototype.parseExpression=function(e){e=e.match(/valid\s*=\s*(.+?)\s*\?\s*true\s*:\s*'(.+)'/);return e?{condition:e[1].trim(),errorMessage:e[2].replace(/\\'/g,"'")}:null},p);function p(){this.expressionEngine=new a}var m=function(){return(m=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e}).apply(this,arguments)},re=(Object.defineProperty(f.prototype,"calculatedColumns",{get:function(){return this.gridExpressions.extractCalculatedColumns(this.columns)},enumerable:!0,configurable:!0}),Object.defineProperty(f.prototype,"hasExpressions",{get:function(){return 0<this.calculatedColumns.length},enumerable:!0,configurable:!0}),f.prototype.buildToolbar=function(){var e=[];return this.allowAdding&&e.push("Add"),this.allowEditing&&e.push("Edit"),this.allowDeleting&&e.push("Delete"),e.push("Update","Cancel"),e},f.prototype.mapColumn=function(e){var t,n=e.validationRules?m({},e.validationRules):{},i=this.mapCustomValidationToSyncfusion(e);return i&&(t=e.customValidation&&e.customValidation[0]&&e.customValidation[0].expression&&(this.validationEngine.parseExpression?this.validationEngine.parseExpression(e.customValidation[0].expression).errorMessage:"Validation failed")||"Validation failed",n.required=[!0,t],n.custom=[i,t]),{field:e.field,headerText:e.headerText,type:e.type||"string",isPrimaryKey:e.isPrimaryKey||!1,width:e.width,format:"date"===e.type?e.format||"MM/dd/yyyy":e.format,editType:e.editType,allowEditing:!1!==e.allowEditing&&!e.expression,validationRules:n,edit:this.createEditParams(e)}},f.prototype.render=function(e){var n=this,t=Array.isArray(this.dataSource)?this.dataSource:[],t=(this.hasExpressions&&0<t.length?this.currentData=t.map(function(e){var t=n.gridExpressions.evaluateRowExpressions(e,n.columns);return m({},e,t)}):this.currentData=t,document.createElement("div")),i=(t.className="datagrid-wrapper",t.style.width="string"==typeof this.width?this.width:this.width+"px",t.style.height="auto",document.createElement("div")),a=(i.className="datagrid-grid",t.appendChild(i),this.id&&(i.id=this.id),new r.Grid({dataSource:this.currentData,allowPaging:this.allowPaging,filterSettings:{mode:"Immediate"},pageSettings:{pageSize:this.pageSize},editSettings:{allowEditing:this.allowEditing,allowAdding:this.allowAdding,allowDeleting:this.allowDeleting,mode:"Normal"},enableRtl:this.enableRtl,locale:this.locale||"en-US",cssClass:this.cssClass,toolbar:this.buildToolbar(),actionComplete:this.handleActionComplete,height:"string"==typeof this.height?this.height:this.height+"px",width:"string"==typeof this.width?this.width:this.width+"px",allowSorting:!0,allowFiltering:this.allowFiltering,allowSelection:!0,columns:(this.columns||[]).map(function(e){return n.mapColumn(e)})}));return a.appendTo(i),this.ref(a),this.grid=a,e&&e.appendChild(t),this.wrapper=t},f.prototype.getRef=function(){var e=this;return{getGridData:function(){return e.currentData},gridRef:{current:this.grid}}},f.prototype.getGridData=function(){return this.currentData},f.prototype.setDataSource=function(e){var n=this;this.grid&&(e=Array.isArray(e)?e:[],this.hasExpressions&&0<e.length?this.currentData=e.map(function(e){var t=n.gridExpressions.evaluateRowExpressions(e,n.columns);return m({},e,t)}):this.currentData=e,this.grid.dataSource=this.currentData,this.grid.refreshBatchData?this.grid.setProperties({dataSource:this.currentData},!0):this.grid.dataSource=this.currentData,this.grid.refresh)&&this.grid.refresh()},f.prototype.setColumns=function(e){this.grid&&(e&&0!==e.length?0===this.grid.columns.length&&e&&1===e.length&&(this.grid.columns=e):this.grid.columns=[],this.columns=e,this.grid.refresh)&&!this.isPreviewMode&&(this.dataSource&&Array.isArray(this.dataSource)&&0<this.dataSource.length&&!this.hasExpressions&&(this.grid.dataSource=this.dataSource),this.grid.refresh())},f.prototype.destroy=function(){if(this.grid){try{this.grid.destroy()}catch(e){}this.grid=null}this.wrapper&&this.wrapper.parentNode&&this.wrapper.parentNode.removeChild(this.wrapper),this.wrapper=null,this.gridExpressions=null,this.validationEngine=null,this.currentData=[],this.columns=[],this.dataSource=[]},f);function f(e){var l=this;this.grid=null,this.wrapper=null,this.mapCustomValidationToSyncfusion=function(s){if(s.customValidation&&0!==s.customValidation.length)return function(e){var n=l.grid&&l.grid.editModule?l.grid.editModule.formObj:null;if(n){var i={};(l.columns||[]).forEach(function(e){var t=n.getInputElement(e.field);t&&(t=t.value,i[e.field]="number"===e.type?parseInt(t,10):t)});for(var t=0,a=s.customValidation;t<a.length;t++){var r,o=a[t];if(o.expression)return r="number"===s.type?parseInt(e.value,10):e.value,!0===l.validationEngine.validate(o.expression,r,i)}}return!0}},this.createEditParams=function(t){if(l.hasExpressions){var n=l.calculatedColumns;if(n.some(function(e){return!!e.expression&&-1!==e.expression.indexOf("{"+t.field+"}")}))return{params:{change:function(){var e,o;l.grid&&l.grid.element&&(e=l.grid.element.querySelector("form"))&&e.ej2_instances&&e.ej2_instances[0]&&(o=e.ej2_instances[0],n.forEach(function(e){var t=o.getInputElement(e.field);if(t)try{var n={};l.columns.forEach(function(e){var t=o.getInputElement(e.field);t&&(n[e.field]=t.value)});var i,a,r=l.gridExpressions.evaluateRowExpressions(n,l.columns)[e.field];null!=r&&("boolean"===e.type?t.checked=!!r:"number"===e.type?(a=(i=t.closest(".e-control-wrapper"))?i.querySelector('input.e-control:not([type="hidden"])'):null)&&a.ej2_instances&&a.ej2_instances[0]?a.ej2_instances[0].value=r:t.value=r:"date"===e.type?t.ej2_instances[0].value=new Date(r):t.value=r)}catch(e){}}))}}}}},this.handleActionComplete=function(e){var t;if(l.grid)switch(e.requestType){case"save":case"delete":case"add":l.grid.dataSource&&(t=Array.isArray(l.grid.dataSource)?l.grid.dataSource:[],l.currentData=t,l.onDataChange)&&l.onDataChange(t)}},this.id=e.id,this.columns=e.columns||[],this.dataSource=Array.isArray(e.dataSource)?e.dataSource:[],this.height=null!=e.height?e.height:"200px",this.width=null!=e.width?e.width:"100%",this.locale=e.locale,this.cssClass=e.cssClass,this.pageSize=null!=e.pageSize?e.pageSize:6,this.allowPaging=!1!==e.allowPaging,this.allowAdding=!1!==e.allowAdding,this.allowEditing=!1!==e.allowEditing,this.allowDeleting=!1!==e.allowDeleting,this.allowFiltering=!0===e.allowFiltering,this.onDataChange=e.onDataChange,this.isPreviewMode=e.isPreviewMode,this.enableRtl=e.enableRtl,this.ref=e.ref,this.currentData=Array.isArray(this.dataSource)?this.dataSource:[],this.gridExpressions=new P,this.validationEngine=new U}r.Grid.Inject(r.Edit,r.Toolbar,r.Page,r.Resize,r.Sort,r.Filter);function Z(e,t){e&&t&&e.setAttribute("id",t)}function R(r){function e(t){var e=o.validateOn||"Change",n={};return e&&"Change"!==e||(n.change=function(e){return l(t(e))},n.blur=function(){i&&i()}),"Blur"===e&&(n.change=function(e){return l(t(e))},n.blur=function(){i&&i()}),n}var t,o=r.component,s=r.value,l=r.onChange,i=r.onBlur,d=r.onClick,n=void 0!==(n=r.hasError)&&n,c=r.locale,a=r.formState,u=r.settings,p=r.components,h=r.enableRtl,m=r.ref,j=r.l10n,L=r.initializedGrids||new Set,f=r.target,y={floatLabelType:o.floatLabelType||"Never",placeholder:o.placeholder||"",enabled:!o.disabled},v=(t=o.htmlAttributes)?Array.isArray(t)?t.reduce(function(e,t){return t&&t.key&&void 0!==t.value&&(e[t.key]=t.value),e},{}):t:{},P=(o.required&&(v["aria-required"]="true"),n?"e-error":""),g=((o.cssClass||"")+" "+P+" "+("Small"===o.size?" e-small":"Bigger"===o.size?" e-bigger":"")).trim();switch(o.type){case"textbox":var b=new z.TextBox(K({id:o.name,type:o.multiline?"hidden":o.textboxType||"text",name:o.id,enableRtl:h,locale:c,floatLabelType:y.floatLabelType,placeholder:y.placeholder,enabled:y.enabled,value:void 0!==s?s:o.defaultValue||"",multiline:o.multiline,showClearButton:o.showClearButton,autocomplete:!1===o.autocomplete||void 0===o.autocomplete?"off":"on",readonly:o.readOnly||!1,cssClass:g,htmlAttributes:v,appendTemplate:o.suffix,prependTemplate:o.prefix},e(function(e){return e.value||""})));return f&&b.appendTo(f),m(b),b;case"textarea":b=new z.TextArea(K({id:o.name,name:o.id,enableRtl:h,locale:c,floatLabelType:y.floatLabelType,placeholder:y.placeholder,enabled:y.enabled,value:void 0!==s?s:o.defaultValue||"",cols:o.cols||200,rows:o.textareaRows||4,showClearButton:o.showClearButton||!1,readonly:o.readOnly||!1,maxLength:o.maxLength||255,cssClass:g,htmlAttributes:v,appendTemplate:o.suffix,prependTemplate:o.prefix,resizeMode:"Vertical"},e(function(e){return e.value||""})));return f&&b.appendTo(f),m(b),b;case"number":b=""===s?void 0:s,b=new z.NumericTextBox({locale:c,enableRtl:h,floatLabelType:y.floatLabelType,placeholder:y.placeholder,enabled:y.enabled,value:void 0!==b?b:o.defaultValue||void 0,decimals:o.decimals||2,currency:o.currency,format:o.numberFormat||"n2",step:o.step||1,min:o.minValue||void 0,max:o.maxValue||void 0,readonly:o.readOnly||!1,showClearButton:o.showClearButton||!1,cssClass:g,htmlAttributes:v,appendTemplate:o.suffix,prependTemplate:o.prefix,change:function(e){return l(e.value)}});return f&&(Z(f,o.name),f.setAttribute("name",o.id),b.appendTo(f)),m(b),b;case"checkbox":b=o.label&&o.required?o.label+" *":o.label,b=new q.CheckBox({locale:c,name:o.id,enableRtl:h,label:b,labelPosition:o.checkboxLabelPosition,checked:void 0!==o.checked&&null!==o.checked&&o.checked||null!=s&&s,indeterminate:o.indeterminate||!1,disabled:o.disabled,cssClass:g,htmlAttributes:v,change:function(e){return l(e.checked)}});return f&&(Z(f,o.name),b.appendTo(f)),m(b),b;case"checkboxGroup":var x=[],b=(Y.fetch(o.options,o.id,a?a.values:void 0,p).then(function(e){e.id===o.id&&0<e.options.length&&(x.push.apply(x,e.options),C.setOptions(x))}).catch(function(){}),J(o.options,x)),b=0<b.length?b:o.options||["Option 1"],C=new ae({component:K({},o,{options:b}),formState:a,value:s,enableRtl:h,onChange:function(e){return l(e)},optionRef:r.ref,target:f,ref:m});return f&&Z(f,o.name),C.render(f),C;case"radio":var b=Array.isArray(o.options)?o.options:["Option 1"],B=_.createElement("div",{id:o.name+"-group",className:"e-radio-group "+P});return b.forEach(function(e,t){var n=e,i=_.createElement("div"),a=(i.style.marginBottom="8px",B.appendChild(i),_.createElement("input",{id:o.name+"_"+t+"_"+n,attrs:{type:"radio"}})),i=(i.appendChild(a),new q.RadioButton({name:o.id,label:e,enableRtl:h,locale:c,disabled:o.disabled,value:n,htmlAttributes:v,labelPosition:o.fieldLabelPosition,checked:o.defaultValue===n||s===n,cssClass:g,change:function(e){e.value===n&&l(n)}}));i.appendTo(a),m(i,t),r.ref&&"function"==typeof r.ref&&r.ref(i,t)}),f&&f.appendChild(B),[];case"dropdown":var w=[],b=(Y.fetch(o.options,o.id,a?a.values:void 0,p).then(function(e){e.id===o.id&&0<e.options.length&&(w.push.apply(w,e.options),S.dataSource=w)}).catch(function(){}),J(o.options,w)),b=0<b.length?b:o.options||["Option 1"],S=(o.conditions&&o.conditions.choiceBasedField&&0<(b=$.getChoiceBasedOptions(o.conditions.choiceBasedField,b,a?a.values:void 0,o.conditions.choiceBasedField.primaryFieldId)).length&&null!=s&&-1===b.indexOf(s)&&a&&(a.values[o.id]=null),new W.DropDownList(K({id:o.name,name:o.id,floatLabelType:y.floatLabelType,placeholder:y.placeholder,enabled:y.enabled,locale:c,enableRtl:h,cssClass:g,dataSource:b,value:void 0!==a.values[o.id]?a.values[o.id]:void 0!==o.defaultValue&&null!==o.defaultValue?o.defaultValue:null,showClearButton:o.showClearButton||!1,readonly:o.readOnly||!1,enableVirtualization:o.enableVirtualization||!1,popupHeight:o.popupHeight||"300px",popupWidth:o.popupWidth||"100%",htmlAttributes:v},e(function(e){return e.value||""}))));return W.DropDownList.Inject(W.VirtualScroll),f&&S.appendTo(f),m(S),S;case"multiselect":var E=[],b=(Y.fetch(o.options,o.id,a?a.values:void 0,p).then(function(e){e.id===o.id&&0<e.options.length&&(E.push.apply(E,e.options),T.dataSource=E)}).catch(function(){}),J(o.options,E)),b=0<b.length?b:o.options||["Option 1"],T=new W.MultiSelect(K({name:o.id,enableRtl:h,locale:c,floatLabelType:y.floatLabelType,enabled:y.enabled,value:void 0!==s?s:void 0!==o.defaultValue&&null!==o.defaultValue?o.defaultValue:null,placeholder:o.placeholder,dataSource:b,fields:{text:"text",value:"value"},showClearButton:o.showClearButton||!1,readonly:o.readOnly||!1,allowCustomValue:o.allowCustomValue||!1,addTagOnBlur:o.addTagOnBlur||!1,delimiterChar:o.delimiterChar||",",showSelectAll:o.showSelectAll||!1,mode:o.showSelectAll?"CheckBox":o.visualMode||void 0,selectAllText:o.selectAllText,unSelectAllText:o.unSelectAllText,showDropDownIcon:!1!==o.showDropDownIcon,enableVirtualization:o.enableVirtualization||!1,popupHeight:o.popupHeight||"300px",popupWidth:o.popupWidth||"100%",cssClass:g,htmlAttributes:v},e(function(e){return e.value||""})));return W.MultiSelect.Inject(W.CheckBoxSelection,W.VirtualScroll),f&&T.appendTo(f),m(T),T;case"date":b=new H.DatePicker(K({floatLabelType:y.floatLabelType,id:o.name,name:o.id,enableRtl:h,locale:c,placeholder:y.placeholder,enabled:y.enabled,value:void 0!==s?s:void 0!==o.defaultValue&&null!==o.defaultValue?o.defaultValue:null,format:o.format||"MM/dd/yyyy",readOnly:o.readOnly||!1,showClearButton:void 0!==o.showClearButton&&o.showClearButton,showTodayButton:!1!==o.showTodayButton,calendarMode:o.calendarMode||"Gregorian",dayHeaderFormat:o.dayHeaderFormat||"Short",depth:o.depth||"Month",start:o.start||"Month",firstDayOfWeek:o.firstDayOfWeek||0,min:o.minDate?new Date(o.minDate):void 0,max:o.maxDate?new Date(o.maxDate):void 0,cssClass:g,htmlAttributes:v},e(function(e){return e.value||""})));return H.DatePicker.Inject(H.Islamic),f&&b.appendTo(f),m(b),b;case"dateTime":b=new H.DateTimePicker(K({id:o.name,floatLabelType:y.floatLabelType,placeholder:y.placeholder,enabled:y.enabled,locale:c,enableRtl:h,name:o.id,dayHeaderFormat:o.dayHeaderFormat||"Short",value:void 0!==s?s:void 0!==o.defaultValue&&null!==o.defaultValue?o.defaultValue:null,format:o.format||"MM/dd/yyyy hh:mm a",showClearButton:void 0!==o.showClearButton&&o.showClearButton,showTodayButton:!1!==o.showTodayButton,depth:o.depth||"Month",start:o.start||"Month",step:o.step||1,readonly:o.readOnly||!1,min:o.minDate?new Date(o.minDate):void 0,max:o.maxDate?new Date(o.maxDate):void 0,minTime:o.minTime?new Date("2000-01-01 "+o.minTime):void 0,maxTime:o.maxTime?new Date("2000-01-01 "+o.maxTime):void 0,enableMask:!1,cssClass:g,htmlAttributes:v},e(function(e){return e.value||""})));return H.DateTimePicker.Inject(H.Islamic),f&&b.appendTo(f),m(b),b;case"time":b=new H.TimePicker(K({id:o.name,locale:c,name:o.id,enableRtl:h,floatLabelType:y.floatLabelType,placeholder:y.placeholder,enabled:y.enabled,value:void 0!==s?s:void 0!==o.defaultValue&&null!==o.defaultValue?o.defaultValue:null,format:o.format||"hh:mm a",showClearButton:void 0!==o.showClearButton&&o.showClearButton,step:o.step||30,readonly:o.readOnly||!1,min:o.minTime?new Date("2000-01-01 "+o.minTime):void 0,max:o.maxTime?new Date("2000-01-01 "+o.maxTime):void 0,enableMask:!1,cssClass:g,htmlAttributes:v},e(function(e){return e.value||""})));return f&&b.appendTo(f),m(b),b;case"dateRange":b=new H.DateRangePicker(K({id:o.name,locale:c,enableRtl:h,name:o.id,floatLabelType:y.floatLabelType,dayHeaderFormat:o.dayHeaderFormat||"Short",placeholder:y.placeholder,enabled:y.enabled,value:void 0!==s?s:void 0!==o.defaultValue&&null!==o.defaultValue?o.defaultValue:null,depth:o.depth||"Month",start:o.start||"Month",min:o.minDate?new Date(o.minDate):void 0,max:o.maxDate?new Date(o.maxDate):void 0,format:o.format||"MM/dd/yyyy",separator:o.separator||" - ",showClearButton:void 0!==o.showClearButton&&o.showClearButton,readonly:o.readOnly||!1,cssClass:g,htmlAttributes:v},e(function(e){return e.value||""})));return f&&b.appendTo(f),m(b),b;case"switch":b=new q.Switch({locale:c,enableRtl:h,value:o.defaultValue,name:o.id,checked:void 0!==o.checked&&null!==o.checked&&o.checked||null!=s&&s,disabled:o.disabled,onLabel:o.onLabel||"",offLabel:o.offLabel||"",cssClass:g,htmlAttributes:v,change:function(e){return l(e.checked)}});return f&&(Z(f,o.name),b.appendTo(f)),m(b),b;case"button":var A,D,b=o.buttonsGroups||o.buttons||[];return b&&0<b.length?(I={display:"flex",flexWrap:"wrap",alignItems:"center",gap:o.gap||"8px",justifyContent:ie(o.position),width:o.width||void 0},A=_.createElement("div",{id:o.name,attrs:{role:"group","aria-label":o.label||"Button Group",className:g+" "+(h?"e-rtl":"")}}),Object.assign(A.style,I),D=[],b.forEach(function(e,t){var n=o.name+"_"+t,i=[te(e.style)].filter(Boolean).join(" "),a=(i+="Small"===o.size?" e-small":"Bigger"===o.size?" e-bigger":"",ne(e.type)),n=_.createElement("button",{id:String(n),attrs:{name:String(n),type:a}}),a=(A.appendChild(n),new q.Button({locale:c,enableRtl:h,cssClass:i,disabled:e.disabled||!1,content:e.label||"Button "+(t+1),iconCss:e.iconCss,iconPosition:e.iconPosition}));a.appendTo(n),a.element.onclick=function(e){d&&d(e)},m(a,t),D.push(a),r.ref&&"function"==typeof r.ref&&r.ref(a,t)}),f&&f.appendChild(A),D):(I=ne(o.buttonType),b=[te(o.style),"submit"===I?"submit-btn form-submit-type":"","reset"===I?"form-reset-type":"",o.cssClass||"e-primary","Small"===o.size?" e-small":"Bigger"===o.size?" e-bigger":""].filter(Boolean).join(" ")||"e-primary",V={display:"flex",justifyContent:ie(o.position),width:o.width||"100%"},O=_.createElement("div",{id:o.name+"-container"}),Object.assign(O.style,V),V=_.createElement("button",{id:o.name,attrs:{type:I}}),O.appendChild(V),(I=new q.Button({enableRtl:h,locale:c,cssClass:b,disabled:o.disabled,iconCss:o.iconCss,iconPosition:o.iconPosition,content:o.label})).appendTo(V),m(I),I.element.onclick=function(e){d&&d(e)},f&&f.appendChild(O),I);case"splitButton":var b=["primary"===o.style?"e-primary":"",(o.style,""),"information"===o.style?"e-info":"","error"===o.style?"e-danger":"","success"===o.style?"e-success":"","warning"===o.style?"e-warning":"",o.cssClass||""].filter(Boolean).join(" ")||void 0,V={display:"flex",justifyContent:ie(o.position)},O=_.createElement("div",{id:o.name+"-container",attrs:{"aria-label":"Splitbutton"}}),I=(Object.assign(O.style,V),o.options&&0<o.options.length?o.options.map(function(e,t){return{text:e,id:o.id+"_option_"+t}}):[{text:"Option 1",id:o.id+"_option_0"}]),V=_.createElement("button",{id:o.name}),I=(O.appendChild(V),new Q.SplitButton({locale:c,enableRtl:h,content:o.label||"Split Button",items:I,cssClass:b,disabled:o.disabled,iconCss:o.iconCss,iconPosition:o.iconPosition||"Left",click:function(e){d&&d(K({},e))},select:function(e){d&&d(K({},e,{selectedItem:e.item.text}))}}));return I.appendTo(V),f&&f.appendChild(O),m(I),I;case"signature":b=_.createElement("canvas",{id:o.name}),V=new z.Signature({enableRtl:h,locale:c,backgroundColor:o.backgroundColor||"",strokeColor:o.strokeColor||"",maxStrokeWidth:o.maxValue,minStrokeWidth:o.minValue,velocity:o.velocity,disabled:o.disabled,change:function(){return l(o.name)}});return f&&(V.appendTo(b),f.appendChild(b)),m(V),V;case"rating":O=new z.Rating({enableRtl:h,locale:c,value:void 0!==s?s:o.defaultValue||0,disabled:o.disabled,cssClass:g,allowReset:o.allowReset,itemsCount:o.itemsCount,min:o.minValue,precision:o.precision,readOnly:o.readOnly,showTooltip:o.showRatingTooltip||!1,showLabel:o.showRatingLabel,labelPosition:o.showRatingLabel?o.ratingLabelPosition:void 0,valueChanged:function(e){return l(e.value)}});return f&&(Z(f,o.name),f.setAttribute("name",o.id),O.appendTo(f)),m(O),O;case"colorPicker":I=new z.ColorPicker({enableRtl:h,locale:c,value:void 0!==s?s:o.defaultValue||"",disabled:o.disabled,enableOpacity:o.enableOpacity,showButtons:o.showButtons,showRecentColors:o.showRecentColors,noColor:o.showNoColor,cssClass:g,change:function(e){return l(e.value)}});return f&&(Z(f,o.name),I.appendTo(f)),m(I),I;case"inputMask":b=new z.MaskedTextBox(K({id:o.name,name:o.id,enableRtl:h,floatLabelType:o.floatLabelType||"Never",placeholder:o.placeholder||"",enabled:!o.disabled,locale:c,value:void 0!==s?s:o.defaultValue||"",mask:o.mask||"000-000-0000",promptChar:o.promptChar||"_",customCharacters:o.customCharacters,readOnly:o.readOnly||!1,showClearButton:!1!==o.showClearButton,cssClass:g,htmlAttributes:v,appendTemplate:o.suffix,prependTemplate:o.prefix},e(function(e){return e.value||""})));return f&&b.appendTo(f),m(b),b;case"rangeSlider":V=new z.Slider({enableRtl:h,locale:c,value:void 0!==s?s:void 0!==o.defaultValue&&null!==o.defaultValue?o.defaultValue:0,min:o.minValue||0,max:o.maxValue||100,step:o.step||1,cssClass:g,enabled:!o.disabled,readonly:o.readOnly,showButtons:o.showButtons,change:function(e){return l(e.value)}});return f&&(Z(f,o.name),V.appendTo(f)),m(V),V;case"fileUpload":O=new z.Uploader({enableRtl:h,locale:c,type:"file",enabled:!o.disabled,allowedExtensions:o.allowExtensions,asyncSettings:{saveUrl:o.saveUrl,removeUrl:o.removeUrl},buttons:o.buttons||{browse:"Choose File",clear:"Clear All",upload:"Upload All"},maxFileSize:o.maxValue,minFileSize:o.minValue,multiple:!!o.allowMultiple,showFileList:o.showFileList,htmlAttributes:v,cssClass:g,change:function(e){return l(e.file)}});return f&&(Z(f,o.name),O.appendTo(f)),m(O),O;case"imageEditor":var F,I=_.createElement("div",{id:o.name,attrs:{"data-field":o.id}});return setTimeout(function(){F=new ee.ImageEditor({locale:c,enableRtl:h,disabled:o.disabled,cssClass:g,height:(null!=o.height?o.height:"350px").toString(),width:(null!=o.width?o.width:"100%").toString(),editComplete:function(){return l(o.name)},fileOpened:function(){return l(o.name)}},"#"+o.name)},100),f&&f.appendChild(I),m(F),F;case"message":var R=new X.Message({locale:c,enableRtl:h,severity:o.severity||o.messageType||"info",variant:o.variant,content:o.content||"Message",showCloseIcon:o.showCloseIcon,showIcon:void 0!==o.showIcon&&o.showIcon||!1,cssClass:g});return f&&(Z(f,o.name),R.appendTo(f)),m(R),R;case"dataGrid":var k=o,b=function(e,t){if(e&&e.conditionalData&&Array.isArray(e.conditionalData))for(var n=0,i=e.conditionalData;n<i.length;n++){var a=i[n];if($.evaluateCondition(a.condition,t))return{dataSource:a.dataSource,columns:a.columns&&0<a.columns.length?a.columns:void 0}}}(k.conditions,a&&a.values||{}),N=b?b.dataSource:void 0,V=b?b.columns:void 0,O=(N||k.dataSource,[]),U=(Y.fetch(N||k.dataSource,k.id,a&&a.values,p).then(function(e){e.id===k.id&&0<e.options.length&&(e=J(N||k.dataSource,e.options,U),M.setDataSource(e))}),[]),I=J(N||k.dataSource,O,U),b=0<I.length?I:void 0!==k.dataSource&&null!==k.dataSource?k.dataSource:[],O=V&&0<V.length?V:void 0!==k.columns&&null!==k.columns?k.columns:[],I=f||_.createElement("div",{id:k.name,className:k.cssClass}),M=(f&&Z(f,o.name),new re({locale:c,name:k.name||"",columns:O,enableRtl:h,dataSource:void 0!==b&&0<b.length?b:s,height:null!=k.height?k.height:"200px",width:null!=k.width?k.width:"100%",pageSize:k.pageSize||6,allowPaging:!1!==k.allowPaging,allowFiltering:k.allowFiltering,allowAdding:!1!==k.allowAdding,allowEditing:!1!==k.allowEditing,allowDeleting:!1!==k.allowDeleting,onDataChange:function(e){return l(e)},cssClass:g,target:I,ref:m}));return M.render(I),!L.has(o.id)&&a&&Array.isArray(b)&&(a.values[o.id]=b,M.isInitialized=!0,L.add(o.id)),"function"==typeof r.ref?r.ref(M):r.ref&&(r.ref.current=M),f||I;case"richTextEditor":V={items:["Undo","Redo","|","Bold","Italic","Underline","StrikeThrough","InlineCode","|","CreateLink","Image","CreateTable","CodeBlock","HorizontalLine","Blockquote","EmojiPicker","|","LineHeight","Formats","Alignments","|","BulletFormatList","NumberFormatList","Checklist","|","Outdent","Indent","|","FontColor","BackgroundColor","FontName","FontSize","|","LowerCase","UpperCase","SuperScript","SubScript","|","SourceCode","|"]},O=(o.enableImportFromWord&&o.enableImportFromWord.enabled&&V.items.push("ImportWord"),o.enableExportToWord&&o.enableExportToWord.enabled&&V.items.push("ExportWord"),o.enableExportToPdf&&o.enableExportToPdf.enabled&&V.items.push("ExportPdf"),V.items.push("Print"),function(e){return!!e&&e.enabled&&"string"==typeof e.serviceUrl&&""!==e.serviceUrl.trim()}),b=O(o.enableImportFromWord)?{serviceUrl:/^(https?:)?\/\//i.test(o.enableImportFromWord?o.enableImportFromWord.serviceUrl:"")?o.enableImportFromWord?o.enableImportFromWord.serviceUrl:"":(u&&u.hostUrl?u.hostUrl:"").replace(/\/+$/,"")+"/"+(o.enableImportFromWord?o.enableImportFromWord.serviceUrl:"").replace(/^\/+/,"")}:void 0,I=O(o.enableExportToWord)?{serviceUrl:/^(https?:)?\/\//i.test(o.enableExportToWord?o.enableExportToWord.serviceUrl:"")?o.enableExportToWord?o.enableExportToWord.serviceUrl:"":(u&&u.hostUrl?u.hostUrl:"").replace(/\/+$/,"")+"/"+(o.enableExportToWord?o.enableExportToWord.serviceUrl:"").replace(/^\/+/,""),fileName:"RichTextEditor.docx",stylesheet:"\n .e-rte-content {\n font-size: 1em;\n font-weight: 400;\n margin: 0;\n }\n "}:void 0,O=O(o.enableExportToPdf)?{serviceUrl:/^(https?:)?\/\//i.test(o.enableExportToPdf?o.enableExportToPdf.serviceUrl:"")?o.enableExportToPdf?o.enableExportToPdf.serviceUrl:"":(u&&u.hostUrl?u.hostUrl:"").replace(/\/+$/,"")+"/"+(o.enableExportToPdf?o.enableExportToPdf.serviceUrl:"").replace(/^\/+/,""),fileName:"RichTextEditor.pdf",stylesheet:"\n .e-rte-content {\n font-size: 1em;\n font-weight: 400;\n margin: 0;\n }\n "}:void 0,V=new G.RichTextEditor({locale:c,toolbarSettings:V,enableRtl:h,value:void 0!==s?s:o.defaultValue||"",placeholder:o.placeholder||"",enabled:!o.disabled,readonly:o.readOnly||!1,maxLength:o.maxLength||void 0,cssClass:g||void 0,height:o.height||"300px",width:o.width||"100%",htmlAttributes:v,importWord:b,exportPdf:O,exportWord:I,change:function(e){return l(e.value)}});return G.RichTextEditor.Inject(G.Toolbar,G.Link,G.HtmlEditor,G.QuickToolbar,G.Image,G.Count,G.Table,G.EmojiPicker,G.PasteCleanup,G.SlashMenu,G.CodeBlock,G.ClipBoardCleanup,G.AutoFormat,G.ImportExport),V.appendTo(f),m(V),V;default:R=new X.Message({locale:c,enableRtl:h,severity:"Warning",content:j.getConstant("unsupportedComponent")+" : "+o.type,cssClass:g});return f&&(Z(f,o.name),R.appendTo(f)),m(R),R}}var K=function(){return(K=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e}).apply(this,arguments)},y=function(){return(y=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e}).apply(this,arguments)},oe={strict:!1,maxInputSize:5242880,defaultTextType:"textbox",inferTypeFromValue:!0,generateIds:!0,includeMetadata:!0,customTypeMap:{},validateUnknownFields:!1},se=(v.prototype.parse=function(e){var t=[],n=[];if("string"==typeof e){if(e.length>this.config.maxInputSize)return this.formatError(t,n,"Input exceeds maximum size of "+this.config.maxInputSize+" bytes");var i=le(e);if(!i.valid)return this.formatError(t,n,i.errors&&i.errors[0]||"Invalid JSON");try{e=JSON.parse(e)}catch(e){return this.formatError(t,n,"Failed to parse JSON: "+e.message)}}var i=this.detectFormat(e),a=(i.ambiguousFormats&&0<i.ambiguousFormats.length&&(n.push("Ambiguous format detected."),n.push("Using "+i.format+" format ("+("json-schema"===i.format?"properties priority":"pages priority")+")")),[]);switch(i.format){case"configured-schema":a=e.properties||[];break;case"json-schema":var r=this.parseJsonSchema(e),a=r.components;r.warnings&&n.push.apply(n,r.warnings);break;case"surveyjs":a=this.parseSurveyJS(e);break;case"openapi":a=this.parseOpenAPI(e);break;case"data-inference":0<(a=this.parseDataInference(e)).length&&n.push("Field types inferred from data; please verify");break;default:t.push("Could not determine input format")}0===a.length&&t.push("No form fields could be extracted from input");!a.some(function(e){return"button"===e.type&&"submit"===e.buttonType})&&0<a.length&&a.push({id:this.generateComponentId("button"),type:"button",label:"Submit",style:"primary",buttonType:"submit"});var o={version:e.version||"0.1.0",components:a},s=de(o),s=(!s.valid&&s.errors&&t.push.apply(t,s.errors),s.warnings&&n.push.apply(n,s.warnings),this.config.strict&&0<n.length&&(t.push.apply(t,n),n.length=0),ce(o));return{success:0===t.length,schema:s,errors:t,warnings:n,metadata:{detectedFormat:i.format,confidence:i.confidence,sourceHints:i.hints}}},v.prototype.formatError=function(e,t,n){return e.push(n),{success:!1,schema:null,errors:e,warnings:t,metadata:{detectedFormat:"unknown",confidence:"low",sourceHints:[]}}},v.prototype.detectFormat=function(e){var t,n,i,a=[],r=[];return e&&"object"==typeof e?e.$schema&&"string"==typeof e.$schema&&e.$schema.includes("json-schema")?(a.push("$schema property detected"),{format:"json-schema",confidence:"high",hints:a}):(t=e.properties&&"object"==typeof e.properties,n=e.pages&&Array.isArray(e.pages),i=e.elements&&Array.isArray(e.elements),t&&n?(a.push("Multiple format patterns detected"),a.push("Selected based on priority rules"),r.push("properties format","pages format"),{format:"json-schema",confidence:"medium",hints:a,ambiguousFormats:r}):n?(a.push("pages array detected"),e.pages[0]&&e.pages[0].elements&&a.push("elements structure matched"),{format:"surveyjs",confidence:"high",hints:a}):i&&!t?(a.push("elements array at root level"),{format:"surveyjs",confidence:"medium",hints:a}):t?(a.push("properties object detected"),"object"===e.type&&a.push("type: object matched"),e.required&&Array.isArray(e.required)&&a.push("required array found"),this.hasExampleFields(e.properties)?(a.push("example fields detected (API schema pattern)"),{format:"openapi",confidence:"high",hints:a}):{format:"json-schema",confidence:"high",hints:a}):this.isDataInferenceCandidate(e)?(a.push("Simple object with primitive values"),a.push("No schema indicators found"),{format:"data-inference",confidence:"medium",hints:a}):{format:"unknown",confidence:"low",hints:["Could not identify format"]}):{format:"unknown",confidence:"low",hints:["Input is not a valid object"]}},v.prototype.hasExampleFields=function(e){if(e&&"object"==typeof e)for(var t=0,n=Object.keys(e);t<n.length;t++){var i=e[n[t]];if(i&&"example"in i)return!0}return!1},v.prototype.isDataInferenceCandidate=function(t){return!(!t||"object"!=typeof t||t.$schema||t.properties||t.pages||t.elements)&&Object.keys(t).every(function(e){e=t[e];return null==e||"string"==typeof e||"number"==typeof e||"boolean"==typeof e||!!Array.isArray(e)&&e.every(function(e){return"string"==typeof e||"number"==typeof e||"boolean"==typeof e})})},v.prototype.inferComponentType=function(e,t){var t=this.inferTypeFromValue(e,t);return t.type?y({},t,{confidence:"high",method:"value-type"}):(t=this.matchFieldNamePattern(e)).type?y({},t,{confidence:"high",method:"name-pattern"}):{type:this.config.defaultTextType,confidence:"low",method:"fallback"}},v.prototype.inferTypeFromValue=function(e,t){return this.config.inferTypeFromValue?null==t?this.matchFieldNamePattern(e):"string"==typeof t?t.includes("@")&&t.includes(".")?{type:"textbox",textboxType:"email"}:/^(https?:\/\/)?(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}/.test(t)?{type:"textbox",textboxType:"url"}:/^\d{4}-\d{2}-\d{2}/.test(t)?{type:"date"}:"textbox"!==(e=this.matchFieldNamePattern(e)).type||e.textboxType?e:{type:this.config.defaultTextType}:"number"==typeof t?{type:"number"}:"boolean"==typeof t?{type:"checkbox"}:Array.isArray(t)?{type:"multiselect"}:{type:"textbox"}:{type:"textbox"}},v.prototype.matchFieldNamePattern=function(e){if(this.config.customTypeMap){var t=this.config.customTypeMap[e.toLowerCase()];if(t)return{type:t}}t=e.toLowerCase().replace(/[_\-\s]+/g," ");return/email|mail|e-?mail/.test(t)?{type:"textbox",textboxType:"email"}:/date|birth|birthday|dob|created|updated/.test(t)?{type:"date"}:/phone|tel|mobile|cell|cellphone|msisdn/.test(t)?{type:"textbox",textboxType:"number"}:/url|link|uri|website/.test(t)?{type:"textbox",textboxType:"url"}:/password|pwd|pass|security|secret|key|token/.test(t)?{type:"textbox",textboxType:"password"}:/\b(?:age|count|qty|quantity|amount|price|cost|salary|fee|rate|number|num)\b/.test(t)?{type:"number"}:/active|enabled|visible|deleted|archived|approved|confirmed/.test(t)?{type:"checkbox"}:/select|choice|option|type|status|category|kind/.test(t)?{type:"dropdown"}:/description|comment|note|bio|biography|about|message|content|summary|details/.test(t)?{type:"textarea"}:{type:"textbox"}},v.prototype.parseJsonSchema=function(e){var t=[],n=[];if(e.properties&&"object"==typeof e.properties)for(var i=this.flattenNestedProperties(e.properties,"",n),a=0,r=Object.keys(i);a<r.length;a++){var o=r[a],s=i[o],l=this.mapJsonSchemaType(s),d=-1!==(e.required||[]).indexOf(o);t.push(this.createComponent(o,s,l,{required:d}))}return{components:t,warnings:n}},v.prototype.flattenNestedProperties=function(e,t,n){for(var i={},a=!1,r=0,o=Object.keys(e);r<o.length;r++){var s,l=o[r],d=t?t+"_"+l:l;"object"===(c=e[l]).type&&c.properties&&"object"==typeof c.properties?(a=!0,s=this.flattenNestedProperties(c.properties,d,n),Object.assign(i,s)):i[d]=c}if(a&&!t){n.push("NESTED_OBJECTS_FLATTENED: Nested objects converted to flat structure");for(var c,u=0,p=Object.keys(e);u<p.length;u++)"object"===(c=e[l=p[u]]).type&&c.properties&&this.collectFlattenedFieldNames(c.properties,l,n)}return i},v.prototype.collectFlattenedFieldNames=function(e,t,n){for(var i=0,a=Object.keys(e);i<a.length;i++){var r=a[i],o=e[r],s=t+"_"+r;n.push("Field '"+t+"."+r+"' flattened to '"+s+"'"),"object"===o.type&&o.properties&&this.collectFlattenedFieldNames(o.properties,s,n)}},v.prototype.parseSurveyJS=function(e){var t=this,n=[];return e.pages&&Array.isArray(e.pages)&&e.pages.forEach(function(e){e.elements&&Array.isArray(e.elements)&&e.elements.forEach(function(e){n.push(t.createComponentFromSurveyJS(e))})}),!n.length&&e.elements&&Array.isArray(e.elements)&&e.elements.forEach(function(e){n.push(t.createComponentFromSurveyJS(e))}),n},v.prototype.createComponentFromSurveyJS=function(e){var t=this.mapSurveyJSType(e.type||"text"),n={},i=(!0===e.isRequired&&(n.required=!0),e.validators&&Array.isArray(e.validators)&&e.validators.forEach(function(e){"numeric"===e.type&&(void 0!==e.minValue&&(n.minValue=e.minValue),void 0!==e.maxValue)&&(n.maxValue=e.maxValue),"text"===e.type&&(void 0!==e.minLength&&(n.minLength=e.minLength),void 0!==e.maxLength)&&(n.maxLength=e.maxLength)}),y({id:this.generateComponentId(t),type:t,label:e.title||e.label||this.humanizeFieldName(e.name),defaultValue:e.defaultValue,expressionValue:e.expressionValue},0<Object.keys(n).length?n:void 0));return"dropdown"!==t&&"multiselect"!==t&&"radio"!==t&&"splitButton"!==t||e.choices&&Array.isArray(e.choices)&&(i.options=e.choices),i},v.prototype.mapSurveyJSType=function(e){return{text:"textbox",email:"email",number:"number",checkbox:"checkbox",radiogroup:"radio",dropdown:"dropdown",tagbox:"multiselect",multiselect:"multiselect",rating:"number",comment:"textarea",date:"date"}[e]||"textbox"},v.prototype.parseOpenAPI=function(e){var t=[];if(e.properties&&"object"==typeof e.properties)for(var n=Object.keys(e.properties),i=e.required||[],a=0,r=n;a<r.length;a++){var o=r[a],s=e.properties[o],l=this.mapJsonSchemaType(s),d=-1!==i.indexOf(o);t.push(this.createComponent(o,s,l,{required:d}))}return t},v.prototype.parseDataInference=function(e){for(var t=[],n=0,i=Object.keys(e);n<i.length;n++){var a=i[n],r=e[a],o=this.inferComponentType(a,r),a={id:this.generateComponentId(o.type),type:o.type,label:this.humanizeFieldName(a),defaultValue:r,expressionValue:void 0};o.textboxType&&(a.textboxType=o.textboxType,"email"===o.textboxType?a.regex=u.EMAIL:"url"===o.textboxType&&(a.regex=u.URL)),"date"===o.type&&null!=a.defaultValue&&(o=this.formatDateTimeValue(a.defaultValue))&&(a.defaultValue=o),Array.isArray(r)&&0<r.length&&(a.options=r),t.push(a)}return t},v.prototype.createComponent=function(e,t,n,i){var a={},i=(!0===(void 0!==t.required?t:i).required&&(a.required=!0),t.minLength&&(a.minLength=t.minLength),t.maxLength&&(a.maxLength=t.maxLength),t.minDate&&(a.minDate=t.minDate),t.maxDate&&(a.maxDate=t.maxDate),t.minTime&&(a.minTime=t.minTime),t.minValue&&(a.minValue=t.minValue),t.maxValue&&(a.maxValue=t.maxValue),t.pattern&&(a.pattern=t.pattern),t.id||this.generateComponentId(n.type)),r=(i=i,r="string"==typeof(r=this.generateComponentId(n.type))&&r?r:"field_"+Date.now()+"_"+Math.floor(1e3*Math.random()),null==i||!(i=String(i).trim())||"__proto__"===i||"prototype"===i||"constructor"===i||(i=i.replace(/[^A-Za-z0-9_-]/g,"_"),"__proto__"===(i=100<(i=/^[A-Za-z_]/.test(i)?i:"f_"+i).length?i.slice(0,100):i))||"prototype"===i||"constructor"===i?r:i),i=y({id:r,name:t.name,type:n.type,label:t.title||t.label||this.humanizeFieldName(e),defaultValue:t.default||t.defaultValue||void 0,expressionValue:t.expressionValue||void 0,content:t.content,buttonType:t.buttonType,textboxType:t.textboxType},0<Object.keys(a).length?a:void 0);return n.textboxType&&(i.textboxType=n.textboxType,"email"===n.textboxType?a.pattern||(a.regex="^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$",a.validationMessage="Please enter a valid email address"):"url"!==n.textboxType||a.pattern||(a.regex="^(https?:\\/\\/)?(www\\.)?[-a-zA-Z0-9@:%._\\+~#=]{1,256}\\.[a-zA-Z0-9()]{1,6}\\b([-a-zA-Z0-9()@:%_\\+.~#?&//=]*)$",a.validationMessage="Please enter a valid URL")),"date"===n.type&&void 0!==i.defaultValue&&null!==i.defaultValue&&(r=this.formatDateTimeValue(i.defaultValue))&&(i.defaultValue=r),"splitButton"!==n.type&&"dropdown"!==n.type&&"multiselect"!==n.type&&"radio"!==n.type||!t.enum&&!t.options||(i.options=t.enum||t.options),i},v.prototype.parseDateFromValue=function(e){if(null!=e){if("number"==typeof e)return e<1e12?new Date(1e3*e):new Date(e);if("string"==typeof e){var e=e.trim(),t=new Date(e);if(!isNaN(t.getTime()))return t;t=e.match(/^(\d{4})-(\d{2})-(\d{2})(?:[T ](\d{2}):(\d{2})(?::(\d{2}))?)?/);if(t)return new Date(Number(t[1]),Number(t[2])-1,Number(t[3]),Number(t[4]||0),Number(t[5]||0),Number(t[6]||0));t=e.match(/^(\d{1,2})\/(\d{1,2})\/(\d{4})(?:[ T](\d{1,2}):(\d{2})(?:[:](\d{2}))?)?/);if(t)return new Date(Number(t[3]),Number(t[1])-1,Number(t[2]),Number(t[4]||0),Number(t[5]||0),Number(t[6]||0))}}return null},v.prototype.formatDate=function(e){var t=e.getMonth()+1,n=e.getDate();return(t<10?"0"+t:String(t))+"/"+(n<10?"0"+n:String(n))+"/"+e.getFullYear()},v.prototype.formatDateTimeValue=function(e){var t,n=this.parseDateFromValue(e);if(n)return t=this.formatDate(n),0!==n.getHours()||0!==n.getMinutes()||/\dT\d{2}:\d{2}/.test(String(e))?""+t:t},v.prototype.mapJsonSchemaType=function(e){var t,n,i=e.type;return"string"===i?(t=(e.format||"").toString().toLowerCase(),n=((e.title||e.label||"")+" "+(e.description||"")).toLowerCase(),/email|mail|e-?mail/.test(t)||/email|mail|e-?mail/.test(n)?{type:"textbox",textboxType:"email"}:/uri|url|link|website/.test(t)||/uri|url|link|website/.test(n)?{type:"textbox",textboxType:"url"}:/phone|tel|mobile|cell|msisdn/.test(t)||/phone|tel|mobile|cell|msisdn/.test(n)?{type:"textbox",textboxType:"number"}:/password|pwd|pass|security|secret|key/.test(t)||/password|pwd|pass|security|secret|key/.test(n)?{type:"textbox",textboxType:"password"}:"date"===t||"date-time"===t||/date|birthday|dob/.test(n)?{type:"date"}:e.enum||e.options?{type:"dropdown"}:{type:this.config.defaultTextType}):"number"===i||"integer"===i?{type:"number"}:"boolean"===i?{type:"checkbox"}:"array"===i?{type:"multiselect"}:"message"===i?{type:"message"}:"button"===i?{type:"button"}:"signature"===i||"sign"===i?{type:"signature"}:"image"===i||"imageEditor"===i?{type:"imageEditor"}:"file"===i||"fileUpload"===i?{type:"fileUpload"}:"color"===i||"colorPicker"===i?{type:"colorPicker"}:"splitButton"===i?{type:"splitButton"}:{type:this.config.defaultTextType}},v.prototype.generateComponentId=function(e){return this.config.generateIds?e+"_"+Date.now()+"_"+Math.floor(1e3*Math.random()):""},v.prototype.humanizeFieldName=function(e){return e.replace(/_/g," ").replace(/([a-z])([A-Z])/g,"$1 $2")},v);function v(e){this.config=y({},oe,e)}var le=function(e){try{return JSON.parse(e),{valid:!0}}catch(e){return{valid:!1,errors:["Invalid JSON syntax: "+e.message]}}},de=function(e){var t,r,n=[],i=[];return e.components?Array.isArray(e.components)||n.push('Property "components" must be an array'):n.push("Missing required property: components"),Array.isArray(e.components)&&(t=new Set,r=function(e,a){void 0===a&&(a="root"),e.id?(t.has(e.id)&&n.push("Duplicate component ID found: "+e.id),t.add(e.id)):n.push("Component at "+a+' is missing "id" property'),e.type||n.push('Component "'+(e.id||"unknown")+'" is missing "type" property'),e.children&&Array.isArray(e.children)&&e.children.forEach(function(e,t){r(e,a+".children["+t+"]")}),e.tabItems&&Array.isArray(e.tabItems)&&e.tabItems.forEach(function(e,n){e.content&&Array.isArray(e.content)&&e.content.forEach(function(e,t){r(e,a+".tabItems["+n+"].content["+t+"]")})}),e.tableCells&&Array.isArray(e.tableCells)&&e.tableCells.forEach(function(e,i){Array.isArray(e)&&e.forEach(function(e,n){Array.isArray(e)&&e.forEach(function(e,t){r(e,a+".tableCells["+i+"]["+n+"]["+t+"]")})})})},e.components.forEach(function(e,t){r(e,"components["+t+"]")})),{valid:0===n.length,errors:0<n.length?n:void 0,warnings:0<i.length?i:void 0}},ce=function(e){function n(e){var t=y({},e,{_configured:!0});return e.children&&Array.isArray(e.children)&&(t.children=e.children.map(n)),e.tabItems&&Array.isArray(e.tabItems)&&(t.tabItems=e.tabItems.map(function(e){return y({},e,{content:e.content?e.content.map(n):[]})})),e.tableCells&&Array.isArray(e.tableCells)&&(t.tableCells=e.tableCells.map(function(e){return e.map(function(e){return Array.isArray(e)?e.map(n):[]})})),t}e={version:e.version||"0.1.0",components:e.components||[]};return e.components=e.components.map(n),e},ue=(g.prototype.resolveHtml=function(e){try{return this.enableHtmlSanitizer?_.SanitizeHtmlHelper.sanitize(e):e}catch(e){return""}},g.prototype.render=function(){var e=document.createElement("div");return this.id&&(e.id=this.id),e.innerHTML=this.resolveHtml(this.content),this.el=e},g.prototype.update=function(e){this.content=e,this.el&&(this.el.innerHTML=this.resolveHtml(this.content))},g.prototype.getElement=function(){return this.el},g.prototype.destroy=function(){this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el),this.el=null,this.content="",this.enableHtmlSanitizer=!1,this.id=void 0},g);function g(e){this.content=e.content,this.id=e.id,this.enableHtmlSanitizer=!!_.isNullOrUndefined(e.enableHtmlSanitizer)||e.enableHtmlSanitizer,this.el=e.target||null}b.getConstraints=function(e,t,n){var i,a,r=this;return void 0===n&&(n="number"),e&&0!==e.length?(i=e.find(function(e){return!1===e.enabled}))?(a=this.resolveValue(i.minValue,{}),i=this.resolveValue(i.maxValue,{}),"date"===n||"dateRange"===n?{minValue:void 0,maxValue:void 0,minDate:a,maxDate:i,minTime:void 0,maxTime:void 0}:"time"===n?{minValue:void 0,maxValue:void 0,minDate:void 0,maxDate:void 0,minTime:a,maxTime:i}:{minValue:a,maxValue:i,minDate:void 0,maxDate:void 0,minTime:void 0,maxTime:void 0}):0===(a=e.filter(function(e){return!0===e.enabled})).length||0===(i=a.map(function(e){return{min:r.resolveValue(e.minValue,t),max:r.resolveValue(e.maxValue,t)}}).filter(function(e){return void 0!==e.min||void 0!==e.max})).length?this.getEmptyConstraints(n):(e=this.getPermissiveMin(i,n),a=this.getPermissiveMax(i,n),"date"===n||"dateRange"===n?{minValue:void 0,maxValue:void 0,minDate:e,maxDate:a,minTime:void 0,maxTime:void 0}:"time"===n?{minValue:void 0,maxValue:void 0,minDate:void 0,maxDate:void 0,minTime:e,maxTime:a}:{minValue:e,maxValue:a,minDate:void 0,maxDate:void 0,minTime:void 0,maxTime:void 0}):this.getEmptyConstraints(n)},b.resolveValue=function(e,t){return"number"==typeof e||"string"==typeof e?e:e&&"object"==typeof e&&e.field&&void 0!==(t=t[e.field])?t:void 0},b.getPermissiveMin=function(e,t){var i=this;if(0!==e.length)return"date"===t||"dateRange"===t?e.reduce(function(e,t){var n;return t.min&&(!e||(n=i.convertToISO(e),i.convertToISO(t.min)<n))?t.min:e},void 0):"time"===t?e.reduce(function(e,t){var n;return t.min&&(!e||(n=i.convertTimeTo24Hour(e),i.convertTimeTo24Hour(t.min)<n))?t.min:e},void 0):0<(t=e.map(function(e){return e.min}).filter(function(e){return void 0!==e})).length?Math.min.apply(Math,t):void 0},b.getPermissiveMax=function(e,t){var n=this;if(0!==e.length)return"date"===t||"dateRange"===t?e.reduce(function(e,t){return t.max&&(!e||n.convertToISO(e)<n.convertToISO(t.max))?t.max:e},void 0):"time"===t?e.reduce(function(e,t){return t.max&&(!e||n.convertTimeTo24Hour(e)<n.convertTimeTo24Hour(t.max))?t.max:e},void 0):0<(t=e.map(function(e){return e.max}).filter(function(e){return void 0!==e})).length?Math.max.apply(Math,t):void 0},b.convertToISO=function(e){var t,n,i;return e?(!e.includes("-")||10!==e.length)&&-1!==e.indexOf("/")&&(t=(i=e.split("/"))[0],n=i[1],i=i[2],t)&&n&&i?i+"-"+(t.length<2?"0"+t:t)+"-"+(n.length<2?"0"+n:n):e:""},b.convertTimeTo24Hour=function(e){var t,n,i,a;return e?(a=/PM/i.test(e),((t=/AM/i.test(e))||a)&&(i=(n=e.replace(/\s*(AM|PM)/i,"").trim().split(":"))[0],n=n[1],i)&&n?(i=parseInt(i,10),a&&12!==i?i+=12:t&&12===i&&(i=0),((a=String(i)).length<2?"0"+a:a)+":"+n):e):""},b.getEmptyConstraints=function(e){return{minValue:void 0,maxValue:void 0,minDate:void 0,maxDate:void 0,minTime:void 0,maxTime:void 0}},b.validateValue=function(e,t,n){if(null!=e&&""!==e)if("date"===n||"dateRange"===n){if(t.minDate){var i=this.convertToISO(t.minDate);if(this.convertToISO(e)<i)return{isValid:!1,error:"Date must be on or after "+t.minDate}}if(t.maxDate)if(this.convertToISO(t.maxDate)<this.convertToISO(e))return{isValid:!1,error:"Date must be on or before "+t.maxDate}}else if("time"===n){if(t.minTime&&e<t.minTime)return{isValid:!1,error:"Time must be on or after "+t.minTime};if(t.maxTime&&e>t.maxTime)return{isValid:!1,error:"Time must be on or before "+t.maxTime}}else{i=Number(e);if(void 0!==t.minValue)if(i<Number(t.minValue))return{isValid:!1,error:"Value must be at least "+t.minValue};if(void 0!==t.maxValue)if(Number(t.maxValue)<i)return{isValid:!1,error:"Value must be at most "+t.maxValue}}return{isValid:!0}};var pe=b;function b(){}he=function(e,t){return(he=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])}))(e,t)};var he,x,me,fe=function(e,t){function n(){this.constructor=e}he(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)},k=function(){return(k=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e}).apply(this,arguments)},C=function(e,t,n,i){var a,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;0<=s;s--)(a=e[s])&&(o=(r<3?a(o):3<r?a(t,n,o):a(t,n))||o);return 3<r&&o&&Object.defineProperty(t,n,o),o},ye=["textbox","number","checkbox","dropdown","multiselect","date","dateTime","time","dateRange","switch","rating","colorPicker","inputMask","fileUpload"],ve={unsupportedComponent:"Unsupported Component type"},fe=(x=_.Component,fe(w,x),(me=w).prototype.getModuleName=function(){return"form-renderer"},w.prototype.getPersistData=function(){return this.addOnPersist(["formState",JSON.stringify(this.formState)])},w.prototype.preRender=function(){_.enableRipple(!0),this.createdFired=!1,this.expressionEngine=new a},w.prototype.render=function(){var i=this;if(this.clearEngineCaches(),this.removePreviousRoot(),this.normalizeSchema(),this.element.classList.add("form-renderer-container"),this.className&&_.addClass([this.element],this.className.replace(/\s+/g," ").trim().split(" ")),this.enableRtl?this.element.classList.add("e-rtl"):this.element.classList.remove("e-rtl"),this.hasLayoutComponentsCache=this.computeHasLayoutComponents(),this.idToLabelCache=this.computeIdToLabel(),this.initialValuesCache=this.buildInitialValues(),this.buildValidationRulesAndBridge(),this.isInitialized||(this.isInitialized=!0),this.formState&&this.initialValuesCache)for(var e=0,t=Object.keys(this.initialValuesCache);e<t.length;e++){var n=t[e],a=this.initialValuesCache[n];this.formState.values[n]||(this.formState.values[n]=a)}this.currentFormValues=k({},this.formState?this.formState.values:{}),this.initExpressionEngine(),this.buildConditionalDependencyMap();var r=_.createElement("form",{className:"form-renderer "+this.layoutClass,attrs:{role:"region","aria-label":this.processedSchemaCache.settings&&this.processedSchemaCache.settings.name||"Form"}});this.element.appendChild(r),this.inputRefs={},(this.processedSchemaCache.components||[]).forEach(function(e){var t,n=i.renderComponent(e);n&&r.appendChild(n),"richTextEditor"===e.type&&(t=n.querySelector(".e-richtexteditor"),_.getComponent(t,"richtexteditor").refreshUI()),"dataGrid"===e.type&&(t=n.querySelector(".e-control.e-toolbar"),_.getComponent(t,"toolbar").refresh())}),this.created&&!this.createdFired&&setTimeout(function(){0<Object.keys(i.inputRefs).length&&(i.createdFired=!0,i.trigger("created",{}))},0)},w.prototype.normalizeSchema=function(){var e=this.schema;try{if(e){var t,n=e;if("string"==typeof e)try{n=JSON.parse(e)}catch(e){return this.failure&&this.trigger("failure",{error:e}),void(this.processedSchemaCache={version:"1.0.0",components:[]})}n&&"object"==typeof n&&n.properties&&Array.isArray(n.layout)?this.processedSchemaCache=E(n):(t=(new se).parse("string"==typeof e?e:JSON.stringify(e))).success&&t.schema?this.processedSchemaCache=t.schema:(this.failure&&this.trigger("failure",{error:t.errors}),this.processedSchemaCache={version:"1.0.0",components:[]})}else this.processedSchemaCache={version:"1.0.0",components:[]}}catch(e){this.failure&&this.trigger("failure",{error:e}),this.processedSchemaCache={version:"1.0.0",components:[]}}},w.prototype.computeHasLayoutComponents=function(){var p;return!!this.processedSchemaCache.components&&(p=function(e){for(var t=0,n=e;t<n.length;t++){var i=n[t];if(-1!==["table","tabs","panel","card"].indexOf(i.type))return!0;if(i.children&&p(i.children))return!0;if(i.tableCells)for(var a=0,r=i.tableCells;a<r.length;a++)for(var o=0,s=r[a];o<s.length;o++){var l=s[o];if(p(l))return!0}if(i.tabItems)for(var d=0,c=i.tabItems;d<c.length;d++){var u=c[d];if(u.content&&p(u.content))return!0}}return!1})(this.processedSchemaCache.components)},Object.defineProperty(w.prototype,"layoutClass",{get:function(){if(this.hasLayoutComponentsCache)return"";switch(this.layout){case"TwoColumn":return"twolayout";case"ThreeColumn":return"threelayout";case"FourColumn":return"fourlayout";default:return""}},enumerable:!0,configurable:!0}),w.prototype.collectAllComponents=function(e){function t(e){e.forEach(function(e){n.push(e),e.children&&0<e.children.length&&t(e.children),e.tableCells&&e.tableCells.forEach(function(e){e.forEach(t)}),e.tabItems&&e.tabItems.forEach(function(e){e.content&&t(e.content)})})}var n=[];return t(e),n},w.prototype.computeIdToLabel=function(){function t(e){e.forEach(function(e){e.label&&-1===["panel","table","tabs","card","button","message","splitButton"].indexOf(e.type)&&(e.name?n[e.id]=e.name:e.label&&(n[e.id]=e.label)),e.children&&t(e.children),e.tableCells&&e.tableCells.forEach(function(e){return e.forEach(t)}),e.tabItems&&e.tabItems.forEach(function(e){e.content&&t(e.content)})})}var n={};return t(this.processedSchemaCache.components),n},w.prototype.buildValidationRulesAndBridge=function(){function s(e,o){void 0===o&&(o=!0),e.forEach(function(p){var e,t,n,h,i,a,r,m;p&&(e={},t=o&&!1!==p.visible&&$.isFieldVisible(p.conditions,c),n=o&&$.isFieldHidden(p.conditions,c),t)&&!n&&(i=$.isFieldRequired(p.conditions,c),a=$.isFieldDisabled(p.conditions,c),r=$.isFieldReadOnly(p.conditions,c),h=!!p.required||i,i=!!p.disabled||a,a=!!p.readOnly||r,p.customValidation&&Array.isArray(p.customValidation)&&0<p.customValidation.length&&!i&&!a&&(r=((r=p.customValidation&&p.customValidation[0]&&p.customValidation[0].expression)&&r.match(/\?\s*true\s*:\s*['"](.+?)['"]/)?r.match(/\?\s*true\s*:\s*['"](.+?)['"]/)[1]:void 0)||p.validationMessage||(p.label||p.id)+" is invalid",m=l,e.customValidation=[function(e){var t=e.value;if(!h||""!==t&&null!=t){for(var n={},i=(m.collectAllComponents(m.processedSchemaCache.components).forEach(function(e){e.name&&(n[e.id]=e.name)}),k({},m.currentFormValues||{})),a=0,r=Object.keys(k({},i));a<r.length;a++){var o=r[a],s=i[o],l=n[o];l&&(i[l]=s,delete i[o])}for(var d=0,c=p.customValidation;d<c.length;d++){var u=c[d];if(!m.customValidationEngine)return!0;if(!0!==m.customValidationEngine.validate(u.expression,t,i))return!1}}return!0},r]),!h||i||a||(e.required=[!0,p.validationMessage||p.label+" is required"]),!p.minLength||i||a||(e.minLength=[p.minLength,"Minimum "+p.minLength+" characters allowed"]),!p.maxLength||i||a||(e.maxLength=[p.maxLength,"Maximum "+p.maxLength+" characters allowed"]),"textbox"!==p.type||!p.textboxType||p.regex||e.regex||i||a||("email"===p.textboxType?e.regex=[u.EMAIL,p.validationMessage||"Invalid format"]:"url"===p.textboxType&&(e.regex=[u.URL,p.validationMessage||"Invalid format"])),!p.regex||i||a||(e.regex=[p.regex,p.validationMessage||"Invalid format"]),0<Object.keys(e).length&&(d[p.id]=e),p.children&&s(p.children,t&&!n),p.tableCells&&p.tableCells.forEach(function(e){return e.forEach(function(e){return s(e,t&&!n)})}),p.tabItems)&&p.tabItems.forEach(function(e){e.content&&s(e.content,t&&!n)})})}var l=this,d={},c=this.formState&&this.formState.values||{},n=(s(this.processedSchemaCache.components),this.formState?k({},this.formState.values):k({},this.initialValuesCache));if(this.formState={values:Object.assign(Object.create(null),this.initialValuesCache,n),errors:this.enablePersistence?this.formState.errors:Object.create(null)},n&&Object.keys(n).forEach(function(e){e in l.formState.values||(l.formState.values[e]=n[e])}),this.validator){try{this.validator.refresh(),this.validator.destroy()}catch(e){}this.validator=null}var i=this;this.validator=new z.FormValidator(this.element,{rules:d,locale:this.locale,ignore:"e-hidden",errorClass:"e-error",validClass:"e-valid",errorElement:"div",errorContainer:"div",customPlacement:function(e,t){var n=e.getAttribute("name");if(n){var i=document.getElementById("error-"+n);if(i){for(;i.firstChild;)i.removeChild(i.firstChild);i.appendChild(t),i.style.display="block"}else e.parentElement&&e.parentElement.appendChild(t)}else e.parentElement&&e.parentElement.appendChild(t)},validationComplete:function(e){if(i.syncFormStateErrors(),e&&e.inputName){var t=document.getElementById("error-"+e.inputName);if(t)if("success"===e.status){for(;t.firstChild;)t.removeChild(t.firstChild);t.style.display="none"}else"failure"===e.status&&(t.style.display="block")}},submit:function(e){i.validator&&(i.validator.validate()&&i.handleSubmitData(k({},i.formState.values)),e)&&"function"==typeof e.preventDefault&&e.preventDefault()},reset:function(){}}),n&&Object.keys(n).forEach(function(e){var t=l.validator.getInputElement(e);if(t&&void 0!==n[e]&&null!==n[e])try{t.value=String(n[e])}catch(e){}})},w.prototype.syncFormStateErrors=function(){var e={};if(this.validator)for(var t=0,n=this.validator.errorRules||[];t<n.length;t++){var i=n[t];i&&i.name&&(e[i.name]=i.message)}this.formState.errors=e},w.prototype.buildInitialValues=function(){var t=this,n={},e=this.collectAllComponents(this.processedSchemaCache.components),i=new Set;return e.forEach(function(e){if("staticHtml"!==e.type)if("dataGrid"===e.type&&(n[e.id]=Array.isArray(e.dataSource)?e.dataSource:[]),void 0!==e.defaultValue)n[e.id]=e.defaultValue;else switch(e.type){case"checkbox":case"switch":n[e.id]=!1}i.add(e.id)}),this.formState&&Object.keys(this.formState.values).filter(function(e){return!i.has(e)}).forEach(function(e){delete t.formState.values[e]}),n},w.prototype.initExpressionEngine=function(){if(this.processedSchemaCache.components&&0!==this.processedSchemaCache.components.length)try{var e=this.expressionEngine,t=this.collectAllComponents(this.processedSchemaCache.components),n=e.buildDependencyGraph(t),i=(e.detectCircularDependencies(n).length,this.expressionDependencyGraph=n,new Set);t.forEach(function(e){e.expressionValue&&i.add(e.id)}),this.computedFieldNames=i}catch(e){this.failure&&this.trigger("failure",{error:e})}},w.prototype.disposeTooltipInstance=function(e){var t=this.tooltipRefs[e]||null;if(t){try{t.destroy()}catch(e){this.trigger("failure",{error:e})}this.renderedInstances=this.renderedInstances.filter(function(e){return e!==t}),this.tooltipRefs[e]=null}},w.prototype.renderField=function(r){var o=this,s=this.formState,e=s?s.values:{};if(-1!==["panel","table","tabs","card","message","button","splitButton","staticHtml"].indexOf(r.type))return null;var t=$.isFieldReadOnly(r.conditions,e),n=$.isFieldDisabled(r.conditions,e),i=$.isFieldRequired(r.conditions,e),a=$.getConditionalValue(r.conditions,e),t=!!r.readOnly||t,n=!!r.disabled||n,i=!!r.required||i,l=pe.getConstraints(r.minMaxRange,e,r.type),d=("dateTime"===r.type&&(d=pe.getConstraints(r.minMaxRange,e,"date"),e=pe.getConstraints(r.minMaxTimeRange,e,"time"),l={minValue:void 0,maxValue:void 0,minDate:d.minDate,maxDate:d.maxDate,minTime:e.minTime,maxTime:e.maxTime}),r.labelPosition||"top"),e=r.labelWidth||"auto",c=!r.hideLabel&&!!r.label&&-1===["checkbox","button","staticHtml"].indexOf(r.type),u=!(!s||!s.errors[r.id]),p=u&&!(!s||-1===s.errors[r.id].indexOf("required")),u=u&&!(p&&!i),p=void 0!==a,h=this.conditionalValueApplied[r.id]||!1,a=(s&&(p&&!h?(s.values[r.id]=a,this.conditionalValueApplied[r.id]=!0):!p&&h&&(this.conditionalValueApplied[r.id]=!1)),_.createElement("div",{className:"form-group",attrs:{"data-field-id":r.id,"data-fr-field":r.id}})),p=_.createElement("div",{className:"field-wrapper label-"+d.toLowerCase()}),d=(c&&(h=_.createElement("label",{className:"field-label"}),-1===ye.indexOf(r.type)&&"textarea"!==r.type||h.setAttribute("for",_.isNullOrUndefined(this.element.id)?r.name:this.element.id+"-"+r.name),h.style.width="left"===d.toLowerCase()?e+"%":"auto",(c=_.createElement("span")).textContent=r.label,h.appendChild(c),i&&((d=_.createElement("span",{className:"required-asterisk"})).textContent="*",h.appendChild(d)),this.disposeTooltipInstance(r.id),r.tooltip&&((e=_.createElement("span",{className:"e-msg-icon e-icons e-circle-info tooltip-icon",attrs:{"aria-label":r.tooltip,title:r.tooltip,tabindex:"0",role:"button","aria-haspopup":"true"}})).style.cursor="pointer",e.style.display="flex",e.style.alignItems="center",e.style.justifyContent="center",e.style.flexShrink="0",h.appendChild(e),(c=new S.Tooltip({content:r.tooltip,enableRtl:this.enableRtl})).appendTo(e),this.tooltipRefs[r.id]=c,this.renderedInstances.push(c)),p.appendChild(h)),_.createElement("div",{className:"field-input"})),e=("radio"===r.type||"checkboxGroup"===r.type)&&Array.isArray(r.options)?function(e,t){e&&"number"==typeof t&&(o.inputRefs[r.name+"_"+t]=e)}:function(e){e&&(o.inputRefs[r.name]=e)},c=k({},r,{readOnly:t,disabled:n,required:i},void 0!==l.minValue&&{minValue:l.minValue},void 0!==l.maxValue&&{maxValue:l.maxValue},void 0!==l.minDate&&{minDate:l.minDate},void 0!==l.maxDate&&{maxDate:l.maxDate},void 0!==l.minTime&&{minTime:l.minTime},void 0!==l.maxTime&&{maxTime:l.maxTime}),h=-1!==ye.indexOf(r.type)?"input":"textarea"===r.type?"textarea":"div",t=_.createElement(h,{attrs:{"aria-label":r.label+" "+r.type}}),m=("radio"===r.type||"checkboxGroup"===r.type?((n=_.createElement("input")).id=_.isNullOrUndefined(this.element.id)?r.name:this.element.id+"-"+r.name,n.setAttribute("name",r.id),n.style.display="none",n.setAttribute("aria-hidden","true"),t.appendChild(n)):(t.id=_.isNullOrUndefined(this.element.id)?r.name:this.element.id+"-"+r.name,t.setAttribute("name",r.id)),d.appendChild(t),R({component:c,value:s?s.values[r.id]:void 0,onChange:function(e){var t,n,i,a;"staticHtml"!==r.type&&("signature"===r.type&&(e=o.inputRefs[e].getSignature()),"imageEditor"===r.type&&(n=o.inputRefs[e].getImageData(),(i=document.createElement("canvas")).width=n.width,i.height=n.height,(t=i.getContext("2d"))&&t.putImageData(n,0,0),e=i.toDataURL()),"radio"!==r.type&&"checkboxGroup"!==r.type||(o.validator.getInputElement(r.id).value=e),t=r,n=e,i=new _.Internationalization,a=i.getDateFormat({format:"MM/dd/yyyy",type:"date"}),"date"===t.type&&(n=a(new Date(n))),"time"===t.type&&(n=(a=i.getDateFormat({format:"hh:mm a",type:"time"}))(new Date(n))),"dateTime"===t.type&&(n=(a=i.getDateFormat({format:"MM/dd/yyyy hh:mm a",type:"dateTime"}))(new Date(n))),e=n="dateRange"===t.type&&Array.isArray(n)?n.map(function(e){return e?a(new Date(e)):null}):n,o.formState&&s&&(o.formState.values[r.id]=e,s.values[r.id]=e),o.trigger("change",{fieldName:r.name,label:r.label||r.id,value:e}),o.afterValueChange(r.id))},formState:s,settings:this.processedSchemaCache.settings,onBlur:function(){if(s&&"staticHtml"!==r.type&&o.validator){try{o.beforeValidate(r.id),o.validator.validate(r.id)}catch(e){}o.syncFormStateErrors()}},ref:e,hasError:u,locale:this.locale,components:this.collectAllComponents(this.processedSchemaCache.components),enableRtl:this.enableRtl,target:t,l10n:this.l10n}));if(Array.isArray(m))m.forEach(function(e){if(e&&"function"==typeof e.destroy)o.renderedInstances.push(e);else if(e instanceof HTMLElement)for(var t=0,n=Object.keys(o.inputRefs);t<n.length;t++){var i=n[t],i=o.inputRefs[i],a=i&&(i.element||i.target||i.hostElement&&i.hostElement());a&&(a===e||e.contains(a))&&o.renderedInstances.push(i)}});else if(m)if("function"==typeof m.destroy)this.renderedInstances.push(m);else if(m instanceof HTMLElement)for(var f=0,y=Object.keys(this.inputRefs);f<y.length;f++){var v=y[f],v=this.inputRefs[v],g=v&&(v.element||v.target||v.hostElement&&v.hostElement());g&&(g===m||m.contains(g))&&this.renderedInstances.push(v)}i=_.createElement("div",{id:"error-"+(r.id||r.name||r.label),className:"e-error-message",attrs:{role:"alert","aria-live":"assertive"}});return i.style.display="none",u&&s&&s.errors[r.id]&&(i.textContent=s.errors[r.id],i.classList.add("e-error"),i.style.display="block"),d.appendChild(i),p.appendChild(d),a.appendChild(p),r.description&&((l=_.createElement("div",{className:"field-description",attrs:{"aria-describedby":"description-"+r.label}})).textContent=r.description,a.appendChild(l)),a},w.prototype.renderComponent=function(s){var n,i,a,l=this,e=this.formState,t=e?e.values:{},r=!1!==s.visible&&$.isFieldVisible(s.conditions,t),o=$.isFieldHidden(s.conditions,t);if(!r||o)return e&&void 0!==e.values[s.id]&&null!==e.values[s.id]&&(e.values[s.id]=null),null;if(me.PRESERVABLE_TYPES.has(s.type)&&this.preservedFields.has(s.id)){r=this.preservedFields.get(s.id);if(r)return this.preservedFields.delete(s.id),r}switch(s.type){case"panel":(I=_.createElement("fieldset",{className:"form-panel-renderer "+(s.cssClass||"")})).style.minInlineSize="unset",s.label&&!s.hideLabel&&((d=_.createElement("legend",{className:s.hideBorders?"":"panel-legend"})).textContent=s.label,I.appendChild(d));var d,c=_.createElement("div",{className:"panel-content"});return(s.children||[]).forEach(function(e){e=l.renderComponent(e);e&&c.appendChild(e)}),I.appendChild(c),I;case"table":for(var u=s.rows||(s.tableCells?s.tableCells.length:2),p=s.columns||(s.tableCells&&s.tableCells[0]?s.tableCells[0].length:2),h=Math.floor(12/p),m=s.columnWidths,f=m?(d=m.widths,d=(a=d.map(function(e){return null===e?NaN:Number(e)})).reduce(function(e,t){return e+(isNaN(t)?0:t)},0),d=Math.max(0,Math.round(100-d)),C=a.map(function(e,t){return isNaN(e)?t:-1}).filter(function(e){return 0<=e}),0===(x=C.length)?a.map(function(e){return Math.round(e)}):(n=Math.floor(d/x),i=d-n*x,C.forEach(function(e){var t=0<i?n+1:n;a[e]=t,i=Math.max(0,i-1)}),a.map(function(e){return isNaN(e)?0:Math.round(e)}))):[],y=_.createElement("div",{className:"form-table-renderer "+(s.hideBorders?"":"table-border")+" "+(s.cssClass||""),attrs:{role:"group","aria-label":s.label||"Table Layout"}}),v=0;v<u;v++){for(var g=_.createElement("div",{className:"e-form-table-row"}),b=(s.hideBorders&&(g.style.display="flex",g.style.gap="1.5rem"),0);b<p;b++)!function(e){var t=s.tableCells&&s.tableCells[v]&&s.tableCells[v][e]||[],n=h,e=f[e],i=1===p?{width:"100%"}:e?{width:e+"%"}:{},a=!m||Array.isArray(m.widths)&&m.widths.every(function(e){return null===e}),r=0===v,o=_.createElement("div",{className:"e-form-table-cell "+(!e&&a?"col-"+n:"")});s.hideBorders?Object.assign(o.style,i,{padding:r?"0":"12px 0 0 0"}):Object.assign(o.style,i),t.forEach(function(e){e=l.renderComponent(e);e&&o.appendChild(e)}),g.appendChild(o)}(b);y.appendChild(g)}return y;case"tabs":var x=_.createElement("div",{className:"form-tabs-renderer "+(s.cssClass||"")}),C=_.createElement("div",{className:"e-tab"}),w=(C.id=s.id,_.createElement("div",{className:"e-tab-header"})),S=_.createElement("div",{className:"e-content"}),E=(C.appendChild(w),C.appendChild(S),x.appendChild(C),(s.tabItems||[]).forEach(function(e){var t=_.createElement("div"),t=(t.textContent=e.header,w.appendChild(t),_.createElement("div")),n=_.createElement("div",{className:"tab-content-renderer"});(e.content||[]).forEach(function(e){e=l.renderComponent(e);e&&n.appendChild(e)}),t.appendChild(n),S.appendChild(t)}),new N.Tab({enableRtl:this.enableRtl,cssClass:s.cssClass,enablePersistence:!0,animation:{previous:{effect:"None"},next:{effect:"None"}},selected:function(e){if("undefined"==typeof window)return null;try{window.localStorage.setItem("tab"+s.id,JSON.stringify({selectedItem:e.selectedIndex}))}catch(e){}}}));return E.appendTo(C),this.renderedInstances.push(E),x;case"card":(I=_.createElement("fieldset",{className:"e-card form-card-renderer "+(s.cssClass||"")})).style.minInlineSize="unset",I.style.padding="0";var E=_.createElement("div",{className:"e-card-header"}),T=_.createElement("div",{className:"e-card-header-caption"}),A=_.createElement("div",{className:"e-card-title"}),D=(A.textContent=s.cardTitle||s.label||"Card Title",T.appendChild(A),s.cardSubtitle&&((A=_.createElement("div",{className:"e-card-sub-title"})).textContent=s.cardSubtitle,T.appendChild(A)),E.appendChild(T),I.appendChild(E),_.createElement("div",{className:"e-card-content card-content"}));return(s.children||[]).forEach(function(e){e=l.renderComponent(e);e&&D.appendChild(e)}),I.appendChild(D),I;case"staticHtml":A=new ue({content:s.defaultValue||"<p>HTML content</p>",id:s.id,enableHtmlSanitizer:s.enableHtmlSanitizer}),T=A.render();return this.renderedInstances.push(A),T;case"message":var V=_.createElement("div",{className:"form-group"}),O=((F=_.createElement("div")).id=s.name,F.setAttribute("name",s.id),V.appendChild(F),R({component:s,locale:this.locale,value:void 0,onChange:function(){},enableRtl:this.enableRtl,target:F,ref:function(e,t){void 0!==t?l.inputRefs[s.name+"_"+t]=e:l.inputRefs[s.name]=e}}));return Array.isArray(O)?O.forEach(function(e){e&&l.renderedInstances.push(e)}):O&&this.renderedInstances.push(O),V;case"button":var E=$.isFieldDisabled(s.conditions,t),I=!!s.disabled||E,V=_.createElement("div",{className:"form-group"}),O=((F=_.createElement("div")).id=s.name,F.setAttribute("name",s.id),V.appendChild(F),R({component:k({},s,{disabled:I}),value:void 0,onChange:function(){},locale:this.locale,onClick:function(e){l.buttonClick&&(t=s.buttonsGroups?e.target&&e.target.ej2_instances?e.target.ej2_instances[0].content:"":s.label||"",l.trigger("buttonClick",{fieldName:s.name,label:t,event:e}));var t=e.target;t.type&&"reset"===t.type&&((e=t.closest("form"))&&e.querySelectorAll('input[type="checkbox"]').forEach(function(e){e.ej2_instances[0].checked=!1}),l.formState.values={},e.reset(),l.rerenderForm(),l.validator.destroy())},ref:function(e,t){void 0!==t?l.inputRefs[s.name+"_"+t]=e:l.inputRefs[s.name]=e},enableRtl:this.enableRtl,target:F}));return Array.isArray(O)?O.forEach(function(e){e&&l.renderedInstances.push(e)}):O&&this.renderedInstances.push(O),V;case"splitButton":var F,A=$.isFieldDisabled(s.conditions,t),T=!!s.disabled||A,V=_.createElement("div",{className:"form-group"}),O=((F=_.createElement("div")).id=s.name,F.setAttribute("name",s.id),V.appendChild(F),R({component:k({},s,{disabled:T}),value:void 0,locale:this.locale,onChange:function(){},onClick:function(e){l.buttonClick&&l.trigger("buttonClick",{fieldName:s.name,label:s.label||"",event:e})},ref:function(e){e&&(l.inputRefs[s.name]=e)},enableRtl:this.enableRtl,target:F}));return Array.isArray(O)?O.forEach(function(e){e&&l.renderedInstances.push(e)}):O&&this.renderedInstances.push(O),V;default:return this.renderField(s)}},w.prototype.afterValueChange=function(e){this.formState&&(this.currentFormValues=k({},this.formState.values),this.evaluateExpressions(),this.retriggerCustomValidation(),this.beforeValidate(e),this.validator.validate(e),this.syncFormStateErrors(),e)&&this.isConditionalTrigger(e)&&this.scheduleRerender(e)},w.prototype.beforeValidate=function(e){var t=this.element.querySelector("#"+e+"-info"),t=(t&&t.classList.contains("e-error")&&t.classList.remove("e-error"),this.getInputElementByName(e)),e=t.parentElement,n=e.parentElement;(e.classList.contains("e-control-wrapper")||e.classList.contains("e-wrapper")||t.classList.contains("e-input")&&e.classList.contains("e-input-group")?e:null!=n&&(n.classList.contains("e-control-wrapper")||n.classList.contains("e-wrapper"))?n:t).classList.remove("e-error"),this.validator&&(this.validator.errorRules=[])},w.prototype.scheduleRerender=function(e){var t=this;e&&this.pendingChangedFieldIds.add(e),this.rerenderScheduled||(this.rerenderScheduled=!0,Promise.resolve().then(function(){t.rerenderScheduled=!1;var e=new Set(t.pendingChangedFieldIds);t.pendingChangedFieldIds.clear(),t.rerenderForm(e)}))},w.prototype.collectConditionFieldIds=function(e,t){if(e)if("string"==typeof e.field)t.add(e.field);else if(Array.isArray(e.rules))for(var n=0,i=e.rules;n<i.length;n++){var a=i[n];this.collectConditionFieldIds(a,t)}},w.prototype.collectDataSourceReferenceIds=function(e,n,i){if("string"==typeof e){e=e.match(/\{([^}]+)\}/g);if(e)for(var t=0,a=e;t<a.length;t++)!function(e){var t=e.slice(1,-1),e=n.find(function(e){return e.name===t});e&&e.id&&i.add(e.id)}(a[t])}},w.prototype.buildConditionalDependencyMap=function(){for(var e=new Set,t=new Map,n=this.collectAllComponents(this.processedSchemaCache.components),i=0,a=n;i<a.length;i++){var r=a[i],o=new Set,s=(t.set(r.id,o),r.conditions);if(s){for(var l=0,d=["visibleWhen","hideWhen","disabledWhen","requiredWhen","readOnlyWhen","choiceBasedField","conditionalData"];l<d.length;l++){var c=d[l];s[c]&&(this.collectConditionFieldIds(s[c],e),this.collectConditionFieldIds(s[c],o))}if(Array.isArray(s.conditionalData))for(var u=0,p=s.conditionalData;u<p.length;u++){var h=p[u];if(h&&h.condition&&(this.collectConditionFieldIds(h.condition,e),this.collectConditionFieldIds(h.condition,o)),h&&Array.isArray(h.conditions))for(var m=0,f=h.conditions;m<f.length;m++){var y=f[m];this.collectConditionFieldIds(y,e),this.collectConditionFieldIds(y,o)}}s.setValueWhen&&s.setValueWhen.condition&&(this.collectConditionFieldIds(s.setValueWhen.condition,e),this.collectConditionFieldIds(s.setValueWhen.condition,o)),s.choiceBasedField&&"string"==typeof s.choiceBasedField.primaryFieldId&&(e.add(s.choiceBasedField.primaryFieldId),o.add(s.choiceBasedField.primaryFieldId))}var v=r.dataSource;if("dataGrid"===r.type&&v&&"url"===v.type&&(v.search&&"string"==typeof v.search.key&&(this.collectDataSourceReferenceIds(v.search.key,n,e),this.collectDataSourceReferenceIds(v.search.key,n,o)),Array.isArray(v.filters)))for(var g=0,b=v.filters;g<b.length;g++){var x=b[g];"string"==typeof x.value&&(this.collectDataSourceReferenceIds(x.value,n,e),this.collectDataSourceReferenceIds(x.value,n,o))}}this.conditionalTriggerFieldIds=e,this.consumerDependencyMap=t},w.prototype.isConditionalTrigger=function(e){return this.conditionalTriggerFieldIds.has(e)},w.prototype.rerenderForm=function(e){var n=this,a=e||new Set,e=document.activeElement,t=e&&e.getAttribute?e.getAttribute("name"):null,i=null,r=null;if(t&&e&&void 0!==e.selectionStart)try{i=e.selectionStart,r=e.selectionEnd}catch(e){}for(var o,e=this.element.scrollTop,s=this.element.scrollLeft,l=window.scrollX,d=window.scrollY,c=(this.preservedFields.clear(),this.collectAllComponents(this.processedSchemaCache.components)),u=this,p=0,h=c;p<h.length;p++)!function(e){var t,n,i;!me.PRESERVABLE_TYPES.has(e.type)||(t=u.consumerDependencyMap.get(e.id),n=!1,t&&a.forEach(function(e){t.has(e)&&(n=!0)}),n)||(i=u.element.querySelector('[data-field-id="'+e.id+'"]'))&&i.parentElement&&(i.parentElement.removeChild(i),u.preservedFields.set(e.id,i))}(h[p]);this.refreshing=!0,this.destroyRenderedExcludingPreserved(),this.removePreviousRoot(),this.validator&&this.validator.destroy(),this.render(),this.refreshing=!1;try{this.element.scrollTop=e,this.element.scrollLeft=s,window.scrollTo(l,d)}catch(e){}if(t){c=this.getInputElementByName(t);if(c&&"function"==typeof c.focus)try{if(c.focus(),null!==i&&null!==r&&"function"==typeof c.setSelectionRange)try{c.setSelectionRange(i,r)}catch(e){}}catch(e){}}0<this.preservedFields.size&&(o=[],this.preservedFields.forEach(function(e,t){if(n.element.contains(e)||document.body.contains(e))o.push(t);else{n.destroyPreservedSubtree(e);try{e.parentNode&&e.parentNode.removeChild(e)}catch(e){}n.preservedFields.delete(t)}}),o.forEach(function(e){return n.preservedFields.delete(e)}))},w.prototype.removePreviousRoot=function(){if(this.element)for(;0<this.element.childNodes.length;)this.element.removeChild(this.element.firstChild)},w.prototype.destroyRenderedInstance=function(e){if(e&&"function"==typeof e.destroy){var t=e;if(!(t.isDestroyed||t.destroyed||t.disposed)){var n=e.element||e.target||(e.hostElement&&"function"==typeof e.hostElement?e.hostElement():void 0);try{t.isDestroyed=!0,t.destroyed=!0,t.disposed=!0,e.destroy()}catch(e){console.warn("FormRenderer: failed to destroy child instance.",e)}finally{if(n&&n.parentNode)try{n.parentNode.removeChild(n)}catch(e){}}}}},w.prototype.destroyRenderedExcludingPreserved=function(){for(var n=[],i=Array.from(this.preservedFields.values()),a=this,e=0,t=this.renderedInstances;e<t.length;e++)!function(e){var t=e&&(e.element||e.target||e.hostElement&&e.hostElement());!!t&&i.some(function(e){return e===t||e.contains(t)})?n.push(e):a.destroyRenderedInstance(e)}(t[e]);this.renderedInstances=n;for(var r=Object.keys(this.inputRefs),o=this,s=0,l=r;s<l.length;s++)!function(e){var t=o.inputRefs[e],n=t&&(t.element||t.target||t.hostElement&&t.hostElement());!!n&&i.some(function(e){return e===n||e.contains(n)})||delete o.inputRefs[e]}(l[s]);this.conditionalValueApplied={},this.expressionDependencyGraph={},this.computedFieldNames=new Set,this.previousFormValues={},this.conditionalTriggerFieldIds=new Set},w.prototype.destroyPreservedSubtree=function(e){for(var t=[],n=0,i=this.renderedInstances;n<i.length;n++){var a=i[n],r=a&&(a.element||a.target||a.hostElement&&a.hostElement());r&&(r===e||e.contains(r))?this.destroyRenderedInstance(a):t.push(a)}this.renderedInstances=t},w.prototype.getInputElementByName=function(e){e=this.element.querySelector('[name="'+e+'"]');if(!e)return null;if(!e.classList.contains("e-control")){var t=e.parentElement?e.parentElement.querySelector(".e-control"):null;if(t)return t}return e},w.prototype.evaluateExpressions=function(){if(this.formState&&this.expressionEngine&&!this.expressionEvaluationInProgress)try{this.expressionEvaluationInProgress=!0;for(var p=this.expressionEngine,e=this.expressionDependencyGraph,h=this.formState.values||{},m=this.collectAllComponents(this.processedSchemaCache.components),t=this.previousFormValues,f=this.computedFieldNames,y={},n=(m.forEach(function(e){e.name&&(y[e.id]=e.name)}),{}),i=Object.keys(h),a=0,r=i;a<r.length;a++){var o=r[a],s=h[o];(g=y[o])&&(n[g]=s)}for(var l=k({},t),d=(Object.assign(t,n),new Set),c=Object.keys(n),u=0,v=c;u<v.length;u++)!function(t){var e=Object.keys(y).find(function(e){return y[e]===t});e&&n[t]!==l[t]&&!f.has(e)&&d.add(t)}(g=v[u]);if(0!==d.size){for(var g,b=p.getTopologicalOrder(e),x=this,C=0,w=b;C<w.length;C++)!function(t){var e=m.find(function(e){return e.name===t});if(e&&e.expressionValue){f.add(e.id);try{if(!1!==e.visible&&$.isFieldVisible(e.conditions,h)){for(var n={},i=Object.keys(h),a=0,r=i;a<r.length;a++){var o=r[a],s=h[o],l=y[o];l&&(n[l]=s)}if(null!=(c="string"==typeof(c=p.evaluate(e.expressionValue,n))&&-1!==c.indexOf("undefined")?c.replace(/undefined/g,""):c)&&""!==c)switch(e.type){case"number":var d=Number(c),c=isNaN(d)?0:d;break;case"checkbox":case"switch":c=Boolean(c);break;case"textbox":case"textarea":c=String(c);break;case"dateRange":case"checkboxGroup":case"multiselect":break;default:c=String(c)}if(null!=c&&c!==h[e.id]&&x.formState&&(x.formState.values[e.id]=c,x.validator)){var u=x.getInputElementByName(e.id);if(u)try{u.ej2_instances[0]?u.ej2_instances[0].value=c:u.value=String(c)}catch(e){}}}}catch(e){x.failure&&x.trigger("failure",{error:e})}}}(g=w[C]);Object.assign(t,n)}}finally{this.expressionEvaluationInProgress=!1}},w.prototype.retriggerCustomValidation=function(){var t=this;if(this.formState&&this.customValidationEngine)try{var i,a=this.collectAllComponents(this.processedSchemaCache.components),n=this.formState.values||{},r=this.previousFormValues,o=new Set;Object.keys(n).forEach(function(e){n[e]!==r[e]&&o.add(e)}),0!==o.size&&(i=new Set,o.forEach(function(t){var e=a.find(function(e){return e.id===t});e&&e.customValidation&&Array.isArray(e.customValidation)&&i.add(t)}),a.forEach(function(n){n.customValidation&&Array.isArray(n.customValidation)&&n.customValidation.forEach(function(e){t.customValidationEngine.extractDependencies(e.expression).forEach(function(t){var e=a.find(function(e){return e.id===t||e.name===t});e&&o.has(e.id)&&i.add(n.id)})})}),this.previousFormValues=k({},n))}catch(e){this.failure&&this.trigger("failure",{error:e})}},w.prototype.handleSubmitData=function(e){for(var t=this.formState,n=!(!t||!t.errors)&&0===Object.keys(t.errors).length,i={},a=t?t.values:{},r=new Set(["button","message","panel","table","tabs"]),t=this.collectAllComponents(this.processedSchemaCache.components||[]),o=new Set(t.filter(function(e){return r.has(e.type)}).map(function(e){return e.id})),s=new Set(t.filter(function(e){return!1===e.visible||!(!e.conditions||!e.conditions.visibleWhen||$.isFieldVisible(e.conditions,a))||!!(e.conditions&&e.conditions.hideWhen&&$.isFieldHidden(e.conditions,a))}).map(function(e){return e.id})),l=new Set(t.filter(function(e){return!!e.disabled||!(!e.conditions||!e.conditions.disabledWhen)&&$.isFieldDisabled(e.conditions,a)}).map(function(e){return e.id})),d=0,c=Object.keys(e);d<c.length;d++){var u=c[d],p=e[u];if(o.has(u)||s.has(u)||l.has(u))return;i[this.idToLabelCache[u]||u]=p}this.submit&&this.trigger("submit",{data:i,isValid:n})},w.prototype.getComponent=function(e){return this.inputRefs[e]||null},w.prototype.onPropertyChanged=function(e,t){var n=!1;e.schema!==t.schema&&(n=!0),e.locale!==t.locale&&(n=!0),e.enableRtl!==t.enableRtl&&(n=!0),e.layout!==t.layout&&(n=!0),(n=e.locale!==t.locale?!0:n)&&(this.refreshing=!0,this.destroyRendered(),this.removePreviousRoot(),this.isInitialized=!1,this.render(),this.refreshing=!1)},w.prototype.destroyRendered=function(){var t=this;if(this.validator){try{this.validator.destroy()}catch(e){this.trigger("failure",{error:e})}this.validator=null}this.renderedInstances.forEach(function(e){t.destroyRenderedInstance(e)}),this.renderedInstances=[],this.removePreviousRoot(),this.inputRefs={},this.tooltipRefs={},this.conditionalValueApplied={},this.expressionDependencyGraph={},this.computedFieldNames=new Set,this.previousFormValues={},this.conditionalTriggerFieldIds=new Set,this.consumerDependencyMap=new Map,this.preservedFields=new Map,this.pendingChangedFieldIds=new Set},w.prototype.clearPersistedTabSelections=function(){if("undefined"==typeof window)return null;try{var e=this.processedSchemaCache&&this.processedSchemaCache.components?this.processedSchemaCache.components:[];this.collectAllComponents(e).forEach(function(e){"tabs"===e.type&&e.id&&window.localStorage.removeItem("tab"+e.id)})}catch(e){}},w.prototype.destroy=function(){this.destroyRendered(),this.formState={values:{},errors:{}},this.expressionEngine=null,this.customValidationEngine=null,this.clearEngineCaches(),this.clearPersistedTabSelections(),this.consumerDependencyMap=new Map,this.preservedFields=new Map,this.conditionalTriggerFieldIds=new Set,x.prototype.destroy.call(this)},w.prototype.clearEngineCaches=function(){if(this.expressionEngine)try{this.expressionEngine.clearCache()}catch(e){}if(this.customValidationEngine){var e=this.customValidationEngine.expressionEngine;if(e&&"function"==typeof e.clearCache)try{e.clearCache()}catch(e){}}},w.PRESERVABLE_TYPES=new Set(["textbox","textarea","number","checkbox","checkboxGroup","radio","dropdown","multiselect","button","date","dateTime","time","dateRange","switch","signature","rating","imageEditor","fileUpload","rangeSlider","colorPicker","inputMask","message","panel","table","tabs","dataGrid","staticHtml","card","splitButton","richTextEditor"]),C([_.Property(null)],w.prototype,"schema",void 0),C([_.Property("SingleColumn")],w.prototype,"layout",void 0),C([_.Property("")],w.prototype,"className",void 0),C([_.Event()],w.prototype,"submit",void 0),C([_.Event()],w.prototype,"change",void 0),C([_.Event()],w.prototype,"buttonClick",void 0),C([_.Event()],w.prototype,"failure",void 0),C([_.Event()],w.prototype,"created",void 0),me=C([_.NotifyPropertyChanges],w));function w(e,t){e=x.call(this,e,t)||this;return e.processedSchemaCache={version:"1.0.0",components:[]},e.l10n=new _.L10n("form-renderer",ve,e.locale),e.formState={values:Object.create(null),errors:Object.create(null)},e.validator=null,e.inputRefs={},e.conditionalValueApplied={},e.expressionEngine=null,e.expressionDependencyGraph={},e.expressionEvaluationInProgress=!1,e.previousFormValues={},e.computedFieldNames=new Set,e.customValidationEngine=new U,e.currentFormValues={},e.isInitialized=!1,e.hasLayoutComponentsCache=!1,e.idToLabelCache={},e.initialValuesCache={},e.renderedInstances=[],e.tooltipRefs={},e.createdFired=!1,e.rerenderScheduled=!1,e.conditionalTriggerFieldIds=new Set,e.preservedFields=new Map,e.consumerDependencyMap=new Map,e.pendingChangedFieldIds=new Set,e}(C=e.FormLayout||(e.FormLayout={})).SingleColumn="SingleColumn",C.TwoColumn="TwoColumn",C.ThreeColumn="ThreeColumn",C.FourColumn="FourColumn";e.FORM_COMPONENT_TYPES=["textbox","textarea","number","checkbox","checkboxGroup","radio","dropdown","multiselect","button","date","dateTime","time","dateRange","switch","signature","rating","imageEditor","fileUpload","rangeSlider","colorPicker","inputMask","message","panel","table","tabs","dataGrid","staticHtml","card","splitButton","richTextEditor"],e.FormRenderer=fe,e.defaultLocale=ve,Object.defineProperty(e,"__esModule",{value:!0})});
11
+ //# sourceMappingURL=ej2-form-renderer.umd.min.js.map