survey-analytics 1.9.81 → 1.9.82
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/package.json +2 -2
- package/survey.analytics.css +1 -1
- package/survey.analytics.d.ts +30 -1
- package/survey.analytics.datatables.css +1 -1
- package/survey.analytics.datatables.js +1 -1
- package/survey.analytics.datatables.min.css +1 -1
- package/survey.analytics.datatables.min.js +1 -1
- package/survey.analytics.js +59 -10
- package/survey.analytics.min.css +1 -1
- package/survey.analytics.min.js +2 -2
- package/survey.analytics.tabulator.css +1 -1
- package/survey.analytics.tabulator.js +1 -1
- package/survey.analytics.tabulator.min.css +1 -1
- package/survey.analytics.tabulator.min.js +1 -1
package/survey.analytics.min.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* surveyjs - SurveyJS Dashboard library v1.9.
|
|
2
|
+
* surveyjs - SurveyJS Dashboard library v1.9.82
|
|
3
3
|
* Copyright (c) 2015-2023 Devsoft Baltic OÜ - http://surveyjs.io/
|
|
4
4
|
* License: MIT (http://www.opensource.org/licenses/mit-license.php)
|
|
5
5
|
*/
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
* Copyright (c) 2018-present, Niklas Rämö <inramo@gmail.com>
|
|
21
21
|
* @license MIT
|
|
22
22
|
*/
|
|
23
|
-
e.exports=function(){"use strict";var e={};function t(){this._events={},this._queue=[],this._counter=0,this._isDestroyed=!1}t.prototype.on=function(e,t){if(this._isDestroyed)return this;var i=this._events[e];return i||(i=this._events[e]=[]),i.push(t),this},t.prototype.off=function(e,t){if(this._isDestroyed)return this;var i=this._events[e];if(!i||!i.length)return this;if(!t)return i.length=0,this;for(var r=i.length;r--;)t===i[r]&&i.splice(r,1);return this},t.prototype.emit=function(e,t,i,r){if(this._isDestroyed)return this;var n=this._events[e];if(!n||!n.length)return this;var s,o=this._queue,a=o.length,l=arguments.length-1;for(s=0;s<n.length;s++)o.push(n[s]);for(++this._counter,s=a,a=o.length;s<a;s++)if(0===l?o[s]():1===l?o[s](t):2===l?o[s](t,i):o[s](t,i,r),this._isDestroyed)return this;return--this._counter,this._counter||(o.length=0),this},t.prototype.destroy=function(){if(this._isDestroyed)return this;var e,t=this._events;for(e in this._isDestroyed=!0,this._queue.length=this._counter=0,t)t[e]&&(t[e].length=0,t[e]=void 0);return this};var i="transform",r="transform",n=window.document.documentElement.style,s=!1;["","Webkit","Moz","O","ms"].forEach((function(e){if(!s){var t=e?e+"Transform":"transform";void 0!==n[t]&&(e=e.toLowerCase(),i=e?"-"+e+"-transform":"transform",r=t,s=!0)}}));var o="function"==typeof WeakMap?new WeakMap:null;function a(e,t){var r=o&&o.get(e);return r||(r=window.getComputedStyle(e,null),o&&o.set(e,r)),r.getPropertyValue("transform"===t?i:t)}var l=/([A-Z])/g;function h(e){return e.replace(l,"-$1").toLowerCase()}function u(e){return"function"==typeof e}function c(e,t){for(var i in t)e.style["transform"===i?r:i]=t[i]}function d(e){this._element=e,this._animation=null,this._callback=null,this._props=[],this._values=[],this._keyframes=[],this._options={},this._isDestroyed=!1,this._onFinish=this._onFinish.bind(this)}d.prototype.start=function(e,t,i){if(!this._isDestroyed){var r=this._animation,n=this._props,s=this._values,o=i||0,a=!1;if(r){var l,h=0;for(var d in t)if(++h,-1===(l=n.indexOf(d))||t[d]!==s[l]){a=!0;break}a||h===n.length||(a=!0)}if(a&&r.cancel(),this._callback=u(o.onFinish)?o.onFinish:null,!r||a){for(d in n.length=s.length=0,t)n.push(d),s.push(t[d]);var p=this._keyframes;p[0]=e,p[1]=t;var f=this._options;f.duration=o.duration||300,f.easing=o.easing||"ease";var m=this._element;(r=m.animate(p,f)).onfinish=this._onFinish,this._animation=r,c(m,t)}}},d.prototype.stop=function(e){if(!this._isDestroyed&&this._animation){var t,i,n,s=this._element,o=this._props,l=this._values;if(e)c(s,e);else for(n=0;n<o.length;n++)i=a(s,h(t=o[n])),s.style["transform"===t?r:t]=i;this._animation.cancel(),this._animation=this._callback=null,o.length=l.length=0}},d.prototype.isAnimating=function(){return!!this._animation},d.prototype.destroy=function(){this._isDestroyed||(this.stop(),this._element=this._options=this._keyframes=null,this._isDestroyed=!0)},d.prototype._onFinish=function(){var e=this._callback;this._animation=this._callback=null,this._props.length=this._values.length=0,e&&e()};var p=["","webkit","moz","ms","o","Webkit","Moz","MS","O"];function f(e,t){for(var i,r,n=t[0].toUpperCase()+t.slice(1),s=0;s<p.length;){if((r=(i=p[s])?i+n:t)in e)return r;++s}return null}var m=(window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame||function(e){return this.setTimeout((function(){e(1e3/60)}),1e3/60)}).bind(window),g=!1;try{var _=Object.defineProperty({},"passive",{get:function(){g=!0}});window.addEventListener("testPassive",null,_),window.removeEventListener("testPassive",null,_)}catch(e){}var y="start",v="move",b="end",w="cancel",C=!(!("ontouchstart"in window)&&!window.TouchEvent),S=!!window.PointerEvent,T=!!window.navigator.msPointerEnabled,A=/(android)/i.test(window.navigator.userAgent),D=!!g&&{passive:!0},P=f(window.document.documentElement.style,"touchAction");function E(e,i){this._element=e,this._emitter=new t,this._isDestroyed=!1,this._cssProps={},this._touchAction="",this._startEvent=null,this._pointerId=null,this._startTime=0,this._startX=0,this._startY=0,this._currentX=0,this._currentY=0,this._preStartCheck=this._preStartCheck.bind(this),this._abortNonCancelable=this._abortNonCancelable.bind(this),this._onStart=this._onStart.bind(this),this._onMove=this._onMove.bind(this),this._onCancel=this._onCancel.bind(this),this._onEnd=this._onEnd.bind(this),this.setCssProps(i),this._touchAction||this.setTouchAction("auto"),e.addEventListener("dragstart",E._preventDefault,!1),e.addEventListener(E._events.start,this._preStartCheck,D),!C||S||T||e.addEventListener(E._mouseEvents.start,this._preStartCheck,D)}function x(){this._nextStep=null,this._queue=[],this._reads={},this._writes={},this._batch=[],this._batchReads={},this._batchWrites={},this._step=this._step.bind(this)}E._pointerEvents={start:"pointerdown",move:"pointermove",cancel:"pointercancel",end:"pointerup"},E._msPointerEvents={start:"MSPointerDown",move:"MSPointerMove",cancel:"MSPointerCancel",end:"MSPointerUp"},E._touchEvents={start:"touchstart",move:"touchmove",cancel:"touchcancel",end:"touchend"},E._mouseEvents={start:"mousedown",move:"mousemove",cancel:"",end:"mouseup"},E._events=S?E._pointerEvents:T?E._msPointerEvents:C?E._touchEvents:E._mouseEvents,E._emitter=new t,E._activeInstances=[],E._preventDefault=function(e){e.preventDefault&&!1!==e.cancelable&&e.preventDefault()},E._activateInstance=function(e){E._activeInstances.indexOf(e)>-1||(E._activeInstances.push(e),E._emitter.on(v,e._onMove),E._emitter.on(w,e._onCancel),E._emitter.on(b,e._onEnd),1===E._activeInstances.length&&E._bindListeners())},E._deactivateInstance=function(e){var t=E._activeInstances.indexOf(e);-1!==t&&(E._activeInstances.splice(t,1),E._emitter.off(v,e._onMove),E._emitter.off(w,e._onCancel),E._emitter.off(b,e._onEnd),E._activeInstances.length||E._unbindListeners())},E._bindListeners=function(){var e=E._events;window.addEventListener(e.move,E._onMove,D),window.addEventListener(e.end,E._onEnd,D),e.cancel&&window.addEventListener(e.cancel,E._onCancel,D)},E._unbindListeners=function(){var e=E._events;window.removeEventListener(e.move,E._onMove,D),window.removeEventListener(e.end,E._onEnd,D),e.cancel&&window.removeEventListener(e.cancel,E._onCancel,D)},E._getEventPointerId=function(e){return"number"==typeof e.pointerId?e.pointerId:e.changedTouches?e.changedTouches[0]?e.changedTouches[0].identifier:null:1},E._getTouchById=function(e,t){if("number"==typeof e.pointerId)return e.pointerId===t?e:null;if(e.changedTouches){for(var i=0;i<e.changedTouches.length;i++)if(e.changedTouches[i].identifier===t)return e.changedTouches[i];return null}return e},E._onMove=function(e){E._emitter.emit(v,e)},E._onCancel=function(e){E._emitter.emit(w,e)},E._onEnd=function(e){E._emitter.emit(b,e)},E.prototype._reset=function(){this._isDestroyed||(this._pointerId=null,this._startTime=0,this._startX=0,this._startY=0,this._currentX=0,this._currentY=0,this._startEvent=null,this._element.removeEventListener(E._touchEvents.start,this._abortNonCancelable,D),E._deactivateInstance(this))},E.prototype._createEvent=function(e,t){var i=this._getTrackedTouch(t);return{type:e,srcEvent:t,distance:this.getDistance(),deltaX:this.getDeltaX(),deltaY:this.getDeltaY(),deltaTime:e===y?0:this.getDeltaTime(),isFirst:e===y,isFinal:e===b||e===w,identifier:this._pointerId,screenX:i.screenX,screenY:i.screenY,clientX:i.clientX,clientY:i.clientY,pageX:i.pageX,pageY:i.pageY,target:i.target}},E.prototype._emit=function(e,t){this._emitter.emit(e,this._createEvent(e,t))},E.prototype._getTrackedTouch=function(e){return null===this._pointerId?null:E._getTouchById(e,this._pointerId)},E.prototype._preStartCheck=function(e){this._isDestroyed||this.isDragging()||A&&!1===e.cancelable||e.button||(this._pointerId=E._getEventPointerId(e),null!==this._pointerId&&(this._startEvent=e,C&&(S||T)?(A&&this._element.addEventListener(E._touchEvents.start,this._abortNonCancelable,D),m(this._onStart)):this._onStart()))},E.prototype._abortNonCancelable=function(e){this._element.removeEventListener(E._touchEvents.start,this._abortNonCancelable,D),this._startEvent&&!1===e.cancelable&&(this._pointerId=null,this._startEvent=null)},E.prototype._onStart=function(){var e=this._startEvent;if(e){this._startEvent=null;var t=this._getTrackedTouch(e);t&&(this._startX=this._currentX=t.clientX,this._startY=this._currentY=t.clientY,this._startTime=Date.now(),this._emit(y,e),E._activateInstance(this))}},E.prototype._onMove=function(e){var t=this._getTrackedTouch(e);t&&(this._currentX=t.clientX,this._currentY=t.clientY,this._emit(v,e))},E.prototype._onCancel=function(e){this._getTrackedTouch(e)&&(this._emit(w,e),this._reset())},E.prototype._onEnd=function(e){this._getTrackedTouch(e)&&(this._emit(b,e),this._reset())},E.prototype.isDragging=function(){return null!==this._pointerId},E.prototype.setTouchAction=function(e){this._touchAction=e,P&&(this._cssProps[P]="",this._element.style[P]=e),C&&(this._element.removeEventListener(E._touchEvents.start,E._preventDefault,!1),this._element.style[P]!==e&&this._element.addEventListener(E._touchEvents.start,E._preventDefault,!1))},E.prototype.setCssProps=function(e){if(e){var t,i,r=this._cssProps,n=this._element;for(t in r)n.style[t]=r[t],delete r[t];for(t in e)e[t]&&("touchAction"!==t?(i=f(n.style,t))&&(r[i]="",n.style[i]=e[t]):this.setTouchAction(e[t]))}},E.prototype.getDeltaX=function(){return this._currentX-this._startX},E.prototype.getDeltaY=function(){return this._currentY-this._startY},E.prototype.getDistance=function(){var e=this.getDeltaX(),t=this.getDeltaY();return Math.sqrt(e*e+t*t)},E.prototype.getDeltaTime=function(){return this._startTime?Date.now()-this._startTime:0},E.prototype.on=function(e,t){this._emitter.on(e,t)},E.prototype.off=function(e,t){this._emitter.off(eventName,t)},E.prototype.destroy=function(){if(!this._isDestroyed){var e=this._element,t=E._events;for(var i in this._reset(),this._emitter.destroy(),e.removeEventListener(t.start,this._preStartCheck,D),e.removeEventListener(E._mouseEvents.start,this._preStartCheck,D),e.removeEventListener("dragstart",E._preventDefault,!1),e.removeEventListener(E._touchEvents.start,E._preventDefault,!1),this._cssProps)e.style[i]=this._cssProps[i],delete this._cssProps[i];this._element=null,this._isDestroyed=!0}},x.prototype.add=function(e,t,i,r){var n=this._queue.indexOf(e);n>-1&&(this._queue[n]=void 0),r?this._queue.unshift(e):this._queue.push(e),this._reads[e]=t,this._writes[e]=i,this._nextStep||(this._nextStep=m(this._step))},x.prototype.cancel=function(e){var t=this._queue.indexOf(e);t>-1&&(this._queue[t]=void 0,delete this._reads[e],delete this._writes[e])},x.prototype._step=function(){var e,t,i=this._queue,r=this._reads,n=this._writes,s=this._batch,o=this._batchReads,a=this._batchWrites,l=i.length;for(this._nextStep=null,t=0;t<l;t++)(e=i[t])&&(s.push(e),o[e]=r[e],delete r[e],a[e]=n[e],delete n[e]);for(i.length=0,t=0;t<l;t++)o[e=s[t]]&&(o[e](),delete o[e]);for(t=0;t<l;t++)a[e=s[t]]&&(a[e](),delete a[e]);s.length=0,!this._nextStep&&i.length&&(this._nextStep=m(this._step))};var k=new x;function O(e){return k.cancel(e+"visibility")}function V(e){return k.cancel(e+"move")}function z(e){return k.cancel(e+"scroll")}function L(e){return k.cancel(e+"placeholder")}var B=window.Element.prototype,M=B.matches||B.matchesSelector||B.webkitMatchesSelector||B.mozMatchesSelector||B.msMatchesSelector||B.oMatchesSelector||function(){return!1};function R(e,t){return M.call(e,t)}function I(e,t){e.classList?e.classList.add(t):R(e,"."+t)||(e.className+=" "+t)}var j=[];function N(e,t,i){var r="number"==typeof i?i:-1;r<0&&(r=e.length-r+1),e.splice.apply(e,j.concat(r,0,t)),j.length=0}function q(e,t,i){var r=e.length,n=Math.max(0,i?r:r-1);return t>n?n:t<0?Math.max(n+t+1,0):t}function H(e,t,i){if(!(e.length<2)){var r=q(e,t),n=q(e,i);r!==n&&e.splice(n,0,e.splice(r,1)[0])}}function F(e,t,i){if(!(e.length<2)){var r,n=q(e,t),s=q(e,i);n!==s&&(r=e[n],e[n]=e[s],e[s]=r)}}var G=0;function X(e,t){var i,r=++G+"debounce";return t>0?function(n){void 0!==i&&(i=window.clearTimeout(i),k.cancel(r),"finish"===n&&e()),"cancel"!==n&&"finish"!==n&&(i=window.setTimeout((function(){i=void 0,k.add(r,e,null,!0)}),t))}:function(t){"cancel"!==t&&e()}}function Y(e){var t=a(e,"transform");if(!t||"none"===t)return!1;var i=a(e,"display");return"inline"!==i&&"none"!==i}function Q(e,t){for(var i=window.document,r=(t?e:e.parentElement)||i;r&&r!==i&&"static"===a(r,"position")&&!Y(r);)r=r.parentElement||i;return r}function U(e,t){return parseFloat(a(e,t))||0}var W={},K={},Z={};function J(e,t){var i,r=t||{};return r.left=0,r.top=0,e===document||(r.left=window.pageXOffset||0,r.top=window.pageYOffset||0,e.self===window.self||(i=e.getBoundingClientRect(),r.left+=i.left,r.top+=i.top,r.left+=U(e,"border-left-width"),r.top+=U(e,"border-top-width"))),r}function $(e,t,i){return Z.left=0,Z.top=0,e===t||i&&(e=Q(e,!0))===(t=Q(t,!0))||(J(e,W),J(t,K),Z.left=K.left-W.left,Z.top=K.top-W.top),Z}function ee(e){var t=a(e,"overflow");return"auto"===t||"scroll"===t||"auto"===(t=a(e,"overflow-x"))||"scroll"===t||"auto"===(t=a(e,"overflow-y"))||"scroll"===t}function te(e,t,i){for(var r=i||[],n=t?e:e.parentNode;n&&n!==document;)n.getRootNode&&n instanceof DocumentFragment?n=n.getRootNode().host:(ee(n)&&r.push(n),n=n.parentNode);return r.push(window),r}var ie,re,ne,se,oe={},ae=/^matrix3d/,le=/([^,]*,){4}/,he=/([^,]*,){12}/,ue=/[^,]*,/;function ce(e){oe.x=0,oe.y=0;var t=a(e,"transform");if(!t||"none"===t)return oe;var i=ae.test(t),r=t.replace(i?he:le,""),n=r.replace(ue,"");return oe.x=parseFloat(r)||0,oe.y=parseFloat(n)||0,oe}function de(e,t){return"translateX("+e+"px) translateY("+t+"px)"}function pe(e,t){e.classList?e.classList.remove(t):R(e,"."+t)&&(e.className=(" "+e.className+" ").replace(" "+t+" "," ").trim())}function fe(e){var t=e._element,i=e.getGrid(),r=i._settings;this._item=e,this._gridId=i._id,this._isDestroyed=!1,this._isMigrating=!1,this._startPredicate=u(r.dragStartPredicate)?r.dragStartPredicate:fe.defaultStartPredicate,this._startPredicateState=0,this._startPredicateResult=void 0,this._hBlockedIndex=null,this._hX1=0,this._hX2=0,this._hY1=0,this._hY2=0,this._reset(),this._preStartCheck=this._preStartCheck.bind(this),this._preEndCheck=this._preEndCheck.bind(this),this._onScroll=this._onScroll.bind(this),this._prepareMove=this._prepareMove.bind(this),this._applyMove=this._applyMove.bind(this),this._prepareScroll=this._prepareScroll.bind(this),this._applyScroll=this._applyScroll.bind(this),this._checkOverlap=this._checkOverlap.bind(this);var n=r.dragSortHeuristics.sortInterval;this._checkOverlapDebounce=X(this._checkOverlap,n),this._dragger=new E(t,r.dragCssProps),this._dragger.on("start",this._preStartCheck),this._dragger.on("move",this._preStartCheck),this._dragger.on("cancel",this._preEndCheck),this._dragger.on("end",this._preEndCheck)}function me(e,t){return e.left+e.width<=t.left||t.left+t.width<=e.left||e.top+e.height<=t.top||t.top+t.height<=e.top?0:(Math.min(e.left+e.width,t.left+t.width)-Math.max(e.left,t.left))*(Math.min(e.top+e.height,t.top+t.height)-Math.max(e.top,t.top))/(Math.min(e.width,t.width)*Math.min(e.height,t.height))*100}function ge(e){this._item=e,this._animate=new d,this._element=null,this._className="",this._didMigrate=!1,this._resetAfterLayout=!1,this._currentLeft=0,this._currentTop=0,this._nextLeft=0,this._nextTop=0,this._setupAnimation=this._setupAnimation.bind(this),this._startAnimation=this._startAnimation.bind(this),this._onLayoutStart=this._onLayoutStart.bind(this),this._onLayoutEnd=this._onLayoutEnd.bind(this),this._onReleaseEnd=this._onReleaseEnd.bind(this),this._onMigrate=this._onMigrate.bind(this)}function _e(){this._queue=[],this._isDestroyed=!1}function ye(e){this._item=e,this._isActive=!1,this._isDestroyed=!1,this._isInterrupted=!1,this._currentStyles={},this._targetStyles={},this._currentLeft=0,this._currentTop=0,this._offsetLeft=0,this._offsetTop=0,this._skipNextAnimation=!1,this._animateOptions={onFinish:this._finish.bind(this)},this._queue=new _e,this._setupAnimation=this._setupAnimation.bind(this),this._startAnimation=this._startAnimation.bind(this)}fe.defaultStartPredicate=function(e,t,i){var r=e._drag,n=r._startPredicateData||r._setupStartPredicate(i);if(!t.isFinal)return!(!n.handleElement&&(n.handleElement=r._getStartPredicateHandle(t),!n.handleElement))&&(n.delay&&(n.event=t,n.delayTimer||(n.delayTimer=window.setTimeout((function(){n.delay=0,r._resolveStartPredicate(n.event)&&(r._forceResolveStartPredicate(n.event),r._resetStartPredicate())}),n.delay))),r._resolveStartPredicate(t));r._finishStartPredicate(t)},fe.defaultSortPredicate=(ie={},re={},ne={},se=[],function(e,t){var i=e._drag,r=i._getGrid(),n=t&&"number"==typeof t.threshold?t.threshold:50,s=t&&"swap"===t.action?"swap":"move";ie.width=e._width,ie.height=e._height,ie.left=i._elementClientX,ie.top=i._elementClientY;var o=function(e,t,i){var r,n,s,o,a=null,l=t._settings.dragSort,h=-1;if(!0===l?(se[0]=t,n=se):n=l.call(t,e),!Array.isArray(n))return a;for(o=0;o<n.length;o++)(s=n[o])._isDestroyed||(s._updateBoundingRect(),re.width=s._width,re.height=s._height,re.left=s._left,re.top=s._top,(r=me(ie,re))>i&&r>h&&(h=r,a=s));return se.length=0,a}(e,r,n);if(!o)return!1;var a,l,h,u,c,d=0,p=0,f=-1;for(o===r?(ie.left=i._gridX+e._marginLeft,ie.top=i._gridY+e._marginTop):(o._updateBorders(1,0,1,0),d=o._left+o._borderLeft,p=o._top+o._borderTop),c=0;c<o._items.length;c++)(h=o._items[c])._isActive&&h!==e&&(l=!0,re.width=h._width,re.height=h._height,re.left=h._left+h._marginLeft+d,re.top=h._top+h._marginTop+p,(u=me(ie,re))>f&&(a=c,f=u));return f<n&&e.getGrid()!==o&&(a=l?-1:0,f=1/0),f>=n&&(ne.grid=o,ne.index=a,ne.action=s,ne)}),fe.prototype.stop=function(){var e=this._item,t=e._element,i=this._getGrid();return this._isActive?this._isMigrating?(this._finishMigration(),this):(V(e._id),z(e._id),this._unbindScrollListeners(),this._checkOverlapDebounce("cancel"),t.parentNode!==i._element&&(i._element.appendChild(t),t.style[r]=de(this._gridX,this._gridY)),pe(t,i._settings.itemDraggingClass),this._reset(),this):this},fe.prototype.destroy=function(){return this._isDestroyed||(this.stop(),this._dragger.destroy(),this._isDestroyed=!0),this},fe.prototype._getGrid=function(){return e[this._gridId]||null},fe.prototype._reset=function(){this._isActive=!1,this._container=null,this._containingBlock=null,this._dragEvent=null,this._scrollEvent=null,this._scrollers=[],this._left=0,this._top=0,this._gridX=0,this._gridY=0,this._elementClientX=0,this._elementClientY=0,this._containerDiffX=0,this._containerDiffY=0},fe.prototype._bindScrollListeners=function(){var e,t,i=this._getGrid()._element,r=this._container,n=this._scrollers;if(n.length=0,te(this._item._element,!1,n),r!==i)for(te(i,!0,e=[]),t=0;t<e.length;t++)n.indexOf(e[t])<0&&n.push(e[t]);for(t=0;t<n.length;t++)n[t].addEventListener("scroll",this._onScroll)},fe.prototype._unbindScrollListeners=function(){var e,t=this._scrollers;for(e=0;e<t.length;e++)t[e].removeEventListener("scroll",this._onScroll);t.length=0},fe.prototype._setupStartPredicate=function(e){var t=e||this._getGrid()._settings.dragStartPredicate||0;return this._startPredicateData={distance:Math.abs(t.distance)||0,delay:Math.max(t.delay,0)||0,handle:"string"==typeof t.handle&&t.handle}},fe.prototype._getStartPredicateHandle=function(e){var t=this._startPredicateData,i=this._item._element,r=i;if(!t.handle)return r;for(r=e.target;r&&!R(r,t.handle);)r=r!==i?r.parentElement:null;return r||null},fe.prototype._resolveStartPredicate=function(e){var t=this._startPredicateData;if(!(e.distance<t.distance||t.delay)){var i=t.handleElement.getBoundingClientRect(),r=i.left+(window.pageXOffset||0),n=i.top+(window.pageYOffset||0),s=i.width,o=i.height;return this._resetStartPredicate(),s&&o&&e.pageX>=r&&e.pageX<r+s&&e.pageY>=n&&e.pageY<n+o}},fe.prototype._forceResolveStartPredicate=function(e){this._isDestroyed||1!==this._startPredicateState||(this._startPredicateState=2,this._onStart(e))},fe.prototype._finishStartPredicate=function(e){var t=this._item._element,i=Math.abs(e.deltaX)<2&&Math.abs(e.deltaY)<2&&e.deltaTime<200;this._resetStartPredicate(),i&&function(e){if("a"===e.tagName.toLowerCase()){var t=e.getAttribute("href");if(t){var i=e.getAttribute("target");i&&"_self"!==i?window.open(t,i):window.location.href=t}}}(t)},fe.prototype._resetHeuristics=function(e){this._hBlockedIndex=null,this._hX1=this._hX2=e.clientX,this._hY1=this._hY2=e.clientY},fe.prototype._checkHeuristics=function(e){var t=this._getGrid()._settings.dragSortHeuristics,i=t.minDragDistance;if(i<=0)return this._hBlockedIndex=null,!0;var r=e.clientX,n=e.clientY,s=r-this._hX2,o=n-this._hY2,a=i>3&&t.minBounceBackAngle>0;if(a||(this._hBlockedIndex=null),Math.abs(s)>i||Math.abs(o)>i){if(a){var l=Math.atan2(s,o),h=Math.atan2(this._hX2-this._hX1,this._hY2-this._hY1),u=Math.atan2(Math.sin(l-h),Math.cos(l-h));Math.abs(u)>t.minBounceBackAngle&&(this._hBlockedIndex=null)}return this._hX1=this._hX2,this._hY1=this._hY2,this._hX2=r,this._hY2=n,!0}return!1},fe.prototype._resetStartPredicate=function(){var e=this._startPredicateData;e&&(e.delayTimer&&(e.delayTimer=window.clearTimeout(e.delayTimer)),this._startPredicateData=null)},fe.prototype._checkOverlap=function(){if(this._isActive){var e,t,i,r,n,s,o,a=this._item,l=this._getGrid()._settings;(e=u(l.dragSortPredicate)?l.dragSortPredicate(a,this._dragEvent):fe.defaultSortPredicate(a,l.dragSortPredicate))&&"number"==typeof e.index&&(o=(t=a.getGrid())!==(r=e.grid||t),i=t._items.indexOf(a),n=q(r._items,e.index,o),s="swap"===e.action?"swap":"move",(o||n!==this._hBlockedIndex)&&(o?(this._hBlockedIndex=null,t._hasListeners("beforeSend")&&t._emit("beforeSend",{item:a,fromGrid:t,fromIndex:i,toGrid:r,toIndex:n}),r._hasListeners("beforeReceive")&&r._emit("beforeReceive",{item:a,fromGrid:t,fromIndex:i,toGrid:r,toIndex:n}),a._gridId=r._id,this._isMigrating=a._gridId!==this._gridId,t._items.splice(i,1),N(r._items,a,n),a._sortData=null,t._hasListeners("send")&&t._emit("send",{item:a,fromGrid:t,fromIndex:i,toGrid:r,toIndex:n}),r._hasListeners("receive")&&r._emit("receive",{item:a,fromGrid:t,fromIndex:i,toGrid:r,toIndex:n}),t.layout(),r.layout()):i!==n&&(this._hBlockedIndex=i,("swap"===s?F:H)(t._items,i,n),t._hasListeners("move")&&t._emit("move",{item:a,fromIndex:i,toIndex:n,action:s}),t.layout())))}},fe.prototype._finishMigration=function(){var e,t,i=this._item,n=i._release,s=i._element,o=i._isActive,a=i.getGrid(),l=a._element,h=a._settings,u=h.dragContainer||l,d=this._getGrid()._settings,p=s.parentNode;this._isMigrating=!1,this.destroy(),pe(s,d.itemClass),pe(s,d.itemVisibleClass),pe(s,d.itemHiddenClass),I(s,h.itemClass),I(s,o?h.itemVisibleClass:h.itemHiddenClass),u!==p&&(u.appendChild(s),t=$(p,u,!0),(e=ce(s)).x-=t.left,e.y-=t.top),i._refreshDimensions(),i._refreshSortData(),t=$(u,l,!0),n._containerDiffX=t.left,n._containerDiffY=t.top,i._drag=h.dragEnabled?new fe(i):null,u!==p&&(s.style[r]=de(e.x,e.y)),i._child.removeAttribute("style"),c(i._child,o?h.visibleStyles:h.hiddenStyles),n.start()},fe.prototype._preStartCheck=function(e){0===this._startPredicateState&&(this._startPredicateState=1),1===this._startPredicateState?(this._startPredicateResult=this._startPredicate(this._item,e),!0===this._startPredicateResult?(this._startPredicateState=2,this._onStart(e)):!1===this._startPredicateResult&&(this._startPredicateState=3)):2===this._startPredicateState&&this._isActive&&this._onMove(e)},fe.prototype._preEndCheck=function(e){var t=2===this._startPredicateState;this._startPredicate(this._item,e),this._startPredicateState=0,t&&this._isActive&&this._onEnd(e)},fe.prototype._onStart=function(e){var t=this._item;if(t._isActive){var i,n=t._element,s=this._getGrid(),o=s._settings,a=t._release,l=t._migrate,h=s._element,u=o.dragContainer||h,c=Q(u,!0),d=ce(n),p=d.x,f=d.y,m=n.getBoundingClientRect(),g=u!==h;this._resetHeuristics(e),g&&(i=$(c,h)),t.isPositioning()&&t._layout.stop(!0,{transform:de(p,f)}),l._isActive&&(p-=l._containerDiffX,f-=l._containerDiffY,l.stop(!0,{transform:de(p,f)})),t.isReleasing()&&a._reset(),this._isActive=!0,this._dragEvent=e,this._container=u,this._containingBlock=c,this._elementClientX=m.left,this._elementClientY=m.top,this._left=this._gridX=p,this._top=this._gridY=f,o.dragPlaceholder.enabled&&t._dragPlaceholder.create(),s._emit("dragInit",t,e),g&&(this._containerDiffX=i.left,this._containerDiffY=i.top,n.parentNode===u?(this._gridX=p-this._containerDiffX,this._gridY=f-this._containerDiffY):(this._left=p+this._containerDiffX,this._top=f+this._containerDiffY,u.appendChild(n),n.style[r]=de(this._left,this._top))),I(n,o.itemDraggingClass),this._bindScrollListeners(),s._emit("dragStart",t,e)}},fe.prototype._onMove=function(e){var t=this._item;if(t._isActive){var i,r,n,s=this._getGrid()._settings.dragAxis;if("y"!==s){var o=e.clientX-this._dragEvent.clientX;this._left+=o,this._gridX+=o,this._elementClientX+=o}if("x"!==s){var a=e.clientY-this._dragEvent.clientY;this._top+=a,this._gridY+=a,this._elementClientY+=a}this._dragEvent=e,i=t._id,r=this._prepareMove,n=this._applyMove,k.add(i+"move",r,n,!0)}else this.stop()},fe.prototype._prepareMove=function(){this._item._isActive&&this._getGrid()._settings.dragSort&&this._checkHeuristics(this._dragEvent)&&this._checkOverlapDebounce()},fe.prototype._applyMove=function(){var e=this._item;e._isActive&&(e._element.style[r]=de(this._left,this._top),this._getGrid()._emit("dragMove",e,this._dragEvent))},fe.prototype._onScroll=function(e){var t,i,r,n=this._item;n._isActive?(this._scrollEvent=e,t=n._id,i=this._prepareScroll,r=this._applyScroll,k.add(t+"scroll",i,r,!0)):this.stop()},fe.prototype._prepareScroll=function(){var e=this._item;if(e._isActive){var t,i=e._element,r=this._getGrid(),n=r._settings,s=n.dragAxis,o=r._element,a=i.getBoundingClientRect(),l=this._elementClientX-a.left,h=this._elementClientY-a.top;this._container!==o&&(t=$(this._containingBlock,o),this._containerDiffX=t.left,this._containerDiffY=t.top),"y"!==s&&(this._left+=l,this._gridX=this._left-this._containerDiffX),"x"!==s&&(this._top+=h,this._gridY=this._top-this._containerDiffY),n.dragSort&&this._checkOverlapDebounce()}},fe.prototype._applyScroll=function(){var e=this._item;e._isActive&&(e._element.style[r]=de(this._left,this._top),this._getGrid()._emit("dragScroll",e,this._scrollEvent))},fe.prototype._onEnd=function(e){var t=this._item,i=t._element,r=this._getGrid(),n=r._settings,s=t._release;t._isActive?(V(t._id),z(t._id),n.dragSort&&this._checkOverlapDebounce("finish"),this._unbindScrollListeners(),s._containerDiffX=this._containerDiffX,s._containerDiffY=this._containerDiffY,this._reset(),pe(i,n.itemDraggingClass),r._emit("dragEnd",t,e),this._isMigrating?this._finishMigration():s.start()):this.stop()},ge.prototype._onLayoutStart=function(){var e=this._item,t=e.getGrid(),i=t._items.indexOf(e),r=t._layout.slots[2*i],n=t._layout.slots[2*i+1];if(this._didMigrate||e._left!==r||e._top!==n){var s,o,a;if(r+=e._marginLeft,n+=e._marginTop,!(t._settings.dragPlaceholder.duration>0)||this._didMigrate){L(e._id);var l={transform:de(r,n)};return this._animate.isAnimating()?this._animate.stop(l):c(this._element,l),void(this._didMigrate&&(t.getElement().appendChild(this._element),this._didMigrate=!1))}this._nextLeft=r,this._nextTop=n,s=e._id,o=this._setupAnimation,a=this._startAnimation,k.add(s+"placeholder",o,a)}},ge.prototype._setupAnimation=function(){if(this.isActive()){var e=ce(this._element);this._currentLeft=e.x,this._currentTop=e.y}},ge.prototype._startAnimation=function(){if(this.isActive()){var e=this._animate,t=this._currentLeft,i=this._currentTop,r=this._nextLeft,n=this._nextTop,s={transform:de(r,n)};if(t!==r||i!==n){var o=this._item.getGrid()._settings.dragPlaceholder,a={transform:de(t,i)};e.start(a,s,{duration:o.duration,easing:o.easing,onFinish:this._onLayoutEnd})}else e.isAnimating()&&e.stop(s)}},ge.prototype._onLayoutEnd=function(){this._resetAfterLayout&&this.reset()},ge.prototype._onReleaseEnd=function(e){if(e._id===this._item._id){if(!this._animate.isAnimating())return void this.reset();this._resetAfterLayout=!0}},ge.prototype._onMigrate=function(e){if(e.item===this._item){var t=this._item.getGrid(),i=e.toGrid;t.off("dragReleaseEnd",this._onReleaseEnd),t.off("layoutStart",this._onLayoutStart),t.off("beforeSend",this._onMigrate),i.on("dragReleaseEnd",this._onReleaseEnd),i.on("layoutStart",this._onLayoutStart),i.on("beforeSend",this._onMigrate),this._didMigrate=!0}},ge.prototype.create=function(){if(this.isActive())this._resetAfterLayout=!1;else{var e,t=this._item,i=t.getGrid(),r=i._settings,n=this._animate;e=u(r.dragPlaceholder.createElement)?r.dragPlaceholder.createElement(t):window.document.createElement("div"),this._element=e,n._element=e,this._className=r.itemPlaceholderClass||"",this._className&&I(e,this._className);var s=t._left+t._marginLeft,o=t._top+t._marginTop;c(e,{display:"block",position:"absolute",left:"0",top:"0",width:t._width+"px",height:t._height+"px",transform:de(s,o)}),i.on("layoutStart",this._onLayoutStart),i.on("dragReleaseEnd",this._onReleaseEnd),i.on("beforeSend",this._onMigrate),u(r.dragPlaceholder.onCreate)&&r.dragPlaceholder.onCreate(t,e),i.getElement().appendChild(e)}},ge.prototype.reset=function(){if(this.isActive()){var e=this._element,t=this._item,i=t.getGrid(),r=i._settings,n=this._animate;this._resetAfterLayout=!1,L(t._id),n.stop(),n._element=null,i.off("dragReleaseEnd",this._onReleaseEnd),i.off("layoutStart",this._onLayoutStart),i.off("beforeSend",this._onMigrate),this._className&&(pe(e,this._className),this._className=""),e.parentNode.removeChild(e),this._element=null,u(r.dragPlaceholder.onRemove)&&r.dragPlaceholder.onRemove(t,e)}},ge.prototype.updateDimensions=function(e,t){this.isActive()&&c(this._element,{width:e+"px",height:t+"px"})},ge.prototype.isActive=function(){return!!this._element},ge.prototype.destroy=function(){this.reset(),this._animate.destroy(),this._item=this._animate=null},_e.prototype.add=function(e){return this._isDestroyed||this._queue.push(e),this},_e.prototype.flush=function(e,t){if(this._isDestroyed)return this;var i,r=this._queue,n=r.length;if(!n)return this;var s=1===n,o=s?r[0]:r.slice(0);if(r.length=0,s)return o(e,t),this;for(i=0;i<n&&(o[i](e,t),!this._isDestroyed);i++);return this},_e.prototype.destroy=function(){return this._isDestroyed||(this._isDestroyed=!0,this._queue.length=0),this},ye.prototype.start=function(e,t){if(!this._isDestroyed){var i,r,n,s,o=this._item,a=o._element,l=o._release,h=o.getGrid()._settings,d=this._isActive,p=l._isActive&&!1===l._isPositioningStarted,f=p?h.dragReleaseDuration:h.layoutDuration,m=p?h.dragReleaseEasing:h.layoutEasing,g=!e&&!this._skipNextAnimation&&f>0;return d&&this._queue.flush(!0,o),p&&(l._isPositioningStarted=!0),u(t)&&this._queue.add(t),g?(this._isActive=!0,this._animateOptions.easing=m,this._animateOptions.duration=f,this._isInterrupted=d,r=o._id,n=this._setupAnimation,s=this._startAnimation,k.add(r+"layout",n,s),this):(this._updateOffsets(),this._updateTargetStyles(),i=o._animate.isAnimating(),this.stop(!1,this._targetStyles),!i&&c(a,this._targetStyles),this._skipNextAnimation=!1,this._finish())}},ye.prototype.stop=function(e,t){if(this._isDestroyed||!this._isActive)return this;var i,r=this._item;return i=r._id,k.cancel(i+"layout"),r._animate.stop(t),pe(r._element,r.getGrid()._settings.itemPositioningClass),this._isActive=!1,e&&this._queue.flush(!0,r),this},ye.prototype.destroy=function(){return this._isDestroyed||(this.stop(!0,{}),this._queue.destroy(),this._item=this._currentStyles=this._targetStyles=this._animateOptions=null,this._isDestroyed=!0),this},ye.prototype._updateOffsets=function(){if(!this._isDestroyed){var e=this._item,t=e._migrate,i=e._release;this._offsetLeft=i._isActive?i._containerDiffX:t._isActive?t._containerDiffX:0,this._offsetTop=i._isActive?i._containerDiffY:t._isActive?t._containerDiffY:0}},ye.prototype._updateTargetStyles=function(){this._isDestroyed||(this._targetStyles.transform=de(this._item._left+this._offsetLeft,this._item._top+this._offsetTop))},ye.prototype._finish=function(){if(!this._isDestroyed){var e=this._item,t=e._migrate,i=e._release;this._isActive&&(this._isActive=!1,pe(e._element,e.getGrid()._settings.itemPositioningClass)),i._isActive&&i.stop(),t._isActive&&t.stop(),this._queue.flush(!1,e)}},ye.prototype._setupAnimation=function(){var e=ce(this._item._element);this._currentLeft=e.x,this._currentTop=e.y},ye.prototype._startAnimation=function(){var e=this._item,t=e.getGrid()._settings;if(this._updateOffsets(),this._updateTargetStyles(),e._left===this._currentLeft-this._offsetLeft&&e._top===this._currentTop-this._offsetTop)return this._isInterrupted&&this.stop(!1,this._targetStyles),this._isActive=!1,void this._finish();this._isInterrupted||I(e._element,t.itemPositioningClass),this._currentStyles.transform=de(this._currentLeft,this._currentTop),e._animate.start(this._currentStyles,this._targetStyles,this._animateOptions)};var ve={};function be(e){this._item=e,this._isActive=!1,this._isDestroyed=!1,this._container=!1,this._containerDiffX=0,this._containerDiffY=0}be.prototype.start=function(e,t,i){if(this._isDestroyed)return this;var n,s,o,a,l,h,u,d,p=this._item,f=p._element,m=p.isVisible(),g=p.getGrid(),_=g._settings,y=e._settings,v=e._element,b=e._items,w=g._items.indexOf(p),C=i||window.document.body;if("number"==typeof t)n=q(b,t,!0);else{if(!(s=e._getItem(t)))return this;n=b.indexOf(s)}return(p.isPositioning()||this._isActive||p.isReleasing())&&(u=(h=ce(f)).x,d=h.y),p.isPositioning()&&p._layout.stop(!0,{transform:de(u,d)}),this._isActive&&(u-=this._containerDiffX,d-=this._containerDiffY,this.stop(!0,{transform:de(u,d)})),p.isReleasing()&&(u-=p._release._containerDiffX,d-=p._release._containerDiffY,p._release.stop(!0,{transform:de(u,d)})),p._visibility._stopAnimation(),p._drag&&p._drag.destroy(),p._visibility._queue.flush(!0,p),g._hasListeners("beforeSend")&&g._emit("beforeSend",{item:p,fromGrid:g,fromIndex:w,toGrid:e,toIndex:n}),e._hasListeners("beforeReceive")&&e._emit("beforeReceive",{item:p,fromGrid:g,fromIndex:w,toGrid:e,toIndex:n}),pe(f,_.itemClass),pe(f,_.itemVisibleClass),pe(f,_.itemHiddenClass),I(f,y.itemClass),I(f,m?y.itemVisibleClass:y.itemHiddenClass),g._items.splice(w,1),N(b,p,n),p._gridId=e._id,C!==(o=f.parentNode)&&(C.appendChild(f),a=$(C,o,!0),h||(u=(h=ce(f)).x,d=h.y),f.style[r]=de(u+a.left,d+a.top)),p._child.removeAttribute("style"),c(p._child,m?y.visibleStyles:y.hiddenStyles),f.style.display=m?"block":"hidden",l=$(C,v,!0),p._refreshDimensions(),p._refreshSortData(),p._drag=y.dragEnabled?new fe(p):null,this._isActive=!0,this._container=C,this._containerDiffX=l.left,this._containerDiffY=l.top,g._hasListeners("send")&&g._emit("send",{item:p,fromGrid:g,fromIndex:w,toGrid:e,toIndex:n}),e._hasListeners("receive")&&e._emit("receive",{item:p,fromGrid:g,fromIndex:w,toGrid:e,toIndex:n}),this},be.prototype.stop=function(e,t){if(this._isDestroyed||!this._isActive)return this;var i,r=this._item,n=r._element,s=r.getGrid()._element;return this._container!==s&&(t||(e?(i=ce(n),ve.transform=de(i.x-this._containerDiffX,i.y-this._containerDiffY)):ve.transform=de(r._left,r._top),t=ve),s.appendChild(n),c(n,t)),this._isActive=!1,this._container=null,this._containerDiffX=0,this._containerDiffY=0,this},be.prototype.destroy=function(){return this._isDestroyed||(this.stop(!0),this._item=null,this._isDestroyed=!0),this};var we={};function Ce(e){this._item=e,this._isActive=!1,this._isDestroyed=!1,this._isPositioningStarted=!1,this._containerDiffX=0,this._containerDiffY=0}function Se(e){var t=e._isActive,i=e._element,r=e.getGrid()._settings;this._item=e,this._isDestroyed=!1,this._isHidden=!t,this._isHiding=!1,this._isShowing=!1,this._queue=new _e,this._finishShow=this._finishShow.bind(this),this._finishHide=this._finishHide.bind(this),i.style.display=t?"block":"none",I(i,t?r.itemVisibleClass:r.itemHiddenClass),c(e._child,t?r.visibleStyles:r.hiddenStyles)}Ce.prototype.start=function(){if(this._isDestroyed||this._isActive)return this;var e=this._item,t=e.getGrid();return this._isActive=!0,I(e._element,t._settings.itemReleasingClass),t._emit("dragReleaseStart",e),e._layout.start(!1),this},Ce.prototype.stop=function(e,t){if(this._isDestroyed||!this._isActive)return this;var i,r=this._item,n=r._element,s=r.getGrid(),o=s._element;return this._reset(),n.parentNode!==o&&(t||(e?(i=ce(n),we.transform=de(i.x-this._containerDiffX,i.y-this._containerDiffY)):we.transform=de(r._left,r._top),t=we),o.appendChild(n),c(n,t)),e||s._emit("dragReleaseEnd",r),this},Ce.prototype.destroy=function(){return this._isDestroyed||(this.stop(!0),this._item=null,this._isDestroyed=!0),this},Ce.prototype._reset=function(){if(!this._isDestroyed){var e=this._item;this._isActive=!1,this._isPositioningStarted=!1,this._containerDiffX=0,this._containerDiffY=0,pe(e._element,e.getGrid()._settings.itemReleasingClass)}},Se.prototype.show=function(e,t){if(this._isDestroyed)return this;var i=this._item,r=i._element,n=this._queue,s=u(t)?t:null,o=i.getGrid()._settings;return this._isShowing||this._isHidden?this._isShowing&&!e?(s&&n.add(s),this):(this._isShowing||(n.flush(!0,i),pe(r,o.itemHiddenClass),I(r,o.itemVisibleClass),this._isHiding||(r.style.display="block")),s&&n.add(s),i._isActive=this._isShowing=!0,this._isHiding=this._isHidden=!1,this._startAnimation(!0,e,this._finishShow),this):(s&&s(!1,i),this)},Se.prototype.hide=function(e,t){if(this._isDestroyed)return this;var i=this._item,r=i._element,n=this._queue,s=u(t)?t:null,o=i.getGrid()._settings;return!this._isHiding&&this._isHidden?(s&&s(!1,i),this):this._isHiding&&!e?(s&&n.add(s),this):(this._isHiding||(n.flush(!0,i),I(r,o.itemHiddenClass),pe(r,o.itemVisibleClass)),s&&n.add(s),this._isHidden=this._isHiding=!0,i._isActive=this._isShowing=!1,this._startAnimation(!1,e,this._finishHide),this)},Se.prototype.destroy=function(){if(this._isDestroyed)return this;var e=this._item,t=e._element,i=e.getGrid(),r=this._queue,n=i._settings;return this._stopAnimation({}),r.flush(!0,e).destroy(),pe(t,n.itemVisibleClass),pe(t,n.itemHiddenClass),this._item=null,this._isHiding=this._isShowing=!1,this._isDestroyed=this._isHidden=!0,this},Se.prototype._startAnimation=function(e,t,i){if(!this._isDestroyed){var r,n=this._item,s=n.getGrid()._settings,o=e?s.visibleStyles:s.hiddenStyles,l=parseInt(e?s.showDuration:s.hideDuration)||0,u=(e?s.showEasing:s.hideEasing)||"ease",d=t||l<=0;if(o){if(O(n._id),d)return n._animateChild.isAnimating()?n._animateChild.stop(o):c(n._child,o),void(i&&i());var p,f,m;p=n._id,f=function(){r=function(e,t){var i={};for(var r in t)i[r]=a(e,h(r));return i}(n._child,o)},m=function(){n._animateChild.start(r,o,{duration:l,easing:u,onFinish:i})},k.add(p+"visibility",f,m)}else i&&i()}},Se.prototype._stopAnimation=function(e){if(!this._isDestroyed){var t=this._item;O(t._id),t._animateChild.stop(e)}},Se.prototype._finishShow=function(){this._isHidden||(this._isShowing=!1,this._queue.flush(!1,this._item))};var Te={};Se.prototype._finishHide=function(){if(this._isHidden){var e=this._item;this._isHiding=!1,Te.transform=de(0,0),e._layout.stop(!0,Te),e._element.style.display="none",this._queue.flush(!1,e)}};var Ae,De,Pe,Ee,xe=0;function ke(){return++xe}function Oe(e,t,i){var n=e._settings;this._id=ke(),this._gridId=e._id,this._isDestroyed=!1,this._left=0,this._top=0,this._element=t,this._child=t.children[0],t.parentNode!==e._element&&e._element.appendChild(t),I(t,n.itemClass),"boolean"!=typeof i&&(i="none"!==a(t,"display")),this._isActive=i,t.style.left="0",t.style.top="0",t.style[r]=de(0,0),this._animate=new d(t),this._animateChild=new d(this._child),this._visibility=new Se(this),this._layout=new ye(this),this._migrate=new be(this),this._release=new Ce(this),this._dragPlaceholder=new ge(this),this._drag=n.dragEnabled?new fe(this):null,this._refreshDimensions(),this._refreshSortData()}function Ve(){this._slots=[],this._slotSizes=[],this._freeSlots=[],this._newSlots=[],this._rectItem={},this._rectStore=[],this._rectId=0,this._layout={slots:null,setWidth:!1,setHeight:!1,width:!1,height:!1},this._sortRectsLeftTop=this._sortRectsLeftTop.bind(this),this._sortRectsTopLeft=this._sortRectsTopLeft.bind(this)}function ze(e){var t=Object.prototype.toString.call(e);return"[object HTMLCollection]"===t||"[object NodeList]"===t}Oe.prototype.getGrid=function(){return e[this._gridId]},Oe.prototype.getElement=function(){return this._element},Oe.prototype.getWidth=function(){return this._width},Oe.prototype.getHeight=function(){return this._height},Oe.prototype.getMargin=function(){return{left:this._marginLeft,right:this._marginRight,top:this._marginTop,bottom:this._marginBottom}},Oe.prototype.getPosition=function(){return{left:this._left,top:this._top}},Oe.prototype.isActive=function(){return this._isActive},Oe.prototype.isVisible=function(){return!!this._visibility&&!this._visibility._isHidden},Oe.prototype.isShowing=function(){return!(!this._visibility||!this._visibility._isShowing)},Oe.prototype.isHiding=function(){return!(!this._visibility||!this._visibility._isHiding)},Oe.prototype.isPositioning=function(){return!(!this._layout||!this._layout._isActive)},Oe.prototype.isDragging=function(){return!(!this._drag||!this._drag._isActive)},Oe.prototype.isReleasing=function(){return!(!this._release||!this._release._isActive)},Oe.prototype.isDestroyed=function(){return this._isDestroyed},Oe.prototype._refreshDimensions=function(){if(!this._isDestroyed&&!this._visibility._isHidden){var e=this._element,t=this._dragPlaceholder,i=e.getBoundingClientRect();this._width=i.width,this._height=i.height,this._marginLeft=Math.max(0,U(e,"margin-left")),this._marginRight=Math.max(0,U(e,"margin-right")),this._marginTop=Math.max(0,U(e,"margin-top")),this._marginBottom=Math.max(0,U(e,"margin-bottom")),t&&t.updateDimensions(this._width,this._height)}},Oe.prototype._refreshSortData=function(){if(!this._isDestroyed){var e,t=this._sortData={},i=this.getGrid()._settings.sortData;for(e in i)t[e]=i[e](this,this._element)}},Oe.prototype._destroy=function(e){if(!this._isDestroyed){var t=this._element,i=this.getGrid(),r=i._settings,n=i._items.indexOf(this);this._release.destroy(),this._migrate.destroy(),this._layout.destroy(),this._visibility.destroy(),this._animate.destroy(),this._animateChild.destroy(),this._dragPlaceholder.destroy(),this._drag&&this._drag.destroy(),t.removeAttribute("style"),this._child.removeAttribute("style"),pe(t,r.itemClass),n>-1&&i._items.splice(n,1),e&&t.parentNode.removeChild(t),this._isActive=!1,this._isDestroyed=!0}},Ve.prototype.getLayout=function(e,t,i,r,n){var s,o=this._layout,a=!(!n||!n.fillGaps),l=!(!n||!n.horizontal),h=!(!n||!n.alignRight),u=!(!n||!n.alignBottom),c=!(!n||!n.rounding),d=this._slotSizes;if(o.slots=r||this._slots,o.width=l?0:c?Math.round(t):t,o.height=l?c?Math.round(i):i:0,o.setWidth=l,o.setHeight=!l,o.slots.length=0,d.length=0,!e.length)return o;for(s=0;s<e.length;s++)this._addSlot(e[s],l,a,c,h||u);if(h)for(s=0;s<o.slots.length;s+=2)o.slots[s]=o.width-(o.slots[s]+d[s]);if(u)for(s=1;s<o.slots.length;s+=2)o.slots[s]=o.height-(o.slots[s]+d[s]);return d.length=0,this._freeSlots.length=0,this._newSlots.length=0,this._rectId=0,o},Ve.prototype._addSlot=(Ee={},function(e,t,i,r,n){var s,o,a,l,h,u,c=this._layout,d=this._freeSlots,p=this._newSlots;for(p.length=0,Ee.left=null,Ee.top=null,Ee.width=e._width+e._marginLeft+e._marginRight,Ee.height=e._height+e._marginTop+e._marginBottom,r&&(Ee.width=Math.round(Ee.width),Ee.height=Math.round(Ee.height)),h=0;h<d.length;h++)if((o=d[h])&&(s=this._getRect(o),Ee.width<=s.width+.001&&Ee.height<=s.height+.001)){Ee.left=s.left,Ee.top=s.top;break}for(null===Ee.left&&(Ee.left=t?c.width:0,Ee.top=t?0:c.height,i||(l=!0)),!t&&Ee.top+Ee.height>c.height&&(Ee.left>0&&p.push(this._addRect(0,c.height,Ee.left,1/0)),Ee.left+Ee.width<c.width&&p.push(this._addRect(Ee.left+Ee.width,c.height,c.width-Ee.left-Ee.width,1/0)),c.height=Ee.top+Ee.height),t&&Ee.left+Ee.width>c.width&&(Ee.top>0&&p.push(this._addRect(c.width,0,1/0,Ee.top)),Ee.top+Ee.height<c.height&&p.push(this._addRect(c.width,Ee.top+Ee.height,1/0,c.height-Ee.top-Ee.height)),c.width=Ee.left+Ee.width),h=i?0:l?d.length:h;h<d.length;h++)if(o=d[h])for(s=this._getRect(o),a=this._splitRect(s,Ee),u=0;u<a.length;u++)o=a[u],(s=this._getRect(o)).width>.49&&s.height>.49&&(!t&&s.top<c.height||t&&s.left<c.width)&&p.push(o);p.length&&this._purgeRects(p).sort(t?this._sortRectsLeftTop:this._sortRectsTopLeft),t?c.width=Math.max(c.width,Ee.left+Ee.width):c.height=Math.max(c.height,Ee.top+Ee.height),c.slots.push(Ee.left,Ee.top),n&&this._slotSizes.push(Ee.width,Ee.height),this._freeSlots=p,this._newSlots=d}),Ve.prototype._addRect=function(e,t,i,r){var n=++this._rectId,s=this._rectStore;return s[n]=e||0,s[++this._rectId]=t||0,s[++this._rectId]=i||0,s[++this._rectId]=r||0,n},Ve.prototype._getRect=function(e,t){var i=t||this._rectItem,r=this._rectStore;return i.left=r[e]||0,i.top=r[++e]||0,i.width=r[++e]||0,i.height=r[++e]||0,i},Ve.prototype._splitRect=(Pe=[],function(e,t){return Pe.length=0,this._doRectsOverlap(e,t)?(e.left<t.left&&Pe.push(this._addRect(e.left,e.top,t.left-e.left,e.height)),e.left+e.width>t.left+t.width&&Pe.push(this._addRect(t.left+t.width,e.top,e.left+e.width-(t.left+t.width),e.height)),e.top<t.top&&Pe.push(this._addRect(e.left,e.top,e.width,t.top-e.top)),e.top+e.height>t.top+t.height&&Pe.push(this._addRect(e.left,t.top+t.height,e.width,e.top+e.height-(t.top+t.height))),Pe):(Pe.push(this._addRect(e.left,e.top,e.width,e.height)),Pe)}),Ve.prototype._doRectsOverlap=function(e,t){return!(e.left+e.width<=t.left||t.left+t.width<=e.left||e.top+e.height<=t.top||t.top+t.height<=e.top)},Ve.prototype._isRectWithinRect=function(e,t){return e.left>=t.left&&e.top>=t.top&&e.left+e.width<=t.left+t.width&&e.top+e.height<=t.top+t.height},Ve.prototype._purgeRects=(Ae={},De={},function(e){for(var t,i=e.length;i--;)if(t=e.length,e[i])for(this._getRect(e[i],Ae);t--;)if(e[t]&&i!==t&&this._isRectWithinRect(Ae,this._getRect(e[t],De))){e[i]=0;break}return e}),Ve.prototype._sortRectsTopLeft=function(){var e={},t={};return function(i,r){return this._getRect(i,e),this._getRect(r,t),e.top<t.top?-1:e.top>t.top?1:e.left<t.left?-1:e.left>t.left?1:0}}(),Ve.prototype._sortRectsLeftTop=function(){var e={},t={};return function(i,r){return this._getRect(i,e),this._getRect(r,t),e.left<t.left?-1:e.left>t.left?1:e.top<t.top?-1:e.top>t.top?1:0}}();var Le=Object.prototype.toString;function Be(e){return"object"==typeof e&&"[object Object]"===Le.call(e)}function Me(e){return ze(e)?Array.prototype.slice.call(e):Array.prototype.concat(e)}var Re=new Ve,Ie=function(){};function je(i,r){var n,s,o,a,l,h,c=this;if(!((i=this._element="string"==typeof i?window.document.querySelector(i):i).getRootNode?i.getRootNode({composed:!0})===document:window.document.body.contains(i))||i===window.document.documentElement)throw new Error("Container element must be an existing DOM element");u((n=this._settings=(a=je.defaultOptions,l=r,h=Ne({},a),l&&(h=Ne(h,l)),h.visibleStyles=(l||0).visibleStyles||(a||0).visibleStyles,h.hiddenStyles=(l||0).hiddenStyles||(a||0).hiddenStyles,h)).dragSort)||(n.dragSort=!!n.dragSort),this._id=ke(),e[this._id]=c,this._isDestroyed=!1,this._layout={id:0,items:[],slots:[],setWidth:!1,setHeight:!1,width:0,height:0},this._emitter=new t,I(i,n.containerClass),this._items=[],"string"==typeof(s=n.items)?Me(i.children).forEach((function(e){("*"===s||R(e,s))&&c._items.push(new Oe(c,e))})):(Array.isArray(s)||ze(s))&&(this._items=Me(s).map((function(e){return new Oe(c,e)}))),"number"!=typeof(o=n.layoutOnResize)&&(o=!0===o?0:-1),o>=0&&window.addEventListener("resize",c._resizeHandler=X((function(){c.refreshItems().layout()}),o)),n.layoutOnInit&&this.layout(!0)}function Ne(e,t){var i,r,n,s=Object.keys(t),o=s.length;for(n=0;n<o;n++)i=Be(t[r=s[n]]),Be(e[r])&&i?e[r]=Ne(Ne({},e[r]),t[r]):i?e[r]=Ne({},t[r]):Array.isArray(t[r])?e[r]=t[r].slice(0):e[r]=t[r];return e}return je.Item=Oe,je.ItemLayout=ye,je.ItemVisibility=Se,je.ItemMigrate=be,je.ItemAnimate=d,je.ItemDrag=fe,je.ItemRelease=Ce,je.ItemDragPlaceholder=ge,je.Emitter=t,je.Dragger=E,je.Packer=Ve,je.defaultOptions={items:"*",showDuration:300,showEasing:"ease",hideDuration:300,hideEasing:"ease",visibleStyles:{opacity:"1",transform:"scale(1)"},hiddenStyles:{opacity:"0",transform:"scale(0.5)"},layout:{fillGaps:!1,horizontal:!1,alignRight:!1,alignBottom:!1,rounding:!0},layoutOnResize:100,layoutOnInit:!0,layoutDuration:300,layoutEasing:"ease",sortData:null,dragEnabled:!1,dragContainer:null,dragStartPredicate:{distance:0,delay:0,handle:!1},dragAxis:null,dragSort:!0,dragSortHeuristics:{sortInterval:100,minDragDistance:10,minBounceBackAngle:1},dragSortPredicate:{threshold:50,action:"move"},dragReleaseDuration:300,dragReleaseEasing:"ease",dragCssProps:{touchAction:"none",userSelect:"none",userDrag:"none",tapHighlightColor:"rgba(0, 0, 0, 0)",touchCallout:"none",contentZooming:"none"},dragPlaceholder:{enabled:!1,duration:300,easing:"ease",createElement:null,onCreate:null,onRemove:null},containerClass:"muuri",itemClass:"muuri-item",itemVisibleClass:"muuri-item-shown",itemHiddenClass:"muuri-item-hidden",itemPositioningClass:"muuri-item-positioning",itemDraggingClass:"muuri-item-dragging",itemReleasingClass:"muuri-item-releasing",itemPlaceholderClass:"muuri-item-placeholder"},je.prototype.on=function(e,t){return this._emitter.on(e,t),this},je.prototype.off=function(e,t){return this._emitter.off(e,t),this},je.prototype.getElement=function(){return this._element},je.prototype.getItems=function(e){if(this._isDestroyed||!e&&0!==e)return this._items.slice(0);var t,i,r=[],n=Me(e);for(i=0;i<n.length;i++)(t=this._getItem(n[i]))&&r.push(t);return r},je.prototype.refreshItems=function(e){if(this._isDestroyed)return this;var t,i=this.getItems(e);for(t=0;t<i.length;t++)i[t]._refreshDimensions();return this},je.prototype.refreshSortData=function(e){if(this._isDestroyed)return this;var t,i=this.getItems(e);for(t=0;t<i.length;t++)i[t]._refreshSortData();return this},je.prototype.synchronize=function(){if(this._isDestroyed)return this;var e,t,i,r=this._element,n=this._items;if(n.length){for(i=0;i<n.length;i++)(t=n[i]._element).parentNode===r&&(e=e||window.document.createDocumentFragment()).appendChild(t);e&&r.appendChild(e)}return this._emit("synchronize"),this},je.prototype.layout=function(e,t){if(this._isDestroyed)return this;var i,r,n,s=this,o=this._element,l=this._updateLayout(),h=l.id,c=l.items.length,d=c;function p(){if(!(--d>0)){var i=s._layout.id!==h,r=u(e)?e:t;u(r)&&r(i,l.items.slice(0)),!i&&s._hasListeners("layoutEnd")&&s._emit("layoutEnd",l.items.slice(0))}}if((l.setHeight&&"number"==typeof l.height||l.setWidth&&"number"==typeof l.width)&&(i="border-box"===a(o,"box-sizing")),l.setHeight&&("number"==typeof l.height?o.style.height=(i?l.height+this._borderTop+this._borderBottom:l.height)+"px":o.style.height=l.height),l.setWidth&&("number"==typeof l.width?o.style.width=(i?l.width+this._borderLeft+this._borderRight:l.width)+"px":o.style.width=l.width),this._hasListeners("layoutStart")&&this._emit("layoutStart",l.items.slice(0)),!c)return p(),this;for(n=0;n<c;n++)(r=l.items[n])&&(r._left=l.slots[2*n],r._top=l.slots[2*n+1],r.isDragging()?p():r._layout.start(!0===e,p));return this},je.prototype.add=function(e,t){if(this._isDestroyed||!e)return[];var i=Me(e);if(!i.length)return i;var r,n,s=t||0,o=s.layout?s.layout:void 0===s.layout,a=this._items,l=!1;for(n=0;n<i.length;n++)r=new Oe(this,i[n],s.isActive),i[n]=r,r._isActive&&(l=!0,r._layout._skipNextAnimation=!0);return N(a,i,s.index),this._hasListeners("add")&&this._emit("add",i.slice(0)),l&&o&&this.layout("instant"===o,u(o)?o:void 0),i},je.prototype.remove=function(e,t){if(this._isDestroyed)return this;var i,r,n=t||0,s=n.layout?n.layout:void 0===n.layout,o=!1,a=this.getItems(),l=this.getItems(e),h=[];for(r=0;r<l.length;r++)i=l[r],h.push(a.indexOf(i)),i._isActive&&(o=!0),i._destroy(n.removeElements);return this._hasListeners("remove")&&this._emit("remove",l.slice(0),h),o&&s&&this.layout("instant"===s,u(s)?s:void 0),l},je.prototype.show=function(e,t){return this._isDestroyed||this._setItemsVisibility(e,!0,t),this},je.prototype.hide=function(e,t){return this._isDestroyed||this._setItemsVisibility(e,!1,t),this},je.prototype.filter=function(e,t){if(this._isDestroyed||!this._items.length)return this;var i,r,n=[],s=[],o="string"==typeof e,a=u(e),l=t||0,h=!0===l.instant,c=l.layout?l.layout:void 0===l.layout,d=u(l.onFinish)?l.onFinish:null,p=-1,f=Ie;if(d&&(f=function(){++p&&d(n.slice(0),s.slice(0))}),a||o)for(r=0;r<this._items.length;r++)i=this._items[r],(a?e(i):R(i._element,e))?n.push(i):s.push(i);return n.length?this.show(n,{instant:h,onFinish:f,layout:!1}):f(),s.length?this.hide(s,{instant:h,onFinish:f,layout:!1}):f(),(n.length||s.length)&&(this._hasListeners("filter")&&this._emit("filter",n.slice(0),s.slice(0)),c&&this.layout("instant"===c,u(c)?c:void 0)),this},je.prototype.sort=function(){var e,t,i,r;function n(e){for(var t={},i=0;i<e.length;i++)t[e[i]._id]=i;return t}function s(e,i){var n=r[e._id],s=r[i._id];return t?s-n:n-s}function o(o,a){for(var l,h,u,c,d=0,p=0;p<e.length;p++)if(l=e[p][0],h=e[p][1],u=(o._sortData?o:o._refreshSortData())._sortData[l],c=(a._sortData?a:a._refreshSortData())._sortData[l],d="desc"===h||!h&&t?c<u?-1:c>u?1:0:u<c?-1:u>c?1:0)return d;return d||(r||(r=n(i)),d=s(o,a)),d}function a(o,a){var l=e(o,a);return t&&l&&(l=-l),l||(r||(r=n(i)),s(o,a))}return function(n,s){if(this._isDestroyed||this._items.length<2)return this;var l,h=this._items,c=s||0,d=c.layout?c.layout:void 0===c.layout;if(e=n,t=!!c.descending,i=h.slice(0),r=null,u(e))h.sort(a);else if("string"==typeof e)e=n.trim().split(" ").map((function(e){return e.split(":")})),h.sort(o);else{if(!Array.isArray(e))return this;if(e.length!==h.length)throw new Error("[Muuri] sort reference items do not match with grid items.");for(l=0;l<h.length;l++){if(e.indexOf(h[l])<0)throw new Error("[Muuri] sort reference items do not match with grid items.");h[l]=e[l]}t&&h.reverse()}return this._hasListeners("sort")&&this._emit("sort",h.slice(0),i),d&&this.layout("instant"===d,u(d)?d:void 0),this}}(),je.prototype.move=function(e,t,i){if(this._isDestroyed||this._items.length<2)return this;var r,n,s=this._items,o=i||0,a=o.layout?o.layout:void 0===o.layout,l="swap"===o.action,h=l?"swap":"move",c=this._getItem(e),d=this._getItem(t);return c&&d&&c!==d&&(r=s.indexOf(c),n=s.indexOf(d),l?F(s,r,n):H(s,r,n),this._hasListeners("move")&&this._emit("move",{item:c,fromIndex:r,toIndex:n,action:h}),a&&this.layout("instant"===a,u(a)?a:void 0)),this},je.prototype.send=function(e,t,i,r){if(this._isDestroyed||t._isDestroyed||this===t)return this;if(!(e=this._getItem(e)))return this;var n=r||0,s=n.appendTo||window.document.body,o=n.layoutSender?n.layoutSender:void 0===n.layoutSender,a=n.layoutReceiver?n.layoutReceiver:void 0===n.layoutReceiver;return e._migrate.start(t,i,s),e._migrate._isActive&&e._isActive&&(o&&this.layout("instant"===o,u(o)?o:void 0),a&&t.layout("instant"===a,u(a)?a:void 0)),this},je.prototype.destroy=function(t){if(this._isDestroyed)return this;var i,r=this._element,n=this._items.slice(0);for(this._resizeHandler&&window.removeEventListener("resize",this._resizeHandler),i=0;i<n.length;i++)n[i]._destroy(t);return pe(r,this._settings.containerClass),r.style.height="",r.style.width="",this._emit("destroy"),this._emitter.destroy(),e[this._id]=void 0,this._isDestroyed=!0,this},je.prototype._getItem=function(e){if(this._isDestroyed||!e&&0!==e)return null;if("number"==typeof e)return this._items[e>-1?e:this._items.length+e]||null;if(e instanceof Oe)return e._gridId===this._id?e:null;for(var t=0;t<this._items.length;t++)if(this._items[t]._element===e)return this._items[t];return null},je.prototype._updateLayout=function(){var e,t,i,r,n=this._layout,s=this._settings.layout;for(++n.id,n.items.length=0,r=0;r<this._items.length;r++)this._items[r]._isActive&&n.items.push(this._items[r]);return this._refreshDimensions(),e=this._width-this._borderLeft-this._borderRight,t=this._height-this._borderTop-this._borderBottom,i=u(s)?s(n.items,e,t):Re.getLayout(n.items,e,t,n.slots,s),n.slots=i.slots,n.setWidth=Boolean(i.setWidth),n.setHeight=Boolean(i.setHeight),n.width=i.width,n.height=i.height,n},je.prototype._emit=function(){this._isDestroyed||this._emitter.emit.apply(this._emitter,arguments)},je.prototype._hasListeners=function(e){var t=this._emitter._events[e];return!(!t||!t.length)},je.prototype._updateBoundingRect=function(){var e=this._element.getBoundingClientRect();this._width=e.width,this._height=e.height,this._left=e.left,this._top=e.top},je.prototype._updateBorders=function(e,t,i,r){var n=this._element;e&&(this._borderLeft=U(n,"border-left-width")),t&&(this._borderRight=U(n,"border-right-width")),i&&(this._borderTop=U(n,"border-top-width")),r&&(this._borderBottom=U(n,"border-bottom-width"))},je.prototype._refreshDimensions=function(){this._updateBoundingRect(),this._updateBorders(1,1,1,1)},je.prototype._setItemsVisibility=function(e,t,i){var r,n,s=this,o=this.getItems(e),a=i||0,l=!0===a.instant,h=a.onFinish,c=a.layout?a.layout:void 0===a.layout,d=o.length,p=t?"showStart":"hideStart",f=t?"showEnd":"hideEnd",m=t?"show":"hide",g=!1,_=[],y=[];if(d){for(this._hasListeners(p)&&this._emit(p,o.slice(0)),n=0;n<o.length;n++)r=o[n],(t&&!r._isActive||!t&&r._isActive)&&(g=!0),t&&!r._isActive&&(r._layout._skipNextAnimation=!0),t&&r._visibility._isHidden&&y.push(r),r._visibility[m](l,(function(e,t){e||_.push(t),--d<1&&(u(h)&&h(_.slice(0)),s._hasListeners(f)&&s._emit(f,_.slice(0)))}));y.length&&this.refreshItems(y),g&&c&&this.layout("instant"===c,u(c)?c:void 0)}else u(h)&&h(o)},je}()},function(e,t,i){},function(e,t,i){},function(e,t,i){},function(e,t,i){"use strict";i.r(t),i.d(t,"localization",(function(){return r.a})),i.d(t,"surveyStrings",(function(){return r.b})),i.d(t,"DataProvider",(function(){return s})),i.d(t,"NumberModel",(function(){return c})),i.d(t,"SelectBase",(function(){return d})),i.d(t,"Matrix",(function(){return p})),i.d(t,"BooleanModel",(function(){return f})),i.d(t,"HistogramModel",(function(){return m})),i.d(t,"VisualizerBase",(function(){return u})),i.d(t,"VisualizationManager",(function(){return a})),i.d(t,"VisualizationPanel",(function(){return C})),i.d(t,"VisualizationPanelDynamic",(function(){return S})),i.d(t,"VisualizationMatrixDynamic",(function(){return T})),i.d(t,"VisualizationMatrixDropdown",(function(){return A})),i.d(t,"AlternativeVisualizersWrapper",(function(){return g})),i.d(t,"PlotlySetup",(function(){return D})),i.d(t,"PlotlyChartAdapter",(function(){return x})),i.d(t,"SelectBasePlotly",(function(){return k})),i.d(t,"MatrixPlotly",(function(){return O})),i.d(t,"PlotlyBoolChartAdapter",(function(){return V})),i.d(t,"BooleanPlotly",(function(){return z})),i.d(t,"RankingPlotly",(function(){return L})),i.d(t,"MatrixDropdownGroupedPlotly",(function(){return B})),i.d(t,"HistogramPlotly",(function(){return M})),i.d(t,"PlotlyGaugeAdapter",(function(){return R})),i.d(t,"GaugePlotly",(function(){return I})),i.d(t,"WordCloudAdapter",(function(){return F})),i.d(t,"WordCloud",(function(){return G})),i.d(t,"textHelper",(function(){return N})),i.d(t,"TextTableAdapter",(function(){return X})),i.d(t,"Text",(function(){return Y})),i.d(t,"ChoicesTableAdapter",(function(){return Q})),i.d(t,"ChoicesTable",(function(){return U})),i.d(t,"DocumentHelper",(function(){return h.b}));var r=i(0);i(9),i(10),i(11),i(12),i(13),i(14);r.a.locales.es={ungroupButton:"Desagrupar por mí",selectButton:"Seleccionarme",hideColumn:"Ocultar columna",showColumn:"Mostrar columna",makePrivateColumn:"Hacer que la columna sea privada",makePublicColumn:"Hacer pública la columna",moveToDetail:"Mover al detalle",showAsColumn:"Mostrar como columna",filterPlaceholder:"Buscar ...",removeRows:"Eliminar filas",showLabel:"Mostrar",entryLabel:"entradas",visualizer_text:"Textos en tabla",visualizer_wordcloud:"Wordcloud",chartType_bar:"Bar",chartType_stackedbar:"Barra apilada",chartType_doughnut:"Donut",chartType_pie:"Pie",chartType_scatter:"Dispersión",chartType_gauge:"Gauge",chartType_bullet:"Bullet",hideButton:"Ocultar",makePrivateButton:"Hacer privado",makePublicButton:"Hacer público",showButton:"Mostrar",filter:"Filtro",resetFilter:"Restablecer filtro",changeLocale:"Cambiar configuración regional",clearButton:"Borrar",addElement:"Elija la pregunta para mostrar ...",defaultOrder:"Orden predeterminado",ascOrder:"Ascendente",descOrder:"Descendente",showMinorColumns:"Mostrar columnas secundarias",otherCommentTitle:"Otros elementos y comentarios",showPercentages:"Mostrar porcentajes",hidePercentages:"Ocultar porcentajes",pdfDownloadCaption:"PDF",xlsxDownloadCaption:"Excel",csvDownloadCaption:"CSV",saveDiagramAsPNG:"Descargar el gráfico como png",hideEmptyAnswers:"Ocultar respuestas vacías",showEmptyAnswers:"Mostrar respuestas vacías","topNValueText-1":"Todas las respuestas",topNValueText5:"Las 5 respuestas principales",topNValueText10:"Las 10 respuestas principales",topNValueText20:"20 respuestas principales",noVisualizerForQuestion:"Este tipo de pregunta aún no se visualiza",noResults:"Aún no hay resultados"},r.a.localeNames.es="Spanish";r.a.locales.it={groupButton:"Raggruppa",ungroupButton:"Dividi",selectButton:"Selezionami",hideColumn:"Nascondi colonna",showColumn:"Mostra colonna",makePrivateColumn:"Rendi la colonna privata",makePublicColumn:"Rendi la colonna pubblica",moveToDetail:"Sposta in Dettaglio",showAsColumn:"Mostra come Colonna",filterPlaceholder:"Cerca...",removeRows:"Rimuovi righe",showLabel:"Mostra",entriesLabel:"voci",visualizer_text:"Parole in tabella",visualizer_wordcloud:"Nuvola di parole",visualizer_histogram:"Istogramma",visualizer_number:"Media",visualizer_choices:"Tabella",visualizer_selectBase:"Grafico",chartType_bar:"Grafico a barre",chartType_vbar:"Grafico a barre verticali",chartType_stackedbar:"Grafico a barre sovrapposte",chartType_doughnut:"Grafico a ciambella",chartType_pie:"Grafico a torta",chartType_scatter:"Grafico a dispersione",chartType_gauge:"Grafico Gauge",chartType_bullet:"Punto",hideButton:"Nascondi",makePrivateButton:"Rendi privato",makePublicButton:"Rendi pubblico",showButton:"Mostra",filter:"Filtro",resetFilter:"Cancella filtro",changeLocale:"Cambia lingua",en:"Inglese",fr:"Francese",ru:"Russo",de:"Tedesco",clearButton:"Cancella",addElement:"Scegli la domanda da mostrare...",defaultOrder:"Ordine di Default",ascOrder:"Ascendente",descOrder:"Discendente",showMinorColumns:"Mostra colonne secondarie",otherCommentTitle:"Altri punti e commenti",showPercentages:"Mostra percentuali",hidePercentages:"Nascondi percentuali",pdfDownloadCaption:"PDF",xlsxDownloadCaption:"Excel",csvDownloadCaption:"CSV",saveDiagramAsPNG:"Scarica il grafico in formato png",hideEmptyAnswers:"Nascondi risposte vuote",showEmptyAnswers:"Mostra risposte vuote","topNValueText-1":"Tutte le risposte",topNValueText5:"Top 5 risposte",topNValueText10:"Top 10 risposte",topNValueText20:"Top 20 risposte",hideMissingAnswers:"Nascondi le risposte mancanti",showMissingAnswers:"Mostra le risposte mancanti",missingAnswersLabel:"Risposte mancanti",noVisualizerForQuestion:"Questo tipo di domanda non è ancora stato visualizzato",noResults:"Non ci sono ancora risultati",showPerValues:"Per Valori",showPerColumns:"Per Colonne",answer:"Risposta",percent:"Percentuale",responses:"Risposte"},r.a.localeNames.it="Italian";i(15);var n=i(3),s=function(){function e(e,t){void 0===e&&(e=[]),void 0===t&&(t=void 0),this._data=e,this._getDataCore=t,this.filterValues={},this.onDataChanged=new n.Event}return e.prototype.getStatisticsCacheKey=function(e){return Array.isArray(e.dataName)?e.dataName.join("-"):e.dataName},e.prototype.reset=function(e){if(e){if(void 0!==this._statisticsCache){var t=this.getStatisticsCacheKey(e);delete this._statisticsCache[t]}}else void 0===this._statisticsCache&&void 0===this._filteredData||(this._statisticsCache=void 0,this._filteredData=void 0,this.raiseDataChanged())},Object.defineProperty(e.prototype,"data",{get:function(){return this._data},set:function(e){this._data=[].concat(e),this.reset()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"filteredData",{get:function(){var t=this;void 0===this._filteredData&&(Object.keys(this.filterValues).length>0?this._filteredData=this.data.filter((function(i){return!Object.keys(t.filterValues).some((function(r){var n=t.filterValues[r],s=typeof n,o=i[r];if(Array.isArray(o)&&"object"!==s)return-1==o.indexOf(n);if("object"==typeof o)return"object"!==s||!function(e,t){var i=Object.keys(e),r=Object.keys(t);if(r.length>i.length)return!1;for(var n=0,s=r;n<s.length;n++){var o=s[n];if(t[o]!=e[o])return!1}return!0}(o,n);var a=i[e.seriesMarkerKey];if(a&&"object"===s)return o!==n[a];if("object"===s&&void 0!==n.start&&void 0!==n.end){var l="number"==typeof o?o:Date.parse(o);return!(!isNaN(l)||(l=parseFloat(o),!isNaN(l)))||(l<n.start||l>=n.end)}return i[r]!==t.filterValues[r]}))})):this._filteredData=this.data);return this._filteredData},enumerable:!1,configurable:!0}),e.prototype.setFilter=function(e,t){var i=!0;void 0!==t?(i=this.filterValues[e]!==t,this.filterValues[e]=t):(i=void 0!==this.filterValues[e],delete this.filterValues[e]),i&&this.reset()},e.prototype.getDataCore=function(t){if(this._getDataCore)return this._getDataCore(t);var i=Array.isArray(t.dataName)?t.dataName:[t.dataName],r=[],n=t.getValues(),s={};n.forEach((function(e,t){s[e]=t}));var o=-1!==n.indexOf(void 0),a=t.getSeriesValues(),l={};a.forEach((function(e,t){l[e]=t}));for(var h=a.length||1,u=0;u<i.length;++u){for(var c=new Array,d=0;d<h;++d)c.push(new Array(n.length).fill(0));r.push(c)}return this.filteredData.forEach((function(t){i.forEach((function(i,n){var h=t[i];if(void 0!==h||o){var u=Array.isArray(h)?h:[h];if(a.length>0)if(void 0!==t[e.seriesMarkerKey]){var c=l[t[e.seriesMarkerKey]]||0;u.forEach((function(e){r[n][c][s[e]]++}))}else u.forEach((function(e){a.forEach((function(t){if(void 0!==e[t]){var i=l[t]||0;r[n][i][s[e[t]]]++}}))}));else u.forEach((function(e){return r[0][0][s[e]]++}))}}))})),Array.isArray(t.dataName)?r:r[0]},e.prototype.getData=function(e){var t=this.getStatisticsCacheKey(e);return void 0!==this._statisticsCache&&void 0!==this._statisticsCache[t]||(void 0===this._statisticsCache&&(this._statisticsCache={}),this._statisticsCache[t]=this.getDataCore(e)),[].concat(this._statisticsCache[t])},e.prototype.raiseDataChanged=function(){this.onDataChanged.isEmpty||this.onDataChanged.fire(this,{})},e.seriesMarkerKey="__sa_series_name",e}();var o=i(2),a=function(){function e(){}return e.registerVisualizer=function(t,i){var r=e.vizualizers[t];r||(r=[],e.vizualizers[t]=r),r.push(i)},e.unregisterVisualizer=function(t,i){var r=e.vizualizers[t];if(r){var n=r.indexOf(i);-1!==n&&r.splice(n,1)}},e.unregisterVisualizerForAll=function(t){Object.keys(e.vizualizers).forEach((function(i){return e.unregisterVisualizer(i,t)}))},e.getVisualizersByType=function(t){var i=e.vizualizers[t];return i||[u]},e.getAlternativesVisualizer=function(){return e.alternativesVisualizer||u},e.registerAlternativesVisualizer=function(t){e.alternativesVisualizer=t},e.alternativesVisualizer=void 0,e.vizualizers={},e}(),l=function(){function e(){}return e.createVisualizer=function(e,t,i){var r;r="text"===e.getType()&&e.inputType?e.inputType:e.getType();var n=a.getVisualizersByType(r).map((function(r){return new r(e,t,i)}));return n.length>1?new(a.getAlternativesVisualizer())(n,e,t,i):n[0]},e}(),h=i(1),u=(i(24),function(){function e(e,t,i,r){void 0===i&&(i={});var o=this;this.question=e,this.options=i,this._name=r,this._showHeader=!0,this._footerVisualizer=void 0,this._dataProvider=void 0,this.labelTruncateLength=27,this.renderResult=void 0,this.toolbarContainer=void 0,this.headerContainer=void 0,this.contentContainer=void 0,this.footerContainer=void 0,this._supportSelection=!1,this.onAfterRender=new n.Event,this.onLocaleChanged=new n.Event,this.toolbarItemCreators={},this._backgroundColor="#f7f7f7",this._dataProvider=i.dataProvider||new s(t),this._dataProvider.onDataChanged.add((function(){return o.onDataChanged()})),void 0!==i.labelTruncateLength&&(this.labelTruncateLength=i.labelTruncateLength)}return e.prototype.afterRender=function(e){this.onAfterRender.fire(this,{htmlElement:e})},Object.defineProperty(e.prototype,"questionOptions",{get:function(){return this.options[this.question.name]},enumerable:!1,configurable:!0}),e.prototype.onDataChanged=function(){this.refresh()},Object.defineProperty(e.prototype,"dataName",{get:function(){return this.question.valueName||this.question.name},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasHeader",{get:function(){return!(!this.options||!this.options.showCorrectAnswers)&&(!!this.question&&!!this.question.correctAnswer)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasFooter",{get:function(){return!!this.question&&(this.question.hasComment||this.question.hasOther)},enumerable:!1,configurable:!0}),e.prototype.createVisualizer=function(e){var t=Object.assign({},this.options);return void 0===t.dataProvider&&(t.dataProvider=this.dataProvider),l.createVisualizer(e,this.data,t)},Object.defineProperty(e.prototype,"footerVisualizer",{get:function(){var e=this;if(this.hasFooter){if(!this._footerVisualizer){var t=new n.QuestionCommentModel(this.question.name+(n.settings||{}).commentPrefix);t.title=this.processText(this.question.title),this._footerVisualizer=this.createVisualizer(t),this._footerVisualizer.onUpdate=function(){return e.invokeOnUpdate()}}return this._footerVisualizer}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"supportSelection",{get:function(){return(void 0===this.options.allowSelection||this.options.allowSelection)&&this._supportSelection},enumerable:!1,configurable:!0}),e.prototype.getSeriesValues=function(){return this.options.seriesValues||[]},e.prototype.getSeriesLabels=function(){return this.options.seriesLabels||this.getSeriesValues()},e.prototype.getValues=function(){throw new Error("Method not implemented.")},e.prototype.getLabels=function(){return this.getValues()},e.prototype.registerToolbarItem=function(e,t){this.toolbarItemCreators[e]=t},Object.defineProperty(e.prototype,"name",{get:function(){return this._name||"visualizer"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"data",{get:function(){return this.dataProvider.filteredData},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dataProvider",{get:function(){return this._dataProvider},enumerable:!1,configurable:!0}),e.prototype.updateData=function(e){this.options.dataProvider||(this.dataProvider.data=e),this.hasFooter&&this.footerVisualizer.updateData(e)},e.prototype.invokeOnUpdate=function(){this.onUpdate&&this.onUpdate()},e.prototype.destroy=function(){this.renderResult&&(this.clear(),this.toolbarContainer=void 0,this.contentContainer=void 0,this.footerContainer=void 0,this.renderResult.innerHTML="",this.renderResult=void 0),this._footerVisualizer&&(this._footerVisualizer.destroy(),this._footerVisualizer.onUpdate=void 0,this._footerVisualizer=void 0)},e.prototype.clear=function(){this.toolbarContainer&&this.destroyToolbar(this.toolbarContainer),this.contentContainer&&this.destroyContent(this.contentContainer),this.footerContainer&&this.destroyFooter(this.footerContainer)},e.prototype.createToolbarItems=function(e){var t=this;Object.keys(this.toolbarItemCreators||{}).forEach((function(i){var r=t.toolbarItemCreators[i](e);r&&e.appendChild(r)}))},e.prototype.getCorrectAnswerText=function(){return this.question?this.question.correctAnswer:""},e.prototype.destroyToolbar=function(e){e.innerHTML=""},e.prototype.renderToolbar=function(e){if(this.showHeader){var t=h.b.createElement("div","sa-toolbar");this.createToolbarItems(t),e.appendChild(t)}},e.prototype.destroyHeader=function(e){this.options&&"function"==typeof this.options.destroyHeader?this.options.destroyHeader(e,this):e.innerHTML=""},e.prototype.destroyContent=function(e){this.options&&"function"==typeof this.options.destroyContent?this.options.destroyContent(e,this):e.innerHTML=""},e.prototype.renderHeader=function(e){if(this.options&&"function"==typeof this.options.renderHeader)this.options.renderHeader(e,this);else{var t=h.b.createElement("div","sa-visualizer__correct-answer");t.innerText=r.a.getString("correctAnswer")+this.getCorrectAnswerText(),e.appendChild(t)}},e.prototype.renderContent=function(e){this.options&&"function"==typeof this.options.renderContent?this.options.renderContent(e,this):e.innerText=r.a.getString("noVisualizerForQuestion"),this.afterRender(e)},e.prototype.destroyFooter=function(e){e.innerHTML=""},e.prototype.renderFooter=function(t){var i=this;if(t.innerHTML="",this.hasFooter){var n=h.b.createElement("h4","sa-visualizer__footer-title",{innerText:r.a.getString("otherCommentTitle")});t.appendChild(n);var s=h.b.createElement("div","sa-visualizer__footer-content");s.style.display=e.otherCommentCollapsed?"none":"block";var o=h.b.createButton((function(){"none"===s.style.display?(s.style.display="block",o.innerText=r.a.getString("hideButton")):(s.style.display="none",o.innerText=r.a.getString(e.otherCommentCollapsed?"showButton":"hideButton")),i.footerVisualizer.invokeOnUpdate()}),r.a.getString("showButton"));t.appendChild(o),t.appendChild(s),this.footerVisualizer.render(s)}},e.prototype.render=function(e){"string"==typeof e&&(e=document.getElementById(e)),this.renderResult=e,this.toolbarContainer=h.b.createElement("div","sa-visualizer__toolbar"),e.appendChild(this.toolbarContainer),this.renderToolbar(this.toolbarContainer),this.hasHeader&&(this.headerContainer=h.b.createElement("div","sa-visualizer__header"),e.appendChild(this.headerContainer),this.renderHeader(this.headerContainer)),this.contentContainer=h.b.createElement("div","sa-visualizer__content"),e.appendChild(this.contentContainer),this.renderContent(this.contentContainer),this.footerContainer=h.b.createElement("div","sa-visualizer__footer"),e.appendChild(this.footerContainer),this.renderFooter(this.footerContainer)},e.prototype.refresh=function(){var e=this;this.headerContainer&&setTimeout((function(){e.destroyHeader(e.headerContainer),e.renderHeader(e.headerContainer),e.invokeOnUpdate()})),this.contentContainer&&setTimeout((function(){e.destroyContent(e.contentContainer),e.renderContent(e.contentContainer),e.invokeOnUpdate()})),this.footerContainer&&setTimeout((function(){e.destroyFooter(e.footerContainer),e.renderFooter(e.footerContainer),e.invokeOnUpdate()}))},e.prototype.processText=function(e){return!1!==this.options.stripHtmlFromTitles?(e||"").replace(/(<([^>]+)>)/gi,""):e},e.prototype.getRandomColor=function(){var e=this.getColors();return e[Math.floor(Math.random()*e.length)]},Object.defineProperty(e.prototype,"backgroundColor",{get:function(){return this.getBackgroundColorCore()},set:function(e){this.setBackgroundColorCore(e)},enumerable:!1,configurable:!0}),e.prototype.getBackgroundColorCore=function(){return this._backgroundColor},e.prototype.setBackgroundColorCore=function(e){this._backgroundColor=e,this.footerVisualizer&&(this.footerVisualizer.backgroundColor=e)},e.prototype.getColors=function(t){void 0===t&&(t=10);for(var i=Array.isArray(e.customColors)&&e.customColors.length>0?e.customColors:e.colors,r=[],n=0;n<t;n++)r=r.concat(i);return r},Object.defineProperty(e.prototype,"showHeader",{get:function(){return this._showHeader},set:function(e){e!=this._showHeader&&(this._showHeader=e,this.toolbarContainer&&(this.destroyToolbar(this.toolbarContainer),this.renderToolbar(this.toolbarContainer)))},enumerable:!1,configurable:!0}),e.prototype.getData=function(){return this.dataProvider.getData(this)},e.prototype.getState=function(){return{}},e.prototype.setState=function(e){},Object.defineProperty(e.prototype,"locale",{get:function(){var e=this.options.survey;return e?e.locale:r.a.currentLocale},set:function(e){this.setLocale(e),this.onLocaleChanged.fire(this,{locale:e}),this.refresh()},enumerable:!1,configurable:!0}),e.prototype.setLocale=function(e){r.a.currentLocale=e;var t=this.options.survey;t&&t.locale!==e&&(t.locale=e)},e.otherCommentCollapsed=!0,e.customColors=[],e.colors=["#86e1fb","#3999fb","#ff6771","#1eb496","#ffc152","#aba1ff","#7d8da5","#4ec46c","#cf37a6","#4e6198"],e}()),c=function(e){function t(t,i,n,s){void 0===n&&(n={});var o=e.call(this,t,i,n,s||"number")||this;return o.registerToolbarItem("changeChartType",(function(){return o.chartTypes.length>1?h.b.createSelector(o.chartTypes.map((function(e){return{value:e,text:r.a.getString("chartType_"+e)}})),(function(e){return o.chartType===e.value}),(function(e){o.setChartType(e.target.value)})):null})),o}return Object(o.b)(t,e),t.prototype.onDataChanged=function(){this._resultAverage=void 0,this._resultMin=void 0,this._resultMax=void 0,e.prototype.onDataChanged.call(this)},t.prototype.onChartTypeChanged=function(){},t.prototype.setChartType=function(e){-1!==this.chartTypes.indexOf(e)&&this.chartType!==e&&(this.chartType=e,this.onChartTypeChanged(),this.contentContainer&&(this.destroyContent(this.contentContainer),this.renderContent(this.contentContainer)),this.invokeOnUpdate())},t.prototype.destroy=function(){this._resultAverage=void 0,this._resultMin=void 0,this._resultMax=void 0,e.prototype.destroy.call(this)},t.prototype.generateText=function(e,i,r){var n=[];if(5===r)n=["very high ("+e+")","high","medium","low","very low ("+i+")"];else{n.push(e);for(var s=0;s<r-2;s++)n.push("");n.push(i)}return t.generateTextsCallback?t.generateTextsCallback(this.question,e,i,r,n):n},t.prototype.generateValues=function(e,t){for(var i=[],r=0;r<t;r++)i.push(e/t);return i.push(e),i},t.prototype.generateColors=function(e,t,i){for(var r=this.getColors(),n=[],s=0;s<i;s++)n.push(r[s]);return n.push("rgba(255, 255, 255, 0)"),n},t.prototype.getData=function(){var e=this;if(void 0===this._resultAverage||void 0===this._resultMin||void 0===this._resultMax){this._resultMin=Number.MAX_VALUE,this._resultMax=-Number.MAX_VALUE,this._resultAverage=0;var t=0;this.data.forEach((function(i){if(void 0!==i[e.question.name]){var r=+i[e.question.name];t++,e._resultAverage+=r,e._resultMin>r&&(e._resultMin=r),e._resultMax<r&&(e._resultMax=r)}})),t>0&&(this._resultAverage=this._resultAverage/t),this._resultAverage=Math.ceil(100*this._resultAverage)/100}return[this._resultAverage,this._resultMin,this._resultMax]},t.stepsCount=5,t.showAsPercentage=!1,t}(u),d=function(e){function t(i,s,o,a){var l=e.call(this,i,s,o,a||"selectBase")||this;return l.selectedItem=void 0,l.choicesOrderSelector=void 0,l.showPercentageBtn=void 0,l.emptyAnswersBtn=void 0,l.transposeDataBtn=void 0,l.topNSelector=void 0,l._showPercentages=!1,l._showOnlyPercentages=!1,l._percentagePrecision=0,l._answersOrder="default",l._supportSelection=!0,l._hideEmptyAnswers=!1,l._topN=-1,l.topNValues=[].concat(t.topNValuesDefaults),l._transposeData=!1,l._showMissingAnswers=!1,l.missingAnswersBtn=void 0,l.chartTypes=[],l.chartType="bar",l.onAnswersDataReady=new n.Event,i.visibleChoicesChangedCallback=function(){l.dataProvider.reset()},l._showPercentages=!0===l.options.showPercentages,l._showOnlyPercentages=!0===l.options.showOnlyPercentages,l.options.percentagePrecision&&(l._percentagePrecision=l.options.percentagePrecision),l._hideEmptyAnswers=!0===l.options.hideEmptyAnswers,l._answersOrder=l.options.answersOrder||"default",l._showMissingAnswers=l.isSupportMissingAnswers()&&!0===l.options.showMissingAnswers,l.registerToolbarItem("changeChartType",(function(){return l.chartTypes.length>1?h.b.createSelector(l.chartTypes.map((function(e){return{value:e,text:r.a.getString("chartType_"+e)}})),(function(e){return l.chartType===e.value}),(function(e){l.setChartType(e.target.value)})):null})),l.registerToolbarItem("changeAnswersOrder",(function(){return void 0!==l.options.allowChangeAnswersOrder&&!l.options.allowChangeAnswersOrder||0!==l.getSeriesValues().length||(l.choicesOrderSelector=h.b.createSelector([{text:r.a.getString("defaultOrder"),value:"default"},{text:r.a.getString("ascOrder"),value:"asc"},{text:r.a.getString("descOrder"),value:"desc"}],(function(e){return!1}),(function(e){l.answersOrder=e.target.value})),l.updateOrderSelector()),l.choicesOrderSelector})),l.registerToolbarItem("showPercentages",(function(){if(l.options.allowShowPercentages&&(-1!==l.chartTypes.indexOf("bar")||-1!==l.chartTypes.indexOf("stackedbar")))return l.showPercentageBtn=h.b.createButton((function(){l.showPercentages=!l.showPercentages})),l.updateShowPercentageBtn(),l.showPercentageBtn})),l.registerToolbarItem("hideEmptyAnswers",(function(){return l.options.allowHideEmptyAnswers&&(l.emptyAnswersBtn=h.b.createButton((function(){l.hideEmptyAnswers=!l._hideEmptyAnswers})),l.updateEmptyAnswersBtn()),l.emptyAnswersBtn})),l.registerToolbarItem("topNAnswers",(function(){return l.options.allowTopNAnswers&&0===l.getSeriesValues().length&&(l.topNSelector=h.b.createSelector(l.topNValues.map((function(e){return{text:r.a.getString("topNValueText"+e),value:e}})),(function(e){return!1}),(function(e){l.topN=parseInt(e.target.value)})),l.updateTopNSelector()),l.topNSelector})),l.registerToolbarItem("transposeData",(function(){return l.options.allowTransposeData&&(l.transposeDataBtn=h.b.createButton((function(){l.transposeData=!l.transposeData})),l.updateTransposeDataBtn()),l.transposeDataBtn})),l.registerToolbarItem("showMissingAnswers",(function(){return l.isSupportMissingAnswers()&&l.options.allowShowMissingAnswers&&(l.missingAnswersBtn=h.b.createButton((function(){l.showMissingAnswers=!l._showMissingAnswers})),l.updateMissingAnswersBtn()),l.missingAnswersBtn})),l}return Object(o.b)(t,e),t.prototype.updateEmptyAnswersBtn=function(){this.emptyAnswersBtn&&(this.emptyAnswersBtn.innerText=this._hideEmptyAnswers?r.a.getString("showEmptyAnswers"):r.a.getString("hideEmptyAnswers"),"bar"==this.chartType||"vbar"==this.chartType||"scatter"==this.chartType?this.emptyAnswersBtn.style.display="inline":this.emptyAnswersBtn.style.display="none")},t.prototype.updateTransposeDataBtn=function(){this.transposeDataBtn&&(this.transposeDataBtn.innerText=this.transposeData?r.a.getString("showPerColumns"):r.a.getString("showPerValues"),this.getSeriesValues().length>0?this.transposeDataBtn.style.display="inline":this.transposeDataBtn.style.display="none")},t.prototype.updateOrderSelector=function(){this.choicesOrderSelector&&("bar"==this.chartType||"vbar"==this.chartType||"scatter"==this.chartType||("pie"==this.chartType||"doughnut"==this.chartType)&&this.topN>0?this.choicesOrderSelector.style.display="inline-block":this.choicesOrderSelector.style.display="none",this.choicesOrderSelector.getElementsByTagName("select")[0].value=this.answersOrder)},t.prototype.updateShowPercentageBtn=function(){this.showPercentageBtn&&(this.showPercentageBtn.innerText=this._showPercentages?r.a.getString("hidePercentages"):r.a.getString("showPercentages"),"bar"==this.chartType||"vbar"==this.chartType||"stackedbar"==this.chartType?this.showPercentageBtn.style.display="inline":this.showPercentageBtn.style.display="none")},t.prototype.updateTopNSelector=function(){this.topNSelector&&(this.topNSelector.getElementsByTagName("select")[0].value=this._topN)},t.prototype.updateMissingAnswersBtn=function(){this.missingAnswersBtn&&(this.missingAnswersBtn.innerText=this._showMissingAnswers?r.a.getString("hideMissingAnswers"):r.a.getString("showMissingAnswers"))},t.prototype.onChartTypeChanged=function(){this.updateOrderSelector(),this.updateShowPercentageBtn(),this.updateEmptyAnswersBtn(),this.updateTopNSelector()},t.prototype.setChartType=function(e){-1!==this.chartTypes.indexOf(e)&&this.chartType!==e&&(this.chartType=e,this.onChartTypeChanged(),this.refreshContent())},t.prototype.getCorrectAnswerText=function(){var t=e.prototype.getCorrectAnswerText.call(this),i=Array.isArray(t)?t:[t],r=this.question;return i.map((function(e){return n.ItemValue.getTextOrHtmlByValue(r.choices,e)})).join(", ")},t.prototype.getSelectedItemByText=function(e){var t=this.question;return this.question.hasOther&&e==t.otherText?t.otherItem:t.choices.filter((function(t){return t.text===e}))[0]},t.prototype.setSelection=function(e){this.selectedItem!==e&&(this.selectedItem=e,void 0!==this.onDataItemSelected&&this.onDataItemSelected(void 0!==e?e.value:void 0,void 0!==e?e.text:""))},Object.defineProperty(t.prototype,"selection",{get:function(){return this.selectedItem},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"showOnlyPercentages",{get:function(){return this._showOnlyPercentages},set:function(e){this._showOnlyPercentages=e,this.refreshContent()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"showPercentages",{get:function(){return this._showPercentages},set:function(e){this._showPercentages=e,this.updateShowPercentageBtn(),this.refreshContent()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"answersOrder",{get:function(){return this._answersOrder},set:function(e){this._answersOrder=e,this.updateOrderSelector(),this.refreshContent()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hideEmptyAnswers",{get:function(){return this._hideEmptyAnswers},set:function(e){this._hideEmptyAnswers=e,this.updateEmptyAnswersBtn(),this.refreshContent()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"transposeData",{get:function(){return this._transposeData},set:function(e){this._transposeData=e,this.updateTransposeDataBtn(),this.refreshContent()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"topN",{get:function(){return this._topN},set:function(e){this._topN=e,this.updateTopNSelector(),this.updateOrderSelector(),this.refreshContent()},enumerable:!1,configurable:!0}),t.prototype.isSupportMissingAnswers=function(){return!0},Object.defineProperty(t.prototype,"showMissingAnswers",{get:function(){return this._showMissingAnswers},set:function(e){this._showMissingAnswers=this.isSupportMissingAnswers()&&e,this.updateMissingAnswersBtn(),this.dataProvider.reset(this),this.refreshContent()},enumerable:!1,configurable:!0}),t.prototype.refreshContent=function(){this.contentContainer&&(this.destroyContent(this.contentContainer),this.renderContent(this.contentContainer)),this.invokeOnUpdate()},Object.defineProperty(t.prototype,"showValuesInOriginalOrder",{get:function(){return!1!==this.options.showValuesInOriginalOrder},enumerable:!1,configurable:!0}),t.prototype.valuesSource=function(){return this.question.activeChoices},t.prototype.getValues=function(){var e=this.valuesSource().map((function(e){return e.value}));return this.question.hasOther&&e.push("other"),this.showMissingAnswers&&e.unshift(void 0),this.showValuesInOriginalOrder?e.reverse():e},t.prototype.getLabels=function(){var e=this;if(this.options.useValuesAsLabels)return this.getValues();var t=this.valuesSource().map((function(t){return n.ItemValue.getTextOrHtmlByValue(e.valuesSource(),t.value)})),i=this.question;return i.hasOther&&t.push(i.otherText),this.showMissingAnswers&&t.unshift(r.a.getString("missingAnswersLabel")),this.showValuesInOriginalOrder?t.reverse():t},t.prototype.getPercentages=function(){var e=this.getData(),t=[],i=this._percentagePrecision;if(e.length<2)e.forEach((function(e,r){var n=e.reduce((function(e,t){return e+t}),0);t[r]=e.map((function(e){var t=i?+(e/n).toFixed(i):Math.round(e/n*1e4);return n&&t/100}))}));else for(var r=0;r<e[0].length;r++){for(var n=0,s=0;s<e.length;s++)n+=e[s][r];for(s=0;s<e.length;s++){Array.isArray(t[s])||(t[s]=[]);var o=i?+(e[s][r]/n*100).toFixed(i):Math.round(e[s][r]/n*100);t[s][r]=n&&o}}return t},t.prototype.hideEmptyAnswersInData=function(e){for(var t={datasets:[[]],labels:[],colors:[],texts:[[]],seriesLabels:e.seriesLabels},i=0;i<e.datasets[0].length;i++)0!=e.datasets[0][i]&&(t.datasets[0].push(e.datasets[0][i]),t.labels.push(e.labels[i]),t.colors.push(e.colors[i]),t.texts[0].push(e.texts[0][i]));return t},t.prototype.answersDataReady=function(e){var t={};return t=this.hideEmptyAnswers?this.hideEmptyAnswersInData(e):e,this.topN>0&&(t.datasets[0]=t.datasets[0].slice(-this.topN),t.labels=t.labels.slice(-this.topN),t.colors=t.colors.slice(-this.topN),t.texts[0]=t.texts[0].slice(-this.topN)),t},t.prototype.getAnswersData=function(){var e=this.getSeriesLabels(),t=this.getData(),i=this.getLabels(),r=this.getColors(),n=this.showPercentages?this.getPercentages():t;if(this.transposeData){t=this.transpose(t),n=this.transpose(n);var s=e;e=i,i=s}if("asc"==this.answersOrder||"desc"==this.answersOrder){var o=this.showPercentages?h.a.zipArrays(i,r,n[0]):h.a.zipArrays(i,r),a=h.a.sortDictionary(o,t[0],"desc"==this.answersOrder),l=h.a.unzipArrays(a.keys);i=l[0],r=l[1],this.showPercentages&&(n[0]=l[2]),t[0]=a.values}var u={datasets:t,labels:i,colors:r,texts:n,seriesLabels:e};return u=this.answersDataReady(u),this.onAnswersDataReady.fire(this,u),u},t.prototype.transpose=function(e){for(var t=e[0].length,i=new Array(t),r=0;r<t;++r)i[r]=new Array(e.length);for(r=0;r<e.length;++r)for(var n=0;n<t;++n)i[n][r]=e[r][n];return i},t.prototype.getState=function(){var e=this,i={};return t._stateProperties.forEach((function(t){i[t]=e[t]})),i},t.prototype.setState=function(e){var i=this;t._stateProperties.forEach((function(t){void 0!==e[t]&&(i[t]=e[t])}))},t.topNValuesDefaults=[-1,5,10,20],t._stateProperties=["chartType","answersOrder","hideEmptyAnswers","topN"],t}(u),p=function(e){function t(t,i,r,n){var s=e.call(this,t,i,r,n||"matrix")||this;return s.getAnswersData(),s}return Object(o.b)(t,e),Object.defineProperty(t.prototype,"matrixQuestion",{get:function(){return this.question},enumerable:!1,configurable:!0}),t.prototype.isSupportMissingAnswers=function(){return!1},t.prototype.getSeriesValues=function(){return this.matrixQuestion.rows.map((function(e){return""+e.value}))},t.prototype.getSeriesLabels=function(){var e=this;return this.matrixQuestion.rows.map((function(t){return n.ItemValue.getTextOrHtmlByValue(e.matrixQuestion.rows,t.value)}))},t.prototype.getSelectedItemByText=function(e){return this.matrixQuestion.columns.filter((function(t){return t.text===e}))[0]},t.prototype.valuesSource=function(){return this.matrixQuestion.columns},t.prototype.getHasAnswersInAllSeriesArray=function(e){for(var t=Array(),i=0;i<e[0].length;i++)for(var r=0;r<e.length;r++)0!=e[r][i]&&(t[i]=!0);return t},t.prototype.getHasAnswersInSeries=function(e){for(var t=0;t<e.length;t++)if(0!=e[t])return!0;return!1},t.prototype.hideEmptyAnswersInData=function(e){for(var t={datasets:[],labels:[],colors:[],texts:[],seriesLabels:[]},i=this.getHasAnswersInAllSeriesArray(e.datasets),r=0;r<e.datasets.length;r++){if(this.getHasAnswersInSeries(e.datasets[r])){t.labels.push(e.labels[r]),t.colors.push(e.colors[r]);for(var n=[],s=[],o=0;o<e.datasets[0].length;o++)i[o]&&(n.push(e.datasets[r][o]),s.push(e.texts[r][o]));t.datasets.push(n),t.texts.push(s)}}for(r=0;r<e.datasets[0].length;r++)i[r]&&t.seriesLabels.push(e.seriesLabels[r]);return t},t.prototype.getData=function(){var t=e.prototype.getData.call(this),i=this.getSeriesValues(),r=this.getValues();if(i.length>1){var n=[];return r.forEach((function(e,r){var s=i.map((function(e,i){return t[i][r]}));n.push(s)})),n}return t},t}(d),f=function(e){function t(t,i,r,n){return e.call(this,t,i,r,n||"boolean")||this}return Object(o.b)(t,e),t.prototype.getCorrectAnswerText=function(){var e=this.booleanQuestion.correctAnswer;return void 0!==this.booleanQuestion.valueTrue&&this.booleanQuestion.valueTrue===e||e?this.booleanQuestion.locLabelTrue.textOrHtml:void 0!==this.booleanQuestion.valueFalse&&this.booleanQuestion.valueFalse===e||!e?this.booleanQuestion.locLabelFalse.textOrHtml:e},Object.defineProperty(t.prototype,"booleanQuestion",{get:function(){return this.question},enumerable:!1,configurable:!0}),t.prototype.getSelectedItemByText=function(e){var t=this.getLabels(),i=this.getValues();return new n.ItemValue(i[t.indexOf(e)],e)},t.prototype.getValues=function(){var e=[void 0===this.booleanQuestion.valueTrue||this.booleanQuestion.valueTrue,void 0!==this.booleanQuestion.valueFalse&&this.booleanQuestion.valueFalse];return this.showMissingAnswers&&e.push(void 0),e},t.prototype.getLabels=function(){var e=[].concat(this.getValues());return void 0!==this.booleanQuestion.labelTrue&&(e[0]=this.booleanQuestion.locLabelTrue.textOrHtml),void 0!==this.booleanQuestion.labelFalse&&(e[1]=this.booleanQuestion.locLabelFalse.textOrHtml),this.showMissingAnswers&&(e[2]=r.a.getString("missingAnswersLabel")),e},t.trueColor="",t.falseColor="",t}(d),m=function(e){function t(t,i,r,n){var s=e.call(this,t,i,r,n||"histogram")||this;return s.valueType="number",s._cachedValues=void 0,s._continiousData=void 0,s._cachedIntervals=void 0,s._intervalPrecision=2,void 0!==s.options.intervalPrecision&&(s._intervalPrecision=s.options.intervalPrecision),"text"!==t.getType()||"date"!==t.inputType&&"datetime"!==t.inputType?s.valueType="number":s.valueType="date",s}return Object(o.b)(t,e),t.prototype.reset=function(){this._continiousData=void 0,this._cachedValues=void 0,this._cachedIntervals=void 0},t.prototype.getContiniousValue=function(e){return"date"===this.valueType?Date.parse(e):parseFloat(e)},t.prototype.getString=function(e){return"date"===this.valueType?new Date(e).toLocaleDateString():""+e},t.prototype.toPrecision=function(e){var t=Math.pow(10,this._intervalPrecision);return Math.round(t*e)/t},t.prototype.getSelectedItemByText=function(e){if(this.hasCustomIntervals||this.getContiniousValues().length>t.UseIntervalsFrom){var i=this.intervals.filter((function(t){return t.label===e}))[0];return new n.ItemValue(i,void 0!==i?i.label:"")}var r=this.getLabels(),s=r.indexOf(e);return new n.ItemValue(this.getValues()[s],r[s])},t.prototype.updateData=function(t){this.reset(),e.prototype.updateData.call(this,t)},t.prototype.onDataChanged=function(){this.reset(),e.prototype.onDataChanged.call(this)},t.prototype.getContiniousValues=function(){var e=this;if(void 0===this._cachedValues){var t=this.getSeriesValues();0===t.length&&t.push(""),this._continiousData={},t.forEach((function(t){return e._continiousData[t]=[]}));var i={};this.data.forEach((function(t){var r=t[e.dataName];if(void 0!==r){var n=t[s.seriesMarkerKey]||"";e._continiousData[n].push(e.getContiniousValue(r)),i[r]=r}})),this._cachedValues=Object.keys(i).map((function(t){return{original:i[t],continious:e.getContiniousValue(t)}})),this._cachedValues.sort((function(e,t){return e.continious-t.continious}))}return this._cachedValues},t.prototype.isSupportMissingAnswers=function(){return!1},Object.defineProperty(t.prototype,"needUseRateValues",{get:function(){return"rating"==this.question.getType()&&Array.isArray(this.question.rateValues)&&this.question.rateValues.length>0},enumerable:!1,configurable:!0}),t.prototype.getValues=function(){var e=this.getContiniousValues();return this.hasCustomIntervals||e.length>t.UseIntervalsFrom||this.needUseRateValues?this.intervals.map((function(e){return e.start})):e.map((function(e){return e.original}))},t.prototype.getLabels=function(){var e=this.getContiniousValues();return this.hasCustomIntervals||e.length>t.UseIntervalsFrom||this.needUseRateValues?this.intervals.map((function(e){return e.label})):e.map((function(e){return""+e.original}))},Object.defineProperty(t.prototype,"hasCustomIntervals",{get:function(){return!!this.questionOptions&&Array.isArray(this.questionOptions.intervals)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"intervals",{get:function(){if(this.hasCustomIntervals)return this.questionOptions.intervals.reverse();if(this.needUseRateValues){var e=this.question.rateValues;return e.map((function(t,i){return{start:t.value,end:i<e.length-1?e[i+1].value:t.value+1,label:t.text}})).reverse()}if(void 0===this._cachedIntervals){var i=this.getContiniousValues();if(this._cachedIntervals=[],i.length)for(var r=i[0].continious,n=i[i.length-1].continious,s=t.IntervalsCount,o=(n-r)/s,a=0;a<s;++a){var l=r+o,h=this.toPrecision(r),u=this.toPrecision(l);this._cachedIntervals.push({start:h,end:u,label:this.getString(h)+"-"+this.getString(u)}),r=l}}return this._cachedIntervals},enumerable:!1,configurable:!0}),t.prototype.getData=function(){var i=this.getContiniousValues();if(!this.hasCustomIntervals&&i.length<=t.UseIntervalsFrom)return e.prototype.getData.call(this);var r=this.intervals,n=[],s=this.getSeriesValues();0===s.length&&s.push("");for(var o=0;o<s.length;++o)n.push(r.map((function(e){return 0}))),this._continiousData[s[o]].forEach((function(e){for(var t=0;t<r.length;++t)if(r[t].start<=e&&(e<r[t].end||t==r.length-1)){n[o][t]++;break}}));return n},t.IntervalsCount=10,t.UseIntervalsFrom=10,t}(d),g=function(e){function t(t,i,n,s){var o=e.call(this,i,n,s)||this;if(o.visualizers=t,o.visualizersWithSelection=[],o.onAfterVisualizerRenderCallback=function(){o.afterRender(o.contentContainer)},!t||t.length<2)throw new Error("VisualizerArrayWrapper works with visualizers collection only.");return o.visualizers.forEach((function(e){e.onUpdate=function(){return o.invokeOnUpdate()},e.supportSelection&&(o._supportSelection=!0,o.visualizersWithSelection.push(e))})),o.registerToolbarItem("changeVisualizer",(function(){return h.b.createSelector(o.visualizers.map((function(e){return{value:e.name,text:r.a.getString("visualizer_"+e.name)}})),(function(e){return o.visualizer.name===e.value}),(function(e){return o.setVisualizer(e.target.value)}))})),o.visualizer=t[0],o.visualizer.onAfterRender.add(o.onAfterVisualizerRenderCallback),o}return Object(o.b)(t,e),Object.defineProperty(t.prototype,"hasFooter",{get:function(){return!1},enumerable:!1,configurable:!0}),t.prototype.getVisualizers=function(){return this.visualizers},t.prototype.setVisualizer=function(e){this.visualizer&&(this.visualizer.onAfterRender.remove(this.onAfterVisualizerRenderCallback),this.visualizer.destroy()),this.visualizer=this.visualizers.filter((function(t){return t.name===e}))[0],this.refresh(),this.visualizer.onAfterRender.add(this.onAfterVisualizerRenderCallback)},t.prototype.updateData=function(t){e.prototype.updateData.call(this,t),this.visualizers.forEach((function(e){e.updateData(t)}))},Object.defineProperty(t.prototype,"onDataItemSelected",{set:function(e){this.visualizersWithSelection.forEach((function(t){t.onDataItemSelected=e}))},enumerable:!1,configurable:!0}),t.prototype.setSelection=function(e){this.visualizersWithSelection.forEach((function(t){t.setSelection(e)}))},Object.defineProperty(t.prototype,"selection",{get:function(){return this.visualizer.selection||this.selectedItem},enumerable:!1,configurable:!0}),t.prototype.renderContent=function(e){this.visualizerContainer=e,this.visualizer.render(this.visualizerContainer)},t.prototype.setBackgroundColorCore=function(t){e.prototype.setBackgroundColorCore.call(this,t),this.visualizers.forEach((function(e){return e.backgroundColor=t}))},t.prototype.destroy=function(){var t=this;this.visualizers.forEach((function(e){e.onAfterRender.remove(t.onAfterVisualizerRenderCallback),e.onUpdate=void 0})),this.visualizer.destroy(),e.prototype.destroy.call(this)},t}(u);a.registerAlternativesVisualizer(g);var _=function(){function e(e){this._htmlElement=void 0,this.text=void 0,this._htmlElement=h.b.createElement("div","sa-question__filter"),this.text=h.b.createElement("span","sa-question__filter-text"),this._htmlElement.appendChild(this.text);var t=h.b.createButton((function(){e.setSelection(void 0)}),r.a.getString("clearButton"));this._htmlElement.appendChild(t)}return Object.defineProperty(e.prototype,"htmlElement",{get:function(){return this._htmlElement},enumerable:!1,configurable:!0}),e.prototype.update=function(e){void 0!==e&&void 0!==e.value?(this._htmlElement.style.display="inline-block",this.text.innerText=r.a.getString("filter")+": ["+e.text+"]"):(this._htmlElement.style.display="none",this.text.innerText="")},e}(),y=i(25),v=function(e){function t(t,i){var r=e.call(this,t)||this;return r._selector=i,r._muuri=void 0,r._layoutingTimer=void 0,r}return Object(o.b)(t,e),t.prototype.startCore=function(e){var t=this;this._muuri=new y(e,{dragStartPredicate:{handle:".sa-question__title--draggable"},items:this._selector,dragEnabled:!0}),this._muuri.on("dragReleaseEnd",(function(e){return t.onMoveCallback&&t.onMoveCallback(e.fromIndex,e.toIndex)}))},t.prototype.stopCore=function(){this._muuri.off("dragReleaseEnd"),this._muuri.destroy(),this._muuri=void 0},t.prototype.updateCore=function(){var e=this;void 0!==this._layoutingTimer&&clearTimeout(this._layoutingTimer),this._layoutingTimer=setTimeout((function(){e._layoutingTimer=void 0,e._muuri.refreshItems(),e._muuri.layout()}),10)},t.prototype.add=function(e,t){this._allowed&&this._muuri.add(e,t)},t.prototype.remove=function(e,t){this._allowed&&this._muuri.remove(e,t)},t}(function(){function e(e){this._allowed=e}return e.prototype.startCore=function(e){},e.prototype.stopCore=function(){},e.prototype.updateCore=function(){},Object.defineProperty(e.prototype,"allowed",{get:function(){return this._allowed},enumerable:!1,configurable:!0}),e.prototype.start=function(e){this._allowed&&this.startCore(e)},e.prototype.stop=function(){this._allowed&&this.stopCore()},e.prototype.update=function(){this._allowed&&this.updateCore()},e.prototype.add=function(e,t){},e.prototype.remove=function(e,t){},e.prototype.destroy=function(){this.stop()},e}());i(26);if(document){var b=i(16),w=document.createElement("div");w.style.display="none",w.innerHTML=b,document.head.appendChild(w)}var C=function(e){function t(i,s,o,a){void 0===o&&(o={}),void 0===a&&(a=void 0);var l=e.call(this,null,s,o,"panel")||this;if(l.questions=i,l._elements=a,l.visualizers=[],l.haveCommercialLicense=!1,l.renderedQuestionsCount=0,l.onAfterRenderQuestionCallback=function(e,t){l.renderedQuestionsCount++,l.renderedQuestionsCount==l.questions.length&&(l.renderedQuestionsCount=0,l.afterRender(l.contentContainer))},l.onVisibleElementsChanged=new n.Event,l.onStateChanged=new n.Event,l._layoutEngine=o.layoutEngine||new v(l.allowDynamicLayout,".sa-question-layouted"),l._layoutEngine.onMoveCallback=function(e,t){return l.moveVisibleElement(e,t)},l.showHeader=!0,l.options.survey&&(r.a.currentLocale=l.options.survey.locale),void 0===a&&(l._elements=l.buildElements(i)),l.haveCommercialLicense=t.haveCommercialLicense||void 0!==o.haveCommercialLicense&&o.haveCommercialLicense,l.buildVisualizers(i),l.haveCommercialLicense||l.registerToolbarItem("commercialLicense",(function(){return Object(h.c)()})),l.registerToolbarItem("resetFilter",(function(){return h.b.createButton((function(){l.visualizers.forEach((function(e){(e instanceof d||e instanceof g)&&e.setSelection(void 0)}))}),r.a.getString("resetFilter"))})),l.registerToolbarItem("addElement",(function(e){if(l.allowHideQuestions){var t=void 0,i=function(i,n){var s=l.hiddenElements;if(s.length>0){var o=h.b.createSelector([{name:void 0,displayName:r.a.getString("addElement")}].concat(s).map((function(e){return{value:e.name,text:e.displayName}})),(function(e){return!1}),(function(e){l.showElement(e.target.value)}));t&&e.replaceChild(o,t)||e.appendChild(o),t=o}else t&&e.removeChild(t),t=void 0};i(),l.onVisibleElementsChanged.add(i)}})),!l.options.disableLocaleSwitch&&l.locales.length>1){var u=l.locales.map((function(e){return{value:e,text:r.a.getString(e)}}));l.registerToolbarItem("changeLocale",(function(){return h.b.createSelector(u,(function(e){return!!e.value&&l.locale===e.value}),(function(e){var t=e.target.value;l.locale=t}))}))}return l}return Object(o.b)(t,e),t.prototype.showElement=function(e){var t=this.getElement(e),i=this._elements.indexOf(t);t.isVisible=!0;var r=this.renderPanelElement(t,this.contentContainer);this.layoutEngine.add([r],{index:i}),this.visibleElementsChanged(t,"ADDED")},t.prototype.hideElement=function(e){var t=this.getElement(e);t.isVisible=!1,t.renderedElement&&(this.layoutEngine.remove([t.renderedElement]),this.contentContainer.removeChild(t.renderedElement),t.renderedElement=void 0),this.visibleElementsChanged(t,"REMOVED")},t.prototype.makeElementPrivate=function(e){e.isPublic=!1,this.onStateChanged.fire(this,this.state),this.onPermissionsChangedCallback&&this.onPermissionsChangedCallback(this)},t.prototype.makeElementPublic=function(e){e.isPublic=!0,this.onStateChanged.fire(this,this.state),this.onPermissionsChangedCallback&&this.onPermissionsChangedCallback(this)},t.prototype.moveVisibleElement=function(e,t){var i,r,n=this.visibleElements[e],s=this.visibleElements[t];i=this._elements.indexOf(n),r=this._elements.indexOf(s),this.moveElement(i,r)},t.prototype.moveElement=function(e,t){var i=this._elements.splice(e,1);this._elements.splice(t,0,i[0]),this.visibleElementsChanged(i[0],"MOVED")},t.prototype.setBackgroundColorCore=function(t){e.prototype.setBackgroundColorCore.call(this,t),this.visualizers.forEach((function(e){return e.backgroundColor=t}))},t.prototype.buildVisualizers=function(e){var t=this;e.forEach((function(e){var i=t.createVisualizer(e);if(t.allowHideQuestions&&i.registerToolbarItem("removeQuestion",(function(){return h.b.createButton((function(){setTimeout((function(){return t.hideElement(e.name)}),0)}),r.a.getString("hideButton"))})),t.allowMakeQuestionsPrivate&&i.registerToolbarItem("makePrivatePublic",(function(){var i=t.getElement(e.name),n=i.isPublic?"first":"second",s=r.a.getString("makePrivateButton"),o=r.a.getString("makePublicButton");return h.b.createSvgToggleButton("makepublic","makeprivate",s,o,(function(e){setTimeout((function(){return t.makeElementPublic(i)}),0)}),(function(e){setTimeout((function(){return t.makeElementPrivate(i)}),0)}),n)})),i.supportSelection){var n=i,s=new _(n);i.registerToolbarItem("questionFilterInfo",(function(){return s.update(n.selection),s.htmlElement})),n.onDataItemSelected=function(i,r){s.update({value:i,text:r}),t.setFilter(e.name,i)}}i.onUpdate=function(){return t.layout()},i.onAfterRender.add(t.onAfterRenderQuestionCallback),t.visualizers.push(i)}))},t.prototype.destroyVisualizers=function(){var e=this;this.visualizers.forEach((function(t){t.onUpdate=void 0,t instanceof d&&(t.onDataItemSelected=void 0),t.onAfterRender.remove(e.onAfterRenderQuestionCallback),t.destroy()})),this.visualizers=[]},t.prototype.setLocale=function(t){var i=this;e.prototype.setLocale.call(this,t),(this.questions||[]).forEach((function(e){var t=i.getElement(e.name);t&&(t.displayName=i.processText(e.title))})),this.visualizers.forEach((function(e){e.options.seriesLabels=i.options.seriesLabels,e.locale=t})),this.onStateChanged.fire(this,this.state)},Object.defineProperty(t.prototype,"allowDynamicLayout",{get:function(){return void 0===this.options.allowDynamicLayout||!0===this.options.allowDynamicLayout},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"allowHideQuestions",{get:function(){return void 0===this.options.allowHideQuestions||!0===this.options.allowHideQuestions},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"allowMakeQuestionsPrivate",{get:function(){return!0===this.options.allowMakeQuestionsPrivate},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"layoutEngine",{get:function(){return this._layoutEngine},enumerable:!1,configurable:!0}),t.prototype.buildElements=function(e){var t=this;return(e||[]).map((function(e){return{name:e.name,displayName:t.processText(e.title),isVisible:!0,isPublic:!0,type:void 0}}))},t.prototype.getElements=function(){return(this._elements||[]).map((function(e){return{name:e.name,displayName:e.displayName,isVisible:e.isVisible,isPublic:e.isPublic,type:e.type}}))},Object.defineProperty(t.prototype,"visibleElements",{get:function(){return this._elements.filter((function(e){return e.isVisible}))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hiddenElements",{get:function(){return this._elements.filter((function(e){return!e.isVisible}))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"publicElements",{get:function(){return this._elements.filter((function(e){return e.isPublic}))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"privateElements",{get:function(){return this._elements.filter((function(e){return!e.isPublic}))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"locales",{get:function(){return this.options.survey?this.options.survey.getUsedLocales():[]},enumerable:!1,configurable:!0}),t.prototype.getElement=function(e){return this._elements.filter((function(t){return t.name===e}))[0]},t.prototype.getVisualizer=function(e){return this.visualizers.filter((function(t){return t.question.name===e}))[0]},t.prototype.visibleElementsChanged=function(e,t){this.onVisibleElementsChanged.isEmpty||this.onVisibleElementsChanged.fire(this,{elements:this._elements,changed:e,reason:t}),this.onStateChanged.fire(this,this.state),this.layout()},t.prototype.renderPanelElement=function(e,t){var i=this.getVisualizer(e.name),r=h.b.createElement("div");t.appendChild(r);var n=h.b.createElement("div"),s=h.b.createElement("h3"),o=h.b.createElement("div");return s.innerText=e.displayName,r.className=this.allowDynamicLayout?"sa-question sa-question-layouted":"sa-question",s.className="sa-question__title",this.allowDynamicLayout&&(s.className=s.className+" sa-question__title--draggable"),n.className="sa-question__content",n.style.backgroundColor=this.backgroundColor,n.appendChild(s),n.appendChild(o),r.appendChild(n),i.render(o),e.renderedElement=r,r},t.prototype.renderToolbar=function(t){t.className+=" sa-panel__header",e.prototype.renderToolbar.call(this,t)},t.prototype.renderContent=function(e){var t=this;e.className+=" sa-panel__content sa-grid",this.visibleElements.forEach((function(i){t.renderPanelElement(i,e)})),this.layoutEngine.start(e)},t.prototype.destroyContent=function(t){this.layoutEngine.stop(),e.prototype.destroyContent.call(this,t)},t.prototype.refresh=function(){this.toolbarContainer&&(this.destroyToolbar(this.toolbarContainer),this.renderToolbar(this.toolbarContainer)),e.prototype.refresh.call(this)},t.prototype.layout=function(){this.layoutEngine.update()},t.prototype.setFilter=function(e,t){this.dataProvider.setFilter(e,t)},Object.defineProperty(t.prototype,"state",{get:function(){var e=this;return{locale:this.locale,elements:[].concat(this._elements.map((function(t){var i=e.getVisualizer(t.name),r=Object(o.a)(Object(o.a)({},t),null==i?void 0:i.getState());return void 0!==r.renderedElement&&delete r.renderedElement,r})))}},set:function(e){var t=this;if(e){if(Array.isArray(e.elements)){var i=this.questions.map((function(e){return e.name}));this._elements=[].concat(e.elements.filter((function(e){return-1!==i.indexOf(e.name)})))}void 0!==e.locale&&this.setLocale(e.locale),this._elements.forEach((function(e){var i=t.getVisualizer(e.name);void 0!==i&&i.setState(e)})),this.refresh()}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"permissions",{get:function(){return this._elements.map((function(e){return{name:e.name,isPublic:e.isPublic}}))},set:function(e){var t=this._elements.map((function(t){return e.forEach((function(e){e.name===t.name&&(t.isPublic=e.isPublic)})),Object(o.a)({},t)}));this._elements=[].concat(t),this.refresh(),this.onPermissionsChangedCallback&&this.onPermissionsChangedCallback(this)},enumerable:!1,configurable:!0}),t.prototype.destroy=function(){e.prototype.destroy.call(this),this.destroyVisualizers()},t.haveCommercialLicense=!1,t}(u),S=function(e){function t(t,i,r,n){void 0===r&&(r={});var s=e.call(this,t,i,r,n||"panelDynamic")||this;return s._panelVisualizer=void 0,s.onAfterRenderPanelCallback=function(){s.afterRender(s.contentContainer)},(r=Object.assign({},r)).allowDynamicLayout=!1,r.dataProvider=void 0,s._panelVisualizer=new C(s.getQuestions(),[],r),s._panelVisualizer.onAfterRender.add(s.onAfterRenderPanelCallback),s.updateData(i),s}return Object(o.b)(t,e),t.prototype.setLocale=function(t){e.prototype.setLocale.call(this,t),this._panelVisualizer.locale=t},Object.defineProperty(t.prototype,"name",{get:function(){return"panelDynamic"},enumerable:!1,configurable:!0}),t.prototype.updatePanelVisualizerData=function(){var e=this,t=[];this.data.forEach((function(i){void 0!==i[e.question.name]&&(t=t.concat(i[e.question.name]))})),this._panelVisualizer.updateData(t)},t.prototype.updateData=function(t){e.prototype.updateData.call(this,t),this.updatePanelVisualizerData()},t.prototype.onDataChanged=function(){this.updatePanelVisualizerData(),e.prototype.onDataChanged.call(this)},t.prototype.getQuestions=function(){return this.question.template.questions},t.prototype.destroyContent=function(t){this._panelVisualizer.clear(),e.prototype.destroyContent.call(this,this.contentContainer)},t.prototype.renderContent=function(e){this._panelVisualizer.render(e)},t.prototype.destroy=function(){e.prototype.destroy.call(this),this._panelVisualizer.onAfterRender.remove(this.onAfterRenderPanelCallback)},t}(u);a.registerVisualizer("paneldynamic",S);var T=function(e){function t(t,i,r){return e.call(this,t,i,r)||this}return Object(o.b)(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"matrixDynamic"},enumerable:!1,configurable:!0}),t.prototype.getQuestions=function(){var e=this.question.visibleRows;return 0===e.length?[]:e[0].cells.map((function(e){return e.question}))},t}(S);a.registerVisualizer("matrixdynamic",T);var A=function(e){function t(t,i,r,s){void 0===r&&(r={});var o=e.call(this,t,i,r,s||"matrixDropdown")||this;o._matrixDropdownVisualizer=void 0,o.onPanelAfterRenderCallback=function(){o.afterRender(o.contentContainer)},o._childOptions=Object.assign({},r),o._childOptions.disableLocaleSwitch=!0,o._childOptions.dataProvider=void 0,o._childOptions.allowDynamicLayout=!1,o._childOptions.seriesValues=t.rows.map((function(e){return e.value})),o._childOptions.seriesLabels=t.rows.map((function(e){return e.text}));var l=o.getQuestions();if(1==o._childOptions.seriesValues.length&&l.every((function(e){return n.Helpers.isArraysEqual(e.choices,o.question.choices)}))){var h=a.getVisualizersByType("matrixdropdown-grouped");o._matrixDropdownVisualizer=new h[0](o.question,[],o._childOptions)}else o._matrixDropdownVisualizer=new C(l,[],o._childOptions);return o._matrixDropdownVisualizer.onAfterRender.add(o.onPanelAfterRenderCallback),o.updateData(i),o}return Object(o.b)(t,e),t.prototype.setLocale=function(t){e.prototype.setLocale.call(this,t),this._childOptions.seriesLabels=this.question.rows.map((function(e){return e.text})),this._matrixDropdownVisualizer.locale=t},Object.defineProperty(t.prototype,"matrixDropdownVisualizer",{get:function(){return this._matrixDropdownVisualizer},enumerable:!1,configurable:!0}),t.prototype.updateDropdownVisualizerData=function(){var e=this,t=[];this.data.forEach((function(i){var r=i[e.question.name];r&&Object.keys(r).forEach((function(e){var i=Object.assign({},r[e]);i[s.seriesMarkerKey]=e,t.push(i)}))})),this._matrixDropdownVisualizer.updateData(t)},t.prototype.updateData=function(t){e.prototype.updateData.call(this,t),this.updateDropdownVisualizerData()},t.prototype.onDataChanged=function(){this.updateDropdownVisualizerData(),e.prototype.onDataChanged.call(this)},t.prototype.getQuestions=function(){var e=this.question;return e.columns.map((function(t){var i=t.templateQuestion;return Array.isArray(i.choices)&&0===i.choices.length&&(i.choices=e.choices),i}))},t.prototype.destroyContent=function(t){this._matrixDropdownVisualizer.clear(),e.prototype.destroyContent.call(this,this.contentContainer)},t.prototype.renderContent=function(e){this._matrixDropdownVisualizer.render(e)},t.prototype.destroy=function(){e.prototype.destroy.call(this),this._matrixDropdownVisualizer.onAfterRender.remove(this.onPanelAfterRenderCallback)},t}(u);a.registerVisualizer("matrixdropdown",A);var D=function(){function e(){}return e.setup=function(e,t){return this.setups[e](t)},e.setupPie=function(t){var i=t.getAnswersData(),r=i.datasets,n=i.labels,s=i.colors,o=(i.texts,i.seriesLabels),a=[],l=o.length>1,h={type:t.chartType,y:l?o:n,text:(l?o:n).map((function(i){return e.getTruncatedLabel(i,t.labelTruncateLength)})),hoverinfo:"x+y",mode:"markers",marker:{}};h.hoverinfo="label+value+percent",h.marker.colors=s,h.textposition="inside","doughnut"===t.chartType&&(h.type="pie",h.hole=.4),l||(h.marker.symbol="circle",h.marker.size=16),r.forEach((function(e,t){a.push(Object.assign({},h,{values:e,labels:l?o:n,customdata:l?o:n}))}));var u={font:{family:"Segoe UI, sans-serif",size:14,weight:"normal",color:"#404040"},height:(n.length<10?50*n.length+100:550)*Math.round(a.length/2)+25,margin:{l:0,t:25,b:0,r:10},colorway:s,hovermode:"closest",plot_bgcolor:t.backgroundColor,paper_bgcolor:t.backgroundColor,showlegend:!1};return l&&(u.grid={rows:Math.round(a.length/2),columns:2},u.annotations=[],n.forEach((function(e,t){a[t].domain={column:t%2,row:Math.floor(t/2)},a[t].title={position:"bottom center",text:e}}))),{traces:a,layout:u,hasSeries:l}},e.setupBar=function(t){var i=t.getAnswersData(),r=i.datasets,n=i.labels,s=i.colors,o=i.texts,a=i.seriesLabels,l=[],h=a.length>1,u=h?a:n,c={type:t.chartType,y:u,text:u,customdata:h?a:n,hoverinfo:"text",orientation:"h",mode:"markers",textposition:"none",width:.5,bargap:.5,marker:{}};c.marker.color=s,r.forEach((function(e,i){var r=Object.assign({},c,{x:e,text:o[i],hovertext:u.map((function(e,t){return"".concat(o[i][t],", ").concat(e)}))});if(t.showPercentages){var n=t.showOnlyPercentages?"%{text}%":"%{value} (%{text}%)";r.textposition="inside",r.texttemplate=n,r.bargap=.1}l.push(r)}));var d={font:{family:"Segoe UI, sans-serif",size:14,weight:"normal",color:"#404040"},height:30*(n.length+1)+30+30,margin:{t:30,b:30,r:10},colorway:s,hovermode:"closest",yaxis:{automargin:!0,type:"category",orientation:"h",tickmode:"array",tickvals:u,ticktext:u.map((function(i){return e.getTruncatedLabel(i,t.labelTruncateLength)+" "}))},xaxis:{rangemode:"nonnegative",automargin:!0},plot_bgcolor:t.backgroundColor,paper_bgcolor:t.backgroundColor,showlegend:!1};return h&&(d.showlegend=!0,"stackedbar"==t.chartType?d.barmode="stack":d.height=30*(n.length+1)*a.length+30+30,n.forEach((function(e,i){l[i].marker.color=void 0,l[i].name=e,"stackedbar"===t.chartType?(l[i].type="bar",l[i].width=.5):l[i].width=(t.showPercentages?.7:.5)/l.length})),l.forEach((function(e,i){var r=t.showPercentages?"%":"";l[i].hovertext=[],u.forEach((function(t,n){l[i].hovertext.push("".concat(e.y[n]," : ").concat(e.name,", ").concat(e.text[n]).concat(r))}))}))),{traces:l,layout:d,hasSeries:h}},e.setupVBar=function(e){var t=e.getAnswersData(),i=t.datasets,r=t.labels,n=t.colors,s=t.texts,o=t.seriesLabels,a=[],l=o.length>1,h={font:{family:"Segoe UI, sans-serif",size:14,weight:"normal",color:"#404040"},margin:{t:30,b:30,r:10},colorway:n,hovermode:"closest",plot_bgcolor:e.backgroundColor,paper_bgcolor:e.backgroundColor,showlegend:!1},u={type:"bar",customdata:l?o:r,hoverinfo:"x+y",mode:"markers",textposition:"none",width:.5,bargap:.5,marker:{}};return u.marker.color=n,i.forEach((function(t,i){var n=Object.assign({},u,{x:r,y:e.showPercentages?s[i].map((function(e){return e/100})):t,text:s[i]});if(e.showPercentages){var o=e.showOnlyPercentages?"%{text}%":"%{value} (%{text}%)";n.textposition="inside",n.texttemplate=o,n.width=.9,n.bargap=.1}a.push(n)})),e.showPercentages&&e.showOnlyPercentages&&(h.yaxis={automargin:!0,tickformat:".0%",range:[0,1],ticklen:e.showOnlyPercentages?25:5,tickcolor:"transparent"}),{traces:a,layout:h,hasSeries:l}},e.setupScatter=function(t){var i=t.getAnswersData(),r=i.datasets,n=i.labels,s=i.colors,o=(i.texts,i.seriesLabels),a=o.length>1,l=[],h={type:"scatter",y:(a?o:n).map((function(i){return e.getTruncatedLabel(i,t.labelTruncateLength)})),customdata:a?o:n,text:a?o:n,hoverinfo:"x+y",orientation:"h",mode:"markers",width:.5,marker:{}};a||(h.marker.symbol="circle",h.marker.size=16),r.forEach((function(e){var t=Object.assign({},h,{x:e});l.push(t)}));var u={font:{family:"Segoe UI, sans-serif",size:14,weight:"normal",color:"#404040"},height:30*(n.length+1)+30+30,margin:{t:30,b:30,r:10},colorway:s,hovermode:"closest",yaxis:{automargin:!0,type:"category",ticklen:5,tickcolor:"transparent"},xaxis:{rangemode:"nonnegative",automargin:!0},plot_bgcolor:t.backgroundColor,paper_bgcolor:t.backgroundColor,showlegend:!1};return a&&(u.showlegend=!0,u.height=void 0,n.forEach((function(e,t){l[t].hoverinfo="x+name",l[t].marker.color=void 0,l[t].name=e}))),{traces:l,layout:u,hasSeries:a}},e.imageExportFormat="png",e.onImageSaving=new n.Event,e.onPlotCreating=new n.Event,e.setups={bar:e.setupBar,vbar:e.setupVBar,stackedbar:e.setupBar,doughnut:e.setupPie,pie:e.setupPie,scatter:e.setupScatter},e.getTruncatedLabel=function(e,t){var i="...".length;return t?-1===t||e.length<=t+i?e:e.substring(0,t)+"...":e},e}(),P=i(7),E=i.n(P),x=function(){function e(e){this.model=e,this._chart=void 0}return e.prototype.patchConfigParameters=function(e,t,i,r){},Object.defineProperty(e.prototype,"chart",{get:function(){return this._chart},enumerable:!1,configurable:!0}),e.prototype.create=function(e){var t=this,i=D.setup(this.model.chartType,this.model),s={displaylogo:!1,responsive:!0,locale:r.a.currentLocale,modeBarButtonsToRemove:["toImage"],modeBarButtonsToAdd:[{name:"toImageSjs",title:r.a.getString("saveDiagramAsPNG"),icon:E.a.Icons.camera,click:function(e){var i={format:D.imageExportFormat,filename:t.model.question.name};D.onImageSaving.fire(t.model,i),E.a.downloadImage(e,i)}}]};void 0!==k.displayModeBar&&(s.displayModeBar=k.displayModeBar),this.patchConfigParameters(e,i.traces,i.layout,s);var o={traces:i.traces,layout:i.layout,config:s};D.onPlotCreating.fire(this.model,o);var a=E.a.newPlot(e,o.traces,o.layout,o.config);e.on("plotly_click",(function(e){var r;if(e.points.length>0){var s="";if(i.hasSeries){s=e.points[0].data.name;var o=e.points[0].label,a=t.model.getSeriesValues()[t.model.getSeriesLabels().indexOf(o)],l=t.model.getSelectedItemByText(s);h=new n.ItemValue(((r={})[a]=l.value,r),o+": "+l.text);t.model.setSelection(h)}else{s=Array.isArray(e.points[0].customdata)?e.points[0].customdata[0]:e.points[0].customdata;var h=t.model.getSelectedItemByText(s);t.model.setSelection(h)}}}));var l=function(){return e.getElementsByClassName("nsewdrag")[0]};return e.on("plotly_hover",(function(){var e=l();e&&(e.style.cursor="pointer")})),e.on("plotly_unhover",(function(){var e=l();e&&(e.style.cursor="")})),this._chart=a,a},e.prototype.destroy=function(e){E.a.purge(e),this._chart=void 0},e}(),k=function(e){function t(i,r,n,s){void 0===n&&(n={});var o=e.call(this,i,r,n,s)||this;return o.chartTypes=[].concat(t.types),o.getSeriesValues().length>0&&-1===o.chartTypes.indexOf("stackedbar")&&o.chartTypes.push("stackedbar"),n.allowExperimentalFeatures&&o.chartTypes.splice(1,0,"vbar"),o.chartType=o.chartTypes[0],-1!==o.chartTypes.indexOf(n.defaultChartType)&&(o.chartType=n.defaultChartType),o._chartAdapter=new x(o),o}return Object(o.b)(t,e),t.prototype.destroyContent=function(t){this._chartAdapter.destroy(t.children[0]),e.prototype.destroyContent.call(this,t)},t.prototype.renderContent=function(e){var t=this,i=h.b.createElement("div");e.appendChild(i),this._chartAdapter.create(i).then((function(){t.afterRender(t.contentContainer)}))},t.prototype.getData=function(){var t=e.prototype.getData.call(this),i=this.getSeriesValues(),r=this.getValues();if(i.length>1){var n=[];return r.forEach((function(e,r){var s=i.map((function(e,i){return t[i][r]}));n.push(s)})),n}return t},t.types=["bar","pie","doughnut","scatter"],t.displayModeBar=void 0,t}(d);a.registerVisualizer("checkbox",k),a.registerVisualizer("radiogroup",k),a.registerVisualizer("dropdown",k),a.registerVisualizer("imagepicker",k);var O=function(e){function t(i,r,n,s){var o=e.call(this,i,r,n,s)||this;return o.chartTypes=t.types,o.chartType=o.chartTypes[0],o._chartAdapter=new x(o),o}return Object(o.b)(t,e),t.prototype.destroyContent=function(t){this._chartAdapter.destroy(t.children[0]),e.prototype.destroyContent.call(this,t)},t.prototype.renderContent=function(e){var t=this,i=h.b.createElement("div");e.appendChild(i),this._chartAdapter.create(i).then((function(){t.afterRender(t.contentContainer)}))},t.types=["bar","stackedbar","pie","doughnut"],t}(p);a.registerVisualizer("matrix",O);var V=function(e){function t(t){return e.call(this,t)||this}return Object(o.b)(t,e),t.prototype.patchConfigParameters=function(e,t,i,r){var n=this.model.getColors(),s=[z.trueColor||n[0],z.falseColor||n[1]];this.model.showMissingAnswers&&s.push(n[2]),"pie"===this.model.chartType||"doughnut"===this.model.chartType?t.forEach((function(e){e.marker.colors=s})):"bar"===this.model.chartType&&t.forEach((function(e){e.marker.color=s}))},t}(x),z=function(e){function t(i,r,n,s){var o=e.call(this,i,r,n,s)||this;return o.chartTypes=t.types,o.chartType=o.chartTypes[0],o._chartAdapter=new V(o),o}return Object(o.b)(t,e),t.prototype.destroyContent=function(t){this._chartAdapter.destroy(t.children[0]),e.prototype.destroyContent.call(this,t)},t.prototype.renderContent=function(e){var t=this,i=h.b.createElement("div");e.appendChild(i),this._chartAdapter.create(i).then((function(){t.afterRender(t.contentContainer)}))},t.types=["pie","bar","doughnut"],t}(f);a.registerVisualizer("boolean",z);var L=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(o.b)(t,e),t.prototype.getQuestionResults=function(){var e=this.question.name;return this.data.map((function(t){return t[e]}))},t.prototype.getEmptyData=function(){var e=this.getValues(),t=[];return t.length=e.length,t.fill(0),t},t.prototype.getData=function(){var e=this,t=this.getQuestionResults(),i=this.getValues(),r=this.getEmptyData();return t.forEach((function(t){e.applyResultToPlotlyData(t,r,i)})),[r]},t.prototype.applyResultToPlotlyData=function(e,t,i){e&&t&&i&&e.forEach((function(e,r,n){var s=i.indexOf(e);t[s]=+t[s]+(n.length-r)}))},t}(k);a.registerVisualizer("ranking",L);var B=function(e){function t(i,r,n,s){var o=e.call(this,i,r,n,s)||this;return o.chartTypes=t.types,o.chartType=o.chartTypes[0],o._chartAdapter=new x(o),o}return Object(o.b)(t,e),t.prototype.destroyContent=function(t){this._chartAdapter.destroy(t.children[0]),e.prototype.destroyContent.call(this,t)},t.prototype.renderContent=function(e){var t=this,i=h.b.createElement("div");e.appendChild(i),this._chartAdapter.create(i).then((function(){t.afterRender(t.contentContainer)}))},t.types=["stackedbar","bar","pie","doughnut"],t}(function(e){function t(t,i,r,n){var s=e.call(this,t,i,r,n||"matrixDropdownGrouped")||this;return s.getAnswersData(),s}return Object(o.b)(t,e),Object.defineProperty(t.prototype,"matrixQuestion",{get:function(){return this.question},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dataName",{get:function(){return this.matrixQuestion.columns.map((function(e){return e.name}))},enumerable:!1,configurable:!0}),t.prototype.getSeriesValues=function(){return this.matrixQuestion.columns.map((function(e){return e.name}))},t.prototype.getSeriesLabels=function(){return this.matrixQuestion.columns.map((function(e){return e.title}))},t.prototype.valuesSource=function(){return this.matrixQuestion.choices},t.prototype.isSupportMissingAnswers=function(){return!1},t.prototype.getData=function(){var e=this.getValues(),t=this.getSeriesValues(),i=this.matrixQuestion.rows.map((function(e){return e.value})),r=this.dataProvider.getData({dataName:t,getValues:function(){return e},getLabels:function(){return e},getSeriesValues:function(){return i},getSeriesLabels:function(){return i}}),n=[];return e.forEach((function(e,i){var s=t.map((function(e,t){return r[t][0][i]}));n.push(s)})),n},t}(d));a.registerVisualizer("matrixdropdown-grouped",B);var M=function(e){function t(i,r,n,s){var o=e.call(this,i,r,n,s)||this;return o.chartTypes=t.types,o.chartType=o.chartTypes[0],o._chartAdapter=new x(o),o}return Object(o.b)(t,e),t.prototype.destroyContent=function(t){this._chartAdapter.destroy(t.children[0]),e.prototype.destroyContent.call(this,t)},t.prototype.renderContent=function(e){var t=this,i=h.b.createElement("div");e.appendChild(i),this._chartAdapter.create(i).then((function(){t.afterRender(t.contentContainer)}))},t.prototype.getData=function(){var t=e.prototype.getData.call(this),i=this.getSeriesValues(),r=this.getValues();if(i.length>1){var n=[];return r.forEach((function(e,r){var s=i.map((function(e,i){return t[i][r]}));n.push(s)})),n}return t},t.types=["vbar","bar","scatter"],t}(m);a.registerVisualizer("date",M),a.registerVisualizer("number",M),a.registerVisualizer("rating",M);var R=function(){function e(e){this.model=e,this._chart=void 0}return Object.defineProperty(e.prototype,"chart",{get:function(){return this._chart},enumerable:!1,configurable:!0}),e.prototype.create=function(e){var t=this,i=this.model.question,n=this.model.getData(),s=n[0],o=n[1],a=n[2];if("rating"===i.getType()){var l=i.visibleRateValues;a=l[l.length-1].value,o=l[0].value}var u=this.model.generateColors(a,o,I.stepsCount);I.showAsPercentage&&(s=h.a.toPercentage(s,a),o=h.a.toPercentage(o,a),a=h.a.toPercentage(a,a));var c=[{type:"indicator",mode:"gauge+number",gauge:{axis:{range:[o,a]},shape:this.model.chartType,bgcolor:"white",bar:{color:u[0]}},value:s,text:i.name,domain:{x:[0,1],y:[0,1]}}],d={plot_bgcolor:this.model.backgroundColor,paper_bgcolor:this.model.backgroundColor};"bullet"===this.model.chartType&&(d.height=250,d.width=600);var p={displayModeBar:!0,locale:r.a.currentLocale,responsive:!0,displaylogo:!1,modeBarButtonsToRemove:["toImage"],modeBarButtonsToAdd:[{name:"toImageSjs",title:r.a.getString("saveDiagramAsPNG"),icon:E.a.Icons.camera,click:function(e){var i={format:D.imageExportFormat,filename:t.model.question.name};D.onImageSaving.fire(t.model,i),E.a.downloadImage(e,i)}}]};void 0!==I.displayModeBar&&(p.displayModeBar=I.displayModeBar);var f={data:c,layout:d,config:p};return D.onPlotCreating.fire(this.model,f),E.a.newPlot(e,f.data,f.layout,f.config)},e.prototype.destroy=function(e){E.a.purge(e),this._chart=void 0},e}(),I=function(e){function t(i,r,n,s){var o=e.call(this,i,r,n,s)||this;return o.chartTypes=t.types,o.chartType=o.chartTypes[0],o._chartAdapter=new R(o),o}return Object(o.b)(t,e),t.prototype.destroyContent=function(t){this._chartAdapter.destroy(t.children[0]),e.prototype.destroyContent.call(this,t)},t.prototype.renderContent=function(e){var t=this,i=h.b.createElement("div");e.appendChild(i),this._chartAdapter.create(i).then((function(){t.afterRender(t.contentContainer)}))},t.displayModeBar=void 0,t.types=["gauge","bullet"],t}(c);a.registerVisualizer("number",I),a.registerVisualizer("rating",I),a.registerVisualizer("expression",I);var j={en:["...","a","about","above","across","after","again","against","all","almost","alone","along","already","also","although","always","among","an","and","another","any","anybody","anyone","anything","anywhere","are","area","areas","around","as","ask","asked","asking","asks","at","away","b","back","backed","backing","backs","be","became","because","become","becomes","been","before","began","behind","being","beings","best","better","between","big","both","but","by","c","came","can","cannot","case","cases","certain","certainly","clear","clearly","come","could","d","did","differ","different","differently","do","does","done","down","down","downed","downing","downs","during","e","each","early","either","end","ended","ending","ends","enough","even","evenly","ever","every","everybody","everyone","everything","everywhere","f","face","faces","fact","facts","far","felt","few","find","finds","first","for","four","from","full","fully","further","furthered","furthering","furthers","g","gave","general","generally","get","gets","give","given","gives","go","going","good","goods","got","great","greater","greatest","group","grouped","grouping","groups","h","had","has","have","having","he","her","here","herself","high","high","high","higher","highest","him","himself","his","how","however","i","if","important","in","interest","interested","interesting","interests","into","is","it","its","itself","j","just","k","keep","keeps","kind","knew","know","known","knows","l","large","largely","last","later","latest","least","less","let","lets","like","likely","long","longer","longest","m","made","make","making","man","many","may","me","member","members","men","might","more","most","mostly","mr","mrs","much","must","my","myself","n","necessary","need","needed","needing","needs","never","new","new","newer","newest","next","no","nobody","non","noone","not","nothing","now","nowhere","number","numbers","o","of","off","often","old","older","oldest","on","once","one","only","open","opened","opening","opens","or","order","ordered","ordering","orders","other","others","our","out","over","p","part","parted","parting","parts","per","perhaps","place","places","point","pointed","pointing","points","possible","present","presented","presenting","presents","problem","problems","put","puts","q","quite","r","rather","really","right","right","room","rooms","s","said","same","saw","say","says","second","seconds","see","seem","seemed","seeming","seems","sees","several","shall","she","should","show","showed","showing","shows","side","sides","since","small","smaller","smallest","so","some","somebody","someone","something","somewhere","state","states","still","still","such","sure","t","take","taken","than","that","the","their","them","then","there","therefore","these","they","thing","things","think","thinks","this","those","though","thought","thoughts","three","through","thus","to","today","together","too","took","toward","turn","turned","turning","turns","two","u","under","until","up","upon","us","use","used","uses","v","very","w","want","wanted","wanting","wants","was","way","ways","we","well","wells","went","were","what","when","where","whether","which","while","who","whole","whose","why","will","with","within","without","work","worked","working","works","would","x","y","year","years","yet","you","young","younger","youngest","your","yours","z"],no:["...","alle","andre","arbeid","at","av","bare","begge","ble","blei","bli","blir","blitt","bort","bruke","både","båe","da","de","deg","dei","deim","deira","deires","dem","den","denne","der","dere","deres","det","dette","di","din","disse","ditt","du","dykk","dykkar","då","eg","ein","eit","eitt","eller","elles","en","ene","eneste","enhver","enn","er","et","ett","etter","folk","for","fordi","forsøke","fra","få","før","før","først","gjorde","gjøre","god","gå","ha","hadde","han","hans","har","hennar","henne","hennes","her","hjå","ho","hoe","honom","hoss","hossen","hun","hva","hvem","hver","hvilke","hvilken","hvis","hvor","hvordan","hvorfor","i","ikke","ikkje","ingen","ingi","inkje","inn","innen","inni","ja","jeg","kan","kom","korleis","korso","kun","kunne","kva","kvar","kvarhelst","kven","kvi","kvifor","lage","lang","lik","like","makt","man","mange","me","med","medan","meg","meget","mellom","men","mens","mer","mest","mi","min","mine","mitt","mot","mye","mykje","må","måte","navn","ned","nei","no","noe","noen","noka","noko","nokon","nokor","nokre","ny","nå","når","og","også","om","opp","oss","over","part","punkt","på","samme","seg","selv","si","sia","sidan","siden","sin","sine","sist","sitt","sjøl","skal","skulle","slik","slutt","so","som","somme","somt","start","stille","så","sånn","tid","til","tilbake","tilstand","um","under","upp","ut","uten","var","vart","varte","ved","verdi","vere","verte","vi","vil","ville","vite","vore","vors","vort","vår","være","vært","vøre","vørt","æ","å"],nl:["de","en","van","ik","te","dat","die","in","een","hij","het","niet","zijn","is","was","op","aan","met","als","voor","had","er","maar","om","hem","dan","zou","of","wat","mijn","men","dit","zo","door","over","ze","zich","bij","ook","tot","je","mij","uit","der","daar","haar","naar","heb","hoe","heeft","hebben","deze","u","want","nog","zal","me","zij","nu","ge","geen","omdat","iets","worden","toch","al","waren","veel","meer","doen","toen","moet","ben","zonder","kan","hun","dus","alles","onder","ja","eens","hier","wie","werd","altijd","doch","wordt","wezen","kunnen","ons","zelf","tegen","na","reeds","wil","kon","niets","uw","iemand","geweest","andere"],es:["...","a","actualmente","adelante","además","afirmó","agregó","ahora","ahí","al","algo","alguna","algunas","alguno","algunos","algún","alrededor","ambos","ampleamos","ante","anterior","antes","apenas","aproximadamente","aquel","aquellas","aquellos","aqui","aquí","arriba","aseguró","así","atras","aunque","ayer","añadió","aún","bajo","bastante","bien","buen","buena","buenas","bueno","buenos","cada","casi","cerca","cierta","ciertas","cierto","ciertos","cinco","comentó","como","con","conocer","conseguimos","conseguir","considera","consideró","consigo","consigue","consiguen","consigues","contra","cosas","creo","cual","cuales","cualquier","cuando","cuanto","cuatro","cuenta","cómo","da","dado","dan","dar","de","debe","deben","debido","decir","dejó","del","demás","dentro","desde","después","dice","dicen","dicho","dieron","diferente","diferentes","dijeron","dijo","dio","donde","dos","durante","e","ejemplo","el","ella","ellas","ello","ellos","embargo","empleais","emplean","emplear","empleas","empleo","en","encima","encuentra","entonces","entre","era","erais","eramos","eran","eras","eres","es","esa","esas","ese","eso","esos","esta","estaba","estabais","estaban","estabas","estad","estada","estadas","estado","estados","estais","estamos","estan","estando","estar","estaremos","estará","estarán","estarás","estaré","estaréis","estaría","estaríais","estaríamos","estarían","estarías","estas","este","estemos","esto","estos","estoy","estuve","estuviera","estuvierais","estuvieran","estuvieras","estuvieron","estuviese","estuvieseis","estuviesen","estuvieses","estuvimos","estuviste","estuvisteis","estuviéramos","estuviésemos","estuvo","está","estábamos","estáis","están","estás","esté","estéis","estén","estés","ex","existe","existen","explicó","expresó","fin","fue","fuera","fuerais","fueran","fueras","fueron","fuese","fueseis","fuesen","fueses","fui","fuimos","fuiste","fuisteis","fuéramos","fuésemos","gran","grandes","gueno","ha","haber","habida","habidas","habido","habidos","habiendo","habremos","habrá","habrán","habrás","habré","habréis","habría","habríais","habríamos","habrían","habrías","habéis","había","habíais","habíamos","habían","habías","hace","haceis","hacemos","hacen","hacer","hacerlo","haces","hacia","haciendo","hago","han","has","hasta","hay","haya","hayamos","hayan","hayas","hayáis","he","hecho","hemos","hicieron","hizo","hoy","hube","hubiera","hubierais","hubieran","hubieras","hubieron","hubiese","hubieseis","hubiesen","hubieses","hubimos","hubiste","hubisteis","hubiéramos","hubiésemos","hubo","igual","incluso","indicó","informó","intenta","intentais","intentamos","intentan","intentar","intentas","intento","ir","junto","la","lado","largo","las","le","les","llegó","lleva","llevar","lo","los","luego","lugar","manera","manifestó","mayor","me","mediante","mejor","mencionó","menos","mi","mientras","mio","mis","misma","mismas","mismo","mismos","modo","momento","mucha","muchas","mucho","muchos","muy","más","mí","mía","mías","mío","míos","nada","nadie","ni","ninguna","ningunas","ninguno","ningunos","ningún","no","nos","nosotras","nosotros","nuestra","nuestras","nuestro","nuestros","nueva","nuevas","nuevo","nuevos","nunca","o","ocho","os","otra","otras","otro","otros","para","parece","parte","partir","pasada","pasado","pero","pesar","poca","pocas","poco","pocos","podeis","podemos","poder","podria","podriais","podriamos","podrian","podrias","podrá","podrán","podría","podrían","poner","por","por qué","porque","posible","primer","primera","primero","primeros","principalmente","propia","propias","propio","propios","próximo","próximos","pudo","pueda","puede","pueden","puedo","pues","que","quedó","queremos","quien","quienes","quiere","quién","qué","realizado","realizar","realizó","respecto","sabe","sabeis","sabemos","saben","saber","sabes","se","sea","seamos","sean","seas","segunda","segundo","según","seis","ser","seremos","será","serán","serás","seré","seréis","sería","seríais","seríamos","serían","serías","seáis","señaló","si","sido","siempre","siendo","siete","sigue","siguiente","sin","sino","sobre","sois","sola","solamente","solas","solo","solos","somos","son","soy","su","sus","suya","suyas","suyo","suyos","sí","sólo","tal","también","tampoco","tan","tanto","te","tendremos","tendrá","tendrán","tendrás","tendré","tendréis","tendría","tendríais","tendríamos","tendrían","tendrías","tened","teneis","tenemos","tener","tenga","tengamos","tengan","tengas","tengo","tengáis","tenida","tenidas","tenido","tenidos","teniendo","tenéis","tenía","teníais","teníamos","tenían","tenías","tercera","ti","tiempo","tiene","tienen","tienes","toda","todas","todavía","todo","todos","total","trabaja","trabajais","trabajamos","trabajan","trabajar","trabajas","trabajo","tras","trata","través","tres","tu","tus","tuve","tuviera","tuvierais","tuvieran","tuvieras","tuvieron","tuviese","tuvieseis","tuviesen","tuvieses","tuvimos","tuviste","tuvisteis","tuviéramos","tuviésemos","tuvo","tuya","tuyas","tuyo","tuyos","tú","ultimo","un","una","unas","uno","unos","usa","usais","usamos","usan","usar","usas","uso","usted","va","vais","valor","vamos","van","varias","varios","vaya","veces","ver","verdad","verdadera","verdadero","vez","vosotras","vosotros","voy","vuestra","vuestras","vuestro","vuestros","y","ya","yo","él","éramos","ésta","éstas","éste","éstos","última","últimas","último","últimos"]},N={getStopWords:function(e){return void 0===e&&(e=""),j[e||"en"]||[]}},q=i(21),H=i.n(q),F=function(){function e(e){this.model=e}return Object.defineProperty(e.prototype,"wordcloud",{get:function(){return this._wordcloud},enumerable:!1,configurable:!0}),e.prototype.create=function(t){var i=this,n=this.model.getData(),s=(this.model.getColors(),h.b.createElement("canvas","")),o=h.b.createElement("p","",{innerText:r.a.getString("noResults")});if(0!==n.length){t.appendChild(s);var a={canvas:s,config:{list:n,weightFactor:e.weightFactor,abortThreshold:e.abortThreshold,drawOutOfBound:e.drawOutOfBound,shrinkToFit:e.shrinkToFit,fontFamily:"Segoe UI Bold, sans-serif",color:function(e,t){return i.model.getRandomColor()},rotateRatio:.5,rotationSteps:2,backgroundColor:this.model.backgroundColor,click:function(e){console.log(e[0]+": "+e[1])}}};return e.onWordcloudCreating.fire(this.model,a),this._wordcloud=H()(a.canvas,a.config),this._wordcloud}t.appendChild(o)},e.prototype.destroy=function(e){this._wordcloud=void 0},e.drawOutOfBound=!1,e.shrinkToFit=!0,e.abortThreshold=void 0,e.weightFactor=20,e.onWordcloudCreating=new n.Event,e}(),G=function(e){function t(t,i,r,n){var s=e.call(this,t,i,r,n||"wordcloud")||this;return s._wordcloudAdapter=new F(s),s}return Object(o.b)(t,e),t.prototype.getData=function(){var e=this,t={},i=[],n=r.a.currentLocale;i=n?N.getStopWords(n):N.getStopWords();var s=function(e){(e=""+e).length>15&&(e=e.substring(0,14)+"..."),e&&e.split(" ").forEach((function(e){(e=function(e){return-1!==i.indexOf(e)?"":e}(e.toLowerCase()||""))&&(t[e]?t[e]++:t[e]=1)}))};return this.data.forEach((function(t){var i=t[e.question.name];i&&(Array.isArray(i)?i.forEach(s):"object"==typeof i?Object.keys(i).forEach((function(e){return s(i[e])})):s(i))})),Object.keys(t).map((function(e){return[e,t[e]]}))},t.prototype.destroyContent=function(t){this._wordcloudAdapter.destroy(t),e.prototype.destroyContent.call(this,t)},t.prototype.renderContent=function(e){this._wordcloudAdapter.create(e),this.afterRender(this.contentContainer)},t.prototype.destroy=function(){this._wordcloudAdapter.destroy(this.contentContainer),e.prototype.destroy.call(this)},t}(u);a.registerVisualizer("text",G),a.registerVisualizer("comment",G),a.registerVisualizer("multipletext",G);i(27);var X=function(){function e(e){this.model=e}return e.prototype.create=function(e){var t=this.model.getData(),i=t.columnsCount,n=t.data,s=h.b.createElement("p","",{innerText:r.a.getString("noResults")});if(0!==n.length){var o=h.b.createElement("table","sa-text-table");o.style.backgroundColor=this.model.backgroundColor,e.appendChild(o),n.forEach((function(e){for(var t=h.b.createElement("tr"),r=0;r<i;r++){var n=h.b.createElement("td","sa-text-table__cell",{textContent:e[r]});t.appendChild(n)}o.appendChild(t)})),e.className="sa-text-table__container",e.appendChild(o)}else e.appendChild(s)},e.prototype.destroy=function(e){e.innerHTML=""},e}(),Y=function(e){function t(t,i,r,n){var s=e.call(this,t,i,r,n||"text")||this;return s._textTableAdapter=new X(s),s}return Object(o.b)(t,e),t.prototype.getData=function(){var e=this,t=[],i=0;return this.data.forEach((function(r){var n=r[e.question.name],s=[];n&&(Array.isArray(n)?s.concat(n):"object"==typeof n?Object.keys(n).forEach((function(e){return s.push(n[e])})):s.push(n),t.push(s),s.length>i&&(i=s.length))})),{columnsCount:i,data:t}},t.prototype.destroyContent=function(t){this._textTableAdapter.destroy(t),e.prototype.destroyContent.call(this,t)},t.prototype.renderContent=function(e){this._textTableAdapter.create(e),this.afterRender(this.contentContainer)},t.prototype.destroy=function(){this._textTableAdapter.destroy(this.contentContainer),e.prototype.destroy.call(this)},t}(u);a.registerVisualizer("text",Y),a.registerVisualizer("comment",Y),a.registerVisualizer("multipletext",Y);i(28);var Q=function(){function e(e){this.model=e}return e.prototype.create=function(e){var t=this,i=this.model.getAnswersData(),n=i.datasets,s=i.labels,o=(i.colors,i.texts),a=(i.seriesLabels.length,h.b.createElement("p","",{innerText:r.a.getString("noResults")}));0!==n.length&&0!==n[0].length?n.forEach((function(i,n){var a=h.b.createElement("table","sa-choices-table");a.style.backgroundColor=t.model.backgroundColor,e.appendChild(a);var l=h.b.createElement("tr"),u=h.b.createElement("th","sa-choices-table__cell-header",{textContent:r.a.getString("answer")});l.appendChild(u);var c=h.b.createElement("th","sa-choices-table__cell-header",{textContent:""});l.appendChild(c);var d=h.b.createElement("th","sa-choices-table__cell-header",{textContent:r.a.getString("percent")});l.appendChild(d);var p=h.b.createElement("th","sa-choices-table__cell-header",{textContent:r.a.getString("responses")});l.appendChild(p),a.appendChild(l),i.forEach((function(e,t){var i=h.b.createElement("tr"),r=h.b.createElement("td","sa-choices-table__cell",{textContent:s[t]});i.appendChild(r);var l=h.b.createElement("td","sa-choices-table__cell"),u=h.b.createElement("div","sa-choices-sparkline"),c=h.b.createElement("div","sa-choices-sparkline-value");c.style.width=o[n][t]+"%",u.appendChild(c),l.appendChild(u),i.appendChild(l);var d=h.b.createElement("td","sa-choices-table__cell sa-choices-table__cell-value",{textContent:o[n][t]+"%"});i.appendChild(d);var p=h.b.createElement("td","sa-choices-table__cell sa-choices-table__cell-value",{textContent:e});i.appendChild(p),a.appendChild(i)})),e.className="sa-choices-table__container",e.appendChild(a)})):e.appendChild(a)},e.prototype.destroy=function(e){e.innerHTML=""},e}(),U=function(e){function t(t,i,r,n){var s=e.call(this,t,i,r,n||"choices")||this;return s._choicesTableAdapter=new Q(s),s.answersOrder="asc",s.showPercentages=!0,s}return Object(o.b)(t,e),t.prototype.destroyContent=function(t){this._choicesTableAdapter.destroy(t),e.prototype.destroyContent.call(this,t)},t.prototype.renderContent=function(e){this._choicesTableAdapter.create(e),this.afterRender(this.contentContainer)},t.prototype.destroy=function(){this._choicesTableAdapter.destroy(this.contentContainer),e.prototype.destroy.call(this)},t}(d)}])}));
|
|
23
|
+
e.exports=function(){"use strict";var e={};function t(){this._events={},this._queue=[],this._counter=0,this._isDestroyed=!1}t.prototype.on=function(e,t){if(this._isDestroyed)return this;var i=this._events[e];return i||(i=this._events[e]=[]),i.push(t),this},t.prototype.off=function(e,t){if(this._isDestroyed)return this;var i=this._events[e];if(!i||!i.length)return this;if(!t)return i.length=0,this;for(var r=i.length;r--;)t===i[r]&&i.splice(r,1);return this},t.prototype.emit=function(e,t,i,r){if(this._isDestroyed)return this;var n=this._events[e];if(!n||!n.length)return this;var s,o=this._queue,a=o.length,l=arguments.length-1;for(s=0;s<n.length;s++)o.push(n[s]);for(++this._counter,s=a,a=o.length;s<a;s++)if(0===l?o[s]():1===l?o[s](t):2===l?o[s](t,i):o[s](t,i,r),this._isDestroyed)return this;return--this._counter,this._counter||(o.length=0),this},t.prototype.destroy=function(){if(this._isDestroyed)return this;var e,t=this._events;for(e in this._isDestroyed=!0,this._queue.length=this._counter=0,t)t[e]&&(t[e].length=0,t[e]=void 0);return this};var i="transform",r="transform",n=window.document.documentElement.style,s=!1;["","Webkit","Moz","O","ms"].forEach((function(e){if(!s){var t=e?e+"Transform":"transform";void 0!==n[t]&&(e=e.toLowerCase(),i=e?"-"+e+"-transform":"transform",r=t,s=!0)}}));var o="function"==typeof WeakMap?new WeakMap:null;function a(e,t){var r=o&&o.get(e);return r||(r=window.getComputedStyle(e,null),o&&o.set(e,r)),r.getPropertyValue("transform"===t?i:t)}var l=/([A-Z])/g;function h(e){return e.replace(l,"-$1").toLowerCase()}function u(e){return"function"==typeof e}function c(e,t){for(var i in t)e.style["transform"===i?r:i]=t[i]}function d(e){this._element=e,this._animation=null,this._callback=null,this._props=[],this._values=[],this._keyframes=[],this._options={},this._isDestroyed=!1,this._onFinish=this._onFinish.bind(this)}d.prototype.start=function(e,t,i){if(!this._isDestroyed){var r=this._animation,n=this._props,s=this._values,o=i||0,a=!1;if(r){var l,h=0;for(var d in t)if(++h,-1===(l=n.indexOf(d))||t[d]!==s[l]){a=!0;break}a||h===n.length||(a=!0)}if(a&&r.cancel(),this._callback=u(o.onFinish)?o.onFinish:null,!r||a){for(d in n.length=s.length=0,t)n.push(d),s.push(t[d]);var p=this._keyframes;p[0]=e,p[1]=t;var f=this._options;f.duration=o.duration||300,f.easing=o.easing||"ease";var m=this._element;(r=m.animate(p,f)).onfinish=this._onFinish,this._animation=r,c(m,t)}}},d.prototype.stop=function(e){if(!this._isDestroyed&&this._animation){var t,i,n,s=this._element,o=this._props,l=this._values;if(e)c(s,e);else for(n=0;n<o.length;n++)i=a(s,h(t=o[n])),s.style["transform"===t?r:t]=i;this._animation.cancel(),this._animation=this._callback=null,o.length=l.length=0}},d.prototype.isAnimating=function(){return!!this._animation},d.prototype.destroy=function(){this._isDestroyed||(this.stop(),this._element=this._options=this._keyframes=null,this._isDestroyed=!0)},d.prototype._onFinish=function(){var e=this._callback;this._animation=this._callback=null,this._props.length=this._values.length=0,e&&e()};var p=["","webkit","moz","ms","o","Webkit","Moz","MS","O"];function f(e,t){for(var i,r,n=t[0].toUpperCase()+t.slice(1),s=0;s<p.length;){if((r=(i=p[s])?i+n:t)in e)return r;++s}return null}var m=(window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame||function(e){return this.setTimeout((function(){e(1e3/60)}),1e3/60)}).bind(window),g=!1;try{var _=Object.defineProperty({},"passive",{get:function(){g=!0}});window.addEventListener("testPassive",null,_),window.removeEventListener("testPassive",null,_)}catch(e){}var y="start",v="move",b="end",w="cancel",C=!(!("ontouchstart"in window)&&!window.TouchEvent),S=!!window.PointerEvent,T=!!window.navigator.msPointerEnabled,A=/(android)/i.test(window.navigator.userAgent),D=!!g&&{passive:!0},E=f(window.document.documentElement.style,"touchAction");function P(e,i){this._element=e,this._emitter=new t,this._isDestroyed=!1,this._cssProps={},this._touchAction="",this._startEvent=null,this._pointerId=null,this._startTime=0,this._startX=0,this._startY=0,this._currentX=0,this._currentY=0,this._preStartCheck=this._preStartCheck.bind(this),this._abortNonCancelable=this._abortNonCancelable.bind(this),this._onStart=this._onStart.bind(this),this._onMove=this._onMove.bind(this),this._onCancel=this._onCancel.bind(this),this._onEnd=this._onEnd.bind(this),this.setCssProps(i),this._touchAction||this.setTouchAction("auto"),e.addEventListener("dragstart",P._preventDefault,!1),e.addEventListener(P._events.start,this._preStartCheck,D),!C||S||T||e.addEventListener(P._mouseEvents.start,this._preStartCheck,D)}function x(){this._nextStep=null,this._queue=[],this._reads={},this._writes={},this._batch=[],this._batchReads={},this._batchWrites={},this._step=this._step.bind(this)}P._pointerEvents={start:"pointerdown",move:"pointermove",cancel:"pointercancel",end:"pointerup"},P._msPointerEvents={start:"MSPointerDown",move:"MSPointerMove",cancel:"MSPointerCancel",end:"MSPointerUp"},P._touchEvents={start:"touchstart",move:"touchmove",cancel:"touchcancel",end:"touchend"},P._mouseEvents={start:"mousedown",move:"mousemove",cancel:"",end:"mouseup"},P._events=S?P._pointerEvents:T?P._msPointerEvents:C?P._touchEvents:P._mouseEvents,P._emitter=new t,P._activeInstances=[],P._preventDefault=function(e){e.preventDefault&&!1!==e.cancelable&&e.preventDefault()},P._activateInstance=function(e){P._activeInstances.indexOf(e)>-1||(P._activeInstances.push(e),P._emitter.on(v,e._onMove),P._emitter.on(w,e._onCancel),P._emitter.on(b,e._onEnd),1===P._activeInstances.length&&P._bindListeners())},P._deactivateInstance=function(e){var t=P._activeInstances.indexOf(e);-1!==t&&(P._activeInstances.splice(t,1),P._emitter.off(v,e._onMove),P._emitter.off(w,e._onCancel),P._emitter.off(b,e._onEnd),P._activeInstances.length||P._unbindListeners())},P._bindListeners=function(){var e=P._events;window.addEventListener(e.move,P._onMove,D),window.addEventListener(e.end,P._onEnd,D),e.cancel&&window.addEventListener(e.cancel,P._onCancel,D)},P._unbindListeners=function(){var e=P._events;window.removeEventListener(e.move,P._onMove,D),window.removeEventListener(e.end,P._onEnd,D),e.cancel&&window.removeEventListener(e.cancel,P._onCancel,D)},P._getEventPointerId=function(e){return"number"==typeof e.pointerId?e.pointerId:e.changedTouches?e.changedTouches[0]?e.changedTouches[0].identifier:null:1},P._getTouchById=function(e,t){if("number"==typeof e.pointerId)return e.pointerId===t?e:null;if(e.changedTouches){for(var i=0;i<e.changedTouches.length;i++)if(e.changedTouches[i].identifier===t)return e.changedTouches[i];return null}return e},P._onMove=function(e){P._emitter.emit(v,e)},P._onCancel=function(e){P._emitter.emit(w,e)},P._onEnd=function(e){P._emitter.emit(b,e)},P.prototype._reset=function(){this._isDestroyed||(this._pointerId=null,this._startTime=0,this._startX=0,this._startY=0,this._currentX=0,this._currentY=0,this._startEvent=null,this._element.removeEventListener(P._touchEvents.start,this._abortNonCancelable,D),P._deactivateInstance(this))},P.prototype._createEvent=function(e,t){var i=this._getTrackedTouch(t);return{type:e,srcEvent:t,distance:this.getDistance(),deltaX:this.getDeltaX(),deltaY:this.getDeltaY(),deltaTime:e===y?0:this.getDeltaTime(),isFirst:e===y,isFinal:e===b||e===w,identifier:this._pointerId,screenX:i.screenX,screenY:i.screenY,clientX:i.clientX,clientY:i.clientY,pageX:i.pageX,pageY:i.pageY,target:i.target}},P.prototype._emit=function(e,t){this._emitter.emit(e,this._createEvent(e,t))},P.prototype._getTrackedTouch=function(e){return null===this._pointerId?null:P._getTouchById(e,this._pointerId)},P.prototype._preStartCheck=function(e){this._isDestroyed||this.isDragging()||A&&!1===e.cancelable||e.button||(this._pointerId=P._getEventPointerId(e),null!==this._pointerId&&(this._startEvent=e,C&&(S||T)?(A&&this._element.addEventListener(P._touchEvents.start,this._abortNonCancelable,D),m(this._onStart)):this._onStart()))},P.prototype._abortNonCancelable=function(e){this._element.removeEventListener(P._touchEvents.start,this._abortNonCancelable,D),this._startEvent&&!1===e.cancelable&&(this._pointerId=null,this._startEvent=null)},P.prototype._onStart=function(){var e=this._startEvent;if(e){this._startEvent=null;var t=this._getTrackedTouch(e);t&&(this._startX=this._currentX=t.clientX,this._startY=this._currentY=t.clientY,this._startTime=Date.now(),this._emit(y,e),P._activateInstance(this))}},P.prototype._onMove=function(e){var t=this._getTrackedTouch(e);t&&(this._currentX=t.clientX,this._currentY=t.clientY,this._emit(v,e))},P.prototype._onCancel=function(e){this._getTrackedTouch(e)&&(this._emit(w,e),this._reset())},P.prototype._onEnd=function(e){this._getTrackedTouch(e)&&(this._emit(b,e),this._reset())},P.prototype.isDragging=function(){return null!==this._pointerId},P.prototype.setTouchAction=function(e){this._touchAction=e,E&&(this._cssProps[E]="",this._element.style[E]=e),C&&(this._element.removeEventListener(P._touchEvents.start,P._preventDefault,!1),this._element.style[E]!==e&&this._element.addEventListener(P._touchEvents.start,P._preventDefault,!1))},P.prototype.setCssProps=function(e){if(e){var t,i,r=this._cssProps,n=this._element;for(t in r)n.style[t]=r[t],delete r[t];for(t in e)e[t]&&("touchAction"!==t?(i=f(n.style,t))&&(r[i]="",n.style[i]=e[t]):this.setTouchAction(e[t]))}},P.prototype.getDeltaX=function(){return this._currentX-this._startX},P.prototype.getDeltaY=function(){return this._currentY-this._startY},P.prototype.getDistance=function(){var e=this.getDeltaX(),t=this.getDeltaY();return Math.sqrt(e*e+t*t)},P.prototype.getDeltaTime=function(){return this._startTime?Date.now()-this._startTime:0},P.prototype.on=function(e,t){this._emitter.on(e,t)},P.prototype.off=function(e,t){this._emitter.off(eventName,t)},P.prototype.destroy=function(){if(!this._isDestroyed){var e=this._element,t=P._events;for(var i in this._reset(),this._emitter.destroy(),e.removeEventListener(t.start,this._preStartCheck,D),e.removeEventListener(P._mouseEvents.start,this._preStartCheck,D),e.removeEventListener("dragstart",P._preventDefault,!1),e.removeEventListener(P._touchEvents.start,P._preventDefault,!1),this._cssProps)e.style[i]=this._cssProps[i],delete this._cssProps[i];this._element=null,this._isDestroyed=!0}},x.prototype.add=function(e,t,i,r){var n=this._queue.indexOf(e);n>-1&&(this._queue[n]=void 0),r?this._queue.unshift(e):this._queue.push(e),this._reads[e]=t,this._writes[e]=i,this._nextStep||(this._nextStep=m(this._step))},x.prototype.cancel=function(e){var t=this._queue.indexOf(e);t>-1&&(this._queue[t]=void 0,delete this._reads[e],delete this._writes[e])},x.prototype._step=function(){var e,t,i=this._queue,r=this._reads,n=this._writes,s=this._batch,o=this._batchReads,a=this._batchWrites,l=i.length;for(this._nextStep=null,t=0;t<l;t++)(e=i[t])&&(s.push(e),o[e]=r[e],delete r[e],a[e]=n[e],delete n[e]);for(i.length=0,t=0;t<l;t++)o[e=s[t]]&&(o[e](),delete o[e]);for(t=0;t<l;t++)a[e=s[t]]&&(a[e](),delete a[e]);s.length=0,!this._nextStep&&i.length&&(this._nextStep=m(this._step))};var k=new x;function O(e){return k.cancel(e+"visibility")}function V(e){return k.cancel(e+"move")}function z(e){return k.cancel(e+"scroll")}function B(e){return k.cancel(e+"placeholder")}var L=window.Element.prototype,M=L.matches||L.matchesSelector||L.webkitMatchesSelector||L.mozMatchesSelector||L.msMatchesSelector||L.oMatchesSelector||function(){return!1};function R(e,t){return M.call(e,t)}function I(e,t){e.classList?e.classList.add(t):R(e,"."+t)||(e.className+=" "+t)}var j=[];function N(e,t,i){var r="number"==typeof i?i:-1;r<0&&(r=e.length-r+1),e.splice.apply(e,j.concat(r,0,t)),j.length=0}function q(e,t,i){var r=e.length,n=Math.max(0,i?r:r-1);return t>n?n:t<0?Math.max(n+t+1,0):t}function H(e,t,i){if(!(e.length<2)){var r=q(e,t),n=q(e,i);r!==n&&e.splice(n,0,e.splice(r,1)[0])}}function F(e,t,i){if(!(e.length<2)){var r,n=q(e,t),s=q(e,i);n!==s&&(r=e[n],e[n]=e[s],e[s]=r)}}var G=0;function X(e,t){var i,r=++G+"debounce";return t>0?function(n){void 0!==i&&(i=window.clearTimeout(i),k.cancel(r),"finish"===n&&e()),"cancel"!==n&&"finish"!==n&&(i=window.setTimeout((function(){i=void 0,k.add(r,e,null,!0)}),t))}:function(t){"cancel"!==t&&e()}}function Y(e){var t=a(e,"transform");if(!t||"none"===t)return!1;var i=a(e,"display");return"inline"!==i&&"none"!==i}function Q(e,t){for(var i=window.document,r=(t?e:e.parentElement)||i;r&&r!==i&&"static"===a(r,"position")&&!Y(r);)r=r.parentElement||i;return r}function U(e,t){return parseFloat(a(e,t))||0}var W={},K={},Z={};function J(e,t){var i,r=t||{};return r.left=0,r.top=0,e===document||(r.left=window.pageXOffset||0,r.top=window.pageYOffset||0,e.self===window.self||(i=e.getBoundingClientRect(),r.left+=i.left,r.top+=i.top,r.left+=U(e,"border-left-width"),r.top+=U(e,"border-top-width"))),r}function $(e,t,i){return Z.left=0,Z.top=0,e===t||i&&(e=Q(e,!0))===(t=Q(t,!0))||(J(e,W),J(t,K),Z.left=K.left-W.left,Z.top=K.top-W.top),Z}function ee(e){var t=a(e,"overflow");return"auto"===t||"scroll"===t||"auto"===(t=a(e,"overflow-x"))||"scroll"===t||"auto"===(t=a(e,"overflow-y"))||"scroll"===t}function te(e,t,i){for(var r=i||[],n=t?e:e.parentNode;n&&n!==document;)n.getRootNode&&n instanceof DocumentFragment?n=n.getRootNode().host:(ee(n)&&r.push(n),n=n.parentNode);return r.push(window),r}var ie,re,ne,se,oe={},ae=/^matrix3d/,le=/([^,]*,){4}/,he=/([^,]*,){12}/,ue=/[^,]*,/;function ce(e){oe.x=0,oe.y=0;var t=a(e,"transform");if(!t||"none"===t)return oe;var i=ae.test(t),r=t.replace(i?he:le,""),n=r.replace(ue,"");return oe.x=parseFloat(r)||0,oe.y=parseFloat(n)||0,oe}function de(e,t){return"translateX("+e+"px) translateY("+t+"px)"}function pe(e,t){e.classList?e.classList.remove(t):R(e,"."+t)&&(e.className=(" "+e.className+" ").replace(" "+t+" "," ").trim())}function fe(e){var t=e._element,i=e.getGrid(),r=i._settings;this._item=e,this._gridId=i._id,this._isDestroyed=!1,this._isMigrating=!1,this._startPredicate=u(r.dragStartPredicate)?r.dragStartPredicate:fe.defaultStartPredicate,this._startPredicateState=0,this._startPredicateResult=void 0,this._hBlockedIndex=null,this._hX1=0,this._hX2=0,this._hY1=0,this._hY2=0,this._reset(),this._preStartCheck=this._preStartCheck.bind(this),this._preEndCheck=this._preEndCheck.bind(this),this._onScroll=this._onScroll.bind(this),this._prepareMove=this._prepareMove.bind(this),this._applyMove=this._applyMove.bind(this),this._prepareScroll=this._prepareScroll.bind(this),this._applyScroll=this._applyScroll.bind(this),this._checkOverlap=this._checkOverlap.bind(this);var n=r.dragSortHeuristics.sortInterval;this._checkOverlapDebounce=X(this._checkOverlap,n),this._dragger=new P(t,r.dragCssProps),this._dragger.on("start",this._preStartCheck),this._dragger.on("move",this._preStartCheck),this._dragger.on("cancel",this._preEndCheck),this._dragger.on("end",this._preEndCheck)}function me(e,t){return e.left+e.width<=t.left||t.left+t.width<=e.left||e.top+e.height<=t.top||t.top+t.height<=e.top?0:(Math.min(e.left+e.width,t.left+t.width)-Math.max(e.left,t.left))*(Math.min(e.top+e.height,t.top+t.height)-Math.max(e.top,t.top))/(Math.min(e.width,t.width)*Math.min(e.height,t.height))*100}function ge(e){this._item=e,this._animate=new d,this._element=null,this._className="",this._didMigrate=!1,this._resetAfterLayout=!1,this._currentLeft=0,this._currentTop=0,this._nextLeft=0,this._nextTop=0,this._setupAnimation=this._setupAnimation.bind(this),this._startAnimation=this._startAnimation.bind(this),this._onLayoutStart=this._onLayoutStart.bind(this),this._onLayoutEnd=this._onLayoutEnd.bind(this),this._onReleaseEnd=this._onReleaseEnd.bind(this),this._onMigrate=this._onMigrate.bind(this)}function _e(){this._queue=[],this._isDestroyed=!1}function ye(e){this._item=e,this._isActive=!1,this._isDestroyed=!1,this._isInterrupted=!1,this._currentStyles={},this._targetStyles={},this._currentLeft=0,this._currentTop=0,this._offsetLeft=0,this._offsetTop=0,this._skipNextAnimation=!1,this._animateOptions={onFinish:this._finish.bind(this)},this._queue=new _e,this._setupAnimation=this._setupAnimation.bind(this),this._startAnimation=this._startAnimation.bind(this)}fe.defaultStartPredicate=function(e,t,i){var r=e._drag,n=r._startPredicateData||r._setupStartPredicate(i);if(!t.isFinal)return!(!n.handleElement&&(n.handleElement=r._getStartPredicateHandle(t),!n.handleElement))&&(n.delay&&(n.event=t,n.delayTimer||(n.delayTimer=window.setTimeout((function(){n.delay=0,r._resolveStartPredicate(n.event)&&(r._forceResolveStartPredicate(n.event),r._resetStartPredicate())}),n.delay))),r._resolveStartPredicate(t));r._finishStartPredicate(t)},fe.defaultSortPredicate=(ie={},re={},ne={},se=[],function(e,t){var i=e._drag,r=i._getGrid(),n=t&&"number"==typeof t.threshold?t.threshold:50,s=t&&"swap"===t.action?"swap":"move";ie.width=e._width,ie.height=e._height,ie.left=i._elementClientX,ie.top=i._elementClientY;var o=function(e,t,i){var r,n,s,o,a=null,l=t._settings.dragSort,h=-1;if(!0===l?(se[0]=t,n=se):n=l.call(t,e),!Array.isArray(n))return a;for(o=0;o<n.length;o++)(s=n[o])._isDestroyed||(s._updateBoundingRect(),re.width=s._width,re.height=s._height,re.left=s._left,re.top=s._top,(r=me(ie,re))>i&&r>h&&(h=r,a=s));return se.length=0,a}(e,r,n);if(!o)return!1;var a,l,h,u,c,d=0,p=0,f=-1;for(o===r?(ie.left=i._gridX+e._marginLeft,ie.top=i._gridY+e._marginTop):(o._updateBorders(1,0,1,0),d=o._left+o._borderLeft,p=o._top+o._borderTop),c=0;c<o._items.length;c++)(h=o._items[c])._isActive&&h!==e&&(l=!0,re.width=h._width,re.height=h._height,re.left=h._left+h._marginLeft+d,re.top=h._top+h._marginTop+p,(u=me(ie,re))>f&&(a=c,f=u));return f<n&&e.getGrid()!==o&&(a=l?-1:0,f=1/0),f>=n&&(ne.grid=o,ne.index=a,ne.action=s,ne)}),fe.prototype.stop=function(){var e=this._item,t=e._element,i=this._getGrid();return this._isActive?this._isMigrating?(this._finishMigration(),this):(V(e._id),z(e._id),this._unbindScrollListeners(),this._checkOverlapDebounce("cancel"),t.parentNode!==i._element&&(i._element.appendChild(t),t.style[r]=de(this._gridX,this._gridY)),pe(t,i._settings.itemDraggingClass),this._reset(),this):this},fe.prototype.destroy=function(){return this._isDestroyed||(this.stop(),this._dragger.destroy(),this._isDestroyed=!0),this},fe.prototype._getGrid=function(){return e[this._gridId]||null},fe.prototype._reset=function(){this._isActive=!1,this._container=null,this._containingBlock=null,this._dragEvent=null,this._scrollEvent=null,this._scrollers=[],this._left=0,this._top=0,this._gridX=0,this._gridY=0,this._elementClientX=0,this._elementClientY=0,this._containerDiffX=0,this._containerDiffY=0},fe.prototype._bindScrollListeners=function(){var e,t,i=this._getGrid()._element,r=this._container,n=this._scrollers;if(n.length=0,te(this._item._element,!1,n),r!==i)for(te(i,!0,e=[]),t=0;t<e.length;t++)n.indexOf(e[t])<0&&n.push(e[t]);for(t=0;t<n.length;t++)n[t].addEventListener("scroll",this._onScroll)},fe.prototype._unbindScrollListeners=function(){var e,t=this._scrollers;for(e=0;e<t.length;e++)t[e].removeEventListener("scroll",this._onScroll);t.length=0},fe.prototype._setupStartPredicate=function(e){var t=e||this._getGrid()._settings.dragStartPredicate||0;return this._startPredicateData={distance:Math.abs(t.distance)||0,delay:Math.max(t.delay,0)||0,handle:"string"==typeof t.handle&&t.handle}},fe.prototype._getStartPredicateHandle=function(e){var t=this._startPredicateData,i=this._item._element,r=i;if(!t.handle)return r;for(r=e.target;r&&!R(r,t.handle);)r=r!==i?r.parentElement:null;return r||null},fe.prototype._resolveStartPredicate=function(e){var t=this._startPredicateData;if(!(e.distance<t.distance||t.delay)){var i=t.handleElement.getBoundingClientRect(),r=i.left+(window.pageXOffset||0),n=i.top+(window.pageYOffset||0),s=i.width,o=i.height;return this._resetStartPredicate(),s&&o&&e.pageX>=r&&e.pageX<r+s&&e.pageY>=n&&e.pageY<n+o}},fe.prototype._forceResolveStartPredicate=function(e){this._isDestroyed||1!==this._startPredicateState||(this._startPredicateState=2,this._onStart(e))},fe.prototype._finishStartPredicate=function(e){var t=this._item._element,i=Math.abs(e.deltaX)<2&&Math.abs(e.deltaY)<2&&e.deltaTime<200;this._resetStartPredicate(),i&&function(e){if("a"===e.tagName.toLowerCase()){var t=e.getAttribute("href");if(t){var i=e.getAttribute("target");i&&"_self"!==i?window.open(t,i):window.location.href=t}}}(t)},fe.prototype._resetHeuristics=function(e){this._hBlockedIndex=null,this._hX1=this._hX2=e.clientX,this._hY1=this._hY2=e.clientY},fe.prototype._checkHeuristics=function(e){var t=this._getGrid()._settings.dragSortHeuristics,i=t.minDragDistance;if(i<=0)return this._hBlockedIndex=null,!0;var r=e.clientX,n=e.clientY,s=r-this._hX2,o=n-this._hY2,a=i>3&&t.minBounceBackAngle>0;if(a||(this._hBlockedIndex=null),Math.abs(s)>i||Math.abs(o)>i){if(a){var l=Math.atan2(s,o),h=Math.atan2(this._hX2-this._hX1,this._hY2-this._hY1),u=Math.atan2(Math.sin(l-h),Math.cos(l-h));Math.abs(u)>t.minBounceBackAngle&&(this._hBlockedIndex=null)}return this._hX1=this._hX2,this._hY1=this._hY2,this._hX2=r,this._hY2=n,!0}return!1},fe.prototype._resetStartPredicate=function(){var e=this._startPredicateData;e&&(e.delayTimer&&(e.delayTimer=window.clearTimeout(e.delayTimer)),this._startPredicateData=null)},fe.prototype._checkOverlap=function(){if(this._isActive){var e,t,i,r,n,s,o,a=this._item,l=this._getGrid()._settings;(e=u(l.dragSortPredicate)?l.dragSortPredicate(a,this._dragEvent):fe.defaultSortPredicate(a,l.dragSortPredicate))&&"number"==typeof e.index&&(o=(t=a.getGrid())!==(r=e.grid||t),i=t._items.indexOf(a),n=q(r._items,e.index,o),s="swap"===e.action?"swap":"move",(o||n!==this._hBlockedIndex)&&(o?(this._hBlockedIndex=null,t._hasListeners("beforeSend")&&t._emit("beforeSend",{item:a,fromGrid:t,fromIndex:i,toGrid:r,toIndex:n}),r._hasListeners("beforeReceive")&&r._emit("beforeReceive",{item:a,fromGrid:t,fromIndex:i,toGrid:r,toIndex:n}),a._gridId=r._id,this._isMigrating=a._gridId!==this._gridId,t._items.splice(i,1),N(r._items,a,n),a._sortData=null,t._hasListeners("send")&&t._emit("send",{item:a,fromGrid:t,fromIndex:i,toGrid:r,toIndex:n}),r._hasListeners("receive")&&r._emit("receive",{item:a,fromGrid:t,fromIndex:i,toGrid:r,toIndex:n}),t.layout(),r.layout()):i!==n&&(this._hBlockedIndex=i,("swap"===s?F:H)(t._items,i,n),t._hasListeners("move")&&t._emit("move",{item:a,fromIndex:i,toIndex:n,action:s}),t.layout())))}},fe.prototype._finishMigration=function(){var e,t,i=this._item,n=i._release,s=i._element,o=i._isActive,a=i.getGrid(),l=a._element,h=a._settings,u=h.dragContainer||l,d=this._getGrid()._settings,p=s.parentNode;this._isMigrating=!1,this.destroy(),pe(s,d.itemClass),pe(s,d.itemVisibleClass),pe(s,d.itemHiddenClass),I(s,h.itemClass),I(s,o?h.itemVisibleClass:h.itemHiddenClass),u!==p&&(u.appendChild(s),t=$(p,u,!0),(e=ce(s)).x-=t.left,e.y-=t.top),i._refreshDimensions(),i._refreshSortData(),t=$(u,l,!0),n._containerDiffX=t.left,n._containerDiffY=t.top,i._drag=h.dragEnabled?new fe(i):null,u!==p&&(s.style[r]=de(e.x,e.y)),i._child.removeAttribute("style"),c(i._child,o?h.visibleStyles:h.hiddenStyles),n.start()},fe.prototype._preStartCheck=function(e){0===this._startPredicateState&&(this._startPredicateState=1),1===this._startPredicateState?(this._startPredicateResult=this._startPredicate(this._item,e),!0===this._startPredicateResult?(this._startPredicateState=2,this._onStart(e)):!1===this._startPredicateResult&&(this._startPredicateState=3)):2===this._startPredicateState&&this._isActive&&this._onMove(e)},fe.prototype._preEndCheck=function(e){var t=2===this._startPredicateState;this._startPredicate(this._item,e),this._startPredicateState=0,t&&this._isActive&&this._onEnd(e)},fe.prototype._onStart=function(e){var t=this._item;if(t._isActive){var i,n=t._element,s=this._getGrid(),o=s._settings,a=t._release,l=t._migrate,h=s._element,u=o.dragContainer||h,c=Q(u,!0),d=ce(n),p=d.x,f=d.y,m=n.getBoundingClientRect(),g=u!==h;this._resetHeuristics(e),g&&(i=$(c,h)),t.isPositioning()&&t._layout.stop(!0,{transform:de(p,f)}),l._isActive&&(p-=l._containerDiffX,f-=l._containerDiffY,l.stop(!0,{transform:de(p,f)})),t.isReleasing()&&a._reset(),this._isActive=!0,this._dragEvent=e,this._container=u,this._containingBlock=c,this._elementClientX=m.left,this._elementClientY=m.top,this._left=this._gridX=p,this._top=this._gridY=f,o.dragPlaceholder.enabled&&t._dragPlaceholder.create(),s._emit("dragInit",t,e),g&&(this._containerDiffX=i.left,this._containerDiffY=i.top,n.parentNode===u?(this._gridX=p-this._containerDiffX,this._gridY=f-this._containerDiffY):(this._left=p+this._containerDiffX,this._top=f+this._containerDiffY,u.appendChild(n),n.style[r]=de(this._left,this._top))),I(n,o.itemDraggingClass),this._bindScrollListeners(),s._emit("dragStart",t,e)}},fe.prototype._onMove=function(e){var t=this._item;if(t._isActive){var i,r,n,s=this._getGrid()._settings.dragAxis;if("y"!==s){var o=e.clientX-this._dragEvent.clientX;this._left+=o,this._gridX+=o,this._elementClientX+=o}if("x"!==s){var a=e.clientY-this._dragEvent.clientY;this._top+=a,this._gridY+=a,this._elementClientY+=a}this._dragEvent=e,i=t._id,r=this._prepareMove,n=this._applyMove,k.add(i+"move",r,n,!0)}else this.stop()},fe.prototype._prepareMove=function(){this._item._isActive&&this._getGrid()._settings.dragSort&&this._checkHeuristics(this._dragEvent)&&this._checkOverlapDebounce()},fe.prototype._applyMove=function(){var e=this._item;e._isActive&&(e._element.style[r]=de(this._left,this._top),this._getGrid()._emit("dragMove",e,this._dragEvent))},fe.prototype._onScroll=function(e){var t,i,r,n=this._item;n._isActive?(this._scrollEvent=e,t=n._id,i=this._prepareScroll,r=this._applyScroll,k.add(t+"scroll",i,r,!0)):this.stop()},fe.prototype._prepareScroll=function(){var e=this._item;if(e._isActive){var t,i=e._element,r=this._getGrid(),n=r._settings,s=n.dragAxis,o=r._element,a=i.getBoundingClientRect(),l=this._elementClientX-a.left,h=this._elementClientY-a.top;this._container!==o&&(t=$(this._containingBlock,o),this._containerDiffX=t.left,this._containerDiffY=t.top),"y"!==s&&(this._left+=l,this._gridX=this._left-this._containerDiffX),"x"!==s&&(this._top+=h,this._gridY=this._top-this._containerDiffY),n.dragSort&&this._checkOverlapDebounce()}},fe.prototype._applyScroll=function(){var e=this._item;e._isActive&&(e._element.style[r]=de(this._left,this._top),this._getGrid()._emit("dragScroll",e,this._scrollEvent))},fe.prototype._onEnd=function(e){var t=this._item,i=t._element,r=this._getGrid(),n=r._settings,s=t._release;t._isActive?(V(t._id),z(t._id),n.dragSort&&this._checkOverlapDebounce("finish"),this._unbindScrollListeners(),s._containerDiffX=this._containerDiffX,s._containerDiffY=this._containerDiffY,this._reset(),pe(i,n.itemDraggingClass),r._emit("dragEnd",t,e),this._isMigrating?this._finishMigration():s.start()):this.stop()},ge.prototype._onLayoutStart=function(){var e=this._item,t=e.getGrid(),i=t._items.indexOf(e),r=t._layout.slots[2*i],n=t._layout.slots[2*i+1];if(this._didMigrate||e._left!==r||e._top!==n){var s,o,a;if(r+=e._marginLeft,n+=e._marginTop,!(t._settings.dragPlaceholder.duration>0)||this._didMigrate){B(e._id);var l={transform:de(r,n)};return this._animate.isAnimating()?this._animate.stop(l):c(this._element,l),void(this._didMigrate&&(t.getElement().appendChild(this._element),this._didMigrate=!1))}this._nextLeft=r,this._nextTop=n,s=e._id,o=this._setupAnimation,a=this._startAnimation,k.add(s+"placeholder",o,a)}},ge.prototype._setupAnimation=function(){if(this.isActive()){var e=ce(this._element);this._currentLeft=e.x,this._currentTop=e.y}},ge.prototype._startAnimation=function(){if(this.isActive()){var e=this._animate,t=this._currentLeft,i=this._currentTop,r=this._nextLeft,n=this._nextTop,s={transform:de(r,n)};if(t!==r||i!==n){var o=this._item.getGrid()._settings.dragPlaceholder,a={transform:de(t,i)};e.start(a,s,{duration:o.duration,easing:o.easing,onFinish:this._onLayoutEnd})}else e.isAnimating()&&e.stop(s)}},ge.prototype._onLayoutEnd=function(){this._resetAfterLayout&&this.reset()},ge.prototype._onReleaseEnd=function(e){if(e._id===this._item._id){if(!this._animate.isAnimating())return void this.reset();this._resetAfterLayout=!0}},ge.prototype._onMigrate=function(e){if(e.item===this._item){var t=this._item.getGrid(),i=e.toGrid;t.off("dragReleaseEnd",this._onReleaseEnd),t.off("layoutStart",this._onLayoutStart),t.off("beforeSend",this._onMigrate),i.on("dragReleaseEnd",this._onReleaseEnd),i.on("layoutStart",this._onLayoutStart),i.on("beforeSend",this._onMigrate),this._didMigrate=!0}},ge.prototype.create=function(){if(this.isActive())this._resetAfterLayout=!1;else{var e,t=this._item,i=t.getGrid(),r=i._settings,n=this._animate;e=u(r.dragPlaceholder.createElement)?r.dragPlaceholder.createElement(t):window.document.createElement("div"),this._element=e,n._element=e,this._className=r.itemPlaceholderClass||"",this._className&&I(e,this._className);var s=t._left+t._marginLeft,o=t._top+t._marginTop;c(e,{display:"block",position:"absolute",left:"0",top:"0",width:t._width+"px",height:t._height+"px",transform:de(s,o)}),i.on("layoutStart",this._onLayoutStart),i.on("dragReleaseEnd",this._onReleaseEnd),i.on("beforeSend",this._onMigrate),u(r.dragPlaceholder.onCreate)&&r.dragPlaceholder.onCreate(t,e),i.getElement().appendChild(e)}},ge.prototype.reset=function(){if(this.isActive()){var e=this._element,t=this._item,i=t.getGrid(),r=i._settings,n=this._animate;this._resetAfterLayout=!1,B(t._id),n.stop(),n._element=null,i.off("dragReleaseEnd",this._onReleaseEnd),i.off("layoutStart",this._onLayoutStart),i.off("beforeSend",this._onMigrate),this._className&&(pe(e,this._className),this._className=""),e.parentNode.removeChild(e),this._element=null,u(r.dragPlaceholder.onRemove)&&r.dragPlaceholder.onRemove(t,e)}},ge.prototype.updateDimensions=function(e,t){this.isActive()&&c(this._element,{width:e+"px",height:t+"px"})},ge.prototype.isActive=function(){return!!this._element},ge.prototype.destroy=function(){this.reset(),this._animate.destroy(),this._item=this._animate=null},_e.prototype.add=function(e){return this._isDestroyed||this._queue.push(e),this},_e.prototype.flush=function(e,t){if(this._isDestroyed)return this;var i,r=this._queue,n=r.length;if(!n)return this;var s=1===n,o=s?r[0]:r.slice(0);if(r.length=0,s)return o(e,t),this;for(i=0;i<n&&(o[i](e,t),!this._isDestroyed);i++);return this},_e.prototype.destroy=function(){return this._isDestroyed||(this._isDestroyed=!0,this._queue.length=0),this},ye.prototype.start=function(e,t){if(!this._isDestroyed){var i,r,n,s,o=this._item,a=o._element,l=o._release,h=o.getGrid()._settings,d=this._isActive,p=l._isActive&&!1===l._isPositioningStarted,f=p?h.dragReleaseDuration:h.layoutDuration,m=p?h.dragReleaseEasing:h.layoutEasing,g=!e&&!this._skipNextAnimation&&f>0;return d&&this._queue.flush(!0,o),p&&(l._isPositioningStarted=!0),u(t)&&this._queue.add(t),g?(this._isActive=!0,this._animateOptions.easing=m,this._animateOptions.duration=f,this._isInterrupted=d,r=o._id,n=this._setupAnimation,s=this._startAnimation,k.add(r+"layout",n,s),this):(this._updateOffsets(),this._updateTargetStyles(),i=o._animate.isAnimating(),this.stop(!1,this._targetStyles),!i&&c(a,this._targetStyles),this._skipNextAnimation=!1,this._finish())}},ye.prototype.stop=function(e,t){if(this._isDestroyed||!this._isActive)return this;var i,r=this._item;return i=r._id,k.cancel(i+"layout"),r._animate.stop(t),pe(r._element,r.getGrid()._settings.itemPositioningClass),this._isActive=!1,e&&this._queue.flush(!0,r),this},ye.prototype.destroy=function(){return this._isDestroyed||(this.stop(!0,{}),this._queue.destroy(),this._item=this._currentStyles=this._targetStyles=this._animateOptions=null,this._isDestroyed=!0),this},ye.prototype._updateOffsets=function(){if(!this._isDestroyed){var e=this._item,t=e._migrate,i=e._release;this._offsetLeft=i._isActive?i._containerDiffX:t._isActive?t._containerDiffX:0,this._offsetTop=i._isActive?i._containerDiffY:t._isActive?t._containerDiffY:0}},ye.prototype._updateTargetStyles=function(){this._isDestroyed||(this._targetStyles.transform=de(this._item._left+this._offsetLeft,this._item._top+this._offsetTop))},ye.prototype._finish=function(){if(!this._isDestroyed){var e=this._item,t=e._migrate,i=e._release;this._isActive&&(this._isActive=!1,pe(e._element,e.getGrid()._settings.itemPositioningClass)),i._isActive&&i.stop(),t._isActive&&t.stop(),this._queue.flush(!1,e)}},ye.prototype._setupAnimation=function(){var e=ce(this._item._element);this._currentLeft=e.x,this._currentTop=e.y},ye.prototype._startAnimation=function(){var e=this._item,t=e.getGrid()._settings;if(this._updateOffsets(),this._updateTargetStyles(),e._left===this._currentLeft-this._offsetLeft&&e._top===this._currentTop-this._offsetTop)return this._isInterrupted&&this.stop(!1,this._targetStyles),this._isActive=!1,void this._finish();this._isInterrupted||I(e._element,t.itemPositioningClass),this._currentStyles.transform=de(this._currentLeft,this._currentTop),e._animate.start(this._currentStyles,this._targetStyles,this._animateOptions)};var ve={};function be(e){this._item=e,this._isActive=!1,this._isDestroyed=!1,this._container=!1,this._containerDiffX=0,this._containerDiffY=0}be.prototype.start=function(e,t,i){if(this._isDestroyed)return this;var n,s,o,a,l,h,u,d,p=this._item,f=p._element,m=p.isVisible(),g=p.getGrid(),_=g._settings,y=e._settings,v=e._element,b=e._items,w=g._items.indexOf(p),C=i||window.document.body;if("number"==typeof t)n=q(b,t,!0);else{if(!(s=e._getItem(t)))return this;n=b.indexOf(s)}return(p.isPositioning()||this._isActive||p.isReleasing())&&(u=(h=ce(f)).x,d=h.y),p.isPositioning()&&p._layout.stop(!0,{transform:de(u,d)}),this._isActive&&(u-=this._containerDiffX,d-=this._containerDiffY,this.stop(!0,{transform:de(u,d)})),p.isReleasing()&&(u-=p._release._containerDiffX,d-=p._release._containerDiffY,p._release.stop(!0,{transform:de(u,d)})),p._visibility._stopAnimation(),p._drag&&p._drag.destroy(),p._visibility._queue.flush(!0,p),g._hasListeners("beforeSend")&&g._emit("beforeSend",{item:p,fromGrid:g,fromIndex:w,toGrid:e,toIndex:n}),e._hasListeners("beforeReceive")&&e._emit("beforeReceive",{item:p,fromGrid:g,fromIndex:w,toGrid:e,toIndex:n}),pe(f,_.itemClass),pe(f,_.itemVisibleClass),pe(f,_.itemHiddenClass),I(f,y.itemClass),I(f,m?y.itemVisibleClass:y.itemHiddenClass),g._items.splice(w,1),N(b,p,n),p._gridId=e._id,C!==(o=f.parentNode)&&(C.appendChild(f),a=$(C,o,!0),h||(u=(h=ce(f)).x,d=h.y),f.style[r]=de(u+a.left,d+a.top)),p._child.removeAttribute("style"),c(p._child,m?y.visibleStyles:y.hiddenStyles),f.style.display=m?"block":"hidden",l=$(C,v,!0),p._refreshDimensions(),p._refreshSortData(),p._drag=y.dragEnabled?new fe(p):null,this._isActive=!0,this._container=C,this._containerDiffX=l.left,this._containerDiffY=l.top,g._hasListeners("send")&&g._emit("send",{item:p,fromGrid:g,fromIndex:w,toGrid:e,toIndex:n}),e._hasListeners("receive")&&e._emit("receive",{item:p,fromGrid:g,fromIndex:w,toGrid:e,toIndex:n}),this},be.prototype.stop=function(e,t){if(this._isDestroyed||!this._isActive)return this;var i,r=this._item,n=r._element,s=r.getGrid()._element;return this._container!==s&&(t||(e?(i=ce(n),ve.transform=de(i.x-this._containerDiffX,i.y-this._containerDiffY)):ve.transform=de(r._left,r._top),t=ve),s.appendChild(n),c(n,t)),this._isActive=!1,this._container=null,this._containerDiffX=0,this._containerDiffY=0,this},be.prototype.destroy=function(){return this._isDestroyed||(this.stop(!0),this._item=null,this._isDestroyed=!0),this};var we={};function Ce(e){this._item=e,this._isActive=!1,this._isDestroyed=!1,this._isPositioningStarted=!1,this._containerDiffX=0,this._containerDiffY=0}function Se(e){var t=e._isActive,i=e._element,r=e.getGrid()._settings;this._item=e,this._isDestroyed=!1,this._isHidden=!t,this._isHiding=!1,this._isShowing=!1,this._queue=new _e,this._finishShow=this._finishShow.bind(this),this._finishHide=this._finishHide.bind(this),i.style.display=t?"block":"none",I(i,t?r.itemVisibleClass:r.itemHiddenClass),c(e._child,t?r.visibleStyles:r.hiddenStyles)}Ce.prototype.start=function(){if(this._isDestroyed||this._isActive)return this;var e=this._item,t=e.getGrid();return this._isActive=!0,I(e._element,t._settings.itemReleasingClass),t._emit("dragReleaseStart",e),e._layout.start(!1),this},Ce.prototype.stop=function(e,t){if(this._isDestroyed||!this._isActive)return this;var i,r=this._item,n=r._element,s=r.getGrid(),o=s._element;return this._reset(),n.parentNode!==o&&(t||(e?(i=ce(n),we.transform=de(i.x-this._containerDiffX,i.y-this._containerDiffY)):we.transform=de(r._left,r._top),t=we),o.appendChild(n),c(n,t)),e||s._emit("dragReleaseEnd",r),this},Ce.prototype.destroy=function(){return this._isDestroyed||(this.stop(!0),this._item=null,this._isDestroyed=!0),this},Ce.prototype._reset=function(){if(!this._isDestroyed){var e=this._item;this._isActive=!1,this._isPositioningStarted=!1,this._containerDiffX=0,this._containerDiffY=0,pe(e._element,e.getGrid()._settings.itemReleasingClass)}},Se.prototype.show=function(e,t){if(this._isDestroyed)return this;var i=this._item,r=i._element,n=this._queue,s=u(t)?t:null,o=i.getGrid()._settings;return this._isShowing||this._isHidden?this._isShowing&&!e?(s&&n.add(s),this):(this._isShowing||(n.flush(!0,i),pe(r,o.itemHiddenClass),I(r,o.itemVisibleClass),this._isHiding||(r.style.display="block")),s&&n.add(s),i._isActive=this._isShowing=!0,this._isHiding=this._isHidden=!1,this._startAnimation(!0,e,this._finishShow),this):(s&&s(!1,i),this)},Se.prototype.hide=function(e,t){if(this._isDestroyed)return this;var i=this._item,r=i._element,n=this._queue,s=u(t)?t:null,o=i.getGrid()._settings;return!this._isHiding&&this._isHidden?(s&&s(!1,i),this):this._isHiding&&!e?(s&&n.add(s),this):(this._isHiding||(n.flush(!0,i),I(r,o.itemHiddenClass),pe(r,o.itemVisibleClass)),s&&n.add(s),this._isHidden=this._isHiding=!0,i._isActive=this._isShowing=!1,this._startAnimation(!1,e,this._finishHide),this)},Se.prototype.destroy=function(){if(this._isDestroyed)return this;var e=this._item,t=e._element,i=e.getGrid(),r=this._queue,n=i._settings;return this._stopAnimation({}),r.flush(!0,e).destroy(),pe(t,n.itemVisibleClass),pe(t,n.itemHiddenClass),this._item=null,this._isHiding=this._isShowing=!1,this._isDestroyed=this._isHidden=!0,this},Se.prototype._startAnimation=function(e,t,i){if(!this._isDestroyed){var r,n=this._item,s=n.getGrid()._settings,o=e?s.visibleStyles:s.hiddenStyles,l=parseInt(e?s.showDuration:s.hideDuration)||0,u=(e?s.showEasing:s.hideEasing)||"ease",d=t||l<=0;if(o){if(O(n._id),d)return n._animateChild.isAnimating()?n._animateChild.stop(o):c(n._child,o),void(i&&i());var p,f,m;p=n._id,f=function(){r=function(e,t){var i={};for(var r in t)i[r]=a(e,h(r));return i}(n._child,o)},m=function(){n._animateChild.start(r,o,{duration:l,easing:u,onFinish:i})},k.add(p+"visibility",f,m)}else i&&i()}},Se.prototype._stopAnimation=function(e){if(!this._isDestroyed){var t=this._item;O(t._id),t._animateChild.stop(e)}},Se.prototype._finishShow=function(){this._isHidden||(this._isShowing=!1,this._queue.flush(!1,this._item))};var Te={};Se.prototype._finishHide=function(){if(this._isHidden){var e=this._item;this._isHiding=!1,Te.transform=de(0,0),e._layout.stop(!0,Te),e._element.style.display="none",this._queue.flush(!1,e)}};var Ae,De,Ee,Pe,xe=0;function ke(){return++xe}function Oe(e,t,i){var n=e._settings;this._id=ke(),this._gridId=e._id,this._isDestroyed=!1,this._left=0,this._top=0,this._element=t,this._child=t.children[0],t.parentNode!==e._element&&e._element.appendChild(t),I(t,n.itemClass),"boolean"!=typeof i&&(i="none"!==a(t,"display")),this._isActive=i,t.style.left="0",t.style.top="0",t.style[r]=de(0,0),this._animate=new d(t),this._animateChild=new d(this._child),this._visibility=new Se(this),this._layout=new ye(this),this._migrate=new be(this),this._release=new Ce(this),this._dragPlaceholder=new ge(this),this._drag=n.dragEnabled?new fe(this):null,this._refreshDimensions(),this._refreshSortData()}function Ve(){this._slots=[],this._slotSizes=[],this._freeSlots=[],this._newSlots=[],this._rectItem={},this._rectStore=[],this._rectId=0,this._layout={slots:null,setWidth:!1,setHeight:!1,width:!1,height:!1},this._sortRectsLeftTop=this._sortRectsLeftTop.bind(this),this._sortRectsTopLeft=this._sortRectsTopLeft.bind(this)}function ze(e){var t=Object.prototype.toString.call(e);return"[object HTMLCollection]"===t||"[object NodeList]"===t}Oe.prototype.getGrid=function(){return e[this._gridId]},Oe.prototype.getElement=function(){return this._element},Oe.prototype.getWidth=function(){return this._width},Oe.prototype.getHeight=function(){return this._height},Oe.prototype.getMargin=function(){return{left:this._marginLeft,right:this._marginRight,top:this._marginTop,bottom:this._marginBottom}},Oe.prototype.getPosition=function(){return{left:this._left,top:this._top}},Oe.prototype.isActive=function(){return this._isActive},Oe.prototype.isVisible=function(){return!!this._visibility&&!this._visibility._isHidden},Oe.prototype.isShowing=function(){return!(!this._visibility||!this._visibility._isShowing)},Oe.prototype.isHiding=function(){return!(!this._visibility||!this._visibility._isHiding)},Oe.prototype.isPositioning=function(){return!(!this._layout||!this._layout._isActive)},Oe.prototype.isDragging=function(){return!(!this._drag||!this._drag._isActive)},Oe.prototype.isReleasing=function(){return!(!this._release||!this._release._isActive)},Oe.prototype.isDestroyed=function(){return this._isDestroyed},Oe.prototype._refreshDimensions=function(){if(!this._isDestroyed&&!this._visibility._isHidden){var e=this._element,t=this._dragPlaceholder,i=e.getBoundingClientRect();this._width=i.width,this._height=i.height,this._marginLeft=Math.max(0,U(e,"margin-left")),this._marginRight=Math.max(0,U(e,"margin-right")),this._marginTop=Math.max(0,U(e,"margin-top")),this._marginBottom=Math.max(0,U(e,"margin-bottom")),t&&t.updateDimensions(this._width,this._height)}},Oe.prototype._refreshSortData=function(){if(!this._isDestroyed){var e,t=this._sortData={},i=this.getGrid()._settings.sortData;for(e in i)t[e]=i[e](this,this._element)}},Oe.prototype._destroy=function(e){if(!this._isDestroyed){var t=this._element,i=this.getGrid(),r=i._settings,n=i._items.indexOf(this);this._release.destroy(),this._migrate.destroy(),this._layout.destroy(),this._visibility.destroy(),this._animate.destroy(),this._animateChild.destroy(),this._dragPlaceholder.destroy(),this._drag&&this._drag.destroy(),t.removeAttribute("style"),this._child.removeAttribute("style"),pe(t,r.itemClass),n>-1&&i._items.splice(n,1),e&&t.parentNode.removeChild(t),this._isActive=!1,this._isDestroyed=!0}},Ve.prototype.getLayout=function(e,t,i,r,n){var s,o=this._layout,a=!(!n||!n.fillGaps),l=!(!n||!n.horizontal),h=!(!n||!n.alignRight),u=!(!n||!n.alignBottom),c=!(!n||!n.rounding),d=this._slotSizes;if(o.slots=r||this._slots,o.width=l?0:c?Math.round(t):t,o.height=l?c?Math.round(i):i:0,o.setWidth=l,o.setHeight=!l,o.slots.length=0,d.length=0,!e.length)return o;for(s=0;s<e.length;s++)this._addSlot(e[s],l,a,c,h||u);if(h)for(s=0;s<o.slots.length;s+=2)o.slots[s]=o.width-(o.slots[s]+d[s]);if(u)for(s=1;s<o.slots.length;s+=2)o.slots[s]=o.height-(o.slots[s]+d[s]);return d.length=0,this._freeSlots.length=0,this._newSlots.length=0,this._rectId=0,o},Ve.prototype._addSlot=(Pe={},function(e,t,i,r,n){var s,o,a,l,h,u,c=this._layout,d=this._freeSlots,p=this._newSlots;for(p.length=0,Pe.left=null,Pe.top=null,Pe.width=e._width+e._marginLeft+e._marginRight,Pe.height=e._height+e._marginTop+e._marginBottom,r&&(Pe.width=Math.round(Pe.width),Pe.height=Math.round(Pe.height)),h=0;h<d.length;h++)if((o=d[h])&&(s=this._getRect(o),Pe.width<=s.width+.001&&Pe.height<=s.height+.001)){Pe.left=s.left,Pe.top=s.top;break}for(null===Pe.left&&(Pe.left=t?c.width:0,Pe.top=t?0:c.height,i||(l=!0)),!t&&Pe.top+Pe.height>c.height&&(Pe.left>0&&p.push(this._addRect(0,c.height,Pe.left,1/0)),Pe.left+Pe.width<c.width&&p.push(this._addRect(Pe.left+Pe.width,c.height,c.width-Pe.left-Pe.width,1/0)),c.height=Pe.top+Pe.height),t&&Pe.left+Pe.width>c.width&&(Pe.top>0&&p.push(this._addRect(c.width,0,1/0,Pe.top)),Pe.top+Pe.height<c.height&&p.push(this._addRect(c.width,Pe.top+Pe.height,1/0,c.height-Pe.top-Pe.height)),c.width=Pe.left+Pe.width),h=i?0:l?d.length:h;h<d.length;h++)if(o=d[h])for(s=this._getRect(o),a=this._splitRect(s,Pe),u=0;u<a.length;u++)o=a[u],(s=this._getRect(o)).width>.49&&s.height>.49&&(!t&&s.top<c.height||t&&s.left<c.width)&&p.push(o);p.length&&this._purgeRects(p).sort(t?this._sortRectsLeftTop:this._sortRectsTopLeft),t?c.width=Math.max(c.width,Pe.left+Pe.width):c.height=Math.max(c.height,Pe.top+Pe.height),c.slots.push(Pe.left,Pe.top),n&&this._slotSizes.push(Pe.width,Pe.height),this._freeSlots=p,this._newSlots=d}),Ve.prototype._addRect=function(e,t,i,r){var n=++this._rectId,s=this._rectStore;return s[n]=e||0,s[++this._rectId]=t||0,s[++this._rectId]=i||0,s[++this._rectId]=r||0,n},Ve.prototype._getRect=function(e,t){var i=t||this._rectItem,r=this._rectStore;return i.left=r[e]||0,i.top=r[++e]||0,i.width=r[++e]||0,i.height=r[++e]||0,i},Ve.prototype._splitRect=(Ee=[],function(e,t){return Ee.length=0,this._doRectsOverlap(e,t)?(e.left<t.left&&Ee.push(this._addRect(e.left,e.top,t.left-e.left,e.height)),e.left+e.width>t.left+t.width&&Ee.push(this._addRect(t.left+t.width,e.top,e.left+e.width-(t.left+t.width),e.height)),e.top<t.top&&Ee.push(this._addRect(e.left,e.top,e.width,t.top-e.top)),e.top+e.height>t.top+t.height&&Ee.push(this._addRect(e.left,t.top+t.height,e.width,e.top+e.height-(t.top+t.height))),Ee):(Ee.push(this._addRect(e.left,e.top,e.width,e.height)),Ee)}),Ve.prototype._doRectsOverlap=function(e,t){return!(e.left+e.width<=t.left||t.left+t.width<=e.left||e.top+e.height<=t.top||t.top+t.height<=e.top)},Ve.prototype._isRectWithinRect=function(e,t){return e.left>=t.left&&e.top>=t.top&&e.left+e.width<=t.left+t.width&&e.top+e.height<=t.top+t.height},Ve.prototype._purgeRects=(Ae={},De={},function(e){for(var t,i=e.length;i--;)if(t=e.length,e[i])for(this._getRect(e[i],Ae);t--;)if(e[t]&&i!==t&&this._isRectWithinRect(Ae,this._getRect(e[t],De))){e[i]=0;break}return e}),Ve.prototype._sortRectsTopLeft=function(){var e={},t={};return function(i,r){return this._getRect(i,e),this._getRect(r,t),e.top<t.top?-1:e.top>t.top?1:e.left<t.left?-1:e.left>t.left?1:0}}(),Ve.prototype._sortRectsLeftTop=function(){var e={},t={};return function(i,r){return this._getRect(i,e),this._getRect(r,t),e.left<t.left?-1:e.left>t.left?1:e.top<t.top?-1:e.top>t.top?1:0}}();var Be=Object.prototype.toString;function Le(e){return"object"==typeof e&&"[object Object]"===Be.call(e)}function Me(e){return ze(e)?Array.prototype.slice.call(e):Array.prototype.concat(e)}var Re=new Ve,Ie=function(){};function je(i,r){var n,s,o,a,l,h,c=this;if(!((i=this._element="string"==typeof i?window.document.querySelector(i):i).getRootNode?i.getRootNode({composed:!0})===document:window.document.body.contains(i))||i===window.document.documentElement)throw new Error("Container element must be an existing DOM element");u((n=this._settings=(a=je.defaultOptions,l=r,h=Ne({},a),l&&(h=Ne(h,l)),h.visibleStyles=(l||0).visibleStyles||(a||0).visibleStyles,h.hiddenStyles=(l||0).hiddenStyles||(a||0).hiddenStyles,h)).dragSort)||(n.dragSort=!!n.dragSort),this._id=ke(),e[this._id]=c,this._isDestroyed=!1,this._layout={id:0,items:[],slots:[],setWidth:!1,setHeight:!1,width:0,height:0},this._emitter=new t,I(i,n.containerClass),this._items=[],"string"==typeof(s=n.items)?Me(i.children).forEach((function(e){("*"===s||R(e,s))&&c._items.push(new Oe(c,e))})):(Array.isArray(s)||ze(s))&&(this._items=Me(s).map((function(e){return new Oe(c,e)}))),"number"!=typeof(o=n.layoutOnResize)&&(o=!0===o?0:-1),o>=0&&window.addEventListener("resize",c._resizeHandler=X((function(){c.refreshItems().layout()}),o)),n.layoutOnInit&&this.layout(!0)}function Ne(e,t){var i,r,n,s=Object.keys(t),o=s.length;for(n=0;n<o;n++)i=Le(t[r=s[n]]),Le(e[r])&&i?e[r]=Ne(Ne({},e[r]),t[r]):i?e[r]=Ne({},t[r]):Array.isArray(t[r])?e[r]=t[r].slice(0):e[r]=t[r];return e}return je.Item=Oe,je.ItemLayout=ye,je.ItemVisibility=Se,je.ItemMigrate=be,je.ItemAnimate=d,je.ItemDrag=fe,je.ItemRelease=Ce,je.ItemDragPlaceholder=ge,je.Emitter=t,je.Dragger=P,je.Packer=Ve,je.defaultOptions={items:"*",showDuration:300,showEasing:"ease",hideDuration:300,hideEasing:"ease",visibleStyles:{opacity:"1",transform:"scale(1)"},hiddenStyles:{opacity:"0",transform:"scale(0.5)"},layout:{fillGaps:!1,horizontal:!1,alignRight:!1,alignBottom:!1,rounding:!0},layoutOnResize:100,layoutOnInit:!0,layoutDuration:300,layoutEasing:"ease",sortData:null,dragEnabled:!1,dragContainer:null,dragStartPredicate:{distance:0,delay:0,handle:!1},dragAxis:null,dragSort:!0,dragSortHeuristics:{sortInterval:100,minDragDistance:10,minBounceBackAngle:1},dragSortPredicate:{threshold:50,action:"move"},dragReleaseDuration:300,dragReleaseEasing:"ease",dragCssProps:{touchAction:"none",userSelect:"none",userDrag:"none",tapHighlightColor:"rgba(0, 0, 0, 0)",touchCallout:"none",contentZooming:"none"},dragPlaceholder:{enabled:!1,duration:300,easing:"ease",createElement:null,onCreate:null,onRemove:null},containerClass:"muuri",itemClass:"muuri-item",itemVisibleClass:"muuri-item-shown",itemHiddenClass:"muuri-item-hidden",itemPositioningClass:"muuri-item-positioning",itemDraggingClass:"muuri-item-dragging",itemReleasingClass:"muuri-item-releasing",itemPlaceholderClass:"muuri-item-placeholder"},je.prototype.on=function(e,t){return this._emitter.on(e,t),this},je.prototype.off=function(e,t){return this._emitter.off(e,t),this},je.prototype.getElement=function(){return this._element},je.prototype.getItems=function(e){if(this._isDestroyed||!e&&0!==e)return this._items.slice(0);var t,i,r=[],n=Me(e);for(i=0;i<n.length;i++)(t=this._getItem(n[i]))&&r.push(t);return r},je.prototype.refreshItems=function(e){if(this._isDestroyed)return this;var t,i=this.getItems(e);for(t=0;t<i.length;t++)i[t]._refreshDimensions();return this},je.prototype.refreshSortData=function(e){if(this._isDestroyed)return this;var t,i=this.getItems(e);for(t=0;t<i.length;t++)i[t]._refreshSortData();return this},je.prototype.synchronize=function(){if(this._isDestroyed)return this;var e,t,i,r=this._element,n=this._items;if(n.length){for(i=0;i<n.length;i++)(t=n[i]._element).parentNode===r&&(e=e||window.document.createDocumentFragment()).appendChild(t);e&&r.appendChild(e)}return this._emit("synchronize"),this},je.prototype.layout=function(e,t){if(this._isDestroyed)return this;var i,r,n,s=this,o=this._element,l=this._updateLayout(),h=l.id,c=l.items.length,d=c;function p(){if(!(--d>0)){var i=s._layout.id!==h,r=u(e)?e:t;u(r)&&r(i,l.items.slice(0)),!i&&s._hasListeners("layoutEnd")&&s._emit("layoutEnd",l.items.slice(0))}}if((l.setHeight&&"number"==typeof l.height||l.setWidth&&"number"==typeof l.width)&&(i="border-box"===a(o,"box-sizing")),l.setHeight&&("number"==typeof l.height?o.style.height=(i?l.height+this._borderTop+this._borderBottom:l.height)+"px":o.style.height=l.height),l.setWidth&&("number"==typeof l.width?o.style.width=(i?l.width+this._borderLeft+this._borderRight:l.width)+"px":o.style.width=l.width),this._hasListeners("layoutStart")&&this._emit("layoutStart",l.items.slice(0)),!c)return p(),this;for(n=0;n<c;n++)(r=l.items[n])&&(r._left=l.slots[2*n],r._top=l.slots[2*n+1],r.isDragging()?p():r._layout.start(!0===e,p));return this},je.prototype.add=function(e,t){if(this._isDestroyed||!e)return[];var i=Me(e);if(!i.length)return i;var r,n,s=t||0,o=s.layout?s.layout:void 0===s.layout,a=this._items,l=!1;for(n=0;n<i.length;n++)r=new Oe(this,i[n],s.isActive),i[n]=r,r._isActive&&(l=!0,r._layout._skipNextAnimation=!0);return N(a,i,s.index),this._hasListeners("add")&&this._emit("add",i.slice(0)),l&&o&&this.layout("instant"===o,u(o)?o:void 0),i},je.prototype.remove=function(e,t){if(this._isDestroyed)return this;var i,r,n=t||0,s=n.layout?n.layout:void 0===n.layout,o=!1,a=this.getItems(),l=this.getItems(e),h=[];for(r=0;r<l.length;r++)i=l[r],h.push(a.indexOf(i)),i._isActive&&(o=!0),i._destroy(n.removeElements);return this._hasListeners("remove")&&this._emit("remove",l.slice(0),h),o&&s&&this.layout("instant"===s,u(s)?s:void 0),l},je.prototype.show=function(e,t){return this._isDestroyed||this._setItemsVisibility(e,!0,t),this},je.prototype.hide=function(e,t){return this._isDestroyed||this._setItemsVisibility(e,!1,t),this},je.prototype.filter=function(e,t){if(this._isDestroyed||!this._items.length)return this;var i,r,n=[],s=[],o="string"==typeof e,a=u(e),l=t||0,h=!0===l.instant,c=l.layout?l.layout:void 0===l.layout,d=u(l.onFinish)?l.onFinish:null,p=-1,f=Ie;if(d&&(f=function(){++p&&d(n.slice(0),s.slice(0))}),a||o)for(r=0;r<this._items.length;r++)i=this._items[r],(a?e(i):R(i._element,e))?n.push(i):s.push(i);return n.length?this.show(n,{instant:h,onFinish:f,layout:!1}):f(),s.length?this.hide(s,{instant:h,onFinish:f,layout:!1}):f(),(n.length||s.length)&&(this._hasListeners("filter")&&this._emit("filter",n.slice(0),s.slice(0)),c&&this.layout("instant"===c,u(c)?c:void 0)),this},je.prototype.sort=function(){var e,t,i,r;function n(e){for(var t={},i=0;i<e.length;i++)t[e[i]._id]=i;return t}function s(e,i){var n=r[e._id],s=r[i._id];return t?s-n:n-s}function o(o,a){for(var l,h,u,c,d=0,p=0;p<e.length;p++)if(l=e[p][0],h=e[p][1],u=(o._sortData?o:o._refreshSortData())._sortData[l],c=(a._sortData?a:a._refreshSortData())._sortData[l],d="desc"===h||!h&&t?c<u?-1:c>u?1:0:u<c?-1:u>c?1:0)return d;return d||(r||(r=n(i)),d=s(o,a)),d}function a(o,a){var l=e(o,a);return t&&l&&(l=-l),l||(r||(r=n(i)),s(o,a))}return function(n,s){if(this._isDestroyed||this._items.length<2)return this;var l,h=this._items,c=s||0,d=c.layout?c.layout:void 0===c.layout;if(e=n,t=!!c.descending,i=h.slice(0),r=null,u(e))h.sort(a);else if("string"==typeof e)e=n.trim().split(" ").map((function(e){return e.split(":")})),h.sort(o);else{if(!Array.isArray(e))return this;if(e.length!==h.length)throw new Error("[Muuri] sort reference items do not match with grid items.");for(l=0;l<h.length;l++){if(e.indexOf(h[l])<0)throw new Error("[Muuri] sort reference items do not match with grid items.");h[l]=e[l]}t&&h.reverse()}return this._hasListeners("sort")&&this._emit("sort",h.slice(0),i),d&&this.layout("instant"===d,u(d)?d:void 0),this}}(),je.prototype.move=function(e,t,i){if(this._isDestroyed||this._items.length<2)return this;var r,n,s=this._items,o=i||0,a=o.layout?o.layout:void 0===o.layout,l="swap"===o.action,h=l?"swap":"move",c=this._getItem(e),d=this._getItem(t);return c&&d&&c!==d&&(r=s.indexOf(c),n=s.indexOf(d),l?F(s,r,n):H(s,r,n),this._hasListeners("move")&&this._emit("move",{item:c,fromIndex:r,toIndex:n,action:h}),a&&this.layout("instant"===a,u(a)?a:void 0)),this},je.prototype.send=function(e,t,i,r){if(this._isDestroyed||t._isDestroyed||this===t)return this;if(!(e=this._getItem(e)))return this;var n=r||0,s=n.appendTo||window.document.body,o=n.layoutSender?n.layoutSender:void 0===n.layoutSender,a=n.layoutReceiver?n.layoutReceiver:void 0===n.layoutReceiver;return e._migrate.start(t,i,s),e._migrate._isActive&&e._isActive&&(o&&this.layout("instant"===o,u(o)?o:void 0),a&&t.layout("instant"===a,u(a)?a:void 0)),this},je.prototype.destroy=function(t){if(this._isDestroyed)return this;var i,r=this._element,n=this._items.slice(0);for(this._resizeHandler&&window.removeEventListener("resize",this._resizeHandler),i=0;i<n.length;i++)n[i]._destroy(t);return pe(r,this._settings.containerClass),r.style.height="",r.style.width="",this._emit("destroy"),this._emitter.destroy(),e[this._id]=void 0,this._isDestroyed=!0,this},je.prototype._getItem=function(e){if(this._isDestroyed||!e&&0!==e)return null;if("number"==typeof e)return this._items[e>-1?e:this._items.length+e]||null;if(e instanceof Oe)return e._gridId===this._id?e:null;for(var t=0;t<this._items.length;t++)if(this._items[t]._element===e)return this._items[t];return null},je.prototype._updateLayout=function(){var e,t,i,r,n=this._layout,s=this._settings.layout;for(++n.id,n.items.length=0,r=0;r<this._items.length;r++)this._items[r]._isActive&&n.items.push(this._items[r]);return this._refreshDimensions(),e=this._width-this._borderLeft-this._borderRight,t=this._height-this._borderTop-this._borderBottom,i=u(s)?s(n.items,e,t):Re.getLayout(n.items,e,t,n.slots,s),n.slots=i.slots,n.setWidth=Boolean(i.setWidth),n.setHeight=Boolean(i.setHeight),n.width=i.width,n.height=i.height,n},je.prototype._emit=function(){this._isDestroyed||this._emitter.emit.apply(this._emitter,arguments)},je.prototype._hasListeners=function(e){var t=this._emitter._events[e];return!(!t||!t.length)},je.prototype._updateBoundingRect=function(){var e=this._element.getBoundingClientRect();this._width=e.width,this._height=e.height,this._left=e.left,this._top=e.top},je.prototype._updateBorders=function(e,t,i,r){var n=this._element;e&&(this._borderLeft=U(n,"border-left-width")),t&&(this._borderRight=U(n,"border-right-width")),i&&(this._borderTop=U(n,"border-top-width")),r&&(this._borderBottom=U(n,"border-bottom-width"))},je.prototype._refreshDimensions=function(){this._updateBoundingRect(),this._updateBorders(1,1,1,1)},je.prototype._setItemsVisibility=function(e,t,i){var r,n,s=this,o=this.getItems(e),a=i||0,l=!0===a.instant,h=a.onFinish,c=a.layout?a.layout:void 0===a.layout,d=o.length,p=t?"showStart":"hideStart",f=t?"showEnd":"hideEnd",m=t?"show":"hide",g=!1,_=[],y=[];if(d){for(this._hasListeners(p)&&this._emit(p,o.slice(0)),n=0;n<o.length;n++)r=o[n],(t&&!r._isActive||!t&&r._isActive)&&(g=!0),t&&!r._isActive&&(r._layout._skipNextAnimation=!0),t&&r._visibility._isHidden&&y.push(r),r._visibility[m](l,(function(e,t){e||_.push(t),--d<1&&(u(h)&&h(_.slice(0)),s._hasListeners(f)&&s._emit(f,_.slice(0)))}));y.length&&this.refreshItems(y),g&&c&&this.layout("instant"===c,u(c)?c:void 0)}else u(h)&&h(o)},je}()},function(e,t,i){},function(e,t,i){},function(e,t,i){},function(e,t,i){"use strict";i.r(t),i.d(t,"localization",(function(){return r.a})),i.d(t,"surveyStrings",(function(){return r.b})),i.d(t,"DataProvider",(function(){return s})),i.d(t,"NumberModel",(function(){return c})),i.d(t,"SelectBase",(function(){return d})),i.d(t,"Matrix",(function(){return p})),i.d(t,"BooleanModel",(function(){return f})),i.d(t,"HistogramModel",(function(){return m})),i.d(t,"VisualizerBase",(function(){return u})),i.d(t,"VisualizationManager",(function(){return a})),i.d(t,"VisualizationPanel",(function(){return C})),i.d(t,"VisualizationPanelDynamic",(function(){return S})),i.d(t,"VisualizationMatrixDynamic",(function(){return T})),i.d(t,"VisualizationMatrixDropdown",(function(){return A})),i.d(t,"AlternativeVisualizersWrapper",(function(){return g})),i.d(t,"PlotlySetup",(function(){return D})),i.d(t,"PlotlyChartAdapter",(function(){return x})),i.d(t,"SelectBasePlotly",(function(){return k})),i.d(t,"MatrixPlotly",(function(){return O})),i.d(t,"PlotlyBoolChartAdapter",(function(){return V})),i.d(t,"BooleanPlotly",(function(){return z})),i.d(t,"RankingPlotly",(function(){return B})),i.d(t,"MatrixDropdownGroupedPlotly",(function(){return L})),i.d(t,"HistogramPlotly",(function(){return M})),i.d(t,"PlotlyGaugeAdapter",(function(){return R})),i.d(t,"GaugePlotly",(function(){return I})),i.d(t,"WordCloudAdapter",(function(){return F})),i.d(t,"WordCloud",(function(){return G})),i.d(t,"textHelper",(function(){return N})),i.d(t,"TextTableAdapter",(function(){return X})),i.d(t,"Text",(function(){return Y})),i.d(t,"ChoicesTableAdapter",(function(){return Q})),i.d(t,"ChoicesTable",(function(){return U})),i.d(t,"DocumentHelper",(function(){return h.b}));var r=i(0);i(9),i(10),i(11),i(12),i(13),i(14);r.a.locales.es={ungroupButton:"Desagrupar por mí",selectButton:"Seleccionarme",hideColumn:"Ocultar columna",showColumn:"Mostrar columna",makePrivateColumn:"Hacer que la columna sea privada",makePublicColumn:"Hacer pública la columna",moveToDetail:"Mover al detalle",showAsColumn:"Mostrar como columna",filterPlaceholder:"Buscar ...",removeRows:"Eliminar filas",showLabel:"Mostrar",entryLabel:"entradas",visualizer_text:"Textos en tabla",visualizer_wordcloud:"Wordcloud",chartType_bar:"Bar",chartType_stackedbar:"Barra apilada",chartType_doughnut:"Donut",chartType_pie:"Pie",chartType_scatter:"Dispersión",chartType_gauge:"Gauge",chartType_bullet:"Bullet",hideButton:"Ocultar",makePrivateButton:"Hacer privado",makePublicButton:"Hacer público",showButton:"Mostrar",filter:"Filtro",resetFilter:"Restablecer filtro",changeLocale:"Cambiar configuración regional",clearButton:"Borrar",addElement:"Elija la pregunta para mostrar ...",defaultOrder:"Orden predeterminado",ascOrder:"Ascendente",descOrder:"Descendente",showMinorColumns:"Mostrar columnas secundarias",otherCommentTitle:"Otros elementos y comentarios",showPercentages:"Mostrar porcentajes",hidePercentages:"Ocultar porcentajes",pdfDownloadCaption:"PDF",xlsxDownloadCaption:"Excel",csvDownloadCaption:"CSV",saveDiagramAsPNG:"Descargar el gráfico como png",hideEmptyAnswers:"Ocultar respuestas vacías",showEmptyAnswers:"Mostrar respuestas vacías","topNValueText-1":"Todas las respuestas",topNValueText5:"Las 5 respuestas principales",topNValueText10:"Las 10 respuestas principales",topNValueText20:"20 respuestas principales",noVisualizerForQuestion:"Este tipo de pregunta aún no se visualiza",noResults:"Aún no hay resultados"},r.a.localeNames.es="Spanish";r.a.locales.it={groupButton:"Raggruppa",ungroupButton:"Dividi",selectButton:"Selezionami",hideColumn:"Nascondi colonna",showColumn:"Mostra colonna",makePrivateColumn:"Rendi la colonna privata",makePublicColumn:"Rendi la colonna pubblica",moveToDetail:"Sposta in Dettaglio",showAsColumn:"Mostra come Colonna",filterPlaceholder:"Cerca...",removeRows:"Rimuovi righe",showLabel:"Mostra",entriesLabel:"voci",visualizer_text:"Parole in tabella",visualizer_wordcloud:"Nuvola di parole",visualizer_histogram:"Istogramma",visualizer_number:"Media",visualizer_choices:"Tabella",visualizer_selectBase:"Grafico",chartType_bar:"Grafico a barre",chartType_vbar:"Grafico a barre verticali",chartType_stackedbar:"Grafico a barre sovrapposte",chartType_doughnut:"Grafico a ciambella",chartType_pie:"Grafico a torta",chartType_scatter:"Grafico a dispersione",chartType_gauge:"Grafico Gauge",chartType_bullet:"Punto",hideButton:"Nascondi",makePrivateButton:"Rendi privato",makePublicButton:"Rendi pubblico",showButton:"Mostra",filter:"Filtro",resetFilter:"Cancella filtro",changeLocale:"Cambia lingua",en:"Inglese",fr:"Francese",ru:"Russo",de:"Tedesco",clearButton:"Cancella",addElement:"Scegli la domanda da mostrare...",defaultOrder:"Ordine di Default",ascOrder:"Ascendente",descOrder:"Discendente",showMinorColumns:"Mostra colonne secondarie",otherCommentTitle:"Altri punti e commenti",showPercentages:"Mostra percentuali",hidePercentages:"Nascondi percentuali",pdfDownloadCaption:"PDF",xlsxDownloadCaption:"Excel",csvDownloadCaption:"CSV",saveDiagramAsPNG:"Scarica il grafico in formato png",hideEmptyAnswers:"Nascondi risposte vuote",showEmptyAnswers:"Mostra risposte vuote","topNValueText-1":"Tutte le risposte",topNValueText5:"Top 5 risposte",topNValueText10:"Top 10 risposte",topNValueText20:"Top 20 risposte",hideMissingAnswers:"Nascondi le risposte mancanti",showMissingAnswers:"Mostra le risposte mancanti",missingAnswersLabel:"Risposte mancanti",noVisualizerForQuestion:"Questo tipo di domanda non è ancora stato visualizzato",noResults:"Non ci sono ancora risultati",showPerValues:"Per Valori",showPerColumns:"Per Colonne",answer:"Risposta",percent:"Percentuale",responses:"Risposte"},r.a.localeNames.it="Italian";i(15);var n=i(3),s=function(){function e(e,t){void 0===e&&(e=[]),void 0===t&&(t=void 0),this._data=e,this._getDataCore=t,this.filterValues={},this.onDataChanged=new n.Event}return e.prototype.getStatisticsCacheKey=function(e){return Array.isArray(e.dataName)?e.dataName.join("-"):e.dataName},e.prototype.reset=function(e){if(e){if(void 0!==this._statisticsCache){var t=this.getStatisticsCacheKey(e);delete this._statisticsCache[t]}}else void 0===this._statisticsCache&&void 0===this._filteredData||(this._statisticsCache=void 0,this._filteredData=void 0,this.raiseDataChanged())},Object.defineProperty(e.prototype,"data",{get:function(){return this._data},set:function(e){this._data=[].concat(e),this.reset()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"filteredData",{get:function(){var t=this;void 0===this._filteredData&&(Object.keys(this.filterValues).length>0?this._filteredData=this.data.filter((function(i){return!Object.keys(t.filterValues).some((function(r){var n=t.filterValues[r],s=typeof n,o=i[r];if(Array.isArray(o)&&"object"!==s)return-1==o.indexOf(n);if("object"==typeof o)return"object"!==s||!function(e,t){var i=Object.keys(e),r=Object.keys(t);if(r.length>i.length)return!1;for(var n=0,s=r;n<s.length;n++){var o=s[n];if(t[o]!=e[o])return!1}return!0}(o,n);var a=i[e.seriesMarkerKey];if(a&&"object"===s)return o!==n[a];if("object"===s&&void 0!==n.start&&void 0!==n.end){var l="number"==typeof o?o:Date.parse(o);return!(!isNaN(l)||(l=parseFloat(o),!isNaN(l)))||(l<n.start||l>=n.end)}return i[r]!==t.filterValues[r]}))})):this._filteredData=this.data);return this._filteredData},enumerable:!1,configurable:!0}),e.prototype.setFilter=function(e,t){var i=!0;void 0!==t?(i=this.filterValues[e]!==t,this.filterValues[e]=t):(i=void 0!==this.filterValues[e],delete this.filterValues[e]),i&&this.reset()},e.prototype.getDataCore=function(t){if(this._getDataCore)return this._getDataCore(t);var i=Array.isArray(t.dataName)?t.dataName:[t.dataName],r=[],n=t.getValues(),s={};n.forEach((function(e,t){s[e]=t}));var o=-1!==n.indexOf(void 0),a=t.getSeriesValues(),l={};a.forEach((function(e,t){l[e]=t}));for(var h=a.length||1,u=0;u<i.length;++u){for(var c=new Array,d=0;d<h;++d)c.push(new Array(n.length).fill(0));r.push(c)}return this.filteredData.forEach((function(t){i.forEach((function(i,n){var h=t[i];if(void 0!==h||o){var u=Array.isArray(h)?h:[h];if(a.length>0)if(void 0!==t[e.seriesMarkerKey]){var c=l[t[e.seriesMarkerKey]]||0;u.forEach((function(e){r[n][c][s[e]]++}))}else u.forEach((function(e){a.forEach((function(t){if(void 0!==e[t]){var i=l[t]||0;r[n][i][s[e[t]]]++}}))}));else u.forEach((function(e){return r[0][0][s[e]]++}))}}))})),Array.isArray(t.dataName)?r:r[0]},e.prototype.getData=function(e){var t=this.getStatisticsCacheKey(e);return void 0!==this._statisticsCache&&void 0!==this._statisticsCache[t]||(void 0===this._statisticsCache&&(this._statisticsCache={}),this._statisticsCache[t]=this.getDataCore(e)),[].concat(this._statisticsCache[t])},e.prototype.raiseDataChanged=function(){this.onDataChanged.isEmpty||this.onDataChanged.fire(this,{})},e.seriesMarkerKey="__sa_series_name",e}();var o=i(2),a=function(){function e(){}return e.registerVisualizer=function(t,i){var r=e.vizualizers[t];r||(r=[],e.vizualizers[t]=r),r.push(i)},e.unregisterVisualizer=function(t,i){var r=e.vizualizers[t];if(r){var n=r.indexOf(i);-1!==n&&r.splice(n,1)}},e.unregisterVisualizerForAll=function(t){Object.keys(e.vizualizers).forEach((function(i){return e.unregisterVisualizer(i,t)}))},e.getVisualizersByType=function(t){var i=e.vizualizers[t];return i||[u]},e.getAlternativesVisualizer=function(){return e.alternativesVisualizer||u},e.registerAlternativesVisualizer=function(t){e.alternativesVisualizer=t},e.alternativesVisualizer=void 0,e.vizualizers={},e}(),l=function(){function e(){}return e.createVisualizer=function(e,t,i){var r;r="text"===e.getType()&&e.inputType?e.inputType:e.getType();var n=a.getVisualizersByType(r).map((function(r){return new r(e,t,i)}));return n.length>1?new(a.getAlternativesVisualizer())(n,e,t,i):n[0]},e}(),h=i(1),u=(i(24),function(){function e(e,t,i,r){void 0===i&&(i={});var o=this;this.question=e,this.options=i,this._name=r,this._showHeader=!0,this._footerVisualizer=void 0,this._dataProvider=void 0,this.labelTruncateLength=27,this.renderResult=void 0,this.toolbarContainer=void 0,this.headerContainer=void 0,this.contentContainer=void 0,this.footerContainer=void 0,this._supportSelection=!1,this.onAfterRender=new n.Event,this.onLocaleChanged=new n.Event,this.toolbarItemCreators={},this._backgroundColor="#f7f7f7",this._dataProvider=i.dataProvider||new s(t),this._dataProvider.onDataChanged.add((function(){return o.onDataChanged()})),void 0!==i.labelTruncateLength&&(this.labelTruncateLength=i.labelTruncateLength)}return e.prototype.afterRender=function(e){this.onAfterRender.fire(this,{htmlElement:e})},Object.defineProperty(e.prototype,"questionOptions",{get:function(){return this.options[this.question.name]},enumerable:!1,configurable:!0}),e.prototype.onDataChanged=function(){this.refresh()},Object.defineProperty(e.prototype,"dataName",{get:function(){return this.question.valueName||this.question.name},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasHeader",{get:function(){return!(!this.options||!this.options.showCorrectAnswers)&&(!!this.question&&!!this.question.correctAnswer)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasFooter",{get:function(){return!!this.question&&(this.question.hasComment||this.question.hasOther)},enumerable:!1,configurable:!0}),e.prototype.createVisualizer=function(e){var t=Object.assign({},this.options);return void 0===t.dataProvider&&(t.dataProvider=this.dataProvider),l.createVisualizer(e,this.data,t)},Object.defineProperty(e.prototype,"footerVisualizer",{get:function(){var e=this;if(this.hasFooter){if(!this._footerVisualizer){var t=new n.QuestionCommentModel(this.question.name+(n.settings||{}).commentPrefix);t.title=this.processText(this.question.title),this._footerVisualizer=this.createVisualizer(t),this._footerVisualizer.onUpdate=function(){return e.invokeOnUpdate()}}return this._footerVisualizer}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"supportSelection",{get:function(){return(void 0===this.options.allowSelection||this.options.allowSelection)&&this._supportSelection},enumerable:!1,configurable:!0}),e.prototype.getSeriesValues=function(){return this.options.seriesValues||[]},e.prototype.getSeriesLabels=function(){return this.options.seriesLabels||this.getSeriesValues()},e.prototype.getValues=function(){throw new Error("Method not implemented.")},e.prototype.getLabels=function(){return this.getValues()},e.prototype.registerToolbarItem=function(e,t){this.toolbarItemCreators[e]=t},Object.defineProperty(e.prototype,"name",{get:function(){return this._name||"visualizer"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"data",{get:function(){return this.dataProvider.filteredData},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dataProvider",{get:function(){return this._dataProvider},enumerable:!1,configurable:!0}),e.prototype.updateData=function(e){this.options.dataProvider||(this.dataProvider.data=e),this.hasFooter&&this.footerVisualizer.updateData(e)},e.prototype.invokeOnUpdate=function(){this.onUpdate&&this.onUpdate()},e.prototype.destroy=function(){this.renderResult&&(this.clear(),this.toolbarContainer=void 0,this.contentContainer=void 0,this.footerContainer=void 0,this.renderResult.innerHTML="",this.renderResult=void 0),this._footerVisualizer&&(this._footerVisualizer.destroy(),this._footerVisualizer.onUpdate=void 0,this._footerVisualizer=void 0)},e.prototype.clear=function(){this.toolbarContainer&&this.destroyToolbar(this.toolbarContainer),this.contentContainer&&this.destroyContent(this.contentContainer),this.footerContainer&&this.destroyFooter(this.footerContainer)},e.prototype.createToolbarItems=function(e){var t=this;Object.keys(this.toolbarItemCreators||{}).forEach((function(i){var r=t.toolbarItemCreators[i](e);r&&e.appendChild(r)}))},e.prototype.getCorrectAnswerText=function(){return this.question?this.question.correctAnswer:""},e.prototype.destroyToolbar=function(e){e.innerHTML=""},e.prototype.renderToolbar=function(e){if(this.showHeader){var t=h.b.createElement("div","sa-toolbar");this.createToolbarItems(t),e.appendChild(t)}},e.prototype.destroyHeader=function(e){this.options&&"function"==typeof this.options.destroyHeader?this.options.destroyHeader(e,this):e.innerHTML=""},e.prototype.destroyContent=function(e){this.options&&"function"==typeof this.options.destroyContent?this.options.destroyContent(e,this):e.innerHTML=""},e.prototype.renderHeader=function(e){if(this.options&&"function"==typeof this.options.renderHeader)this.options.renderHeader(e,this);else{var t=h.b.createElement("div","sa-visualizer__correct-answer");t.innerText=r.a.getString("correctAnswer")+this.getCorrectAnswerText(),e.appendChild(t)}},e.prototype.renderContent=function(e){this.options&&"function"==typeof this.options.renderContent?this.options.renderContent(e,this):e.innerText=r.a.getString("noVisualizerForQuestion"),this.afterRender(e)},e.prototype.destroyFooter=function(e){e.innerHTML=""},e.prototype.renderFooter=function(t){var i=this;if(t.innerHTML="",this.hasFooter){var n=h.b.createElement("h4","sa-visualizer__footer-title",{innerText:r.a.getString("otherCommentTitle")});t.appendChild(n);var s=h.b.createElement("div","sa-visualizer__footer-content");s.style.display=e.otherCommentCollapsed?"none":"block";var o=h.b.createButton((function(){"none"===s.style.display?(s.style.display="block",o.innerText=r.a.getString("hideButton")):(s.style.display="none",o.innerText=r.a.getString(e.otherCommentCollapsed?"showButton":"hideButton")),i.footerVisualizer.invokeOnUpdate()}),r.a.getString("showButton"));t.appendChild(o),t.appendChild(s),this.footerVisualizer.render(s)}},e.prototype.render=function(e){"string"==typeof e&&(e=document.getElementById(e)),this.renderResult=e,this.toolbarContainer=h.b.createElement("div","sa-visualizer__toolbar"),e.appendChild(this.toolbarContainer),this.renderToolbar(this.toolbarContainer),this.hasHeader&&(this.headerContainer=h.b.createElement("div","sa-visualizer__header"),e.appendChild(this.headerContainer),this.renderHeader(this.headerContainer)),this.contentContainer=h.b.createElement("div","sa-visualizer__content"),e.appendChild(this.contentContainer),this.renderContent(this.contentContainer),this.footerContainer=h.b.createElement("div","sa-visualizer__footer"),e.appendChild(this.footerContainer),this.renderFooter(this.footerContainer)},e.prototype.refresh=function(){var e=this;this.headerContainer&&setTimeout((function(){e.destroyHeader(e.headerContainer),e.renderHeader(e.headerContainer),e.invokeOnUpdate()})),this.contentContainer&&setTimeout((function(){e.destroyContent(e.contentContainer),e.renderContent(e.contentContainer),e.invokeOnUpdate()})),this.footerContainer&&setTimeout((function(){e.destroyFooter(e.footerContainer),e.renderFooter(e.footerContainer),e.invokeOnUpdate()}))},e.prototype.processText=function(e){return!1!==this.options.stripHtmlFromTitles?(e||"").replace(/(<([^>]+)>)/gi,""):e},e.prototype.getRandomColor=function(){var e=this.getColors();return e[Math.floor(Math.random()*e.length)]},Object.defineProperty(e.prototype,"backgroundColor",{get:function(){return this.getBackgroundColorCore()},set:function(e){this.setBackgroundColorCore(e)},enumerable:!1,configurable:!0}),e.prototype.getBackgroundColorCore=function(){return this._backgroundColor},e.prototype.setBackgroundColorCore=function(e){this._backgroundColor=e,this.footerVisualizer&&(this.footerVisualizer.backgroundColor=e)},e.prototype.getColors=function(t){void 0===t&&(t=10);for(var i=Array.isArray(e.customColors)&&e.customColors.length>0?e.customColors:e.colors,r=[],n=0;n<t;n++)r=r.concat(i);return r},Object.defineProperty(e.prototype,"showHeader",{get:function(){return this._showHeader},set:function(e){e!=this._showHeader&&(this._showHeader=e,this.toolbarContainer&&(this.destroyToolbar(this.toolbarContainer),this.renderToolbar(this.toolbarContainer)))},enumerable:!1,configurable:!0}),e.prototype.getData=function(){return this.dataProvider.getData(this)},e.prototype.getState=function(){return{}},e.prototype.setState=function(e){},Object.defineProperty(e.prototype,"locale",{get:function(){var e=this.options.survey;return e?e.locale:r.a.currentLocale},set:function(e){this.setLocale(e),this.onLocaleChanged.fire(this,{locale:e}),this.refresh()},enumerable:!1,configurable:!0}),e.prototype.setLocale=function(e){r.a.currentLocale=e;var t=this.options.survey;t&&t.locale!==e&&(t.locale=e)},e.otherCommentCollapsed=!0,e.customColors=[],e.colors=["#86e1fb","#3999fb","#ff6771","#1eb496","#ffc152","#aba1ff","#7d8da5","#4ec46c","#cf37a6","#4e6198"],e}()),c=function(e){function t(t,i,n,s){void 0===n&&(n={});var o=e.call(this,t,i,n,s||"number")||this;return o.registerToolbarItem("changeChartType",(function(){return o.chartTypes.length>1?h.b.createSelector(o.chartTypes.map((function(e){return{value:e,text:r.a.getString("chartType_"+e)}})),(function(e){return o.chartType===e.value}),(function(e){o.setChartType(e.target.value)})):null})),o}return Object(o.b)(t,e),t.prototype.onDataChanged=function(){this._resultAverage=void 0,this._resultMin=void 0,this._resultMax=void 0,e.prototype.onDataChanged.call(this)},t.prototype.onChartTypeChanged=function(){},t.prototype.setChartType=function(e){-1!==this.chartTypes.indexOf(e)&&this.chartType!==e&&(this.chartType=e,this.onChartTypeChanged(),this.contentContainer&&(this.destroyContent(this.contentContainer),this.renderContent(this.contentContainer)),this.invokeOnUpdate())},t.prototype.destroy=function(){this._resultAverage=void 0,this._resultMin=void 0,this._resultMax=void 0,e.prototype.destroy.call(this)},t.prototype.generateText=function(e,i,r){var n=[];if(5===r)n=["very high ("+e+")","high","medium","low","very low ("+i+")"];else{n.push(e);for(var s=0;s<r-2;s++)n.push("");n.push(i)}return t.generateTextsCallback?t.generateTextsCallback(this.question,e,i,r,n):n},t.prototype.generateValues=function(e,t){for(var i=[],r=0;r<t;r++)i.push(e/t);return i.push(e),i},t.prototype.generateColors=function(e,t,i){for(var r=this.getColors(),n=[],s=0;s<i;s++)n.push(r[s]);return n.push("rgba(255, 255, 255, 0)"),n},t.prototype.getData=function(){var e=this;if(void 0===this._resultAverage||void 0===this._resultMin||void 0===this._resultMax){this._resultMin=Number.MAX_VALUE,this._resultMax=-Number.MAX_VALUE,this._resultAverage=0;var t=0;this.data.forEach((function(i){if(void 0!==i[e.question.name]){var r=+i[e.question.name];t++,e._resultAverage+=r,e._resultMin>r&&(e._resultMin=r),e._resultMax<r&&(e._resultMax=r)}})),t>0&&(this._resultAverage=this._resultAverage/t),this._resultAverage=Math.ceil(100*this._resultAverage)/100}return[this._resultAverage,this._resultMin,this._resultMax]},t.stepsCount=5,t.showAsPercentage=!1,t}(u),d=function(e){function t(i,s,o,a){var l=e.call(this,i,s,o,a||"selectBase")||this;return l.selectedItem=void 0,l.choicesOrderSelector=void 0,l.showPercentageBtn=void 0,l.emptyAnswersBtn=void 0,l.transposeDataBtn=void 0,l.topNSelector=void 0,l._showPercentages=!1,l._showOnlyPercentages=!1,l._percentagePrecision=0,l._answersOrder="default",l._supportSelection=!0,l._hideEmptyAnswers=!1,l._topN=-1,l.topNValues=[].concat(t.topNValuesDefaults),l._transposeData=!1,l._showMissingAnswers=!1,l.missingAnswersBtn=void 0,l.chartTypes=[],l.chartType="bar",l.onAnswersDataReady=new n.Event,i.visibleChoicesChangedCallback=function(){l.dataProvider.reset()},l._showPercentages=!0===l.options.showPercentages,l._showOnlyPercentages=!0===l.options.showOnlyPercentages,l.options.percentagePrecision&&(l._percentagePrecision=l.options.percentagePrecision),l._hideEmptyAnswers=!0===l.options.hideEmptyAnswers,l._answersOrder=l.options.answersOrder||"default",l._showMissingAnswers=l.isSupportMissingAnswers()&&!0===l.options.showMissingAnswers,l.registerToolbarItem("changeChartType",(function(){return l.chartTypes.length>1?h.b.createSelector(l.chartTypes.map((function(e){return{value:e,text:r.a.getString("chartType_"+e)}})),(function(e){return l.chartType===e.value}),(function(e){l.setChartType(e.target.value)})):null})),l.registerToolbarItem("changeAnswersOrder",(function(){return void 0!==l.options.allowChangeAnswersOrder&&!l.options.allowChangeAnswersOrder||0!==l.getSeriesValues().length||(l.choicesOrderSelector=h.b.createSelector([{text:r.a.getString("defaultOrder"),value:"default"},{text:r.a.getString("ascOrder"),value:"asc"},{text:r.a.getString("descOrder"),value:"desc"}],(function(e){return!1}),(function(e){l.answersOrder=e.target.value})),l.updateOrderSelector()),l.choicesOrderSelector})),l.registerToolbarItem("showPercentages",(function(){if(l.options.allowShowPercentages&&(-1!==l.chartTypes.indexOf("bar")||-1!==l.chartTypes.indexOf("stackedbar")))return l.showPercentageBtn=h.b.createButton((function(){l.showPercentages=!l.showPercentages})),l.updateShowPercentageBtn(),l.showPercentageBtn})),l.registerToolbarItem("hideEmptyAnswers",(function(){return l.options.allowHideEmptyAnswers&&(l.emptyAnswersBtn=h.b.createButton((function(){l.hideEmptyAnswers=!l._hideEmptyAnswers})),l.updateEmptyAnswersBtn()),l.emptyAnswersBtn})),l.registerToolbarItem("topNAnswers",(function(){return l.options.allowTopNAnswers&&0===l.getSeriesValues().length&&(l.topNSelector=h.b.createSelector(l.topNValues.map((function(e){return{text:r.a.getString("topNValueText"+e),value:e}})),(function(e){return!1}),(function(e){l.topN=parseInt(e.target.value)})),l.updateTopNSelector()),l.topNSelector})),l.registerToolbarItem("transposeData",(function(){return l.options.allowTransposeData&&(l.transposeDataBtn=h.b.createButton((function(){l.transposeData=!l.transposeData})),l.updateTransposeDataBtn()),l.transposeDataBtn})),l.registerToolbarItem("showMissingAnswers",(function(){return l.isSupportMissingAnswers()&&l.options.allowShowMissingAnswers&&(l.missingAnswersBtn=h.b.createButton((function(){l.showMissingAnswers=!l._showMissingAnswers})),l.updateMissingAnswersBtn()),l.missingAnswersBtn})),l}return Object(o.b)(t,e),t.prototype.updateEmptyAnswersBtn=function(){this.emptyAnswersBtn&&(this.emptyAnswersBtn.innerText=this._hideEmptyAnswers?r.a.getString("showEmptyAnswers"):r.a.getString("hideEmptyAnswers"),"bar"==this.chartType||"vbar"==this.chartType||"scatter"==this.chartType?this.emptyAnswersBtn.style.display="inline":this.emptyAnswersBtn.style.display="none")},t.prototype.updateTransposeDataBtn=function(){this.transposeDataBtn&&(this.transposeDataBtn.innerText=this.transposeData?r.a.getString("showPerColumns"):r.a.getString("showPerValues"),this.getSeriesValues().length>0?this.transposeDataBtn.style.display="inline":this.transposeDataBtn.style.display="none")},t.prototype.updateOrderSelector=function(){this.choicesOrderSelector&&("bar"==this.chartType||"vbar"==this.chartType||"scatter"==this.chartType||("pie"==this.chartType||"doughnut"==this.chartType)&&this.topN>0?this.choicesOrderSelector.style.display="inline-block":this.choicesOrderSelector.style.display="none",this.choicesOrderSelector.getElementsByTagName("select")[0].value=this.answersOrder)},t.prototype.updateShowPercentageBtn=function(){this.showPercentageBtn&&(this.showPercentageBtn.innerText=this._showPercentages?r.a.getString("hidePercentages"):r.a.getString("showPercentages"),"bar"==this.chartType||"vbar"==this.chartType||"stackedbar"==this.chartType?this.showPercentageBtn.style.display="inline":this.showPercentageBtn.style.display="none")},t.prototype.updateTopNSelector=function(){this.topNSelector&&(this.topNSelector.getElementsByTagName("select")[0].value=this._topN)},t.prototype.updateMissingAnswersBtn=function(){this.missingAnswersBtn&&(this.missingAnswersBtn.innerText=this._showMissingAnswers?r.a.getString("hideMissingAnswers"):r.a.getString("showMissingAnswers"))},t.prototype.onChartTypeChanged=function(){this.updateOrderSelector(),this.updateShowPercentageBtn(),this.updateEmptyAnswersBtn(),this.updateTopNSelector()},t.prototype.setChartType=function(e){-1!==this.chartTypes.indexOf(e)&&this.chartType!==e&&(this.chartType=e,this.onChartTypeChanged(),this.refreshContent())},t.prototype.getCorrectAnswerText=function(){var t=e.prototype.getCorrectAnswerText.call(this),i=Array.isArray(t)?t:[t],r=this.question;return i.map((function(e){return n.ItemValue.getTextOrHtmlByValue(r.choices,e)})).join(", ")},t.prototype.getSelectedItemByText=function(e){var t=this.question;return this.question.hasOther&&e==t.otherText?t.otherItem:t.choices.filter((function(t){return t.text===e}))[0]},t.prototype.setSelection=function(e){this.selectedItem!==e&&(this.selectedItem=e,void 0!==this.onDataItemSelected&&this.onDataItemSelected(void 0!==e?e.value:void 0,void 0!==e?e.text:""))},Object.defineProperty(t.prototype,"selection",{get:function(){return this.selectedItem},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"showOnlyPercentages",{get:function(){return this._showOnlyPercentages},set:function(e){this._showOnlyPercentages=e,this.refreshContent()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"showPercentages",{get:function(){return this._showPercentages},set:function(e){this._showPercentages=e,this.updateShowPercentageBtn(),this.refreshContent()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"answersOrder",{get:function(){return this._answersOrder},set:function(e){this._answersOrder=e,this.updateOrderSelector(),this.refreshContent()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hideEmptyAnswers",{get:function(){return this._hideEmptyAnswers},set:function(e){this._hideEmptyAnswers=e,this.updateEmptyAnswersBtn(),this.refreshContent()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"transposeData",{get:function(){return this._transposeData},set:function(e){this._transposeData=e,this.updateTransposeDataBtn(),this.refreshContent()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"topN",{get:function(){return this._topN},set:function(e){this._topN=e,this.updateTopNSelector(),this.updateOrderSelector(),this.refreshContent()},enumerable:!1,configurable:!0}),t.prototype.isSupportMissingAnswers=function(){return!0},Object.defineProperty(t.prototype,"showMissingAnswers",{get:function(){return this._showMissingAnswers},set:function(e){this._showMissingAnswers=this.isSupportMissingAnswers()&&e,this.updateMissingAnswersBtn(),this.dataProvider.reset(this),this.refreshContent()},enumerable:!1,configurable:!0}),t.prototype.refreshContent=function(){this.contentContainer&&(this.destroyContent(this.contentContainer),this.renderContent(this.contentContainer)),this.invokeOnUpdate()},Object.defineProperty(t.prototype,"showValuesInOriginalOrder",{get:function(){return!1!==this.options.showValuesInOriginalOrder},enumerable:!1,configurable:!0}),t.prototype.valuesSource=function(){return this.question.activeChoices},t.prototype.getValues=function(){var e=this.valuesSource().map((function(e){return e.value}));return this.question.hasOther&&e.push("other"),this.showMissingAnswers&&e.unshift(void 0),this.showValuesInOriginalOrder?e.reverse():e},t.prototype.getLabels=function(){var e=this;if(this.options.useValuesAsLabels)return this.getValues();var t=this.valuesSource().map((function(t){return n.ItemValue.getTextOrHtmlByValue(e.valuesSource(),t.value)})),i=this.question;return i.hasOther&&t.push(i.otherText),this.showMissingAnswers&&t.unshift(r.a.getString("missingAnswersLabel")),this.showValuesInOriginalOrder?t.reverse():t},t.prototype.getPercentages=function(){var e=this.getData(),t=[],i=this._percentagePrecision;if(e.length<2)e.forEach((function(e,r){var n=e.reduce((function(e,t){return e+t}),0);t[r]=e.map((function(e){var t=i?+(e/n).toFixed(i):Math.round(e/n*1e4);return n&&t/100}))}));else for(var r=0;r<e[0].length;r++){for(var n=0,s=0;s<e.length;s++)n+=e[s][r];for(s=0;s<e.length;s++){Array.isArray(t[s])||(t[s]=[]);var o=i?+(e[s][r]/n*100).toFixed(i):Math.round(e[s][r]/n*100);t[s][r]=n&&o}}return t},t.prototype.hideEmptyAnswersInData=function(e){for(var t={datasets:[[]],labels:[],colors:[],texts:[[]],seriesLabels:e.seriesLabels},i=0;i<e.datasets[0].length;i++)0!=e.datasets[0][i]&&(t.datasets[0].push(e.datasets[0][i]),t.labels.push(e.labels[i]),t.colors.push(e.colors[i]),t.texts[0].push(e.texts[0][i]));return t},t.prototype.answersDataReady=function(e){var t={};return t=this.hideEmptyAnswers?this.hideEmptyAnswersInData(e):e,this.topN>0&&(t.datasets[0]=t.datasets[0].slice(-this.topN),t.labels=t.labels.slice(-this.topN),t.colors=t.colors.slice(-this.topN),t.texts[0]=t.texts[0].slice(-this.topN)),t},t.prototype.getAnswersData=function(){var e=this.getSeriesLabels(),t=this.getData(),i=this.getLabels(),r=this.getColors(),n=this.showPercentages?this.getPercentages():t;if(this.transposeData){t=this.transpose(t),n=this.transpose(n);var s=e;e=i,i=s}if("asc"==this.answersOrder||"desc"==this.answersOrder){var o=this.showPercentages?h.a.zipArrays(i,r,n[0]):h.a.zipArrays(i,r),a=h.a.sortDictionary(o,t[0],"desc"==this.answersOrder),l=h.a.unzipArrays(a.keys);i=l[0],r=l[1],this.showPercentages&&(n[0]=l[2]),t[0]=a.values}var u={datasets:t,labels:i,colors:r,texts:n,seriesLabels:e};return u=this.answersDataReady(u),this.onAnswersDataReady.fire(this,u),u},t.prototype.transpose=function(e){for(var t=e[0].length,i=new Array(t),r=0;r<t;++r)i[r]=new Array(e.length);for(r=0;r<e.length;++r)for(var n=0;n<t;++n)i[n][r]=e[r][n];return i},t.prototype.getState=function(){var e=this,i={};return t._stateProperties.forEach((function(t){i[t]=e[t]})),i},t.prototype.setState=function(e){var i=this;t._stateProperties.forEach((function(t){void 0!==e[t]&&(i[t]=e[t])}))},t.topNValuesDefaults=[-1,5,10,20],t._stateProperties=["chartType","answersOrder","hideEmptyAnswers","topN"],t}(u),p=function(e){function t(t,i,r,n){var s=e.call(this,t,i,r,n||"matrix")||this;return s.getAnswersData(),s}return Object(o.b)(t,e),Object.defineProperty(t.prototype,"matrixQuestion",{get:function(){return this.question},enumerable:!1,configurable:!0}),t.prototype.isSupportMissingAnswers=function(){return!1},t.prototype.getSeriesValues=function(){return this.matrixQuestion.rows.map((function(e){return""+e.value}))},t.prototype.getSeriesLabels=function(){var e=this;return this.matrixQuestion.rows.map((function(t){return n.ItemValue.getTextOrHtmlByValue(e.matrixQuestion.rows,t.value)}))},t.prototype.getSelectedItemByText=function(e){return this.matrixQuestion.columns.filter((function(t){return t.text===e}))[0]},t.prototype.valuesSource=function(){return this.matrixQuestion.columns},t.prototype.getHasAnswersInAllSeriesArray=function(e){for(var t=Array(),i=0;i<e[0].length;i++)for(var r=0;r<e.length;r++)0!=e[r][i]&&(t[i]=!0);return t},t.prototype.getHasAnswersInSeries=function(e){for(var t=0;t<e.length;t++)if(0!=e[t])return!0;return!1},t.prototype.hideEmptyAnswersInData=function(e){for(var t={datasets:[],labels:[],colors:[],texts:[],seriesLabels:[]},i=this.getHasAnswersInAllSeriesArray(e.datasets),r=0;r<e.datasets.length;r++){if(this.getHasAnswersInSeries(e.datasets[r])){t.labels.push(e.labels[r]),t.colors.push(e.colors[r]);for(var n=[],s=[],o=0;o<e.datasets[0].length;o++)i[o]&&(n.push(e.datasets[r][o]),s.push(e.texts[r][o]));t.datasets.push(n),t.texts.push(s)}}for(r=0;r<e.datasets[0].length;r++)i[r]&&t.seriesLabels.push(e.seriesLabels[r]);return t},t.prototype.getData=function(){var t=e.prototype.getData.call(this),i=this.getSeriesValues(),r=this.getValues();if(i.length>1){var n=[];return r.forEach((function(e,r){var s=i.map((function(e,i){return t[i][r]}));n.push(s)})),n}return t},t}(d),f=function(e){function t(t,i,r,n){return e.call(this,t,i,r,n||"boolean")||this}return Object(o.b)(t,e),t.prototype.getCorrectAnswerText=function(){var e=this.booleanQuestion.correctAnswer;return void 0!==this.booleanQuestion.valueTrue&&this.booleanQuestion.valueTrue===e||e?this.booleanQuestion.locLabelTrue.textOrHtml:void 0!==this.booleanQuestion.valueFalse&&this.booleanQuestion.valueFalse===e||!e?this.booleanQuestion.locLabelFalse.textOrHtml:e},Object.defineProperty(t.prototype,"booleanQuestion",{get:function(){return this.question},enumerable:!1,configurable:!0}),t.prototype.getSelectedItemByText=function(e){var t=this.getLabels(),i=this.getValues();return new n.ItemValue(i[t.indexOf(e)],e)},t.prototype.getValues=function(){var e=[void 0===this.booleanQuestion.valueTrue||this.booleanQuestion.valueTrue,void 0!==this.booleanQuestion.valueFalse&&this.booleanQuestion.valueFalse];return this.showMissingAnswers&&e.push(void 0),e},t.prototype.getLabels=function(){var e=[].concat(this.getValues());return void 0!==this.booleanQuestion.labelTrue&&(e[0]=this.booleanQuestion.locLabelTrue.textOrHtml),void 0!==this.booleanQuestion.labelFalse&&(e[1]=this.booleanQuestion.locLabelFalse.textOrHtml),this.showMissingAnswers&&(e[2]=r.a.getString("missingAnswersLabel")),e},t.trueColor="",t.falseColor="",t}(d),m=function(e){function t(t,i,r,n){var s=e.call(this,t,i,r,n||"histogram")||this;return s.valueType="number",s._cachedValues=void 0,s._continiousData=void 0,s._cachedIntervals=void 0,s._intervalPrecision=2,void 0!==s.options.intervalPrecision&&(s._intervalPrecision=s.options.intervalPrecision),"text"!==t.getType()||"date"!==t.inputType&&"datetime"!==t.inputType?s.valueType="number":s.valueType="date",s}return Object(o.b)(t,e),t.prototype.reset=function(){this._continiousData=void 0,this._cachedValues=void 0,this._cachedIntervals=void 0},t.prototype.getContiniousValue=function(e){return"date"===this.valueType?Date.parse(e):parseFloat(e)},t.prototype.getString=function(e){return"date"===this.valueType?new Date(e).toLocaleDateString():""+e},t.prototype.toPrecision=function(e){var t=Math.pow(10,this._intervalPrecision);return Math.round(t*e)/t},t.prototype.getSelectedItemByText=function(e){if(this.hasCustomIntervals||this.getContiniousValues().length>t.UseIntervalsFrom){var i=this.intervals.filter((function(t){return t.label===e}))[0];return new n.ItemValue(i,void 0!==i?i.label:"")}var r=this.getLabels(),s=r.indexOf(e);return new n.ItemValue(this.getValues()[s],r[s])},t.prototype.updateData=function(t){this.reset(),e.prototype.updateData.call(this,t)},t.prototype.onDataChanged=function(){this.reset(),e.prototype.onDataChanged.call(this)},t.prototype.getContiniousValues=function(){var e=this;if(void 0===this._cachedValues){var t=this.getSeriesValues();0===t.length&&t.push(""),this._continiousData={},t.forEach((function(t){return e._continiousData[t]=[]}));var i={};this.data.forEach((function(t){var r=t[e.dataName];if(void 0!==r){var n=t[s.seriesMarkerKey]||"";e._continiousData[n].push(e.getContiniousValue(r)),i[r]=r}})),this._cachedValues=Object.keys(i).map((function(t){return{original:i[t],continious:e.getContiniousValue(t)}})),this._cachedValues.sort((function(e,t){return e.continious-t.continious}))}return this._cachedValues},t.prototype.isSupportMissingAnswers=function(){return!1},Object.defineProperty(t.prototype,"needUseRateValues",{get:function(){return"rating"==this.question.getType()&&Array.isArray(this.question.rateValues)&&this.question.rateValues.length>0},enumerable:!1,configurable:!0}),t.prototype.getValues=function(){var e=this.getContiniousValues();return this.hasCustomIntervals||e.length>t.UseIntervalsFrom||this.needUseRateValues?this.intervals.map((function(e){return e.start})):e.map((function(e){return e.original}))},t.prototype.getLabels=function(){var e=this.getContiniousValues();return this.hasCustomIntervals||e.length>t.UseIntervalsFrom||this.needUseRateValues?this.intervals.map((function(e){return e.label})):e.map((function(e){return""+e.original}))},Object.defineProperty(t.prototype,"hasCustomIntervals",{get:function(){return!!this.questionOptions&&Array.isArray(this.questionOptions.intervals)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"intervals",{get:function(){if(this.hasCustomIntervals)return this.questionOptions.intervals.reverse();if(this.needUseRateValues){var e=this.question.rateValues;return e.map((function(t,i){return{start:t.value,end:i<e.length-1?e[i+1].value:t.value+1,label:t.text}})).reverse()}if(void 0===this._cachedIntervals){var i=this.getContiniousValues();if(this._cachedIntervals=[],i.length)for(var r=i[0].continious,n=i[i.length-1].continious,s=t.IntervalsCount,o=(n-r)/s,a=0;a<s;++a){var l=r+o,h=this.toPrecision(r),u=this.toPrecision(l);this._cachedIntervals.push({start:h,end:u,label:this.getString(h)+"-"+this.getString(u)}),r=l}}return this._cachedIntervals},enumerable:!1,configurable:!0}),t.prototype.getData=function(){var i=this.getContiniousValues();if(!this.hasCustomIntervals&&i.length<=t.UseIntervalsFrom)return e.prototype.getData.call(this);var r=this.intervals,n=[],s=this.getSeriesValues();0===s.length&&s.push("");for(var o=0;o<s.length;++o)n.push(r.map((function(e){return 0}))),this._continiousData[s[o]].forEach((function(e){for(var t=0;t<r.length;++t)if(r[t].start<=e&&(e<r[t].end||t==r.length-1)){n[o][t]++;break}}));return n},t.IntervalsCount=10,t.UseIntervalsFrom=10,t}(d),g=function(e){function t(t,i,s,o){var a=e.call(this,i,s,o)||this;if(a.visualizers=t,a.visualizersWithSelection=[],a.onAfterVisualizerRenderCallback=function(){a.afterRender(a.contentContainer)},a.onVisualizerChanged=new n.Event,!t||t.length<2)throw new Error("VisualizerArrayWrapper works with visualizers collection only.");return a.visualizers.forEach((function(e){e.onUpdate=function(){return a.invokeOnUpdate()},e.supportSelection&&(a._supportSelection=!0,a.visualizersWithSelection.push(e))})),a.registerToolbarItem("changeVisualizer",(function(){return a.visualizerSelector=h.b.createSelector(a.visualizers.map((function(e){return{value:e.name,text:r.a.getString("visualizer_"+e.name)}})),(function(e){return a.visualizer.name===e.value}),(function(e){return a.setVisualizer(e.target.value)}))})),a.visualizer=t[0],a.visualizer.onAfterRender.add(a.onAfterVisualizerRenderCallback),a}return Object(o.b)(t,e),t.prototype.updateVisualizerSelector=function(){this.visualizerSelector&&(this.visualizerSelector.getElementsByTagName("select")[0].value=this.visualizer.name)},Object.defineProperty(t.prototype,"hasFooter",{get:function(){return!1},enumerable:!1,configurable:!0}),t.prototype.getVisualizers=function(){return this.visualizers},t.prototype.setVisualizer=function(e,t){void 0===t&&(t=!1);var i=this.visualizers.filter((function(t){return t.name===e}))[0];i&&i!==this.visualizer&&(this.visualizer&&(this.visualizer.onAfterRender.remove(this.onAfterVisualizerRenderCallback),this.visualizer.destroy()),this.visualizer=i,this.refresh(),this.visualizer.onAfterRender.add(this.onAfterVisualizerRenderCallback),t||this.onVisualizerChanged.fire(this,{visualizer:this.visualizer}),this.updateVisualizerSelector())},t.prototype.updateData=function(t){e.prototype.updateData.call(this,t),this.visualizers.forEach((function(e){e.updateData(t)}))},Object.defineProperty(t.prototype,"onDataItemSelected",{set:function(e){this.visualizersWithSelection.forEach((function(t){t.onDataItemSelected=e}))},enumerable:!1,configurable:!0}),t.prototype.setSelection=function(e){this.visualizersWithSelection.forEach((function(t){t.setSelection(e)}))},Object.defineProperty(t.prototype,"selection",{get:function(){return this.visualizer.selection||this.selectedItem},enumerable:!1,configurable:!0}),t.prototype.renderContent=function(e){this.visualizerContainer=e,this.visualizer.render(this.visualizerContainer)},t.prototype.setBackgroundColorCore=function(t){e.prototype.setBackgroundColorCore.call(this,t),this.visualizers.forEach((function(e){return e.backgroundColor=t}))},t.prototype.destroy=function(){var t=this;this.visualizers.forEach((function(e){e.onAfterRender.remove(t.onAfterVisualizerRenderCallback),e.onUpdate=void 0})),this.visualizer.destroy(),e.prototype.destroy.call(this)},t}(u);a.registerAlternativesVisualizer(g);var _=function(){function e(e){this._htmlElement=void 0,this.text=void 0,this._htmlElement=h.b.createElement("div","sa-question__filter"),this.text=h.b.createElement("span","sa-question__filter-text"),this._htmlElement.appendChild(this.text);var t=h.b.createButton((function(){e.setSelection(void 0)}),r.a.getString("clearButton"));this._htmlElement.appendChild(t)}return Object.defineProperty(e.prototype,"htmlElement",{get:function(){return this._htmlElement},enumerable:!1,configurable:!0}),e.prototype.update=function(e){void 0!==e&&void 0!==e.value?(this._htmlElement.style.display="inline-block",this.text.innerText=r.a.getString("filter")+": ["+e.text+"]"):(this._htmlElement.style.display="none",this.text.innerText="")},e}(),y=i(25),v=function(e){function t(t,i){var r=e.call(this,t)||this;return r._selector=i,r._muuri=void 0,r._layoutingTimer=void 0,r}return Object(o.b)(t,e),t.prototype.startCore=function(e){var t=this;this._muuri=new y(e,{dragStartPredicate:{handle:".sa-question__title--draggable"},items:this._selector,dragEnabled:!0}),this._muuri.on("dragReleaseEnd",(function(e){return t.onMoveCallback&&t.onMoveCallback(e.fromIndex,e.toIndex)}))},t.prototype.stopCore=function(){this._muuri.off("dragReleaseEnd"),this._muuri.destroy(),this._muuri=void 0},t.prototype.updateCore=function(){var e=this;void 0!==this._layoutingTimer&&clearTimeout(this._layoutingTimer),this._layoutingTimer=setTimeout((function(){e._layoutingTimer=void 0,e._muuri.refreshItems(),e._muuri.layout()}),10)},t.prototype.add=function(e,t){this._allowed&&this._muuri.add(e,t)},t.prototype.remove=function(e,t){this._allowed&&this._muuri.remove(e,t)},t}(function(){function e(e){this._allowed=e}return e.prototype.startCore=function(e){},e.prototype.stopCore=function(){},e.prototype.updateCore=function(){},Object.defineProperty(e.prototype,"allowed",{get:function(){return this._allowed},enumerable:!1,configurable:!0}),e.prototype.start=function(e){this._allowed&&this.startCore(e)},e.prototype.stop=function(){this._allowed&&this.stopCore()},e.prototype.update=function(){this._allowed&&this.updateCore()},e.prototype.add=function(e,t){},e.prototype.remove=function(e,t){},e.prototype.destroy=function(){this.stop()},e}());i(26);if(document){var b=i(16),w=document.createElement("div");w.style.display="none",w.innerHTML=b,document.head.appendChild(w)}var C=function(e){function t(i,s,o,a){void 0===o&&(o={}),void 0===a&&(a=void 0);var l=e.call(this,null,s,o,"panel")||this;if(l.questions=i,l._elements=a,l.visualizers=[],l.haveCommercialLicense=!1,l.renderedQuestionsCount=0,l.onAfterRenderQuestionCallback=function(e,t){l.renderedQuestionsCount++,l.renderedQuestionsCount==l.questions.length&&(l.renderedQuestionsCount=0,l.afterRender(l.contentContainer))},l.onAlternativeVisualizerChanged=new n.Event,l.onAlternativeVisualizerChangedCallback=function(e,t){l.onAlternativeVisualizerChanged.fire(e,t)},l.onVisibleElementsChanged=new n.Event,l.onStateChanged=new n.Event,l._layoutEngine=o.layoutEngine||new v(l.allowDynamicLayout,".sa-question-layouted"),l._layoutEngine.onMoveCallback=function(e,t){return l.moveVisibleElement(e,t)},l.showHeader=!0,l.options.survey&&(r.a.currentLocale=l.options.survey.locale),void 0===a&&(l._elements=l.buildElements(i)),l.haveCommercialLicense=t.haveCommercialLicense||void 0!==o.haveCommercialLicense&&o.haveCommercialLicense,l.buildVisualizers(i),l.haveCommercialLicense||l.registerToolbarItem("commercialLicense",(function(){return Object(h.c)()})),l.registerToolbarItem("resetFilter",(function(){return h.b.createButton((function(){l.visualizers.forEach((function(e){(e instanceof d||e instanceof g)&&e.setSelection(void 0)}))}),r.a.getString("resetFilter"))})),l.registerToolbarItem("addElement",(function(e){if(l.allowHideQuestions){var t=void 0,i=function(i,n){var s=l.hiddenElements;if(s.length>0){var o=h.b.createSelector([{name:void 0,displayName:r.a.getString("addElement")}].concat(s).map((function(e){return{value:e.name,text:e.displayName}})),(function(e){return!1}),(function(e){l.showElement(e.target.value)}));t&&e.replaceChild(o,t)||e.appendChild(o),t=o}else t&&e.removeChild(t),t=void 0};i(),l.onVisibleElementsChanged.add(i)}})),!l.options.disableLocaleSwitch&&l.locales.length>1){var u=l.locales.map((function(e){return{value:e,text:r.a.getString(e)}}));l.registerToolbarItem("changeLocale",(function(){return h.b.createSelector(u,(function(e){return!!e.value&&l.locale===e.value}),(function(e){var t=e.target.value;l.locale=t}))}))}return l}return Object(o.b)(t,e),t.prototype.showElement=function(e){var t=this.getElement(e),i=this._elements.indexOf(t);t.isVisible=!0;var r=this.renderPanelElement(t,this.contentContainer);this.layoutEngine.add([r],{index:i}),this.visibleElementsChanged(t,"ADDED")},t.prototype.hideElement=function(e){var t=this.getElement(e);t.isVisible=!1,t.renderedElement&&(this.layoutEngine.remove([t.renderedElement]),this.contentContainer.removeChild(t.renderedElement),t.renderedElement=void 0),this.visibleElementsChanged(t,"REMOVED")},t.prototype.makeElementPrivate=function(e){e.isPublic=!1,this.onStateChanged.fire(this,this.state),this.onPermissionsChangedCallback&&this.onPermissionsChangedCallback(this)},t.prototype.makeElementPublic=function(e){e.isPublic=!0,this.onStateChanged.fire(this,this.state),this.onPermissionsChangedCallback&&this.onPermissionsChangedCallback(this)},t.prototype.moveVisibleElement=function(e,t){var i,r,n=this.visibleElements[e],s=this.visibleElements[t];i=this._elements.indexOf(n),r=this._elements.indexOf(s),this.moveElement(i,r)},t.prototype.moveElement=function(e,t){var i=this._elements.splice(e,1);this._elements.splice(t,0,i[0]),this.visibleElementsChanged(i[0],"MOVED")},t.prototype.setBackgroundColorCore=function(t){e.prototype.setBackgroundColorCore.call(this,t),this.visualizers.forEach((function(e){return e.backgroundColor=t}))},t.prototype.buildVisualizers=function(e){var t=this;e.forEach((function(e){var i=t.createVisualizer(e);if(t.allowHideQuestions&&i.registerToolbarItem("removeQuestion",(function(){return h.b.createButton((function(){setTimeout((function(){return t.hideElement(e.name)}),0)}),r.a.getString("hideButton"))})),t.allowMakeQuestionsPrivate&&i.registerToolbarItem("makePrivatePublic",(function(){var i=t.getElement(e.name),n=i.isPublic?"first":"second",s=r.a.getString("makePrivateButton"),o=r.a.getString("makePublicButton");return h.b.createSvgToggleButton("makepublic","makeprivate",s,o,(function(e){setTimeout((function(){return t.makeElementPublic(i)}),0)}),(function(e){setTimeout((function(){return t.makeElementPrivate(i)}),0)}),n)})),i.supportSelection){var n=i,s=new _(n);i.registerToolbarItem("questionFilterInfo",(function(){return s.update(n.selection),s.htmlElement})),n.onDataItemSelected=function(i,r){s.update({value:i,text:r}),t.setFilter(e.name,i)}}i.onUpdate=function(){return t.layout()},i.onAfterRender.add(t.onAfterRenderQuestionCallback),i instanceof g&&i.onVisualizerChanged.add(t.onAlternativeVisualizerChangedCallback),t.visualizers.push(i)}))},t.prototype.destroyVisualizers=function(){var e=this;this.visualizers.forEach((function(t){t.onUpdate=void 0,t instanceof d&&(t.onDataItemSelected=void 0),t instanceof g&&t.onVisualizerChanged.remove(e.onAlternativeVisualizerChangedCallback),t.onAfterRender.remove(e.onAfterRenderQuestionCallback),t.destroy()})),this.visualizers=[]},t.prototype.setLocale=function(t){var i=this;e.prototype.setLocale.call(this,t),(this.questions||[]).forEach((function(e){var t=i.getElement(e.name);t&&(t.displayName=i.processText(e.title))})),this.visualizers.forEach((function(e){e.options.seriesLabels=i.options.seriesLabels,e.locale=t})),this.onStateChanged.fire(this,this.state)},Object.defineProperty(t.prototype,"allowDynamicLayout",{get:function(){return void 0===this.options.allowDynamicLayout||!0===this.options.allowDynamicLayout},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"allowHideQuestions",{get:function(){return void 0===this.options.allowHideQuestions||!0===this.options.allowHideQuestions},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"allowMakeQuestionsPrivate",{get:function(){return!0===this.options.allowMakeQuestionsPrivate},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"layoutEngine",{get:function(){return this._layoutEngine},enumerable:!1,configurable:!0}),t.prototype.buildElements=function(e){var t=this;return(e||[]).map((function(e){return{name:e.name,displayName:t.processText(e.title),isVisible:!0,isPublic:!0,type:void 0}}))},t.prototype.getElements=function(){return(this._elements||[]).map((function(e){return{name:e.name,displayName:e.displayName,isVisible:e.isVisible,isPublic:e.isPublic,type:e.type}}))},Object.defineProperty(t.prototype,"visibleElements",{get:function(){return this._elements.filter((function(e){return e.isVisible}))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hiddenElements",{get:function(){return this._elements.filter((function(e){return!e.isVisible}))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"publicElements",{get:function(){return this._elements.filter((function(e){return e.isPublic}))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"privateElements",{get:function(){return this._elements.filter((function(e){return!e.isPublic}))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"locales",{get:function(){return this.options.survey?this.options.survey.getUsedLocales():[]},enumerable:!1,configurable:!0}),t.prototype.getElement=function(e){return this._elements.filter((function(t){return t.name===e}))[0]},t.prototype.getVisualizer=function(e){return this.visualizers.filter((function(t){return t.question.name===e}))[0]},t.prototype.visibleElementsChanged=function(e,t){this.onVisibleElementsChanged.isEmpty||this.onVisibleElementsChanged.fire(this,{elements:this._elements,changed:e,reason:t}),this.onStateChanged.fire(this,this.state),this.layout()},t.prototype.renderPanelElement=function(e,t){var i=this.getVisualizer(e.name),r=h.b.createElement("div");t.appendChild(r);var n=h.b.createElement("div"),s=h.b.createElement("h3"),o=h.b.createElement("div");return s.innerText=e.displayName,r.className=this.allowDynamicLayout?"sa-question sa-question-layouted":"sa-question",s.className="sa-question__title",this.allowDynamicLayout&&(s.className=s.className+" sa-question__title--draggable"),n.className="sa-question__content",n.style.backgroundColor=this.backgroundColor,n.appendChild(s),n.appendChild(o),r.appendChild(n),i.render(o),e.renderedElement=r,r},t.prototype.renderToolbar=function(t){t.className+=" sa-panel__header",e.prototype.renderToolbar.call(this,t)},t.prototype.renderContent=function(e){var t=this;e.className+=" sa-panel__content sa-grid",this.visibleElements.forEach((function(i){t.renderPanelElement(i,e)})),this.layoutEngine.start(e)},t.prototype.destroyContent=function(t){this.layoutEngine.stop(),e.prototype.destroyContent.call(this,t)},t.prototype.refresh=function(){this.toolbarContainer&&(this.destroyToolbar(this.toolbarContainer),this.renderToolbar(this.toolbarContainer)),e.prototype.refresh.call(this)},t.prototype.layout=function(){this.layoutEngine.update()},t.prototype.setFilter=function(e,t){this.dataProvider.setFilter(e,t)},Object.defineProperty(t.prototype,"state",{get:function(){var e=this;return{locale:this.locale,elements:[].concat(this._elements.map((function(t){var i=e.getVisualizer(t.name),r=Object(o.a)(Object(o.a)({},t),null==i?void 0:i.getState());return void 0!==r.renderedElement&&delete r.renderedElement,r})))}},set:function(e){var t=this;if(e){if(Array.isArray(e.elements)){var i=this.questions.map((function(e){return e.name}));this._elements=[].concat(e.elements.filter((function(e){return-1!==i.indexOf(e.name)})))}void 0!==e.locale&&this.setLocale(e.locale),this._elements.forEach((function(e){var i=t.getVisualizer(e.name);void 0!==i&&i.setState(e)})),this.refresh()}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"permissions",{get:function(){return this._elements.map((function(e){return{name:e.name,isPublic:e.isPublic}}))},set:function(e){var t=this._elements.map((function(t){return e.forEach((function(e){e.name===t.name&&(t.isPublic=e.isPublic)})),Object(o.a)({},t)}));this._elements=[].concat(t),this.refresh(),this.onPermissionsChangedCallback&&this.onPermissionsChangedCallback(this)},enumerable:!1,configurable:!0}),t.prototype.destroy=function(){e.prototype.destroy.call(this),this.destroyVisualizers()},t.haveCommercialLicense=!1,t}(u),S=function(e){function t(t,i,r,n){void 0===r&&(r={});var s=e.call(this,t,i,r,n||"panelDynamic")||this;return s._panelVisualizer=void 0,s.onAfterRenderPanelCallback=function(){s.afterRender(s.contentContainer)},(r=Object.assign({},r)).allowDynamicLayout=!1,r.dataProvider=void 0,s._panelVisualizer=new C(s.getQuestions(),[],r),s._panelVisualizer.onAfterRender.add(s.onAfterRenderPanelCallback),s.updateData(i),s}return Object(o.b)(t,e),t.prototype.setLocale=function(t){e.prototype.setLocale.call(this,t),this._panelVisualizer.locale=t},Object.defineProperty(t.prototype,"name",{get:function(){return"panelDynamic"},enumerable:!1,configurable:!0}),t.prototype.updatePanelVisualizerData=function(){var e=this,t=[];this.data.forEach((function(i){void 0!==i[e.question.name]&&(t=t.concat(i[e.question.name]))})),this._panelVisualizer.updateData(t)},t.prototype.updateData=function(t){e.prototype.updateData.call(this,t),this.updatePanelVisualizerData()},t.prototype.onDataChanged=function(){this.updatePanelVisualizerData(),e.prototype.onDataChanged.call(this)},t.prototype.getQuestions=function(){return this.question.template.questions},t.prototype.destroyContent=function(t){this._panelVisualizer.clear(),e.prototype.destroyContent.call(this,this.contentContainer)},t.prototype.renderContent=function(e){this._panelVisualizer.render(e)},t.prototype.destroy=function(){e.prototype.destroy.call(this),this._panelVisualizer.onAfterRender.remove(this.onAfterRenderPanelCallback)},t}(u);a.registerVisualizer("paneldynamic",S);var T=function(e){function t(t,i,r){return e.call(this,t,i,r)||this}return Object(o.b)(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"matrixDynamic"},enumerable:!1,configurable:!0}),t.prototype.getQuestions=function(){var e=this.question.visibleRows;return 0===e.length?[]:e[0].cells.map((function(e){return e.question}))},t}(S);a.registerVisualizer("matrixdynamic",T);var A=function(e){function t(t,i,r,s){void 0===r&&(r={});var o=e.call(this,t,i,r,s||"matrixDropdown")||this;o._matrixDropdownVisualizer=void 0,o.onPanelAfterRenderCallback=function(){o.afterRender(o.contentContainer)},o._childOptions=Object.assign({},r),o._childOptions.disableLocaleSwitch=!0,o._childOptions.dataProvider=void 0,o._childOptions.allowDynamicLayout=!1,o._childOptions.seriesValues=t.rows.map((function(e){return e.value})),o._childOptions.seriesLabels=t.rows.map((function(e){return e.text}));var l=o.getQuestions();if(1==o._childOptions.seriesValues.length&&l.every((function(e){return n.Helpers.isArraysEqual(e.choices,o.question.choices)}))){var h=a.getVisualizersByType("matrixdropdown-grouped");o._matrixDropdownVisualizer=new h[0](o.question,[],o._childOptions)}else o._matrixDropdownVisualizer=new C(l,[],o._childOptions);return o._matrixDropdownVisualizer.onAfterRender.add(o.onPanelAfterRenderCallback),o.updateData(i),o}return Object(o.b)(t,e),t.prototype.setLocale=function(t){e.prototype.setLocale.call(this,t),this._childOptions.seriesLabels=this.question.rows.map((function(e){return e.text})),this._matrixDropdownVisualizer.locale=t},Object.defineProperty(t.prototype,"matrixDropdownVisualizer",{get:function(){return this._matrixDropdownVisualizer},enumerable:!1,configurable:!0}),t.prototype.updateDropdownVisualizerData=function(){var e=this,t=[];this.data.forEach((function(i){var r=i[e.question.name];r&&Object.keys(r).forEach((function(e){var i=Object.assign({},r[e]);i[s.seriesMarkerKey]=e,t.push(i)}))})),this._matrixDropdownVisualizer.updateData(t)},t.prototype.updateData=function(t){e.prototype.updateData.call(this,t),this.updateDropdownVisualizerData()},t.prototype.onDataChanged=function(){this.updateDropdownVisualizerData(),e.prototype.onDataChanged.call(this)},t.prototype.getQuestions=function(){var e=this.question;return e.columns.map((function(t){var i=t.templateQuestion;return Array.isArray(i.choices)&&0===i.choices.length&&(i.choices=e.choices),i}))},t.prototype.destroyContent=function(t){this._matrixDropdownVisualizer.clear(),e.prototype.destroyContent.call(this,this.contentContainer)},t.prototype.renderContent=function(e){this._matrixDropdownVisualizer.render(e)},t.prototype.destroy=function(){e.prototype.destroy.call(this),this._matrixDropdownVisualizer.onAfterRender.remove(this.onPanelAfterRenderCallback)},t}(u);a.registerVisualizer("matrixdropdown",A);var D=function(){function e(){}return e.setup=function(e,t){return this.setups[e](t)},e.setupPie=function(t){var i=t.getAnswersData(),r=i.datasets,n=i.labels,s=i.colors,o=(i.texts,i.seriesLabels),a=[],l=o.length>1,h={type:t.chartType,y:l?o:n,text:(l?o:n).map((function(i){return e.getTruncatedLabel(i,t.labelTruncateLength)})),hoverinfo:"x+y",mode:"markers",marker:{}};h.hoverinfo="label+value+percent",h.marker.colors=s,h.textposition="inside","doughnut"===t.chartType&&(h.type="pie",h.hole=.4),l||(h.marker.symbol="circle",h.marker.size=16),r.forEach((function(e,t){a.push(Object.assign({},h,{values:e,labels:l?o:n,customdata:l?o:n}))}));var u={font:{family:"Segoe UI, sans-serif",size:14,weight:"normal",color:"#404040"},height:(n.length<10?50*n.length+100:550)*Math.round(a.length/2)+25,margin:{l:0,t:25,b:0,r:10},colorway:s,hovermode:"closest",plot_bgcolor:t.backgroundColor,paper_bgcolor:t.backgroundColor,showlegend:!1};return l&&(u.grid={rows:Math.round(a.length/2),columns:2},u.annotations=[],n.forEach((function(e,t){a[t].domain={column:t%2,row:Math.floor(t/2)},a[t].title={position:"bottom center",text:e}}))),{traces:a,layout:u,hasSeries:l}},e.setupBar=function(t){var i=t.getAnswersData(),r=i.datasets,n=i.labels,s=i.colors,o=i.texts,a=i.seriesLabels,l=[],h=a.length>1,u=h?a:n,c={type:t.chartType,y:u,text:u,customdata:h?a:n,hoverinfo:"text",orientation:"h",mode:"markers",textposition:"none",width:.5,bargap:.5,marker:{}};c.marker.color=s,r.forEach((function(e,i){var r=Object.assign({},c,{x:e,text:o[i],hovertext:u.map((function(e,t){return"".concat(o[i][t],", ").concat(e)}))});if(t.showPercentages){var n=t.showOnlyPercentages?"%{text}%":"%{value} (%{text}%)";r.textposition="inside",r.texttemplate=n,r.bargap=.1}l.push(r)}));var d={font:{family:"Segoe UI, sans-serif",size:14,weight:"normal",color:"#404040"},height:30*(n.length+1)+30+30,margin:{t:30,b:30,r:10},colorway:s,hovermode:"closest",yaxis:{automargin:!0,type:"category",orientation:"h",tickmode:"array",tickvals:u,ticktext:u.map((function(i){return e.getTruncatedLabel(i,t.labelTruncateLength)+" "}))},xaxis:{rangemode:"nonnegative",automargin:!0},plot_bgcolor:t.backgroundColor,paper_bgcolor:t.backgroundColor,showlegend:!1};return h&&(d.showlegend=!0,"stackedbar"==t.chartType?d.barmode="stack":d.height=30*(n.length+1)*a.length+30+30,n.forEach((function(e,i){l[i].marker.color=void 0,l[i].name=e,"stackedbar"===t.chartType?(l[i].type="bar",l[i].width=.5):l[i].width=(t.showPercentages?.7:.5)/l.length})),l.forEach((function(e,i){var r=t.showPercentages?"%":"";l[i].hovertext=[],u.forEach((function(t,n){l[i].hovertext.push("".concat(e.y[n]," : ").concat(e.name,", ").concat(e.text[n]).concat(r))}))}))),{traces:l,layout:d,hasSeries:h}},e.setupVBar=function(e){var t=e.getAnswersData(),i=t.datasets,r=t.labels,n=t.colors,s=t.texts,o=t.seriesLabels,a=[],l=o.length>1,h={font:{family:"Segoe UI, sans-serif",size:14,weight:"normal",color:"#404040"},margin:{t:30,b:30,r:10},colorway:n,hovermode:"closest",plot_bgcolor:e.backgroundColor,paper_bgcolor:e.backgroundColor,showlegend:!1},u={type:"bar",customdata:l?o:r,hoverinfo:"x+y",mode:"markers",textposition:"none",width:.5,bargap:.5,marker:{}};return u.marker.color=n,i.forEach((function(t,i){var n=Object.assign({},u,{x:r,y:e.showPercentages?s[i].map((function(e){return e/100})):t,text:s[i]});if(e.showPercentages){var o=e.showOnlyPercentages?"%{text}%":"%{value} (%{text}%)";n.textposition="inside",n.texttemplate=o,n.width=.9,n.bargap=.1}a.push(n)})),e.showPercentages&&e.showOnlyPercentages&&(h.yaxis={automargin:!0,tickformat:".0%",range:[0,1],ticklen:e.showOnlyPercentages?25:5,tickcolor:"transparent"}),{traces:a,layout:h,hasSeries:l}},e.setupScatter=function(t){var i=t.getAnswersData(),r=i.datasets,n=i.labels,s=i.colors,o=(i.texts,i.seriesLabels),a=o.length>1,l=[],h={type:"scatter",y:(a?o:n).map((function(i){return e.getTruncatedLabel(i,t.labelTruncateLength)})),customdata:a?o:n,text:a?o:n,hoverinfo:"x+y",orientation:"h",mode:"markers",width:.5,marker:{}};a||(h.marker.symbol="circle",h.marker.size=16),r.forEach((function(e){var t=Object.assign({},h,{x:e});l.push(t)}));var u={font:{family:"Segoe UI, sans-serif",size:14,weight:"normal",color:"#404040"},height:30*(n.length+1)+30+30,margin:{t:30,b:30,r:10},colorway:s,hovermode:"closest",yaxis:{automargin:!0,type:"category",ticklen:5,tickcolor:"transparent"},xaxis:{rangemode:"nonnegative",automargin:!0},plot_bgcolor:t.backgroundColor,paper_bgcolor:t.backgroundColor,showlegend:!1};return a&&(u.showlegend=!0,u.height=void 0,n.forEach((function(e,t){l[t].hoverinfo="x+name",l[t].marker.color=void 0,l[t].name=e}))),{traces:l,layout:u,hasSeries:a}},e.imageExportFormat="png",e.onImageSaving=new n.Event,e.onPlotCreating=new n.Event,e.setups={bar:e.setupBar,vbar:e.setupVBar,stackedbar:e.setupBar,doughnut:e.setupPie,pie:e.setupPie,scatter:e.setupScatter},e.getTruncatedLabel=function(e,t){var i="...".length;return t?-1===t||e.length<=t+i?e:e.substring(0,t)+"...":e},e}(),E=i(7),P=i.n(E),x=function(){function e(e){this.model=e,this._chart=void 0}return e.prototype.patchConfigParameters=function(e,t,i,r){},Object.defineProperty(e.prototype,"chart",{get:function(){return this._chart},enumerable:!1,configurable:!0}),e.prototype.create=function(e){var t=this,i=D.setup(this.model.chartType,this.model),s={displaylogo:!1,responsive:!0,locale:r.a.currentLocale,modeBarButtonsToRemove:["toImage"],modeBarButtonsToAdd:[{name:"toImageSjs",title:r.a.getString("saveDiagramAsPNG"),icon:P.a.Icons.camera,click:function(e){var i={format:D.imageExportFormat,filename:t.model.question.name};D.onImageSaving.fire(t.model,i),P.a.downloadImage(e,i)}}]};void 0!==k.displayModeBar&&(s.displayModeBar=k.displayModeBar),this.patchConfigParameters(e,i.traces,i.layout,s);var o={traces:i.traces,layout:i.layout,config:s};D.onPlotCreating.fire(this.model,o);var a=P.a.newPlot(e,o.traces,o.layout,o.config);e.on("plotly_click",(function(e){var r;if(e.points.length>0){var s="";if(i.hasSeries){s=e.points[0].data.name;var o=e.points[0].label,a=t.model.getSeriesValues()[t.model.getSeriesLabels().indexOf(o)],l=t.model.getSelectedItemByText(s);h=new n.ItemValue(((r={})[a]=l.value,r),o+": "+l.text);t.model.setSelection(h)}else{s=Array.isArray(e.points[0].customdata)?e.points[0].customdata[0]:e.points[0].customdata;var h=t.model.getSelectedItemByText(s);t.model.setSelection(h)}}}));var l=function(){return e.getElementsByClassName("nsewdrag")[0]};return e.on("plotly_hover",(function(){var e=l();e&&(e.style.cursor="pointer")})),e.on("plotly_unhover",(function(){var e=l();e&&(e.style.cursor="")})),this._chart=a,a},e.prototype.destroy=function(e){P.a.purge(e),this._chart=void 0},e}(),k=function(e){function t(i,r,n,s){void 0===n&&(n={});var o=e.call(this,i,r,n,s)||this;return o.chartTypes=[].concat(t.types),o.getSeriesValues().length>0&&-1===o.chartTypes.indexOf("stackedbar")&&o.chartTypes.push("stackedbar"),n.allowExperimentalFeatures&&o.chartTypes.splice(1,0,"vbar"),o.chartType=o.chartTypes[0],-1!==o.chartTypes.indexOf(n.defaultChartType)&&(o.chartType=n.defaultChartType),o._chartAdapter=new x(o),o}return Object(o.b)(t,e),t.prototype.destroyContent=function(t){this._chartAdapter.destroy(t.children[0]),e.prototype.destroyContent.call(this,t)},t.prototype.renderContent=function(e){var t=this,i=h.b.createElement("div");e.appendChild(i),this._chartAdapter.create(i).then((function(){t.afterRender(t.contentContainer)}))},t.prototype.getData=function(){var t=e.prototype.getData.call(this),i=this.getSeriesValues(),r=this.getValues();if(i.length>1){var n=[];return r.forEach((function(e,r){var s=i.map((function(e,i){return t[i][r]}));n.push(s)})),n}return t},t.types=["bar","pie","doughnut","scatter"],t.displayModeBar=void 0,t}(d);a.registerVisualizer("checkbox",k),a.registerVisualizer("radiogroup",k),a.registerVisualizer("dropdown",k),a.registerVisualizer("imagepicker",k);var O=function(e){function t(i,r,n,s){var o=e.call(this,i,r,n,s)||this;return o.chartTypes=t.types,o.chartType=o.chartTypes[0],o._chartAdapter=new x(o),o}return Object(o.b)(t,e),t.prototype.destroyContent=function(t){this._chartAdapter.destroy(t.children[0]),e.prototype.destroyContent.call(this,t)},t.prototype.renderContent=function(e){var t=this,i=h.b.createElement("div");e.appendChild(i),this._chartAdapter.create(i).then((function(){t.afterRender(t.contentContainer)}))},t.types=["bar","stackedbar","pie","doughnut"],t}(p);a.registerVisualizer("matrix",O);var V=function(e){function t(t){return e.call(this,t)||this}return Object(o.b)(t,e),t.prototype.patchConfigParameters=function(e,t,i,r){var n=this.model.getColors(),s=[z.trueColor||n[0],z.falseColor||n[1]];this.model.showMissingAnswers&&s.push(n[2]),"pie"===this.model.chartType||"doughnut"===this.model.chartType?t.forEach((function(e){e.marker.colors=s})):"bar"===this.model.chartType&&t.forEach((function(e){e.marker.color=s}))},t}(x),z=function(e){function t(i,r,n,s){var o=e.call(this,i,r,n,s)||this;return o.chartTypes=t.types,o.chartType=o.chartTypes[0],o._chartAdapter=new V(o),o}return Object(o.b)(t,e),t.prototype.destroyContent=function(t){this._chartAdapter.destroy(t.children[0]),e.prototype.destroyContent.call(this,t)},t.prototype.renderContent=function(e){var t=this,i=h.b.createElement("div");e.appendChild(i),this._chartAdapter.create(i).then((function(){t.afterRender(t.contentContainer)}))},t.types=["pie","bar","doughnut"],t}(f);a.registerVisualizer("boolean",z);var B=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(o.b)(t,e),t.prototype.getQuestionResults=function(){var e=this.question.name;return this.data.map((function(t){return t[e]}))},t.prototype.getEmptyData=function(){var e=this.getValues(),t=[];return t.length=e.length,t.fill(0),t},t.prototype.getData=function(){var e=this,t=this.getQuestionResults(),i=this.getValues(),r=this.getEmptyData();return t.forEach((function(t){e.applyResultToPlotlyData(t,r,i)})),[r]},t.prototype.applyResultToPlotlyData=function(e,t,i){e&&t&&i&&e.forEach((function(e,r,n){var s=i.indexOf(e);t[s]=+t[s]+(n.length-r)}))},t}(k);a.registerVisualizer("ranking",B);var L=function(e){function t(i,r,n,s){var o=e.call(this,i,r,n,s)||this;return o.chartTypes=t.types,o.chartType=o.chartTypes[0],o._chartAdapter=new x(o),o}return Object(o.b)(t,e),t.prototype.destroyContent=function(t){this._chartAdapter.destroy(t.children[0]),e.prototype.destroyContent.call(this,t)},t.prototype.renderContent=function(e){var t=this,i=h.b.createElement("div");e.appendChild(i),this._chartAdapter.create(i).then((function(){t.afterRender(t.contentContainer)}))},t.types=["stackedbar","bar","pie","doughnut"],t}(function(e){function t(t,i,r,n){var s=e.call(this,t,i,r,n||"matrixDropdownGrouped")||this;return s.getAnswersData(),s}return Object(o.b)(t,e),Object.defineProperty(t.prototype,"matrixQuestion",{get:function(){return this.question},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dataName",{get:function(){return this.matrixQuestion.columns.map((function(e){return e.name}))},enumerable:!1,configurable:!0}),t.prototype.getSeriesValues=function(){return this.matrixQuestion.columns.map((function(e){return e.name}))},t.prototype.getSeriesLabels=function(){return this.matrixQuestion.columns.map((function(e){return e.title}))},t.prototype.valuesSource=function(){return this.matrixQuestion.choices},t.prototype.isSupportMissingAnswers=function(){return!1},t.prototype.getData=function(){var e=this.getValues(),t=this.getSeriesValues(),i=this.matrixQuestion.rows.map((function(e){return e.value})),r=this.dataProvider.getData({dataName:t,getValues:function(){return e},getLabels:function(){return e},getSeriesValues:function(){return i},getSeriesLabels:function(){return i}}),n=[];return e.forEach((function(e,i){var s=t.map((function(e,t){return r[t][0][i]}));n.push(s)})),n},t}(d));a.registerVisualizer("matrixdropdown-grouped",L);var M=function(e){function t(i,r,n,s){var o=e.call(this,i,r,n,s)||this;return o.chartTypes=t.types,o.chartType=o.chartTypes[0],o._chartAdapter=new x(o),o}return Object(o.b)(t,e),t.prototype.destroyContent=function(t){this._chartAdapter.destroy(t.children[0]),e.prototype.destroyContent.call(this,t)},t.prototype.renderContent=function(e){var t=this,i=h.b.createElement("div");e.appendChild(i),this._chartAdapter.create(i).then((function(){t.afterRender(t.contentContainer)}))},t.prototype.getData=function(){var t=e.prototype.getData.call(this),i=this.getSeriesValues(),r=this.getValues();if(i.length>1){var n=[];return r.forEach((function(e,r){var s=i.map((function(e,i){return t[i][r]}));n.push(s)})),n}return t},t.types=["vbar","bar","scatter"],t}(m);a.registerVisualizer("date",M),a.registerVisualizer("number",M),a.registerVisualizer("rating",M);var R=function(){function e(e){this.model=e,this._chart=void 0}return Object.defineProperty(e.prototype,"chart",{get:function(){return this._chart},enumerable:!1,configurable:!0}),e.prototype.create=function(e){var t=this,i=this.model.question,n=this.model.getData(),s=n[0],o=n[1],a=n[2];if("rating"===i.getType()){var l=i.visibleRateValues;a=l[l.length-1].value,o=l[0].value}var u=this.model.generateColors(a,o,I.stepsCount);I.showAsPercentage&&(s=h.a.toPercentage(s,a),o=h.a.toPercentage(o,a),a=h.a.toPercentage(a,a));var c=[{type:"indicator",mode:"gauge+number",gauge:{axis:{range:[o,a]},shape:this.model.chartType,bgcolor:"white",bar:{color:u[0]}},value:s,text:i.name,domain:{x:[0,1],y:[0,1]}}],d={plot_bgcolor:this.model.backgroundColor,paper_bgcolor:this.model.backgroundColor};"bullet"===this.model.chartType&&(d.height=250,d.width=600);var p={displayModeBar:!0,locale:r.a.currentLocale,responsive:!0,displaylogo:!1,modeBarButtonsToRemove:["toImage"],modeBarButtonsToAdd:[{name:"toImageSjs",title:r.a.getString("saveDiagramAsPNG"),icon:P.a.Icons.camera,click:function(e){var i={format:D.imageExportFormat,filename:t.model.question.name};D.onImageSaving.fire(t.model,i),P.a.downloadImage(e,i)}}]};void 0!==I.displayModeBar&&(p.displayModeBar=I.displayModeBar);var f={data:c,layout:d,config:p};return D.onPlotCreating.fire(this.model,f),P.a.newPlot(e,f.data,f.layout,f.config)},e.prototype.destroy=function(e){P.a.purge(e),this._chart=void 0},e}(),I=function(e){function t(i,r,n,s){var o=e.call(this,i,r,n,s)||this;return o.chartTypes=t.types,o.chartType=o.chartTypes[0],o._chartAdapter=new R(o),o}return Object(o.b)(t,e),t.prototype.destroyContent=function(t){this._chartAdapter.destroy(t.children[0]),e.prototype.destroyContent.call(this,t)},t.prototype.renderContent=function(e){var t=this,i=h.b.createElement("div");e.appendChild(i),this._chartAdapter.create(i).then((function(){t.afterRender(t.contentContainer)}))},t.displayModeBar=void 0,t.types=["gauge","bullet"],t}(c);a.registerVisualizer("number",I),a.registerVisualizer("rating",I),a.registerVisualizer("expression",I);var j={en:["...","a","about","above","across","after","again","against","all","almost","alone","along","already","also","although","always","among","an","and","another","any","anybody","anyone","anything","anywhere","are","area","areas","around","as","ask","asked","asking","asks","at","away","b","back","backed","backing","backs","be","became","because","become","becomes","been","before","began","behind","being","beings","best","better","between","big","both","but","by","c","came","can","cannot","case","cases","certain","certainly","clear","clearly","come","could","d","did","differ","different","differently","do","does","done","down","down","downed","downing","downs","during","e","each","early","either","end","ended","ending","ends","enough","even","evenly","ever","every","everybody","everyone","everything","everywhere","f","face","faces","fact","facts","far","felt","few","find","finds","first","for","four","from","full","fully","further","furthered","furthering","furthers","g","gave","general","generally","get","gets","give","given","gives","go","going","good","goods","got","great","greater","greatest","group","grouped","grouping","groups","h","had","has","have","having","he","her","here","herself","high","high","high","higher","highest","him","himself","his","how","however","i","if","important","in","interest","interested","interesting","interests","into","is","it","its","itself","j","just","k","keep","keeps","kind","knew","know","known","knows","l","large","largely","last","later","latest","least","less","let","lets","like","likely","long","longer","longest","m","made","make","making","man","many","may","me","member","members","men","might","more","most","mostly","mr","mrs","much","must","my","myself","n","necessary","need","needed","needing","needs","never","new","new","newer","newest","next","no","nobody","non","noone","not","nothing","now","nowhere","number","numbers","o","of","off","often","old","older","oldest","on","once","one","only","open","opened","opening","opens","or","order","ordered","ordering","orders","other","others","our","out","over","p","part","parted","parting","parts","per","perhaps","place","places","point","pointed","pointing","points","possible","present","presented","presenting","presents","problem","problems","put","puts","q","quite","r","rather","really","right","right","room","rooms","s","said","same","saw","say","says","second","seconds","see","seem","seemed","seeming","seems","sees","several","shall","she","should","show","showed","showing","shows","side","sides","since","small","smaller","smallest","so","some","somebody","someone","something","somewhere","state","states","still","still","such","sure","t","take","taken","than","that","the","their","them","then","there","therefore","these","they","thing","things","think","thinks","this","those","though","thought","thoughts","three","through","thus","to","today","together","too","took","toward","turn","turned","turning","turns","two","u","under","until","up","upon","us","use","used","uses","v","very","w","want","wanted","wanting","wants","was","way","ways","we","well","wells","went","were","what","when","where","whether","which","while","who","whole","whose","why","will","with","within","without","work","worked","working","works","would","x","y","year","years","yet","you","young","younger","youngest","your","yours","z"],no:["...","alle","andre","arbeid","at","av","bare","begge","ble","blei","bli","blir","blitt","bort","bruke","både","båe","da","de","deg","dei","deim","deira","deires","dem","den","denne","der","dere","deres","det","dette","di","din","disse","ditt","du","dykk","dykkar","då","eg","ein","eit","eitt","eller","elles","en","ene","eneste","enhver","enn","er","et","ett","etter","folk","for","fordi","forsøke","fra","få","før","før","først","gjorde","gjøre","god","gå","ha","hadde","han","hans","har","hennar","henne","hennes","her","hjå","ho","hoe","honom","hoss","hossen","hun","hva","hvem","hver","hvilke","hvilken","hvis","hvor","hvordan","hvorfor","i","ikke","ikkje","ingen","ingi","inkje","inn","innen","inni","ja","jeg","kan","kom","korleis","korso","kun","kunne","kva","kvar","kvarhelst","kven","kvi","kvifor","lage","lang","lik","like","makt","man","mange","me","med","medan","meg","meget","mellom","men","mens","mer","mest","mi","min","mine","mitt","mot","mye","mykje","må","måte","navn","ned","nei","no","noe","noen","noka","noko","nokon","nokor","nokre","ny","nå","når","og","også","om","opp","oss","over","part","punkt","på","samme","seg","selv","si","sia","sidan","siden","sin","sine","sist","sitt","sjøl","skal","skulle","slik","slutt","so","som","somme","somt","start","stille","så","sånn","tid","til","tilbake","tilstand","um","under","upp","ut","uten","var","vart","varte","ved","verdi","vere","verte","vi","vil","ville","vite","vore","vors","vort","vår","være","vært","vøre","vørt","æ","å"],nl:["de","en","van","ik","te","dat","die","in","een","hij","het","niet","zijn","is","was","op","aan","met","als","voor","had","er","maar","om","hem","dan","zou","of","wat","mijn","men","dit","zo","door","over","ze","zich","bij","ook","tot","je","mij","uit","der","daar","haar","naar","heb","hoe","heeft","hebben","deze","u","want","nog","zal","me","zij","nu","ge","geen","omdat","iets","worden","toch","al","waren","veel","meer","doen","toen","moet","ben","zonder","kan","hun","dus","alles","onder","ja","eens","hier","wie","werd","altijd","doch","wordt","wezen","kunnen","ons","zelf","tegen","na","reeds","wil","kon","niets","uw","iemand","geweest","andere"],es:["...","a","actualmente","adelante","además","afirmó","agregó","ahora","ahí","al","algo","alguna","algunas","alguno","algunos","algún","alrededor","ambos","ampleamos","ante","anterior","antes","apenas","aproximadamente","aquel","aquellas","aquellos","aqui","aquí","arriba","aseguró","así","atras","aunque","ayer","añadió","aún","bajo","bastante","bien","buen","buena","buenas","bueno","buenos","cada","casi","cerca","cierta","ciertas","cierto","ciertos","cinco","comentó","como","con","conocer","conseguimos","conseguir","considera","consideró","consigo","consigue","consiguen","consigues","contra","cosas","creo","cual","cuales","cualquier","cuando","cuanto","cuatro","cuenta","cómo","da","dado","dan","dar","de","debe","deben","debido","decir","dejó","del","demás","dentro","desde","después","dice","dicen","dicho","dieron","diferente","diferentes","dijeron","dijo","dio","donde","dos","durante","e","ejemplo","el","ella","ellas","ello","ellos","embargo","empleais","emplean","emplear","empleas","empleo","en","encima","encuentra","entonces","entre","era","erais","eramos","eran","eras","eres","es","esa","esas","ese","eso","esos","esta","estaba","estabais","estaban","estabas","estad","estada","estadas","estado","estados","estais","estamos","estan","estando","estar","estaremos","estará","estarán","estarás","estaré","estaréis","estaría","estaríais","estaríamos","estarían","estarías","estas","este","estemos","esto","estos","estoy","estuve","estuviera","estuvierais","estuvieran","estuvieras","estuvieron","estuviese","estuvieseis","estuviesen","estuvieses","estuvimos","estuviste","estuvisteis","estuviéramos","estuviésemos","estuvo","está","estábamos","estáis","están","estás","esté","estéis","estén","estés","ex","existe","existen","explicó","expresó","fin","fue","fuera","fuerais","fueran","fueras","fueron","fuese","fueseis","fuesen","fueses","fui","fuimos","fuiste","fuisteis","fuéramos","fuésemos","gran","grandes","gueno","ha","haber","habida","habidas","habido","habidos","habiendo","habremos","habrá","habrán","habrás","habré","habréis","habría","habríais","habríamos","habrían","habrías","habéis","había","habíais","habíamos","habían","habías","hace","haceis","hacemos","hacen","hacer","hacerlo","haces","hacia","haciendo","hago","han","has","hasta","hay","haya","hayamos","hayan","hayas","hayáis","he","hecho","hemos","hicieron","hizo","hoy","hube","hubiera","hubierais","hubieran","hubieras","hubieron","hubiese","hubieseis","hubiesen","hubieses","hubimos","hubiste","hubisteis","hubiéramos","hubiésemos","hubo","igual","incluso","indicó","informó","intenta","intentais","intentamos","intentan","intentar","intentas","intento","ir","junto","la","lado","largo","las","le","les","llegó","lleva","llevar","lo","los","luego","lugar","manera","manifestó","mayor","me","mediante","mejor","mencionó","menos","mi","mientras","mio","mis","misma","mismas","mismo","mismos","modo","momento","mucha","muchas","mucho","muchos","muy","más","mí","mía","mías","mío","míos","nada","nadie","ni","ninguna","ningunas","ninguno","ningunos","ningún","no","nos","nosotras","nosotros","nuestra","nuestras","nuestro","nuestros","nueva","nuevas","nuevo","nuevos","nunca","o","ocho","os","otra","otras","otro","otros","para","parece","parte","partir","pasada","pasado","pero","pesar","poca","pocas","poco","pocos","podeis","podemos","poder","podria","podriais","podriamos","podrian","podrias","podrá","podrán","podría","podrían","poner","por","por qué","porque","posible","primer","primera","primero","primeros","principalmente","propia","propias","propio","propios","próximo","próximos","pudo","pueda","puede","pueden","puedo","pues","que","quedó","queremos","quien","quienes","quiere","quién","qué","realizado","realizar","realizó","respecto","sabe","sabeis","sabemos","saben","saber","sabes","se","sea","seamos","sean","seas","segunda","segundo","según","seis","ser","seremos","será","serán","serás","seré","seréis","sería","seríais","seríamos","serían","serías","seáis","señaló","si","sido","siempre","siendo","siete","sigue","siguiente","sin","sino","sobre","sois","sola","solamente","solas","solo","solos","somos","son","soy","su","sus","suya","suyas","suyo","suyos","sí","sólo","tal","también","tampoco","tan","tanto","te","tendremos","tendrá","tendrán","tendrás","tendré","tendréis","tendría","tendríais","tendríamos","tendrían","tendrías","tened","teneis","tenemos","tener","tenga","tengamos","tengan","tengas","tengo","tengáis","tenida","tenidas","tenido","tenidos","teniendo","tenéis","tenía","teníais","teníamos","tenían","tenías","tercera","ti","tiempo","tiene","tienen","tienes","toda","todas","todavía","todo","todos","total","trabaja","trabajais","trabajamos","trabajan","trabajar","trabajas","trabajo","tras","trata","través","tres","tu","tus","tuve","tuviera","tuvierais","tuvieran","tuvieras","tuvieron","tuviese","tuvieseis","tuviesen","tuvieses","tuvimos","tuviste","tuvisteis","tuviéramos","tuviésemos","tuvo","tuya","tuyas","tuyo","tuyos","tú","ultimo","un","una","unas","uno","unos","usa","usais","usamos","usan","usar","usas","uso","usted","va","vais","valor","vamos","van","varias","varios","vaya","veces","ver","verdad","verdadera","verdadero","vez","vosotras","vosotros","voy","vuestra","vuestras","vuestro","vuestros","y","ya","yo","él","éramos","ésta","éstas","éste","éstos","última","últimas","último","últimos"]},N={getStopWords:function(e){return void 0===e&&(e=""),j[e||"en"]||[]}},q=i(21),H=i.n(q),F=function(){function e(e){this.model=e}return Object.defineProperty(e.prototype,"wordcloud",{get:function(){return this._wordcloud},enumerable:!1,configurable:!0}),e.prototype.create=function(t){var i=this,n=this.model.getData(),s=(this.model.getColors(),h.b.createElement("canvas","")),o=h.b.createElement("p","",{innerText:r.a.getString("noResults")});if(0!==n.length){t.appendChild(s);var a={canvas:s,config:{list:n,weightFactor:e.weightFactor,abortThreshold:e.abortThreshold,drawOutOfBound:e.drawOutOfBound,shrinkToFit:e.shrinkToFit,fontFamily:"Segoe UI Bold, sans-serif",color:function(e,t){return i.model.getRandomColor()},rotateRatio:.5,rotationSteps:2,backgroundColor:this.model.backgroundColor,click:function(e){console.log(e[0]+": "+e[1])}}};return e.onWordcloudCreating.fire(this.model,a),this._wordcloud=H()(a.canvas,a.config),this._wordcloud}t.appendChild(o)},e.prototype.destroy=function(e){this._wordcloud=void 0},e.drawOutOfBound=!1,e.shrinkToFit=!0,e.abortThreshold=void 0,e.weightFactor=20,e.onWordcloudCreating=new n.Event,e}(),G=function(e){function t(t,i,r,n){var s=e.call(this,t,i,r,n||"wordcloud")||this;return s._wordcloudAdapter=new F(s),s}return Object(o.b)(t,e),t.prototype.getData=function(){var e=this,t={},i=[],n=r.a.currentLocale;i=n?N.getStopWords(n):N.getStopWords();var s=function(e){(e=""+e).length>15&&(e=e.substring(0,14)+"..."),e&&e.split(" ").forEach((function(e){(e=function(e){return-1!==i.indexOf(e)?"":e}(e.toLowerCase()||""))&&(t[e]?t[e]++:t[e]=1)}))};return this.data.forEach((function(t){var i=t[e.question.name];i&&(Array.isArray(i)?i.forEach(s):"object"==typeof i?Object.keys(i).forEach((function(e){return s(i[e])})):s(i))})),Object.keys(t).map((function(e){return[e,t[e]]}))},t.prototype.destroyContent=function(t){this._wordcloudAdapter.destroy(t),e.prototype.destroyContent.call(this,t)},t.prototype.renderContent=function(e){this._wordcloudAdapter.create(e),this.afterRender(this.contentContainer)},t.prototype.destroy=function(){this._wordcloudAdapter.destroy(this.contentContainer),e.prototype.destroy.call(this)},t}(u);a.registerVisualizer("text",G),a.registerVisualizer("comment",G),a.registerVisualizer("multipletext",G);i(27);var X=function(){function e(e){this.model=e}return e.prototype.create=function(e){var t=this.model.getData(),i=t.columnsCount,n=t.data,s=h.b.createElement("p","",{innerText:r.a.getString("noResults")});if(0!==n.length){var o=h.b.createElement("table","sa-text-table");o.style.backgroundColor=this.model.backgroundColor,e.appendChild(o),n.forEach((function(e){for(var t=h.b.createElement("tr"),r=0;r<i;r++){var n=h.b.createElement("td","sa-text-table__cell",{textContent:e[r]});t.appendChild(n)}o.appendChild(t)})),e.className="sa-text-table__container",e.appendChild(o)}else e.appendChild(s)},e.prototype.destroy=function(e){e.innerHTML=""},e}(),Y=function(e){function t(t,i,r,n){var s=e.call(this,t,i,r,n||"text")||this;return s._textTableAdapter=new X(s),s}return Object(o.b)(t,e),t.prototype.getData=function(){var e=this,t=[],i=0;return this.data.forEach((function(r){var n=r[e.question.name],s=[];n&&(Array.isArray(n)?s.concat(n):"object"==typeof n?Object.keys(n).forEach((function(e){return s.push(n[e])})):s.push(n),t.push(s),s.length>i&&(i=s.length))})),{columnsCount:i,data:t}},t.prototype.destroyContent=function(t){this._textTableAdapter.destroy(t),e.prototype.destroyContent.call(this,t)},t.prototype.renderContent=function(e){this._textTableAdapter.create(e),this.afterRender(this.contentContainer)},t.prototype.destroy=function(){this._textTableAdapter.destroy(this.contentContainer),e.prototype.destroy.call(this)},t}(u);a.registerVisualizer("text",Y),a.registerVisualizer("comment",Y),a.registerVisualizer("multipletext",Y);i(28);var Q=function(){function e(e){this.model=e}return e.prototype.create=function(e){var t=this,i=this.model.getAnswersData(),n=i.datasets,s=i.labels,o=(i.colors,i.texts),a=(i.seriesLabels.length,h.b.createElement("p","",{innerText:r.a.getString("noResults")}));0!==n.length&&0!==n[0].length?n.forEach((function(i,n){var a=h.b.createElement("table","sa-choices-table");a.style.backgroundColor=t.model.backgroundColor,e.appendChild(a);var l=h.b.createElement("tr"),u=h.b.createElement("th","sa-choices-table__cell-header",{textContent:r.a.getString("answer")});l.appendChild(u);var c=h.b.createElement("th","sa-choices-table__cell-header",{textContent:""});l.appendChild(c);var d=h.b.createElement("th","sa-choices-table__cell-header",{textContent:r.a.getString("percent")});l.appendChild(d);var p=h.b.createElement("th","sa-choices-table__cell-header",{textContent:r.a.getString("responses")});l.appendChild(p),a.appendChild(l),i.forEach((function(e,t){var i=h.b.createElement("tr"),r=h.b.createElement("td","sa-choices-table__cell",{textContent:s[t]});i.appendChild(r);var l=h.b.createElement("td","sa-choices-table__cell"),u=h.b.createElement("div","sa-choices-sparkline"),c=h.b.createElement("div","sa-choices-sparkline-value");c.style.width=o[n][t]+"%",u.appendChild(c),l.appendChild(u),i.appendChild(l);var d=h.b.createElement("td","sa-choices-table__cell sa-choices-table__cell-value",{textContent:o[n][t]+"%"});i.appendChild(d);var p=h.b.createElement("td","sa-choices-table__cell sa-choices-table__cell-value",{textContent:e});i.appendChild(p),a.appendChild(i)})),e.className="sa-choices-table__container",e.appendChild(a)})):e.appendChild(a)},e.prototype.destroy=function(e){e.innerHTML=""},e}(),U=function(e){function t(t,i,r,n){var s=e.call(this,t,i,r,n||"choices")||this;return s._choicesTableAdapter=new Q(s),s.answersOrder="asc",s.showPercentages=!0,s}return Object(o.b)(t,e),t.prototype.destroyContent=function(t){this._choicesTableAdapter.destroy(t),e.prototype.destroyContent.call(this,t)},t.prototype.renderContent=function(e){this._choicesTableAdapter.create(e),this.afterRender(this.contentContainer)},t.prototype.destroy=function(){this._choicesTableAdapter.destroy(this.contentContainer),e.prototype.destroy.call(this)},t}(d)}])}));
|