survey-core 2.5.31 → 2.5.32

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 (262) hide show
  1. package/fesm/i18n/arabic.mjs +1 -1
  2. package/fesm/i18n/basque.mjs +1 -1
  3. package/fesm/i18n/bulgarian.mjs +1 -1
  4. package/fesm/i18n/burmese.mjs +1 -1
  5. package/fesm/i18n/catalan.mjs +1 -1
  6. package/fesm/i18n/croatian.mjs +1 -1
  7. package/fesm/i18n/czech.mjs +1 -1
  8. package/fesm/i18n/danish.mjs +1 -1
  9. package/fesm/i18n/dutch.mjs +1 -1
  10. package/fesm/i18n/english.mjs +1 -1
  11. package/fesm/i18n/estonian.mjs +1 -1
  12. package/fesm/i18n/finnish.mjs +1 -1
  13. package/fesm/i18n/french.mjs +1 -1
  14. package/fesm/i18n/georgian.mjs +1 -1
  15. package/fesm/i18n/german.mjs +1 -1
  16. package/fesm/i18n/greek.mjs +1 -1
  17. package/fesm/i18n/haitian-creole.mjs +1 -1
  18. package/fesm/i18n/hebrew.mjs +1 -1
  19. package/fesm/i18n/hindi.mjs +1 -1
  20. package/fesm/i18n/hungarian.mjs +1 -1
  21. package/fesm/i18n/icelandic.mjs +1 -1
  22. package/fesm/i18n/index.mjs +1 -1
  23. package/fesm/i18n/indonesian.mjs +1 -1
  24. package/fesm/i18n/italian.mjs +1 -1
  25. package/fesm/i18n/japanese.mjs +1 -1
  26. package/fesm/i18n/kazakh.mjs +1 -1
  27. package/fesm/i18n/korean.mjs +1 -1
  28. package/fesm/i18n/latvian.mjs +1 -1
  29. package/fesm/i18n/lithuanian.mjs +1 -1
  30. package/fesm/i18n/macedonian.mjs +1 -1
  31. package/fesm/i18n/malay.mjs +1 -1
  32. package/fesm/i18n/nl-BE.mjs +1 -1
  33. package/fesm/i18n/norwegian.mjs +1 -1
  34. package/fesm/i18n/persian.mjs +1 -1
  35. package/fesm/i18n/philippines.mjs +1 -1
  36. package/fesm/i18n/polish.mjs +1 -1
  37. package/fesm/i18n/portuguese-br.mjs +1 -1
  38. package/fesm/i18n/portuguese.mjs +1 -1
  39. package/fesm/i18n/romanian.mjs +1 -1
  40. package/fesm/i18n/russian.mjs +1 -1
  41. package/fesm/i18n/serbian.mjs +1 -1
  42. package/fesm/i18n/simplified-chinese.mjs +1 -1
  43. package/fesm/i18n/slovak.mjs +1 -1
  44. package/fesm/i18n/slovenian.mjs +1 -1
  45. package/fesm/i18n/spanish.mjs +1 -1
  46. package/fesm/i18n/swahili.mjs +1 -1
  47. package/fesm/i18n/swedish.mjs +1 -1
  48. package/fesm/i18n/tajik.mjs +1 -1
  49. package/fesm/i18n/telugu.mjs +1 -1
  50. package/fesm/i18n/thai.mjs +1 -1
  51. package/fesm/i18n/traditional-chinese.mjs +1 -1
  52. package/fesm/i18n/turkish.mjs +1 -1
  53. package/fesm/i18n/ukrainian.mjs +1 -1
  54. package/fesm/i18n/urdu.mjs +1 -1
  55. package/fesm/i18n/vietnamese.mjs +1 -1
  56. package/fesm/i18n/welsh.mjs +1 -1
  57. package/fesm/survey-core.mjs +3 -3
  58. package/fesm/survey.i18n.mjs +1 -1
  59. package/fesm/themes/index.mjs +1 -1
  60. package/i18n/arabic.js +1 -1
  61. package/i18n/arabic.min.js +1 -1
  62. package/i18n/basque.js +1 -1
  63. package/i18n/basque.min.js +1 -1
  64. package/i18n/bulgarian.js +1 -1
  65. package/i18n/bulgarian.min.js +1 -1
  66. package/i18n/burmese.js +1 -1
  67. package/i18n/burmese.min.js +1 -1
  68. package/i18n/catalan.js +1 -1
  69. package/i18n/catalan.min.js +1 -1
  70. package/i18n/croatian.js +1 -1
  71. package/i18n/croatian.min.js +1 -1
  72. package/i18n/czech.js +1 -1
  73. package/i18n/czech.min.js +1 -1
  74. package/i18n/danish.js +1 -1
  75. package/i18n/danish.min.js +1 -1
  76. package/i18n/dutch.js +1 -1
  77. package/i18n/dutch.min.js +1 -1
  78. package/i18n/english.js +1 -1
  79. package/i18n/english.min.js +1 -1
  80. package/i18n/estonian.js +1 -1
  81. package/i18n/estonian.min.js +1 -1
  82. package/i18n/finnish.js +1 -1
  83. package/i18n/finnish.min.js +1 -1
  84. package/i18n/french.js +1 -1
  85. package/i18n/french.min.js +1 -1
  86. package/i18n/georgian.js +1 -1
  87. package/i18n/georgian.min.js +1 -1
  88. package/i18n/german.js +1 -1
  89. package/i18n/german.min.js +1 -1
  90. package/i18n/greek.js +1 -1
  91. package/i18n/greek.min.js +1 -1
  92. package/i18n/haitian-creole.js +1 -1
  93. package/i18n/haitian-creole.min.js +1 -1
  94. package/i18n/hebrew.js +1 -1
  95. package/i18n/hebrew.min.js +1 -1
  96. package/i18n/hindi.js +1 -1
  97. package/i18n/hindi.min.js +1 -1
  98. package/i18n/hungarian.js +1 -1
  99. package/i18n/hungarian.min.js +1 -1
  100. package/i18n/icelandic.js +1 -1
  101. package/i18n/icelandic.min.js +1 -1
  102. package/i18n/index.js +1 -1
  103. package/i18n/index.min.js +1 -1
  104. package/i18n/indonesian.js +1 -1
  105. package/i18n/indonesian.min.js +1 -1
  106. package/i18n/italian.js +1 -1
  107. package/i18n/italian.min.js +1 -1
  108. package/i18n/japanese.js +1 -1
  109. package/i18n/japanese.min.js +1 -1
  110. package/i18n/kazakh.js +1 -1
  111. package/i18n/kazakh.min.js +1 -1
  112. package/i18n/korean.js +1 -1
  113. package/i18n/korean.min.js +1 -1
  114. package/i18n/latvian.js +1 -1
  115. package/i18n/latvian.min.js +1 -1
  116. package/i18n/lithuanian.js +1 -1
  117. package/i18n/lithuanian.min.js +1 -1
  118. package/i18n/macedonian.js +1 -1
  119. package/i18n/macedonian.min.js +1 -1
  120. package/i18n/malay.js +1 -1
  121. package/i18n/malay.min.js +1 -1
  122. package/i18n/nl-BE.js +1 -1
  123. package/i18n/nl-BE.min.js +1 -1
  124. package/i18n/norwegian.js +1 -1
  125. package/i18n/norwegian.min.js +1 -1
  126. package/i18n/persian.js +1 -1
  127. package/i18n/persian.min.js +1 -1
  128. package/i18n/philippines.js +1 -1
  129. package/i18n/philippines.min.js +1 -1
  130. package/i18n/polish.js +1 -1
  131. package/i18n/polish.min.js +1 -1
  132. package/i18n/portuguese-br.js +1 -1
  133. package/i18n/portuguese-br.min.js +1 -1
  134. package/i18n/portuguese.js +1 -1
  135. package/i18n/portuguese.min.js +1 -1
  136. package/i18n/romanian.js +1 -1
  137. package/i18n/romanian.min.js +1 -1
  138. package/i18n/russian.js +1 -1
  139. package/i18n/russian.min.js +1 -1
  140. package/i18n/serbian.js +1 -1
  141. package/i18n/serbian.min.js +1 -1
  142. package/i18n/simplified-chinese.js +1 -1
  143. package/i18n/simplified-chinese.min.js +1 -1
  144. package/i18n/slovak.js +1 -1
  145. package/i18n/slovak.min.js +1 -1
  146. package/i18n/slovenian.js +1 -1
  147. package/i18n/slovenian.min.js +1 -1
  148. package/i18n/spanish.js +1 -1
  149. package/i18n/spanish.min.js +1 -1
  150. package/i18n/swahili.js +1 -1
  151. package/i18n/swahili.min.js +1 -1
  152. package/i18n/swedish.js +1 -1
  153. package/i18n/swedish.min.js +1 -1
  154. package/i18n/tajik.js +1 -1
  155. package/i18n/tajik.min.js +1 -1
  156. package/i18n/telugu.js +1 -1
  157. package/i18n/telugu.min.js +1 -1
  158. package/i18n/thai.js +1 -1
  159. package/i18n/thai.min.js +1 -1
  160. package/i18n/traditional-chinese.js +1 -1
  161. package/i18n/traditional-chinese.min.js +1 -1
  162. package/i18n/turkish.js +1 -1
  163. package/i18n/turkish.min.js +1 -1
  164. package/i18n/ukrainian.js +1 -1
  165. package/i18n/ukrainian.min.js +1 -1
  166. package/i18n/urdu.js +1 -1
  167. package/i18n/urdu.min.js +1 -1
  168. package/i18n/vietnamese.js +1 -1
  169. package/i18n/vietnamese.min.js +1 -1
  170. package/i18n/welsh.js +1 -1
  171. package/i18n/welsh.min.js +1 -1
  172. package/package.json +1 -1
  173. package/survey-core.css +1 -1
  174. package/survey-core.fontless.css +1 -1
  175. package/survey-core.fontless.min.css +1 -1
  176. package/survey-core.min.css +1 -1
  177. package/survey.core.js +3 -3
  178. package/survey.core.min.js +2 -2
  179. package/survey.i18n.js +1 -1
  180. package/survey.i18n.min.js +1 -1
  181. package/themes/borderless-dark-panelless.js +1 -1
  182. package/themes/borderless-dark-panelless.min.js +1 -1
  183. package/themes/borderless-dark.js +1 -1
  184. package/themes/borderless-dark.min.js +1 -1
  185. package/themes/borderless-light-panelless.js +1 -1
  186. package/themes/borderless-light-panelless.min.js +1 -1
  187. package/themes/borderless-light.js +1 -1
  188. package/themes/borderless-light.min.js +1 -1
  189. package/themes/contrast-dark-panelless.js +1 -1
  190. package/themes/contrast-dark-panelless.min.js +1 -1
  191. package/themes/contrast-dark.js +1 -1
  192. package/themes/contrast-dark.min.js +1 -1
  193. package/themes/contrast-light-panelless.js +1 -1
  194. package/themes/contrast-light-panelless.min.js +1 -1
  195. package/themes/contrast-light.js +1 -1
  196. package/themes/contrast-light.min.js +1 -1
  197. package/themes/default-dark-panelless.js +1 -1
  198. package/themes/default-dark-panelless.min.js +1 -1
  199. package/themes/default-dark.js +1 -1
  200. package/themes/default-dark.min.js +1 -1
  201. package/themes/default-light-panelless.js +1 -1
  202. package/themes/default-light-panelless.min.js +1 -1
  203. package/themes/default-light.js +1 -1
  204. package/themes/default-light.min.js +1 -1
  205. package/themes/doubleborder-dark-panelless.js +1 -1
  206. package/themes/doubleborder-dark-panelless.min.js +1 -1
  207. package/themes/doubleborder-dark.js +1 -1
  208. package/themes/doubleborder-dark.min.js +1 -1
  209. package/themes/doubleborder-light-panelless.js +1 -1
  210. package/themes/doubleborder-light-panelless.min.js +1 -1
  211. package/themes/doubleborder-light.js +1 -1
  212. package/themes/doubleborder-light.min.js +1 -1
  213. package/themes/flat-dark-panelless.js +1 -1
  214. package/themes/flat-dark-panelless.min.js +1 -1
  215. package/themes/flat-dark.js +1 -1
  216. package/themes/flat-dark.min.js +1 -1
  217. package/themes/flat-light-panelless.js +1 -1
  218. package/themes/flat-light-panelless.min.js +1 -1
  219. package/themes/flat-light.js +1 -1
  220. package/themes/flat-light.min.js +1 -1
  221. package/themes/index.js +1 -1
  222. package/themes/index.min.js +1 -1
  223. package/themes/layered-dark-panelless.js +1 -1
  224. package/themes/layered-dark-panelless.min.js +1 -1
  225. package/themes/layered-dark.js +1 -1
  226. package/themes/layered-dark.min.js +1 -1
  227. package/themes/layered-light-panelless.js +1 -1
  228. package/themes/layered-light-panelless.min.js +1 -1
  229. package/themes/layered-light.js +1 -1
  230. package/themes/layered-light.min.js +1 -1
  231. package/themes/plain-dark-panelless.js +1 -1
  232. package/themes/plain-dark-panelless.min.js +1 -1
  233. package/themes/plain-dark.js +1 -1
  234. package/themes/plain-dark.min.js +1 -1
  235. package/themes/plain-light-panelless.js +1 -1
  236. package/themes/plain-light-panelless.min.js +1 -1
  237. package/themes/plain-light.js +1 -1
  238. package/themes/plain-light.min.js +1 -1
  239. package/themes/sharp-dark-panelless.js +1 -1
  240. package/themes/sharp-dark-panelless.min.js +1 -1
  241. package/themes/sharp-dark.js +1 -1
  242. package/themes/sharp-dark.min.js +1 -1
  243. package/themes/sharp-light-panelless.js +1 -1
  244. package/themes/sharp-light-panelless.min.js +1 -1
  245. package/themes/sharp-light.js +1 -1
  246. package/themes/sharp-light.min.js +1 -1
  247. package/themes/solid-dark-panelless.js +1 -1
  248. package/themes/solid-dark-panelless.min.js +1 -1
  249. package/themes/solid-dark.js +1 -1
  250. package/themes/solid-dark.min.js +1 -1
  251. package/themes/solid-light-panelless.js +1 -1
  252. package/themes/solid-light-panelless.min.js +1 -1
  253. package/themes/solid-light.js +1 -1
  254. package/themes/solid-light.min.js +1 -1
  255. package/themes/threedimensional-dark-panelless.js +1 -1
  256. package/themes/threedimensional-dark-panelless.min.js +1 -1
  257. package/themes/threedimensional-dark.js +1 -1
  258. package/themes/threedimensional-dark.min.js +1 -1
  259. package/themes/threedimensional-light-panelless.js +1 -1
  260. package/themes/threedimensional-light-panelless.min.js +1 -1
  261. package/themes/threedimensional-light.js +1 -1
  262. package/themes/threedimensional-light.min.js +1 -1
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * surveyjs - Survey JavaScript library v2.5.31
2
+ * surveyjs - Survey JavaScript library v2.5.32
3
3
  * Copyright (c) 2015-2026 Devsoft Baltic OÜ - http://surveyjs.io/
4
4
  * License: MIT (http://www.opensource.org/licenses/mit-license.php)
5
5
  */
@@ -8,4 +8,4 @@
8
8
  * Signature Pad v4.2.0 | https://github.com/szimek/signature_pad
9
9
  * (c) 2024 Szymon Nowak | Released under the MIT license
10
10
  */
11
- class Ur{constructor(e,t,n,i){if(isNaN(e)||isNaN(t))throw new Error(`Point is invalid: (${e}, ${t})`);this.x=+e,this.y=+t,this.pressure=n||0,this.time=i||Date.now()}distanceTo(e){return Math.sqrt(Math.pow(this.x-e.x,2)+Math.pow(this.y-e.y,2))}equals(e){return this.x===e.x&&this.y===e.y&&this.pressure===e.pressure&&this.time===e.time}velocityFrom(e){return this.time!==e.time?this.distanceTo(e)/(this.time-e.time):0}}class Wr{static fromPoints(e,t){const n=this.calculateControlPoints(e[0],e[1],e[2]).c2,i=this.calculateControlPoints(e[1],e[2],e[3]).c1;return new Wr(e[1],n,i,e[2],t.start,t.end)}static calculateControlPoints(e,t,n){const i=e.x-t.x,o=e.y-t.y,r=t.x-n.x,s=t.y-n.y,a=(e.x+t.x)/2,l=(e.y+t.y)/2,u=(t.x+n.x)/2,p=(t.y+n.y)/2,c=Math.sqrt(i*i+o*o),h=Math.sqrt(r*r+s*s),d=h/(c+h),f=u+(a-u)*d,g=p+(l-p)*d,y=t.x-f,m=t.y-g;return{c1:new Ur(a+y,l+m),c2:new Ur(u+y,p+m)}}constructor(e,t,n,i,o,r){this.startPoint=e,this.control2=t,this.control1=n,this.endPoint=i,this.startWidth=o,this.endWidth=r}length(){let e,t,n=0;for(let i=0;i<=10;i+=1){const o=i/10,r=this.point(o,this.startPoint.x,this.control1.x,this.control2.x,this.endPoint.x),s=this.point(o,this.startPoint.y,this.control1.y,this.control2.y,this.endPoint.y);if(i>0){const i=r-e,o=s-t;n+=Math.sqrt(i*i+o*o)}e=r,t=s}return n}point(e,t,n,i,o){return t*(1-e)*(1-e)*(1-e)+3*n*(1-e)*(1-e)*e+3*i*(1-e)*e*e+o*e*e*e}}class Gr{constructor(){try{this._et=new EventTarget}catch(e){this._et=document}}addEventListener(e,t,n){this._et.addEventListener(e,t,n)}dispatchEvent(e){return this._et.dispatchEvent(e)}removeEventListener(e,t,n){this._et.removeEventListener(e,t,n)}}class Jr extends Gr{constructor(e,t={}){super(),this.canvas=e,this._drawingStroke=!1,this._isEmpty=!0,this._lastPoints=[],this._data=[],this._lastVelocity=0,this._lastWidth=0,this._handleMouseDown=e=>{1===e.buttons&&this._strokeBegin(e)},this._handleMouseMove=e=>{this._strokeMoveUpdate(e)},this._handleMouseUp=e=>{1===e.buttons&&this._strokeEnd(e)},this._handleTouchStart=e=>{if(e.cancelable&&e.preventDefault(),1===e.targetTouches.length){const t=e.changedTouches[0];this._strokeBegin(t)}},this._handleTouchMove=e=>{e.cancelable&&e.preventDefault();const t=e.targetTouches[0];this._strokeMoveUpdate(t)},this._handleTouchEnd=e=>{if(e.target===this.canvas){e.cancelable&&e.preventDefault();const t=e.changedTouches[0];this._strokeEnd(t)}},this._handlePointerStart=e=>{e.preventDefault(),this._strokeBegin(e)},this._handlePointerMove=e=>{this._strokeMoveUpdate(e)},this._handlePointerEnd=e=>{this._drawingStroke&&(e.preventDefault(),this._strokeEnd(e))},this.velocityFilterWeight=t.velocityFilterWeight||.7,this.minWidth=t.minWidth||.5,this.maxWidth=t.maxWidth||2.5,this.throttle="throttle"in t?t.throttle:16,this.minDistance="minDistance"in t?t.minDistance:5,this.dotSize=t.dotSize||0,this.penColor=t.penColor||"black",this.backgroundColor=t.backgroundColor||"rgba(0,0,0,0)",this.compositeOperation=t.compositeOperation||"source-over",this.canvasContextOptions="canvasContextOptions"in t?t.canvasContextOptions:{},this._strokeMoveUpdate=this.throttle?function(e,t=250){let n,i,o,r=0,s=null;const a=()=>{r=Date.now(),s=null,n=e.apply(i,o),s||(i=null,o=[])};return function(...l){const u=Date.now(),p=t-(u-r);return i=this,o=l,p<=0||p>t?(s&&(clearTimeout(s),s=null),r=u,n=e.apply(i,o),s||(i=null,o=[])):s||(s=window.setTimeout(a,p)),n}}(Jr.prototype._strokeUpdate,this.throttle):Jr.prototype._strokeUpdate,this._ctx=e.getContext("2d",this.canvasContextOptions),this.clear(),this.on()}clear(){const{_ctx:e,canvas:t}=this;e.fillStyle=this.backgroundColor,e.clearRect(0,0,t.width,t.height),e.fillRect(0,0,t.width,t.height),this._data=[],this._reset(this._getPointGroupOptions()),this._isEmpty=!0}fromDataURL(e,t={}){return new Promise((n,i)=>{const o=new Image,r=t.ratio||window.devicePixelRatio||1,s=t.width||this.canvas.width/r,a=t.height||this.canvas.height/r,l=t.xOffset||0,u=t.yOffset||0;this._reset(this._getPointGroupOptions()),o.onload=()=>{this._ctx.drawImage(o,l,u,s,a),n()},o.onerror=e=>{i(e)},o.crossOrigin="anonymous",o.src=e,this._isEmpty=!1})}toDataURL(e="image/png",t){return"image/svg+xml"===e?("object"!=typeof t&&(t=void 0),`data:image/svg+xml;base64,${btoa(this.toSVG(t))}`):("number"!=typeof t&&(t=void 0),this.canvas.toDataURL(e,t))}on(){this.canvas.style.touchAction="none",this.canvas.style.msTouchAction="none",this.canvas.style.userSelect="none";const e=/Macintosh/.test(navigator.userAgent)&&"ontouchstart"in document;window.PointerEvent&&!e?this._handlePointerEvents():(this._handleMouseEvents(),"ontouchstart"in window&&this._handleTouchEvents())}off(){this.canvas.style.touchAction="auto",this.canvas.style.msTouchAction="auto",this.canvas.style.userSelect="auto",this.canvas.removeEventListener("pointerdown",this._handlePointerStart),this.canvas.removeEventListener("pointermove",this._handlePointerMove),this.canvas.ownerDocument.removeEventListener("pointerup",this._handlePointerEnd),this.canvas.removeEventListener("mousedown",this._handleMouseDown),this.canvas.removeEventListener("mousemove",this._handleMouseMove),this.canvas.ownerDocument.removeEventListener("mouseup",this._handleMouseUp),this.canvas.removeEventListener("touchstart",this._handleTouchStart),this.canvas.removeEventListener("touchmove",this._handleTouchMove),this.canvas.removeEventListener("touchend",this._handleTouchEnd)}isEmpty(){return this._isEmpty}fromData(e,{clear:t=!0}={}){t&&this.clear(),this._fromData(e,this._drawCurve.bind(this),this._drawDot.bind(this)),this._data=this._data.concat(e)}toData(){return this._data}_getPointGroupOptions(e){return{penColor:e&&"penColor"in e?e.penColor:this.penColor,dotSize:e&&"dotSize"in e?e.dotSize:this.dotSize,minWidth:e&&"minWidth"in e?e.minWidth:this.minWidth,maxWidth:e&&"maxWidth"in e?e.maxWidth:this.maxWidth,velocityFilterWeight:e&&"velocityFilterWeight"in e?e.velocityFilterWeight:this.velocityFilterWeight,compositeOperation:e&&"compositeOperation"in e?e.compositeOperation:this.compositeOperation}}_strokeBegin(e){if(!this.dispatchEvent(new CustomEvent("beginStroke",{detail:e,cancelable:!0})))return;this._drawingStroke=!0;const t=this._getPointGroupOptions(),n=Object.assign(Object.assign({},t),{points:[]});this._data.push(n),this._reset(t),this._strokeUpdate(e)}_strokeUpdate(e){if(!this._drawingStroke)return;if(0===this._data.length)return void this._strokeBegin(e);this.dispatchEvent(new CustomEvent("beforeUpdateStroke",{detail:e}));const t=e.clientX,n=e.clientY,i=void 0!==e.pressure?e.pressure:void 0!==e.force?e.force:0,o=this._createPoint(t,n,i),r=this._data[this._data.length-1],s=r.points,a=s.length>0&&s[s.length-1],l=!!a&&o.distanceTo(a)<=this.minDistance,u=this._getPointGroupOptions(r);if(!a||!a||!l){const e=this._addPoint(o,u);a?e&&this._drawCurve(e,u):this._drawDot(o,u),s.push({time:o.time,x:o.x,y:o.y,pressure:o.pressure})}this.dispatchEvent(new CustomEvent("afterUpdateStroke",{detail:e}))}_strokeEnd(e){this._drawingStroke&&(this._strokeUpdate(e),this._drawingStroke=!1,this.dispatchEvent(new CustomEvent("endStroke",{detail:e})))}_handlePointerEvents(){this._drawingStroke=!1,this.canvas.addEventListener("pointerdown",this._handlePointerStart),this.canvas.addEventListener("pointermove",this._handlePointerMove),this.canvas.ownerDocument.addEventListener("pointerup",this._handlePointerEnd)}_handleMouseEvents(){this._drawingStroke=!1,this.canvas.addEventListener("mousedown",this._handleMouseDown),this.canvas.addEventListener("mousemove",this._handleMouseMove),this.canvas.ownerDocument.addEventListener("mouseup",this._handleMouseUp)}_handleTouchEvents(){this.canvas.addEventListener("touchstart",this._handleTouchStart),this.canvas.addEventListener("touchmove",this._handleTouchMove),this.canvas.addEventListener("touchend",this._handleTouchEnd)}_reset(e){this._lastPoints=[],this._lastVelocity=0,this._lastWidth=(e.minWidth+e.maxWidth)/2,this._ctx.fillStyle=e.penColor,this._ctx.globalCompositeOperation=e.compositeOperation}_createPoint(e,t,n){const i=this.canvas.getBoundingClientRect();return new Ur(e-i.left,t-i.top,n,(new Date).getTime())}_addPoint(e,t){const{_lastPoints:n}=this;if(n.push(e),n.length>2){3===n.length&&n.unshift(n[0]);const e=this._calculateCurveWidths(n[1],n[2],t),i=Wr.fromPoints(n,e);return n.shift(),i}return null}_calculateCurveWidths(e,t,n){const i=n.velocityFilterWeight*t.velocityFrom(e)+(1-n.velocityFilterWeight)*this._lastVelocity,o=this._strokeWidth(i,n),r={end:o,start:this._lastWidth};return this._lastVelocity=i,this._lastWidth=o,r}_strokeWidth(e,t){return Math.max(t.maxWidth/(e+1),t.minWidth)}_drawCurveSegment(e,t,n){const i=this._ctx;i.moveTo(e,t),i.arc(e,t,n,0,2*Math.PI,!1),this._isEmpty=!1}_drawCurve(e,t){const n=this._ctx,i=e.endWidth-e.startWidth,o=2*Math.ceil(e.length());n.beginPath(),n.fillStyle=t.penColor;for(let n=0;n<o;n+=1){const r=n/o,s=r*r,a=s*r,l=1-r,u=l*l,p=u*l;let c=p*e.startPoint.x;c+=3*u*r*e.control1.x,c+=3*l*s*e.control2.x,c+=a*e.endPoint.x;let h=p*e.startPoint.y;h+=3*u*r*e.control1.y,h+=3*l*s*e.control2.y,h+=a*e.endPoint.y;const d=Math.min(e.startWidth+a*i,t.maxWidth);this._drawCurveSegment(c,h,d)}n.closePath(),n.fill()}_drawDot(e,t){const n=this._ctx,i=t.dotSize>0?t.dotSize:(t.minWidth+t.maxWidth)/2;n.beginPath(),this._drawCurveSegment(e.x,e.y,i),n.closePath(),n.fillStyle=t.penColor,n.fill()}_fromData(e,t,n){for(const i of e){const{points:e}=i,o=this._getPointGroupOptions(i);if(e.length>1)for(let n=0;n<e.length;n+=1){const i=e[n],r=new Ur(i.x,i.y,i.pressure,i.time);0===n&&this._reset(o);const s=this._addPoint(r,o);s&&t(s,o)}else this._reset(o),n(e[0],o)}}toSVG({includeBackgroundColor:e=!1}={}){const t=this._data,n=Math.max(window.devicePixelRatio||1,1),i=this.canvas.width/n,o=this.canvas.height/n,r=document.createElementNS("http://www.w3.org/2000/svg","svg");if(r.setAttribute("xmlns","http://www.w3.org/2000/svg"),r.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink"),r.setAttribute("viewBox",`0 0 ${i} ${o}`),r.setAttribute("width",i.toString()),r.setAttribute("height",o.toString()),e&&this.backgroundColor){const e=document.createElement("rect");e.setAttribute("width","100%"),e.setAttribute("height","100%"),e.setAttribute("fill",this.backgroundColor),r.appendChild(e)}return this._fromData(t,(e,{penColor:t})=>{const n=document.createElement("path");if(!(isNaN(e.control1.x)||isNaN(e.control1.y)||isNaN(e.control2.x)||isNaN(e.control2.y))){const i=`M ${e.startPoint.x.toFixed(3)},${e.startPoint.y.toFixed(3)} C ${e.control1.x.toFixed(3)},${e.control1.y.toFixed(3)} ${e.control2.x.toFixed(3)},${e.control2.y.toFixed(3)} ${e.endPoint.x.toFixed(3)},${e.endPoint.y.toFixed(3)}`;n.setAttribute("d",i),n.setAttribute("stroke-width",(2.25*e.endWidth).toFixed(3)),n.setAttribute("stroke",t),n.setAttribute("fill","none"),n.setAttribute("stroke-linecap","round"),r.appendChild(n)}},(e,{penColor:t,dotSize:n,minWidth:i,maxWidth:o})=>{const s=document.createElement("circle"),a=n>0?n:(i+o)/2;s.setAttribute("r",a.toString()),s.setAttribute("cx",e.x.toString()),s.setAttribute("cy",e.y.toString()),s.setAttribute("fill",t),r.appendChild(s)}),r.outerHTML}}var Kr=function(e){function i(t){var n=e.call(this,t)||this;return n.valueIsUpdatingInternally=!1,n._loadedData=void 0,n.updateValueHandler=function(){n._loadedData=void 0,n.scaleCanvas(!0,!0)},n}return y(i,e),i.prototype.onPropertyValueChanged=function(t,n,i){e.prototype.onPropertyValueChanged.call(this,t,n,i),"penColor"!==t&&"backgroundColor"!==t&&"backgroundImage"!==t||this.signaturePad&&this.updateColors(this.signaturePad)},i.prototype.getPenColorFromTheme=function(){var e=this.survey;return!!e&&!!e.themeVariables&&e.themeVariables["--sjs-primary-backcolor"]},i.prototype.updateColors=function(e){var t=this.getPenColorFromTheme(),n=this.getPropertyByName("penColor");e.penColor=this.penColor||t||n.defaultValue||"#1ab394";var i=this.getPropertyByName("backgroundColor"),o=t?"transparent":void 0,r=this.backgroundImage?"transparent":this.backgroundColor;e.backgroundColor=r||o||i.defaultValue||"#ffffff"},i.prototype.getCssRoot=function(t){return(new tt).append(e.prototype.getCssRoot.call(this,t)).append(t.small,"300"===this.signatureWidth.toString()).toString()},i.prototype.getFormat=function(){return"jpeg"===this.dataFormat?"image/jpeg":"svg"===this.dataFormat?"image/svg+xml":""},i.prototype.updateValue=function(){if(this.signaturePad){var e=this.signaturePad.toDataURL(this.getFormat());this.valueIsUpdatingInternally=!0,this.value=e,this.valueIsUpdatingInternally=!1}},i.prototype.getType=function(){return"signaturepad"},i.prototype.afterRenderQuestionElement=function(n){t.isAvailable()&&n&&(this.isDesignMode||this.initSignaturePad(n),this.element=n),e.prototype.afterRenderQuestionElement.call(this,n)},i.prototype.beforeDestroyQuestionElement=function(e){e&&this.destroySignaturePad(e)},i.prototype.themeChanged=function(e){this.signaturePad&&this.updateColors(this.signaturePad)},i.prototype.resizeCanvas=function(){this.canvas.width=this.containerWidth,this.canvas.height=this.containerHeight},i.prototype.scaleCanvas=function(e,t){void 0===e&&(e=!0),void 0===t&&(t=!1);var n=this.canvas,i=n.offsetWidth/this.containerWidth;(this.scale!=i||t)&&(this.scale=i,n.style.width=this.renderedCanvasWidth,this.resizeCanvas(),this.signaturePad.minWidth=this.penMinWidth*i,this.signaturePad.maxWidth=this.penMaxWidth*i,n.getContext("2d").scale(1/i,1/i),e&&this.loadPreview(this.value))},i.prototype.fromUrl=function(e){var t=this;if(this.isFileLoading=!0,wt(e))this.fromDataUrl(e),this.isFileLoading=!1;else{var i=new Image;i.crossOrigin="anonymous",i.src=e,i.onload=function(){if(t.canvas){var e=n.createElement("canvas");e.width=t.containerWidth,e.height=t.containerHeight,e.getContext("2d").drawImage(i,0,0);var o=e.toDataURL(t.getFormat());t.fromDataUrl(o)}t.isFileLoading=!1},i.onerror=function(){t.isFileLoading=!1}}},i.prototype.fromDataUrl=function(e){if(this._loadedData=e,this.signaturePad){var n=1,i=this.scale;if("svg"===this.dataFormat)n=t.getDevicePixelRatio()||1,i=1;var o={width:this.canvas.width*i/n,height:this.canvas.height*i/n};this.signaturePad.fromDataURL(e,o)}},Object.defineProperty(i.prototype,"loadedData",{get:function(){return this._loadedData},enumerable:!1,configurable:!0}),i.prototype.loadPreview=function(e){var t=this;if(!e)return this.signaturePad&&this.canvas&&(this.canvas.getContext("2d").clearRect(0,0,this.canvas.width*this.scale,this.canvas.height*this.scale),this.signaturePad.clear()),this.hasDrawnStroke=!1,void(this.valueWasChangedFromLastUpload=!1);if(this.storeDataAsText)this.fromDataUrl(e);else if(this.loadedData)this.fromDataUrl(this.loadedData);else{var n=e?[e]:[];this._previewLoader&&this._previewLoader.dispose(),this.isFileLoading=!0,this._previewLoader=new Sr(this,function(n,i){"success"===n&&i&&i.length>0&&i[0].content?(t.fromDataUrl(i[0].content),t.isFileLoading=!1):"skipped"===n&&t.fromUrl(e),t._previewLoader.dispose(),t._previewLoader=void 0}),this._previewLoader.load(n)}},i.prototype.onChangeQuestionValue=function(t){e.prototype.onChangeQuestionValue.call(this,t),this.isLoadingFromJson||(this._loadedData=void 0,this.loadPreview(t))},i.prototype.onSurveyLoad=function(){e.prototype.onSurveyLoad.call(this),this.loadPreview(this.value)},i.prototype.initSignaturePad=function(e){var t=this,n=e.getElementsByTagName("canvas")[0];this.canvas=n,this.resizeCanvas();var i=new Jr(n,{backgroundColor:"#ffffff"});this.signaturePad=i,this.isInputReadOnly&&i.off(),this.readOnlyChangedCallback=function(){t.isInputReadOnly?i.off():i.on()},this.updateColors(i),i.addEventListener("beginStroke",function(){t.scaleCanvas(),t.hasDrawnStroke=!0,n.focus()},{once:!1}),i.addEventListener("endStroke",function(){t.storeDataAsText?t.updateValue():t.valueWasChangedFromLastUpload=!0},{once:!1}),this.updateValueHandler(),this.readOnlyChangedCallback();var o=function(e,n){"signatureWidth"!==n.name&&"signatureHeight"!==n.name||t.valueIsUpdatingInternally||t.updateValueHandler()};this.onPropertyChanged.add(o),this.signaturePad.propertyChangedHandler=o},i.prototype.destroySignaturePad=function(e){this.signaturePad&&(this.onPropertyChanged.remove(this.signaturePad.propertyChangedHandler),this.signaturePad.off()),this.readOnlyChangedCallback=null,this.signaturePad=null},Object.defineProperty(i.prototype,"containerHeight",{get:function(){return this.signatureHeight||200},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"containerWidth",{get:function(){return this.signatureWidth||300},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"renderedCanvasWidth",{get:function(){return this.signatureAutoScaleEnabled?"100%":this.containerWidth+"px"},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"canShowClearButton",{get:function(){var e=!this.nothingIsDrawn(),t=this.isUploading;return!this.isInputReadOnly&&this.allowClear&&e&&!t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"clearButtonCaption",{get:function(){return this.getLocalizationString("clearCaption")},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"locRenderedPlaceholder",{get:function(){return this.isReadOnly?this.locPlaceholderReadOnly:this.locPlaceholder},enumerable:!1,configurable:!0}),i.prototype.nothingIsDrawn=function(){var e=this.hasDrawnStroke,t=this.isEmpty(),n=this.isUploading,i=this.valueWasChangedFromLastUpload;return!e&&t&&!n&&!i},i.prototype.needShowPlaceholder=function(){return this.showPlaceholder&&this.nothingIsDrawn()},i.prototype.onBlurCore=function(t){if(e.prototype.onBlurCore.call(this,t),!this.storeDataAsText&&!this.element.contains(t.relatedTarget)){if(!this.valueWasChangedFromLastUpload)return;this.uploadFiles([(n=this.signaturePad.toDataURL(this.getFormat()),i=this.name+"."+Yr(this.dataFormat),o=this.getFormat(),r=atob(n.split(",")[1]),s=new Uint8Array(r.split("").map(function(e){return e.charCodeAt(0)})).buffer,new File([s],i,{type:o}))],"signature"),this.valueWasChangedFromLastUpload=!1}var n,i,o,r,s},i.prototype.uploadResultItemToValue=function(e){return e.content},i.prototype.setValueFromResult=function(e){this.valueIsUpdatingInternally=!0,this.value=(null==e?void 0:e.length)?e.map(function(e){return e.content})[0]:void 0,this.valueIsUpdatingInternally=!1},i.prototype.onClearValue=function(){e.prototype.onClearValue.call(this),this.valueWasChangedFromLastUpload=!1,this._loadedData=void 0,this.loadPreview(this.value)},i.prototype.endLoadingFromJson=function(){e.prototype.endLoadingFromJson.call(this),300===this.signatureWidth&&this.width&&"number"==typeof this.width&&this.width&&(Z.warn("Use signatureWidth property to set width for the signature pad"),this.signatureWidth=this.width,this.width=void 0),200===this.signatureHeight&&this.height&&(Z.warn("Use signatureHeight property to set width for the signature pad"),this.signatureHeight=this.height,this.height=void 0)},v([qe({defaultValue:!1})],i.prototype,"hasDrawnStroke",void 0),v([qe({defaultValue:!1})],i.prototype,"isReadyForUpload",void 0),v([qe({defaultValue:!1})],i.prototype,"valueWasChangedFromLastUpload",void 0),v([qe({onSetting:function(e){return Yr(e)}})],i.prototype,"dataFormat",void 0),v([qe()],i.prototype,"signatureWidth",void 0),v([qe()],i.prototype,"signatureHeight",void 0),v([qe()],i.prototype,"signatureAutoScaleEnabled",void 0),v([qe()],i.prototype,"penMinWidth",void 0),v([qe()],i.prototype,"penMaxWidth",void 0),v([qe()],i.prototype,"height",void 0),v([qe()],i.prototype,"allowClear",void 0),v([qe()],i.prototype,"penColor",void 0),v([qe()],i.prototype,"backgroundColor",void 0),v([qe()],i.prototype,"backgroundImage",void 0),v([qe({})],i.prototype,"showPlaceholder",void 0),v([qe({localizable:{defaultStr:"signaturePlaceHolder",markdown:!0}})],i.prototype,"placeholder",void 0),v([qe({localizable:{defaultStr:"signaturePlaceHolderReadOnly",markdown:!0}})],i.prototype,"placeholderReadOnly",void 0),i}(Pr);function Yr(e){return e||(e="png"),"jpeg"!==(e=e.replace("image/","").replace("+xml",""))&&"svg"!==e&&(e="png"),e}Q.addClass("signaturepad",[{name:"signatureWidth:number",default:300},{name:"signatureHeight:number",default:200},{name:"signatureAutoScaleEnabled:boolean",default:!1},{name:"penMinWidth:number",default:.5},{name:"penMaxWidth:number",default:2.5},{name:"height:number",visible:!1},{name:"allowClear:boolean",default:!0},{name:"showPlaceholder:boolean",default:!0},{name:"placeholder:text",serializationProperty:"locPlaceholder",dependsOn:"showPlaceholder",visibleIf:function(e){return e.showPlaceholder}},{name:"placeholderReadOnly:text",serializationProperty:"locPlaceholderReadOnly",dependsOn:"showPlaceholder",visibleIf:function(e){return e.showPlaceholder}},{name:"backgroundImage:file"},{name:"penColor:color"},{name:"backgroundColor:color"},{name:"dataFormat",default:"png",choices:[{value:"png",text:"PNG"},{value:"jpeg",text:"JPEG"},{value:"svg",text:"SVG"}],onSettingValue:function(e,t){return Yr(t)}},{name:"defaultValue",visible:!1},{name:"correctAnswer",visible:!1},{name:"storeDataAsText:boolean",default:!0},{name:"waitForUpload:boolean",default:!1}],function(){return new Kr("")},"question"),$n.Instance.registerQuestion("signaturepad",function(e){return new Kr(e)});var Xr=function(e){function t(t){var n=e.call(this,t)||this;return n.item=t,n}return y(t,e),t.prototype.getNextName=function(){return r.expressionVariables.nextPanel},t.prototype.getPrevName=function(){return r.expressionVariables.prevPanel},t.prototype.getVisibleItem=function(e){return e<0||e>=this.getPanels(!0).length?null:this.getPanels(!0)[e].data},t.prototype.getSpecificValue=function(e){var t=e.path;if(t.length>1&&t[0].name.toLocaleLowerCase()===r.expressionVariables.parentPanel.toLocaleLowerCase()){var n=this.item.data;if(n&&n.parentQuestion&&n.parent&&n.parent.data)return t[0].name=this.variableName,e.isRoot=!0,n.parent.data.getValueGetterContext().getValue(e)}return null},t.prototype.getTextValue=function(t,n,i){return t=t.toLocaleLowerCase(),[this.indexVar,this.visIndexVar].indexOf(t)>-1&&n>-1&&n++,e.prototype.getTextValue.call(this,t,n,i)},Object.defineProperty(t.prototype,"indexVar",{get:function(){return r.expressionVariables.panelIndex.toLocaleLowerCase()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"visIndexVar",{get:function(){return r.expressionVariables.visiblePanelIndex.toLocaleLowerCase()},enumerable:!1,configurable:!0}),t.prototype.getItemVariableNames=function(){return[r.expressionVariables.panelIndex,r.expressionVariables.visiblePanelIndex]},t.prototype.getItemValue=function(e){return(e=e.toLocaleLowerCase())===this.indexVar?this.panelIndex:e==this.visIndexVar?this.visibleIndex:void 0},Object.defineProperty(t.prototype,"panelIndex",{get:function(){return this.getPanels(!1).indexOf(this.item.panel)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"visibleIndex",{get:function(){return this.getPanels(!0).indexOf(this.item.panel)},enumerable:!1,configurable:!0}),t.prototype.getPanels=function(e){var t=this.item.data;return t?e?t.visiblePanels:t.panels:[]},t}(di),Zr=function(e){function t(t){var n=e.call(this,t)||this;return n.question=t,n}return y(t,e),t.prototype.getValue=function(t){var n=t.path,i=this.question,o=t.index;if(o>-1&&i.isDesignMode&&n.length>0){var r=n[0].name,s=i.template.getQuestionByName(r);return s?(n.shift(),0===n.length?{isFound:!0}:s.getValueGetterContext().getValue(t)):{isFound:!1}}if(o>-1){if(o>=0&&o<i.panels.length){var a=i.panels[o].data;return t.isRoot=!1,a.getValueGetterContext().getValue(t)}return{isFound:!1,value:void 0,context:this}}return!t.createObjects&&this.question.isEmpty()?{isFound:0===n.length,value:void 0}:e.prototype.getValue.call(this,t)},t}(cn),$r=function(e){function t(t){return e.call(this,t)||this}return y(t,e),t}(rt),es=function(e){function t(t,n){var i=e.call(this,t)||this;return i.data=t,i.data=t,i.panelValue=n,i.setSurveyImpl(),i}return y(t,e),Object.defineProperty(t.prototype,"panel",{get:function(){return this.panelValue},enumerable:!1,configurable:!0}),t.prototype.setSurveyImpl=function(){this.panel.setSurveyImpl(this)},t.prototype.getValueGetterContext=function(){return new Xr(this)},t.prototype.getVariableName=function(){return r.expressionVariables.panel},t.prototype.getQuestionsByValueName=function(e,t){return this.panel.getQuestionsByValueName(e,t)},t.prototype.getQuestionByName=function(e){return this.panel.getQuestionByName(e)},t.prototype.getIndex=function(){return this.data.getItemIndex(this)},Object.defineProperty(t.prototype,"questions",{get:function(){return this.panel.questions},enumerable:!1,configurable:!0}),t.prototype.setValue=function(e,t){!this.isSettingValue&&this.isValueChanged(e,t)&&(this.updateSharedQuestionsValue(e,t),this.data.updateItemValue(this,e,f.getUnbindValue(t),!1),this.runTriggersOnSetValue(e,t))},t.prototype.getComment=function(e){var t=this.getValue(e+r.commentSuffix);return t||""},t.prototype.setComment=function(e,t,n){this.setValue(e+r.commentSuffix,t)},t}(fi),ts=function(){function e(e){this.data=e}return e.prototype.getSurveyData=function(){return null},e.prototype.getSurvey=function(){return this.data.getSurvey()},e.prototype.getTextProcessor=function(){return null},e}(),ns=function(e){function t(t){var n=e.call(this,t)||this;return n._renderedPanels=[],n.isPanelsAnimationRunning=!1,n.isAddingNewPanels=!1,n.isSetPanelItemData={},n.createNewArray("panels",function(e){n.onPanelAdded(e)},function(e){n.onPanelRemoved(e)}),n.createNewArray("visiblePanels"),n.templateValue=n.createAndSetupNewPanelObject(),n.template.renderWidth="100%",n.template.selectedElementInDesign=n,n.template.addElementCallback=function(e){n.addOnPropertyChangedCallback(e),n.rebuildPanels()},n.template.removeElementCallback=function(){n.rebuildPanels()},n}return y(t,e),Object.defineProperty(t.prototype,"dynamicPanelCallbacks",{get:function(){return this.survey},enumerable:!1,configurable:!0}),t.prototype.onPropertyValueChanged=function(t,n,i){e.prototype.onPropertyValueChanged.call(this,t,n,i),"panelsState"===t&&this.setPanelsState();["newPanelPosition","displayMode","showProgressBar"].indexOf(t)>-1&&this.updateFooterActions(),"allowAddPanel"===t&&this.updateNoEntriesTextDefaultLoc(),"minPanelCount"===t&&this.onMinPanelCountChanged(),"maxPanelCount"===t&&this.onMaxPanelCountChanged();if(["templateQuestionTitleLocation","templateQuestionTitleWidth"].indexOf(t)>-1){var o=this.visiblePanelsCore;o&&o.forEach(function(e){e.updateElementCss(!0)})}"showQuestionNumbers"===t&&this.survey&&this.lifecycleCallbacks.questionVisibilityChanged(this,this.visible,!0),"tabAlign"===t&&this.isRenderModeTab&&(this.tabbedMenu.containerCss=this.getTabbedMenuCss())},t.prototype.validateExpressions=function(t){void 0===t&&(t={functions:!0,variables:!0,semantics:!0}),this.useTemplatePanel||new es(this,this.template);var n=e.prototype.validateExpressions.call(this,t);return this.useTemplatePanel||this.setTemplatePanelSurveyImpl(),n},Object.defineProperty(t.prototype,"isCompositeQuestion",{get:function(){return!0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isContainer",{get:function(){return!0},enumerable:!1,configurable:!0}),t.prototype.getFirstQuestionToFocus=function(e){for(var t=0,n=this.currentPanel?[this.currentPanel]:this.visiblePanelsCore;t<n.length;t++){var i=n[t].getFirstQuestionToFocus(e);if(i)return i}return this.showAddPanelButton&&(!e||this.currentErrorCount>0)?this:null},t.prototype.getFirstInputElementId=function(){var t=this.getFirstQuestionToFocus(!1);return t&&t!==this?t.inputId:this.showAddPanelButton?this.addButtonId:e.prototype.getFirstInputElementId.call(this)},t.prototype.getFirstErrorInputElementId=function(){var t=this.getFirstQuestionToFocus(!0);return t?t.inputId:e.prototype.getFirstErrorInputElementId.call(this)},t.prototype.setSurveyImpl=function(t,n){e.prototype.setSurveyImpl.call(this,t,n),this.setTemplatePanelSurveyImpl(),this.setPanelsSurveyImpl()},t.prototype.getFilteredData=function(){return this.value},t.prototype.assignOnPropertyChangedToTemplate=function(){for(var e=this.template.elements,t=0;t<e.length;t++)this.addOnPropertyChangedCallback(e[t])},t.prototype.addOnPropertyChangedCallback=function(e){var t=this;e.isQuestion&&e.setParentQuestion(this),e.onPropertyChanged.add(function(e,n){t.onTemplateElementPropertyChanged(e,n)}),e.isPanel&&(e.addElementCallback=function(e){t.addOnPropertyChangedCallback(e)})},t.prototype.onTemplateElementPropertyChanged=function(e,t){if(!this.isLoadingFromJson&&!this.useTemplatePanel&&0!=this.panelsCore.length&&Q.findProperty(e.getType(),t.name))for(var n=this.panelsCore,i=0;i<n.length;i++){var o=n[i].getQuestionByName(e.name);o&&o[t.name]!==t.newValue&&(o[t.name]=t.newValue)}},Object.defineProperty(t.prototype,"useTemplatePanel",{get:function(){return this.isDesignMode&&!this.isContentElement},enumerable:!1,configurable:!0}),t.prototype.getType=function(){return"paneldynamic"},t.prototype.getAllChildren=function(){return b(b([],e.prototype.getAllChildren.call(this),!0),this.templateElements,!0)},t.prototype.clearOnDeletingContainer=function(){this.panelsCore.forEach(function(e){e.clearOnDeletingContainer()})},Object.defineProperty(t.prototype,"isAllowTitleLeft",{get:function(){return!1},enumerable:!1,configurable:!0}),t.prototype.removeElement=function(e){return this.template.removeElement(e)},Object.defineProperty(t.prototype,"template",{get:function(){return this.templateValue},enumerable:!1,configurable:!0}),t.prototype.getPanelInDesignMode=function(){return this.template},t.prototype.getPanels=function(){return[this.template]},Object.defineProperty(t.prototype,"templateElements",{get:function(){return this.template.elements},enumerable:!1,configurable:!0}),t.prototype.isPropertyStoredInHash=function(t){return"templateElements"!==t&&e.prototype.isPropertyStoredInHash.call(this,t)},t.prototype.mergeLocalizationWithInnerObjects=function(e,t){var n=e.template;n&&this.template.mergeLocalizationObj(n,t)},Object.defineProperty(t.prototype,"templateTitle",{get:function(){return this.template.title},set:function(e){this.template.title=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"locTemplateTitle",{get:function(){return this.template.locTitle},enumerable:!1,configurable:!0}),t.prototype.getLocalizableString=function(t){return"templateTitle"===t?this.template.locTitle:"templateDescription"===t?this.template.locDescription:e.prototype.getLocalizableString.call(this,t)},Object.defineProperty(t.prototype,"templateDescription",{get:function(){return this.template.description},set:function(e){this.template.description=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"locTemplateDescription",{get:function(){return this.template.locDescription},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"templateVisibleIf",{get:function(){return this.getPropertyValue("templateVisibleIf")},set:function(e){this.setPropertyValue("templateVisibleIf",e),this.template.visibleIf=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"questionStartIndex",{get:function(){return this.template.questionStartIndex},set:function(e){this.template.questionStartIndex=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"items",{get:function(){for(var e=[],t=0;t<this.panelsCore.length;t++)e.push(this.panelsCore[t].data);return e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"panels",{get:function(){return this.buildPanelsFirstTime(this.canBuildPanels),this.panelsCore},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"visiblePanels",{get:function(){return this.buildPanelsFirstTime(this.canBuildPanels),this.visiblePanelsCore},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"panelsCore",{get:function(){return this.getPropertyValue("panels")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"visiblePanelsCore",{get:function(){return this.getPropertyValue("visiblePanels")},enumerable:!1,configurable:!0}),t.prototype.onPanelAdded=function(e){if(this.onPanelRemovedCore(e),e.visible){for(var t=0,n=this.panelsCore,i=0;i<n.length&&n[i]!==e;i++)n[i].visible&&t++;this.visiblePanelsCore.splice(t,0,e),this.addTabFromToolbar(e,t),this.currentPanel||(this.currentPanel=e),this.updateRenderedPanels()}},t.prototype.onPanelRemoved=function(e){var t=this.onPanelRemovedCore(e);if(this.currentPanel===e){var n=this.visiblePanelsCore;t>=n.length&&(t=n.length-1),this.currentPanel=t>=0?n[t]:null}this.updateRenderedPanels()},t.prototype.onPanelRemovedCore=function(e){var t=this.visiblePanelsCore,n=t.indexOf(e);return n>-1&&(t.splice(n,1),this.removeTabFromToolbar(e)),n},Object.defineProperty(t.prototype,"currentIndex",{get:function(){return this.isRenderModeList?-1:this.useTemplatePanel?0:this.visiblePanelsCore.indexOf(this.currentPanel)},set:function(e){e<0||this.visiblePanelCount<1||(e>=this.visiblePanelCount&&(e=this.visiblePanelCount-1),this.currentPanel=this.visiblePanelsCore[e])},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"currentPanel",{get:function(){if(this.isDesignMode)return this.template;if(this.isRenderModeList||this.useTemplatePanel)return null;var e=this.getPropertyValue("currentPanel",null);return!e&&this.visiblePanelCount>0&&(e=this.visiblePanelsCore[0],this.currentPanel=e),e},set:function(e){if(!this.isRenderModeList&&!this.useTemplatePanel){var t=this.getPropertyValue("currentPanel"),n=e?this.visiblePanelsCore.indexOf(e):-1;if(!(e&&n<0||e===t)&&(t&&t.onHidingContent(),e&&e.onFirstRendering(),this.setPropertyValue("currentPanel",e),this.updateRenderedPanels(),this.updateFooterActions(),this.updateTabToolbarItemsPressedState(),this.fireCallback(this.currentIndexChangedCallback),n>-1&&this.survey)){var i={panel:e,visiblePanelIndex:n};this.dynamicPanelCallbacks.dynamicPanelCurrentIndexChanged(this,i)}}},enumerable:!1,configurable:!0}),t.prototype.getUIState=function(){var t=e.prototype.getUIState.call(this),n=this.currentIndex;return n>0&&((t=t||{}).activePanelIndex=n),t},t.prototype.setUIState=function(t){e.prototype.setUIState.call(this,t),t.activePanelIndex&&(this.currentIndex=t.activePanelIndex)},t.prototype.updateRenderedPanels=function(){var e=this,t=[];this.isRenderModeList?t=[].concat(this.visiblePanels):this.currentPanel&&(t=[this.currentPanel]),t.forEach(function(t){return e.panelOnFirstRendering(t)}),this.renderedPanels=t},t.prototype.panelOnFirstRendering=function(e){e&&(e.onFirstRendering(),e.locStrsChanged())},Object.defineProperty(t.prototype,"renderedPanels",{get:function(){return this._renderedPanels},set:function(e){0==this.renderedPanels.length||0==e.length?(this.blockAnimations(),this.panelsAnimation.sync(e),this.releaseAnimations()):(this.isPanelsAnimationRunning=!0,this.panelsAnimation.sync(e))},enumerable:!1,configurable:!0}),t.prototype.getPanelsAnimationOptions=function(){var e=this,t=function(){if(e.isRenderModeList)return"";var t=new tt,n=!1,i=e.renderedPanels.filter(function(t){return t!==e.currentPanel})[0],o=e.visiblePanels.indexOf(i);return o<0&&(n=!0,o=e.removedPanelIndex),t.append("sv-pd-animation-adding",!!e.focusNewPanelCallback).append("sv-pd-animation-removing",n).append("sv-pd-animation-left",o<=e.currentIndex).append("sv-pd-animation-right",o>e.currentIndex).toString()};return{getRerenderEvent:function(){return e.onElementRerendered},getAnimatedElement:function(t){var n,i;if(t&&e.cssContent){var o=ft(e.cssContent);return null===(i=null===(n=e.getWrapperElement())||void 0===n?void 0:n.querySelector(":scope ".concat(o," #").concat(t.id)))||void 0===i?void 0:i.parentElement}},getEnterOptions:function(){return{onBeforeRunAnimation:function(t){if(e.focusNewPanelCallback){var n=e.isRenderModeList?t:t.parentElement;nn.ScrollElementToViewCore(n,!1,!1,{behavior:"smooth"})}!e.isRenderModeList&&t.parentElement?Zt(t.parentElement,{heightTo:t.offsetHeight+"px"}):$t(t)},onAfterRunAnimation:function(e){en(e),e.parentElement&&en(e.parentElement)},cssClass:(new tt).append(e.cssClasses.panelWrapperEnter).append(t()).toString()}},getLeaveOptions:function(){return{onBeforeRunAnimation:function(t){!e.isRenderModeList&&t.parentElement?Zt(t.parentElement,{heightFrom:t.offsetHeight+"px"}):$t(t)},onAfterRunAnimation:function(e){en(e),e.parentElement&&en(e.parentElement)},cssClass:(new tt).append(e.cssClasses.panelWrapperLeave).append(t()).toString()}},isAnimationEnabled:function(){return e.animationAllowed&&!!e.getWrapperElement()}}},t.prototype.disablePanelsAnimations=function(){this.panelsCore.forEach(function(e){e.blockAnimations()})},t.prototype.enablePanelsAnimations=function(){this.panelsCore.forEach(function(e){e.releaseAnimations()})},t.prototype.updatePanelsAnimation=function(){var e=this;this._panelsAnimations=new(this.isRenderModeList?Kt:Yt)(this.getPanelsAnimationOptions(),function(t,n){e._renderedPanels=t,n||(e.isPanelsAnimationRunning=!1,e.focusNewPanel())},function(){return e._renderedPanels})},Object.defineProperty(t.prototype,"panelsAnimation",{get:function(){return this._panelsAnimations||this.updatePanelsAnimation(),this._panelsAnimations},enumerable:!1,configurable:!0}),t.prototype.onHidingContent=function(){e.prototype.onHidingContent.call(this),this.currentPanel?this.currentPanel.onHidingContent():this.visiblePanelsCore.forEach(function(e){return e.onHidingContent()})},Object.defineProperty(t.prototype,"panelPrevText",{get:function(){return this.prevPanelText},set:function(e){this.prevPanelText=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"panelNextText",{get:function(){return this.nextPanelText},set:function(e){this.nextPanelText=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"panelAddText",{get:function(){return this.addPanelText},set:function(e){this.addPanelText=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"panelRemoveText",{get:function(){return this.removePanelText},set:function(e){this.removePanelText=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isProgressTopShowing",{get:function(){return"carousel"==this.displayMode&&("top"===this.progressBarLocation||"topBottom"===this.progressBarLocation)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isProgressBottomShowing",{get:function(){return"carousel"==this.displayMode&&("bottom"===this.progressBarLocation||"topBottom"===this.progressBarLocation)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isPrevButtonVisible",{get:function(){return this.currentIndex>0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isPrevButtonShowing",{get:function(){return this.isPrevButtonVisible},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isNextButtonVisible",{get:function(){return this.currentIndex>=0&&this.currentIndex<this.visiblePanelCount-1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isNextButtonShowing",{get:function(){return this.isNextButtonVisible},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isRangeShowing",{get:function(){return this.showProgressBar&&this.currentIndex>=0&&this.visiblePanelCount>1},enumerable:!1,configurable:!0}),t.prototype.getElementsInDesign=function(e){return void 0===e&&(e=!1),e?[this.template]:this.templateElements},t.prototype.prepareValueForPanelCreating=function(){this.addingNewPanelsValue=this.value,this.isAddingNewPanels=!0,this.isNewPanelsValueChanged=!1},t.prototype.setValueAfterPanelsCreating=function(){this.isAddingNewPanels=!1,this.isNewPanelsValueChanged&&(this.isValueChangingInternally=!0,this.value=this.addingNewPanelsValue,this.isValueChangingInternally=!1)},t.prototype.getValueCore=function(){return this.isAddingNewPanels?this.addingNewPanelsValue:e.prototype.getValueCore.call(this)},t.prototype.setValueCore=function(t){this.isAddingNewPanels?(this.isNewPanelsValueChanged=!0,this.addingNewPanelsValue=t):e.prototype.setValueCore.call(this,t)},t.prototype.setIsMobile=function(t){e.prototype.setIsMobile.call(this,t),(this.panelsCore||[]).forEach(function(e){return e.getQuestions(!0).forEach(function(e){e.setIsMobile(t)})})},t.prototype.themeChanged=function(t){e.prototype.themeChanged.call(this,t),(this.panelsCore||[]).forEach(function(e){return e.getQuestions(!0).forEach(function(e){e.themeChanged(t)})})},Object.defineProperty(t.prototype,"panelCount",{get:function(){return!this.canBuildPanels||this.wasNotRenderedInSurvey?this.getPropertyValue("panelCount"):this.panelsCore.length},set:function(e){if(!(e<0)){if(!this.isLoadingFromJson&&this.isDesignMode){var t=this.minPanelCount;e<t&&(e=t);var n=this.maxPanelCount;n>0&&e>n&&(e=n)}if(!this.canBuildPanels||this.wasNotRenderedInSurvey)return this.setPropertyValue("panelCount",e),void this.updateFooterActions();if(e!=this.panelsCore.length&&!this.useTemplatePanel){this.updateBindings("panelCount",e),this.prepareValueForPanelCreating();for(var i=e-this.panelCount===1,o=this.panelCount,r=this.panelCount;r<e;r++){var s=this.createNewPanel();this.panelsCore.push(s),"list"==this.displayMode&&"default"!=this.panelsState&&("expanded"===this.panelsState?s.expand():s.title&&s.collapse())}i&&this.singleInputOnAddItem(this.settingPanelCountBasedOnValue),e<this.panelCount&&this.panelsCore.splice(e,this.panelCount-e),this.disablePanelsAnimations(),this.setValueAfterPanelsCreating(),this.setValueBasedOnPanelCount(),this.reRunCondition(),this.updateFooterActions(),this.updateNewPanelsVisibleIndex(o),this.fireCallback(this.panelCountChangedCallback),this.enablePanelsAnimations()}}},enumerable:!1,configurable:!0}),t.prototype.updateNewPanelsVisibleIndex=function(e){if(this.survey){var t=this.getShowQuestionNumbers();if("onpanel"===t||"recursive"===t)for(var n=e;n<this.panelsCore.length;n++)this.panelsCore[n].setVisibleIndex(0)}},Object.defineProperty(t.prototype,"visiblePanelCount",{get:function(){return this.visiblePanels.length},enumerable:!1,configurable:!0}),t.prototype.getStructuredValue=function(e){if(void 0===e&&(e=-1),e<0||this.isEmpty()||!Array.isArray(this.value))return this.value;for(var t=new Array,n=Math.min(this.visiblePanelCount,this.value.length),i=0;i<n;i++){var o={};this.visiblePanels[i].collectValues(o,e),t.push(o)}return t},t.prototype.setTemplatePanelSurveyImpl=function(){this.template.setSurveyImpl(this.useTemplatePanel?this.surveyImpl:new ts(this))},t.prototype.setPanelsSurveyImpl=function(){for(var e=0;e<this.panelsCore.length;e++){var t=this.panelsCore[e];t!=this.template&&t.setSurveyImpl(t.data)}},t.prototype.setPanelsState=function(){if(!this.useTemplatePanel&&"list"==this.displayMode&&this.templateTitle)for(var e=0;e<this.panelsCore.length;e++){var t=this.panelsState;"firstExpanded"===t&&(t=0===e?"expanded":"collapsed"),"expanded"===t?this.panelsCore[e].expand(!1):this.panelsCore[e].state=t}},t.prototype.setValueBasedOnPanelCount=function(){var e=this.value;if(e&&Array.isArray(e)||(e=[]),e.length!=this.panelCount){for(var t=e.length;t<this.panelCount;t++){var n=this.panels[t].getValue(),i=f.isValueEmpty(n)?{}:n;e.push(i)}e.length>this.panelCount&&e.splice(this.panelCount,e.length-this.panelCount),this.isValueChangingInternally=!0,this.value=e,this.isValueChangingInternally=!1}},t.prototype.onMinPanelCountChanged=function(){var e=this.minPanelCount;e>this.maxPanelCount&&(this.maxPanelCount=e),this.panelCount<e&&(this.panelCount=e)},t.prototype.onMaxPanelCountChanged=function(){var e=this.maxPanelCount;e<this.minPanelCount&&(this.minPanelCount=e),this.panelCount>e&&(this.panelCount=e),this.updateFooterActions()},Object.defineProperty(t.prototype,"addButtonId",{get:function(){return this.id+"addPanel"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"templateTitleLocation",{get:function(){return this.templateQuestionTitleLocation},set:function(e){this.templateQuestionTitleLocation=e},enumerable:!1,configurable:!0}),t.prototype.resetSingleInput=function(){e.prototype.resetSingleInput.call(this),this.locTemplateTitle.onGetTextCallback=null},Object.defineProperty(t.prototype,"locEditPanelText",{get:function(){return this.getOrCreateLocStr("editPanelText",!1,"editText")},enumerable:!1,configurable:!0}),t.prototype.createSingleInputBehavior=function(){return new is(this)},t.prototype.getShowQuestionNumbers=function(){var e,t=this.showQuestionNumbers;if("default"===t){var n=null===(e=this.survey)||void 0===e?void 0:e.showQuestionNumbers;if("recursive"===n)return n}return t},t.prototype.notifySurveyOnChildrenVisibilityChanged=function(){return"default"===this.showQuestionNumbers},Object.defineProperty(t.prototype,"panelRemoveButtonLocation",{get:function(){return this.removePanelButtonLocation},set:function(e){this.removePanelButtonLocation=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"showRangeInProgress",{get:function(){return this.showProgressBar},set:function(e){this.showProgressBar=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"renderMode",{get:function(){var e=this.displayMode;if("carousel"==e){var t=this.progressBarLocation;if("top"==t)return"progressTop";if("bottom"==t)return"progressBottom";if("topBottom"==t)return"progressTopBottom"}return e},set:function(e){(e||"").startsWith("progress")?("progressTop"==e?this.progressBarLocation="top":"progressBottom"==e?this.progressBarLocation="bottom":"progressTopBottom"==e&&(this.progressBarLocation="topBottom"),this.displayMode="carousel"):this.displayMode=e},enumerable:!1,configurable:!0}),t.prototype.updatePanelView=function(){this.blockAnimations(),this.updateRenderedPanels(),this.releaseAnimations(),this.updatePanelsAnimation()},Object.defineProperty(t.prototype,"isRenderModeList",{get:function(){return"list"===this.displayMode||this.isSingleInputActive},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isRenderModeTab",{get:function(){return"tab"===this.displayMode&&!this.isSingleInputActive},enumerable:!1,configurable:!0}),t.prototype.setVisibleIndex=function(t){var n=this.isDesignMode?[this.template]:this.visiblePanelsCore;if(this.isVisibleIndexNegative(t))return n.forEach(function(e){return e.setVisibleIndex(-1)}),e.prototype.setVisibleIndex.call(this,-1);for(var i=this.getShowQuestionNumbers(),o="default"===i,r=o?t:0,s=0;s<n.length;s++){var a=this.setPanelVisibleIndex(n[s],r,"off"!=i);o&&(r+=a)}return e.prototype.setVisibleIndex.call(this,o?-1:t),o?r-t:1},t.prototype.setPanelVisibleIndex=function(e,t,n){return n?e.setVisibleIndex(t):(e.setVisibleIndex(-1),0)},Object.defineProperty(t.prototype,"canAddPanel",{get:function(){return!this.isDesignMode&&(!(!this.legacyNavigation&&!this.isRenderModeList&&this.currentIndex<this.visiblePanelCount-1&&"next"!==this.newPanelPosition)&&(this.allowAddPanel&&!this.isReadOnly&&this.panelCount<this.maxPanelCount))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"canRemovePanel",{get:function(){return!this.isDesignMode&&(this.allowRemovePanel&&!this.isReadOnly&&this.panelCount>this.minPanelCount)},enumerable:!1,configurable:!0}),t.prototype.rebuildPanels=function(){var e;if(!this.isLoadingFromJson){this.prepareValueForPanelCreating();var t=[];if(this.useTemplatePanel)new es(this,this.template),t.push(this.template);else for(var n=0;n<this.panelCount;n++)t.push(this.createNewPanel());(e=this.panelsCore).splice.apply(e,b([0,this.panelsCore.length],t,!1)),this.setValueAfterPanelsCreating(),this.setPanelsState(),this.reRunCondition(),this.updateFooterActions(),this.fireCallback(this.panelCountChangedCallback),this.updateTabToolbar()}},Object.defineProperty(t.prototype,"defaultValueFromLastPanel",{get:function(){return this.copyDefaultValueFromLastEntry},set:function(e){this.copyDefaultValueFromLastEntry=e},enumerable:!1,configurable:!0}),t.prototype.isDefaultValueEmpty=function(){return e.prototype.isDefaultValueEmpty.call(this)&&this.isValueEmpty(this.defaultPanelValue)},t.prototype.setDefaultValue=function(){if(!this.isValueEmpty(this.defaultPanelValue)&&this.isValueEmpty(this.defaultValue)){if(this.isEmpty()&&0!=this.panelCount){for(var t=[],n=0;n<this.panelCount;n++)t.push(this.defaultPanelValue);this.value=t}}else e.prototype.setDefaultValue.call(this)},Object.defineProperty(t.prototype,"isValueArray",{get:function(){return!0},enumerable:!1,configurable:!0}),t.prototype.isEmpty=function(){var e=this.value;if(!e||!Array.isArray(e))return!0;for(var t=0;t<e.length;t++)if(!this.isRowEmpty(e[t]))return!1;return!0},t.prototype.getProgressInfo=function(){return nn.getProgressInfoByElements(this.visiblePanelsCore,this.isRequired)},t.prototype.isRowEmpty=function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0},t.prototype.addPanelUI=function(){return this.addPanel(void 0,!0)},t.prototype.addPanel=function(e,t){var n=!0===t;if(n){if(!this.canAddPanel)return null;if(!this.canLeaveCurrentPanel())return null}var i=this.addPanelCore(e);return this.panelOnFirstRendering(i),n&&("list"===this.displayMode&&"default"!==this.panelsState&&i.expand(),this.focusNewPanelCallback=function(){null==i||i.focusFirstQuestion()},this.isPanelsAnimationRunning||this.focusNewPanel()),i},t.prototype.addPanelCore=function(e){var t=this.currentIndex;return void 0===e&&(e=t<0?this.panelCount:t+1),(e<0||e>this.panelCount)&&(e=this.panelCount),this.updateValueOnAddingPanel(t<0?this.panelCount-1:t,e),this.isRenderModeList||(this.currentIndex=e),this.notifyOnPanelAddedRemoved(!0,e),this.panelsCore[e]},t.prototype.focusNewPanel=function(){this.focusNewPanelCallback&&(this.focusNewPanelCallback(),this.focusNewPanelCallback=void 0)},t.prototype.updateValueOnAddingPanel=function(e,t){this.panelCount++;var n=this.value;if(Array.isArray(n)&&n.length===this.panelCount){var i=!1,o=this.panelCount-1;if(t<o){i=!0;var r=n[o];n.splice(o,1),n.splice(t,0,r)}if(this.isValueEmpty(this.defaultPanelValue)||(i=!0,this.copyValue(n[t],this.defaultPanelValue)),this.copyDefaultValueFromLastEntry&&n.length>1){var s=e>-1&&e<=o?e:o;i=!0,this.copyValue(n[t],n[s])}i&&(this.value=n)}},t.prototype.canLeaveCurrentPanel=function(){return"list"===this.displayMode||!this.currentPanel||this.currentPanel.validate(!0,!0)},t.prototype.copyValue=function(e,t){for(var n in t)e[n]=t[n]},t.prototype.getPanelRemoveButtonId=function(e){return e.id+"_remove_button"},t.prototype.isRequireConfirmOnDelete=function(e){if(!this.confirmDelete)return!1;var t=this.getVisualPanelIndex(e);if(t<0||t>=this.visiblePanelCount)return!1;var n=this.visiblePanelsCore[t].getValue();return!this.isValueEmpty(n)&&(this.isValueEmpty(this.defaultPanelValue)||!this.isTwoValueEquals(n,this.defaultPanelValue))},t.prototype.goToNextPanel=function(){return!(this.currentIndex<0)&&(!!this.canLeaveCurrentPanel()&&(this.currentIndex++,!0))},t.prototype.goToPrevPanel=function(){this.currentIndex<0||this.currentIndex--},t.prototype.removePanelUI=function(e){this.removePanel(e,this.isRequireConfirmOnDelete(e))},t.prototype.removePanel=function(e,t){var n=this,i=this.getVisualPanelIndex(e);if(!(i<0||i>=this.visiblePanelCount))if(void 0!==t){if(!this.canRemovePanel)return;var o=function(){var e;n.removePanelCore(i);var t=n.visiblePanelCount,o=i>=t?t-1:i,r=0===t?n.addButtonId:o>-1?n.getPanelRemoveButtonId(n.visiblePanels[o]):"";r&&nn.FocusElement(r,!0,null===(e=n.survey)||void 0===e?void 0:e.rootElement)};t?Ei({message:this.confirmDeleteText,funcOnYes:function(){o()},locale:this.getLocale(),rootElement:this.survey.rootElement,cssClass:this.cssClasses.confirmDialog}):o()}else this.removePanelCore(i)},t.prototype.removePanelCore=function(e){this.removedPanelIndex=e;var t=this.visiblePanelsCore[e],n=this.panelsCore.indexOf(t);if(!(n<0)&&(!this.survey||this.dynamicPanelCallbacks.dynamicPanelRemoving(this,n,t))){this.panelsCore.splice(n,1),this.setPropertyValue("panelCount",this.panelCount),this.singleInputOnRemoveItem(e);var i=this.value;!i||!Array.isArray(i)||n>=i.length?this.updateFooterActions():(this.isValueChangingInternally=!0,i.splice(n,1),this.value=i,this.updateFooterActions(),this.fireCallback(this.panelCountChangedCallback),this.notifyOnPanelAddedRemoved(!1,n,t),this.isValueChangingInternally=!1)}},t.prototype.notifyOnPanelAddedRemoved=function(e,t,n){n||(n=this.panelsCore[t]);var i=this.getShowQuestionNumbers();if(this.survey){var o="default"===i;e?this.dynamicPanelCallbacks.dynamicPanelAdded(this,t,n,o):this.dynamicPanelCallbacks.dynamicPanelRemoved(this,t,n,o)}e&&n&&("onpanel"===i||"recursive"===i)&&n.setVisibleIndex(0)},t.prototype.recursiveNoCallback=function(){return"recursive"===this.getShowQuestionNumbers()?this.no:""},t.prototype.getVisualPanelIndex=function(e){if(f.isNumber(e))return e;for(var t=this.visiblePanelsCore,n=0;n<t.length;n++)if(t[n]===e||t[n].data===e)return n;return-1},t.prototype.getPanelVisibleIndexById=function(e){for(var t=this.visiblePanelsCore,n=0;n<t.length;n++)if(t[n].id===e)return n;return-1},t.prototype.locStrsChanged=function(){e.prototype.locStrsChanged.call(this),this.locTemplateTitle.strChanged();for(var t=this.panelsCore,n=0;n<t.length;n++)t[n].locStrsChanged();this.tabbedMenu&&this.tabbedMenu.locStrsChanged()},t.prototype.randomSeedChanged=function(){for(var e=this.panelsCore,t=0;t<e.length;t++)e[t].randomSeedChanged()},t.prototype.clearIncorrectValues=function(){for(var e=0;e<this.panelsCore.length;e++)this.clearIncorrectValuesInPanel(e)},t.prototype.clearErrors=function(){e.prototype.clearErrors.call(this);for(var t=0;t<this.panelsCore.length;t++)this.panelsCore[t].clearErrors()},t.prototype.getQuestionFromArray=function(e,t){return t<0||t>=this.panelsCore.length?null:this.panelsCore[t].getQuestionByName(e)},t.prototype.clearIncorrectValuesInPanel=function(e){var t=this.panelsCore[e];t.clearIncorrectValues();var n=this.value,i=n&&e<n.length?n[e]:null;if(i){var o=!1;for(var s in i){if(!this.getSharedQuestionFromArray(s,e))t.getQuestionByValueName(s)||this.iscorrectValueWithPostPrefix(t,s,r.commentSuffix)||this.iscorrectValueWithPostPrefix(t,s,r.matrix.totalsSuffix)||(delete i[s],o=!0)}o&&(n[e]=i,this.value=n)}},t.prototype.iscorrectValueWithPostPrefix=function(e,t,n){return t.indexOf(n)===t.length-n.length&&!!e.getQuestionByName(t.substring(0,t.indexOf(n)))},t.prototype.getSharedQuestionFromArray=function(e,t){return this.survey&&this.valueName?this.survey.getQuestionByValueNameFromArray(this.valueName,e,t):null},t.prototype.addConditionObjectsByContext=function(e,t){for(var n=(null==t?void 0:t.isValidator)?t.errorOwner:t,i=!!t&&(!0===t||this.template.questions.indexOf(n)>-1),o=new Array,s=this.template.questions,a=0;a<s.length;a++)s[a].addConditionObjectsByContext(o,t);for(var l=0;l<r.panel.maxPanelCountInCondition;l++){var u="["+l+"].",p=this.getValueName()+u,c=this.processedTitle+u;for(a=0;a<o.length;a++)o[a].context?e.push(o[a]):e.push({name:p+o[a].name,text:c+o[a].text,question:o[a].question})}if(i){p=!0===t?this.getValueName()+".":"",c=!0===t?this.processedTitle+".":"";var h=r.expressionVariables.panel+".";for(a=0;a<o.length;a++)if(o[a].question!=t){var d={name:p+h+o[a].name,text:c+h+o[a].text,question:o[a].question};d.context=this,e.push(d)}}},t.prototype.collectNestedQuestionsCore=function(e,t,n,i){i&&e.push(this);var o=t?this.visiblePanelsCore:this.panelsCore;Array.isArray(o)&&o.forEach(function(o){o.questions.forEach(function(o){return o.addNestedQuestion(e,t,n,i)})})},t.prototype.getConditionJson=function(t,n){if(void 0===t&&(t=null),void 0===n&&(n=null),!n)return e.prototype.getConditionJson.call(this,t);var i=n,o=n.indexOf(".");o>-1&&(i=n.substring(0,o),n=n.substring(o+1));var r=this.template.getQuestionByName(i);return r?r.getConditionJson(t,n):null},t.prototype.onReadOnlyChanged=function(){var t=this.isReadOnly;this.template.readOnly=t;for(var n=0;n<this.panelsCore.length;n++)this.panelsCore[n].readOnly=t;this.updateNoEntriesTextDefaultLoc(),this.updateFooterActions(),e.prototype.onReadOnlyChanged.call(this)},t.prototype.updateNoEntriesTextDefaultLoc=function(){var e=this.getLocalizableString("noEntriesText");e&&(e.localizationName=this.getNoEntriesLocalizationName())},t.prototype.getNoEntriesLocalizationName=function(){return this.isReadOnly||!this.allowAddPanel?"noEntriesReadonlyText":"noEntriesText"},t.prototype.onSurveyLoad=function(){this.template.readOnly=this.isReadOnly,this.template.onSurveyLoad();var t=this.adjustPanelCount();t>-1&&this.setPropertyValue("panelCount",t),e.prototype.onSurveyLoad.call(this)},t.prototype.adjustPanelCount=function(){var e=this.getPropertyValue("panelCount");return e<this.minPanelCount?this.minPanelCount:e>this.maxPanelCount?this.maxPanelCount:-1},t.prototype.buildPanelsFirstTime=function(e){if(void 0===e&&(e=!1),!this.hasPanelBuildFirstTime&&(e||!this.wasNotRenderedInSurvey)){if(this.blockAnimations(),this.hasPanelBuildFirstTime=!0,this.isBuildingPanelsFirstTime=!0,this.getPropertyValue("panelCount")>0&&(this.panelCount=this.getPropertyValue("panelCount")),this.useTemplatePanel&&this.rebuildPanels(),this.setPanelsSurveyImpl(),this.setPanelsState(),this.assignOnPropertyChangedToTemplate(),this.data&&this.isValueChangedWithoutPanels&&(this.isValueChangedWithoutPanels=!1,this.runTriggersOnBuildPanelsFirstTime()),this.survey)for(var t=0;t<this.panelCount;t++)this.notifyOnPanelAddedRemoved(!0,t);this.updateIsReady(),this.showAddPanelButton||this.updateNoEntriesTextDefaultLoc(),this.updateFooterActions(),this.isBuildingPanelsFirstTime=!1,this.releaseAnimations()}},t.prototype.runTriggersOnBuildPanelsFirstTime=function(){var e=this;this.value,this.visiblePanelsCore.forEach(function(t){var n=e.getItemData(t.data);if(!f.isValueEmpty(n)){var i=f.createCopyWithPrefix(n,r.expressionVariables.panel+".");t.data.runTriggers("",void 0,i)}})},Object.defineProperty(t.prototype,"showAddPanelButton",{get:function(){return this.allowAddPanel&&!this.isReadOnly},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"wasNotRenderedInSurvey",{get:function(){return!this.hasPanelBuildFirstTime&&!this.wasRendered&&!!this.survey},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"canBuildPanels",{get:function(){return!this.isLoadingFromJson&&!this.useTemplatePanel},enumerable:!1,configurable:!0}),t.prototype.onFirstRenderingCore=function(){e.prototype.onFirstRenderingCore.call(this),this.buildPanelsFirstTime(),this.template.onFirstRendering()},t.prototype.localeChanged=function(){e.prototype.localeChanged.call(this),this.panelsCore.forEach(function(e){return e.localeChanged()})},t.prototype.runConditionCore=function(t){e.prototype.runConditionCore.call(this,t),this.runPanelsCondition(this.panelsCore,t)},t.prototype.runTriggers=function(t,n,i){e.prototype.runTriggers.call(this,t,n,i),this.visiblePanelsCore.forEach(function(e){e.data.runTriggers(t,n,i)})},t.prototype.reRunCondition=function(){this.data&&this.runCondition(this.getDataFilteredProperties())},t.prototype.runPanelsCondition=function(e,t){var n=this.isValueChangingInternally;this.isValueChangingInternally=!0;for(var i=0;i<e.length;i++){var o=e[i],s=r.expressionVariables.panel,a=f.createCopy(t);a[s]=o,o.runCondition(a),o.isVisible}this.isValueChangingInternally=n},t.prototype.onAnyValueChanged=function(t,n){e.prototype.onAnyValueChanged.call(this,t,n),this.hasPanelBuildFirstTime||t!==this.getValueName()||(this.isValueChangedWithoutPanels=!0);for(var i=0;i<this.panelsCore.length;i++)this.panelsCore[i].onAnyValueChanged(t,n),this.panelsCore[i].onAnyValueChanged(r.expressionVariables.panel,"")},t.prototype.hasKeysDuplicated=function(e){for(var t,n=[],i=0;i<this.panelsCore.length;i++)t=this.isValueDuplicated(this.panelsCore[i],n,e)||t;return t},t.prototype.updatePanelsContainsErrors=function(){var e=this.changingValueQuestions;if(Array.isArray(e)&&0!==e.length){for(var t=e[0].parent;t;)t.updateContainsErrors(),t=t.parent;this.updateContainsErrors()}},t.prototype.validateElementCore=function(t){if(this.isValueChangingInternally&&!this.hasInputInChangedQuestions()||this.isBuildingPanelsFirstTime)return!0;var n=!0,i=this.changingValueQuestions;if(Array.isArray(i)){var o=!0;i.forEach(function(e){o=e.validateElement(t)&&o}),n=!this.hasKeysDuplicated(t)&&o,this.updatePanelsContainsErrors()}else n=this.validateInPanels(t);return e.prototype.validateElementCore.call(this,t)&&n},t.prototype.hasInputInChangedQuestions=function(){var e=this.changingValueQuestions;if(!Array.isArray(e)||0===e.length)return!1;for(var t=0;t<e.length;t++)if(e[t].hasInput)return!0;return!1},t.prototype.getContainsErrors=function(){var t=e.prototype.getContainsErrors.call(this);if(t)return t;for(var n=this.panelsCore,i=0;i<n.length;i++)if(n[i].containsErrors)return!0;return!1},t.prototype.getIsAnswered=function(){if(!e.prototype.getIsAnswered.call(this))return!1;for(var t=this.visiblePanelsCore,n=0;n<t.length;n++){var i=[];t[n].addQuestionsToList(i,!0);for(var o=0;o<i.length;o++)if(!i[o].isAnswered)return!1}return!0},t.prototype.clearValueOnHidding=function(t){if(!t){if(this.survey&&"none"===this.survey.getQuestionClearIfInvisible("onHidden"))return;this.clearValueInPanelsIfInvisible("onHiddenContainer")}e.prototype.clearValueOnHidding.call(this,t)},t.prototype.clearValueIfInvisible=function(t){void 0===t&&(t="onHidden");var n="onHidden"===t?"onHiddenContainer":t;this.clearValueInPanelsIfInvisible(n),e.prototype.clearValueIfInvisible.call(this,t)},t.prototype.clearValueInPanelsIfInvisible=function(e){for(var t=0;t<this.panelsCore.length;t++){var n=this.panelsCore[t],i=n.questions;this.isSetPanelItemData={};for(var o=0;o<i.length;o++){var r=i[o];r.visible&&!n.isVisible||(r.clearValueIfInvisible(e),this.isSetPanelItemData[r.getValueName()]=this.maxCheckCount+1)}}this.isSetPanelItemData={}},t.prototype.getIsRunningValidators=function(){if(e.prototype.getIsRunningValidators.call(this))return!0;for(var t=0;t<this.panelsCore.length;t++)for(var n=this.panelsCore[t].questions,i=0;i<n.length;i++)if(n[i].isRunningValidators)return!0;return!1},t.prototype.getAllErrors=function(){for(var t=e.prototype.getAllErrors.call(this),n=this.visiblePanelsCore,i=0;i<n.length;i++)for(var o=n[i].questions,r=0;r<o.length;r++){var s=o[r].getAllErrors();s&&s.length>0&&(t=t.concat(s))}return t},t.prototype.getValueGetterContext=function(){return new Zr(this)},t.prototype.getDisplayValueCore=function(e,t){var n=this.getUnbindValue(t);if(!n||!Array.isArray(n))return n;for(var i=0;i<this.panelsCore.length&&i<n.length;i++){var o=n[i];o&&(n[i]=this.getPanelDisplayValue(i,o,e))}return n},t.prototype.getPanelDisplayValue=function(e,t,n){if(!t)return t;for(var i=this.panelsCore[e],o=Object.keys(t),r=0;r<o.length;r++){var s=o[r],a=i.getQuestionByValueName(s);if(a||(a=this.getSharedQuestionFromArray(s,e)),a){var l=a.getDisplayValue(n,t[s]);t[s]=l,n&&a.title&&a.title!==s&&(t[a.title]=l,delete t[s])}}return t},t.prototype.validateInPanels=function(e){for(var t=!0,n=this.visiblePanels,i=[],o=0;o<n.length;o++){var r=n[o].validateElement(e);r=!this.isValueDuplicated(n[o],i,e)&&r,!this.isRenderModeList&&!r&&t&&e.focusOnFirstError&&(this.currentIndex=o),t=r&&t}return t},t.prototype.isValueDuplicated=function(e,t,n){if(!this.keyName)return!1;var i=e.getQuestionByValueName(this.keyName);if(!i||i.isEmpty())return!1;var o=i.value,r=this.changingValueQuestions;Array.isArray(r)&&r.indexOf(i)<0&&i.validateElement(n);for(var s=0;s<t.length;s++)if(o==t[s])return n.fireCallback&&i.addError(new je(this.keyDuplicationError,this)),n.setErrorElement(i),!0;return t.push(o),!1},t.prototype.getPanelActions=function(e){var t=this,n=e.footerActions;return"right"!==this.removePanelButtonLocation&&n.push(new rt({id:"remove-panel-".concat(e.id),component:"sv-paneldynamic-remove-btn",visible:new we(function(){return[t.canRenderRemovePanel(e,"bottom")].every(function(e){return!0===e})}),enabled:new we(function(){return!1!==t.enableRemovePanel}),data:{question:this,panel:e}})),this.survey&&(n=this.titleSettings.getUpdatedPanelFooterActions(e,n,this)),n},t.prototype.canRenderRemovePanelOnRight=function(e){return this.canRenderRemovePanel(e,"right")},t.prototype.canRenderRemovePanel=function(e,t){var n=this.canRemovePanel,i="collapsed"!==e.state;return this.removePanelButtonLocation===t&&n&&i},t.prototype.createNewPanel=function(){var e=this,t=this.createAndSetupNewPanelObject(),n=this.template.toJSON();return(new q).toObject(n,t),t.renderWidth="100%",t.updateCustomWidgets(),t.questions.forEach(function(t){return t.setParentQuestion(e)}),new es(this,t),t.onGetFooterActionsCallback=function(){return e.getPanelActions(t)},t.onGetFooterToolbarCssCallback=function(){return e.cssClasses.panelFooter},t.registerPropertyChangedHandlers(["visible"],function(){t.visible?e.onPanelAdded(t):e.onPanelRemoved(t),e.updateFooterActions()}),t},t.prototype.createAndSetupNewPanelObject=function(){var e=this,t=this.createNewPanelObject();return t.isInteractiveDesignElement=!1,t.setParentQuestion(this),t.onGetQuestionTitleLocation=function(){return e.getTemplateQuestionTitleLocation()},t.onGetQuestionTitleWidth=function(){return e.templateQuestionTitleWidth},t.recursiveNoCallback=function(){return e.recursiveNoCallback()},t},t.prototype.getTemplateQuestionTitleLocation=function(){return"default"!=this.templateQuestionTitleLocation?this.templateQuestionTitleLocation:this.getParentTitleLocation()},t.prototype.getChildErrorLocation=function(t){return"default"!==this.templateErrorLocation?this.templateErrorLocation:e.prototype.getChildErrorLocation.call(this,t)},t.prototype.createNewPanelObject=function(){return Q.createClass("panel")},t.prototype.setPanelCountBasedOnValue=function(){if(!this.isValueChangingInternally&&!this.useTemplatePanel){var e=this.value,t=e&&Array.isArray(e)?e.length:0;0==t&&this.getPropertyValue("panelCount")>0&&(t=this.getPropertyValue("panelCount")),this.settingPanelCountBasedOnValue=!0,this.panelCount=t,this.settingPanelCountBasedOnValue=!1}},t.prototype.setQuestionValue=function(t){if(!this.settingPanelCountBasedOnValue){if(e.prototype.setQuestionValue.call(this,t,!1),this.setPanelCountBasedOnValue(),!this.isSettingPanelItemData())for(var n=0;n<this.panelsCore.length;n++)this.panelUpdateValueFromSurvey(this.panelsCore[n]);this.updateIsAnswered()}},t.prototype.isSettingPanelItemData=function(){for(var e in this.isSetPanelItemData)if(this.isSetPanelItemData[e]>0)return!0;return!1},t.prototype.onSurveyValueChanged=function(t){if(void 0!==t||!this.isAllPanelsEmpty()){e.prototype.onSurveyValueChanged.call(this,t);for(var n=0;n<this.panelsCore.length;n++)this.panelSurveyValueChanged(this.panelsCore[n]);void 0===t&&this.setValueBasedOnPanelCount(),this.updateIsReady()}},t.prototype.isAllPanelsEmpty=function(){for(var e=0;e<this.panelsCore.length;e++)if(!f.isValueEmpty(this.panelsCore[e].getValue()))return!1;return!0},t.prototype.panelUpdateValueFromSurvey=function(e){for(var t=e.questions,n=this.getItemData(e.data),i=0;i<t.length;i++){var o=t[i];o.updateValueFromSurvey(n[o.getValueName()]),o.updateCommentFromSurvey(n[o.getValueName()+r.commentSuffix]),o.initDataUI()}},t.prototype.panelSurveyValueChanged=function(e){for(var t=e.questions,n=this.getItemData(e.data),i=0;i<t.length;i++){var o=t[i];o.onSurveyValueChanged(n[o.getValueName()])}},t.prototype.onSetData=function(){e.prototype.onSetData.call(this),!this.isLoadingFromJson&&this.useTemplatePanel&&(this.setTemplatePanelSurveyImpl(),this.rebuildPanels())},t.prototype.isNewValueCorrect=function(e){return Array.isArray(e)},t.prototype.getValueChangingOptions=function(e){for(var t=e.parent;t.parent;)t=t.parent;var n=t,i=this.panels.indexOf(n);return{question:this,panel:n,name:e.name,panelIndex:i,panelData:this.getPanelItemDataByIndex(i),oldValue:e.value}},t.prototype.getItemIndex=function(e){var t=this.items.indexOf(e);return t>-1?t:this.items.length},t.prototype.getItemData=function(e){return this.getPanelItemDataByIndex(this.items.indexOf(e))},t.prototype.getBindedQuestions=function(){return this.survey&&this.valueName?this.survey.getQuestionsByValueName(this.valueName):[]},t.prototype.getItem=function(e){var t=this.visiblePanels[e]||void 0;return null==t?void 0:t.data},t.prototype.getPanelItemDataByIndex=function(e){var t=this.items,n=this.value;return e<0&&Array.isArray(n)&&n.length>t.length&&(e=t.length),e<0||!n||!Array.isArray(n)||n.length<=e?{}:n[e]},t.prototype.updateItemValue=function(e,t,n,i){if(e!==this.template.data&&!(this.isSetPanelItemData[t]>this.maxCheckCount)){this.isSetPanelItemData[t]||(this.isSetPanelItemData[t]=0),this.isSetPanelItemData[t]++;var o=this.items,s=o.indexOf(e);s<0&&(s=o.length);var a=this.getUnbindValue(this.value);a&&Array.isArray(a)||(a=[]);for(var l=Math.max(s+1,o.length),u=a.length;u<l;u++)a.push({});if(a[s]||(a[s]={}),this.isValueEmpty(n)?delete a[s][t]:a[s][t]=n,s>=0&&s<this.panelsCore.length){Array.isArray(this.changingValueQuestions)||(this.changingValueQuestions=[]);var p=t,c=r.commentSuffix;p.endsWith(c)&&(p=p.substring(0,p.length-c.length));var h=this.panelsCore[s].getQuestionByValueName(p);h&&this.changingValueQuestions.push(h)}this.value=a,this.changingValueQuestions=null,this.isSetPanelItemData[t]--,this.isSetPanelItemData[t]-1&&delete this.isSetPanelItemData[t]}},t.prototype.getPlainData=function(t){var n=this;void 0===t&&(t={includeEmpty:!0});var i=e.prototype.getPlainData.call(this,t);if(i){i.isNode=!0;var o=Array.isArray(i.data)?[].concat(i.data):[];i.data=this.panels.map(function(e,i){var o={name:e.name||i,title:e.title||"Panel",value:e.getValue(),displayValue:e.getValue(),getString:function(e){return n.getValueAsString(e)},isNode:!0,data:e.questions.map(function(e){return e.getPlainData(t)}).filter(function(e){return!!e})};return(t.calculations||[]).forEach(function(t){o[t.propertyName]=e[t.propertyName]}),o}),i.data=i.data.concat(o)}return i},t.prototype.updateElementCss=function(t){e.prototype.updateElementCss.call(this,t);for(var n=0;n<this.panelsCore.length;n++){this.panelsCore[n].updateElementCss(t)}},Object.defineProperty(t.prototype,"progressText",{get:function(){var e=this.visiblePanelCount;return this.getLocalizationFormatString("panelDynamicProgressText",this.currentIndex+1,e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"progress",{get:function(){return(this.currentIndex+1)/this.visiblePanelCount*100+"%"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"progressBarAriaLabel",{get:function(){return V("progressbar",this.getLocale())},enumerable:!1,configurable:!0}),t.prototype.getRootCss=function(){return(new tt).append(e.prototype.getRootCss.call(this)).append(this.cssClasses.empty,this.getShowNoEntriesPlaceholder()).toString()},Object.defineProperty(t.prototype,"cssHeader",{get:function(){var t=this.isRenderModeTab&&!!this.visiblePanelCount;return(new tt).append(e.prototype.getCssHeader.call(this,this.cssClasses)).append(this.cssClasses.headerTab,this.hasTitleOnTop&&t).toString()},enumerable:!1,configurable:!0}),t.prototype.getTabsContainerCss=function(){return(new tt).append(this.cssClasses.tabsContainer).append(this.cssClasses.tabsContainerWithHeader,this.hasTitleOnTop).toString()},t.prototype.getPanelWrapperCss=function(e){return(new tt).append(this.cssClasses.panelWrapper,!e||e.visible).append(this.cssClasses.panelWrapperList,this.isRenderModeList).append(this.cssClasses.panelWrapperInRow,"right"===this.removePanelButtonLocation).toString()},t.prototype.getPanelRemoveButtonCss=function(){return(new tt).append(this.cssClasses.button).append(this.cssClasses.buttonRemove).append(this.cssClasses.buttonRemoveRight,"right"===this.removePanelButtonLocation).toString()},t.prototype.getAddButtonCss=function(){return(new tt).append(this.cssClasses.button).append(this.cssClasses.buttonAdd).append(this.cssClasses.buttonAdd+"--list-mode","list"===this.displayMode).toString()},t.prototype.getPrevButtonCss=function(){return(new tt).append(this.cssClasses.buttonPrev).append(this.cssClasses.buttonPrevDisabled,!this.isPrevButtonVisible).toString()},t.prototype.getNextButtonCss=function(){return(new tt).append(this.cssClasses.buttonNext).append(this.cssClasses.buttonNextDisabled,!this.isNextButtonVisible).toString()},Object.defineProperty(t.prototype,"noEntriesText",{get:function(){return this.getLocStringText(this.locNoEntriesText)},set:function(e){this.setLocStringText(this.locNoEntriesText,e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"locNoEntriesText",{get:function(){return this.getOrCreateLocStr("noEntriesText",!1,this.getNoEntriesLocalizationName())},enumerable:!1,configurable:!0}),t.prototype.getShowNoEntriesPlaceholder=function(){return!!this.cssClasses.noEntriesPlaceholder&&!this.isDesignMode&&0===this.visiblePanelCount},t.prototype.needResponsiveWidth=function(){for(var e=this.getPanels(),t=0;t<e.length;t++){var n=e[t];if(n.isVisible&&n.needResponsiveWidth())return!0}return!1},Object.defineProperty(t.prototype,"hasTabbedMenu",{get:function(){return this.isRenderModeTab&&this.visiblePanels.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tabbedMenu",{get:function(){return this.isRenderModeTab?(this.tabbedMenuValue||(this.tabbedMenuValue=new Ht,this.tabbedMenuValue.dotsItem.popupModel.showPointer=!1,this.tabbedMenuValue.dotsItem.popupModel.verticalPosition="bottom",this.tabbedMenuValue.dotsItem.popupModel.horizontalPosition="center",this.updateElementCss(!1)),this.tabbedMenuValue):null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"showFooterToolbar",{get:function(){return this.footerToolbar&&this._showFooterToolbar},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"footerToolbar",{get:function(){return this.footerToolbarValue||this.initFooterToolbar(),this.footerToolbarValue},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ariaRole",{get:function(){return"group"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ariaRequired",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ariaInvalid",{get:function(){return null},enumerable:!1,configurable:!0}),t.prototype.updateFooterActions=function(){this.updateFooterActionsCallback&&this.updateFooterActionsCallback()},t.prototype.initFooterToolbar=function(){var e=this;this.footerToolbarValue=this.createActionContainer();var t=[],n=new rt({id:"sv-pd-prev-btn",title:this.prevPanelText,action:function(){e.goToPrevPanel()}}),i=new rt({id:"sv-pd-next-btn",title:this.nextPanelText,action:function(){e.goToNextPanel()}}),o=new rt({id:"sv-pd-add-btn",component:"sv-paneldynamic-add-btn",enabled:new we(function(){return!1!==e.enableAddPanel}),data:{question:this}}),r=new rt({id:"sv-prev-btn-icon",component:"sv-paneldynamic-prev-btn",data:{question:this}}),s=new rt({id:"sv-pd-progress-text",component:"sv-paneldynamic-progress-text",data:{question:this}}),a=new rt({id:"sv-pd-next-btn-icon",component:"sv-paneldynamic-next-btn",data:{question:this}});t.push(n,i,o,r,s,a),this.updateFooterActionsCallback=function(){var t=e.legacyNavigation,l=e.isRenderModeList,u=e.isMobile,p=!t&&!l;n.visible=p&&e.currentIndex>0,i.visible=p&&e.currentIndex<e.visiblePanelCount-1,i.needSpace=u&&i.visible&&n.visible,o.visible=e.canAddPanel,o.needSpace=e.isMobile&&!i.visible&&n.visible,s.visible=!e.isRenderModeList&&!u,s.needSpace=!t&&!e.isMobile;var c=t&&!l;r.visible=c,a.visible=c,r.needSpace=c},this.updateFooterActionsCallback(),this.footerToolbarValue.setItems(t),this.footerToolbar.flushUpdates(),this._showFooterToolbar=new we(function(){var t;return null===(t=e.footerToolbarValue)||void 0===t?void 0:t.hasVisibleActions})},t.prototype.createTabByPanel=function(e,t){var n=this;if(this.isRenderModeTab){var i=new S(e,!0);i.onGetTextCallback=function(i){if(i||(i=n.locTabTitlePlaceholder.renderedHtml),!n.survey)return i;var o={title:i,panel:e,visiblePanelIndex:t};return n.dynamicPanelCallbacks.dynamicPanelGetTabTitle(n,o),o.title},i.sharedData=this.locTemplateTabTitle;var o=e.id,r=this.getPanelVisibleIndexById(o)===this.currentIndex;return new $r({id:"".concat(this.id,"_tab_").concat(o),panelId:o,pressed:r,locTitle:i,disableHide:r,action:function(){n.currentIndex=n.getPanelVisibleIndexById(o)}})}},t.prototype.getTabbedMenuCss=function(e){var t=null!=e?e:this.cssClasses;return(new tt).append(t.tabsRoot).append(t.tabsLeft,"left"===this.tabAlign).append(t.tabsRight,"right"===this.tabAlign).append(t.tabsCenter,"center"===this.tabAlign).toString()},t.prototype.updateTabToolbarItemsPressedState=function(){if(this.isRenderModeTab&&!(this.currentIndex<0||this.currentIndex>=this.visiblePanelCount)){var e=this.visiblePanelsCore[this.currentIndex];this.tabbedMenu.actions.forEach(function(t){var n=t.panelId===e.id;t.pressed=n,t.disableHide=n})}},t.prototype.updateTabToolbar=function(){var e=this;if(this.isRenderModeTab){for(var t=[],n=this.visiblePanelsCore,i=function(i){o.visiblePanelsCore.forEach(function(o){return t.push(e.createTabByPanel(n[i],i))})},o=this,r=0;r<n.length;r++)i(r);this.tabbedMenu.setItems(t)}},t.prototype.addTabFromToolbar=function(e,t){if(this.isRenderModeTab){var n=this.createTabByPanel(e,t);this.tabbedMenu.actions.splice(t,0,n),this.updateTabToolbarItemsPressedState()}},t.prototype.removeTabFromToolbar=function(e){if(this.isRenderModeTab){var t=this.tabbedMenu.actions.find(function(t){return t.panelId==e.id});t&&(this.tabbedMenu.actions.splice(this.tabbedMenu.actions.indexOf(t),1),this.updateTabToolbarItemsPressedState())}},Object.defineProperty(t.prototype,"showNavigation",{get:function(){return(!this.isReadOnly||1!=this.visiblePanelCount)&&(this.visiblePanelCount>0&&!!this.cssClasses.footer)},enumerable:!1,configurable:!0}),t.prototype.showSeparator=function(e){return this.isRenderModeList&&e<this.renderedPanels.length-1},t.prototype.calcCssClasses=function(t){var n=e.prototype.calcCssClasses.call(this,t),i=this.tabbedMenu;return i&&(i.containerCss=this.getTabbedMenuCss(n),i.cssClasses=n.tabs,i.dotsItem.cssClasses=n.tabs,i.dotsItem.popupModel.contentComponentData.model.cssClasses=t.list),n},t.prototype.onMobileChanged=function(){e.prototype.onMobileChanged.call(this),this.updateFooterActions()},t.prototype.ensureRowsVisibility=function(){this.visiblePanels.forEach(function(e){return e.ensureRowsVisibility()})},v([qe({localizable:{defaultStr:"panelDynamicTabTextFormat",markdown:!0}})],t.prototype,"templateTabTitle",void 0),v([qe({localizable:{defaultStr:!0,markdown:!0}})],t.prototype,"tabTitlePlaceholder",void 0),v([He({})],t.prototype,"_renderedPanels",void 0),v([qe()],t.prototype,"confirmDelete",void 0),v([qe({defaultValue:""})],t.prototype,"keyName",void 0),v([qe({localizable:{defaultStr:"confirmDelete"}})],t.prototype,"confirmDeleteText",void 0),v([qe({localizable:{defaultStr:!0}})],t.prototype,"keyDuplicationError",void 0),v([qe({localizable:{defaultStr:"pagePrevText"}})],t.prototype,"prevPanelText",void 0),v([qe({localizable:{defaultStr:"pageNextText"}})],t.prototype,"nextPanelText",void 0),v([qe({localizable:{defaultStr:"addPanel"}})],t.prototype,"addPanelText",void 0),v([qe({localizable:{defaultStr:"removePanel"}})],t.prototype,"removePanelText",void 0),v([qe()],t.prototype,"panelsState",void 0),v([qe({onSetting:function(e){return e<0?0:e}})],t.prototype,"minPanelCount",void 0),v([qe({onSetting:function(e){return e<=0?1:e<r.panel.maxPanelCount?e:r.panel.maxPanelCount}})],t.prototype,"maxPanelCount",void 0),v([qe()],t.prototype,"allowAddPanel",void 0),v([qe()],t.prototype,"newPanelPosition",void 0),v([qe()],t.prototype,"allowRemovePanel",void 0),v([qe({defaultValue:!0})],t.prototype,"enableAddPanel",void 0),v([qe({defaultValue:!0})],t.prototype,"enableRemovePanel",void 0),v([qe()],t.prototype,"templateQuestionTitleLocation",void 0),v([qe()],t.prototype,"templateQuestionTitleWidth",void 0),v([qe()],t.prototype,"templateErrorLocation",void 0),v([qe({onSetting:function(e){return e?"onsurvey"===(e=e.toLowerCase())?"default":e:"off"}})],t.prototype,"showQuestionNumbers",void 0),v([qe()],t.prototype,"removePanelButtonLocation",void 0),v([qe({onSet:function(e,t){t.fireCallback(t.renderModeChangedCallback),t.updatePanelView()}})],t.prototype,"displayMode",void 0),v([qe({onSet:function(e,t){t.fireCallback(t.currentIndexChangedCallback)}})],t.prototype,"showProgressBar",void 0),v([qe({onSet:function(e,t){}})],t.prototype,"progressBarLocation",void 0),v([qe()],t.prototype,"tabAlign",void 0),v([qe()],t.prototype,"defaultPanelValue",void 0),v([qe()],t.prototype,"copyDefaultValueFromLastEntry",void 0),v([qe({defaultValue:!1})],t.prototype,"_showFooterToolbar",void 0),v([qe({defaultValue:!1,onSet:function(e,t){t.updateFooterActions()}})],t.prototype,"legacyNavigation",void 0),t}(gn),is=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return y(t,e),Object.defineProperty(t.prototype,"panelDynamic",{get:function(){return this.question},enumerable:!1,configurable:!0}),t.prototype.getSingleInputQuestionsCore=function(e,t){this.panelDynamic.onFirstRendering();var n=new Array,i=this.panelDynamic.visiblePanels;if(t)for(var o=0;o<i.length;o++){var r=i[o];r.hasValueAnyQuestion(!0)&&r.validate(!1,!1)||this.fillSingleInputQuestionsByPanel(n,r)}return this.getSingleInputQuestionsForDynamic(e,n)},t.prototype.fillSingleInputQuestionsInContainer=function(e,t){var n=this.getPanelByQuestion(t);this.fillSingleInputQuestionsByPanel(e,n)},t.prototype.fillSingleInputQuestionsByPanel=function(e,t){t&&t.visibleQuestions.forEach(function(t){return t.addNestedQuestion(e,!0,!1,!1)})},t.prototype.getSingleQuestionLocTitleCore=function(){var e=this,t=this.panelDynamic.locTemplateTitle;return t.onGetTextCallback=function(t){var n=e.panelDynamic.singleInputQuestion;return n?e.processSingleInputTitle(t,e.getPanelByQuestion(n)):t},t},t.prototype.processSingleInputTitle=function(e,t){return e||(e=this.getSingleInputTitleTemplate()),t?t.getProcessedText(e):e},t.prototype.getSingleInputTitleTemplate=function(){return this.panelDynamic.getLocalizationString("panelDynamicTabTextFormat")},t.prototype.getPanelByQuestion=function(e){for(var t=e.parent;t&&t.parent;)t=t.parent;return t},t.prototype.getSingleInputAddTextCore=function(){if(this.panelDynamic.canAddPanel)return this.panelDynamic.addPanelText},t.prototype.singleInputAddItemCore=function(){this.panelDynamic.addPanelUI()},t.prototype.getSingleQuestionOnChange=function(e){var t=this.panelDynamic.visiblePanels;if(t.length>0){(e<0||e>=t.length)&&(e=t.length-1);var n=t[e].visibleQuestions;if(n.length>0)return n[0]}return null},t.prototype.createSingleInputSummary=function(){var e=this,t=this.panelDynamic,n=new Mi(t,t.locNoEntriesText),i=new Array;return t.visiblePanels.forEach(function(n){var o=new S(t,!0,void 0,t.locTemplateTitle.localizationName);o.setJson(t.locTemplateTitle.getJson()),o.onGetTextCallback=function(i){return e.processSingleInputTitle(t.templateTitle,n)};var r=new rt({locTitle:t.locEditPanelText,action:function(){e.singInputEditPanel(n)}}),s=t.canRemovePanel?new rt({locTitle:t.locRemovePanelText,action:function(){t.removePanelUI(n)}}):void 0;i.push(new Ni(o,r,s))}),n.items=i,n},t.prototype.singleInputMoveToFirstCore=function(){for(var e,t=null===(e=this.panelDynamic.singleInputQuestion)||void 0===e?void 0:e.parent;t&&t.parent;)t=t.parent;this.singInputEditPanel(t)},t.prototype.singInputEditPanel=function(e){if(e){var t=e.visibleQuestions;t.length>0&&this.setSingleInputQuestion(t[0])}},t}(pn);Q.addClass("paneldynamic",[{name:"showCommentArea:switch",visible:!0},{name:"templateElements",alternativeName:"questions",baseClassName:"question",visible:!1,isLightSerializable:!1},{name:"templateTitle:text",serializationProperty:"locTemplateTitle"},{name:"templateTabTitle",serializationProperty:"locTemplateTabTitle",visibleIf:function(e){return"tab"===e.displayMode}},{name:"tabTitlePlaceholder",serializationProperty:"locTabTitlePlaceholder",visibleIf:function(e){return"tab"===e.displayMode}},{name:"templateDescription:text",serializationProperty:"locTemplateDescription"},{name:"minWidth",defaultFunc:function(){return"auto"}},{name:"noEntriesText:text",serializationProperty:"locNoEntriesText"},{name:"allowAddPanel:boolean",default:!0},{name:"allowRemovePanel:boolean",default:!0},{name:"newPanelPosition",choices:["next","last"],default:"last"},{name:"panelCount:number",isBindable:!0,default:0,choices:[0,1,2,3,4,5,6,7,8,9,10],onSettingValue:function(e,t){return t<e.minPanelCount?e.minPanelCount:t>e.maxPanelCount?e.maxPanelCount:t}},{name:"minPanelCount:number",default:0,minValue:0},{name:"maxPanelCount:number",defaultFunc:function(){return r.panel.maxPanelCount}},"defaultPanelValue:panelvalue",{name:"copyDefaultValueFromLastEntry:boolean",alternativeName:"defaultValueFromLastPanel"},{name:"panelsState",default:"default",choices:["default","collapsed","expanded","firstExpanded"],visibleIf:function(e){return"list"===e.displayMode}},{name:"keyName"},{name:"keyDuplicationError",serializationProperty:"locKeyDuplicationError"},{name:"confirmDelete:boolean"},{name:"confirmDeleteText",serializationProperty:"locConfirmDeleteText",visibleIf:function(e){return e.confirmDelete}},{name:"addPanelText",alternativeName:"panelAddText",serializationProperty:"locAddPanelText",visibleIf:function(e){return e.allowAddPanel}},{name:"removePanelText",alternativeName:"panelRemoveText",serializationProperty:"locRemovePanelText",visibleIf:function(e){return e.allowRemovePanel}},{name:"prevPanelText",alternativeName:"panelPrevText",serializationProperty:"locPrevPanelText",visibleIf:function(e){return"list"!==e.displayMode}},{name:"nextPanelText",alternativeName:"panelNextText",serializationProperty:"locNextPanelText",visibleIf:function(e){return"list"!==e.displayMode}},{name:"showQuestionNumbers",default:"off",choices:["default","onpanel","recursive","off"]},{name:"questionStartIndex",visibleIf:function(e){var t=e.showQuestionNumbers;return"onpanel"===t||"recursive"===t}},{name:"renderMode",visible:!1,isSerializable:!1},{name:"displayMode",default:"list",choices:["list","carousel","tab"]},{name:"showProgressBar:boolean",alternativeName:"showRangeInProgress",default:!0,visibleIf:function(e){return"carousel"===e.displayMode}},{name:"progressBarLocation",default:"top",choices:["top","bottom","topBottom"],visibleIf:function(e){return e.showProgressBar&&"carousel"===e.displayMode}},{name:"tabAlign",default:"center",choices:["left","center","right"],visibleIf:function(e){return"tab"===e.displayMode}},{name:"templateQuestionTitleLocation",alternativeName:"templateTitleLocation",default:"default",choices:["default","top","bottom","left"]},{name:"templateQuestionTitleWidth",visibleIf:function(e){return!!e&&e.template.availableQuestionTitleWidth()}},{name:"templateErrorLocation",default:"default",choices:["default","top","bottom"]},{name:"templateVisibleIf:expression"},{name:"removePanelButtonLocation",alternativeName:"panelRemoveButtonLocation",default:"bottom",choices:["bottom","right"],visibleIf:function(e){return e.allowRemovePanel}}],function(){return new ns("")},"question"),$n.Instance.registerQuestion("paneldynamic",function(e){return new ns(e)});var os=function(){function e(){}return e.getProgressTextInBarCss=function(e){return(new tt).append(e.progressText).append(e.progressTextInBar).toString()},e.getProgressTextUnderBarCss=function(e){return(new tt).append(e.progressText).append(e.progressTextUnderBar).toString()},e}(),rs=function(e){function t(){return e.call(this)||this}return y(t,e),Object.defineProperty(t,"operators",{get:function(){return null!=t.operatorsValue||(t.operatorsValue={empty:function(e,t){return!e},notempty:function(e,t){return!!e},equal:function(e,t){return e==t},notequal:function(e,t){return e!=t},contains:function(e,t){return e&&e.indexOf&&e.indexOf(t)>-1},notcontains:function(e,t){return!e||!e.indexOf||-1==e.indexOf(t)},greater:function(e,t){return e>t},less:function(e,t){return e<t},greaterorequal:function(e,t){return e>=t},lessorequal:function(e,t){return e<=t}}),t.operatorsValue},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"id",{get:function(){return this.uniqueId},enumerable:!1,configurable:!0}),t.prototype.getType=function(){return"triggerbase"},t.prototype.toString=function(){var e=this.getType().replace("trigger",""),t=this.expression;return t&&(e+=", "+t),e},Object.defineProperty(t.prototype,"isInternal",{get:function(){return!0===this.isGhost},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"operator",{get:function(){return this.getPropertyValue("operator","equal")},set:function(e){e&&(e=e.toLowerCase(),t.operators[e]&&this.setPropertyValue("operator",e))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"expression",{get:function(){return this.getPropertyValue("expression",this.buildExpression())},set:function(e){this.setPropertyValue("expression",e)},enumerable:!1,configurable:!0}),t.prototype.canBeExecuted=function(e){return!0},t.prototype.canBeExecutedOnComplete=function(){return!1},t.prototype.checkExpression=function(e){var t=this;if(this.isExecutingOnNextPage=e.isOnNextPage,this.isExecutingOnNavigation=e.isOnNavigation||e.isOnNextPage,this.canBeExecuted(e.isOnNextPage)&&(!e.isOnComplete||this.canBeExecutedOnComplete())){var n=Object.keys(e.keys);if(!Array.isArray(n)||this.canBeExecuteOnKeysChange(n)){var i=e.properties||null;this.runExpressionByProperty("expression",i,function(e){t.triggerResult(!0===e,i)},function(n){return t.isCheckRequired(n,e.keys)})||this.isCheckRequired(null,e.keys)&&this.canSuccessOnEmptyExpression()&&this.triggerResult(!0,i)}}},t.prototype.canBeExecuteOnKeysChange=function(e){return!0},t.prototype.canSuccessOnEmptyExpression=function(){return!1},t.prototype.check=function(e){t.operators[this.operator](e,this.value)?this.onSuccess(null):this.onFailure()},Object.defineProperty(t.prototype,"requireValidQuestion",{get:function(){return!1},enumerable:!1,configurable:!0}),t.prototype.triggerResult=function(e,t){e?(this.onSuccess(t),this.onSuccessExecuted()):this.onFailure()},t.prototype.onSuccess=function(e){},t.prototype.onFailure=function(){},t.prototype.onSuccessExecuted=function(){},t.prototype.buildExpression=function(){return this.name?this.isValueEmpty(this.value)&&this.isRequireValue?"":"{"+this.name+"} "+this.operator+" "+Nn.toOperandString(this.value):""},t.prototype.isCheckRequired=function(e,t){return!!t&&!this.canSkipExpressionByKeys(e,t,this.getUsedVariables(e))},t.prototype.getUsedVariables=function(e){if(!e)return[];var t=e.getVariables();if(Array.isArray(t))for(var n=r.expressionVariables.unwrapPostfix,i=t.length-1;i>=0;i--){var o=t[i];o.endsWith(n)&&t.push(o.substring(0,o.length-n.length))}return t},Object.defineProperty(t.prototype,"isRequireValue",{get:function(){return"empty"!==this.operator&&"notempty"!=this.operator},enumerable:!1,configurable:!0}),t.operatorsValue=null,v([qe()],t.prototype,"value",void 0),v([qe()],t.prototype,"name",void 0),t}(Ve),ss=function(e){function t(){var t=e.call(this)||this;return t.ownerValue=null,t}return y(t,e),Object.defineProperty(t.prototype,"owner",{get:function(){return this.ownerValue},enumerable:!1,configurable:!0}),t.prototype.setOwner=function(e){this.ownerValue=e},t.prototype.getOwner=function(){return this.owner},t.prototype.getSurvey=function(e){return this.owner&&this.owner.getSurvey?this.owner.getSurvey():null},t.prototype.isRealExecution=function(){return!0},t.prototype.onSuccessExecuted=function(){this.owner&&this.isRealExecution()&&this.owner.triggerExecuted(this)},t}(rs),as=function(e){function t(){var t=e.call(this)||this;return t.pages=[],t.questions=[],t}return y(t,e),t.prototype.getType=function(){return"visibletrigger"},t.prototype.onSuccess=function(e){this.onTrigger(this.onItemSuccess)},t.prototype.onFailure=function(){this.onTrigger(this.onItemFailure)},t.prototype.onTrigger=function(e){if(this.owner)for(var t=this.owner.getObjects(this.pages,this.questions),n=0;n<t.length;n++)e(t[n])},t.prototype.onItemSuccess=function(e){e.visible=!0},t.prototype.onItemFailure=function(e){e.visible=!1},t}(ss),ls=function(e){function t(){return e.call(this)||this}return y(t,e),t.prototype.getType=function(){return"completetrigger"},Object.defineProperty(t.prototype,"requireValidQuestion",{get:function(){return!0},enumerable:!1,configurable:!0}),t.prototype.isRealExecution=function(){return!r.triggers.executeCompleteOnValueChanged===this.isExecutingOnNavigation},t.prototype.onSuccess=function(e){this.owner&&(this.isRealExecution()?this.owner.setCompleted(this):this.owner.canBeCompleted(this,!0))},t.prototype.onFailure=function(){this.owner.canBeCompleted(this,!1)},t}(ss),us=function(e){function t(){return e.call(this)||this}return y(t,e),t.prototype.getType=function(){return"setvaluetrigger"},t.prototype.canBeExecuted=function(e){return!e&&!!this.setToName},t.prototype.canBeExecuteOnKeysChange=function(t){return(1!==t.length||t[0]!==this.setToName)&&e.prototype.canBeExecuteOnKeysChange.call(this,t)},t.prototype.onPropertyValueChanged=function(t,n,i){if(e.prototype.onPropertyValueChanged.call(this,t,n,i),"setToName"===t){var o=this.getSurvey();o&&!o.isLoadingFromJson&&o.isDesignMode&&(this.setValue=void 0)}},t.prototype.onSuccess=function(e){this.setToName&&this.owner&&this.owner.setTriggerValue(this.setToName,f.getUnbindValue(this.setValue),this.isVariable)},v([qe()],t.prototype,"setToName",void 0),v([qe()],t.prototype,"setValue",void 0),v([qe()],t.prototype,"isVariable",void 0),t}(ss),ps=function(e){function t(){return e.call(this)||this}return y(t,e),t.prototype.getType=function(){return"skiptrigger"},Object.defineProperty(t.prototype,"requireValidQuestion",{get:function(){return this.canBeExecuted(!1)},enumerable:!1,configurable:!0}),t.prototype.canBeExecuted=function(e){return e===!r.triggers.executeSkipOnValueChanged},t.prototype.onSuccess=function(e){this.gotoName&&this.owner&&this.owner.focusQuestion(this.gotoName)},v([qe()],t.prototype,"gotoName",void 0),t}(ss),cs=function(e){function t(){return e.call(this)||this}return y(t,e),t.prototype.getType=function(){return"runexpressiontrigger"},t.prototype.canBeExecuted=function(e){return!e},t.prototype.onSuccess=function(e){var t=this;this.owner&&this.runExpressionByProperty("runExpression",e,function(e){t.onCompleteRunExpression(e)})},t.prototype.onCompleteRunExpression=function(e){this.setToName&&void 0!==e&&this.owner.setTriggerValue(this.setToName,f.convertValToQuestionVal(e),!1)},v([qe()],t.prototype,"setToName",void 0),v([qe()],t.prototype,"runExpression",void 0),t}(ss),hs=function(e){function t(){return e.call(this)||this}return y(t,e),t.prototype.canBeExecuted=function(e){return!e&&!!this.setToName&&!!this.fromName},t.prototype.getType=function(){return"copyvaluetrigger"},t.prototype.canBeExecuteOnKeysChange=function(t){return(1!==t.length||t[0]!==this.setToName)&&e.prototype.canBeExecuteOnKeysChange.call(this,t)},t.prototype.onSuccess=function(e){this.setToName&&this.owner&&this.owner.copyTriggerValue(this.setToName,this.fromName,this.copyDisplayValue)},t.prototype.canSuccessOnEmptyExpression=function(){return!0},t.prototype.getUsedVariables=function(t){var n=e.prototype.getUsedVariables.call(this,t);return this.fromName&&n.indexOf(this.fromName)<0&&n.push(this.fromName),n},v([qe()],t.prototype,"setToName",void 0),v([qe()],t.prototype,"fromName",void 0),v([qe()],t.prototype,"copyDisplayValue",void 0),t}(ss);Q.addClass("trigger",[{name:"operator",default:"equal",visible:!1},{name:"value",visible:!1},"expression:condition"]),Q.addClass("surveytrigger",[{name:"name",visible:!1}],null,"trigger"),Q.addClass("visibletrigger",["pages:pages","questions:questions"],function(){return new as},"surveytrigger"),Q.addClass("completetrigger",[],function(){return new ls},"surveytrigger"),Q.addClass("setvaluetrigger",[{name:"!setToName:questionvalue"},{name:"setValue:triggervalue",dependsOn:"setToName",visibleIf:function(e){return!!e&&!!e.setToName}},{name:"isVariable:boolean",visible:!1}],function(){return new us},"surveytrigger"),Q.addClass("copyvaluetrigger",[{name:"!fromName:questionvalue"},{name:"!setToName:questionvalue"},{name:"copyDisplayValue:boolean",visible:!1}],function(){return new hs},"surveytrigger"),Q.addClass("skiptrigger",[{name:"!gotoName:question"}],function(){return new ps},"surveytrigger"),Q.addClass("runexpressiontrigger",[{name:"setToName:questionvalue"},"runExpression:expression"],function(){return new cs},"surveytrigger");var ds=function(e){function t(t,i){void 0===i&&(i=null);var o=e.call(this)||this;return o.closeOnCompleteTimeout=0,o.surveyValue=i||o.createSurvey(t),o.surveyValue.fitToContainer=!0,o.windowElement=n.createElement("div"),o.survey.onComplete.add(function(e,t){o.onSurveyComplete()}),o.width=new we(function(){return o.survey.width}),o.width=o.survey.width,o.updateCss(),o}return y(t,e),t.prototype.onPropertyValueChanged=function(t,n,i){if(e.prototype.onPropertyValueChanged.call(this,t,n,i),"isShowing"===t){var o=this.showingChangedCallback;o&&o()}"isExpanded"===t&&(this.isFullScreen&&!i&&(this.isFullScreen=!1),this.onExpandedChanged()),"isFullScreen"===t&&(i&&!this.isExpanded&&(this.isExpanded=!0),this.setCssRoot())},t.prototype.getType=function(){return"popupsurvey"},Object.defineProperty(t.prototype,"survey",{get:function(){return this.surveyValue},enumerable:!1,configurable:!0}),t.prototype.show=function(){this.isShowing=!0},t.prototype.hide=function(){this.isShowing=!1},t.prototype.toggleFullScreen=function(){this.isFullScreen=!this.isFullScreen},Object.defineProperty(t.prototype,"isCollapsed",{get:function(){return!this.isExpanded},enumerable:!1,configurable:!0}),t.prototype.onExpandedChanged=function(){this.expandedChangedCallback&&this.expandedChangedCallback(),this.updateCssButton()},Object.defineProperty(t.prototype,"title",{get:function(){return this.survey.title},set:function(e){this.survey.title=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"locTitle",{get:function(){return this.survey.locTitle.isEmpty?null:this.survey.locTitle},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"locDescription",{get:function(){return this.survey.locTitle.isEmpty?null:this.survey.locDescription},enumerable:!1,configurable:!0}),t.prototype.expand=function(){this.isExpanded=!0},t.prototype.collapse=function(){this.isExpanded=!1},t.prototype.changeExpandCollapse=function(){this.isExpanded=!this.isExpanded},Object.defineProperty(t.prototype,"css",{get:function(){return this.survey.css},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cssButton",{get:function(){return this.getPropertyValue("cssButton","")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cssRoot",{get:function(){var e=this.getPropertyValue("cssRoot","");return this.isCollapsed&&(e+=" "+this.getPropertyValue("cssRootCollapsedMod","")),e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cssRootCollapsedMod",{get:function(){return this.getPropertyValue("cssRootCollapsedMod")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cssRootContent",{get:function(){return this.getPropertyValue("cssRootContent")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cssBody",{get:function(){return this.getPropertyValue("cssBody","")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cssHeaderRoot",{get:function(){return this.getPropertyValue("cssHeaderRoot","")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cssHeaderTitleCollapsed",{get:function(){return this.getPropertyValue("cssHeaderTitleCollapsed","")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cssHeaderButtonsContainer",{get:function(){return this.getPropertyValue("cssHeaderButtonsContainer","")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cssHeaderCollapseButton",{get:function(){return this.getPropertyValue("cssHeaderCollapseButton","")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cssHeaderCloseButton",{get:function(){return this.getPropertyValue("cssHeaderCloseButton","")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cssHeaderFullScreenButton",{get:function(){return this.getPropertyValue("cssHeaderFullScreenButton","")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"renderedWidth",{get:function(){var e=this.getPropertyValue("width","60%");return e&&!isNaN(e)&&(e+="px"),e},enumerable:!1,configurable:!0}),t.prototype.updateCss=function(){if(this.css&&this.css.window){var e=this.css.window;this.setCssRoot(),this.setPropertyValue("cssRootCollapsedMod",e.rootCollapsedMod),this.setPropertyValue("cssRootContent",e.rootContent),this.setPropertyValue("cssBody",e.body);var t=e.header;t&&(this.setPropertyValue("cssHeaderRoot",t.root),this.setPropertyValue("cssHeaderTitleCollapsed",t.titleCollapsed),this.setPropertyValue("cssHeaderButtonsContainer",t.buttonsContainer),this.setPropertyValue("cssHeaderCollapseButton",t.collapseButton),this.setPropertyValue("cssHeaderCloseButton",t.closeButton),this.setPropertyValue("cssHeaderFullScreenButton",t.fullScreenButton),this.updateCssButton())}},t.prototype.setCssRoot=function(){var e=this.css.window;this.isFullScreen?this.setPropertyValue("cssRoot",e.root+" "+e.rootFullScreenMode):this.setPropertyValue("cssRoot",e.root)},t.prototype.updateCssButton=function(){var e=this.css.window?this.css.window.header:null;e&&this.setCssButton(this.isExpanded?e.buttonExpanded:e.buttonCollapsed)},t.prototype.setCssButton=function(e){e&&this.setPropertyValue("cssButton",e)},t.prototype.createSurvey=function(e){return new vo(e)},t.prototype.onSurveyComplete=function(){if(!(this.closeOnCompleteTimeout<0))if(0==this.closeOnCompleteTimeout)this.hide();else{var e=this,t=null;t=setInterval(function(){e.hide(),clearInterval(t)},1e3*this.closeOnCompleteTimeout)}},t.prototype.onScroll=function(){this.survey.onScroll()},v([qe({defaultValue:!1})],t.prototype,"isShowing",void 0),v([qe({defaultValue:!1})],t.prototype,"isFullScreen",void 0),v([qe({defaultValue:!1})],t.prototype,"isExpanded",void 0),v([qe({defaultValue:!1})],t.prototype,"allowClose",void 0),v([qe({defaultValue:!1})],t.prototype,"allowFullScreen",void 0),v([qe()],t.prototype,"width",void 0),t}(Ve),fs=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return y(t,e),t}(ds),gs=function(){function e(){this._lockScroll=!1}return e.prototype.setRootElement=function(e){var n=this;this._containerElementValue=null==e?void 0:e.querySelector(".sv-scroll__scroller"),this._scrollbarElement=null==e?void 0:e.querySelector(".sv-scroll__scrollbar"),this._scrollbarSizerElement=null==e?void 0:e.querySelector(".sv-scroll__scrollbar-sizer"),this._containerBodyElement=null==e?void 0:e.querySelector(".sv-scroll__container"),e&&t.isAvailable()&&(this._containerBodyResizeObserver=new ResizeObserver(function(e){for(var t=0,i=e;t<i.length;t++){var o=i[t],r=o.contentBoxSize?o.contentBoxSize[0].blockSize:o.contentRect.width;n._scrollbarSizerElement.style.height=r+"px"}n.onInnerHeightChanged&&n.onInnerHeightChanged(n._containerBodyElement.clientHeight>n._containerElementValue.clientHeight)}),this._containerBodyResizeObserver.observe(this._containerBodyElement))},e.prototype.onScrollContainer=function(){this._lockScroll=!0,this._scrollbarElement.scrollTop=this._containerElementValue.scrollTop},e.prototype.onScrollScrollbar=function(){this._lockScroll?this._lockScroll=!1:this._containerElementValue.scrollTop=this._scrollbarElement.scrollTop},e.prototype.unsubscribeRootElement=function(){this._containerBodyResizeObserver&&(this._containerBodyResizeObserver.disconnect(),this._containerBodyResizeObserver=void 0)},e}(),ys=["input:not(:disabled):not([readonly]):not([type=hidden])","select:not(:disabled)","textarea:not(:disabled):not([readonly])",'button:not(:disabled):not([tabindex="-1"])','[tabindex]:not([tabindex^="-"])'].join(","),ms=function(e){function t(t){var n=e.call(this)||this;return n.popupSelector=".sv-popup",n.fixedPopupContainer=".sv-popup",n.containerSelector=".sv-popup__container",n.scrollingContentSelector=".sv-popup__scrolling-content",n.visibilityAnimation=new Jt(n,function(e){n._isVisible!==e&&(e?(n.updateBeforeShowing(),n.updateIsVisible(e)):(n.updateOnHiding(),n.updateIsVisible(e),n.updateAfterHiding(),n._isPositionSetValue=!1))},function(){return n._isVisible}),n.onVisibilityChanged=new I,n.onModelIsVisibleChangedCallback=function(){n.isVisible=n.model.isVisible},n._isPositionSetValue=!1,n.model=t,n.locale=n.model.locale,n}return y(t,e),t.prototype.updateIsVisible=function(e){this._isVisible=e,this.onVisibilityChanged.fire(this,{isVisible:e})},t.prototype.updateBeforeShowing=function(){this.model.onShow()},t.prototype.updateAfterHiding=function(){this.model.onHiding()},t.prototype.getLeaveOptions=function(){return{cssClass:"sv-popup--leave",onBeforeRunAnimation:function(e){e.setAttribute("inert","")},onAfterRunAnimation:function(e){return e.removeAttribute("inert")}}},t.prototype.getEnterOptions=function(){return{cssClass:"sv-popup--enter"}},t.prototype.getAnimatedElement=function(){return this.getAnimationContainer()},t.prototype.isAnimationEnabled=function(){return"overlay"!==this.model.displayMode&&r.animationEnabled},t.prototype.getRerenderEvent=function(){return this.onElementRerendered},t.prototype.getAnimationContainer=function(){var e;return null===(e=this.container)||void 0===e?void 0:e.querySelector(this.fixedPopupContainer)},Object.defineProperty(t.prototype,"isVisible",{get:function(){return this._isVisible},set:function(e){this.visibilityAnimation.sync(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"container",{get:function(){return this.containerElement||this.createdContainer},enumerable:!1,configurable:!0}),t.prototype.getLocale=function(){return this.locale?this.locale:e.prototype.getLocale.call(this)},t.prototype.hidePopup=function(){this.model.isVisible=!1},t.prototype.getStyleClass=function(){return(new tt).append(this.model.cssClass)},t.prototype.getShowFooter=function(){return this.isOverlay},t.prototype.getShowHeader=function(){return this.getShowCloseButton()},t.prototype.getShowCloseButton=function(){return!!this.model.showCloseButton},t.prototype.getPopupHeaderTemplate=function(){return this.model.showCloseButton?"popup-close-button":void 0},t.prototype.createFooterActionBar=function(){this.footerToolbarValue=new Tt},t.prototype.resetDimensionsAndPositionStyleProperties=function(){this.top="",this.left="",this.height="",this.width="",this.minWidth=""},t.prototype.onModelChanging=function(e){},t.prototype.setupModel=function(e){this.model&&this.model.onVisibilityChanged.remove(this.onModelIsVisibleChangedCallback),this.onModelChanging(e),this._model=e,e.onVisibilityChanged.add(this.onModelIsVisibleChangedCallback),this.onModelIsVisibleChangedCallback()},Object.defineProperty(t.prototype,"model",{get:function(){return this._model},set:function(e){this.setupModel(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"title",{get:function(){return this.model.title},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"contentComponentName",{get:function(){return this.model.contentComponentName},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"contentComponentData",{get:function(){return this.model.contentComponentData},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isModal",{get:function(){return this.model.isModal},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isFocusedContent",{get:function(){return this.model.isFocusedContent},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isFocusedContainer",{get:function(){return this.model.isFocusedContainer},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"showFooter",{get:function(){return this.getShowFooter()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"showHeader",{get:function(){return this.getShowHeader()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"showCloseButton",{get:function(){return this.getShowCloseButton()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"popupHeaderTemplate",{get:function(){return this.getPopupHeaderTemplate()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isOverlay",{get:function(){return"overlay"===this.model.displayMode},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"styleClass",{get:function(){return this.getStyleClass().toString()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cancelButtonText",{get:function(){return this.getLocalizationString("modalCancelButtonText")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"footerToolbar",{get:function(){return this.footerToolbarValue||this.createFooterActionBar(),this.footerToolbarValue},enumerable:!1,configurable:!0}),t.prototype.onKeyDown=function(e){"Tab"===e.key||9===e.keyCode?this.trapFocus(e):"Escape"!==e.key&&27!==e.keyCode||this.hidePopup()},t.prototype.trapFocus=function(e){var t=this.container.querySelectorAll(ys),n=t[0],i=t[t.length-1],o=pt();e.shiftKey?o===n&&(i.focus(),e.preventDefault()):o===i&&(n.focus(),e.preventDefault())},t.prototype.switchFocus=function(){this.isFocusedContent?this.focusFirstInput():this.isFocusedContainer&&this.focusContainer()},Object.defineProperty(t.prototype,"isPositionSet",{get:function(){return this._isPositionSetValue},enumerable:!1,configurable:!0}),t.prototype.updateOnShowing=function(){var e=pt();this.prevActiveElement=e,this.isOverlay&&this.resetDimensionsAndPositionStyleProperties(),this.switchFocus(),this._isPositionSetValue=!0},t.prototype.updateOnHiding=function(){this.isFocusedContent&&this.prevActiveElement&&this.prevActiveElement.focus({preventScroll:!0})},t.prototype.focusContainer=function(){if(this.container){var e=this.container.querySelector(this.popupSelector);null==e||e.focus()}},t.prototype.focusFirstInput=function(){var e=this;setTimeout(function(){if(e.container){var t=e.container.querySelector(e.model.focusFirstInputSelector||ys);t?t.focus():e.focusContainer()}},100)},t.prototype.clickClose=function(e){this.hidePopup(),null==e||e.stopPropagation()},t.prototype.clickOutside=function(e){this.hidePopup(),null==e||e.stopPropagation()},t.prototype.blur=function(e){this.model.onBlur()},t.prototype.cancel=function(){this.model.onCancel(),this.hidePopup()},t.prototype.dispose=function(){e.prototype.dispose.call(this),this.model&&this.model.onVisibilityChanged.remove(this.onModelIsVisibleChangedCallback),this.createdContainer&&(this.createdContainer.remove(),this.createdContainer=void 0),this.footerToolbarValue&&this.footerToolbarValue.dispose(),this.resetComponentElement()},t.prototype.initializePopupContainer=function(){if(!this.container){var e=n.createElement("div");this.createdContainer=e,lt(r.environment.popupMountContainer).appendChild(e)}},t.prototype.setComponentElement=function(e){e&&(this.containerElement=e)},t.prototype.resetComponentElement=function(){this.containerElement=void 0,this.prevActiveElement=void 0},t.prototype.preventScrollOuside=function(e,t){for(var i=e.target;i!==this.container;){if("auto"===n.getComputedStyle(i).overflowY&&i.scrollHeight!==i.offsetHeight){var o=i.scrollHeight,r=i.scrollTop,s=i.clientHeight;if(!(t>0&&Math.abs(o-s-r)<1||t<0&&r<=0))return}i=i.parentElement}e.cancelable&&e.preventDefault()},v([qe({defaultValue:"0px"})],t.prototype,"top",void 0),v([qe({defaultValue:"0px"})],t.prototype,"left",void 0),v([qe({defaultValue:"auto"})],t.prototype,"height",void 0),v([qe({defaultValue:"auto"})],t.prototype,"width",void 0),v([qe({defaultValue:"auto"})],t.prototype,"minWidth",void 0),v([qe({defaultValue:!1})],t.prototype,"_isVisible",void 0),v([qe()],t.prototype,"locale",void 0),t}(Ve),vs=function(){function e(e,t,n,i){this.x=e,this.y=t,this.width=n,this.height=i}return Object.defineProperty(e.prototype,"left",{get:function(){return this.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"top",{get:function(){return this.y},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"right",{get:function(){return this.x+this.width},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"bottom",{get:function(){return this.y+this.height},enumerable:!1,configurable:!0}),e}(),bs=function(){function e(){}return e.calculatePosition=function(e,t,n,i,o,r){void 0===r&&(r="flex");var s=e.left,a=e.top;return"flex"===r&&(s="center"==o?(e.left+e.right-n)/2:"left"==o?e.left-n:e.right),a="middle"==i?(e.top+e.bottom-t)/2:"top"==i?e.top-t:e.bottom,"center"!=o&&"middle"!=i&&("top"==i?a+=e.height:a-=e.height),{left:Math.round(s),top:Math.round(a)}},e.getCorrectedVerticalDimensions=function(t,n,i,o,r,s){var a;void 0===r&&(r=!0),void 0===s&&(s={top:0,bottom:0});var l=i-e.bottomIndent;if("top"===o&&(a={height:n,top:t}),t<-s.top)a={height:r?n+t:n,top:-s.top};else if(n+t>i){var u=Math.min(n,l-t);a={height:r?u:n,top:r?t:t-(n-u)}}return a&&(a.height=Math.min(a.height,l),a.top=Math.max(a.top,-s.top)),a},e.updateHorizontalDimensions=function(e,t,n,i,o,r){void 0===o&&(o="flex"),void 0===r&&(r={left:0,right:0}),t+=r.left+r.right;var s=void 0,a=e;return"center"===i&&("fixed"===o?(e+t>n&&(s=n-e),a-=r.left):e<0?(a=r.left,s=Math.min(t,n)):t+e>n&&(a=n-t,a=Math.max(a,r.left),s=Math.min(t,n))),"left"===i&&e<0&&(a=r.left,s=Math.min(t,n)),"right"===i&&t+e>n&&(s=n-e),{width:s-r.left-r.right,left:a}},e.updateVerticalPosition=function(e,t,n,i,o){if("middle"===i)return i;var r=t-(e.top+("center"!==n?e.height:0)),s=t+e.bottom-("center"!==n?e.height:0)-o;return r>0&&s<=0&&"top"==i?i="bottom":s>0&&r<=0&&"bottom"==i?i="top":s>0&&r>0&&(i=r<s?"top":"bottom"),i},e.updateHorizontalPosition=function(e,t,n,i){if("center"===n)return n;var o=t-e.left,r=t+e.right-i;return o>0&&r<=0&&"left"==n?n="right":r>0&&o<=0&&"right"==n?n="left":r>0&&o>0&&(n=o<r?"left":"right"),n},e.calculatePopupDirection=function(e,t){var n;return"center"==t&&"middle"!=e?n=e:"center"!=t&&(n=t),n},e.calculatePointerTarget=function(e,t,n,i,o,r,s){void 0===r&&(r=0),void 0===s&&(s=0);var a={};return"center"!=o?(a.top=e.top+e.height/2,a.left=e[o]):"middle"!=i&&(a.top=e[i],a.left=e.left+e.width/2),a.left=Math.round(a.left-n),a.top=Math.round(a.top-t),"left"==o&&(a.left-=r+s),"center"===o&&(a.left-=r),a},e.bottomIndent=16,e}(),Cs=function(i){function o(o){var r=i.call(this,o)||this;return r.scrollEventCallBack=function(t){if(r.isOverlay&&e.IsTouch)return t.stopPropagation(),void t.preventDefault();r.hidePopup()},r.resizeEventCallback=function(){if(t.isAvailable()){var e=t.getVisualViewport(),i=n.getDocumentElement();i&&e&&i.style.setProperty("--sv-popup-overlay-height","".concat(e.height*e.scale,"px"))}},r.resizeWindowCallback=function(){r.isOverlay||r.updatePosition(!0,"vue"===vo.platform||"vue3"===vo.platform||"react"==vo.platform||"js-ui"==vo.platform)},r.clientY=0,r.touchStartEventCallback=function(e){r.clientY=e.touches[0].clientY},r.touchMoveEventCallback=function(e){r.preventScrollOuside(e,r.clientY-e.changedTouches[0].clientY)},r.model.onRecalculatePosition.add(r.recalculatePositionHandler),r}return y(o,i),o.prototype.createFooterActionBar=function(){var e=this;i.prototype.createFooterActionBar.call(this),this.footerToolbar.setCssClasses({root:nt.root,defaultSizeMode:nt.defaultSizeMode,smallSizeMode:nt.smallSizeMode,item:"sd-action sv-menu-popup__button"},!1),this.footerToolbar.containerCss="sv-menu-footer-action-bar";var t=[{id:"cancel",visibleIndex:10,title:this.cancelButtonText,innerCss:"sv-popup__button--cancel",action:function(){e.cancel()}}];t=this.model.updateFooterActions(t),this.footerToolbarValue.setItems(t)},o.prototype.getAvailableAreaRect=function(){var e=this.model.getAreaCallback?this.model.getAreaCallback(this.container):void 0;if(e){var n=e.getBoundingClientRect();return new vs(n.x,n.y,n.width,n.height)}return new vs(0,0,t.getInnerWidth(),t.getInnerHeight())},o.prototype.getTargetElementRect=function(e){var t=this.container,n=this.model.getTargetCallback?this.model.getTargetCallback(t):void 0;if(t&&t.parentElement&&!this.isModal&&!n&&(n=t.parentElement),!n)return null;var i=n.getBoundingClientRect();return new vs(i.left-e.left,i.top-e.top,i.width,i.height)},o.prototype._updatePosition=function(){var e,i,o,r=this.getAvailableAreaRect(),s=this.getTargetElementRect(r);if(s){var a=null===(e=this.container)||void 0===e?void 0:e.querySelector(this.containerSelector);if(a){var l=null===(i=this.container)||void 0===i?void 0:i.querySelector(this.fixedPopupContainer),u=a.querySelector(this.scrollingContentSelector),p=n.getComputedStyle(a),c=parseFloat(p.marginLeft)||0,h=parseFloat(p.marginRight)||0,d=parseFloat(p.marginTop)||0,f=parseFloat(p.marginBottom)||0,g=a.offsetHeight-u.offsetHeight+u.scrollHeight,y=a.getBoundingClientRect().width;this.model.setWidthByTarget&&(this.minWidth=s.width+"px");var m=this.model.verticalPosition,v=this.getActualHorizontalPosition();if(t.isAvailable()){var b=[g,.9*t.getInnerHeight(),null===(o=t.getVisualViewport())||void 0===o?void 0:o.height];g=Math.ceil(Math.min.apply(Math,b.filter(function(e){return"number"==typeof e}))),m=bs.updateVerticalPosition(s,g,this.model.horizontalPosition,this.model.verticalPosition,r.height),v=bs.updateHorizontalPosition(s,y,v,r.width)}this.popupDirection=bs.calculatePopupDirection(m,v);var C=bs.calculatePosition(s,g,y+c+h,m,v,this.model.positionMode);if(t.isAvailable()){var w=bs.getCorrectedVerticalDimensions(C.top,g,r.height,m,this.model.canShrink,{top:d,bottom:f});if(w&&(this.height=w.height+"px",C.top=w.top),this.model.setWidthByTarget)this.width=s.width+"px",C.left=s.left;else{var V=bs.updateHorizontalDimensions(C.left,y,t.getInnerWidth(),v,this.model.positionMode,{left:c,right:h});V&&(this.width=V.width?V.width+"px":void 0,C.left=V.left)}}if(l){var P=l.getBoundingClientRect();C.top-=P.top,C.left-=P.left}this.showHeader&&(this.pointerTarget=bs.calculatePointerTarget(s,C.top,C.left,m,v,c,h),this.pointerTarget.top+="px",this.pointerTarget.left+="px"),C.left+=r.left,C.top+=r.top,this.left=C.left+"px",this.top=C.top+"px"}}},o.prototype.getActualHorizontalPosition=function(){var e=this.model.horizontalPosition;n.isAvailable()&&("rtl"==n.getComputedStyle(n.getBody()).direction&&("left"===this.model.horizontalPosition?e="right":"right"===this.model.horizontalPosition&&(e="left")));return e},o.prototype.getStyleClass=function(){var e=this.model.getDisplayMode();return i.prototype.getStyleClass.call(this).append("sv-popup--menu-phone","menu-overlay"===e).append("sv-popup--menu-tablet","menu-popup-overlay"===e).append("sv-popup--menu-popup","menu-popup"===e).append("sv-popup--show-pointer","menu-popup"===e&&this.showHeader).append("sv-popup--".concat(this.popupDirection),"menu-popup"===e&&(this.showHeader||"top"==this.popupDirection||"bottom"==this.popupDirection))},o.prototype.getShowHeader=function(){return this.model.showPointer&&!this.isOverlay},o.prototype.getPopupHeaderTemplate=function(){return"popup-pointer"},o.prototype.setComponentElement=function(e){i.prototype.setComponentElement.call(this,e)},o.prototype.resetComponentElement=function(){i.prototype.resetComponentElement.call(this)},o.prototype.updateOnShowing=function(){var e=ut(this.container);e&&(this.prevActiveElement=e.activeElement,this.isOverlay?this.resetDimensionsAndPositionStyleProperties():this.updatePosition(!0,!1),this.switchFocus(),t.addEventListener("resize",this.resizeWindowCallback),this.shouldCreateResizeCallback&&(t.getVisualViewport().addEventListener("resize",this.resizeEventCallback),this.container&&(this.container.addEventListener("touchstart",this.touchStartEventCallback),this.container.addEventListener("touchmove",this.touchMoveEventCallback)),this.resizeEventCallback()),t.addEventListener("scroll",this.scrollEventCallBack),this._isPositionSetValue=!0)},Object.defineProperty(o.prototype,"shouldCreateResizeCallback",{get:function(){return!!t.getVisualViewport()&&this.isOverlay},enumerable:!1,configurable:!0}),o.prototype.updatePosition=function(e,t){var n=this;void 0===t&&(t=!0),e&&(this.height="auto"),t?setTimeout(function(){n._updatePosition()},1):this._updatePosition()},o.prototype.updateOnHiding=function(){i.prototype.updateOnHiding.call(this),t.removeEventListener("resize",this.resizeWindowCallback),this.shouldCreateResizeCallback&&(t.getVisualViewport().removeEventListener("resize",this.resizeEventCallback),this.container&&(this.container.removeEventListener("touchstart",this.touchStartEventCallback),this.container.removeEventListener("touchmove",this.touchMoveEventCallback))),t.removeEventListener("scroll",this.scrollEventCallBack),this.isDisposed||(this.top=void 0,this.left=void 0,this.height=void 0,this.width=void 0,this.minWidth=void 0)},o.prototype.onModelChanging=function(e){var t=this;this.model&&this.model.onRecalculatePosition.remove(this.recalculatePositionHandler),this.recalculatePositionHandler||(this.recalculatePositionHandler=function(e,n){t.isOverlay||t.updatePosition(n.isResetHeight)}),i.prototype.onModelChanging.call(this,e),e.onRecalculatePosition.add(this.recalculatePositionHandler)},o.prototype.dispose=function(){i.prototype.dispose.call(this),this.updateOnHiding(),this.model&&(this.model.onRecalculatePosition.remove(this.recalculatePositionHandler),this.recalculatePositionHandler=void 0),this.resetComponentElement()},o.tabletSizeBreakpoint=600,v([qe({defaultValue:"left"})],o.prototype,"popupDirection",void 0),v([qe({defaultValue:{left:"0px",top:"0px"}})],o.prototype,"pointerTarget",void 0),o}(ms),ws=function(e){function t(t){var n=e.call(this,t)||this;return n.onScrollOutsideCallback=function(e){n.preventScrollOuside(e,e.deltaY)},n}return y(t,e),t.prototype.getStyleClass=function(){var t=this.model.getDisplayMode();return e.prototype.getStyleClass.call(this).append("sv-popup--modal-popup","modal-popup"===t).append("sv-popup--modal-overlay","modal-overlay"===t)},t.prototype.getShowFooter=function(){return!0},t.prototype.createFooterActionBar=function(){var t=this;e.prototype.createFooterActionBar.call(this),this.footerToolbar.setCssClasses({root:nt.root,defaultSizeMode:nt.defaultSizeMode,smallSizeMode:nt.smallSizeMode,item:"sv-popup__body-footer-item sv-popup__button sv-modal-popup__button sd-btn sd-btn--small"},!1),this.footerToolbar.containerCss="sv-modal-footer-action-bar";var n=[{id:"cancel",visibleIndex:10,title:this.cancelButtonText,innerCss:"sv-popup__button--cancel",action:function(){t.cancel()}},{id:"apply",visibleIndex:20,title:this.applyButtonText,innerCss:"sv-popup__button--apply sd-btn--action",action:function(){t.apply()}}];n=this.model.updateFooterActions(n),this.footerToolbarValue.setItems(n)},Object.defineProperty(t.prototype,"applyButtonText",{get:function(){return this.getLocalizationString("modalApplyButtonText")},enumerable:!1,configurable:!0}),t.prototype.apply=function(){this.model.onApply&&!this.model.onApply()||this.hidePopup()},t.prototype.clickOutside=function(){},t.prototype.onKeyDown=function(t){"Escape"!==t.key&&27!==t.keyCode||this.model.onCancel(),e.prototype.onKeyDown.call(this,t)},t.prototype.updateOnShowing=function(){this.container&&this.container.addEventListener("wheel",this.onScrollOutsideCallback,{passive:!1}),e.prototype.updateOnShowing.call(this)},t.prototype.updateOnHiding=function(){this.container&&this.container.removeEventListener("wheel",this.onScrollOutsideCallback),e.prototype.updateOnHiding.call(this)},t}(ms);function Vs(e,t){var i,o=m({},e);o.verticalPosition="top",o.horizontalPosition="left",o.showPointer=!1,o.isModal=!0,o.displayMode=e.displayMode||"popup";var r=new _t(e.componentName,e.data,o);r.isFocusedContent=null===(i=e.isFocusedContent)||void 0===i||i,r.showCloseButton=!!e.showCloseButton;var s=new ws(r);if(t&&t.appendChild){var a=n.createElement("div");t.appendChild(a),s.setComponentElement(a)}s.container||s.initializePopupContainer();var l=function(e,t){t.isVisible||a&&s.resetComponentElement(),s.onVisibilityChanged.remove(l)};return s.onVisibilityChanged.add(l),s}var Ps=function(){function e(){this.modals=[]}return e.prototype.onModalsChanged=function(e,t){void 0===e&&(e=[]),void 0===t&&(t=[]),this.onModalsChangedCallback&&this.onModalsChangedCallback(this.modals,e,t)},e.prototype.addModal=function(e){var t=this,n=function(i,o){if(!o.isVisible){var r=t.modals.indexOf(e);r>=0&&t.modals.splice(r,1),e.onVisibilityChanged.remove(n),t.onModalsChanged(void 0,[e]),e.dispose()}};e.onVisibilityChanged.add(n),this.modals.push(e),this.onModalsChanged([e]),e.model.isVisible=!0},e.prototype.addDialog=function(e,t){var n=Vs(e,t);return this.addModal(n),n},e.prototype.getModals=function(){return this.modals},e.prototype.clear=function(){var e=this.modals;this.modals=[],this.onModalsChanged(void 0,e);for(var t=0,n=e;t<n.length;t++){n[t].dispose()}},e}(),xs=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return y(t,e),t.prototype.getBaseType=function(){return"buttongroupitemvalue"},v([qe()],t.prototype,"iconName",void 0),v([qe()],t.prototype,"iconSize",void 0),v([qe()],t.prototype,"showCaption",void 0),t}(Co),Is=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._allowClear=!0,t}return y(t,e),t.prototype.onPropertyValueChanged=function(t,n,i){e.prototype.onPropertyValueChanged.call(this,t,n,i);["value","renderAs","placeholder","choices","visibleChoices"].indexOf(t)>-1&&this.resetReadOnlyText()},t.prototype.locStrsChanged=function(){var t;e.prototype.locStrsChanged.call(this),this.resetReadOnlyText(),null===(t=this.dropdownListModelValue)||void 0===t||t.locStrsChanged()},t.prototype.getType=function(){return"buttongroup"},t.prototype.getItemValueType=function(){return"buttongroupitemvalue"},t.prototype.supportOther=function(){return!1},t.prototype.getControlClass=function(){return this.isEmpty(),(new tt).append(this.cssClasses.control).append(this.cssClasses.controlEmpty,this.isEmpty()).append(this.cssClasses.onError,this.hasCssError()).append(this.cssClasses.controlDisabled,this.isDisabledStyle).append(this.cssClasses.controlReadOnly,this.isReadOnlyStyle).append(this.cssClasses.controlPreview,this.isPreviewStyle).toString()},t.prototype.getFirstInputElementId=function(){return this.inputId+"_0"},t.prototype.getInputId=function(e){return this.inputId+"_"+e},Object.defineProperty(t.prototype,"allowClear",{get:function(){return this._allowClear},set:function(e){this._allowClear=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"searchEnabled",{get:function(){return!1},enumerable:!1,configurable:!0}),t.prototype.isItemSelected=function(e){return e.value==this.value},Object.defineProperty(t.prototype,"readOnlyText",{get:function(){return this.locReadOnlyText.calculatedText},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"locReadOnlyText",{get:function(){var e=this;return this.getOrCreateLocStr("readOnlyText",!0,!1,function(t){t.onGetTextCallback=function(){return e.displayValue||e.placeholder}})},enumerable:!1,configurable:!0}),t.prototype.resetReadOnlyText=function(){this.resetPropertyValue("readOnlyText")},Object.defineProperty(t.prototype,"showSelectedItemLocText",{get:function(){return!this.readOnly&&!this.inputHasValue&&!!this.selectedItemLocText},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"selectedItemLocText",{get:function(){var e;return null===(e=this.selectedItem)||void 0===e?void 0:e.locText},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dropdownListModel",{get:function(){return"dropdown"===this.renderAs&&this.onBeforeSetCompactRenderer(),this.dropdownListModelValue},set:function(e){this.dropdownListModelValue=e,this.updateElementCss()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"selectedItem",{get:function(){return this.getSingleSelectedItem()},enumerable:!1,configurable:!0}),t.prototype.onBlurCore=function(t){var n;null===(n=this.dropdownListModel)||void 0===n||n.onBlur(t),e.prototype.onBlurCore.call(this,t)},t.prototype.updateCssClasses=function(t,n){e.prototype.updateCssClasses.call(this,t,n),Pt(t,n)},t.prototype.calcCssClasses=function(t){var n=e.prototype.calcCssClasses.call(this,t);return this.dropdownListModelValue&&this.dropdownListModelValue.updateCssClasses(n.popup,n.list),n},t.prototype.needResponsiveWidth=function(){return!0},t.prototype.supportResponsiveness=function(){return!0},t.prototype.getCompactRenderAs=function(){return"dropdown"},t.prototype.getObservedElementSelector=function(){return".sd-button-group-scrollable-container"},t.prototype.onBeforeSetCompactRenderer=function(){this.isDisposed||this.dropdownListModelValue||(this.dropdownListModelValue=new Eo(this))},t.prototype.dispose=function(){e.prototype.dispose.call(this),this.dropdownListModelValue&&(this.dropdownListModelValue.dispose(),this.dropdownListModelValue=void 0)},v([qe({localizable:{defaultStr:"buttongroupOptionsCaption"}})],t.prototype,"placeholder",void 0),v([qe({defaultValue:!1})],t.prototype,"inputHasValue",void 0),t}(Vo);Q.addClass("buttongroup",[{name:"choices:buttongroupitemvalue[]"}],function(){return new Is("")},"checkboxbase"),Q.addClass("buttongroupitemvalue",[{name:"showCaption:boolean",default:!0},{name:"iconName:text"},{name:"iconSize:number"}],function(e){return new xs(e)},"choiceitem");var Ss=function(){function e(e,t,n){this.question=e,this.item=t,this.index=n}return Object.defineProperty(e.prototype,"value",{get:function(){return this.item.value},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"iconName",{get:function(){return this.item.iconName},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"iconSize",{get:function(){return this.item.iconSize||24},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"caption",{get:function(){return this.item.locText},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"showCaption",{get:function(){return this.item.showCaption||void 0===this.item.showCaption},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isRequired",{get:function(){return this.question.isRequired},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"selected",{get:function(){return this.question.isItemSelected(this.item)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"readOnly",{get:function(){return this.question.isInputReadOnly||!this.item.isEnabled},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"name",{get:function(){return this.question.name+"_"+this.question.id},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"id",{get:function(){return this.question.inputId+"_"+this.index},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasErrors",{get:function(){return this.question.errors.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"describedBy",{get:function(){return this.question.errors.length>0?this.question.id+"_errors":null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"labelClass",{get:function(){return(new tt).append(this.question.cssClasses.item).append(this.question.cssClasses.itemSelected,this.selected).append(this.question.cssClasses.itemHover,!this.readOnly&&!this.selected).append(this.question.cssClasses.itemDisabled,this.question.isReadOnly||!this.item.isEnabled).toString()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"css",{get:function(){return{label:this.labelClass,icon:this.question.cssClasses.itemIcon,control:this.question.cssClasses.itemControl,caption:this.question.cssClasses.itemCaption,decorator:this.question.cssClasses.itemDecorator}},enumerable:!1,configurable:!0}),e.prototype.onChange=function(){this.question.selectItem(this.item)},e}(),Es={changecamera:"flip-24x24",clear:"clear-24x24",cancel:"cancel-24x24",closecamera:"close-24x24",defaultfile:"file-72x72",choosefile:"folder-24x24",file:"toolbox-file-24x24",left:"chevronleft-16x16",modernbooleancheckchecked:"plus-32x32",modernbooleancheckunchecked:"minus-32x32",more:"more-24x24",navmenu_24x24:"navmenu-24x24",removefile:"error-24x24",takepicture:"camera-32x32",takepicture_24x24:"camera-24x24",v2check:"check-16x16",checked:"check-16x16",v2check_24x24:"check-24x24","back-to-panel_16x16":"restoredown-16x16",clear_16x16:"clear-16x16",close_16x16:"close-16x16",collapsedetail:"collapsedetails-16x16",expanddetail:"expanddetails-16x16","full-screen_16x16":"maximize-16x16",loading:"loading-48x48",minimize_16x16:"minimize-16x16",next_16x16:"chevronright-16x16",previous_16x16:"chevronleft-16x16","no-image":"noimage-48x48","ranking-dash":"rankingundefined-16x16","drag-n-drop":"drag-24x24","ranking-arrows":"reorder-24x24",restore_16x16:"fullsize-16x16",reset:"restore-24x24",search:"search-24x24",average:"smiley-rate5-24x24",excellent:"smiley-rate9-24x24",good:"smiley-rate7-24x24",normal:"smiley-rate6-24x24","not-good":"smiley-rate4-24x24",perfect:"smiley-rate10-24x24",poor:"smiley-rate3-24x24",terrible:"smiley-rate1-24x24","very-good":"smiley-rate8-24x24","very-poor":"smiley-rate2-24x24",add_16x16:"add-16x16",add_24x24:"add-24x24",alert_24x24:"warning-24x24",apply:"apply-24x24","arrow-down":"arrowdown-24x24","arrow-left":"arrowleft-24x24","arrow-left_16x16":"arrowleft-16x16",arrowleft:"arrowleft-16x16","arrow-right":"arrowright-24x24","arrow-right_16x16":"arrowright-16x16",arrowright:"arrowright-16x16","arrow-up":"arrowup-24x24",boolean:"toolbox-boolean-24x24","change-question-type_16x16":"speechbubble-16x16",checkbox:"toolbox-checkbox-24x24","collapse-detail_16x16":"minusbox-16x16","collapse-panel":"collapse-pg-24x24",collapse_16x16:"collapse-16x16","color-picker":"dropper-16x16",comment:"toolbox-longtext-24x24",config:"wrench-24x24",copy:"copy-24x24",default:"toolbox-customquestion-24x24",delete_16x16:"delete-16x16",delete_24x24:"delete-24x24",delete:"delete-24x24","description-hide":"hidehint-16x16",description:"hint-16x16","device-desktop":"desktop-24x24","device-phone":"phone-24x24","device-rotate":"rotate-24x24","device-tablet":"tablet-24x24",download:"download-24x24","drag-area-indicator":"drag-24x24","drag-area-indicator_24x16":"draghorizontal-24x16",v2dragelement_16x16:"draghorizontal-24x16","drop-down-arrow":"chevrondown-24x24","drop-down-arrow_16x16":"chevrondown-16x16",chevron_16x16:"chevrondown-16x16",dropdown:"toolbox-dropdown-24x24",duplicate_16x16:"copy-16x16",edit:"edit-24x24",edit_16x16:"edit-16x16","editing-finish":"finishedit-24x24",error:"error-16x16","expand-detail_16x16":"plusbox-16x16","expand-panel":"expand-pg-24x24",expand_16x16:"expand-16x16",expression:"toolbox-expression-24x24","fast-entry":"textedit-24x24",fix:"fix-24x24",html:"toolbox-html-24x24",image:"toolbox-image-24x24",imagepicker:"toolbox-imagepicker-24x24",import:"import-24x24","invisible-items":"invisible-24x24",language:"language-24x24",load:"import-24x24","logic-collapse":"collapse-24x24","logic-expand":"expand-24x24",logo:"image-48x48",matrix:"toolbox-matrix-24x24",matrixdropdown:"toolbox-multimatrix-24x24",matrixdynamic:"toolbox-dynamicmatrix-24x24",multipletext:"toolbox-multipletext-24x24",panel:"toolbox-panel-24x24",paneldynamic:"toolbox-dynamicpanel-24x24",preview:"preview-24x24",radiogroup:"toolbox-radiogroup-24x24",ranking:"toolbox-ranking-24x24",rating:"toolbox-rating-24x24",slider:"toolbox-slider-24x24",redo:"redo-24x24",remove_16x16:"remove-16x16",required:"required-16x16",save:"save-24x24","select-page":"selectpage-24x24",settings:"settings-24x24",settings_16x16:"settings-16x16",signaturepad:"toolbox-signature-24x24","switch-active_16x16":"switchon-16x16","switch-inactive_16x16":"switchoff-16x16",tagbox:"toolbox-tagbox-24x24",text:"toolbox-singleline-24x24",theme:"theme-24x24",toolbox:"toolbox-24x24",undo:"undo-24x24",visible:"visible-24x24",wizard:"wand-24x24",searchclear:"clear-16x16","chevron-16x16":"chevrondown-16x16",chevron:"chevrondown-24x24",progressbuttonv2:"arrowleft-16x16",right:"chevronright-16x16","add-lg":"add-24x24",add:"add-24x24"};function Ts(e){var t="icon-",n=e.replace(t,"");return t+(Es[n]||n)}function Os(e){var t=r.customIcons[e];return t?Ts(t):(e=Ts(e),(t=r.customIcons[e])||null)}function Rs(e){return Os(e)||Ts(e)}var As=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return y(t,e),t.prototype.getSurvey=function(e){var t;return null===(t=this.owner)||void 0===t?void 0:t.getSurvey()},t.prototype.getType=function(){return"masksettings"},t.prototype.setData=function(e){var t=this;Q.getProperties(this.getType()).forEach(function(n){var i=e[n.name];t[n.name]=void 0!==i?i:n.getDefaultValue(t)})},t.prototype.getData=function(){var e=this,t={};return Q.getProperties(this.getType()).forEach(function(n){var i=e[n.name];n.isDefaultValue(i)||(t[n.name]=i)}),t},t.prototype.processInput=function(e){return{value:e.prevValue,caretPosition:e.selectionEnd,cancelPreventDefault:!1}},t.prototype.getUnmaskedValue=function(e){return e},t.prototype.getMaskedValue=function(e){return e},t.prototype.getTextAlignment=function(){return"auto"},t.prototype.getTypeForExpressions=function(){return"text"},v([qe()],t.prototype,"saveMaskedValue",void 0),t}(Ve);function Ds(e){return function(e){var t=r.maskSettings.patternDefinitions;for(var n in t)if(e.match(t[n]))return!0;return!1}(e)?"fixed":"const"}function Ls(e){for(var t=[],n=!1,i=Object.keys(r.maskSettings.patternDefinitions),o=0;o<e.length;o++){var s=e[o];if(s===r.maskSettings.patternEscapeChar)n=!0;else if(n)n=!1,t.push({type:"fixed",value:s});else{var a=-1!==i.indexOf(s)?"regex":Ds(s);t.push({type:a,value:s})}}return t}function Ns(e,t,n){for(var i=r.maskSettings.patternDefinitions[n.value];t<e.length;){if(e[t].match(i))return t;t++}return t}function Ms(e,t,n,i){void 0===i&&(i=!1);var o="";if(!e)return o;for(var s="string"==typeof t?Ls(t):t,a=0;a<s.length;a++)if("fixed"!==s[a].type||i||(o+=s[a].value),"regex"===s[a].type){var l=r.maskSettings.patternDefinitions[s[a].value];if(!e[a]||!e[a].match(l)){if(n){o="";break}break}o+=e[a]}return o}Q.addClass("masksettings",[{name:"saveMaskedValue:boolean",visibleIf:function(e){return!!e&&"masksettings"!==e.getType()}}],function(){return new As});var ks=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.literals=[],t}return y(t,e),t.prototype.updateLiterals=function(){this.literals=Ls(this.pattern||"")},t.prototype.onPropertyValueChanged=function(t,n,i){e.prototype.onPropertyValueChanged.call(this,t,n,i),"pattern"===t&&this.updateLiterals()},t.prototype.getType=function(){return"patternmask"},t.prototype.fromJSON=function(t,n){e.prototype.fromJSON.call(this,t,n),this.updateLiterals()},t.prototype._getMaskedValue=function(e,t){return void 0===t&&(t=!1),function(e,t,n){for(var i=null==e?"":e,o="",s=0,a="string"==typeof t?Ls(t):t,l=0;l<a.length;l++)switch(a[l].type){case"regex":if(s<i.length&&(s=Ns(i,s,a[l])),s<i.length)o+=i[s];else{if(!n)return o;o+=r.maskSettings.patternPlaceholderChar}s++;break;case"const":case"fixed":o+=a[l].value,a[l].value===i[s]&&s++}return o}(null==e?"":e,this.literals,t)},t.prototype._getUnmaskedValue=function(e,t){return void 0===t&&(t=!1),Ms(null==e?"":e,this.literals,t)},t.prototype.processInput=function(e){var t={value:e.prevValue,caretPosition:e.selectionEnd,cancelPreventDefault:!1};if(!e.insertedChars&&e.selectionStart===e.selectionEnd)return t;var n=e.prevValue.slice(0,e.selectionStart)+(e.insertedChars||""),i=Ms(e.prevValue.slice(0,e.selectionStart),this.literals.slice(0,e.selectionStart),!1),o=Ms(e.prevValue.slice(e.selectionEnd),this.literals.slice(e.selectionEnd),!1,!0);return t.value=this._getMaskedValue(i+(e.insertedChars||"")+o,!0),e.insertedChars||"backward"!==e.inputDirection?t.caretPosition=this._getMaskedValue(n).length:t.caretPosition=e.selectionStart,t},t.prototype.getMaskedValue=function(e){return this._getMaskedValue(e,!0)},t.prototype.getUnmaskedValue=function(e){return this._getUnmaskedValue(e,!0)},v([qe()],t.prototype,"pattern",void 0),t}(As);Q.addClass("patternmask",[{name:"pattern"}],function(){return new ks},"masksettings");var Fs=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return y(t,e),t.prototype.calccaretPosition=function(e,t,n){for(var i=e?this.displayNumber(this.parseNumber(e),!1).length:0,o=0,r=t.selectionStart,s=!t.insertedChars&&"forward"===t.inputDirection,a=0;a<n.length;a++){if(n[a]!==this.thousandsSeparator&&o++,o===i+(s?1:0)){r=s?a:a+1;break}}return r},t.prototype.numericalCompositionIsEmpty=function(e){return!e.integralPart&&!e.fractionalPart},t.prototype.displayNumber=function(e,t,n){void 0===t&&(t=!0),void 0===n&&(n=!1);var i=e.integralPart;t&&i&&this.thousandsSeparator&&(i=function(e,t,n){void 0===t&&(t=!0),void 0===n&&(n=3);var i=[];if(t){for(var o=e.length-n;o>-n;o-=n)i.push(e.substring(o,o+n));i=i.reverse()}else for(o=0;o<e.length;o+=n)i.push(e.substring(o,o+n));return i}(i).join(this.thousandsSeparator));var o=e.fractionalPart,r=e.isNegative?"-":"";if(""===o){if(n)return i&&"0"!==i?r+i:i;var s=i+(e.hasDecimalSeparator&&!n?this.decimalSeparator:"");return"0"===s?s:r+s}return[r+(i=i||"0"),o=o.substring(0,this.precision)].join(this.decimalSeparator)},t.prototype.convertNumber=function(e){var t=e.isNegative?"-":"";return e.fractionalPart?parseFloat(t+(e.integralPart||"0")+"."+e.fractionalPart.substring(0,this.precision)):parseInt(t+e.integralPart||"0")},t.prototype.validateNumber=function(e,t){var n=this.min||Number.MIN_SAFE_INTEGER,i=this.max||Number.MAX_SAFE_INTEGER;if(this.numericalCompositionIsEmpty(e))return!0;if(void 0!==this.min||void 0!==this.max){var o=this.convertNumber(e);if(Number.isNaN(o))return!0;if(o>=n&&o<=i)return!0;if(!t){if(e.hasDecimalSeparator||0==o){var r=Math.pow(.1,(e.fractionalPart||"").length);if(o>=0)return o+r>n&&o<=i;if(o<0)return o>=n&&o-r<i}else{var s=o,a=o;if(o>0){if(o+1>n&&o<=i)return!0;for(;s=10*s+9,!((a*=10)>i);)if(s>n)return!0;return!1}if(o<0){if(o>=n&&o-1<i)return!0;for(;a=10*a-9,!((s*=10)<n);)if(a<i)return!0;return!1}}return o>=0&&o<=i||o<0&&o>=n}return!1}return!0},t.prototype.parseNumber=function(e){for(var t={integralPart:"",fractionalPart:"",hasDecimalSeparator:!1,isNegative:!1},n=null==e?"":e.toString(),i=0,o=0;o<n.length;o++){var r=n[o];switch(r){case"-":this.allowNegativeValues&&(void 0===this.min||this.min<0)&&i++;break;case this.decimalSeparator:this.precision>0&&(t.hasDecimalSeparator=!0);break;case this.thousandsSeparator:break;default:r.match(Bo)&&(t.hasDecimalSeparator?t.fractionalPart+=r:t.integralPart+=r)}}return t.isNegative=i%2!=0,t.integralPart.length>1&&"0"===t.integralPart[0]&&(t.integralPart=t.integralPart.slice(1)),t},t.prototype.getNumberMaskedValue=function(e,t){void 0===t&&(t=!1);var n=this.parseNumber(e);return this.validateNumber(n,t)?this.displayNumber(n,!0,t):null},t.prototype.getNumberUnmaskedValue=function(e){var t=this.parseNumber(e);if(!this.numericalCompositionIsEmpty(t))return this.convertNumber(t)},t.prototype.getTextAlignment=function(){return"right"},t.prototype.getMaskedValue=function(e){var t=null==e?"":e.toString();return t=t.replace(".",this.decimalSeparator),this.getNumberMaskedValue(t,!0)},t.prototype.getUnmaskedValue=function(e){return this.getNumberUnmaskedValue(e)},t.prototype.processInput=function(e){var t={value:e.prevValue,caretPosition:e.selectionEnd,cancelPreventDefault:!1},n=e.prevValue.slice(0,e.selectionStart)+(e.insertedChars||""),i=n+e.prevValue.slice(e.selectionEnd),o=this.parseNumber(i);if(!this.validateNumber(o,!1))return t;var r=this.getNumberMaskedValue(i),s=this.calccaretPosition(n,e,r);return t.value=r,t.caretPosition=s,t},t.prototype.getType=function(){return"numericmask"},v([qe()],t.prototype,"allowNegativeValues",void 0),v([qe()],t.prototype,"decimalSeparator",void 0),v([qe()],t.prototype,"precision",void 0),v([qe()],t.prototype,"thousandsSeparator",void 0),v([qe()],t.prototype,"min",void 0),v([qe()],t.prototype,"max",void 0),t}(As);function js(e,t){switch(e){case"hour":case"minute":case"second":case"day":case"month":return 2;case"timeMarker":case"year":return t;default:return 1}}Q.addClass("numericmask",[{name:"allowNegativeValues:boolean",default:!0},{name:"decimalSeparator",default:".",maxLength:1},{name:"thousandsSeparator",default:",",maxLength:1},{name:"precision:number",default:2,minValue:0},{name:"min:number"},{name:"max:number"}],function(){return new Fs},"masksettings");var _s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.defaultDate="1970-01-01T",t.turnOfTheCentury=68,t.twelve=12,t.lexems=[],t.inputDateTimeData=[],t.validBeginningOfNumbers={hour:1,hourU:2,minute:5,second:5,day:3,month:1},t}return y(t,e),Object.defineProperty(t.prototype,"hasDatePart",{get:function(){return this.lexems.some(function(e){return"day"===e.type||"month"===e.type||"year"===e.type})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hasTimePart",{get:function(){return this.lexems.some(function(e){return"hour"===e.type||"minute"===e.type||"second"===e.type})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hasSeconds",{get:function(){return this.lexems.some(function(e){return"second"===e.type})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"is12Hours",{get:function(){return this.lexems.filter(function(e){return"hour"===e.type&&!e.upperCase}).length>0},enumerable:!1,configurable:!0}),t.prototype.getType=function(){return"datetimemask"},t.prototype.getTypeForExpressions=function(){return this.hasTimePart&&this.hasSeconds?"datetime-seconds":this.hasTimePart?"datetime-local":"datetime"},t.prototype.updateLiterals=function(){this.lexems=function(e){for(var t,n=[],i=function(e,i,o){if(void 0===o&&(o=!1),t&&t===e){n[n.length-1].count++;var r=js(e,n[n.length-1].count);n[n.length-1].maxCount=r}else r=js(e,1),n.push({type:e,value:i,count:1,maxCount:r,upperCase:o})},o=0;o<e.length;o++){var r=e[o];switch(r){case"m":i("month",r);break;case"d":i("day",r);break;case"y":i("year",r);break;case"h":i("hour",r,!1);break;case"H":i("hour",r,!0);break;case"M":i("minute",r);break;case"s":i("second",r);break;case"t":i("timeMarker",r);break;case"T":i("timeMarker",r,!0);break;default:n.push({type:"separator",value:r,count:1,maxCount:1,upperCase:!1})}t=n[n.length-1].type}return n}(this.pattern||"")},t.prototype.leaveOnlyNumbers=function(e){for(var t="",n=0;n<e.length;n++)e[n].match(Bo)&&(t+=e[n]);return t},t.prototype.getMaskedStrFromISO=function(e){var t=this,n=new Date(e);return this.initInputDateTimeData(),this.hasTimePart||(n=new Date(e+"T00:00:00")),this.hasDatePart||(n=new Date(this.defaultDate+e)),isNaN(n)||this.lexems.forEach(function(e,i){var o=t.inputDateTimeData[i];switch(o.isCompleted=!0,e.type){case"hour":t.is12Hours?o.value=((n.getHours()-1)%t.twelve+1).toString():o.value=n.getHours().toString();break;case"minute":o.value=n.getMinutes().toString();break;case"second":o.value=n.getSeconds().toString();break;case"timeMarker":var r=n.getHours()>=t.twelve?"pm":"am";o.value=e.upperCase?r.toUpperCase():r;break;case"day":o.value=n.getDate().toString();break;case"month":o.value=(n.getMonth()+1).toString();break;case"year":var s=n.getFullYear();2==e.count&&(s%=100),o.value=s.toString()}}),this.getFormatedString(!0)},t.prototype.initInputDateTimeData=function(){var e=this;this.inputDateTimeData=[],this.lexems.forEach(function(t){e.inputDateTimeData.push({lexem:t,isCompleted:!1,value:void 0})})},t.prototype.getISO_8601Format=function(e){var t=[],n=[];if(void 0!==e.year){var i=this.getPlaceholder(4,e.year.toString(),"0")+e.year;t.push(i)}if(void 0!==e.month&&void 0!==e.year){var o=this.getPlaceholder(2,e.month.toString(),"0")+e.month;t.push(o)}if(void 0!==e.day&&void 0!==e.month&&void 0!==e.year){var r=this.getPlaceholder(2,e.day.toString(),"0")+e.day;t.push(r)}if(void 0!==e.hour){var s=this.getPlaceholder(2,e.hour.toString(),"0")+e.hour;n.push(s)}if(void 0!==e.minute&&void 0!==e.hour){var a=this.getPlaceholder(2,e.minute.toString(),"0")+e.minute;n.push(a)}if(void 0!==e.second&&void 0!==e.minute&&void 0!==e.hour){var l=this.getPlaceholder(2,e.second.toString(),"0")+e.second;n.push(l)}var u=[];return t.length>0&&u.push(t.join("-")),n.length>1&&u.push(n.join(":")),u.join("T")},t.prototype.isYearValid=function(e){if(void 0===e.min&&void 0===e.max)return!1;var t=e.year.toString(),n=e.min.toISOString().slice(0,t.length),i=e.max.toISOString().slice(0,t.length);return e.year>=parseInt(n)&&e.year<=parseInt(i)},t.prototype.createIDateTimeCompositionWithDefaults=function(e,t){var n=29==e.day&&2==e.month,i=e.min.getFullYear(),o=e.max.getFullYear();n&&(i=4*Math.ceil(i/4))>(o=4*Math.floor(o/4))&&(i=void 0,o=void 0);var r=void 0!==e.year?e.year:t?o:i,s=void 0!==e.month?e.month:t&&this.hasDatePart?12:1;return{year:r,month:s,day:void 0!==e.day?e.day:t&&this.hasDatePart?this.getMaxDateForMonth(r,s):1,hour:void 0!==e.hour?e.hour:t?23:0,minute:void 0!==e.minute?e.minute:t?59:0,second:void 0!==e.second?e.second:t?59:0}},t.prototype.getMaxDateForMonth=function(e,t){return 2==t?e%4==0&&e%100!=0||e%400==0?29:28:[31,28,31,30,31,30,31,31,30,31,30,31][t-1]},t.prototype.isDateValid=function(e){var t=new Date(this.getISO_8601Format(this.createIDateTimeCompositionWithDefaults(e,!1))),n=new Date(this.getISO_8601Format(this.createIDateTimeCompositionWithDefaults(e,!0)));return!isNaN(t)&&(t.getDate()===e.day||void 0===e.day)&&(t.getMonth()===e.month-1||void 0===e.month)&&(t.getFullYear()===e.year||void 0===e.year)&&n>=e.min&&t<=e.max},t.prototype.getPlaceholder=function(e,t,n){var i=e-(t||"").length;return i>0?n.repeat(i):""},t.prototype.isDateValid12=function(e){return this.is12Hours?!(this.is12Hours&&e.hour>this.twelve)&&(e.timeMarker?"p"===e.timeMarker[0].toLowerCase()?(e.hour!==this.twelve&&(e.hour+=this.twelve),this.isDateValid(e)):(e.hour===this.twelve&&(e.hour=0),this.isDateValid(e)):!!this.isDateValid(e)||(e.hour+=this.twelve,this.isDateValid(e))):this.isDateValid(e)},t.prototype.updateTimeMarkerInputDateTimeData=function(e,t){var n=e.value;if(n){var i="timeMarker",o=m({},t);o[i]=n,this.isDateValid12(o)?e.isCompleted=!0:n=n.slice(0,n.length-1),e.value=n||void 0,t[i]=n||void 0}},t.prototype.updateInputDateTimeData=function(e,t){var n=e.value;if(n){var i=e.lexem.type,o=m({},t);if(o[i]=parseInt(this.parseTwoDigitYear(e)),n.length===e.lexem.maxCount){if(this.isDateValid12(o))return e.isCompleted=!0,e.value=n||void 0,void(t[i]=parseInt(n)>0?parseInt(n):void 0);n=n.slice(0,n.length-1)}o[i]=parseInt(n);var r=parseInt(n[0]),s=this.validBeginningOfNumbers[i+(e.lexem.upperCase?"U":"")];"year"!==i||this.isYearValid(o)?void 0!==s&&r>s?this.isDateValid12(o)?e.isCompleted=!0:n=n.slice(0,n.length-1):void 0!==s&&0!==r&&r<=s&&(this.checkValidationDateTimePart(o,i,e),e.isCompleted&&!this.isDateValid12(o)&&(n=n.slice(0,n.length-1))):(n=n.slice(0,n.length-1),e.isCompleted=!1),e.value=n||void 0,t[i]=parseInt(n)>0?parseInt(n):void 0}},t.prototype.checkValidationDateTimePart=function(e,t,n){var i=e[t],o=10*i,r=10;"month"===t&&(r=3),"hour"===t&&(r=this.is12Hours?3:5),n.isCompleted=!0;for(var s=0;s<r;s++)if(e[t]=o+s,this.isDateValid12(e)){n.isCompleted=!1;break}e[t]=i},t.prototype.getCorrectDatePartFormat=function(e,t){var n=e.lexem,i=e.value||"";if(i&&"timeMarker"===n.type)return t&&(i+=this.getPlaceholder(n.count,i,n.value)),i;(i&&e.isCompleted&&(i=parseInt(i).toString()),i&&e.isCompleted)?i=this.getPlaceholder(n.count,i,"0")+i:(i=function(e,t){var n=t;return e.count<e.maxCount&&("day"===e.type&&0===parseInt(t[0])||"month"===e.type&&0===parseInt(t[0]))&&(n=t.slice(1,t.length)),n}(n,i),t&&(i+=this.getPlaceholder(n.count,i,n.value)));return i},t.prototype.createIDateTimeComposition=function(){var e,t;return this.hasDatePart?(e=this.min||"0001-01-01",t=this.max||"9996-12-31"):(e=this.defaultDate+(this.min||"00:00:00"),t=this.defaultDate+(this.max||"23:59:59")),{hour:void 0,minute:void 0,second:void 0,day:void 0,month:void 0,year:void 0,min:new Date(e),max:new Date(t)}},t.prototype.parseTwoDigitYear=function(e){var t=e.value;return"year"!==e.lexem.type||e.lexem.count>2?t:(this.max&&this.max.length>=4&&(this.turnOfTheCentury=parseInt(this.max.slice(2,4))),(parseInt(t)>this.turnOfTheCentury?"19":"20")+t)},t.prototype.getFormatedString=function(e){var t="",n="",i=!1,o=this.inputDateTimeData.length-1;if(!e){var r=this.inputDateTimeData.filter(function(e){return!!e.value});o=this.inputDateTimeData.indexOf(r[r.length-1])}for(var s=0;s<this.inputDateTimeData.length;s++){var a=this.inputDateTimeData[s];switch(a.lexem.type){case"timeMarker":case"hour":case"minute":case"second":case"day":case"month":case"year":if(void 0===a.value&&!e)return t+=i?n:"";var l=e||o>s;t+=n+this.getCorrectDatePartFormat(a,l),i=a.isCompleted;break;case"separator":n=a.lexem.value}}return t},t.prototype.cleanTimeMarker=function(e,t){var n="";e=e.toUpperCase();for(var i=0;i<e.length;i++)(!n&&("P"==e[i]||"A"==e[i])||n&&"M"==e[i])&&(n+=e[i]);return n=t?n.toUpperCase():n.toLowerCase()},t.prototype.setInputDateTimeData=function(e){var t=this,n=0;this.initInputDateTimeData(),this.lexems.forEach(function(i,o){if(e.length>0&&n<e.length){if("separator"===i.type)return;var r=t.inputDateTimeData[o],s=e[n],a=void 0;a="timeMarker"===i.type?t.cleanTimeMarker(s,i.upperCase):t.leaveOnlyNumbers(s),r.value=a.slice(0,i.maxCount),n++}})},t.prototype._getMaskedValue=function(e,t){var n=this;void 0===t&&(t=!0);var i=null==e?"":e.toString(),o=this.getParts(i);this.setInputDateTimeData(o);var r=this.createIDateTimeComposition();return this.inputDateTimeData.forEach(function(e){"timeMarker"===e.lexem.type?n.updateTimeMarkerInputDateTimeData(e,r):n.updateInputDateTimeData(e,r)}),this.getFormatedString(t)},t.prototype.getParts=function(e){for(var t=[],n=this.lexems.filter(function(e){return"separator"!==e.type}),i=this.lexems.filter(function(e){return"separator"===e.type}).map(function(e){return e.value}),o="",r=!1,s=!1,a=0;a<e.length;a++){var l=e[a];if(l.match(Bo)||l===n[t.length].value||"timeMarker"===n[t.length].type?(r=!1,s=!1,o+=l):-1!==i.indexOf(l)?s||(r=!0,t.push(o),o=""):r||(s=!0,t.push(o),o=""),t.length>=n.length){r=!1;break}}return(""!=o||r)&&t.push(o),t},t.prototype.getUnmaskedValue=function(e){var t,n=this,i=null==e?"":e.toString(),o=this.getParts(i);this.setInputDateTimeData(o);var r=null===(t=this.inputDateTimeData.filter(function(e){return"timeMarker"===e.lexem.type})[0])||void 0===t?void 0:t.value.toLowerCase()[0],s=this.createIDateTimeComposition(),a=!1;return this.inputDateTimeData.forEach(function(e){var t=e.value;if("timeMarker"!=e.lexem.type&&"separator"!=e.lexem.type)if(!t||t.length<e.lexem.count)a=!0;else{var i=parseInt(n.parseTwoDigitYear(e));"hour"==e.lexem.type&&"p"===r&&i!=n.twelve&&(i+=n.twelve),s[e.lexem.type]=i}}),a?"":this.getISO_8601Format(s)},t.prototype.getMaskedValue=function(e){return this.getMaskedStrFromISO(e)},t.prototype.processInput=function(e){var t={value:e.prevValue,caretPosition:e.selectionEnd,cancelPreventDefault:!1},n=e.prevValue.slice(0,e.selectionStart),i=e.prevValue.slice(e.selectionEnd);return t.value=this._getMaskedValue(n+(e.insertedChars||"")+i),e.insertedChars||"backward"!==e.inputDirection?t.caretPosition=this._getMaskedValue(n+(e.insertedChars||""),!1).length:t.caretPosition=e.selectionStart,t},v([qe()],t.prototype,"min",void 0),v([qe()],t.prototype,"max",void 0),t}(ks);Q.addClass("datetimemask",[{name:"min",type:"datetime",enableIf:function(e){return!!e.pattern}},{name:"max",type:"datetime",enableIf:function(e){return!!e.pattern}}],function(){return new _s},"patternmask");var Bs=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return y(t,e),t.prototype.getType=function(){return"currencymask"},t.prototype.wrapText=function(e){var t=this.prefix||"",n=this.suffix||"",i=e;return i?(-1===i.indexOf(t)&&(i=t+i),-1===i.indexOf(n)&&(i+=n),i):i},t.prototype.unwrapInputArgs=function(e){var t=e.prevValue;if(t){if(this.prefix&&-1!==t.indexOf(this.prefix)){t=t.slice(t.indexOf(this.prefix)+this.prefix.length);var n=(this.prefix||"").length;e.selectionStart=Math.max(e.selectionStart-n,0),e.selectionEnd-=n}this.suffix&&-1!==t.indexOf(this.suffix)&&(t=t.slice(0,t.indexOf(this.suffix))),e.prevValue=t}},t.prototype.processInput=function(t){this.unwrapInputArgs(t);var n=e.prototype.processInput.call(this,t),i=(this.prefix||"").length;return n.value&&(n.caretPosition+=i),n.value=this.wrapText(n.value),n},t.prototype.getMaskedValue=function(t){var n=e.prototype.getMaskedValue.call(this,t);return this.wrapText(n)},v([qe()],t.prototype,"prefix",void 0),v([qe()],t.prototype,"suffix",void 0),t}(Fs);function qs(n){!function(e,n,i){if(!e)return;var o=function(e){var t,n,i,o={},r=0,s=0,a="",l=String.fromCharCode,u=e.length,p="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(t=0;t<64;t++)o[p.charAt(t)]=t;for(n=0;n<u;n++){for(r=(r<<6)+o[e.charAt(n)],s+=6;s>=8;)((i=r>>>(s-=8)&255)||n<u-2)&&(a+=l(i))}return a},r=o(e);if(!r)return;var s=r.indexOf(";");if(s<0)return;if(!function(e){if(!e)return!0;var n="domains:",i=e.indexOf(n);if(i<0)return!0;var o=e.substring(i+n.length).toLowerCase().split(",");if(!Array.isArray(o)||0===o.length)return!0;var r=t.getLocation();if(r&&r.hostname){for(var s=r.hostname.toLowerCase(),a=0;a<o.length;a++)if(s.indexOf(o[a])>-1)return!0;return!1}return!0}(r.substring(0,s)))return;(r=r.substring(s+1)).split(",").forEach(function(e){var t=e.indexOf("=");if(t>0){var o=new Date(e.substring(t+1));n[e.substring(0,t)]=new Date(i)<=o||o}})}(n,Hs,e.ReleaseDate)}function Qs(e){var t=Hs[e.toString()];return t||!1}Q.addClass("currencymask",[{name:"prefix"},{name:"suffix"}],function(){return new Bs},"numericmask"),e.Version=void 0,e.ReleaseDate=void 0,e.Version="".concat("2.5.31"),r.version=e.Version,e.ReleaseDate="".concat("2026-06-30");var Hs={};var zs=function(){function e(){this.icons={},this.iconPrefix="icon-",this.onIconsChanged=new I}return e.prototype.processId=function(e,t){return 0==e.indexOf(t)&&(e=e.substring(t.length)),e=Es[e]||e},e.prototype.registerIconFromSymbol=function(e,t){this.icons[e]=t},e.prototype.registerIconFromSvgViaElement=function(e,t,i){if(void 0===i&&(i=this.iconPrefix),n.isAvailable()){e=this.processId(e,i);var o=n.createElement("div");o.innerHTML=t;var r=n.createElement("symbol"),s=o.querySelector("svg");r.innerHTML=s.innerHTML;for(var a=0;a<s.attributes.length;a++)r.setAttributeNS("http://www.w3.org/2000/svg",s.attributes[a].name,s.attributes[a].value);r.id=i+e,this.registerIconFromSymbol(e,r.outerHTML)}},e.prototype.registerIconFromSvg=function(e,t,n){void 0===n&&(n=this.iconPrefix),e=this.processId(e,n);var i="<svg ",o="</svg>",r=(t=t.trim()).toLowerCase();return r.substring(0,5)===i&&r.substring(r.length-6,r.length)===o&&(this.registerIconFromSymbol(e,'<symbol id="'+n+e+'" '+t.substring(5,r.length-6)+"</symbol>"),!0)},e.prototype.registerIconsFromFolder=function(e){var t=this;e.keys().forEach(function(n){t.registerIconFromSvg(n.substring(2,n.length-4).toLowerCase(),e(n))})},e.prototype.registerIcons=function(e){for(var t in e)this.registerIconFromSvg(t,e[t]);this.updateMarkup()},e.prototype.registerIcon=function(e,t,n){var i;void 0===n&&(n="v2"),this.registerIconFromSvg(e,t),Gs(n,((i={})[e]=t,i))},e.prototype.iconsRenderedHtml=function(){var e=this;return Object.keys(this.icons).map(function(t){return e.icons[t]}).join("")},e.prototype.updateMarkup=function(){this.onIconsChanged.fire(this,{})},e}(),Us=new zs,Ws={};function Gs(e,t){Ws[e]||(Ws[e]={});var n=Ws[e];for(var i in t)n[i]=t[i]}e.Action=rt,e.ActionContainer=Tt,e.ActionDropdownViewModel=st,e.AdaptiveActionContainer=Ht,e.AnimationBoolean=Jt,e.AnimationGroup=Kt,e.AnimationGroupUtils=Wt,e.AnimationProperty=Gt,e.AnimationPropertyUtils=Ut,e.AnimationTab=Yt,e.AnimationUtils=zt,e.AnswerCountValidator=Ye,e.AnswerRequiredError=Se,e.ArrayChanges=Pe,e.ArrayOperand=Rn,e.Base=Ve,e.BaseAction=ot,e.BinaryOperand=Tn,e.ButtonGroupItemModel=Ss,e.ButtonGroupItemValue=xs,e.CalculatedValue=bn,e.CharacterCounter=Fo,e.CheckboxItem=lr,e.ChoiceItem=Co,e.ChoicesRestful=xn,e.ChoicesRestfull=In,e.ComponentCollection=Jn,e.ComponentQuestionJSON=Gn,e.ComputedUpdater=we,e.ConditionRunner=ee,e.ConditionsParser=_n,e.Const=An,e.Cover=Xi,e.CoverCell=Yi,e.CssClassBuilder=tt,e.CustomError=Be,e.CustomWidgetCollection=sn,e.DefaultTitleModel=or,e.DomDocumentHelper=n,e.DomWindowHelper=t,e.DragDropChoices=dr,e.DragDropCore=Ai,e.DragDropRankingSelectToRank=gr,e.DragOrClickHelper=Li,e.DropdownListModel=Eo,e.DropdownMultiSelectListModel=cr,e.ElementFactory=ei,e.EmailValidator=Ze,e.Event=x,e.EventBase=I,e.ExceedFilesCountError=Re,e.ExceedSizeError=Oe,e.ExpressionExecutorRunner=Bn,e.ExpressionRunner=X,e.ExpressionValidator=$e,e.FlowPanelModel=ir,e.FunctionFactory=te,e.FunctionOperand=Ln,e.Helpers=f,e.HtmlConditionItem=wn,e.ImageItemValue=Fr,e.InputMaskBase=As,e.InputMaskCurrency=Bs,e.InputMaskDateTime=_s,e.InputMaskNumeric=Fs,e.InputMaskPattern=ks,e.IsMobile=Dt,e.ItemValue=vn,e.JsonError=L,e.JsonIncorrectTypeError=F,e.JsonMetadata=D,e.JsonMetadataClass=A,e.JsonMissingTypeError=k,e.JsonMissingTypeErrorBase=M,e.JsonObject=q,e.JsonObjectProperty=O,e.JsonRequiredPropertyError=j,e.JsonUnknownPropertyError=N,e.ListModel=jt,e.LocalizableString=S,e.LocalizableStrings=E,e.MatrixCells=Lo,e.MatrixColumn=Ao,e.MatrixDropdownCell=gi,e.MatrixDropdownColumn=si,e.MatrixDropdownRowModel=xi,e.MatrixDropdownRowModelBase=vi,e.MatrixDynamicRowModel=Fi,e.MatrixRowModel=Do,e.Model=vo,e.MultiSelectListModel=pr,e.MultipleTextCell=tr,e.MultipleTextEditorModel=Yo,e.MultipleTextErrorCell=nr,e.MultipleTextItemModel=Xo,e.MutlipleTextErrorRow=er,e.MutlipleTextRow=$o,e.Notifier=Ki,e.NumericValidator=Je,e.OneAnswerRequiredError=Ee,e.Operand=En,e.PageModel=oo,e.PanelModel=io,e.PanelModelBase=no,e.PopupBaseViewModel=ms,e.PopupDropdownViewModel=Cs,e.PopupModalManager=Ps,e.PopupModalViewModel=ws,e.PopupModel=_t,e.PopupSurveyModel=ds,e.ProcessValue=J,e.ProgressButtons=ro,e.ProgressButtonsResponsivityManager=so,e.Question=gn,e.QuestionBooleanModel=kr,e.QuestionButtonGroupModel=Is,e.QuestionCheckboxBase=Vo,e.QuestionCheckboxModel=ur,e.QuestionCommentModel=mr,e.QuestionCompositeModel=Zn,e.QuestionCustomModel=Yn,e.QuestionCustomWidget=rn,e.QuestionDropdownModel=Oo,e.QuestionEmptyModel=sr,e.QuestionExpressionModel=ti,e.QuestionFactory=$n,e.QuestionFileModel=Ir,e.QuestionFileModelBase=Pr,e.QuestionFilePage=xr,e.QuestionHtmlModel=Er,e.QuestionImageMapModel=_r,e.QuestionImageModel=zr,e.QuestionImagePickerModel=jr,e.QuestionMatrixBaseModel=Qn,e.QuestionMatrixDropdownModel=Ii,e.QuestionMatrixDropdownModelBase=wi,e.QuestionMatrixDropdownRenderedCell=li,e.QuestionMatrixDropdownRenderedErrorRow=pi,e.QuestionMatrixDropdownRenderedRow=ui,e.QuestionMatrixDropdownRenderedTable=hi,e.QuestionMatrixDynamicModel=ji,e.QuestionMatrixModel=Mo,e.QuestionMultipleTextModel=Zo,e.QuestionNonValue=rr,e.QuestionPanelDynamicItem=es,e.QuestionPanelDynamicModel=ns,e.QuestionRadiogroupModel=Tr,e.QuestionRankingModel=yr,e.QuestionRatingModel=Dr,e.QuestionRowModel=to,e.QuestionSelectBase=wo,e.QuestionSignaturePadModel=Kr,e.QuestionSingleInputSummary=Mi,e.QuestionSingleInputSummaryItem=Ni,e.QuestionSliderModel=Nr,e.QuestionTagboxModel=hr,e.QuestionTextBase=jo,e.QuestionTextModel=Qo,e.RatingItemValue=Ar,e.RegexValidator=Xe,e.RenderedRatingItem=Ar,e.RendererFactory=an,e.RequreNumericError=Te,e.ResponsivityManager=xt,e.ScrollViewModel=gs,e.Serializer=Q,e.SliderLabelItemValue=Lr,e.SurveyElement=nn,e.SurveyElementCore=tn,e.SurveyError=Ie,e.SurveyModel=vo,e.SurveyNavigationLayoutModel=yo,e.SurveyProgressModel=os,e.SurveyProgressTextModel=fo,e.SurveyTimer=Ui,e.SurveyTimerModel=Wi,e.SurveyTrigger=ss,e.SurveyTriggerComplete=ls,e.SurveyTriggerCopyValue=hs,e.SurveyTriggerRunExpression=cs,e.SurveyTriggerSetValue=us,e.SurveyTriggerSkip=ps,e.SurveyTriggerVisible=as,e.SurveyValidator=We,e.SurveyWindowModel=fs,e.SvgIconRegistry=zs,e.SvgRegistry=Us,e.SvgThemeSets=Ws,e.TOCModel=ho,e.TextAreaModel=un,e.TextPreProcessor=Un,e.TextValidator=Ke,e.Trigger=rs,e.UnaryOperand=On,e.UrlConditionItem=Vn,e.ValidatorResult=Ue,e.ValidatorRunner=Ge,e.Variable=Dn,e.VerticalResponsivityManager=It,e._setIsTablet=function(e){Mt=e},e._setIsTouch=function(t){e.IsTouch=t},e.activateLazyRenderingChecks=dt,e.addIconsToThemeSet=Gs,e.checkLibraryVersion=function(t,n){if(e.Version!=t){var i="survey-core has version '"+e.Version+"' and "+n+" has version '"+t+"'. SurveyJS libraries should have the same versions to work correctly.";console.error(i)}},e.chooseFiles=Ji,e.classesToSelector=ft,e.cleanHtmlElementAfterAnimation=en,e.compareArrays=u,e.compareVersions=function(e,t){for(var n=/(\.0+)+$/,i=e.replace(n,"").split("."),o=t.replace(n,"").split("."),r=Math.min(i.length,o.length),s=0;s<r;s++){var a=parseInt(i[s],10)-parseInt(o[s],10);if(a)return a}return i.length-o.length},e.configConfirmDialog=Oi,e.confirmAction=Si,e.confirmActionAsync=Ei,e.createDropdownActionModel=function(e,t,n){return t.locOwner=n,Bt(e,t,t)},e.createDropdownActionModelAdvanced=Bt,e.createPopupModalViewModel=Vs,e.createPopupModelWithListModel=qt,e.createPopupViewModel=function(e){return e.isModal?new ws(e):new Cs(e)},e.createSvg=function(e,t,i,o,r,s){if(r){"auto"!==e&&(r.style.width=(e||t||16)+"px",r.style.height=(e||i||16)+"px");var a=r.childNodes[0],l=Rs(o);a.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href","#"+l);var u=r.getElementsByTagName("title")[0];s?(u||(u=n.getDocument().createElementNS("http://www.w3.org/2000/svg","title"),r.appendChild(u)),u.textContent=s):u&&r.removeChild(u)}},e.createTOCListModel=uo,e.defaultActionBarCss=nt,e.defaultCss=Qi,e.defaultThemeName=Hi,e.detectIEBrowser=function(){var e=navigator.userAgent,t=e.indexOf("MSIE "),n=e.indexOf("Trident/");return t>-1||n>-1},e.detectIEOrEdge=vr,e.doKey2ClickBlur=Io,e.doKey2ClickDown=function(e,t){if(void 0===t&&(t={processEsc:!0}),t&&(t.__keyDownReceived=!0),!e.target||"true"!==e.target.contentEditable){var n=e.which||e.keyCode,i=[13,32];t.processEsc&&i.push(27),-1!==i.indexOf(n)&&e.preventDefault()}},e.doKey2ClickUp=So,e.englishStrings=C,e.findParentByClassNames=function e(t,n){if(t)return n.every(function(e){return!e||t.classList.contains(e)})?t:e(t.parentElement,n)},e.findScrollableParent=ht,e.floorTo2Decimals=p,e.getActionDropdownButtonTarget=Qt,e.getActiveElement=pt,e.getCustomNewIconNameIfExists=Os,e.getElement=lt,e.getElementWidth=gt,e.getFirstVisibleChild=mt,e.getIconNameFromProxy=Rs,e.getLocaleString=V,e.getLocaleStrings=function(e){return w.getLocaleStrings(e)},e.getNewIconName=Ts,e.getOriginalEvent=function(e){return e.originalEvent||e},e.getRenderedSize=s,e.getRenderedStyleSize=a,e.getRootNode=ut,e.getSafeUrl=vt,e.getTocRootCss=co,e.getVerticalDimensions=Xt,e.glc=Qs,e.hasLicense=function(e){return!0===Qs(e)},e.increaseHeightByContent=ln,e.isBase64URL=wt,e.isContainerVisible=yt,e.isElementVisible=ct,e.isMobile=function(){return t.isAvailable()&&t.hasOwn("orientation")},e.isShadowDOM=at,e.loadFileFromBase64=Gi,e.matrixDropdownColumnTypes=ri,e.mergeValues=l,e.mulberry32=c,e.navigateToUrl=bt,e.prepareElementForVerticalAnimation=$t,e.preventDefaults=Vt,e.property=qe,e.propertyArray=He,e.registerFunction=function(e){te.Instance.register(e.name,e.func,e.isAsync,e.useCache)},e.renamedIcons=Es,e.sanitizeEditableContent=function(e,i){if(void 0===i&&(i=!0),t.isAvailable()&&n.isAvailable()&&e.childNodes.length>0){var o=t.getSelection();if(0==o.rangeCount)return;var r=o.getRangeAt(0);r.setStart(r.endContainer,r.endOffset),r.setEndAfter(e.lastChild),o.removeAllRanges(),o.addRange(r);var s=o.toString(),a=e.innerText;s=s.replace(/\r/g,""),i&&(s=s.replace(/\n/g,""),a=a.replace(/\n/g,""));var l=s.length;for(e.innerText=a,(r=n.getDocument().createRange()).setStart(e.firstChild,0),r.setEnd(e.firstChild,0),o.removeAllRanges(),o.addRange(r);o.toString().length<a.length-l;){var u=o.toString().length;if(o.modify("extend","forward","character"),o.toString().length==u)break}(r=o.getRangeAt(0)).setStart(r.endContainer,r.endOffset)}},e.setCreatePopupModelWithListModel=it,e.setLicenseKey=function(e){qs(e)},e.setPropertiesOnElementForAnimation=Zt,e.settings=r,e.setupLocale=function(e){w.setupLocale(e)},e.showConfirmDialog=Ti,e.slk=qs,e.surveyCss=qi,e.surveyLocalization=w,e.surveyStrings=P,e.tryFocusPage=ao,e.unwrap=function(e){return"function"!=typeof e?e:e()},e.updateListCssValues=Pt,e.wrapUrlForBackgroundImage=Ct});
11
+ class Ur{constructor(e,t,n,i){if(isNaN(e)||isNaN(t))throw new Error(`Point is invalid: (${e}, ${t})`);this.x=+e,this.y=+t,this.pressure=n||0,this.time=i||Date.now()}distanceTo(e){return Math.sqrt(Math.pow(this.x-e.x,2)+Math.pow(this.y-e.y,2))}equals(e){return this.x===e.x&&this.y===e.y&&this.pressure===e.pressure&&this.time===e.time}velocityFrom(e){return this.time!==e.time?this.distanceTo(e)/(this.time-e.time):0}}class Wr{static fromPoints(e,t){const n=this.calculateControlPoints(e[0],e[1],e[2]).c2,i=this.calculateControlPoints(e[1],e[2],e[3]).c1;return new Wr(e[1],n,i,e[2],t.start,t.end)}static calculateControlPoints(e,t,n){const i=e.x-t.x,o=e.y-t.y,r=t.x-n.x,s=t.y-n.y,a=(e.x+t.x)/2,l=(e.y+t.y)/2,u=(t.x+n.x)/2,p=(t.y+n.y)/2,c=Math.sqrt(i*i+o*o),h=Math.sqrt(r*r+s*s),d=h/(c+h),f=u+(a-u)*d,g=p+(l-p)*d,y=t.x-f,m=t.y-g;return{c1:new Ur(a+y,l+m),c2:new Ur(u+y,p+m)}}constructor(e,t,n,i,o,r){this.startPoint=e,this.control2=t,this.control1=n,this.endPoint=i,this.startWidth=o,this.endWidth=r}length(){let e,t,n=0;for(let i=0;i<=10;i+=1){const o=i/10,r=this.point(o,this.startPoint.x,this.control1.x,this.control2.x,this.endPoint.x),s=this.point(o,this.startPoint.y,this.control1.y,this.control2.y,this.endPoint.y);if(i>0){const i=r-e,o=s-t;n+=Math.sqrt(i*i+o*o)}e=r,t=s}return n}point(e,t,n,i,o){return t*(1-e)*(1-e)*(1-e)+3*n*(1-e)*(1-e)*e+3*i*(1-e)*e*e+o*e*e*e}}class Gr{constructor(){try{this._et=new EventTarget}catch(e){this._et=document}}addEventListener(e,t,n){this._et.addEventListener(e,t,n)}dispatchEvent(e){return this._et.dispatchEvent(e)}removeEventListener(e,t,n){this._et.removeEventListener(e,t,n)}}class Jr extends Gr{constructor(e,t={}){super(),this.canvas=e,this._drawingStroke=!1,this._isEmpty=!0,this._lastPoints=[],this._data=[],this._lastVelocity=0,this._lastWidth=0,this._handleMouseDown=e=>{1===e.buttons&&this._strokeBegin(e)},this._handleMouseMove=e=>{this._strokeMoveUpdate(e)},this._handleMouseUp=e=>{1===e.buttons&&this._strokeEnd(e)},this._handleTouchStart=e=>{if(e.cancelable&&e.preventDefault(),1===e.targetTouches.length){const t=e.changedTouches[0];this._strokeBegin(t)}},this._handleTouchMove=e=>{e.cancelable&&e.preventDefault();const t=e.targetTouches[0];this._strokeMoveUpdate(t)},this._handleTouchEnd=e=>{if(e.target===this.canvas){e.cancelable&&e.preventDefault();const t=e.changedTouches[0];this._strokeEnd(t)}},this._handlePointerStart=e=>{e.preventDefault(),this._strokeBegin(e)},this._handlePointerMove=e=>{this._strokeMoveUpdate(e)},this._handlePointerEnd=e=>{this._drawingStroke&&(e.preventDefault(),this._strokeEnd(e))},this.velocityFilterWeight=t.velocityFilterWeight||.7,this.minWidth=t.minWidth||.5,this.maxWidth=t.maxWidth||2.5,this.throttle="throttle"in t?t.throttle:16,this.minDistance="minDistance"in t?t.minDistance:5,this.dotSize=t.dotSize||0,this.penColor=t.penColor||"black",this.backgroundColor=t.backgroundColor||"rgba(0,0,0,0)",this.compositeOperation=t.compositeOperation||"source-over",this.canvasContextOptions="canvasContextOptions"in t?t.canvasContextOptions:{},this._strokeMoveUpdate=this.throttle?function(e,t=250){let n,i,o,r=0,s=null;const a=()=>{r=Date.now(),s=null,n=e.apply(i,o),s||(i=null,o=[])};return function(...l){const u=Date.now(),p=t-(u-r);return i=this,o=l,p<=0||p>t?(s&&(clearTimeout(s),s=null),r=u,n=e.apply(i,o),s||(i=null,o=[])):s||(s=window.setTimeout(a,p)),n}}(Jr.prototype._strokeUpdate,this.throttle):Jr.prototype._strokeUpdate,this._ctx=e.getContext("2d",this.canvasContextOptions),this.clear(),this.on()}clear(){const{_ctx:e,canvas:t}=this;e.fillStyle=this.backgroundColor,e.clearRect(0,0,t.width,t.height),e.fillRect(0,0,t.width,t.height),this._data=[],this._reset(this._getPointGroupOptions()),this._isEmpty=!0}fromDataURL(e,t={}){return new Promise((n,i)=>{const o=new Image,r=t.ratio||window.devicePixelRatio||1,s=t.width||this.canvas.width/r,a=t.height||this.canvas.height/r,l=t.xOffset||0,u=t.yOffset||0;this._reset(this._getPointGroupOptions()),o.onload=()=>{this._ctx.drawImage(o,l,u,s,a),n()},o.onerror=e=>{i(e)},o.crossOrigin="anonymous",o.src=e,this._isEmpty=!1})}toDataURL(e="image/png",t){return"image/svg+xml"===e?("object"!=typeof t&&(t=void 0),`data:image/svg+xml;base64,${btoa(this.toSVG(t))}`):("number"!=typeof t&&(t=void 0),this.canvas.toDataURL(e,t))}on(){this.canvas.style.touchAction="none",this.canvas.style.msTouchAction="none",this.canvas.style.userSelect="none";const e=/Macintosh/.test(navigator.userAgent)&&"ontouchstart"in document;window.PointerEvent&&!e?this._handlePointerEvents():(this._handleMouseEvents(),"ontouchstart"in window&&this._handleTouchEvents())}off(){this.canvas.style.touchAction="auto",this.canvas.style.msTouchAction="auto",this.canvas.style.userSelect="auto",this.canvas.removeEventListener("pointerdown",this._handlePointerStart),this.canvas.removeEventListener("pointermove",this._handlePointerMove),this.canvas.ownerDocument.removeEventListener("pointerup",this._handlePointerEnd),this.canvas.removeEventListener("mousedown",this._handleMouseDown),this.canvas.removeEventListener("mousemove",this._handleMouseMove),this.canvas.ownerDocument.removeEventListener("mouseup",this._handleMouseUp),this.canvas.removeEventListener("touchstart",this._handleTouchStart),this.canvas.removeEventListener("touchmove",this._handleTouchMove),this.canvas.removeEventListener("touchend",this._handleTouchEnd)}isEmpty(){return this._isEmpty}fromData(e,{clear:t=!0}={}){t&&this.clear(),this._fromData(e,this._drawCurve.bind(this),this._drawDot.bind(this)),this._data=this._data.concat(e)}toData(){return this._data}_getPointGroupOptions(e){return{penColor:e&&"penColor"in e?e.penColor:this.penColor,dotSize:e&&"dotSize"in e?e.dotSize:this.dotSize,minWidth:e&&"minWidth"in e?e.minWidth:this.minWidth,maxWidth:e&&"maxWidth"in e?e.maxWidth:this.maxWidth,velocityFilterWeight:e&&"velocityFilterWeight"in e?e.velocityFilterWeight:this.velocityFilterWeight,compositeOperation:e&&"compositeOperation"in e?e.compositeOperation:this.compositeOperation}}_strokeBegin(e){if(!this.dispatchEvent(new CustomEvent("beginStroke",{detail:e,cancelable:!0})))return;this._drawingStroke=!0;const t=this._getPointGroupOptions(),n=Object.assign(Object.assign({},t),{points:[]});this._data.push(n),this._reset(t),this._strokeUpdate(e)}_strokeUpdate(e){if(!this._drawingStroke)return;if(0===this._data.length)return void this._strokeBegin(e);this.dispatchEvent(new CustomEvent("beforeUpdateStroke",{detail:e}));const t=e.clientX,n=e.clientY,i=void 0!==e.pressure?e.pressure:void 0!==e.force?e.force:0,o=this._createPoint(t,n,i),r=this._data[this._data.length-1],s=r.points,a=s.length>0&&s[s.length-1],l=!!a&&o.distanceTo(a)<=this.minDistance,u=this._getPointGroupOptions(r);if(!a||!a||!l){const e=this._addPoint(o,u);a?e&&this._drawCurve(e,u):this._drawDot(o,u),s.push({time:o.time,x:o.x,y:o.y,pressure:o.pressure})}this.dispatchEvent(new CustomEvent("afterUpdateStroke",{detail:e}))}_strokeEnd(e){this._drawingStroke&&(this._strokeUpdate(e),this._drawingStroke=!1,this.dispatchEvent(new CustomEvent("endStroke",{detail:e})))}_handlePointerEvents(){this._drawingStroke=!1,this.canvas.addEventListener("pointerdown",this._handlePointerStart),this.canvas.addEventListener("pointermove",this._handlePointerMove),this.canvas.ownerDocument.addEventListener("pointerup",this._handlePointerEnd)}_handleMouseEvents(){this._drawingStroke=!1,this.canvas.addEventListener("mousedown",this._handleMouseDown),this.canvas.addEventListener("mousemove",this._handleMouseMove),this.canvas.ownerDocument.addEventListener("mouseup",this._handleMouseUp)}_handleTouchEvents(){this.canvas.addEventListener("touchstart",this._handleTouchStart),this.canvas.addEventListener("touchmove",this._handleTouchMove),this.canvas.addEventListener("touchend",this._handleTouchEnd)}_reset(e){this._lastPoints=[],this._lastVelocity=0,this._lastWidth=(e.minWidth+e.maxWidth)/2,this._ctx.fillStyle=e.penColor,this._ctx.globalCompositeOperation=e.compositeOperation}_createPoint(e,t,n){const i=this.canvas.getBoundingClientRect();return new Ur(e-i.left,t-i.top,n,(new Date).getTime())}_addPoint(e,t){const{_lastPoints:n}=this;if(n.push(e),n.length>2){3===n.length&&n.unshift(n[0]);const e=this._calculateCurveWidths(n[1],n[2],t),i=Wr.fromPoints(n,e);return n.shift(),i}return null}_calculateCurveWidths(e,t,n){const i=n.velocityFilterWeight*t.velocityFrom(e)+(1-n.velocityFilterWeight)*this._lastVelocity,o=this._strokeWidth(i,n),r={end:o,start:this._lastWidth};return this._lastVelocity=i,this._lastWidth=o,r}_strokeWidth(e,t){return Math.max(t.maxWidth/(e+1),t.minWidth)}_drawCurveSegment(e,t,n){const i=this._ctx;i.moveTo(e,t),i.arc(e,t,n,0,2*Math.PI,!1),this._isEmpty=!1}_drawCurve(e,t){const n=this._ctx,i=e.endWidth-e.startWidth,o=2*Math.ceil(e.length());n.beginPath(),n.fillStyle=t.penColor;for(let n=0;n<o;n+=1){const r=n/o,s=r*r,a=s*r,l=1-r,u=l*l,p=u*l;let c=p*e.startPoint.x;c+=3*u*r*e.control1.x,c+=3*l*s*e.control2.x,c+=a*e.endPoint.x;let h=p*e.startPoint.y;h+=3*u*r*e.control1.y,h+=3*l*s*e.control2.y,h+=a*e.endPoint.y;const d=Math.min(e.startWidth+a*i,t.maxWidth);this._drawCurveSegment(c,h,d)}n.closePath(),n.fill()}_drawDot(e,t){const n=this._ctx,i=t.dotSize>0?t.dotSize:(t.minWidth+t.maxWidth)/2;n.beginPath(),this._drawCurveSegment(e.x,e.y,i),n.closePath(),n.fillStyle=t.penColor,n.fill()}_fromData(e,t,n){for(const i of e){const{points:e}=i,o=this._getPointGroupOptions(i);if(e.length>1)for(let n=0;n<e.length;n+=1){const i=e[n],r=new Ur(i.x,i.y,i.pressure,i.time);0===n&&this._reset(o);const s=this._addPoint(r,o);s&&t(s,o)}else this._reset(o),n(e[0],o)}}toSVG({includeBackgroundColor:e=!1}={}){const t=this._data,n=Math.max(window.devicePixelRatio||1,1),i=this.canvas.width/n,o=this.canvas.height/n,r=document.createElementNS("http://www.w3.org/2000/svg","svg");if(r.setAttribute("xmlns","http://www.w3.org/2000/svg"),r.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink"),r.setAttribute("viewBox",`0 0 ${i} ${o}`),r.setAttribute("width",i.toString()),r.setAttribute("height",o.toString()),e&&this.backgroundColor){const e=document.createElement("rect");e.setAttribute("width","100%"),e.setAttribute("height","100%"),e.setAttribute("fill",this.backgroundColor),r.appendChild(e)}return this._fromData(t,(e,{penColor:t})=>{const n=document.createElement("path");if(!(isNaN(e.control1.x)||isNaN(e.control1.y)||isNaN(e.control2.x)||isNaN(e.control2.y))){const i=`M ${e.startPoint.x.toFixed(3)},${e.startPoint.y.toFixed(3)} C ${e.control1.x.toFixed(3)},${e.control1.y.toFixed(3)} ${e.control2.x.toFixed(3)},${e.control2.y.toFixed(3)} ${e.endPoint.x.toFixed(3)},${e.endPoint.y.toFixed(3)}`;n.setAttribute("d",i),n.setAttribute("stroke-width",(2.25*e.endWidth).toFixed(3)),n.setAttribute("stroke",t),n.setAttribute("fill","none"),n.setAttribute("stroke-linecap","round"),r.appendChild(n)}},(e,{penColor:t,dotSize:n,minWidth:i,maxWidth:o})=>{const s=document.createElement("circle"),a=n>0?n:(i+o)/2;s.setAttribute("r",a.toString()),s.setAttribute("cx",e.x.toString()),s.setAttribute("cy",e.y.toString()),s.setAttribute("fill",t),r.appendChild(s)}),r.outerHTML}}var Kr=function(e){function i(t){var n=e.call(this,t)||this;return n.valueIsUpdatingInternally=!1,n._loadedData=void 0,n.updateValueHandler=function(){n._loadedData=void 0,n.scaleCanvas(!0,!0)},n}return y(i,e),i.prototype.onPropertyValueChanged=function(t,n,i){e.prototype.onPropertyValueChanged.call(this,t,n,i),"penColor"!==t&&"backgroundColor"!==t&&"backgroundImage"!==t||this.signaturePad&&this.updateColors(this.signaturePad)},i.prototype.getPenColorFromTheme=function(){var e=this.survey;return!!e&&!!e.themeVariables&&e.themeVariables["--sjs-primary-backcolor"]},i.prototype.updateColors=function(e){var t=this.getPenColorFromTheme(),n=this.getPropertyByName("penColor");e.penColor=this.penColor||t||n.defaultValue||"#1ab394";var i=this.getPropertyByName("backgroundColor"),o=t?"transparent":void 0,r=this.backgroundImage?"transparent":this.backgroundColor;e.backgroundColor=r||o||i.defaultValue||"#ffffff"},i.prototype.getCssRoot=function(t){return(new tt).append(e.prototype.getCssRoot.call(this,t)).append(t.small,"300"===this.signatureWidth.toString()).toString()},i.prototype.getFormat=function(){return"jpeg"===this.dataFormat?"image/jpeg":"svg"===this.dataFormat?"image/svg+xml":""},i.prototype.updateValue=function(){if(this.signaturePad){var e=this.signaturePad.toDataURL(this.getFormat());this.valueIsUpdatingInternally=!0,this.value=e,this.valueIsUpdatingInternally=!1}},i.prototype.getType=function(){return"signaturepad"},i.prototype.afterRenderQuestionElement=function(n){t.isAvailable()&&n&&(this.isDesignMode||this.initSignaturePad(n),this.element=n),e.prototype.afterRenderQuestionElement.call(this,n)},i.prototype.beforeDestroyQuestionElement=function(e){e&&this.destroySignaturePad(e)},i.prototype.themeChanged=function(e){this.signaturePad&&this.updateColors(this.signaturePad)},i.prototype.resizeCanvas=function(){this.canvas.width=this.containerWidth,this.canvas.height=this.containerHeight},i.prototype.scaleCanvas=function(e,t){void 0===e&&(e=!0),void 0===t&&(t=!1);var n=this.canvas,i=n.offsetWidth/this.containerWidth;(this.scale!=i||t)&&(this.scale=i,n.style.width=this.renderedCanvasWidth,this.resizeCanvas(),this.signaturePad.minWidth=this.penMinWidth*i,this.signaturePad.maxWidth=this.penMaxWidth*i,n.getContext("2d").scale(1/i,1/i),e&&this.loadPreview(this.value))},i.prototype.fromUrl=function(e){var t=this;if(this.isFileLoading=!0,wt(e))this.fromDataUrl(e),this.isFileLoading=!1;else{var i=new Image;i.crossOrigin="anonymous",i.src=e,i.onload=function(){if(t.canvas){var e=n.createElement("canvas");e.width=t.containerWidth,e.height=t.containerHeight,e.getContext("2d").drawImage(i,0,0);var o=e.toDataURL(t.getFormat());t.fromDataUrl(o)}t.isFileLoading=!1},i.onerror=function(){t.isFileLoading=!1}}},i.prototype.fromDataUrl=function(e){if(this._loadedData=e,this.signaturePad){var n=1,i=this.scale;if("svg"===this.dataFormat)n=t.getDevicePixelRatio()||1,i=1;var o={width:this.canvas.width*i/n,height:this.canvas.height*i/n};this.signaturePad.fromDataURL(e,o)}},Object.defineProperty(i.prototype,"loadedData",{get:function(){return this._loadedData},enumerable:!1,configurable:!0}),i.prototype.loadPreview=function(e){var t=this;if(!e)return this.signaturePad&&this.canvas&&(this.canvas.getContext("2d").clearRect(0,0,this.canvas.width*this.scale,this.canvas.height*this.scale),this.signaturePad.clear()),this.hasDrawnStroke=!1,void(this.valueWasChangedFromLastUpload=!1);if(this.storeDataAsText)this.fromDataUrl(e);else if(this.loadedData)this.fromDataUrl(this.loadedData);else{var n=e?[e]:[];this._previewLoader&&this._previewLoader.dispose(),this.isFileLoading=!0,this._previewLoader=new Sr(this,function(n,i){"success"===n&&i&&i.length>0&&i[0].content?(t.fromDataUrl(i[0].content),t.isFileLoading=!1):"skipped"===n&&t.fromUrl(e),t._previewLoader.dispose(),t._previewLoader=void 0}),this._previewLoader.load(n)}},i.prototype.onChangeQuestionValue=function(t){e.prototype.onChangeQuestionValue.call(this,t),this.isLoadingFromJson||(this._loadedData=void 0,this.loadPreview(t))},i.prototype.onSurveyLoad=function(){e.prototype.onSurveyLoad.call(this),this.loadPreview(this.value)},i.prototype.initSignaturePad=function(e){var t=this,n=e.getElementsByTagName("canvas")[0];this.canvas=n,this.resizeCanvas();var i=new Jr(n,{backgroundColor:"#ffffff"});this.signaturePad=i,this.isInputReadOnly&&i.off(),this.readOnlyChangedCallback=function(){t.isInputReadOnly?i.off():i.on()},this.updateColors(i),i.addEventListener("beginStroke",function(){t.scaleCanvas(),t.hasDrawnStroke=!0,n.focus()},{once:!1}),i.addEventListener("endStroke",function(){t.storeDataAsText?t.updateValue():t.valueWasChangedFromLastUpload=!0},{once:!1}),this.updateValueHandler(),this.readOnlyChangedCallback();var o=function(e,n){"signatureWidth"!==n.name&&"signatureHeight"!==n.name||t.valueIsUpdatingInternally||t.updateValueHandler()};this.onPropertyChanged.add(o),this.signaturePad.propertyChangedHandler=o},i.prototype.destroySignaturePad=function(e){this.signaturePad&&(this.onPropertyChanged.remove(this.signaturePad.propertyChangedHandler),this.signaturePad.off()),this.readOnlyChangedCallback=null,this.signaturePad=null},Object.defineProperty(i.prototype,"containerHeight",{get:function(){return this.signatureHeight||200},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"containerWidth",{get:function(){return this.signatureWidth||300},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"renderedCanvasWidth",{get:function(){return this.signatureAutoScaleEnabled?"100%":this.containerWidth+"px"},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"canShowClearButton",{get:function(){var e=!this.nothingIsDrawn(),t=this.isUploading;return!this.isInputReadOnly&&this.allowClear&&e&&!t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"clearButtonCaption",{get:function(){return this.getLocalizationString("clearCaption")},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"locRenderedPlaceholder",{get:function(){return this.isReadOnly?this.locPlaceholderReadOnly:this.locPlaceholder},enumerable:!1,configurable:!0}),i.prototype.nothingIsDrawn=function(){var e=this.hasDrawnStroke,t=this.isEmpty(),n=this.isUploading,i=this.valueWasChangedFromLastUpload;return!e&&t&&!n&&!i},i.prototype.needShowPlaceholder=function(){return this.showPlaceholder&&this.nothingIsDrawn()},i.prototype.onBlurCore=function(t){if(e.prototype.onBlurCore.call(this,t),!this.storeDataAsText&&!this.element.contains(t.relatedTarget)){if(!this.valueWasChangedFromLastUpload)return;this.uploadFiles([(n=this.signaturePad.toDataURL(this.getFormat()),i=this.name+"."+Yr(this.dataFormat),o=this.getFormat(),r=atob(n.split(",")[1]),s=new Uint8Array(r.split("").map(function(e){return e.charCodeAt(0)})).buffer,new File([s],i,{type:o}))],"signature"),this.valueWasChangedFromLastUpload=!1}var n,i,o,r,s},i.prototype.uploadResultItemToValue=function(e){return e.content},i.prototype.setValueFromResult=function(e){this.valueIsUpdatingInternally=!0,this.value=(null==e?void 0:e.length)?e.map(function(e){return e.content})[0]:void 0,this.valueIsUpdatingInternally=!1},i.prototype.onClearValue=function(){e.prototype.onClearValue.call(this),this.valueWasChangedFromLastUpload=!1,this._loadedData=void 0,this.loadPreview(this.value)},i.prototype.endLoadingFromJson=function(){e.prototype.endLoadingFromJson.call(this),300===this.signatureWidth&&this.width&&"number"==typeof this.width&&this.width&&(Z.warn("Use signatureWidth property to set width for the signature pad"),this.signatureWidth=this.width,this.width=void 0),200===this.signatureHeight&&this.height&&(Z.warn("Use signatureHeight property to set width for the signature pad"),this.signatureHeight=this.height,this.height=void 0)},v([qe({defaultValue:!1})],i.prototype,"hasDrawnStroke",void 0),v([qe({defaultValue:!1})],i.prototype,"isReadyForUpload",void 0),v([qe({defaultValue:!1})],i.prototype,"valueWasChangedFromLastUpload",void 0),v([qe({onSetting:function(e){return Yr(e)}})],i.prototype,"dataFormat",void 0),v([qe()],i.prototype,"signatureWidth",void 0),v([qe()],i.prototype,"signatureHeight",void 0),v([qe()],i.prototype,"signatureAutoScaleEnabled",void 0),v([qe()],i.prototype,"penMinWidth",void 0),v([qe()],i.prototype,"penMaxWidth",void 0),v([qe()],i.prototype,"height",void 0),v([qe()],i.prototype,"allowClear",void 0),v([qe()],i.prototype,"penColor",void 0),v([qe()],i.prototype,"backgroundColor",void 0),v([qe()],i.prototype,"backgroundImage",void 0),v([qe({})],i.prototype,"showPlaceholder",void 0),v([qe({localizable:{defaultStr:"signaturePlaceHolder",markdown:!0}})],i.prototype,"placeholder",void 0),v([qe({localizable:{defaultStr:"signaturePlaceHolderReadOnly",markdown:!0}})],i.prototype,"placeholderReadOnly",void 0),i}(Pr);function Yr(e){return e||(e="png"),"jpeg"!==(e=e.replace("image/","").replace("+xml",""))&&"svg"!==e&&(e="png"),e}Q.addClass("signaturepad",[{name:"signatureWidth:number",default:300},{name:"signatureHeight:number",default:200},{name:"signatureAutoScaleEnabled:boolean",default:!1},{name:"penMinWidth:number",default:.5},{name:"penMaxWidth:number",default:2.5},{name:"height:number",visible:!1},{name:"allowClear:boolean",default:!0},{name:"showPlaceholder:boolean",default:!0},{name:"placeholder:text",serializationProperty:"locPlaceholder",dependsOn:"showPlaceholder",visibleIf:function(e){return e.showPlaceholder}},{name:"placeholderReadOnly:text",serializationProperty:"locPlaceholderReadOnly",dependsOn:"showPlaceholder",visibleIf:function(e){return e.showPlaceholder}},{name:"backgroundImage:file"},{name:"penColor:color"},{name:"backgroundColor:color"},{name:"dataFormat",default:"png",choices:[{value:"png",text:"PNG"},{value:"jpeg",text:"JPEG"},{value:"svg",text:"SVG"}],onSettingValue:function(e,t){return Yr(t)}},{name:"defaultValue",visible:!1},{name:"correctAnswer",visible:!1},{name:"storeDataAsText:boolean",default:!0},{name:"waitForUpload:boolean",default:!1}],function(){return new Kr("")},"question"),$n.Instance.registerQuestion("signaturepad",function(e){return new Kr(e)});var Xr=function(e){function t(t){var n=e.call(this,t)||this;return n.item=t,n}return y(t,e),t.prototype.getNextName=function(){return r.expressionVariables.nextPanel},t.prototype.getPrevName=function(){return r.expressionVariables.prevPanel},t.prototype.getVisibleItem=function(e){return e<0||e>=this.getPanels(!0).length?null:this.getPanels(!0)[e].data},t.prototype.getSpecificValue=function(e){var t=e.path;if(t.length>1&&t[0].name.toLocaleLowerCase()===r.expressionVariables.parentPanel.toLocaleLowerCase()){var n=this.item.data;if(n&&n.parentQuestion&&n.parent&&n.parent.data)return t[0].name=this.variableName,e.isRoot=!0,n.parent.data.getValueGetterContext().getValue(e)}return null},t.prototype.getTextValue=function(t,n,i){return t=t.toLocaleLowerCase(),[this.indexVar,this.visIndexVar].indexOf(t)>-1&&n>-1&&n++,e.prototype.getTextValue.call(this,t,n,i)},Object.defineProperty(t.prototype,"indexVar",{get:function(){return r.expressionVariables.panelIndex.toLocaleLowerCase()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"visIndexVar",{get:function(){return r.expressionVariables.visiblePanelIndex.toLocaleLowerCase()},enumerable:!1,configurable:!0}),t.prototype.getItemVariableNames=function(){return[r.expressionVariables.panelIndex,r.expressionVariables.visiblePanelIndex]},t.prototype.getItemValue=function(e){return(e=e.toLocaleLowerCase())===this.indexVar?this.panelIndex:e==this.visIndexVar?this.visibleIndex:void 0},Object.defineProperty(t.prototype,"panelIndex",{get:function(){return this.getPanels(!1).indexOf(this.item.panel)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"visibleIndex",{get:function(){return this.getPanels(!0).indexOf(this.item.panel)},enumerable:!1,configurable:!0}),t.prototype.getPanels=function(e){var t=this.item.data;return t?e?t.visiblePanels:t.panels:[]},t}(di),Zr=function(e){function t(t){var n=e.call(this,t)||this;return n.question=t,n}return y(t,e),t.prototype.getValue=function(t){var n=t.path,i=this.question,o=t.index;if(o>-1&&i.isDesignMode&&n.length>0){var r=n[0].name,s=i.template.getQuestionByName(r);return s?(n.shift(),0===n.length?{isFound:!0}:s.getValueGetterContext().getValue(t)):{isFound:!1}}if(o>-1){if(o>=0&&o<i.panels.length){var a=i.panels[o].data;return t.isRoot=!1,a.getValueGetterContext().getValue(t)}return{isFound:!1,value:void 0,context:this}}return!t.createObjects&&this.question.isEmpty()?{isFound:0===n.length,value:void 0}:e.prototype.getValue.call(this,t)},t}(cn),$r=function(e){function t(t){return e.call(this,t)||this}return y(t,e),t}(rt),es=function(e){function t(t,n){var i=e.call(this,t)||this;return i.data=t,i.data=t,i.panelValue=n,i.setSurveyImpl(),i}return y(t,e),Object.defineProperty(t.prototype,"panel",{get:function(){return this.panelValue},enumerable:!1,configurable:!0}),t.prototype.setSurveyImpl=function(){this.panel.setSurveyImpl(this)},t.prototype.getValueGetterContext=function(){return new Xr(this)},t.prototype.getVariableName=function(){return r.expressionVariables.panel},t.prototype.getQuestionsByValueName=function(e,t){return this.panel.getQuestionsByValueName(e,t)},t.prototype.getQuestionByName=function(e){return this.panel.getQuestionByName(e)},t.prototype.getIndex=function(){return this.data.getItemIndex(this)},Object.defineProperty(t.prototype,"questions",{get:function(){return this.panel.questions},enumerable:!1,configurable:!0}),t.prototype.setValue=function(e,t){!this.isSettingValue&&this.isValueChanged(e,t)&&(this.updateSharedQuestionsValue(e,t),this.data.updateItemValue(this,e,f.getUnbindValue(t),!1),this.runTriggersOnSetValue(e,t))},t.prototype.getComment=function(e){var t=this.getValue(e+r.commentSuffix);return t||""},t.prototype.setComment=function(e,t,n){this.setValue(e+r.commentSuffix,t)},t}(fi),ts=function(){function e(e){this.data=e}return e.prototype.getSurveyData=function(){return null},e.prototype.getSurvey=function(){return this.data.getSurvey()},e.prototype.getTextProcessor=function(){return null},e}(),ns=function(e){function t(t){var n=e.call(this,t)||this;return n._renderedPanels=[],n.isPanelsAnimationRunning=!1,n.isAddingNewPanels=!1,n.isSetPanelItemData={},n.createNewArray("panels",function(e){n.onPanelAdded(e)},function(e){n.onPanelRemoved(e)}),n.createNewArray("visiblePanels"),n.templateValue=n.createAndSetupNewPanelObject(),n.template.renderWidth="100%",n.template.selectedElementInDesign=n,n.template.addElementCallback=function(e){n.addOnPropertyChangedCallback(e),n.rebuildPanels()},n.template.removeElementCallback=function(){n.rebuildPanels()},n}return y(t,e),Object.defineProperty(t.prototype,"dynamicPanelCallbacks",{get:function(){return this.survey},enumerable:!1,configurable:!0}),t.prototype.onPropertyValueChanged=function(t,n,i){e.prototype.onPropertyValueChanged.call(this,t,n,i),"panelsState"===t&&this.setPanelsState();["newPanelPosition","displayMode","showProgressBar"].indexOf(t)>-1&&this.updateFooterActions(),"allowAddPanel"===t&&this.updateNoEntriesTextDefaultLoc(),"minPanelCount"===t&&this.onMinPanelCountChanged(),"maxPanelCount"===t&&this.onMaxPanelCountChanged();if(["templateQuestionTitleLocation","templateQuestionTitleWidth"].indexOf(t)>-1){var o=this.visiblePanelsCore;o&&o.forEach(function(e){e.updateElementCss(!0)})}"showQuestionNumbers"===t&&this.survey&&this.lifecycleCallbacks.questionVisibilityChanged(this,this.visible,!0),"tabAlign"===t&&this.isRenderModeTab&&(this.tabbedMenu.containerCss=this.getTabbedMenuCss())},t.prototype.validateExpressions=function(t){void 0===t&&(t={functions:!0,variables:!0,semantics:!0}),this.useTemplatePanel||new es(this,this.template);var n=e.prototype.validateExpressions.call(this,t);return this.useTemplatePanel||this.setTemplatePanelSurveyImpl(),n},Object.defineProperty(t.prototype,"isCompositeQuestion",{get:function(){return!0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isContainer",{get:function(){return!0},enumerable:!1,configurable:!0}),t.prototype.getFirstQuestionToFocus=function(e){for(var t=0,n=this.currentPanel?[this.currentPanel]:this.visiblePanelsCore;t<n.length;t++){var i=n[t].getFirstQuestionToFocus(e);if(i)return i}return this.showAddPanelButton&&(!e||this.currentErrorCount>0)?this:null},t.prototype.getFirstInputElementId=function(){var t=this.getFirstQuestionToFocus(!1);return t&&t!==this?t.inputId:this.showAddPanelButton?this.addButtonId:e.prototype.getFirstInputElementId.call(this)},t.prototype.getFirstErrorInputElementId=function(){var t=this.getFirstQuestionToFocus(!0);return t?t.inputId:e.prototype.getFirstErrorInputElementId.call(this)},t.prototype.setSurveyImpl=function(t,n){e.prototype.setSurveyImpl.call(this,t,n),this.setTemplatePanelSurveyImpl(),this.setPanelsSurveyImpl()},t.prototype.getFilteredData=function(){return this.value},t.prototype.assignOnPropertyChangedToTemplate=function(){for(var e=this.template.elements,t=0;t<e.length;t++)this.addOnPropertyChangedCallback(e[t])},t.prototype.addOnPropertyChangedCallback=function(e){var t=this;e.isQuestion&&e.setParentQuestion(this),e.onPropertyChanged.add(function(e,n){t.onTemplateElementPropertyChanged(e,n)}),e.isPanel&&(e.addElementCallback=function(e){t.addOnPropertyChangedCallback(e)})},t.prototype.onTemplateElementPropertyChanged=function(e,t){if(!this.isLoadingFromJson&&!this.useTemplatePanel&&0!=this.panelsCore.length&&Q.findProperty(e.getType(),t.name))for(var n=this.panelsCore,i=0;i<n.length;i++){var o=n[i].getQuestionByName(e.name);o&&o[t.name]!==t.newValue&&(o[t.name]=t.newValue)}},Object.defineProperty(t.prototype,"useTemplatePanel",{get:function(){return this.isDesignMode&&!this.isContentElement},enumerable:!1,configurable:!0}),t.prototype.getType=function(){return"paneldynamic"},t.prototype.getAllChildren=function(){return b(b([],e.prototype.getAllChildren.call(this),!0),this.templateElements,!0)},t.prototype.clearOnDeletingContainer=function(){this.panelsCore.forEach(function(e){e.clearOnDeletingContainer()})},Object.defineProperty(t.prototype,"isAllowTitleLeft",{get:function(){return!1},enumerable:!1,configurable:!0}),t.prototype.removeElement=function(e){return this.template.removeElement(e)},Object.defineProperty(t.prototype,"template",{get:function(){return this.templateValue},enumerable:!1,configurable:!0}),t.prototype.getPanelInDesignMode=function(){return this.template},t.prototype.getPanels=function(){return[this.template]},Object.defineProperty(t.prototype,"templateElements",{get:function(){return this.template.elements},enumerable:!1,configurable:!0}),t.prototype.isPropertyStoredInHash=function(t){return"templateElements"!==t&&e.prototype.isPropertyStoredInHash.call(this,t)},t.prototype.mergeLocalizationWithInnerObjects=function(e,t){var n=e.template;n&&this.template.mergeLocalizationObj(n,t)},Object.defineProperty(t.prototype,"templateTitle",{get:function(){return this.template.title},set:function(e){this.template.title=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"locTemplateTitle",{get:function(){return this.template.locTitle},enumerable:!1,configurable:!0}),t.prototype.getLocalizableString=function(t){return"templateTitle"===t?this.template.locTitle:"templateDescription"===t?this.template.locDescription:e.prototype.getLocalizableString.call(this,t)},Object.defineProperty(t.prototype,"templateDescription",{get:function(){return this.template.description},set:function(e){this.template.description=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"locTemplateDescription",{get:function(){return this.template.locDescription},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"templateVisibleIf",{get:function(){return this.getPropertyValue("templateVisibleIf")},set:function(e){this.setPropertyValue("templateVisibleIf",e),this.template.visibleIf=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"questionStartIndex",{get:function(){return this.template.questionStartIndex},set:function(e){this.template.questionStartIndex=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"items",{get:function(){for(var e=[],t=0;t<this.panelsCore.length;t++)e.push(this.panelsCore[t].data);return e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"panels",{get:function(){return this.buildPanelsFirstTime(this.canBuildPanels),this.panelsCore},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"visiblePanels",{get:function(){return this.buildPanelsFirstTime(this.canBuildPanels),this.visiblePanelsCore},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"panelsCore",{get:function(){return this.getPropertyValue("panels")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"visiblePanelsCore",{get:function(){return this.getPropertyValue("visiblePanels")},enumerable:!1,configurable:!0}),t.prototype.onPanelAdded=function(e){if(this.onPanelRemovedCore(e),e.visible){for(var t=0,n=this.panelsCore,i=0;i<n.length&&n[i]!==e;i++)n[i].visible&&t++;this.visiblePanelsCore.splice(t,0,e),this.addTabFromToolbar(e,t),this.currentPanel||(this.currentPanel=e),this.updateRenderedPanels()}},t.prototype.onPanelRemoved=function(e){var t=this.onPanelRemovedCore(e);if(this.currentPanel===e){var n=this.visiblePanelsCore;t>=n.length&&(t=n.length-1),this.currentPanel=t>=0?n[t]:null}this.updateRenderedPanels()},t.prototype.onPanelRemovedCore=function(e){var t=this.visiblePanelsCore,n=t.indexOf(e);return n>-1&&(t.splice(n,1),this.removeTabFromToolbar(e)),n},Object.defineProperty(t.prototype,"currentIndex",{get:function(){return this.isRenderModeList?-1:this.useTemplatePanel?0:this.visiblePanelsCore.indexOf(this.currentPanel)},set:function(e){e<0||this.visiblePanelCount<1||(e>=this.visiblePanelCount&&(e=this.visiblePanelCount-1),this.currentPanel=this.visiblePanelsCore[e])},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"currentPanel",{get:function(){if(this.isDesignMode)return this.template;if(this.isRenderModeList||this.useTemplatePanel)return null;var e=this.getPropertyValue("currentPanel",null);return!e&&this.visiblePanelCount>0&&(e=this.visiblePanelsCore[0],this.currentPanel=e),e},set:function(e){if(!this.isRenderModeList&&!this.useTemplatePanel){var t=this.getPropertyValue("currentPanel"),n=e?this.visiblePanelsCore.indexOf(e):-1;if(!(e&&n<0||e===t)&&(t&&t.onHidingContent(),e&&e.onFirstRendering(),this.setPropertyValue("currentPanel",e),this.updateRenderedPanels(),this.updateFooterActions(),this.updateTabToolbarItemsPressedState(),this.fireCallback(this.currentIndexChangedCallback),n>-1&&this.survey)){var i={panel:e,visiblePanelIndex:n};this.dynamicPanelCallbacks.dynamicPanelCurrentIndexChanged(this,i)}}},enumerable:!1,configurable:!0}),t.prototype.getUIState=function(){var t=e.prototype.getUIState.call(this),n=this.currentIndex;return n>0&&((t=t||{}).activePanelIndex=n),t},t.prototype.setUIState=function(t){e.prototype.setUIState.call(this,t),t.activePanelIndex&&(this.currentIndex=t.activePanelIndex)},t.prototype.updateRenderedPanels=function(){var e=this,t=[];this.isRenderModeList?t=[].concat(this.visiblePanels):this.currentPanel&&(t=[this.currentPanel]),t.forEach(function(t){return e.panelOnFirstRendering(t)}),this.renderedPanels=t},t.prototype.panelOnFirstRendering=function(e){e&&(e.onFirstRendering(),e.locStrsChanged())},Object.defineProperty(t.prototype,"renderedPanels",{get:function(){return this._renderedPanels},set:function(e){0==this.renderedPanels.length||0==e.length?(this.blockAnimations(),this.panelsAnimation.sync(e),this.releaseAnimations()):(this.isPanelsAnimationRunning=!0,this.panelsAnimation.sync(e))},enumerable:!1,configurable:!0}),t.prototype.getPanelsAnimationOptions=function(){var e=this,t=function(){if(e.isRenderModeList)return"";var t=new tt,n=!1,i=e.renderedPanels.filter(function(t){return t!==e.currentPanel})[0],o=e.visiblePanels.indexOf(i);return o<0&&(n=!0,o=e.removedPanelIndex),t.append("sv-pd-animation-adding",!!e.focusNewPanelCallback).append("sv-pd-animation-removing",n).append("sv-pd-animation-left",o<=e.currentIndex).append("sv-pd-animation-right",o>e.currentIndex).toString()};return{getRerenderEvent:function(){return e.onElementRerendered},getAnimatedElement:function(t){var n,i;if(t&&e.cssContent){var o=ft(e.cssContent);return null===(i=null===(n=e.getWrapperElement())||void 0===n?void 0:n.querySelector(":scope ".concat(o," #").concat(t.id)))||void 0===i?void 0:i.parentElement}},getEnterOptions:function(){return{onBeforeRunAnimation:function(t){if(e.focusNewPanelCallback){var n=e.isRenderModeList?t:t.parentElement;nn.ScrollElementToViewCore(n,!1,!1,{behavior:"smooth"})}!e.isRenderModeList&&t.parentElement?Zt(t.parentElement,{heightTo:t.offsetHeight+"px"}):$t(t)},onAfterRunAnimation:function(e){en(e),e.parentElement&&en(e.parentElement)},cssClass:(new tt).append(e.cssClasses.panelWrapperEnter).append(t()).toString()}},getLeaveOptions:function(){return{onBeforeRunAnimation:function(t){!e.isRenderModeList&&t.parentElement?Zt(t.parentElement,{heightFrom:t.offsetHeight+"px"}):$t(t)},onAfterRunAnimation:function(e){en(e),e.parentElement&&en(e.parentElement)},cssClass:(new tt).append(e.cssClasses.panelWrapperLeave).append(t()).toString()}},isAnimationEnabled:function(){return e.animationAllowed&&!!e.getWrapperElement()}}},t.prototype.disablePanelsAnimations=function(){this.panelsCore.forEach(function(e){e.blockAnimations()})},t.prototype.enablePanelsAnimations=function(){this.panelsCore.forEach(function(e){e.releaseAnimations()})},t.prototype.updatePanelsAnimation=function(){var e=this;this._panelsAnimations=new(this.isRenderModeList?Kt:Yt)(this.getPanelsAnimationOptions(),function(t,n){e._renderedPanels=t,n||(e.isPanelsAnimationRunning=!1,e.focusNewPanel())},function(){return e._renderedPanels})},Object.defineProperty(t.prototype,"panelsAnimation",{get:function(){return this._panelsAnimations||this.updatePanelsAnimation(),this._panelsAnimations},enumerable:!1,configurable:!0}),t.prototype.onHidingContent=function(){e.prototype.onHidingContent.call(this),this.currentPanel?this.currentPanel.onHidingContent():this.visiblePanelsCore.forEach(function(e){return e.onHidingContent()})},Object.defineProperty(t.prototype,"panelPrevText",{get:function(){return this.prevPanelText},set:function(e){this.prevPanelText=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"panelNextText",{get:function(){return this.nextPanelText},set:function(e){this.nextPanelText=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"panelAddText",{get:function(){return this.addPanelText},set:function(e){this.addPanelText=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"panelRemoveText",{get:function(){return this.removePanelText},set:function(e){this.removePanelText=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isProgressTopShowing",{get:function(){return"carousel"==this.displayMode&&("top"===this.progressBarLocation||"topBottom"===this.progressBarLocation)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isProgressBottomShowing",{get:function(){return"carousel"==this.displayMode&&("bottom"===this.progressBarLocation||"topBottom"===this.progressBarLocation)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isPrevButtonVisible",{get:function(){return this.currentIndex>0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isPrevButtonShowing",{get:function(){return this.isPrevButtonVisible},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isNextButtonVisible",{get:function(){return this.currentIndex>=0&&this.currentIndex<this.visiblePanelCount-1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isNextButtonShowing",{get:function(){return this.isNextButtonVisible},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isRangeShowing",{get:function(){return this.showProgressBar&&this.currentIndex>=0&&this.visiblePanelCount>1},enumerable:!1,configurable:!0}),t.prototype.getElementsInDesign=function(e){return void 0===e&&(e=!1),e?[this.template]:this.templateElements},t.prototype.prepareValueForPanelCreating=function(){this.addingNewPanelsValue=this.value,this.isAddingNewPanels=!0,this.isNewPanelsValueChanged=!1},t.prototype.setValueAfterPanelsCreating=function(){this.isAddingNewPanels=!1,this.isNewPanelsValueChanged&&(this.isValueChangingInternally=!0,this.value=this.addingNewPanelsValue,this.isValueChangingInternally=!1)},t.prototype.getValueCore=function(){return this.isAddingNewPanels?this.addingNewPanelsValue:e.prototype.getValueCore.call(this)},t.prototype.setValueCore=function(t){this.isAddingNewPanels?(this.isNewPanelsValueChanged=!0,this.addingNewPanelsValue=t):e.prototype.setValueCore.call(this,t)},t.prototype.setIsMobile=function(t){e.prototype.setIsMobile.call(this,t),(this.panelsCore||[]).forEach(function(e){return e.getQuestions(!0).forEach(function(e){e.setIsMobile(t)})})},t.prototype.themeChanged=function(t){e.prototype.themeChanged.call(this,t),(this.panelsCore||[]).forEach(function(e){return e.getQuestions(!0).forEach(function(e){e.themeChanged(t)})})},Object.defineProperty(t.prototype,"panelCount",{get:function(){return!this.canBuildPanels||this.wasNotRenderedInSurvey?this.getPropertyValue("panelCount"):this.panelsCore.length},set:function(e){if(!(e<0)){if(!this.isLoadingFromJson&&this.isDesignMode){var t=this.minPanelCount;e<t&&(e=t);var n=this.maxPanelCount;n>0&&e>n&&(e=n)}if(!this.canBuildPanels||this.wasNotRenderedInSurvey)return this.setPropertyValue("panelCount",e),void this.updateFooterActions();if(e!=this.panelsCore.length&&!this.useTemplatePanel){this.updateBindings("panelCount",e),this.prepareValueForPanelCreating();for(var i=e-this.panelCount===1,o=this.panelCount,r=this.panelCount;r<e;r++){var s=this.createNewPanel();this.panelsCore.push(s),"list"==this.displayMode&&"default"!=this.panelsState&&("expanded"===this.panelsState?s.expand():s.title&&s.collapse())}i&&this.singleInputOnAddItem(this.settingPanelCountBasedOnValue),e<this.panelCount&&this.panelsCore.splice(e,this.panelCount-e),this.disablePanelsAnimations(),this.setValueAfterPanelsCreating(),this.setValueBasedOnPanelCount(),this.reRunCondition(),this.updateFooterActions(),this.updateNewPanelsVisibleIndex(o),this.fireCallback(this.panelCountChangedCallback),this.enablePanelsAnimations()}}},enumerable:!1,configurable:!0}),t.prototype.updateNewPanelsVisibleIndex=function(e){if(this.survey){var t=this.getShowQuestionNumbers();if("onpanel"===t||"recursive"===t)for(var n=e;n<this.panelsCore.length;n++)this.panelsCore[n].setVisibleIndex(0)}},Object.defineProperty(t.prototype,"visiblePanelCount",{get:function(){return this.visiblePanels.length},enumerable:!1,configurable:!0}),t.prototype.getStructuredValue=function(e){if(void 0===e&&(e=-1),e<0||this.isEmpty()||!Array.isArray(this.value))return this.value;for(var t=new Array,n=Math.min(this.visiblePanelCount,this.value.length),i=0;i<n;i++){var o={};this.visiblePanels[i].collectValues(o,e),t.push(o)}return t},t.prototype.setTemplatePanelSurveyImpl=function(){this.template.setSurveyImpl(this.useTemplatePanel?this.surveyImpl:new ts(this))},t.prototype.setPanelsSurveyImpl=function(){for(var e=0;e<this.panelsCore.length;e++){var t=this.panelsCore[e];t!=this.template&&t.setSurveyImpl(t.data)}},t.prototype.setPanelsState=function(){if(!this.useTemplatePanel&&"list"==this.displayMode&&this.templateTitle)for(var e=0;e<this.panelsCore.length;e++){var t=this.panelsState;"firstExpanded"===t&&(t=0===e?"expanded":"collapsed"),"expanded"===t?this.panelsCore[e].expand(!1):this.panelsCore[e].state=t}},t.prototype.setValueBasedOnPanelCount=function(){var e=this.value;if(e&&Array.isArray(e)||(e=[]),e.length!=this.panelCount){for(var t=e.length;t<this.panelCount;t++){var n=this.panels[t].getValue(),i=f.isValueEmpty(n)?{}:n;e.push(i)}e.length>this.panelCount&&e.splice(this.panelCount,e.length-this.panelCount),this.isValueChangingInternally=!0,this.value=e,this.isValueChangingInternally=!1}},t.prototype.onMinPanelCountChanged=function(){var e=this.minPanelCount;e>this.maxPanelCount&&(this.maxPanelCount=e),this.panelCount<e&&(this.panelCount=e)},t.prototype.onMaxPanelCountChanged=function(){var e=this.maxPanelCount;e<this.minPanelCount&&(this.minPanelCount=e),this.panelCount>e&&(this.panelCount=e),this.updateFooterActions()},Object.defineProperty(t.prototype,"addButtonId",{get:function(){return this.id+"addPanel"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"templateTitleLocation",{get:function(){return this.templateQuestionTitleLocation},set:function(e){this.templateQuestionTitleLocation=e},enumerable:!1,configurable:!0}),t.prototype.resetSingleInput=function(){e.prototype.resetSingleInput.call(this),this.locTemplateTitle.onGetTextCallback=null},Object.defineProperty(t.prototype,"locEditPanelText",{get:function(){return this.getOrCreateLocStr("editPanelText",!1,"editText")},enumerable:!1,configurable:!0}),t.prototype.createSingleInputBehavior=function(){return new is(this)},t.prototype.getShowQuestionNumbers=function(){var e,t=this.showQuestionNumbers;if("default"===t){var n=null===(e=this.survey)||void 0===e?void 0:e.showQuestionNumbers;if("recursive"===n)return n}return t},t.prototype.notifySurveyOnChildrenVisibilityChanged=function(){return"default"===this.showQuestionNumbers},Object.defineProperty(t.prototype,"panelRemoveButtonLocation",{get:function(){return this.removePanelButtonLocation},set:function(e){this.removePanelButtonLocation=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"showRangeInProgress",{get:function(){return this.showProgressBar},set:function(e){this.showProgressBar=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"renderMode",{get:function(){var e=this.displayMode;if("carousel"==e){var t=this.progressBarLocation;if("top"==t)return"progressTop";if("bottom"==t)return"progressBottom";if("topBottom"==t)return"progressTopBottom"}return e},set:function(e){(e||"").startsWith("progress")?("progressTop"==e?this.progressBarLocation="top":"progressBottom"==e?this.progressBarLocation="bottom":"progressTopBottom"==e&&(this.progressBarLocation="topBottom"),this.displayMode="carousel"):this.displayMode=e},enumerable:!1,configurable:!0}),t.prototype.updatePanelView=function(){this.blockAnimations(),this.updateRenderedPanels(),this.releaseAnimations(),this.updatePanelsAnimation()},Object.defineProperty(t.prototype,"isRenderModeList",{get:function(){return"list"===this.displayMode||this.isSingleInputActive},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isRenderModeTab",{get:function(){return"tab"===this.displayMode&&!this.isSingleInputActive},enumerable:!1,configurable:!0}),t.prototype.setVisibleIndex=function(t){var n=this.isDesignMode?[this.template]:this.visiblePanelsCore;if(this.isVisibleIndexNegative(t))return n.forEach(function(e){return e.setVisibleIndex(-1)}),e.prototype.setVisibleIndex.call(this,-1);for(var i=this.getShowQuestionNumbers(),o="default"===i,r=o?t:0,s=0;s<n.length;s++){var a=this.setPanelVisibleIndex(n[s],r,"off"!=i);o&&(r+=a)}return e.prototype.setVisibleIndex.call(this,o?-1:t),o?r-t:1},t.prototype.setPanelVisibleIndex=function(e,t,n){return n?e.setVisibleIndex(t):(e.setVisibleIndex(-1),0)},Object.defineProperty(t.prototype,"canAddPanel",{get:function(){return!this.isDesignMode&&(!(!this.legacyNavigation&&!this.isRenderModeList&&this.currentIndex<this.visiblePanelCount-1&&"next"!==this.newPanelPosition)&&(this.allowAddPanel&&!this.isReadOnly&&this.panelCount<this.maxPanelCount))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"canRemovePanel",{get:function(){return!this.isDesignMode&&(this.allowRemovePanel&&!this.isReadOnly&&this.panelCount>this.minPanelCount)},enumerable:!1,configurable:!0}),t.prototype.rebuildPanels=function(){var e;if(!this.isLoadingFromJson){this.prepareValueForPanelCreating();var t=[];if(this.useTemplatePanel)new es(this,this.template),t.push(this.template);else for(var n=0;n<this.panelCount;n++)t.push(this.createNewPanel());(e=this.panelsCore).splice.apply(e,b([0,this.panelsCore.length],t,!1)),this.setValueAfterPanelsCreating(),this.setPanelsState(),this.reRunCondition(),this.updateFooterActions(),this.fireCallback(this.panelCountChangedCallback),this.updateTabToolbar()}},Object.defineProperty(t.prototype,"defaultValueFromLastPanel",{get:function(){return this.copyDefaultValueFromLastEntry},set:function(e){this.copyDefaultValueFromLastEntry=e},enumerable:!1,configurable:!0}),t.prototype.isDefaultValueEmpty=function(){return e.prototype.isDefaultValueEmpty.call(this)&&this.isValueEmpty(this.defaultPanelValue)},t.prototype.setDefaultValue=function(){if(!this.isValueEmpty(this.defaultPanelValue)&&this.isValueEmpty(this.defaultValue)){if(this.isEmpty()&&0!=this.panelCount){for(var t=[],n=0;n<this.panelCount;n++)t.push(this.defaultPanelValue);this.value=t}}else e.prototype.setDefaultValue.call(this)},Object.defineProperty(t.prototype,"isValueArray",{get:function(){return!0},enumerable:!1,configurable:!0}),t.prototype.isEmpty=function(){var e=this.value;if(!e||!Array.isArray(e))return!0;for(var t=0;t<e.length;t++)if(!this.isRowEmpty(e[t]))return!1;return!0},t.prototype.getProgressInfo=function(){return nn.getProgressInfoByElements(this.visiblePanelsCore,this.isRequired)},t.prototype.isRowEmpty=function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0},t.prototype.addPanelUI=function(){return this.addPanel(void 0,!0)},t.prototype.addPanel=function(e,t){var n=!0===t;if(n){if(!this.canAddPanel)return null;if(!this.canLeaveCurrentPanel())return null}var i=this.addPanelCore(e);return this.panelOnFirstRendering(i),n&&("list"===this.displayMode&&"default"!==this.panelsState&&i.expand(),this.focusNewPanelCallback=function(){null==i||i.focusFirstQuestion()},this.isPanelsAnimationRunning||this.focusNewPanel()),i},t.prototype.addPanelCore=function(e){var t=this.currentIndex;return void 0===e&&(e=t<0?this.panelCount:t+1),(e<0||e>this.panelCount)&&(e=this.panelCount),this.updateValueOnAddingPanel(t<0?this.panelCount-1:t,e),this.isRenderModeList||(this.currentIndex=e),this.notifyOnPanelAddedRemoved(!0,e),this.panelsCore[e]},t.prototype.focusNewPanel=function(){this.focusNewPanelCallback&&(this.focusNewPanelCallback(),this.focusNewPanelCallback=void 0)},t.prototype.updateValueOnAddingPanel=function(e,t){this.panelCount++;var n=this.value;if(Array.isArray(n)&&n.length===this.panelCount){var i=!1,o=this.panelCount-1;if(t<o){i=!0;var r=n[o];n.splice(o,1),n.splice(t,0,r)}if(this.isValueEmpty(this.defaultPanelValue)||(i=!0,this.copyValue(n[t],this.defaultPanelValue)),this.copyDefaultValueFromLastEntry&&n.length>1){var s=e>-1&&e<=o?e:o;i=!0,this.copyValue(n[t],n[s])}i&&(this.value=n)}},t.prototype.canLeaveCurrentPanel=function(){return"list"===this.displayMode||!this.currentPanel||this.currentPanel.validate(!0,!0)},t.prototype.copyValue=function(e,t){for(var n in t)e[n]=t[n]},t.prototype.getPanelRemoveButtonId=function(e){return e.id+"_remove_button"},t.prototype.isRequireConfirmOnDelete=function(e){if(!this.confirmDelete)return!1;var t=this.getVisualPanelIndex(e);if(t<0||t>=this.visiblePanelCount)return!1;var n=this.visiblePanelsCore[t].getValue();return!this.isValueEmpty(n)&&(this.isValueEmpty(this.defaultPanelValue)||!this.isTwoValueEquals(n,this.defaultPanelValue))},t.prototype.goToNextPanel=function(){return!(this.currentIndex<0)&&(!!this.canLeaveCurrentPanel()&&(this.currentIndex++,!0))},t.prototype.goToPrevPanel=function(){this.currentIndex<0||this.currentIndex--},t.prototype.removePanelUI=function(e){this.removePanel(e,this.isRequireConfirmOnDelete(e))},t.prototype.removePanel=function(e,t){var n=this,i=this.getVisualPanelIndex(e);if(!(i<0||i>=this.visiblePanelCount))if(void 0!==t){if(!this.canRemovePanel)return;var o=function(){var e;n.removePanelCore(i);var t=n.visiblePanelCount,o=i>=t?t-1:i,r=0===t?n.addButtonId:o>-1?n.getPanelRemoveButtonId(n.visiblePanels[o]):"";r&&nn.FocusElement(r,!0,null===(e=n.survey)||void 0===e?void 0:e.rootElement)};t?Ei({message:this.confirmDeleteText,funcOnYes:function(){o()},locale:this.getLocale(),rootElement:this.survey.rootElement,cssClass:this.cssClasses.confirmDialog}):o()}else this.removePanelCore(i)},t.prototype.removePanelCore=function(e){this.removedPanelIndex=e;var t=this.visiblePanelsCore[e],n=this.panelsCore.indexOf(t);if(!(n<0)&&(!this.survey||this.dynamicPanelCallbacks.dynamicPanelRemoving(this,n,t))){this.panelsCore.splice(n,1),this.setPropertyValue("panelCount",this.panelCount),this.singleInputOnRemoveItem(e);var i=this.value;!i||!Array.isArray(i)||n>=i.length?this.updateFooterActions():(this.isValueChangingInternally=!0,i.splice(n,1),this.value=i,this.updateFooterActions(),this.fireCallback(this.panelCountChangedCallback),this.notifyOnPanelAddedRemoved(!1,n,t),this.isValueChangingInternally=!1)}},t.prototype.notifyOnPanelAddedRemoved=function(e,t,n){n||(n=this.panelsCore[t]);var i=this.getShowQuestionNumbers();if(this.survey){var o="default"===i;e?this.dynamicPanelCallbacks.dynamicPanelAdded(this,t,n,o):this.dynamicPanelCallbacks.dynamicPanelRemoved(this,t,n,o)}e&&n&&("onpanel"===i||"recursive"===i)&&n.setVisibleIndex(0)},t.prototype.recursiveNoCallback=function(){return"recursive"===this.getShowQuestionNumbers()?this.no:""},t.prototype.getVisualPanelIndex=function(e){if(f.isNumber(e))return e;for(var t=this.visiblePanelsCore,n=0;n<t.length;n++)if(t[n]===e||t[n].data===e)return n;return-1},t.prototype.getPanelVisibleIndexById=function(e){for(var t=this.visiblePanelsCore,n=0;n<t.length;n++)if(t[n].id===e)return n;return-1},t.prototype.locStrsChanged=function(){e.prototype.locStrsChanged.call(this),this.locTemplateTitle.strChanged();for(var t=this.panelsCore,n=0;n<t.length;n++)t[n].locStrsChanged();this.tabbedMenu&&this.tabbedMenu.locStrsChanged()},t.prototype.randomSeedChanged=function(){for(var e=this.panelsCore,t=0;t<e.length;t++)e[t].randomSeedChanged()},t.prototype.clearIncorrectValues=function(){for(var e=0;e<this.panelsCore.length;e++)this.clearIncorrectValuesInPanel(e)},t.prototype.clearErrors=function(){e.prototype.clearErrors.call(this);for(var t=0;t<this.panelsCore.length;t++)this.panelsCore[t].clearErrors()},t.prototype.getQuestionFromArray=function(e,t){return t<0||t>=this.panelsCore.length?null:this.panelsCore[t].getQuestionByName(e)},t.prototype.clearIncorrectValuesInPanel=function(e){var t=this.panelsCore[e];t.clearIncorrectValues();var n=this.value,i=n&&e<n.length?n[e]:null;if(i){var o=!1;for(var s in i){if(!this.getSharedQuestionFromArray(s,e))t.getQuestionByValueName(s)||this.iscorrectValueWithPostPrefix(t,s,r.commentSuffix)||this.iscorrectValueWithPostPrefix(t,s,r.matrix.totalsSuffix)||(delete i[s],o=!0)}o&&(n[e]=i,this.value=n)}},t.prototype.iscorrectValueWithPostPrefix=function(e,t,n){return t.indexOf(n)===t.length-n.length&&!!e.getQuestionByName(t.substring(0,t.indexOf(n)))},t.prototype.getSharedQuestionFromArray=function(e,t){return this.survey&&this.valueName?this.survey.getQuestionByValueNameFromArray(this.valueName,e,t):null},t.prototype.addConditionObjectsByContext=function(e,t){for(var n=(null==t?void 0:t.isValidator)?t.errorOwner:t,i=!!t&&(!0===t||this.template.questions.indexOf(n)>-1),o=new Array,s=this.template.questions,a=0;a<s.length;a++)s[a].addConditionObjectsByContext(o,t);for(var l=0;l<r.panel.maxPanelCountInCondition;l++){var u="["+l+"].",p=this.getValueName()+u,c=this.processedTitle+u;for(a=0;a<o.length;a++)o[a].context?e.push(o[a]):e.push({name:p+o[a].name,text:c+o[a].text,question:o[a].question})}if(i){p=!0===t?this.getValueName()+".":"",c=!0===t?this.processedTitle+".":"";var h=r.expressionVariables.panel+".";for(a=0;a<o.length;a++)if(o[a].question!=t){var d={name:p+h+o[a].name,text:c+h+o[a].text,question:o[a].question};d.context=this,e.push(d)}}},t.prototype.collectNestedQuestionsCore=function(e,t,n,i){i&&e.push(this);var o=t?this.visiblePanelsCore:this.panelsCore;Array.isArray(o)&&o.forEach(function(o){o.questions.forEach(function(o){return o.addNestedQuestion(e,t,n,i)})})},t.prototype.getConditionJson=function(t,n){if(void 0===t&&(t=null),void 0===n&&(n=null),!n)return e.prototype.getConditionJson.call(this,t);var i=n,o=n.indexOf(".");o>-1&&(i=n.substring(0,o),n=n.substring(o+1));var r=this.template.getQuestionByName(i);return r?r.getConditionJson(t,n):null},t.prototype.onReadOnlyChanged=function(){var t=this.isReadOnly;this.template.readOnly=t;for(var n=0;n<this.panelsCore.length;n++)this.panelsCore[n].readOnly=t;this.updateNoEntriesTextDefaultLoc(),this.updateFooterActions(),e.prototype.onReadOnlyChanged.call(this)},t.prototype.updateNoEntriesTextDefaultLoc=function(){var e=this.getLocalizableString("noEntriesText");e&&(e.localizationName=this.getNoEntriesLocalizationName())},t.prototype.getNoEntriesLocalizationName=function(){return this.isReadOnly||!this.allowAddPanel?"noEntriesReadonlyText":"noEntriesText"},t.prototype.onSurveyLoad=function(){this.template.readOnly=this.isReadOnly,this.template.onSurveyLoad();var t=this.adjustPanelCount();t>-1&&this.setPropertyValue("panelCount",t),e.prototype.onSurveyLoad.call(this)},t.prototype.adjustPanelCount=function(){var e=this.getPropertyValue("panelCount");return e<this.minPanelCount?this.minPanelCount:e>this.maxPanelCount?this.maxPanelCount:-1},t.prototype.buildPanelsFirstTime=function(e){if(void 0===e&&(e=!1),!this.hasPanelBuildFirstTime&&(e||!this.wasNotRenderedInSurvey)){if(this.blockAnimations(),this.hasPanelBuildFirstTime=!0,this.isBuildingPanelsFirstTime=!0,this.getPropertyValue("panelCount")>0&&(this.panelCount=this.getPropertyValue("panelCount")),this.useTemplatePanel&&this.rebuildPanels(),this.setPanelsSurveyImpl(),this.setPanelsState(),this.assignOnPropertyChangedToTemplate(),this.data&&this.isValueChangedWithoutPanels&&(this.isValueChangedWithoutPanels=!1,this.runTriggersOnBuildPanelsFirstTime()),this.survey)for(var t=0;t<this.panelCount;t++)this.notifyOnPanelAddedRemoved(!0,t);this.updateIsReady(),this.showAddPanelButton||this.updateNoEntriesTextDefaultLoc(),this.updateFooterActions(),this.isBuildingPanelsFirstTime=!1,this.releaseAnimations()}},t.prototype.runTriggersOnBuildPanelsFirstTime=function(){var e=this;this.value,this.visiblePanelsCore.forEach(function(t){var n=e.getItemData(t.data);if(!f.isValueEmpty(n)){var i=f.createCopyWithPrefix(n,r.expressionVariables.panel+".");t.data.runTriggers("",void 0,i)}})},Object.defineProperty(t.prototype,"showAddPanelButton",{get:function(){return this.allowAddPanel&&!this.isReadOnly},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"wasNotRenderedInSurvey",{get:function(){return!this.hasPanelBuildFirstTime&&!this.wasRendered&&!!this.survey},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"canBuildPanels",{get:function(){return!this.isLoadingFromJson&&!this.useTemplatePanel},enumerable:!1,configurable:!0}),t.prototype.onFirstRenderingCore=function(){e.prototype.onFirstRenderingCore.call(this),this.buildPanelsFirstTime(),this.template.onFirstRendering()},t.prototype.localeChanged=function(){e.prototype.localeChanged.call(this),this.panelsCore.forEach(function(e){return e.localeChanged()})},t.prototype.runConditionCore=function(t){e.prototype.runConditionCore.call(this,t),this.runPanelsCondition(this.panelsCore,t)},t.prototype.runTriggers=function(t,n,i){e.prototype.runTriggers.call(this,t,n,i),this.visiblePanelsCore.forEach(function(e){e.data.runTriggers(t,n,i)})},t.prototype.reRunCondition=function(){this.data&&this.runCondition(this.getDataFilteredProperties())},t.prototype.runPanelsCondition=function(e,t){var n=this.isValueChangingInternally;this.isValueChangingInternally=!0;for(var i=0;i<e.length;i++){var o=e[i],s=r.expressionVariables.panel,a=f.createCopy(t);a[s]=o,o.runCondition(a),o.isVisible}this.isValueChangingInternally=n},t.prototype.onAnyValueChanged=function(t,n){e.prototype.onAnyValueChanged.call(this,t,n),this.hasPanelBuildFirstTime||t!==this.getValueName()||(this.isValueChangedWithoutPanels=!0);for(var i=0;i<this.panelsCore.length;i++)this.panelsCore[i].onAnyValueChanged(t,n),this.panelsCore[i].onAnyValueChanged(r.expressionVariables.panel,"")},t.prototype.hasKeysDuplicated=function(e){for(var t,n=[],i=0;i<this.panelsCore.length;i++)t=this.isValueDuplicated(this.panelsCore[i],n,e)||t;return t},t.prototype.updatePanelsContainsErrors=function(){var e=this.changingValueQuestions;if(Array.isArray(e)&&0!==e.length){for(var t=e[0].parent;t;)t.updateContainsErrors(),t=t.parent;this.updateContainsErrors()}},t.prototype.validateElementCore=function(t){if(this.isValueChangingInternally&&!this.hasInputInChangedQuestions()||this.isBuildingPanelsFirstTime)return!0;var n=!0,i=this.changingValueQuestions;if(Array.isArray(i)){var o=!0;i.forEach(function(e){o=e.validateElement(t)&&o}),n=!this.hasKeysDuplicated(t)&&o,this.updatePanelsContainsErrors()}else n=this.validateInPanels(t);return e.prototype.validateElementCore.call(this,t)&&n},t.prototype.hasInputInChangedQuestions=function(){var e=this.changingValueQuestions;if(!Array.isArray(e)||0===e.length)return!1;for(var t=0;t<e.length;t++)if(e[t].hasInput)return!0;return!1},t.prototype.getContainsErrors=function(){var t=e.prototype.getContainsErrors.call(this);if(t)return t;for(var n=this.panelsCore,i=0;i<n.length;i++)if(n[i].containsErrors)return!0;return!1},t.prototype.getIsAnswered=function(){if(!e.prototype.getIsAnswered.call(this))return!1;for(var t=this.visiblePanelsCore,n=0;n<t.length;n++){var i=[];t[n].addQuestionsToList(i,!0);for(var o=0;o<i.length;o++)if(!i[o].isAnswered)return!1}return!0},t.prototype.clearValueOnHidding=function(t){if(!t){if(this.survey&&"none"===this.survey.getQuestionClearIfInvisible("onHidden"))return;this.clearValueInPanelsIfInvisible("onHiddenContainer")}e.prototype.clearValueOnHidding.call(this,t)},t.prototype.clearValueIfInvisible=function(t){void 0===t&&(t="onHidden");var n="onHidden"===t?"onHiddenContainer":t;this.clearValueInPanelsIfInvisible(n),e.prototype.clearValueIfInvisible.call(this,t)},t.prototype.clearValueInPanelsIfInvisible=function(e){for(var t=0;t<this.panelsCore.length;t++){var n=this.panelsCore[t],i=n.questions;this.isSetPanelItemData={};for(var o=0;o<i.length;o++){var r=i[o];r.visible&&!n.isVisible||(r.clearValueIfInvisible(e),this.isSetPanelItemData[r.getValueName()]=this.maxCheckCount+1)}}this.isSetPanelItemData={}},t.prototype.getIsRunningValidators=function(){if(e.prototype.getIsRunningValidators.call(this))return!0;for(var t=0;t<this.panelsCore.length;t++)for(var n=this.panelsCore[t].questions,i=0;i<n.length;i++)if(n[i].isRunningValidators)return!0;return!1},t.prototype.getAllErrors=function(){for(var t=e.prototype.getAllErrors.call(this),n=this.visiblePanelsCore,i=0;i<n.length;i++)for(var o=n[i].questions,r=0;r<o.length;r++){var s=o[r].getAllErrors();s&&s.length>0&&(t=t.concat(s))}return t},t.prototype.getValueGetterContext=function(){return new Zr(this)},t.prototype.getDisplayValueCore=function(e,t){var n=this.getUnbindValue(t);if(!n||!Array.isArray(n))return n;for(var i=0;i<this.panelsCore.length&&i<n.length;i++){var o=n[i];o&&(n[i]=this.getPanelDisplayValue(i,o,e))}return n},t.prototype.getPanelDisplayValue=function(e,t,n){if(!t)return t;for(var i=this.panelsCore[e],o=Object.keys(t),r=0;r<o.length;r++){var s=o[r],a=i.getQuestionByValueName(s);if(a||(a=this.getSharedQuestionFromArray(s,e)),a){var l=a.getDisplayValue(n,t[s]);t[s]=l,n&&a.title&&a.title!==s&&(t[a.title]=l,delete t[s])}}return t},t.prototype.validateInPanels=function(e){for(var t=!0,n=this.visiblePanels,i=[],o=0;o<n.length;o++){var r=n[o].validateElement(e);r=!this.isValueDuplicated(n[o],i,e)&&r,!this.isRenderModeList&&!r&&t&&e.focusOnFirstError&&(this.currentIndex=o),t=r&&t}return t},t.prototype.isValueDuplicated=function(e,t,n){if(!this.keyName)return!1;var i=e.getQuestionByValueName(this.keyName);if(!i||i.isEmpty())return!1;var o=i.value,r=this.changingValueQuestions;Array.isArray(r)&&r.indexOf(i)<0&&i.validateElement(n);for(var s=0;s<t.length;s++)if(o==t[s])return n.fireCallback&&i.addError(new je(this.keyDuplicationError,this)),n.setErrorElement(i),!0;return t.push(o),!1},t.prototype.getPanelActions=function(e){var t=this,n=e.footerActions;return"right"!==this.removePanelButtonLocation&&n.push(new rt({id:"remove-panel-".concat(e.id),component:"sv-paneldynamic-remove-btn",visible:new we(function(){return[t.canRenderRemovePanel(e,"bottom")].every(function(e){return!0===e})}),enabled:new we(function(){return!1!==t.enableRemovePanel}),data:{question:this,panel:e}})),this.survey&&(n=this.titleSettings.getUpdatedPanelFooterActions(e,n,this)),n},t.prototype.canRenderRemovePanelOnRight=function(e){return this.canRenderRemovePanel(e,"right")},t.prototype.canRenderRemovePanel=function(e,t){var n=this.canRemovePanel,i="collapsed"!==e.state;return this.removePanelButtonLocation===t&&n&&i},t.prototype.createNewPanel=function(){var e=this,t=this.createAndSetupNewPanelObject(),n=this.template.toJSON();return(new q).toObject(n,t),t.renderWidth="100%",t.updateCustomWidgets(),t.questions.forEach(function(t){return t.setParentQuestion(e)}),new es(this,t),t.onGetFooterActionsCallback=function(){return e.getPanelActions(t)},t.onGetFooterToolbarCssCallback=function(){return e.cssClasses.panelFooter},t.registerPropertyChangedHandlers(["visible"],function(){t.visible?e.onPanelAdded(t):e.onPanelRemoved(t),e.updateFooterActions()}),t},t.prototype.createAndSetupNewPanelObject=function(){var e=this,t=this.createNewPanelObject();return t.isInteractiveDesignElement=!1,t.setParentQuestion(this),t.onGetQuestionTitleLocation=function(){return e.getTemplateQuestionTitleLocation()},t.onGetQuestionTitleWidth=function(){return e.templateQuestionTitleWidth},t.recursiveNoCallback=function(){return e.recursiveNoCallback()},t},t.prototype.getTemplateQuestionTitleLocation=function(){return"default"!=this.templateQuestionTitleLocation?this.templateQuestionTitleLocation:this.getParentTitleLocation()},t.prototype.getChildErrorLocation=function(t){return"default"!==this.templateErrorLocation?this.templateErrorLocation:e.prototype.getChildErrorLocation.call(this,t)},t.prototype.createNewPanelObject=function(){return Q.createClass("panel")},t.prototype.setPanelCountBasedOnValue=function(){if(!this.isValueChangingInternally&&!this.useTemplatePanel){var e=this.value,t=e&&Array.isArray(e)?e.length:0;0==t&&this.getPropertyValue("panelCount")>0&&(t=this.getPropertyValue("panelCount")),this.settingPanelCountBasedOnValue=!0,this.panelCount=t,this.settingPanelCountBasedOnValue=!1}},t.prototype.setQuestionValue=function(t){if(!this.settingPanelCountBasedOnValue){if(e.prototype.setQuestionValue.call(this,t,!1),this.setPanelCountBasedOnValue(),!this.isSettingPanelItemData())for(var n=0;n<this.panelsCore.length;n++)this.panelUpdateValueFromSurvey(this.panelsCore[n]);this.updateIsAnswered()}},t.prototype.isSettingPanelItemData=function(){for(var e in this.isSetPanelItemData)if(this.isSetPanelItemData[e]>0)return!0;return!1},t.prototype.onSurveyValueChanged=function(t){if(void 0!==t||!this.isAllPanelsEmpty()){e.prototype.onSurveyValueChanged.call(this,t);for(var n=0;n<this.panelsCore.length;n++)this.panelSurveyValueChanged(this.panelsCore[n]);void 0===t&&this.setValueBasedOnPanelCount(),this.updateIsReady()}},t.prototype.isAllPanelsEmpty=function(){for(var e=0;e<this.panelsCore.length;e++)if(!f.isValueEmpty(this.panelsCore[e].getValue()))return!1;return!0},t.prototype.panelUpdateValueFromSurvey=function(e){for(var t=e.questions,n=this.getItemData(e.data),i=0;i<t.length;i++){var o=t[i];o.updateValueFromSurvey(n[o.getValueName()]),o.updateCommentFromSurvey(n[o.getValueName()+r.commentSuffix]),o.initDataUI()}},t.prototype.panelSurveyValueChanged=function(e){for(var t=e.questions,n=this.getItemData(e.data),i=0;i<t.length;i++){var o=t[i];o.onSurveyValueChanged(n[o.getValueName()])}},t.prototype.onSetData=function(){e.prototype.onSetData.call(this),!this.isLoadingFromJson&&this.useTemplatePanel&&(this.setTemplatePanelSurveyImpl(),this.rebuildPanels())},t.prototype.isNewValueCorrect=function(e){return Array.isArray(e)},t.prototype.getValueChangingOptions=function(e){for(var t=e.parent;t.parent;)t=t.parent;var n=t,i=this.panels.indexOf(n);return{question:this,panel:n,name:e.name,panelIndex:i,panelData:this.getPanelItemDataByIndex(i),oldValue:e.value}},t.prototype.getItemIndex=function(e){var t=this.items.indexOf(e);return t>-1?t:this.items.length},t.prototype.getItemData=function(e){return this.getPanelItemDataByIndex(this.items.indexOf(e))},t.prototype.getBindedQuestions=function(){return this.survey&&this.valueName?this.survey.getQuestionsByValueName(this.valueName):[]},t.prototype.getItem=function(e){var t=this.visiblePanels[e]||void 0;return null==t?void 0:t.data},t.prototype.getPanelItemDataByIndex=function(e){var t=this.items,n=this.value;return e<0&&Array.isArray(n)&&n.length>t.length&&(e=t.length),e<0||!n||!Array.isArray(n)||n.length<=e?{}:n[e]},t.prototype.updateItemValue=function(e,t,n,i){if(e!==this.template.data&&!(this.isSetPanelItemData[t]>this.maxCheckCount)){this.isSetPanelItemData[t]||(this.isSetPanelItemData[t]=0),this.isSetPanelItemData[t]++;var o=this.items,s=o.indexOf(e);s<0&&(s=o.length);var a=this.getUnbindValue(this.value);a&&Array.isArray(a)||(a=[]);for(var l=Math.max(s+1,o.length),u=a.length;u<l;u++)a.push({});if(a[s]||(a[s]={}),this.isValueEmpty(n)?delete a[s][t]:a[s][t]=n,s>=0&&s<this.panelsCore.length){Array.isArray(this.changingValueQuestions)||(this.changingValueQuestions=[]);var p=t,c=r.commentSuffix;p.endsWith(c)&&(p=p.substring(0,p.length-c.length));var h=this.panelsCore[s].getQuestionByValueName(p);h&&this.changingValueQuestions.push(h)}this.value=a,this.changingValueQuestions=null,this.isSetPanelItemData[t]--,this.isSetPanelItemData[t]-1&&delete this.isSetPanelItemData[t]}},t.prototype.getPlainData=function(t){var n=this;void 0===t&&(t={includeEmpty:!0});var i=e.prototype.getPlainData.call(this,t);if(i){i.isNode=!0;var o=Array.isArray(i.data)?[].concat(i.data):[];i.data=this.panels.map(function(e,i){var o={name:e.name||i,title:e.title||"Panel",value:e.getValue(),displayValue:e.getValue(),getString:function(e){return n.getValueAsString(e)},isNode:!0,data:e.questions.map(function(e){return e.getPlainData(t)}).filter(function(e){return!!e})};return(t.calculations||[]).forEach(function(t){o[t.propertyName]=e[t.propertyName]}),o}),i.data=i.data.concat(o)}return i},t.prototype.updateElementCss=function(t){e.prototype.updateElementCss.call(this,t);for(var n=0;n<this.panelsCore.length;n++){this.panelsCore[n].updateElementCss(t)}},Object.defineProperty(t.prototype,"progressText",{get:function(){var e=this.visiblePanelCount;return this.getLocalizationFormatString("panelDynamicProgressText",this.currentIndex+1,e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"progress",{get:function(){return(this.currentIndex+1)/this.visiblePanelCount*100+"%"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"progressBarAriaLabel",{get:function(){return V("progressbar",this.getLocale())},enumerable:!1,configurable:!0}),t.prototype.getRootCss=function(){return(new tt).append(e.prototype.getRootCss.call(this)).append(this.cssClasses.empty,this.getShowNoEntriesPlaceholder()).toString()},Object.defineProperty(t.prototype,"cssHeader",{get:function(){var t=this.isRenderModeTab&&!!this.visiblePanelCount;return(new tt).append(e.prototype.getCssHeader.call(this,this.cssClasses)).append(this.cssClasses.headerTab,this.hasTitleOnTop&&t).toString()},enumerable:!1,configurable:!0}),t.prototype.getTabsContainerCss=function(){return(new tt).append(this.cssClasses.tabsContainer).append(this.cssClasses.tabsContainerWithHeader,this.hasTitleOnTop).toString()},t.prototype.getPanelWrapperCss=function(e){return(new tt).append(this.cssClasses.panelWrapper,!e||e.visible).append(this.cssClasses.panelWrapperList,this.isRenderModeList).append(this.cssClasses.panelWrapperInRow,"right"===this.removePanelButtonLocation).toString()},t.prototype.getPanelRemoveButtonCss=function(){return(new tt).append(this.cssClasses.button).append(this.cssClasses.buttonRemove).append(this.cssClasses.buttonRemoveRight,"right"===this.removePanelButtonLocation).toString()},t.prototype.getAddButtonCss=function(){return(new tt).append(this.cssClasses.button).append(this.cssClasses.buttonAdd).append(this.cssClasses.buttonAdd+"--list-mode","list"===this.displayMode).toString()},t.prototype.getPrevButtonCss=function(){return(new tt).append(this.cssClasses.buttonPrev).append(this.cssClasses.buttonPrevDisabled,!this.isPrevButtonVisible).toString()},t.prototype.getNextButtonCss=function(){return(new tt).append(this.cssClasses.buttonNext).append(this.cssClasses.buttonNextDisabled,!this.isNextButtonVisible).toString()},Object.defineProperty(t.prototype,"noEntriesText",{get:function(){return this.getLocStringText(this.locNoEntriesText)},set:function(e){this.setLocStringText(this.locNoEntriesText,e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"locNoEntriesText",{get:function(){return this.getOrCreateLocStr("noEntriesText",!1,this.getNoEntriesLocalizationName())},enumerable:!1,configurable:!0}),t.prototype.getShowNoEntriesPlaceholder=function(){return!!this.cssClasses.noEntriesPlaceholder&&!this.isDesignMode&&0===this.visiblePanelCount},t.prototype.needResponsiveWidth=function(){for(var e=this.getPanels(),t=0;t<e.length;t++){var n=e[t];if(n.isVisible&&n.needResponsiveWidth())return!0}return!1},Object.defineProperty(t.prototype,"hasTabbedMenu",{get:function(){return this.isRenderModeTab&&this.visiblePanels.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tabbedMenu",{get:function(){return this.isRenderModeTab?(this.tabbedMenuValue||(this.tabbedMenuValue=new Ht,this.tabbedMenuValue.dotsItem.popupModel.showPointer=!1,this.tabbedMenuValue.dotsItem.popupModel.verticalPosition="bottom",this.tabbedMenuValue.dotsItem.popupModel.horizontalPosition="center",this.updateElementCss(!1)),this.tabbedMenuValue):null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"showFooterToolbar",{get:function(){return this.footerToolbar&&this._showFooterToolbar},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"footerToolbar",{get:function(){return this.footerToolbarValue||this.initFooterToolbar(),this.footerToolbarValue},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ariaRole",{get:function(){return"group"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ariaRequired",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ariaInvalid",{get:function(){return null},enumerable:!1,configurable:!0}),t.prototype.updateFooterActions=function(){this.updateFooterActionsCallback&&this.updateFooterActionsCallback()},t.prototype.initFooterToolbar=function(){var e=this;this.footerToolbarValue=this.createActionContainer();var t=[],n=new rt({id:"sv-pd-prev-btn",title:this.prevPanelText,action:function(){e.goToPrevPanel()}}),i=new rt({id:"sv-pd-next-btn",title:this.nextPanelText,action:function(){e.goToNextPanel()}}),o=new rt({id:"sv-pd-add-btn",component:"sv-paneldynamic-add-btn",enabled:new we(function(){return!1!==e.enableAddPanel}),data:{question:this}}),r=new rt({id:"sv-prev-btn-icon",component:"sv-paneldynamic-prev-btn",data:{question:this}}),s=new rt({id:"sv-pd-progress-text",component:"sv-paneldynamic-progress-text",data:{question:this}}),a=new rt({id:"sv-pd-next-btn-icon",component:"sv-paneldynamic-next-btn",data:{question:this}});t.push(n,i,o,r,s,a),this.updateFooterActionsCallback=function(){var t=e.legacyNavigation,l=e.isRenderModeList,u=e.isMobile,p=!t&&!l;n.visible=p&&e.currentIndex>0,i.visible=p&&e.currentIndex<e.visiblePanelCount-1,i.needSpace=u&&i.visible&&n.visible,o.visible=e.canAddPanel,o.needSpace=e.isMobile&&!i.visible&&n.visible,s.visible=!e.isRenderModeList&&!u,s.needSpace=!t&&!e.isMobile;var c=t&&!l;r.visible=c,a.visible=c,r.needSpace=c},this.updateFooterActionsCallback(),this.footerToolbarValue.setItems(t),this.footerToolbar.flushUpdates(),this._showFooterToolbar=new we(function(){var t;return null===(t=e.footerToolbarValue)||void 0===t?void 0:t.hasVisibleActions})},t.prototype.createTabByPanel=function(e,t){var n=this;if(this.isRenderModeTab){var i=new S(e,!0);i.onGetTextCallback=function(i){if(i||(i=n.locTabTitlePlaceholder.renderedHtml),!n.survey)return i;var o={title:i,panel:e,visiblePanelIndex:t};return n.dynamicPanelCallbacks.dynamicPanelGetTabTitle(n,o),o.title},i.sharedData=this.locTemplateTabTitle;var o=e.id,r=this.getPanelVisibleIndexById(o)===this.currentIndex;return new $r({id:"".concat(this.id,"_tab_").concat(o),panelId:o,pressed:r,locTitle:i,disableHide:r,action:function(){n.currentIndex=n.getPanelVisibleIndexById(o)}})}},t.prototype.getTabbedMenuCss=function(e){var t=null!=e?e:this.cssClasses;return(new tt).append(t.tabsRoot).append(t.tabsLeft,"left"===this.tabAlign).append(t.tabsRight,"right"===this.tabAlign).append(t.tabsCenter,"center"===this.tabAlign).toString()},t.prototype.updateTabToolbarItemsPressedState=function(){if(this.isRenderModeTab&&!(this.currentIndex<0||this.currentIndex>=this.visiblePanelCount)){var e=this.visiblePanelsCore[this.currentIndex];this.tabbedMenu.actions.forEach(function(t){var n=t.panelId===e.id;t.pressed=n,t.disableHide=n})}},t.prototype.updateTabToolbar=function(){var e=this;if(this.isRenderModeTab){for(var t=[],n=this.visiblePanelsCore,i=function(i){o.visiblePanelsCore.forEach(function(o){return t.push(e.createTabByPanel(n[i],i))})},o=this,r=0;r<n.length;r++)i(r);this.tabbedMenu.setItems(t)}},t.prototype.addTabFromToolbar=function(e,t){if(this.isRenderModeTab){var n=this.createTabByPanel(e,t);this.tabbedMenu.actions.splice(t,0,n),this.updateTabToolbarItemsPressedState()}},t.prototype.removeTabFromToolbar=function(e){if(this.isRenderModeTab){var t=this.tabbedMenu.actions.find(function(t){return t.panelId==e.id});t&&(this.tabbedMenu.actions.splice(this.tabbedMenu.actions.indexOf(t),1),this.updateTabToolbarItemsPressedState())}},Object.defineProperty(t.prototype,"showNavigation",{get:function(){return(!this.isReadOnly||1!=this.visiblePanelCount)&&(this.visiblePanelCount>0&&!!this.cssClasses.footer)},enumerable:!1,configurable:!0}),t.prototype.showSeparator=function(e){return this.isRenderModeList&&e<this.renderedPanels.length-1},t.prototype.calcCssClasses=function(t){var n=e.prototype.calcCssClasses.call(this,t),i=this.tabbedMenu;return i&&(i.containerCss=this.getTabbedMenuCss(n),i.cssClasses=n.tabs,i.dotsItem.cssClasses=n.tabs,i.dotsItem.popupModel.contentComponentData.model.cssClasses=t.list),n},t.prototype.onMobileChanged=function(){e.prototype.onMobileChanged.call(this),this.updateFooterActions()},t.prototype.ensureRowsVisibility=function(){this.visiblePanels.forEach(function(e){return e.ensureRowsVisibility()})},v([qe({localizable:{defaultStr:"panelDynamicTabTextFormat",markdown:!0}})],t.prototype,"templateTabTitle",void 0),v([qe({localizable:{defaultStr:!0,markdown:!0}})],t.prototype,"tabTitlePlaceholder",void 0),v([He({})],t.prototype,"_renderedPanels",void 0),v([qe()],t.prototype,"confirmDelete",void 0),v([qe({defaultValue:""})],t.prototype,"keyName",void 0),v([qe({localizable:{defaultStr:"confirmDelete"}})],t.prototype,"confirmDeleteText",void 0),v([qe({localizable:{defaultStr:!0}})],t.prototype,"keyDuplicationError",void 0),v([qe({localizable:{defaultStr:"pagePrevText"}})],t.prototype,"prevPanelText",void 0),v([qe({localizable:{defaultStr:"pageNextText"}})],t.prototype,"nextPanelText",void 0),v([qe({localizable:{defaultStr:"addPanel"}})],t.prototype,"addPanelText",void 0),v([qe({localizable:{defaultStr:"removePanel"}})],t.prototype,"removePanelText",void 0),v([qe()],t.prototype,"panelsState",void 0),v([qe({onSetting:function(e){return e<0?0:e}})],t.prototype,"minPanelCount",void 0),v([qe({onSetting:function(e){return e<=0?1:e<r.panel.maxPanelCount?e:r.panel.maxPanelCount}})],t.prototype,"maxPanelCount",void 0),v([qe()],t.prototype,"allowAddPanel",void 0),v([qe()],t.prototype,"newPanelPosition",void 0),v([qe()],t.prototype,"allowRemovePanel",void 0),v([qe({defaultValue:!0})],t.prototype,"enableAddPanel",void 0),v([qe({defaultValue:!0})],t.prototype,"enableRemovePanel",void 0),v([qe()],t.prototype,"templateQuestionTitleLocation",void 0),v([qe()],t.prototype,"templateQuestionTitleWidth",void 0),v([qe()],t.prototype,"templateErrorLocation",void 0),v([qe({onSetting:function(e){return e?"onsurvey"===(e=e.toLowerCase())?"default":e:"off"}})],t.prototype,"showQuestionNumbers",void 0),v([qe()],t.prototype,"removePanelButtonLocation",void 0),v([qe({onSet:function(e,t){t.fireCallback(t.renderModeChangedCallback),t.updatePanelView()}})],t.prototype,"displayMode",void 0),v([qe({onSet:function(e,t){t.fireCallback(t.currentIndexChangedCallback)}})],t.prototype,"showProgressBar",void 0),v([qe({onSet:function(e,t){}})],t.prototype,"progressBarLocation",void 0),v([qe()],t.prototype,"tabAlign",void 0),v([qe()],t.prototype,"defaultPanelValue",void 0),v([qe()],t.prototype,"copyDefaultValueFromLastEntry",void 0),v([qe({defaultValue:!1})],t.prototype,"_showFooterToolbar",void 0),v([qe({defaultValue:!1,onSet:function(e,t){t.updateFooterActions()}})],t.prototype,"legacyNavigation",void 0),t}(gn),is=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return y(t,e),Object.defineProperty(t.prototype,"panelDynamic",{get:function(){return this.question},enumerable:!1,configurable:!0}),t.prototype.getSingleInputQuestionsCore=function(e,t){this.panelDynamic.onFirstRendering();var n=new Array,i=this.panelDynamic.visiblePanels;if(t)for(var o=0;o<i.length;o++){var r=i[o];r.hasValueAnyQuestion(!0)&&r.validate(!1,!1)||this.fillSingleInputQuestionsByPanel(n,r)}return this.getSingleInputQuestionsForDynamic(e,n)},t.prototype.fillSingleInputQuestionsInContainer=function(e,t){var n=this.getPanelByQuestion(t);this.fillSingleInputQuestionsByPanel(e,n)},t.prototype.fillSingleInputQuestionsByPanel=function(e,t){t&&t.visibleQuestions.forEach(function(t){return t.addNestedQuestion(e,!0,!1,!1)})},t.prototype.getSingleQuestionLocTitleCore=function(){var e=this,t=this.panelDynamic.locTemplateTitle;return t.onGetTextCallback=function(t){var n=e.panelDynamic.singleInputQuestion;return n?e.processSingleInputTitle(t,e.getPanelByQuestion(n)):t},t},t.prototype.processSingleInputTitle=function(e,t){return e||(e=this.getSingleInputTitleTemplate()),t?t.getProcessedText(e):e},t.prototype.getSingleInputTitleTemplate=function(){return this.panelDynamic.getLocalizationString("panelDynamicTabTextFormat")},t.prototype.getPanelByQuestion=function(e){for(var t=e.parent;t&&t.parent;)t=t.parent;return t},t.prototype.getSingleInputAddTextCore=function(){if(this.panelDynamic.canAddPanel)return this.panelDynamic.addPanelText},t.prototype.singleInputAddItemCore=function(){this.panelDynamic.addPanelUI()},t.prototype.getSingleQuestionOnChange=function(e){var t=this.panelDynamic.visiblePanels;if(t.length>0){(e<0||e>=t.length)&&(e=t.length-1);var n=t[e].visibleQuestions;if(n.length>0)return n[0]}return null},t.prototype.createSingleInputSummary=function(){var e=this,t=this.panelDynamic,n=new Mi(t,t.locNoEntriesText),i=new Array;return t.visiblePanels.forEach(function(n){var o=new S(t,!0,void 0,t.locTemplateTitle.localizationName);o.setJson(t.locTemplateTitle.getJson()),o.onGetTextCallback=function(i){return e.processSingleInputTitle(t.templateTitle,n)};var r=new rt({locTitle:t.locEditPanelText,action:function(){e.singInputEditPanel(n)}}),s=t.canRemovePanel?new rt({locTitle:t.locRemovePanelText,action:function(){t.removePanelUI(n)}}):void 0;i.push(new Ni(o,r,s))}),n.items=i,n},t.prototype.singleInputMoveToFirstCore=function(){for(var e,t=null===(e=this.panelDynamic.singleInputQuestion)||void 0===e?void 0:e.parent;t&&t.parent;)t=t.parent;this.singInputEditPanel(t)},t.prototype.singInputEditPanel=function(e){if(e){var t=e.visibleQuestions;t.length>0&&this.setSingleInputQuestion(t[0])}},t}(pn);Q.addClass("paneldynamic",[{name:"showCommentArea:switch",visible:!0},{name:"templateElements",alternativeName:"questions",baseClassName:"question",visible:!1,isLightSerializable:!1},{name:"templateTitle:text",serializationProperty:"locTemplateTitle"},{name:"templateTabTitle",serializationProperty:"locTemplateTabTitle",visibleIf:function(e){return"tab"===e.displayMode}},{name:"tabTitlePlaceholder",serializationProperty:"locTabTitlePlaceholder",visibleIf:function(e){return"tab"===e.displayMode}},{name:"templateDescription:text",serializationProperty:"locTemplateDescription"},{name:"minWidth",defaultFunc:function(){return"auto"}},{name:"noEntriesText:text",serializationProperty:"locNoEntriesText"},{name:"allowAddPanel:boolean",default:!0},{name:"allowRemovePanel:boolean",default:!0},{name:"newPanelPosition",choices:["next","last"],default:"last"},{name:"panelCount:number",isBindable:!0,default:0,choices:[0,1,2,3,4,5,6,7,8,9,10],onSettingValue:function(e,t){return t<e.minPanelCount?e.minPanelCount:t>e.maxPanelCount?e.maxPanelCount:t}},{name:"minPanelCount:number",default:0,minValue:0},{name:"maxPanelCount:number",defaultFunc:function(){return r.panel.maxPanelCount}},"defaultPanelValue:panelvalue",{name:"copyDefaultValueFromLastEntry:boolean",alternativeName:"defaultValueFromLastPanel"},{name:"panelsState",default:"default",choices:["default","collapsed","expanded","firstExpanded"],visibleIf:function(e){return"list"===e.displayMode}},{name:"keyName"},{name:"keyDuplicationError",serializationProperty:"locKeyDuplicationError"},{name:"confirmDelete:boolean"},{name:"confirmDeleteText",serializationProperty:"locConfirmDeleteText",visibleIf:function(e){return e.confirmDelete}},{name:"addPanelText",alternativeName:"panelAddText",serializationProperty:"locAddPanelText",visibleIf:function(e){return e.allowAddPanel}},{name:"removePanelText",alternativeName:"panelRemoveText",serializationProperty:"locRemovePanelText",visibleIf:function(e){return e.allowRemovePanel}},{name:"prevPanelText",alternativeName:"panelPrevText",serializationProperty:"locPrevPanelText",visibleIf:function(e){return"list"!==e.displayMode}},{name:"nextPanelText",alternativeName:"panelNextText",serializationProperty:"locNextPanelText",visibleIf:function(e){return"list"!==e.displayMode}},{name:"showQuestionNumbers",default:"off",choices:["default","onpanel","recursive","off"]},{name:"questionStartIndex",visibleIf:function(e){var t=e.showQuestionNumbers;return"onpanel"===t||"recursive"===t}},{name:"renderMode",visible:!1,isSerializable:!1},{name:"displayMode",default:"list",choices:["list","carousel","tab"]},{name:"showProgressBar:boolean",alternativeName:"showRangeInProgress",default:!0,visibleIf:function(e){return"carousel"===e.displayMode}},{name:"progressBarLocation",default:"top",choices:["top","bottom","topBottom"],visibleIf:function(e){return e.showProgressBar&&"carousel"===e.displayMode}},{name:"tabAlign",default:"center",choices:["left","center","right"],visibleIf:function(e){return"tab"===e.displayMode}},{name:"templateQuestionTitleLocation",alternativeName:"templateTitleLocation",default:"default",choices:["default","top","bottom","left"]},{name:"templateQuestionTitleWidth",visibleIf:function(e){return!!e&&e.template.availableQuestionTitleWidth()}},{name:"templateErrorLocation",default:"default",choices:["default","top","bottom"]},{name:"templateVisibleIf:expression"},{name:"removePanelButtonLocation",alternativeName:"panelRemoveButtonLocation",default:"bottom",choices:["bottom","right"],visibleIf:function(e){return e.allowRemovePanel}}],function(){return new ns("")},"question"),$n.Instance.registerQuestion("paneldynamic",function(e){return new ns(e)});var os=function(){function e(){}return e.getProgressTextInBarCss=function(e){return(new tt).append(e.progressText).append(e.progressTextInBar).toString()},e.getProgressTextUnderBarCss=function(e){return(new tt).append(e.progressText).append(e.progressTextUnderBar).toString()},e}(),rs=function(e){function t(){return e.call(this)||this}return y(t,e),Object.defineProperty(t,"operators",{get:function(){return null!=t.operatorsValue||(t.operatorsValue={empty:function(e,t){return!e},notempty:function(e,t){return!!e},equal:function(e,t){return e==t},notequal:function(e,t){return e!=t},contains:function(e,t){return e&&e.indexOf&&e.indexOf(t)>-1},notcontains:function(e,t){return!e||!e.indexOf||-1==e.indexOf(t)},greater:function(e,t){return e>t},less:function(e,t){return e<t},greaterorequal:function(e,t){return e>=t},lessorequal:function(e,t){return e<=t}}),t.operatorsValue},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"id",{get:function(){return this.uniqueId},enumerable:!1,configurable:!0}),t.prototype.getType=function(){return"triggerbase"},t.prototype.toString=function(){var e=this.getType().replace("trigger",""),t=this.expression;return t&&(e+=", "+t),e},Object.defineProperty(t.prototype,"isInternal",{get:function(){return!0===this.isGhost},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"operator",{get:function(){return this.getPropertyValue("operator","equal")},set:function(e){e&&(e=e.toLowerCase(),t.operators[e]&&this.setPropertyValue("operator",e))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"expression",{get:function(){return this.getPropertyValue("expression",this.buildExpression())},set:function(e){this.setPropertyValue("expression",e)},enumerable:!1,configurable:!0}),t.prototype.canBeExecuted=function(e){return!0},t.prototype.canBeExecutedOnComplete=function(){return!1},t.prototype.checkExpression=function(e){var t=this;if(this.isExecutingOnNextPage=e.isOnNextPage,this.isExecutingOnNavigation=e.isOnNavigation||e.isOnNextPage,this.canBeExecuted(e.isOnNextPage)&&(!e.isOnComplete||this.canBeExecutedOnComplete())){var n=Object.keys(e.keys);if(!Array.isArray(n)||this.canBeExecuteOnKeysChange(n)){var i=e.properties||null;this.runExpressionByProperty("expression",i,function(e){t.triggerResult(!0===e,i)},function(n){return t.isCheckRequired(n,e.keys)})||this.isCheckRequired(null,e.keys)&&this.canSuccessOnEmptyExpression()&&this.triggerResult(!0,i)}}},t.prototype.canBeExecuteOnKeysChange=function(e){return!0},t.prototype.canSuccessOnEmptyExpression=function(){return!1},t.prototype.check=function(e){t.operators[this.operator](e,this.value)?this.onSuccess(null):this.onFailure()},Object.defineProperty(t.prototype,"requireValidQuestion",{get:function(){return!1},enumerable:!1,configurable:!0}),t.prototype.triggerResult=function(e,t){e?(this.onSuccess(t),this.onSuccessExecuted()):this.onFailure()},t.prototype.onSuccess=function(e){},t.prototype.onFailure=function(){},t.prototype.onSuccessExecuted=function(){},t.prototype.buildExpression=function(){return this.name?this.isValueEmpty(this.value)&&this.isRequireValue?"":"{"+this.name+"} "+this.operator+" "+Nn.toOperandString(this.value):""},t.prototype.isCheckRequired=function(e,t){return!!t&&!this.canSkipExpressionByKeys(e,t,this.getUsedVariables(e))},t.prototype.getUsedVariables=function(e){if(!e)return[];var t=e.getVariables();if(Array.isArray(t))for(var n=r.expressionVariables.unwrapPostfix,i=t.length-1;i>=0;i--){var o=t[i];o.endsWith(n)&&t.push(o.substring(0,o.length-n.length))}return t},Object.defineProperty(t.prototype,"isRequireValue",{get:function(){return"empty"!==this.operator&&"notempty"!=this.operator},enumerable:!1,configurable:!0}),t.operatorsValue=null,v([qe()],t.prototype,"value",void 0),v([qe()],t.prototype,"name",void 0),t}(Ve),ss=function(e){function t(){var t=e.call(this)||this;return t.ownerValue=null,t}return y(t,e),Object.defineProperty(t.prototype,"owner",{get:function(){return this.ownerValue},enumerable:!1,configurable:!0}),t.prototype.setOwner=function(e){this.ownerValue=e},t.prototype.getOwner=function(){return this.owner},t.prototype.getSurvey=function(e){return this.owner&&this.owner.getSurvey?this.owner.getSurvey():null},t.prototype.isRealExecution=function(){return!0},t.prototype.onSuccessExecuted=function(){this.owner&&this.isRealExecution()&&this.owner.triggerExecuted(this)},t}(rs),as=function(e){function t(){var t=e.call(this)||this;return t.pages=[],t.questions=[],t}return y(t,e),t.prototype.getType=function(){return"visibletrigger"},t.prototype.onSuccess=function(e){this.onTrigger(this.onItemSuccess)},t.prototype.onFailure=function(){this.onTrigger(this.onItemFailure)},t.prototype.onTrigger=function(e){if(this.owner)for(var t=this.owner.getObjects(this.pages,this.questions),n=0;n<t.length;n++)e(t[n])},t.prototype.onItemSuccess=function(e){e.visible=!0},t.prototype.onItemFailure=function(e){e.visible=!1},t}(ss),ls=function(e){function t(){return e.call(this)||this}return y(t,e),t.prototype.getType=function(){return"completetrigger"},Object.defineProperty(t.prototype,"requireValidQuestion",{get:function(){return!0},enumerable:!1,configurable:!0}),t.prototype.isRealExecution=function(){return!r.triggers.executeCompleteOnValueChanged===this.isExecutingOnNavigation},t.prototype.onSuccess=function(e){this.owner&&(this.isRealExecution()?this.owner.setCompleted(this):this.owner.canBeCompleted(this,!0))},t.prototype.onFailure=function(){this.owner.canBeCompleted(this,!1)},t}(ss),us=function(e){function t(){return e.call(this)||this}return y(t,e),t.prototype.getType=function(){return"setvaluetrigger"},t.prototype.canBeExecuted=function(e){return!e&&!!this.setToName},t.prototype.canBeExecuteOnKeysChange=function(t){return(1!==t.length||t[0]!==this.setToName)&&e.prototype.canBeExecuteOnKeysChange.call(this,t)},t.prototype.onPropertyValueChanged=function(t,n,i){if(e.prototype.onPropertyValueChanged.call(this,t,n,i),"setToName"===t){var o=this.getSurvey();o&&!o.isLoadingFromJson&&o.isDesignMode&&(this.setValue=void 0)}},t.prototype.onSuccess=function(e){this.setToName&&this.owner&&this.owner.setTriggerValue(this.setToName,f.getUnbindValue(this.setValue),this.isVariable)},v([qe()],t.prototype,"setToName",void 0),v([qe()],t.prototype,"setValue",void 0),v([qe()],t.prototype,"isVariable",void 0),t}(ss),ps=function(e){function t(){return e.call(this)||this}return y(t,e),t.prototype.getType=function(){return"skiptrigger"},Object.defineProperty(t.prototype,"requireValidQuestion",{get:function(){return this.canBeExecuted(!1)},enumerable:!1,configurable:!0}),t.prototype.canBeExecuted=function(e){return e===!r.triggers.executeSkipOnValueChanged},t.prototype.onSuccess=function(e){this.gotoName&&this.owner&&this.owner.focusQuestion(this.gotoName)},v([qe()],t.prototype,"gotoName",void 0),t}(ss),cs=function(e){function t(){return e.call(this)||this}return y(t,e),t.prototype.getType=function(){return"runexpressiontrigger"},t.prototype.canBeExecuted=function(e){return!e},t.prototype.onSuccess=function(e){var t=this;this.owner&&this.runExpressionByProperty("runExpression",e,function(e){t.onCompleteRunExpression(e)})},t.prototype.onCompleteRunExpression=function(e){this.setToName&&void 0!==e&&this.owner.setTriggerValue(this.setToName,f.convertValToQuestionVal(e),!1)},v([qe()],t.prototype,"setToName",void 0),v([qe()],t.prototype,"runExpression",void 0),t}(ss),hs=function(e){function t(){return e.call(this)||this}return y(t,e),t.prototype.canBeExecuted=function(e){return!e&&!!this.setToName&&!!this.fromName},t.prototype.getType=function(){return"copyvaluetrigger"},t.prototype.canBeExecuteOnKeysChange=function(t){return(1!==t.length||t[0]!==this.setToName)&&e.prototype.canBeExecuteOnKeysChange.call(this,t)},t.prototype.onSuccess=function(e){this.setToName&&this.owner&&this.owner.copyTriggerValue(this.setToName,this.fromName,this.copyDisplayValue)},t.prototype.canSuccessOnEmptyExpression=function(){return!0},t.prototype.getUsedVariables=function(t){var n=e.prototype.getUsedVariables.call(this,t);return this.fromName&&n.indexOf(this.fromName)<0&&n.push(this.fromName),n},v([qe()],t.prototype,"setToName",void 0),v([qe()],t.prototype,"fromName",void 0),v([qe()],t.prototype,"copyDisplayValue",void 0),t}(ss);Q.addClass("trigger",[{name:"operator",default:"equal",visible:!1},{name:"value",visible:!1},"expression:condition"]),Q.addClass("surveytrigger",[{name:"name",visible:!1}],null,"trigger"),Q.addClass("visibletrigger",["pages:pages","questions:questions"],function(){return new as},"surveytrigger"),Q.addClass("completetrigger",[],function(){return new ls},"surveytrigger"),Q.addClass("setvaluetrigger",[{name:"!setToName:questionvalue"},{name:"setValue:triggervalue",dependsOn:"setToName",visibleIf:function(e){return!!e&&!!e.setToName}},{name:"isVariable:boolean",visible:!1}],function(){return new us},"surveytrigger"),Q.addClass("copyvaluetrigger",[{name:"!fromName:questionvalue"},{name:"!setToName:questionvalue"},{name:"copyDisplayValue:boolean",visible:!1}],function(){return new hs},"surveytrigger"),Q.addClass("skiptrigger",[{name:"!gotoName:question"}],function(){return new ps},"surveytrigger"),Q.addClass("runexpressiontrigger",[{name:"setToName:questionvalue"},"runExpression:expression"],function(){return new cs},"surveytrigger");var ds=function(e){function t(t,i){void 0===i&&(i=null);var o=e.call(this)||this;return o.closeOnCompleteTimeout=0,o.surveyValue=i||o.createSurvey(t),o.surveyValue.fitToContainer=!0,o.windowElement=n.createElement("div"),o.survey.onComplete.add(function(e,t){o.onSurveyComplete()}),o.width=new we(function(){return o.survey.width}),o.width=o.survey.width,o.updateCss(),o}return y(t,e),t.prototype.onPropertyValueChanged=function(t,n,i){if(e.prototype.onPropertyValueChanged.call(this,t,n,i),"isShowing"===t){var o=this.showingChangedCallback;o&&o()}"isExpanded"===t&&(this.isFullScreen&&!i&&(this.isFullScreen=!1),this.onExpandedChanged()),"isFullScreen"===t&&(i&&!this.isExpanded&&(this.isExpanded=!0),this.setCssRoot())},t.prototype.getType=function(){return"popupsurvey"},Object.defineProperty(t.prototype,"survey",{get:function(){return this.surveyValue},enumerable:!1,configurable:!0}),t.prototype.show=function(){this.isShowing=!0},t.prototype.hide=function(){this.isShowing=!1},t.prototype.toggleFullScreen=function(){this.isFullScreen=!this.isFullScreen},Object.defineProperty(t.prototype,"isCollapsed",{get:function(){return!this.isExpanded},enumerable:!1,configurable:!0}),t.prototype.onExpandedChanged=function(){this.expandedChangedCallback&&this.expandedChangedCallback(),this.updateCssButton()},Object.defineProperty(t.prototype,"title",{get:function(){return this.survey.title},set:function(e){this.survey.title=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"locTitle",{get:function(){return this.survey.locTitle.isEmpty?null:this.survey.locTitle},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"locDescription",{get:function(){return this.survey.locTitle.isEmpty?null:this.survey.locDescription},enumerable:!1,configurable:!0}),t.prototype.expand=function(){this.isExpanded=!0},t.prototype.collapse=function(){this.isExpanded=!1},t.prototype.changeExpandCollapse=function(){this.isExpanded=!this.isExpanded},Object.defineProperty(t.prototype,"css",{get:function(){return this.survey.css},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cssButton",{get:function(){return this.getPropertyValue("cssButton","")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cssRoot",{get:function(){var e=this.getPropertyValue("cssRoot","");return this.isCollapsed&&(e+=" "+this.getPropertyValue("cssRootCollapsedMod","")),e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cssRootCollapsedMod",{get:function(){return this.getPropertyValue("cssRootCollapsedMod")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cssRootContent",{get:function(){return this.getPropertyValue("cssRootContent")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cssBody",{get:function(){return this.getPropertyValue("cssBody","")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cssHeaderRoot",{get:function(){return this.getPropertyValue("cssHeaderRoot","")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cssHeaderTitleCollapsed",{get:function(){return this.getPropertyValue("cssHeaderTitleCollapsed","")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cssHeaderButtonsContainer",{get:function(){return this.getPropertyValue("cssHeaderButtonsContainer","")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cssHeaderCollapseButton",{get:function(){return this.getPropertyValue("cssHeaderCollapseButton","")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cssHeaderCloseButton",{get:function(){return this.getPropertyValue("cssHeaderCloseButton","")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cssHeaderFullScreenButton",{get:function(){return this.getPropertyValue("cssHeaderFullScreenButton","")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"renderedWidth",{get:function(){var e=this.getPropertyValue("width","60%");return e&&!isNaN(e)&&(e+="px"),e},enumerable:!1,configurable:!0}),t.prototype.updateCss=function(){if(this.css&&this.css.window){var e=this.css.window;this.setCssRoot(),this.setPropertyValue("cssRootCollapsedMod",e.rootCollapsedMod),this.setPropertyValue("cssRootContent",e.rootContent),this.setPropertyValue("cssBody",e.body);var t=e.header;t&&(this.setPropertyValue("cssHeaderRoot",t.root),this.setPropertyValue("cssHeaderTitleCollapsed",t.titleCollapsed),this.setPropertyValue("cssHeaderButtonsContainer",t.buttonsContainer),this.setPropertyValue("cssHeaderCollapseButton",t.collapseButton),this.setPropertyValue("cssHeaderCloseButton",t.closeButton),this.setPropertyValue("cssHeaderFullScreenButton",t.fullScreenButton),this.updateCssButton())}},t.prototype.setCssRoot=function(){var e=this.css.window;this.isFullScreen?this.setPropertyValue("cssRoot",e.root+" "+e.rootFullScreenMode):this.setPropertyValue("cssRoot",e.root)},t.prototype.updateCssButton=function(){var e=this.css.window?this.css.window.header:null;e&&this.setCssButton(this.isExpanded?e.buttonExpanded:e.buttonCollapsed)},t.prototype.setCssButton=function(e){e&&this.setPropertyValue("cssButton",e)},t.prototype.createSurvey=function(e){return new vo(e)},t.prototype.onSurveyComplete=function(){if(!(this.closeOnCompleteTimeout<0))if(0==this.closeOnCompleteTimeout)this.hide();else{var e=this,t=null;t=setInterval(function(){e.hide(),clearInterval(t)},1e3*this.closeOnCompleteTimeout)}},t.prototype.onScroll=function(){this.survey.onScroll()},v([qe({defaultValue:!1})],t.prototype,"isShowing",void 0),v([qe({defaultValue:!1})],t.prototype,"isFullScreen",void 0),v([qe({defaultValue:!1})],t.prototype,"isExpanded",void 0),v([qe({defaultValue:!1})],t.prototype,"allowClose",void 0),v([qe({defaultValue:!1})],t.prototype,"allowFullScreen",void 0),v([qe()],t.prototype,"width",void 0),t}(Ve),fs=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return y(t,e),t}(ds),gs=function(){function e(){this._lockScroll=!1}return e.prototype.setRootElement=function(e){var n=this;this._containerElementValue=null==e?void 0:e.querySelector(".sv-scroll__scroller"),this._scrollbarElement=null==e?void 0:e.querySelector(".sv-scroll__scrollbar"),this._scrollbarSizerElement=null==e?void 0:e.querySelector(".sv-scroll__scrollbar-sizer"),this._containerBodyElement=null==e?void 0:e.querySelector(".sv-scroll__container"),e&&t.isAvailable()&&(this._containerBodyResizeObserver=new ResizeObserver(function(e){for(var t=0,i=e;t<i.length;t++){var o=i[t],r=o.contentBoxSize?o.contentBoxSize[0].blockSize:o.contentRect.width;n._scrollbarSizerElement.style.height=r+"px"}n.onInnerHeightChanged&&n.onInnerHeightChanged(n._containerBodyElement.clientHeight>n._containerElementValue.clientHeight)}),this._containerBodyResizeObserver.observe(this._containerBodyElement))},e.prototype.onScrollContainer=function(){this._lockScroll=!0,this._scrollbarElement.scrollTop=this._containerElementValue.scrollTop},e.prototype.onScrollScrollbar=function(){this._lockScroll?this._lockScroll=!1:this._containerElementValue.scrollTop=this._scrollbarElement.scrollTop},e.prototype.unsubscribeRootElement=function(){this._containerBodyResizeObserver&&(this._containerBodyResizeObserver.disconnect(),this._containerBodyResizeObserver=void 0)},e}(),ys=["input:not(:disabled):not([readonly]):not([type=hidden])","select:not(:disabled)","textarea:not(:disabled):not([readonly])",'button:not(:disabled):not([tabindex="-1"])','[tabindex]:not([tabindex^="-"])'].join(","),ms=function(e){function t(t){var n=e.call(this)||this;return n.popupSelector=".sv-popup",n.fixedPopupContainer=".sv-popup",n.containerSelector=".sv-popup__container",n.scrollingContentSelector=".sv-popup__scrolling-content",n.visibilityAnimation=new Jt(n,function(e){n._isVisible!==e&&(e?(n.updateBeforeShowing(),n.updateIsVisible(e)):(n.updateOnHiding(),n.updateIsVisible(e),n.updateAfterHiding(),n._isPositionSetValue=!1))},function(){return n._isVisible}),n.onVisibilityChanged=new I,n.onModelIsVisibleChangedCallback=function(){n.isVisible=n.model.isVisible},n._isPositionSetValue=!1,n.model=t,n.locale=n.model.locale,n}return y(t,e),t.prototype.updateIsVisible=function(e){this._isVisible=e,this.onVisibilityChanged.fire(this,{isVisible:e})},t.prototype.updateBeforeShowing=function(){this.model.onShow()},t.prototype.updateAfterHiding=function(){this.model.onHiding()},t.prototype.getLeaveOptions=function(){return{cssClass:"sv-popup--leave",onBeforeRunAnimation:function(e){e.setAttribute("inert","")},onAfterRunAnimation:function(e){return e.removeAttribute("inert")}}},t.prototype.getEnterOptions=function(){return{cssClass:"sv-popup--enter"}},t.prototype.getAnimatedElement=function(){return this.getAnimationContainer()},t.prototype.isAnimationEnabled=function(){return"overlay"!==this.model.displayMode&&r.animationEnabled},t.prototype.getRerenderEvent=function(){return this.onElementRerendered},t.prototype.getAnimationContainer=function(){var e;return null===(e=this.container)||void 0===e?void 0:e.querySelector(this.fixedPopupContainer)},Object.defineProperty(t.prototype,"isVisible",{get:function(){return this._isVisible},set:function(e){this.visibilityAnimation.sync(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"container",{get:function(){return this.containerElement||this.createdContainer},enumerable:!1,configurable:!0}),t.prototype.getLocale=function(){return this.locale?this.locale:e.prototype.getLocale.call(this)},t.prototype.hidePopup=function(){this.model.isVisible=!1},t.prototype.getStyleClass=function(){return(new tt).append(this.model.cssClass)},t.prototype.getShowFooter=function(){return this.isOverlay},t.prototype.getShowHeader=function(){return this.getShowCloseButton()},t.prototype.getShowCloseButton=function(){return!!this.model.showCloseButton},t.prototype.getPopupHeaderTemplate=function(){return this.model.showCloseButton?"popup-close-button":void 0},t.prototype.createFooterActionBar=function(){this.footerToolbarValue=new Tt},t.prototype.resetDimensionsAndPositionStyleProperties=function(){this.top="",this.left="",this.height="",this.width="",this.minWidth=""},t.prototype.onModelChanging=function(e){},t.prototype.setupModel=function(e){this.model&&this.model.onVisibilityChanged.remove(this.onModelIsVisibleChangedCallback),this.onModelChanging(e),this._model=e,e.onVisibilityChanged.add(this.onModelIsVisibleChangedCallback),this.onModelIsVisibleChangedCallback()},Object.defineProperty(t.prototype,"model",{get:function(){return this._model},set:function(e){this.setupModel(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"title",{get:function(){return this.model.title},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"contentComponentName",{get:function(){return this.model.contentComponentName},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"contentComponentData",{get:function(){return this.model.contentComponentData},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isModal",{get:function(){return this.model.isModal},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isFocusedContent",{get:function(){return this.model.isFocusedContent},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isFocusedContainer",{get:function(){return this.model.isFocusedContainer},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"showFooter",{get:function(){return this.getShowFooter()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"showHeader",{get:function(){return this.getShowHeader()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"showCloseButton",{get:function(){return this.getShowCloseButton()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"popupHeaderTemplate",{get:function(){return this.getPopupHeaderTemplate()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isOverlay",{get:function(){return"overlay"===this.model.displayMode},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"styleClass",{get:function(){return this.getStyleClass().toString()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cancelButtonText",{get:function(){return this.getLocalizationString("modalCancelButtonText")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"footerToolbar",{get:function(){return this.footerToolbarValue||this.createFooterActionBar(),this.footerToolbarValue},enumerable:!1,configurable:!0}),t.prototype.onKeyDown=function(e){"Tab"===e.key||9===e.keyCode?this.trapFocus(e):"Escape"!==e.key&&27!==e.keyCode||this.hidePopup()},t.prototype.trapFocus=function(e){var t=this.container.querySelectorAll(ys),n=t[0],i=t[t.length-1],o=pt();e.shiftKey?o===n&&(i.focus(),e.preventDefault()):o===i&&(n.focus(),e.preventDefault())},t.prototype.switchFocus=function(){this.isFocusedContent?this.focusFirstInput():this.isFocusedContainer&&this.focusContainer()},Object.defineProperty(t.prototype,"isPositionSet",{get:function(){return this._isPositionSetValue},enumerable:!1,configurable:!0}),t.prototype.updateOnShowing=function(){var e=pt();this.prevActiveElement=e,this.isOverlay&&this.resetDimensionsAndPositionStyleProperties(),this.switchFocus(),this._isPositionSetValue=!0},t.prototype.updateOnHiding=function(){this.isFocusedContent&&this.prevActiveElement&&this.prevActiveElement.focus({preventScroll:!0})},t.prototype.focusContainer=function(){if(this.container){var e=this.container.querySelector(this.popupSelector);null==e||e.focus()}},t.prototype.focusFirstInput=function(){var e=this;setTimeout(function(){if(e.container){var t=e.container.querySelector(e.model.focusFirstInputSelector||ys);t?t.focus():e.focusContainer()}},100)},t.prototype.clickClose=function(e){this.hidePopup(),null==e||e.stopPropagation()},t.prototype.clickOutside=function(e){this.hidePopup(),null==e||e.stopPropagation()},t.prototype.blur=function(e){this.model.onBlur()},t.prototype.cancel=function(){this.model.onCancel(),this.hidePopup()},t.prototype.dispose=function(){e.prototype.dispose.call(this),this.model&&this.model.onVisibilityChanged.remove(this.onModelIsVisibleChangedCallback),this.createdContainer&&(this.createdContainer.remove(),this.createdContainer=void 0),this.footerToolbarValue&&this.footerToolbarValue.dispose(),this.resetComponentElement()},t.prototype.initializePopupContainer=function(){if(!this.container){var e=n.createElement("div");this.createdContainer=e,lt(r.environment.popupMountContainer).appendChild(e)}},t.prototype.setComponentElement=function(e){e&&(this.containerElement=e)},t.prototype.resetComponentElement=function(){this.containerElement=void 0,this.prevActiveElement=void 0},t.prototype.preventScrollOuside=function(e,t){for(var i=e.target;i!==this.container;){if("auto"===n.getComputedStyle(i).overflowY&&i.scrollHeight!==i.offsetHeight){var o=i.scrollHeight,r=i.scrollTop,s=i.clientHeight;if(!(t>0&&Math.abs(o-s-r)<1||t<0&&r<=0))return}i=i.parentElement}e.cancelable&&e.preventDefault()},v([qe({defaultValue:"0px"})],t.prototype,"top",void 0),v([qe({defaultValue:"0px"})],t.prototype,"left",void 0),v([qe({defaultValue:"auto"})],t.prototype,"height",void 0),v([qe({defaultValue:"auto"})],t.prototype,"width",void 0),v([qe({defaultValue:"auto"})],t.prototype,"minWidth",void 0),v([qe({defaultValue:!1})],t.prototype,"_isVisible",void 0),v([qe()],t.prototype,"locale",void 0),t}(Ve),vs=function(){function e(e,t,n,i){this.x=e,this.y=t,this.width=n,this.height=i}return Object.defineProperty(e.prototype,"left",{get:function(){return this.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"top",{get:function(){return this.y},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"right",{get:function(){return this.x+this.width},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"bottom",{get:function(){return this.y+this.height},enumerable:!1,configurable:!0}),e}(),bs=function(){function e(){}return e.calculatePosition=function(e,t,n,i,o,r){void 0===r&&(r="flex");var s=e.left,a=e.top;return"flex"===r&&(s="center"==o?(e.left+e.right-n)/2:"left"==o?e.left-n:e.right),a="middle"==i?(e.top+e.bottom-t)/2:"top"==i?e.top-t:e.bottom,"center"!=o&&"middle"!=i&&("top"==i?a+=e.height:a-=e.height),{left:Math.round(s),top:Math.round(a)}},e.getCorrectedVerticalDimensions=function(t,n,i,o,r,s){var a;void 0===r&&(r=!0),void 0===s&&(s={top:0,bottom:0});var l=i-e.bottomIndent;if("top"===o&&(a={height:n,top:t}),t<-s.top)a={height:r?n+t:n,top:-s.top};else if(n+t>i){var u=Math.min(n,l-t);a={height:r?u:n,top:r?t:t-(n-u)}}return a&&(a.height=Math.min(a.height,l),a.top=Math.max(a.top,-s.top)),a},e.updateHorizontalDimensions=function(e,t,n,i,o,r){void 0===o&&(o="flex"),void 0===r&&(r={left:0,right:0}),t+=r.left+r.right;var s=void 0,a=e;return"center"===i&&("fixed"===o?(e+t>n&&(s=n-e),a-=r.left):e<0?(a=r.left,s=Math.min(t,n)):t+e>n&&(a=n-t,a=Math.max(a,r.left),s=Math.min(t,n))),"left"===i&&e<0&&(a=r.left,s=Math.min(t,n)),"right"===i&&t+e>n&&(s=n-e),{width:s-r.left-r.right,left:a}},e.updateVerticalPosition=function(e,t,n,i,o){if("middle"===i)return i;var r=t-(e.top+("center"!==n?e.height:0)),s=t+e.bottom-("center"!==n?e.height:0)-o;return r>0&&s<=0&&"top"==i?i="bottom":s>0&&r<=0&&"bottom"==i?i="top":s>0&&r>0&&(i=r<s?"top":"bottom"),i},e.updateHorizontalPosition=function(e,t,n,i){if("center"===n)return n;var o=t-e.left,r=t+e.right-i;return o>0&&r<=0&&"left"==n?n="right":r>0&&o<=0&&"right"==n?n="left":r>0&&o>0&&(n=o<r?"left":"right"),n},e.calculatePopupDirection=function(e,t){var n;return"center"==t&&"middle"!=e?n=e:"center"!=t&&(n=t),n},e.calculatePointerTarget=function(e,t,n,i,o,r,s){void 0===r&&(r=0),void 0===s&&(s=0);var a={};return"center"!=o?(a.top=e.top+e.height/2,a.left=e[o]):"middle"!=i&&(a.top=e[i],a.left=e.left+e.width/2),a.left=Math.round(a.left-n),a.top=Math.round(a.top-t),"left"==o&&(a.left-=r+s),"center"===o&&(a.left-=r),a},e.bottomIndent=16,e}(),Cs=function(i){function o(o){var r=i.call(this,o)||this;return r.scrollEventCallBack=function(t){if(r.isOverlay&&e.IsTouch)return t.stopPropagation(),void t.preventDefault();r.hidePopup()},r.resizeEventCallback=function(){if(t.isAvailable()){var e=t.getVisualViewport(),i=n.getDocumentElement();i&&e&&i.style.setProperty("--sv-popup-overlay-height","".concat(e.height*e.scale,"px"))}},r.resizeWindowCallback=function(){r.isOverlay||r.updatePosition(!0,"vue"===vo.platform||"vue3"===vo.platform||"react"==vo.platform||"js-ui"==vo.platform)},r.clientY=0,r.touchStartEventCallback=function(e){r.clientY=e.touches[0].clientY},r.touchMoveEventCallback=function(e){r.preventScrollOuside(e,r.clientY-e.changedTouches[0].clientY)},r.model.onRecalculatePosition.add(r.recalculatePositionHandler),r}return y(o,i),o.prototype.createFooterActionBar=function(){var e=this;i.prototype.createFooterActionBar.call(this),this.footerToolbar.setCssClasses({root:nt.root,defaultSizeMode:nt.defaultSizeMode,smallSizeMode:nt.smallSizeMode,item:"sd-action sv-menu-popup__button"},!1),this.footerToolbar.containerCss="sv-menu-footer-action-bar";var t=[{id:"cancel",visibleIndex:10,title:this.cancelButtonText,innerCss:"sv-popup__button--cancel",action:function(){e.cancel()}}];t=this.model.updateFooterActions(t),this.footerToolbarValue.setItems(t)},o.prototype.getAvailableAreaRect=function(){var e=this.model.getAreaCallback?this.model.getAreaCallback(this.container):void 0;if(e){var n=e.getBoundingClientRect();return new vs(n.x,n.y,n.width,n.height)}return new vs(0,0,t.getInnerWidth(),t.getInnerHeight())},o.prototype.getTargetElementRect=function(e){var t=this.container,n=this.model.getTargetCallback?this.model.getTargetCallback(t):void 0;if(t&&t.parentElement&&!this.isModal&&!n&&(n=t.parentElement),!n)return null;var i=n.getBoundingClientRect();return new vs(i.left-e.left,i.top-e.top,i.width,i.height)},o.prototype._updatePosition=function(){var e,i,o,r=this.getAvailableAreaRect(),s=this.getTargetElementRect(r);if(s){var a=null===(e=this.container)||void 0===e?void 0:e.querySelector(this.containerSelector);if(a){var l=null===(i=this.container)||void 0===i?void 0:i.querySelector(this.fixedPopupContainer),u=a.querySelector(this.scrollingContentSelector),p=n.getComputedStyle(a),c=parseFloat(p.marginLeft)||0,h=parseFloat(p.marginRight)||0,d=parseFloat(p.marginTop)||0,f=parseFloat(p.marginBottom)||0,g=a.offsetHeight-u.offsetHeight+u.scrollHeight,y=a.getBoundingClientRect().width;this.model.setWidthByTarget&&(this.minWidth=s.width+"px");var m=this.model.verticalPosition,v=this.getActualHorizontalPosition();if(t.isAvailable()){var b=[g,.9*t.getInnerHeight(),null===(o=t.getVisualViewport())||void 0===o?void 0:o.height];g=Math.ceil(Math.min.apply(Math,b.filter(function(e){return"number"==typeof e}))),m=bs.updateVerticalPosition(s,g,this.model.horizontalPosition,this.model.verticalPosition,r.height),v=bs.updateHorizontalPosition(s,y,v,r.width)}this.popupDirection=bs.calculatePopupDirection(m,v);var C=bs.calculatePosition(s,g,y+c+h,m,v,this.model.positionMode);if(t.isAvailable()){var w=bs.getCorrectedVerticalDimensions(C.top,g,r.height,m,this.model.canShrink,{top:d,bottom:f});if(w&&(this.height=w.height+"px",C.top=w.top),this.model.setWidthByTarget)this.width=s.width+"px",C.left=s.left;else{var V=bs.updateHorizontalDimensions(C.left,y,t.getInnerWidth(),v,this.model.positionMode,{left:c,right:h});V&&(this.width=V.width?V.width+"px":void 0,C.left=V.left)}}if(l){var P=l.getBoundingClientRect();C.top-=P.top,C.left-=P.left}this.showHeader&&(this.pointerTarget=bs.calculatePointerTarget(s,C.top,C.left,m,v,c,h),this.pointerTarget.top+="px",this.pointerTarget.left+="px"),C.left+=r.left,C.top+=r.top,this.left=C.left+"px",this.top=C.top+"px"}}},o.prototype.getActualHorizontalPosition=function(){var e=this.model.horizontalPosition;n.isAvailable()&&("rtl"==n.getComputedStyle(n.getBody()).direction&&("left"===this.model.horizontalPosition?e="right":"right"===this.model.horizontalPosition&&(e="left")));return e},o.prototype.getStyleClass=function(){var e=this.model.getDisplayMode();return i.prototype.getStyleClass.call(this).append("sv-popup--menu-phone","menu-overlay"===e).append("sv-popup--menu-tablet","menu-popup-overlay"===e).append("sv-popup--menu-popup","menu-popup"===e).append("sv-popup--show-pointer","menu-popup"===e&&this.showHeader).append("sv-popup--".concat(this.popupDirection),"menu-popup"===e&&(this.showHeader||"top"==this.popupDirection||"bottom"==this.popupDirection))},o.prototype.getShowHeader=function(){return this.model.showPointer&&!this.isOverlay},o.prototype.getPopupHeaderTemplate=function(){return"popup-pointer"},o.prototype.setComponentElement=function(e){i.prototype.setComponentElement.call(this,e)},o.prototype.resetComponentElement=function(){i.prototype.resetComponentElement.call(this)},o.prototype.updateOnShowing=function(){var e=ut(this.container);e&&(this.prevActiveElement=e.activeElement,this.isOverlay?this.resetDimensionsAndPositionStyleProperties():this.updatePosition(!0,!1),this.switchFocus(),t.addEventListener("resize",this.resizeWindowCallback),this.shouldCreateResizeCallback&&(t.getVisualViewport().addEventListener("resize",this.resizeEventCallback),this.container&&(this.container.addEventListener("touchstart",this.touchStartEventCallback),this.container.addEventListener("touchmove",this.touchMoveEventCallback)),this.resizeEventCallback()),t.addEventListener("scroll",this.scrollEventCallBack),this._isPositionSetValue=!0)},Object.defineProperty(o.prototype,"shouldCreateResizeCallback",{get:function(){return!!t.getVisualViewport()&&this.isOverlay},enumerable:!1,configurable:!0}),o.prototype.updatePosition=function(e,t){var n=this;void 0===t&&(t=!0),e&&(this.height="auto"),t?setTimeout(function(){n._updatePosition()},1):this._updatePosition()},o.prototype.updateOnHiding=function(){i.prototype.updateOnHiding.call(this),t.removeEventListener("resize",this.resizeWindowCallback),this.shouldCreateResizeCallback&&(t.getVisualViewport().removeEventListener("resize",this.resizeEventCallback),this.container&&(this.container.removeEventListener("touchstart",this.touchStartEventCallback),this.container.removeEventListener("touchmove",this.touchMoveEventCallback))),t.removeEventListener("scroll",this.scrollEventCallBack),this.isDisposed||(this.top=void 0,this.left=void 0,this.height=void 0,this.width=void 0,this.minWidth=void 0)},o.prototype.onModelChanging=function(e){var t=this;this.model&&this.model.onRecalculatePosition.remove(this.recalculatePositionHandler),this.recalculatePositionHandler||(this.recalculatePositionHandler=function(e,n){t.isOverlay||t.updatePosition(n.isResetHeight)}),i.prototype.onModelChanging.call(this,e),e.onRecalculatePosition.add(this.recalculatePositionHandler)},o.prototype.dispose=function(){i.prototype.dispose.call(this),this.updateOnHiding(),this.model&&(this.model.onRecalculatePosition.remove(this.recalculatePositionHandler),this.recalculatePositionHandler=void 0),this.resetComponentElement()},o.tabletSizeBreakpoint=600,v([qe({defaultValue:"left"})],o.prototype,"popupDirection",void 0),v([qe({defaultValue:{left:"0px",top:"0px"}})],o.prototype,"pointerTarget",void 0),o}(ms),ws=function(e){function t(t){var n=e.call(this,t)||this;return n.onScrollOutsideCallback=function(e){n.preventScrollOuside(e,e.deltaY)},n}return y(t,e),t.prototype.getStyleClass=function(){var t=this.model.getDisplayMode();return e.prototype.getStyleClass.call(this).append("sv-popup--modal-popup","modal-popup"===t).append("sv-popup--modal-overlay","modal-overlay"===t)},t.prototype.getShowFooter=function(){return!0},t.prototype.createFooterActionBar=function(){var t=this;e.prototype.createFooterActionBar.call(this),this.footerToolbar.setCssClasses({root:nt.root,defaultSizeMode:nt.defaultSizeMode,smallSizeMode:nt.smallSizeMode,item:"sv-popup__body-footer-item sv-popup__button sv-modal-popup__button sd-btn sd-btn--small"},!1),this.footerToolbar.containerCss="sv-modal-footer-action-bar";var n=[{id:"cancel",visibleIndex:10,title:this.cancelButtonText,innerCss:"sv-popup__button--cancel",action:function(){t.cancel()}},{id:"apply",visibleIndex:20,title:this.applyButtonText,innerCss:"sv-popup__button--apply sd-btn--action",action:function(){t.apply()}}];n=this.model.updateFooterActions(n),this.footerToolbarValue.setItems(n)},Object.defineProperty(t.prototype,"applyButtonText",{get:function(){return this.getLocalizationString("modalApplyButtonText")},enumerable:!1,configurable:!0}),t.prototype.apply=function(){this.model.onApply&&!this.model.onApply()||this.hidePopup()},t.prototype.clickOutside=function(){},t.prototype.onKeyDown=function(t){"Escape"!==t.key&&27!==t.keyCode||this.model.onCancel(),e.prototype.onKeyDown.call(this,t)},t.prototype.updateOnShowing=function(){this.container&&this.container.addEventListener("wheel",this.onScrollOutsideCallback,{passive:!1}),e.prototype.updateOnShowing.call(this)},t.prototype.updateOnHiding=function(){this.container&&this.container.removeEventListener("wheel",this.onScrollOutsideCallback),e.prototype.updateOnHiding.call(this)},t}(ms);function Vs(e,t){var i,o=m({},e);o.verticalPosition="top",o.horizontalPosition="left",o.showPointer=!1,o.isModal=!0,o.displayMode=e.displayMode||"popup";var r=new _t(e.componentName,e.data,o);r.isFocusedContent=null===(i=e.isFocusedContent)||void 0===i||i,r.showCloseButton=!!e.showCloseButton;var s=new ws(r);if(t&&t.appendChild){var a=n.createElement("div");t.appendChild(a),s.setComponentElement(a)}s.container||s.initializePopupContainer();var l=function(e,t){t.isVisible||a&&s.resetComponentElement(),s.onVisibilityChanged.remove(l)};return s.onVisibilityChanged.add(l),s}var Ps=function(){function e(){this.modals=[]}return e.prototype.onModalsChanged=function(e,t){void 0===e&&(e=[]),void 0===t&&(t=[]),this.onModalsChangedCallback&&this.onModalsChangedCallback(this.modals,e,t)},e.prototype.addModal=function(e){var t=this,n=function(i,o){if(!o.isVisible){var r=t.modals.indexOf(e);r>=0&&t.modals.splice(r,1),e.onVisibilityChanged.remove(n),t.onModalsChanged(void 0,[e]),e.dispose()}};e.onVisibilityChanged.add(n),this.modals.push(e),this.onModalsChanged([e]),e.model.isVisible=!0},e.prototype.addDialog=function(e,t){var n=Vs(e,t);return this.addModal(n),n},e.prototype.getModals=function(){return this.modals},e.prototype.clear=function(){var e=this.modals;this.modals=[],this.onModalsChanged(void 0,e);for(var t=0,n=e;t<n.length;t++){n[t].dispose()}},e}(),xs=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return y(t,e),t.prototype.getBaseType=function(){return"buttongroupitemvalue"},v([qe()],t.prototype,"iconName",void 0),v([qe()],t.prototype,"iconSize",void 0),v([qe()],t.prototype,"showCaption",void 0),t}(Co),Is=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._allowClear=!0,t}return y(t,e),t.prototype.onPropertyValueChanged=function(t,n,i){e.prototype.onPropertyValueChanged.call(this,t,n,i);["value","renderAs","placeholder","choices","visibleChoices"].indexOf(t)>-1&&this.resetReadOnlyText()},t.prototype.locStrsChanged=function(){var t;e.prototype.locStrsChanged.call(this),this.resetReadOnlyText(),null===(t=this.dropdownListModelValue)||void 0===t||t.locStrsChanged()},t.prototype.getType=function(){return"buttongroup"},t.prototype.getItemValueType=function(){return"buttongroupitemvalue"},t.prototype.supportOther=function(){return!1},t.prototype.getControlClass=function(){return this.isEmpty(),(new tt).append(this.cssClasses.control).append(this.cssClasses.controlEmpty,this.isEmpty()).append(this.cssClasses.onError,this.hasCssError()).append(this.cssClasses.controlDisabled,this.isDisabledStyle).append(this.cssClasses.controlReadOnly,this.isReadOnlyStyle).append(this.cssClasses.controlPreview,this.isPreviewStyle).toString()},t.prototype.getFirstInputElementId=function(){return this.inputId+"_0"},t.prototype.getInputId=function(e){return this.inputId+"_"+e},Object.defineProperty(t.prototype,"allowClear",{get:function(){return this._allowClear},set:function(e){this._allowClear=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"searchEnabled",{get:function(){return!1},enumerable:!1,configurable:!0}),t.prototype.isItemSelected=function(e){return e.value==this.value},Object.defineProperty(t.prototype,"readOnlyText",{get:function(){return this.locReadOnlyText.calculatedText},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"locReadOnlyText",{get:function(){var e=this;return this.getOrCreateLocStr("readOnlyText",!0,!1,function(t){t.onGetTextCallback=function(){return e.displayValue||e.placeholder}})},enumerable:!1,configurable:!0}),t.prototype.resetReadOnlyText=function(){this.resetPropertyValue("readOnlyText")},Object.defineProperty(t.prototype,"showSelectedItemLocText",{get:function(){return!this.readOnly&&!this.inputHasValue&&!!this.selectedItemLocText},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"selectedItemLocText",{get:function(){var e;return null===(e=this.selectedItem)||void 0===e?void 0:e.locText},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dropdownListModel",{get:function(){return"dropdown"===this.renderAs&&this.onBeforeSetCompactRenderer(),this.dropdownListModelValue},set:function(e){this.dropdownListModelValue=e,this.updateElementCss()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"selectedItem",{get:function(){return this.getSingleSelectedItem()},enumerable:!1,configurable:!0}),t.prototype.onBlurCore=function(t){var n;null===(n=this.dropdownListModel)||void 0===n||n.onBlur(t),e.prototype.onBlurCore.call(this,t)},t.prototype.updateCssClasses=function(t,n){e.prototype.updateCssClasses.call(this,t,n),Pt(t,n)},t.prototype.calcCssClasses=function(t){var n=e.prototype.calcCssClasses.call(this,t);return this.dropdownListModelValue&&this.dropdownListModelValue.updateCssClasses(n.popup,n.list),n},t.prototype.needResponsiveWidth=function(){return!0},t.prototype.supportResponsiveness=function(){return!0},t.prototype.getCompactRenderAs=function(){return"dropdown"},t.prototype.getObservedElementSelector=function(){return".sd-button-group-scrollable-container"},t.prototype.onBeforeSetCompactRenderer=function(){this.isDisposed||this.dropdownListModelValue||(this.dropdownListModelValue=new Eo(this))},t.prototype.dispose=function(){e.prototype.dispose.call(this),this.dropdownListModelValue&&(this.dropdownListModelValue.dispose(),this.dropdownListModelValue=void 0)},v([qe({localizable:{defaultStr:"buttongroupOptionsCaption"}})],t.prototype,"placeholder",void 0),v([qe({defaultValue:!1})],t.prototype,"inputHasValue",void 0),t}(Vo);Q.addClass("buttongroup",[{name:"choices:buttongroupitemvalue[]"}],function(){return new Is("")},"checkboxbase"),Q.addClass("buttongroupitemvalue",[{name:"showCaption:boolean",default:!0},{name:"iconName:text"},{name:"iconSize:number"}],function(e){return new xs(e)},"choiceitem");var Ss=function(){function e(e,t,n){this.question=e,this.item=t,this.index=n}return Object.defineProperty(e.prototype,"value",{get:function(){return this.item.value},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"iconName",{get:function(){return this.item.iconName},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"iconSize",{get:function(){return this.item.iconSize||24},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"caption",{get:function(){return this.item.locText},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"showCaption",{get:function(){return this.item.showCaption||void 0===this.item.showCaption},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isRequired",{get:function(){return this.question.isRequired},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"selected",{get:function(){return this.question.isItemSelected(this.item)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"readOnly",{get:function(){return this.question.isInputReadOnly||!this.item.isEnabled},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"name",{get:function(){return this.question.name+"_"+this.question.id},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"id",{get:function(){return this.question.inputId+"_"+this.index},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasErrors",{get:function(){return this.question.errors.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"describedBy",{get:function(){return this.question.errors.length>0?this.question.id+"_errors":null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"labelClass",{get:function(){return(new tt).append(this.question.cssClasses.item).append(this.question.cssClasses.itemSelected,this.selected).append(this.question.cssClasses.itemHover,!this.readOnly&&!this.selected).append(this.question.cssClasses.itemDisabled,this.question.isReadOnly||!this.item.isEnabled).toString()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"css",{get:function(){return{label:this.labelClass,icon:this.question.cssClasses.itemIcon,control:this.question.cssClasses.itemControl,caption:this.question.cssClasses.itemCaption,decorator:this.question.cssClasses.itemDecorator}},enumerable:!1,configurable:!0}),e.prototype.onChange=function(){this.question.selectItem(this.item)},e}(),Es={changecamera:"flip-24x24",clear:"clear-24x24",cancel:"cancel-24x24",closecamera:"close-24x24",defaultfile:"file-72x72",choosefile:"folder-24x24",file:"toolbox-file-24x24",left:"chevronleft-16x16",modernbooleancheckchecked:"plus-32x32",modernbooleancheckunchecked:"minus-32x32",more:"more-24x24",navmenu_24x24:"navmenu-24x24",removefile:"error-24x24",takepicture:"camera-32x32",takepicture_24x24:"camera-24x24",v2check:"check-16x16",checked:"check-16x16",v2check_24x24:"check-24x24","back-to-panel_16x16":"restoredown-16x16",clear_16x16:"clear-16x16",close_16x16:"close-16x16",collapsedetail:"collapsedetails-16x16",expanddetail:"expanddetails-16x16","full-screen_16x16":"maximize-16x16",loading:"loading-48x48",minimize_16x16:"minimize-16x16",next_16x16:"chevronright-16x16",previous_16x16:"chevronleft-16x16","no-image":"noimage-48x48","ranking-dash":"rankingundefined-16x16","drag-n-drop":"drag-24x24","ranking-arrows":"reorder-24x24",restore_16x16:"fullsize-16x16",reset:"restore-24x24",search:"search-24x24",average:"smiley-rate5-24x24",excellent:"smiley-rate9-24x24",good:"smiley-rate7-24x24",normal:"smiley-rate6-24x24","not-good":"smiley-rate4-24x24",perfect:"smiley-rate10-24x24",poor:"smiley-rate3-24x24",terrible:"smiley-rate1-24x24","very-good":"smiley-rate8-24x24","very-poor":"smiley-rate2-24x24",add_16x16:"add-16x16",add_24x24:"add-24x24",alert_24x24:"warning-24x24",apply:"apply-24x24","arrow-down":"arrowdown-24x24","arrow-left":"arrowleft-24x24","arrow-left_16x16":"arrowleft-16x16",arrowleft:"arrowleft-16x16","arrow-right":"arrowright-24x24","arrow-right_16x16":"arrowright-16x16",arrowright:"arrowright-16x16","arrow-up":"arrowup-24x24",boolean:"toolbox-boolean-24x24","change-question-type_16x16":"speechbubble-16x16",checkbox:"toolbox-checkbox-24x24","collapse-detail_16x16":"minusbox-16x16","collapse-panel":"collapse-pg-24x24",collapse_16x16:"collapse-16x16","color-picker":"dropper-16x16",comment:"toolbox-longtext-24x24",config:"wrench-24x24",copy:"copy-24x24",default:"toolbox-customquestion-24x24",delete_16x16:"delete-16x16",delete_24x24:"delete-24x24",delete:"delete-24x24","description-hide":"hidehint-16x16",description:"hint-16x16","device-desktop":"desktop-24x24","device-phone":"phone-24x24","device-rotate":"rotate-24x24","device-tablet":"tablet-24x24",download:"download-24x24","drag-area-indicator":"drag-24x24","drag-area-indicator_24x16":"draghorizontal-24x16",v2dragelement_16x16:"draghorizontal-24x16","drop-down-arrow":"chevrondown-24x24","drop-down-arrow_16x16":"chevrondown-16x16",chevron_16x16:"chevrondown-16x16",dropdown:"toolbox-dropdown-24x24",duplicate_16x16:"copy-16x16",edit:"edit-24x24",edit_16x16:"edit-16x16","editing-finish":"finishedit-24x24",error:"error-16x16","expand-detail_16x16":"plusbox-16x16","expand-panel":"expand-pg-24x24",expand_16x16:"expand-16x16",expression:"toolbox-expression-24x24","fast-entry":"textedit-24x24",fix:"fix-24x24",html:"toolbox-html-24x24",image:"toolbox-image-24x24",imagepicker:"toolbox-imagepicker-24x24",import:"import-24x24","invisible-items":"invisible-24x24",language:"language-24x24",load:"import-24x24","logic-collapse":"collapse-24x24","logic-expand":"expand-24x24",logo:"image-48x48",matrix:"toolbox-matrix-24x24",matrixdropdown:"toolbox-multimatrix-24x24",matrixdynamic:"toolbox-dynamicmatrix-24x24",multipletext:"toolbox-multipletext-24x24",panel:"toolbox-panel-24x24",paneldynamic:"toolbox-dynamicpanel-24x24",preview:"preview-24x24",radiogroup:"toolbox-radiogroup-24x24",ranking:"toolbox-ranking-24x24",rating:"toolbox-rating-24x24",slider:"toolbox-slider-24x24",redo:"redo-24x24",remove_16x16:"remove-16x16",required:"required-16x16",save:"save-24x24","select-page":"selectpage-24x24",settings:"settings-24x24",settings_16x16:"settings-16x16",signaturepad:"toolbox-signature-24x24","switch-active_16x16":"switchon-16x16","switch-inactive_16x16":"switchoff-16x16",tagbox:"toolbox-tagbox-24x24",text:"toolbox-singleline-24x24",theme:"theme-24x24",toolbox:"toolbox-24x24",undo:"undo-24x24",visible:"visible-24x24",wizard:"wand-24x24",searchclear:"clear-16x16","chevron-16x16":"chevrondown-16x16",chevron:"chevrondown-24x24",progressbuttonv2:"arrowleft-16x16",right:"chevronright-16x16","add-lg":"add-24x24",add:"add-24x24"};function Ts(e){var t="icon-",n=e.replace(t,"");return t+(Es[n]||n)}function Os(e){var t=r.customIcons[e];return t?Ts(t):(e=Ts(e),(t=r.customIcons[e])||null)}function Rs(e){return Os(e)||Ts(e)}var As=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return y(t,e),t.prototype.getSurvey=function(e){var t;return null===(t=this.owner)||void 0===t?void 0:t.getSurvey()},t.prototype.getType=function(){return"masksettings"},t.prototype.setData=function(e){var t=this;Q.getProperties(this.getType()).forEach(function(n){var i=e[n.name];t[n.name]=void 0!==i?i:n.getDefaultValue(t)})},t.prototype.getData=function(){var e=this,t={};return Q.getProperties(this.getType()).forEach(function(n){var i=e[n.name];n.isDefaultValue(i)||(t[n.name]=i)}),t},t.prototype.processInput=function(e){return{value:e.prevValue,caretPosition:e.selectionEnd,cancelPreventDefault:!1}},t.prototype.getUnmaskedValue=function(e){return e},t.prototype.getMaskedValue=function(e){return e},t.prototype.getTextAlignment=function(){return"auto"},t.prototype.getTypeForExpressions=function(){return"text"},v([qe()],t.prototype,"saveMaskedValue",void 0),t}(Ve);function Ds(e){return function(e){var t=r.maskSettings.patternDefinitions;for(var n in t)if(e.match(t[n]))return!0;return!1}(e)?"fixed":"const"}function Ls(e){for(var t=[],n=!1,i=Object.keys(r.maskSettings.patternDefinitions),o=0;o<e.length;o++){var s=e[o];if(s===r.maskSettings.patternEscapeChar)n=!0;else if(n)n=!1,t.push({type:"fixed",value:s});else{var a=-1!==i.indexOf(s)?"regex":Ds(s);t.push({type:a,value:s})}}return t}function Ns(e,t,n){for(var i=r.maskSettings.patternDefinitions[n.value];t<e.length;){if(e[t].match(i))return t;t++}return t}function Ms(e,t,n,i){void 0===i&&(i=!1);var o="";if(!e)return o;for(var s="string"==typeof t?Ls(t):t,a=0;a<s.length;a++)if("fixed"!==s[a].type||i||(o+=s[a].value),"regex"===s[a].type){var l=r.maskSettings.patternDefinitions[s[a].value];if(!e[a]||!e[a].match(l)){if(n){o="";break}break}o+=e[a]}return o}Q.addClass("masksettings",[{name:"saveMaskedValue:boolean",visibleIf:function(e){return!!e&&"masksettings"!==e.getType()}}],function(){return new As});var ks=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.literals=[],t}return y(t,e),t.prototype.updateLiterals=function(){this.literals=Ls(this.pattern||"")},t.prototype.onPropertyValueChanged=function(t,n,i){e.prototype.onPropertyValueChanged.call(this,t,n,i),"pattern"===t&&this.updateLiterals()},t.prototype.getType=function(){return"patternmask"},t.prototype.fromJSON=function(t,n){e.prototype.fromJSON.call(this,t,n),this.updateLiterals()},t.prototype._getMaskedValue=function(e,t){return void 0===t&&(t=!1),function(e,t,n){for(var i=null==e?"":e,o="",s=0,a="string"==typeof t?Ls(t):t,l=0;l<a.length;l++)switch(a[l].type){case"regex":if(s<i.length&&(s=Ns(i,s,a[l])),s<i.length)o+=i[s];else{if(!n)return o;o+=r.maskSettings.patternPlaceholderChar}s++;break;case"const":case"fixed":o+=a[l].value,a[l].value===i[s]&&s++}return o}(null==e?"":e,this.literals,t)},t.prototype._getUnmaskedValue=function(e,t){return void 0===t&&(t=!1),Ms(null==e?"":e,this.literals,t)},t.prototype.processInput=function(e){var t={value:e.prevValue,caretPosition:e.selectionEnd,cancelPreventDefault:!1};if(!e.insertedChars&&e.selectionStart===e.selectionEnd)return t;var n=e.prevValue.slice(0,e.selectionStart)+(e.insertedChars||""),i=Ms(e.prevValue.slice(0,e.selectionStart),this.literals.slice(0,e.selectionStart),!1),o=Ms(e.prevValue.slice(e.selectionEnd),this.literals.slice(e.selectionEnd),!1,!0);return t.value=this._getMaskedValue(i+(e.insertedChars||"")+o,!0),e.insertedChars||"backward"!==e.inputDirection?t.caretPosition=this._getMaskedValue(n).length:t.caretPosition=e.selectionStart,t},t.prototype.getMaskedValue=function(e){return this._getMaskedValue(e,!0)},t.prototype.getUnmaskedValue=function(e){return this._getUnmaskedValue(e,!0)},v([qe()],t.prototype,"pattern",void 0),t}(As);Q.addClass("patternmask",[{name:"pattern"}],function(){return new ks},"masksettings");var Fs=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return y(t,e),t.prototype.calccaretPosition=function(e,t,n){for(var i=e?this.displayNumber(this.parseNumber(e),!1).length:0,o=0,r=t.selectionStart,s=!t.insertedChars&&"forward"===t.inputDirection,a=0;a<n.length;a++){if(n[a]!==this.thousandsSeparator&&o++,o===i+(s?1:0)){r=s?a:a+1;break}}return r},t.prototype.numericalCompositionIsEmpty=function(e){return!e.integralPart&&!e.fractionalPart},t.prototype.displayNumber=function(e,t,n){void 0===t&&(t=!0),void 0===n&&(n=!1);var i=e.integralPart;t&&i&&this.thousandsSeparator&&(i=function(e,t,n){void 0===t&&(t=!0),void 0===n&&(n=3);var i=[];if(t){for(var o=e.length-n;o>-n;o-=n)i.push(e.substring(o,o+n));i=i.reverse()}else for(o=0;o<e.length;o+=n)i.push(e.substring(o,o+n));return i}(i).join(this.thousandsSeparator));var o=e.fractionalPart,r=e.isNegative?"-":"";if(""===o){if(n)return i&&"0"!==i?r+i:i;var s=i+(e.hasDecimalSeparator&&!n?this.decimalSeparator:"");return"0"===s?s:r+s}return[r+(i=i||"0"),o=o.substring(0,this.precision)].join(this.decimalSeparator)},t.prototype.convertNumber=function(e){var t=e.isNegative?"-":"";return e.fractionalPart?parseFloat(t+(e.integralPart||"0")+"."+e.fractionalPart.substring(0,this.precision)):parseInt(t+e.integralPart||"0")},t.prototype.validateNumber=function(e,t){var n=this.min||Number.MIN_SAFE_INTEGER,i=this.max||Number.MAX_SAFE_INTEGER;if(this.numericalCompositionIsEmpty(e))return!0;if(void 0!==this.min||void 0!==this.max){var o=this.convertNumber(e);if(Number.isNaN(o))return!0;if(o>=n&&o<=i)return!0;if(!t){if(e.hasDecimalSeparator||0==o){var r=Math.pow(.1,(e.fractionalPart||"").length);if(o>=0)return o+r>n&&o<=i;if(o<0)return o>=n&&o-r<i}else{var s=o,a=o;if(o>0){if(o+1>n&&o<=i)return!0;for(;s=10*s+9,!((a*=10)>i);)if(s>n)return!0;return!1}if(o<0){if(o>=n&&o-1<i)return!0;for(;a=10*a-9,!((s*=10)<n);)if(a<i)return!0;return!1}}return o>=0&&o<=i||o<0&&o>=n}return!1}return!0},t.prototype.parseNumber=function(e){for(var t={integralPart:"",fractionalPart:"",hasDecimalSeparator:!1,isNegative:!1},n=null==e?"":e.toString(),i=0,o=0;o<n.length;o++){var r=n[o];switch(r){case"-":this.allowNegativeValues&&(void 0===this.min||this.min<0)&&i++;break;case this.decimalSeparator:this.precision>0&&(t.hasDecimalSeparator=!0);break;case this.thousandsSeparator:break;default:r.match(Bo)&&(t.hasDecimalSeparator?t.fractionalPart+=r:t.integralPart+=r)}}return t.isNegative=i%2!=0,t.integralPart.length>1&&"0"===t.integralPart[0]&&(t.integralPart=t.integralPart.slice(1)),t},t.prototype.getNumberMaskedValue=function(e,t){void 0===t&&(t=!1);var n=this.parseNumber(e);return this.validateNumber(n,t)?this.displayNumber(n,!0,t):null},t.prototype.getNumberUnmaskedValue=function(e){var t=this.parseNumber(e);if(!this.numericalCompositionIsEmpty(t))return this.convertNumber(t)},t.prototype.getTextAlignment=function(){return"right"},t.prototype.getMaskedValue=function(e){var t=null==e?"":e.toString();return t=t.replace(".",this.decimalSeparator),this.getNumberMaskedValue(t,!0)},t.prototype.getUnmaskedValue=function(e){return this.getNumberUnmaskedValue(e)},t.prototype.processInput=function(e){var t={value:e.prevValue,caretPosition:e.selectionEnd,cancelPreventDefault:!1},n=e.prevValue.slice(0,e.selectionStart)+(e.insertedChars||""),i=n+e.prevValue.slice(e.selectionEnd),o=this.parseNumber(i);if(!this.validateNumber(o,!1))return t;var r=this.getNumberMaskedValue(i),s=this.calccaretPosition(n,e,r);return t.value=r,t.caretPosition=s,t},t.prototype.getType=function(){return"numericmask"},v([qe()],t.prototype,"allowNegativeValues",void 0),v([qe()],t.prototype,"decimalSeparator",void 0),v([qe()],t.prototype,"precision",void 0),v([qe()],t.prototype,"thousandsSeparator",void 0),v([qe()],t.prototype,"min",void 0),v([qe()],t.prototype,"max",void 0),t}(As);function js(e,t){switch(e){case"hour":case"minute":case"second":case"day":case"month":return 2;case"timeMarker":case"year":return t;default:return 1}}Q.addClass("numericmask",[{name:"allowNegativeValues:boolean",default:!0},{name:"decimalSeparator",default:".",maxLength:1},{name:"thousandsSeparator",default:",",maxLength:1},{name:"precision:number",default:2,minValue:0},{name:"min:number"},{name:"max:number"}],function(){return new Fs},"masksettings");var _s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.defaultDate="1970-01-01T",t.turnOfTheCentury=68,t.twelve=12,t.lexems=[],t.inputDateTimeData=[],t.validBeginningOfNumbers={hour:1,hourU:2,minute:5,second:5,day:3,month:1},t}return y(t,e),Object.defineProperty(t.prototype,"hasDatePart",{get:function(){return this.lexems.some(function(e){return"day"===e.type||"month"===e.type||"year"===e.type})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hasTimePart",{get:function(){return this.lexems.some(function(e){return"hour"===e.type||"minute"===e.type||"second"===e.type})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hasSeconds",{get:function(){return this.lexems.some(function(e){return"second"===e.type})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"is12Hours",{get:function(){return this.lexems.filter(function(e){return"hour"===e.type&&!e.upperCase}).length>0},enumerable:!1,configurable:!0}),t.prototype.getType=function(){return"datetimemask"},t.prototype.getTypeForExpressions=function(){return this.hasTimePart&&this.hasSeconds?"datetime-seconds":this.hasTimePart?"datetime-local":"datetime"},t.prototype.updateLiterals=function(){this.lexems=function(e){for(var t,n=[],i=function(e,i,o){if(void 0===o&&(o=!1),t&&t===e){n[n.length-1].count++;var r=js(e,n[n.length-1].count);n[n.length-1].maxCount=r}else r=js(e,1),n.push({type:e,value:i,count:1,maxCount:r,upperCase:o})},o=0;o<e.length;o++){var r=e[o];switch(r){case"m":i("month",r);break;case"d":i("day",r);break;case"y":i("year",r);break;case"h":i("hour",r,!1);break;case"H":i("hour",r,!0);break;case"M":i("minute",r);break;case"s":i("second",r);break;case"t":i("timeMarker",r);break;case"T":i("timeMarker",r,!0);break;default:n.push({type:"separator",value:r,count:1,maxCount:1,upperCase:!1})}t=n[n.length-1].type}return n}(this.pattern||"")},t.prototype.leaveOnlyNumbers=function(e){for(var t="",n=0;n<e.length;n++)e[n].match(Bo)&&(t+=e[n]);return t},t.prototype.getMaskedStrFromISO=function(e){var t=this,n=new Date(e);return this.initInputDateTimeData(),this.hasTimePart||(n=new Date(e+"T00:00:00")),this.hasDatePart||(n=new Date(this.defaultDate+e)),isNaN(n)||this.lexems.forEach(function(e,i){var o=t.inputDateTimeData[i];switch(o.isCompleted=!0,e.type){case"hour":t.is12Hours?o.value=((n.getHours()-1)%t.twelve+1).toString():o.value=n.getHours().toString();break;case"minute":o.value=n.getMinutes().toString();break;case"second":o.value=n.getSeconds().toString();break;case"timeMarker":var r=n.getHours()>=t.twelve?"pm":"am";o.value=e.upperCase?r.toUpperCase():r;break;case"day":o.value=n.getDate().toString();break;case"month":o.value=(n.getMonth()+1).toString();break;case"year":var s=n.getFullYear();2==e.count&&(s%=100),o.value=s.toString()}}),this.getFormatedString(!0)},t.prototype.initInputDateTimeData=function(){var e=this;this.inputDateTimeData=[],this.lexems.forEach(function(t){e.inputDateTimeData.push({lexem:t,isCompleted:!1,value:void 0})})},t.prototype.getISO_8601Format=function(e){var t=[],n=[];if(void 0!==e.year){var i=this.getPlaceholder(4,e.year.toString(),"0")+e.year;t.push(i)}if(void 0!==e.month&&void 0!==e.year){var o=this.getPlaceholder(2,e.month.toString(),"0")+e.month;t.push(o)}if(void 0!==e.day&&void 0!==e.month&&void 0!==e.year){var r=this.getPlaceholder(2,e.day.toString(),"0")+e.day;t.push(r)}if(void 0!==e.hour){var s=this.getPlaceholder(2,e.hour.toString(),"0")+e.hour;n.push(s)}if(void 0!==e.minute&&void 0!==e.hour){var a=this.getPlaceholder(2,e.minute.toString(),"0")+e.minute;n.push(a)}if(void 0!==e.second&&void 0!==e.minute&&void 0!==e.hour){var l=this.getPlaceholder(2,e.second.toString(),"0")+e.second;n.push(l)}var u=[];return t.length>0&&u.push(t.join("-")),n.length>1&&u.push(n.join(":")),u.join("T")},t.prototype.isYearValid=function(e){if(void 0===e.min&&void 0===e.max)return!1;var t=e.year.toString(),n=e.min.toISOString().slice(0,t.length),i=e.max.toISOString().slice(0,t.length);return e.year>=parseInt(n)&&e.year<=parseInt(i)},t.prototype.createIDateTimeCompositionWithDefaults=function(e,t){var n=29==e.day&&2==e.month,i=e.min.getFullYear(),o=e.max.getFullYear();n&&(i=4*Math.ceil(i/4))>(o=4*Math.floor(o/4))&&(i=void 0,o=void 0);var r=void 0!==e.year?e.year:t?o:i,s=void 0!==e.month?e.month:t&&this.hasDatePart?12:1;return{year:r,month:s,day:void 0!==e.day?e.day:t&&this.hasDatePart?this.getMaxDateForMonth(r,s):1,hour:void 0!==e.hour?e.hour:t?23:0,minute:void 0!==e.minute?e.minute:t?59:0,second:void 0!==e.second?e.second:t?59:0}},t.prototype.getMaxDateForMonth=function(e,t){return 2==t?e%4==0&&e%100!=0||e%400==0?29:28:[31,28,31,30,31,30,31,31,30,31,30,31][t-1]},t.prototype.isDateValid=function(e){var t=new Date(this.getISO_8601Format(this.createIDateTimeCompositionWithDefaults(e,!1))),n=new Date(this.getISO_8601Format(this.createIDateTimeCompositionWithDefaults(e,!0)));return!isNaN(t)&&(t.getDate()===e.day||void 0===e.day)&&(t.getMonth()===e.month-1||void 0===e.month)&&(t.getFullYear()===e.year||void 0===e.year)&&n>=e.min&&t<=e.max},t.prototype.getPlaceholder=function(e,t,n){var i=e-(t||"").length;return i>0?n.repeat(i):""},t.prototype.isDateValid12=function(e){return this.is12Hours?!(this.is12Hours&&e.hour>this.twelve)&&(e.timeMarker?"p"===e.timeMarker[0].toLowerCase()?(e.hour!==this.twelve&&(e.hour+=this.twelve),this.isDateValid(e)):(e.hour===this.twelve&&(e.hour=0),this.isDateValid(e)):!!this.isDateValid(e)||(e.hour+=this.twelve,this.isDateValid(e))):this.isDateValid(e)},t.prototype.updateTimeMarkerInputDateTimeData=function(e,t){var n=e.value;if(n){var i="timeMarker",o=m({},t);o[i]=n,this.isDateValid12(o)?e.isCompleted=!0:n=n.slice(0,n.length-1),e.value=n||void 0,t[i]=n||void 0}},t.prototype.updateInputDateTimeData=function(e,t){var n=e.value;if(n){var i=e.lexem.type,o=m({},t);if(o[i]=parseInt(this.parseTwoDigitYear(e)),n.length===e.lexem.maxCount){if(this.isDateValid12(o))return e.isCompleted=!0,e.value=n||void 0,void(t[i]=parseInt(n)>0?parseInt(n):void 0);n=n.slice(0,n.length-1)}o[i]=parseInt(n);var r=parseInt(n[0]),s=this.validBeginningOfNumbers[i+(e.lexem.upperCase?"U":"")];"year"!==i||this.isYearValid(o)?void 0!==s&&r>s?this.isDateValid12(o)?e.isCompleted=!0:n=n.slice(0,n.length-1):void 0!==s&&0!==r&&r<=s&&(this.checkValidationDateTimePart(o,i,e),e.isCompleted&&!this.isDateValid12(o)&&(n=n.slice(0,n.length-1))):(n=n.slice(0,n.length-1),e.isCompleted=!1),e.value=n||void 0,t[i]=parseInt(n)>0?parseInt(n):void 0}},t.prototype.checkValidationDateTimePart=function(e,t,n){var i=e[t],o=10*i,r=10;"month"===t&&(r=3),"hour"===t&&(r=this.is12Hours?3:5),n.isCompleted=!0;for(var s=0;s<r;s++)if(e[t]=o+s,this.isDateValid12(e)){n.isCompleted=!1;break}e[t]=i},t.prototype.getCorrectDatePartFormat=function(e,t){var n=e.lexem,i=e.value||"";if(i&&"timeMarker"===n.type)return t&&(i+=this.getPlaceholder(n.count,i,n.value)),i;(i&&e.isCompleted&&(i=parseInt(i).toString()),i&&e.isCompleted)?i=this.getPlaceholder(n.count,i,"0")+i:(i=function(e,t){var n=t;return e.count<e.maxCount&&("day"===e.type&&0===parseInt(t[0])||"month"===e.type&&0===parseInt(t[0]))&&(n=t.slice(1,t.length)),n}(n,i),t&&(i+=this.getPlaceholder(n.count,i,n.value)));return i},t.prototype.createIDateTimeComposition=function(){var e,t;return this.hasDatePart?(e=this.min||"0001-01-01",t=this.max||"9996-12-31"):(e=this.defaultDate+(this.min||"00:00:00"),t=this.defaultDate+(this.max||"23:59:59")),{hour:void 0,minute:void 0,second:void 0,day:void 0,month:void 0,year:void 0,min:new Date(e),max:new Date(t)}},t.prototype.parseTwoDigitYear=function(e){var t=e.value;return"year"!==e.lexem.type||e.lexem.count>2?t:(this.max&&this.max.length>=4&&(this.turnOfTheCentury=parseInt(this.max.slice(2,4))),(parseInt(t)>this.turnOfTheCentury?"19":"20")+t)},t.prototype.getFormatedString=function(e){var t="",n="",i=!1,o=this.inputDateTimeData.length-1;if(!e){var r=this.inputDateTimeData.filter(function(e){return!!e.value});o=this.inputDateTimeData.indexOf(r[r.length-1])}for(var s=0;s<this.inputDateTimeData.length;s++){var a=this.inputDateTimeData[s];switch(a.lexem.type){case"timeMarker":case"hour":case"minute":case"second":case"day":case"month":case"year":if(void 0===a.value&&!e)return t+=i?n:"";var l=e||o>s;t+=n+this.getCorrectDatePartFormat(a,l),i=a.isCompleted;break;case"separator":n=a.lexem.value}}return t},t.prototype.cleanTimeMarker=function(e,t){var n="";e=e.toUpperCase();for(var i=0;i<e.length;i++)(!n&&("P"==e[i]||"A"==e[i])||n&&"M"==e[i])&&(n+=e[i]);return n=t?n.toUpperCase():n.toLowerCase()},t.prototype.setInputDateTimeData=function(e){var t=this,n=0;this.initInputDateTimeData(),this.lexems.forEach(function(i,o){if(e.length>0&&n<e.length){if("separator"===i.type)return;var r=t.inputDateTimeData[o],s=e[n],a=void 0;a="timeMarker"===i.type?t.cleanTimeMarker(s,i.upperCase):t.leaveOnlyNumbers(s),r.value=a.slice(0,i.maxCount),n++}})},t.prototype._getMaskedValue=function(e,t){var n=this;void 0===t&&(t=!0);var i=null==e?"":e.toString(),o=this.getParts(i);this.setInputDateTimeData(o);var r=this.createIDateTimeComposition();return this.inputDateTimeData.forEach(function(e){"timeMarker"===e.lexem.type?n.updateTimeMarkerInputDateTimeData(e,r):n.updateInputDateTimeData(e,r)}),this.getFormatedString(t)},t.prototype.getParts=function(e){for(var t=[],n=this.lexems.filter(function(e){return"separator"!==e.type}),i=this.lexems.filter(function(e){return"separator"===e.type}).map(function(e){return e.value}),o="",r=!1,s=!1,a=0;a<e.length;a++){var l=e[a];if(l.match(Bo)||l===n[t.length].value||"timeMarker"===n[t.length].type?(r=!1,s=!1,o+=l):-1!==i.indexOf(l)?s||(r=!0,t.push(o),o=""):r||(s=!0,t.push(o),o=""),t.length>=n.length){r=!1;break}}return(""!=o||r)&&t.push(o),t},t.prototype.getUnmaskedValue=function(e){var t,n=this,i=null==e?"":e.toString(),o=this.getParts(i);this.setInputDateTimeData(o);var r=null===(t=this.inputDateTimeData.filter(function(e){return"timeMarker"===e.lexem.type})[0])||void 0===t?void 0:t.value.toLowerCase()[0],s=this.createIDateTimeComposition(),a=!1;return this.inputDateTimeData.forEach(function(e){var t=e.value;if("timeMarker"!=e.lexem.type&&"separator"!=e.lexem.type)if(!t||t.length<e.lexem.count)a=!0;else{var i=parseInt(n.parseTwoDigitYear(e));"hour"==e.lexem.type&&"p"===r&&i!=n.twelve&&(i+=n.twelve),s[e.lexem.type]=i}}),a?"":this.getISO_8601Format(s)},t.prototype.getMaskedValue=function(e){return this.getMaskedStrFromISO(e)},t.prototype.processInput=function(e){var t={value:e.prevValue,caretPosition:e.selectionEnd,cancelPreventDefault:!1},n=e.prevValue.slice(0,e.selectionStart),i=e.prevValue.slice(e.selectionEnd);return t.value=this._getMaskedValue(n+(e.insertedChars||"")+i),e.insertedChars||"backward"!==e.inputDirection?t.caretPosition=this._getMaskedValue(n+(e.insertedChars||""),!1).length:t.caretPosition=e.selectionStart,t},v([qe()],t.prototype,"min",void 0),v([qe()],t.prototype,"max",void 0),t}(ks);Q.addClass("datetimemask",[{name:"min",type:"datetime",enableIf:function(e){return!!e.pattern}},{name:"max",type:"datetime",enableIf:function(e){return!!e.pattern}}],function(){return new _s},"patternmask");var Bs=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return y(t,e),t.prototype.getType=function(){return"currencymask"},t.prototype.wrapText=function(e){var t=this.prefix||"",n=this.suffix||"",i=e;return i?(-1===i.indexOf(t)&&(i=t+i),-1===i.indexOf(n)&&(i+=n),i):i},t.prototype.unwrapInputArgs=function(e){var t=e.prevValue;if(t){if(this.prefix&&-1!==t.indexOf(this.prefix)){t=t.slice(t.indexOf(this.prefix)+this.prefix.length);var n=(this.prefix||"").length;e.selectionStart=Math.max(e.selectionStart-n,0),e.selectionEnd-=n}this.suffix&&-1!==t.indexOf(this.suffix)&&(t=t.slice(0,t.indexOf(this.suffix))),e.prevValue=t}},t.prototype.processInput=function(t){this.unwrapInputArgs(t);var n=e.prototype.processInput.call(this,t),i=(this.prefix||"").length;return n.value&&(n.caretPosition+=i),n.value=this.wrapText(n.value),n},t.prototype.getMaskedValue=function(t){var n=e.prototype.getMaskedValue.call(this,t);return this.wrapText(n)},v([qe()],t.prototype,"prefix",void 0),v([qe()],t.prototype,"suffix",void 0),t}(Fs);function qs(n){!function(e,n,i){if(!e)return;var o=function(e){var t,n,i,o={},r=0,s=0,a="",l=String.fromCharCode,u=e.length,p="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(t=0;t<64;t++)o[p.charAt(t)]=t;for(n=0;n<u;n++){for(r=(r<<6)+o[e.charAt(n)],s+=6;s>=8;)((i=r>>>(s-=8)&255)||n<u-2)&&(a+=l(i))}return a},r=o(e);if(!r)return;var s=r.indexOf(";");if(s<0)return;if(!function(e){if(!e)return!0;var n="domains:",i=e.indexOf(n);if(i<0)return!0;var o=e.substring(i+n.length).toLowerCase().split(",");if(!Array.isArray(o)||0===o.length)return!0;var r=t.getLocation();if(r&&r.hostname){for(var s=r.hostname.toLowerCase(),a=0;a<o.length;a++)if(s.indexOf(o[a])>-1)return!0;return!1}return!0}(r.substring(0,s)))return;(r=r.substring(s+1)).split(",").forEach(function(e){var t=e.indexOf("=");if(t>0){var o=new Date(e.substring(t+1));n[e.substring(0,t)]=new Date(i)<=o||o}})}(n,Hs,e.ReleaseDate)}function Qs(e){var t=Hs[e.toString()];return t||!1}Q.addClass("currencymask",[{name:"prefix"},{name:"suffix"}],function(){return new Bs},"numericmask"),e.Version=void 0,e.ReleaseDate=void 0,e.Version="".concat("2.5.32"),r.version=e.Version,e.ReleaseDate="".concat("2026-07-01");var Hs={};var zs=function(){function e(){this.icons={},this.iconPrefix="icon-",this.onIconsChanged=new I}return e.prototype.processId=function(e,t){return 0==e.indexOf(t)&&(e=e.substring(t.length)),e=Es[e]||e},e.prototype.registerIconFromSymbol=function(e,t){this.icons[e]=t},e.prototype.registerIconFromSvgViaElement=function(e,t,i){if(void 0===i&&(i=this.iconPrefix),n.isAvailable()){e=this.processId(e,i);var o=n.createElement("div");o.innerHTML=t;var r=n.createElement("symbol"),s=o.querySelector("svg");r.innerHTML=s.innerHTML;for(var a=0;a<s.attributes.length;a++)r.setAttributeNS("http://www.w3.org/2000/svg",s.attributes[a].name,s.attributes[a].value);r.id=i+e,this.registerIconFromSymbol(e,r.outerHTML)}},e.prototype.registerIconFromSvg=function(e,t,n){void 0===n&&(n=this.iconPrefix),e=this.processId(e,n);var i="<svg ",o="</svg>",r=(t=t.trim()).toLowerCase();return r.substring(0,5)===i&&r.substring(r.length-6,r.length)===o&&(this.registerIconFromSymbol(e,'<symbol id="'+n+e+'" '+t.substring(5,r.length-6)+"</symbol>"),!0)},e.prototype.registerIconsFromFolder=function(e){var t=this;e.keys().forEach(function(n){t.registerIconFromSvg(n.substring(2,n.length-4).toLowerCase(),e(n))})},e.prototype.registerIcons=function(e){for(var t in e)this.registerIconFromSvg(t,e[t]);this.updateMarkup()},e.prototype.registerIcon=function(e,t,n){var i;void 0===n&&(n="v2"),this.registerIconFromSvg(e,t),Gs(n,((i={})[e]=t,i))},e.prototype.iconsRenderedHtml=function(){var e=this;return Object.keys(this.icons).map(function(t){return e.icons[t]}).join("")},e.prototype.updateMarkup=function(){this.onIconsChanged.fire(this,{})},e}(),Us=new zs,Ws={};function Gs(e,t){Ws[e]||(Ws[e]={});var n=Ws[e];for(var i in t)n[i]=t[i]}e.Action=rt,e.ActionContainer=Tt,e.ActionDropdownViewModel=st,e.AdaptiveActionContainer=Ht,e.AnimationBoolean=Jt,e.AnimationGroup=Kt,e.AnimationGroupUtils=Wt,e.AnimationProperty=Gt,e.AnimationPropertyUtils=Ut,e.AnimationTab=Yt,e.AnimationUtils=zt,e.AnswerCountValidator=Ye,e.AnswerRequiredError=Se,e.ArrayChanges=Pe,e.ArrayOperand=Rn,e.Base=Ve,e.BaseAction=ot,e.BinaryOperand=Tn,e.ButtonGroupItemModel=Ss,e.ButtonGroupItemValue=xs,e.CalculatedValue=bn,e.CharacterCounter=Fo,e.CheckboxItem=lr,e.ChoiceItem=Co,e.ChoicesRestful=xn,e.ChoicesRestfull=In,e.ComponentCollection=Jn,e.ComponentQuestionJSON=Gn,e.ComputedUpdater=we,e.ConditionRunner=ee,e.ConditionsParser=_n,e.Const=An,e.Cover=Xi,e.CoverCell=Yi,e.CssClassBuilder=tt,e.CustomError=Be,e.CustomWidgetCollection=sn,e.DefaultTitleModel=or,e.DomDocumentHelper=n,e.DomWindowHelper=t,e.DragDropChoices=dr,e.DragDropCore=Ai,e.DragDropRankingSelectToRank=gr,e.DragOrClickHelper=Li,e.DropdownListModel=Eo,e.DropdownMultiSelectListModel=cr,e.ElementFactory=ei,e.EmailValidator=Ze,e.Event=x,e.EventBase=I,e.ExceedFilesCountError=Re,e.ExceedSizeError=Oe,e.ExpressionExecutorRunner=Bn,e.ExpressionRunner=X,e.ExpressionValidator=$e,e.FlowPanelModel=ir,e.FunctionFactory=te,e.FunctionOperand=Ln,e.Helpers=f,e.HtmlConditionItem=wn,e.ImageItemValue=Fr,e.InputMaskBase=As,e.InputMaskCurrency=Bs,e.InputMaskDateTime=_s,e.InputMaskNumeric=Fs,e.InputMaskPattern=ks,e.IsMobile=Dt,e.ItemValue=vn,e.JsonError=L,e.JsonIncorrectTypeError=F,e.JsonMetadata=D,e.JsonMetadataClass=A,e.JsonMissingTypeError=k,e.JsonMissingTypeErrorBase=M,e.JsonObject=q,e.JsonObjectProperty=O,e.JsonRequiredPropertyError=j,e.JsonUnknownPropertyError=N,e.ListModel=jt,e.LocalizableString=S,e.LocalizableStrings=E,e.MatrixCells=Lo,e.MatrixColumn=Ao,e.MatrixDropdownCell=gi,e.MatrixDropdownColumn=si,e.MatrixDropdownRowModel=xi,e.MatrixDropdownRowModelBase=vi,e.MatrixDynamicRowModel=Fi,e.MatrixRowModel=Do,e.Model=vo,e.MultiSelectListModel=pr,e.MultipleTextCell=tr,e.MultipleTextEditorModel=Yo,e.MultipleTextErrorCell=nr,e.MultipleTextItemModel=Xo,e.MutlipleTextErrorRow=er,e.MutlipleTextRow=$o,e.Notifier=Ki,e.NumericValidator=Je,e.OneAnswerRequiredError=Ee,e.Operand=En,e.PageModel=oo,e.PanelModel=io,e.PanelModelBase=no,e.PopupBaseViewModel=ms,e.PopupDropdownViewModel=Cs,e.PopupModalManager=Ps,e.PopupModalViewModel=ws,e.PopupModel=_t,e.PopupSurveyModel=ds,e.ProcessValue=J,e.ProgressButtons=ro,e.ProgressButtonsResponsivityManager=so,e.Question=gn,e.QuestionBooleanModel=kr,e.QuestionButtonGroupModel=Is,e.QuestionCheckboxBase=Vo,e.QuestionCheckboxModel=ur,e.QuestionCommentModel=mr,e.QuestionCompositeModel=Zn,e.QuestionCustomModel=Yn,e.QuestionCustomWidget=rn,e.QuestionDropdownModel=Oo,e.QuestionEmptyModel=sr,e.QuestionExpressionModel=ti,e.QuestionFactory=$n,e.QuestionFileModel=Ir,e.QuestionFileModelBase=Pr,e.QuestionFilePage=xr,e.QuestionHtmlModel=Er,e.QuestionImageMapModel=_r,e.QuestionImageModel=zr,e.QuestionImagePickerModel=jr,e.QuestionMatrixBaseModel=Qn,e.QuestionMatrixDropdownModel=Ii,e.QuestionMatrixDropdownModelBase=wi,e.QuestionMatrixDropdownRenderedCell=li,e.QuestionMatrixDropdownRenderedErrorRow=pi,e.QuestionMatrixDropdownRenderedRow=ui,e.QuestionMatrixDropdownRenderedTable=hi,e.QuestionMatrixDynamicModel=ji,e.QuestionMatrixModel=Mo,e.QuestionMultipleTextModel=Zo,e.QuestionNonValue=rr,e.QuestionPanelDynamicItem=es,e.QuestionPanelDynamicModel=ns,e.QuestionRadiogroupModel=Tr,e.QuestionRankingModel=yr,e.QuestionRatingModel=Dr,e.QuestionRowModel=to,e.QuestionSelectBase=wo,e.QuestionSignaturePadModel=Kr,e.QuestionSingleInputSummary=Mi,e.QuestionSingleInputSummaryItem=Ni,e.QuestionSliderModel=Nr,e.QuestionTagboxModel=hr,e.QuestionTextBase=jo,e.QuestionTextModel=Qo,e.RatingItemValue=Ar,e.RegexValidator=Xe,e.RenderedRatingItem=Ar,e.RendererFactory=an,e.RequreNumericError=Te,e.ResponsivityManager=xt,e.ScrollViewModel=gs,e.Serializer=Q,e.SliderLabelItemValue=Lr,e.SurveyElement=nn,e.SurveyElementCore=tn,e.SurveyError=Ie,e.SurveyModel=vo,e.SurveyNavigationLayoutModel=yo,e.SurveyProgressModel=os,e.SurveyProgressTextModel=fo,e.SurveyTimer=Ui,e.SurveyTimerModel=Wi,e.SurveyTrigger=ss,e.SurveyTriggerComplete=ls,e.SurveyTriggerCopyValue=hs,e.SurveyTriggerRunExpression=cs,e.SurveyTriggerSetValue=us,e.SurveyTriggerSkip=ps,e.SurveyTriggerVisible=as,e.SurveyValidator=We,e.SurveyWindowModel=fs,e.SvgIconRegistry=zs,e.SvgRegistry=Us,e.SvgThemeSets=Ws,e.TOCModel=ho,e.TextAreaModel=un,e.TextPreProcessor=Un,e.TextValidator=Ke,e.Trigger=rs,e.UnaryOperand=On,e.UrlConditionItem=Vn,e.ValidatorResult=Ue,e.ValidatorRunner=Ge,e.Variable=Dn,e.VerticalResponsivityManager=It,e._setIsTablet=function(e){Mt=e},e._setIsTouch=function(t){e.IsTouch=t},e.activateLazyRenderingChecks=dt,e.addIconsToThemeSet=Gs,e.checkLibraryVersion=function(t,n){if(e.Version!=t){var i="survey-core has version '"+e.Version+"' and "+n+" has version '"+t+"'. SurveyJS libraries should have the same versions to work correctly.";console.error(i)}},e.chooseFiles=Ji,e.classesToSelector=ft,e.cleanHtmlElementAfterAnimation=en,e.compareArrays=u,e.compareVersions=function(e,t){for(var n=/(\.0+)+$/,i=e.replace(n,"").split("."),o=t.replace(n,"").split("."),r=Math.min(i.length,o.length),s=0;s<r;s++){var a=parseInt(i[s],10)-parseInt(o[s],10);if(a)return a}return i.length-o.length},e.configConfirmDialog=Oi,e.confirmAction=Si,e.confirmActionAsync=Ei,e.createDropdownActionModel=function(e,t,n){return t.locOwner=n,Bt(e,t,t)},e.createDropdownActionModelAdvanced=Bt,e.createPopupModalViewModel=Vs,e.createPopupModelWithListModel=qt,e.createPopupViewModel=function(e){return e.isModal?new ws(e):new Cs(e)},e.createSvg=function(e,t,i,o,r,s){if(r){"auto"!==e&&(r.style.width=(e||t||16)+"px",r.style.height=(e||i||16)+"px");var a=r.childNodes[0],l=Rs(o);a.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href","#"+l);var u=r.getElementsByTagName("title")[0];s?(u||(u=n.getDocument().createElementNS("http://www.w3.org/2000/svg","title"),r.appendChild(u)),u.textContent=s):u&&r.removeChild(u)}},e.createTOCListModel=uo,e.defaultActionBarCss=nt,e.defaultCss=Qi,e.defaultThemeName=Hi,e.detectIEBrowser=function(){var e=navigator.userAgent,t=e.indexOf("MSIE "),n=e.indexOf("Trident/");return t>-1||n>-1},e.detectIEOrEdge=vr,e.doKey2ClickBlur=Io,e.doKey2ClickDown=function(e,t){if(void 0===t&&(t={processEsc:!0}),t&&(t.__keyDownReceived=!0),!e.target||"true"!==e.target.contentEditable){var n=e.which||e.keyCode,i=[13,32];t.processEsc&&i.push(27),-1!==i.indexOf(n)&&e.preventDefault()}},e.doKey2ClickUp=So,e.englishStrings=C,e.findParentByClassNames=function e(t,n){if(t)return n.every(function(e){return!e||t.classList.contains(e)})?t:e(t.parentElement,n)},e.findScrollableParent=ht,e.floorTo2Decimals=p,e.getActionDropdownButtonTarget=Qt,e.getActiveElement=pt,e.getCustomNewIconNameIfExists=Os,e.getElement=lt,e.getElementWidth=gt,e.getFirstVisibleChild=mt,e.getIconNameFromProxy=Rs,e.getLocaleString=V,e.getLocaleStrings=function(e){return w.getLocaleStrings(e)},e.getNewIconName=Ts,e.getOriginalEvent=function(e){return e.originalEvent||e},e.getRenderedSize=s,e.getRenderedStyleSize=a,e.getRootNode=ut,e.getSafeUrl=vt,e.getTocRootCss=co,e.getVerticalDimensions=Xt,e.glc=Qs,e.hasLicense=function(e){return!0===Qs(e)},e.increaseHeightByContent=ln,e.isBase64URL=wt,e.isContainerVisible=yt,e.isElementVisible=ct,e.isMobile=function(){return t.isAvailable()&&t.hasOwn("orientation")},e.isShadowDOM=at,e.loadFileFromBase64=Gi,e.matrixDropdownColumnTypes=ri,e.mergeValues=l,e.mulberry32=c,e.navigateToUrl=bt,e.prepareElementForVerticalAnimation=$t,e.preventDefaults=Vt,e.property=qe,e.propertyArray=He,e.registerFunction=function(e){te.Instance.register(e.name,e.func,e.isAsync,e.useCache)},e.renamedIcons=Es,e.sanitizeEditableContent=function(e,i){if(void 0===i&&(i=!0),t.isAvailable()&&n.isAvailable()&&e.childNodes.length>0){var o=t.getSelection();if(0==o.rangeCount)return;var r=o.getRangeAt(0);r.setStart(r.endContainer,r.endOffset),r.setEndAfter(e.lastChild),o.removeAllRanges(),o.addRange(r);var s=o.toString(),a=e.innerText;s=s.replace(/\r/g,""),i&&(s=s.replace(/\n/g,""),a=a.replace(/\n/g,""));var l=s.length;for(e.innerText=a,(r=n.getDocument().createRange()).setStart(e.firstChild,0),r.setEnd(e.firstChild,0),o.removeAllRanges(),o.addRange(r);o.toString().length<a.length-l;){var u=o.toString().length;if(o.modify("extend","forward","character"),o.toString().length==u)break}(r=o.getRangeAt(0)).setStart(r.endContainer,r.endOffset)}},e.setCreatePopupModelWithListModel=it,e.setLicenseKey=function(e){qs(e)},e.setPropertiesOnElementForAnimation=Zt,e.settings=r,e.setupLocale=function(e){w.setupLocale(e)},e.showConfirmDialog=Ti,e.slk=qs,e.surveyCss=qi,e.surveyLocalization=w,e.surveyStrings=P,e.tryFocusPage=ao,e.unwrap=function(e){return"function"!=typeof e?e:e()},e.updateListCssValues=Pt,e.wrapUrlForBackgroundImage=Ct});