survey-pdf 2.3.0 → 2.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm/pdf-form-filler-shared.mjs +1 -1
- package/fesm/pdf-form-filler.mjs +1 -1
- package/fesm/pdf-form-filler.node.mjs +1 -1
- package/fesm/survey.pdf.fonts.mjs +1 -1
- package/fesm/survey.pdf.mjs +2 -2
- package/package.json +2 -2
- package/pdf-form-filler.js +1 -1
- package/pdf-form-filler.min.js.LICENSE.txt +1 -1
- package/pdf-form-filler.node.js +1 -1
- package/pdf-form-filler.node.min.js.LICENSE.txt +1 -1
- package/survey.pdf.fonts.js +1 -1
- package/survey.pdf.fonts.min.js.LICENSE.txt +1 -1
- package/survey.pdf.js +2 -2
- package/survey.pdf.min.js +1 -1
- package/survey.pdf.min.js.LICENSE.txt +1 -1
package/fesm/pdf-form-filler.mjs
CHANGED
package/fesm/survey.pdf.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* surveyjs - SurveyJS PDF library v2.3.
|
|
2
|
+
* surveyjs - SurveyJS PDF library v2.3.1
|
|
3
3
|
* Copyright (c) 2015-2025 Devsoft Baltic OÜ - http://surveyjs.io/
|
|
4
4
|
* License: MIT (http://www.opensource.org/licenses/mit-license.php)
|
|
5
5
|
*/
|
|
@@ -9375,7 +9375,7 @@ class CustomBrick extends PdfBrick {
|
|
|
9375
9375
|
}
|
|
9376
9376
|
}
|
|
9377
9377
|
|
|
9378
|
-
checkLibraryVersion(`${"2.3.
|
|
9378
|
+
checkLibraryVersion(`${"2.3.1"}`, 'survey-pdf');
|
|
9379
9379
|
|
|
9380
9380
|
export { BooleanItemBrick, CheckItemBrick, CheckboxItemBrick, CompositeBrick, CustomBrick, DocController, DocOptions, DrawCanvas, DropdownBrick, EmptyBrick, EventHandler, FlatBooleanCheckbox as FlatBoolean, FlatCheckbox, FlatComment, FlatCustomModel, FlatDropdown, FlatExpression, FlatFile, FlatHTML, FlatImage, FlatImagePicker, FlatMatrix, FlatMatrixDynamic, FlatMatrixMultiple, FlatMultipleText, FlatPanelDynamic, FlatQuestion, FlatQuestionDefault, FlatRadiogroup, FlatRanking, FlatRating, FlatRepository, FlatSelectBase, FlatSignaturePad, FlatSlider, FlatSurvey, FlatTextbox, HTMLBrick, HorizontalAlign, ImageBrick, LinkBrick, PagePacker, PdfBrick, RadioItemBrick, RankingItemBrick, RowlineBrick, SurveyHelper, SurveyPDF, TextBoldBrick, TextBrick, TextFieldBrick, TitlePanelBrick, VerticalAlign };
|
|
9381
9381
|
//# sourceMappingURL=survey.pdf.mjs.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "survey-pdf",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.1",
|
|
4
4
|
"description": "survey.pdf.js is a SurveyJS PDF Library. It is a easy way to export SurveyJS surveys to PDF. It uses JSON for survey metadata.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Survey",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
},
|
|
20
20
|
"typings": "./typings/entries/pdf.d.ts",
|
|
21
21
|
"peerDependencies": {
|
|
22
|
-
"survey-core": "2.3.
|
|
22
|
+
"survey-core": "2.3.1"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"jspdf": "^2.3.0 || ^3"
|
package/pdf-form-filler.js
CHANGED
package/pdf-form-filler.node.js
CHANGED
package/survey.pdf.fonts.js
CHANGED
package/survey.pdf.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* surveyjs - SurveyJS PDF library v2.3.
|
|
2
|
+
* surveyjs - SurveyJS PDF library v2.3.1
|
|
3
3
|
* Copyright (c) 2015-2025 Devsoft Baltic OÜ - http://surveyjs.io/
|
|
4
4
|
* License: MIT (http://www.opensource.org/licenses/mit-license.php)
|
|
5
5
|
*/
|
|
@@ -1558,7 +1558,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1558
1558
|
|
|
1559
1559
|
|
|
1560
1560
|
|
|
1561
|
-
(0,survey_core__WEBPACK_IMPORTED_MODULE_50__.checkLibraryVersion)("".concat("2.3.
|
|
1561
|
+
(0,survey_core__WEBPACK_IMPORTED_MODULE_50__.checkLibraryVersion)("".concat("2.3.1"), 'survey-pdf');
|
|
1562
1562
|
|
|
1563
1563
|
|
|
1564
1564
|
/***/ }),
|
package/survey.pdf.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see survey.pdf.min.js.LICENSE.txt */
|
|
2
|
-
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("survey-core"),require("jspdf")):"function"==typeof define&&define.amd?define("SurveyPDF",["survey-core","jspdf"],e):"object"==typeof exports?exports.SurveyPDF=e(require("survey-core"),require("jspdf")):t.SurveyPDF=e(t.Survey,t.jspdf)}(this,(t,e)=>(()=>{var n={156:e=>{"use strict";e.exports=t},400:(t,e,n)=>{"use strict";var i=n(833);function r(t){return void 0===t?-1:t.height}var o=function(){function t(t,e){this.intervalTree=t,this.records=[],this.height=0,this.key=e.low,this.max=e.high,this.records.push(e)}return t.prototype.getNodeHigh=function(){for(var t=this.records[0].high,e=1;e<this.records.length;e++)this.records[e].high>t&&(t=this.records[e].high);return t},t.prototype.updateHeight=function(){this.height=Math.max(r(this.left),r(this.right))+1},t.prototype.updateMaxOfParents=function(){if(void 0!==this){var t=this.getNodeHigh();void 0!==this.left&&void 0!==this.right?this.max=Math.max(Math.max(this.left.max,this.right.max),t):void 0!==this.left&&void 0===this.right?this.max=Math.max(this.left.max,t):void 0===this.left&&void 0!==this.right?this.max=Math.max(this.right.max,t):this.max=t,this.parent&&this.parent.updateMaxOfParents()}},t.prototype._updateMaxAfterRightRotate=function(){var t=this.parent,e=t.left,n=e.getNodeHigh();void 0===e.left&&void 0!==e.right?e.max=Math.max(n,e.right.max):void 0!==e.left&&void 0===e.right?e.max=Math.max(n,e.left.max):void 0===e.left&&void 0===e.right?e.max=n:e.max=Math.max(Math.max(e.left.max,e.right.max),n);var i=this.getNodeHigh();void 0===this.left&&void 0!==this.right?this.max=Math.max(i,this.right.max):void 0!==this.left&&void 0===this.right?this.max=Math.max(i,this.left.max):void 0===this.left&&void 0===this.right?this.max=i:this.max=Math.max(Math.max(this.left.max,this.right.max),i),t.max=Math.max(Math.max(t.left.max,t.right.max),t.getNodeHigh())},t.prototype._updateMaxAfterLeftRotate=function(){var t=this.parent,e=t.right,n=e.getNodeHigh();void 0===e.left&&void 0!==e.right?e.max=Math.max(n,e.right.max):void 0!==e.left&&void 0===e.right?e.max=Math.max(n,e.left.max):void 0===e.left&&void 0===e.right?e.max=n:e.max=Math.max(Math.max(e.left.max,e.right.max),n);var i=this.getNodeHigh();void 0===this.left&&void 0!==this.right?this.max=Math.max(i,this.right.max):void 0!==this.left&&void 0===this.right?this.max=Math.max(i,this.left.max):void 0===this.left&&void 0===this.right?this.max=i:this.max=Math.max(Math.max(this.left.max,this.right.max),i),t.max=Math.max(Math.max(t.left.max,e.max),t.getNodeHigh())},t.prototype._leftRotate=function(){var t=this.right;t.parent=this.parent,void 0===t.parent?this.intervalTree.root=t:t.parent.left===this?t.parent.left=t:t.parent.right===this&&(t.parent.right=t),this.right=t.left,void 0!==this.right&&(this.right.parent=this),t.left=this,this.parent=t,this.updateHeight(),t.updateHeight()},t.prototype._rightRotate=function(){var t=this.left;t.parent=this.parent,void 0===t.parent?this.intervalTree.root=t:t.parent.left===this?t.parent.left=t:t.parent.right===this&&(t.parent.right=t),this.left=t.right,void 0!==this.left&&(this.left.parent=this),t.right=this,this.parent=t,this.updateHeight(),t.updateHeight()},t.prototype._rebalance=function(){if(r(this.left)>=2+r(this.right)){var t=this.left;r(t.left)>=r(t.right)?(this._rightRotate(),this._updateMaxAfterRightRotate()):(t._leftRotate(),this._rightRotate(),this._updateMaxAfterRightRotate())}else if(r(this.right)>=2+r(this.left)){var e=this.right;r(e.right)>=r(e.left)?(this._leftRotate(),this._updateMaxAfterLeftRotate()):(e._rightRotate(),this._leftRotate(),this._updateMaxAfterLeftRotate())}},t.prototype.insert=function(e){e.low<this.key?void 0===this.left?(this.left=new t(this.intervalTree,e),this.left.parent=this):this.left.insert(e):void 0===this.right?(this.right=new t(this.intervalTree,e),this.right.parent=this):this.right.insert(e),this.max<e.high&&(this.max=e.high),this.updateHeight(),this._rebalance()},t.prototype._getOverlappingRecords=function(t,e,n){if(t.key<=n&&e<=t.getNodeHigh()){for(var i=[],r=0;r<t.records.length;r++)t.records[r].high>=e&&i.push(t.records[r]);return i}return[]},t.prototype.search=function(t,e){if(void 0===this)return[];var n,i=[],r=[];return t>this.max?[]:(void 0!==this.left&&this.left.max>=t&&(i=this.left.search(t,e)),n=this._getOverlappingRecords(this,t,e),e<this.key?i.concat(n):(void 0!==this.right&&(r=this.right.search(t,e)),i.concat(n,r)))},t.prototype.searchExisting=function(t){if(void 0!==this){if(this.key===t)return this;if(t<this.key){if(void 0!==this.left)return this.left.searchExisting(t)}else if(void 0!==this.right)return this.right.searchExisting(t)}},t.prototype._minValue=function(){return void 0===this.left?this:this.left._minValue()},t.prototype.remove=function(t){var e=this.parent;if(t.key<this.key)return void 0!==this.left?this.left.remove(t):void 0;if(t.key>this.key)return void 0!==this.right?this.right.remove(t):void 0;if(void 0!==this.left&&void 0!==this.right){var n=this.right._minValue();return this.key=n.key,this.records=n.records,this.right.remove(this)}return e.left===this?(void 0!==this.right?(e.left=this.right,this.right.parent=e):(e.left=this.left,void 0!==this.left&&(this.left.parent=e)),e.updateMaxOfParents(),e.updateHeight(),e._rebalance(),this):e.right===this?(void 0!==this.right?(e.right=this.right,this.right.parent=e):(e.right=this.left,void 0!==this.left&&(this.left.parent=e)),e.updateMaxOfParents(),e.updateHeight(),e._rebalance(),this):void 0},t}(),s=function(){function t(){this.count=0}return t.prototype.insert=function(t){if(t.low>t.high)throw new Error("`low` value must be lower or equal to `high` value");if(void 0===this.root)return this.root=new o(this,t),this.count++,!0;var e=this.root.searchExisting(t.low);if(void 0!==e){for(var n=0;n<e.records.length;n++)if(i(e.records[n],t))return!1;return e.records.push(t),t.high>e.max&&(e.max=t.high,e.parent&&e.parent.updateMaxOfParents()),this.count++,!0}return this.root.insert(t),this.count++,!0},t.prototype.search=function(t,e){return void 0===this.root?[]:this.root.search(t,e)},t.prototype.remove=function(t){if(void 0===this.root)return!1;var e=this.root.searchExisting(t.low);if(void 0===e)return!1;if(e.records.length>1){for(var n=void 0,r=0;r<e.records.length;r++)if(i(e.records[r],t)){n=e.records[r],e.records.splice(r,1);break}if(n){if(n=void 0,t.high===e.max){var s=e.getNodeHigh();void 0!==e.left&&void 0!==e.right?e.max=Math.max(Math.max(e.left.max,e.right.max),s):void 0!==e.left&&void 0===e.right?e.max=Math.max(e.left.max,s):void 0===e.left&&void 0!==e.right?e.max=Math.max(e.right.max,s):e.max=s,e.parent&&e.parent.updateMaxOfParents()}return this.count--,!0}return!1}if(1===e.records.length){if(i(e.records[0],t)){if(this.root.key===e.key){var a=new o(this,{low:t.low,high:t.low});a.left=this.root,this.root.parent=a;var l=this.root.remove(e);return this.root=a.left,void 0!==this.root&&(this.root.parent=void 0),!!l&&(l=void 0,this.count--,!0)}return!!(l=this.root.remove(e))&&(l=void 0,this.count--,!0)}return!1}return!1},t.prototype.inOrder=function(){return new l(this.root)},t.prototype.preOrder=function(){return new c(this.root)},t}(),a=function(){function t(){this.tree=new s}return t.prototype.insert=function(t,e,n){return this.tree.insert({low:t,high:e,data:n})},t.prototype.remove=function(t,e,n){return this.tree.remove({low:t,high:e,data:n})},t.prototype.search=function(t,e){return this.tree.search(t,e).map(function(t){return t.data})},t.prototype.inOrder=function(){return this.tree.inOrder()},t.prototype.preOrder=function(){return this.tree.preOrder()},Object.defineProperty(t.prototype,"count",{get:function(){return this.tree.count},enumerable:!0,configurable:!0}),t}();e.Ay=a;var l=function(){function t(t){this.stack=[],void 0!==t&&this.push(t)}return t.prototype.next=function(){return void 0===this.currentNode?{done:!0,value:void 0}:this.i<this.currentNode.records.length?{done:!1,value:this.currentNode.records[this.i++]}:(void 0!==this.currentNode.right?this.push(this.currentNode.right):this.pop(),this.next())},t.prototype.push=function(t){for(this.currentNode=t,this.i=0;void 0!==this.currentNode.left;)this.stack.push(this.currentNode),this.currentNode=this.currentNode.left},t.prototype.pop=function(){this.currentNode=this.stack.pop(),this.i=0},t}();"function"==typeof Symbol&&(l.prototype[Symbol.iterator]=function(){return this});var c=function(){function t(t){this.stack=[],this.i=0,this.currentNode=t}return t.prototype.next=function(){return void 0===this.currentNode?{done:!0,value:void 0}:this.i<this.currentNode.records.length?{done:!1,value:this.currentNode.records[this.i++]}:(void 0!==this.currentNode.right&&this.push(this.currentNode.right),void 0!==this.currentNode.left&&this.push(this.currentNode.left),this.pop(),this.next())},t.prototype.push=function(t){this.stack.push(t)},t.prototype.pop=function(){this.currentNode=this.stack.pop(),this.i=0},t}();"function"==typeof Symbol&&(c.prototype[Symbol.iterator]=function(){return this})},814:t=>{"use strict";t.exports=e},833:t=>{t.exports=function(t,e,n,i){var r=n?n.call(i,t,e):void 0;if(void 0!==r)return!!r;if(t===e)return!0;if("object"!=typeof t||!t||"object"!=typeof e||!e)return!1;var o=Object.keys(t),s=Object.keys(e);if(o.length!==s.length)return!1;for(var a=Object.prototype.hasOwnProperty.bind(e),l=0;l<o.length;l++){var c=o[l];if(!a(c))return!1;var h=t[c],u=e[c];if(!1===(r=n?n.call(i,h,u,c):void 0)||void 0===r&&h!==u)return!1}return!0}}},i={};function r(t){var e=i[t];if(void 0!==e)return e.exports;var o=i[t]={exports:{}};return n[t](o,o.exports,r),o.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var o={};return(()=>{"use strict";r.r(o),r.d(o,{BooleanItemBrick:()=>z,CheckItemBrick:()=>j,CheckboxItemBrick:()=>K,CompositeBrick:()=>u,CustomBrick:()=>Tt,DocController:()=>N,DocOptions:()=>I,DrawCanvas:()=>W,DropdownBrick:()=>et,EmptyBrick:()=>E,EventHandler:()=>H,FlatBoolean:()=>X,FlatCheckbox:()=>Z,FlatComment:()=>tt,FlatCustomModel:()=>$,FlatDropdown:()=>nt,FlatExpression:()=>it,FlatFile:()=>rt,FlatHTML:()=>ot,FlatImage:()=>st,FlatImagePicker:()=>at,FlatMatrix:()=>mt,FlatMatrixDynamic:()=>bt,FlatMatrixMultiple:()=>vt,FlatMultipleText:()=>xt,FlatPanelDynamic:()=>lt,FlatQuestion:()=>x,FlatQuestionDefault:()=>T,FlatRadiogroup:()=>Y,FlatRanking:()=>ut,FlatRating:()=>ft,FlatRepository:()=>F,FlatSelectBase:()=>U,FlatSignaturePad:()=>pt,FlatSlider:()=>dt,FlatSurvey:()=>y,FlatTextbox:()=>gt,HTMLBrick:()=>O,HorizontalAlign:()=>B,ImageBrick:()=>P,LinkBrick:()=>C,PagePacker:()=>k,PdfBrick:()=>v,RadioItemBrick:()=>V,RankingItemBrick:()=>ct,RowlineBrick:()=>f,SurveyHelper:()=>L,SurveyPDF:()=>D,TextBoldBrick:()=>_,TextBrick:()=>b,TextFieldBrick:()=>S,TitlePanelBrick:()=>R,VerticalAlign:()=>A});var t={};r.r(t),r.d(t,{BooleanItemBrick:()=>z,CheckItemBrick:()=>j,CheckboxItemBrick:()=>K,CompositeBrick:()=>u,CustomBrick:()=>Tt,DocController:()=>N,DocOptions:()=>I,DrawCanvas:()=>W,DropdownBrick:()=>et,EmptyBrick:()=>E,EventHandler:()=>H,FlatBoolean:()=>X,FlatCheckbox:()=>Z,FlatComment:()=>tt,FlatCustomModel:()=>$,FlatDropdown:()=>nt,FlatExpression:()=>it,FlatFile:()=>rt,FlatHTML:()=>ot,FlatImage:()=>st,FlatImagePicker:()=>at,FlatMatrix:()=>mt,FlatMatrixDynamic:()=>bt,FlatMatrixMultiple:()=>vt,FlatMultipleText:()=>xt,FlatPanelDynamic:()=>lt,FlatQuestion:()=>x,FlatQuestionDefault:()=>T,FlatRadiogroup:()=>Y,FlatRanking:()=>ut,FlatRating:()=>ft,FlatRepository:()=>F,FlatSelectBase:()=>U,FlatSignaturePad:()=>pt,FlatSlider:()=>dt,FlatSurvey:()=>y,FlatTextbox:()=>gt,HTMLBrick:()=>O,HorizontalAlign:()=>B,ImageBrick:()=>P,LinkBrick:()=>C,PagePacker:()=>k,PdfBrick:()=>v,RadioItemBrick:()=>V,RankingItemBrick:()=>ct,RowlineBrick:()=>f,SurveyHelper:()=>L,SurveyPDF:()=>D,TextBoldBrick:()=>_,TextBrick:()=>b,TextFieldBrick:()=>S,TitlePanelBrick:()=>R,VerticalAlign:()=>A});var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},e(t,n)};function n(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}var i=function(){return i=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},i.apply(this,arguments)};function s(t,e,n,i){return new(n||(n=Promise))(function(r,o){function s(t){try{l(i.next(t))}catch(t){o(t)}}function a(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(s,a)}l((i=i.apply(t,e||[])).next())})}function a(t,e){var n,i,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,i=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((r=(r=s.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){s.label=o[1];break}if(6===o[0]&&s.label<r[1]){s.label=r[1],r=o;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(o);break}r[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}function l(t,e,n){if(n||2===arguments.length)for(var i,r=0,o=e.length;r<o;r++)!i&&r in e||(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))}var c=r(156),h=r(814),u=function(){function t(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.bricks=[],this.isPageBreak=!1,this._xLeft=0,this._xRight=0,this._yTop=0,this._yBot=0,this.addBrick.apply(this,t)}return Object.defineProperty(t.prototype,"xLeft",{get:function(){return this._xLeft},set:function(t){this.shift(t-this.xLeft,0,0,0),this._xLeft=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"xRight",{get:function(){return this._xRight},set:function(t){this.shift(0,t-this.xRight,0,0),this._xRight=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"yTop",{get:function(){return this._yTop},set:function(t){this.shift(0,0,t-this.yTop,0),this._yTop=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"yBot",{get:function(){return this._yBot},set:function(t){this.shift(0,0,0,t-this.yBot),this._yBot=t},enumerable:!1,configurable:!0}),t.prototype.shift=function(t,e,n,i){this.bricks.forEach(function(r){r.xLeft+=t,r.xRight+=e,r.yTop+=n,r.yBot+=i})},Object.defineProperty(t.prototype,"width",{get:function(){return this.xRight-this.xLeft},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.yBot-this.yTop},enumerable:!1,configurable:!0}),t.prototype.render=function(){return s(this,void 0,void 0,function(){var t;return a(this,function(e){switch(e.label){case 0:t=0,e.label=1;case 1:return t<this.bricks.length?[4,this.bricks[t].render()]:[3,4];case 2:e.sent(),e.label=3;case 3:return t++,[3,1];case 4:return[2]}})})},Object.defineProperty(t.prototype,"isEmpty",{get:function(){return 0===this.bricks.length},enumerable:!1,configurable:!0}),t.prototype.addBrick=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if(0!=e.length){(t=this.bricks).push.apply(t,e);var i=L.mergeRects.apply(L,this.bricks);this._xLeft=i.xLeft,this._xRight=i.xRight,this._yTop=i.yTop,this._yBot=i.yBot}},t.prototype.unfold=function(){var t=[];return this.bricks.forEach(function(e){t.push.apply(t,e.unfold())}),t},t.prototype.translateX=function(t){this.bricks.forEach(function(e){return e.translateX(t)});var e=t(this.xLeft,this.xRight);this._xLeft=e.xLeft,this._xRight=e.xRight},t}(),f=function(){function t(t,e,n){this.controller=t,this.color=n,this.isPageBreak=!1,this.xLeft=e.xLeft,this.xRight=e.xRight,this.yTop=e.yTop,this.yBot=e.yBot}return Object.defineProperty(t.prototype,"width",{get:function(){return this.xRight-this.xLeft},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.yBot-this.yTop},enumerable:!1,configurable:!0}),t.prototype.render=function(){return s(this,void 0,void 0,function(){var t;return a(this,function(e){return null!==this.color&&(t=this.controller.doc.getDrawColor(),this.controller.doc.setDrawColor(this.color),this.controller.doc.line(this.xLeft,this.yTop,this.xRight,this.yTop),this.controller.doc.setDrawColor(t)),[2]})})},t.prototype.unfold=function(){return[this]},t.prototype.translateX=function(t){},t}(),d=function(t,e,n,i,r){this.point=t,this.bricks=e,this.controller=n,this.repository=i,this.module=r},p=function(t){function e(e,n,i,r,o,s){var a=t.call(this,e,n,r,o,s)||this;return a.question=i,a}return n(e,t),e}(d),g=function(t){function e(e,n,i,r,o,s){var a=t.call(this,e,n,r,o,s)||this;return a.panel=i,a}return n(e,t),e}(d),m=function(t){function e(e,n,i,r,o,s){var a=t.call(this,e,n,r,o,s)||this;return a.page=i,a}return n(e,t),e}(d),y=function(){function e(){}return e.generateFlatsPanel=function(e,n,i,r){return s(this,void 0,void 0,function(){var o,s,c,h,u,f;return a(this,function(a){switch(a.label){case 0:return o=[],s=L.clone(r),n.pushMargins(),n.margins.left+=n.measureText(i.innerIndent).width,s.xLeft+=n.measureText(i.innerIndent).width,h=(c=o.push).apply,u=[o],[4,this.generateFlatsPagePanel(e,n,i,s)];case 1:return h.apply(c,u.concat([a.sent()])),n.popMargins(),f=new g(r,o,i,n,F.getInstance(),t),[4,e.onRenderPanel.fire(e,f)];case 2:return a.sent(),[2,l([],f.bricks,!0)]}})})},e.generateFlatsPagePanel=function(t,n,i,r){return s(this,void 0,void 0,function(){var o,s,l,h,f,d,p,g,m,y,v,b,x,T,F,_,R,w,C,O,P,E,S;return a(this,function(a){switch(a.label){case 0:return i.isVisible?(i.onFirstRendering(),o=[],s=L.clone(r),"page"!==i.getType()||t.showPageTitles?(l=new u,i.title?i instanceof c.PanelModel&&i.no?[4,L.createTitlePanelFlat(s,n,i.no,"page"===i.getType())]:[3,2]:[3,4]):[3,7]):[2];case 1:h=a.sent(),l.addBrick(h),s.xLeft=h.xRight+n.measureText(" ").width,a.label=2;case 2:return[4,L.createTitlePanelFlat(s,n,i.locTitle,"page"===i.getType())];case 3:f=a.sent(),l.addBrick(f),s=L.createPoint(f),a.label=4;case 4:return i.description?(i.title&&(s.yTop+=n.unitWidth*e.PANEL_DESC_GAP_SCALE),[4,L.createDescFlat(s,null,n,i.locDescription)]):[3,6];case 5:d=a.sent(),l.addBrick(d),s=L.createPoint(d),a.label=6;case 6:l.isEmpty||(p=L.createPoint(l),l.addBrick(L.createRowlineFlat(p,n)),o.push(l),s.yTop+=n.unitHeight*e.PANEL_CONT_GAP_SCALE+L.EPSILON),a.label=7;case 7:g=0,m=i.rows,a.label=8;case 8:if(!(g<m.length))return[3,17];if(!(y=m[g]).visible)return[3,16];n.pushMargins(),v=L.getPageAvailableWidth(n),b=n.margins.left,x=[],T=y.elements.filter(function(t){return t.isVisible}),F=0,a.label=9;case 9:return F<T.length?(_=T[F]).isVisible?(R=L.parseWidth(_.renderWidth,v-(T.length-1)*n.unitWidth,T.length),n.margins.left=b+(0!==F?n.unitWidth:0),n.margins.right=n.paperWidth-n.margins.left-R,s.xLeft=n.margins.left,b=n.margins.left+R,_ instanceof c.PanelModel?(C=(w=x.push).apply,O=[x],[4,this.generateFlatsPanel(t,n,_,s)]):[3,11]):[3,14]:[3,15];case 10:return C.apply(w,O.concat([a.sent()])),[3,14];case 11:return[4,_.waitForQuestionIsReady()];case 12:return a.sent(),E=(P=x.push).apply,S=[x],[4,L.generateQuestionFlats(t,n,_,s)];case 13:E.apply(P,S.concat([a.sent()])),a.label=14;case 14:return F++,[3,9];case 15:n.popMargins(),s.xLeft=n.margins.left,0!==x.length&&(s.yTop=L.mergeRects.apply(L,x).yBot,s.xLeft=r.xLeft,s.yTop+=n.unitHeight*e.QUES_GAP_VERT_SCALE,o.push.apply(o,x),o.push(L.createRowlineFlat(s,n)),s.yTop+=L.EPSILON),a.label=16;case 16:return g++,[3,8];case 17:return[2,o]}})})},e.popRowlines=function(t){for(;t.length>0&&t[t.length-1]instanceof f;)t.pop()},e.generateFlatTitle=function(t,n,i){return s(this,void 0,void 0,function(){var r,o,s,l;return a(this,function(a){switch(a.label){case 0:return r=new u,t.showTitle?t.title?[4,L.createTitleSurveyFlat(i,n,t.locTitle)]:[3,2]:[3,4];case 1:o=a.sent(),r.addBrick(o),i=L.createPoint(o),a.label=2;case 2:return t.description?(t.title&&(i.yTop+=n.unitWidth*e.PANEL_DESC_GAP_SCALE),l=(s=r).addBrick,[4,L.createDescFlat(i,null,n,t.locDescription)]):[3,4];case 3:l.apply(s,[a.sent()]),a.label=4;case 4:return[2,r]}})})},e.generateFlatLogoImage=function(t,e,n){return s(this,void 0,void 0,function(){var i,r,o,s;return a(this,function(a){switch(a.label){case 0:return i=L.getLocString(t.locLogo),[4,L.getCorrectedImageSize(e,{imageLink:i,imageHeight:t.logoHeight,imageWidth:t.logoWidth,defaultImageWidth:"300px",defaultImageHeight:"200px"})];case 1:return r=a.sent(),[4,L.createImageFlat(n,null,e,{link:i,width:r.width,height:r.height})];case 2:return o=a.sent(),s=0,"right"===t.logoPosition?s=L.getPageAvailableWidth(e)-o.width:"left"!==t.logoPosition&&(s=L.getPageAvailableWidth(e)/2-o.width/2),o.xLeft+=s,o.xRight+=s,[2,o]}})})},e.generateFlats=function(n,i){return s(this,void 0,void 0,function(){var r,o,s,c,h,u,f,d,p,g,y,v,b;return a(this,function(a){switch(a.label){case 0:return r=[],n.hasLogo?[3,2]:[4,this.generateFlatTitle(n,i,i.leftTopPoint)];case 1:return(s=a.sent()).isEmpty||r.push([s]),[3,11];case 2:return n.isLogoBefore?[4,this.generateFlatLogoImage(n,i,i.leftTopPoint)]:[3,5];case 3:return h=a.sent(),r.push([h]),o=L.createPoint(h,"top"===n.logoPosition,"top"!==n.logoPosition),"top"!==n.logoPosition?(i.pushMargins(),o.xLeft+=i.unitWidth,i.margins.left+=h.width+i.unitWidth):(o.xLeft=i.leftTopPoint.xLeft,o.yTop+=i.unitHeight/2),[4,this.generateFlatTitle(n,i,o)];case 4:return s=a.sent(),"top"!==n.logoPosition&&i.popMargins(),s.isEmpty||r[0].push(s),[3,11];case 5:return"right"!==n.logoPosition?[3,8]:[4,this.generateFlatLogoImage(n,i,i.leftTopPoint)];case 6:return h=a.sent(),r.push([h]),i.pushMargins(),i.margins.right+=h.width+i.unitWidth,[4,this.generateFlatTitle(n,i,i.leftTopPoint)];case 7:return(s=a.sent()).isEmpty||r[0].unshift(s),i.popMargins(),[3,11];case 8:return[4,this.generateFlatTitle(n,i,i.leftTopPoint)];case 9:return s=a.sent(),c=i.leftTopPoint,s.isEmpty||(r.push([s]),(c=L.createPoint(s)).yTop+=i.unitHeight/2),[4,this.generateFlatLogoImage(n,i,c)];case 10:h=a.sent(),0!==r.length?r[0].push(h):r.push([h]),a.label=11;case 11:u=i.leftTopPoint,0!==r.length&&(u.yTop=L.createPoint(L.mergeRects.apply(L,r[0])).yTop,r[0].push(L.createRowlineFlat(u,i)),u.yTop+=i.unitHeight*e.PANEL_CONT_GAP_SCALE+L.EPSILON),f=0,a.label=12;case 12:return f<n.visiblePages.length?(n.currentPage=n.visiblePages[f],g=(p=(d=[]).push).apply,y=[d],[4,this.generateFlatsPagePanel(n,i,n.visiblePages[f],u)]):[3,16];case 13:return g.apply(p,y.concat([a.sent()])),v=new m(u,d,n.visiblePages[f],i,F.getInstance(),t),[4,n.onRenderPage.fire(n,v)];case 14:a.sent(),d=l([],v.bricks,!0),0===f&&0!==r.length?(b=r[0]).push.apply(b,d):r.push(d),this.popRowlines(r[r.length-1]),u.yTop=i.leftTopPoint.yTop,a.label=15;case 15:return f++,[3,12];case 16:return[2,r]}})})},e.QUES_GAP_VERT_SCALE=1.5,e.PANEL_CONT_GAP_SCALE=1,e.PANEL_DESC_GAP_SCALE=.25,e}(),v=function(){function t(t,e,n){this.question=t,this.controller=e,this.textColor=L.TEXT_COLOR,this.formBorderColor=L.FORM_BORDER_COLOR,this.isPageBreak=!1,this.xLeft=n.xLeft,this.xRight=n.xRight,this.yTop=n.yTop,this.yBot=n.yBot,this.fontSize=e?e.fontSize:N.FONT_SIZE}return Object.defineProperty(t.prototype,"xLeft",{get:function(){return this._xLeft},set:function(t){this.setXLeft(t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"xRight",{get:function(){return this._xRight},set:function(t){this.setXRight(t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"yTop",{get:function(){return this._yTop},set:function(t){this.setYTop(t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"yBot",{get:function(){return this._yBot},set:function(t){this.setYBottom(t)},enumerable:!1,configurable:!0}),t.prototype.translateX=function(t){var e=t(this.xLeft,this.xRight);this.xLeft=e.xLeft,this.xRight=e.xRight},Object.defineProperty(t.prototype,"width",{get:function(){return this.xRight-this.xLeft},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.yBot-this.yTop},enumerable:!1,configurable:!0}),t.prototype.getShouldRenderReadOnly=function(){return L.shouldRenderReadOnly(this.question,this.controller)},t.prototype.render=function(){return s(this,void 0,void 0,function(){return a(this,function(t){switch(t.label){case 0:return this.getShouldRenderReadOnly()?[4,this.renderReadOnly()]:[3,2];case 1:return t.sent(),[3,4];case 2:return[4,this.renderInteractive()];case 3:t.sent(),t.label=4;case 4:return this.afterRenderCallback&&this.afterRenderCallback(),[2]}})})},t.prototype.renderInteractive=function(){return s(this,void 0,void 0,function(){return a(this,function(t){return[2]})})},t.prototype.renderReadOnly=function(){return s(this,void 0,void 0,function(){return a(this,function(t){switch(t.label){case 0:return[4,this.renderInteractive()];case 1:return t.sent(),[2]}})})},t.prototype.unfold=function(){return[this]},t.prototype.getCorrectedText=function(t){return this.controller.isRTL?(t||"").split("").reverse().join(""):t},t.prototype.setXLeft=function(t){this._xLeft=t},t.prototype.setXRight=function(t){this._xRight=t},t.prototype.setYTop=function(t){this._yTop=t},t.prototype.setYBottom=function(t){this._yBot=t},t}(),b=function(t){function e(e,n,i,r){var o=t.call(this,e,n,i)||this;return o.text=r,o.align={isInputRtl:!1,isOutputRtl:n.isRTL,align:n.isRTL?"right":"left",baseline:"middle"},o}return n(e,t),e.prototype.escapeText=function(){for(;this.text.indexOf("\t")>-1;)this.text=this.text.replace("\t",Array(5).join(String.fromCharCode(160)));return this.text},e.prototype.renderInteractive=function(){return s(this,void 0,void 0,function(){var t,e,n;return a(this,function(i){return t=this.alignPoint(this),e=this.controller.fontSize,this.controller.fontSize=this.fontSize,n=this.controller.doc.getTextColor(),this.controller.doc.setTextColor(this.textColor),this.controller.doc.text(this.escapeText(),t.xLeft,t.yTop,this.align),this.controller.doc.setTextColor(n),this.controller.fontSize=e,[2]})})},e.prototype.alignPoint=function(t){return{xLeft:this.controller.isRTL?t.xRight:t.xLeft,yTop:t.yTop+(t.yBot-t.yTop)/2}},e}(v),x=function(){function t(t,e,n){this.survey=t,this.controller=n,this.question=e}return t.prototype.generateFlatTitle=function(t){return s(this,void 0,void 0,function(){return a(this,function(e){switch(e.label){case 0:return[4,L.createTitleFlat(t,this.question,this.controller)];case 1:return[2,e.sent()]}})})},t.prototype.generateFlatDescription=function(t){return s(this,void 0,void 0,function(){return a(this,function(e){switch(e.label){case 0:return[4,L.createDescFlat(t,this.question,this.controller,this.question.locDescription)];case 1:return[2,e.sent()]}})})},t.prototype.generateFlatHeader=function(e){return s(this,void 0,void 0,function(){var n,i,r,o,s;return a(this,function(a){switch(a.label){case 0:return[4,this.generateFlatTitle(e)];case 1:return n=a.sent(),i=new u(n),this.question.hasDescriptionUnderTitle?((r=L.createPoint(n,!0,!1)).yTop+=t.DESC_GAP_SCALE*this.controller.unitHeight,r.xLeft+=this.controller.unitWidth*t.CONTENT_INDENT_SCALE,s=(o=i).addBrick,[4,this.generateFlatDescription(r)]):[3,3];case 2:s.apply(o,[a.sent()]),a.label=3;case 3:return[2,i]}})})},t.prototype.generateFlatsComment=function(t){return s(this,void 0,void 0,function(){var e,n,i,r,o;return a(this,function(s){switch(s.label){case 0:return e=this.question.locCommentText,[4,L.createTextFlat(t,this.question,this.controller,e,b)];case 1:return n=s.sent(),(i=L.createPoint(n)).yTop+=this.controller.unitHeight*L.GAP_BETWEEN_ROWS,r=u.bind,o=[void 0,n],[4,L.createCommentFlat(i,this.question,this.controller,{fieldName:this.question.id+"_comment",rows:L.OTHER_ROWS_COUNT,value:void 0!==this.question.comment&&null!==this.question.comment?this.question.comment:"",shouldRenderBorders:"textarea"===c.settings.readOnlyCommentRenderMode,isReadOnly:this.question.isReadOnly,isMultiline:!0,placeholder:""})];case 2:return[2,new(r.apply(u,o.concat([s.sent()])))]}})})},t.prototype.generateFlatsComposite=function(t){return s(this,void 0,void 0,function(){var e;return a(this,function(n){switch(n.label){case 0:return(e=this.question.contentPanel)?[4,y.generateFlatsPanel(this.survey,this.controller,e,t)]:[3,2];case 1:case 3:return[2,n.sent()];case 2:return this.question=L.getContentQuestion(this.question),[4,this.generateFlatsContent(t)]}})})},t.prototype.generateFlatsContent=function(t){return s(this,void 0,void 0,function(){return a(this,function(t){return[2,null]})})},t.prototype.generateFlatsContentWithOptionalElements=function(t){return s(this,void 0,void 0,function(){var e,n,i,r,o,s,l,c=this;return a(this,function(a){switch(a.label){case 0:return e=[],[4,this.generateFlatsComposite(t)];case 1:return n=a.sent(),e.push.apply(e,n),i=function(){var i=L.clone(t);return null!==n&&0!==n.length&&(i.yTop=L.mergeRects.apply(L,e).yBot+c.controller.unitHeight*L.GAP_BETWEEN_ROWS),i},this.question.hasComment?(o=(r=e).push,[4,this.generateFlatsComment(i())]):[3,3];case 2:o.apply(r,[a.sent()]),a.label=3;case 3:return this.question.hasDescriptionUnderInput?(l=(s=e).push,[4,this.generateFlatDescription(i())]):[3,5];case 4:l.apply(s,[a.sent()]),a.label=5;case 5:return[2,e]}})})},t.prototype.generateFlats=function(e){return s(this,void 0,void 0,function(){var n,i,r,o,s,l,c,h,u,f,d,p;return a(this,function(a){switch(a.label){case 0:switch(this.controller.pushMargins(),this.controller.margins.left+=this.controller.measureText(this.question.indent).width,n={xLeft:e.xLeft+this.controller.measureText(this.question.indent).width,yTop:e.yTop},i=[],r=this.question.getTitleLocation(),r=this.question.hasTitle?r:"hidden"){case"top":case"default":return[3,1];case"bottom":return[3,4];case"left":return[3,7];case"hidden":case L.TITLE_LOCATION_MATRIX:return[3,10]}return[3,10];case 1:return[4,this.generateFlatHeader(n)];case 2:return c=a.sent(),(u=L.createPoint(c)).xLeft+=this.controller.unitWidth*t.CONTENT_INDENT_SCALE,c.addBrick(L.createRowlineFlat(L.createPoint(c),this.controller)),u.yTop+=this.controller.unitHeight*t.CONTENT_GAP_VERT_SCALE+L.EPSILON,this.controller.pushMargins(),this.controller.margins.left+=this.controller.unitWidth*t.CONTENT_INDENT_SCALE,[4,this.generateFlatsContentWithOptionalElements(u)];case 3:return h=a.sent(),this.controller.popMargins(),null!==h&&0!==h.length&&c.addBrick(h.shift()),i.push(c),i.push.apply(i,h),[3,12];case 4:return u=L.clone(n),this.controller.pushMargins(),u.xLeft+=this.controller.unitWidth*t.CONTENT_INDENT_SCALE,this.controller.margins.left+=this.controller.unitWidth*t.CONTENT_INDENT_SCALE,[4,this.generateFlatsContentWithOptionalElements(u)];case 5:return h=a.sent(),this.controller.popMargins(),i.push.apply(i,h),o=n,0!==i.length&&(o.yTop=i[i.length-1].yBot),o.yTop+=this.controller.unitHeight*t.CONTENT_GAP_VERT_SCALE,l=(s=i).push,[4,this.generateFlatHeader(o)];case 6:return l.apply(s,[a.sent()]),[3,12];case 7:return this.controller.pushMargins(this.controller.margins.left,this.controller.paperWidth-this.controller.margins.left-L.getPageAvailableWidth(this.controller)*L.MULTIPLETEXT_TEXT_PERS),[4,this.generateFlatHeader(n)];case 8:return c=a.sent(),u=L.createPoint(c,!1,!0),this.controller.popMargins(),u.xLeft+=this.controller.unitWidth*t.CONTENT_GAP_HOR_SCALE,this.controller.margins.left=u.xLeft,[4,this.generateFlatsContentWithOptionalElements(u)];case 9:return null!==(h=a.sent())&&0!==h.length&&c.addBrick(h.shift()),i.push(c),i.push.apply(i,h),[3,12];case 10:return u=L.clone(n),this.controller.pushMargins(),r!==L.TITLE_LOCATION_MATRIX&&(u.xLeft+=this.controller.unitWidth*t.CONTENT_INDENT_SCALE,this.controller.margins.left+=this.controller.unitWidth*t.CONTENT_INDENT_SCALE),d=(f=i.push).apply,p=[i],[4,this.generateFlatsContentWithOptionalElements(u)];case 11:return d.apply(f,p.concat([a.sent()])),this.controller.popMargins(),[3,12];case 12:return this.controller.popMargins(),[2,i]}})})},Object.defineProperty(t.prototype,"shouldRenderAsComment",{get:function(){return L.shouldRenderReadOnly(this.question,this.controller)},enumerable:!1,configurable:!0}),t.CONTENT_GAP_VERT_SCALE=.5,t.CONTENT_GAP_HOR_SCALE=1,t.CONTENT_INDENT_SCALE=1,t.DESC_GAP_SCALE=.0625,t}();c.Serializer.addProperty("question",{name:"readonlyRenderAs",default:"auto",choices:["auto","text","acroform"],visible:!1});var T=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.generateFlatsContent=function(t){return s(this,void 0,void 0,function(){return a(this,function(e){switch(e.label){case 0:return[4,L.createTextFlat(t,this.question,this.controller,"".concat(this.question.displayValue),b)];case 1:return[2,[e.sent()]]}})})},e}(x),F=function(){function t(){this.questions={}}return t.getInstance=function(){return t.instance},t.prototype.register=function(t,e){this.questions[t]=e},t.prototype.isTypeRegistered=function(t){return!!this.questions[t]},t.prototype.getRenderer=function(t){return this.questions[t]},t.prototype.create=function(t,e,n,i){var r,o=void 0===i?e.getType():i,s=this.getRenderer(o);return s||(s=(null===(r=e.customWidget)||void 0===r?void 0:r.pdfRender)?x:T),new s(t,e,n)},t.register=function(t,e){this.getInstance().register(t,e)},t.getRenderer=function(t){return this.getInstance().getRenderer(t)},t.instance=new t,t}(),_=function(t){function e(e,n,i,r){return t.call(this,e,n,i,r)||this}return n(e,t),e.prototype.renderInteractive=function(){return s(this,void 0,void 0,function(){return a(this,function(e){switch(e.label){case 0:return this.controller.fontStyle="bold",[4,t.prototype.renderInteractive.call(this)];case 1:return e.sent(),this.controller.fontStyle="normal",[2]}})})},e}(b),R=function(t){function e(e,n,i,r){return t.call(this,e,n,i,r)||this}return n(e,t),e.prototype.renderInteractive=function(){return s(this,void 0,void 0,function(){var e;return a(this,function(n){switch(n.label){case 0:return e=this.controller.fontSize,this.controller.fontSize=e*L.TITLE_PANEL_FONT_SIZE_SCALE,[4,t.prototype.renderInteractive.call(this)];case 1:return n.sent(),this.controller.fontSize=e,[2]}})})},e}(_),w=function(t){function e(e,n,i,r){return t.call(this,e,n,i,r)||this}return n(e,t),e}(b),C=function(t){function e(n,i){var r=t.call(this,n.question,n.controller,n,n.text)||this;return r.link=i,r.textColor=e.COLOR,r}return n(e,t),e.prototype.renderInteractive=function(){return s(this,void 0,void 0,function(){var n,i,r;return a(this,function(o){switch(o.label){case 0:return n=this.controller.doc.getTextColor(),this.controller.doc.setTextColor(L.BACKGROUND_COLOR),i=this.controller.unitHeight*(this.controller.doc.getLineHeightFactor()-e.SCALE_FACTOR_MAGIC),r=this.yTop+(this.yBot-this.yTop)-i,this.controller.doc.textWithLink(this.text,this.xLeft,r,{url:this.link}),[4,t.prototype.renderInteractive.call(this)];case 1:return o.sent(),this.controller.doc.setTextColor(n),[2]}})})},e.prototype.renderReadOnly=function(){return s(this,void 0,void 0,function(){return a(this,function(e){switch(e.label){case 0:return"text"!==L.getReadonlyRenderAs(this.question,this.controller)?[2,this.renderInteractive()]:[4,t.prototype.renderInteractive.call(this)];case 1:return e.sent(),[2]}})})},e.SCALE_FACTOR_MAGIC=.955,e.COLOR="#0000EE",e}(b),O=function(t){function e(e,n,i,r,o){void 0===o&&(o=!1);var s=t.call(this,e,n,i)||this;return s.html=r,s.margins=o?{top:0,bottom:0}:{top:n.margins.top,bottom:n.margins.bot},s}return n(e,t),e.prototype.renderInteractive=function(){return s(this,void 0,void 0,function(){var t,e=this;return a(this,function(n){switch(n.label){case 0:return t=this.controller.fontSize,this.controller.fontSize=this.fontSize,[4,new Promise(function(t){e.controller.doc.fromHTML(e.html,e.xLeft,e.yTop,{width:e.width,pagesplit:!0},function(){[].slice.call(document.querySelectorAll(".sjs-pdf-hidden-html-div")).forEach(function(t){t.parentNode.removeChild(t)}),t()},e.margins)})];case 1:return n.sent(),this.controller.fontSize=t,[2]}})})},e}(v),P=function(t){function e(e,n,i,r,o,s){var a=t.call(this,e,n,{xLeft:r.xLeft,xRight:r.xLeft+(o||0),yTop:r.yTop,yBot:r.yTop+(s||0)})||this;return a.image=i,a.originalWidth=o,a.originalHeight=s,a.isPageBreak=void 0===a.originalHeight,a}return n(e,t),e.prototype.renderInteractive=function(){return s(this,void 0,void 0,function(){var t=this;return a(this,function(e){switch(e.label){case 0:return[4,new Promise(function(e){try{t.controller.doc.addImage(t.image,"PNG",t.xLeft,t.yTop,t.originalWidth,t.originalHeight)}finally{e()}})];case 1:return e.sent(),[2]}})})},e}(v),E=function(t){function e(e,n,i){void 0===n&&(n=null),void 0===i&&(i=!1);var r=t.call(this,null,n,e)||this;return r.controller=n,r.isBorderVisible=!1,r.isBorderVisible=i,r}return n(e,t),e.prototype.resizeBorder=function(t){var e=t?1:-1,n=this.controller.doc.getFontSize()*L.VALUE_READONLY_PADDING_SCALE;this.xLeft-=e*n,this.xRight+=e*n,this.yBot+=e*n},e.prototype.renderInteractive=function(){return s(this,void 0,void 0,function(){return a(this,function(t){return this.isBorderVisible&&(this.resizeBorder(!0),L.renderFlatBorders(this.controller,this),this.resizeBorder(!1)),[2]})})},e}(v),S=function(t){function e(e,n,i,r){var o,s,a,l,c=t.call(this,e,n,i)||this;return c.question=e,c.options=r,r.isMultiline=null!==(o=r.isMultiline)&&void 0!==o&&o,r.placeholder=null!==(s=r.placeholder)&&void 0!==s?s:"",r.inputType=null!==(a=r.inputType)&&void 0!==a?a:"",r.value=null!==(l=r.value)&&void 0!==l?l:"",c.question=e,c}return n(e,t),e.prototype.renderColorQuestion=function(){var t=this.controller.doc.getFillColor();this.controller.doc.setFillColor(this.question.value||"black"),this.controller.doc.rect(this.xLeft,this.yTop,this.width,this.height,"F"),this.controller.doc.setFillColor(t)},e.prototype.renderInteractive=function(){return s(this,void 0,void 0,function(){var t,e;return a(this,function(n){return"color"===this.options.inputType?(this.renderColorQuestion(),[2]):((t="password"===this.options.inputType?new this.controller.doc.AcroFormPasswordField:new this.controller.doc.AcroFormTextField).fieldName=this.options.fieldName,t.fontName=this.controller.fontName,t.fontSize=this.fontSize,t.isUnicode=L.isCustomFont(this.controller,t.fontName),"password"!==this.options.inputType?(t.V=" "+this.getCorrectedText(this.options.value),t.DV=" "+this.getCorrectedText(this.options.placeholder)):t.value="",t.multiline=this.options.isMultiline,t.readOnly=this.options.isReadOnly,t.color=this.textColor,e=L.formScale(this.controller,this),t.maxFontSize=this.controller.fontSize*e,t.Rect=L.createAcroformRect(L.scaleRect(this,e)),this.controller.doc.addField(t),L.renderFlatBorders(this.controller,this),[2])})})},e.prototype.shouldRenderFlatBorders=function(){return this.options.shouldRenderBorders},e.prototype.getShouldRenderReadOnly=function(){return L.shouldRenderReadOnly(this.question,this.controller,this.options.isReadOnly)},Object.defineProperty(e.prototype,"textBrick",{get:function(){return this._textBrick},set:function(t){var e=this;this._textBrick=t;var n=t.unfold(),i=n.length,r=0,o={},s=function(t){if(e.shouldRenderFlatBorders()){r++;var n=e.controller.getCurrentPageIndex();if(o[n]||(o[n]=[]),o[n].push(t),r>=i){var s=Object.keys(o),a=1==s.length;s.forEach(function(t){var i=new u;o[t].forEach(function(t){i.addBrick(t)});var r=e.controller.unitHeight*L.VALUE_READONLY_PADDING_SCALE,s={xLeft:e.xLeft,xRight:e.xRight,width:e.width,yTop:a?e.yTop:i.yTop-r,yBot:a?e.yBot:i.yBot+r,height:a?e.height:i.height+2*r,formBorderColor:e.formBorderColor};e.controller.setPage(Number(t)),L.renderFlatBorders(e.controller,s),e.controller.setPage(n)})}}};n.forEach(function(t){t.afterRenderCallback=s.bind(e,t)})},enumerable:!1,configurable:!0}),e.prototype.renderReadOnly=function(){return s(this,void 0,void 0,function(){return a(this,function(t){switch(t.label){case 0:return this.controller.pushMargins(this.xLeft,this.controller.paperWidth-this.xRight),"color"!==this.options.inputType?[3,1]:(this.renderColorQuestion(),[3,3]);case 1:return[4,this.textBrick.render()];case 2:t.sent(),t.label=3;case 3:return this.controller.popMargins(),[2]}})})},e.prototype.unfold=function(){return this.getShouldRenderReadOnly()&&"color"!==this.options.inputType?this.textBrick.unfold():t.prototype.unfold.call(this)},e.prototype.translateX=function(t){var e=t(this.xLeft,this.xRight);this._xLeft=e.xLeft,this._xRight=e.xRight,this.textBrick&&this.textBrick.translateX(t)},e.prototype.setXLeft=function(e){var n=e-this._xLeft;t.prototype.setXLeft.call(this,e),this.textBrick&&(this.textBrick.xLeft=this.textBrick.xLeft+n)},e.prototype.setXRight=function(e){var n=e-this._xRight;t.prototype.setXRight.call(this,e),this.textBrick&&(this.textBrick.xRight=this.textBrick.xRight+n)},e.prototype.setYTop=function(e){var n=e-this._yTop;t.prototype.setYTop.call(this,e),this.textBrick&&(this.textBrick.yTop=this.textBrick.yTop+n)},e.prototype.setYBottom=function(e){var n=e-this._yBot;t.prototype.setYBottom.call(this,e),this.textBrick&&(this.textBrick.yBot=this.textBrick.yBot+n)},e}(v),L=function(){function e(){}return e.parseWidth=function(t,e,n,i){if(void 0===n&&(n=1),0===t.indexOf("calc"))return e/n;var r,o=parseFloat(t);switch(t.replace(/[^A-Za-z%]/g,"")||i){case"pt":r=1;break;case"mm":r=72/25.4;break;case"cm":r=72/2.54;break;case"in":r=72;break;case"px":r=.75;break;case"pc":case"em":r=12;break;case"ex":r=6;break;default:r=e/100}return Math.min(o*r,e)},e.pxToPt=function(t){return"string"==typeof t?(isNaN(Number(t))||(t+="px"),e.parseWidth(t,Number.MAX_VALUE)):72*t/96},e.mergeRects=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n={xLeft:t[0].xLeft,xRight:t[0].xRight,yTop:t[0].yTop,yBot:t[0].yBot};return t.forEach(function(t){n.xLeft=Math.min(n.xLeft,t.xLeft),n.xRight=Math.max(n.xRight,t.xRight),n.yTop=Math.min(n.yTop,t.yTop),n.yBot=Math.max(n.yBot,t.yBot)}),n},e.createPoint=function(t,e,n){return void 0===e&&(e=!0),void 0===n&&(n=!1),{xLeft:e?t.xLeft:t.xRight,yTop:n?t.yTop:t.yBot}},e.createRect=function(t,e,n){return{xLeft:t.xLeft,xRight:t.xLeft+e,yTop:t.yTop,yBot:t.yTop+n}},e.createHeaderRect=function(t){return{xLeft:0,xRight:t.paperWidth,yTop:0,yBot:t.margins.top}},e.createFooterRect=function(t){return{xLeft:0,xRight:t.paperWidth,yTop:t.paperHeight-t.margins.bot,yBot:t.paperHeight}},e.chooseHtmlFont=function(t){return t.useCustomFontInHtml?t.fontName:this.STANDARD_FONT},e.generateCssTextRule=function(t,e,n){return'"font-size: '.concat(t,"pt; font-weight: ").concat(e,"; font-family: ").concat(n,"; color: ").concat(this.TEXT_COLOR,';"')},e.createHtmlContainerBlock=function(t,e,n){var i=this.chooseHtmlFont(e);return'<div class="__surveypdf_html" style='.concat(this.generateCssTextRule(e.fontSize,e.fontStyle,i),">")+"<style>.__surveypdf_html p { margin: 0; line-height: ".concat(e.fontSize,"pt } body { margin: 0; }</style>").concat(t,"</div>")},e.splitHtmlRect=function(t,e){var n=[],i=e.height,r=t.doc.getFontSize();e.yBot=e.yTop+r;var o=Math.floor(i/r)-1;n.push(e);for(var s=this.createPoint(e),a=0;a<o;a++)n.push(new E(this.createRect(s,e.width,r))),s.yTop+=r;var c=i-(o+1)*r;return c>0&&n.push(new E(this.createRect(s,e.width,c))),new(u.bind.apply(u,l([void 0],n,!1)))},e.createPlainTextFlat=function(t,e,n,i,r){var o=this,s=n.doc.splitTextToSize(i,n.paperWidth-n.margins.right-t.xLeft),a=this.clone(t),l=new u;return s.forEach(function(t){var i=n.measureText(t);l.addBrick(new r(e,n,o.createRect(a,i.width,i.height),t)),a.yTop+=i.height}),l},e.createTextFlat=function(t,e,n,i,r){return s(this,void 0,void 0,function(){var o,s;return a(this,function(a){switch(a.label){case 0:return"string"!=typeof i&&this.hasHtml(i)?[3,1]:[2,this.createPlainTextFlat(t,e,n,"string"==typeof i?i:this.getLocString(i),r)];case 1:return o=this.splitHtmlRect,s=[n],[4,this.createHTMLFlat(t,e,n,this.createHtmlContainerBlock(this.getLocString(i),n,"standard"))];case 2:return[2,o.apply(this,s.concat([a.sent()]))]}})})},e.hasHtml=function(t){var e=/<\/?[a-z][\s\S]*>/i;return t.hasHtml&&(e.test(t.renderedText)||e.test(t.renderedHtml))},e.getHtmlMargins=function(t,e){var n=t.paperWidth-e.xLeft-t.margins.right;return{top:t.margins.top,bottom:t.margins.bot,width:n>t.unitWidth?n:t.unitWidth}},e.createHTMLRect=function(t,n,i,r){var o=n.paperHeight-n.margins.bot-n.margins.top,s=(n.helperDoc.getNumberOfPages()-1)*(n.fontSize*Math.floor(o/n.fontSize))+r-i.top+e.HTML_TAIL_TEXT_SCALE*n.fontSize,a=n.helperDoc.getNumberOfPages();n.helperDoc.addPage();for(var l=0;l<a;l++)n.helperDoc.deletePage(1);return e.createRect(t,i.width,s)},e.createHTMLFlat=function(t,n,i,r){return s(this,void 0,void 0,function(){var o;return a(this,function(s){switch(s.label){case 0:return o=this.getHtmlMargins(i,t),[4,new Promise(function(s){i.helperDoc.fromHTML(r,t.xLeft,o.top,{pagesplit:!0,width:o.width},function(a){var l=e.createHTMLRect(t,i,o,a.y);s(new O(n,i,l,r))},o)})];case 1:return[2,s.sent()]}})})},e.generateFontFace=function(t,e,n){return"@font-face { font-family: ".concat(t,"; ")+"src: url(data:application/font-woff;charset=utf-8;base64,".concat(e,") format('woff'); ")+"font-weight: ".concat(n,"; }")},e.generateFontFaceWithItalicStyle=function(t,e,n){return"@font-face { font-family: ".concat(t,"; ")+"src: url(data:application/font-woff;charset=utf-8;base64,".concat(e,") format('woff'); ")+"font-weight: ".concat(n,"; font-style: italic}")},e.htmlToXml=function(t){var e=document.implementation.createHTMLDocument("");return e.write(t.replace(/\#/g,"%23")),e.documentElement.setAttribute("xmlns",e.documentElement.namespaceURI),e.body.style.margin="unset",(new XMLSerializer).serializeToString(e.body).replace(/%23/g,"#")},e.createSvgContent=function(t,e,n){var i=this,r=document.createElement("style");r.innerHTML=".__surveypdf_html p { margin: unset; line-height: 22px; } body { margin: unset; }",document.body.appendChild(r);var o=document.createElement("div");o.className="__surveypdf_html",o.style.display="block",o.style.position="fixed",o.style.top="-10000px",o.style.left="-10000px",o.style.width=e/72*96+"px",o.style.boxSizing="initial",o.style.color="initial",o.style.fontFamily="initial",o.style.font="initial",o.style.lineHeight="initial",o.insertAdjacentHTML("beforeend",t),document.body.appendChild(o);var s=o.offsetWidth,a=o.offsetHeight;o.remove(),r.remove();var l="";return n.useCustomFontInHtml?l="<defs><style>".concat(this.generateFontFace(n.fontName,n.base64Normal,"normal"))+" ".concat(this.generateFontFace(n.fontName,n.base64Bold,"bold"),"</style></defs>"):Object.keys(N.customFonts).forEach(function(t){var e=N.customFonts[t];Object.keys(e).forEach(function(n){l+="".concat("normal"===n||"bold"===n?i.generateFontFace(t,e[n],n):i.generateFontFaceWithItalicStyle(t,e[n],"italic"===n?"normal":"bold"))}),l="<defs><style>"+l+"</style></defs>"}),{svg:'<svg xmlns="http://www.w3.org/2000/svg" width="'.concat(s,'px" height="').concat(a,'px">')+l+"<style>.__surveypdf_html p { margin: unset; line-height: 22px; }</style>"+'<foreignObject width="'.concat(s,'px" height="').concat(a,'px">')+this.htmlToXml(t)+"</foreignObject></svg>",divWidth:s,divHeight:a}},e.setCanvas=function(t,n,i,r){t.width=n*e.HTML_TO_IMAGE_QUALITY,t.height=i*e.HTML_TO_IMAGE_QUALITY;var o=t.getContext("2d");o.scale(e.HTML_TO_IMAGE_QUALITY,e.HTML_TO_IMAGE_QUALITY),o.fillStyle=e.BACKGROUND_COLOR,o.fillRect(0,0,n,i),o.drawImage(r,0,0)},e.htmlToImage=function(t,n,i){return s(this,void 0,void 0,function(){var r,o,s,l,c,h;return a(this,function(a){return r=e.createSvgContent(t,n,i),o=r.svg,s=r.divWidth,l=r.divHeight,c="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(o))),(h=new Image).crossOrigin="anonymous",h.src=c,[2,new Promise(function(t){h.onload=function(){var n=document.createElement("canvas");e.setCanvas(n,s,l,h);var i=n.toDataURL("image/jpeg",e.HTML_TO_IMAGE_QUALITY);n.remove(),t({url:i,aspect:s/l})},h.onerror=function(){t({url:"data:,",aspect:n/this.EPSILON})}})]})})},e.createBoldTextFlat=function(t,e,n,i){return s(this,void 0,void 0,function(){var r;return a(this,function(o){switch(o.label){case 0:return n.fontStyle="bold",[4,this.createTextFlat(t,e,n,i,_)];case 1:return r=o.sent(),n.fontStyle="normal",[2,r]}})})},e.createTitleFlat=function(t,e,n){return s(this,void 0,void 0,function(){var i,r,o,s,l,c,h,f,d,p,g;return a(this,function(a){switch(a.label){case 0:return i=new u,r=this.clone(t),o=n.fontSize,n.fontSize*=this.TITLE_FONT_SCALE,e.no?(s=e.no+" ",l=void 0,this.hasHtml(e.locTitle)?(n.fontStyle="bold",n.pushMargins(),n.margins.right=n.paperWidth-n.margins.left-n.measureText(s,"bold").width,[4,this.createHTMLFlat(r,e,n,this.createHtmlContainerBlock(s,n,"standard"))]):[3,2]):[3,5];case 1:return l=a.sent(),n.popMargins(),n.fontStyle="normal",[3,4];case 2:return[4,this.createBoldTextFlat(r,e,n,s)];case 3:l=a.sent(),a.label=4;case 4:i.addBrick(l),r.xLeft=l.xRight,a.label=5;case 5:return n.pushMargins(),n.margins.left=r.xLeft,[4,this.createBoldTextFlat(r,e,n,e.locTitle)];case 6:return c=a.sent(),i.addBrick(c),n.popMargins(),e.isRequired?(h=e.requiredText,this.hasHtml(e.locTitle)?(r=this.createPoint(c.unfold()[0],!1,!1),n.fontStyle="bold",n.pushMargins(),n.margins.right=n.paperWidth-n.margins.left-n.measureText(h,"bold").width,d=(f=i).addBrick,[4,this.createHTMLFlat(r,e,n,this.createHtmlContainerBlock(h,n,"standard"))]):[3,8]):[3,10];case 7:return d.apply(f,[a.sent()]),n.popMargins(),n.fontStyle="normal",[3,10];case 8:return r=this.createPoint(c.unfold().pop(),!1,!0),g=(p=i).addBrick,[4,this.createBoldTextFlat(r,e,n,h)];case 9:g.apply(p,[a.sent()]),a.label=10;case 10:return n.fontSize=o,[2,i]}})})},e.createTitleSurveyPanelFlat=function(t,e,n,i){return s(this,void 0,void 0,function(){var r,o;return a(this,function(s){switch(s.label){case 0:return r=e.fontSize,e.fontSize=r*i,e.fontStyle="bold",[4,this.createTextFlat(t,null,e,n,R)];case 1:return o=s.sent(),e.fontStyle="normal",e.fontSize=r,[2,o]}})})},e.createTitleSurveyFlat=function(t,e,n){return s(this,void 0,void 0,function(){return a(this,function(i){switch(i.label){case 0:return[4,this.createTitleSurveyPanelFlat(t,e,n,this.TITLE_SURVEY_FONT_SIZE_SCALE)];case 1:return[2,i.sent()]}})})},e.createTitlePanelFlat=function(t,e,n){return s(this,arguments,void 0,function(t,e,n,i){return void 0===i&&(i=!1),a(this,function(r){switch(r.label){case 0:return[4,this.createTitleSurveyPanelFlat(t,e,n,i?this.TITLE_PAGE_FONT_SIZE_SCALE:this.TITLE_PANEL_FONT_SIZE_SCALE)];case 1:return[2,r.sent()]}})})},e.createDescFlat=function(t,e,n,i){return s(this,void 0,void 0,function(){var r,o;return a(this,function(s){switch(s.label){case 0:return r=n.fontSize,n.fontSize=r*this.DESCRIPTION_FONT_SIZE_SCALE,[4,this.createTextFlat(t,e,n,i,w)];case 1:return o=s.sent(),n.fontSize=r,[2,o]}})})},e.getReadonlyRenderAs=function(t,e){return"auto"===t.readonlyRenderAs?e.readonlyRenderAs:t.readonlyRenderAs},e.createCommentFlat=function(t,n,i,r){return s(this,void 0,void 0,function(){var o,s,l,c,h,u;return a(this,function(a){switch(a.label){case 0:return r.rows=null!==(h=r.rows)&&void 0!==h?h:1,r.value=null!==(u=r.value)&&void 0!==u?u:"",o=this.createTextFieldRect(t,i,r.rows),e.shouldRenderReadOnly(n,i,r.isReadOnly)?[4,this.createReadOnlyTextFieldTextFlat(t,i,n,r.value)]:[3,2];case 1:s=a.sent(),l=i.unitHeight*this.VALUE_READONLY_PADDING_SCALE,s.yBot+l>o.yBot&&(o.yBot=s.yBot+l),a.label=2;case 2:return c=new S(n,i,o,r),s&&(c.textBrick=s),[2,c]}})})},Object.defineProperty(e,"hasDocument",{get:function(){return"undefined"!=typeof document},enumerable:!1,configurable:!0}),e.getImageBase64=function(t){return s(this,void 0,void 0,function(){var e;return a(this,function(n){return(e=new Image).crossOrigin="anonymous",[2,new Promise(function(n){e.onload=function(){var t=document.createElement("canvas"),i=t.getContext("2d");t.height=e.naturalHeight,t.width=e.naturalWidth,i.drawImage(e,0,0);var r=t.toDataURL();n(r)},e.onerror=function(){n("")},e.src=t})]})})},e.getImageLink=function(t,n,i){return s(this,void 0,void 0,function(){var r,o,s,l;return a(this,function(a){switch(a.label){case 0:return r=96/72,this.shouldConvertImageToPng?[4,e.getImageBase64(n.link)]:[3,2];case 1:return s=a.sent(),[3,3];case 2:s=n.link,a.label=3;case 3:return o=s,"function"==typeof XMLSerializer&&i?(l="<div style='overflow: hidden; width: ".concat(n.width*r,"px; height: ").concat(n.height*r,"px;'>\n <img src='").concat(o,"' style='object-fit: ").concat(n.objectFit,"; width: 100%; height: 100%;'/>\n </div>"),[4,e.htmlToImage(l,n.width,t)]):[3,5];case 4:o=a.sent().url,a.label=5;case 5:return[2,o]}})})},e.createImageFlat=function(t,n,i,r,o){return s(this,void 0,void 0,function(){var s,l,c;return a(this,function(a){switch(a.label){case 0:return e.inBrowser?(r.objectFit=n&&n.imageFit?n.imageFit:r.objectFit||"contain",(null!=o?o:i.applyImageFit)&&r.width>i.paperWidth-i.margins.left-i.margins.right&&(s=i.paperWidth-i.margins.left-i.margins.right,r.height*=s/r.width,r.width=s),c="<img src='".concat,[4,e.getImageLink(i,r,null!=o?o:i.applyImageFit)]):[3,2];case 1:return l=c.apply("<img src='",[a.sent(),"' width='"]).concat(r.width,"' height='").concat(r.height,"'/>"),[2,new O(n,i,this.createRect(t,r.width,r.height),l,!0)];case 2:return[2,new P(n,i,r.link,t,r.width,r.height)]}})})},e.canPreviewImage=function(t,e,n){return t.canPreviewImage(e)},e.getImageSize=function(t){return s(this,void 0,void 0,function(){return a(this,function(n){switch(n.label){case 0:return e.inBrowser?[3,2]:[4,new Promise(function(t){return t({width:void 0,height:void 0})})];case 1:case 3:return[2,n.sent()];case 2:return[4,new Promise(function(e){var n=new Image;n.src=t,n.onload=function(){return e({width:n.width,height:n.height})},n.onerror=function(){return e(null)}})]}})})},e.createRowlineFlat=function(t,e,n,i){var r=void 0===n?e.paperWidth-e.margins.right:t.xLeft+n;return r=r>t.xLeft?r:t.xLeft+this.EPSILON,new f(e,{xLeft:t.xLeft,xRight:r,yTop:t.yTop+this.EPSILON,yBot:t.yTop+this.EPSILON},void 0===i?null:i)},e.createLinkFlat=function(t,e,n,i,r){return s(this,void 0,void 0,function(){var o,s,l=this;return a(this,function(a){switch(a.label){case 0:return[4,this.createTextFlat(t,e,n,i,b)];case 1:return o=a.sent(),s=new u,o.unfold().forEach(function(t){s.addBrick(new C(t,r));var e=l.createPoint(s);s.addBrick(l.createRowlineFlat(e,n,s.width,C.COLOR))}),[2,s]}})})},e.createAcroformRect=function(t){return[t.xLeft,t.yTop,t.xRight-t.xLeft,t.yBot-t.yTop]},e.createTextFieldRect=function(t,e,n){void 0===n&&(n=1);var i=e.paperWidth-t.xLeft-e.margins.right;i=Math.max(i,e.unitWidth);var r=e.unitHeight*n;return this.createRect(t,i,r)},e.createReadOnlyTextFieldTextFlat=function(t,e,n,i){return s(this,void 0,void 0,function(){var r,o;return a(this,function(s){switch(s.label){case 0:return r=e.unitWidth*this.VALUE_READONLY_PADDING_SCALE,t.yTop+=r,t.xLeft+=r,e.pushMargins(t.xLeft,e.margins.right+r),[4,this.createTextFlat(t,n,e,i.toString(),b)];case 1:return o=s.sent(),e.popMargins(),[2,o]}})})},e.renderFlatBorders=function(t,e){var n,i,r,o,s,a;if(this.FORM_BORDER_VISIBLE){e.rounded=null===(r=e.rounded)||void 0===r||r,e.outside=null!==(o=e.outside)&&void 0!==o&&o;var c=Math.min(e.width,e.height),h=this.getBorderWidth(t),u=t.unitHeight*this.VISIBLE_BORDER_SCALE*this.BORDER_SCALE,f=e.outside?(c+h)/c-u/c:(c-h)/c+u/c,d=t.doc.getDrawColor();t.doc.setDrawColor(e.formBorderColor),t.doc.setLineWidth(u);var p=this.scaleRect(e,f);if(e.dashStyle){var g=e.dashStyle,m=2*(Math.abs(p.yTop-p.yBot)+Math.abs(p.xLeft-p.xRight)),y=g.dashArray[0]+(null!==(s=g.dashArray[1])&&void 0!==s?s:g.dashArray[0]),v=g.dashArray[0]+m%y/Math.floor(m/y);t.doc.setLineDashPattern([v,null!==(a=g.dashArray[1])&&void 0!==a?a:g.dashArray[0]],g.dashPhase)}if((n=t.doc).rect.apply(n,this.createAcroformRect(p)),e.rounded){var b=t.unitHeight*this.UNVISIBLE_BORDER_SCALE*this.BORDER_SCALE,x=1-b/c,T=this.RADIUS_SCALE*b;t.doc.setDrawColor(this.BACKGROUND_COLOR),t.doc.setLineWidth(b),(i=t.doc).roundedRect.apply(i,l(l([],this.createAcroformRect(this.scaleRect(e,x)),!1),[T,T],!1))}e.dashStyle&&t.doc.setLineDashPattern([]),t.doc.setDrawColor(d)}},e.getLocString=function(t){return this.hasHtml(t)?t.renderedHtml:t.renderedText||t.renderedHtml},e.getContentQuestion=function(t){return t.contentQuestion?t.contentQuestion:t},e.getContentQuestionTypeRenderAs=function(t,e){var n=t.renderAs;if("boolean"===t.getType()&&e.options.useLegacyBooleanRendering&&(n="checkbox"),"default"!==n){var i="".concat(t.getType(),"-").concat(n);if(F.getInstance().isTypeRegistered(i))return i}return t.getType()},e.getContentQuestionType=function(t,e){return t.customWidget?t.customWidget.pdfQuestionType:t.contentQuestion?"custom_model":this.getContentQuestionTypeRenderAs(t,e)},e.getRatingMinWidth=function(t){return t.measureText(this.RATING_MIN_WIDTH).width},e.getRatingItemText=function(t,e,n){var i=new c.LocalizableString(n.owner,n.useMarkdown);return i.text=this.getLocString(n),0===e&&t.minRateDescription?i.text=t.locMinRateDescription.text+" "+this.getLocString(n):e===t.visibleRateValues.length-1&&t.maxRateDescription&&(i.text=this.getLocString(n)+" "+t.locMaxRateDescription.text),i},e.getPageAvailableWidth=function(t){return t.paperWidth-t.margins.left-t.margins.right},e.getImagePickerAvailableWidth=function(t){var e=this.getPageAvailableWidth(t)-(this.IMAGEPICKER_COUNT-1)*t.unitHeight;return e>0?e:t.unitHeight},e.getColumnWidth=function(t,e){return(this.getPageAvailableWidth(t)-(e-1)*t.unitWidth*this.GAP_BETWEEN_COLUMNS)/e},e.setColumnMargins=function(t,e,n){var i=this.getColumnWidth(t,e);t.margins.left=t.margins.left+n*(i+t.unitWidth*this.GAP_BETWEEN_COLUMNS),t.margins.right=t.margins.right+(e-n-1)*(i+t.unitWidth*this.GAP_BETWEEN_COLUMNS)},e.moveRect=function(t,e,n){return void 0===e&&(e=t.xLeft),void 0===n&&(n=t.yTop),{xLeft:e,yTop:n,xRight:e+t.xRight-t.xLeft,yBot:n+t.yBot-t.yTop}},e.scaleRect=function(t,e){var n=Math.min(t.xRight-t.xLeft,t.yBot-t.yTop)*(1-e)/2;return{xLeft:t.xLeft+n,yTop:t.yTop+n,xRight:t.xRight-n,yBot:t.yBot-n}},e.getBorderWidth=function(t){return 2*t.unitWidth*this.BORDER_SCALE},e.formScale=function(t,e){var n=Math.min(e.width,e.height);return(n-this.getBorderWidth(t))/n},e.generateQuestionFlats=function(e,n,i,r){return s(this,void 0,void 0,function(){var o,s,c;return a(this,function(a){switch(a.label){case 0:return o=this.getContentQuestionType(i,e),[4,F.getInstance().create(e,i,n,o).generateFlats(r)];case 1:return s=a.sent(),c=new p(r,s,i,n,F.getInstance(),t),i.customWidget&&i.customWidget.isFit(i)&&i.customWidget.pdfRender&&e.onRenderQuestion.unshift(i.customWidget.pdfRender),[4,e.onRenderQuestion.fire(e,c)];case 2:return a.sent(),[2,l([],c.bricks,!0)]}})})},e.isFontExist=function(t,e){return t.doc.internal.getFont(e).fontName===e},e.isCustomFont=function(t,e){return t.doc.internal.getFont(e).encoding===this.CUSTOM_FONT_ENCODING},e.fixFont=function(t){this.isCustomFont(t,t.fontName)&&(t.doc.text("load font",0,0),t.doc.deletePage(1),t.addPage())},e.clone=function(t){var e={};for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e},e.shouldRenderReadOnly=function(t,n,i){return(!!t&&t.isReadOnly||i)&&"acroform"!==e.getReadonlyRenderAs(t,n)||(null==n?void 0:n.compress)},e.isSizeEmpty=function(t){return!t||"auto"===t},e.isHeightEmpty=function(t){return this.isSizeEmpty(t)||"100%"==t},e.getCorrectedImageSize=function(t,n){return s(this,void 0,void 0,function(){var i,r,o,s,l,c,h,u,f,d;return a(this,function(a){switch(a.label){case 0:return i=n.imageWidth,r=n.imageLink,o=n.imageHeight,s=n.defaultImageWidth,l=n.defaultImageHeight,i="number"==typeof i?i.toString():i,o="number"==typeof o?o.toString():o,c=i&&e.parseWidth(i,e.getPageAvailableWidth(t),1,"px"),h=o&&e.parseWidth(o,e.getPageAvailableWidth(t),1,"px"),s="number"==typeof s?s.toString():s,l="number"==typeof l?l.toString():l,u=s&&e.parseWidth(s,e.getPageAvailableWidth(t),1,"px"),f=l&&e.parseWidth(l,e.getPageAvailableWidth(t),1,"px"),e.isSizeEmpty(i)||e.isHeightEmpty(o)?[4,e.getImageSize(r)]:[3,2];case 1:d=a.sent(),e.isSizeEmpty(i)?e.isHeightEmpty(o)?d&&d.height&&d.width&&(h=e.parseWidth(d.height.toString(),e.getPageAvailableWidth(t),1,"px"),c=e.parseWidth(d.width.toString(),e.getPageAvailableWidth(t),1,"px")):d&&d.height&&(c=d.width*h/d.height):d&&d.width&&(h=d.height*c/d.width),a.label=2;case 2:return[2,{width:c||u||0,height:h||f||0}]}})})},e.EPSILON=2220446049250313e-30,e.TITLE_SURVEY_FONT_SIZE_SCALE=1.7,e.TITLE_PAGE_FONT_SIZE_SCALE=1.3,e.TITLE_PANEL_FONT_SIZE_SCALE=1.3,e.DESCRIPTION_FONT_SIZE_SCALE=2/3,e.OTHER_ROWS_COUNT=2,e.RATING_MIN_WIDTH=3,e.RATING_MIN_HEIGHT=2,e.RATING_COLUMN_WIDTH=5,e.MATRIX_COLUMN_WIDTH=5,e.IMAGEPICKER_COUNT=4,e.IMAGEPICKER_RATIO=4/3,e.MULTIPLETEXT_TEXT_PERS=Math.E/10,e.HTML_TAIL_TEXT_SCALE=.24,e.SELECT_ITEM_FLAT_SCALE=.95,e.GAP_BETWEEN_ROWS=.25,e.GAP_BETWEEN_COLUMNS=1.5,e.GAP_BETWEEN_ITEM_TEXT=.25,e.FORM_BORDER_VISIBLE=!0,e.BORDER_SCALE=.1,e.VISIBLE_BORDER_SCALE=.8,e.UNVISIBLE_BORDER_SCALE=.2,e.RADIUS_SCALE=3,e.TITLE_FONT_SCALE=1.1,e.VALUE_READONLY_PADDING_SCALE=.3,e.HTML_TO_IMAGE_QUALITY=1,e.FORM_BORDER_COLOR="#9f9f9f",e.TEXT_COLOR="#404040",e.BACKGROUND_COLOR="#FFFFFF",e.TITLE_LOCATION_MATRIX="matrix",e.STANDARD_FONT="helvetica",e.CUSTOM_FONT_ENCODING="Identity-H",e.inBrowser="function"==typeof Image,e.shouldConvertImageToPng=!0,e}();!function(t,e){var n,i=t.API,r=1;function o(t){for(var e="",n=0;n<t.length;n++){for(var i=t.charCodeAt(n).toString(16).toUpperCase();i.length<4;)i="0"+i;e+=i}return"<FEFF"+e+">"}var s=function(t){return t.replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},a=function(t){return t.replace(/\\\\/g,"\\").replace(/\\\(/g,"(").replace(/\\\)/g,")")},l=function(t){return t.toFixed(2)},c=function(t){return t.toFixed(5)};i.__acroform__={};var h=function(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t},u=function(t){return t*r},f=function(t){return t/r},d=function(t){var e=new M,n=K.internal.getHeight(t)||0,i=K.internal.getWidth(t)||0;return e.BBox=[0,0,Number(l(i)),Number(l(n))],e},p=i.__acroform__.setBit=function(t,e){if(t=t||0,e=e||0,isNaN(t)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBit");return t|1<<e},g=i.__acroform__.clearBit=function(t,e){if(t=t||0,e=e||0,isNaN(t)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBit");return t&~(1<<e)},m=i.__acroform__.getBit=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBit");return t&1<<e?1:0},y=i.__acroform__.getBitForPdf=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBitForPdf");return m(t,e-1)},v=i.__acroform__.setBitForPdf=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBitForPdf");return p(t,e-1)},b=i.__acroform__.clearBitForPdf=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBitForPdf");return g(t,e-1)},x=i.__acroform__.calculateCoordinates=function(t){var e=this.internal.getHorizontalCoordinate,n=this.internal.getVerticalCoordinate,i=t[0],r=t[1],o=t[2],s=t[3],a={};return a.lowerLeft_X=e(i)||0,a.lowerLeft_Y=n(r+s)||0,a.upperRight_X=e(i+o)||0,a.upperRight_Y=n(r)||0,[Number(l(a.lowerLeft_X)),Number(l(a.lowerLeft_Y)),Number(l(a.upperRight_X)),Number(l(a.upperRight_Y))]},T=function(t){if(t.appearanceStreamContent)return t.appearanceStreamContent;if(t.V||t.DV){var e=[],i=t.V||t.DV,r=F(t,i),o=n.internal.getFont(t.fontName,t.fontStyle).id;e.push("/Tx BMC"),e.push("q"),e.push("BT"),e.push(n.__private__.encodeColorString(t.color)),e.push("/"+o+" "+l(r.fontSize)+" Tf"),e.push("1 0 0 1 0 0 Tm"),e.push(r.text),e.push("ET"),e.push("Q"),e.push("EMC");var s=new d(t);return s.stream=e.join("\n"),s}},F=function(t,e){t.isUnicode&&(e=t.trueValue);var i=0===t.fontSize?t.maxFontSize:t.fontSize,r={text:"",fontSize:""},o=(e=")"==(e="("==e.substr(0,1)?e.substr(1):e).substr(e.length-1)?e.substr(0,e.length-1):e).split(" ");o=o.map(function(t){return t.split("\n")}),t.multiline||(o=o.map(function(t){return[t.join(" ")]}));var a=i,c=K.internal.getHeight(t)||0;c=c<0?-c:c;var h=K.internal.getWidth(t)||0;h=h<0?-h:h;var u=function(e,n,i){if(e+1<o.length){var r=n+" "+o[e+1][0];return _(r,t,i).width<=h-4}return!1};a++;t:for(;a>0;){e="",a--;var f,d,p=_("3",t,a).height,g=t.multiline?c-a:(c-p)/2,m=g+=2,y=0,v=0,b=0;if(a<=0){e="(...) Tj\n",e+="% Width of Text: "+_(e,t,a=12).width+", FieldWidth:"+h+"\n";break}for(var x="",T=0,F=0;F<o.length;F++)if(o.hasOwnProperty(F)){var R=!1;if(1!==o[F].length&&b!==o[F].length-1){if((p+2)*(T+2)+2>c)continue t;x+=o[F][b],R=!0,v=F,F--}else{x=" "==(x+=o[F][b]+" ").substr(x.length-1)?x.substr(0,x.length-1):x;var w=parseInt(F),C=u(w,x,a),O=F>=o.length-1;if(C&&!O){x+=" ",b=0;continue}if(C||O){if(O)v=w;else if(t.multiline&&(p+2)*(T+2)+2>c)continue t}else{if(!t.multiline)continue t;if((p+2)*(T+2)+2>c)continue t;v=w}}for(var P="",E=y;E<=v;E++){var S=o[E];if(t.multiline){if(E===v){P+=S[b]+" ",b=(b+1)%S.length;continue}if(E===y){P+=S[S.length-1]+" ";continue}}P+=S[0]+" "}switch(P=" "==P.substr(P.length-1)?P.substr(0,P.length-1):P,d=_(P,t,a).width,t.textAlign){case"right":f=h-d-2;break;case"center":f=(h-d)/2;break;default:f=2}if(e+=l(f)+" "+l(m)+" Td\n",t.isUnicode){var L={};L[n.internal.getFont().id]=n.internal.getFont();var B={text:P,x:null,y:null,options:{lang:null},mutex:{pdfEscape:s,activeFontKey:n.internal.getFont().id,fonts:L,activeFontSize:t.fontSize}};n.internal.events.publish("postProcessText",B),e+="<"+B.text+"> Tj\n"}else e+="("+s(P)+") Tj\n";e+=-l(f)+" 0 Td\n",m=-(a+2),d=0,y=R?v:v+1,T++,x=""}break}return r.text=e,r.fontSize=a,r},_=function(t,e,i){var r=n.internal.getFont(e.fontName,e.fontStyle),o=n.getStringUnitWidth(t,{font:r,fontSize:parseFloat(i),charSpace:0})*parseFloat(i);return{height:n.getStringUnitWidth("3",{font:r,fontSize:parseFloat(i),charSpace:0})*parseFloat(i)*1.5,width:o}},R={fields:[],xForms:[],acroFormDictionaryRoot:null,printedOut:!1,internal:null,isInitialized:!1},w=function(){n.internal.acroformPlugin.acroFormDictionaryRoot.objId=void 0;var t=n.internal.acroformPlugin.acroFormDictionaryRoot.Fields;for(var e in t)if(t.hasOwnProperty(e)){var i=t[e];i.objId=void 0,i.hasAnnotation&&O.call(n,i)}},C=function(t){n.internal.acroformPlugin.printedOut&&(n.internal.acroformPlugin.printedOut=!1,n.internal.acroformPlugin.acroFormDictionaryRoot=null),n.internal.acroformPlugin.acroFormDictionaryRoot||B.call(n),n.internal.acroformPlugin.acroFormDictionaryRoot.Fields.push(t)},O=function(t){var e={type:"reference",object:t};void 0===n.internal.getPageInfo(t.page).pageContext.annotations.find(function(t){return t.type===e.type&&t.object===e.object})&&n.internal.getPageInfo(t.page).pageContext.annotations.push(e)},P=function(){if(void 0===n.internal.acroformPlugin.acroFormDictionaryRoot)throw new Error("putCatalogCallback: Root missing.");n.internal.write("/AcroForm "+n.internal.acroformPlugin.acroFormDictionaryRoot.objId+" 0 R")},E=function(){n.internal.events.unsubscribe(n.internal.acroformPlugin.acroFormDictionaryRoot._eventID),delete n.internal.acroformPlugin.acroFormDictionaryRoot._eventID,n.internal.acroformPlugin.printedOut=!0},S=function(t){var e=!t;for(var i in t||(n.internal.newObjectDeferredBegin(n.internal.acroformPlugin.acroFormDictionaryRoot.objId,!0),n.internal.acroformPlugin.acroFormDictionaryRoot.putStream()),t=t||n.internal.acroformPlugin.acroFormDictionaryRoot.Kids)if(t.hasOwnProperty(i)){var r=t[i],o=[],s=r.Rect;if(r.Rect&&(r.Rect=x.call(this,r.Rect)),n.internal.newObjectDeferredBegin(r.objId,!0),r.DA=K.createDefaultAppearanceStream(r),"object"==typeof r&&"function"==typeof r.getKeyValueListForStream&&(o=r.getKeyValueListForStream()),r.Rect=s,r.hasAppearanceStream&&!r.appearanceStreamContent){var a=T.call(this,r);o.push({key:"AP",value:"<</N "+a+">>"}),n.internal.acroformPlugin.xForms.push(a)}if(r.appearanceStreamContent){var l="";for(var c in r.appearanceStreamContent)if(r.appearanceStreamContent.hasOwnProperty(c)){var h=r.appearanceStreamContent[c];if(l+="/"+c+" ",l+="<<",Object.keys(h).length>=1||Array.isArray(h)){for(var i in h)if(h.hasOwnProperty(i)){var u=h[i];"function"==typeof u&&(u=u.call(this,r)),l+="/"+i+" "+u+" ",n.internal.acroformPlugin.xForms.indexOf(u)>=0||n.internal.acroformPlugin.xForms.push(u)}}else"function"==typeof(u=h)&&(u=u.call(this,r)),l+="/"+i+" "+u,n.internal.acroformPlugin.xForms.indexOf(u)>=0||n.internal.acroformPlugin.xForms.push(u);l+=">>"}o.push({key:"AP",value:"<<\n"+l+">>"})}n.internal.putStream({additionalKeyValues:o}),n.internal.out("endobj")}e&&L.call(this,n.internal.acroformPlugin.xForms)},L=function(t){for(var e in t)if(t.hasOwnProperty(e)){var i=e,r=t[e];n.internal.newObjectDeferredBegin(r&&r.objId,!0),"object"==typeof r&&"function"==typeof r.putStream&&r.putStream(),delete t[i]}},B=function(){if(void 0!==this.internal&&(void 0===this.internal.acroformPlugin||!1===this.internal.acroformPlugin.isInitialized)){if(n=this,W.FieldNum=0,this.internal.acroformPlugin=JSON.parse(JSON.stringify(R)),this.internal.acroformPlugin.acroFormDictionaryRoot)throw new Error("Exception while creating AcroformDictionary");r=n.internal.scaleFactor,n.internal.acroformPlugin.acroFormDictionaryRoot=new k,n.internal.acroformPlugin.acroFormDictionaryRoot._eventID=n.internal.events.subscribe("postPutResources",E),n.internal.events.subscribe("buildDocument",w),n.internal.events.subscribe("putCatalog",P),n.internal.events.subscribe("postPutPages",S),n.internal.acroformPlugin.isInitialized=!0}},A=i.__acroform__.arrayToPdfArray=function(t){if(Array.isArray(t)){for(var e="[",n=0;n<t.length;n++)switch(0!==n&&(e+=" "),typeof t[n]){case"boolean":case"number":case"object":e+=t[n].toString();break;case"string":"/"!==t[n].substr(0,1)?e+="("+s(t[n].toString())+")":e+=t[n].toString()}return e+"]"}throw new Error("Invalid argument passed to jsPDF.__acroform__.arrayToPdfArray")},I=function(t){return(t=t||"").toString(),"("+s(t)+")"},N=function(){var t;Object.defineProperty(this,"objId",{configurable:!0,get:function(){return t||(t=n.internal.newObjectDeferred()),t},set:function(e){t=e}})};N.prototype.toString=function(){return this.objId+" 0 R"},N.prototype.putStream=function(){var t=this.getKeyValueListForStream();n.internal.putStream({data:this.stream,additionalKeyValues:t}),n.internal.out("endobj")},N.prototype.getKeyValueListForStream=function(){return function(t){var e=[],n=Object.getOwnPropertyNames(t).filter(function(t){return"content"!=t&&"appearanceStreamContent"!=t&&"_"!=t.substring(0,1)});for(var i in n){var r=Object.getOwnPropertyDescriptor(t,n[i]);if(r&&!1===r.configurable){var o=n[i],s=t[o];s&&(Array.isArray(s)?e.push({key:o,value:A(s)}):s instanceof N?e.push({key:o,value:s.objId+" 0 R"}):"function"!=typeof s&&e.push({key:o,value:s}))}}return e}(this)};var M=function(){N.call(this),Object.defineProperty(this,"Type",{value:"/XObject",configurable:!1,writeable:!0}),Object.defineProperty(this,"Subtype",{value:"/Form",configurable:!1,writeable:!0}),Object.defineProperty(this,"FormType",{value:1,configurable:!1,writeable:!0});var t,e=[];Object.defineProperty(this,"BBox",{configurable:!1,writeable:!0,get:function(){return e},set:function(t){e=t}}),Object.defineProperty(this,"Resources",{value:"2 0 R",configurable:!1,writeable:!0}),Object.defineProperty(this,"stream",{enumerable:!1,configurable:!0,set:function(e){t=e.trim()},get:function(){return t||null}})};h(M,N);var k=function(){N.call(this);var t,e=[];Object.defineProperty(this,"Kids",{enumerable:!1,configurable:!0,get:function(){return e.length>0?e:void 0}}),Object.defineProperty(this,"Fields",{enumerable:!1,configurable:!1,get:function(){return e}}),Object.defineProperty(this,"DA",{enumerable:!1,configurable:!1,get:function(){if(t)return"("+t+")"},set:function(e){t=e}})};h(k,N);var W=function(){N.call(this);var t=4;this.isUnicode=!1,this.trueValue="",Object.defineProperty(this,"F",{enumerable:!1,configurable:!1,get:function(){return t},set:function(e){if(isNaN(e))throw new Error('Invalid value "'+e+'" for attribute F supplied.');t=e}}),Object.defineProperty(this,"showWhenPrinted",{enumerable:!0,configurable:!0,get:function(){return Boolean(y(t,3))},set:function(e){!0===Boolean(e)?this.F=v(t,3):this.F=b(t,3)}});var e=0;Object.defineProperty(this,"Ff",{enumerable:!1,configurable:!1,get:function(){return e},set:function(t){if(isNaN(t))throw new Error('Invalid value "'+t+'" for attribute Ff supplied.');e=t}});var n=[];Object.defineProperty(this,"Rect",{enumerable:!1,configurable:!1,get:function(){if(0!==n.length)return n},set:function(t){n=void 0!==t?t:[]}}),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,get:function(){return!n||isNaN(n[0])?0:f(n[0])},set:function(t){n[0]=u(t)}}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,get:function(){return!n||isNaN(n[1])?0:f(n[1])},set:function(t){n[1]=u(t)}}),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,get:function(){return!n||isNaN(n[2])?0:f(n[2])},set:function(t){n[2]=u(t)}}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,get:function(){return!n||isNaN(n[3])?0:f(n[3])},set:function(t){n[3]=u(t)}});var i="";Object.defineProperty(this,"FT",{enumerable:!0,configurable:!1,get:function(){return i},set:function(t){switch(t){case"/Btn":case"/Tx":case"/Ch":case"/Sig":i=t;break;default:throw new Error('Invalid value "'+t+'" for attribute FT supplied.')}}});var r=null;Object.defineProperty(this,"T",{enumerable:!0,configurable:!1,get:function(){if(!r||r.length<1){if(this instanceof U)return;r="FieldObject"+W.FieldNum++}return"("+s(r)+")"},set:function(t){r=t.toString()}}),Object.defineProperty(this,"fieldName",{configurable:!0,enumerable:!0,get:function(){return r},set:function(t){r=t}});var l="helvetica";Object.defineProperty(this,"fontName",{enumerable:!0,configurable:!0,get:function(){return l},set:function(t){l=t}});var c="normal";Object.defineProperty(this,"fontStyle",{enumerable:!0,configurable:!0,get:function(){return c},set:function(t){c=t}});var h=0;Object.defineProperty(this,"fontSize",{enumerable:!0,configurable:!0,get:function(){return f(h)},set:function(t){h=u(t)}});var d=50;Object.defineProperty(this,"maxFontSize",{enumerable:!0,configurable:!0,get:function(){return f(d)},set:function(t){d=u(t)}});var p="black";Object.defineProperty(this,"color",{enumerable:!0,configurable:!0,get:function(){return p},set:function(t){p=t}});var g="/F1 0 Tf 0 g";Object.defineProperty(this,"DA",{enumerable:!0,configurable:!1,get:function(){if(!(!g||this instanceof U||this instanceof X))return I(g)},set:function(t){t=t.toString(),g=t}});var m=null;Object.defineProperty(this,"DV",{enumerable:!1,configurable:!1,get:function(){if(m)return this instanceof z==0?I(m):m},set:function(t){t=t.toString(),m=this instanceof z==0?"("===t.substr(0,1)?a(t.substr(1,t.length-2)):a(t):t}}),Object.defineProperty(this,"defaultValue",{enumerable:!0,configurable:!0,get:function(){return this instanceof z==1?a(m.substr(1,m.length-1)):m},set:function(t){t=t.toString(),m=this instanceof z==1?"/"+t:t}});var x=null;Object.defineProperty(this,"V",{enumerable:!1,configurable:!1,get:function(){return this.isUnicode?x:x?this instanceof z==0?I(x):x:void 0},set:function(t){t=t.toString(),this.isUnicode?(x=o(t),this.trueValue=t):x=this instanceof z==0?"("===t.substr(0,1)?a(t.substr(1,t.length-2)):a(t):t}}),Object.defineProperty(this,"value",{enumerable:!0,configurable:!0,get:function(){return this instanceof z==1?a(x.substr(1,x.length-1)):x},set:function(t){t=t.toString(),x=this instanceof z==1?"/"+t:t}}),Object.defineProperty(this,"hasAnnotation",{enumerable:!0,configurable:!0,get:function(){return this.Rect}}),Object.defineProperty(this,"Type",{enumerable:!0,configurable:!1,get:function(){return this.hasAnnotation?"/Annot":null}}),Object.defineProperty(this,"Subtype",{enumerable:!0,configurable:!1,get:function(){return this.hasAnnotation?"/Widget":null}});var T,F=!1;Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,writeable:!0,get:function(){return F},set:function(t){t=Boolean(t),F=t}}),Object.defineProperty(this,"page",{enumerable:!0,configurable:!0,writeable:!0,get:function(){if(T)return T},set:function(t){T=t}}),Object.defineProperty(this,"readOnly",{enumerable:!0,configurable:!0,get:function(){return Boolean(y(this.Ff,1))},set:function(t){!0===Boolean(t)?this.Ff=v(this.Ff,1):this.Ff=b(this.Ff,1)}}),Object.defineProperty(this,"required",{enumerable:!0,configurable:!0,get:function(){return Boolean(y(this.Ff,2))},set:function(t){!0===Boolean(t)?this.Ff=v(this.Ff,2):this.Ff=b(this.Ff,2)}}),Object.defineProperty(this,"noExport",{enumerable:!0,configurable:!0,get:function(){return Boolean(y(this.Ff,3))},set:function(t){!0===Boolean(t)?this.Ff=v(this.Ff,3):this.Ff=b(this.Ff,3)}});var _=null;Object.defineProperty(this,"Q",{enumerable:!0,configurable:!1,get:function(){if(null!==_)return _},set:function(t){if(-1===[0,1,2].indexOf(t))throw new Error('Invalid value "'+t+'" for attribute Q supplied.');_=t}}),Object.defineProperty(this,"textAlign",{get:function(){var t;switch(_){case 0:default:t="left";break;case 1:t="center";break;case 2:t="right"}return t},configurable:!0,enumerable:!0,set:function(t){switch(t){case"right":case 2:_=2;break;case"center":case 1:_=1;break;default:_=0}}})};h(W,N);var q=function(){W.call(this),this.FT="/Ch",this.V="()",this.fontName="zapfdingbats";var t=0;Object.defineProperty(this,"TI",{enumerable:!0,configurable:!1,get:function(){return t},set:function(e){t=e}});var e="<< /BG [ 0.975 0.975 0.975 ] >>";Object.defineProperty(this,"MK",{enumerable:!0,configurable:!1,get:function(){return e},set:function(t){e=t}}),Object.defineProperty(this,"topIndex",{enumerable:!0,configurable:!0,get:function(){return t},set:function(e){t=e}});var n=[];Object.defineProperty(this,"Opt",{enumerable:!0,configurable:!1,get:function(){return this.isUnicode?function(t){for(var e="[ ",n=0;n<t.length;n++)e+=o(t[n]);return e+" ]"}(n):A(n)},set:function(t){var e,i;i=[],"string"==typeof(e=t)&&(i=function(t,e,n){n||(n=1);for(var i,r=[];i=e.exec(t);)r.push(i[n]);return r}(e,/\((.*?)\)/g)),n=i}}),this.getOptions=function(){return n},this.setOptions=function(t){n=t,this.sort&&n.sort()},this.addOption=function(t){t=(t=t||"").toString(),n.push(t),this.sort&&n.sort()},this.removeOption=function(t,e){for(e=e||!1,t=(t=t||"").toString();-1!==n.indexOf(t)&&(n.splice(n.indexOf(t),1),!1!==e););},Object.defineProperty(this,"combo",{enumerable:!0,configurable:!0,get:function(){return Boolean(y(this.Ff,18))},set:function(t){!0===Boolean(t)?this.Ff=v(this.Ff,18):this.Ff=b(this.Ff,18)}}),Object.defineProperty(this,"edit",{enumerable:!0,configurable:!0,get:function(){return Boolean(y(this.Ff,19))},set:function(t){!0===this.combo&&(!0===Boolean(t)?this.Ff=v(this.Ff,19):this.Ff=b(this.Ff,19))}}),Object.defineProperty(this,"sort",{enumerable:!0,configurable:!0,get:function(){return Boolean(y(this.Ff,20))},set:function(t){!0===Boolean(t)?(this.Ff=v(this.Ff,20),n.sort()):this.Ff=b(this.Ff,20)}}),Object.defineProperty(this,"multiSelect",{enumerable:!0,configurable:!0,get:function(){return Boolean(y(this.Ff,22))},set:function(t){!0===Boolean(t)?this.Ff=v(this.Ff,22):this.Ff=b(this.Ff,22)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return Boolean(y(this.Ff,23))},set:function(t){!0===Boolean(t)?this.Ff=v(this.Ff,23):this.Ff=b(this.Ff,23)}}),Object.defineProperty(this,"commitOnSelChange",{enumerable:!0,configurable:!0,get:function(){return Boolean(y(this.Ff,27))},set:function(t){!0===Boolean(t)?this.Ff=v(this.Ff,27):this.Ff=b(this.Ff,27)}}),this.hasAppearanceStream=!1};h(q,W);var H=function(){q.call(this),this.fontName="helvetica",this.combo=!1};h(H,q);var D=function(){H.call(this),this.combo=!0};h(D,H);var j=function(){D.call(this),this.edit=!0};h(j,D);var z=function(){W.call(this),this.FT="/Btn",Object.defineProperty(this,"noToggleToOff",{enumerable:!0,configurable:!0,get:function(){return Boolean(y(this.Ff,15))},set:function(t){!0===Boolean(t)?this.Ff=v(this.Ff,15):this.Ff=b(this.Ff,15)}}),Object.defineProperty(this,"radio",{enumerable:!0,configurable:!0,get:function(){return Boolean(y(this.Ff,16))},set:function(t){!0===Boolean(t)?this.Ff=v(this.Ff,16):this.Ff=b(this.Ff,16)}}),Object.defineProperty(this,"pushButton",{enumerable:!0,configurable:!0,get:function(){return Boolean(y(this.Ff,17))},set:function(t){!0===Boolean(t)?this.Ff=v(this.Ff,17):this.Ff=b(this.Ff,17)}}),Object.defineProperty(this,"radioIsUnison",{enumerable:!0,configurable:!0,get:function(){return Boolean(y(this.Ff,26))},set:function(t){!0===Boolean(t)?this.Ff=v(this.Ff,26):this.Ff=b(this.Ff,26)}});var t,e={};Object.defineProperty(this,"MK",{enumerable:!1,configurable:!1,get:function(){if(0!==Object.keys(e).length){var t,n=[];for(t in n.push("<<"),e)n.push("/"+t+" ("+e[t]+")");return n.push(">>"),n.join("\n")}},set:function(t){"object"==typeof t&&(e=t)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return e.CA||""},set:function(t){"string"==typeof t&&(e.CA=t)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return t},set:function(e){t=e}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return t.substr(1,t.length-1)},set:function(e){t="/"+e}})};h(z,W);var G=function(){z.call(this),this.pushButton=!0};h(G,z);var V=function(){z.call(this),this.radio=!0,this.pushButton=!1;var t=[];Object.defineProperty(this,"Kids",{enumerable:!0,configurable:!1,get:function(){return t},set:function(e){t=void 0!==e?e:[]}})};h(V,z);var U=function(){var t,e;W.call(this),Object.defineProperty(this,"Parent",{enumerable:!1,configurable:!1,get:function(){return t},set:function(e){t=e}}),Object.defineProperty(this,"optionName",{enumerable:!1,configurable:!0,get:function(){return e},set:function(t){e=t}});var n,i={};Object.defineProperty(this,"MK",{enumerable:!1,configurable:!1,get:function(){var t,e=[];for(t in e.push("<<"),i)e.push("/"+t+" ("+i[t]+")");return e.push(">>"),e.join("\n")},set:function(t){"object"==typeof t&&(i=t)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return i.CA||""},set:function(t){"string"==typeof t&&(i.CA=t)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return n},set:function(t){n=t}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return n.substr(1,n.length-1)},set:function(t){n="/"+t}}),this.caption="l",this.appearanceState="Off",this._AppearanceType=K.RadioButton.Circle,this.appearanceStreamContent=this._AppearanceType.createAppearanceStream(this.optionName)};h(U,W),V.prototype.setAppearance=function(t){if(!("createAppearanceStream"in t)||!("getCA"in t))throw new Error("Couldn't assign Appearance to RadioButton. Appearance was Invalid!");for(var e in this.Kids)if(this.Kids.hasOwnProperty(e)){var n=this.Kids[e];n.appearanceStreamContent=t.createAppearanceStream(n.optionName),n.caption=t.getCA()}},V.prototype.createOption=function(t){var e=new U;return e.Parent=this,e.optionName=t,this.Kids.push(e),Z.call(this,e),e};var Y=function(){z.call(this),this.fontName="zapfdingbats",this.caption="3",this.appearanceState="On",this.value="On",this.textAlign="center",this.appearanceStreamContent=K.CheckBox.createAppearanceStream()};h(Y,z);var X=function(){W.call(this),this.FT="/Tx",Object.defineProperty(this,"multiline",{enumerable:!0,configurable:!0,get:function(){return Boolean(y(this.Ff,13))},set:function(t){!0===Boolean(t)?this.Ff=v(this.Ff,13):this.Ff=b(this.Ff,13)}}),Object.defineProperty(this,"fileSelect",{enumerable:!0,configurable:!0,get:function(){return Boolean(y(this.Ff,21))},set:function(t){!0===Boolean(t)?this.Ff=v(this.Ff,21):this.Ff=b(this.Ff,21)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return Boolean(y(this.Ff,23))},set:function(t){!0===Boolean(t)?this.Ff=v(this.Ff,23):this.Ff=b(this.Ff,23)}}),Object.defineProperty(this,"doNotScroll",{enumerable:!0,configurable:!0,get:function(){return Boolean(y(this.Ff,24))},set:function(t){!0===Boolean(t)?this.Ff=v(this.Ff,24):this.Ff=b(this.Ff,24)}}),Object.defineProperty(this,"comb",{enumerable:!0,configurable:!0,get:function(){return Boolean(y(this.Ff,25))},set:function(t){!0===Boolean(t)?this.Ff=v(this.Ff,25):this.Ff=b(this.Ff,25)}}),Object.defineProperty(this,"richText",{enumerable:!0,configurable:!0,get:function(){return Boolean(y(this.Ff,26))},set:function(t){!0===Boolean(t)?this.Ff=v(this.Ff,26):this.Ff=b(this.Ff,26)}});var t=null;Object.defineProperty(this,"MaxLen",{enumerable:!0,configurable:!1,get:function(){return t},set:function(e){t=e}}),Object.defineProperty(this,"maxLength",{enumerable:!0,configurable:!0,get:function(){return t},set:function(e){Number.isInteger(e)&&(t=e)}}),Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,get:function(){return this.V||this.DV}})};h(X,W);var Q=function(){X.call(this),Object.defineProperty(this,"password",{enumerable:!0,configurable:!0,get:function(){return Boolean(y(this.Ff,14))},set:function(t){!0===Boolean(t)?this.Ff=v(this.Ff,14):this.Ff=b(this.Ff,14)}}),this.password=!0};h(Q,X);var K={CheckBox:{createAppearanceStream:function(){return{N:{On:K.CheckBox.YesNormal},D:{On:K.CheckBox.YesPushDown,Off:K.CheckBox.OffPushDown}}},YesPushDown:function(t){var e=new d(t),i=[],r=n.internal.getFont(t.fontName,t.fontStyle).id,o=n.__private__.encodeColorString(t.color),s=F(t,t.caption);return i.push("0.749023 g"),i.push("0 0 "+l(K.internal.getWidth(t))+" "+l(K.internal.getHeight(t))+" re"),i.push("f"),i.push("BMC"),i.push("q"),i.push("0 0 1 rg"),i.push("/"+r+" "+l(s.fontSize)+" Tf "+o),i.push("BT"),i.push(s.text),i.push("ET"),i.push("Q"),i.push("EMC"),e.stream=i.join("\n"),e},YesNormal:function(t){var e=new d(t),i=n.internal.getFont(t.fontName,t.fontStyle).id,r=n.__private__.encodeColorString(t.color),o=[],s=K.internal.getHeight(t),a=K.internal.getWidth(t),c=F(t,t.caption);return o.push("1 g"),o.push("0 0 "+l(a)+" "+l(s)+" re"),o.push("f"),o.push("q"),o.push("0 0 1 rg"),o.push("0 0 "+l(a-1)+" "+l(s-1)+" re"),o.push("W"),o.push("n"),o.push("0 g"),o.push("BT"),o.push("/"+i+" "+l(c.fontSize)+" Tf "+r),o.push(c.text),o.push("ET"),o.push("Q"),e.stream=o.join("\n"),e},OffPushDown:function(t){var e=new d(t),n=[];return n.push("0.749023 g"),n.push("0 0 "+l(K.internal.getWidth(t))+" "+l(K.internal.getHeight(t))+" re"),n.push("f"),e.stream=n.join("\n"),e}},RadioButton:{Circle:{createAppearanceStream:function(t){var e={D:{Off:K.RadioButton.Circle.OffPushDown},N:{}};return e.N[t]=K.RadioButton.Circle.YesNormal,e.D[t]=K.RadioButton.Circle.YesPushDown,e},getCA:function(){return"l"},YesNormal:function(t){var e=new d(t),n=[],i=K.internal.getWidth(t)<=K.internal.getHeight(t)?K.internal.getWidth(t)/4:K.internal.getHeight(t)/4;i=Number((.9*i).toFixed(5));var r=K.internal.Bezier_C,o=Number((i*r).toFixed(5));return n.push("q"),n.push("1 0 0 1 "+c(K.internal.getWidth(t)/2)+" "+c(K.internal.getHeight(t)/2)+" cm"),n.push(i+" 0 m"),n.push(i+" "+o+" "+o+" "+i+" 0 "+i+" c"),n.push("-"+o+" "+i+" -"+i+" "+o+" -"+i+" 0 c"),n.push("-"+i+" -"+o+" -"+o+" -"+i+" 0 -"+i+" c"),n.push(o+" -"+i+" "+i+" -"+o+" "+i+" 0 c"),n.push("f"),n.push("Q"),e.stream=n.join("\n"),e},YesPushDown:function(t){var e=new d(t),n=[],i=K.internal.getWidth(t)<=K.internal.getHeight(t)?K.internal.getWidth(t)/4:K.internal.getHeight(t)/4,r=(i=Number((.9*i).toFixed(5)),Number((2*i).toFixed(5))),o=Number((r*K.internal.Bezier_C).toFixed(5)),s=Number((i*K.internal.Bezier_C).toFixed(5));return n.push("0.749023 g"),n.push("q"),n.push("1 0 0 1 "+c(K.internal.getWidth(t)/2)+" "+c(K.internal.getHeight(t)/2)+" cm"),n.push(r+" 0 m"),n.push(r+" "+o+" "+o+" "+r+" 0 "+r+" c"),n.push("-"+o+" "+r+" -"+r+" "+o+" -"+r+" 0 c"),n.push("-"+r+" -"+o+" -"+o+" -"+r+" 0 -"+r+" c"),n.push(o+" -"+r+" "+r+" -"+o+" "+r+" 0 c"),n.push("f"),n.push("Q"),n.push("0 g"),n.push("q"),n.push("1 0 0 1 "+c(K.internal.getWidth(t)/2)+" "+c(K.internal.getHeight(t)/2)+" cm"),n.push(i+" 0 m"),n.push(i+" "+s+" "+s+" "+i+" 0 "+i+" c"),n.push("-"+s+" "+i+" -"+i+" "+s+" -"+i+" 0 c"),n.push("-"+i+" -"+s+" -"+s+" -"+i+" 0 -"+i+" c"),n.push(s+" -"+i+" "+i+" -"+s+" "+i+" 0 c"),n.push("f"),n.push("Q"),e.stream=n.join("\n"),e},OffPushDown:function(t){var e=new d(t),n=[],i=K.internal.getWidth(t)<=K.internal.getHeight(t)?K.internal.getWidth(t)/4:K.internal.getHeight(t)/4;i=Number((.9*i).toFixed(5));var r=Number((2*i).toFixed(5)),o=Number((r*K.internal.Bezier_C).toFixed(5));return n.push("0.749023 g"),n.push("q"),n.push("1 0 0 1 "+c(K.internal.getWidth(t)/2)+" "+c(K.internal.getHeight(t)/2)+" cm"),n.push(r+" 0 m"),n.push(r+" "+o+" "+o+" "+r+" 0 "+r+" c"),n.push("-"+o+" "+r+" -"+r+" "+o+" -"+r+" 0 c"),n.push("-"+r+" -"+o+" -"+o+" -"+r+" 0 -"+r+" c"),n.push(o+" -"+r+" "+r+" -"+o+" "+r+" 0 c"),n.push("f"),n.push("Q"),e.stream=n.join("\n"),e}},Cross:{createAppearanceStream:function(t){var e={D:{Off:K.RadioButton.Cross.OffPushDown},N:{}};return e.N[t]=K.RadioButton.Cross.YesNormal,e.D[t]=K.RadioButton.Cross.YesPushDown,e},getCA:function(){return"8"},YesNormal:function(t){var e=new d(t),n=[],i=K.internal.calculateCross(t);return n.push("q"),n.push("1 1 "+l(K.internal.getWidth(t)-2)+" "+l(K.internal.getHeight(t)-2)+" re"),n.push("W"),n.push("n"),n.push(l(i.x1.x)+" "+l(i.x1.y)+" m"),n.push(l(i.x2.x)+" "+l(i.x2.y)+" l"),n.push(l(i.x4.x)+" "+l(i.x4.y)+" m"),n.push(l(i.x3.x)+" "+l(i.x3.y)+" l"),n.push("s"),n.push("Q"),e.stream=n.join("\n"),e},YesPushDown:function(t){var e=new d(t),n=K.internal.calculateCross(t),i=[];return i.push("0.749023 g"),i.push("0 0 "+l(K.internal.getWidth(t))+" "+l(K.internal.getHeight(t))+" re"),i.push("f"),i.push("q"),i.push("1 1 "+l(K.internal.getWidth(t)-2)+" "+l(K.internal.getHeight(t)-2)+" re"),i.push("W"),i.push("n"),i.push(l(n.x1.x)+" "+l(n.x1.y)+" m"),i.push(l(n.x2.x)+" "+l(n.x2.y)+" l"),i.push(l(n.x4.x)+" "+l(n.x4.y)+" m"),i.push(l(n.x3.x)+" "+l(n.x3.y)+" l"),i.push("s"),i.push("Q"),e.stream=i.join("\n"),e},OffPushDown:function(t){var e=new d(t),n=[];return n.push("0.749023 g"),n.push("0 0 "+l(K.internal.getWidth(t))+" "+l(K.internal.getHeight(t))+" re"),n.push("f"),e.stream=n.join("\n"),e}}},createDefaultAppearanceStream:function(t){var e=n.internal.getFont(t.fontName,t.fontStyle).id,i=n.__private__.encodeColorString(t.color);return"/"+e+" "+t.fontSize+" Tf "+i}};K.internal={Bezier_C:.551915024494,calculateCross:function(t){var e=K.internal.getWidth(t),n=K.internal.getHeight(t),i=Math.min(e,n);return{x1:{x:(e-i)/2,y:(n-i)/2+i},x2:{x:(e-i)/2+i,y:(n-i)/2},x3:{x:(e-i)/2,y:(n-i)/2},x4:{x:(e-i)/2+i,y:(n-i)/2+i}}}},K.internal.getWidth=function(t){var e=0;return"object"==typeof t&&(e=u(t.Rect[2])),e},K.internal.getHeight=function(t){var e=0;return"object"==typeof t&&(e=u(t.Rect[3])),e};var Z=i.addField=function(t){if(B.call(this),!(t instanceof W))throw new Error("Invalid argument passed to jsPDF.addField.");return C.call(this,t),t.page=n.internal.getCurrentPageInfo().pageNumber,this};i.addButton=function(t){if(t instanceof z==0)throw new Error("Invalid argument passed to jsPDF.addButton.");return Z.call(this,t)},i.addTextField=function(t){if(t instanceof X==0)throw new Error("Invalid argument passed to jsPDF.addTextField.");return Z.call(this,t)},i.addChoiceField=function(t){if(t instanceof q==0)throw new Error("Invalid argument passed to jsPDF.addChoiceField.");return Z.call(this,t)},"object"==typeof e&&void 0===e.ChoiceField&&void 0===e.ListBox&&void 0===e.ComboBox&&void 0===e.EditBox&&void 0===e.Button&&void 0===e.PushButton&&void 0===e.RadioButton&&void 0===e.CheckBox&&void 0===e.TextField&&void 0===e.PasswordField&&(e.ChoiceField=q,e.ListBox=H,e.ComboBox=D,e.EditBox=j,e.Button=z,e.PushButton=G,e.RadioButton=V,e.CheckBox=Y,e.TextField=X,e.PasswordField=Q,e.AcroForm={Appearance:K}),i.AcroFormChoiceField=q,i.AcroFormListBox=H,i.AcroFormComboBox=D,i.AcroFormEditBox=j,i.AcroFormButton=z,i.AcroFormPushButton=G,i.AcroFormRadioButton=V,i.AcroFormCheckBox=Y,i.AcroFormTextField=X,i.AcroFormPasswordField=Q,i.AcroFormAppearance=K,i.AcroForm={ChoiceField:q,ListBox:H,ComboBox:D,EditBox:j,Button:z,PushButton:G,RadioButton:V,CheckBox:Y,TextField:X,PasswordField:Q,Appearance:K},t.AcroForm={ChoiceField:q,ListBox:H,ComboBox:D,EditBox:j,Button:z,PushButton:G,RadioButton:V,CheckBox:Y,TextField:X,PasswordField:Q,Appearance:K}}(h.jsPDF,"undefined"!=typeof window&&window||void 0!==r.g&&r.g),function(t){var e,n,i,r,o,s,a,l,c,h,u,f,d,p,g,m,y,v,b,x;e=function(){return function(e){return t.prototype=e,new t};function t(){}}(),h=function(t){var e,n,i,r,o,s,a;for(n=0,i=t.length,e=void 0,r=!1,s=!1;!r&&n!==i;)(e=t[n]=t[n].trimLeft())&&(r=!0),n++;for(n=i-1;i&&!s&&-1!==n;)(e=t[n]=t[n].trimRight())&&(s=!0),n--;for(o=/\s+$/g,a=!0,n=0;n!==i;)"\u2028"!=t[n]&&(e=t[n].replace(/\s+/g," "),a&&(e=e.trimLeft()),e&&(a=o.test(e)),t[n]=e),n++;return t},f=function(t){var e,n,r;for(e=void 0,n=(r=t.split(",")).shift();!e&&n;)e=i[n.trim().toLowerCase()],n=r.shift();return e},d=function(t){var e;return(t="auto"===t?"0px":t).indexOf("em")>-1&&!isNaN(Number(t.replace("em","")))&&(t=18.719*Number(t.replace("em",""))+"px"),t.indexOf("pt")>-1&&!isNaN(Number(t.replace("pt","")))&&(t=1.333*Number(t.replace("pt",""))+"px"),(e=p[t])?e:void 0!==(e={"xx-small":9,"x-small":11,small:13,medium:16,large:19,"x-large":23,"xx-large":28,auto:0}[t])||(e=parseFloat(t))?p[t]=e/16:(e=t.match(/([\d\.]+)(px)/),Array.isArray(e)&&3===e.length?p[t]=parseFloat(e[1])/16:p[t]=1)},c=function(t){var e,n,i,c,h;return h=t,c=document.defaultView&&document.defaultView.getComputedStyle?document.defaultView.getComputedStyle(h,null):h.currentStyle?h.currentStyle:h.style,n=void 0,(e={})["font-family"]=f((i=function(t){return t=t.replace(/-\D/g,function(t){return t.charAt(1).toUpperCase()}),c[t]})("font-family"))||"times",e["font-style"]=r[i("font-style")]||"normal",e["text-align"]=o[i("text-align")]||"left","bold"===(n=s[i("font-weight")]||"normal")&&("normal"===e["font-style"]?e["font-style"]=n:e["font-style"]=n+e["font-style"]),e["font-size"]=d(i("font-size"))||1,e["line-height"]=d(i("line-height"))||1,e.display="inline"===i("display")?"inline":"block",n="block"===e.display,e["margin-top"]=n&&d(i("margin-top"))||0,e["margin-bottom"]=n&&d(i("margin-bottom"))||0,e["padding-top"]=n&&d(i("padding-top"))||0,e["padding-bottom"]=n&&d(i("padding-bottom"))||0,e["margin-left"]=n&&d(i("margin-left"))||0,e["margin-right"]=n&&d(i("margin-right"))||0,e["padding-left"]=n&&d(i("padding-left"))||0,e["padding-right"]=n&&d(i("padding-right"))||0,e["page-break-before"]=i("page-break-before")||"auto",e.float=a[i("cssFloat")]||"none",e.clear=l[i("clear")]||"none",e.color=i("color"),e},g=function(t,e,n){var i,r,o,s,a;if(o=!1,r=void 0,s=void 0,i=n["#"+t.id])if("function"==typeof i)o=i(t,e);else for(r=0,s=i.length;!o&&r!==s;)o=i[r](t,e),r++;if(i=n[t.nodeName],!o&&i)if("function"==typeof i)o=i(t,e);else for(r=0,s=i.length;!o&&r!==s;)o=i[r](t,e),r++;for(a="string"==typeof t.className?t.className.split(" "):[],r=0;r<a.length;r++)if(i=n["."+a[r]],!o&&i)if("function"==typeof i)o=i(t,e);else for(r=0,s=i.length;!o&&r!==s;)o=i[r](t,e),r++;return o},x=function(t,e){var n,i,r,o,s,a,l,c;n=[],i=[],r=0,c=0;for(var h=0;h<t.rows[0].cells.length;h++)c+=t.rows[0].cells[h].colSpan;for(a=t.clientWidth;r<c;){for(l=t.rows[0].cells[r],h=0;h<l.colSpan;h++)i[r+h]={name:l.textContent.toLowerCase().replace(/\s+/g,"")+"_"+h,prompt:l.textContent.replace(/\r?\n/g,""),width:l.clientWidth/a*e.settings.width/l.colSpan};r+=h}for(r=1;r<t.rows.length;){for(s=t.rows[r],o={},h=0;h<s.cells.length;)o[i[h].name]=s.cells[h].textContent.replace(/\r?\n/g,""),h++;n.push(o),r++}return{rows:n,headers:i}};var T={SCRIPT:1,STYLE:1,NOSCRIPT:1,OBJECT:1,EMBED:1,SELECT:1},F=1;n=function(t,i,r){var o,s,a,l,h,u,f,d;for(s=t.childNodes,o=void 0,(h="block"===(a=c(t)).display)&&(i.setBlockBoundary(),i.setBlockStyle(a)),l=0,u=s.length;l<u;){if("object"==typeof(o=s[l])){if(i.executeWatchFunctions(o),1===o.nodeType&&"HEADER"===o.nodeName){var p=o,y=i.pdf.margins_doc.top;i.pdf.internal.events.subscribe("addPage",function(t){i.y=y,n(p,i,r),i.pdf.margins_doc.top=i.y+10,i.y+=10},!1)}if(8===o.nodeType&&"#comment"===o.nodeName)~o.textContent.indexOf("ADD_PAGE")&&(i.pdf.addPage(),i.y=i.pdf.margins_doc.top);else if(1!==o.nodeType||T[o.nodeName])if(3===o.nodeType){var v=o.nodeValue;if(o.nodeValue&&"LI"===o.parentNode.nodeName)if("OL"===o.parentNode.parentNode.nodeName)v=F+++". "+v;else{var b=a["font-size"],_=(3-.75*b)*i.pdf.internal.scaleFactor,R=.75*b*i.pdf.internal.scaleFactor,w=1.74*b/i.pdf.internal.scaleFactor;d=function(t,e){this.pdf.circle(t+_,e+R,w,"FD")}}16&o.ownerDocument.body.compareDocumentPosition(o)&&i.addText(v,a)}else"string"==typeof o&&i.addText(o,a);else{var C;if("IMG"===o.nodeName){var O=o.getAttribute("src");C=m[i.pdf.sHashCode&&i.pdf.sHashCode(O)||O]}if(C){i.pdf.internal.pageSize.getHeight()-i.pdf.margins_doc.bottom<i.y+o.height&&i.y>i.pdf.margins_doc.top&&(i.pdf.addPage(),i.y=i.pdf.margins_doc.top,i.executeWatchFunctions(o));var P=c(o),E=i.x,S=12/i.pdf.internal.scaleFactor,L=(P["margin-left"]+P["padding-left"])*S,B=(P["margin-right"]+P["padding-right"])*S,A=(P["margin-top"]+P["padding-top"])*S,I=(P["margin-bottom"]+P["padding-bottom"])*S;void 0!==P.float&&"right"===P.float?E+=i.settings.width-o.width-B:E+=L,i.pdf.addImage(C,E,i.y+A,o.width,o.height),C=void 0,"right"===P.float||"left"===P.float?(i.watchFunctions.push(function(t,e,n,r){return i.y>=e?(i.x+=t,i.settings.width+=n,!0):!!(r&&1===r.nodeType&&!T[r.nodeName]&&i.x+r.width>i.pdf.margins_doc.left+i.pdf.margins_doc.width)&&(i.x+=t,i.y=e,i.settings.width+=n,!0)}.bind(this,"left"===P.float?-o.width-L-B:0,i.y+o.height+A+I,o.width)),i.watchFunctions.push(function(t,e,n){return!(i.y<t&&e===i.pdf.internal.getNumberOfPages())||1===n.nodeType&&"both"===c(n).clear&&(i.y=t,!0)}.bind(this,i.y+o.height,i.pdf.internal.getNumberOfPages())),i.settings.width-=o.width+L+B,"left"===P.float&&(i.x+=o.width+L+B)):i.y+=o.height+A+I}else if("TABLE"===o.nodeName)i.pdf.autoTable?(i.y+=10,i.pdf.autoTable({theme:"grid",html:o,startY:i.y,styles:{font:i.pdf.getFont().fontName,fontSize:i.pdf.getFontSize(),textColor:i.pdf.getTextColor()},margin:{top:i.pdf.margins_doc.top,left:i.x,right:i.pdf.internal.pageSize.getWidth()-(i.x+i.settings.width),bottom:i.pdf.margins_doc.bottom}}),i.y=i.pdf.lastAutoTable.finalY):(f=x(o,i),i.y+=10,i.pdf.table(i.x,i.y,f.rows,f.headers,{autoSize:!1,printHeaders:r.printHeaders,margins:i.pdf.margins_doc,css:c(o)}),i.y=i.pdf.internal.__cell__.lastCell.y+i.pdf.internal.__cell__.lastCell.height);else if("OL"===o.nodeName||"UL"===o.nodeName)F=1,g(o,i,r)||n(o,i,r),i.y+=10;else if("LI"===o.nodeName){var N=i.x;i.x+=20/i.pdf.internal.scaleFactor,i.y+=3,g(o,i,r)||n(o,i,r),i.x=N}else"BR"===o.nodeName?(i.y+=a["font-size"]*i.pdf.internal.scaleFactor,i.addText("\u2028",e(a))):g(o,i,r)||n(o,i,r)}}l++}if(r.outY=i.y,h)return i.setBlockBoundary(d)},m={},y=function(t,e,n,i){var r,o=t.getElementsByTagName("img"),s=o.length,a=0;function l(){e.pdf.internal.events.publish("imagesLoaded"),i(r)}function c(t,n,i){if(t){var o=new Image;r=++a,o.crossOrigin="",o.onerror=o.onload=function(){if(o.complete&&(0===o.src.indexOf("data:image/")&&(o.width=n||o.width||0,o.height=i||o.height||0),o.width+o.height)){var r=e.pdf.sHashCode&&e.pdf.sHashCode(t)||t;m[r]=m[r]||o}--a||l()},o.src=t}}for(;s--;)c(o[s].getAttribute("src"),o[s].width,o[s].height);return a||l()},v=function(t,e,i){var r=t.getElementsByTagName("footer");if(r.length>0){r=r[0];var o=e.pdf.internal.write,s=e.y;e.pdf.internal.write=function(){},n(r,e,i);var a=Math.ceil(e.y-s)+5;e.y=s,e.pdf.internal.write=o,e.pdf.margins_doc.bottom+=a;for(var l=function(t){var o=void 0!==t?t.pageNumber:1,s=e.y;e.y=e.pdf.internal.pageSize.getHeight()-e.pdf.margins_doc.bottom,e.pdf.margins_doc.bottom-=a;for(var l=r.getElementsByTagName("span"),c=0;c<l.length;++c)(" "+l[c].className+" ").replace(/[\n\t]/g," ").indexOf(" pageCounter ")>-1&&(l[c].innerHTML=o),(" "+l[c].className+" ").replace(/[\n\t]/g," ").indexOf(" totalPages ")>-1&&(l[c].innerHTML="###jsPDFVarTotalPages###");n(r,e,i),e.pdf.margins_doc.bottom+=a,e.y=s},c=r.getElementsByTagName("span"),h=0;h<c.length;++h)(" "+c[h].className+" ").replace(/[\n\t]/g," ").indexOf(" totalPages ")>-1&&e.pdf.internal.events.subscribe("htmlRenderingFinished",e.pdf.putTotalPages.bind(e.pdf,"###jsPDFVarTotalPages###"),!0);e.pdf.internal.events.subscribe("addPage",l,!1),l(),T.FOOTER=1}},b=function(t,e,r,o,s,a){if(!e)return!1;"string"==typeof e||e.parentNode||(e=""+e.innerHTML),"string"==typeof e&&(e=function(t){var e,n,i;return i="jsPDFhtmlText"+Date.now().toString()+(1e3*Math.random()).toFixed(0),(n=document.createElement("div")).className="sjs-pdf-hidden-html-div",n.style.cssText="position: absolute !important;clip: rect(1px 1px 1px 1px); /* IE6, IE7 */clip: rect(1px, 1px, 1px, 1px);padding:0 !important;border:0 !important;height: 1px !important;width: 1px !important; top:auto;left:-100px;overflow: hidden;",n.innerHTML='<iframe style="height:1px;width:1px" name="'+i+'" />',document.body.appendChild(n),(e=window.frames[i]).document.open(),e.document.writeln(t),e.document.close(),e.document.body}(e.replace(/<\/?script[^>]*?>/gi,"")));for(var l=Object.keys(t.getFontList()),c=0;c<l.length;++c){var h=l[c],f=h.toLowerCase();i[f]||(i[f]=h)}var d,p=new u(t,r,o,s);return y.call(this,e,p,s.elementHandlers,function(t){v(e,p,s.elementHandlers),n(e,p,s.elementHandlers),p.pdf.internal.events.publish("htmlRenderingFinished"),d=p.dispose(),"function"==typeof a?a(d):t&&console.error("jsPDF Warning: rendering issues? provide a callback to fromHTML!")}),d||{x:p.x,y:p.y}},(u=function(t,e,n,i){return this.pdf=t,this.x=e,this.y=n,this.settings=i,this.watchFunctions=[],this.init(),this}).prototype.init=function(){return this.paragraph={text:[],style:[]},this.pdf.internal.write("q")},u.prototype.dispose=function(){return this.pdf.internal.write("Q"),{x:this.x,y:this.y,ready:!0}},u.prototype.executeWatchFunctions=function(t){var e=!1,n=[];if(this.watchFunctions.length>0){for(var i=0;i<this.watchFunctions.length;++i)!0===this.watchFunctions[i](t)?e=!0:n.push(this.watchFunctions[i]);this.watchFunctions=n}return e},u.prototype.splitFragmentsIntoLines=function(t,n){var i,r,o,s,a,l,c,h,u,f,d,p;h=this.pdf.internal.scaleFactor,r=void 0,c=void 0,o=void 0,p=void 0,l=void 0,a=void 0,s=void 0,f=[u=[]],i=0,d=this.settings.width;const g=this.pdf.getFont().fontName,m=this.pdf.getFont().fontStyle;for(;t.length;)if(o=t.shift(),p=n.shift(),o)if(r=p["font-family"],c=p["font-style"],this.pdf.setFont(r,c),l={textIndent:i,fontSize:12*p["font-size"]},a=this.pdf.getStringUnitWidth(o,l)*l.fontSize/h,"\u2028"==o)u=[],f.push(u);else if(i+a>d){for(s=this.pdf.splitTextToSize(o,d,l),u.push([s.shift(),p]);s.length;)u=[[s.shift(),p]],f.push(u);i=this.pdf.getStringUnitWidth(u[0][0],l)*l.fontSize/h}else u.push([o,p]),i+=a;if(void 0!==p["text-align"]&&("center"===p["text-align"]||"right"===p["text-align"]||"justify"===p["text-align"]))for(var y=0;y<f.length;++y){var v=this.pdf.getStringUnitWidth(f[y][0][0],l)*l.fontSize/h;y>0&&(f[y][0][1]=e(f[y][0][1]));var b=d-v;if("right"===p["text-align"])f[y][0][1]["margin-left"]=b;else if("center"===p["text-align"])f[y][0][1]["margin-left"]=b/2;else if("justify"===p["text-align"]){var x=f[y][0][0].split(" ").length-1;f[y][0][1]["word-spacing"]=b/x,y===f.length-1&&(f[y][0][1]["word-spacing"]=0)}}return this.pdf.setFont(g,m),f},u.prototype.RenderTextFragment=function(t,e){var n,i;if(i=0,this.pdf.internal.pageSize.getHeight()-this.pdf.margins_doc.bottom<this.y+this.pdf.internal.getFontSize()){this.pdf.internal.write("ET","Q","Q");const t=this.pdf.getCurrentPageInfo().pageNumber;this.pdf.getNumberOfPages()===t?this.pdf.addPage():this.pdf.setPage(t+1),this.y=this.pdf.margins_doc.top,this.pdf.internal.write("q","q","BT",this.getPdfColor(e.color),this.pdf.internal.getCoordinateString(this.x),this.pdf.internal.getVerticalCoordinateString(this.y),"Td"),i=Math.max(i,e["line-height"],e["font-size"]),this.pdf.internal.write(0,(-12*i).toFixed(2),"Td")}n=this.pdf.internal.getFont(e["font-family"],e["font-style"]);var r=this.getPdfColor(e.color);r!==this.lastTextColor&&(this.pdf.internal.write(r),this.lastTextColor=r),void 0!==e["word-spacing"]&&e["word-spacing"]>0&&this.pdf.internal.write(e["word-spacing"].toFixed(2),"Tw");var o;o="Identity-H"!==n.encoding?"("+this.pdf.internal.pdfEscape(t)+")":"<"+function(t,e){t=t||"";var n,i="",r=0,o="",s=e.encoding;if("Identity-H"!==e.encoding)return t;for(o=t,r=0;r<o.length;r+=1)e.metadata.hasOwnProperty("cmap")&&(n=e.metadata.cmap.unicode.codeMap[o[r].charCodeAt(0)]),n||o[r].charCodeAt(0)<256&&e.metadata.hasOwnProperty("Unicode")?i+=o[r]:i+="";var a="";return parseInt(e.id.slice(1))<14||"WinAnsiEncoding"===s?a=this.pdf.internal.pdfEscape(i,key).split("").map(function(t){return t.charCodeAt(0).toString(16)}).join(""):"Identity-H"===s&&(a=function(t,e){for(var n,i=e.metadata.Unicode.widths,r=["","0","00","000","0000"],o=[""],s=0,a=t.length;s<a;++s){if(n=e.metadata.characterToGlyph(t.charCodeAt(s)),e.metadata.glyIdsUsed.push(n),e.metadata.toUnicode[n]=t.charCodeAt(s),-1==i.indexOf(n)&&(i.push(n),i.push([parseInt(e.metadata.widthOfGlyph(n),10)])),"0"==n)return o.join("");n=n.toString(16),o.push(r[4-n.length],n)}return o.join("")}(i,e)),a}(t,n)+">",this.pdf.internal.write("/"+n.id,(12*e["font-size"]).toFixed(2),"Tf",o+" Tj"),void 0!==e["word-spacing"]&&this.pdf.internal.write(0,"Tw")},u.prototype.getPdfColor=function(t){var e,n,i,r=/rgb\s*\(\s*(\d+),\s*(\d+),\s*(\d+\s*)\)/.exec(t);if(null!=r)e=parseInt(r[1]),n=parseInt(r[2]),i=parseInt(r[3]);else{if("string"==typeof t&&"#"!=t.charAt(0)){var o=new RGBColor(t);t=o.ok?o.toHex():"#000000"}e=t.substring(1,3),e=parseInt(e,16),n=t.substring(3,5),n=parseInt(n,16),i=t.substring(5,7),i=parseInt(i,16)}if("string"==typeof e&&/^#[0-9A-Fa-f]{6}$/.test(e)){var s=parseInt(e.substr(1),16);e=s>>16&255,n=s>>8&255,i=255&s}var a=this.f3;return 0===e&&0===n&&0===i||void 0===n?a(e/255)+" g":[a(e/255),a(n/255),a(i/255),"rg"].join(" ")},u.prototype.f3=function(t){return t.toFixed(3)},u.prototype.renderParagraph=function(t){var e,n,i,r,o,s,a,l,c,u,f,d,p;if(i=h(this.paragraph.text),d=this.paragraph.style,e=this.paragraph.blockstyle,this.paragraph.priorblockstyle,this.paragraph={text:[],style:[],blockstyle:{},priorblockstyle:e},i.join("").trim()){a=this.splitFragmentsIntoLines(i,d),s=void 0,l=void 0,n=12/this.pdf.internal.scaleFactor,this.priorMarginBottom=this.priorMarginBottom||0,f=(Math.max((e["margin-top"]||0)-this.priorMarginBottom,0)+(e["padding-top"]||0))*n,u=((e["margin-bottom"]||0)+(e["padding-bottom"]||0))*n,this.priorMarginBottom=e["margin-bottom"]||0,"always"===e["page-break-before"]&&(this.pdf.addPage(),this.y=0,f=((e["margin-top"]||0)+(e["padding-top"]||0))*n),c=this.pdf.internal.write,r=void 0,o=void 0,this.y+=f,c("q","BT 0 g",this.pdf.internal.getCoordinateString(this.x),this.pdf.internal.getVerticalCoordinateString(this.y),"Td");for(var g=0;a.length;){for(l=0,r=0,o=(s=a.shift()).length;r!==o;)s[r][0].trim()&&(l=Math.max(l,s[r][1]["line-height"],s[r][1]["font-size"]),p=7*s[r][1]["font-size"]),r++;var m=0,y=0;for(void 0!==s[0][1]["margin-left"]&&s[0][1]["margin-left"]>0&&(m=(y=this.pdf.internal.getCoordinateString(s[0][1]["margin-left"]))-g,g=y),c(m+Math.max(e["margin-left"]||0,0)*n,(-12*l).toFixed(2),"Td"),r=0,o=s.length;r!==o;)s[r][0]&&this.RenderTextFragment(s[r][0],s[r][1]),r++;if(this.y+=l*n,this.executeWatchFunctions(s[0][1])&&a.length>0){var v=[],b=[];a.forEach(function(t){for(var e=0,n=t.length;e!==n;)t[e][0]&&(v.push(t[e][0]+" "),b.push(t[e][1])),++e}),a=this.splitFragmentsIntoLines(h(v),b),c("ET","Q"),c("q","BT 0 g",this.pdf.internal.getCoordinateString(this.x),this.pdf.internal.getVerticalCoordinateString(this.y),"Td")}}return t&&"function"==typeof t&&t.call(this,this.x-9,this.y-p/2),c("ET","Q"),this.y+=u}},u.prototype.setBlockBoundary=function(t){return this.renderParagraph(t)},u.prototype.setBlockStyle=function(t){return this.paragraph.blockstyle=t},u.prototype.addText=function(t,e){return this.paragraph.text.push(t),this.paragraph.style.push(e)},i={helvetica:"helvetica","sans-serif":"helvetica","times new roman":"times",serif:"times",times:"times",monospace:"courier",courier:"courier"},s={100:"normal",200:"normal",300:"normal",400:"normal",500:"bold",600:"bold",700:"bold",800:"bold",900:"bold",normal:"normal",bold:"bold",bolder:"bold",lighter:"normal"},r={normal:"normal",italic:"italic",oblique:"italic"},o={left:"left",right:"right",center:"center",justify:"justify"},a={none:"none",right:"right",left:"left"},l={none:"none",both:"both"},p={normal:1},t.fromHTML=function(t,e,n,i,r,o){return this.margins_doc=o||{top:0,bottom:0},i||(i={}),i.elementHandlers||(i.elementHandlers={}),b(this,t,isNaN(e)?4:e,isNaN(n)?4:n,i,r)}}(h.jsPDF.API);var B,A,I=function(){function t(e){var n=this;this._base64Normal=void 0,this._base64Bold=void 0,void 0===e.orientation?void 0===e.format||e.format[0]<e.format[1]?this._orientation="p":this._orientation="l":this._orientation=e.orientation,this._format=e.format||"a4",Array.isArray(this._format)&&(this._format=this._format.map(function(e){return e*t.MM_TO_PT})),this._fontSize=e.fontSize||t.FONT_SIZE,e.fontName?this._fontName=e.fontName:t.SEGOE_BOLD||t.SEGOE_NORMAL?this._fontName="segoe":this._fontName=L.STANDARD_FONT,void 0===e.fontName||void 0===e.base64Normal&&void 0===e.base64Bold?"segoe"===this.fontName&&(this._base64Normal=t.SEGOE_NORMAL,this._base64Bold=t.SEGOE_BOLD):(this._base64Normal=e.base64Normal||e.base64Bold,this._base64Bold=e.base64Bold||e.base64Normal),this._margins=L.clone(e.margins),void 0===this._margins&&(this._margins={}),void 0===this._margins.top&&(this._margins.top=10),void 0===this._margins.bot&&(this._margins.bot=10),void 0===this._margins.left&&(this._margins.left=10),void 0===this._margins.right&&(this._margins.right=10),Object.keys(this._margins).forEach(function(e){n._margins[e]=n._margins[e]*t.MM_TO_PT}),this._htmlRenderAs=e.htmlRenderAs||"auto",this._matrixRenderAs=e.matrixRenderAs||"auto",this._readonlyRenderAs=e.readonlyRenderAs||"auto",this._compress=e.compress||!1,this._applyImageFit=e.applyImageFit||!1,this._useLegacyBooleanRendering=e.useLegacyBooleanRendering||!1,this._isRTL=e.isRTL||!1,this._tagboxSelectedChoicesOnly=e.tagboxSelectedChoicesOnly||!1}return Object.defineProperty(t.prototype,"leftTopPoint",{get:function(){return{xLeft:this.margins.left,yTop:this.margins.top}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontSize",{get:function(){return this._fontSize},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontName",{get:function(){return this._fontName},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"base64Normal",{get:function(){return this._base64Normal},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"base64Bold",{get:function(){return this._base64Bold},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"useCustomFontInHtml",{get:function(){return this._useCustomFontInHtml},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"margins",{get:function(){return this._margins},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"format",{get:function(){return this._format},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"orientation",{get:function(){return this._orientation},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"htmlRenderAs",{get:function(){return this._htmlRenderAs},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"matrixRenderAs",{get:function(){return this._matrixRenderAs},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"readonlyRenderAs",{get:function(){return this._readonlyRenderAs},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"compress",{get:function(){return this._compress},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"applyImageFit",{get:function(){return this._applyImageFit},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"useLegacyBooleanRendering",{get:function(){return this._useLegacyBooleanRendering},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isRTL",{get:function(){return this._isRTL},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tagboxSelectedChoicesOnly",{get:function(){return this._tagboxSelectedChoicesOnly},enumerable:!1,configurable:!0}),t.MM_TO_PT=72/25.4,t.FONT_SIZE=14,t}(),N=function(t){function e(n){void 0===n&&(n={});var i,r,o=t.call(this,n)||this,s={orientation:o.orientation,unit:"pt",format:o.format,compress:o.compress};return o._doc=new h.jsPDF(s),void 0===o.base64Normal||L.isFontExist(o,o.fontName)||(e.addFont(o.fontName,o.base64Normal,"normal"),e.addFont(o.fontName,o.base64Bold,"bold"),o._doc=new h.jsPDF(s)),i=o._doc,r=i.AcroFormAppearance.RadioButton.Circle.YesNormal,i.AcroFormAppearance.RadioButton.Circle.YesNormal=function(t){var e=r(t),n=e.stream.split("\n"),o=i.__private__.encodeColorString(t.color);return n[0]=n[0]+"\n"+o+"\n"+o.toUpperCase(),e.stream=n.join("\n"),e},o._useCustomFontInHtml=n.useCustomFontInHtml&&L.isFontExist(o,o.fontName),o._helperDoc=new h.jsPDF(s),o._doc.setFont(o.fontName),o._helperDoc.setFont(o.fontName),o._doc.setFontSize(o.fontSize),o._helperDoc.setFontSize(o.fontSize),o._fontStyle="normal",o.marginsStack=[],o}return n(e,t),e.addFont=function(t,n,i){var r=e.customFonts[t];r||(r={},e.customFonts[t]=r),r[i]=n,h.jsPDF.API.events.push(["addFonts",function(){var n=e.customFonts[t];if(n&&n[i]){var r="".concat(t,"-").concat(i,".ttf");this.addFileToVFS(r,n[i]),this.addFont(r,t,i)}}])},Object.defineProperty(e.prototype,"doc",{get:function(){return this._doc},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"helperDoc",{get:function(){return this._helperDoc},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fontName",{get:function(){return this._fontName},set:function(t){this._fontName=t,this._doc.setFont(t),this._helperDoc.setFont(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fontSize",{get:function(){return this._fontSize},set:function(t){this._fontSize=t,this._doc.setFontSize(t),this._helperDoc.setFontSize(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fontStyle",{get:function(){return this._fontStyle},set:function(t){this._fontStyle=t,this._doc.setFont(this._fontName,t),this._helperDoc.setFont(this._fontName,t)},enumerable:!1,configurable:!0}),e.prototype.measureText=function(t,e,n){var i=this;void 0===t&&(t=1),void 0===e&&(e=this._fontStyle),void 0===n&&(n=this._fontSize);var r=this._helperDoc.getFontSize();this._helperDoc.setFontSize(n),this._helperDoc.setFont(this._fontName,e);var o,s=this._helperDoc.getLineHeight()/this._helperDoc.internal.scaleFactor;return o="number"==typeof t?s*t:(t="string"==typeof t?t:L.getLocString(t)).split("").reduce(function(t,e){return t+i._helperDoc.getTextWidth(e)},0),this._helperDoc.setFontSize(r),this._helperDoc.setFont(this._fontName,"normal"),{width:o,height:s}},Object.defineProperty(e.prototype,"unitWidth",{get:function(){return this.measureText().width},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"unitHeight",{get:function(){return this.measureText().height},enumerable:!1,configurable:!0}),e.prototype.pushMargins=function(t,e){this.marginsStack.push({left:this.margins.left,right:this.margins.right}),void 0!==t&&(this.margins.left=t),void 0!==e&&(this.margins.right=e)},e.prototype.popMargins=function(){var t=this.marginsStack.pop();this.margins.left=t.left,this.margins.right=t.right},Object.defineProperty(e.prototype,"paperWidth",{get:function(){return this.doc.internal.pageSize.width},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"paperHeight",{get:function(){return this.doc.internal.pageSize.height},enumerable:!1,configurable:!0}),e.prototype.getNumberOfPages=function(){return this.doc.getNumberOfPages()},e.prototype.addPage=function(){this.doc.addPage()},e.prototype.getCurrentPageIndex=function(){return this.doc.getCurrentPageInfo().pageNumber-1},e.prototype.setPage=function(t){this.doc.setPage(t+1)},e.customFonts={},e}(I),M=r(400),k=function(){function t(){}return t.findBotInterval=function(t,e,n,i){var r=t.search(e,n);return r.push({pageIndex:0,xLeft:i.margins.left,xRight:i.margins.left,yBot:i.margins.top,absBot:i.margins.top}),r.reduce(function(t,i){return Math.abs(i.xRight-e)<L.EPSILON||Math.abs(i.xLeft-n)<L.EPSILON||i.pageIndex<t.pageIndex?t:i.pageIndex>t.pageIndex||i.yBot>t.yBot?i:t},r[r.length-1])},t.addPack=function(t,e,n){for(var i=t.length;i<=e;i++)t.push([]);t[e].push(n)},t.pack=function(e,n){var i=n.paperHeight-n.margins.top-n.margins.bot,r=[];e.forEach(function(t){r.push([]),t.forEach(function(t){var e;t.height>i+L.EPSILON?(e=r[r.length-1]).push.apply(e,t.unfold()):r[r.length-1].push(t)})}),r.forEach(function(t){t.sort(function(t,e){return t.yTop<e.yTop?-1:t.yTop>e.yTop||t.xLeft>e.xLeft?1:t.xLeft<e.xLeft?-1:0})});var o=0,s=[],a=n.paperHeight-n.margins.bot;return r.forEach(function(e){var i=new M.Ay,r=0;e.forEach(function(e){var l=t.findBotInterval(i,e.xLeft,e.xRight,n),c=l.pageIndex,h=l.yBot,u=l.absBot,f=e.height;e.yTop=h+e.yTop-u,(Math.abs(e.yTop-n.margins.top)>L.EPSILON&&e.yTop+f>a+L.EPSILON||e.isPageBreak)&&(e.yTop=n.margins.top,c++,r=Math.max(r,c)),i.insert(e.xLeft,e.xRight,{pageIndex:c,xLeft:e.xLeft,xRight:e.xRight,yBot:e.yTop+f,absBot:e.yBot}),e.yBot=e.yTop+f,t.addPack(s,o+c,e)}),o+=r+1}),s},t}();!function(t){t.NotSet="notset",t.Left="left",t.Center="center",t.Right="right"}(B||(B={})),function(t){t.NotSet="notset",t.Top="top",t.Middle="middle",t.Bottom="bottom"}(A||(A={}));var W=function(){function t(t,e,n,i,r){this.packs=t,this.controller=e,this._rect=n,this._countPages=i,this._pageNumber=r}return Object.defineProperty(t.prototype,"pageCount",{get:function(){return this._countPages},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"countPages",{get:function(){return this._countPages},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pageNumber",{get:function(){return this._pageNumber},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rect",{get:function(){return this._rect},enumerable:!1,configurable:!0}),t.prototype.alignRect=function(t,e){void 0===t.margins?t.margins={left:0,right:0,top:0,bot:0}:(void 0===t.margins.left&&(t.margins.left=0),void 0===t.margins.right&&(t.margins.right=0),void 0===t.margins.top&&(t.margins.top=0),void 0===t.margins.bot&&(t.margins.bot=0)),void 0===t.rect&&(void 0!==t.horizontalAlign&&t.horizontalAlign!==B.NotSet||(t.horizontalAlign=B.Center),void 0!==t.verticalAlign&&t.verticalAlign!==A.NotSet||(t.verticalAlign=A.Middle));var n=L.clone(this.rect);if(void 0!==t.horizontalAlign)switch(t.horizontalAlign){case B.Left:n.xLeft=this.rect.xLeft+t.margins.left,n.xRight=Math.min(this.rect.xRight-t.margins.right,this.rect.xLeft+t.margins.left+e.width);break;case B.Center:n.xLeft=Math.max(this.rect.xLeft+t.margins.left,(this.rect.xLeft+this.rect.xRight-e.width)/2),n.xRight=Math.min(this.rect.xRight-t.margins.right,(this.rect.xLeft+this.rect.xRight+e.width)/2);break;case B.Right:n.xLeft=Math.max(this.rect.xLeft+t.margins.left,this.rect.xRight-t.margins.right-e.width),n.xRight=this.rect.xRight-t.margins.right}else n.xLeft=t.rect.xLeft||this.rect.xLeft,n.xRight=t.rect.xRight||this.rect.xRight;if(void 0!==t.verticalAlign)switch(t.verticalAlign){case A.Top:n.yTop=this.rect.yTop+t.margins.top,n.yBot=Math.min(this.rect.yBot-t.margins.bot,this.rect.yTop+t.margins.top+e.height);break;case A.Middle:n.yTop=Math.max(this.rect.yTop+t.margins.top,(this.rect.yTop+this.rect.yBot-e.height)/2),n.yBot=Math.min(this.rect.yBot-t.margins.bot,(this.rect.yTop+this.rect.yBot+e.height)/2);break;case A.Bottom:n.yTop=Math.max(this.rect.yTop+t.margins.top,this.rect.yBot-t.margins.bot-e.height),n.yBot=this.rect.yBot-t.margins.bot}else n.yTop=t.rect.yTop||this.rect.yTop,n.yBot=t.rect.yBot||this.rect.yBot;return n},t.prototype.drawText=function(t){void 0===(t=L.clone(t)).fontSize&&(t.fontSize=I.FONT_SIZE),void 0===t.isBold&&(t.isBold=!1);var e=this.controller.measureText(t.text,t.isBold?"bold":"normal",t.fontSize),n=this.alignRect(t,e);t.isBold?this.packs.push(new _(null,this.controller,n,t.text)):this.packs.push(new b(null,this.controller,n,t.text)),this.packs[this.packs.length-1].fontSize=t.fontSize},t.prototype.drawImage=function(t){return s(this,void 0,void 0,function(){var e,n,i,r;return a(this,function(o){switch(o.label){case 0:return void 0===(t=L.clone(t)).width&&(t.width=this.rect.xRight-this.rect.xLeft),void 0===t.height&&(t.height=this.rect.yBot-this.rect.yTop),e={width:t.width,height:t.height},n=this.alignRect(t,e),this.controller.pushMargins(0,0),r=(i=this.packs).push,[4,L.createImageFlat(L.createPoint(n,!0,!0),null,this.controller,{link:t.base64,width:n.xRight-n.xLeft,height:n.yBot-n.yTop,objectFit:t.imageFit},!!t.imageFit||this.controller.applyImageFit)];case 1:return r.apply(i,[o.sent()]),this.controller.popMargins(),[2]}})})},t}(),q=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.unshift=function(t){this.hasFunc(t)||(null==this.callbacks&&(this.callbacks=new Array),this.callbacks.unshift(t))},e.prototype.fire=function(t,e){return s(this,void 0,void 0,function(){var n;return a(this,function(i){switch(i.label){case 0:if(null==this.callbacks)return[2];n=0,i.label=1;case 1:return n<this.callbacks.length?[4,this.callbacks[n](t,e)]:[3,4];case 2:i.sent(),i.label=3;case 3:return n++,[3,1];case 4:return[2]}})})},e}(c.EventBase),H=function(){function t(){}return t.process_header_events=function(t,e,n){return s(this,void 0,void 0,function(){var i;return a(this,function(r){switch(r.label){case 0:t.haveCommercialLicense||t.onRenderHeader.add(function(t,e){e.drawText({text:"SurveyJS PDF | Please purchase a SurveyJS PDF developer license to use it in your app | https://surveyjs.io/Buy",fontSize:10})}),i=0,r.label=1;case 1:return i<n.length?[4,t.onRenderHeader.fire(t,new W(n[i],e,L.createHeaderRect(e),n.length,i+1))]:[3,5];case 2:return r.sent(),[4,t.onRenderFooter.fire(t,new W(n[i],e,L.createFooterRect(e),n.length,i+1))];case 3:r.sent(),r.label=4;case 4:return i++,[3,1];case 5:return[2]}})})},t}(),D=function(t){function e(e,n){var i=t.call(this,e)||this;return i.onRenderHeader=new q,i.onRenderFooter=new q,i.onRenderQuestion=new q,i.onRenderPanel=new q,i.onRenderPage=new q,i.onDocControllerCreated=new c.EventBase,i.onRenderCheckItemAcroform=new q,i.onRenderRadioGroupWrapAcroform=new q,i.onRenderRadioItemAcroform=new q,void 0===n&&(n={}),"inputPerPage"==i.questionsOnPageMode&&(i.questionsOnPageMode="standard"),i.options=L.clone(n),i}return n(e,t),Object.defineProperty(e.prototype,"haveCommercialLicense",{get:function(){var t=c.hasLicense;return!!t&&t(2)},set:function(t){console.error("As of v1.9.101, the haveCommercialLicense property is not supported. To activate your license, use the setLicenseKey(key) method as shown on the following page: https://surveyjs.io/remove-alert-banner")},enumerable:!1,configurable:!0}),e.prototype.getUpdatedCheckItemAcroformOptions=function(t){this.onRenderCheckItemAcroform.fire(this,t)},e.prototype.getUpdatedRadioGroupWrapOptions=function(t){this.onRenderRadioGroupWrapAcroform.fire(this,t)},e.prototype.getUpdatedRadioItemAcroformOptions=function(t){this.onRenderRadioItemAcroform.fire(this,t)},e.prototype.correctBricksPosition=function(t,e){t.isRTL&&e.forEach(function(e){e.forEach(function(e){e.translateX(function(e,n){var i=t.paperWidth-e-n;return{xLeft:e+i,xRight:n+i}})})})},e.prototype.renderSurvey=function(t){return s(this,void 0,void 0,function(){var e,n,i,r;return a(this,function(o){switch(o.label){case 0:return this.visiblePages.forEach(function(t){return t.onFirstRendering()}),[4,y.generateFlats(this,t)];case 1:return e=o.sent(),this.correctBricksPosition(t,e),n=k.pack(e,t),[4,H.process_header_events(this,t,n)];case 2:o.sent(),i=0,o.label=3;case 3:if(!(i<n.length))return[3,8];r=0,o.label=4;case 4:return r<n[i].length?(t.getNumberOfPages()===i&&t.addPage(),t.setPage(i),[4,n[i][r].render()]):[3,7];case 5:o.sent(),o.label=6;case 6:return r++,[3,4];case 7:return i++,[3,3];case 8:return[2]}})})},e.prototype.save=function(){return s(this,arguments,void 0,function(t){var n,i,r=this;return void 0===t&&(t="survey_result.pdf"),a(this,function(o){switch(o.label){case 0:return e.currentlySaving?[3,2]:(n=new N(this.options),this.onDocControllerCreated.fire(this,{controller:n}),e.currentlySaving=!0,L.fixFont(n),[4,this.renderSurvey(n)]);case 1:return o.sent(),(i=n.doc.save(t,{returnPromise:!0})).then(function(){e.currentlySaving=!1;var t=e.saveQueue.shift();t&&t()}),[2,i];case 2:e.saveQueue.push(function(){r.save(t)}),o.label=3;case 3:return[2]}})})},e.prototype.raw=function(t){return s(this,void 0,void 0,function(){var e;return a(this,function(n){switch(n.label){case 0:return e=new N(this.options),this.onDocControllerCreated.fire(this,{controller:e}),L.fixFont(e),[4,this.renderSurvey(e)];case 1:return n.sent(),[2,e.doc.output(t)]}})})},e.currentlySaving=!1,e.saveQueue=[],e}(c.SurveyModel),j=function(t){function e(e,n,i,r){var o=t.call(this,r.question,e,n)||this;return o.fieldName=i,o.context=r,o.question=o.context.question,o.textColor=o.formBorderColor,o}return n(e,t),e.prototype.getShouldRenderReadOnly=function(){return this.context.readOnly&&"acroform"!==L.getReadonlyRenderAs(this.question,this.controller)||this.controller.compress},e.prototype.renderInteractive=function(){return s(this,void 0,void 0,function(){var t,n,i,r;return a(this,function(o){return t=new this.controller.doc.AcroFormCheckBox,n=L.formScale(this.controller,this),(i={}).maxFontSize=this.height*n*e.FONT_SIZE_SCALE,i.caption=e.CHECKMARK_READONLY_SYMBOL,i.textAlign="center",i.fieldName=this.fieldName,i.readOnly=this.context.readOnly,i.color=this.formBorderColor,i.value=!!this.context.checked&&"On",i.AS=this.context.checked?"/On":"/Off",i.context=this.context,i.Rect=L.createAcroformRect(L.scaleRect(this,n)),this.controller.doc.addField(t),null===(r=this.question.survey)||void 0===r||r.getUpdatedCheckItemAcroformOptions(i),t.maxFontSize=i.maxFontSize,t.caption=i.caption,t.textAlign=i.textAlign,t.fieldName=i.fieldName,t.readOnly=i.readOnly,t.color=i.color,t.value=i.value,t.AS=i.AS,t.Rect=i.Rect,L.renderFlatBorders(this.controller,this),[2]})})},e.prototype.renderReadOnly=function(){return s(this,void 0,void 0,function(){var t,n,i,r,o;return a(this,function(s){switch(s.label){case 0:return L.renderFlatBorders(this.controller,this),this.context.checked?(t=L.createPoint(this,!0,!0),n=this.controller.fontName,this.controller.fontName=e.CHECKMARK_READONLY_FONT,i=this.controller.fontSize,this.controller.fontSize=i*e.CHECKMARK_READONLY_FONT_SIZE_SCALE,r=this.controller.measureText(e.CHECKMARK_READONLY_SYMBOL),t.xLeft+=this.width/2-r.width/2,t.yTop+=this.height/2-r.height/2,[4,L.createTextFlat(t,this.question,this.controller,e.CHECKMARK_READONLY_SYMBOL,b)]):[3,3];case 1:return(o=s.sent()).unfold()[0].textColor=this.textColor,this.controller.fontSize=i,[4,o.render()];case 2:s.sent(),this.controller.fontName=n,s.label=3;case 3:return[2]}})})},e.FONT_SIZE_SCALE=.7,e.CHECKMARK_READONLY_SYMBOL="3",e.CHECKMARK_READONLY_FONT="zapfdingbats",e.CHECKMARK_READONLY_FONT_SIZE_SCALE=1-Math.E/10,e}(v),z=function(t){function e(e,n,i){return t.call(this,n,i,e.id,{question:e,readOnly:e.isReadOnly,checked:e.checkedValue})||this}return n(e,t),e}(j),G=function(){function t(t,e,n){this.name=t,this.controller=e,this.context=n}return t.prototype.addToPdf=function(t){var e;this._radioGroup=new this.controller.doc.AcroFormRadioButton;var n={};n.fieldName=this.name,n.readOnly=this.readOnly,n.color=t,n.context=this.context,null===(e=this.context.question.survey)||void 0===e||e.getUpdatedRadioGroupWrapOptions(n),this._radioGroup.fieldName=n.fieldName,this._radioGroup.readOnly=n.readOnly,this._radioGroup.color=n.color,this._radioGroup.value="",this.controller.doc.addField(this._radioGroup)},Object.defineProperty(t.prototype,"radioGroup",{get:function(){return this._radioGroup},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"readOnly",{get:function(){return this.context.readOnly},enumerable:!1,configurable:!0}),t}(),V=function(t){function e(e,n,i,r){var o=t.call(this,i.question,e,n)||this;return o.context=i,o.radioGroupWrap=r,o.textColor=o.formBorderColor,o}return n(e,t),e.prototype.getShouldRenderReadOnly=function(){return this.radioGroupWrap.readOnly&&"acroform"!==L.getReadonlyRenderAs(this.question,this.controller)||this.controller.compress},e.prototype.renderInteractive=function(){return s(this,void 0,void 0,function(){var t,e,n,i;return a(this,function(r){return 0==this.context.index&&this.radioGroupWrap.addToPdf(this.formBorderColor),(t={}).fieldName=this.radioGroupWrap.name+"index"+this.context.index,e=L.formScale(this.controller,this),t.Rect=L.createAcroformRect(L.scaleRect(this,e)),t.color=this.formBorderColor,t.appearance=this.controller.doc.AcroForm.Appearance.RadioButton.Circle,t.radioGroup=this.radioGroupWrap.radioGroup,t.context=this.context,null===(i=this.context.question.survey)||void 0===i||i.getUpdatedRadioItemAcroformOptions(t),n=this.radioGroupWrap.radioGroup.createOption(t.fieldName),this.context.checked?(t.AS||(n.AS="/"+t.fieldName),this.radioGroupWrap.radioGroup.value||(this.radioGroupWrap.radioGroup.value=t.fieldName)):t.AS||(t.AS="/Off"),n.Rect=t.Rect,n.color=t.color,L.renderFlatBorders(this.controller,this),this.radioGroupWrap.radioGroup.setAppearance(t.appearance),[2]})})},e.prototype.renderReadOnly=function(){return s(this,void 0,void 0,function(){var t,n,i,r,o;return a(this,function(s){switch(s.label){case 0:return L.renderFlatBorders(this.controller,this),this.context.checked?(t=L.createPoint(this,!0,!0),n=this.controller.fontSize,i=this.controller.fontName,this.controller.fontName=e.RADIOMARKER_READONLY_FONT,this.controller.fontSize=n*e.RADIOMARKER_READONLY_FONT_SIZE_SCALE,r=this.controller.measureText(e.RADIOMARKER_READONLY_SYMBOL),t.xLeft+=this.width/2-r.width/2,t.yTop+=this.height/2-r.height/2,[4,L.createTextFlat(t,this.question,this.controller,e.RADIOMARKER_READONLY_SYMBOL,b)]):[3,3];case 1:return(o=s.sent()).unfold()[0].textColor=this.textColor,[4,o.render()];case 2:s.sent(),this.controller.fontSize=n,this.controller.fontName=i,s.label=3;case 3:return[2]}})})},e.RADIOMARKER_READONLY_SYMBOL="l",e.RADIOMARKER_READONLY_FONT="zapfdingbats",e.RADIOMARKER_READONLY_FONT_SIZE_SCALE=1-(2+Math.E)/10,e}(v),U=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.survey=e,r.controller=i,r.question=n,r}return n(e,t),e.prototype.generateItemComment=function(t,e){return s(this,void 0,void 0,function(){var n;return a(this,function(i){switch(i.label){case 0:return n=this.question.getCommentTextAreaModel(e),[4,L.createCommentFlat(t,this.question,this.controller,{fieldName:n.id,rows:L.OTHER_ROWS_COUNT,value:n.getTextValue(),shouldRenderBorders:"textarea"===c.settings.readOnlyCommentRenderMode,isReadOnly:this.question.isReadOnly,isMultiline:!0})];case 1:return[2,i.sent()]}})})},e.prototype.generateFlatComposite=function(t,e,n){return s(this,void 0,void 0,function(){var i,r,o,s,l,c,h,f,d;return a(this,function(a){switch(a.label){case 0:return i=new u,r=L.createRect(t,this.controller.unitWidth,this.controller.unitHeight),o=this.generateFlatItem(L.moveRect(L.scaleRect(r,L.SELECT_ITEM_FLAT_SCALE),t.xLeft),e,n),i.addBrick(o),(s=L.clone(t)).xLeft=o.xRight+this.controller.unitWidth*L.GAP_BETWEEN_ITEM_TEXT,null===e.locText.renderedHtml?[3,2]:(c=(l=i).addBrick,[4,L.createTextFlat(s,this.question,this.controller,e.locText,b)]);case 1:c.apply(l,[a.sent()]),a.label=2;case 2:return e.isCommentShowing?((h=L.createPoint(i,!0,!1)).yTop+=this.controller.unitHeight*L.GAP_BETWEEN_ROWS,d=(f=i).addBrick,[4,this.generateItemComment(h,e)]):[3,4];case 3:d.apply(f,[a.sent()]),a.label=4;case 4:return[2,i]}})})},e.prototype.getVisibleChoices=function(){return this.question.visibleChoices},e.prototype.getColCount=function(){return this.question.colCount},e.prototype.generateFlatsContent=function(t){return s(this,void 0,void 0,function(){var e,n,i,r;return a(this,function(o){switch(o.label){case 0:return e=this.getColCount(),n=this.getVisibleChoices(),i=e,0!=e?[3,1]:(i=Math.floor(L.getPageAvailableWidth(this.controller)/this.controller.measureText(L.MATRIX_COLUMN_WIDTH).width)||1,n.length<i&&(i=n.length),[3,3]);case 1:return e>1?(i=L.getColumnWidth(this.controller,e)<this.controller.measureText(L.MATRIX_COLUMN_WIDTH).width?1:e)!=e?[3,3]:[4,this.generateColumns(t)]:[3,3];case 2:return[2,o.sent()];case 3:return 1!=i?[3,5]:[4,this.generateVerticallyItems(t,n)];case 4:return r=o.sent(),[3,7];case 5:return[4,this.generateHorisontallyItems(t,i)];case 6:r=o.sent(),o.label=7;case 7:return[2,r]}})})},e.prototype.generateRows=function(t,e){return s(this,void 0,void 0,function(){var n,i,r,o,s,l,c,h,f,d,p,g,m;return a(this,function(a){switch(a.label){case 0:n=this.getVisibleChoices(),i=L.clone(t),r=(null!==(m=e[0])&&void 0!==m?m:[]).length,o=[],s=0,l=e,a.label=1;case 1:if(!(s<l.length))return[3,7];c=l[s],h=new u,f=0,a.label=2;case 2:return f<c.length?(d=c[f],this.controller.pushMargins(),L.setColumnMargins(this.controller,r,f),i.xLeft=this.controller.margins.left,[4,this.generateFlatComposite(i,d,n.indexOf(d))]):[3,5];case 3:p=a.sent(),h.addBrick(p),this.controller.popMargins(),a.label=4;case 4:return f++,[3,2];case 5:g=L.createRowlineFlat(L.createPoint(h),this.controller),i.yTop=g.yBot+L.GAP_BETWEEN_ROWS*this.controller.unitHeight,o.push(h,g),a.label=6;case 6:return s++,[3,1];case 7:return[2,o]}})})},e.prototype.generateVerticallyItems=function(t,e){return s(this,void 0,void 0,function(){var n,i,r,o;return a(this,function(s){switch(s.label){case 0:n=L.clone(t),i=[],r=0,s.label=1;case 1:return r<e.length?[4,this.generateFlatComposite(n,e[r],r)]:[3,4];case 2:o=s.sent(),n.yTop=o.yBot+L.GAP_BETWEEN_ROWS*this.controller.unitHeight,i.push(o),s.label=3;case 3:return r++,[3,1];case 4:return[2,i]}})})},e.prototype.generateColumns=function(t){return s(this,void 0,void 0,function(){var e,n,i,r,o,s,l,c;return a(this,function(a){switch(a.label){case 0:for(e=this.question.columns,n=e.reduce(function(t,e){return Math.max(t,e.length)},0),i=[],r=0;r<n;r++){for(o=[],s=0,l=e;s<l.length;s++)(c=l[s])[r]&&o.push(c[r]);i.push(o)}return[4,this.generateRows(t,i)];case 1:return[2,a.sent()]}})})},e.prototype.generateHorisontallyItems=function(t,e){return s(this,void 0,void 0,function(){var n;return a(this,function(i){switch(i.label){case 0:return n=[],this.getVisibleChoices().forEach(function(t,i){var r=Math.floor(i/e),o=i%e;n[r]||(n[r]=[]),n[r][o]=t}),[4,this.generateRows(t,n)];case 1:return[2,i.sent()]}})})},e}(x),Y=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.survey=e,r.controller=i,r.question=n,r}return n(e,t),e.prototype.isItemSelected=function(t,e){return void 0===e?t===this.question.otherItem?this.question.isOtherSelected:t.value===this.question.value||void 0!==this.question.isItemSelected&&this.question.isItemSelected(t):e},e.prototype.generateFlatItem=function(t,e,n,r,o,s){void 0===s&&(s={}),0===n?(this.radioGroupWrap=new G(this.question.id+(void 0===r?"":r),this.controller,i({readOnly:this.question.isReadOnly,question:this.question},s)),this.question.pdfRadioGroupWrap=this.radioGroupWrap):void 0===this.radioGroupWrap&&(this.radioGroupWrap=this.question.pdfRadioGroupWrap);var a=this.isItemSelected(e,o);return new V(this.controller,t,{question:this.question,index:n,checked:a,item:e},this.radioGroupWrap)},e}(U);F.getInstance().register("radiogroup",Y),F.getInstance().register("buttongroup",Y);var X=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.survey=e,r.controller=i,r.question=n,r}return n(e,t),e.prototype.generateFlatsContent=function(t){return s(this,void 0,void 0,function(){var e,n,i,r,o,s,l;return a(this,function(a){switch(a.label){case 0:return e=new u,n=this.controller.unitHeight,i=new z(this.question,this.controller,L.moveRect(L.scaleRect(L.createRect(t,n,n),L.SELECT_ITEM_FLAT_SCALE),t.xLeft)),e.addBrick(i),(r=L.clone(t)).xLeft=i.xRight+this.controller.unitWidth*L.GAP_BETWEEN_ITEM_TEXT,null===(o=this.question.isIndeterminate?null:this.question.checkedValue?this.question.locLabelTrue:this.question.locLabelFalse)||null===o.renderedHtml?[3,2]:(l=(s=e).addBrick,[4,L.createTextFlat(r,this.question,this.controller,o,b)]);case 1:l.apply(s,[a.sent()]),a.label=2;case 2:return[2,[e]]}})})},e}(x),Q=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.survey=e,r.controller=i,r.buildItems(),r}return n(e,t),e.prototype.buildItems=function(){var t=this.question,e=new c.ItemValue(void 0!==t.valueFalse&&t.valueFalse),n=new c.ItemValue(void 0===t.valueTrue||t.valueTrue);e.locOwner=t,e.setLocText(t.locLabelFalse),n.locOwner=t,n.setLocText(t.locLabelTrue),this.items=[e,n]},e.prototype.getVisibleChoices=function(){return this.items},e.prototype.getColCount=function(){return 0},e}(Y);F.getInstance().register("boolean",Q),F.getInstance().register("boolean-checkbox",X);var K=function(t){function e(e,n,i,r,o){return t.call(this,n,i,e.id+"index"+o,{question:e,readOnly:e.isReadOnly||!r.isEnabled,item:r,checked:e.isItemSelected(r),index:o})||this}return n(e,t),e}(j),Z=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.survey=e,r.controller=i,r.question=n,r}return n(e,t),e.prototype.generateFlatItem=function(t,e,n){return new K(this.question,this.controller,t,e,n)},e}(U),J=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.survey=e,r.controller=i,r.question=n,r}return n(e,t),e.prototype.getVisibleChoices=function(){return this.controller.tagboxSelectedChoicesOnly?this.question.selectedChoices:t.prototype.getVisibleChoices.call(this)},e}(Z);F.getInstance().register("tagbox",J),F.getInstance().register("checkbox",Z);var $=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.survey=e,r.controller=i,r}return n(e,t),e.prototype.generateFlatsContent=function(t){return s(this,void 0,void 0,function(){return a(this,function(e){return[2,F.getInstance().create(this.survey,this.question,this.controller,this.question.getType()).generateFlatsContent(t)]})})},e}(x);F.getInstance().register("custom_model",$);var tt=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.survey=e,r.controller=i,r.question=n,r}return n(e,t),e.prototype.generateFlatsContent=function(t){return s(this,void 0,void 0,function(){return a(this,function(e){switch(e.label){case 0:return[4,L.createCommentFlat(t,this.question,this.controller,{rows:this.question.rows,isReadOnly:this.question.isReadOnly,isMultiline:!0,fieldName:this.question.id,placeholder:L.getLocString(this.question.locPlaceHolder),shouldRenderBorders:"textarea"===c.settings.readOnlyCommentRenderMode,value:this.question.value})];case 1:return[2,[e.sent()]]}})})},e}(x);F.getInstance().register("comment",tt);var et=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.controller=n,r.question=e,r}return n(e,t),e.prototype.renderInteractive=function(){return s(this,void 0,void 0,function(){var t,e,n=this;return a(this,function(i){return(t=new this.controller.doc.AcroFormComboBox).fieldName=this.question.id,t.Rect=L.createAcroformRect(L.scaleRect(this,L.formScale(this.controller,this))),t.edit=!1,t.color=this.textColor,e=[],this.question.showOptionsCaption&&e.push(this.getCorrectedText(this.question.optionsCaption)),this.question.visibleChoices.forEach(function(t){e.push(n.getCorrectedText(L.getLocString(t.locText)))}),t.setOptions(e),t.fontName=this.controller.fontName,t.fontSize=this.fontSize,t.readOnly=this.question.isReadOnly,t.isUnicode=L.isCustomFont(this.controller,t.fontName),t.V=this.getCorrectedText(this.question.readOnlyText||""),this.controller.doc.addField(t),L.renderFlatBorders(this.controller,this),[2]})})},e}(v),nt=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.survey=e,r.controller=i,r.question=n,r}return n(e,t),e.prototype.generateItemComment=function(t){return s(this,void 0,void 0,function(){var e;return a(this,function(n){switch(n.label){case 0:return e=this.question.getCommentTextAreaModel(this.question.selectedItem),[4,L.createCommentFlat(t,this.question,this.controller,{fieldName:e.id,rows:L.OTHER_ROWS_COUNT,value:e.getTextValue(),shouldRenderBorders:"textarea"===c.settings.readOnlyCommentRenderMode,isReadOnly:this.question.isReadOnly,isMultiline:!0})];case 1:return[2,n.sent()]}})})},e.prototype.generateFlatsContent=function(t){return s(this,void 0,void 0,function(){var e,n,i,r,o;return a(this,function(s){switch(s.label){case 0:return this.shouldRenderAsComment?[3,1]:(e=new et(this.question,this.controller,L.createTextFieldRect(t,this.controller)),[3,3]);case 1:return[4,L.createCommentFlat(t,this.question,this.controller,{fieldName:this.question.id,shouldRenderBorders:"input"===c.settings.readOnlyTextRenderMode,value:this.question.readOnlyText||"",isReadOnly:this.question.isReadOnly,placeholder:L.getLocString(this.question.locPlaceholder)})];case 2:e=s.sent(),s.label=3;case 3:return n=new u(e),this.question.isShowingChoiceComment?((i=L.createPoint(n)).yTop+=this.controller.unitHeight*L.GAP_BETWEEN_ROWS,o=(r=n).addBrick,[4,this.generateItemComment(i)]):[3,5];case 4:o.apply(r,[s.sent()]),s.label=5;case 5:return[2,[n]]}})})},e}(x);F.getInstance().register("dropdown",nt);var it=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.survey=e,r.question=n,r}return n(e,t),e.prototype.generateFlatsContent=function(t){return s(this,void 0,void 0,function(){return a(this,function(e){switch(e.label){case 0:return[4,L.createCommentFlat(t,this.question,this.controller,{value:this.question.displayValue,isReadOnly:!0,fieldName:this.question.id,shouldRenderBorders:"input"===c.settings.readOnlyTextRenderMode})];case 1:return[2,[e.sent()]]}})})},e}(x);F.getInstance().register("expression",it);var rt=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.survey=e,r.question=n,r}return n(e,t),e.prototype.generateFlatItem=function(t,n){return s(this,void 0,void 0,function(){var i,r,o,s,l;return a(this,function(a){switch(a.label){case 0:return r=u.bind,[4,L.createLinkFlat(t,this.question,this.controller,void 0===n.name?"image":n.name,n.content)];case 1:return i=new(r.apply(u,[void 0,a.sent()])),L.canPreviewImage(this.question,n,n.content)?((o=L.createPoint(i)).yTop+=this.controller.unitHeight*e.IMAGE_GAP_SCALE,l=(s=i).addBrick,[4,L.createImageFlat(o,this.question,this.controller,{link:n.content,width:n.imageSize.width,height:n.imageSize.height,objectFit:e.DEFAULT_IMAGE_FIT})]):[3,3];case 2:l.apply(s,[a.sent()]),a.label=3;case 3:return[2,i]}})})},e.prototype.addLine=function(t,e,n,i){n!==i.length-1&&(t[t.length-1].addBrick(L.createRowlineFlat(e,this.controller)),e.yTop+=L.EPSILON,t.push(new u))},e.prototype.getImagePreviewContentWidth=function(t){return s(this,void 0,void 0,function(){return a(this,function(n){return[2,Math.max(t.imageSize.width,e.TEXT_MIN_SCALE*this.controller.unitWidth)]})})},e.prototype.generateFlatsContent=function(t){return s(this,void 0,void 0,function(){var e,n,r,o,s,l,c,h,f,d,p;return a(this,function(a){switch(a.label){case 0:return(e=this.question.showPreview?this.question.previewValue:this.question.value)&&0!==e.length?[3,2]:[4,L.createTextFlat(t,this.question,this.controller,this.question.noFileChosenCaption,b)];case 1:return[2,[a.sent()]];case 2:n=[new u],r=L.clone(t),o=r.yTop,s=0,a.label=3;case 3:return s<e.length?(l=i({},e[s]),(c=L.canPreviewImage(this.question,l,l.content))?(h=l,[4,L.getCorrectedImageSize(this.controller,{imageWidth:this.question.imageWidth,imageHeight:this.question.imageHeight,imageLink:e[s].content,defaultImageWidth:200,defaultImageHeight:150})]):[3,5]):[3,12];case 4:h.imageSize=a.sent(),a.label=5;case 5:return f=this.controller.paperWidth-this.controller.margins.right-r.xLeft,c?[4,this.getImagePreviewContentWidth(l)]:[3,8];case 6:return d=a.sent(),f<d&&(r.xLeft=t.xLeft,r.yTop=o,this.addLine(n,r,s,e)),this.controller.pushMargins(r.xLeft,this.controller.paperWidth-r.xLeft-d),[4,this.generateFlatItem(r,l)];case 7:return p=a.sent(),n[n.length-1].addBrick(p),r.xLeft+=p.width,o=Math.max(o,p.yBot),this.controller.popMargins(),[3,10];case 8:return f<this.controller.unitWidth&&(r.xLeft=t.xLeft,r.yTop=o,this.addLine(n,r,s,e)),[4,this.generateFlatItem(r,l)];case 9:p=a.sent(),n[n.length-1].addBrick(p),r.xLeft+=p.xRight-p.xLeft,o=Math.max(o,p.yBot),a.label=10;case 10:r.xLeft+=this.controller.unitWidth,a.label=11;case 11:return s++,[3,3];case 12:return[2,n]}})})},e.IMAGE_GAP_SCALE=.195,e.TEXT_MIN_SCALE=5,e.DEFAULT_IMAGE_FIT="contain",e}(x);F.getInstance().register("file",rt);var ot=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.survey=e,r}return n(e,t),e.prototype.chooseRender=function(t){return/<[^>]*style[^<]*>/.test(t)||/<[^>]*table[^<]*>/.test(t)||/&\w+;/.test(t)?"image":"standard"},e.prototype.correctHtml=function(t){return e.correctHtmlRules.forEach(function(e){t=t.replace(e.searchRegExp,e.replaceString)}),t},e.prototype.generateFlatsContent=function(t){return s(this,void 0,void 0,function(){var e,n,i,r,o,s,l,c,h,u;return a(this,function(a){switch(a.label){case 0:return e=this.question.renderAs,L.hasDocument?("auto"===e&&(e=this.controller.htmlRenderAs),"auto"===e&&(e=this.chooseRender(L.getLocString(this.question.locHtml))),n=L.createHtmlContainerBlock(L.getLocString(this.question.locHtml),this.controller,e),"image"!==e?[3,3]:(i=L.getPageAvailableWidth(this.controller),[4,L.htmlToImage(n,i,this.controller)])):[2,[new E(L.createRect(t,0,0))]];case 1:return r=a.sent(),o=r.url,s=r.aspect,l=i/s,[4,L.createImageFlat(t,this.question,this.controller,{link:o,width:i,height:l})];case 2:return[2,[a.sent()]];case 3:return h=(c=L).splitHtmlRect,u=[this.controller],[4,L.createHTMLFlat(t,this.question,this.controller,this.correctHtml(n))];case 4:return[2,[h.apply(c,u.concat([a.sent()]))]]}})})},e.correctHtmlRules=[{searchRegExp:/(<\/?br\s*?\/?\s*?>\s*){2,}/g,replaceString:"<br>"}],e}(x);c.Serializer.removeProperty("html","renderAs"),c.Serializer.addProperty("html",{name:"renderAs",default:"auto",visible:!1,choices:["auto","standard","image"]}),F.getInstance().register("html",ot);var st=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.survey=e,r.question=n,r}return n(e,t),e.prototype.getCorrectImageSize=function(){return s(this,void 0,void 0,function(){return a(this,function(t){switch(t.label){case 0:return[4,L.getCorrectedImageSize(this.controller,{imageWidth:this.question.imageWidth,imageHeight:this.question.imageHeight,imageLink:this.question.imageLink})];case 1:return[2,t.sent()]}})})},e.prototype.generateFlatsContent=function(t){return s(this,void 0,void 0,function(){var e;return a(this,function(n){switch(n.label){case 0:return[4,this.getCorrectImageSize()];case 1:return e=n.sent(),[4,L.createImageFlat(t,this.question,this.controller,{link:this.question.imageLink,width:e.width,height:e.height})];case 2:return[2,[n.sent()]]}})})},e}(x);F.getInstance().register("image",st);var at=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.survey=e,r.question=n,r}return n(e,t),e.prototype.generateFlatItem=function(t,e,n){return s(this,void 0,void 0,function(){var i,r,o,s,l,c,h;return a(this,function(a){switch(a.label){case 0:return i=L.getPageAvailableWidth(this.controller),[4,L.createImageFlat(t,this.question,this.controller,{link:e.imageLink,width:i,height:i/L.IMAGEPICKER_RATIO})];case 1:return r=a.sent(),o=new u(r),s=L.createPoint(o),this.question.showLabel?[4,L.createTextFlat(s,this.question,this.controller,e.text||e.value,b)]:[3,3];case 2:l=a.sent(),o.addBrick(l),s=L.createPoint(l),a.label=3;case 3:return c=this.controller.unitHeight,h=L.createRect(s,i,c),this.question.multiSelect?o.addBrick(new j(this.controller,h,this.question.id+"index"+n,{readOnly:this.question.isReadOnly||!e.isEnabled,question:this.question,item:e,checked:-1!==this.question.value.indexOf(e.value),index:n})):o.addBrick(this.radio.generateFlatItem(h,e,n)),[2,o]}})})},e.prototype.generateFlatsContent=function(t){return s(this,void 0,void 0,function(){var e,n,i,r,o,s,l,c,h,f,d,p;return a(this,function(a){switch(a.label){case 0:this.radio=this.question.multiSelect?null:new Y(this.survey,this.question,this.controller),e=[new u],n=L.getImagePickerAvailableWidth(this.controller)/L.IMAGEPICKER_COUNT,i=~~(L.getPageAvailableWidth(this.controller)/n)||1,r=this.question.visibleChoices.length,i=i<=r?i:r,o=~~Math.ceil(r/i),s=L.clone(t),l=0,a.label=1;case 1:if(!(l<o))return[3,7];c=s.yTop,this.controller.pushMargins(),h=this.controller.margins.left,f=0,a.label=2;case 2:return f<i?(d=l*i+f)==r?[3,5]:(this.controller.margins.left=h,this.controller.margins.right=this.controller.paperWidth-h-n,h=this.controller.paperWidth-this.controller.margins.right+this.controller.unitWidth,s.xLeft=this.controller.margins.left,[4,this.generateFlatItem(s,this.question.visibleChoices[d],d)]):[3,5];case 3:p=a.sent(),e[e.length-1].addBrick(p),c=Math.max(c,p.yBot),a.label=4;case 4:return f++,[3,2];case 5:this.controller.popMargins(),s.xLeft=t.xLeft,s.yTop=c,l!==o-1&&(e[e.length-1].addBrick(L.createRowlineFlat(s,this.controller)),s.yTop+=L.EPSILON,e.push(new u)),a.label=6;case 6:return l++,[3,1];case 7:return[2,e]}})})},e}(x);F.getInstance().register("imagepicker",at);var lt=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.survey=e,r.controller=i,r.question=n,r}return n(e,t),e.prototype.generateFlatsContent=function(t){return s(this,void 0,void 0,function(){var n,i,r,o,s,l;return a(this,function(a){switch(a.label){case 0:n=[],i=L.clone(t),r=0,o=this.question.panels,a.label=1;case 1:return r<o.length?(s=o[r],[4,y.generateFlatsPanel(this.survey,this.controller,s,i)]):[3,4];case 2:0!==(l=a.sent()).length&&(i.yTop=L.mergeRects.apply(L,l).yBot,i.yTop+=this.controller.unitHeight*e.GAP_BETWEEN_PANELS,n.push.apply(n,l)),a.label=3;case 3:return r++,[3,1];case 4:return[2,n]}})})},e.GAP_BETWEEN_PANELS=.75,e}(x);F.getInstance().register("paneldynamic",lt);var ct=function(t){function e(e,n,i,r){var o=t.call(this,e,n,i)||this;return o.mark=r,o.question=e,o.textColor=o.formBorderColor,o}return n(e,t),e.prototype.renderInteractive=function(){return s(this,void 0,void 0,function(){var t,e,n,i;return a(this,function(r){switch(r.label){case 0:return L.renderFlatBorders(this.controller,this),t=L.createPoint(this,!0,!0),e=this.controller.fontSize,this.controller.fontSize=e*j.CHECKMARK_READONLY_FONT_SIZE_SCALE,n=this.controller.measureText(this.mark),t.xLeft+=this.width/2-n.width/2,t.yTop+=this.height/2-n.height/2,[4,L.createTextFlat(t,this.question,this.controller,this.mark,b)];case 1:return(i=r.sent()).unfold()[0].textColor=this.textColor,this.controller.fontSize=e,[4,i.render()];case 2:return r.sent(),[2]}})})},e}(v),ht=function(t){function e(e,n,i,r,o){var s=t.call(this,void 0,e,n)||this;return s.color=i,s.renderWidth=r,s.renderHeight=o,s}return n(e,t),e.prototype.renderInteractive=function(){return s(this,void 0,void 0,function(){var t,e,n;return a(this,function(i){return t=this.controller.doc.getFillColor(),this.controller.doc.setFillColor(this.color||"black"),this.controller.doc.rect(this.xLeft,this.yTop,null!==(e=this.renderWidth)&&void 0!==e?e:this.width,null!==(n=this.renderHeight)&&void 0!==n?n:this.height,"F"),this.controller.doc.setFillColor(t),[2]})})},e}(v),ut=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.survey=e,r.controller=i,r.question=n,r}return n(e,t),e.prototype.generateFlatComposite=function(t,e,n){return s(this,arguments,void 0,function(t,e,n,i){var r,o,s,l,c;return void 0===i&&(i=!1),a(this,function(a){switch(a.label){case 0:return r=L.createRect(t,this.controller.unitWidth,this.controller.unitHeight),o=L.moveRect(L.scaleRect(r,L.SELECT_ITEM_FLAT_SCALE),t.xLeft),s=new ct(this.question,this.controller,o,i?"-":this.question.getNumberByIndex(n)),(l=L.clone(t)).xLeft=s.xRight+this.controller.unitWidth*L.GAP_BETWEEN_ITEM_TEXT,[4,L.createTextFlat(l,this.question,this.controller,e.locText,b)];case 1:return c=a.sent(),[2,new u(s,c)]}})})},e.prototype.generateChoicesColumn=function(t,e){return s(this,arguments,void 0,function(t,e,n){var i,r,o,s;return void 0===n&&(n=!1),a(this,function(a){switch(a.label){case 0:i=L.clone(t),r=[],o=0,a.label=1;case 1:return o<e.length?[4,this.generateFlatComposite(i,e[o],o,n)]:[3,4];case 2:s=a.sent(),i.yTop=s.yBot+L.GAP_BETWEEN_ROWS*this.controller.unitHeight,r.push(s),a.label=3;case 3:return o++,[3,1];case 4:return[2,r]}})})},e.prototype.generateSelectToRankItemsVertically=function(t){return s(this,void 0,void 0,function(){var e,n,i,r,o,s,l,c,h;return a(this,function(a){switch(a.label){case 0:return e=L.clone(t),n=[],0===this.question.rankingChoices.length?[3,2]:(r=(i=n.push).apply,o=[n],[4,this.generateChoicesColumn(e,this.question.rankingChoices)]);case 1:r.apply(i,o.concat([a.sent()])),e.yTop=n[n.length-1].yBot+L.GAP_BETWEEN_ROWS*this.controller.unitHeight*2,a.label=2;case 2:return s=L.createRect({xLeft:e.xLeft,yTop:e.yTop-L.GAP_BETWEEN_ROWS*this.controller.unitHeight-.5},this.controller.paperWidth-this.controller.margins.right-e.xLeft,1),n.push(new ht(this.controller,s,L.FORM_BORDER_COLOR)),c=(l=n.push).apply,h=[n],[4,this.generateChoicesColumn(e,this.question.unRankingChoices,!0)];case 3:return c.apply(l,h.concat([a.sent()])),[2,n]}})})},e.prototype.generateSelectToRankItemsHorizontally=function(t){return s(this,void 0,void 0,function(){var e,n,i,r,o,s,l,c,h,f,d,p,g;return a(this,function(a){switch(a.label){case 0:e=2,n=L.clone(t),i=[],r=Math.max(this.question.unRankingChoices.length,this.question.rankingChoices.length),o=new u,s=0,a.label=1;case 1:if(!(s<r))return[3,8];l=0,c=0,h=[this.question.unRankingChoices[s],this.question.rankingChoices[s]],a.label=2;case 2:return c<h.length?(f=h[c])?(this.controller.pushMargins(this.controller.margins.left,this.controller.margins.right),L.setColumnMargins(this.controller,e,l),n.xLeft=this.controller.margins.left,[4,this.generateFlatComposite(n,f,s,0==l)]):[3,4]:[3,6];case 3:d=a.sent(),o.addBrick(d),this.controller.popMargins(),a.label=4;case 4:l++,a.label=5;case 5:return c++,[3,2];case 6:p=L.createRowlineFlat(L.createPoint(o),this.controller),i.push(o,p),g=L.createRect({xLeft:this.controller.margins.left+L.getPageAvailableWidth(this.controller)/2-.5,yTop:n.yTop},0,0),o.addBrick(new ht(this.controller,g,L.FORM_BORDER_COLOR,1,p.yBot-n.yTop+(s!==r-1?L.GAP_BETWEEN_ROWS*this.controller.unitHeight:0))),n.yTop=p.yBot+L.GAP_BETWEEN_ROWS*this.controller.unitHeight,o=new u,a.label=7;case 7:return s++,[3,1];case 8:return[2,i]}})})},e.prototype.generateFlatsContent=function(t){return s(this,void 0,void 0,function(){return a(this,function(e){return this.question.selectToRankEnabled?"vertical"==this.question.selectToRankAreasLayout?[2,this.generateSelectToRankItemsVertically(t)]:[2,this.generateSelectToRankItemsHorizontally(t)]:[2,this.generateChoicesColumn(t,this.question.rankingChoices)]})})},e}(x);F.getInstance().register("ranking",ut);var ft=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.survey=e,r.controller=i,r.questionRating=n,r}return n(e,t),e.prototype.generateFlatHorisontalComposite=function(t,e,n){return s(this,void 0,void 0,function(){var i,r,o,s,l,c,h;return a(this,function(a){switch(a.label){case 0:return i=L.getRatingItemText(this.questionRating,n,e.locText),this.controller.pushMargins(),r=this.controller.unitWidth/2,this.controller.margins.left+=r,this.controller.margins.right+=r,(o=L.clone(t)).xLeft+=r,l=u.bind,[4,L.createBoldTextFlat(o,this.questionRating,this.controller,i)];case 1:return s=new(l.apply(u,[void 0,a.sent()])),this.controller.popMargins(),(c=s.width)<L.getRatingMinWidth(this.controller)?(s.xLeft+=(L.getRatingMinWidth(this.controller)-c)/2-r,c=L.getRatingMinWidth(this.controller)):c+=this.controller.unitWidth,(h=L.createPoint(s)).xLeft=t.xLeft,s.addBrick(this.generateFlatItem(L.createRect(h,c,this.controller.unitHeight),e,n,void 0,this.question.value==e.value)),[2,s]}})})},e.prototype.generateFlatComposite=function(t,e,n){return s(this,void 0,void 0,function(){var i,r,o,s,l,c,h;return a(this,function(a){switch(a.label){case 0:return i=new u,r=L.createRect(t,this.controller.unitHeight,this.controller.unitHeight),o=this.generateFlatItem(L.moveRect(L.scaleRect(r,L.SELECT_ITEM_FLAT_SCALE),t.xLeft),e,n,void 0,this.question.value==e.value),i.addBrick(o),(s=L.clone(t)).xLeft=o.xRight+this.controller.unitWidth*L.GAP_BETWEEN_ITEM_TEXT,null==(l=L.getRatingItemText(this.questionRating,n,e.locText))?[3,2]:(h=(c=i).addBrick,[4,L.createTextFlat(s,this.question,this.controller,l,b)]);case 1:h.apply(c,[a.sent()]),a.label=2;case 2:return[2,i]}})})},e.prototype.generateHorisontallyItems=function(t){return s(this,void 0,void 0,function(){var e,n,i,r,o;return a(this,function(s){switch(s.label){case 0:e=[new u],n=L.clone(t),i=0,s.label=1;case 1:return i<this.questionRating.visibleRateValues.length?[4,this.generateFlatHorisontalComposite(n,this.questionRating.visibleRateValues[i],i)]:[3,4];case 2:r=s.sent(),e[e.length-1].addBrick(r),o=this.controller.paperWidth-this.controller.margins.right-r.xRight,L.getRatingMinWidth(this.controller)<=o+L.EPSILON?n.xLeft=r.xRight:(n.xLeft=t.xLeft,n.yTop=r.yBot,i!==this.questionRating.visibleRateValues.length-1&&(e[e.length-1].addBrick(L.createRowlineFlat(n,this.controller)),n.yTop+=L.EPSILON,e.push(new u))),s.label=3;case 3:return i++,[3,1];case 4:return[2,e]}})})},e.prototype.generateFlatsContent=function(t){return s(this,void 0,void 0,function(){var e,n,i;return a(this,function(r){for(e=!1,n=0;n<this.questionRating.visibleRateValues.length;n++)i=L.getRatingItemText(this.questionRating,n,this.questionRating.visibleRateValues[n].locText),this.controller.measureText(i).width>this.controller.measureText(L.RATING_COLUMN_WIDTH).width&&(e=!0);return[2,e?this.generateVerticallyItems(t,this.questionRating.visibleRateValues):this.generateHorisontallyItems(t)]})})},e}(Y);F.getInstance().register("rating",ft);var dt=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.survey=e,r.controller=i,r.question=n,r}return n(e,t),e.prototype.generateFlatsContent=function(t){return s(this,void 0,void 0,function(){var e,n,i,r,o,s;return a(this,function(a){switch(a.label){case 0:return e=L.clone(t),"single"!==this.question.sliderType?[3,2]:(o=this.getOptionsByValue(this.question.value),[4,this.generateInputBrick(e,o)]);case 1:return[2,[a.sent()]];case 2:if("range"!==this.question.sliderType)return[3,7];n=new u,i=0,a.label=3;case 3:return i<this.question.value.length?(r=this.question.value[i],o=this.getOptionsByValue(r),[4,this.generateColumnInput(e,o,2,i)]):[3,6];case 4:s=a.sent(),n.addBrick(s),a.label=5;case 5:return i++,[3,3];case 6:return[2,[n]];case 7:return[2]}})})},e.prototype.getOptionsByValue=function(t){var e=this.question;return{fieldName:e.id,inputType:"number",value:t,isReadOnly:e.isReadOnly,shouldRenderBorders:!0}},e.prototype.generateInputBrick=function(t,e){return s(this,void 0,void 0,function(){var n;return a(this,function(r){switch(r.label){case 0:return this.shouldRenderAsComment?[3,1]:(n=L.createTextFieldRect(t,this.controller),[2,new S(this.question,this.controller,n,i({},e))]);case 1:return[4,L.createCommentFlat(t,this.question,this.controller,i({},e))];case 2:return[2,r.sent()]}})})},e.prototype.generateColumnInput=function(t,e,n,i){return s(this,void 0,void 0,function(){var r,o;return a(this,function(s){switch(s.label){case 0:return this.controller.pushMargins(),L.setColumnMargins(this.controller,n,i),(r=L.clone(t)).xLeft=this.controller.margins.left,[4,this.generateInputBrick(r,e)];case 1:return o=s.sent(),this.controller.popMargins(),[2,o]}})})},e}(x);F.getInstance().register("slider",dt);var pt=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.survey=e,r.question=n,r}return n(e,t),e.prototype.generateBackgroundImage=function(t){return s(this,void 0,void 0,function(){return a(this,function(e){switch(e.label){case 0:return[4,L.createImageFlat(t,this.question,this.controller,{link:this.question.backgroundImage,width:L.pxToPt(this.question.signatureWidth),height:L.pxToPt(this.question.signatureHeight),objectFit:"cover"},!0)];case 1:return[2,e.sent()]}})})},e.prototype.getSignImageUrl=function(){return this.question.storeDataAsText||!this.question.loadedData?this.question.value:this.question.loadedData},e.prototype.generateSign=function(t){return s(this,void 0,void 0,function(){var n,i,r,o=this;return a(this,function(s){switch(s.label){case 0:return n=L.pxToPt(this.question.signatureWidth),i=L.pxToPt(this.question.signatureHeight),this.question.value?[4,L.createImageFlat(t,this.question,this.controller,{link:this.getSignImageUrl(),width:n,height:i},!1)]:[3,2];case 1:return r=s.sent(),[3,3];case 2:r=new E(L.createRect(t,n,i)),s.label=3;case 3:return"none"!==e.BORDER_STYLE&&(r.afterRenderCallback=function(){var t={height:r.width,width:r.width,yTop:r.yTop,yBot:r.yBot,xLeft:r.xLeft,xRight:r.xRight,formBorderColor:r.formBorderColor,rounded:!1,outside:!0,dashStyle:"dashed"==e.BORDER_STYLE?{dashArray:[5],dashPhase:0}:void 0};L.renderFlatBorders(o.controller,t)}),[2,r]}})})},e.prototype.generateFlatsContent=function(t){return s(this,void 0,void 0,function(){var e,n,i,r,o;return a(this,function(s){switch(s.label){case 0:return e=new u,this.question.backgroundImage?(i=(n=e).addBrick,[4,this.generateBackgroundImage(t)]):[3,2];case 1:i.apply(n,[s.sent()]),s.label=2;case 2:return o=(r=e).addBrick,[4,this.generateSign(t)];case 3:return o.apply(r,[s.sent()]),[2,[e]]}})})},e.BORDER_STYLE="dashed",e}(x);F.getInstance().register("signaturepad",pt);var gt=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.survey=e,r.question=n,r}return n(e,t),e.prototype.generateFlatsContent=function(t){return s(this,void 0,void 0,function(){var n,r;return a(this,function(o){switch(o.label){case 0:return n={fieldName:this.question.id,inputType:this.question.inputType,value:this.question.inputValue,isReadOnly:this.question.isReadOnly,shouldRenderBorders:"input"===c.settings.readOnlyTextRenderMode,placeholder:L.getLocString(this.question.locPlaceHolder)},this.shouldRenderAsComment?[4,L.createCommentFlat(t,this.question,this.controller,i({rows:e.MULTILINE_TEXT_ROWS_COUNT,isMultiline:!0},n))]:(r=L.createTextFieldRect(t,this.controller),[2,[new S(this.question,this.controller,r,i({},n))]]);case 1:return[2,[o.sent()]]}})})},e.MULTILINE_TEXT_ROWS_COUNT=1,e}(x);F.getInstance().register("text",gt);var mt=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.survey=e,r.controller=i,r.question=n,r}return n(e,t),e.prototype.generateFlatsHeader=function(t){return s(this,void 0,void 0,function(){var e,n,i,r,o,s;return a(this,function(a){switch(a.label){case 0:e=[],n=L.clone(t),this.question.hasRows&&(n.xLeft+=this.rowTitleWidth+this.controller.unitWidth*L.GAP_BETWEEN_COLUMNS),i=0,a.label=1;case 1:return i<this.question.visibleColumns.length?(this.controller.pushMargins(),this.controller.margins.left=n.xLeft,this.controller.margins.right+=L.getPageAvailableWidth(this.controller)-this.columnWidth,o=(r=e).push,[4,L.createBoldTextFlat(n,this.question,this.controller,this.question.visibleColumns[i].locText)]):[3,4];case 2:o.apply(r,[a.sent()]),n.xLeft+=this.columnWidth+this.controller.unitWidth*L.GAP_BETWEEN_COLUMNS,this.controller.popMargins(),a.label=3;case 3:return i++,[3,1];case 4:return[2,[s=new(u.bind.apply(u,l([void 0],e,!1))),L.createRowlineFlat(L.createPoint(s),this.controller)]]}})})},e.prototype.generateFlatsRows=function(t,n){return s(this,void 0,void 0,function(){var i,r,o,s,l;return a(this,function(a){switch(a.label){case 0:i=[],r=L.clone(t),o=0,a.label=1;case 1:return o<this.question.visibleRows.length?(s="row"+o,[4,new yt(this.survey,this.question,this.controller,this.question.visibleRows[o],o,s,0==o,n,this.rowTitleWidth,this.columnWidth).generateFlatsContent(r)]):[3,4];case 2:l=a.sent(),(r=L.createPoint(L.mergeRects.apply(L,l))).yTop+=this.controller.unitHeight*e.GAP_BETWEEN_ROWS,i.push.apply(i,l),a.label=3;case 3:return o++,[3,1];case 4:return[2,i]}})})},e.prototype.calculateColumnsWidthes=function(){var t=L.getPageAvailableWidth(this.controller);this.question.hasRows&&this.question.rowTitleWidth?(this.controller.pushMargins(),this.rowTitleWidth=L.parseWidth(this.question.rowTitleWidth,t),this.controller.margins.left+=this.rowTitleWidth+this.controller.unitWidth*L.GAP_BETWEEN_COLUMNS,this.columnWidth=L.getColumnWidth(this.controller,this.question.visibleColumns.length),this.controller.popMargins()):this.columnWidth=this.rowTitleWidth=L.getColumnWidth(this.controller,this.question.visibleColumns.length+(this.question.hasRows?1:0))},e.prototype.generateFlatsContent=function(t){return s(this,void 0,void 0,function(){var n,i,r,o,s,l,c;return a(this,function(a){switch(a.label){case 0:return this.calculateColumnsWidthes(),n="list"===this.question.renderAs||"list"===this.controller.matrixRenderAs||this.columnWidth<this.controller.measureText(L.MATRIX_COLUMN_WIDTH).width,i=L.clone(t),r=[],n||!this.question.showHeader||0==this.question.visibleColumns.length?[3,2]:[4,this.generateFlatsHeader(i)];case 1:o=a.sent(),(i=L.createPoint(L.mergeRects.apply(L,o))).yTop+=e.GAP_BETWEEN_ROWS*this.controller.unitHeight,r.push.apply(r,o),a.label=2;case 2:return l=(s=r.push).apply,c=[r],[4,this.generateFlatsRows(i,n)];case 3:return l.apply(s,c.concat([a.sent()])),[2,r]}})})},e.GAP_BETWEEN_ROWS=.5,e}(x),yt=function(){function t(t,e,n,i,r,o,s,a,l,c){void 0===s&&(s=!1),void 0===a&&(a=!1),this.survey=t,this.question=e,this.controller=n,this.row=i,this.rowIndex=r,this.key=o,this.isFirst=s,this.isVertical=a,this.rowTitleWidth=l,this.columnWidth=c}return t.prototype.generateFlatsContent=function(t){return s(this,void 0,void 0,function(){var e;return a(this,function(n){switch(n.label){case 0:return this.isVertical?[4,this.generateFlatsVerticallyCells(t)]:[3,2];case 1:return e=n.sent(),[3,4];case 2:return[4,this.generateFlatsHorizontallyCells(t)];case 3:e=n.sent(),n.label=4;case 4:return[2,e]}})})},t.prototype.generateFlatItem=function(t,e,n,r,o){void 0===o&&(o={});var s=this.question.id+r,a=this.row.isChecked(e);return this.question.isMultiSelect?new j(this.controller,t,s+"index"+n,{question:this.question,index:n,checked:a,item:e,readOnly:this.question.isReadOnly}):(0===n?(this.radioGroupWrap=new G(s,this.controller,i({readOnly:this.question.isReadOnly,question:this.question},o)),this.question.pdfRadioGroupWrap=this.radioGroupWrap):void 0===this.radioGroupWrap&&(this.radioGroupWrap=this.question.pdfRadioGroupWrap),new V(this.controller,t,{question:this.question,index:n,checked:a,item:e},this.radioGroupWrap))},t.prototype.generateTextComposite=function(t,e,n){return s(this,void 0,void 0,function(){var i,r,o,s;return a(this,function(a){switch(a.label){case 0:return i=L.clone(t),r=L.createRect(i,L.getPageAvailableWidth(this.controller),this.controller.unitHeight),o=this.generateFlatItem(r,e,n,this.key,{row:this.row,rowIndex:this.rowIndex}),i.yTop=o.yBot+this.controller.unitHeight*L.GAP_BETWEEN_ITEM_TEXT,[4,L.createTextFlat(i,this.question,this.controller,this.question.getCellDisplayLocText(this.row.name,e),b)];case 1:return s=a.sent(),[2,new u(o,s)]}})})},t.prototype.generateItemComposite=function(t,e,n){return s(this,void 0,void 0,function(){var i,r,o,s;return a(this,function(a){switch(a.label){case 0:return i=L.clone(t),r=L.createRect(i,this.controller.unitHeight,this.controller.unitHeight),o=this.generateFlatItem(L.moveRect(L.scaleRect(r,L.SELECT_ITEM_FLAT_SCALE),r.xLeft),e,n,this.key,{row:this.row,rowIndex:this.rowIndex}),i.xLeft=o.xRight+this.controller.unitWidth*L.GAP_BETWEEN_ITEM_TEXT,[4,L.createTextFlat(i,this.question,this.controller,e.locText,b)];case 1:return s=a.sent(),[2,new u(o,s)]}})})},t.prototype.generateFlatsHorizontallyCells=function(t){return s(this,void 0,void 0,function(){var e,n,i,r,o,s,c,h,f,d;return a(this,function(a){switch(a.label){case 0:return e=[],n=L.clone(t),this.question.hasRows?(this.controller.pushMargins(),n.xLeft=this.controller.margins.left,this.controller.margins.right+=L.getPageAvailableWidth(this.controller)-this.rowTitleWidth,r=(i=e).push,[4,L.createTextFlat(n,this.question,this.controller,this.row.locText,b)]):[3,2];case 1:r.apply(i,[a.sent()]),n.xLeft+=this.rowTitleWidth+this.controller.unitWidth*L.GAP_BETWEEN_COLUMNS,this.controller.popMargins(),a.label=2;case 2:o=0,a.label=3;case 3:return o<this.question.visibleColumns.length?(s=this.question.visibleColumns[o],this.row.value,s.value,this.controller.pushMargins(),this.controller.margins.left=n.xLeft,this.controller.margins.right+=L.getPageAvailableWidth(this.controller)-this.columnWidth,this.question.hasCellText?(h=(c=e).push,[4,this.generateTextComposite(n,s,o)]):[3,5]):[3,8];case 4:return h.apply(c,[a.sent()]),[3,6];case 5:f=L.createRect(n,this.controller.unitHeight,this.controller.unitHeight),e.push(this.generateFlatItem(L.moveRect(L.scaleRect(f,L.SELECT_ITEM_FLAT_SCALE),n.xLeft),s,o,this.key,{row:this.row,rowIndex:this.rowIndex})),a.label=6;case 6:n.xLeft+=this.columnWidth+this.controller.unitWidth*L.GAP_BETWEEN_COLUMNS,this.controller.popMargins(),a.label=7;case 7:return o++,[3,3];case 8:return[2,[d=new(u.bind.apply(u,l([void 0],e,!1))),L.createRowlineFlat(L.createPoint(d),this.controller)]]}})})},t.prototype.generateFlatsVerticallyCells=function(t){return s(this,void 0,void 0,function(){var e,n,i,r,o,s,c;return a(this,function(a){switch(a.label){case 0:return e=[],n=L.clone(t),this.question.hasRows?[4,L.createTextFlat(n,this.question,this.controller,this.row.locText,b)]:[3,2];case 1:i=a.sent(),n.yTop=i.yBot+x.CONTENT_GAP_VERT_SCALE*this.controller.unitHeight,e.push(i),a.label=2;case 2:return o=(r=e.push).apply,s=[e],[4,this.generateVerticallyItems(n,this.question.visibleColumns)];case 3:return o.apply(r,s.concat([a.sent()])),[2,[c=new(u.bind.apply(u,l([void 0],e,!1))),L.createRowlineFlat(L.createPoint(c),this.controller)]]}})})},t.prototype.generateVerticallyItems=function(t,e){return s(this,void 0,void 0,function(){var n,i,r,o;return a(this,function(s){switch(s.label){case 0:n=L.clone(t),i=[],r=0,s.label=1;case 1:return r<e.length?[4,(this.question.hasCellText?this.generateTextComposite:this.generateItemComposite).call(this,n,e[r],r)]:[3,4];case 2:o=s.sent(),n.yTop=o.yBot+L.GAP_BETWEEN_ROWS*this.controller.unitHeight,i.push(o),s.label=3;case 3:return r++,[3,1];case 4:return[2,i]}})})},t}();c.Serializer.removeProperty("matrix","renderAs"),c.Serializer.addProperty("matrix",{name:"renderAs",default:"auto",visible:!1,choices:["auto","list"]}),F.getInstance().register("matrix",mt);var vt=function(t){function e(e,n,i,r){void 0===r&&(r=!0);var o=t.call(this,e,n,i)||this;return o.survey=e,o.isMultiple=r,o.question=n,o}return n(e,t),Object.defineProperty(e.prototype,"visibleRows",{get:function(){return this.visibleRowsValue||(this.visibleRowsValue=this.question.renderedTable.rows.filter(function(t){return t.visible})),this.visibleRowsValue},enumerable:!1,configurable:!0}),e.prototype.generateFlatsCellTitle=function(t,e){return s(this,void 0,void 0,function(){var n,i,r;return a(this,function(o){switch(o.label){case 0:return n=new u,r=(i=n).addBrick,[4,L.createTextFlat(t,this.question,this.controller,e,b)];case 1:return r.apply(i,[o.sent()]),[2,n]}})})},e.prototype.generateFlatsCell=function(t,e,n){return s(this,arguments,void 0,function(t,e,n,i){var r,o,s,l,c,h,f,d,p,g;return void 0===i&&(i=!0),a(this,function(a){switch(a.label){case 0:return r=new u,e.hasQuestion?"footer"!=n||e.question.isAnswered?[3,1]:[3,4]:[3,5];case 1:return i&&e.isChoice?(o=F.getInstance().create(this.survey,e.question,this.controller,e.question.getType()),s=L.moveRect(L.scaleRect(L.createRect(t,this.controller.unitHeight,this.controller.unitHeight),L.SELECT_ITEM_FLAT_SCALE),t.xLeft),r.addBrick(o.generateFlatItem(s,e.item,e.choiceIndex)),[3,4]):[3,2];case 2:return e.question.titleLocation=L.TITLE_LOCATION_MATRIX,c=(l=r.addBrick).apply,h=[r],[4,L.generateQuestionFlats(this.survey,this.controller,e.question,t)];case 3:c.apply(l,h.concat([a.sent()])),a.label=4;case 4:return[3,9];case 5:return e.hasTitle?"header"!=n?[3,7]:(d=(f=r).addBrick,[4,L.createBoldTextFlat(t,this.question,this.controller,e.locTitle)]):[3,9];case 6:return d.apply(f,[a.sent()]),[3,9];case 7:return g=(p=r).addBrick,[4,L.createTextFlat(t,this.question,this.controller,e.locTitle,b)];case 8:g.apply(p,[a.sent()]),a.label=9;case 9:return[2,r]}})})},Object.defineProperty(e.prototype,"hasDetailPanel",{get:function(){var t=this;return this.visibleRows.some(function(e){return e.row&&t.question.hasDetailPanel(e.row)})},enumerable:!1,configurable:!0}),e.prototype.ignoreCell=function(t,e,n,i){return void 0===i&&(i=!0),!(i||"footer"!=n||!t.hasQuestion||t.question.isAnswered)||!(t.hasQuestion||t.hasTitle||this.isMultiple&&(this.hasDetailPanel?1==e:0==e))},e.prototype.getRowLocation=function(t){return t===this.question.renderedTable.headerRow?"header":this.question.renderedTable.footerRow===t?"footer":void 0},e.prototype.generateFlatsRowHorisontal=function(t,e,n){return s(this,void 0,void 0,function(){var i,r,o,s,l,c,h;return a(this,function(a){switch(a.label){case 0:i=new u,r=L.clone(t),o=this.controller.paperWidth-this.controller.margins.left+this.controller.unitWidth*L.GAP_BETWEEN_COLUMNS,this.controller.pushMargins(),s=0,l=this.getRowLocation(e),c=0,a.label=1;case 1:return c<e.cells.length?this.ignoreCell(e.cells[c],c,l)?[3,3]:(this.controller.margins.left=this.controller.paperWidth-o+this.controller.unitWidth*L.GAP_BETWEEN_COLUMNS,this.controller.margins.right=this.controller.paperWidth-this.controller.margins.left-n[s],o=this.controller.margins.right,r.xLeft=this.controller.margins.left,[4,this.generateFlatsCell(r,e.cells[c],l)]):[3,4];case 2:(h=a.sent()).isEmpty||i.addBrick(h),s++,a.label=3;case 3:return c++,[3,1];case 4:return this.controller.popMargins(),[2,i]}})})},e.prototype.generateFlatsRowVertical=function(t,n){return s(this,void 0,void 0,function(){var i,r,o,s,l,c,h,f,d,p;return a(this,function(a){switch(a.label){case 0:i=new u,r=L.clone(t),o=this.getRowLocation(n),s=0,a.label=1;case 1:return s<n.cells.length?this.ignoreCell(n.cells[s],s,o,!1)?[3,5]:this.question.renderedTable.showHeader&&(!this.isMultiple||s>0)&&(null===(p=null===(d=n.cells[s].cell)||void 0===d?void 0:d.column)||void 0===p?void 0:p.locTitle)?(c=(l=i).addBrick,[4,this.generateFlatsCellTitle(r,n.cells[s].cell.column.locTitle)]):[3,3]:[3,6];case 2:c.apply(l,[a.sent()]),r.yTop=i.yBot+e.GAP_BETWEEN_ROWS*this.controller.unitHeight,a.label=3;case 3:return f=(h=i).addBrick,[4,this.generateFlatsCell(r,n.cells[s],o,!1)];case 4:f.apply(h,[a.sent()]),r.yTop=i.yBot+e.GAP_BETWEEN_ROWS*this.controller.unitHeight,a.label=5;case 5:return s++,[3,1];case 6:return[2,i]}})})},e.prototype.getAvalableWidth=function(t){return L.getPageAvailableWidth(this.controller)-(t-1)*this.controller.unitWidth*L.GAP_BETWEEN_COLUMNS},e.prototype.calculateColumnWidth=function(t,e){for(var n=this,i=this.getAvalableWidth(e),r=i,o=e,s=[],a=[],l=t[0].cells.filter(function(t,e){return!n.ignoreCell(t,e)}),c=0;c<e;c++){var h=L.parseWidth(l[c].width,i,e)||0;r-=h,0!==h?o--:a.push(l[c]),s.push(h)}if(0===o)return s;var u=this.controller.measureText(L.MATRIX_COLUMN_WIDTH).width;return a.sort(function(t,n){var r=L.parseWidth(t.minWidth,i,e)||0;return(L.parseWidth(n.minWidth,i,e)||0)>r?1:-1}).forEach(function(t){var n=r/o,a=L.parseWidth(t.minWidth,i,e)||0;a>n&&a>u&&(r-=a,o--),s[l.indexOf(t)]=Math.max(u,a,n)}),s},e.prototype.generateOneRow=function(t,e,n,i){return s(this,void 0,void 0,function(){return a(this,function(r){switch(r.label){case 0:return n?[4,this.generateFlatsRowHorisontal(t,e,i)]:[3,2];case 1:case 3:return[2,r.sent()];case 2:return[4,this.generateFlatsRowVertical(t,e)]}})})},e.prototype.generateFlatsRows=function(t,n,i,r){return s(this,void 0,void 0,function(){var o,s,l,c,h,f,d,p,g,m;return a(this,function(a){switch(a.label){case 0:o=L.clone(t),s=[],l=0,a.label=1;case 1:return l<n.length?[4,this.generateOneRow(o,n[l],r,this.calculateColumnWidth(n,i))]:[3,6];case 2:if((c=a.sent()).isEmpty&&(!n[l].row||!n[l].row.hasPanel))return[3,5];if(c.isEmpty||(l!==n.length-1&&(o.yTop=c.yBot,c.addBrick(L.createRowlineFlat(o,this.controller))),s.push(c),o.yTop=c.yBot+e.GAP_BETWEEN_ROWS*this.controller.unitHeight),!n[l].row||!n[l].row.hasPanel)return[3,5];for(n[l].row.showDetailPanel(),h=n[l].row.detailPanel,f=0;f<h.questions.length;f++)h.questions[f].id+="_"+l;return[4,y.generateFlatsPanel(this.survey,this.controller,h,o)];case 3:return d=a.sent(),(p=new u).addBrick.apply(p,d),o.yTop=p.yBot+e.GAP_BETWEEN_ROWS*this.controller.unitHeight,s.push(p),l!==n.length-1&&this.question.renderedTable.showHeader&&r?[4,this.generateOneRow(o,n[0],r,this.calculateColumnWidth(n,i))]:[3,5];case 4:g=a.sent(),m=p.yBot,g.isEmpty||(m=g.yBot,s.push(g)),o.yTop=m+e.GAP_BETWEEN_ROWS*this.controller.unitHeight,a.label=5;case 5:return l++,[3,1];case 6:return[2,s]}})})},e.prototype.calculateIsWide=function(t,e){var n=[];if(t.showHeader&&n.push(t.headerRow),n.push.apply(n,this.visibleRows),0===n.length)return!0;var i=this.calculateColumnWidth(n,e).reduce(function(t,e){return t+e},0);return"list"!==this.question.renderAs&&"list"!==this.controller.matrixRenderAs&&Math.floor(i)<=Math.floor(this.getAvalableWidth(e))},e.prototype.getRowsToRender=function(t,e,n){var i=[],r=this.visibleRows;return t.showHeader&&n&&i.push(t.headerRow),i.push.apply(i,r),t.hasRemoveRows&&e&&i.pop(),t.showFooter&&i.push(t.footerRow),i},e.prototype.getColCount=function(t,e){var n=this;return e[0]?e[0].cells.filter(function(t,e){return!n.ignoreCell(t,e)}).length:t.showHeader&&t.headerRow?t.headerRow.cells.length:t.showFooter&&t.footerRow?t.footerRow.cells.length:0},e.prototype.generateFlatsContent=function(t){return s(this,void 0,void 0,function(){var e,n,i,r,o;return a(this,function(s){switch(s.label){case 0:return e=this.question.renderedTable,n="vertical"===this.question.columnLayout,0!==(i=this.getColCount(e,this.visibleRows))||this.hasDetailPanel?((r=this.calculateIsWide(e,i))||(this.question.isMobile=!0,n=!1,e=this.question.renderedTable,this.visibleRowsValue=void 0,i=this.getColCount(e,this.visibleRows)),o=this.getRowsToRender(e,n,r),[4,this.generateFlatsRows(t,o,i,r)]):[2,[new u(L.createRowlineFlat(t,this.controller))]];case 1:return[2,s.sent()]}})})},e.GAP_BETWEEN_ROWS=.5,e}(x);c.Serializer.removeProperty("matrixdropdown","renderAs"),c.Serializer.addProperty("matrixdropdown",{name:"renderAs",default:"auto",visible:!1,choices:["auto","list"]}),F.getInstance().register("matrixdropdown",vt);var bt=function(t){function e(e,n,i){var r=t.call(this,e,n,i,!1)||this;return r.survey=e,r}return n(e,t),e}(vt);c.Serializer.removeProperty("matrixdynamic","renderAs"),c.Serializer.addProperty("matrixdynamic",{name:"renderAs",default:"auto",visible:!1,choices:["auto","list"]}),F.getInstance().register("matrixdynamic",bt);var xt=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.survey=e,r.controller=i,r.question=n,r}return n(e,t),e.prototype.getVisibleRows=function(){return this.question.getRows().filter(function(t){return t.isVisible})},e.prototype.generateFlatItem=function(t,e,n,i){return s(this,void 0,void 0,function(){var e,n,r,o,s,l,c,h;return a(this,function(a){switch(a.label){case 0:return e=L.getPageAvailableWidth(this.controller),this.controller.pushMargins(),this.controller.margins.right=this.controller.paperWidth-this.controller.margins.left-e*L.MULTIPLETEXT_TEXT_PERS,r=u.bind,[4,L.createBoldTextFlat(t,this.question,this.controller,i.locTitle)];case 1:return n=new(r.apply(u,[void 0,a.sent()])),this.controller.popMargins(),o=F.getInstance().create(this.survey,i.editor,this.controller,"text"),s=L.createTextFieldRect({xLeft:t.xLeft+e*L.MULTIPLETEXT_TEXT_PERS,yTop:t.yTop},this.controller),c=(l=n.addBrick).apply,h=[n],[4,o.generateFlatsContent(s)];case 2:return c.apply(l,h.concat([a.sent()])),[2,n]}})})},e.prototype.generateFlatsContent=function(t){return s(this,void 0,void 0,function(){var n,i,r,o,s,l,c;return a(this,function(a){switch(a.label){case 0:n=[],i=L.clone(t),r=this.getVisibleRows(),o=0,a.label=1;case 1:if(!(o<r.length))return[3,7];n.push(new u),s=i.yTop,this.controller.pushMargins(),l=0,a.label=2;case 2:return l<r[o].cells.length?(this.controller.pushMargins(),L.setColumnMargins(this.controller,this.question.colCount,l),i.xLeft=this.controller.margins.left,[4,this.generateFlatItem(i,o,l,r[o].cells[l].item)]):[3,5];case 3:c=a.sent(),n[n.length-1].addBrick(c),s=Math.max(s,c.yBot),this.controller.popMargins(),a.label=4;case 4:return l++,[3,2];case 5:this.controller.popMargins(),i.xLeft=t.xLeft,i.yTop=s,n[n.length-1].addBrick(L.createRowlineFlat(i,this.controller)),i.yTop+=L.EPSILON,i.yTop+=this.controller.unitHeight*e.ROWS_GAP_SCALE,a.label=6;case 6:return o++,[3,1];case 7:return[2,n]}})})},e.ROWS_GAP_SCALE=.195,e}(x);F.getInstance().register("multipletext",xt);var Tt=function(t){function e(e,n,i){var r=t.call(this,e,n,i(n.helperDoc,e,0,0))||this;return r.renderFunc=i,r}return n(e,t),e.prototype.renderInteractive=function(){return s(this,void 0,void 0,function(){var t=this;return a(this,function(e){switch(e.label){case 0:return[4,new Promise(function(e){t.renderFunc(t.controller.doc,t.question,t.xLeft,t.yTop),e()})];case 1:return e.sent(),[2]}})})},e}(v);(0,c.checkLibraryVersion)("".concat("2.3.0"),"survey-pdf")})(),o})());
|
|
2
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("survey-core"),require("jspdf")):"function"==typeof define&&define.amd?define("SurveyPDF",["survey-core","jspdf"],e):"object"==typeof exports?exports.SurveyPDF=e(require("survey-core"),require("jspdf")):t.SurveyPDF=e(t.Survey,t.jspdf)}(this,(t,e)=>(()=>{var n={156:e=>{"use strict";e.exports=t},400:(t,e,n)=>{"use strict";var i=n(833);function r(t){return void 0===t?-1:t.height}var o=function(){function t(t,e){this.intervalTree=t,this.records=[],this.height=0,this.key=e.low,this.max=e.high,this.records.push(e)}return t.prototype.getNodeHigh=function(){for(var t=this.records[0].high,e=1;e<this.records.length;e++)this.records[e].high>t&&(t=this.records[e].high);return t},t.prototype.updateHeight=function(){this.height=Math.max(r(this.left),r(this.right))+1},t.prototype.updateMaxOfParents=function(){if(void 0!==this){var t=this.getNodeHigh();void 0!==this.left&&void 0!==this.right?this.max=Math.max(Math.max(this.left.max,this.right.max),t):void 0!==this.left&&void 0===this.right?this.max=Math.max(this.left.max,t):void 0===this.left&&void 0!==this.right?this.max=Math.max(this.right.max,t):this.max=t,this.parent&&this.parent.updateMaxOfParents()}},t.prototype._updateMaxAfterRightRotate=function(){var t=this.parent,e=t.left,n=e.getNodeHigh();void 0===e.left&&void 0!==e.right?e.max=Math.max(n,e.right.max):void 0!==e.left&&void 0===e.right?e.max=Math.max(n,e.left.max):void 0===e.left&&void 0===e.right?e.max=n:e.max=Math.max(Math.max(e.left.max,e.right.max),n);var i=this.getNodeHigh();void 0===this.left&&void 0!==this.right?this.max=Math.max(i,this.right.max):void 0!==this.left&&void 0===this.right?this.max=Math.max(i,this.left.max):void 0===this.left&&void 0===this.right?this.max=i:this.max=Math.max(Math.max(this.left.max,this.right.max),i),t.max=Math.max(Math.max(t.left.max,t.right.max),t.getNodeHigh())},t.prototype._updateMaxAfterLeftRotate=function(){var t=this.parent,e=t.right,n=e.getNodeHigh();void 0===e.left&&void 0!==e.right?e.max=Math.max(n,e.right.max):void 0!==e.left&&void 0===e.right?e.max=Math.max(n,e.left.max):void 0===e.left&&void 0===e.right?e.max=n:e.max=Math.max(Math.max(e.left.max,e.right.max),n);var i=this.getNodeHigh();void 0===this.left&&void 0!==this.right?this.max=Math.max(i,this.right.max):void 0!==this.left&&void 0===this.right?this.max=Math.max(i,this.left.max):void 0===this.left&&void 0===this.right?this.max=i:this.max=Math.max(Math.max(this.left.max,this.right.max),i),t.max=Math.max(Math.max(t.left.max,e.max),t.getNodeHigh())},t.prototype._leftRotate=function(){var t=this.right;t.parent=this.parent,void 0===t.parent?this.intervalTree.root=t:t.parent.left===this?t.parent.left=t:t.parent.right===this&&(t.parent.right=t),this.right=t.left,void 0!==this.right&&(this.right.parent=this),t.left=this,this.parent=t,this.updateHeight(),t.updateHeight()},t.prototype._rightRotate=function(){var t=this.left;t.parent=this.parent,void 0===t.parent?this.intervalTree.root=t:t.parent.left===this?t.parent.left=t:t.parent.right===this&&(t.parent.right=t),this.left=t.right,void 0!==this.left&&(this.left.parent=this),t.right=this,this.parent=t,this.updateHeight(),t.updateHeight()},t.prototype._rebalance=function(){if(r(this.left)>=2+r(this.right)){var t=this.left;r(t.left)>=r(t.right)?(this._rightRotate(),this._updateMaxAfterRightRotate()):(t._leftRotate(),this._rightRotate(),this._updateMaxAfterRightRotate())}else if(r(this.right)>=2+r(this.left)){var e=this.right;r(e.right)>=r(e.left)?(this._leftRotate(),this._updateMaxAfterLeftRotate()):(e._rightRotate(),this._leftRotate(),this._updateMaxAfterLeftRotate())}},t.prototype.insert=function(e){e.low<this.key?void 0===this.left?(this.left=new t(this.intervalTree,e),this.left.parent=this):this.left.insert(e):void 0===this.right?(this.right=new t(this.intervalTree,e),this.right.parent=this):this.right.insert(e),this.max<e.high&&(this.max=e.high),this.updateHeight(),this._rebalance()},t.prototype._getOverlappingRecords=function(t,e,n){if(t.key<=n&&e<=t.getNodeHigh()){for(var i=[],r=0;r<t.records.length;r++)t.records[r].high>=e&&i.push(t.records[r]);return i}return[]},t.prototype.search=function(t,e){if(void 0===this)return[];var n,i=[],r=[];return t>this.max?[]:(void 0!==this.left&&this.left.max>=t&&(i=this.left.search(t,e)),n=this._getOverlappingRecords(this,t,e),e<this.key?i.concat(n):(void 0!==this.right&&(r=this.right.search(t,e)),i.concat(n,r)))},t.prototype.searchExisting=function(t){if(void 0!==this){if(this.key===t)return this;if(t<this.key){if(void 0!==this.left)return this.left.searchExisting(t)}else if(void 0!==this.right)return this.right.searchExisting(t)}},t.prototype._minValue=function(){return void 0===this.left?this:this.left._minValue()},t.prototype.remove=function(t){var e=this.parent;if(t.key<this.key)return void 0!==this.left?this.left.remove(t):void 0;if(t.key>this.key)return void 0!==this.right?this.right.remove(t):void 0;if(void 0!==this.left&&void 0!==this.right){var n=this.right._minValue();return this.key=n.key,this.records=n.records,this.right.remove(this)}return e.left===this?(void 0!==this.right?(e.left=this.right,this.right.parent=e):(e.left=this.left,void 0!==this.left&&(this.left.parent=e)),e.updateMaxOfParents(),e.updateHeight(),e._rebalance(),this):e.right===this?(void 0!==this.right?(e.right=this.right,this.right.parent=e):(e.right=this.left,void 0!==this.left&&(this.left.parent=e)),e.updateMaxOfParents(),e.updateHeight(),e._rebalance(),this):void 0},t}(),s=function(){function t(){this.count=0}return t.prototype.insert=function(t){if(t.low>t.high)throw new Error("`low` value must be lower or equal to `high` value");if(void 0===this.root)return this.root=new o(this,t),this.count++,!0;var e=this.root.searchExisting(t.low);if(void 0!==e){for(var n=0;n<e.records.length;n++)if(i(e.records[n],t))return!1;return e.records.push(t),t.high>e.max&&(e.max=t.high,e.parent&&e.parent.updateMaxOfParents()),this.count++,!0}return this.root.insert(t),this.count++,!0},t.prototype.search=function(t,e){return void 0===this.root?[]:this.root.search(t,e)},t.prototype.remove=function(t){if(void 0===this.root)return!1;var e=this.root.searchExisting(t.low);if(void 0===e)return!1;if(e.records.length>1){for(var n=void 0,r=0;r<e.records.length;r++)if(i(e.records[r],t)){n=e.records[r],e.records.splice(r,1);break}if(n){if(n=void 0,t.high===e.max){var s=e.getNodeHigh();void 0!==e.left&&void 0!==e.right?e.max=Math.max(Math.max(e.left.max,e.right.max),s):void 0!==e.left&&void 0===e.right?e.max=Math.max(e.left.max,s):void 0===e.left&&void 0!==e.right?e.max=Math.max(e.right.max,s):e.max=s,e.parent&&e.parent.updateMaxOfParents()}return this.count--,!0}return!1}if(1===e.records.length){if(i(e.records[0],t)){if(this.root.key===e.key){var a=new o(this,{low:t.low,high:t.low});a.left=this.root,this.root.parent=a;var l=this.root.remove(e);return this.root=a.left,void 0!==this.root&&(this.root.parent=void 0),!!l&&(l=void 0,this.count--,!0)}return!!(l=this.root.remove(e))&&(l=void 0,this.count--,!0)}return!1}return!1},t.prototype.inOrder=function(){return new l(this.root)},t.prototype.preOrder=function(){return new c(this.root)},t}(),a=function(){function t(){this.tree=new s}return t.prototype.insert=function(t,e,n){return this.tree.insert({low:t,high:e,data:n})},t.prototype.remove=function(t,e,n){return this.tree.remove({low:t,high:e,data:n})},t.prototype.search=function(t,e){return this.tree.search(t,e).map(function(t){return t.data})},t.prototype.inOrder=function(){return this.tree.inOrder()},t.prototype.preOrder=function(){return this.tree.preOrder()},Object.defineProperty(t.prototype,"count",{get:function(){return this.tree.count},enumerable:!0,configurable:!0}),t}();e.Ay=a;var l=function(){function t(t){this.stack=[],void 0!==t&&this.push(t)}return t.prototype.next=function(){return void 0===this.currentNode?{done:!0,value:void 0}:this.i<this.currentNode.records.length?{done:!1,value:this.currentNode.records[this.i++]}:(void 0!==this.currentNode.right?this.push(this.currentNode.right):this.pop(),this.next())},t.prototype.push=function(t){for(this.currentNode=t,this.i=0;void 0!==this.currentNode.left;)this.stack.push(this.currentNode),this.currentNode=this.currentNode.left},t.prototype.pop=function(){this.currentNode=this.stack.pop(),this.i=0},t}();"function"==typeof Symbol&&(l.prototype[Symbol.iterator]=function(){return this});var c=function(){function t(t){this.stack=[],this.i=0,this.currentNode=t}return t.prototype.next=function(){return void 0===this.currentNode?{done:!0,value:void 0}:this.i<this.currentNode.records.length?{done:!1,value:this.currentNode.records[this.i++]}:(void 0!==this.currentNode.right&&this.push(this.currentNode.right),void 0!==this.currentNode.left&&this.push(this.currentNode.left),this.pop(),this.next())},t.prototype.push=function(t){this.stack.push(t)},t.prototype.pop=function(){this.currentNode=this.stack.pop(),this.i=0},t}();"function"==typeof Symbol&&(c.prototype[Symbol.iterator]=function(){return this})},814:t=>{"use strict";t.exports=e},833:t=>{t.exports=function(t,e,n,i){var r=n?n.call(i,t,e):void 0;if(void 0!==r)return!!r;if(t===e)return!0;if("object"!=typeof t||!t||"object"!=typeof e||!e)return!1;var o=Object.keys(t),s=Object.keys(e);if(o.length!==s.length)return!1;for(var a=Object.prototype.hasOwnProperty.bind(e),l=0;l<o.length;l++){var c=o[l];if(!a(c))return!1;var h=t[c],u=e[c];if(!1===(r=n?n.call(i,h,u,c):void 0)||void 0===r&&h!==u)return!1}return!0}}},i={};function r(t){var e=i[t];if(void 0!==e)return e.exports;var o=i[t]={exports:{}};return n[t](o,o.exports,r),o.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var o={};return(()=>{"use strict";r.r(o),r.d(o,{BooleanItemBrick:()=>z,CheckItemBrick:()=>j,CheckboxItemBrick:()=>K,CompositeBrick:()=>u,CustomBrick:()=>Tt,DocController:()=>N,DocOptions:()=>I,DrawCanvas:()=>W,DropdownBrick:()=>et,EmptyBrick:()=>E,EventHandler:()=>H,FlatBoolean:()=>X,FlatCheckbox:()=>Z,FlatComment:()=>tt,FlatCustomModel:()=>$,FlatDropdown:()=>nt,FlatExpression:()=>it,FlatFile:()=>rt,FlatHTML:()=>ot,FlatImage:()=>st,FlatImagePicker:()=>at,FlatMatrix:()=>mt,FlatMatrixDynamic:()=>bt,FlatMatrixMultiple:()=>vt,FlatMultipleText:()=>xt,FlatPanelDynamic:()=>lt,FlatQuestion:()=>x,FlatQuestionDefault:()=>T,FlatRadiogroup:()=>Y,FlatRanking:()=>ut,FlatRating:()=>ft,FlatRepository:()=>F,FlatSelectBase:()=>U,FlatSignaturePad:()=>pt,FlatSlider:()=>dt,FlatSurvey:()=>y,FlatTextbox:()=>gt,HTMLBrick:()=>O,HorizontalAlign:()=>B,ImageBrick:()=>P,LinkBrick:()=>C,PagePacker:()=>k,PdfBrick:()=>v,RadioItemBrick:()=>V,RankingItemBrick:()=>ct,RowlineBrick:()=>f,SurveyHelper:()=>L,SurveyPDF:()=>D,TextBoldBrick:()=>_,TextBrick:()=>b,TextFieldBrick:()=>S,TitlePanelBrick:()=>R,VerticalAlign:()=>A});var t={};r.r(t),r.d(t,{BooleanItemBrick:()=>z,CheckItemBrick:()=>j,CheckboxItemBrick:()=>K,CompositeBrick:()=>u,CustomBrick:()=>Tt,DocController:()=>N,DocOptions:()=>I,DrawCanvas:()=>W,DropdownBrick:()=>et,EmptyBrick:()=>E,EventHandler:()=>H,FlatBoolean:()=>X,FlatCheckbox:()=>Z,FlatComment:()=>tt,FlatCustomModel:()=>$,FlatDropdown:()=>nt,FlatExpression:()=>it,FlatFile:()=>rt,FlatHTML:()=>ot,FlatImage:()=>st,FlatImagePicker:()=>at,FlatMatrix:()=>mt,FlatMatrixDynamic:()=>bt,FlatMatrixMultiple:()=>vt,FlatMultipleText:()=>xt,FlatPanelDynamic:()=>lt,FlatQuestion:()=>x,FlatQuestionDefault:()=>T,FlatRadiogroup:()=>Y,FlatRanking:()=>ut,FlatRating:()=>ft,FlatRepository:()=>F,FlatSelectBase:()=>U,FlatSignaturePad:()=>pt,FlatSlider:()=>dt,FlatSurvey:()=>y,FlatTextbox:()=>gt,HTMLBrick:()=>O,HorizontalAlign:()=>B,ImageBrick:()=>P,LinkBrick:()=>C,PagePacker:()=>k,PdfBrick:()=>v,RadioItemBrick:()=>V,RankingItemBrick:()=>ct,RowlineBrick:()=>f,SurveyHelper:()=>L,SurveyPDF:()=>D,TextBoldBrick:()=>_,TextBrick:()=>b,TextFieldBrick:()=>S,TitlePanelBrick:()=>R,VerticalAlign:()=>A});var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},e(t,n)};function n(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}var i=function(){return i=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},i.apply(this,arguments)};function s(t,e,n,i){return new(n||(n=Promise))(function(r,o){function s(t){try{l(i.next(t))}catch(t){o(t)}}function a(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(s,a)}l((i=i.apply(t,e||[])).next())})}function a(t,e){var n,i,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,i=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((r=(r=s.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){s.label=o[1];break}if(6===o[0]&&s.label<r[1]){s.label=r[1],r=o;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(o);break}r[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}function l(t,e,n){if(n||2===arguments.length)for(var i,r=0,o=e.length;r<o;r++)!i&&r in e||(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))}var c=r(156),h=r(814),u=function(){function t(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.bricks=[],this.isPageBreak=!1,this._xLeft=0,this._xRight=0,this._yTop=0,this._yBot=0,this.addBrick.apply(this,t)}return Object.defineProperty(t.prototype,"xLeft",{get:function(){return this._xLeft},set:function(t){this.shift(t-this.xLeft,0,0,0),this._xLeft=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"xRight",{get:function(){return this._xRight},set:function(t){this.shift(0,t-this.xRight,0,0),this._xRight=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"yTop",{get:function(){return this._yTop},set:function(t){this.shift(0,0,t-this.yTop,0),this._yTop=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"yBot",{get:function(){return this._yBot},set:function(t){this.shift(0,0,0,t-this.yBot),this._yBot=t},enumerable:!1,configurable:!0}),t.prototype.shift=function(t,e,n,i){this.bricks.forEach(function(r){r.xLeft+=t,r.xRight+=e,r.yTop+=n,r.yBot+=i})},Object.defineProperty(t.prototype,"width",{get:function(){return this.xRight-this.xLeft},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.yBot-this.yTop},enumerable:!1,configurable:!0}),t.prototype.render=function(){return s(this,void 0,void 0,function(){var t;return a(this,function(e){switch(e.label){case 0:t=0,e.label=1;case 1:return t<this.bricks.length?[4,this.bricks[t].render()]:[3,4];case 2:e.sent(),e.label=3;case 3:return t++,[3,1];case 4:return[2]}})})},Object.defineProperty(t.prototype,"isEmpty",{get:function(){return 0===this.bricks.length},enumerable:!1,configurable:!0}),t.prototype.addBrick=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if(0!=e.length){(t=this.bricks).push.apply(t,e);var i=L.mergeRects.apply(L,this.bricks);this._xLeft=i.xLeft,this._xRight=i.xRight,this._yTop=i.yTop,this._yBot=i.yBot}},t.prototype.unfold=function(){var t=[];return this.bricks.forEach(function(e){t.push.apply(t,e.unfold())}),t},t.prototype.translateX=function(t){this.bricks.forEach(function(e){return e.translateX(t)});var e=t(this.xLeft,this.xRight);this._xLeft=e.xLeft,this._xRight=e.xRight},t}(),f=function(){function t(t,e,n){this.controller=t,this.color=n,this.isPageBreak=!1,this.xLeft=e.xLeft,this.xRight=e.xRight,this.yTop=e.yTop,this.yBot=e.yBot}return Object.defineProperty(t.prototype,"width",{get:function(){return this.xRight-this.xLeft},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.yBot-this.yTop},enumerable:!1,configurable:!0}),t.prototype.render=function(){return s(this,void 0,void 0,function(){var t;return a(this,function(e){return null!==this.color&&(t=this.controller.doc.getDrawColor(),this.controller.doc.setDrawColor(this.color),this.controller.doc.line(this.xLeft,this.yTop,this.xRight,this.yTop),this.controller.doc.setDrawColor(t)),[2]})})},t.prototype.unfold=function(){return[this]},t.prototype.translateX=function(t){},t}(),d=function(t,e,n,i,r){this.point=t,this.bricks=e,this.controller=n,this.repository=i,this.module=r},p=function(t){function e(e,n,i,r,o,s){var a=t.call(this,e,n,r,o,s)||this;return a.question=i,a}return n(e,t),e}(d),g=function(t){function e(e,n,i,r,o,s){var a=t.call(this,e,n,r,o,s)||this;return a.panel=i,a}return n(e,t),e}(d),m=function(t){function e(e,n,i,r,o,s){var a=t.call(this,e,n,r,o,s)||this;return a.page=i,a}return n(e,t),e}(d),y=function(){function e(){}return e.generateFlatsPanel=function(e,n,i,r){return s(this,void 0,void 0,function(){var o,s,c,h,u,f;return a(this,function(a){switch(a.label){case 0:return o=[],s=L.clone(r),n.pushMargins(),n.margins.left+=n.measureText(i.innerIndent).width,s.xLeft+=n.measureText(i.innerIndent).width,h=(c=o.push).apply,u=[o],[4,this.generateFlatsPagePanel(e,n,i,s)];case 1:return h.apply(c,u.concat([a.sent()])),n.popMargins(),f=new g(r,o,i,n,F.getInstance(),t),[4,e.onRenderPanel.fire(e,f)];case 2:return a.sent(),[2,l([],f.bricks,!0)]}})})},e.generateFlatsPagePanel=function(t,n,i,r){return s(this,void 0,void 0,function(){var o,s,l,h,f,d,p,g,m,y,v,b,x,T,F,_,R,w,C,O,P,E,S;return a(this,function(a){switch(a.label){case 0:return i.isVisible?(i.onFirstRendering(),o=[],s=L.clone(r),"page"!==i.getType()||t.showPageTitles?(l=new u,i.title?i instanceof c.PanelModel&&i.no?[4,L.createTitlePanelFlat(s,n,i.no,"page"===i.getType())]:[3,2]:[3,4]):[3,7]):[2];case 1:h=a.sent(),l.addBrick(h),s.xLeft=h.xRight+n.measureText(" ").width,a.label=2;case 2:return[4,L.createTitlePanelFlat(s,n,i.locTitle,"page"===i.getType())];case 3:f=a.sent(),l.addBrick(f),s=L.createPoint(f),a.label=4;case 4:return i.description?(i.title&&(s.yTop+=n.unitWidth*e.PANEL_DESC_GAP_SCALE),[4,L.createDescFlat(s,null,n,i.locDescription)]):[3,6];case 5:d=a.sent(),l.addBrick(d),s=L.createPoint(d),a.label=6;case 6:l.isEmpty||(p=L.createPoint(l),l.addBrick(L.createRowlineFlat(p,n)),o.push(l),s.yTop+=n.unitHeight*e.PANEL_CONT_GAP_SCALE+L.EPSILON),a.label=7;case 7:g=0,m=i.rows,a.label=8;case 8:if(!(g<m.length))return[3,17];if(!(y=m[g]).visible)return[3,16];n.pushMargins(),v=L.getPageAvailableWidth(n),b=n.margins.left,x=[],T=y.elements.filter(function(t){return t.isVisible}),F=0,a.label=9;case 9:return F<T.length?(_=T[F]).isVisible?(R=L.parseWidth(_.renderWidth,v-(T.length-1)*n.unitWidth,T.length),n.margins.left=b+(0!==F?n.unitWidth:0),n.margins.right=n.paperWidth-n.margins.left-R,s.xLeft=n.margins.left,b=n.margins.left+R,_ instanceof c.PanelModel?(C=(w=x.push).apply,O=[x],[4,this.generateFlatsPanel(t,n,_,s)]):[3,11]):[3,14]:[3,15];case 10:return C.apply(w,O.concat([a.sent()])),[3,14];case 11:return[4,_.waitForQuestionIsReady()];case 12:return a.sent(),E=(P=x.push).apply,S=[x],[4,L.generateQuestionFlats(t,n,_,s)];case 13:E.apply(P,S.concat([a.sent()])),a.label=14;case 14:return F++,[3,9];case 15:n.popMargins(),s.xLeft=n.margins.left,0!==x.length&&(s.yTop=L.mergeRects.apply(L,x).yBot,s.xLeft=r.xLeft,s.yTop+=n.unitHeight*e.QUES_GAP_VERT_SCALE,o.push.apply(o,x),o.push(L.createRowlineFlat(s,n)),s.yTop+=L.EPSILON),a.label=16;case 16:return g++,[3,8];case 17:return[2,o]}})})},e.popRowlines=function(t){for(;t.length>0&&t[t.length-1]instanceof f;)t.pop()},e.generateFlatTitle=function(t,n,i){return s(this,void 0,void 0,function(){var r,o,s,l;return a(this,function(a){switch(a.label){case 0:return r=new u,t.showTitle?t.title?[4,L.createTitleSurveyFlat(i,n,t.locTitle)]:[3,2]:[3,4];case 1:o=a.sent(),r.addBrick(o),i=L.createPoint(o),a.label=2;case 2:return t.description?(t.title&&(i.yTop+=n.unitWidth*e.PANEL_DESC_GAP_SCALE),l=(s=r).addBrick,[4,L.createDescFlat(i,null,n,t.locDescription)]):[3,4];case 3:l.apply(s,[a.sent()]),a.label=4;case 4:return[2,r]}})})},e.generateFlatLogoImage=function(t,e,n){return s(this,void 0,void 0,function(){var i,r,o,s;return a(this,function(a){switch(a.label){case 0:return i=L.getLocString(t.locLogo),[4,L.getCorrectedImageSize(e,{imageLink:i,imageHeight:t.logoHeight,imageWidth:t.logoWidth,defaultImageWidth:"300px",defaultImageHeight:"200px"})];case 1:return r=a.sent(),[4,L.createImageFlat(n,null,e,{link:i,width:r.width,height:r.height})];case 2:return o=a.sent(),s=0,"right"===t.logoPosition?s=L.getPageAvailableWidth(e)-o.width:"left"!==t.logoPosition&&(s=L.getPageAvailableWidth(e)/2-o.width/2),o.xLeft+=s,o.xRight+=s,[2,o]}})})},e.generateFlats=function(n,i){return s(this,void 0,void 0,function(){var r,o,s,c,h,u,f,d,p,g,y,v,b;return a(this,function(a){switch(a.label){case 0:return r=[],n.hasLogo?[3,2]:[4,this.generateFlatTitle(n,i,i.leftTopPoint)];case 1:return(s=a.sent()).isEmpty||r.push([s]),[3,11];case 2:return n.isLogoBefore?[4,this.generateFlatLogoImage(n,i,i.leftTopPoint)]:[3,5];case 3:return h=a.sent(),r.push([h]),o=L.createPoint(h,"top"===n.logoPosition,"top"!==n.logoPosition),"top"!==n.logoPosition?(i.pushMargins(),o.xLeft+=i.unitWidth,i.margins.left+=h.width+i.unitWidth):(o.xLeft=i.leftTopPoint.xLeft,o.yTop+=i.unitHeight/2),[4,this.generateFlatTitle(n,i,o)];case 4:return s=a.sent(),"top"!==n.logoPosition&&i.popMargins(),s.isEmpty||r[0].push(s),[3,11];case 5:return"right"!==n.logoPosition?[3,8]:[4,this.generateFlatLogoImage(n,i,i.leftTopPoint)];case 6:return h=a.sent(),r.push([h]),i.pushMargins(),i.margins.right+=h.width+i.unitWidth,[4,this.generateFlatTitle(n,i,i.leftTopPoint)];case 7:return(s=a.sent()).isEmpty||r[0].unshift(s),i.popMargins(),[3,11];case 8:return[4,this.generateFlatTitle(n,i,i.leftTopPoint)];case 9:return s=a.sent(),c=i.leftTopPoint,s.isEmpty||(r.push([s]),(c=L.createPoint(s)).yTop+=i.unitHeight/2),[4,this.generateFlatLogoImage(n,i,c)];case 10:h=a.sent(),0!==r.length?r[0].push(h):r.push([h]),a.label=11;case 11:u=i.leftTopPoint,0!==r.length&&(u.yTop=L.createPoint(L.mergeRects.apply(L,r[0])).yTop,r[0].push(L.createRowlineFlat(u,i)),u.yTop+=i.unitHeight*e.PANEL_CONT_GAP_SCALE+L.EPSILON),f=0,a.label=12;case 12:return f<n.visiblePages.length?(n.currentPage=n.visiblePages[f],g=(p=(d=[]).push).apply,y=[d],[4,this.generateFlatsPagePanel(n,i,n.visiblePages[f],u)]):[3,16];case 13:return g.apply(p,y.concat([a.sent()])),v=new m(u,d,n.visiblePages[f],i,F.getInstance(),t),[4,n.onRenderPage.fire(n,v)];case 14:a.sent(),d=l([],v.bricks,!0),0===f&&0!==r.length?(b=r[0]).push.apply(b,d):r.push(d),this.popRowlines(r[r.length-1]),u.yTop=i.leftTopPoint.yTop,a.label=15;case 15:return f++,[3,12];case 16:return[2,r]}})})},e.QUES_GAP_VERT_SCALE=1.5,e.PANEL_CONT_GAP_SCALE=1,e.PANEL_DESC_GAP_SCALE=.25,e}(),v=function(){function t(t,e,n){this.question=t,this.controller=e,this.textColor=L.TEXT_COLOR,this.formBorderColor=L.FORM_BORDER_COLOR,this.isPageBreak=!1,this.xLeft=n.xLeft,this.xRight=n.xRight,this.yTop=n.yTop,this.yBot=n.yBot,this.fontSize=e?e.fontSize:N.FONT_SIZE}return Object.defineProperty(t.prototype,"xLeft",{get:function(){return this._xLeft},set:function(t){this.setXLeft(t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"xRight",{get:function(){return this._xRight},set:function(t){this.setXRight(t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"yTop",{get:function(){return this._yTop},set:function(t){this.setYTop(t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"yBot",{get:function(){return this._yBot},set:function(t){this.setYBottom(t)},enumerable:!1,configurable:!0}),t.prototype.translateX=function(t){var e=t(this.xLeft,this.xRight);this.xLeft=e.xLeft,this.xRight=e.xRight},Object.defineProperty(t.prototype,"width",{get:function(){return this.xRight-this.xLeft},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.yBot-this.yTop},enumerable:!1,configurable:!0}),t.prototype.getShouldRenderReadOnly=function(){return L.shouldRenderReadOnly(this.question,this.controller)},t.prototype.render=function(){return s(this,void 0,void 0,function(){return a(this,function(t){switch(t.label){case 0:return this.getShouldRenderReadOnly()?[4,this.renderReadOnly()]:[3,2];case 1:return t.sent(),[3,4];case 2:return[4,this.renderInteractive()];case 3:t.sent(),t.label=4;case 4:return this.afterRenderCallback&&this.afterRenderCallback(),[2]}})})},t.prototype.renderInteractive=function(){return s(this,void 0,void 0,function(){return a(this,function(t){return[2]})})},t.prototype.renderReadOnly=function(){return s(this,void 0,void 0,function(){return a(this,function(t){switch(t.label){case 0:return[4,this.renderInteractive()];case 1:return t.sent(),[2]}})})},t.prototype.unfold=function(){return[this]},t.prototype.getCorrectedText=function(t){return this.controller.isRTL?(t||"").split("").reverse().join(""):t},t.prototype.setXLeft=function(t){this._xLeft=t},t.prototype.setXRight=function(t){this._xRight=t},t.prototype.setYTop=function(t){this._yTop=t},t.prototype.setYBottom=function(t){this._yBot=t},t}(),b=function(t){function e(e,n,i,r){var o=t.call(this,e,n,i)||this;return o.text=r,o.align={isInputRtl:!1,isOutputRtl:n.isRTL,align:n.isRTL?"right":"left",baseline:"middle"},o}return n(e,t),e.prototype.escapeText=function(){for(;this.text.indexOf("\t")>-1;)this.text=this.text.replace("\t",Array(5).join(String.fromCharCode(160)));return this.text},e.prototype.renderInteractive=function(){return s(this,void 0,void 0,function(){var t,e,n;return a(this,function(i){return t=this.alignPoint(this),e=this.controller.fontSize,this.controller.fontSize=this.fontSize,n=this.controller.doc.getTextColor(),this.controller.doc.setTextColor(this.textColor),this.controller.doc.text(this.escapeText(),t.xLeft,t.yTop,this.align),this.controller.doc.setTextColor(n),this.controller.fontSize=e,[2]})})},e.prototype.alignPoint=function(t){return{xLeft:this.controller.isRTL?t.xRight:t.xLeft,yTop:t.yTop+(t.yBot-t.yTop)/2}},e}(v),x=function(){function t(t,e,n){this.survey=t,this.controller=n,this.question=e}return t.prototype.generateFlatTitle=function(t){return s(this,void 0,void 0,function(){return a(this,function(e){switch(e.label){case 0:return[4,L.createTitleFlat(t,this.question,this.controller)];case 1:return[2,e.sent()]}})})},t.prototype.generateFlatDescription=function(t){return s(this,void 0,void 0,function(){return a(this,function(e){switch(e.label){case 0:return[4,L.createDescFlat(t,this.question,this.controller,this.question.locDescription)];case 1:return[2,e.sent()]}})})},t.prototype.generateFlatHeader=function(e){return s(this,void 0,void 0,function(){var n,i,r,o,s;return a(this,function(a){switch(a.label){case 0:return[4,this.generateFlatTitle(e)];case 1:return n=a.sent(),i=new u(n),this.question.hasDescriptionUnderTitle?((r=L.createPoint(n,!0,!1)).yTop+=t.DESC_GAP_SCALE*this.controller.unitHeight,r.xLeft+=this.controller.unitWidth*t.CONTENT_INDENT_SCALE,s=(o=i).addBrick,[4,this.generateFlatDescription(r)]):[3,3];case 2:s.apply(o,[a.sent()]),a.label=3;case 3:return[2,i]}})})},t.prototype.generateFlatsComment=function(t){return s(this,void 0,void 0,function(){var e,n,i,r,o;return a(this,function(s){switch(s.label){case 0:return e=this.question.locCommentText,[4,L.createTextFlat(t,this.question,this.controller,e,b)];case 1:return n=s.sent(),(i=L.createPoint(n)).yTop+=this.controller.unitHeight*L.GAP_BETWEEN_ROWS,r=u.bind,o=[void 0,n],[4,L.createCommentFlat(i,this.question,this.controller,{fieldName:this.question.id+"_comment",rows:L.OTHER_ROWS_COUNT,value:void 0!==this.question.comment&&null!==this.question.comment?this.question.comment:"",shouldRenderBorders:"textarea"===c.settings.readOnlyCommentRenderMode,isReadOnly:this.question.isReadOnly,isMultiline:!0,placeholder:""})];case 2:return[2,new(r.apply(u,o.concat([s.sent()])))]}})})},t.prototype.generateFlatsComposite=function(t){return s(this,void 0,void 0,function(){var e;return a(this,function(n){switch(n.label){case 0:return(e=this.question.contentPanel)?[4,y.generateFlatsPanel(this.survey,this.controller,e,t)]:[3,2];case 1:case 3:return[2,n.sent()];case 2:return this.question=L.getContentQuestion(this.question),[4,this.generateFlatsContent(t)]}})})},t.prototype.generateFlatsContent=function(t){return s(this,void 0,void 0,function(){return a(this,function(t){return[2,null]})})},t.prototype.generateFlatsContentWithOptionalElements=function(t){return s(this,void 0,void 0,function(){var e,n,i,r,o,s,l,c=this;return a(this,function(a){switch(a.label){case 0:return e=[],[4,this.generateFlatsComposite(t)];case 1:return n=a.sent(),e.push.apply(e,n),i=function(){var i=L.clone(t);return null!==n&&0!==n.length&&(i.yTop=L.mergeRects.apply(L,e).yBot+c.controller.unitHeight*L.GAP_BETWEEN_ROWS),i},this.question.hasComment?(o=(r=e).push,[4,this.generateFlatsComment(i())]):[3,3];case 2:o.apply(r,[a.sent()]),a.label=3;case 3:return this.question.hasDescriptionUnderInput?(l=(s=e).push,[4,this.generateFlatDescription(i())]):[3,5];case 4:l.apply(s,[a.sent()]),a.label=5;case 5:return[2,e]}})})},t.prototype.generateFlats=function(e){return s(this,void 0,void 0,function(){var n,i,r,o,s,l,c,h,u,f,d,p;return a(this,function(a){switch(a.label){case 0:switch(this.controller.pushMargins(),this.controller.margins.left+=this.controller.measureText(this.question.indent).width,n={xLeft:e.xLeft+this.controller.measureText(this.question.indent).width,yTop:e.yTop},i=[],r=this.question.getTitleLocation(),r=this.question.hasTitle?r:"hidden"){case"top":case"default":return[3,1];case"bottom":return[3,4];case"left":return[3,7];case"hidden":case L.TITLE_LOCATION_MATRIX:return[3,10]}return[3,10];case 1:return[4,this.generateFlatHeader(n)];case 2:return c=a.sent(),(u=L.createPoint(c)).xLeft+=this.controller.unitWidth*t.CONTENT_INDENT_SCALE,c.addBrick(L.createRowlineFlat(L.createPoint(c),this.controller)),u.yTop+=this.controller.unitHeight*t.CONTENT_GAP_VERT_SCALE+L.EPSILON,this.controller.pushMargins(),this.controller.margins.left+=this.controller.unitWidth*t.CONTENT_INDENT_SCALE,[4,this.generateFlatsContentWithOptionalElements(u)];case 3:return h=a.sent(),this.controller.popMargins(),null!==h&&0!==h.length&&c.addBrick(h.shift()),i.push(c),i.push.apply(i,h),[3,12];case 4:return u=L.clone(n),this.controller.pushMargins(),u.xLeft+=this.controller.unitWidth*t.CONTENT_INDENT_SCALE,this.controller.margins.left+=this.controller.unitWidth*t.CONTENT_INDENT_SCALE,[4,this.generateFlatsContentWithOptionalElements(u)];case 5:return h=a.sent(),this.controller.popMargins(),i.push.apply(i,h),o=n,0!==i.length&&(o.yTop=i[i.length-1].yBot),o.yTop+=this.controller.unitHeight*t.CONTENT_GAP_VERT_SCALE,l=(s=i).push,[4,this.generateFlatHeader(o)];case 6:return l.apply(s,[a.sent()]),[3,12];case 7:return this.controller.pushMargins(this.controller.margins.left,this.controller.paperWidth-this.controller.margins.left-L.getPageAvailableWidth(this.controller)*L.MULTIPLETEXT_TEXT_PERS),[4,this.generateFlatHeader(n)];case 8:return c=a.sent(),u=L.createPoint(c,!1,!0),this.controller.popMargins(),u.xLeft+=this.controller.unitWidth*t.CONTENT_GAP_HOR_SCALE,this.controller.margins.left=u.xLeft,[4,this.generateFlatsContentWithOptionalElements(u)];case 9:return null!==(h=a.sent())&&0!==h.length&&c.addBrick(h.shift()),i.push(c),i.push.apply(i,h),[3,12];case 10:return u=L.clone(n),this.controller.pushMargins(),r!==L.TITLE_LOCATION_MATRIX&&(u.xLeft+=this.controller.unitWidth*t.CONTENT_INDENT_SCALE,this.controller.margins.left+=this.controller.unitWidth*t.CONTENT_INDENT_SCALE),d=(f=i.push).apply,p=[i],[4,this.generateFlatsContentWithOptionalElements(u)];case 11:return d.apply(f,p.concat([a.sent()])),this.controller.popMargins(),[3,12];case 12:return this.controller.popMargins(),[2,i]}})})},Object.defineProperty(t.prototype,"shouldRenderAsComment",{get:function(){return L.shouldRenderReadOnly(this.question,this.controller)},enumerable:!1,configurable:!0}),t.CONTENT_GAP_VERT_SCALE=.5,t.CONTENT_GAP_HOR_SCALE=1,t.CONTENT_INDENT_SCALE=1,t.DESC_GAP_SCALE=.0625,t}();c.Serializer.addProperty("question",{name:"readonlyRenderAs",default:"auto",choices:["auto","text","acroform"],visible:!1});var T=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.generateFlatsContent=function(t){return s(this,void 0,void 0,function(){return a(this,function(e){switch(e.label){case 0:return[4,L.createTextFlat(t,this.question,this.controller,"".concat(this.question.displayValue),b)];case 1:return[2,[e.sent()]]}})})},e}(x),F=function(){function t(){this.questions={}}return t.getInstance=function(){return t.instance},t.prototype.register=function(t,e){this.questions[t]=e},t.prototype.isTypeRegistered=function(t){return!!this.questions[t]},t.prototype.getRenderer=function(t){return this.questions[t]},t.prototype.create=function(t,e,n,i){var r,o=void 0===i?e.getType():i,s=this.getRenderer(o);return s||(s=(null===(r=e.customWidget)||void 0===r?void 0:r.pdfRender)?x:T),new s(t,e,n)},t.register=function(t,e){this.getInstance().register(t,e)},t.getRenderer=function(t){return this.getInstance().getRenderer(t)},t.instance=new t,t}(),_=function(t){function e(e,n,i,r){return t.call(this,e,n,i,r)||this}return n(e,t),e.prototype.renderInteractive=function(){return s(this,void 0,void 0,function(){return a(this,function(e){switch(e.label){case 0:return this.controller.fontStyle="bold",[4,t.prototype.renderInteractive.call(this)];case 1:return e.sent(),this.controller.fontStyle="normal",[2]}})})},e}(b),R=function(t){function e(e,n,i,r){return t.call(this,e,n,i,r)||this}return n(e,t),e.prototype.renderInteractive=function(){return s(this,void 0,void 0,function(){var e;return a(this,function(n){switch(n.label){case 0:return e=this.controller.fontSize,this.controller.fontSize=e*L.TITLE_PANEL_FONT_SIZE_SCALE,[4,t.prototype.renderInteractive.call(this)];case 1:return n.sent(),this.controller.fontSize=e,[2]}})})},e}(_),w=function(t){function e(e,n,i,r){return t.call(this,e,n,i,r)||this}return n(e,t),e}(b),C=function(t){function e(n,i){var r=t.call(this,n.question,n.controller,n,n.text)||this;return r.link=i,r.textColor=e.COLOR,r}return n(e,t),e.prototype.renderInteractive=function(){return s(this,void 0,void 0,function(){var n,i,r;return a(this,function(o){switch(o.label){case 0:return n=this.controller.doc.getTextColor(),this.controller.doc.setTextColor(L.BACKGROUND_COLOR),i=this.controller.unitHeight*(this.controller.doc.getLineHeightFactor()-e.SCALE_FACTOR_MAGIC),r=this.yTop+(this.yBot-this.yTop)-i,this.controller.doc.textWithLink(this.text,this.xLeft,r,{url:this.link}),[4,t.prototype.renderInteractive.call(this)];case 1:return o.sent(),this.controller.doc.setTextColor(n),[2]}})})},e.prototype.renderReadOnly=function(){return s(this,void 0,void 0,function(){return a(this,function(e){switch(e.label){case 0:return"text"!==L.getReadonlyRenderAs(this.question,this.controller)?[2,this.renderInteractive()]:[4,t.prototype.renderInteractive.call(this)];case 1:return e.sent(),[2]}})})},e.SCALE_FACTOR_MAGIC=.955,e.COLOR="#0000EE",e}(b),O=function(t){function e(e,n,i,r,o){void 0===o&&(o=!1);var s=t.call(this,e,n,i)||this;return s.html=r,s.margins=o?{top:0,bottom:0}:{top:n.margins.top,bottom:n.margins.bot},s}return n(e,t),e.prototype.renderInteractive=function(){return s(this,void 0,void 0,function(){var t,e=this;return a(this,function(n){switch(n.label){case 0:return t=this.controller.fontSize,this.controller.fontSize=this.fontSize,[4,new Promise(function(t){e.controller.doc.fromHTML(e.html,e.xLeft,e.yTop,{width:e.width,pagesplit:!0},function(){[].slice.call(document.querySelectorAll(".sjs-pdf-hidden-html-div")).forEach(function(t){t.parentNode.removeChild(t)}),t()},e.margins)})];case 1:return n.sent(),this.controller.fontSize=t,[2]}})})},e}(v),P=function(t){function e(e,n,i,r,o,s){var a=t.call(this,e,n,{xLeft:r.xLeft,xRight:r.xLeft+(o||0),yTop:r.yTop,yBot:r.yTop+(s||0)})||this;return a.image=i,a.originalWidth=o,a.originalHeight=s,a.isPageBreak=void 0===a.originalHeight,a}return n(e,t),e.prototype.renderInteractive=function(){return s(this,void 0,void 0,function(){var t=this;return a(this,function(e){switch(e.label){case 0:return[4,new Promise(function(e){try{t.controller.doc.addImage(t.image,"PNG",t.xLeft,t.yTop,t.originalWidth,t.originalHeight)}finally{e()}})];case 1:return e.sent(),[2]}})})},e}(v),E=function(t){function e(e,n,i){void 0===n&&(n=null),void 0===i&&(i=!1);var r=t.call(this,null,n,e)||this;return r.controller=n,r.isBorderVisible=!1,r.isBorderVisible=i,r}return n(e,t),e.prototype.resizeBorder=function(t){var e=t?1:-1,n=this.controller.doc.getFontSize()*L.VALUE_READONLY_PADDING_SCALE;this.xLeft-=e*n,this.xRight+=e*n,this.yBot+=e*n},e.prototype.renderInteractive=function(){return s(this,void 0,void 0,function(){return a(this,function(t){return this.isBorderVisible&&(this.resizeBorder(!0),L.renderFlatBorders(this.controller,this),this.resizeBorder(!1)),[2]})})},e}(v),S=function(t){function e(e,n,i,r){var o,s,a,l,c=t.call(this,e,n,i)||this;return c.question=e,c.options=r,r.isMultiline=null!==(o=r.isMultiline)&&void 0!==o&&o,r.placeholder=null!==(s=r.placeholder)&&void 0!==s?s:"",r.inputType=null!==(a=r.inputType)&&void 0!==a?a:"",r.value=null!==(l=r.value)&&void 0!==l?l:"",c.question=e,c}return n(e,t),e.prototype.renderColorQuestion=function(){var t=this.controller.doc.getFillColor();this.controller.doc.setFillColor(this.question.value||"black"),this.controller.doc.rect(this.xLeft,this.yTop,this.width,this.height,"F"),this.controller.doc.setFillColor(t)},e.prototype.renderInteractive=function(){return s(this,void 0,void 0,function(){var t,e;return a(this,function(n){return"color"===this.options.inputType?(this.renderColorQuestion(),[2]):((t="password"===this.options.inputType?new this.controller.doc.AcroFormPasswordField:new this.controller.doc.AcroFormTextField).fieldName=this.options.fieldName,t.fontName=this.controller.fontName,t.fontSize=this.fontSize,t.isUnicode=L.isCustomFont(this.controller,t.fontName),"password"!==this.options.inputType?(t.V=" "+this.getCorrectedText(this.options.value),t.DV=" "+this.getCorrectedText(this.options.placeholder)):t.value="",t.multiline=this.options.isMultiline,t.readOnly=this.options.isReadOnly,t.color=this.textColor,e=L.formScale(this.controller,this),t.maxFontSize=this.controller.fontSize*e,t.Rect=L.createAcroformRect(L.scaleRect(this,e)),this.controller.doc.addField(t),L.renderFlatBorders(this.controller,this),[2])})})},e.prototype.shouldRenderFlatBorders=function(){return this.options.shouldRenderBorders},e.prototype.getShouldRenderReadOnly=function(){return L.shouldRenderReadOnly(this.question,this.controller,this.options.isReadOnly)},Object.defineProperty(e.prototype,"textBrick",{get:function(){return this._textBrick},set:function(t){var e=this;this._textBrick=t;var n=t.unfold(),i=n.length,r=0,o={},s=function(t){if(e.shouldRenderFlatBorders()){r++;var n=e.controller.getCurrentPageIndex();if(o[n]||(o[n]=[]),o[n].push(t),r>=i){var s=Object.keys(o),a=1==s.length;s.forEach(function(t){var i=new u;o[t].forEach(function(t){i.addBrick(t)});var r=e.controller.unitHeight*L.VALUE_READONLY_PADDING_SCALE,s={xLeft:e.xLeft,xRight:e.xRight,width:e.width,yTop:a?e.yTop:i.yTop-r,yBot:a?e.yBot:i.yBot+r,height:a?e.height:i.height+2*r,formBorderColor:e.formBorderColor};e.controller.setPage(Number(t)),L.renderFlatBorders(e.controller,s),e.controller.setPage(n)})}}};n.forEach(function(t){t.afterRenderCallback=s.bind(e,t)})},enumerable:!1,configurable:!0}),e.prototype.renderReadOnly=function(){return s(this,void 0,void 0,function(){return a(this,function(t){switch(t.label){case 0:return this.controller.pushMargins(this.xLeft,this.controller.paperWidth-this.xRight),"color"!==this.options.inputType?[3,1]:(this.renderColorQuestion(),[3,3]);case 1:return[4,this.textBrick.render()];case 2:t.sent(),t.label=3;case 3:return this.controller.popMargins(),[2]}})})},e.prototype.unfold=function(){return this.getShouldRenderReadOnly()&&"color"!==this.options.inputType?this.textBrick.unfold():t.prototype.unfold.call(this)},e.prototype.translateX=function(t){var e=t(this.xLeft,this.xRight);this._xLeft=e.xLeft,this._xRight=e.xRight,this.textBrick&&this.textBrick.translateX(t)},e.prototype.setXLeft=function(e){var n=e-this._xLeft;t.prototype.setXLeft.call(this,e),this.textBrick&&(this.textBrick.xLeft=this.textBrick.xLeft+n)},e.prototype.setXRight=function(e){var n=e-this._xRight;t.prototype.setXRight.call(this,e),this.textBrick&&(this.textBrick.xRight=this.textBrick.xRight+n)},e.prototype.setYTop=function(e){var n=e-this._yTop;t.prototype.setYTop.call(this,e),this.textBrick&&(this.textBrick.yTop=this.textBrick.yTop+n)},e.prototype.setYBottom=function(e){var n=e-this._yBot;t.prototype.setYBottom.call(this,e),this.textBrick&&(this.textBrick.yBot=this.textBrick.yBot+n)},e}(v),L=function(){function e(){}return e.parseWidth=function(t,e,n,i){if(void 0===n&&(n=1),0===t.indexOf("calc"))return e/n;var r,o=parseFloat(t);switch(t.replace(/[^A-Za-z%]/g,"")||i){case"pt":r=1;break;case"mm":r=72/25.4;break;case"cm":r=72/2.54;break;case"in":r=72;break;case"px":r=.75;break;case"pc":case"em":r=12;break;case"ex":r=6;break;default:r=e/100}return Math.min(o*r,e)},e.pxToPt=function(t){return"string"==typeof t?(isNaN(Number(t))||(t+="px"),e.parseWidth(t,Number.MAX_VALUE)):72*t/96},e.mergeRects=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n={xLeft:t[0].xLeft,xRight:t[0].xRight,yTop:t[0].yTop,yBot:t[0].yBot};return t.forEach(function(t){n.xLeft=Math.min(n.xLeft,t.xLeft),n.xRight=Math.max(n.xRight,t.xRight),n.yTop=Math.min(n.yTop,t.yTop),n.yBot=Math.max(n.yBot,t.yBot)}),n},e.createPoint=function(t,e,n){return void 0===e&&(e=!0),void 0===n&&(n=!1),{xLeft:e?t.xLeft:t.xRight,yTop:n?t.yTop:t.yBot}},e.createRect=function(t,e,n){return{xLeft:t.xLeft,xRight:t.xLeft+e,yTop:t.yTop,yBot:t.yTop+n}},e.createHeaderRect=function(t){return{xLeft:0,xRight:t.paperWidth,yTop:0,yBot:t.margins.top}},e.createFooterRect=function(t){return{xLeft:0,xRight:t.paperWidth,yTop:t.paperHeight-t.margins.bot,yBot:t.paperHeight}},e.chooseHtmlFont=function(t){return t.useCustomFontInHtml?t.fontName:this.STANDARD_FONT},e.generateCssTextRule=function(t,e,n){return'"font-size: '.concat(t,"pt; font-weight: ").concat(e,"; font-family: ").concat(n,"; color: ").concat(this.TEXT_COLOR,';"')},e.createHtmlContainerBlock=function(t,e,n){var i=this.chooseHtmlFont(e);return'<div class="__surveypdf_html" style='.concat(this.generateCssTextRule(e.fontSize,e.fontStyle,i),">")+"<style>.__surveypdf_html p { margin: 0; line-height: ".concat(e.fontSize,"pt } body { margin: 0; }</style>").concat(t,"</div>")},e.splitHtmlRect=function(t,e){var n=[],i=e.height,r=t.doc.getFontSize();e.yBot=e.yTop+r;var o=Math.floor(i/r)-1;n.push(e);for(var s=this.createPoint(e),a=0;a<o;a++)n.push(new E(this.createRect(s,e.width,r))),s.yTop+=r;var c=i-(o+1)*r;return c>0&&n.push(new E(this.createRect(s,e.width,c))),new(u.bind.apply(u,l([void 0],n,!1)))},e.createPlainTextFlat=function(t,e,n,i,r){var o=this,s=n.doc.splitTextToSize(i,n.paperWidth-n.margins.right-t.xLeft),a=this.clone(t),l=new u;return s.forEach(function(t){var i=n.measureText(t);l.addBrick(new r(e,n,o.createRect(a,i.width,i.height),t)),a.yTop+=i.height}),l},e.createTextFlat=function(t,e,n,i,r){return s(this,void 0,void 0,function(){var o,s;return a(this,function(a){switch(a.label){case 0:return"string"!=typeof i&&this.hasHtml(i)?[3,1]:[2,this.createPlainTextFlat(t,e,n,"string"==typeof i?i:this.getLocString(i),r)];case 1:return o=this.splitHtmlRect,s=[n],[4,this.createHTMLFlat(t,e,n,this.createHtmlContainerBlock(this.getLocString(i),n,"standard"))];case 2:return[2,o.apply(this,s.concat([a.sent()]))]}})})},e.hasHtml=function(t){var e=/<\/?[a-z][\s\S]*>/i;return t.hasHtml&&(e.test(t.renderedText)||e.test(t.renderedHtml))},e.getHtmlMargins=function(t,e){var n=t.paperWidth-e.xLeft-t.margins.right;return{top:t.margins.top,bottom:t.margins.bot,width:n>t.unitWidth?n:t.unitWidth}},e.createHTMLRect=function(t,n,i,r){var o=n.paperHeight-n.margins.bot-n.margins.top,s=(n.helperDoc.getNumberOfPages()-1)*(n.fontSize*Math.floor(o/n.fontSize))+r-i.top+e.HTML_TAIL_TEXT_SCALE*n.fontSize,a=n.helperDoc.getNumberOfPages();n.helperDoc.addPage();for(var l=0;l<a;l++)n.helperDoc.deletePage(1);return e.createRect(t,i.width,s)},e.createHTMLFlat=function(t,n,i,r){return s(this,void 0,void 0,function(){var o;return a(this,function(s){switch(s.label){case 0:return o=this.getHtmlMargins(i,t),[4,new Promise(function(s){i.helperDoc.fromHTML(r,t.xLeft,o.top,{pagesplit:!0,width:o.width},function(a){var l=e.createHTMLRect(t,i,o,a.y);s(new O(n,i,l,r))},o)})];case 1:return[2,s.sent()]}})})},e.generateFontFace=function(t,e,n){return"@font-face { font-family: ".concat(t,"; ")+"src: url(data:application/font-woff;charset=utf-8;base64,".concat(e,") format('woff'); ")+"font-weight: ".concat(n,"; }")},e.generateFontFaceWithItalicStyle=function(t,e,n){return"@font-face { font-family: ".concat(t,"; ")+"src: url(data:application/font-woff;charset=utf-8;base64,".concat(e,") format('woff'); ")+"font-weight: ".concat(n,"; font-style: italic}")},e.htmlToXml=function(t){var e=document.implementation.createHTMLDocument("");return e.write(t.replace(/\#/g,"%23")),e.documentElement.setAttribute("xmlns",e.documentElement.namespaceURI),e.body.style.margin="unset",(new XMLSerializer).serializeToString(e.body).replace(/%23/g,"#")},e.createSvgContent=function(t,e,n){var i=this,r=document.createElement("style");r.innerHTML=".__surveypdf_html p { margin: unset; line-height: 22px; } body { margin: unset; }",document.body.appendChild(r);var o=document.createElement("div");o.className="__surveypdf_html",o.style.display="block",o.style.position="fixed",o.style.top="-10000px",o.style.left="-10000px",o.style.width=e/72*96+"px",o.style.boxSizing="initial",o.style.color="initial",o.style.fontFamily="initial",o.style.font="initial",o.style.lineHeight="initial",o.insertAdjacentHTML("beforeend",t),document.body.appendChild(o);var s=o.offsetWidth,a=o.offsetHeight;o.remove(),r.remove();var l="";return n.useCustomFontInHtml?l="<defs><style>".concat(this.generateFontFace(n.fontName,n.base64Normal,"normal"))+" ".concat(this.generateFontFace(n.fontName,n.base64Bold,"bold"),"</style></defs>"):Object.keys(N.customFonts).forEach(function(t){var e=N.customFonts[t];Object.keys(e).forEach(function(n){l+="".concat("normal"===n||"bold"===n?i.generateFontFace(t,e[n],n):i.generateFontFaceWithItalicStyle(t,e[n],"italic"===n?"normal":"bold"))}),l="<defs><style>"+l+"</style></defs>"}),{svg:'<svg xmlns="http://www.w3.org/2000/svg" width="'.concat(s,'px" height="').concat(a,'px">')+l+"<style>.__surveypdf_html p { margin: unset; line-height: 22px; }</style>"+'<foreignObject width="'.concat(s,'px" height="').concat(a,'px">')+this.htmlToXml(t)+"</foreignObject></svg>",divWidth:s,divHeight:a}},e.setCanvas=function(t,n,i,r){t.width=n*e.HTML_TO_IMAGE_QUALITY,t.height=i*e.HTML_TO_IMAGE_QUALITY;var o=t.getContext("2d");o.scale(e.HTML_TO_IMAGE_QUALITY,e.HTML_TO_IMAGE_QUALITY),o.fillStyle=e.BACKGROUND_COLOR,o.fillRect(0,0,n,i),o.drawImage(r,0,0)},e.htmlToImage=function(t,n,i){return s(this,void 0,void 0,function(){var r,o,s,l,c,h;return a(this,function(a){return r=e.createSvgContent(t,n,i),o=r.svg,s=r.divWidth,l=r.divHeight,c="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(o))),(h=new Image).crossOrigin="anonymous",h.src=c,[2,new Promise(function(t){h.onload=function(){var n=document.createElement("canvas");e.setCanvas(n,s,l,h);var i=n.toDataURL("image/jpeg",e.HTML_TO_IMAGE_QUALITY);n.remove(),t({url:i,aspect:s/l})},h.onerror=function(){t({url:"data:,",aspect:n/this.EPSILON})}})]})})},e.createBoldTextFlat=function(t,e,n,i){return s(this,void 0,void 0,function(){var r;return a(this,function(o){switch(o.label){case 0:return n.fontStyle="bold",[4,this.createTextFlat(t,e,n,i,_)];case 1:return r=o.sent(),n.fontStyle="normal",[2,r]}})})},e.createTitleFlat=function(t,e,n){return s(this,void 0,void 0,function(){var i,r,o,s,l,c,h,f,d,p,g;return a(this,function(a){switch(a.label){case 0:return i=new u,r=this.clone(t),o=n.fontSize,n.fontSize*=this.TITLE_FONT_SCALE,e.no?(s=e.no+" ",l=void 0,this.hasHtml(e.locTitle)?(n.fontStyle="bold",n.pushMargins(),n.margins.right=n.paperWidth-n.margins.left-n.measureText(s,"bold").width,[4,this.createHTMLFlat(r,e,n,this.createHtmlContainerBlock(s,n,"standard"))]):[3,2]):[3,5];case 1:return l=a.sent(),n.popMargins(),n.fontStyle="normal",[3,4];case 2:return[4,this.createBoldTextFlat(r,e,n,s)];case 3:l=a.sent(),a.label=4;case 4:i.addBrick(l),r.xLeft=l.xRight,a.label=5;case 5:return n.pushMargins(),n.margins.left=r.xLeft,[4,this.createBoldTextFlat(r,e,n,e.locTitle)];case 6:return c=a.sent(),i.addBrick(c),n.popMargins(),e.isRequired?(h=e.requiredText,this.hasHtml(e.locTitle)?(r=this.createPoint(c.unfold()[0],!1,!1),n.fontStyle="bold",n.pushMargins(),n.margins.right=n.paperWidth-n.margins.left-n.measureText(h,"bold").width,d=(f=i).addBrick,[4,this.createHTMLFlat(r,e,n,this.createHtmlContainerBlock(h,n,"standard"))]):[3,8]):[3,10];case 7:return d.apply(f,[a.sent()]),n.popMargins(),n.fontStyle="normal",[3,10];case 8:return r=this.createPoint(c.unfold().pop(),!1,!0),g=(p=i).addBrick,[4,this.createBoldTextFlat(r,e,n,h)];case 9:g.apply(p,[a.sent()]),a.label=10;case 10:return n.fontSize=o,[2,i]}})})},e.createTitleSurveyPanelFlat=function(t,e,n,i){return s(this,void 0,void 0,function(){var r,o;return a(this,function(s){switch(s.label){case 0:return r=e.fontSize,e.fontSize=r*i,e.fontStyle="bold",[4,this.createTextFlat(t,null,e,n,R)];case 1:return o=s.sent(),e.fontStyle="normal",e.fontSize=r,[2,o]}})})},e.createTitleSurveyFlat=function(t,e,n){return s(this,void 0,void 0,function(){return a(this,function(i){switch(i.label){case 0:return[4,this.createTitleSurveyPanelFlat(t,e,n,this.TITLE_SURVEY_FONT_SIZE_SCALE)];case 1:return[2,i.sent()]}})})},e.createTitlePanelFlat=function(t,e,n){return s(this,arguments,void 0,function(t,e,n,i){return void 0===i&&(i=!1),a(this,function(r){switch(r.label){case 0:return[4,this.createTitleSurveyPanelFlat(t,e,n,i?this.TITLE_PAGE_FONT_SIZE_SCALE:this.TITLE_PANEL_FONT_SIZE_SCALE)];case 1:return[2,r.sent()]}})})},e.createDescFlat=function(t,e,n,i){return s(this,void 0,void 0,function(){var r,o;return a(this,function(s){switch(s.label){case 0:return r=n.fontSize,n.fontSize=r*this.DESCRIPTION_FONT_SIZE_SCALE,[4,this.createTextFlat(t,e,n,i,w)];case 1:return o=s.sent(),n.fontSize=r,[2,o]}})})},e.getReadonlyRenderAs=function(t,e){return"auto"===t.readonlyRenderAs?e.readonlyRenderAs:t.readonlyRenderAs},e.createCommentFlat=function(t,n,i,r){return s(this,void 0,void 0,function(){var o,s,l,c,h,u;return a(this,function(a){switch(a.label){case 0:return r.rows=null!==(h=r.rows)&&void 0!==h?h:1,r.value=null!==(u=r.value)&&void 0!==u?u:"",o=this.createTextFieldRect(t,i,r.rows),e.shouldRenderReadOnly(n,i,r.isReadOnly)?[4,this.createReadOnlyTextFieldTextFlat(t,i,n,r.value)]:[3,2];case 1:s=a.sent(),l=i.unitHeight*this.VALUE_READONLY_PADDING_SCALE,s.yBot+l>o.yBot&&(o.yBot=s.yBot+l),a.label=2;case 2:return c=new S(n,i,o,r),s&&(c.textBrick=s),[2,c]}})})},Object.defineProperty(e,"hasDocument",{get:function(){return"undefined"!=typeof document},enumerable:!1,configurable:!0}),e.getImageBase64=function(t){return s(this,void 0,void 0,function(){var e;return a(this,function(n){return(e=new Image).crossOrigin="anonymous",[2,new Promise(function(n){e.onload=function(){var t=document.createElement("canvas"),i=t.getContext("2d");t.height=e.naturalHeight,t.width=e.naturalWidth,i.drawImage(e,0,0);var r=t.toDataURL();n(r)},e.onerror=function(){n("")},e.src=t})]})})},e.getImageLink=function(t,n,i){return s(this,void 0,void 0,function(){var r,o,s,l;return a(this,function(a){switch(a.label){case 0:return r=96/72,this.shouldConvertImageToPng?[4,e.getImageBase64(n.link)]:[3,2];case 1:return s=a.sent(),[3,3];case 2:s=n.link,a.label=3;case 3:return o=s,"function"==typeof XMLSerializer&&i?(l="<div style='overflow: hidden; width: ".concat(n.width*r,"px; height: ").concat(n.height*r,"px;'>\n <img src='").concat(o,"' style='object-fit: ").concat(n.objectFit,"; width: 100%; height: 100%;'/>\n </div>"),[4,e.htmlToImage(l,n.width,t)]):[3,5];case 4:o=a.sent().url,a.label=5;case 5:return[2,o]}})})},e.createImageFlat=function(t,n,i,r,o){return s(this,void 0,void 0,function(){var s,l,c;return a(this,function(a){switch(a.label){case 0:return e.inBrowser?(r.objectFit=n&&n.imageFit?n.imageFit:r.objectFit||"contain",(null!=o?o:i.applyImageFit)&&r.width>i.paperWidth-i.margins.left-i.margins.right&&(s=i.paperWidth-i.margins.left-i.margins.right,r.height*=s/r.width,r.width=s),c="<img src='".concat,[4,e.getImageLink(i,r,null!=o?o:i.applyImageFit)]):[3,2];case 1:return l=c.apply("<img src='",[a.sent(),"' width='"]).concat(r.width,"' height='").concat(r.height,"'/>"),[2,new O(n,i,this.createRect(t,r.width,r.height),l,!0)];case 2:return[2,new P(n,i,r.link,t,r.width,r.height)]}})})},e.canPreviewImage=function(t,e,n){return t.canPreviewImage(e)},e.getImageSize=function(t){return s(this,void 0,void 0,function(){return a(this,function(n){switch(n.label){case 0:return e.inBrowser?[3,2]:[4,new Promise(function(t){return t({width:void 0,height:void 0})})];case 1:case 3:return[2,n.sent()];case 2:return[4,new Promise(function(e){var n=new Image;n.src=t,n.onload=function(){return e({width:n.width,height:n.height})},n.onerror=function(){return e(null)}})]}})})},e.createRowlineFlat=function(t,e,n,i){var r=void 0===n?e.paperWidth-e.margins.right:t.xLeft+n;return r=r>t.xLeft?r:t.xLeft+this.EPSILON,new f(e,{xLeft:t.xLeft,xRight:r,yTop:t.yTop+this.EPSILON,yBot:t.yTop+this.EPSILON},void 0===i?null:i)},e.createLinkFlat=function(t,e,n,i,r){return s(this,void 0,void 0,function(){var o,s,l=this;return a(this,function(a){switch(a.label){case 0:return[4,this.createTextFlat(t,e,n,i,b)];case 1:return o=a.sent(),s=new u,o.unfold().forEach(function(t){s.addBrick(new C(t,r));var e=l.createPoint(s);s.addBrick(l.createRowlineFlat(e,n,s.width,C.COLOR))}),[2,s]}})})},e.createAcroformRect=function(t){return[t.xLeft,t.yTop,t.xRight-t.xLeft,t.yBot-t.yTop]},e.createTextFieldRect=function(t,e,n){void 0===n&&(n=1);var i=e.paperWidth-t.xLeft-e.margins.right;i=Math.max(i,e.unitWidth);var r=e.unitHeight*n;return this.createRect(t,i,r)},e.createReadOnlyTextFieldTextFlat=function(t,e,n,i){return s(this,void 0,void 0,function(){var r,o;return a(this,function(s){switch(s.label){case 0:return r=e.unitWidth*this.VALUE_READONLY_PADDING_SCALE,t.yTop+=r,t.xLeft+=r,e.pushMargins(t.xLeft,e.margins.right+r),[4,this.createTextFlat(t,n,e,i.toString(),b)];case 1:return o=s.sent(),e.popMargins(),[2,o]}})})},e.renderFlatBorders=function(t,e){var n,i,r,o,s,a;if(this.FORM_BORDER_VISIBLE){e.rounded=null===(r=e.rounded)||void 0===r||r,e.outside=null!==(o=e.outside)&&void 0!==o&&o;var c=Math.min(e.width,e.height),h=this.getBorderWidth(t),u=t.unitHeight*this.VISIBLE_BORDER_SCALE*this.BORDER_SCALE,f=e.outside?(c+h)/c-u/c:(c-h)/c+u/c,d=t.doc.getDrawColor();t.doc.setDrawColor(e.formBorderColor),t.doc.setLineWidth(u);var p=this.scaleRect(e,f);if(e.dashStyle){var g=e.dashStyle,m=2*(Math.abs(p.yTop-p.yBot)+Math.abs(p.xLeft-p.xRight)),y=g.dashArray[0]+(null!==(s=g.dashArray[1])&&void 0!==s?s:g.dashArray[0]),v=g.dashArray[0]+m%y/Math.floor(m/y);t.doc.setLineDashPattern([v,null!==(a=g.dashArray[1])&&void 0!==a?a:g.dashArray[0]],g.dashPhase)}if((n=t.doc).rect.apply(n,this.createAcroformRect(p)),e.rounded){var b=t.unitHeight*this.UNVISIBLE_BORDER_SCALE*this.BORDER_SCALE,x=1-b/c,T=this.RADIUS_SCALE*b;t.doc.setDrawColor(this.BACKGROUND_COLOR),t.doc.setLineWidth(b),(i=t.doc).roundedRect.apply(i,l(l([],this.createAcroformRect(this.scaleRect(e,x)),!1),[T,T],!1))}e.dashStyle&&t.doc.setLineDashPattern([]),t.doc.setDrawColor(d)}},e.getLocString=function(t){return this.hasHtml(t)?t.renderedHtml:t.renderedText||t.renderedHtml},e.getContentQuestion=function(t){return t.contentQuestion?t.contentQuestion:t},e.getContentQuestionTypeRenderAs=function(t,e){var n=t.renderAs;if("boolean"===t.getType()&&e.options.useLegacyBooleanRendering&&(n="checkbox"),"default"!==n){var i="".concat(t.getType(),"-").concat(n);if(F.getInstance().isTypeRegistered(i))return i}return t.getType()},e.getContentQuestionType=function(t,e){return t.customWidget?t.customWidget.pdfQuestionType:t.contentQuestion?"custom_model":this.getContentQuestionTypeRenderAs(t,e)},e.getRatingMinWidth=function(t){return t.measureText(this.RATING_MIN_WIDTH).width},e.getRatingItemText=function(t,e,n){var i=new c.LocalizableString(n.owner,n.useMarkdown);return i.text=this.getLocString(n),0===e&&t.minRateDescription?i.text=t.locMinRateDescription.text+" "+this.getLocString(n):e===t.visibleRateValues.length-1&&t.maxRateDescription&&(i.text=this.getLocString(n)+" "+t.locMaxRateDescription.text),i},e.getPageAvailableWidth=function(t){return t.paperWidth-t.margins.left-t.margins.right},e.getImagePickerAvailableWidth=function(t){var e=this.getPageAvailableWidth(t)-(this.IMAGEPICKER_COUNT-1)*t.unitHeight;return e>0?e:t.unitHeight},e.getColumnWidth=function(t,e){return(this.getPageAvailableWidth(t)-(e-1)*t.unitWidth*this.GAP_BETWEEN_COLUMNS)/e},e.setColumnMargins=function(t,e,n){var i=this.getColumnWidth(t,e);t.margins.left=t.margins.left+n*(i+t.unitWidth*this.GAP_BETWEEN_COLUMNS),t.margins.right=t.margins.right+(e-n-1)*(i+t.unitWidth*this.GAP_BETWEEN_COLUMNS)},e.moveRect=function(t,e,n){return void 0===e&&(e=t.xLeft),void 0===n&&(n=t.yTop),{xLeft:e,yTop:n,xRight:e+t.xRight-t.xLeft,yBot:n+t.yBot-t.yTop}},e.scaleRect=function(t,e){var n=Math.min(t.xRight-t.xLeft,t.yBot-t.yTop)*(1-e)/2;return{xLeft:t.xLeft+n,yTop:t.yTop+n,xRight:t.xRight-n,yBot:t.yBot-n}},e.getBorderWidth=function(t){return 2*t.unitWidth*this.BORDER_SCALE},e.formScale=function(t,e){var n=Math.min(e.width,e.height);return(n-this.getBorderWidth(t))/n},e.generateQuestionFlats=function(e,n,i,r){return s(this,void 0,void 0,function(){var o,s,c;return a(this,function(a){switch(a.label){case 0:return o=this.getContentQuestionType(i,e),[4,F.getInstance().create(e,i,n,o).generateFlats(r)];case 1:return s=a.sent(),c=new p(r,s,i,n,F.getInstance(),t),i.customWidget&&i.customWidget.isFit(i)&&i.customWidget.pdfRender&&e.onRenderQuestion.unshift(i.customWidget.pdfRender),[4,e.onRenderQuestion.fire(e,c)];case 2:return a.sent(),[2,l([],c.bricks,!0)]}})})},e.isFontExist=function(t,e){return t.doc.internal.getFont(e).fontName===e},e.isCustomFont=function(t,e){return t.doc.internal.getFont(e).encoding===this.CUSTOM_FONT_ENCODING},e.fixFont=function(t){this.isCustomFont(t,t.fontName)&&(t.doc.text("load font",0,0),t.doc.deletePage(1),t.addPage())},e.clone=function(t){var e={};for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e},e.shouldRenderReadOnly=function(t,n,i){return(!!t&&t.isReadOnly||i)&&"acroform"!==e.getReadonlyRenderAs(t,n)||(null==n?void 0:n.compress)},e.isSizeEmpty=function(t){return!t||"auto"===t},e.isHeightEmpty=function(t){return this.isSizeEmpty(t)||"100%"==t},e.getCorrectedImageSize=function(t,n){return s(this,void 0,void 0,function(){var i,r,o,s,l,c,h,u,f,d;return a(this,function(a){switch(a.label){case 0:return i=n.imageWidth,r=n.imageLink,o=n.imageHeight,s=n.defaultImageWidth,l=n.defaultImageHeight,i="number"==typeof i?i.toString():i,o="number"==typeof o?o.toString():o,c=i&&e.parseWidth(i,e.getPageAvailableWidth(t),1,"px"),h=o&&e.parseWidth(o,e.getPageAvailableWidth(t),1,"px"),s="number"==typeof s?s.toString():s,l="number"==typeof l?l.toString():l,u=s&&e.parseWidth(s,e.getPageAvailableWidth(t),1,"px"),f=l&&e.parseWidth(l,e.getPageAvailableWidth(t),1,"px"),e.isSizeEmpty(i)||e.isHeightEmpty(o)?[4,e.getImageSize(r)]:[3,2];case 1:d=a.sent(),e.isSizeEmpty(i)?e.isHeightEmpty(o)?d&&d.height&&d.width&&(h=e.parseWidth(d.height.toString(),e.getPageAvailableWidth(t),1,"px"),c=e.parseWidth(d.width.toString(),e.getPageAvailableWidth(t),1,"px")):d&&d.height&&(c=d.width*h/d.height):d&&d.width&&(h=d.height*c/d.width),a.label=2;case 2:return[2,{width:c||u||0,height:h||f||0}]}})})},e.EPSILON=2220446049250313e-30,e.TITLE_SURVEY_FONT_SIZE_SCALE=1.7,e.TITLE_PAGE_FONT_SIZE_SCALE=1.3,e.TITLE_PANEL_FONT_SIZE_SCALE=1.3,e.DESCRIPTION_FONT_SIZE_SCALE=2/3,e.OTHER_ROWS_COUNT=2,e.RATING_MIN_WIDTH=3,e.RATING_MIN_HEIGHT=2,e.RATING_COLUMN_WIDTH=5,e.MATRIX_COLUMN_WIDTH=5,e.IMAGEPICKER_COUNT=4,e.IMAGEPICKER_RATIO=4/3,e.MULTIPLETEXT_TEXT_PERS=Math.E/10,e.HTML_TAIL_TEXT_SCALE=.24,e.SELECT_ITEM_FLAT_SCALE=.95,e.GAP_BETWEEN_ROWS=.25,e.GAP_BETWEEN_COLUMNS=1.5,e.GAP_BETWEEN_ITEM_TEXT=.25,e.FORM_BORDER_VISIBLE=!0,e.BORDER_SCALE=.1,e.VISIBLE_BORDER_SCALE=.8,e.UNVISIBLE_BORDER_SCALE=.2,e.RADIUS_SCALE=3,e.TITLE_FONT_SCALE=1.1,e.VALUE_READONLY_PADDING_SCALE=.3,e.HTML_TO_IMAGE_QUALITY=1,e.FORM_BORDER_COLOR="#9f9f9f",e.TEXT_COLOR="#404040",e.BACKGROUND_COLOR="#FFFFFF",e.TITLE_LOCATION_MATRIX="matrix",e.STANDARD_FONT="helvetica",e.CUSTOM_FONT_ENCODING="Identity-H",e.inBrowser="function"==typeof Image,e.shouldConvertImageToPng=!0,e}();!function(t,e){var n,i=t.API,r=1;function o(t){for(var e="",n=0;n<t.length;n++){for(var i=t.charCodeAt(n).toString(16).toUpperCase();i.length<4;)i="0"+i;e+=i}return"<FEFF"+e+">"}var s=function(t){return t.replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},a=function(t){return t.replace(/\\\\/g,"\\").replace(/\\\(/g,"(").replace(/\\\)/g,")")},l=function(t){return t.toFixed(2)},c=function(t){return t.toFixed(5)};i.__acroform__={};var h=function(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t},u=function(t){return t*r},f=function(t){return t/r},d=function(t){var e=new M,n=K.internal.getHeight(t)||0,i=K.internal.getWidth(t)||0;return e.BBox=[0,0,Number(l(i)),Number(l(n))],e},p=i.__acroform__.setBit=function(t,e){if(t=t||0,e=e||0,isNaN(t)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBit");return t|1<<e},g=i.__acroform__.clearBit=function(t,e){if(t=t||0,e=e||0,isNaN(t)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBit");return t&~(1<<e)},m=i.__acroform__.getBit=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBit");return t&1<<e?1:0},y=i.__acroform__.getBitForPdf=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBitForPdf");return m(t,e-1)},v=i.__acroform__.setBitForPdf=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBitForPdf");return p(t,e-1)},b=i.__acroform__.clearBitForPdf=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBitForPdf");return g(t,e-1)},x=i.__acroform__.calculateCoordinates=function(t){var e=this.internal.getHorizontalCoordinate,n=this.internal.getVerticalCoordinate,i=t[0],r=t[1],o=t[2],s=t[3],a={};return a.lowerLeft_X=e(i)||0,a.lowerLeft_Y=n(r+s)||0,a.upperRight_X=e(i+o)||0,a.upperRight_Y=n(r)||0,[Number(l(a.lowerLeft_X)),Number(l(a.lowerLeft_Y)),Number(l(a.upperRight_X)),Number(l(a.upperRight_Y))]},T=function(t){if(t.appearanceStreamContent)return t.appearanceStreamContent;if(t.V||t.DV){var e=[],i=t.V||t.DV,r=F(t,i),o=n.internal.getFont(t.fontName,t.fontStyle).id;e.push("/Tx BMC"),e.push("q"),e.push("BT"),e.push(n.__private__.encodeColorString(t.color)),e.push("/"+o+" "+l(r.fontSize)+" Tf"),e.push("1 0 0 1 0 0 Tm"),e.push(r.text),e.push("ET"),e.push("Q"),e.push("EMC");var s=new d(t);return s.stream=e.join("\n"),s}},F=function(t,e){t.isUnicode&&(e=t.trueValue);var i=0===t.fontSize?t.maxFontSize:t.fontSize,r={text:"",fontSize:""},o=(e=")"==(e="("==e.substr(0,1)?e.substr(1):e).substr(e.length-1)?e.substr(0,e.length-1):e).split(" ");o=o.map(function(t){return t.split("\n")}),t.multiline||(o=o.map(function(t){return[t.join(" ")]}));var a=i,c=K.internal.getHeight(t)||0;c=c<0?-c:c;var h=K.internal.getWidth(t)||0;h=h<0?-h:h;var u=function(e,n,i){if(e+1<o.length){var r=n+" "+o[e+1][0];return _(r,t,i).width<=h-4}return!1};a++;t:for(;a>0;){e="",a--;var f,d,p=_("3",t,a).height,g=t.multiline?c-a:(c-p)/2,m=g+=2,y=0,v=0,b=0;if(a<=0){e="(...) Tj\n",e+="% Width of Text: "+_(e,t,a=12).width+", FieldWidth:"+h+"\n";break}for(var x="",T=0,F=0;F<o.length;F++)if(o.hasOwnProperty(F)){var R=!1;if(1!==o[F].length&&b!==o[F].length-1){if((p+2)*(T+2)+2>c)continue t;x+=o[F][b],R=!0,v=F,F--}else{x=" "==(x+=o[F][b]+" ").substr(x.length-1)?x.substr(0,x.length-1):x;var w=parseInt(F),C=u(w,x,a),O=F>=o.length-1;if(C&&!O){x+=" ",b=0;continue}if(C||O){if(O)v=w;else if(t.multiline&&(p+2)*(T+2)+2>c)continue t}else{if(!t.multiline)continue t;if((p+2)*(T+2)+2>c)continue t;v=w}}for(var P="",E=y;E<=v;E++){var S=o[E];if(t.multiline){if(E===v){P+=S[b]+" ",b=(b+1)%S.length;continue}if(E===y){P+=S[S.length-1]+" ";continue}}P+=S[0]+" "}switch(P=" "==P.substr(P.length-1)?P.substr(0,P.length-1):P,d=_(P,t,a).width,t.textAlign){case"right":f=h-d-2;break;case"center":f=(h-d)/2;break;default:f=2}if(e+=l(f)+" "+l(m)+" Td\n",t.isUnicode){var L={};L[n.internal.getFont().id]=n.internal.getFont();var B={text:P,x:null,y:null,options:{lang:null},mutex:{pdfEscape:s,activeFontKey:n.internal.getFont().id,fonts:L,activeFontSize:t.fontSize}};n.internal.events.publish("postProcessText",B),e+="<"+B.text+"> Tj\n"}else e+="("+s(P)+") Tj\n";e+=-l(f)+" 0 Td\n",m=-(a+2),d=0,y=R?v:v+1,T++,x=""}break}return r.text=e,r.fontSize=a,r},_=function(t,e,i){var r=n.internal.getFont(e.fontName,e.fontStyle),o=n.getStringUnitWidth(t,{font:r,fontSize:parseFloat(i),charSpace:0})*parseFloat(i);return{height:n.getStringUnitWidth("3",{font:r,fontSize:parseFloat(i),charSpace:0})*parseFloat(i)*1.5,width:o}},R={fields:[],xForms:[],acroFormDictionaryRoot:null,printedOut:!1,internal:null,isInitialized:!1},w=function(){n.internal.acroformPlugin.acroFormDictionaryRoot.objId=void 0;var t=n.internal.acroformPlugin.acroFormDictionaryRoot.Fields;for(var e in t)if(t.hasOwnProperty(e)){var i=t[e];i.objId=void 0,i.hasAnnotation&&O.call(n,i)}},C=function(t){n.internal.acroformPlugin.printedOut&&(n.internal.acroformPlugin.printedOut=!1,n.internal.acroformPlugin.acroFormDictionaryRoot=null),n.internal.acroformPlugin.acroFormDictionaryRoot||B.call(n),n.internal.acroformPlugin.acroFormDictionaryRoot.Fields.push(t)},O=function(t){var e={type:"reference",object:t};void 0===n.internal.getPageInfo(t.page).pageContext.annotations.find(function(t){return t.type===e.type&&t.object===e.object})&&n.internal.getPageInfo(t.page).pageContext.annotations.push(e)},P=function(){if(void 0===n.internal.acroformPlugin.acroFormDictionaryRoot)throw new Error("putCatalogCallback: Root missing.");n.internal.write("/AcroForm "+n.internal.acroformPlugin.acroFormDictionaryRoot.objId+" 0 R")},E=function(){n.internal.events.unsubscribe(n.internal.acroformPlugin.acroFormDictionaryRoot._eventID),delete n.internal.acroformPlugin.acroFormDictionaryRoot._eventID,n.internal.acroformPlugin.printedOut=!0},S=function(t){var e=!t;for(var i in t||(n.internal.newObjectDeferredBegin(n.internal.acroformPlugin.acroFormDictionaryRoot.objId,!0),n.internal.acroformPlugin.acroFormDictionaryRoot.putStream()),t=t||n.internal.acroformPlugin.acroFormDictionaryRoot.Kids)if(t.hasOwnProperty(i)){var r=t[i],o=[],s=r.Rect;if(r.Rect&&(r.Rect=x.call(this,r.Rect)),n.internal.newObjectDeferredBegin(r.objId,!0),r.DA=K.createDefaultAppearanceStream(r),"object"==typeof r&&"function"==typeof r.getKeyValueListForStream&&(o=r.getKeyValueListForStream()),r.Rect=s,r.hasAppearanceStream&&!r.appearanceStreamContent){var a=T.call(this,r);o.push({key:"AP",value:"<</N "+a+">>"}),n.internal.acroformPlugin.xForms.push(a)}if(r.appearanceStreamContent){var l="";for(var c in r.appearanceStreamContent)if(r.appearanceStreamContent.hasOwnProperty(c)){var h=r.appearanceStreamContent[c];if(l+="/"+c+" ",l+="<<",Object.keys(h).length>=1||Array.isArray(h)){for(var i in h)if(h.hasOwnProperty(i)){var u=h[i];"function"==typeof u&&(u=u.call(this,r)),l+="/"+i+" "+u+" ",n.internal.acroformPlugin.xForms.indexOf(u)>=0||n.internal.acroformPlugin.xForms.push(u)}}else"function"==typeof(u=h)&&(u=u.call(this,r)),l+="/"+i+" "+u,n.internal.acroformPlugin.xForms.indexOf(u)>=0||n.internal.acroformPlugin.xForms.push(u);l+=">>"}o.push({key:"AP",value:"<<\n"+l+">>"})}n.internal.putStream({additionalKeyValues:o}),n.internal.out("endobj")}e&&L.call(this,n.internal.acroformPlugin.xForms)},L=function(t){for(var e in t)if(t.hasOwnProperty(e)){var i=e,r=t[e];n.internal.newObjectDeferredBegin(r&&r.objId,!0),"object"==typeof r&&"function"==typeof r.putStream&&r.putStream(),delete t[i]}},B=function(){if(void 0!==this.internal&&(void 0===this.internal.acroformPlugin||!1===this.internal.acroformPlugin.isInitialized)){if(n=this,W.FieldNum=0,this.internal.acroformPlugin=JSON.parse(JSON.stringify(R)),this.internal.acroformPlugin.acroFormDictionaryRoot)throw new Error("Exception while creating AcroformDictionary");r=n.internal.scaleFactor,n.internal.acroformPlugin.acroFormDictionaryRoot=new k,n.internal.acroformPlugin.acroFormDictionaryRoot._eventID=n.internal.events.subscribe("postPutResources",E),n.internal.events.subscribe("buildDocument",w),n.internal.events.subscribe("putCatalog",P),n.internal.events.subscribe("postPutPages",S),n.internal.acroformPlugin.isInitialized=!0}},A=i.__acroform__.arrayToPdfArray=function(t){if(Array.isArray(t)){for(var e="[",n=0;n<t.length;n++)switch(0!==n&&(e+=" "),typeof t[n]){case"boolean":case"number":case"object":e+=t[n].toString();break;case"string":"/"!==t[n].substr(0,1)?e+="("+s(t[n].toString())+")":e+=t[n].toString()}return e+"]"}throw new Error("Invalid argument passed to jsPDF.__acroform__.arrayToPdfArray")},I=function(t){return(t=t||"").toString(),"("+s(t)+")"},N=function(){var t;Object.defineProperty(this,"objId",{configurable:!0,get:function(){return t||(t=n.internal.newObjectDeferred()),t},set:function(e){t=e}})};N.prototype.toString=function(){return this.objId+" 0 R"},N.prototype.putStream=function(){var t=this.getKeyValueListForStream();n.internal.putStream({data:this.stream,additionalKeyValues:t}),n.internal.out("endobj")},N.prototype.getKeyValueListForStream=function(){return function(t){var e=[],n=Object.getOwnPropertyNames(t).filter(function(t){return"content"!=t&&"appearanceStreamContent"!=t&&"_"!=t.substring(0,1)});for(var i in n){var r=Object.getOwnPropertyDescriptor(t,n[i]);if(r&&!1===r.configurable){var o=n[i],s=t[o];s&&(Array.isArray(s)?e.push({key:o,value:A(s)}):s instanceof N?e.push({key:o,value:s.objId+" 0 R"}):"function"!=typeof s&&e.push({key:o,value:s}))}}return e}(this)};var M=function(){N.call(this),Object.defineProperty(this,"Type",{value:"/XObject",configurable:!1,writeable:!0}),Object.defineProperty(this,"Subtype",{value:"/Form",configurable:!1,writeable:!0}),Object.defineProperty(this,"FormType",{value:1,configurable:!1,writeable:!0});var t,e=[];Object.defineProperty(this,"BBox",{configurable:!1,writeable:!0,get:function(){return e},set:function(t){e=t}}),Object.defineProperty(this,"Resources",{value:"2 0 R",configurable:!1,writeable:!0}),Object.defineProperty(this,"stream",{enumerable:!1,configurable:!0,set:function(e){t=e.trim()},get:function(){return t||null}})};h(M,N);var k=function(){N.call(this);var t,e=[];Object.defineProperty(this,"Kids",{enumerable:!1,configurable:!0,get:function(){return e.length>0?e:void 0}}),Object.defineProperty(this,"Fields",{enumerable:!1,configurable:!1,get:function(){return e}}),Object.defineProperty(this,"DA",{enumerable:!1,configurable:!1,get:function(){if(t)return"("+t+")"},set:function(e){t=e}})};h(k,N);var W=function(){N.call(this);var t=4;this.isUnicode=!1,this.trueValue="",Object.defineProperty(this,"F",{enumerable:!1,configurable:!1,get:function(){return t},set:function(e){if(isNaN(e))throw new Error('Invalid value "'+e+'" for attribute F supplied.');t=e}}),Object.defineProperty(this,"showWhenPrinted",{enumerable:!0,configurable:!0,get:function(){return Boolean(y(t,3))},set:function(e){!0===Boolean(e)?this.F=v(t,3):this.F=b(t,3)}});var e=0;Object.defineProperty(this,"Ff",{enumerable:!1,configurable:!1,get:function(){return e},set:function(t){if(isNaN(t))throw new Error('Invalid value "'+t+'" for attribute Ff supplied.');e=t}});var n=[];Object.defineProperty(this,"Rect",{enumerable:!1,configurable:!1,get:function(){if(0!==n.length)return n},set:function(t){n=void 0!==t?t:[]}}),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,get:function(){return!n||isNaN(n[0])?0:f(n[0])},set:function(t){n[0]=u(t)}}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,get:function(){return!n||isNaN(n[1])?0:f(n[1])},set:function(t){n[1]=u(t)}}),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,get:function(){return!n||isNaN(n[2])?0:f(n[2])},set:function(t){n[2]=u(t)}}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,get:function(){return!n||isNaN(n[3])?0:f(n[3])},set:function(t){n[3]=u(t)}});var i="";Object.defineProperty(this,"FT",{enumerable:!0,configurable:!1,get:function(){return i},set:function(t){switch(t){case"/Btn":case"/Tx":case"/Ch":case"/Sig":i=t;break;default:throw new Error('Invalid value "'+t+'" for attribute FT supplied.')}}});var r=null;Object.defineProperty(this,"T",{enumerable:!0,configurable:!1,get:function(){if(!r||r.length<1){if(this instanceof U)return;r="FieldObject"+W.FieldNum++}return"("+s(r)+")"},set:function(t){r=t.toString()}}),Object.defineProperty(this,"fieldName",{configurable:!0,enumerable:!0,get:function(){return r},set:function(t){r=t}});var l="helvetica";Object.defineProperty(this,"fontName",{enumerable:!0,configurable:!0,get:function(){return l},set:function(t){l=t}});var c="normal";Object.defineProperty(this,"fontStyle",{enumerable:!0,configurable:!0,get:function(){return c},set:function(t){c=t}});var h=0;Object.defineProperty(this,"fontSize",{enumerable:!0,configurable:!0,get:function(){return f(h)},set:function(t){h=u(t)}});var d=50;Object.defineProperty(this,"maxFontSize",{enumerable:!0,configurable:!0,get:function(){return f(d)},set:function(t){d=u(t)}});var p="black";Object.defineProperty(this,"color",{enumerable:!0,configurable:!0,get:function(){return p},set:function(t){p=t}});var g="/F1 0 Tf 0 g";Object.defineProperty(this,"DA",{enumerable:!0,configurable:!1,get:function(){if(!(!g||this instanceof U||this instanceof X))return I(g)},set:function(t){t=t.toString(),g=t}});var m=null;Object.defineProperty(this,"DV",{enumerable:!1,configurable:!1,get:function(){if(m)return this instanceof z==0?I(m):m},set:function(t){t=t.toString(),m=this instanceof z==0?"("===t.substr(0,1)?a(t.substr(1,t.length-2)):a(t):t}}),Object.defineProperty(this,"defaultValue",{enumerable:!0,configurable:!0,get:function(){return this instanceof z==1?a(m.substr(1,m.length-1)):m},set:function(t){t=t.toString(),m=this instanceof z==1?"/"+t:t}});var x=null;Object.defineProperty(this,"V",{enumerable:!1,configurable:!1,get:function(){return this.isUnicode?x:x?this instanceof z==0?I(x):x:void 0},set:function(t){t=t.toString(),this.isUnicode?(x=o(t),this.trueValue=t):x=this instanceof z==0?"("===t.substr(0,1)?a(t.substr(1,t.length-2)):a(t):t}}),Object.defineProperty(this,"value",{enumerable:!0,configurable:!0,get:function(){return this instanceof z==1?a(x.substr(1,x.length-1)):x},set:function(t){t=t.toString(),x=this instanceof z==1?"/"+t:t}}),Object.defineProperty(this,"hasAnnotation",{enumerable:!0,configurable:!0,get:function(){return this.Rect}}),Object.defineProperty(this,"Type",{enumerable:!0,configurable:!1,get:function(){return this.hasAnnotation?"/Annot":null}}),Object.defineProperty(this,"Subtype",{enumerable:!0,configurable:!1,get:function(){return this.hasAnnotation?"/Widget":null}});var T,F=!1;Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,writeable:!0,get:function(){return F},set:function(t){t=Boolean(t),F=t}}),Object.defineProperty(this,"page",{enumerable:!0,configurable:!0,writeable:!0,get:function(){if(T)return T},set:function(t){T=t}}),Object.defineProperty(this,"readOnly",{enumerable:!0,configurable:!0,get:function(){return Boolean(y(this.Ff,1))},set:function(t){!0===Boolean(t)?this.Ff=v(this.Ff,1):this.Ff=b(this.Ff,1)}}),Object.defineProperty(this,"required",{enumerable:!0,configurable:!0,get:function(){return Boolean(y(this.Ff,2))},set:function(t){!0===Boolean(t)?this.Ff=v(this.Ff,2):this.Ff=b(this.Ff,2)}}),Object.defineProperty(this,"noExport",{enumerable:!0,configurable:!0,get:function(){return Boolean(y(this.Ff,3))},set:function(t){!0===Boolean(t)?this.Ff=v(this.Ff,3):this.Ff=b(this.Ff,3)}});var _=null;Object.defineProperty(this,"Q",{enumerable:!0,configurable:!1,get:function(){if(null!==_)return _},set:function(t){if(-1===[0,1,2].indexOf(t))throw new Error('Invalid value "'+t+'" for attribute Q supplied.');_=t}}),Object.defineProperty(this,"textAlign",{get:function(){var t;switch(_){case 0:default:t="left";break;case 1:t="center";break;case 2:t="right"}return t},configurable:!0,enumerable:!0,set:function(t){switch(t){case"right":case 2:_=2;break;case"center":case 1:_=1;break;default:_=0}}})};h(W,N);var q=function(){W.call(this),this.FT="/Ch",this.V="()",this.fontName="zapfdingbats";var t=0;Object.defineProperty(this,"TI",{enumerable:!0,configurable:!1,get:function(){return t},set:function(e){t=e}});var e="<< /BG [ 0.975 0.975 0.975 ] >>";Object.defineProperty(this,"MK",{enumerable:!0,configurable:!1,get:function(){return e},set:function(t){e=t}}),Object.defineProperty(this,"topIndex",{enumerable:!0,configurable:!0,get:function(){return t},set:function(e){t=e}});var n=[];Object.defineProperty(this,"Opt",{enumerable:!0,configurable:!1,get:function(){return this.isUnicode?function(t){for(var e="[ ",n=0;n<t.length;n++)e+=o(t[n]);return e+" ]"}(n):A(n)},set:function(t){var e,i;i=[],"string"==typeof(e=t)&&(i=function(t,e,n){n||(n=1);for(var i,r=[];i=e.exec(t);)r.push(i[n]);return r}(e,/\((.*?)\)/g)),n=i}}),this.getOptions=function(){return n},this.setOptions=function(t){n=t,this.sort&&n.sort()},this.addOption=function(t){t=(t=t||"").toString(),n.push(t),this.sort&&n.sort()},this.removeOption=function(t,e){for(e=e||!1,t=(t=t||"").toString();-1!==n.indexOf(t)&&(n.splice(n.indexOf(t),1),!1!==e););},Object.defineProperty(this,"combo",{enumerable:!0,configurable:!0,get:function(){return Boolean(y(this.Ff,18))},set:function(t){!0===Boolean(t)?this.Ff=v(this.Ff,18):this.Ff=b(this.Ff,18)}}),Object.defineProperty(this,"edit",{enumerable:!0,configurable:!0,get:function(){return Boolean(y(this.Ff,19))},set:function(t){!0===this.combo&&(!0===Boolean(t)?this.Ff=v(this.Ff,19):this.Ff=b(this.Ff,19))}}),Object.defineProperty(this,"sort",{enumerable:!0,configurable:!0,get:function(){return Boolean(y(this.Ff,20))},set:function(t){!0===Boolean(t)?(this.Ff=v(this.Ff,20),n.sort()):this.Ff=b(this.Ff,20)}}),Object.defineProperty(this,"multiSelect",{enumerable:!0,configurable:!0,get:function(){return Boolean(y(this.Ff,22))},set:function(t){!0===Boolean(t)?this.Ff=v(this.Ff,22):this.Ff=b(this.Ff,22)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return Boolean(y(this.Ff,23))},set:function(t){!0===Boolean(t)?this.Ff=v(this.Ff,23):this.Ff=b(this.Ff,23)}}),Object.defineProperty(this,"commitOnSelChange",{enumerable:!0,configurable:!0,get:function(){return Boolean(y(this.Ff,27))},set:function(t){!0===Boolean(t)?this.Ff=v(this.Ff,27):this.Ff=b(this.Ff,27)}}),this.hasAppearanceStream=!1};h(q,W);var H=function(){q.call(this),this.fontName="helvetica",this.combo=!1};h(H,q);var D=function(){H.call(this),this.combo=!0};h(D,H);var j=function(){D.call(this),this.edit=!0};h(j,D);var z=function(){W.call(this),this.FT="/Btn",Object.defineProperty(this,"noToggleToOff",{enumerable:!0,configurable:!0,get:function(){return Boolean(y(this.Ff,15))},set:function(t){!0===Boolean(t)?this.Ff=v(this.Ff,15):this.Ff=b(this.Ff,15)}}),Object.defineProperty(this,"radio",{enumerable:!0,configurable:!0,get:function(){return Boolean(y(this.Ff,16))},set:function(t){!0===Boolean(t)?this.Ff=v(this.Ff,16):this.Ff=b(this.Ff,16)}}),Object.defineProperty(this,"pushButton",{enumerable:!0,configurable:!0,get:function(){return Boolean(y(this.Ff,17))},set:function(t){!0===Boolean(t)?this.Ff=v(this.Ff,17):this.Ff=b(this.Ff,17)}}),Object.defineProperty(this,"radioIsUnison",{enumerable:!0,configurable:!0,get:function(){return Boolean(y(this.Ff,26))},set:function(t){!0===Boolean(t)?this.Ff=v(this.Ff,26):this.Ff=b(this.Ff,26)}});var t,e={};Object.defineProperty(this,"MK",{enumerable:!1,configurable:!1,get:function(){if(0!==Object.keys(e).length){var t,n=[];for(t in n.push("<<"),e)n.push("/"+t+" ("+e[t]+")");return n.push(">>"),n.join("\n")}},set:function(t){"object"==typeof t&&(e=t)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return e.CA||""},set:function(t){"string"==typeof t&&(e.CA=t)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return t},set:function(e){t=e}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return t.substr(1,t.length-1)},set:function(e){t="/"+e}})};h(z,W);var G=function(){z.call(this),this.pushButton=!0};h(G,z);var V=function(){z.call(this),this.radio=!0,this.pushButton=!1;var t=[];Object.defineProperty(this,"Kids",{enumerable:!0,configurable:!1,get:function(){return t},set:function(e){t=void 0!==e?e:[]}})};h(V,z);var U=function(){var t,e;W.call(this),Object.defineProperty(this,"Parent",{enumerable:!1,configurable:!1,get:function(){return t},set:function(e){t=e}}),Object.defineProperty(this,"optionName",{enumerable:!1,configurable:!0,get:function(){return e},set:function(t){e=t}});var n,i={};Object.defineProperty(this,"MK",{enumerable:!1,configurable:!1,get:function(){var t,e=[];for(t in e.push("<<"),i)e.push("/"+t+" ("+i[t]+")");return e.push(">>"),e.join("\n")},set:function(t){"object"==typeof t&&(i=t)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return i.CA||""},set:function(t){"string"==typeof t&&(i.CA=t)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return n},set:function(t){n=t}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return n.substr(1,n.length-1)},set:function(t){n="/"+t}}),this.caption="l",this.appearanceState="Off",this._AppearanceType=K.RadioButton.Circle,this.appearanceStreamContent=this._AppearanceType.createAppearanceStream(this.optionName)};h(U,W),V.prototype.setAppearance=function(t){if(!("createAppearanceStream"in t)||!("getCA"in t))throw new Error("Couldn't assign Appearance to RadioButton. Appearance was Invalid!");for(var e in this.Kids)if(this.Kids.hasOwnProperty(e)){var n=this.Kids[e];n.appearanceStreamContent=t.createAppearanceStream(n.optionName),n.caption=t.getCA()}},V.prototype.createOption=function(t){var e=new U;return e.Parent=this,e.optionName=t,this.Kids.push(e),Z.call(this,e),e};var Y=function(){z.call(this),this.fontName="zapfdingbats",this.caption="3",this.appearanceState="On",this.value="On",this.textAlign="center",this.appearanceStreamContent=K.CheckBox.createAppearanceStream()};h(Y,z);var X=function(){W.call(this),this.FT="/Tx",Object.defineProperty(this,"multiline",{enumerable:!0,configurable:!0,get:function(){return Boolean(y(this.Ff,13))},set:function(t){!0===Boolean(t)?this.Ff=v(this.Ff,13):this.Ff=b(this.Ff,13)}}),Object.defineProperty(this,"fileSelect",{enumerable:!0,configurable:!0,get:function(){return Boolean(y(this.Ff,21))},set:function(t){!0===Boolean(t)?this.Ff=v(this.Ff,21):this.Ff=b(this.Ff,21)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return Boolean(y(this.Ff,23))},set:function(t){!0===Boolean(t)?this.Ff=v(this.Ff,23):this.Ff=b(this.Ff,23)}}),Object.defineProperty(this,"doNotScroll",{enumerable:!0,configurable:!0,get:function(){return Boolean(y(this.Ff,24))},set:function(t){!0===Boolean(t)?this.Ff=v(this.Ff,24):this.Ff=b(this.Ff,24)}}),Object.defineProperty(this,"comb",{enumerable:!0,configurable:!0,get:function(){return Boolean(y(this.Ff,25))},set:function(t){!0===Boolean(t)?this.Ff=v(this.Ff,25):this.Ff=b(this.Ff,25)}}),Object.defineProperty(this,"richText",{enumerable:!0,configurable:!0,get:function(){return Boolean(y(this.Ff,26))},set:function(t){!0===Boolean(t)?this.Ff=v(this.Ff,26):this.Ff=b(this.Ff,26)}});var t=null;Object.defineProperty(this,"MaxLen",{enumerable:!0,configurable:!1,get:function(){return t},set:function(e){t=e}}),Object.defineProperty(this,"maxLength",{enumerable:!0,configurable:!0,get:function(){return t},set:function(e){Number.isInteger(e)&&(t=e)}}),Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,get:function(){return this.V||this.DV}})};h(X,W);var Q=function(){X.call(this),Object.defineProperty(this,"password",{enumerable:!0,configurable:!0,get:function(){return Boolean(y(this.Ff,14))},set:function(t){!0===Boolean(t)?this.Ff=v(this.Ff,14):this.Ff=b(this.Ff,14)}}),this.password=!0};h(Q,X);var K={CheckBox:{createAppearanceStream:function(){return{N:{On:K.CheckBox.YesNormal},D:{On:K.CheckBox.YesPushDown,Off:K.CheckBox.OffPushDown}}},YesPushDown:function(t){var e=new d(t),i=[],r=n.internal.getFont(t.fontName,t.fontStyle).id,o=n.__private__.encodeColorString(t.color),s=F(t,t.caption);return i.push("0.749023 g"),i.push("0 0 "+l(K.internal.getWidth(t))+" "+l(K.internal.getHeight(t))+" re"),i.push("f"),i.push("BMC"),i.push("q"),i.push("0 0 1 rg"),i.push("/"+r+" "+l(s.fontSize)+" Tf "+o),i.push("BT"),i.push(s.text),i.push("ET"),i.push("Q"),i.push("EMC"),e.stream=i.join("\n"),e},YesNormal:function(t){var e=new d(t),i=n.internal.getFont(t.fontName,t.fontStyle).id,r=n.__private__.encodeColorString(t.color),o=[],s=K.internal.getHeight(t),a=K.internal.getWidth(t),c=F(t,t.caption);return o.push("1 g"),o.push("0 0 "+l(a)+" "+l(s)+" re"),o.push("f"),o.push("q"),o.push("0 0 1 rg"),o.push("0 0 "+l(a-1)+" "+l(s-1)+" re"),o.push("W"),o.push("n"),o.push("0 g"),o.push("BT"),o.push("/"+i+" "+l(c.fontSize)+" Tf "+r),o.push(c.text),o.push("ET"),o.push("Q"),e.stream=o.join("\n"),e},OffPushDown:function(t){var e=new d(t),n=[];return n.push("0.749023 g"),n.push("0 0 "+l(K.internal.getWidth(t))+" "+l(K.internal.getHeight(t))+" re"),n.push("f"),e.stream=n.join("\n"),e}},RadioButton:{Circle:{createAppearanceStream:function(t){var e={D:{Off:K.RadioButton.Circle.OffPushDown},N:{}};return e.N[t]=K.RadioButton.Circle.YesNormal,e.D[t]=K.RadioButton.Circle.YesPushDown,e},getCA:function(){return"l"},YesNormal:function(t){var e=new d(t),n=[],i=K.internal.getWidth(t)<=K.internal.getHeight(t)?K.internal.getWidth(t)/4:K.internal.getHeight(t)/4;i=Number((.9*i).toFixed(5));var r=K.internal.Bezier_C,o=Number((i*r).toFixed(5));return n.push("q"),n.push("1 0 0 1 "+c(K.internal.getWidth(t)/2)+" "+c(K.internal.getHeight(t)/2)+" cm"),n.push(i+" 0 m"),n.push(i+" "+o+" "+o+" "+i+" 0 "+i+" c"),n.push("-"+o+" "+i+" -"+i+" "+o+" -"+i+" 0 c"),n.push("-"+i+" -"+o+" -"+o+" -"+i+" 0 -"+i+" c"),n.push(o+" -"+i+" "+i+" -"+o+" "+i+" 0 c"),n.push("f"),n.push("Q"),e.stream=n.join("\n"),e},YesPushDown:function(t){var e=new d(t),n=[],i=K.internal.getWidth(t)<=K.internal.getHeight(t)?K.internal.getWidth(t)/4:K.internal.getHeight(t)/4,r=(i=Number((.9*i).toFixed(5)),Number((2*i).toFixed(5))),o=Number((r*K.internal.Bezier_C).toFixed(5)),s=Number((i*K.internal.Bezier_C).toFixed(5));return n.push("0.749023 g"),n.push("q"),n.push("1 0 0 1 "+c(K.internal.getWidth(t)/2)+" "+c(K.internal.getHeight(t)/2)+" cm"),n.push(r+" 0 m"),n.push(r+" "+o+" "+o+" "+r+" 0 "+r+" c"),n.push("-"+o+" "+r+" -"+r+" "+o+" -"+r+" 0 c"),n.push("-"+r+" -"+o+" -"+o+" -"+r+" 0 -"+r+" c"),n.push(o+" -"+r+" "+r+" -"+o+" "+r+" 0 c"),n.push("f"),n.push("Q"),n.push("0 g"),n.push("q"),n.push("1 0 0 1 "+c(K.internal.getWidth(t)/2)+" "+c(K.internal.getHeight(t)/2)+" cm"),n.push(i+" 0 m"),n.push(i+" "+s+" "+s+" "+i+" 0 "+i+" c"),n.push("-"+s+" "+i+" -"+i+" "+s+" -"+i+" 0 c"),n.push("-"+i+" -"+s+" -"+s+" -"+i+" 0 -"+i+" c"),n.push(s+" -"+i+" "+i+" -"+s+" "+i+" 0 c"),n.push("f"),n.push("Q"),e.stream=n.join("\n"),e},OffPushDown:function(t){var e=new d(t),n=[],i=K.internal.getWidth(t)<=K.internal.getHeight(t)?K.internal.getWidth(t)/4:K.internal.getHeight(t)/4;i=Number((.9*i).toFixed(5));var r=Number((2*i).toFixed(5)),o=Number((r*K.internal.Bezier_C).toFixed(5));return n.push("0.749023 g"),n.push("q"),n.push("1 0 0 1 "+c(K.internal.getWidth(t)/2)+" "+c(K.internal.getHeight(t)/2)+" cm"),n.push(r+" 0 m"),n.push(r+" "+o+" "+o+" "+r+" 0 "+r+" c"),n.push("-"+o+" "+r+" -"+r+" "+o+" -"+r+" 0 c"),n.push("-"+r+" -"+o+" -"+o+" -"+r+" 0 -"+r+" c"),n.push(o+" -"+r+" "+r+" -"+o+" "+r+" 0 c"),n.push("f"),n.push("Q"),e.stream=n.join("\n"),e}},Cross:{createAppearanceStream:function(t){var e={D:{Off:K.RadioButton.Cross.OffPushDown},N:{}};return e.N[t]=K.RadioButton.Cross.YesNormal,e.D[t]=K.RadioButton.Cross.YesPushDown,e},getCA:function(){return"8"},YesNormal:function(t){var e=new d(t),n=[],i=K.internal.calculateCross(t);return n.push("q"),n.push("1 1 "+l(K.internal.getWidth(t)-2)+" "+l(K.internal.getHeight(t)-2)+" re"),n.push("W"),n.push("n"),n.push(l(i.x1.x)+" "+l(i.x1.y)+" m"),n.push(l(i.x2.x)+" "+l(i.x2.y)+" l"),n.push(l(i.x4.x)+" "+l(i.x4.y)+" m"),n.push(l(i.x3.x)+" "+l(i.x3.y)+" l"),n.push("s"),n.push("Q"),e.stream=n.join("\n"),e},YesPushDown:function(t){var e=new d(t),n=K.internal.calculateCross(t),i=[];return i.push("0.749023 g"),i.push("0 0 "+l(K.internal.getWidth(t))+" "+l(K.internal.getHeight(t))+" re"),i.push("f"),i.push("q"),i.push("1 1 "+l(K.internal.getWidth(t)-2)+" "+l(K.internal.getHeight(t)-2)+" re"),i.push("W"),i.push("n"),i.push(l(n.x1.x)+" "+l(n.x1.y)+" m"),i.push(l(n.x2.x)+" "+l(n.x2.y)+" l"),i.push(l(n.x4.x)+" "+l(n.x4.y)+" m"),i.push(l(n.x3.x)+" "+l(n.x3.y)+" l"),i.push("s"),i.push("Q"),e.stream=i.join("\n"),e},OffPushDown:function(t){var e=new d(t),n=[];return n.push("0.749023 g"),n.push("0 0 "+l(K.internal.getWidth(t))+" "+l(K.internal.getHeight(t))+" re"),n.push("f"),e.stream=n.join("\n"),e}}},createDefaultAppearanceStream:function(t){var e=n.internal.getFont(t.fontName,t.fontStyle).id,i=n.__private__.encodeColorString(t.color);return"/"+e+" "+t.fontSize+" Tf "+i}};K.internal={Bezier_C:.551915024494,calculateCross:function(t){var e=K.internal.getWidth(t),n=K.internal.getHeight(t),i=Math.min(e,n);return{x1:{x:(e-i)/2,y:(n-i)/2+i},x2:{x:(e-i)/2+i,y:(n-i)/2},x3:{x:(e-i)/2,y:(n-i)/2},x4:{x:(e-i)/2+i,y:(n-i)/2+i}}}},K.internal.getWidth=function(t){var e=0;return"object"==typeof t&&(e=u(t.Rect[2])),e},K.internal.getHeight=function(t){var e=0;return"object"==typeof t&&(e=u(t.Rect[3])),e};var Z=i.addField=function(t){if(B.call(this),!(t instanceof W))throw new Error("Invalid argument passed to jsPDF.addField.");return C.call(this,t),t.page=n.internal.getCurrentPageInfo().pageNumber,this};i.addButton=function(t){if(t instanceof z==0)throw new Error("Invalid argument passed to jsPDF.addButton.");return Z.call(this,t)},i.addTextField=function(t){if(t instanceof X==0)throw new Error("Invalid argument passed to jsPDF.addTextField.");return Z.call(this,t)},i.addChoiceField=function(t){if(t instanceof q==0)throw new Error("Invalid argument passed to jsPDF.addChoiceField.");return Z.call(this,t)},"object"==typeof e&&void 0===e.ChoiceField&&void 0===e.ListBox&&void 0===e.ComboBox&&void 0===e.EditBox&&void 0===e.Button&&void 0===e.PushButton&&void 0===e.RadioButton&&void 0===e.CheckBox&&void 0===e.TextField&&void 0===e.PasswordField&&(e.ChoiceField=q,e.ListBox=H,e.ComboBox=D,e.EditBox=j,e.Button=z,e.PushButton=G,e.RadioButton=V,e.CheckBox=Y,e.TextField=X,e.PasswordField=Q,e.AcroForm={Appearance:K}),i.AcroFormChoiceField=q,i.AcroFormListBox=H,i.AcroFormComboBox=D,i.AcroFormEditBox=j,i.AcroFormButton=z,i.AcroFormPushButton=G,i.AcroFormRadioButton=V,i.AcroFormCheckBox=Y,i.AcroFormTextField=X,i.AcroFormPasswordField=Q,i.AcroFormAppearance=K,i.AcroForm={ChoiceField:q,ListBox:H,ComboBox:D,EditBox:j,Button:z,PushButton:G,RadioButton:V,CheckBox:Y,TextField:X,PasswordField:Q,Appearance:K},t.AcroForm={ChoiceField:q,ListBox:H,ComboBox:D,EditBox:j,Button:z,PushButton:G,RadioButton:V,CheckBox:Y,TextField:X,PasswordField:Q,Appearance:K}}(h.jsPDF,"undefined"!=typeof window&&window||void 0!==r.g&&r.g),function(t){var e,n,i,r,o,s,a,l,c,h,u,f,d,p,g,m,y,v,b,x;e=function(){return function(e){return t.prototype=e,new t};function t(){}}(),h=function(t){var e,n,i,r,o,s,a;for(n=0,i=t.length,e=void 0,r=!1,s=!1;!r&&n!==i;)(e=t[n]=t[n].trimLeft())&&(r=!0),n++;for(n=i-1;i&&!s&&-1!==n;)(e=t[n]=t[n].trimRight())&&(s=!0),n--;for(o=/\s+$/g,a=!0,n=0;n!==i;)"\u2028"!=t[n]&&(e=t[n].replace(/\s+/g," "),a&&(e=e.trimLeft()),e&&(a=o.test(e)),t[n]=e),n++;return t},f=function(t){var e,n,r;for(e=void 0,n=(r=t.split(",")).shift();!e&&n;)e=i[n.trim().toLowerCase()],n=r.shift();return e},d=function(t){var e;return(t="auto"===t?"0px":t).indexOf("em")>-1&&!isNaN(Number(t.replace("em","")))&&(t=18.719*Number(t.replace("em",""))+"px"),t.indexOf("pt")>-1&&!isNaN(Number(t.replace("pt","")))&&(t=1.333*Number(t.replace("pt",""))+"px"),(e=p[t])?e:void 0!==(e={"xx-small":9,"x-small":11,small:13,medium:16,large:19,"x-large":23,"xx-large":28,auto:0}[t])||(e=parseFloat(t))?p[t]=e/16:(e=t.match(/([\d\.]+)(px)/),Array.isArray(e)&&3===e.length?p[t]=parseFloat(e[1])/16:p[t]=1)},c=function(t){var e,n,i,c,h;return h=t,c=document.defaultView&&document.defaultView.getComputedStyle?document.defaultView.getComputedStyle(h,null):h.currentStyle?h.currentStyle:h.style,n=void 0,(e={})["font-family"]=f((i=function(t){return t=t.replace(/-\D/g,function(t){return t.charAt(1).toUpperCase()}),c[t]})("font-family"))||"times",e["font-style"]=r[i("font-style")]||"normal",e["text-align"]=o[i("text-align")]||"left","bold"===(n=s[i("font-weight")]||"normal")&&("normal"===e["font-style"]?e["font-style"]=n:e["font-style"]=n+e["font-style"]),e["font-size"]=d(i("font-size"))||1,e["line-height"]=d(i("line-height"))||1,e.display="inline"===i("display")?"inline":"block",n="block"===e.display,e["margin-top"]=n&&d(i("margin-top"))||0,e["margin-bottom"]=n&&d(i("margin-bottom"))||0,e["padding-top"]=n&&d(i("padding-top"))||0,e["padding-bottom"]=n&&d(i("padding-bottom"))||0,e["margin-left"]=n&&d(i("margin-left"))||0,e["margin-right"]=n&&d(i("margin-right"))||0,e["padding-left"]=n&&d(i("padding-left"))||0,e["padding-right"]=n&&d(i("padding-right"))||0,e["page-break-before"]=i("page-break-before")||"auto",e.float=a[i("cssFloat")]||"none",e.clear=l[i("clear")]||"none",e.color=i("color"),e},g=function(t,e,n){var i,r,o,s,a;if(o=!1,r=void 0,s=void 0,i=n["#"+t.id])if("function"==typeof i)o=i(t,e);else for(r=0,s=i.length;!o&&r!==s;)o=i[r](t,e),r++;if(i=n[t.nodeName],!o&&i)if("function"==typeof i)o=i(t,e);else for(r=0,s=i.length;!o&&r!==s;)o=i[r](t,e),r++;for(a="string"==typeof t.className?t.className.split(" "):[],r=0;r<a.length;r++)if(i=n["."+a[r]],!o&&i)if("function"==typeof i)o=i(t,e);else for(r=0,s=i.length;!o&&r!==s;)o=i[r](t,e),r++;return o},x=function(t,e){var n,i,r,o,s,a,l,c;n=[],i=[],r=0,c=0;for(var h=0;h<t.rows[0].cells.length;h++)c+=t.rows[0].cells[h].colSpan;for(a=t.clientWidth;r<c;){for(l=t.rows[0].cells[r],h=0;h<l.colSpan;h++)i[r+h]={name:l.textContent.toLowerCase().replace(/\s+/g,"")+"_"+h,prompt:l.textContent.replace(/\r?\n/g,""),width:l.clientWidth/a*e.settings.width/l.colSpan};r+=h}for(r=1;r<t.rows.length;){for(s=t.rows[r],o={},h=0;h<s.cells.length;)o[i[h].name]=s.cells[h].textContent.replace(/\r?\n/g,""),h++;n.push(o),r++}return{rows:n,headers:i}};var T={SCRIPT:1,STYLE:1,NOSCRIPT:1,OBJECT:1,EMBED:1,SELECT:1},F=1;n=function(t,i,r){var o,s,a,l,h,u,f,d;for(s=t.childNodes,o=void 0,(h="block"===(a=c(t)).display)&&(i.setBlockBoundary(),i.setBlockStyle(a)),l=0,u=s.length;l<u;){if("object"==typeof(o=s[l])){if(i.executeWatchFunctions(o),1===o.nodeType&&"HEADER"===o.nodeName){var p=o,y=i.pdf.margins_doc.top;i.pdf.internal.events.subscribe("addPage",function(t){i.y=y,n(p,i,r),i.pdf.margins_doc.top=i.y+10,i.y+=10},!1)}if(8===o.nodeType&&"#comment"===o.nodeName)~o.textContent.indexOf("ADD_PAGE")&&(i.pdf.addPage(),i.y=i.pdf.margins_doc.top);else if(1!==o.nodeType||T[o.nodeName])if(3===o.nodeType){var v=o.nodeValue;if(o.nodeValue&&"LI"===o.parentNode.nodeName)if("OL"===o.parentNode.parentNode.nodeName)v=F+++". "+v;else{var b=a["font-size"],_=(3-.75*b)*i.pdf.internal.scaleFactor,R=.75*b*i.pdf.internal.scaleFactor,w=1.74*b/i.pdf.internal.scaleFactor;d=function(t,e){this.pdf.circle(t+_,e+R,w,"FD")}}16&o.ownerDocument.body.compareDocumentPosition(o)&&i.addText(v,a)}else"string"==typeof o&&i.addText(o,a);else{var C;if("IMG"===o.nodeName){var O=o.getAttribute("src");C=m[i.pdf.sHashCode&&i.pdf.sHashCode(O)||O]}if(C){i.pdf.internal.pageSize.getHeight()-i.pdf.margins_doc.bottom<i.y+o.height&&i.y>i.pdf.margins_doc.top&&(i.pdf.addPage(),i.y=i.pdf.margins_doc.top,i.executeWatchFunctions(o));var P=c(o),E=i.x,S=12/i.pdf.internal.scaleFactor,L=(P["margin-left"]+P["padding-left"])*S,B=(P["margin-right"]+P["padding-right"])*S,A=(P["margin-top"]+P["padding-top"])*S,I=(P["margin-bottom"]+P["padding-bottom"])*S;void 0!==P.float&&"right"===P.float?E+=i.settings.width-o.width-B:E+=L,i.pdf.addImage(C,E,i.y+A,o.width,o.height),C=void 0,"right"===P.float||"left"===P.float?(i.watchFunctions.push(function(t,e,n,r){return i.y>=e?(i.x+=t,i.settings.width+=n,!0):!!(r&&1===r.nodeType&&!T[r.nodeName]&&i.x+r.width>i.pdf.margins_doc.left+i.pdf.margins_doc.width)&&(i.x+=t,i.y=e,i.settings.width+=n,!0)}.bind(this,"left"===P.float?-o.width-L-B:0,i.y+o.height+A+I,o.width)),i.watchFunctions.push(function(t,e,n){return!(i.y<t&&e===i.pdf.internal.getNumberOfPages())||1===n.nodeType&&"both"===c(n).clear&&(i.y=t,!0)}.bind(this,i.y+o.height,i.pdf.internal.getNumberOfPages())),i.settings.width-=o.width+L+B,"left"===P.float&&(i.x+=o.width+L+B)):i.y+=o.height+A+I}else if("TABLE"===o.nodeName)i.pdf.autoTable?(i.y+=10,i.pdf.autoTable({theme:"grid",html:o,startY:i.y,styles:{font:i.pdf.getFont().fontName,fontSize:i.pdf.getFontSize(),textColor:i.pdf.getTextColor()},margin:{top:i.pdf.margins_doc.top,left:i.x,right:i.pdf.internal.pageSize.getWidth()-(i.x+i.settings.width),bottom:i.pdf.margins_doc.bottom}}),i.y=i.pdf.lastAutoTable.finalY):(f=x(o,i),i.y+=10,i.pdf.table(i.x,i.y,f.rows,f.headers,{autoSize:!1,printHeaders:r.printHeaders,margins:i.pdf.margins_doc,css:c(o)}),i.y=i.pdf.internal.__cell__.lastCell.y+i.pdf.internal.__cell__.lastCell.height);else if("OL"===o.nodeName||"UL"===o.nodeName)F=1,g(o,i,r)||n(o,i,r),i.y+=10;else if("LI"===o.nodeName){var N=i.x;i.x+=20/i.pdf.internal.scaleFactor,i.y+=3,g(o,i,r)||n(o,i,r),i.x=N}else"BR"===o.nodeName?(i.y+=a["font-size"]*i.pdf.internal.scaleFactor,i.addText("\u2028",e(a))):g(o,i,r)||n(o,i,r)}}l++}if(r.outY=i.y,h)return i.setBlockBoundary(d)},m={},y=function(t,e,n,i){var r,o=t.getElementsByTagName("img"),s=o.length,a=0;function l(){e.pdf.internal.events.publish("imagesLoaded"),i(r)}function c(t,n,i){if(t){var o=new Image;r=++a,o.crossOrigin="",o.onerror=o.onload=function(){if(o.complete&&(0===o.src.indexOf("data:image/")&&(o.width=n||o.width||0,o.height=i||o.height||0),o.width+o.height)){var r=e.pdf.sHashCode&&e.pdf.sHashCode(t)||t;m[r]=m[r]||o}--a||l()},o.src=t}}for(;s--;)c(o[s].getAttribute("src"),o[s].width,o[s].height);return a||l()},v=function(t,e,i){var r=t.getElementsByTagName("footer");if(r.length>0){r=r[0];var o=e.pdf.internal.write,s=e.y;e.pdf.internal.write=function(){},n(r,e,i);var a=Math.ceil(e.y-s)+5;e.y=s,e.pdf.internal.write=o,e.pdf.margins_doc.bottom+=a;for(var l=function(t){var o=void 0!==t?t.pageNumber:1,s=e.y;e.y=e.pdf.internal.pageSize.getHeight()-e.pdf.margins_doc.bottom,e.pdf.margins_doc.bottom-=a;for(var l=r.getElementsByTagName("span"),c=0;c<l.length;++c)(" "+l[c].className+" ").replace(/[\n\t]/g," ").indexOf(" pageCounter ")>-1&&(l[c].innerHTML=o),(" "+l[c].className+" ").replace(/[\n\t]/g," ").indexOf(" totalPages ")>-1&&(l[c].innerHTML="###jsPDFVarTotalPages###");n(r,e,i),e.pdf.margins_doc.bottom+=a,e.y=s},c=r.getElementsByTagName("span"),h=0;h<c.length;++h)(" "+c[h].className+" ").replace(/[\n\t]/g," ").indexOf(" totalPages ")>-1&&e.pdf.internal.events.subscribe("htmlRenderingFinished",e.pdf.putTotalPages.bind(e.pdf,"###jsPDFVarTotalPages###"),!0);e.pdf.internal.events.subscribe("addPage",l,!1),l(),T.FOOTER=1}},b=function(t,e,r,o,s,a){if(!e)return!1;"string"==typeof e||e.parentNode||(e=""+e.innerHTML),"string"==typeof e&&(e=function(t){var e,n,i;return i="jsPDFhtmlText"+Date.now().toString()+(1e3*Math.random()).toFixed(0),(n=document.createElement("div")).className="sjs-pdf-hidden-html-div",n.style.cssText="position: absolute !important;clip: rect(1px 1px 1px 1px); /* IE6, IE7 */clip: rect(1px, 1px, 1px, 1px);padding:0 !important;border:0 !important;height: 1px !important;width: 1px !important; top:auto;left:-100px;overflow: hidden;",n.innerHTML='<iframe style="height:1px;width:1px" name="'+i+'" />',document.body.appendChild(n),(e=window.frames[i]).document.open(),e.document.writeln(t),e.document.close(),e.document.body}(e.replace(/<\/?script[^>]*?>/gi,"")));for(var l=Object.keys(t.getFontList()),c=0;c<l.length;++c){var h=l[c],f=h.toLowerCase();i[f]||(i[f]=h)}var d,p=new u(t,r,o,s);return y.call(this,e,p,s.elementHandlers,function(t){v(e,p,s.elementHandlers),n(e,p,s.elementHandlers),p.pdf.internal.events.publish("htmlRenderingFinished"),d=p.dispose(),"function"==typeof a?a(d):t&&console.error("jsPDF Warning: rendering issues? provide a callback to fromHTML!")}),d||{x:p.x,y:p.y}},(u=function(t,e,n,i){return this.pdf=t,this.x=e,this.y=n,this.settings=i,this.watchFunctions=[],this.init(),this}).prototype.init=function(){return this.paragraph={text:[],style:[]},this.pdf.internal.write("q")},u.prototype.dispose=function(){return this.pdf.internal.write("Q"),{x:this.x,y:this.y,ready:!0}},u.prototype.executeWatchFunctions=function(t){var e=!1,n=[];if(this.watchFunctions.length>0){for(var i=0;i<this.watchFunctions.length;++i)!0===this.watchFunctions[i](t)?e=!0:n.push(this.watchFunctions[i]);this.watchFunctions=n}return e},u.prototype.splitFragmentsIntoLines=function(t,n){var i,r,o,s,a,l,c,h,u,f,d,p;h=this.pdf.internal.scaleFactor,r=void 0,c=void 0,o=void 0,p=void 0,l=void 0,a=void 0,s=void 0,f=[u=[]],i=0,d=this.settings.width;const g=this.pdf.getFont().fontName,m=this.pdf.getFont().fontStyle;for(;t.length;)if(o=t.shift(),p=n.shift(),o)if(r=p["font-family"],c=p["font-style"],this.pdf.setFont(r,c),l={textIndent:i,fontSize:12*p["font-size"]},a=this.pdf.getStringUnitWidth(o,l)*l.fontSize/h,"\u2028"==o)u=[],f.push(u);else if(i+a>d){for(s=this.pdf.splitTextToSize(o,d,l),u.push([s.shift(),p]);s.length;)u=[[s.shift(),p]],f.push(u);i=this.pdf.getStringUnitWidth(u[0][0],l)*l.fontSize/h}else u.push([o,p]),i+=a;if(void 0!==p["text-align"]&&("center"===p["text-align"]||"right"===p["text-align"]||"justify"===p["text-align"]))for(var y=0;y<f.length;++y){var v=this.pdf.getStringUnitWidth(f[y][0][0],l)*l.fontSize/h;y>0&&(f[y][0][1]=e(f[y][0][1]));var b=d-v;if("right"===p["text-align"])f[y][0][1]["margin-left"]=b;else if("center"===p["text-align"])f[y][0][1]["margin-left"]=b/2;else if("justify"===p["text-align"]){var x=f[y][0][0].split(" ").length-1;f[y][0][1]["word-spacing"]=b/x,y===f.length-1&&(f[y][0][1]["word-spacing"]=0)}}return this.pdf.setFont(g,m),f},u.prototype.RenderTextFragment=function(t,e){var n,i;if(i=0,this.pdf.internal.pageSize.getHeight()-this.pdf.margins_doc.bottom<this.y+this.pdf.internal.getFontSize()){this.pdf.internal.write("ET","Q","Q");const t=this.pdf.getCurrentPageInfo().pageNumber;this.pdf.getNumberOfPages()===t?this.pdf.addPage():this.pdf.setPage(t+1),this.y=this.pdf.margins_doc.top,this.pdf.internal.write("q","q","BT",this.getPdfColor(e.color),this.pdf.internal.getCoordinateString(this.x),this.pdf.internal.getVerticalCoordinateString(this.y),"Td"),i=Math.max(i,e["line-height"],e["font-size"]),this.pdf.internal.write(0,(-12*i).toFixed(2),"Td")}n=this.pdf.internal.getFont(e["font-family"],e["font-style"]);var r=this.getPdfColor(e.color);r!==this.lastTextColor&&(this.pdf.internal.write(r),this.lastTextColor=r),void 0!==e["word-spacing"]&&e["word-spacing"]>0&&this.pdf.internal.write(e["word-spacing"].toFixed(2),"Tw");var o;o="Identity-H"!==n.encoding?"("+this.pdf.internal.pdfEscape(t)+")":"<"+function(t,e){t=t||"";var n,i="",r=0,o="",s=e.encoding;if("Identity-H"!==e.encoding)return t;for(o=t,r=0;r<o.length;r+=1)e.metadata.hasOwnProperty("cmap")&&(n=e.metadata.cmap.unicode.codeMap[o[r].charCodeAt(0)]),n||o[r].charCodeAt(0)<256&&e.metadata.hasOwnProperty("Unicode")?i+=o[r]:i+="";var a="";return parseInt(e.id.slice(1))<14||"WinAnsiEncoding"===s?a=this.pdf.internal.pdfEscape(i,key).split("").map(function(t){return t.charCodeAt(0).toString(16)}).join(""):"Identity-H"===s&&(a=function(t,e){for(var n,i=e.metadata.Unicode.widths,r=["","0","00","000","0000"],o=[""],s=0,a=t.length;s<a;++s){if(n=e.metadata.characterToGlyph(t.charCodeAt(s)),e.metadata.glyIdsUsed.push(n),e.metadata.toUnicode[n]=t.charCodeAt(s),-1==i.indexOf(n)&&(i.push(n),i.push([parseInt(e.metadata.widthOfGlyph(n),10)])),"0"==n)return o.join("");n=n.toString(16),o.push(r[4-n.length],n)}return o.join("")}(i,e)),a}(t,n)+">",this.pdf.internal.write("/"+n.id,(12*e["font-size"]).toFixed(2),"Tf",o+" Tj"),void 0!==e["word-spacing"]&&this.pdf.internal.write(0,"Tw")},u.prototype.getPdfColor=function(t){var e,n,i,r=/rgb\s*\(\s*(\d+),\s*(\d+),\s*(\d+\s*)\)/.exec(t);if(null!=r)e=parseInt(r[1]),n=parseInt(r[2]),i=parseInt(r[3]);else{if("string"==typeof t&&"#"!=t.charAt(0)){var o=new RGBColor(t);t=o.ok?o.toHex():"#000000"}e=t.substring(1,3),e=parseInt(e,16),n=t.substring(3,5),n=parseInt(n,16),i=t.substring(5,7),i=parseInt(i,16)}if("string"==typeof e&&/^#[0-9A-Fa-f]{6}$/.test(e)){var s=parseInt(e.substr(1),16);e=s>>16&255,n=s>>8&255,i=255&s}var a=this.f3;return 0===e&&0===n&&0===i||void 0===n?a(e/255)+" g":[a(e/255),a(n/255),a(i/255),"rg"].join(" ")},u.prototype.f3=function(t){return t.toFixed(3)},u.prototype.renderParagraph=function(t){var e,n,i,r,o,s,a,l,c,u,f,d,p;if(i=h(this.paragraph.text),d=this.paragraph.style,e=this.paragraph.blockstyle,this.paragraph.priorblockstyle,this.paragraph={text:[],style:[],blockstyle:{},priorblockstyle:e},i.join("").trim()){a=this.splitFragmentsIntoLines(i,d),s=void 0,l=void 0,n=12/this.pdf.internal.scaleFactor,this.priorMarginBottom=this.priorMarginBottom||0,f=(Math.max((e["margin-top"]||0)-this.priorMarginBottom,0)+(e["padding-top"]||0))*n,u=((e["margin-bottom"]||0)+(e["padding-bottom"]||0))*n,this.priorMarginBottom=e["margin-bottom"]||0,"always"===e["page-break-before"]&&(this.pdf.addPage(),this.y=0,f=((e["margin-top"]||0)+(e["padding-top"]||0))*n),c=this.pdf.internal.write,r=void 0,o=void 0,this.y+=f,c("q","BT 0 g",this.pdf.internal.getCoordinateString(this.x),this.pdf.internal.getVerticalCoordinateString(this.y),"Td");for(var g=0;a.length;){for(l=0,r=0,o=(s=a.shift()).length;r!==o;)s[r][0].trim()&&(l=Math.max(l,s[r][1]["line-height"],s[r][1]["font-size"]),p=7*s[r][1]["font-size"]),r++;var m=0,y=0;for(void 0!==s[0][1]["margin-left"]&&s[0][1]["margin-left"]>0&&(m=(y=this.pdf.internal.getCoordinateString(s[0][1]["margin-left"]))-g,g=y),c(m+Math.max(e["margin-left"]||0,0)*n,(-12*l).toFixed(2),"Td"),r=0,o=s.length;r!==o;)s[r][0]&&this.RenderTextFragment(s[r][0],s[r][1]),r++;if(this.y+=l*n,this.executeWatchFunctions(s[0][1])&&a.length>0){var v=[],b=[];a.forEach(function(t){for(var e=0,n=t.length;e!==n;)t[e][0]&&(v.push(t[e][0]+" "),b.push(t[e][1])),++e}),a=this.splitFragmentsIntoLines(h(v),b),c("ET","Q"),c("q","BT 0 g",this.pdf.internal.getCoordinateString(this.x),this.pdf.internal.getVerticalCoordinateString(this.y),"Td")}}return t&&"function"==typeof t&&t.call(this,this.x-9,this.y-p/2),c("ET","Q"),this.y+=u}},u.prototype.setBlockBoundary=function(t){return this.renderParagraph(t)},u.prototype.setBlockStyle=function(t){return this.paragraph.blockstyle=t},u.prototype.addText=function(t,e){return this.paragraph.text.push(t),this.paragraph.style.push(e)},i={helvetica:"helvetica","sans-serif":"helvetica","times new roman":"times",serif:"times",times:"times",monospace:"courier",courier:"courier"},s={100:"normal",200:"normal",300:"normal",400:"normal",500:"bold",600:"bold",700:"bold",800:"bold",900:"bold",normal:"normal",bold:"bold",bolder:"bold",lighter:"normal"},r={normal:"normal",italic:"italic",oblique:"italic"},o={left:"left",right:"right",center:"center",justify:"justify"},a={none:"none",right:"right",left:"left"},l={none:"none",both:"both"},p={normal:1},t.fromHTML=function(t,e,n,i,r,o){return this.margins_doc=o||{top:0,bottom:0},i||(i={}),i.elementHandlers||(i.elementHandlers={}),b(this,t,isNaN(e)?4:e,isNaN(n)?4:n,i,r)}}(h.jsPDF.API);var B,A,I=function(){function t(e){var n=this;this._base64Normal=void 0,this._base64Bold=void 0,void 0===e.orientation?void 0===e.format||e.format[0]<e.format[1]?this._orientation="p":this._orientation="l":this._orientation=e.orientation,this._format=e.format||"a4",Array.isArray(this._format)&&(this._format=this._format.map(function(e){return e*t.MM_TO_PT})),this._fontSize=e.fontSize||t.FONT_SIZE,e.fontName?this._fontName=e.fontName:t.SEGOE_BOLD||t.SEGOE_NORMAL?this._fontName="segoe":this._fontName=L.STANDARD_FONT,void 0===e.fontName||void 0===e.base64Normal&&void 0===e.base64Bold?"segoe"===this.fontName&&(this._base64Normal=t.SEGOE_NORMAL,this._base64Bold=t.SEGOE_BOLD):(this._base64Normal=e.base64Normal||e.base64Bold,this._base64Bold=e.base64Bold||e.base64Normal),this._margins=L.clone(e.margins),void 0===this._margins&&(this._margins={}),void 0===this._margins.top&&(this._margins.top=10),void 0===this._margins.bot&&(this._margins.bot=10),void 0===this._margins.left&&(this._margins.left=10),void 0===this._margins.right&&(this._margins.right=10),Object.keys(this._margins).forEach(function(e){n._margins[e]=n._margins[e]*t.MM_TO_PT}),this._htmlRenderAs=e.htmlRenderAs||"auto",this._matrixRenderAs=e.matrixRenderAs||"auto",this._readonlyRenderAs=e.readonlyRenderAs||"auto",this._compress=e.compress||!1,this._applyImageFit=e.applyImageFit||!1,this._useLegacyBooleanRendering=e.useLegacyBooleanRendering||!1,this._isRTL=e.isRTL||!1,this._tagboxSelectedChoicesOnly=e.tagboxSelectedChoicesOnly||!1}return Object.defineProperty(t.prototype,"leftTopPoint",{get:function(){return{xLeft:this.margins.left,yTop:this.margins.top}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontSize",{get:function(){return this._fontSize},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontName",{get:function(){return this._fontName},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"base64Normal",{get:function(){return this._base64Normal},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"base64Bold",{get:function(){return this._base64Bold},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"useCustomFontInHtml",{get:function(){return this._useCustomFontInHtml},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"margins",{get:function(){return this._margins},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"format",{get:function(){return this._format},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"orientation",{get:function(){return this._orientation},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"htmlRenderAs",{get:function(){return this._htmlRenderAs},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"matrixRenderAs",{get:function(){return this._matrixRenderAs},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"readonlyRenderAs",{get:function(){return this._readonlyRenderAs},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"compress",{get:function(){return this._compress},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"applyImageFit",{get:function(){return this._applyImageFit},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"useLegacyBooleanRendering",{get:function(){return this._useLegacyBooleanRendering},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isRTL",{get:function(){return this._isRTL},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tagboxSelectedChoicesOnly",{get:function(){return this._tagboxSelectedChoicesOnly},enumerable:!1,configurable:!0}),t.MM_TO_PT=72/25.4,t.FONT_SIZE=14,t}(),N=function(t){function e(n){void 0===n&&(n={});var i,r,o=t.call(this,n)||this,s={orientation:o.orientation,unit:"pt",format:o.format,compress:o.compress};return o._doc=new h.jsPDF(s),void 0===o.base64Normal||L.isFontExist(o,o.fontName)||(e.addFont(o.fontName,o.base64Normal,"normal"),e.addFont(o.fontName,o.base64Bold,"bold"),o._doc=new h.jsPDF(s)),i=o._doc,r=i.AcroFormAppearance.RadioButton.Circle.YesNormal,i.AcroFormAppearance.RadioButton.Circle.YesNormal=function(t){var e=r(t),n=e.stream.split("\n"),o=i.__private__.encodeColorString(t.color);return n[0]=n[0]+"\n"+o+"\n"+o.toUpperCase(),e.stream=n.join("\n"),e},o._useCustomFontInHtml=n.useCustomFontInHtml&&L.isFontExist(o,o.fontName),o._helperDoc=new h.jsPDF(s),o._doc.setFont(o.fontName),o._helperDoc.setFont(o.fontName),o._doc.setFontSize(o.fontSize),o._helperDoc.setFontSize(o.fontSize),o._fontStyle="normal",o.marginsStack=[],o}return n(e,t),e.addFont=function(t,n,i){var r=e.customFonts[t];r||(r={},e.customFonts[t]=r),r[i]=n,h.jsPDF.API.events.push(["addFonts",function(){var n=e.customFonts[t];if(n&&n[i]){var r="".concat(t,"-").concat(i,".ttf");this.addFileToVFS(r,n[i]),this.addFont(r,t,i)}}])},Object.defineProperty(e.prototype,"doc",{get:function(){return this._doc},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"helperDoc",{get:function(){return this._helperDoc},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fontName",{get:function(){return this._fontName},set:function(t){this._fontName=t,this._doc.setFont(t),this._helperDoc.setFont(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fontSize",{get:function(){return this._fontSize},set:function(t){this._fontSize=t,this._doc.setFontSize(t),this._helperDoc.setFontSize(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fontStyle",{get:function(){return this._fontStyle},set:function(t){this._fontStyle=t,this._doc.setFont(this._fontName,t),this._helperDoc.setFont(this._fontName,t)},enumerable:!1,configurable:!0}),e.prototype.measureText=function(t,e,n){var i=this;void 0===t&&(t=1),void 0===e&&(e=this._fontStyle),void 0===n&&(n=this._fontSize);var r=this._helperDoc.getFontSize();this._helperDoc.setFontSize(n),this._helperDoc.setFont(this._fontName,e);var o,s=this._helperDoc.getLineHeight()/this._helperDoc.internal.scaleFactor;return o="number"==typeof t?s*t:(t="string"==typeof t?t:L.getLocString(t)).split("").reduce(function(t,e){return t+i._helperDoc.getTextWidth(e)},0),this._helperDoc.setFontSize(r),this._helperDoc.setFont(this._fontName,"normal"),{width:o,height:s}},Object.defineProperty(e.prototype,"unitWidth",{get:function(){return this.measureText().width},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"unitHeight",{get:function(){return this.measureText().height},enumerable:!1,configurable:!0}),e.prototype.pushMargins=function(t,e){this.marginsStack.push({left:this.margins.left,right:this.margins.right}),void 0!==t&&(this.margins.left=t),void 0!==e&&(this.margins.right=e)},e.prototype.popMargins=function(){var t=this.marginsStack.pop();this.margins.left=t.left,this.margins.right=t.right},Object.defineProperty(e.prototype,"paperWidth",{get:function(){return this.doc.internal.pageSize.width},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"paperHeight",{get:function(){return this.doc.internal.pageSize.height},enumerable:!1,configurable:!0}),e.prototype.getNumberOfPages=function(){return this.doc.getNumberOfPages()},e.prototype.addPage=function(){this.doc.addPage()},e.prototype.getCurrentPageIndex=function(){return this.doc.getCurrentPageInfo().pageNumber-1},e.prototype.setPage=function(t){this.doc.setPage(t+1)},e.customFonts={},e}(I),M=r(400),k=function(){function t(){}return t.findBotInterval=function(t,e,n,i){var r=t.search(e,n);return r.push({pageIndex:0,xLeft:i.margins.left,xRight:i.margins.left,yBot:i.margins.top,absBot:i.margins.top}),r.reduce(function(t,i){return Math.abs(i.xRight-e)<L.EPSILON||Math.abs(i.xLeft-n)<L.EPSILON||i.pageIndex<t.pageIndex?t:i.pageIndex>t.pageIndex||i.yBot>t.yBot?i:t},r[r.length-1])},t.addPack=function(t,e,n){for(var i=t.length;i<=e;i++)t.push([]);t[e].push(n)},t.pack=function(e,n){var i=n.paperHeight-n.margins.top-n.margins.bot,r=[];e.forEach(function(t){r.push([]),t.forEach(function(t){var e;t.height>i+L.EPSILON?(e=r[r.length-1]).push.apply(e,t.unfold()):r[r.length-1].push(t)})}),r.forEach(function(t){t.sort(function(t,e){return t.yTop<e.yTop?-1:t.yTop>e.yTop||t.xLeft>e.xLeft?1:t.xLeft<e.xLeft?-1:0})});var o=0,s=[],a=n.paperHeight-n.margins.bot;return r.forEach(function(e){var i=new M.Ay,r=0;e.forEach(function(e){var l=t.findBotInterval(i,e.xLeft,e.xRight,n),c=l.pageIndex,h=l.yBot,u=l.absBot,f=e.height;e.yTop=h+e.yTop-u,(Math.abs(e.yTop-n.margins.top)>L.EPSILON&&e.yTop+f>a+L.EPSILON||e.isPageBreak)&&(e.yTop=n.margins.top,c++,r=Math.max(r,c)),i.insert(e.xLeft,e.xRight,{pageIndex:c,xLeft:e.xLeft,xRight:e.xRight,yBot:e.yTop+f,absBot:e.yBot}),e.yBot=e.yTop+f,t.addPack(s,o+c,e)}),o+=r+1}),s},t}();!function(t){t.NotSet="notset",t.Left="left",t.Center="center",t.Right="right"}(B||(B={})),function(t){t.NotSet="notset",t.Top="top",t.Middle="middle",t.Bottom="bottom"}(A||(A={}));var W=function(){function t(t,e,n,i,r){this.packs=t,this.controller=e,this._rect=n,this._countPages=i,this._pageNumber=r}return Object.defineProperty(t.prototype,"pageCount",{get:function(){return this._countPages},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"countPages",{get:function(){return this._countPages},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pageNumber",{get:function(){return this._pageNumber},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rect",{get:function(){return this._rect},enumerable:!1,configurable:!0}),t.prototype.alignRect=function(t,e){void 0===t.margins?t.margins={left:0,right:0,top:0,bot:0}:(void 0===t.margins.left&&(t.margins.left=0),void 0===t.margins.right&&(t.margins.right=0),void 0===t.margins.top&&(t.margins.top=0),void 0===t.margins.bot&&(t.margins.bot=0)),void 0===t.rect&&(void 0!==t.horizontalAlign&&t.horizontalAlign!==B.NotSet||(t.horizontalAlign=B.Center),void 0!==t.verticalAlign&&t.verticalAlign!==A.NotSet||(t.verticalAlign=A.Middle));var n=L.clone(this.rect);if(void 0!==t.horizontalAlign)switch(t.horizontalAlign){case B.Left:n.xLeft=this.rect.xLeft+t.margins.left,n.xRight=Math.min(this.rect.xRight-t.margins.right,this.rect.xLeft+t.margins.left+e.width);break;case B.Center:n.xLeft=Math.max(this.rect.xLeft+t.margins.left,(this.rect.xLeft+this.rect.xRight-e.width)/2),n.xRight=Math.min(this.rect.xRight-t.margins.right,(this.rect.xLeft+this.rect.xRight+e.width)/2);break;case B.Right:n.xLeft=Math.max(this.rect.xLeft+t.margins.left,this.rect.xRight-t.margins.right-e.width),n.xRight=this.rect.xRight-t.margins.right}else n.xLeft=t.rect.xLeft||this.rect.xLeft,n.xRight=t.rect.xRight||this.rect.xRight;if(void 0!==t.verticalAlign)switch(t.verticalAlign){case A.Top:n.yTop=this.rect.yTop+t.margins.top,n.yBot=Math.min(this.rect.yBot-t.margins.bot,this.rect.yTop+t.margins.top+e.height);break;case A.Middle:n.yTop=Math.max(this.rect.yTop+t.margins.top,(this.rect.yTop+this.rect.yBot-e.height)/2),n.yBot=Math.min(this.rect.yBot-t.margins.bot,(this.rect.yTop+this.rect.yBot+e.height)/2);break;case A.Bottom:n.yTop=Math.max(this.rect.yTop+t.margins.top,this.rect.yBot-t.margins.bot-e.height),n.yBot=this.rect.yBot-t.margins.bot}else n.yTop=t.rect.yTop||this.rect.yTop,n.yBot=t.rect.yBot||this.rect.yBot;return n},t.prototype.drawText=function(t){void 0===(t=L.clone(t)).fontSize&&(t.fontSize=I.FONT_SIZE),void 0===t.isBold&&(t.isBold=!1);var e=this.controller.measureText(t.text,t.isBold?"bold":"normal",t.fontSize),n=this.alignRect(t,e);t.isBold?this.packs.push(new _(null,this.controller,n,t.text)):this.packs.push(new b(null,this.controller,n,t.text)),this.packs[this.packs.length-1].fontSize=t.fontSize},t.prototype.drawImage=function(t){return s(this,void 0,void 0,function(){var e,n,i,r;return a(this,function(o){switch(o.label){case 0:return void 0===(t=L.clone(t)).width&&(t.width=this.rect.xRight-this.rect.xLeft),void 0===t.height&&(t.height=this.rect.yBot-this.rect.yTop),e={width:t.width,height:t.height},n=this.alignRect(t,e),this.controller.pushMargins(0,0),r=(i=this.packs).push,[4,L.createImageFlat(L.createPoint(n,!0,!0),null,this.controller,{link:t.base64,width:n.xRight-n.xLeft,height:n.yBot-n.yTop,objectFit:t.imageFit},!!t.imageFit||this.controller.applyImageFit)];case 1:return r.apply(i,[o.sent()]),this.controller.popMargins(),[2]}})})},t}(),q=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.unshift=function(t){this.hasFunc(t)||(null==this.callbacks&&(this.callbacks=new Array),this.callbacks.unshift(t))},e.prototype.fire=function(t,e){return s(this,void 0,void 0,function(){var n;return a(this,function(i){switch(i.label){case 0:if(null==this.callbacks)return[2];n=0,i.label=1;case 1:return n<this.callbacks.length?[4,this.callbacks[n](t,e)]:[3,4];case 2:i.sent(),i.label=3;case 3:return n++,[3,1];case 4:return[2]}})})},e}(c.EventBase),H=function(){function t(){}return t.process_header_events=function(t,e,n){return s(this,void 0,void 0,function(){var i;return a(this,function(r){switch(r.label){case 0:t.haveCommercialLicense||t.onRenderHeader.add(function(t,e){e.drawText({text:"SurveyJS PDF | Please purchase a SurveyJS PDF developer license to use it in your app | https://surveyjs.io/Buy",fontSize:10})}),i=0,r.label=1;case 1:return i<n.length?[4,t.onRenderHeader.fire(t,new W(n[i],e,L.createHeaderRect(e),n.length,i+1))]:[3,5];case 2:return r.sent(),[4,t.onRenderFooter.fire(t,new W(n[i],e,L.createFooterRect(e),n.length,i+1))];case 3:r.sent(),r.label=4;case 4:return i++,[3,1];case 5:return[2]}})})},t}(),D=function(t){function e(e,n){var i=t.call(this,e)||this;return i.onRenderHeader=new q,i.onRenderFooter=new q,i.onRenderQuestion=new q,i.onRenderPanel=new q,i.onRenderPage=new q,i.onDocControllerCreated=new c.EventBase,i.onRenderCheckItemAcroform=new q,i.onRenderRadioGroupWrapAcroform=new q,i.onRenderRadioItemAcroform=new q,void 0===n&&(n={}),"inputPerPage"==i.questionsOnPageMode&&(i.questionsOnPageMode="standard"),i.options=L.clone(n),i}return n(e,t),Object.defineProperty(e.prototype,"haveCommercialLicense",{get:function(){var t=c.hasLicense;return!!t&&t(2)},set:function(t){console.error("As of v1.9.101, the haveCommercialLicense property is not supported. To activate your license, use the setLicenseKey(key) method as shown on the following page: https://surveyjs.io/remove-alert-banner")},enumerable:!1,configurable:!0}),e.prototype.getUpdatedCheckItemAcroformOptions=function(t){this.onRenderCheckItemAcroform.fire(this,t)},e.prototype.getUpdatedRadioGroupWrapOptions=function(t){this.onRenderRadioGroupWrapAcroform.fire(this,t)},e.prototype.getUpdatedRadioItemAcroformOptions=function(t){this.onRenderRadioItemAcroform.fire(this,t)},e.prototype.correctBricksPosition=function(t,e){t.isRTL&&e.forEach(function(e){e.forEach(function(e){e.translateX(function(e,n){var i=t.paperWidth-e-n;return{xLeft:e+i,xRight:n+i}})})})},e.prototype.renderSurvey=function(t){return s(this,void 0,void 0,function(){var e,n,i,r;return a(this,function(o){switch(o.label){case 0:return this.visiblePages.forEach(function(t){return t.onFirstRendering()}),[4,y.generateFlats(this,t)];case 1:return e=o.sent(),this.correctBricksPosition(t,e),n=k.pack(e,t),[4,H.process_header_events(this,t,n)];case 2:o.sent(),i=0,o.label=3;case 3:if(!(i<n.length))return[3,8];r=0,o.label=4;case 4:return r<n[i].length?(t.getNumberOfPages()===i&&t.addPage(),t.setPage(i),[4,n[i][r].render()]):[3,7];case 5:o.sent(),o.label=6;case 6:return r++,[3,4];case 7:return i++,[3,3];case 8:return[2]}})})},e.prototype.save=function(){return s(this,arguments,void 0,function(t){var n,i,r=this;return void 0===t&&(t="survey_result.pdf"),a(this,function(o){switch(o.label){case 0:return e.currentlySaving?[3,2]:(n=new N(this.options),this.onDocControllerCreated.fire(this,{controller:n}),e.currentlySaving=!0,L.fixFont(n),[4,this.renderSurvey(n)]);case 1:return o.sent(),(i=n.doc.save(t,{returnPromise:!0})).then(function(){e.currentlySaving=!1;var t=e.saveQueue.shift();t&&t()}),[2,i];case 2:e.saveQueue.push(function(){r.save(t)}),o.label=3;case 3:return[2]}})})},e.prototype.raw=function(t){return s(this,void 0,void 0,function(){var e;return a(this,function(n){switch(n.label){case 0:return e=new N(this.options),this.onDocControllerCreated.fire(this,{controller:e}),L.fixFont(e),[4,this.renderSurvey(e)];case 1:return n.sent(),[2,e.doc.output(t)]}})})},e.currentlySaving=!1,e.saveQueue=[],e}(c.SurveyModel),j=function(t){function e(e,n,i,r){var o=t.call(this,r.question,e,n)||this;return o.fieldName=i,o.context=r,o.question=o.context.question,o.textColor=o.formBorderColor,o}return n(e,t),e.prototype.getShouldRenderReadOnly=function(){return this.context.readOnly&&"acroform"!==L.getReadonlyRenderAs(this.question,this.controller)||this.controller.compress},e.prototype.renderInteractive=function(){return s(this,void 0,void 0,function(){var t,n,i,r;return a(this,function(o){return t=new this.controller.doc.AcroFormCheckBox,n=L.formScale(this.controller,this),(i={}).maxFontSize=this.height*n*e.FONT_SIZE_SCALE,i.caption=e.CHECKMARK_READONLY_SYMBOL,i.textAlign="center",i.fieldName=this.fieldName,i.readOnly=this.context.readOnly,i.color=this.formBorderColor,i.value=!!this.context.checked&&"On",i.AS=this.context.checked?"/On":"/Off",i.context=this.context,i.Rect=L.createAcroformRect(L.scaleRect(this,n)),this.controller.doc.addField(t),null===(r=this.question.survey)||void 0===r||r.getUpdatedCheckItemAcroformOptions(i),t.maxFontSize=i.maxFontSize,t.caption=i.caption,t.textAlign=i.textAlign,t.fieldName=i.fieldName,t.readOnly=i.readOnly,t.color=i.color,t.value=i.value,t.AS=i.AS,t.Rect=i.Rect,L.renderFlatBorders(this.controller,this),[2]})})},e.prototype.renderReadOnly=function(){return s(this,void 0,void 0,function(){var t,n,i,r,o;return a(this,function(s){switch(s.label){case 0:return L.renderFlatBorders(this.controller,this),this.context.checked?(t=L.createPoint(this,!0,!0),n=this.controller.fontName,this.controller.fontName=e.CHECKMARK_READONLY_FONT,i=this.controller.fontSize,this.controller.fontSize=i*e.CHECKMARK_READONLY_FONT_SIZE_SCALE,r=this.controller.measureText(e.CHECKMARK_READONLY_SYMBOL),t.xLeft+=this.width/2-r.width/2,t.yTop+=this.height/2-r.height/2,[4,L.createTextFlat(t,this.question,this.controller,e.CHECKMARK_READONLY_SYMBOL,b)]):[3,3];case 1:return(o=s.sent()).unfold()[0].textColor=this.textColor,this.controller.fontSize=i,[4,o.render()];case 2:s.sent(),this.controller.fontName=n,s.label=3;case 3:return[2]}})})},e.FONT_SIZE_SCALE=.7,e.CHECKMARK_READONLY_SYMBOL="3",e.CHECKMARK_READONLY_FONT="zapfdingbats",e.CHECKMARK_READONLY_FONT_SIZE_SCALE=1-Math.E/10,e}(v),z=function(t){function e(e,n,i){return t.call(this,n,i,e.id,{question:e,readOnly:e.isReadOnly,checked:e.checkedValue})||this}return n(e,t),e}(j),G=function(){function t(t,e,n){this.name=t,this.controller=e,this.context=n}return t.prototype.addToPdf=function(t){var e;this._radioGroup=new this.controller.doc.AcroFormRadioButton;var n={};n.fieldName=this.name,n.readOnly=this.readOnly,n.color=t,n.context=this.context,null===(e=this.context.question.survey)||void 0===e||e.getUpdatedRadioGroupWrapOptions(n),this._radioGroup.fieldName=n.fieldName,this._radioGroup.readOnly=n.readOnly,this._radioGroup.color=n.color,this._radioGroup.value="",this.controller.doc.addField(this._radioGroup)},Object.defineProperty(t.prototype,"radioGroup",{get:function(){return this._radioGroup},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"readOnly",{get:function(){return this.context.readOnly},enumerable:!1,configurable:!0}),t}(),V=function(t){function e(e,n,i,r){var o=t.call(this,i.question,e,n)||this;return o.context=i,o.radioGroupWrap=r,o.textColor=o.formBorderColor,o}return n(e,t),e.prototype.getShouldRenderReadOnly=function(){return this.radioGroupWrap.readOnly&&"acroform"!==L.getReadonlyRenderAs(this.question,this.controller)||this.controller.compress},e.prototype.renderInteractive=function(){return s(this,void 0,void 0,function(){var t,e,n,i;return a(this,function(r){return 0==this.context.index&&this.radioGroupWrap.addToPdf(this.formBorderColor),(t={}).fieldName=this.radioGroupWrap.name+"index"+this.context.index,e=L.formScale(this.controller,this),t.Rect=L.createAcroformRect(L.scaleRect(this,e)),t.color=this.formBorderColor,t.appearance=this.controller.doc.AcroForm.Appearance.RadioButton.Circle,t.radioGroup=this.radioGroupWrap.radioGroup,t.context=this.context,null===(i=this.context.question.survey)||void 0===i||i.getUpdatedRadioItemAcroformOptions(t),n=this.radioGroupWrap.radioGroup.createOption(t.fieldName),this.context.checked?(t.AS||(n.AS="/"+t.fieldName),this.radioGroupWrap.radioGroup.value||(this.radioGroupWrap.radioGroup.value=t.fieldName)):t.AS||(t.AS="/Off"),n.Rect=t.Rect,n.color=t.color,L.renderFlatBorders(this.controller,this),this.radioGroupWrap.radioGroup.setAppearance(t.appearance),[2]})})},e.prototype.renderReadOnly=function(){return s(this,void 0,void 0,function(){var t,n,i,r,o;return a(this,function(s){switch(s.label){case 0:return L.renderFlatBorders(this.controller,this),this.context.checked?(t=L.createPoint(this,!0,!0),n=this.controller.fontSize,i=this.controller.fontName,this.controller.fontName=e.RADIOMARKER_READONLY_FONT,this.controller.fontSize=n*e.RADIOMARKER_READONLY_FONT_SIZE_SCALE,r=this.controller.measureText(e.RADIOMARKER_READONLY_SYMBOL),t.xLeft+=this.width/2-r.width/2,t.yTop+=this.height/2-r.height/2,[4,L.createTextFlat(t,this.question,this.controller,e.RADIOMARKER_READONLY_SYMBOL,b)]):[3,3];case 1:return(o=s.sent()).unfold()[0].textColor=this.textColor,[4,o.render()];case 2:s.sent(),this.controller.fontSize=n,this.controller.fontName=i,s.label=3;case 3:return[2]}})})},e.RADIOMARKER_READONLY_SYMBOL="l",e.RADIOMARKER_READONLY_FONT="zapfdingbats",e.RADIOMARKER_READONLY_FONT_SIZE_SCALE=1-(2+Math.E)/10,e}(v),U=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.survey=e,r.controller=i,r.question=n,r}return n(e,t),e.prototype.generateItemComment=function(t,e){return s(this,void 0,void 0,function(){var n;return a(this,function(i){switch(i.label){case 0:return n=this.question.getCommentTextAreaModel(e),[4,L.createCommentFlat(t,this.question,this.controller,{fieldName:n.id,rows:L.OTHER_ROWS_COUNT,value:n.getTextValue(),shouldRenderBorders:"textarea"===c.settings.readOnlyCommentRenderMode,isReadOnly:this.question.isReadOnly,isMultiline:!0})];case 1:return[2,i.sent()]}})})},e.prototype.generateFlatComposite=function(t,e,n){return s(this,void 0,void 0,function(){var i,r,o,s,l,c,h,f,d;return a(this,function(a){switch(a.label){case 0:return i=new u,r=L.createRect(t,this.controller.unitWidth,this.controller.unitHeight),o=this.generateFlatItem(L.moveRect(L.scaleRect(r,L.SELECT_ITEM_FLAT_SCALE),t.xLeft),e,n),i.addBrick(o),(s=L.clone(t)).xLeft=o.xRight+this.controller.unitWidth*L.GAP_BETWEEN_ITEM_TEXT,null===e.locText.renderedHtml?[3,2]:(c=(l=i).addBrick,[4,L.createTextFlat(s,this.question,this.controller,e.locText,b)]);case 1:c.apply(l,[a.sent()]),a.label=2;case 2:return e.isCommentShowing?((h=L.createPoint(i,!0,!1)).yTop+=this.controller.unitHeight*L.GAP_BETWEEN_ROWS,d=(f=i).addBrick,[4,this.generateItemComment(h,e)]):[3,4];case 3:d.apply(f,[a.sent()]),a.label=4;case 4:return[2,i]}})})},e.prototype.getVisibleChoices=function(){return this.question.visibleChoices},e.prototype.getColCount=function(){return this.question.colCount},e.prototype.generateFlatsContent=function(t){return s(this,void 0,void 0,function(){var e,n,i,r;return a(this,function(o){switch(o.label){case 0:return e=this.getColCount(),n=this.getVisibleChoices(),i=e,0!=e?[3,1]:(i=Math.floor(L.getPageAvailableWidth(this.controller)/this.controller.measureText(L.MATRIX_COLUMN_WIDTH).width)||1,n.length<i&&(i=n.length),[3,3]);case 1:return e>1?(i=L.getColumnWidth(this.controller,e)<this.controller.measureText(L.MATRIX_COLUMN_WIDTH).width?1:e)!=e?[3,3]:[4,this.generateColumns(t)]:[3,3];case 2:return[2,o.sent()];case 3:return 1!=i?[3,5]:[4,this.generateVerticallyItems(t,n)];case 4:return r=o.sent(),[3,7];case 5:return[4,this.generateHorisontallyItems(t,i)];case 6:r=o.sent(),o.label=7;case 7:return[2,r]}})})},e.prototype.generateRows=function(t,e){return s(this,void 0,void 0,function(){var n,i,r,o,s,l,c,h,f,d,p,g,m;return a(this,function(a){switch(a.label){case 0:n=this.getVisibleChoices(),i=L.clone(t),r=(null!==(m=e[0])&&void 0!==m?m:[]).length,o=[],s=0,l=e,a.label=1;case 1:if(!(s<l.length))return[3,7];c=l[s],h=new u,f=0,a.label=2;case 2:return f<c.length?(d=c[f],this.controller.pushMargins(),L.setColumnMargins(this.controller,r,f),i.xLeft=this.controller.margins.left,[4,this.generateFlatComposite(i,d,n.indexOf(d))]):[3,5];case 3:p=a.sent(),h.addBrick(p),this.controller.popMargins(),a.label=4;case 4:return f++,[3,2];case 5:g=L.createRowlineFlat(L.createPoint(h),this.controller),i.yTop=g.yBot+L.GAP_BETWEEN_ROWS*this.controller.unitHeight,o.push(h,g),a.label=6;case 6:return s++,[3,1];case 7:return[2,o]}})})},e.prototype.generateVerticallyItems=function(t,e){return s(this,void 0,void 0,function(){var n,i,r,o;return a(this,function(s){switch(s.label){case 0:n=L.clone(t),i=[],r=0,s.label=1;case 1:return r<e.length?[4,this.generateFlatComposite(n,e[r],r)]:[3,4];case 2:o=s.sent(),n.yTop=o.yBot+L.GAP_BETWEEN_ROWS*this.controller.unitHeight,i.push(o),s.label=3;case 3:return r++,[3,1];case 4:return[2,i]}})})},e.prototype.generateColumns=function(t){return s(this,void 0,void 0,function(){var e,n,i,r,o,s,l,c;return a(this,function(a){switch(a.label){case 0:for(e=this.question.columns,n=e.reduce(function(t,e){return Math.max(t,e.length)},0),i=[],r=0;r<n;r++){for(o=[],s=0,l=e;s<l.length;s++)(c=l[s])[r]&&o.push(c[r]);i.push(o)}return[4,this.generateRows(t,i)];case 1:return[2,a.sent()]}})})},e.prototype.generateHorisontallyItems=function(t,e){return s(this,void 0,void 0,function(){var n;return a(this,function(i){switch(i.label){case 0:return n=[],this.getVisibleChoices().forEach(function(t,i){var r=Math.floor(i/e),o=i%e;n[r]||(n[r]=[]),n[r][o]=t}),[4,this.generateRows(t,n)];case 1:return[2,i.sent()]}})})},e}(x),Y=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.survey=e,r.controller=i,r.question=n,r}return n(e,t),e.prototype.isItemSelected=function(t,e){return void 0===e?t===this.question.otherItem?this.question.isOtherSelected:t.value===this.question.value||void 0!==this.question.isItemSelected&&this.question.isItemSelected(t):e},e.prototype.generateFlatItem=function(t,e,n,r,o,s){void 0===s&&(s={}),0===n?(this.radioGroupWrap=new G(this.question.id+(void 0===r?"":r),this.controller,i({readOnly:this.question.isReadOnly,question:this.question},s)),this.question.pdfRadioGroupWrap=this.radioGroupWrap):void 0===this.radioGroupWrap&&(this.radioGroupWrap=this.question.pdfRadioGroupWrap);var a=this.isItemSelected(e,o);return new V(this.controller,t,{question:this.question,index:n,checked:a,item:e},this.radioGroupWrap)},e}(U);F.getInstance().register("radiogroup",Y),F.getInstance().register("buttongroup",Y);var X=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.survey=e,r.controller=i,r.question=n,r}return n(e,t),e.prototype.generateFlatsContent=function(t){return s(this,void 0,void 0,function(){var e,n,i,r,o,s,l;return a(this,function(a){switch(a.label){case 0:return e=new u,n=this.controller.unitHeight,i=new z(this.question,this.controller,L.moveRect(L.scaleRect(L.createRect(t,n,n),L.SELECT_ITEM_FLAT_SCALE),t.xLeft)),e.addBrick(i),(r=L.clone(t)).xLeft=i.xRight+this.controller.unitWidth*L.GAP_BETWEEN_ITEM_TEXT,null===(o=this.question.isIndeterminate?null:this.question.checkedValue?this.question.locLabelTrue:this.question.locLabelFalse)||null===o.renderedHtml?[3,2]:(l=(s=e).addBrick,[4,L.createTextFlat(r,this.question,this.controller,o,b)]);case 1:l.apply(s,[a.sent()]),a.label=2;case 2:return[2,[e]]}})})},e}(x),Q=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.survey=e,r.controller=i,r.buildItems(),r}return n(e,t),e.prototype.buildItems=function(){var t=this.question,e=new c.ItemValue(void 0!==t.valueFalse&&t.valueFalse),n=new c.ItemValue(void 0===t.valueTrue||t.valueTrue);e.locOwner=t,e.setLocText(t.locLabelFalse),n.locOwner=t,n.setLocText(t.locLabelTrue),this.items=[e,n]},e.prototype.getVisibleChoices=function(){return this.items},e.prototype.getColCount=function(){return 0},e}(Y);F.getInstance().register("boolean",Q),F.getInstance().register("boolean-checkbox",X);var K=function(t){function e(e,n,i,r,o){return t.call(this,n,i,e.id+"index"+o,{question:e,readOnly:e.isReadOnly||!r.isEnabled,item:r,checked:e.isItemSelected(r),index:o})||this}return n(e,t),e}(j),Z=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.survey=e,r.controller=i,r.question=n,r}return n(e,t),e.prototype.generateFlatItem=function(t,e,n){return new K(this.question,this.controller,t,e,n)},e}(U),J=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.survey=e,r.controller=i,r.question=n,r}return n(e,t),e.prototype.getVisibleChoices=function(){return this.controller.tagboxSelectedChoicesOnly?this.question.selectedChoices:t.prototype.getVisibleChoices.call(this)},e}(Z);F.getInstance().register("tagbox",J),F.getInstance().register("checkbox",Z);var $=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.survey=e,r.controller=i,r}return n(e,t),e.prototype.generateFlatsContent=function(t){return s(this,void 0,void 0,function(){return a(this,function(e){return[2,F.getInstance().create(this.survey,this.question,this.controller,this.question.getType()).generateFlatsContent(t)]})})},e}(x);F.getInstance().register("custom_model",$);var tt=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.survey=e,r.controller=i,r.question=n,r}return n(e,t),e.prototype.generateFlatsContent=function(t){return s(this,void 0,void 0,function(){return a(this,function(e){switch(e.label){case 0:return[4,L.createCommentFlat(t,this.question,this.controller,{rows:this.question.rows,isReadOnly:this.question.isReadOnly,isMultiline:!0,fieldName:this.question.id,placeholder:L.getLocString(this.question.locPlaceHolder),shouldRenderBorders:"textarea"===c.settings.readOnlyCommentRenderMode,value:this.question.value})];case 1:return[2,[e.sent()]]}})})},e}(x);F.getInstance().register("comment",tt);var et=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.controller=n,r.question=e,r}return n(e,t),e.prototype.renderInteractive=function(){return s(this,void 0,void 0,function(){var t,e,n=this;return a(this,function(i){return(t=new this.controller.doc.AcroFormComboBox).fieldName=this.question.id,t.Rect=L.createAcroformRect(L.scaleRect(this,L.formScale(this.controller,this))),t.edit=!1,t.color=this.textColor,e=[],this.question.showOptionsCaption&&e.push(this.getCorrectedText(this.question.optionsCaption)),this.question.visibleChoices.forEach(function(t){e.push(n.getCorrectedText(L.getLocString(t.locText)))}),t.setOptions(e),t.fontName=this.controller.fontName,t.fontSize=this.fontSize,t.readOnly=this.question.isReadOnly,t.isUnicode=L.isCustomFont(this.controller,t.fontName),t.V=this.getCorrectedText(this.question.readOnlyText||""),this.controller.doc.addField(t),L.renderFlatBorders(this.controller,this),[2]})})},e}(v),nt=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.survey=e,r.controller=i,r.question=n,r}return n(e,t),e.prototype.generateItemComment=function(t){return s(this,void 0,void 0,function(){var e;return a(this,function(n){switch(n.label){case 0:return e=this.question.getCommentTextAreaModel(this.question.selectedItem),[4,L.createCommentFlat(t,this.question,this.controller,{fieldName:e.id,rows:L.OTHER_ROWS_COUNT,value:e.getTextValue(),shouldRenderBorders:"textarea"===c.settings.readOnlyCommentRenderMode,isReadOnly:this.question.isReadOnly,isMultiline:!0})];case 1:return[2,n.sent()]}})})},e.prototype.generateFlatsContent=function(t){return s(this,void 0,void 0,function(){var e,n,i,r,o;return a(this,function(s){switch(s.label){case 0:return this.shouldRenderAsComment?[3,1]:(e=new et(this.question,this.controller,L.createTextFieldRect(t,this.controller)),[3,3]);case 1:return[4,L.createCommentFlat(t,this.question,this.controller,{fieldName:this.question.id,shouldRenderBorders:"input"===c.settings.readOnlyTextRenderMode,value:this.question.readOnlyText||"",isReadOnly:this.question.isReadOnly,placeholder:L.getLocString(this.question.locPlaceholder)})];case 2:e=s.sent(),s.label=3;case 3:return n=new u(e),this.question.isShowingChoiceComment?((i=L.createPoint(n)).yTop+=this.controller.unitHeight*L.GAP_BETWEEN_ROWS,o=(r=n).addBrick,[4,this.generateItemComment(i)]):[3,5];case 4:o.apply(r,[s.sent()]),s.label=5;case 5:return[2,[n]]}})})},e}(x);F.getInstance().register("dropdown",nt);var it=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.survey=e,r.question=n,r}return n(e,t),e.prototype.generateFlatsContent=function(t){return s(this,void 0,void 0,function(){return a(this,function(e){switch(e.label){case 0:return[4,L.createCommentFlat(t,this.question,this.controller,{value:this.question.displayValue,isReadOnly:!0,fieldName:this.question.id,shouldRenderBorders:"input"===c.settings.readOnlyTextRenderMode})];case 1:return[2,[e.sent()]]}})})},e}(x);F.getInstance().register("expression",it);var rt=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.survey=e,r.question=n,r}return n(e,t),e.prototype.generateFlatItem=function(t,n){return s(this,void 0,void 0,function(){var i,r,o,s,l;return a(this,function(a){switch(a.label){case 0:return r=u.bind,[4,L.createLinkFlat(t,this.question,this.controller,void 0===n.name?"image":n.name,n.content)];case 1:return i=new(r.apply(u,[void 0,a.sent()])),L.canPreviewImage(this.question,n,n.content)?((o=L.createPoint(i)).yTop+=this.controller.unitHeight*e.IMAGE_GAP_SCALE,l=(s=i).addBrick,[4,L.createImageFlat(o,this.question,this.controller,{link:n.content,width:n.imageSize.width,height:n.imageSize.height,objectFit:e.DEFAULT_IMAGE_FIT})]):[3,3];case 2:l.apply(s,[a.sent()]),a.label=3;case 3:return[2,i]}})})},e.prototype.addLine=function(t,e,n,i){n!==i.length-1&&(t[t.length-1].addBrick(L.createRowlineFlat(e,this.controller)),e.yTop+=L.EPSILON,t.push(new u))},e.prototype.getImagePreviewContentWidth=function(t){return s(this,void 0,void 0,function(){return a(this,function(n){return[2,Math.max(t.imageSize.width,e.TEXT_MIN_SCALE*this.controller.unitWidth)]})})},e.prototype.generateFlatsContent=function(t){return s(this,void 0,void 0,function(){var e,n,r,o,s,l,c,h,f,d,p;return a(this,function(a){switch(a.label){case 0:return(e=this.question.showPreview?this.question.previewValue:this.question.value)&&0!==e.length?[3,2]:[4,L.createTextFlat(t,this.question,this.controller,this.question.noFileChosenCaption,b)];case 1:return[2,[a.sent()]];case 2:n=[new u],r=L.clone(t),o=r.yTop,s=0,a.label=3;case 3:return s<e.length?(l=i({},e[s]),(c=L.canPreviewImage(this.question,l,l.content))?(h=l,[4,L.getCorrectedImageSize(this.controller,{imageWidth:this.question.imageWidth,imageHeight:this.question.imageHeight,imageLink:e[s].content,defaultImageWidth:200,defaultImageHeight:150})]):[3,5]):[3,12];case 4:h.imageSize=a.sent(),a.label=5;case 5:return f=this.controller.paperWidth-this.controller.margins.right-r.xLeft,c?[4,this.getImagePreviewContentWidth(l)]:[3,8];case 6:return d=a.sent(),f<d&&(r.xLeft=t.xLeft,r.yTop=o,this.addLine(n,r,s,e)),this.controller.pushMargins(r.xLeft,this.controller.paperWidth-r.xLeft-d),[4,this.generateFlatItem(r,l)];case 7:return p=a.sent(),n[n.length-1].addBrick(p),r.xLeft+=p.width,o=Math.max(o,p.yBot),this.controller.popMargins(),[3,10];case 8:return f<this.controller.unitWidth&&(r.xLeft=t.xLeft,r.yTop=o,this.addLine(n,r,s,e)),[4,this.generateFlatItem(r,l)];case 9:p=a.sent(),n[n.length-1].addBrick(p),r.xLeft+=p.xRight-p.xLeft,o=Math.max(o,p.yBot),a.label=10;case 10:r.xLeft+=this.controller.unitWidth,a.label=11;case 11:return s++,[3,3];case 12:return[2,n]}})})},e.IMAGE_GAP_SCALE=.195,e.TEXT_MIN_SCALE=5,e.DEFAULT_IMAGE_FIT="contain",e}(x);F.getInstance().register("file",rt);var ot=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.survey=e,r}return n(e,t),e.prototype.chooseRender=function(t){return/<[^>]*style[^<]*>/.test(t)||/<[^>]*table[^<]*>/.test(t)||/&\w+;/.test(t)?"image":"standard"},e.prototype.correctHtml=function(t){return e.correctHtmlRules.forEach(function(e){t=t.replace(e.searchRegExp,e.replaceString)}),t},e.prototype.generateFlatsContent=function(t){return s(this,void 0,void 0,function(){var e,n,i,r,o,s,l,c,h,u;return a(this,function(a){switch(a.label){case 0:return e=this.question.renderAs,L.hasDocument?("auto"===e&&(e=this.controller.htmlRenderAs),"auto"===e&&(e=this.chooseRender(L.getLocString(this.question.locHtml))),n=L.createHtmlContainerBlock(L.getLocString(this.question.locHtml),this.controller,e),"image"!==e?[3,3]:(i=L.getPageAvailableWidth(this.controller),[4,L.htmlToImage(n,i,this.controller)])):[2,[new E(L.createRect(t,0,0))]];case 1:return r=a.sent(),o=r.url,s=r.aspect,l=i/s,[4,L.createImageFlat(t,this.question,this.controller,{link:o,width:i,height:l})];case 2:return[2,[a.sent()]];case 3:return h=(c=L).splitHtmlRect,u=[this.controller],[4,L.createHTMLFlat(t,this.question,this.controller,this.correctHtml(n))];case 4:return[2,[h.apply(c,u.concat([a.sent()]))]]}})})},e.correctHtmlRules=[{searchRegExp:/(<\/?br\s*?\/?\s*?>\s*){2,}/g,replaceString:"<br>"}],e}(x);c.Serializer.removeProperty("html","renderAs"),c.Serializer.addProperty("html",{name:"renderAs",default:"auto",visible:!1,choices:["auto","standard","image"]}),F.getInstance().register("html",ot);var st=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.survey=e,r.question=n,r}return n(e,t),e.prototype.getCorrectImageSize=function(){return s(this,void 0,void 0,function(){return a(this,function(t){switch(t.label){case 0:return[4,L.getCorrectedImageSize(this.controller,{imageWidth:this.question.imageWidth,imageHeight:this.question.imageHeight,imageLink:this.question.imageLink})];case 1:return[2,t.sent()]}})})},e.prototype.generateFlatsContent=function(t){return s(this,void 0,void 0,function(){var e;return a(this,function(n){switch(n.label){case 0:return[4,this.getCorrectImageSize()];case 1:return e=n.sent(),[4,L.createImageFlat(t,this.question,this.controller,{link:this.question.imageLink,width:e.width,height:e.height})];case 2:return[2,[n.sent()]]}})})},e}(x);F.getInstance().register("image",st);var at=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.survey=e,r.question=n,r}return n(e,t),e.prototype.generateFlatItem=function(t,e,n){return s(this,void 0,void 0,function(){var i,r,o,s,l,c,h;return a(this,function(a){switch(a.label){case 0:return i=L.getPageAvailableWidth(this.controller),[4,L.createImageFlat(t,this.question,this.controller,{link:e.imageLink,width:i,height:i/L.IMAGEPICKER_RATIO})];case 1:return r=a.sent(),o=new u(r),s=L.createPoint(o),this.question.showLabel?[4,L.createTextFlat(s,this.question,this.controller,e.text||e.value,b)]:[3,3];case 2:l=a.sent(),o.addBrick(l),s=L.createPoint(l),a.label=3;case 3:return c=this.controller.unitHeight,h=L.createRect(s,i,c),this.question.multiSelect?o.addBrick(new j(this.controller,h,this.question.id+"index"+n,{readOnly:this.question.isReadOnly||!e.isEnabled,question:this.question,item:e,checked:-1!==this.question.value.indexOf(e.value),index:n})):o.addBrick(this.radio.generateFlatItem(h,e,n)),[2,o]}})})},e.prototype.generateFlatsContent=function(t){return s(this,void 0,void 0,function(){var e,n,i,r,o,s,l,c,h,f,d,p;return a(this,function(a){switch(a.label){case 0:this.radio=this.question.multiSelect?null:new Y(this.survey,this.question,this.controller),e=[new u],n=L.getImagePickerAvailableWidth(this.controller)/L.IMAGEPICKER_COUNT,i=~~(L.getPageAvailableWidth(this.controller)/n)||1,r=this.question.visibleChoices.length,i=i<=r?i:r,o=~~Math.ceil(r/i),s=L.clone(t),l=0,a.label=1;case 1:if(!(l<o))return[3,7];c=s.yTop,this.controller.pushMargins(),h=this.controller.margins.left,f=0,a.label=2;case 2:return f<i?(d=l*i+f)==r?[3,5]:(this.controller.margins.left=h,this.controller.margins.right=this.controller.paperWidth-h-n,h=this.controller.paperWidth-this.controller.margins.right+this.controller.unitWidth,s.xLeft=this.controller.margins.left,[4,this.generateFlatItem(s,this.question.visibleChoices[d],d)]):[3,5];case 3:p=a.sent(),e[e.length-1].addBrick(p),c=Math.max(c,p.yBot),a.label=4;case 4:return f++,[3,2];case 5:this.controller.popMargins(),s.xLeft=t.xLeft,s.yTop=c,l!==o-1&&(e[e.length-1].addBrick(L.createRowlineFlat(s,this.controller)),s.yTop+=L.EPSILON,e.push(new u)),a.label=6;case 6:return l++,[3,1];case 7:return[2,e]}})})},e}(x);F.getInstance().register("imagepicker",at);var lt=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.survey=e,r.controller=i,r.question=n,r}return n(e,t),e.prototype.generateFlatsContent=function(t){return s(this,void 0,void 0,function(){var n,i,r,o,s,l;return a(this,function(a){switch(a.label){case 0:n=[],i=L.clone(t),r=0,o=this.question.panels,a.label=1;case 1:return r<o.length?(s=o[r],[4,y.generateFlatsPanel(this.survey,this.controller,s,i)]):[3,4];case 2:0!==(l=a.sent()).length&&(i.yTop=L.mergeRects.apply(L,l).yBot,i.yTop+=this.controller.unitHeight*e.GAP_BETWEEN_PANELS,n.push.apply(n,l)),a.label=3;case 3:return r++,[3,1];case 4:return[2,n]}})})},e.GAP_BETWEEN_PANELS=.75,e}(x);F.getInstance().register("paneldynamic",lt);var ct=function(t){function e(e,n,i,r){var o=t.call(this,e,n,i)||this;return o.mark=r,o.question=e,o.textColor=o.formBorderColor,o}return n(e,t),e.prototype.renderInteractive=function(){return s(this,void 0,void 0,function(){var t,e,n,i;return a(this,function(r){switch(r.label){case 0:return L.renderFlatBorders(this.controller,this),t=L.createPoint(this,!0,!0),e=this.controller.fontSize,this.controller.fontSize=e*j.CHECKMARK_READONLY_FONT_SIZE_SCALE,n=this.controller.measureText(this.mark),t.xLeft+=this.width/2-n.width/2,t.yTop+=this.height/2-n.height/2,[4,L.createTextFlat(t,this.question,this.controller,this.mark,b)];case 1:return(i=r.sent()).unfold()[0].textColor=this.textColor,this.controller.fontSize=e,[4,i.render()];case 2:return r.sent(),[2]}})})},e}(v),ht=function(t){function e(e,n,i,r,o){var s=t.call(this,void 0,e,n)||this;return s.color=i,s.renderWidth=r,s.renderHeight=o,s}return n(e,t),e.prototype.renderInteractive=function(){return s(this,void 0,void 0,function(){var t,e,n;return a(this,function(i){return t=this.controller.doc.getFillColor(),this.controller.doc.setFillColor(this.color||"black"),this.controller.doc.rect(this.xLeft,this.yTop,null!==(e=this.renderWidth)&&void 0!==e?e:this.width,null!==(n=this.renderHeight)&&void 0!==n?n:this.height,"F"),this.controller.doc.setFillColor(t),[2]})})},e}(v),ut=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.survey=e,r.controller=i,r.question=n,r}return n(e,t),e.prototype.generateFlatComposite=function(t,e,n){return s(this,arguments,void 0,function(t,e,n,i){var r,o,s,l,c;return void 0===i&&(i=!1),a(this,function(a){switch(a.label){case 0:return r=L.createRect(t,this.controller.unitWidth,this.controller.unitHeight),o=L.moveRect(L.scaleRect(r,L.SELECT_ITEM_FLAT_SCALE),t.xLeft),s=new ct(this.question,this.controller,o,i?"-":this.question.getNumberByIndex(n)),(l=L.clone(t)).xLeft=s.xRight+this.controller.unitWidth*L.GAP_BETWEEN_ITEM_TEXT,[4,L.createTextFlat(l,this.question,this.controller,e.locText,b)];case 1:return c=a.sent(),[2,new u(s,c)]}})})},e.prototype.generateChoicesColumn=function(t,e){return s(this,arguments,void 0,function(t,e,n){var i,r,o,s;return void 0===n&&(n=!1),a(this,function(a){switch(a.label){case 0:i=L.clone(t),r=[],o=0,a.label=1;case 1:return o<e.length?[4,this.generateFlatComposite(i,e[o],o,n)]:[3,4];case 2:s=a.sent(),i.yTop=s.yBot+L.GAP_BETWEEN_ROWS*this.controller.unitHeight,r.push(s),a.label=3;case 3:return o++,[3,1];case 4:return[2,r]}})})},e.prototype.generateSelectToRankItemsVertically=function(t){return s(this,void 0,void 0,function(){var e,n,i,r,o,s,l,c,h;return a(this,function(a){switch(a.label){case 0:return e=L.clone(t),n=[],0===this.question.rankingChoices.length?[3,2]:(r=(i=n.push).apply,o=[n],[4,this.generateChoicesColumn(e,this.question.rankingChoices)]);case 1:r.apply(i,o.concat([a.sent()])),e.yTop=n[n.length-1].yBot+L.GAP_BETWEEN_ROWS*this.controller.unitHeight*2,a.label=2;case 2:return s=L.createRect({xLeft:e.xLeft,yTop:e.yTop-L.GAP_BETWEEN_ROWS*this.controller.unitHeight-.5},this.controller.paperWidth-this.controller.margins.right-e.xLeft,1),n.push(new ht(this.controller,s,L.FORM_BORDER_COLOR)),c=(l=n.push).apply,h=[n],[4,this.generateChoicesColumn(e,this.question.unRankingChoices,!0)];case 3:return c.apply(l,h.concat([a.sent()])),[2,n]}})})},e.prototype.generateSelectToRankItemsHorizontally=function(t){return s(this,void 0,void 0,function(){var e,n,i,r,o,s,l,c,h,f,d,p,g;return a(this,function(a){switch(a.label){case 0:e=2,n=L.clone(t),i=[],r=Math.max(this.question.unRankingChoices.length,this.question.rankingChoices.length),o=new u,s=0,a.label=1;case 1:if(!(s<r))return[3,8];l=0,c=0,h=[this.question.unRankingChoices[s],this.question.rankingChoices[s]],a.label=2;case 2:return c<h.length?(f=h[c])?(this.controller.pushMargins(this.controller.margins.left,this.controller.margins.right),L.setColumnMargins(this.controller,e,l),n.xLeft=this.controller.margins.left,[4,this.generateFlatComposite(n,f,s,0==l)]):[3,4]:[3,6];case 3:d=a.sent(),o.addBrick(d),this.controller.popMargins(),a.label=4;case 4:l++,a.label=5;case 5:return c++,[3,2];case 6:p=L.createRowlineFlat(L.createPoint(o),this.controller),i.push(o,p),g=L.createRect({xLeft:this.controller.margins.left+L.getPageAvailableWidth(this.controller)/2-.5,yTop:n.yTop},0,0),o.addBrick(new ht(this.controller,g,L.FORM_BORDER_COLOR,1,p.yBot-n.yTop+(s!==r-1?L.GAP_BETWEEN_ROWS*this.controller.unitHeight:0))),n.yTop=p.yBot+L.GAP_BETWEEN_ROWS*this.controller.unitHeight,o=new u,a.label=7;case 7:return s++,[3,1];case 8:return[2,i]}})})},e.prototype.generateFlatsContent=function(t){return s(this,void 0,void 0,function(){return a(this,function(e){return this.question.selectToRankEnabled?"vertical"==this.question.selectToRankAreasLayout?[2,this.generateSelectToRankItemsVertically(t)]:[2,this.generateSelectToRankItemsHorizontally(t)]:[2,this.generateChoicesColumn(t,this.question.rankingChoices)]})})},e}(x);F.getInstance().register("ranking",ut);var ft=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.survey=e,r.controller=i,r.questionRating=n,r}return n(e,t),e.prototype.generateFlatHorisontalComposite=function(t,e,n){return s(this,void 0,void 0,function(){var i,r,o,s,l,c,h;return a(this,function(a){switch(a.label){case 0:return i=L.getRatingItemText(this.questionRating,n,e.locText),this.controller.pushMargins(),r=this.controller.unitWidth/2,this.controller.margins.left+=r,this.controller.margins.right+=r,(o=L.clone(t)).xLeft+=r,l=u.bind,[4,L.createBoldTextFlat(o,this.questionRating,this.controller,i)];case 1:return s=new(l.apply(u,[void 0,a.sent()])),this.controller.popMargins(),(c=s.width)<L.getRatingMinWidth(this.controller)?(s.xLeft+=(L.getRatingMinWidth(this.controller)-c)/2-r,c=L.getRatingMinWidth(this.controller)):c+=this.controller.unitWidth,(h=L.createPoint(s)).xLeft=t.xLeft,s.addBrick(this.generateFlatItem(L.createRect(h,c,this.controller.unitHeight),e,n,void 0,this.question.value==e.value)),[2,s]}})})},e.prototype.generateFlatComposite=function(t,e,n){return s(this,void 0,void 0,function(){var i,r,o,s,l,c,h;return a(this,function(a){switch(a.label){case 0:return i=new u,r=L.createRect(t,this.controller.unitHeight,this.controller.unitHeight),o=this.generateFlatItem(L.moveRect(L.scaleRect(r,L.SELECT_ITEM_FLAT_SCALE),t.xLeft),e,n,void 0,this.question.value==e.value),i.addBrick(o),(s=L.clone(t)).xLeft=o.xRight+this.controller.unitWidth*L.GAP_BETWEEN_ITEM_TEXT,null==(l=L.getRatingItemText(this.questionRating,n,e.locText))?[3,2]:(h=(c=i).addBrick,[4,L.createTextFlat(s,this.question,this.controller,l,b)]);case 1:h.apply(c,[a.sent()]),a.label=2;case 2:return[2,i]}})})},e.prototype.generateHorisontallyItems=function(t){return s(this,void 0,void 0,function(){var e,n,i,r,o;return a(this,function(s){switch(s.label){case 0:e=[new u],n=L.clone(t),i=0,s.label=1;case 1:return i<this.questionRating.visibleRateValues.length?[4,this.generateFlatHorisontalComposite(n,this.questionRating.visibleRateValues[i],i)]:[3,4];case 2:r=s.sent(),e[e.length-1].addBrick(r),o=this.controller.paperWidth-this.controller.margins.right-r.xRight,L.getRatingMinWidth(this.controller)<=o+L.EPSILON?n.xLeft=r.xRight:(n.xLeft=t.xLeft,n.yTop=r.yBot,i!==this.questionRating.visibleRateValues.length-1&&(e[e.length-1].addBrick(L.createRowlineFlat(n,this.controller)),n.yTop+=L.EPSILON,e.push(new u))),s.label=3;case 3:return i++,[3,1];case 4:return[2,e]}})})},e.prototype.generateFlatsContent=function(t){return s(this,void 0,void 0,function(){var e,n,i;return a(this,function(r){for(e=!1,n=0;n<this.questionRating.visibleRateValues.length;n++)i=L.getRatingItemText(this.questionRating,n,this.questionRating.visibleRateValues[n].locText),this.controller.measureText(i).width>this.controller.measureText(L.RATING_COLUMN_WIDTH).width&&(e=!0);return[2,e?this.generateVerticallyItems(t,this.questionRating.visibleRateValues):this.generateHorisontallyItems(t)]})})},e}(Y);F.getInstance().register("rating",ft);var dt=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.survey=e,r.controller=i,r.question=n,r}return n(e,t),e.prototype.generateFlatsContent=function(t){return s(this,void 0,void 0,function(){var e,n,i,r,o,s;return a(this,function(a){switch(a.label){case 0:return e=L.clone(t),"single"!==this.question.sliderType?[3,2]:(o=this.getOptionsByValue(this.question.value),[4,this.generateInputBrick(e,o)]);case 1:return[2,[a.sent()]];case 2:if("range"!==this.question.sliderType)return[3,7];n=new u,i=0,a.label=3;case 3:return i<this.question.value.length?(r=this.question.value[i],o=this.getOptionsByValue(r),[4,this.generateColumnInput(e,o,2,i)]):[3,6];case 4:s=a.sent(),n.addBrick(s),a.label=5;case 5:return i++,[3,3];case 6:return[2,[n]];case 7:return[2]}})})},e.prototype.getOptionsByValue=function(t){var e=this.question;return{fieldName:e.id,inputType:"number",value:t,isReadOnly:e.isReadOnly,shouldRenderBorders:!0}},e.prototype.generateInputBrick=function(t,e){return s(this,void 0,void 0,function(){var n;return a(this,function(r){switch(r.label){case 0:return this.shouldRenderAsComment?[3,1]:(n=L.createTextFieldRect(t,this.controller),[2,new S(this.question,this.controller,n,i({},e))]);case 1:return[4,L.createCommentFlat(t,this.question,this.controller,i({},e))];case 2:return[2,r.sent()]}})})},e.prototype.generateColumnInput=function(t,e,n,i){return s(this,void 0,void 0,function(){var r,o;return a(this,function(s){switch(s.label){case 0:return this.controller.pushMargins(),L.setColumnMargins(this.controller,n,i),(r=L.clone(t)).xLeft=this.controller.margins.left,[4,this.generateInputBrick(r,e)];case 1:return o=s.sent(),this.controller.popMargins(),[2,o]}})})},e}(x);F.getInstance().register("slider",dt);var pt=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.survey=e,r.question=n,r}return n(e,t),e.prototype.generateBackgroundImage=function(t){return s(this,void 0,void 0,function(){return a(this,function(e){switch(e.label){case 0:return[4,L.createImageFlat(t,this.question,this.controller,{link:this.question.backgroundImage,width:L.pxToPt(this.question.signatureWidth),height:L.pxToPt(this.question.signatureHeight),objectFit:"cover"},!0)];case 1:return[2,e.sent()]}})})},e.prototype.getSignImageUrl=function(){return this.question.storeDataAsText||!this.question.loadedData?this.question.value:this.question.loadedData},e.prototype.generateSign=function(t){return s(this,void 0,void 0,function(){var n,i,r,o=this;return a(this,function(s){switch(s.label){case 0:return n=L.pxToPt(this.question.signatureWidth),i=L.pxToPt(this.question.signatureHeight),this.question.value?[4,L.createImageFlat(t,this.question,this.controller,{link:this.getSignImageUrl(),width:n,height:i},!1)]:[3,2];case 1:return r=s.sent(),[3,3];case 2:r=new E(L.createRect(t,n,i)),s.label=3;case 3:return"none"!==e.BORDER_STYLE&&(r.afterRenderCallback=function(){var t={height:r.width,width:r.width,yTop:r.yTop,yBot:r.yBot,xLeft:r.xLeft,xRight:r.xRight,formBorderColor:r.formBorderColor,rounded:!1,outside:!0,dashStyle:"dashed"==e.BORDER_STYLE?{dashArray:[5],dashPhase:0}:void 0};L.renderFlatBorders(o.controller,t)}),[2,r]}})})},e.prototype.generateFlatsContent=function(t){return s(this,void 0,void 0,function(){var e,n,i,r,o;return a(this,function(s){switch(s.label){case 0:return e=new u,this.question.backgroundImage?(i=(n=e).addBrick,[4,this.generateBackgroundImage(t)]):[3,2];case 1:i.apply(n,[s.sent()]),s.label=2;case 2:return o=(r=e).addBrick,[4,this.generateSign(t)];case 3:return o.apply(r,[s.sent()]),[2,[e]]}})})},e.BORDER_STYLE="dashed",e}(x);F.getInstance().register("signaturepad",pt);var gt=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.survey=e,r.question=n,r}return n(e,t),e.prototype.generateFlatsContent=function(t){return s(this,void 0,void 0,function(){var n,r;return a(this,function(o){switch(o.label){case 0:return n={fieldName:this.question.id,inputType:this.question.inputType,value:this.question.inputValue,isReadOnly:this.question.isReadOnly,shouldRenderBorders:"input"===c.settings.readOnlyTextRenderMode,placeholder:L.getLocString(this.question.locPlaceHolder)},this.shouldRenderAsComment?[4,L.createCommentFlat(t,this.question,this.controller,i({rows:e.MULTILINE_TEXT_ROWS_COUNT,isMultiline:!0},n))]:(r=L.createTextFieldRect(t,this.controller),[2,[new S(this.question,this.controller,r,i({},n))]]);case 1:return[2,[o.sent()]]}})})},e.MULTILINE_TEXT_ROWS_COUNT=1,e}(x);F.getInstance().register("text",gt);var mt=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.survey=e,r.controller=i,r.question=n,r}return n(e,t),e.prototype.generateFlatsHeader=function(t){return s(this,void 0,void 0,function(){var e,n,i,r,o,s;return a(this,function(a){switch(a.label){case 0:e=[],n=L.clone(t),this.question.hasRows&&(n.xLeft+=this.rowTitleWidth+this.controller.unitWidth*L.GAP_BETWEEN_COLUMNS),i=0,a.label=1;case 1:return i<this.question.visibleColumns.length?(this.controller.pushMargins(),this.controller.margins.left=n.xLeft,this.controller.margins.right+=L.getPageAvailableWidth(this.controller)-this.columnWidth,o=(r=e).push,[4,L.createBoldTextFlat(n,this.question,this.controller,this.question.visibleColumns[i].locText)]):[3,4];case 2:o.apply(r,[a.sent()]),n.xLeft+=this.columnWidth+this.controller.unitWidth*L.GAP_BETWEEN_COLUMNS,this.controller.popMargins(),a.label=3;case 3:return i++,[3,1];case 4:return[2,[s=new(u.bind.apply(u,l([void 0],e,!1))),L.createRowlineFlat(L.createPoint(s),this.controller)]]}})})},e.prototype.generateFlatsRows=function(t,n){return s(this,void 0,void 0,function(){var i,r,o,s,l;return a(this,function(a){switch(a.label){case 0:i=[],r=L.clone(t),o=0,a.label=1;case 1:return o<this.question.visibleRows.length?(s="row"+o,[4,new yt(this.survey,this.question,this.controller,this.question.visibleRows[o],o,s,0==o,n,this.rowTitleWidth,this.columnWidth).generateFlatsContent(r)]):[3,4];case 2:l=a.sent(),(r=L.createPoint(L.mergeRects.apply(L,l))).yTop+=this.controller.unitHeight*e.GAP_BETWEEN_ROWS,i.push.apply(i,l),a.label=3;case 3:return o++,[3,1];case 4:return[2,i]}})})},e.prototype.calculateColumnsWidthes=function(){var t=L.getPageAvailableWidth(this.controller);this.question.hasRows&&this.question.rowTitleWidth?(this.controller.pushMargins(),this.rowTitleWidth=L.parseWidth(this.question.rowTitleWidth,t),this.controller.margins.left+=this.rowTitleWidth+this.controller.unitWidth*L.GAP_BETWEEN_COLUMNS,this.columnWidth=L.getColumnWidth(this.controller,this.question.visibleColumns.length),this.controller.popMargins()):this.columnWidth=this.rowTitleWidth=L.getColumnWidth(this.controller,this.question.visibleColumns.length+(this.question.hasRows?1:0))},e.prototype.generateFlatsContent=function(t){return s(this,void 0,void 0,function(){var n,i,r,o,s,l,c;return a(this,function(a){switch(a.label){case 0:return this.calculateColumnsWidthes(),n="list"===this.question.renderAs||"list"===this.controller.matrixRenderAs||this.columnWidth<this.controller.measureText(L.MATRIX_COLUMN_WIDTH).width,i=L.clone(t),r=[],n||!this.question.showHeader||0==this.question.visibleColumns.length?[3,2]:[4,this.generateFlatsHeader(i)];case 1:o=a.sent(),(i=L.createPoint(L.mergeRects.apply(L,o))).yTop+=e.GAP_BETWEEN_ROWS*this.controller.unitHeight,r.push.apply(r,o),a.label=2;case 2:return l=(s=r.push).apply,c=[r],[4,this.generateFlatsRows(i,n)];case 3:return l.apply(s,c.concat([a.sent()])),[2,r]}})})},e.GAP_BETWEEN_ROWS=.5,e}(x),yt=function(){function t(t,e,n,i,r,o,s,a,l,c){void 0===s&&(s=!1),void 0===a&&(a=!1),this.survey=t,this.question=e,this.controller=n,this.row=i,this.rowIndex=r,this.key=o,this.isFirst=s,this.isVertical=a,this.rowTitleWidth=l,this.columnWidth=c}return t.prototype.generateFlatsContent=function(t){return s(this,void 0,void 0,function(){var e;return a(this,function(n){switch(n.label){case 0:return this.isVertical?[4,this.generateFlatsVerticallyCells(t)]:[3,2];case 1:return e=n.sent(),[3,4];case 2:return[4,this.generateFlatsHorizontallyCells(t)];case 3:e=n.sent(),n.label=4;case 4:return[2,e]}})})},t.prototype.generateFlatItem=function(t,e,n,r,o){void 0===o&&(o={});var s=this.question.id+r,a=this.row.isChecked(e);return this.question.isMultiSelect?new j(this.controller,t,s+"index"+n,{question:this.question,index:n,checked:a,item:e,readOnly:this.question.isReadOnly}):(0===n?(this.radioGroupWrap=new G(s,this.controller,i({readOnly:this.question.isReadOnly,question:this.question},o)),this.question.pdfRadioGroupWrap=this.radioGroupWrap):void 0===this.radioGroupWrap&&(this.radioGroupWrap=this.question.pdfRadioGroupWrap),new V(this.controller,t,{question:this.question,index:n,checked:a,item:e},this.radioGroupWrap))},t.prototype.generateTextComposite=function(t,e,n){return s(this,void 0,void 0,function(){var i,r,o,s;return a(this,function(a){switch(a.label){case 0:return i=L.clone(t),r=L.createRect(i,L.getPageAvailableWidth(this.controller),this.controller.unitHeight),o=this.generateFlatItem(r,e,n,this.key,{row:this.row,rowIndex:this.rowIndex}),i.yTop=o.yBot+this.controller.unitHeight*L.GAP_BETWEEN_ITEM_TEXT,[4,L.createTextFlat(i,this.question,this.controller,this.question.getCellDisplayLocText(this.row.name,e),b)];case 1:return s=a.sent(),[2,new u(o,s)]}})})},t.prototype.generateItemComposite=function(t,e,n){return s(this,void 0,void 0,function(){var i,r,o,s;return a(this,function(a){switch(a.label){case 0:return i=L.clone(t),r=L.createRect(i,this.controller.unitHeight,this.controller.unitHeight),o=this.generateFlatItem(L.moveRect(L.scaleRect(r,L.SELECT_ITEM_FLAT_SCALE),r.xLeft),e,n,this.key,{row:this.row,rowIndex:this.rowIndex}),i.xLeft=o.xRight+this.controller.unitWidth*L.GAP_BETWEEN_ITEM_TEXT,[4,L.createTextFlat(i,this.question,this.controller,e.locText,b)];case 1:return s=a.sent(),[2,new u(o,s)]}})})},t.prototype.generateFlatsHorizontallyCells=function(t){return s(this,void 0,void 0,function(){var e,n,i,r,o,s,c,h,f,d;return a(this,function(a){switch(a.label){case 0:return e=[],n=L.clone(t),this.question.hasRows?(this.controller.pushMargins(),n.xLeft=this.controller.margins.left,this.controller.margins.right+=L.getPageAvailableWidth(this.controller)-this.rowTitleWidth,r=(i=e).push,[4,L.createTextFlat(n,this.question,this.controller,this.row.locText,b)]):[3,2];case 1:r.apply(i,[a.sent()]),n.xLeft+=this.rowTitleWidth+this.controller.unitWidth*L.GAP_BETWEEN_COLUMNS,this.controller.popMargins(),a.label=2;case 2:o=0,a.label=3;case 3:return o<this.question.visibleColumns.length?(s=this.question.visibleColumns[o],this.row.value,s.value,this.controller.pushMargins(),this.controller.margins.left=n.xLeft,this.controller.margins.right+=L.getPageAvailableWidth(this.controller)-this.columnWidth,this.question.hasCellText?(h=(c=e).push,[4,this.generateTextComposite(n,s,o)]):[3,5]):[3,8];case 4:return h.apply(c,[a.sent()]),[3,6];case 5:f=L.createRect(n,this.controller.unitHeight,this.controller.unitHeight),e.push(this.generateFlatItem(L.moveRect(L.scaleRect(f,L.SELECT_ITEM_FLAT_SCALE),n.xLeft),s,o,this.key,{row:this.row,rowIndex:this.rowIndex})),a.label=6;case 6:n.xLeft+=this.columnWidth+this.controller.unitWidth*L.GAP_BETWEEN_COLUMNS,this.controller.popMargins(),a.label=7;case 7:return o++,[3,3];case 8:return[2,[d=new(u.bind.apply(u,l([void 0],e,!1))),L.createRowlineFlat(L.createPoint(d),this.controller)]]}})})},t.prototype.generateFlatsVerticallyCells=function(t){return s(this,void 0,void 0,function(){var e,n,i,r,o,s,c;return a(this,function(a){switch(a.label){case 0:return e=[],n=L.clone(t),this.question.hasRows?[4,L.createTextFlat(n,this.question,this.controller,this.row.locText,b)]:[3,2];case 1:i=a.sent(),n.yTop=i.yBot+x.CONTENT_GAP_VERT_SCALE*this.controller.unitHeight,e.push(i),a.label=2;case 2:return o=(r=e.push).apply,s=[e],[4,this.generateVerticallyItems(n,this.question.visibleColumns)];case 3:return o.apply(r,s.concat([a.sent()])),[2,[c=new(u.bind.apply(u,l([void 0],e,!1))),L.createRowlineFlat(L.createPoint(c),this.controller)]]}})})},t.prototype.generateVerticallyItems=function(t,e){return s(this,void 0,void 0,function(){var n,i,r,o;return a(this,function(s){switch(s.label){case 0:n=L.clone(t),i=[],r=0,s.label=1;case 1:return r<e.length?[4,(this.question.hasCellText?this.generateTextComposite:this.generateItemComposite).call(this,n,e[r],r)]:[3,4];case 2:o=s.sent(),n.yTop=o.yBot+L.GAP_BETWEEN_ROWS*this.controller.unitHeight,i.push(o),s.label=3;case 3:return r++,[3,1];case 4:return[2,i]}})})},t}();c.Serializer.removeProperty("matrix","renderAs"),c.Serializer.addProperty("matrix",{name:"renderAs",default:"auto",visible:!1,choices:["auto","list"]}),F.getInstance().register("matrix",mt);var vt=function(t){function e(e,n,i,r){void 0===r&&(r=!0);var o=t.call(this,e,n,i)||this;return o.survey=e,o.isMultiple=r,o.question=n,o}return n(e,t),Object.defineProperty(e.prototype,"visibleRows",{get:function(){return this.visibleRowsValue||(this.visibleRowsValue=this.question.renderedTable.rows.filter(function(t){return t.visible})),this.visibleRowsValue},enumerable:!1,configurable:!0}),e.prototype.generateFlatsCellTitle=function(t,e){return s(this,void 0,void 0,function(){var n,i,r;return a(this,function(o){switch(o.label){case 0:return n=new u,r=(i=n).addBrick,[4,L.createTextFlat(t,this.question,this.controller,e,b)];case 1:return r.apply(i,[o.sent()]),[2,n]}})})},e.prototype.generateFlatsCell=function(t,e,n){return s(this,arguments,void 0,function(t,e,n,i){var r,o,s,l,c,h,f,d,p,g;return void 0===i&&(i=!0),a(this,function(a){switch(a.label){case 0:return r=new u,e.hasQuestion?"footer"!=n||e.question.isAnswered?[3,1]:[3,4]:[3,5];case 1:return i&&e.isChoice?(o=F.getInstance().create(this.survey,e.question,this.controller,e.question.getType()),s=L.moveRect(L.scaleRect(L.createRect(t,this.controller.unitHeight,this.controller.unitHeight),L.SELECT_ITEM_FLAT_SCALE),t.xLeft),r.addBrick(o.generateFlatItem(s,e.item,e.choiceIndex)),[3,4]):[3,2];case 2:return e.question.titleLocation=L.TITLE_LOCATION_MATRIX,c=(l=r.addBrick).apply,h=[r],[4,L.generateQuestionFlats(this.survey,this.controller,e.question,t)];case 3:c.apply(l,h.concat([a.sent()])),a.label=4;case 4:return[3,9];case 5:return e.hasTitle?"header"!=n?[3,7]:(d=(f=r).addBrick,[4,L.createBoldTextFlat(t,this.question,this.controller,e.locTitle)]):[3,9];case 6:return d.apply(f,[a.sent()]),[3,9];case 7:return g=(p=r).addBrick,[4,L.createTextFlat(t,this.question,this.controller,e.locTitle,b)];case 8:g.apply(p,[a.sent()]),a.label=9;case 9:return[2,r]}})})},Object.defineProperty(e.prototype,"hasDetailPanel",{get:function(){var t=this;return this.visibleRows.some(function(e){return e.row&&t.question.hasDetailPanel(e.row)})},enumerable:!1,configurable:!0}),e.prototype.ignoreCell=function(t,e,n,i){return void 0===i&&(i=!0),!(i||"footer"!=n||!t.hasQuestion||t.question.isAnswered)||!(t.hasQuestion||t.hasTitle||this.isMultiple&&(this.hasDetailPanel?1==e:0==e))},e.prototype.getRowLocation=function(t){return t===this.question.renderedTable.headerRow?"header":this.question.renderedTable.footerRow===t?"footer":void 0},e.prototype.generateFlatsRowHorisontal=function(t,e,n){return s(this,void 0,void 0,function(){var i,r,o,s,l,c,h;return a(this,function(a){switch(a.label){case 0:i=new u,r=L.clone(t),o=this.controller.paperWidth-this.controller.margins.left+this.controller.unitWidth*L.GAP_BETWEEN_COLUMNS,this.controller.pushMargins(),s=0,l=this.getRowLocation(e),c=0,a.label=1;case 1:return c<e.cells.length?this.ignoreCell(e.cells[c],c,l)?[3,3]:(this.controller.margins.left=this.controller.paperWidth-o+this.controller.unitWidth*L.GAP_BETWEEN_COLUMNS,this.controller.margins.right=this.controller.paperWidth-this.controller.margins.left-n[s],o=this.controller.margins.right,r.xLeft=this.controller.margins.left,[4,this.generateFlatsCell(r,e.cells[c],l)]):[3,4];case 2:(h=a.sent()).isEmpty||i.addBrick(h),s++,a.label=3;case 3:return c++,[3,1];case 4:return this.controller.popMargins(),[2,i]}})})},e.prototype.generateFlatsRowVertical=function(t,n){return s(this,void 0,void 0,function(){var i,r,o,s,l,c,h,f,d,p;return a(this,function(a){switch(a.label){case 0:i=new u,r=L.clone(t),o=this.getRowLocation(n),s=0,a.label=1;case 1:return s<n.cells.length?this.ignoreCell(n.cells[s],s,o,!1)?[3,5]:this.question.renderedTable.showHeader&&(!this.isMultiple||s>0)&&(null===(p=null===(d=n.cells[s].cell)||void 0===d?void 0:d.column)||void 0===p?void 0:p.locTitle)?(c=(l=i).addBrick,[4,this.generateFlatsCellTitle(r,n.cells[s].cell.column.locTitle)]):[3,3]:[3,6];case 2:c.apply(l,[a.sent()]),r.yTop=i.yBot+e.GAP_BETWEEN_ROWS*this.controller.unitHeight,a.label=3;case 3:return f=(h=i).addBrick,[4,this.generateFlatsCell(r,n.cells[s],o,!1)];case 4:f.apply(h,[a.sent()]),r.yTop=i.yBot+e.GAP_BETWEEN_ROWS*this.controller.unitHeight,a.label=5;case 5:return s++,[3,1];case 6:return[2,i]}})})},e.prototype.getAvalableWidth=function(t){return L.getPageAvailableWidth(this.controller)-(t-1)*this.controller.unitWidth*L.GAP_BETWEEN_COLUMNS},e.prototype.calculateColumnWidth=function(t,e){for(var n=this,i=this.getAvalableWidth(e),r=i,o=e,s=[],a=[],l=t[0].cells.filter(function(t,e){return!n.ignoreCell(t,e)}),c=0;c<e;c++){var h=L.parseWidth(l[c].width,i,e)||0;r-=h,0!==h?o--:a.push(l[c]),s.push(h)}if(0===o)return s;var u=this.controller.measureText(L.MATRIX_COLUMN_WIDTH).width;return a.sort(function(t,n){var r=L.parseWidth(t.minWidth,i,e)||0;return(L.parseWidth(n.minWidth,i,e)||0)>r?1:-1}).forEach(function(t){var n=r/o,a=L.parseWidth(t.minWidth,i,e)||0;a>n&&a>u&&(r-=a,o--),s[l.indexOf(t)]=Math.max(u,a,n)}),s},e.prototype.generateOneRow=function(t,e,n,i){return s(this,void 0,void 0,function(){return a(this,function(r){switch(r.label){case 0:return n?[4,this.generateFlatsRowHorisontal(t,e,i)]:[3,2];case 1:case 3:return[2,r.sent()];case 2:return[4,this.generateFlatsRowVertical(t,e)]}})})},e.prototype.generateFlatsRows=function(t,n,i,r){return s(this,void 0,void 0,function(){var o,s,l,c,h,f,d,p,g,m;return a(this,function(a){switch(a.label){case 0:o=L.clone(t),s=[],l=0,a.label=1;case 1:return l<n.length?[4,this.generateOneRow(o,n[l],r,this.calculateColumnWidth(n,i))]:[3,6];case 2:if((c=a.sent()).isEmpty&&(!n[l].row||!n[l].row.hasPanel))return[3,5];if(c.isEmpty||(l!==n.length-1&&(o.yTop=c.yBot,c.addBrick(L.createRowlineFlat(o,this.controller))),s.push(c),o.yTop=c.yBot+e.GAP_BETWEEN_ROWS*this.controller.unitHeight),!n[l].row||!n[l].row.hasPanel)return[3,5];for(n[l].row.showDetailPanel(),h=n[l].row.detailPanel,f=0;f<h.questions.length;f++)h.questions[f].id+="_"+l;return[4,y.generateFlatsPanel(this.survey,this.controller,h,o)];case 3:return d=a.sent(),(p=new u).addBrick.apply(p,d),o.yTop=p.yBot+e.GAP_BETWEEN_ROWS*this.controller.unitHeight,s.push(p),l!==n.length-1&&this.question.renderedTable.showHeader&&r?[4,this.generateOneRow(o,n[0],r,this.calculateColumnWidth(n,i))]:[3,5];case 4:g=a.sent(),m=p.yBot,g.isEmpty||(m=g.yBot,s.push(g)),o.yTop=m+e.GAP_BETWEEN_ROWS*this.controller.unitHeight,a.label=5;case 5:return l++,[3,1];case 6:return[2,s]}})})},e.prototype.calculateIsWide=function(t,e){var n=[];if(t.showHeader&&n.push(t.headerRow),n.push.apply(n,this.visibleRows),0===n.length)return!0;var i=this.calculateColumnWidth(n,e).reduce(function(t,e){return t+e},0);return"list"!==this.question.renderAs&&"list"!==this.controller.matrixRenderAs&&Math.floor(i)<=Math.floor(this.getAvalableWidth(e))},e.prototype.getRowsToRender=function(t,e,n){var i=[],r=this.visibleRows;return t.showHeader&&n&&i.push(t.headerRow),i.push.apply(i,r),t.hasRemoveRows&&e&&i.pop(),t.showFooter&&i.push(t.footerRow),i},e.prototype.getColCount=function(t,e){var n=this;return e[0]?e[0].cells.filter(function(t,e){return!n.ignoreCell(t,e)}).length:t.showHeader&&t.headerRow?t.headerRow.cells.length:t.showFooter&&t.footerRow?t.footerRow.cells.length:0},e.prototype.generateFlatsContent=function(t){return s(this,void 0,void 0,function(){var e,n,i,r,o;return a(this,function(s){switch(s.label){case 0:return e=this.question.renderedTable,n="vertical"===this.question.columnLayout,0!==(i=this.getColCount(e,this.visibleRows))||this.hasDetailPanel?((r=this.calculateIsWide(e,i))||(this.question.isMobile=!0,n=!1,e=this.question.renderedTable,this.visibleRowsValue=void 0,i=this.getColCount(e,this.visibleRows)),o=this.getRowsToRender(e,n,r),[4,this.generateFlatsRows(t,o,i,r)]):[2,[new u(L.createRowlineFlat(t,this.controller))]];case 1:return[2,s.sent()]}})})},e.GAP_BETWEEN_ROWS=.5,e}(x);c.Serializer.removeProperty("matrixdropdown","renderAs"),c.Serializer.addProperty("matrixdropdown",{name:"renderAs",default:"auto",visible:!1,choices:["auto","list"]}),F.getInstance().register("matrixdropdown",vt);var bt=function(t){function e(e,n,i){var r=t.call(this,e,n,i,!1)||this;return r.survey=e,r}return n(e,t),e}(vt);c.Serializer.removeProperty("matrixdynamic","renderAs"),c.Serializer.addProperty("matrixdynamic",{name:"renderAs",default:"auto",visible:!1,choices:["auto","list"]}),F.getInstance().register("matrixdynamic",bt);var xt=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.survey=e,r.controller=i,r.question=n,r}return n(e,t),e.prototype.getVisibleRows=function(){return this.question.getRows().filter(function(t){return t.isVisible})},e.prototype.generateFlatItem=function(t,e,n,i){return s(this,void 0,void 0,function(){var e,n,r,o,s,l,c,h;return a(this,function(a){switch(a.label){case 0:return e=L.getPageAvailableWidth(this.controller),this.controller.pushMargins(),this.controller.margins.right=this.controller.paperWidth-this.controller.margins.left-e*L.MULTIPLETEXT_TEXT_PERS,r=u.bind,[4,L.createBoldTextFlat(t,this.question,this.controller,i.locTitle)];case 1:return n=new(r.apply(u,[void 0,a.sent()])),this.controller.popMargins(),o=F.getInstance().create(this.survey,i.editor,this.controller,"text"),s=L.createTextFieldRect({xLeft:t.xLeft+e*L.MULTIPLETEXT_TEXT_PERS,yTop:t.yTop},this.controller),c=(l=n.addBrick).apply,h=[n],[4,o.generateFlatsContent(s)];case 2:return c.apply(l,h.concat([a.sent()])),[2,n]}})})},e.prototype.generateFlatsContent=function(t){return s(this,void 0,void 0,function(){var n,i,r,o,s,l,c;return a(this,function(a){switch(a.label){case 0:n=[],i=L.clone(t),r=this.getVisibleRows(),o=0,a.label=1;case 1:if(!(o<r.length))return[3,7];n.push(new u),s=i.yTop,this.controller.pushMargins(),l=0,a.label=2;case 2:return l<r[o].cells.length?(this.controller.pushMargins(),L.setColumnMargins(this.controller,this.question.colCount,l),i.xLeft=this.controller.margins.left,[4,this.generateFlatItem(i,o,l,r[o].cells[l].item)]):[3,5];case 3:c=a.sent(),n[n.length-1].addBrick(c),s=Math.max(s,c.yBot),this.controller.popMargins(),a.label=4;case 4:return l++,[3,2];case 5:this.controller.popMargins(),i.xLeft=t.xLeft,i.yTop=s,n[n.length-1].addBrick(L.createRowlineFlat(i,this.controller)),i.yTop+=L.EPSILON,i.yTop+=this.controller.unitHeight*e.ROWS_GAP_SCALE,a.label=6;case 6:return o++,[3,1];case 7:return[2,n]}})})},e.ROWS_GAP_SCALE=.195,e}(x);F.getInstance().register("multipletext",xt);var Tt=function(t){function e(e,n,i){var r=t.call(this,e,n,i(n.helperDoc,e,0,0))||this;return r.renderFunc=i,r}return n(e,t),e.prototype.renderInteractive=function(){return s(this,void 0,void 0,function(){var t=this;return a(this,function(e){switch(e.label){case 0:return[4,new Promise(function(e){t.renderFunc(t.controller.doc,t.question,t.xLeft,t.yTop),e()})];case 1:return e.sent(),[2]}})})},e}(v);(0,c.checkLibraryVersion)("".concat("2.3.1"),"survey-pdf")})(),o})());
|