survey-analytics 1.9.60 → 1.9.61
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/README.md +3 -3
- package/package.json +2 -2
- package/survey.analytics.css +1 -1
- package/survey.analytics.d.ts +5 -5
- 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 +3 -3
- 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
|
|
2
|
+
* surveyjs - SurveyJS Dashboard library v1.9.61
|
|
3
3
|
* Copyright (c) 2015-2022 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
|
-
t.exports=function(){"use strict";var t={};function e(){this._events={},this._queue=[],this._counter=0,this._isDestroyed=!1}e.prototype.on=function(t,e){if(this._isDestroyed)return this;var i=this._events[t];return i||(i=this._events[t]=[]),i.push(e),this},e.prototype.off=function(t,e){if(this._isDestroyed)return this;var i=this._events[t];if(!i||!i.length)return this;if(!e)return i.length=0,this;for(var r=i.length;r--;)e===i[r]&&i.splice(r,1);return this},e.prototype.emit=function(t,e,i,r){if(this._isDestroyed)return this;var n=this._events[t];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](e):2===l?o[s](e,i):o[s](e,i,r),this._isDestroyed)return this;return--this._counter,this._counter||(o.length=0),this},e.prototype.destroy=function(){if(this._isDestroyed)return this;var t,e=this._events;for(t in this._isDestroyed=!0,this._queue.length=this._counter=0,e)e[t]&&(e[t].length=0,e[t]=void 0);return this};var i="transform",r="transform",n=window.document.documentElement.style,s=!1;["","Webkit","Moz","O","ms"].forEach((function(t){if(!s){var e=t?t+"Transform":"transform";void 0!==n[e]&&(t=t.toLowerCase(),i=t?"-"+t+"-transform":"transform",r=e,s=!0)}}));var o="function"==typeof WeakMap?new WeakMap:null;function a(t,e){var r=o&&o.get(t);return r||(r=window.getComputedStyle(t,null),o&&o.set(t,r)),r.getPropertyValue("transform"===e?i:e)}var l=/([A-Z])/g;function h(t){return t.replace(l,"-$1").toLowerCase()}function u(t){return"function"==typeof t}function c(t,e){for(var i in e)t.style["transform"===i?r:i]=e[i]}function d(t){this._element=t,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(t,e,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 e)if(++h,-1===(l=n.indexOf(d))||e[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,e)n.push(d),s.push(e[d]);var p=this._keyframes;p[0]=t,p[1]=e;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,e)}}},d.prototype.stop=function(t){if(!this._isDestroyed&&this._animation){var e,i,n,s=this._element,o=this._props,l=this._values;if(t)c(s,t);else for(n=0;n<o.length;n++)i=a(s,h(e=o[n])),s.style["transform"===e?r:e]=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 t=this._callback;this._animation=this._callback=null,this._props.length=this._values.length=0,t&&t()};var p=["","webkit","moz","ms","o","Webkit","Moz","MS","O"];function f(t,e){for(var i,r,n=e[0].toUpperCase()+e.slice(1),s=0;s<p.length;){if((r=(i=p[s])?i+n:e)in t)return r;++s}return null}var m=(window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame||function(t){return this.setTimeout((function(){t(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(t){}var y="start",v="move",b="end",w="cancel",C=!(!("ontouchstart"in window)&&!window.TouchEvent),S=!!window.PointerEvent,T=!!window.navigator.msPointerEnabled,D=/(android)/i.test(window.navigator.userAgent),A=!!g&&{passive:!0},E=f(window.document.documentElement.style,"touchAction");function x(t,i){this._element=t,this._emitter=new e,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"),t.addEventListener("dragstart",x._preventDefault,!1),t.addEventListener(x._events.start,this._preStartCheck,A),!C||S||T||t.addEventListener(x._mouseEvents.start,this._preStartCheck,A)}function P(){this._nextStep=null,this._queue=[],this._reads={},this._writes={},this._batch=[],this._batchReads={},this._batchWrites={},this._step=this._step.bind(this)}x._pointerEvents={start:"pointerdown",move:"pointermove",cancel:"pointercancel",end:"pointerup"},x._msPointerEvents={start:"MSPointerDown",move:"MSPointerMove",cancel:"MSPointerCancel",end:"MSPointerUp"},x._touchEvents={start:"touchstart",move:"touchmove",cancel:"touchcancel",end:"touchend"},x._mouseEvents={start:"mousedown",move:"mousemove",cancel:"",end:"mouseup"},x._events=S?x._pointerEvents:T?x._msPointerEvents:C?x._touchEvents:x._mouseEvents,x._emitter=new e,x._activeInstances=[],x._preventDefault=function(t){t.preventDefault&&!1!==t.cancelable&&t.preventDefault()},x._activateInstance=function(t){x._activeInstances.indexOf(t)>-1||(x._activeInstances.push(t),x._emitter.on(v,t._onMove),x._emitter.on(w,t._onCancel),x._emitter.on(b,t._onEnd),1===x._activeInstances.length&&x._bindListeners())},x._deactivateInstance=function(t){var e=x._activeInstances.indexOf(t);-1!==e&&(x._activeInstances.splice(e,1),x._emitter.off(v,t._onMove),x._emitter.off(w,t._onCancel),x._emitter.off(b,t._onEnd),x._activeInstances.length||x._unbindListeners())},x._bindListeners=function(){var t=x._events;window.addEventListener(t.move,x._onMove,A),window.addEventListener(t.end,x._onEnd,A),t.cancel&&window.addEventListener(t.cancel,x._onCancel,A)},x._unbindListeners=function(){var t=x._events;window.removeEventListener(t.move,x._onMove,A),window.removeEventListener(t.end,x._onEnd,A),t.cancel&&window.removeEventListener(t.cancel,x._onCancel,A)},x._getEventPointerId=function(t){return"number"==typeof t.pointerId?t.pointerId:t.changedTouches?t.changedTouches[0]?t.changedTouches[0].identifier:null:1},x._getTouchById=function(t,e){if("number"==typeof t.pointerId)return t.pointerId===e?t:null;if(t.changedTouches){for(var i=0;i<t.changedTouches.length;i++)if(t.changedTouches[i].identifier===e)return t.changedTouches[i];return null}return t},x._onMove=function(t){x._emitter.emit(v,t)},x._onCancel=function(t){x._emitter.emit(w,t)},x._onEnd=function(t){x._emitter.emit(b,t)},x.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(x._touchEvents.start,this._abortNonCancelable,A),x._deactivateInstance(this))},x.prototype._createEvent=function(t,e){var i=this._getTrackedTouch(e);return{type:t,srcEvent:e,distance:this.getDistance(),deltaX:this.getDeltaX(),deltaY:this.getDeltaY(),deltaTime:t===y?0:this.getDeltaTime(),isFirst:t===y,isFinal:t===b||t===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}},x.prototype._emit=function(t,e){this._emitter.emit(t,this._createEvent(t,e))},x.prototype._getTrackedTouch=function(t){return null===this._pointerId?null:x._getTouchById(t,this._pointerId)},x.prototype._preStartCheck=function(t){this._isDestroyed||this.isDragging()||D&&!1===t.cancelable||t.button||(this._pointerId=x._getEventPointerId(t),null!==this._pointerId&&(this._startEvent=t,C&&(S||T)?(D&&this._element.addEventListener(x._touchEvents.start,this._abortNonCancelable,A),m(this._onStart)):this._onStart()))},x.prototype._abortNonCancelable=function(t){this._element.removeEventListener(x._touchEvents.start,this._abortNonCancelable,A),this._startEvent&&!1===t.cancelable&&(this._pointerId=null,this._startEvent=null)},x.prototype._onStart=function(){var t=this._startEvent;if(t){this._startEvent=null;var e=this._getTrackedTouch(t);e&&(this._startX=this._currentX=e.clientX,this._startY=this._currentY=e.clientY,this._startTime=Date.now(),this._emit(y,t),x._activateInstance(this))}},x.prototype._onMove=function(t){var e=this._getTrackedTouch(t);e&&(this._currentX=e.clientX,this._currentY=e.clientY,this._emit(v,t))},x.prototype._onCancel=function(t){this._getTrackedTouch(t)&&(this._emit(w,t),this._reset())},x.prototype._onEnd=function(t){this._getTrackedTouch(t)&&(this._emit(b,t),this._reset())},x.prototype.isDragging=function(){return null!==this._pointerId},x.prototype.setTouchAction=function(t){this._touchAction=t,E&&(this._cssProps[E]="",this._element.style[E]=t),C&&(this._element.removeEventListener(x._touchEvents.start,x._preventDefault,!1),this._element.style[E]!==t&&this._element.addEventListener(x._touchEvents.start,x._preventDefault,!1))},x.prototype.setCssProps=function(t){if(t){var e,i,r=this._cssProps,n=this._element;for(e in r)n.style[e]=r[e],delete r[e];for(e in t)t[e]&&("touchAction"!==e?(i=f(n.style,e))&&(r[i]="",n.style[i]=t[e]):this.setTouchAction(t[e]))}},x.prototype.getDeltaX=function(){return this._currentX-this._startX},x.prototype.getDeltaY=function(){return this._currentY-this._startY},x.prototype.getDistance=function(){var t=this.getDeltaX(),e=this.getDeltaY();return Math.sqrt(t*t+e*e)},x.prototype.getDeltaTime=function(){return this._startTime?Date.now()-this._startTime:0},x.prototype.on=function(t,e){this._emitter.on(t,e)},x.prototype.off=function(t,e){this._emitter.off(eventName,e)},x.prototype.destroy=function(){if(!this._isDestroyed){var t=this._element,e=x._events;for(var i in this._reset(),this._emitter.destroy(),t.removeEventListener(e.start,this._preStartCheck,A),t.removeEventListener(x._mouseEvents.start,this._preStartCheck,A),t.removeEventListener("dragstart",x._preventDefault,!1),t.removeEventListener(x._touchEvents.start,x._preventDefault,!1),this._cssProps)t.style[i]=this._cssProps[i],delete this._cssProps[i];this._element=null,this._isDestroyed=!0}},P.prototype.add=function(t,e,i,r){var n=this._queue.indexOf(t);n>-1&&(this._queue[n]=void 0),r?this._queue.unshift(t):this._queue.push(t),this._reads[t]=e,this._writes[t]=i,this._nextStep||(this._nextStep=m(this._step))},P.prototype.cancel=function(t){var e=this._queue.indexOf(t);e>-1&&(this._queue[e]=void 0,delete this._reads[t],delete this._writes[t])},P.prototype._step=function(){var t,e,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,e=0;e<l;e++)(t=i[e])&&(s.push(t),o[t]=r[t],delete r[t],a[t]=n[t],delete n[t]);for(i.length=0,e=0;e<l;e++)o[t=s[e]]&&(o[t](),delete o[t]);for(e=0;e<l;e++)a[t=s[e]]&&(a[t](),delete a[t]);s.length=0,!this._nextStep&&i.length&&(this._nextStep=m(this._step))};var k=new P;function O(t){return k.cancel(t+"visibility")}function V(t){return k.cancel(t+"move")}function z(t){return k.cancel(t+"scroll")}function M(t){return k.cancel(t+"placeholder")}var L=window.Element.prototype,B=L.matches||L.matchesSelector||L.webkitMatchesSelector||L.mozMatchesSelector||L.msMatchesSelector||L.oMatchesSelector||function(){return!1};function R(t,e){return B.call(t,e)}function I(t,e){t.classList?t.classList.add(e):R(t,"."+e)||(t.className+=" "+e)}var j=[];function N(t,e,i){var r="number"==typeof i?i:-1;r<0&&(r=t.length-r+1),t.splice.apply(t,j.concat(r,0,e)),j.length=0}function q(t,e,i){var r=t.length,n=Math.max(0,i?r:r-1);return e>n?n:e<0?Math.max(n+e+1,0):e}function H(t,e,i){if(!(t.length<2)){var r=q(t,e),n=q(t,i);r!==n&&t.splice(n,0,t.splice(r,1)[0])}}function F(t,e,i){if(!(t.length<2)){var r,n=q(t,e),s=q(t,i);n!==s&&(r=t[n],t[n]=t[s],t[s]=r)}}var G=0;function X(t,e){var i,r=++G+"debounce";return e>0?function(n){void 0!==i&&(i=window.clearTimeout(i),k.cancel(r),"finish"===n&&t()),"cancel"!==n&&"finish"!==n&&(i=window.setTimeout((function(){i=void 0,k.add(r,t,null,!0)}),e))}:function(e){"cancel"!==e&&t()}}function Y(t){var e=a(t,"transform");if(!e||"none"===e)return!1;var i=a(t,"display");return"inline"!==i&&"none"!==i}function Q(t,e){for(var i=window.document,r=(e?t:t.parentElement)||i;r&&r!==i&&"static"===a(r,"position")&&!Y(r);)r=r.parentElement||i;return r}function U(t,e){return parseFloat(a(t,e))||0}var W={},K={},Z={};function J(t,e){var i,r=e||{};return r.left=0,r.top=0,t===document||(r.left=window.pageXOffset||0,r.top=window.pageYOffset||0,t.self===window.self||(i=t.getBoundingClientRect(),r.left+=i.left,r.top+=i.top,r.left+=U(t,"border-left-width"),r.top+=U(t,"border-top-width"))),r}function $(t,e,i){return Z.left=0,Z.top=0,t===e||i&&(t=Q(t,!0))===(e=Q(e,!0))||(J(t,W),J(e,K),Z.left=K.left-W.left,Z.top=K.top-W.top),Z}function tt(t){var e=a(t,"overflow");return"auto"===e||"scroll"===e||"auto"===(e=a(t,"overflow-x"))||"scroll"===e||"auto"===(e=a(t,"overflow-y"))||"scroll"===e}function et(t,e,i){for(var r=i||[],n=e?t:t.parentNode;n&&n!==document;)n.getRootNode&&n instanceof DocumentFragment?n=n.getRootNode().host:(tt(n)&&r.push(n),n=n.parentNode);return r.push(window),r}var it,rt,nt,st,ot={},at=/^matrix3d/,lt=/([^,]*,){4}/,ht=/([^,]*,){12}/,ut=/[^,]*,/;function ct(t){ot.x=0,ot.y=0;var e=a(t,"transform");if(!e||"none"===e)return ot;var i=at.test(e),r=e.replace(i?ht:lt,""),n=r.replace(ut,"");return ot.x=parseFloat(r)||0,ot.y=parseFloat(n)||0,ot}function dt(t,e){return"translateX("+t+"px) translateY("+e+"px)"}function pt(t,e){t.classList?t.classList.remove(e):R(t,"."+e)&&(t.className=(" "+t.className+" ").replace(" "+e+" "," ").trim())}function ft(t){var e=t._element,i=t.getGrid(),r=i._settings;this._item=t,this._gridId=i._id,this._isDestroyed=!1,this._isMigrating=!1,this._startPredicate=u(r.dragStartPredicate)?r.dragStartPredicate:ft.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 x(e,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 mt(t,e){return t.left+t.width<=e.left||e.left+e.width<=t.left||t.top+t.height<=e.top||e.top+e.height<=t.top?0:(Math.min(t.left+t.width,e.left+e.width)-Math.max(t.left,e.left))*(Math.min(t.top+t.height,e.top+e.height)-Math.max(t.top,e.top))/(Math.min(t.width,e.width)*Math.min(t.height,e.height))*100}function gt(t){this._item=t,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 _t(){this._queue=[],this._isDestroyed=!1}function yt(t){this._item=t,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 _t,this._setupAnimation=this._setupAnimation.bind(this),this._startAnimation=this._startAnimation.bind(this)}ft.defaultStartPredicate=function(t,e,i){var r=t._drag,n=r._startPredicateData||r._setupStartPredicate(i);if(!e.isFinal)return!(!n.handleElement&&(n.handleElement=r._getStartPredicateHandle(e),!n.handleElement))&&(n.delay&&(n.event=e,n.delayTimer||(n.delayTimer=window.setTimeout((function(){n.delay=0,r._resolveStartPredicate(n.event)&&(r._forceResolveStartPredicate(n.event),r._resetStartPredicate())}),n.delay))),r._resolveStartPredicate(e));r._finishStartPredicate(e)},ft.defaultSortPredicate=(it={},rt={},nt={},st=[],function(t,e){var i=t._drag,r=i._getGrid(),n=e&&"number"==typeof e.threshold?e.threshold:50,s=e&&"swap"===e.action?"swap":"move";it.width=t._width,it.height=t._height,it.left=i._elementClientX,it.top=i._elementClientY;var o=function(t,e,i){var r,n,s,o,a=null,l=e._settings.dragSort,h=-1;if(!0===l?(st[0]=e,n=st):n=l.call(e,t),!Array.isArray(n))return a;for(o=0;o<n.length;o++)(s=n[o])._isDestroyed||(s._updateBoundingRect(),rt.width=s._width,rt.height=s._height,rt.left=s._left,rt.top=s._top,(r=mt(it,rt))>i&&r>h&&(h=r,a=s));return st.length=0,a}(t,r,n);if(!o)return!1;var a,l,h,u,c,d=0,p=0,f=-1;for(o===r?(it.left=i._gridX+t._marginLeft,it.top=i._gridY+t._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!==t&&(l=!0,rt.width=h._width,rt.height=h._height,rt.left=h._left+h._marginLeft+d,rt.top=h._top+h._marginTop+p,(u=mt(it,rt))>f&&(a=c,f=u));return f<n&&t.getGrid()!==o&&(a=l?-1:0,f=1/0),f>=n&&(nt.grid=o,nt.index=a,nt.action=s,nt)}),ft.prototype.stop=function(){var t=this._item,e=t._element,i=this._getGrid();return this._isActive?this._isMigrating?(this._finishMigration(),this):(V(t._id),z(t._id),this._unbindScrollListeners(),this._checkOverlapDebounce("cancel"),e.parentNode!==i._element&&(i._element.appendChild(e),e.style[r]=dt(this._gridX,this._gridY)),pt(e,i._settings.itemDraggingClass),this._reset(),this):this},ft.prototype.destroy=function(){return this._isDestroyed||(this.stop(),this._dragger.destroy(),this._isDestroyed=!0),this},ft.prototype._getGrid=function(){return t[this._gridId]||null},ft.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},ft.prototype._bindScrollListeners=function(){var t,e,i=this._getGrid()._element,r=this._container,n=this._scrollers;if(n.length=0,et(this._item._element,!1,n),r!==i)for(et(i,!0,t=[]),e=0;e<t.length;e++)n.indexOf(t[e])<0&&n.push(t[e]);for(e=0;e<n.length;e++)n[e].addEventListener("scroll",this._onScroll)},ft.prototype._unbindScrollListeners=function(){var t,e=this._scrollers;for(t=0;t<e.length;t++)e[t].removeEventListener("scroll",this._onScroll);e.length=0},ft.prototype._setupStartPredicate=function(t){var e=t||this._getGrid()._settings.dragStartPredicate||0;return this._startPredicateData={distance:Math.abs(e.distance)||0,delay:Math.max(e.delay,0)||0,handle:"string"==typeof e.handle&&e.handle}},ft.prototype._getStartPredicateHandle=function(t){var e=this._startPredicateData,i=this._item._element,r=i;if(!e.handle)return r;for(r=t.target;r&&!R(r,e.handle);)r=r!==i?r.parentElement:null;return r||null},ft.prototype._resolveStartPredicate=function(t){var e=this._startPredicateData;if(!(t.distance<e.distance||e.delay)){var i=e.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&&t.pageX>=r&&t.pageX<r+s&&t.pageY>=n&&t.pageY<n+o}},ft.prototype._forceResolveStartPredicate=function(t){this._isDestroyed||1!==this._startPredicateState||(this._startPredicateState=2,this._onStart(t))},ft.prototype._finishStartPredicate=function(t){var e=this._item._element,i=Math.abs(t.deltaX)<2&&Math.abs(t.deltaY)<2&&t.deltaTime<200;this._resetStartPredicate(),i&&function(t){if("a"===t.tagName.toLowerCase()){var e=t.getAttribute("href");if(e){var i=t.getAttribute("target");i&&"_self"!==i?window.open(e,i):window.location.href=e}}}(e)},ft.prototype._resetHeuristics=function(t){this._hBlockedIndex=null,this._hX1=this._hX2=t.clientX,this._hY1=this._hY2=t.clientY},ft.prototype._checkHeuristics=function(t){var e=this._getGrid()._settings.dragSortHeuristics,i=e.minDragDistance;if(i<=0)return this._hBlockedIndex=null,!0;var r=t.clientX,n=t.clientY,s=r-this._hX2,o=n-this._hY2,a=i>3&&e.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)>e.minBounceBackAngle&&(this._hBlockedIndex=null)}return this._hX1=this._hX2,this._hY1=this._hY2,this._hX2=r,this._hY2=n,!0}return!1},ft.prototype._resetStartPredicate=function(){var t=this._startPredicateData;t&&(t.delayTimer&&(t.delayTimer=window.clearTimeout(t.delayTimer)),this._startPredicateData=null)},ft.prototype._checkOverlap=function(){if(this._isActive){var t,e,i,r,n,s,o,a=this._item,l=this._getGrid()._settings;(t=u(l.dragSortPredicate)?l.dragSortPredicate(a,this._dragEvent):ft.defaultSortPredicate(a,l.dragSortPredicate))&&"number"==typeof t.index&&(o=(e=a.getGrid())!==(r=t.grid||e),i=e._items.indexOf(a),n=q(r._items,t.index,o),s="swap"===t.action?"swap":"move",(o||n!==this._hBlockedIndex)&&(o?(this._hBlockedIndex=null,e._hasListeners("beforeSend")&&e._emit("beforeSend",{item:a,fromGrid:e,fromIndex:i,toGrid:r,toIndex:n}),r._hasListeners("beforeReceive")&&r._emit("beforeReceive",{item:a,fromGrid:e,fromIndex:i,toGrid:r,toIndex:n}),a._gridId=r._id,this._isMigrating=a._gridId!==this._gridId,e._items.splice(i,1),N(r._items,a,n),a._sortData=null,e._hasListeners("send")&&e._emit("send",{item:a,fromGrid:e,fromIndex:i,toGrid:r,toIndex:n}),r._hasListeners("receive")&&r._emit("receive",{item:a,fromGrid:e,fromIndex:i,toGrid:r,toIndex:n}),e.layout(),r.layout()):i!==n&&(this._hBlockedIndex=i,("swap"===s?F:H)(e._items,i,n),e._hasListeners("move")&&e._emit("move",{item:a,fromIndex:i,toIndex:n,action:s}),e.layout())))}},ft.prototype._finishMigration=function(){var t,e,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(),pt(s,d.itemClass),pt(s,d.itemVisibleClass),pt(s,d.itemHiddenClass),I(s,h.itemClass),I(s,o?h.itemVisibleClass:h.itemHiddenClass),u!==p&&(u.appendChild(s),e=$(p,u,!0),(t=ct(s)).x-=e.left,t.y-=e.top),i._refreshDimensions(),i._refreshSortData(),e=$(u,l,!0),n._containerDiffX=e.left,n._containerDiffY=e.top,i._drag=h.dragEnabled?new ft(i):null,u!==p&&(s.style[r]=dt(t.x,t.y)),i._child.removeAttribute("style"),c(i._child,o?h.visibleStyles:h.hiddenStyles),n.start()},ft.prototype._preStartCheck=function(t){0===this._startPredicateState&&(this._startPredicateState=1),1===this._startPredicateState?(this._startPredicateResult=this._startPredicate(this._item,t),!0===this._startPredicateResult?(this._startPredicateState=2,this._onStart(t)):!1===this._startPredicateResult&&(this._startPredicateState=3)):2===this._startPredicateState&&this._isActive&&this._onMove(t)},ft.prototype._preEndCheck=function(t){var e=2===this._startPredicateState;this._startPredicate(this._item,t),this._startPredicateState=0,e&&this._isActive&&this._onEnd(t)},ft.prototype._onStart=function(t){var e=this._item;if(e._isActive){var i,n=e._element,s=this._getGrid(),o=s._settings,a=e._release,l=e._migrate,h=s._element,u=o.dragContainer||h,c=Q(u,!0),d=ct(n),p=d.x,f=d.y,m=n.getBoundingClientRect(),g=u!==h;this._resetHeuristics(t),g&&(i=$(c,h)),e.isPositioning()&&e._layout.stop(!0,{transform:dt(p,f)}),l._isActive&&(p-=l._containerDiffX,f-=l._containerDiffY,l.stop(!0,{transform:dt(p,f)})),e.isReleasing()&&a._reset(),this._isActive=!0,this._dragEvent=t,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&&e._dragPlaceholder.create(),s._emit("dragInit",e,t),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]=dt(this._left,this._top))),I(n,o.itemDraggingClass),this._bindScrollListeners(),s._emit("dragStart",e,t)}},ft.prototype._onMove=function(t){var e=this._item;if(e._isActive){var i,r,n,s=this._getGrid()._settings.dragAxis;if("y"!==s){var o=t.clientX-this._dragEvent.clientX;this._left+=o,this._gridX+=o,this._elementClientX+=o}if("x"!==s){var a=t.clientY-this._dragEvent.clientY;this._top+=a,this._gridY+=a,this._elementClientY+=a}this._dragEvent=t,i=e._id,r=this._prepareMove,n=this._applyMove,k.add(i+"move",r,n,!0)}else this.stop()},ft.prototype._prepareMove=function(){this._item._isActive&&this._getGrid()._settings.dragSort&&this._checkHeuristics(this._dragEvent)&&this._checkOverlapDebounce()},ft.prototype._applyMove=function(){var t=this._item;t._isActive&&(t._element.style[r]=dt(this._left,this._top),this._getGrid()._emit("dragMove",t,this._dragEvent))},ft.prototype._onScroll=function(t){var e,i,r,n=this._item;n._isActive?(this._scrollEvent=t,e=n._id,i=this._prepareScroll,r=this._applyScroll,k.add(e+"scroll",i,r,!0)):this.stop()},ft.prototype._prepareScroll=function(){var t=this._item;if(t._isActive){var e,i=t._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&&(e=$(this._containingBlock,o),this._containerDiffX=e.left,this._containerDiffY=e.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()}},ft.prototype._applyScroll=function(){var t=this._item;t._isActive&&(t._element.style[r]=dt(this._left,this._top),this._getGrid()._emit("dragScroll",t,this._scrollEvent))},ft.prototype._onEnd=function(t){var e=this._item,i=e._element,r=this._getGrid(),n=r._settings,s=e._release;e._isActive?(V(e._id),z(e._id),n.dragSort&&this._checkOverlapDebounce("finish"),this._unbindScrollListeners(),s._containerDiffX=this._containerDiffX,s._containerDiffY=this._containerDiffY,this._reset(),pt(i,n.itemDraggingClass),r._emit("dragEnd",e,t),this._isMigrating?this._finishMigration():s.start()):this.stop()},gt.prototype._onLayoutStart=function(){var t=this._item,e=t.getGrid(),i=e._items.indexOf(t),r=e._layout.slots[2*i],n=e._layout.slots[2*i+1];if(this._didMigrate||t._left!==r||t._top!==n){var s,o,a;if(r+=t._marginLeft,n+=t._marginTop,!(e._settings.dragPlaceholder.duration>0)||this._didMigrate){M(t._id);var l={transform:dt(r,n)};return this._animate.isAnimating()?this._animate.stop(l):c(this._element,l),void(this._didMigrate&&(e.getElement().appendChild(this._element),this._didMigrate=!1))}this._nextLeft=r,this._nextTop=n,s=t._id,o=this._setupAnimation,a=this._startAnimation,k.add(s+"placeholder",o,a)}},gt.prototype._setupAnimation=function(){if(this.isActive()){var t=ct(this._element);this._currentLeft=t.x,this._currentTop=t.y}},gt.prototype._startAnimation=function(){if(this.isActive()){var t=this._animate,e=this._currentLeft,i=this._currentTop,r=this._nextLeft,n=this._nextTop,s={transform:dt(r,n)};if(e!==r||i!==n){var o=this._item.getGrid()._settings.dragPlaceholder,a={transform:dt(e,i)};t.start(a,s,{duration:o.duration,easing:o.easing,onFinish:this._onLayoutEnd})}else t.isAnimating()&&t.stop(s)}},gt.prototype._onLayoutEnd=function(){this._resetAfterLayout&&this.reset()},gt.prototype._onReleaseEnd=function(t){if(t._id===this._item._id){if(!this._animate.isAnimating())return void this.reset();this._resetAfterLayout=!0}},gt.prototype._onMigrate=function(t){if(t.item===this._item){var e=this._item.getGrid(),i=t.toGrid;e.off("dragReleaseEnd",this._onReleaseEnd),e.off("layoutStart",this._onLayoutStart),e.off("beforeSend",this._onMigrate),i.on("dragReleaseEnd",this._onReleaseEnd),i.on("layoutStart",this._onLayoutStart),i.on("beforeSend",this._onMigrate),this._didMigrate=!0}},gt.prototype.create=function(){if(this.isActive())this._resetAfterLayout=!1;else{var t,e=this._item,i=e.getGrid(),r=i._settings,n=this._animate;t=u(r.dragPlaceholder.createElement)?r.dragPlaceholder.createElement(e):window.document.createElement("div"),this._element=t,n._element=t,this._className=r.itemPlaceholderClass||"",this._className&&I(t,this._className);var s=e._left+e._marginLeft,o=e._top+e._marginTop;c(t,{display:"block",position:"absolute",left:"0",top:"0",width:e._width+"px",height:e._height+"px",transform:dt(s,o)}),i.on("layoutStart",this._onLayoutStart),i.on("dragReleaseEnd",this._onReleaseEnd),i.on("beforeSend",this._onMigrate),u(r.dragPlaceholder.onCreate)&&r.dragPlaceholder.onCreate(e,t),i.getElement().appendChild(t)}},gt.prototype.reset=function(){if(this.isActive()){var t=this._element,e=this._item,i=e.getGrid(),r=i._settings,n=this._animate;this._resetAfterLayout=!1,M(e._id),n.stop(),n._element=null,i.off("dragReleaseEnd",this._onReleaseEnd),i.off("layoutStart",this._onLayoutStart),i.off("beforeSend",this._onMigrate),this._className&&(pt(t,this._className),this._className=""),t.parentNode.removeChild(t),this._element=null,u(r.dragPlaceholder.onRemove)&&r.dragPlaceholder.onRemove(e,t)}},gt.prototype.updateDimensions=function(t,e){this.isActive()&&c(this._element,{width:t+"px",height:e+"px"})},gt.prototype.isActive=function(){return!!this._element},gt.prototype.destroy=function(){this.reset(),this._animate.destroy(),this._item=this._animate=null},_t.prototype.add=function(t){return this._isDestroyed||this._queue.push(t),this},_t.prototype.flush=function(t,e){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(t,e),this;for(i=0;i<n&&(o[i](t,e),!this._isDestroyed);i++);return this},_t.prototype.destroy=function(){return this._isDestroyed||(this._isDestroyed=!0,this._queue.length=0),this},yt.prototype.start=function(t,e){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=!t&&!this._skipNextAnimation&&f>0;return d&&this._queue.flush(!0,o),p&&(l._isPositioningStarted=!0),u(e)&&this._queue.add(e),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())}},yt.prototype.stop=function(t,e){if(this._isDestroyed||!this._isActive)return this;var i,r=this._item;return i=r._id,k.cancel(i+"layout"),r._animate.stop(e),pt(r._element,r.getGrid()._settings.itemPositioningClass),this._isActive=!1,t&&this._queue.flush(!0,r),this},yt.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},yt.prototype._updateOffsets=function(){if(!this._isDestroyed){var t=this._item,e=t._migrate,i=t._release;this._offsetLeft=i._isActive?i._containerDiffX:e._isActive?e._containerDiffX:0,this._offsetTop=i._isActive?i._containerDiffY:e._isActive?e._containerDiffY:0}},yt.prototype._updateTargetStyles=function(){this._isDestroyed||(this._targetStyles.transform=dt(this._item._left+this._offsetLeft,this._item._top+this._offsetTop))},yt.prototype._finish=function(){if(!this._isDestroyed){var t=this._item,e=t._migrate,i=t._release;this._isActive&&(this._isActive=!1,pt(t._element,t.getGrid()._settings.itemPositioningClass)),i._isActive&&i.stop(),e._isActive&&e.stop(),this._queue.flush(!1,t)}},yt.prototype._setupAnimation=function(){var t=ct(this._item._element);this._currentLeft=t.x,this._currentTop=t.y},yt.prototype._startAnimation=function(){var t=this._item,e=t.getGrid()._settings;if(this._updateOffsets(),this._updateTargetStyles(),t._left===this._currentLeft-this._offsetLeft&&t._top===this._currentTop-this._offsetTop)return this._isInterrupted&&this.stop(!1,this._targetStyles),this._isActive=!1,void this._finish();this._isInterrupted||I(t._element,e.itemPositioningClass),this._currentStyles.transform=dt(this._currentLeft,this._currentTop),t._animate.start(this._currentStyles,this._targetStyles,this._animateOptions)};var vt={};function bt(t){this._item=t,this._isActive=!1,this._isDestroyed=!1,this._container=!1,this._containerDiffX=0,this._containerDiffY=0}bt.prototype.start=function(t,e,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=t._settings,v=t._element,b=t._items,w=g._items.indexOf(p),C=i||window.document.body;if("number"==typeof e)n=q(b,e,!0);else{if(!(s=t._getItem(e)))return this;n=b.indexOf(s)}return(p.isPositioning()||this._isActive||p.isReleasing())&&(u=(h=ct(f)).x,d=h.y),p.isPositioning()&&p._layout.stop(!0,{transform:dt(u,d)}),this._isActive&&(u-=this._containerDiffX,d-=this._containerDiffY,this.stop(!0,{transform:dt(u,d)})),p.isReleasing()&&(u-=p._release._containerDiffX,d-=p._release._containerDiffY,p._release.stop(!0,{transform:dt(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:t,toIndex:n}),t._hasListeners("beforeReceive")&&t._emit("beforeReceive",{item:p,fromGrid:g,fromIndex:w,toGrid:t,toIndex:n}),pt(f,_.itemClass),pt(f,_.itemVisibleClass),pt(f,_.itemHiddenClass),I(f,y.itemClass),I(f,m?y.itemVisibleClass:y.itemHiddenClass),g._items.splice(w,1),N(b,p,n),p._gridId=t._id,C!==(o=f.parentNode)&&(C.appendChild(f),a=$(C,o,!0),h||(u=(h=ct(f)).x,d=h.y),f.style[r]=dt(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 ft(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:t,toIndex:n}),t._hasListeners("receive")&&t._emit("receive",{item:p,fromGrid:g,fromIndex:w,toGrid:t,toIndex:n}),this},bt.prototype.stop=function(t,e){if(this._isDestroyed||!this._isActive)return this;var i,r=this._item,n=r._element,s=r.getGrid()._element;return this._container!==s&&(e||(t?(i=ct(n),vt.transform=dt(i.x-this._containerDiffX,i.y-this._containerDiffY)):vt.transform=dt(r._left,r._top),e=vt),s.appendChild(n),c(n,e)),this._isActive=!1,this._container=null,this._containerDiffX=0,this._containerDiffY=0,this},bt.prototype.destroy=function(){return this._isDestroyed||(this.stop(!0),this._item=null,this._isDestroyed=!0),this};var wt={};function Ct(t){this._item=t,this._isActive=!1,this._isDestroyed=!1,this._isPositioningStarted=!1,this._containerDiffX=0,this._containerDiffY=0}function St(t){var e=t._isActive,i=t._element,r=t.getGrid()._settings;this._item=t,this._isDestroyed=!1,this._isHidden=!e,this._isHiding=!1,this._isShowing=!1,this._queue=new _t,this._finishShow=this._finishShow.bind(this),this._finishHide=this._finishHide.bind(this),i.style.display=e?"block":"none",I(i,e?r.itemVisibleClass:r.itemHiddenClass),c(t._child,e?r.visibleStyles:r.hiddenStyles)}Ct.prototype.start=function(){if(this._isDestroyed||this._isActive)return this;var t=this._item,e=t.getGrid();return this._isActive=!0,I(t._element,e._settings.itemReleasingClass),e._emit("dragReleaseStart",t),t._layout.start(!1),this},Ct.prototype.stop=function(t,e){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&&(e||(t?(i=ct(n),wt.transform=dt(i.x-this._containerDiffX,i.y-this._containerDiffY)):wt.transform=dt(r._left,r._top),e=wt),o.appendChild(n),c(n,e)),t||s._emit("dragReleaseEnd",r),this},Ct.prototype.destroy=function(){return this._isDestroyed||(this.stop(!0),this._item=null,this._isDestroyed=!0),this},Ct.prototype._reset=function(){if(!this._isDestroyed){var t=this._item;this._isActive=!1,this._isPositioningStarted=!1,this._containerDiffX=0,this._containerDiffY=0,pt(t._element,t.getGrid()._settings.itemReleasingClass)}},St.prototype.show=function(t,e){if(this._isDestroyed)return this;var i=this._item,r=i._element,n=this._queue,s=u(e)?e:null,o=i.getGrid()._settings;return this._isShowing||this._isHidden?this._isShowing&&!t?(s&&n.add(s),this):(this._isShowing||(n.flush(!0,i),pt(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,t,this._finishShow),this):(s&&s(!1,i),this)},St.prototype.hide=function(t,e){if(this._isDestroyed)return this;var i=this._item,r=i._element,n=this._queue,s=u(e)?e:null,o=i.getGrid()._settings;return!this._isHiding&&this._isHidden?(s&&s(!1,i),this):this._isHiding&&!t?(s&&n.add(s),this):(this._isHiding||(n.flush(!0,i),I(r,o.itemHiddenClass),pt(r,o.itemVisibleClass)),s&&n.add(s),this._isHidden=this._isHiding=!0,i._isActive=this._isShowing=!1,this._startAnimation(!1,t,this._finishHide),this)},St.prototype.destroy=function(){if(this._isDestroyed)return this;var t=this._item,e=t._element,i=t.getGrid(),r=this._queue,n=i._settings;return this._stopAnimation({}),r.flush(!0,t).destroy(),pt(e,n.itemVisibleClass),pt(e,n.itemHiddenClass),this._item=null,this._isHiding=this._isShowing=!1,this._isDestroyed=this._isHidden=!0,this},St.prototype._startAnimation=function(t,e,i){if(!this._isDestroyed){var r,n=this._item,s=n.getGrid()._settings,o=t?s.visibleStyles:s.hiddenStyles,l=parseInt(t?s.showDuration:s.hideDuration)||0,u=(t?s.showEasing:s.hideEasing)||"ease",d=e||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(t,e){var i={};for(var r in e)i[r]=a(t,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()}},St.prototype._stopAnimation=function(t){if(!this._isDestroyed){var e=this._item;O(e._id),e._animateChild.stop(t)}},St.prototype._finishShow=function(){this._isHidden||(this._isShowing=!1,this._queue.flush(!1,this._item))};var Tt={};St.prototype._finishHide=function(){if(this._isHidden){var t=this._item;this._isHiding=!1,Tt.transform=dt(0,0),t._layout.stop(!0,Tt),t._element.style.display="none",this._queue.flush(!1,t)}};var Dt,At,Et,xt,Pt=0;function kt(){return++Pt}function Ot(t,e,i){var n=t._settings;this._id=kt(),this._gridId=t._id,this._isDestroyed=!1,this._left=0,this._top=0,this._element=e,this._child=e.children[0],e.parentNode!==t._element&&t._element.appendChild(e),I(e,n.itemClass),"boolean"!=typeof i&&(i="none"!==a(e,"display")),this._isActive=i,e.style.left="0",e.style.top="0",e.style[r]=dt(0,0),this._animate=new d(e),this._animateChild=new d(this._child),this._visibility=new St(this),this._layout=new yt(this),this._migrate=new bt(this),this._release=new Ct(this),this._dragPlaceholder=new gt(this),this._drag=n.dragEnabled?new ft(this):null,this._refreshDimensions(),this._refreshSortData()}function Vt(){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 zt(t){var e=Object.prototype.toString.call(t);return"[object HTMLCollection]"===e||"[object NodeList]"===e}Ot.prototype.getGrid=function(){return t[this._gridId]},Ot.prototype.getElement=function(){return this._element},Ot.prototype.getWidth=function(){return this._width},Ot.prototype.getHeight=function(){return this._height},Ot.prototype.getMargin=function(){return{left:this._marginLeft,right:this._marginRight,top:this._marginTop,bottom:this._marginBottom}},Ot.prototype.getPosition=function(){return{left:this._left,top:this._top}},Ot.prototype.isActive=function(){return this._isActive},Ot.prototype.isVisible=function(){return!!this._visibility&&!this._visibility._isHidden},Ot.prototype.isShowing=function(){return!(!this._visibility||!this._visibility._isShowing)},Ot.prototype.isHiding=function(){return!(!this._visibility||!this._visibility._isHiding)},Ot.prototype.isPositioning=function(){return!(!this._layout||!this._layout._isActive)},Ot.prototype.isDragging=function(){return!(!this._drag||!this._drag._isActive)},Ot.prototype.isReleasing=function(){return!(!this._release||!this._release._isActive)},Ot.prototype.isDestroyed=function(){return this._isDestroyed},Ot.prototype._refreshDimensions=function(){if(!this._isDestroyed&&!this._visibility._isHidden){var t=this._element,e=this._dragPlaceholder,i=t.getBoundingClientRect();this._width=i.width,this._height=i.height,this._marginLeft=Math.max(0,U(t,"margin-left")),this._marginRight=Math.max(0,U(t,"margin-right")),this._marginTop=Math.max(0,U(t,"margin-top")),this._marginBottom=Math.max(0,U(t,"margin-bottom")),e&&e.updateDimensions(this._width,this._height)}},Ot.prototype._refreshSortData=function(){if(!this._isDestroyed){var t,e=this._sortData={},i=this.getGrid()._settings.sortData;for(t in i)e[t]=i[t](this,this._element)}},Ot.prototype._destroy=function(t){if(!this._isDestroyed){var e=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(),e.removeAttribute("style"),this._child.removeAttribute("style"),pt(e,r.itemClass),n>-1&&i._items.splice(n,1),t&&e.parentNode.removeChild(e),this._isActive=!1,this._isDestroyed=!0}},Vt.prototype.getLayout=function(t,e,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(e):e,o.height=l?c?Math.round(i):i:0,o.setWidth=l,o.setHeight=!l,o.slots.length=0,d.length=0,!t.length)return o;for(s=0;s<t.length;s++)this._addSlot(t[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},Vt.prototype._addSlot=(xt={},function(t,e,i,r,n){var s,o,a,l,h,u,c=this._layout,d=this._freeSlots,p=this._newSlots;for(p.length=0,xt.left=null,xt.top=null,xt.width=t._width+t._marginLeft+t._marginRight,xt.height=t._height+t._marginTop+t._marginBottom,r&&(xt.width=Math.round(xt.width),xt.height=Math.round(xt.height)),h=0;h<d.length;h++)if((o=d[h])&&(s=this._getRect(o),xt.width<=s.width+.001&&xt.height<=s.height+.001)){xt.left=s.left,xt.top=s.top;break}for(null===xt.left&&(xt.left=e?c.width:0,xt.top=e?0:c.height,i||(l=!0)),!e&&xt.top+xt.height>c.height&&(xt.left>0&&p.push(this._addRect(0,c.height,xt.left,1/0)),xt.left+xt.width<c.width&&p.push(this._addRect(xt.left+xt.width,c.height,c.width-xt.left-xt.width,1/0)),c.height=xt.top+xt.height),e&&xt.left+xt.width>c.width&&(xt.top>0&&p.push(this._addRect(c.width,0,1/0,xt.top)),xt.top+xt.height<c.height&&p.push(this._addRect(c.width,xt.top+xt.height,1/0,c.height-xt.top-xt.height)),c.width=xt.left+xt.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,xt),u=0;u<a.length;u++)o=a[u],(s=this._getRect(o)).width>.49&&s.height>.49&&(!e&&s.top<c.height||e&&s.left<c.width)&&p.push(o);p.length&&this._purgeRects(p).sort(e?this._sortRectsLeftTop:this._sortRectsTopLeft),e?c.width=Math.max(c.width,xt.left+xt.width):c.height=Math.max(c.height,xt.top+xt.height),c.slots.push(xt.left,xt.top),n&&this._slotSizes.push(xt.width,xt.height),this._freeSlots=p,this._newSlots=d}),Vt.prototype._addRect=function(t,e,i,r){var n=++this._rectId,s=this._rectStore;return s[n]=t||0,s[++this._rectId]=e||0,s[++this._rectId]=i||0,s[++this._rectId]=r||0,n},Vt.prototype._getRect=function(t,e){var i=e||this._rectItem,r=this._rectStore;return i.left=r[t]||0,i.top=r[++t]||0,i.width=r[++t]||0,i.height=r[++t]||0,i},Vt.prototype._splitRect=(Et=[],function(t,e){return Et.length=0,this._doRectsOverlap(t,e)?(t.left<e.left&&Et.push(this._addRect(t.left,t.top,e.left-t.left,t.height)),t.left+t.width>e.left+e.width&&Et.push(this._addRect(e.left+e.width,t.top,t.left+t.width-(e.left+e.width),t.height)),t.top<e.top&&Et.push(this._addRect(t.left,t.top,t.width,e.top-t.top)),t.top+t.height>e.top+e.height&&Et.push(this._addRect(t.left,e.top+e.height,t.width,t.top+t.height-(e.top+e.height))),Et):(Et.push(this._addRect(t.left,t.top,t.width,t.height)),Et)}),Vt.prototype._doRectsOverlap=function(t,e){return!(t.left+t.width<=e.left||e.left+e.width<=t.left||t.top+t.height<=e.top||e.top+e.height<=t.top)},Vt.prototype._isRectWithinRect=function(t,e){return t.left>=e.left&&t.top>=e.top&&t.left+t.width<=e.left+e.width&&t.top+t.height<=e.top+e.height},Vt.prototype._purgeRects=(Dt={},At={},function(t){for(var e,i=t.length;i--;)if(e=t.length,t[i])for(this._getRect(t[i],Dt);e--;)if(t[e]&&i!==e&&this._isRectWithinRect(Dt,this._getRect(t[e],At))){t[i]=0;break}return t}),Vt.prototype._sortRectsTopLeft=function(){var t={},e={};return function(i,r){return this._getRect(i,t),this._getRect(r,e),t.top<e.top?-1:t.top>e.top?1:t.left<e.left?-1:t.left>e.left?1:0}}(),Vt.prototype._sortRectsLeftTop=function(){var t={},e={};return function(i,r){return this._getRect(i,t),this._getRect(r,e),t.left<e.left?-1:t.left>e.left?1:t.top<e.top?-1:t.top>e.top?1:0}}();var Mt=Object.prototype.toString;function Lt(t){return"object"==typeof t&&"[object Object]"===Mt.call(t)}function Bt(t){return zt(t)?Array.prototype.slice.call(t):Array.prototype.concat(t)}var Rt=new Vt,It=function(){};function jt(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=jt.defaultOptions,l=r,h=Nt({},a),l&&(h=Nt(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=kt(),t[this._id]=c,this._isDestroyed=!1,this._layout={id:0,items:[],slots:[],setWidth:!1,setHeight:!1,width:0,height:0},this._emitter=new e,I(i,n.containerClass),this._items=[],"string"==typeof(s=n.items)?Bt(i.children).forEach((function(t){("*"===s||R(t,s))&&c._items.push(new Ot(c,t))})):(Array.isArray(s)||zt(s))&&(this._items=Bt(s).map((function(t){return new Ot(c,t)}))),"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 Nt(t,e){var i,r,n,s=Object.keys(e),o=s.length;for(n=0;n<o;n++)i=Lt(e[r=s[n]]),Lt(t[r])&&i?t[r]=Nt(Nt({},t[r]),e[r]):i?t[r]=Nt({},e[r]):Array.isArray(e[r])?t[r]=e[r].slice(0):t[r]=e[r];return t}return jt.Item=Ot,jt.ItemLayout=yt,jt.ItemVisibility=St,jt.ItemMigrate=bt,jt.ItemAnimate=d,jt.ItemDrag=ft,jt.ItemRelease=Ct,jt.ItemDragPlaceholder=gt,jt.Emitter=e,jt.Dragger=x,jt.Packer=Vt,jt.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"},jt.prototype.on=function(t,e){return this._emitter.on(t,e),this},jt.prototype.off=function(t,e){return this._emitter.off(t,e),this},jt.prototype.getElement=function(){return this._element},jt.prototype.getItems=function(t){if(this._isDestroyed||!t&&0!==t)return this._items.slice(0);var e,i,r=[],n=Bt(t);for(i=0;i<n.length;i++)(e=this._getItem(n[i]))&&r.push(e);return r},jt.prototype.refreshItems=function(t){if(this._isDestroyed)return this;var e,i=this.getItems(t);for(e=0;e<i.length;e++)i[e]._refreshDimensions();return this},jt.prototype.refreshSortData=function(t){if(this._isDestroyed)return this;var e,i=this.getItems(t);for(e=0;e<i.length;e++)i[e]._refreshSortData();return this},jt.prototype.synchronize=function(){if(this._isDestroyed)return this;var t,e,i,r=this._element,n=this._items;if(n.length){for(i=0;i<n.length;i++)(e=n[i]._element).parentNode===r&&(t=t||window.document.createDocumentFragment()).appendChild(e);t&&r.appendChild(t)}return this._emit("synchronize"),this},jt.prototype.layout=function(t,e){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(t)?t:e;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===t,p));return this},jt.prototype.add=function(t,e){if(this._isDestroyed||!t)return[];var i=Bt(t);if(!i.length)return i;var r,n,s=e||0,o=s.layout?s.layout:void 0===s.layout,a=this._items,l=!1;for(n=0;n<i.length;n++)r=new Ot(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},jt.prototype.remove=function(t,e){if(this._isDestroyed)return this;var i,r,n=e||0,s=n.layout?n.layout:void 0===n.layout,o=!1,a=this.getItems(),l=this.getItems(t),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},jt.prototype.show=function(t,e){return this._isDestroyed||this._setItemsVisibility(t,!0,e),this},jt.prototype.hide=function(t,e){return this._isDestroyed||this._setItemsVisibility(t,!1,e),this},jt.prototype.filter=function(t,e){if(this._isDestroyed||!this._items.length)return this;var i,r,n=[],s=[],o="string"==typeof t,a=u(t),l=e||0,h=!0===l.instant,c=l.layout?l.layout:void 0===l.layout,d=u(l.onFinish)?l.onFinish:null,p=-1,f=It;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?t(i):R(i._element,t))?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},jt.prototype.sort=function(){var t,e,i,r;function n(t){for(var e={},i=0;i<t.length;i++)e[t[i]._id]=i;return e}function s(t,i){var n=r[t._id],s=r[i._id];return e?s-n:n-s}function o(o,a){for(var l,h,u,c,d=0,p=0;p<t.length;p++)if(l=t[p][0],h=t[p][1],u=(o._sortData?o:o._refreshSortData())._sortData[l],c=(a._sortData?a:a._refreshSortData())._sortData[l],d="desc"===h||!h&&e?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=t(o,a);return e&&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(t=n,e=!!c.descending,i=h.slice(0),r=null,u(t))h.sort(a);else if("string"==typeof t)t=n.trim().split(" ").map((function(t){return t.split(":")})),h.sort(o);else{if(!Array.isArray(t))return this;if(t.length!==h.length)throw new Error("[Muuri] sort reference items do not match with grid items.");for(l=0;l<h.length;l++){if(t.indexOf(h[l])<0)throw new Error("[Muuri] sort reference items do not match with grid items.");h[l]=t[l]}e&&h.reverse()}return this._hasListeners("sort")&&this._emit("sort",h.slice(0),i),d&&this.layout("instant"===d,u(d)?d:void 0),this}}(),jt.prototype.move=function(t,e,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(t),d=this._getItem(e);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},jt.prototype.send=function(t,e,i,r){if(this._isDestroyed||e._isDestroyed||this===e)return this;if(!(t=this._getItem(t)))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 t._migrate.start(e,i,s),t._migrate._isActive&&t._isActive&&(o&&this.layout("instant"===o,u(o)?o:void 0),a&&e.layout("instant"===a,u(a)?a:void 0)),this},jt.prototype.destroy=function(e){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(e);return pt(r,this._settings.containerClass),r.style.height="",r.style.width="",this._emit("destroy"),this._emitter.destroy(),t[this._id]=void 0,this._isDestroyed=!0,this},jt.prototype._getItem=function(t){if(this._isDestroyed||!t&&0!==t)return null;if("number"==typeof t)return this._items[t>-1?t:this._items.length+t]||null;if(t instanceof Ot)return t._gridId===this._id?t:null;for(var e=0;e<this._items.length;e++)if(this._items[e]._element===t)return this._items[e];return null},jt.prototype._updateLayout=function(){var t,e,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(),t=this._width-this._borderLeft-this._borderRight,e=this._height-this._borderTop-this._borderBottom,i=u(s)?s(n.items,t,e):Rt.getLayout(n.items,t,e,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},jt.prototype._emit=function(){this._isDestroyed||this._emitter.emit.apply(this._emitter,arguments)},jt.prototype._hasListeners=function(t){var e=this._emitter._events[t];return!(!e||!e.length)},jt.prototype._updateBoundingRect=function(){var t=this._element.getBoundingClientRect();this._width=t.width,this._height=t.height,this._left=t.left,this._top=t.top},jt.prototype._updateBorders=function(t,e,i,r){var n=this._element;t&&(this._borderLeft=U(n,"border-left-width")),e&&(this._borderRight=U(n,"border-right-width")),i&&(this._borderTop=U(n,"border-top-width")),r&&(this._borderBottom=U(n,"border-bottom-width"))},jt.prototype._refreshDimensions=function(){this._updateBoundingRect(),this._updateBorders(1,1,1,1)},jt.prototype._setItemsVisibility=function(t,e,i){var r,n,s=this,o=this.getItems(t),a=i||0,l=!0===a.instant,h=a.onFinish,c=a.layout?a.layout:void 0===a.layout,d=o.length,p=e?"showStart":"hideStart",f=e?"showEnd":"hideEnd",m=e?"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],(e&&!r._isActive||!e&&r._isActive)&&(g=!0),e&&!r._isActive&&(r._layout._skipNextAnimation=!0),e&&r._visibility._isHidden&&y.push(r),r._visibility[m](l,(function(t,e){t||_.push(e),--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)},jt}()},function(t,e,i){},function(t,e,i){},function(t,e,i){},function(t,e,i){"use strict";i.r(e),i.d(e,"localization",(function(){return r.a})),i.d(e,"surveyStrings",(function(){return r.b})),i.d(e,"DataProvider",(function(){return s})),i.d(e,"NumberModel",(function(){return c})),i.d(e,"SelectBase",(function(){return d})),i.d(e,"Matrix",(function(){return p})),i.d(e,"BooleanModel",(function(){return f})),i.d(e,"HistogramModel",(function(){return m})),i.d(e,"VisualizerBase",(function(){return u})),i.d(e,"VisualizationManager",(function(){return a})),i.d(e,"VisualizationPanel",(function(){return C})),i.d(e,"VisualizationPanelDynamic",(function(){return S})),i.d(e,"VisualizationMatrixDynamic",(function(){return T})),i.d(e,"VisualizationMatrixDropdown",(function(){return D})),i.d(e,"AlternativeVisualizersWrapper",(function(){return g})),i.d(e,"PlotlySetup",(function(){return A})),i.d(e,"PlotlyChartAdapter",(function(){return P})),i.d(e,"SelectBasePlotly",(function(){return k})),i.d(e,"MatrixPlotly",(function(){return O})),i.d(e,"PlotlyBoolChartAdapter",(function(){return V})),i.d(e,"BooleanPlotly",(function(){return z})),i.d(e,"RankingPlotly",(function(){return M})),i.d(e,"MatrixDropdownGroupedPlotly",(function(){return L})),i.d(e,"HistogramPlotly",(function(){return B})),i.d(e,"PlotlyGaugeAdapter",(function(){return R})),i.d(e,"GaugePlotly",(function(){return I})),i.d(e,"WordCloudAdapter",(function(){return F})),i.d(e,"WordCloud",(function(){return G})),i.d(e,"textHelper",(function(){return N})),i.d(e,"TextTableAdapter",(function(){return X})),i.d(e,"Text",(function(){return Y})),i.d(e,"ChoicesTableAdapter",(function(){return Q})),i.d(e,"ChoicesTable",(function(){return U})),i.d(e,"DocumentHelper",(function(){return h.b}));var r=i(1);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";var n=i(3),s=function(){function t(t,e){void 0===t&&(t=[]),void 0===e&&(e=void 0),this._data=t,this._getDataCore=e,this.filterValues={},this.onDataChanged=new n.Event}return t.prototype.getStatisticsCacheKey=function(t){return Array.isArray(t.dataName)?t.dataName.join("-"):t.dataName},t.prototype.reset=function(t){if(t){if(void 0!==this._statisticsCache){var e=this.getStatisticsCacheKey(t);delete this._statisticsCache[e]}}else void 0===this._statisticsCache&&void 0===this._filteredData||(this._statisticsCache=void 0,this._filteredData=void 0,this.raiseDataChanged())},Object.defineProperty(t.prototype,"data",{get:function(){return this._data},set:function(t){this._data=[].concat(t),this.reset()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"filteredData",{get:function(){var e=this;void 0===this._filteredData&&(Object.keys(this.filterValues).length>0?this._filteredData=this.data.filter((function(i){return!Object.keys(e.filterValues).some((function(r){var n=e.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(t,e){var i=Object.keys(t),r=Object.keys(e);if(r.length>i.length)return!1;for(var n=0,s=r;n<s.length;n++){var o=s[n];if(e[o]!=t[o])return!1}return!0}(o,n);var a=i[t.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]!==e.filterValues[r]}))})):this._filteredData=this.data);return this._filteredData},enumerable:!1,configurable:!0}),t.prototype.setFilter=function(t,e){var i=!0;void 0!==e?(i=this.filterValues[t]!==e,this.filterValues[t]=e):(i=void 0!==this.filterValues[t],delete this.filterValues[t]),i&&this.reset()},t.prototype.getDataCore=function(e){if(this._getDataCore)return this._getDataCore(e);var i=Array.isArray(e.dataName)?e.dataName:[e.dataName],r=[],n=e.getValues(),s={};n.forEach((function(t,e){s[t]=e}));var o=-1!==n.indexOf(void 0),a=e.getSeriesValues(),l={};a.forEach((function(t,e){l[t]=e}));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(e){i.forEach((function(i,n){var h=e[i];if(void 0!==h||o){var u=Array.isArray(h)?h:[h];if(a.length>0)if(void 0!==e[t.seriesMarkerKey]){var c=l[e[t.seriesMarkerKey]]||0;u.forEach((function(t){r[n][c][s[t]]++}))}else u.forEach((function(t){a.forEach((function(e){if(void 0!==t[e]){var i=l[e]||0;r[n][i][s[t[e]]]++}}))}));else u.forEach((function(t){return r[0][0][s[t]]++}))}}))})),Array.isArray(e.dataName)?r:r[0]},t.prototype.getData=function(t){var e=this.getStatisticsCacheKey(t);return void 0!==this._statisticsCache&&void 0!==this._statisticsCache[e]||(void 0===this._statisticsCache&&(this._statisticsCache={}),this._statisticsCache[e]=this.getDataCore(t)),[].concat(this._statisticsCache[e])},t.prototype.raiseDataChanged=function(){this.onDataChanged.isEmpty||this.onDataChanged.fire(this,{})},t.seriesMarkerKey="__sa_series_name",t}();var o=i(2),a=function(){function t(){}return t.registerVisualizer=function(e,i){var r=t.vizualizers[e];r||(r=[],t.vizualizers[e]=r),r.push(i)},t.unregisterVisualizer=function(e,i){var r=t.vizualizers[e];if(r){var n=r.indexOf(i);-1!==n&&r.splice(n,1)}},t.unregisterVisualizerForAll=function(e){Object.keys(t.vizualizers).forEach((function(i){return t.unregisterVisualizer(i,e)}))},t.getVisualizersByType=function(e){var i=t.vizualizers[e];return i||[u]},t.getAlternativesVisualizer=function(){return t.alternativesVisualizer||u},t.registerAlternativesVisualizer=function(e){t.alternativesVisualizer=e},t.alternativesVisualizer=void 0,t.vizualizers={},t}(),l=function(){function t(){}return t.createVisualizer=function(t,e,i){var r;r="text"===t.getType()&&t.inputType?t.inputType:t.getType();var n=a.getVisualizersByType(r).map((function(r){return new r(t,e,i)}));return n.length>1?new(a.getAlternativesVisualizer())(n,t,e,i):n[0]},t}(),h=i(0),u=(i(23),function(){function t(t,e,i,r){void 0===i&&(i={});var o=this;this.question=t,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.toolbarItemCreators={},this._backgroundColor="#f7f7f7",this._dataProvider=i.dataProvider||new s(e),this._dataProvider.onDataChanged.add((function(){return o.onDataChanged()})),void 0!==i.labelTruncateLength&&(this.labelTruncateLength=i.labelTruncateLengt)}return t.prototype.afterRender=function(t){this.onAfterRender.fire(this,{htmlElement:t})},Object.defineProperty(t.prototype,"questionOptions",{get:function(){return this.options[this.question.name]},enumerable:!1,configurable:!0}),t.prototype.onDataChanged=function(){this.refresh()},Object.defineProperty(t.prototype,"dataName",{get:function(){return this.question.valueName||this.question.name},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hasHeader",{get:function(){return!(!this.options||!this.options.showCorrectAnswers)&&(!!this.question&&!!this.question.correctAnswer)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hasFooter",{get:function(){return!!this.question&&(this.question.hasComment||this.question.hasOther)},enumerable:!1,configurable:!0}),t.prototype.createVisualizer=function(t){var e=Object.assign({},this.options);return void 0===e.dataProvider&&(e.dataProvider=this.dataProvider),l.createVisualizer(t,this.data,e)},Object.defineProperty(t.prototype,"footerVisualizer",{get:function(){var t=this;if(this.hasFooter){if(!this._footerVisualizer){var e=new n.QuestionCommentModel(this.question.name+(n.settings||{}).commentPrefix);e.title=this.processText(this.question.title),this._footerVisualizer=this.createVisualizer(e),this._footerVisualizer.onUpdate=function(){return t.invokeOnUpdate()}}return this._footerVisualizer}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"supportSelection",{get:function(){return(void 0===this.options.allowSelection||this.options.allowSelection)&&this._supportSelection},enumerable:!1,configurable:!0}),t.prototype.getSeriesValues=function(){return this.options.seriesValues||[]},t.prototype.getSeriesLabels=function(){return this.options.seriesLabels||this.getSeriesValues()},t.prototype.getValues=function(){throw new Error("Method not implemented.")},t.prototype.getLabels=function(){return this.getValues()},t.prototype.registerToolbarItem=function(t,e){this.toolbarItemCreators[t]=e},Object.defineProperty(t.prototype,"name",{get:function(){return this._name||"visualizer"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"data",{get:function(){return this.dataProvider.filteredData},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dataProvider",{get:function(){return this._dataProvider},enumerable:!1,configurable:!0}),t.prototype.updateData=function(t){this.options.dataProvider||(this.dataProvider.data=t),this.hasFooter&&this.footerVisualizer.updateData(t)},t.prototype.invokeOnUpdate=function(){this.onUpdate&&this.onUpdate()},t.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)},t.prototype.clear=function(){this.toolbarContainer&&this.destroyToolbar(this.toolbarContainer),this.contentContainer&&this.destroyContent(this.contentContainer),this.footerContainer&&this.destroyFooter(this.footerContainer)},t.prototype.createToolbarItems=function(t){var e=this;Object.keys(this.toolbarItemCreators||{}).forEach((function(i){var r=e.toolbarItemCreators[i](t);r&&t.appendChild(r)}))},t.prototype.getCorrectAnswerText=function(){return this.question?this.question.correctAnswer:""},t.prototype.destroyToolbar=function(t){t.innerHTML=""},t.prototype.renderToolbar=function(t){if(this.showHeader){var e=h.b.createElement("div","sa-toolbar");this.createToolbarItems(e),t.appendChild(e)}},t.prototype.destroyHeader=function(t){this.options&&"function"==typeof this.options.destroyHeader?this.options.destroyHeader(t,this):t.innerHTML=""},t.prototype.destroyContent=function(t){this.options&&"function"==typeof this.options.destroyContent?this.options.destroyContent(t,this):t.innerHTML=""},t.prototype.renderHeader=function(t){if(this.options&&"function"==typeof this.options.renderHeader)this.options.renderHeader(t,this);else{var e=h.b.createElement("div","sa-visualizer__correct-answer");e.innerText=r.a.getString("correctAnswer")+this.getCorrectAnswerText(),t.appendChild(e)}},t.prototype.renderContent=function(t){this.options&&"function"==typeof this.options.renderContent?this.options.renderContent(t,this):t.innerText=r.a.getString("noVisualizerForQuestion"),this.afterRender(t)},t.prototype.destroyFooter=function(t){t.innerHTML=""},t.prototype.renderFooter=function(e){var i=this;if(e.innerHTML="",this.hasFooter){var n=h.b.createElement("h4","sa-visualizer__footer-title",{innerText:r.a.getString("otherCommentTitle")});e.appendChild(n);var s=h.b.createElement("div","sa-visualizer__footer-content");s.style.display=t.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(t.otherCommentCollapsed?"showButton":"hideButton")),i.footerVisualizer.invokeOnUpdate()}),r.a.getString("showButton"));e.appendChild(o),e.appendChild(s),this.footerVisualizer.render(s)}},t.prototype.render=function(t){"string"==typeof t&&(t=document.getElementById(t)),this.renderResult=t,this.toolbarContainer=h.b.createElement("div","sa-visualizer__toolbar"),t.appendChild(this.toolbarContainer),this.renderToolbar(this.toolbarContainer),this.hasHeader&&(this.headerContainer=h.b.createElement("div","sa-visualizer__header"),t.appendChild(this.headerContainer),this.renderHeader(this.headerContainer)),this.contentContainer=h.b.createElement("div","sa-visualizer__content"),t.appendChild(this.contentContainer),this.renderContent(this.contentContainer),this.footerContainer=h.b.createElement("div","sa-visualizer__footer"),t.appendChild(this.footerContainer),this.renderFooter(this.footerContainer)},t.prototype.refresh=function(){var t=this;this.headerContainer&&setTimeout((function(){t.destroyHeader(t.headerContainer),t.renderHeader(t.headerContainer),t.invokeOnUpdate()})),this.contentContainer&&setTimeout((function(){t.destroyContent(t.contentContainer),t.renderContent(t.contentContainer),t.invokeOnUpdate()})),this.footerContainer&&setTimeout((function(){t.destroyFooter(t.footerContainer),t.renderFooter(t.footerContainer),t.invokeOnUpdate()}))},t.prototype.processText=function(t){return!1!==this.options.stripHtmlFromTitles?(t||"").replace(/(<([^>]+)>)/gi,""):t},t.prototype.getRandomColor=function(){var t=this.getColors();return t[Math.floor(Math.random()*t.length)]},Object.defineProperty(t.prototype,"backgroundColor",{get:function(){return this.getBackgroundColorCore()},set:function(t){this.setBackgroundColorCore(t)},enumerable:!1,configurable:!0}),t.prototype.getBackgroundColorCore=function(){return this._backgroundColor},t.prototype.setBackgroundColorCore=function(t){this._backgroundColor=t,this.footerVisualizer&&(this.footerVisualizer.backgroundColor=t)},t.prototype.getColors=function(e){void 0===e&&(e=10);for(var i=Array.isArray(t.customColors)&&t.customColors.length>0?t.customColors:t.colors,r=[],n=0;n<e;n++)r=r.concat(i);return r},Object.defineProperty(t.prototype,"showHeader",{get:function(){return this._showHeader},set:function(t){t!=this._showHeader&&(this._showHeader=t,this.toolbarContainer&&(this.destroyToolbar(this.toolbarContainer),this.renderToolbar(this.toolbarContainer)))},enumerable:!1,configurable:!0}),t.prototype.getData=function(){return this.dataProvider.getData(this)},t.prototype.getState=function(){return{}},t.prototype.setState=function(t){},t.otherCommentCollapsed=!0,t.customColors=[],t.colors=["#86e1fb","#3999fb","#ff6771","#1eb496","#ffc152","#aba1ff","#7d8da5","#4ec46c","#cf37a6","#4e6198"],t}()),c=function(t){function e(e,i,n,s){void 0===n&&(n={});var o=t.call(this,e,i,n,s||"number")||this;return o.registerToolbarItem("changeChartType",(function(){return o.chartTypes.length>1?h.b.createSelector(o.chartTypes.map((function(t){return{value:t,text:r.a.getString("chartType_"+t)}})),(function(t){return o.chartType===t.value}),(function(t){o.setChartType(t.target.value)})):null})),o}return Object(o.b)(e,t),e.prototype.onDataChanged=function(){this._resultAverage=void 0,this._resultMin=void 0,this._resultMax=void 0,t.prototype.onDataChanged.call(this)},e.prototype.onChartTypeChanged=function(){},e.prototype.setChartType=function(t){-1!==this.chartTypes.indexOf(t)&&this.chartType!==t&&(this.chartType=t,this.onChartTypeChanged(),this.contentContainer&&(this.destroyContent(this.contentContainer),this.renderContent(this.contentContainer)),this.invokeOnUpdate())},e.prototype.destroy=function(){this._resultAverage=void 0,this._resultMin=void 0,this._resultMax=void 0,t.prototype.destroy.call(this)},e.prototype.generateText=function(t,i,r){var n=[];if(5===r)n=["very high ("+t+")","high","medium","low","very low ("+i+")"];else{n.push(t);for(var s=0;s<r-2;s++)n.push("");n.push(i)}return e.generateTextsCallback?e.generateTextsCallback(this.question,t,i,r,n):n},e.prototype.generateValues=function(t,e){for(var i=[],r=0;r<e;r++)i.push(t/e);return i.push(t),i},e.prototype.generateColors=function(t,e,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},e.prototype.getData=function(){var t=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 e=0;this.data.forEach((function(i){if(void 0!==i[t.question.name]){var r=+i[t.question.name];e++,t._resultAverage+=r,t._resultMin>r&&(t._resultMin=r),t._resultMax<r&&(t._resultMax=r)}})),e>0&&(this._resultAverage=this._resultAverage/e),this._resultAverage=Math.ceil(100*this._resultAverage)/100}return[this._resultAverage,this._resultMin,this._resultMax]},e.stepsCount=5,e.showAsPercentage=!1,e}(u),d=function(t){function e(i,s,o,a){var l=t.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(e.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(t){return{value:t,text:r.a.getString("chartType_"+t)}})),(function(t){return l.chartType===t.value}),(function(t){l.setChartType(t.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(t){return!1}),(function(t){l.answersOrder=t.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(t){return{text:r.a.getString("topNValueText"+t),value:t}})),(function(t){return!1}),(function(t){l.topN=parseInt(t.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)(e,t),e.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")},e.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")},e.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)},e.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")},e.prototype.updateTopNSelector=function(){this.topNSelector&&(this.topNSelector.getElementsByTagName("select")[0].value=this._topN)},e.prototype.updateMissingAnswersBtn=function(){this.missingAnswersBtn&&(this.missingAnswersBtn.innerText=this._showMissingAnswers?r.a.getString("hideMissingAnswers"):r.a.getString("showMissingAnswers"))},e.prototype.onChartTypeChanged=function(){this.updateOrderSelector(),this.updateShowPercentageBtn(),this.updateEmptyAnswersBtn(),this.updateTopNSelector()},e.prototype.setChartType=function(t){-1!==this.chartTypes.indexOf(t)&&this.chartType!==t&&(this.chartType=t,this.onChartTypeChanged(),this.refreshContent())},e.prototype.getCorrectAnswerText=function(){var e=t.prototype.getCorrectAnswerText.call(this),i=Array.isArray(e)?e:[e],r=this.question;return i.map((function(t){return n.ItemValue.getTextOrHtmlByValue(r.choices,t)})).join(", ")},e.prototype.getSelectedItemByText=function(t){var e=this.question;return this.question.hasOther&&t==e.otherText?e.otherItem:e.choices.filter((function(e){return e.text===t}))[0]},e.prototype.setSelection=function(t){this.selectedItem!==t&&(this.selectedItem=t,void 0!==this.onDataItemSelected&&this.onDataItemSelected(void 0!==t?t.value:void 0,void 0!==t?t.text:""))},Object.defineProperty(e.prototype,"selection",{get:function(){return this.selectedItem},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"showOnlyPercentages",{get:function(){return this._showOnlyPercentages},set:function(t){this._showOnlyPercentages=t,this.refreshContent()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"showPercentages",{get:function(){return this._showPercentages},set:function(t){this._showPercentages=t,this.updateShowPercentageBtn(),this.refreshContent()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"answersOrder",{get:function(){return this._answersOrder},set:function(t){this._answersOrder=t,this.updateOrderSelector(),this.refreshContent()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hideEmptyAnswers",{get:function(){return this._hideEmptyAnswers},set:function(t){this._hideEmptyAnswers=t,this.updateEmptyAnswersBtn(),this.refreshContent()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"transposeData",{get:function(){return this._transposeData},set:function(t){this._transposeData=t,this.updateTransposeDataBtn(),this.refreshContent()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"topN",{get:function(){return this._topN},set:function(t){this._topN=t,this.updateTopNSelector(),this.updateOrderSelector(),this.refreshContent()},enumerable:!1,configurable:!0}),e.prototype.isSupportMissingAnswers=function(){return!0},Object.defineProperty(e.prototype,"showMissingAnswers",{get:function(){return this._showMissingAnswers},set:function(t){this._showMissingAnswers=this.isSupportMissingAnswers()&&t,this.updateMissingAnswersBtn(),this.dataProvider.reset(this),this.refreshContent()},enumerable:!1,configurable:!0}),e.prototype.refreshContent=function(){this.contentContainer&&(this.destroyContent(this.contentContainer),this.renderContent(this.contentContainer)),this.invokeOnUpdate()},Object.defineProperty(e.prototype,"showValuesInOriginalOrder",{get:function(){return!1!==this.options.showValuesInOriginalOrder},enumerable:!1,configurable:!0}),e.prototype.valuesSource=function(){return this.question.activeChoices},e.prototype.getValues=function(){var t=this.valuesSource().map((function(t){return t.value}));return this.question.hasOther&&t.push("other"),this.showMissingAnswers&&t.unshift(void 0),this.showValuesInOriginalOrder?t.reverse():t},e.prototype.getLabels=function(){var t=this;if(this.options.useValuesAsLabels)return this.getValues();var e=this.valuesSource().map((function(e){return n.ItemValue.getTextOrHtmlByValue(t.valuesSource(),e.value)})),i=this.question;return i.hasOther&&e.push(i.otherText),this.showMissingAnswers&&e.unshift(r.a.getString("missingAnswersLabel")),this.showValuesInOriginalOrder?e.reverse():e},e.prototype.getPercentages=function(){var t=this.getData(),e=[],i=this._percentagePrecision;if(t.length<2)t.forEach((function(t,r){var n=t.reduce((function(t,e){return t+e}),0);e[r]=t.map((function(t){var e=i?+(t/n).toFixed(i):Math.round(t/n*1e4);return n&&e/100}))}));else for(var r=0;r<t[0].length;r++){for(var n=0,s=0;s<t.length;s++)n+=t[s][r];for(s=0;s<t.length;s++){Array.isArray(e[s])||(e[s]=[]);var o=i?+(t[s][r]/n*100).toFixed(i):Math.round(t[s][r]/n*100);e[s][r]=n&&o}}return e},e.prototype.hideEmptyAnswersInData=function(t){for(var e={datasets:[[]],labels:[],colors:[],texts:[[]],seriesLabels:t.seriesLabels},i=0;i<t.datasets[0].length;i++)0!=t.datasets[0][i]&&(e.datasets[0].push(t.datasets[0][i]),e.labels.push(t.labels[i]),e.colors.push(t.colors[i]),e.texts[0].push(t.texts[0][i]));return e},e.prototype.answersDataReady=function(t){var e={};return e=this.hideEmptyAnswers?this.hideEmptyAnswersInData(t):t,this.topN>0&&(e.datasets[0]=e.datasets[0].slice(-this.topN),e.labels=e.labels.slice(-this.topN),e.colors=e.colors.slice(-this.topN),e.texts[0]=e.texts[0].slice(-this.topN)),e},e.prototype.getAnswersData=function(){var t=this.getSeriesLabels(),e=this.getData(),i=this.getLabels(),r=this.getColors(),n=this.showPercentages?this.getPercentages():e;if(this.transposeData){e=this.transpose(e),n=this.transpose(n);var s=t;t=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,e[0],"desc"==this.answersOrder),l=h.a.unzipArrays(a.keys);i=l[0],r=l[1],this.showPercentages&&(n[0]=l[2]),e[0]=a.values}var u={datasets:e,labels:i,colors:r,texts:n,seriesLabels:t};return u=this.answersDataReady(u),this.onAnswersDataReady.fire(this,u),u},e.prototype.transpose=function(t){for(var e=t[0].length,i=new Array(e),r=0;r<e;++r)i[r]=new Array(t.length);for(r=0;r<t.length;++r)for(var n=0;n<e;++n)i[n][r]=t[r][n];return i},e.prototype.getState=function(){var t=this,i={};return e._stateProperties.forEach((function(e){i[e]=t[e]})),i},e.prototype.setState=function(t){var i=this;e._stateProperties.forEach((function(e){void 0!==t[e]&&(i[e]=t[e])}))},e.topNValuesDefaults=[-1,5,10,20],e._stateProperties=["chartType","answersOrder","hideEmptyAnswers","topN"],e}(u),p=function(t){function e(e,i,r,n){var s=t.call(this,e,i,r,n||"matrix")||this;return s.getAnswersData(),s}return Object(o.b)(e,t),Object.defineProperty(e.prototype,"matrixQuestion",{get:function(){return this.question},enumerable:!1,configurable:!0}),e.prototype.isSupportMissingAnswers=function(){return!1},e.prototype.getSeriesValues=function(){return this.matrixQuestion.rows.map((function(t){return""+t.value}))},e.prototype.getSeriesLabels=function(){var t=this;return this.matrixQuestion.rows.map((function(e){return n.ItemValue.getTextOrHtmlByValue(t.matrixQuestion.rows,e.value)}))},e.prototype.getSelectedItemByText=function(t){return this.matrixQuestion.columns.filter((function(e){return e.text===t}))[0]},e.prototype.valuesSource=function(){return this.matrixQuestion.columns},e.prototype.getHasAnswersInAllSeriesArray=function(t){for(var e=Array(),i=0;i<t[0].length;i++)for(var r=0;r<t.length;r++)0!=t[r][i]&&(e[i]=!0);return e},e.prototype.getHasAnswersInSeries=function(t){for(var e=0;e<t.length;e++)if(0!=t[e])return!0;return!1},e.prototype.hideEmptyAnswersInData=function(t){for(var e={datasets:[],labels:[],colors:[],texts:[],seriesLabels:[]},i=this.getHasAnswersInAllSeriesArray(t.datasets),r=0;r<t.datasets.length;r++){if(this.getHasAnswersInSeries(t.datasets[r])){e.labels.push(t.labels[r]),e.colors.push(t.colors[r]);for(var n=[],s=[],o=0;o<t.datasets[0].length;o++)i[o]&&(n.push(t.datasets[r][o]),s.push(t.texts[r][o]));e.datasets.push(n),e.texts.push(s)}}for(r=0;r<t.datasets[0].length;r++)i[r]&&e.seriesLabels.push(t.seriesLabels[r]);return e},e.prototype.getData=function(){var e=t.prototype.getData.call(this),i=this.getSeriesValues(),r=this.getValues();if(i.length>1){var n=[];return r.forEach((function(t,r){var s=i.map((function(t,i){return e[i][r]}));n.push(s)})),n}return e},e}(d),f=function(t){function e(e,i,r,n){return t.call(this,e,i,r,n||"boolean")||this}return Object(o.b)(e,t),e.prototype.getCorrectAnswerText=function(){var t=this.booleanQuestion.correctAnswer;return void 0!==this.booleanQuestion.valueTrue&&this.booleanQuestion.valueTrue===t||t?this.booleanQuestion.locLabelTrue.textOrHtml:void 0!==this.booleanQuestion.valueFalse&&this.booleanQuestion.valueFalse===t||!t?this.booleanQuestion.locLabelFalse.textOrHtml:t},Object.defineProperty(e.prototype,"booleanQuestion",{get:function(){return this.question},enumerable:!1,configurable:!0}),e.prototype.getSelectedItemByText=function(t){var e=this.getLabels(),i=this.getValues();return new n.ItemValue(i[e.indexOf(t)],t)},e.prototype.getValues=function(){var t=[void 0===this.booleanQuestion.valueTrue||this.booleanQuestion.valueTrue,void 0!==this.booleanQuestion.valueFalse&&this.booleanQuestion.valueFalse];return this.showMissingAnswers&&t.push(void 0),t},e.prototype.getLabels=function(){var t=[].concat(this.getValues());return void 0!==this.booleanQuestion.labelTrue&&(t[0]=this.booleanQuestion.locLabelTrue.textOrHtml),void 0!==this.booleanQuestion.labelFalse&&(t[1]=this.booleanQuestion.locLabelFalse.textOrHtml),this.showMissingAnswers&&(t[2]=r.a.getString("missingAnswersLabel")),t},e.trueColor="",e.falseColor="",e}(d),m=function(t){function e(e,i,r,n){var s=t.call(this,e,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"!==e.getType()||"date"!==e.inputType&&"datetime"!==e.inputType?s.valueType="number":s.valueType="date",s}return Object(o.b)(e,t),e.prototype.reset=function(){this._continiousData=void 0,this._cachedValues=void 0,this._cachedIntervals=void 0},e.prototype.getContiniousValue=function(t){return"date"===this.valueType?Date.parse(t):parseFloat(t)},e.prototype.getString=function(t){return"date"===this.valueType?new Date(t).toLocaleDateString():""+t},e.prototype.toPrecision=function(t){var e=Math.pow(10,this._intervalPrecision);return Math.round(e*t)/e},e.prototype.getSelectedItemByText=function(t){if(this.hasCustomIntervals||this.getContiniousValues().length>e.UseIntervalsFrom){var i=this.intervals.filter((function(e){return e.label===t}))[0];return new n.ItemValue(i,void 0!==i?i.label:"")}var r=this.getLabels(),s=r.indexOf(t);return new n.ItemValue(this.getValues()[s],r[s])},e.prototype.updateData=function(e){this.reset(),t.prototype.updateData.call(this,e)},e.prototype.onDataChanged=function(){this.reset(),t.prototype.onDataChanged.call(this)},e.prototype.getContiniousValues=function(){var t=this;if(void 0===this._cachedValues){var e=this.getSeriesValues();0===e.length&&e.push(""),this._continiousData={},e.forEach((function(e){return t._continiousData[e]=[]}));var i={};this.data.forEach((function(e){var r=e[t.dataName];if(void 0!==r){var n=e[s.seriesMarkerKey]||"";t._continiousData[n].push(t.getContiniousValue(r)),i[r]=r}})),this._cachedValues=Object.keys(i).map((function(e){return{original:i[e],continious:t.getContiniousValue(e)}})),this._cachedValues.sort((function(t,e){return t.continious-e.continious}))}return this._cachedValues},e.prototype.isSupportMissingAnswers=function(){return!1},Object.defineProperty(e.prototype,"needUseRateValues",{get:function(){return"rating"==this.question.getType()&&Array.isArray(this.question.rateValues)&&this.question.rateValues.length>0},enumerable:!1,configurable:!0}),e.prototype.getValues=function(){var t=this.getContiniousValues();return this.hasCustomIntervals||t.length>e.UseIntervalsFrom||this.needUseRateValues?this.intervals.map((function(t){return t.start})):t.map((function(t){return t.original}))},e.prototype.getLabels=function(){var t=this.getContiniousValues();return this.hasCustomIntervals||t.length>e.UseIntervalsFrom||this.needUseRateValues?this.intervals.map((function(t){return t.label})):t.map((function(t){return""+t.original}))},Object.defineProperty(e.prototype,"hasCustomIntervals",{get:function(){return!!this.questionOptions&&Array.isArray(this.questionOptions.intervals)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"intervals",{get:function(){if(this.hasCustomIntervals)return this.questionOptions.intervals.reverse();if(this.needUseRateValues){var t=this.question.rateValues;return t.map((function(e,i){return{start:e.value,end:i<t.length-1?t[i+1].value:e.value+1,label:e.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=e.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}),e.prototype.getData=function(){var i=this.getContiniousValues();if(!this.hasCustomIntervals&&i.length<=e.UseIntervalsFrom)return t.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(t){return 0}))),this._continiousData[s[o]].forEach((function(t){for(var e=0;e<r.length;++e)if(r[e].start<=t&&(t<r[e].end||e==r.length-1)){n[o][e]++;break}}));return n},e.IntervalsCount=10,e.UseIntervalsFrom=10,e}(d),g=function(t){function e(e,i,n,s){var o=t.call(this,i,n,s)||this;if(o.visualizers=e,o.visualizersWithSelection=[],o.onAfterVisualizerRenderCallback=function(){o.afterRender(o.contentContainer)},!e||e.length<2)throw new Error("VisualizerArrayWrapper works with visualizers collection only.");return o.visualizers.forEach((function(t){t.onUpdate=function(){return o.invokeOnUpdate()},t.supportSelection&&(o._supportSelection=!0,o.visualizersWithSelection.push(t))})),o.registerToolbarItem("changeVisualizer",(function(){return h.b.createSelector(o.visualizers.map((function(t){return{value:t.name,text:r.a.getString("visualizer_"+t.name)}})),(function(t){return o.visualizer.name===t.value}),(function(t){return o.setVisualizer(t.target.value)}))})),o.visualizer=e[0],o.visualizer.onAfterRender.add(o.onAfterVisualizerRenderCallback),o}return Object(o.b)(e,t),Object.defineProperty(e.prototype,"hasFooter",{get:function(){return!1},enumerable:!1,configurable:!0}),e.prototype.getVisualizers=function(){return this.visualizers},e.prototype.setVisualizer=function(t){this.visualizer&&(this.visualizer.onAfterRender.remove(this.onAfterVisualizerRenderCallback),this.visualizer.destroy()),this.visualizer=this.visualizers.filter((function(e){return e.name===t}))[0],this.refresh(),this.visualizer.onAfterRender.add(this.onAfterVisualizerRenderCallback)},e.prototype.updateData=function(e){t.prototype.updateData.call(this,e),this.visualizers.forEach((function(t){t.updateData(e)}))},Object.defineProperty(e.prototype,"onDataItemSelected",{set:function(t){this.visualizersWithSelection.forEach((function(e){e.onDataItemSelected=t}))},enumerable:!1,configurable:!0}),e.prototype.setSelection=function(t){this.visualizersWithSelection.forEach((function(e){e.setSelection(t)}))},Object.defineProperty(e.prototype,"selection",{get:function(){return this.visualizer.selection||this.selectedItem},enumerable:!1,configurable:!0}),e.prototype.renderContent=function(t){this.visualizerContainer=t,this.visualizer.render(this.visualizerContainer)},e.prototype.setBackgroundColorCore=function(e){t.prototype.setBackgroundColorCore.call(this,e),this.visualizers.forEach((function(t){return t.backgroundColor=e}))},e.prototype.destroy=function(){var e=this;this.visualizers.forEach((function(t){t.onAfterRender.remove(e.onAfterVisualizerRenderCallback),t.onUpdate=void 0})),this.visualizer.destroy(),t.prototype.destroy.call(this)},e}(u);a.registerAlternativesVisualizer(g);var _=function(){function t(t){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 e=h.b.createButton((function(){t.setSelection(void 0)}),r.a.getString("clearButton"));this._htmlElement.appendChild(e)}return Object.defineProperty(t.prototype,"htmlElement",{get:function(){return this._htmlElement},enumerable:!1,configurable:!0}),t.prototype.update=function(t){void 0!==t&&void 0!==t.value?(this._htmlElement.style.display="inline-block",this.text.innerText=r.a.getString("filter")+": ["+t.text+"]"):(this._htmlElement.style.display="none",this.text.innerText="")},t}(),y=i(24),v=function(t){function e(e,i){var r=t.call(this,e)||this;return r._selector=i,r._muuri=void 0,r._layoutingTimer=void 0,r}return Object(o.b)(e,t),e.prototype.startCore=function(t){var e=this;this._muuri=new y(t,{dragStartPredicate:{handle:".sa-question__title--draggable"},items:this._selector,dragEnabled:!0}),this._muuri.on("dragReleaseEnd",(function(t){return e.onMoveCallback&&e.onMoveCallback(t.fromIndex,t.toIndex)}))},e.prototype.stopCore=function(){this._muuri.off("dragReleaseEnd"),this._muuri.destroy(),this._muuri=void 0},e.prototype.updateCore=function(){var t=this;void 0!==this._layoutingTimer&&clearTimeout(this._layoutingTimer),this._layoutingTimer=setTimeout((function(){t._layoutingTimer=void 0,t._muuri.refreshItems(),t._muuri.layout()}),10)},e.prototype.add=function(t,e){this._allowed&&this._muuri.add(t,e)},e.prototype.remove=function(t,e){this._allowed&&this._muuri.remove(t,e)},e}(function(){function t(t){this._allowed=t}return t.prototype.startCore=function(t){},t.prototype.stopCore=function(){},t.prototype.updateCore=function(){},Object.defineProperty(t.prototype,"allowed",{get:function(){return this._allowed},enumerable:!1,configurable:!0}),t.prototype.start=function(t){this._allowed&&this.startCore(t)},t.prototype.stop=function(){this._allowed&&this.stopCore()},t.prototype.update=function(){this._allowed&&this.updateCore()},t.prototype.add=function(t,e){},t.prototype.remove=function(t,e){},t.prototype.destroy=function(){this.stop()},t}());i(25);if(document){var b=i(15),w=document.createElement("div");w.style.display="none",w.innerHTML=b,document.head.appendChild(w)}var C=function(t){function e(i,s,o,a){void 0===o&&(o={}),void 0===a&&(a=void 0);var l=t.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(t,e){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(t,e){return l.moveVisibleElement(t,e)},l.showHeader=!0,l.options.survey&&(r.a.currentLocale=l.options.survey.locale),void 0===a&&(l._elements=l.buildElements(i)),l.haveCommercialLicense=e.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(t){(t instanceof d||t instanceof g)&&t.setSelection(void 0)}))}),r.a.getString("resetFilter"))})),l.registerToolbarItem("addElement",(function(t){if(l.allowHideQuestions){var e=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(t){return{value:t.name,text:t.displayName}})),(function(t){return!1}),(function(t){l.showElement(t.target.value)}));e&&t.replaceChild(o,e)||t.appendChild(o),e=o}else e&&t.removeChild(e),e=void 0};i(),l.onVisibleElementsChanged.add(i)}})),l.locales.length>1){var u=l.locales.map((function(t){return{value:t,text:r.a.getString(t)}}));l.registerToolbarItem("changeLocale",(function(){return h.b.createSelector(u,(function(t){return!!t.value&&l.locale===t.value}),(function(t){var e=t.target.value;l.locale=e}))}))}return l}return Object(o.b)(e,t),e.prototype.showElement=function(t){var e=this.getElement(t),i=this._elements.indexOf(e);e.isVisible=!0;var r=this.renderPanelElement(e,this.contentContainer);this.layoutEngine.add([r],{index:i}),this.visibleElementsChanged(e,"ADDED")},e.prototype.hideElement=function(t){var e=this.getElement(t);e.isVisible=!1,e.renderedElement&&(this.layoutEngine.remove([e.renderedElement]),this.contentContainer.removeChild(e.renderedElement),e.renderedElement=void 0),this.visibleElementsChanged(e,"REMOVED")},e.prototype.makeElementPrivate=function(t){t.isPublic=!1,this.onStateChanged.fire(this,this.state),this.onPermissionsChangedCallback&&this.onPermissionsChangedCallback(this)},e.prototype.makeElementPublic=function(t){t.isPublic=!0,this.onStateChanged.fire(this,this.state),this.onPermissionsChangedCallback&&this.onPermissionsChangedCallback(this)},e.prototype.moveVisibleElement=function(t,e){var i,r,n=this.visibleElements[t],s=this.visibleElements[e];i=this._elements.indexOf(n),r=this._elements.indexOf(s),this.moveElement(i,r)},e.prototype.moveElement=function(t,e){var i=this._elements.splice(t,1);this._elements.splice(e,0,i[0]),this.visibleElementsChanged(i[0],"MOVED")},e.prototype.setBackgroundColorCore=function(e){t.prototype.setBackgroundColorCore.call(this,e),this.visualizers.forEach((function(t){return t.backgroundColor=e}))},e.prototype.buildVisualizers=function(t){var e=this;t.forEach((function(t){var i=e.createVisualizer(t);if(e.allowHideQuestions&&i.registerToolbarItem("removeQuestion",(function(){return h.b.createButton((function(){setTimeout((function(){return e.hideElement(t.name)}),0)}),r.a.getString("hideButton"))})),e.allowMakeQuestionsPrivate&&i.registerToolbarItem("makePrivatePublic",(function(){var i=e.getElement(t.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(t){setTimeout((function(){return e.makeElementPublic(i)}),0)}),(function(t){setTimeout((function(){return e.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}),e.setFilter(t.name,i)}}i.onUpdate=function(){return e.layout()},i.onAfterRender.add(e.onAfterRenderQuestionCallback),e.visualizers.push(i)}))},e.prototype.destroyVisualizers=function(){var t=this;this.visualizers.forEach((function(e){e.onUpdate=void 0,e instanceof d&&(e.onDataItemSelected=void 0),e.onAfterRender.remove(t.onAfterRenderQuestionCallback),e.destroy()})),this.visualizers=[]},Object.defineProperty(e.prototype,"locale",{get:function(){var t=this.options.survey;return t?t.locale:r.a.currentLocale},set:function(t){this.setLocale(t),this.refresh(),this.onStateChanged.fire(this,this.state)},enumerable:!1,configurable:!0}),e.prototype.setLocale=function(t){var e=this,i=this.options.survey;i&&(i.locale=t,(this.questions||[]).forEach((function(t){var i=e.getElement(t.name);i&&(i.displayName=e.processText(t.title))}))),r.a.currentLocale=t},Object.defineProperty(e.prototype,"allowDynamicLayout",{get:function(){return void 0===this.options.allowDynamicLayout||!0===this.options.allowDynamicLayout},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"allowHideQuestions",{get:function(){return void 0===this.options.allowHideQuestions||!0===this.options.allowHideQuestions},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"allowMakeQuestionsPrivate",{get:function(){return!0===this.options.allowMakeQuestionsPrivate},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"layoutEngine",{get:function(){return this._layoutEngine},enumerable:!1,configurable:!0}),e.prototype.buildElements=function(t){var e=this;return(t||[]).map((function(t){return{name:t.name,displayName:e.processText(t.title),isVisible:!0,isPublic:!0,type:void 0}}))},e.prototype.getElements=function(){return(this._elements||[]).map((function(t){return{name:t.name,displayName:t.displayName,isVisible:t.isVisible,isPublic:t.isPublic,type:t.type}}))},Object.defineProperty(e.prototype,"visibleElements",{get:function(){return this._elements.filter((function(t){return t.isVisible}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hiddenElements",{get:function(){return this._elements.filter((function(t){return!t.isVisible}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"publicElements",{get:function(){return this._elements.filter((function(t){return t.isPublic}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"privateElements",{get:function(){return this._elements.filter((function(t){return!t.isPublic}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"locales",{get:function(){return this.options.survey?this.options.survey.getUsedLocales():[]},enumerable:!1,configurable:!0}),e.prototype.getElement=function(t){return this._elements.filter((function(e){return e.name===t}))[0]},e.prototype.getVisualizer=function(t){return this.visualizers.filter((function(e){return e.question.name===t}))[0]},e.prototype.visibleElementsChanged=function(t,e){this.onVisibleElementsChanged.isEmpty||this.onVisibleElementsChanged.fire(this,{elements:this._elements,changed:t,reason:e}),this.onStateChanged.fire(this,this.state),this.layout()},e.prototype.renderPanelElement=function(t,e){var i=this.getVisualizer(t.name),r=h.b.createElement("div");e.appendChild(r);var n=h.b.createElement("div"),s=h.b.createElement("h3"),o=h.b.createElement("div");return s.innerText=t.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),t.renderedElement=r,r},e.prototype.renderToolbar=function(e){e.className+=" sa-panel__header",t.prototype.renderToolbar.call(this,e)},e.prototype.renderContent=function(t){var e=this;t.className+=" sa-panel__content sa-grid",this.visibleElements.forEach((function(i){e.renderPanelElement(i,t)})),this.layoutEngine.start(t)},e.prototype.destroyContent=function(e){this.layoutEngine.stop(),t.prototype.destroyContent.call(this,e)},e.prototype.refresh=function(){this.toolbarContainer&&(this.destroyToolbar(this.toolbarContainer),this.renderToolbar(this.toolbarContainer)),t.prototype.refresh.call(this)},e.prototype.layout=function(){this.layoutEngine.update()},e.prototype.setFilter=function(t,e){this.dataProvider.setFilter(t,e)},Object.defineProperty(e.prototype,"state",{get:function(){var t=this;return{locale:this.locale,elements:[].concat(this._elements.map((function(e){var i=t.getVisualizer(e.name),r=Object(o.a)(Object(o.a)({},e),null==i?void 0:i.getState());return void 0!==r.renderedElement&&delete r.renderedElement,r})))}},set:function(t){var e=this;if(t){if(Array.isArray(t.elements)){var i=this.questions.map((function(t){return t.name}));this._elements=[].concat(t.elements.filter((function(t){return-1!==i.indexOf(t.name)})))}void 0!==t.locale&&this.setLocale(t.locale),this._elements.forEach((function(t){var i=e.getVisualizer(t.name);void 0!==i&&i.setState(t)})),this.refresh()}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"permissions",{get:function(){return this._elements.map((function(t){return{name:t.name,isPublic:t.isPublic}}))},set:function(t){var e=this._elements.map((function(e){return t.forEach((function(t){t.name===e.name&&(e.isPublic=t.isPublic)})),Object(o.a)({},e)}));this._elements=[].concat(e),this.refresh(),this.onPermissionsChangedCallback&&this.onPermissionsChangedCallback(this)},enumerable:!1,configurable:!0}),e.prototype.destroy=function(){t.prototype.destroy.call(this),this.destroyVisualizers()},e.haveCommercialLicense=!1,e}(u),S=function(t){function e(e,i,r,n){void 0===r&&(r={});var s=t.call(this,e,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)(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"panelDynamic"},enumerable:!1,configurable:!0}),e.prototype.updatePanelVisualizerData=function(){var t=this,e=[];this.data.forEach((function(i){void 0!==i[t.question.name]&&(e=e.concat(i[t.question.name]))})),this._panelVisualizer.updateData(e)},e.prototype.updateData=function(e){t.prototype.updateData.call(this,e),this.updatePanelVisualizerData()},e.prototype.onDataChanged=function(){this.updatePanelVisualizerData(),t.prototype.onDataChanged.call(this)},e.prototype.getQuestions=function(){return this.question.template.questions},e.prototype.destroyContent=function(e){this._panelVisualizer.clear(),t.prototype.destroyContent.call(this,this.contentContainer)},e.prototype.renderContent=function(t){this._panelVisualizer.render(t)},e.prototype.destroy=function(){t.prototype.destroy.call(this),this._panelVisualizer.onAfterRender.remove(this.onAfterRenderPanelCallback)},e}(u);a.registerVisualizer("paneldynamic",S);var T=function(t){function e(e,i,r){return t.call(this,e,i,r)||this}return Object(o.b)(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"matrixDynamic"},enumerable:!1,configurable:!0}),e.prototype.getQuestions=function(){var t=this.question.visibleRows;return 0===t.length?[]:t[0].cells.map((function(t){return t.question}))},e}(S);a.registerVisualizer("matrixdynamic",T);var D=function(t){function e(e,i,r,s){void 0===r&&(r={});var o=t.call(this,e,i,r,s||"matrixDropdown")||this;o._matrixDropdownVisualizer=void 0,o.onPanelAfterRenderCallback=function(){o.afterRender(o.contentContainer)},(r=Object.assign({},r)).dataProvider=void 0,r.allowDynamicLayout=!1,r.seriesValues=e.rows.map((function(t){return t.value})),r.seriesLabels=e.rows.map((function(t){return t.text}));var l=o.getQuestions();if(1==r.seriesValues.length&&l.every((function(t){return n.Helpers.isArraysEqual(t.choices,o.question.choices)}))){var h=a.getVisualizersByType("matrixdropdown-grouped");o._matrixDropdownVisualizer=new h[0](o.question,[],r)}else o._matrixDropdownVisualizer=new C(l,[],r);return o._matrixDropdownVisualizer.onAfterRender.add(o.onPanelAfterRenderCallback),o.updateData(i),o}return Object(o.b)(e,t),Object.defineProperty(e.prototype,"matrixDropdownVisualizer",{get:function(){return this._matrixDropdownVisualizer},enumerable:!1,configurable:!0}),e.prototype.updateDropdownVisualizerData=function(){var t=this,e=[];this.data.forEach((function(i){var r=i[t.question.name];r&&Object.keys(r).forEach((function(t){var i=Object.assign({},r[t]);i[s.seriesMarkerKey]=t,e.push(i)}))})),this._matrixDropdownVisualizer.updateData(e)},e.prototype.updateData=function(e){t.prototype.updateData.call(this,e),this.updateDropdownVisualizerData()},e.prototype.onDataChanged=function(){this.updateDropdownVisualizerData(),t.prototype.onDataChanged.call(this)},e.prototype.getQuestions=function(){var t=this.question;return t.columns.map((function(e){var i=e.templateQuestion;return Array.isArray(i.choices)&&0===i.choices.length&&(i.choices=t.choices),i}))},e.prototype.destroyContent=function(e){this._matrixDropdownVisualizer.clear(),t.prototype.destroyContent.call(this,this.contentContainer)},e.prototype.renderContent=function(t){this._matrixDropdownVisualizer.render(t)},e.prototype.destroy=function(){t.prototype.destroy.call(this),this._matrixDropdownVisualizer.onAfterRender.remove(this.onPanelAfterRenderCallback)},e}(u);a.registerVisualizer("matrixdropdown",D);var A=function(){function t(){}return t.setup=function(t,e){return this.setups[t](e)},t.setupPie=function(e){var i=e.getAnswersData(),r=i.datasets,n=i.labels,s=i.colors,o=(i.texts,i.seriesLabels),a=[],l=o.length>1,h={type:e.chartType,y:l?o:n,text:(l?o:n).map((function(i){return t.getTruncatedLabel(i,e.labelTruncateLength)})),hoverinfo:"x+y",mode:"markers",marker:{}};h.hoverinfo="label+value+percent",h.marker.colors=s,h.textposition="inside","doughnut"===e.chartType&&(h.type="pie",h.hole=.4),l||(h.marker.symbol="circle",h.marker.size=16),r.forEach((function(t,e){a.push(Object.assign({},h,{values:t,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:e.backgroundColor,paper_bgcolor:e.backgroundColor,showlegend:!1};return l&&(u.grid={rows:Math.round(a.length/2),columns:2},u.annotations=[],n.forEach((function(t,e){a[e].domain={column:e%2,row:Math.floor(e/2)},a[e].title={position:"bottom center",text:t}}))),{traces:a,layout:u,hasSeries:l}},t.setupBar=function(e){var i=e.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:e.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(t,i){var r=Object.assign({},c,{x:t,text:o[i],hovertext:u.map((function(t,e){return"".concat(o[i][e],", ").concat(t)}))});if(e.showPercentages){var n=e.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 t.getTruncatedLabel(i,e.labelTruncateLength)+" "}))},xaxis:{rangemode:"nonnegative",automargin:!0},plot_bgcolor:e.backgroundColor,paper_bgcolor:e.backgroundColor,showlegend:!1};return h&&(d.showlegend=!0,"stackedbar"==e.chartType?d.barmode="stack":d.height=30*(n.length+1)*a.length+30+30,n.forEach((function(t,i){l[i].marker.color=void 0,l[i].name=t,"stackedbar"===e.chartType?(l[i].type="bar",l[i].width=.5):l[i].width=(e.showPercentages?.7:.5)/l.length})),l.forEach((function(t,i){var r=e.showPercentages?"%":"";l[i].hovertext=[],u.forEach((function(e,n){l[i].hovertext.push("".concat(t.y[n]," : ").concat(t.name,", ").concat(t.text[n]).concat(r))}))}))),{traces:l,layout:d,hasSeries:h}},t.setupVBar=function(t){var e=t.getAnswersData(),i=e.datasets,r=e.labels,n=e.colors,s=e.texts,o=e.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:t.backgroundColor,paper_bgcolor:t.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(e,i){var n=Object.assign({},u,{x:r,y:t.showPercentages?s[i].map((function(t){return t/100})):e,text:s[i]});if(t.showPercentages){var o=t.showOnlyPercentages?"%{text}%":"%{value} (%{text}%)";n.textposition="inside",n.texttemplate=o,n.width=.9,n.bargap=.1}a.push(n)})),t.showPercentages&&t.showOnlyPercentages&&(h.yaxis={automargin:!0,tickformat:".0%",range:[0,1],ticklen:t.showOnlyPercentages?25:5,tickcolor:"transparent"}),{traces:a,layout:h,hasSeries:l}},t.setupScatter=function(e){var i=e.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 t.getTruncatedLabel(i,e.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(t){var e=Object.assign({},h,{x:t});l.push(e)}));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:e.backgroundColor,paper_bgcolor:e.backgroundColor,showlegend:!1};return a&&(u.showlegend=!0,u.height=void 0,n.forEach((function(t,e){l[e].hoverinfo="x+name",l[e].marker.color=void 0,l[e].name=t}))),{traces:l,layout:u,hasSeries:a}},t.imageExportFormat="png",t.onImageSaving=new n.Event,t.onPlotCreating=new n.Event,t.setups={bar:t.setupBar,vbar:t.setupVBar,stackedbar:t.setupBar,doughnut:t.setupPie,pie:t.setupPie,scatter:t.setupScatter},t.getTruncatedLabel=function(t,e){var i="...".length;return e?-1===e||t.length<=e+i?t:t.substring(0,e)+"...":t},t}(),E=i(7),x=i.n(E),P=function(){function t(t){this.model=t,this._chart=void 0}return t.prototype.patchConfigParameters=function(t,e,i,r){},Object.defineProperty(t.prototype,"chart",{get:function(){return this._chart},enumerable:!1,configurable:!0}),t.prototype.create=function(t){var e=this,i=A.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:x.a.Icons.camera,click:function(t){var i={format:A.imageExportFormat,filename:e.model.question.name};A.onImageSaving.fire(e.model,i),x.a.downloadImage(t,i)}}]};void 0!==k.displayModeBar&&(s.displayModeBar=k.displayModeBar),this.patchConfigParameters(t,i.traces,i.layout,s);var o={traces:i.traces,layout:i.layout,config:s};A.onPlotCreating.fire(this.model,o);var a=x.a.newPlot(t,o.traces,o.layout,o.config);t.on("plotly_click",(function(t){var r;if(t.points.length>0){var s="";if(i.hasSeries){s=t.points[0].data.name;var o=t.points[0].label,a=e.model.getSeriesValues()[e.model.getSeriesLabels().indexOf(o)],l=e.model.getSelectedItemByText(s);h=new n.ItemValue(((r={})[a]=l.value,r),o+": "+l.text);e.model.setSelection(h)}else{s=Array.isArray(t.points[0].customdata)?t.points[0].customdata[0]:t.points[0].customdata;var h=e.model.getSelectedItemByText(s);e.model.setSelection(h)}}}));var l=function(){return t.getElementsByClassName("nsewdrag")[0]};return t.on("plotly_hover",(function(){var t=l();t&&(t.style.cursor="pointer")})),t.on("plotly_unhover",(function(){var t=l();t&&(t.style.cursor="")})),this._chart=a,a},t.prototype.destroy=function(t){x.a.purge(t),this._chart=void 0},t}(),k=function(t){function e(i,r,n,s){void 0===n&&(n={});var o=t.call(this,i,r,n,s)||this;return o.chartTypes=[].concat(e.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 P(o),o}return Object(o.b)(e,t),e.prototype.destroyContent=function(e){this._chartAdapter.destroy(e.children[0]),t.prototype.destroyContent.call(this,e)},e.prototype.renderContent=function(t){var e=this,i=h.b.createElement("div");t.appendChild(i),this._chartAdapter.create(i).then((function(){e.afterRender(e.contentContainer)}))},e.prototype.getData=function(){var e=t.prototype.getData.call(this),i=this.getSeriesValues(),r=this.getValues();if(i.length>1){var n=[];return r.forEach((function(t,r){var s=i.map((function(t,i){return e[i][r]}));n.push(s)})),n}return e},e.types=["bar","pie","doughnut","scatter"],e.displayModeBar=void 0,e}(d);a.registerVisualizer("checkbox",k),a.registerVisualizer("radiogroup",k),a.registerVisualizer("dropdown",k),a.registerVisualizer("imagepicker",k);var O=function(t){function e(i,r,n,s){var o=t.call(this,i,r,n,s)||this;return o.chartTypes=e.types,o.chartType=o.chartTypes[0],o._chartAdapter=new P(o),o}return Object(o.b)(e,t),e.prototype.destroyContent=function(e){this._chartAdapter.destroy(e.children[0]),t.prototype.destroyContent.call(this,e)},e.prototype.renderContent=function(t){var e=this,i=h.b.createElement("div");t.appendChild(i),this._chartAdapter.create(i).then((function(){e.afterRender(e.contentContainer)}))},e.types=["bar","stackedbar","pie","doughnut"],e}(p);a.registerVisualizer("matrix",O);var V=function(t){function e(e){return t.call(this,e)||this}return Object(o.b)(e,t),e.prototype.patchConfigParameters=function(t,e,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?e.forEach((function(t){t.marker.colors=s})):"bar"===this.model.chartType&&e.forEach((function(t){t.marker.color=s}))},e}(P),z=function(t){function e(i,r,n,s){var o=t.call(this,i,r,n,s)||this;return o.chartTypes=e.types,o.chartType=o.chartTypes[0],o._chartAdapter=new V(o),o}return Object(o.b)(e,t),e.prototype.destroyContent=function(e){this._chartAdapter.destroy(e.children[0]),t.prototype.destroyContent.call(this,e)},e.prototype.renderContent=function(t){var e=this,i=h.b.createElement("div");t.appendChild(i),this._chartAdapter.create(i).then((function(){e.afterRender(e.contentContainer)}))},e.types=["pie","bar","doughnut"],e}(f);a.registerVisualizer("boolean",z);var M=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(o.b)(e,t),e.prototype.getQuestionResults=function(){var t=this.question.name;return this.data.map((function(e){return e[t]}))},e.prototype.getEmptyData=function(){var t=this.getValues(),e=[];return e.length=t.length,e.fill(0),e},e.prototype.getData=function(){var t=this,e=this.getQuestionResults(),i=this.getValues(),r=this.getEmptyData();return e.forEach((function(e){t.applyResultToPlotlyData(e,r,i)})),[r]},e.prototype.applyResultToPlotlyData=function(t,e,i){t&&e&&i&&t.forEach((function(t,r,n){var s=i.indexOf(t);e[s]=+e[s]+(n.length-r)}))},e}(k);a.registerVisualizer("ranking",M);var L=function(t){function e(i,r,n,s){var o=t.call(this,i,r,n,s)||this;return o.chartTypes=e.types,o.chartType=o.chartTypes[0],o._chartAdapter=new P(o),o}return Object(o.b)(e,t),e.prototype.destroyContent=function(e){this._chartAdapter.destroy(e.children[0]),t.prototype.destroyContent.call(this,e)},e.prototype.renderContent=function(t){var e=this,i=h.b.createElement("div");t.appendChild(i),this._chartAdapter.create(i).then((function(){e.afterRender(e.contentContainer)}))},e.types=["stackedbar","bar","pie","doughnut"],e}(function(t){function e(e,i,r,n){var s=t.call(this,e,i,r,n||"matrixDropdownGrouped")||this;return s.getAnswersData(),s}return Object(o.b)(e,t),Object.defineProperty(e.prototype,"matrixQuestion",{get:function(){return this.question},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dataName",{get:function(){return this.matrixQuestion.columns.map((function(t){return t.name}))},enumerable:!1,configurable:!0}),e.prototype.getSeriesValues=function(){return this.matrixQuestion.columns.map((function(t){return t.name}))},e.prototype.getSeriesLabels=function(){return this.matrixQuestion.columns.map((function(t){return t.title}))},e.prototype.valuesSource=function(){return this.matrixQuestion.choices},e.prototype.isSupportMissingAnswers=function(){return!1},e.prototype.getData=function(){var t=this.getValues(),e=this.getSeriesValues(),i=this.matrixQuestion.rows.map((function(t){return t.value})),r=this.dataProvider.getData({dataName:e,getValues:function(){return t},getLabels:function(){return t},getSeriesValues:function(){return i},getSeriesLabels:function(){return i}}),n=[];return t.forEach((function(t,i){var s=e.map((function(t,e){return r[e][0][i]}));n.push(s)})),n},e}(d));a.registerVisualizer("matrixdropdown-grouped",L);var B=function(t){function e(i,r,n,s){var o=t.call(this,i,r,n,s)||this;return o.chartTypes=e.types,o.chartType=o.chartTypes[0],o._chartAdapter=new P(o),o}return Object(o.b)(e,t),e.prototype.destroyContent=function(e){this._chartAdapter.destroy(e.children[0]),t.prototype.destroyContent.call(this,e)},e.prototype.renderContent=function(t){var e=this,i=h.b.createElement("div");t.appendChild(i),this._chartAdapter.create(i).then((function(){e.afterRender(e.contentContainer)}))},e.prototype.getData=function(){var e=t.prototype.getData.call(this),i=this.getSeriesValues(),r=this.getValues();if(i.length>1){var n=[];return r.forEach((function(t,r){var s=i.map((function(t,i){return e[i][r]}));n.push(s)})),n}return e},e.types=["vbar","bar","scatter"],e}(m);a.registerVisualizer("date",B),a.registerVisualizer("number",B),a.registerVisualizer("rating",B);var R=function(){function t(t){this.model=t,this._chart=void 0}return Object.defineProperty(t.prototype,"chart",{get:function(){return this._chart},enumerable:!1,configurable:!0}),t.prototype.create=function(t){var e=this.model.question,i=this.model.getData(),n=i[0],s=i[1],o=i[2];if("rating"===e.getType()){var a=e.visibleRateValues;o=a[a.length-1].value,s=a[0].value}var l=this.model.generateColors(o,s,I.stepsCount);I.showAsPercentage&&(n=h.a.toPercentage(n,o),s=h.a.toPercentage(s,o),o=h.a.toPercentage(o,o));var u=[{type:"indicator",mode:"gauge+number",gauge:{axis:{range:[s,o]},shape:this.model.chartType,bgcolor:"white",bar:{color:l[0]}},value:n,text:e.name,domain:{x:[0,1],y:[0,1]}}],c={plot_bgcolor:this.model.backgroundColor,paper_bgcolor:this.model.backgroundColor};"bullet"===this.model.chartType&&(c.height=250,c.width=600);var d={data:u,layout:c,config:{displayModeBar:!1,staticPlot:!0,locale:r.a.currentLocale,responsive:!0}};return A.onPlotCreating.fire(this.model,d),x.a.newPlot(t,d.data,d.layout,d.config)},t.prototype.destroy=function(t){x.a.purge(t),this._chart=void 0},t}(),I=function(t){function e(i,r,n,s){var o=t.call(this,i,r,n,s)||this;return o.chartTypes=e.types,o.chartType=o.chartTypes[0],o._chartAdapter=new R(o),o}return Object(o.b)(e,t),e.prototype.destroyContent=function(e){this._chartAdapter.destroy(e.children[0]),t.prototype.destroyContent.call(this,e)},e.prototype.renderContent=function(t){var e=this,i=h.b.createElement("div");t.appendChild(i),this._chartAdapter.create(i).then((function(){e.afterRender(e.contentContainer)}))},e.types=["gauge","bullet"],e}(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(t){return void 0===t&&(t=""),j[t||"en"]||[]}},q=i(20),H=i.n(q),F=function(){function t(t){this.model=t}return Object.defineProperty(t.prototype,"wordcloud",{get:function(){return this._wordcloud},enumerable:!1,configurable:!0}),t.prototype.create=function(e){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){e.appendChild(s);var a={canvas:s,config:{list:n,weightFactor:t.weightFactor,abortThreshold:t.abortThreshold,drawOutOfBound:t.drawOutOfBound,shrinkToFit:t.shrinkToFit,fontFamily:"Segoe UI Bold, sans-serif",color:function(t,e){return i.model.getRandomColor()},rotateRatio:.5,rotationSteps:2,backgroundColor:this.model.backgroundColor,click:function(t){console.log(t[0]+": "+t[1])}}};return t.onWordcloudCreating.fire(this.model,a),this._wordcloud=H()(a.canvas,a.config),this._wordcloud}e.appendChild(o)},t.prototype.destroy=function(t){this._wordcloud=void 0},t.drawOutOfBound=!1,t.shrinkToFit=!0,t.abortThreshold=void 0,t.weightFactor=20,t.onWordcloudCreating=new n.Event,t}(),G=function(t){function e(e,i,r,n){var s=t.call(this,e,i,r,n||"wordcloud")||this;return s._wordcloudAdapter=new F(s),s}return Object(o.b)(e,t),e.prototype.getData=function(){var t=this,e={},i=[],n=r.a.currentLocale;i=n?N.getStopWords(n):N.getStopWords();var s=function(t){(t=""+t).length>15&&(t=t.substring(0,14)+"..."),t&&t.split(" ").forEach((function(t){(t=function(t){return-1!==i.indexOf(t)?"":t}(t.toLowerCase()||""))&&(e[t]?e[t]++:e[t]=1)}))};return this.data.forEach((function(e){var i=e[t.question.name];i&&(Array.isArray(i)?i.forEach(s):"object"==typeof i?Object.keys(i).forEach((function(t){return s(i[t])})):s(i))})),Object.keys(e).map((function(t){return[t,e[t]]}))},e.prototype.destroyContent=function(e){this._wordcloudAdapter.destroy(e),t.prototype.destroyContent.call(this,e)},e.prototype.renderContent=function(t){this._wordcloudAdapter.create(t),this.afterRender(this.contentContainer)},e.prototype.destroy=function(){this._wordcloudAdapter.destroy(this.contentContainer),t.prototype.destroy.call(this)},e}(u);a.registerVisualizer("text",G),a.registerVisualizer("comment",G),a.registerVisualizer("multipletext",G);i(26);var X=function(){function t(t){this.model=t}return t.prototype.create=function(t){var e=this.model.getData(),i=e.columnsCount,n=e.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,t.appendChild(o),n.forEach((function(t){for(var e=h.b.createElement("tr"),r=0;r<i;r++){var n=h.b.createElement("td","sa-text-table__cell",{textContent:t[r]});e.appendChild(n)}o.appendChild(e)})),t.className="sa-text-table__container",t.appendChild(o)}else t.appendChild(s)},t.prototype.destroy=function(t){t.innerHTML=""},t}(),Y=function(t){function e(e,i,r,n){var s=t.call(this,e,i,r,n||"text")||this;return s._textTableAdapter=new X(s),s}return Object(o.b)(e,t),e.prototype.getData=function(){var t=this,e=[],i=0;return this.data.forEach((function(r){var n=r[t.question.name],s=[];n&&(Array.isArray(n)?s.concat(n):"object"==typeof n?Object.keys(n).forEach((function(t){return s.push(n[t])})):s.push(n),e.push(s),s.length>i&&(i=s.length))})),{columnsCount:i,data:e}},e.prototype.destroyContent=function(e){this._textTableAdapter.destroy(e),t.prototype.destroyContent.call(this,e)},e.prototype.renderContent=function(t){this._textTableAdapter.create(t),this.afterRender(this.contentContainer)},e.prototype.destroy=function(){this._textTableAdapter.destroy(this.contentContainer),t.prototype.destroy.call(this)},e}(u);a.registerVisualizer("text",Y),a.registerVisualizer("comment",Y),a.registerVisualizer("multipletext",Y);i(27);var Q=function(){function t(t){this.model=t}return t.prototype.create=function(t){var e=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=e.model.backgroundColor,t.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(t,e){var i=h.b.createElement("tr"),r=h.b.createElement("td","sa-choices-table__cell",{textContent:s[e]});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][e]+"%",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][e]+"%"});i.appendChild(d);var p=h.b.createElement("td","sa-choices-table__cell sa-choices-table__cell-value",{textContent:t});i.appendChild(p),a.appendChild(i)})),t.className="sa-choices-table__container",t.appendChild(a)})):t.appendChild(a)},t.prototype.destroy=function(t){t.innerHTML=""},t}(),U=function(t){function e(e,i,r,n){var s=t.call(this,e,i,r,n||"choices")||this;return s._choicesTableAdapter=new Q(s),s.answersOrder="asc",s.showPercentages=!0,s}return Object(o.b)(e,t),e.prototype.destroyContent=function(e){this._choicesTableAdapter.destroy(e),t.prototype.destroyContent.call(this,e)},e.prototype.renderContent=function(t){this._choicesTableAdapter.create(t),this.afterRender(this.contentContainer)},e.prototype.destroy=function(){this._choicesTableAdapter.destroy(this.contentContainer),t.prototype.destroy.call(this)},e}(d)}])}));
|
|
23
|
+
t.exports=function(){"use strict";var t={};function e(){this._events={},this._queue=[],this._counter=0,this._isDestroyed=!1}e.prototype.on=function(t,e){if(this._isDestroyed)return this;var i=this._events[t];return i||(i=this._events[t]=[]),i.push(e),this},e.prototype.off=function(t,e){if(this._isDestroyed)return this;var i=this._events[t];if(!i||!i.length)return this;if(!e)return i.length=0,this;for(var r=i.length;r--;)e===i[r]&&i.splice(r,1);return this},e.prototype.emit=function(t,e,i,r){if(this._isDestroyed)return this;var n=this._events[t];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](e):2===l?o[s](e,i):o[s](e,i,r),this._isDestroyed)return this;return--this._counter,this._counter||(o.length=0),this},e.prototype.destroy=function(){if(this._isDestroyed)return this;var t,e=this._events;for(t in this._isDestroyed=!0,this._queue.length=this._counter=0,e)e[t]&&(e[t].length=0,e[t]=void 0);return this};var i="transform",r="transform",n=window.document.documentElement.style,s=!1;["","Webkit","Moz","O","ms"].forEach((function(t){if(!s){var e=t?t+"Transform":"transform";void 0!==n[e]&&(t=t.toLowerCase(),i=t?"-"+t+"-transform":"transform",r=e,s=!0)}}));var o="function"==typeof WeakMap?new WeakMap:null;function a(t,e){var r=o&&o.get(t);return r||(r=window.getComputedStyle(t,null),o&&o.set(t,r)),r.getPropertyValue("transform"===e?i:e)}var l=/([A-Z])/g;function h(t){return t.replace(l,"-$1").toLowerCase()}function u(t){return"function"==typeof t}function c(t,e){for(var i in e)t.style["transform"===i?r:i]=e[i]}function d(t){this._element=t,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(t,e,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 e)if(++h,-1===(l=n.indexOf(d))||e[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,e)n.push(d),s.push(e[d]);var p=this._keyframes;p[0]=t,p[1]=e;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,e)}}},d.prototype.stop=function(t){if(!this._isDestroyed&&this._animation){var e,i,n,s=this._element,o=this._props,l=this._values;if(t)c(s,t);else for(n=0;n<o.length;n++)i=a(s,h(e=o[n])),s.style["transform"===e?r:e]=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 t=this._callback;this._animation=this._callback=null,this._props.length=this._values.length=0,t&&t()};var p=["","webkit","moz","ms","o","Webkit","Moz","MS","O"];function f(t,e){for(var i,r,n=e[0].toUpperCase()+e.slice(1),s=0;s<p.length;){if((r=(i=p[s])?i+n:e)in t)return r;++s}return null}var m=(window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame||function(t){return this.setTimeout((function(){t(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(t){}var y="start",v="move",b="end",w="cancel",C=!(!("ontouchstart"in window)&&!window.TouchEvent),S=!!window.PointerEvent,T=!!window.navigator.msPointerEnabled,D=/(android)/i.test(window.navigator.userAgent),A=!!g&&{passive:!0},E=f(window.document.documentElement.style,"touchAction");function x(t,i){this._element=t,this._emitter=new e,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"),t.addEventListener("dragstart",x._preventDefault,!1),t.addEventListener(x._events.start,this._preStartCheck,A),!C||S||T||t.addEventListener(x._mouseEvents.start,this._preStartCheck,A)}function P(){this._nextStep=null,this._queue=[],this._reads={},this._writes={},this._batch=[],this._batchReads={},this._batchWrites={},this._step=this._step.bind(this)}x._pointerEvents={start:"pointerdown",move:"pointermove",cancel:"pointercancel",end:"pointerup"},x._msPointerEvents={start:"MSPointerDown",move:"MSPointerMove",cancel:"MSPointerCancel",end:"MSPointerUp"},x._touchEvents={start:"touchstart",move:"touchmove",cancel:"touchcancel",end:"touchend"},x._mouseEvents={start:"mousedown",move:"mousemove",cancel:"",end:"mouseup"},x._events=S?x._pointerEvents:T?x._msPointerEvents:C?x._touchEvents:x._mouseEvents,x._emitter=new e,x._activeInstances=[],x._preventDefault=function(t){t.preventDefault&&!1!==t.cancelable&&t.preventDefault()},x._activateInstance=function(t){x._activeInstances.indexOf(t)>-1||(x._activeInstances.push(t),x._emitter.on(v,t._onMove),x._emitter.on(w,t._onCancel),x._emitter.on(b,t._onEnd),1===x._activeInstances.length&&x._bindListeners())},x._deactivateInstance=function(t){var e=x._activeInstances.indexOf(t);-1!==e&&(x._activeInstances.splice(e,1),x._emitter.off(v,t._onMove),x._emitter.off(w,t._onCancel),x._emitter.off(b,t._onEnd),x._activeInstances.length||x._unbindListeners())},x._bindListeners=function(){var t=x._events;window.addEventListener(t.move,x._onMove,A),window.addEventListener(t.end,x._onEnd,A),t.cancel&&window.addEventListener(t.cancel,x._onCancel,A)},x._unbindListeners=function(){var t=x._events;window.removeEventListener(t.move,x._onMove,A),window.removeEventListener(t.end,x._onEnd,A),t.cancel&&window.removeEventListener(t.cancel,x._onCancel,A)},x._getEventPointerId=function(t){return"number"==typeof t.pointerId?t.pointerId:t.changedTouches?t.changedTouches[0]?t.changedTouches[0].identifier:null:1},x._getTouchById=function(t,e){if("number"==typeof t.pointerId)return t.pointerId===e?t:null;if(t.changedTouches){for(var i=0;i<t.changedTouches.length;i++)if(t.changedTouches[i].identifier===e)return t.changedTouches[i];return null}return t},x._onMove=function(t){x._emitter.emit(v,t)},x._onCancel=function(t){x._emitter.emit(w,t)},x._onEnd=function(t){x._emitter.emit(b,t)},x.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(x._touchEvents.start,this._abortNonCancelable,A),x._deactivateInstance(this))},x.prototype._createEvent=function(t,e){var i=this._getTrackedTouch(e);return{type:t,srcEvent:e,distance:this.getDistance(),deltaX:this.getDeltaX(),deltaY:this.getDeltaY(),deltaTime:t===y?0:this.getDeltaTime(),isFirst:t===y,isFinal:t===b||t===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}},x.prototype._emit=function(t,e){this._emitter.emit(t,this._createEvent(t,e))},x.prototype._getTrackedTouch=function(t){return null===this._pointerId?null:x._getTouchById(t,this._pointerId)},x.prototype._preStartCheck=function(t){this._isDestroyed||this.isDragging()||D&&!1===t.cancelable||t.button||(this._pointerId=x._getEventPointerId(t),null!==this._pointerId&&(this._startEvent=t,C&&(S||T)?(D&&this._element.addEventListener(x._touchEvents.start,this._abortNonCancelable,A),m(this._onStart)):this._onStart()))},x.prototype._abortNonCancelable=function(t){this._element.removeEventListener(x._touchEvents.start,this._abortNonCancelable,A),this._startEvent&&!1===t.cancelable&&(this._pointerId=null,this._startEvent=null)},x.prototype._onStart=function(){var t=this._startEvent;if(t){this._startEvent=null;var e=this._getTrackedTouch(t);e&&(this._startX=this._currentX=e.clientX,this._startY=this._currentY=e.clientY,this._startTime=Date.now(),this._emit(y,t),x._activateInstance(this))}},x.prototype._onMove=function(t){var e=this._getTrackedTouch(t);e&&(this._currentX=e.clientX,this._currentY=e.clientY,this._emit(v,t))},x.prototype._onCancel=function(t){this._getTrackedTouch(t)&&(this._emit(w,t),this._reset())},x.prototype._onEnd=function(t){this._getTrackedTouch(t)&&(this._emit(b,t),this._reset())},x.prototype.isDragging=function(){return null!==this._pointerId},x.prototype.setTouchAction=function(t){this._touchAction=t,E&&(this._cssProps[E]="",this._element.style[E]=t),C&&(this._element.removeEventListener(x._touchEvents.start,x._preventDefault,!1),this._element.style[E]!==t&&this._element.addEventListener(x._touchEvents.start,x._preventDefault,!1))},x.prototype.setCssProps=function(t){if(t){var e,i,r=this._cssProps,n=this._element;for(e in r)n.style[e]=r[e],delete r[e];for(e in t)t[e]&&("touchAction"!==e?(i=f(n.style,e))&&(r[i]="",n.style[i]=t[e]):this.setTouchAction(t[e]))}},x.prototype.getDeltaX=function(){return this._currentX-this._startX},x.prototype.getDeltaY=function(){return this._currentY-this._startY},x.prototype.getDistance=function(){var t=this.getDeltaX(),e=this.getDeltaY();return Math.sqrt(t*t+e*e)},x.prototype.getDeltaTime=function(){return this._startTime?Date.now()-this._startTime:0},x.prototype.on=function(t,e){this._emitter.on(t,e)},x.prototype.off=function(t,e){this._emitter.off(eventName,e)},x.prototype.destroy=function(){if(!this._isDestroyed){var t=this._element,e=x._events;for(var i in this._reset(),this._emitter.destroy(),t.removeEventListener(e.start,this._preStartCheck,A),t.removeEventListener(x._mouseEvents.start,this._preStartCheck,A),t.removeEventListener("dragstart",x._preventDefault,!1),t.removeEventListener(x._touchEvents.start,x._preventDefault,!1),this._cssProps)t.style[i]=this._cssProps[i],delete this._cssProps[i];this._element=null,this._isDestroyed=!0}},P.prototype.add=function(t,e,i,r){var n=this._queue.indexOf(t);n>-1&&(this._queue[n]=void 0),r?this._queue.unshift(t):this._queue.push(t),this._reads[t]=e,this._writes[t]=i,this._nextStep||(this._nextStep=m(this._step))},P.prototype.cancel=function(t){var e=this._queue.indexOf(t);e>-1&&(this._queue[e]=void 0,delete this._reads[t],delete this._writes[t])},P.prototype._step=function(){var t,e,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,e=0;e<l;e++)(t=i[e])&&(s.push(t),o[t]=r[t],delete r[t],a[t]=n[t],delete n[t]);for(i.length=0,e=0;e<l;e++)o[t=s[e]]&&(o[t](),delete o[t]);for(e=0;e<l;e++)a[t=s[e]]&&(a[t](),delete a[t]);s.length=0,!this._nextStep&&i.length&&(this._nextStep=m(this._step))};var k=new P;function O(t){return k.cancel(t+"visibility")}function V(t){return k.cancel(t+"move")}function z(t){return k.cancel(t+"scroll")}function M(t){return k.cancel(t+"placeholder")}var L=window.Element.prototype,B=L.matches||L.matchesSelector||L.webkitMatchesSelector||L.mozMatchesSelector||L.msMatchesSelector||L.oMatchesSelector||function(){return!1};function R(t,e){return B.call(t,e)}function I(t,e){t.classList?t.classList.add(e):R(t,"."+e)||(t.className+=" "+e)}var j=[];function N(t,e,i){var r="number"==typeof i?i:-1;r<0&&(r=t.length-r+1),t.splice.apply(t,j.concat(r,0,e)),j.length=0}function q(t,e,i){var r=t.length,n=Math.max(0,i?r:r-1);return e>n?n:e<0?Math.max(n+e+1,0):e}function H(t,e,i){if(!(t.length<2)){var r=q(t,e),n=q(t,i);r!==n&&t.splice(n,0,t.splice(r,1)[0])}}function F(t,e,i){if(!(t.length<2)){var r,n=q(t,e),s=q(t,i);n!==s&&(r=t[n],t[n]=t[s],t[s]=r)}}var G=0;function X(t,e){var i,r=++G+"debounce";return e>0?function(n){void 0!==i&&(i=window.clearTimeout(i),k.cancel(r),"finish"===n&&t()),"cancel"!==n&&"finish"!==n&&(i=window.setTimeout((function(){i=void 0,k.add(r,t,null,!0)}),e))}:function(e){"cancel"!==e&&t()}}function Y(t){var e=a(t,"transform");if(!e||"none"===e)return!1;var i=a(t,"display");return"inline"!==i&&"none"!==i}function Q(t,e){for(var i=window.document,r=(e?t:t.parentElement)||i;r&&r!==i&&"static"===a(r,"position")&&!Y(r);)r=r.parentElement||i;return r}function U(t,e){return parseFloat(a(t,e))||0}var W={},K={},Z={};function J(t,e){var i,r=e||{};return r.left=0,r.top=0,t===document||(r.left=window.pageXOffset||0,r.top=window.pageYOffset||0,t.self===window.self||(i=t.getBoundingClientRect(),r.left+=i.left,r.top+=i.top,r.left+=U(t,"border-left-width"),r.top+=U(t,"border-top-width"))),r}function $(t,e,i){return Z.left=0,Z.top=0,t===e||i&&(t=Q(t,!0))===(e=Q(e,!0))||(J(t,W),J(e,K),Z.left=K.left-W.left,Z.top=K.top-W.top),Z}function tt(t){var e=a(t,"overflow");return"auto"===e||"scroll"===e||"auto"===(e=a(t,"overflow-x"))||"scroll"===e||"auto"===(e=a(t,"overflow-y"))||"scroll"===e}function et(t,e,i){for(var r=i||[],n=e?t:t.parentNode;n&&n!==document;)n.getRootNode&&n instanceof DocumentFragment?n=n.getRootNode().host:(tt(n)&&r.push(n),n=n.parentNode);return r.push(window),r}var it,rt,nt,st,ot={},at=/^matrix3d/,lt=/([^,]*,){4}/,ht=/([^,]*,){12}/,ut=/[^,]*,/;function ct(t){ot.x=0,ot.y=0;var e=a(t,"transform");if(!e||"none"===e)return ot;var i=at.test(e),r=e.replace(i?ht:lt,""),n=r.replace(ut,"");return ot.x=parseFloat(r)||0,ot.y=parseFloat(n)||0,ot}function dt(t,e){return"translateX("+t+"px) translateY("+e+"px)"}function pt(t,e){t.classList?t.classList.remove(e):R(t,"."+e)&&(t.className=(" "+t.className+" ").replace(" "+e+" "," ").trim())}function ft(t){var e=t._element,i=t.getGrid(),r=i._settings;this._item=t,this._gridId=i._id,this._isDestroyed=!1,this._isMigrating=!1,this._startPredicate=u(r.dragStartPredicate)?r.dragStartPredicate:ft.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 x(e,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 mt(t,e){return t.left+t.width<=e.left||e.left+e.width<=t.left||t.top+t.height<=e.top||e.top+e.height<=t.top?0:(Math.min(t.left+t.width,e.left+e.width)-Math.max(t.left,e.left))*(Math.min(t.top+t.height,e.top+e.height)-Math.max(t.top,e.top))/(Math.min(t.width,e.width)*Math.min(t.height,e.height))*100}function gt(t){this._item=t,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 _t(){this._queue=[],this._isDestroyed=!1}function yt(t){this._item=t,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 _t,this._setupAnimation=this._setupAnimation.bind(this),this._startAnimation=this._startAnimation.bind(this)}ft.defaultStartPredicate=function(t,e,i){var r=t._drag,n=r._startPredicateData||r._setupStartPredicate(i);if(!e.isFinal)return!(!n.handleElement&&(n.handleElement=r._getStartPredicateHandle(e),!n.handleElement))&&(n.delay&&(n.event=e,n.delayTimer||(n.delayTimer=window.setTimeout((function(){n.delay=0,r._resolveStartPredicate(n.event)&&(r._forceResolveStartPredicate(n.event),r._resetStartPredicate())}),n.delay))),r._resolveStartPredicate(e));r._finishStartPredicate(e)},ft.defaultSortPredicate=(it={},rt={},nt={},st=[],function(t,e){var i=t._drag,r=i._getGrid(),n=e&&"number"==typeof e.threshold?e.threshold:50,s=e&&"swap"===e.action?"swap":"move";it.width=t._width,it.height=t._height,it.left=i._elementClientX,it.top=i._elementClientY;var o=function(t,e,i){var r,n,s,o,a=null,l=e._settings.dragSort,h=-1;if(!0===l?(st[0]=e,n=st):n=l.call(e,t),!Array.isArray(n))return a;for(o=0;o<n.length;o++)(s=n[o])._isDestroyed||(s._updateBoundingRect(),rt.width=s._width,rt.height=s._height,rt.left=s._left,rt.top=s._top,(r=mt(it,rt))>i&&r>h&&(h=r,a=s));return st.length=0,a}(t,r,n);if(!o)return!1;var a,l,h,u,c,d=0,p=0,f=-1;for(o===r?(it.left=i._gridX+t._marginLeft,it.top=i._gridY+t._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!==t&&(l=!0,rt.width=h._width,rt.height=h._height,rt.left=h._left+h._marginLeft+d,rt.top=h._top+h._marginTop+p,(u=mt(it,rt))>f&&(a=c,f=u));return f<n&&t.getGrid()!==o&&(a=l?-1:0,f=1/0),f>=n&&(nt.grid=o,nt.index=a,nt.action=s,nt)}),ft.prototype.stop=function(){var t=this._item,e=t._element,i=this._getGrid();return this._isActive?this._isMigrating?(this._finishMigration(),this):(V(t._id),z(t._id),this._unbindScrollListeners(),this._checkOverlapDebounce("cancel"),e.parentNode!==i._element&&(i._element.appendChild(e),e.style[r]=dt(this._gridX,this._gridY)),pt(e,i._settings.itemDraggingClass),this._reset(),this):this},ft.prototype.destroy=function(){return this._isDestroyed||(this.stop(),this._dragger.destroy(),this._isDestroyed=!0),this},ft.prototype._getGrid=function(){return t[this._gridId]||null},ft.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},ft.prototype._bindScrollListeners=function(){var t,e,i=this._getGrid()._element,r=this._container,n=this._scrollers;if(n.length=0,et(this._item._element,!1,n),r!==i)for(et(i,!0,t=[]),e=0;e<t.length;e++)n.indexOf(t[e])<0&&n.push(t[e]);for(e=0;e<n.length;e++)n[e].addEventListener("scroll",this._onScroll)},ft.prototype._unbindScrollListeners=function(){var t,e=this._scrollers;for(t=0;t<e.length;t++)e[t].removeEventListener("scroll",this._onScroll);e.length=0},ft.prototype._setupStartPredicate=function(t){var e=t||this._getGrid()._settings.dragStartPredicate||0;return this._startPredicateData={distance:Math.abs(e.distance)||0,delay:Math.max(e.delay,0)||0,handle:"string"==typeof e.handle&&e.handle}},ft.prototype._getStartPredicateHandle=function(t){var e=this._startPredicateData,i=this._item._element,r=i;if(!e.handle)return r;for(r=t.target;r&&!R(r,e.handle);)r=r!==i?r.parentElement:null;return r||null},ft.prototype._resolveStartPredicate=function(t){var e=this._startPredicateData;if(!(t.distance<e.distance||e.delay)){var i=e.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&&t.pageX>=r&&t.pageX<r+s&&t.pageY>=n&&t.pageY<n+o}},ft.prototype._forceResolveStartPredicate=function(t){this._isDestroyed||1!==this._startPredicateState||(this._startPredicateState=2,this._onStart(t))},ft.prototype._finishStartPredicate=function(t){var e=this._item._element,i=Math.abs(t.deltaX)<2&&Math.abs(t.deltaY)<2&&t.deltaTime<200;this._resetStartPredicate(),i&&function(t){if("a"===t.tagName.toLowerCase()){var e=t.getAttribute("href");if(e){var i=t.getAttribute("target");i&&"_self"!==i?window.open(e,i):window.location.href=e}}}(e)},ft.prototype._resetHeuristics=function(t){this._hBlockedIndex=null,this._hX1=this._hX2=t.clientX,this._hY1=this._hY2=t.clientY},ft.prototype._checkHeuristics=function(t){var e=this._getGrid()._settings.dragSortHeuristics,i=e.minDragDistance;if(i<=0)return this._hBlockedIndex=null,!0;var r=t.clientX,n=t.clientY,s=r-this._hX2,o=n-this._hY2,a=i>3&&e.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)>e.minBounceBackAngle&&(this._hBlockedIndex=null)}return this._hX1=this._hX2,this._hY1=this._hY2,this._hX2=r,this._hY2=n,!0}return!1},ft.prototype._resetStartPredicate=function(){var t=this._startPredicateData;t&&(t.delayTimer&&(t.delayTimer=window.clearTimeout(t.delayTimer)),this._startPredicateData=null)},ft.prototype._checkOverlap=function(){if(this._isActive){var t,e,i,r,n,s,o,a=this._item,l=this._getGrid()._settings;(t=u(l.dragSortPredicate)?l.dragSortPredicate(a,this._dragEvent):ft.defaultSortPredicate(a,l.dragSortPredicate))&&"number"==typeof t.index&&(o=(e=a.getGrid())!==(r=t.grid||e),i=e._items.indexOf(a),n=q(r._items,t.index,o),s="swap"===t.action?"swap":"move",(o||n!==this._hBlockedIndex)&&(o?(this._hBlockedIndex=null,e._hasListeners("beforeSend")&&e._emit("beforeSend",{item:a,fromGrid:e,fromIndex:i,toGrid:r,toIndex:n}),r._hasListeners("beforeReceive")&&r._emit("beforeReceive",{item:a,fromGrid:e,fromIndex:i,toGrid:r,toIndex:n}),a._gridId=r._id,this._isMigrating=a._gridId!==this._gridId,e._items.splice(i,1),N(r._items,a,n),a._sortData=null,e._hasListeners("send")&&e._emit("send",{item:a,fromGrid:e,fromIndex:i,toGrid:r,toIndex:n}),r._hasListeners("receive")&&r._emit("receive",{item:a,fromGrid:e,fromIndex:i,toGrid:r,toIndex:n}),e.layout(),r.layout()):i!==n&&(this._hBlockedIndex=i,("swap"===s?F:H)(e._items,i,n),e._hasListeners("move")&&e._emit("move",{item:a,fromIndex:i,toIndex:n,action:s}),e.layout())))}},ft.prototype._finishMigration=function(){var t,e,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(),pt(s,d.itemClass),pt(s,d.itemVisibleClass),pt(s,d.itemHiddenClass),I(s,h.itemClass),I(s,o?h.itemVisibleClass:h.itemHiddenClass),u!==p&&(u.appendChild(s),e=$(p,u,!0),(t=ct(s)).x-=e.left,t.y-=e.top),i._refreshDimensions(),i._refreshSortData(),e=$(u,l,!0),n._containerDiffX=e.left,n._containerDiffY=e.top,i._drag=h.dragEnabled?new ft(i):null,u!==p&&(s.style[r]=dt(t.x,t.y)),i._child.removeAttribute("style"),c(i._child,o?h.visibleStyles:h.hiddenStyles),n.start()},ft.prototype._preStartCheck=function(t){0===this._startPredicateState&&(this._startPredicateState=1),1===this._startPredicateState?(this._startPredicateResult=this._startPredicate(this._item,t),!0===this._startPredicateResult?(this._startPredicateState=2,this._onStart(t)):!1===this._startPredicateResult&&(this._startPredicateState=3)):2===this._startPredicateState&&this._isActive&&this._onMove(t)},ft.prototype._preEndCheck=function(t){var e=2===this._startPredicateState;this._startPredicate(this._item,t),this._startPredicateState=0,e&&this._isActive&&this._onEnd(t)},ft.prototype._onStart=function(t){var e=this._item;if(e._isActive){var i,n=e._element,s=this._getGrid(),o=s._settings,a=e._release,l=e._migrate,h=s._element,u=o.dragContainer||h,c=Q(u,!0),d=ct(n),p=d.x,f=d.y,m=n.getBoundingClientRect(),g=u!==h;this._resetHeuristics(t),g&&(i=$(c,h)),e.isPositioning()&&e._layout.stop(!0,{transform:dt(p,f)}),l._isActive&&(p-=l._containerDiffX,f-=l._containerDiffY,l.stop(!0,{transform:dt(p,f)})),e.isReleasing()&&a._reset(),this._isActive=!0,this._dragEvent=t,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&&e._dragPlaceholder.create(),s._emit("dragInit",e,t),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]=dt(this._left,this._top))),I(n,o.itemDraggingClass),this._bindScrollListeners(),s._emit("dragStart",e,t)}},ft.prototype._onMove=function(t){var e=this._item;if(e._isActive){var i,r,n,s=this._getGrid()._settings.dragAxis;if("y"!==s){var o=t.clientX-this._dragEvent.clientX;this._left+=o,this._gridX+=o,this._elementClientX+=o}if("x"!==s){var a=t.clientY-this._dragEvent.clientY;this._top+=a,this._gridY+=a,this._elementClientY+=a}this._dragEvent=t,i=e._id,r=this._prepareMove,n=this._applyMove,k.add(i+"move",r,n,!0)}else this.stop()},ft.prototype._prepareMove=function(){this._item._isActive&&this._getGrid()._settings.dragSort&&this._checkHeuristics(this._dragEvent)&&this._checkOverlapDebounce()},ft.prototype._applyMove=function(){var t=this._item;t._isActive&&(t._element.style[r]=dt(this._left,this._top),this._getGrid()._emit("dragMove",t,this._dragEvent))},ft.prototype._onScroll=function(t){var e,i,r,n=this._item;n._isActive?(this._scrollEvent=t,e=n._id,i=this._prepareScroll,r=this._applyScroll,k.add(e+"scroll",i,r,!0)):this.stop()},ft.prototype._prepareScroll=function(){var t=this._item;if(t._isActive){var e,i=t._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&&(e=$(this._containingBlock,o),this._containerDiffX=e.left,this._containerDiffY=e.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()}},ft.prototype._applyScroll=function(){var t=this._item;t._isActive&&(t._element.style[r]=dt(this._left,this._top),this._getGrid()._emit("dragScroll",t,this._scrollEvent))},ft.prototype._onEnd=function(t){var e=this._item,i=e._element,r=this._getGrid(),n=r._settings,s=e._release;e._isActive?(V(e._id),z(e._id),n.dragSort&&this._checkOverlapDebounce("finish"),this._unbindScrollListeners(),s._containerDiffX=this._containerDiffX,s._containerDiffY=this._containerDiffY,this._reset(),pt(i,n.itemDraggingClass),r._emit("dragEnd",e,t),this._isMigrating?this._finishMigration():s.start()):this.stop()},gt.prototype._onLayoutStart=function(){var t=this._item,e=t.getGrid(),i=e._items.indexOf(t),r=e._layout.slots[2*i],n=e._layout.slots[2*i+1];if(this._didMigrate||t._left!==r||t._top!==n){var s,o,a;if(r+=t._marginLeft,n+=t._marginTop,!(e._settings.dragPlaceholder.duration>0)||this._didMigrate){M(t._id);var l={transform:dt(r,n)};return this._animate.isAnimating()?this._animate.stop(l):c(this._element,l),void(this._didMigrate&&(e.getElement().appendChild(this._element),this._didMigrate=!1))}this._nextLeft=r,this._nextTop=n,s=t._id,o=this._setupAnimation,a=this._startAnimation,k.add(s+"placeholder",o,a)}},gt.prototype._setupAnimation=function(){if(this.isActive()){var t=ct(this._element);this._currentLeft=t.x,this._currentTop=t.y}},gt.prototype._startAnimation=function(){if(this.isActive()){var t=this._animate,e=this._currentLeft,i=this._currentTop,r=this._nextLeft,n=this._nextTop,s={transform:dt(r,n)};if(e!==r||i!==n){var o=this._item.getGrid()._settings.dragPlaceholder,a={transform:dt(e,i)};t.start(a,s,{duration:o.duration,easing:o.easing,onFinish:this._onLayoutEnd})}else t.isAnimating()&&t.stop(s)}},gt.prototype._onLayoutEnd=function(){this._resetAfterLayout&&this.reset()},gt.prototype._onReleaseEnd=function(t){if(t._id===this._item._id){if(!this._animate.isAnimating())return void this.reset();this._resetAfterLayout=!0}},gt.prototype._onMigrate=function(t){if(t.item===this._item){var e=this._item.getGrid(),i=t.toGrid;e.off("dragReleaseEnd",this._onReleaseEnd),e.off("layoutStart",this._onLayoutStart),e.off("beforeSend",this._onMigrate),i.on("dragReleaseEnd",this._onReleaseEnd),i.on("layoutStart",this._onLayoutStart),i.on("beforeSend",this._onMigrate),this._didMigrate=!0}},gt.prototype.create=function(){if(this.isActive())this._resetAfterLayout=!1;else{var t,e=this._item,i=e.getGrid(),r=i._settings,n=this._animate;t=u(r.dragPlaceholder.createElement)?r.dragPlaceholder.createElement(e):window.document.createElement("div"),this._element=t,n._element=t,this._className=r.itemPlaceholderClass||"",this._className&&I(t,this._className);var s=e._left+e._marginLeft,o=e._top+e._marginTop;c(t,{display:"block",position:"absolute",left:"0",top:"0",width:e._width+"px",height:e._height+"px",transform:dt(s,o)}),i.on("layoutStart",this._onLayoutStart),i.on("dragReleaseEnd",this._onReleaseEnd),i.on("beforeSend",this._onMigrate),u(r.dragPlaceholder.onCreate)&&r.dragPlaceholder.onCreate(e,t),i.getElement().appendChild(t)}},gt.prototype.reset=function(){if(this.isActive()){var t=this._element,e=this._item,i=e.getGrid(),r=i._settings,n=this._animate;this._resetAfterLayout=!1,M(e._id),n.stop(),n._element=null,i.off("dragReleaseEnd",this._onReleaseEnd),i.off("layoutStart",this._onLayoutStart),i.off("beforeSend",this._onMigrate),this._className&&(pt(t,this._className),this._className=""),t.parentNode.removeChild(t),this._element=null,u(r.dragPlaceholder.onRemove)&&r.dragPlaceholder.onRemove(e,t)}},gt.prototype.updateDimensions=function(t,e){this.isActive()&&c(this._element,{width:t+"px",height:e+"px"})},gt.prototype.isActive=function(){return!!this._element},gt.prototype.destroy=function(){this.reset(),this._animate.destroy(),this._item=this._animate=null},_t.prototype.add=function(t){return this._isDestroyed||this._queue.push(t),this},_t.prototype.flush=function(t,e){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(t,e),this;for(i=0;i<n&&(o[i](t,e),!this._isDestroyed);i++);return this},_t.prototype.destroy=function(){return this._isDestroyed||(this._isDestroyed=!0,this._queue.length=0),this},yt.prototype.start=function(t,e){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=!t&&!this._skipNextAnimation&&f>0;return d&&this._queue.flush(!0,o),p&&(l._isPositioningStarted=!0),u(e)&&this._queue.add(e),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())}},yt.prototype.stop=function(t,e){if(this._isDestroyed||!this._isActive)return this;var i,r=this._item;return i=r._id,k.cancel(i+"layout"),r._animate.stop(e),pt(r._element,r.getGrid()._settings.itemPositioningClass),this._isActive=!1,t&&this._queue.flush(!0,r),this},yt.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},yt.prototype._updateOffsets=function(){if(!this._isDestroyed){var t=this._item,e=t._migrate,i=t._release;this._offsetLeft=i._isActive?i._containerDiffX:e._isActive?e._containerDiffX:0,this._offsetTop=i._isActive?i._containerDiffY:e._isActive?e._containerDiffY:0}},yt.prototype._updateTargetStyles=function(){this._isDestroyed||(this._targetStyles.transform=dt(this._item._left+this._offsetLeft,this._item._top+this._offsetTop))},yt.prototype._finish=function(){if(!this._isDestroyed){var t=this._item,e=t._migrate,i=t._release;this._isActive&&(this._isActive=!1,pt(t._element,t.getGrid()._settings.itemPositioningClass)),i._isActive&&i.stop(),e._isActive&&e.stop(),this._queue.flush(!1,t)}},yt.prototype._setupAnimation=function(){var t=ct(this._item._element);this._currentLeft=t.x,this._currentTop=t.y},yt.prototype._startAnimation=function(){var t=this._item,e=t.getGrid()._settings;if(this._updateOffsets(),this._updateTargetStyles(),t._left===this._currentLeft-this._offsetLeft&&t._top===this._currentTop-this._offsetTop)return this._isInterrupted&&this.stop(!1,this._targetStyles),this._isActive=!1,void this._finish();this._isInterrupted||I(t._element,e.itemPositioningClass),this._currentStyles.transform=dt(this._currentLeft,this._currentTop),t._animate.start(this._currentStyles,this._targetStyles,this._animateOptions)};var vt={};function bt(t){this._item=t,this._isActive=!1,this._isDestroyed=!1,this._container=!1,this._containerDiffX=0,this._containerDiffY=0}bt.prototype.start=function(t,e,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=t._settings,v=t._element,b=t._items,w=g._items.indexOf(p),C=i||window.document.body;if("number"==typeof e)n=q(b,e,!0);else{if(!(s=t._getItem(e)))return this;n=b.indexOf(s)}return(p.isPositioning()||this._isActive||p.isReleasing())&&(u=(h=ct(f)).x,d=h.y),p.isPositioning()&&p._layout.stop(!0,{transform:dt(u,d)}),this._isActive&&(u-=this._containerDiffX,d-=this._containerDiffY,this.stop(!0,{transform:dt(u,d)})),p.isReleasing()&&(u-=p._release._containerDiffX,d-=p._release._containerDiffY,p._release.stop(!0,{transform:dt(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:t,toIndex:n}),t._hasListeners("beforeReceive")&&t._emit("beforeReceive",{item:p,fromGrid:g,fromIndex:w,toGrid:t,toIndex:n}),pt(f,_.itemClass),pt(f,_.itemVisibleClass),pt(f,_.itemHiddenClass),I(f,y.itemClass),I(f,m?y.itemVisibleClass:y.itemHiddenClass),g._items.splice(w,1),N(b,p,n),p._gridId=t._id,C!==(o=f.parentNode)&&(C.appendChild(f),a=$(C,o,!0),h||(u=(h=ct(f)).x,d=h.y),f.style[r]=dt(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 ft(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:t,toIndex:n}),t._hasListeners("receive")&&t._emit("receive",{item:p,fromGrid:g,fromIndex:w,toGrid:t,toIndex:n}),this},bt.prototype.stop=function(t,e){if(this._isDestroyed||!this._isActive)return this;var i,r=this._item,n=r._element,s=r.getGrid()._element;return this._container!==s&&(e||(t?(i=ct(n),vt.transform=dt(i.x-this._containerDiffX,i.y-this._containerDiffY)):vt.transform=dt(r._left,r._top),e=vt),s.appendChild(n),c(n,e)),this._isActive=!1,this._container=null,this._containerDiffX=0,this._containerDiffY=0,this},bt.prototype.destroy=function(){return this._isDestroyed||(this.stop(!0),this._item=null,this._isDestroyed=!0),this};var wt={};function Ct(t){this._item=t,this._isActive=!1,this._isDestroyed=!1,this._isPositioningStarted=!1,this._containerDiffX=0,this._containerDiffY=0}function St(t){var e=t._isActive,i=t._element,r=t.getGrid()._settings;this._item=t,this._isDestroyed=!1,this._isHidden=!e,this._isHiding=!1,this._isShowing=!1,this._queue=new _t,this._finishShow=this._finishShow.bind(this),this._finishHide=this._finishHide.bind(this),i.style.display=e?"block":"none",I(i,e?r.itemVisibleClass:r.itemHiddenClass),c(t._child,e?r.visibleStyles:r.hiddenStyles)}Ct.prototype.start=function(){if(this._isDestroyed||this._isActive)return this;var t=this._item,e=t.getGrid();return this._isActive=!0,I(t._element,e._settings.itemReleasingClass),e._emit("dragReleaseStart",t),t._layout.start(!1),this},Ct.prototype.stop=function(t,e){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&&(e||(t?(i=ct(n),wt.transform=dt(i.x-this._containerDiffX,i.y-this._containerDiffY)):wt.transform=dt(r._left,r._top),e=wt),o.appendChild(n),c(n,e)),t||s._emit("dragReleaseEnd",r),this},Ct.prototype.destroy=function(){return this._isDestroyed||(this.stop(!0),this._item=null,this._isDestroyed=!0),this},Ct.prototype._reset=function(){if(!this._isDestroyed){var t=this._item;this._isActive=!1,this._isPositioningStarted=!1,this._containerDiffX=0,this._containerDiffY=0,pt(t._element,t.getGrid()._settings.itemReleasingClass)}},St.prototype.show=function(t,e){if(this._isDestroyed)return this;var i=this._item,r=i._element,n=this._queue,s=u(e)?e:null,o=i.getGrid()._settings;return this._isShowing||this._isHidden?this._isShowing&&!t?(s&&n.add(s),this):(this._isShowing||(n.flush(!0,i),pt(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,t,this._finishShow),this):(s&&s(!1,i),this)},St.prototype.hide=function(t,e){if(this._isDestroyed)return this;var i=this._item,r=i._element,n=this._queue,s=u(e)?e:null,o=i.getGrid()._settings;return!this._isHiding&&this._isHidden?(s&&s(!1,i),this):this._isHiding&&!t?(s&&n.add(s),this):(this._isHiding||(n.flush(!0,i),I(r,o.itemHiddenClass),pt(r,o.itemVisibleClass)),s&&n.add(s),this._isHidden=this._isHiding=!0,i._isActive=this._isShowing=!1,this._startAnimation(!1,t,this._finishHide),this)},St.prototype.destroy=function(){if(this._isDestroyed)return this;var t=this._item,e=t._element,i=t.getGrid(),r=this._queue,n=i._settings;return this._stopAnimation({}),r.flush(!0,t).destroy(),pt(e,n.itemVisibleClass),pt(e,n.itemHiddenClass),this._item=null,this._isHiding=this._isShowing=!1,this._isDestroyed=this._isHidden=!0,this},St.prototype._startAnimation=function(t,e,i){if(!this._isDestroyed){var r,n=this._item,s=n.getGrid()._settings,o=t?s.visibleStyles:s.hiddenStyles,l=parseInt(t?s.showDuration:s.hideDuration)||0,u=(t?s.showEasing:s.hideEasing)||"ease",d=e||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(t,e){var i={};for(var r in e)i[r]=a(t,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()}},St.prototype._stopAnimation=function(t){if(!this._isDestroyed){var e=this._item;O(e._id),e._animateChild.stop(t)}},St.prototype._finishShow=function(){this._isHidden||(this._isShowing=!1,this._queue.flush(!1,this._item))};var Tt={};St.prototype._finishHide=function(){if(this._isHidden){var t=this._item;this._isHiding=!1,Tt.transform=dt(0,0),t._layout.stop(!0,Tt),t._element.style.display="none",this._queue.flush(!1,t)}};var Dt,At,Et,xt,Pt=0;function kt(){return++Pt}function Ot(t,e,i){var n=t._settings;this._id=kt(),this._gridId=t._id,this._isDestroyed=!1,this._left=0,this._top=0,this._element=e,this._child=e.children[0],e.parentNode!==t._element&&t._element.appendChild(e),I(e,n.itemClass),"boolean"!=typeof i&&(i="none"!==a(e,"display")),this._isActive=i,e.style.left="0",e.style.top="0",e.style[r]=dt(0,0),this._animate=new d(e),this._animateChild=new d(this._child),this._visibility=new St(this),this._layout=new yt(this),this._migrate=new bt(this),this._release=new Ct(this),this._dragPlaceholder=new gt(this),this._drag=n.dragEnabled?new ft(this):null,this._refreshDimensions(),this._refreshSortData()}function Vt(){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 zt(t){var e=Object.prototype.toString.call(t);return"[object HTMLCollection]"===e||"[object NodeList]"===e}Ot.prototype.getGrid=function(){return t[this._gridId]},Ot.prototype.getElement=function(){return this._element},Ot.prototype.getWidth=function(){return this._width},Ot.prototype.getHeight=function(){return this._height},Ot.prototype.getMargin=function(){return{left:this._marginLeft,right:this._marginRight,top:this._marginTop,bottom:this._marginBottom}},Ot.prototype.getPosition=function(){return{left:this._left,top:this._top}},Ot.prototype.isActive=function(){return this._isActive},Ot.prototype.isVisible=function(){return!!this._visibility&&!this._visibility._isHidden},Ot.prototype.isShowing=function(){return!(!this._visibility||!this._visibility._isShowing)},Ot.prototype.isHiding=function(){return!(!this._visibility||!this._visibility._isHiding)},Ot.prototype.isPositioning=function(){return!(!this._layout||!this._layout._isActive)},Ot.prototype.isDragging=function(){return!(!this._drag||!this._drag._isActive)},Ot.prototype.isReleasing=function(){return!(!this._release||!this._release._isActive)},Ot.prototype.isDestroyed=function(){return this._isDestroyed},Ot.prototype._refreshDimensions=function(){if(!this._isDestroyed&&!this._visibility._isHidden){var t=this._element,e=this._dragPlaceholder,i=t.getBoundingClientRect();this._width=i.width,this._height=i.height,this._marginLeft=Math.max(0,U(t,"margin-left")),this._marginRight=Math.max(0,U(t,"margin-right")),this._marginTop=Math.max(0,U(t,"margin-top")),this._marginBottom=Math.max(0,U(t,"margin-bottom")),e&&e.updateDimensions(this._width,this._height)}},Ot.prototype._refreshSortData=function(){if(!this._isDestroyed){var t,e=this._sortData={},i=this.getGrid()._settings.sortData;for(t in i)e[t]=i[t](this,this._element)}},Ot.prototype._destroy=function(t){if(!this._isDestroyed){var e=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(),e.removeAttribute("style"),this._child.removeAttribute("style"),pt(e,r.itemClass),n>-1&&i._items.splice(n,1),t&&e.parentNode.removeChild(e),this._isActive=!1,this._isDestroyed=!0}},Vt.prototype.getLayout=function(t,e,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(e):e,o.height=l?c?Math.round(i):i:0,o.setWidth=l,o.setHeight=!l,o.slots.length=0,d.length=0,!t.length)return o;for(s=0;s<t.length;s++)this._addSlot(t[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},Vt.prototype._addSlot=(xt={},function(t,e,i,r,n){var s,o,a,l,h,u,c=this._layout,d=this._freeSlots,p=this._newSlots;for(p.length=0,xt.left=null,xt.top=null,xt.width=t._width+t._marginLeft+t._marginRight,xt.height=t._height+t._marginTop+t._marginBottom,r&&(xt.width=Math.round(xt.width),xt.height=Math.round(xt.height)),h=0;h<d.length;h++)if((o=d[h])&&(s=this._getRect(o),xt.width<=s.width+.001&&xt.height<=s.height+.001)){xt.left=s.left,xt.top=s.top;break}for(null===xt.left&&(xt.left=e?c.width:0,xt.top=e?0:c.height,i||(l=!0)),!e&&xt.top+xt.height>c.height&&(xt.left>0&&p.push(this._addRect(0,c.height,xt.left,1/0)),xt.left+xt.width<c.width&&p.push(this._addRect(xt.left+xt.width,c.height,c.width-xt.left-xt.width,1/0)),c.height=xt.top+xt.height),e&&xt.left+xt.width>c.width&&(xt.top>0&&p.push(this._addRect(c.width,0,1/0,xt.top)),xt.top+xt.height<c.height&&p.push(this._addRect(c.width,xt.top+xt.height,1/0,c.height-xt.top-xt.height)),c.width=xt.left+xt.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,xt),u=0;u<a.length;u++)o=a[u],(s=this._getRect(o)).width>.49&&s.height>.49&&(!e&&s.top<c.height||e&&s.left<c.width)&&p.push(o);p.length&&this._purgeRects(p).sort(e?this._sortRectsLeftTop:this._sortRectsTopLeft),e?c.width=Math.max(c.width,xt.left+xt.width):c.height=Math.max(c.height,xt.top+xt.height),c.slots.push(xt.left,xt.top),n&&this._slotSizes.push(xt.width,xt.height),this._freeSlots=p,this._newSlots=d}),Vt.prototype._addRect=function(t,e,i,r){var n=++this._rectId,s=this._rectStore;return s[n]=t||0,s[++this._rectId]=e||0,s[++this._rectId]=i||0,s[++this._rectId]=r||0,n},Vt.prototype._getRect=function(t,e){var i=e||this._rectItem,r=this._rectStore;return i.left=r[t]||0,i.top=r[++t]||0,i.width=r[++t]||0,i.height=r[++t]||0,i},Vt.prototype._splitRect=(Et=[],function(t,e){return Et.length=0,this._doRectsOverlap(t,e)?(t.left<e.left&&Et.push(this._addRect(t.left,t.top,e.left-t.left,t.height)),t.left+t.width>e.left+e.width&&Et.push(this._addRect(e.left+e.width,t.top,t.left+t.width-(e.left+e.width),t.height)),t.top<e.top&&Et.push(this._addRect(t.left,t.top,t.width,e.top-t.top)),t.top+t.height>e.top+e.height&&Et.push(this._addRect(t.left,e.top+e.height,t.width,t.top+t.height-(e.top+e.height))),Et):(Et.push(this._addRect(t.left,t.top,t.width,t.height)),Et)}),Vt.prototype._doRectsOverlap=function(t,e){return!(t.left+t.width<=e.left||e.left+e.width<=t.left||t.top+t.height<=e.top||e.top+e.height<=t.top)},Vt.prototype._isRectWithinRect=function(t,e){return t.left>=e.left&&t.top>=e.top&&t.left+t.width<=e.left+e.width&&t.top+t.height<=e.top+e.height},Vt.prototype._purgeRects=(Dt={},At={},function(t){for(var e,i=t.length;i--;)if(e=t.length,t[i])for(this._getRect(t[i],Dt);e--;)if(t[e]&&i!==e&&this._isRectWithinRect(Dt,this._getRect(t[e],At))){t[i]=0;break}return t}),Vt.prototype._sortRectsTopLeft=function(){var t={},e={};return function(i,r){return this._getRect(i,t),this._getRect(r,e),t.top<e.top?-1:t.top>e.top?1:t.left<e.left?-1:t.left>e.left?1:0}}(),Vt.prototype._sortRectsLeftTop=function(){var t={},e={};return function(i,r){return this._getRect(i,t),this._getRect(r,e),t.left<e.left?-1:t.left>e.left?1:t.top<e.top?-1:t.top>e.top?1:0}}();var Mt=Object.prototype.toString;function Lt(t){return"object"==typeof t&&"[object Object]"===Mt.call(t)}function Bt(t){return zt(t)?Array.prototype.slice.call(t):Array.prototype.concat(t)}var Rt=new Vt,It=function(){};function jt(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=jt.defaultOptions,l=r,h=Nt({},a),l&&(h=Nt(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=kt(),t[this._id]=c,this._isDestroyed=!1,this._layout={id:0,items:[],slots:[],setWidth:!1,setHeight:!1,width:0,height:0},this._emitter=new e,I(i,n.containerClass),this._items=[],"string"==typeof(s=n.items)?Bt(i.children).forEach((function(t){("*"===s||R(t,s))&&c._items.push(new Ot(c,t))})):(Array.isArray(s)||zt(s))&&(this._items=Bt(s).map((function(t){return new Ot(c,t)}))),"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 Nt(t,e){var i,r,n,s=Object.keys(e),o=s.length;for(n=0;n<o;n++)i=Lt(e[r=s[n]]),Lt(t[r])&&i?t[r]=Nt(Nt({},t[r]),e[r]):i?t[r]=Nt({},e[r]):Array.isArray(e[r])?t[r]=e[r].slice(0):t[r]=e[r];return t}return jt.Item=Ot,jt.ItemLayout=yt,jt.ItemVisibility=St,jt.ItemMigrate=bt,jt.ItemAnimate=d,jt.ItemDrag=ft,jt.ItemRelease=Ct,jt.ItemDragPlaceholder=gt,jt.Emitter=e,jt.Dragger=x,jt.Packer=Vt,jt.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"},jt.prototype.on=function(t,e){return this._emitter.on(t,e),this},jt.prototype.off=function(t,e){return this._emitter.off(t,e),this},jt.prototype.getElement=function(){return this._element},jt.prototype.getItems=function(t){if(this._isDestroyed||!t&&0!==t)return this._items.slice(0);var e,i,r=[],n=Bt(t);for(i=0;i<n.length;i++)(e=this._getItem(n[i]))&&r.push(e);return r},jt.prototype.refreshItems=function(t){if(this._isDestroyed)return this;var e,i=this.getItems(t);for(e=0;e<i.length;e++)i[e]._refreshDimensions();return this},jt.prototype.refreshSortData=function(t){if(this._isDestroyed)return this;var e,i=this.getItems(t);for(e=0;e<i.length;e++)i[e]._refreshSortData();return this},jt.prototype.synchronize=function(){if(this._isDestroyed)return this;var t,e,i,r=this._element,n=this._items;if(n.length){for(i=0;i<n.length;i++)(e=n[i]._element).parentNode===r&&(t=t||window.document.createDocumentFragment()).appendChild(e);t&&r.appendChild(t)}return this._emit("synchronize"),this},jt.prototype.layout=function(t,e){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(t)?t:e;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===t,p));return this},jt.prototype.add=function(t,e){if(this._isDestroyed||!t)return[];var i=Bt(t);if(!i.length)return i;var r,n,s=e||0,o=s.layout?s.layout:void 0===s.layout,a=this._items,l=!1;for(n=0;n<i.length;n++)r=new Ot(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},jt.prototype.remove=function(t,e){if(this._isDestroyed)return this;var i,r,n=e||0,s=n.layout?n.layout:void 0===n.layout,o=!1,a=this.getItems(),l=this.getItems(t),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},jt.prototype.show=function(t,e){return this._isDestroyed||this._setItemsVisibility(t,!0,e),this},jt.prototype.hide=function(t,e){return this._isDestroyed||this._setItemsVisibility(t,!1,e),this},jt.prototype.filter=function(t,e){if(this._isDestroyed||!this._items.length)return this;var i,r,n=[],s=[],o="string"==typeof t,a=u(t),l=e||0,h=!0===l.instant,c=l.layout?l.layout:void 0===l.layout,d=u(l.onFinish)?l.onFinish:null,p=-1,f=It;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?t(i):R(i._element,t))?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},jt.prototype.sort=function(){var t,e,i,r;function n(t){for(var e={},i=0;i<t.length;i++)e[t[i]._id]=i;return e}function s(t,i){var n=r[t._id],s=r[i._id];return e?s-n:n-s}function o(o,a){for(var l,h,u,c,d=0,p=0;p<t.length;p++)if(l=t[p][0],h=t[p][1],u=(o._sortData?o:o._refreshSortData())._sortData[l],c=(a._sortData?a:a._refreshSortData())._sortData[l],d="desc"===h||!h&&e?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=t(o,a);return e&&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(t=n,e=!!c.descending,i=h.slice(0),r=null,u(t))h.sort(a);else if("string"==typeof t)t=n.trim().split(" ").map((function(t){return t.split(":")})),h.sort(o);else{if(!Array.isArray(t))return this;if(t.length!==h.length)throw new Error("[Muuri] sort reference items do not match with grid items.");for(l=0;l<h.length;l++){if(t.indexOf(h[l])<0)throw new Error("[Muuri] sort reference items do not match with grid items.");h[l]=t[l]}e&&h.reverse()}return this._hasListeners("sort")&&this._emit("sort",h.slice(0),i),d&&this.layout("instant"===d,u(d)?d:void 0),this}}(),jt.prototype.move=function(t,e,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(t),d=this._getItem(e);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},jt.prototype.send=function(t,e,i,r){if(this._isDestroyed||e._isDestroyed||this===e)return this;if(!(t=this._getItem(t)))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 t._migrate.start(e,i,s),t._migrate._isActive&&t._isActive&&(o&&this.layout("instant"===o,u(o)?o:void 0),a&&e.layout("instant"===a,u(a)?a:void 0)),this},jt.prototype.destroy=function(e){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(e);return pt(r,this._settings.containerClass),r.style.height="",r.style.width="",this._emit("destroy"),this._emitter.destroy(),t[this._id]=void 0,this._isDestroyed=!0,this},jt.prototype._getItem=function(t){if(this._isDestroyed||!t&&0!==t)return null;if("number"==typeof t)return this._items[t>-1?t:this._items.length+t]||null;if(t instanceof Ot)return t._gridId===this._id?t:null;for(var e=0;e<this._items.length;e++)if(this._items[e]._element===t)return this._items[e];return null},jt.prototype._updateLayout=function(){var t,e,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(),t=this._width-this._borderLeft-this._borderRight,e=this._height-this._borderTop-this._borderBottom,i=u(s)?s(n.items,t,e):Rt.getLayout(n.items,t,e,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},jt.prototype._emit=function(){this._isDestroyed||this._emitter.emit.apply(this._emitter,arguments)},jt.prototype._hasListeners=function(t){var e=this._emitter._events[t];return!(!e||!e.length)},jt.prototype._updateBoundingRect=function(){var t=this._element.getBoundingClientRect();this._width=t.width,this._height=t.height,this._left=t.left,this._top=t.top},jt.prototype._updateBorders=function(t,e,i,r){var n=this._element;t&&(this._borderLeft=U(n,"border-left-width")),e&&(this._borderRight=U(n,"border-right-width")),i&&(this._borderTop=U(n,"border-top-width")),r&&(this._borderBottom=U(n,"border-bottom-width"))},jt.prototype._refreshDimensions=function(){this._updateBoundingRect(),this._updateBorders(1,1,1,1)},jt.prototype._setItemsVisibility=function(t,e,i){var r,n,s=this,o=this.getItems(t),a=i||0,l=!0===a.instant,h=a.onFinish,c=a.layout?a.layout:void 0===a.layout,d=o.length,p=e?"showStart":"hideStart",f=e?"showEnd":"hideEnd",m=e?"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],(e&&!r._isActive||!e&&r._isActive)&&(g=!0),e&&!r._isActive&&(r._layout._skipNextAnimation=!0),e&&r._visibility._isHidden&&y.push(r),r._visibility[m](l,(function(t,e){t||_.push(e),--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)},jt}()},function(t,e,i){},function(t,e,i){},function(t,e,i){},function(t,e,i){"use strict";i.r(e),i.d(e,"localization",(function(){return r.a})),i.d(e,"surveyStrings",(function(){return r.b})),i.d(e,"DataProvider",(function(){return s})),i.d(e,"NumberModel",(function(){return c})),i.d(e,"SelectBase",(function(){return d})),i.d(e,"Matrix",(function(){return p})),i.d(e,"BooleanModel",(function(){return f})),i.d(e,"HistogramModel",(function(){return m})),i.d(e,"VisualizerBase",(function(){return u})),i.d(e,"VisualizationManager",(function(){return a})),i.d(e,"VisualizationPanel",(function(){return C})),i.d(e,"VisualizationPanelDynamic",(function(){return S})),i.d(e,"VisualizationMatrixDynamic",(function(){return T})),i.d(e,"VisualizationMatrixDropdown",(function(){return D})),i.d(e,"AlternativeVisualizersWrapper",(function(){return g})),i.d(e,"PlotlySetup",(function(){return A})),i.d(e,"PlotlyChartAdapter",(function(){return P})),i.d(e,"SelectBasePlotly",(function(){return k})),i.d(e,"MatrixPlotly",(function(){return O})),i.d(e,"PlotlyBoolChartAdapter",(function(){return V})),i.d(e,"BooleanPlotly",(function(){return z})),i.d(e,"RankingPlotly",(function(){return M})),i.d(e,"MatrixDropdownGroupedPlotly",(function(){return L})),i.d(e,"HistogramPlotly",(function(){return B})),i.d(e,"PlotlyGaugeAdapter",(function(){return R})),i.d(e,"GaugePlotly",(function(){return I})),i.d(e,"WordCloudAdapter",(function(){return F})),i.d(e,"WordCloud",(function(){return G})),i.d(e,"textHelper",(function(){return N})),i.d(e,"TextTableAdapter",(function(){return X})),i.d(e,"Text",(function(){return Y})),i.d(e,"ChoicesTableAdapter",(function(){return Q})),i.d(e,"ChoicesTable",(function(){return U})),i.d(e,"DocumentHelper",(function(){return h.b}));var r=i(1);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";var n=i(3),s=function(){function t(t,e){void 0===t&&(t=[]),void 0===e&&(e=void 0),this._data=t,this._getDataCore=e,this.filterValues={},this.onDataChanged=new n.Event}return t.prototype.getStatisticsCacheKey=function(t){return Array.isArray(t.dataName)?t.dataName.join("-"):t.dataName},t.prototype.reset=function(t){if(t){if(void 0!==this._statisticsCache){var e=this.getStatisticsCacheKey(t);delete this._statisticsCache[e]}}else void 0===this._statisticsCache&&void 0===this._filteredData||(this._statisticsCache=void 0,this._filteredData=void 0,this.raiseDataChanged())},Object.defineProperty(t.prototype,"data",{get:function(){return this._data},set:function(t){this._data=[].concat(t),this.reset()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"filteredData",{get:function(){var e=this;void 0===this._filteredData&&(Object.keys(this.filterValues).length>0?this._filteredData=this.data.filter((function(i){return!Object.keys(e.filterValues).some((function(r){var n=e.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(t,e){var i=Object.keys(t),r=Object.keys(e);if(r.length>i.length)return!1;for(var n=0,s=r;n<s.length;n++){var o=s[n];if(e[o]!=t[o])return!1}return!0}(o,n);var a=i[t.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]!==e.filterValues[r]}))})):this._filteredData=this.data);return this._filteredData},enumerable:!1,configurable:!0}),t.prototype.setFilter=function(t,e){var i=!0;void 0!==e?(i=this.filterValues[t]!==e,this.filterValues[t]=e):(i=void 0!==this.filterValues[t],delete this.filterValues[t]),i&&this.reset()},t.prototype.getDataCore=function(e){if(this._getDataCore)return this._getDataCore(e);var i=Array.isArray(e.dataName)?e.dataName:[e.dataName],r=[],n=e.getValues(),s={};n.forEach((function(t,e){s[t]=e}));var o=-1!==n.indexOf(void 0),a=e.getSeriesValues(),l={};a.forEach((function(t,e){l[t]=e}));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(e){i.forEach((function(i,n){var h=e[i];if(void 0!==h||o){var u=Array.isArray(h)?h:[h];if(a.length>0)if(void 0!==e[t.seriesMarkerKey]){var c=l[e[t.seriesMarkerKey]]||0;u.forEach((function(t){r[n][c][s[t]]++}))}else u.forEach((function(t){a.forEach((function(e){if(void 0!==t[e]){var i=l[e]||0;r[n][i][s[t[e]]]++}}))}));else u.forEach((function(t){return r[0][0][s[t]]++}))}}))})),Array.isArray(e.dataName)?r:r[0]},t.prototype.getData=function(t){var e=this.getStatisticsCacheKey(t);return void 0!==this._statisticsCache&&void 0!==this._statisticsCache[e]||(void 0===this._statisticsCache&&(this._statisticsCache={}),this._statisticsCache[e]=this.getDataCore(t)),[].concat(this._statisticsCache[e])},t.prototype.raiseDataChanged=function(){this.onDataChanged.isEmpty||this.onDataChanged.fire(this,{})},t.seriesMarkerKey="__sa_series_name",t}();var o=i(2),a=function(){function t(){}return t.registerVisualizer=function(e,i){var r=t.vizualizers[e];r||(r=[],t.vizualizers[e]=r),r.push(i)},t.unregisterVisualizer=function(e,i){var r=t.vizualizers[e];if(r){var n=r.indexOf(i);-1!==n&&r.splice(n,1)}},t.unregisterVisualizerForAll=function(e){Object.keys(t.vizualizers).forEach((function(i){return t.unregisterVisualizer(i,e)}))},t.getVisualizersByType=function(e){var i=t.vizualizers[e];return i||[u]},t.getAlternativesVisualizer=function(){return t.alternativesVisualizer||u},t.registerAlternativesVisualizer=function(e){t.alternativesVisualizer=e},t.alternativesVisualizer=void 0,t.vizualizers={},t}(),l=function(){function t(){}return t.createVisualizer=function(t,e,i){var r;r="text"===t.getType()&&t.inputType?t.inputType:t.getType();var n=a.getVisualizersByType(r).map((function(r){return new r(t,e,i)}));return n.length>1?new(a.getAlternativesVisualizer())(n,t,e,i):n[0]},t}(),h=i(0),u=(i(23),function(){function t(t,e,i,r){void 0===i&&(i={});var o=this;this.question=t,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.toolbarItemCreators={},this._backgroundColor="#f7f7f7",this._dataProvider=i.dataProvider||new s(e),this._dataProvider.onDataChanged.add((function(){return o.onDataChanged()})),void 0!==i.labelTruncateLength&&(this.labelTruncateLength=i.labelTruncateLength)}return t.prototype.afterRender=function(t){this.onAfterRender.fire(this,{htmlElement:t})},Object.defineProperty(t.prototype,"questionOptions",{get:function(){return this.options[this.question.name]},enumerable:!1,configurable:!0}),t.prototype.onDataChanged=function(){this.refresh()},Object.defineProperty(t.prototype,"dataName",{get:function(){return this.question.valueName||this.question.name},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hasHeader",{get:function(){return!(!this.options||!this.options.showCorrectAnswers)&&(!!this.question&&!!this.question.correctAnswer)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hasFooter",{get:function(){return!!this.question&&(this.question.hasComment||this.question.hasOther)},enumerable:!1,configurable:!0}),t.prototype.createVisualizer=function(t){var e=Object.assign({},this.options);return void 0===e.dataProvider&&(e.dataProvider=this.dataProvider),l.createVisualizer(t,this.data,e)},Object.defineProperty(t.prototype,"footerVisualizer",{get:function(){var t=this;if(this.hasFooter){if(!this._footerVisualizer){var e=new n.QuestionCommentModel(this.question.name+(n.settings||{}).commentPrefix);e.title=this.processText(this.question.title),this._footerVisualizer=this.createVisualizer(e),this._footerVisualizer.onUpdate=function(){return t.invokeOnUpdate()}}return this._footerVisualizer}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"supportSelection",{get:function(){return(void 0===this.options.allowSelection||this.options.allowSelection)&&this._supportSelection},enumerable:!1,configurable:!0}),t.prototype.getSeriesValues=function(){return this.options.seriesValues||[]},t.prototype.getSeriesLabels=function(){return this.options.seriesLabels||this.getSeriesValues()},t.prototype.getValues=function(){throw new Error("Method not implemented.")},t.prototype.getLabels=function(){return this.getValues()},t.prototype.registerToolbarItem=function(t,e){this.toolbarItemCreators[t]=e},Object.defineProperty(t.prototype,"name",{get:function(){return this._name||"visualizer"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"data",{get:function(){return this.dataProvider.filteredData},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dataProvider",{get:function(){return this._dataProvider},enumerable:!1,configurable:!0}),t.prototype.updateData=function(t){this.options.dataProvider||(this.dataProvider.data=t),this.hasFooter&&this.footerVisualizer.updateData(t)},t.prototype.invokeOnUpdate=function(){this.onUpdate&&this.onUpdate()},t.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)},t.prototype.clear=function(){this.toolbarContainer&&this.destroyToolbar(this.toolbarContainer),this.contentContainer&&this.destroyContent(this.contentContainer),this.footerContainer&&this.destroyFooter(this.footerContainer)},t.prototype.createToolbarItems=function(t){var e=this;Object.keys(this.toolbarItemCreators||{}).forEach((function(i){var r=e.toolbarItemCreators[i](t);r&&t.appendChild(r)}))},t.prototype.getCorrectAnswerText=function(){return this.question?this.question.correctAnswer:""},t.prototype.destroyToolbar=function(t){t.innerHTML=""},t.prototype.renderToolbar=function(t){if(this.showHeader){var e=h.b.createElement("div","sa-toolbar");this.createToolbarItems(e),t.appendChild(e)}},t.prototype.destroyHeader=function(t){this.options&&"function"==typeof this.options.destroyHeader?this.options.destroyHeader(t,this):t.innerHTML=""},t.prototype.destroyContent=function(t){this.options&&"function"==typeof this.options.destroyContent?this.options.destroyContent(t,this):t.innerHTML=""},t.prototype.renderHeader=function(t){if(this.options&&"function"==typeof this.options.renderHeader)this.options.renderHeader(t,this);else{var e=h.b.createElement("div","sa-visualizer__correct-answer");e.innerText=r.a.getString("correctAnswer")+this.getCorrectAnswerText(),t.appendChild(e)}},t.prototype.renderContent=function(t){this.options&&"function"==typeof this.options.renderContent?this.options.renderContent(t,this):t.innerText=r.a.getString("noVisualizerForQuestion"),this.afterRender(t)},t.prototype.destroyFooter=function(t){t.innerHTML=""},t.prototype.renderFooter=function(e){var i=this;if(e.innerHTML="",this.hasFooter){var n=h.b.createElement("h4","sa-visualizer__footer-title",{innerText:r.a.getString("otherCommentTitle")});e.appendChild(n);var s=h.b.createElement("div","sa-visualizer__footer-content");s.style.display=t.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(t.otherCommentCollapsed?"showButton":"hideButton")),i.footerVisualizer.invokeOnUpdate()}),r.a.getString("showButton"));e.appendChild(o),e.appendChild(s),this.footerVisualizer.render(s)}},t.prototype.render=function(t){"string"==typeof t&&(t=document.getElementById(t)),this.renderResult=t,this.toolbarContainer=h.b.createElement("div","sa-visualizer__toolbar"),t.appendChild(this.toolbarContainer),this.renderToolbar(this.toolbarContainer),this.hasHeader&&(this.headerContainer=h.b.createElement("div","sa-visualizer__header"),t.appendChild(this.headerContainer),this.renderHeader(this.headerContainer)),this.contentContainer=h.b.createElement("div","sa-visualizer__content"),t.appendChild(this.contentContainer),this.renderContent(this.contentContainer),this.footerContainer=h.b.createElement("div","sa-visualizer__footer"),t.appendChild(this.footerContainer),this.renderFooter(this.footerContainer)},t.prototype.refresh=function(){var t=this;this.headerContainer&&setTimeout((function(){t.destroyHeader(t.headerContainer),t.renderHeader(t.headerContainer),t.invokeOnUpdate()})),this.contentContainer&&setTimeout((function(){t.destroyContent(t.contentContainer),t.renderContent(t.contentContainer),t.invokeOnUpdate()})),this.footerContainer&&setTimeout((function(){t.destroyFooter(t.footerContainer),t.renderFooter(t.footerContainer),t.invokeOnUpdate()}))},t.prototype.processText=function(t){return!1!==this.options.stripHtmlFromTitles?(t||"").replace(/(<([^>]+)>)/gi,""):t},t.prototype.getRandomColor=function(){var t=this.getColors();return t[Math.floor(Math.random()*t.length)]},Object.defineProperty(t.prototype,"backgroundColor",{get:function(){return this.getBackgroundColorCore()},set:function(t){this.setBackgroundColorCore(t)},enumerable:!1,configurable:!0}),t.prototype.getBackgroundColorCore=function(){return this._backgroundColor},t.prototype.setBackgroundColorCore=function(t){this._backgroundColor=t,this.footerVisualizer&&(this.footerVisualizer.backgroundColor=t)},t.prototype.getColors=function(e){void 0===e&&(e=10);for(var i=Array.isArray(t.customColors)&&t.customColors.length>0?t.customColors:t.colors,r=[],n=0;n<e;n++)r=r.concat(i);return r},Object.defineProperty(t.prototype,"showHeader",{get:function(){return this._showHeader},set:function(t){t!=this._showHeader&&(this._showHeader=t,this.toolbarContainer&&(this.destroyToolbar(this.toolbarContainer),this.renderToolbar(this.toolbarContainer)))},enumerable:!1,configurable:!0}),t.prototype.getData=function(){return this.dataProvider.getData(this)},t.prototype.getState=function(){return{}},t.prototype.setState=function(t){},t.otherCommentCollapsed=!0,t.customColors=[],t.colors=["#86e1fb","#3999fb","#ff6771","#1eb496","#ffc152","#aba1ff","#7d8da5","#4ec46c","#cf37a6","#4e6198"],t}()),c=function(t){function e(e,i,n,s){void 0===n&&(n={});var o=t.call(this,e,i,n,s||"number")||this;return o.registerToolbarItem("changeChartType",(function(){return o.chartTypes.length>1?h.b.createSelector(o.chartTypes.map((function(t){return{value:t,text:r.a.getString("chartType_"+t)}})),(function(t){return o.chartType===t.value}),(function(t){o.setChartType(t.target.value)})):null})),o}return Object(o.b)(e,t),e.prototype.onDataChanged=function(){this._resultAverage=void 0,this._resultMin=void 0,this._resultMax=void 0,t.prototype.onDataChanged.call(this)},e.prototype.onChartTypeChanged=function(){},e.prototype.setChartType=function(t){-1!==this.chartTypes.indexOf(t)&&this.chartType!==t&&(this.chartType=t,this.onChartTypeChanged(),this.contentContainer&&(this.destroyContent(this.contentContainer),this.renderContent(this.contentContainer)),this.invokeOnUpdate())},e.prototype.destroy=function(){this._resultAverage=void 0,this._resultMin=void 0,this._resultMax=void 0,t.prototype.destroy.call(this)},e.prototype.generateText=function(t,i,r){var n=[];if(5===r)n=["very high ("+t+")","high","medium","low","very low ("+i+")"];else{n.push(t);for(var s=0;s<r-2;s++)n.push("");n.push(i)}return e.generateTextsCallback?e.generateTextsCallback(this.question,t,i,r,n):n},e.prototype.generateValues=function(t,e){for(var i=[],r=0;r<e;r++)i.push(t/e);return i.push(t),i},e.prototype.generateColors=function(t,e,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},e.prototype.getData=function(){var t=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 e=0;this.data.forEach((function(i){if(void 0!==i[t.question.name]){var r=+i[t.question.name];e++,t._resultAverage+=r,t._resultMin>r&&(t._resultMin=r),t._resultMax<r&&(t._resultMax=r)}})),e>0&&(this._resultAverage=this._resultAverage/e),this._resultAverage=Math.ceil(100*this._resultAverage)/100}return[this._resultAverage,this._resultMin,this._resultMax]},e.stepsCount=5,e.showAsPercentage=!1,e}(u),d=function(t){function e(i,s,o,a){var l=t.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(e.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(t){return{value:t,text:r.a.getString("chartType_"+t)}})),(function(t){return l.chartType===t.value}),(function(t){l.setChartType(t.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(t){return!1}),(function(t){l.answersOrder=t.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(t){return{text:r.a.getString("topNValueText"+t),value:t}})),(function(t){return!1}),(function(t){l.topN=parseInt(t.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)(e,t),e.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")},e.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")},e.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)},e.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")},e.prototype.updateTopNSelector=function(){this.topNSelector&&(this.topNSelector.getElementsByTagName("select")[0].value=this._topN)},e.prototype.updateMissingAnswersBtn=function(){this.missingAnswersBtn&&(this.missingAnswersBtn.innerText=this._showMissingAnswers?r.a.getString("hideMissingAnswers"):r.a.getString("showMissingAnswers"))},e.prototype.onChartTypeChanged=function(){this.updateOrderSelector(),this.updateShowPercentageBtn(),this.updateEmptyAnswersBtn(),this.updateTopNSelector()},e.prototype.setChartType=function(t){-1!==this.chartTypes.indexOf(t)&&this.chartType!==t&&(this.chartType=t,this.onChartTypeChanged(),this.refreshContent())},e.prototype.getCorrectAnswerText=function(){var e=t.prototype.getCorrectAnswerText.call(this),i=Array.isArray(e)?e:[e],r=this.question;return i.map((function(t){return n.ItemValue.getTextOrHtmlByValue(r.choices,t)})).join(", ")},e.prototype.getSelectedItemByText=function(t){var e=this.question;return this.question.hasOther&&t==e.otherText?e.otherItem:e.choices.filter((function(e){return e.text===t}))[0]},e.prototype.setSelection=function(t){this.selectedItem!==t&&(this.selectedItem=t,void 0!==this.onDataItemSelected&&this.onDataItemSelected(void 0!==t?t.value:void 0,void 0!==t?t.text:""))},Object.defineProperty(e.prototype,"selection",{get:function(){return this.selectedItem},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"showOnlyPercentages",{get:function(){return this._showOnlyPercentages},set:function(t){this._showOnlyPercentages=t,this.refreshContent()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"showPercentages",{get:function(){return this._showPercentages},set:function(t){this._showPercentages=t,this.updateShowPercentageBtn(),this.refreshContent()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"answersOrder",{get:function(){return this._answersOrder},set:function(t){this._answersOrder=t,this.updateOrderSelector(),this.refreshContent()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hideEmptyAnswers",{get:function(){return this._hideEmptyAnswers},set:function(t){this._hideEmptyAnswers=t,this.updateEmptyAnswersBtn(),this.refreshContent()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"transposeData",{get:function(){return this._transposeData},set:function(t){this._transposeData=t,this.updateTransposeDataBtn(),this.refreshContent()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"topN",{get:function(){return this._topN},set:function(t){this._topN=t,this.updateTopNSelector(),this.updateOrderSelector(),this.refreshContent()},enumerable:!1,configurable:!0}),e.prototype.isSupportMissingAnswers=function(){return!0},Object.defineProperty(e.prototype,"showMissingAnswers",{get:function(){return this._showMissingAnswers},set:function(t){this._showMissingAnswers=this.isSupportMissingAnswers()&&t,this.updateMissingAnswersBtn(),this.dataProvider.reset(this),this.refreshContent()},enumerable:!1,configurable:!0}),e.prototype.refreshContent=function(){this.contentContainer&&(this.destroyContent(this.contentContainer),this.renderContent(this.contentContainer)),this.invokeOnUpdate()},Object.defineProperty(e.prototype,"showValuesInOriginalOrder",{get:function(){return!1!==this.options.showValuesInOriginalOrder},enumerable:!1,configurable:!0}),e.prototype.valuesSource=function(){return this.question.activeChoices},e.prototype.getValues=function(){var t=this.valuesSource().map((function(t){return t.value}));return this.question.hasOther&&t.push("other"),this.showMissingAnswers&&t.unshift(void 0),this.showValuesInOriginalOrder?t.reverse():t},e.prototype.getLabels=function(){var t=this;if(this.options.useValuesAsLabels)return this.getValues();var e=this.valuesSource().map((function(e){return n.ItemValue.getTextOrHtmlByValue(t.valuesSource(),e.value)})),i=this.question;return i.hasOther&&e.push(i.otherText),this.showMissingAnswers&&e.unshift(r.a.getString("missingAnswersLabel")),this.showValuesInOriginalOrder?e.reverse():e},e.prototype.getPercentages=function(){var t=this.getData(),e=[],i=this._percentagePrecision;if(t.length<2)t.forEach((function(t,r){var n=t.reduce((function(t,e){return t+e}),0);e[r]=t.map((function(t){var e=i?+(t/n).toFixed(i):Math.round(t/n*1e4);return n&&e/100}))}));else for(var r=0;r<t[0].length;r++){for(var n=0,s=0;s<t.length;s++)n+=t[s][r];for(s=0;s<t.length;s++){Array.isArray(e[s])||(e[s]=[]);var o=i?+(t[s][r]/n*100).toFixed(i):Math.round(t[s][r]/n*100);e[s][r]=n&&o}}return e},e.prototype.hideEmptyAnswersInData=function(t){for(var e={datasets:[[]],labels:[],colors:[],texts:[[]],seriesLabels:t.seriesLabels},i=0;i<t.datasets[0].length;i++)0!=t.datasets[0][i]&&(e.datasets[0].push(t.datasets[0][i]),e.labels.push(t.labels[i]),e.colors.push(t.colors[i]),e.texts[0].push(t.texts[0][i]));return e},e.prototype.answersDataReady=function(t){var e={};return e=this.hideEmptyAnswers?this.hideEmptyAnswersInData(t):t,this.topN>0&&(e.datasets[0]=e.datasets[0].slice(-this.topN),e.labels=e.labels.slice(-this.topN),e.colors=e.colors.slice(-this.topN),e.texts[0]=e.texts[0].slice(-this.topN)),e},e.prototype.getAnswersData=function(){var t=this.getSeriesLabels(),e=this.getData(),i=this.getLabels(),r=this.getColors(),n=this.showPercentages?this.getPercentages():e;if(this.transposeData){e=this.transpose(e),n=this.transpose(n);var s=t;t=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,e[0],"desc"==this.answersOrder),l=h.a.unzipArrays(a.keys);i=l[0],r=l[1],this.showPercentages&&(n[0]=l[2]),e[0]=a.values}var u={datasets:e,labels:i,colors:r,texts:n,seriesLabels:t};return u=this.answersDataReady(u),this.onAnswersDataReady.fire(this,u),u},e.prototype.transpose=function(t){for(var e=t[0].length,i=new Array(e),r=0;r<e;++r)i[r]=new Array(t.length);for(r=0;r<t.length;++r)for(var n=0;n<e;++n)i[n][r]=t[r][n];return i},e.prototype.getState=function(){var t=this,i={};return e._stateProperties.forEach((function(e){i[e]=t[e]})),i},e.prototype.setState=function(t){var i=this;e._stateProperties.forEach((function(e){void 0!==t[e]&&(i[e]=t[e])}))},e.topNValuesDefaults=[-1,5,10,20],e._stateProperties=["chartType","answersOrder","hideEmptyAnswers","topN"],e}(u),p=function(t){function e(e,i,r,n){var s=t.call(this,e,i,r,n||"matrix")||this;return s.getAnswersData(),s}return Object(o.b)(e,t),Object.defineProperty(e.prototype,"matrixQuestion",{get:function(){return this.question},enumerable:!1,configurable:!0}),e.prototype.isSupportMissingAnswers=function(){return!1},e.prototype.getSeriesValues=function(){return this.matrixQuestion.rows.map((function(t){return""+t.value}))},e.prototype.getSeriesLabels=function(){var t=this;return this.matrixQuestion.rows.map((function(e){return n.ItemValue.getTextOrHtmlByValue(t.matrixQuestion.rows,e.value)}))},e.prototype.getSelectedItemByText=function(t){return this.matrixQuestion.columns.filter((function(e){return e.text===t}))[0]},e.prototype.valuesSource=function(){return this.matrixQuestion.columns},e.prototype.getHasAnswersInAllSeriesArray=function(t){for(var e=Array(),i=0;i<t[0].length;i++)for(var r=0;r<t.length;r++)0!=t[r][i]&&(e[i]=!0);return e},e.prototype.getHasAnswersInSeries=function(t){for(var e=0;e<t.length;e++)if(0!=t[e])return!0;return!1},e.prototype.hideEmptyAnswersInData=function(t){for(var e={datasets:[],labels:[],colors:[],texts:[],seriesLabels:[]},i=this.getHasAnswersInAllSeriesArray(t.datasets),r=0;r<t.datasets.length;r++){if(this.getHasAnswersInSeries(t.datasets[r])){e.labels.push(t.labels[r]),e.colors.push(t.colors[r]);for(var n=[],s=[],o=0;o<t.datasets[0].length;o++)i[o]&&(n.push(t.datasets[r][o]),s.push(t.texts[r][o]));e.datasets.push(n),e.texts.push(s)}}for(r=0;r<t.datasets[0].length;r++)i[r]&&e.seriesLabels.push(t.seriesLabels[r]);return e},e.prototype.getData=function(){var e=t.prototype.getData.call(this),i=this.getSeriesValues(),r=this.getValues();if(i.length>1){var n=[];return r.forEach((function(t,r){var s=i.map((function(t,i){return e[i][r]}));n.push(s)})),n}return e},e}(d),f=function(t){function e(e,i,r,n){return t.call(this,e,i,r,n||"boolean")||this}return Object(o.b)(e,t),e.prototype.getCorrectAnswerText=function(){var t=this.booleanQuestion.correctAnswer;return void 0!==this.booleanQuestion.valueTrue&&this.booleanQuestion.valueTrue===t||t?this.booleanQuestion.locLabelTrue.textOrHtml:void 0!==this.booleanQuestion.valueFalse&&this.booleanQuestion.valueFalse===t||!t?this.booleanQuestion.locLabelFalse.textOrHtml:t},Object.defineProperty(e.prototype,"booleanQuestion",{get:function(){return this.question},enumerable:!1,configurable:!0}),e.prototype.getSelectedItemByText=function(t){var e=this.getLabels(),i=this.getValues();return new n.ItemValue(i[e.indexOf(t)],t)},e.prototype.getValues=function(){var t=[void 0===this.booleanQuestion.valueTrue||this.booleanQuestion.valueTrue,void 0!==this.booleanQuestion.valueFalse&&this.booleanQuestion.valueFalse];return this.showMissingAnswers&&t.push(void 0),t},e.prototype.getLabels=function(){var t=[].concat(this.getValues());return void 0!==this.booleanQuestion.labelTrue&&(t[0]=this.booleanQuestion.locLabelTrue.textOrHtml),void 0!==this.booleanQuestion.labelFalse&&(t[1]=this.booleanQuestion.locLabelFalse.textOrHtml),this.showMissingAnswers&&(t[2]=r.a.getString("missingAnswersLabel")),t},e.trueColor="",e.falseColor="",e}(d),m=function(t){function e(e,i,r,n){var s=t.call(this,e,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"!==e.getType()||"date"!==e.inputType&&"datetime"!==e.inputType?s.valueType="number":s.valueType="date",s}return Object(o.b)(e,t),e.prototype.reset=function(){this._continiousData=void 0,this._cachedValues=void 0,this._cachedIntervals=void 0},e.prototype.getContiniousValue=function(t){return"date"===this.valueType?Date.parse(t):parseFloat(t)},e.prototype.getString=function(t){return"date"===this.valueType?new Date(t).toLocaleDateString():""+t},e.prototype.toPrecision=function(t){var e=Math.pow(10,this._intervalPrecision);return Math.round(e*t)/e},e.prototype.getSelectedItemByText=function(t){if(this.hasCustomIntervals||this.getContiniousValues().length>e.UseIntervalsFrom){var i=this.intervals.filter((function(e){return e.label===t}))[0];return new n.ItemValue(i,void 0!==i?i.label:"")}var r=this.getLabels(),s=r.indexOf(t);return new n.ItemValue(this.getValues()[s],r[s])},e.prototype.updateData=function(e){this.reset(),t.prototype.updateData.call(this,e)},e.prototype.onDataChanged=function(){this.reset(),t.prototype.onDataChanged.call(this)},e.prototype.getContiniousValues=function(){var t=this;if(void 0===this._cachedValues){var e=this.getSeriesValues();0===e.length&&e.push(""),this._continiousData={},e.forEach((function(e){return t._continiousData[e]=[]}));var i={};this.data.forEach((function(e){var r=e[t.dataName];if(void 0!==r){var n=e[s.seriesMarkerKey]||"";t._continiousData[n].push(t.getContiniousValue(r)),i[r]=r}})),this._cachedValues=Object.keys(i).map((function(e){return{original:i[e],continious:t.getContiniousValue(e)}})),this._cachedValues.sort((function(t,e){return t.continious-e.continious}))}return this._cachedValues},e.prototype.isSupportMissingAnswers=function(){return!1},Object.defineProperty(e.prototype,"needUseRateValues",{get:function(){return"rating"==this.question.getType()&&Array.isArray(this.question.rateValues)&&this.question.rateValues.length>0},enumerable:!1,configurable:!0}),e.prototype.getValues=function(){var t=this.getContiniousValues();return this.hasCustomIntervals||t.length>e.UseIntervalsFrom||this.needUseRateValues?this.intervals.map((function(t){return t.start})):t.map((function(t){return t.original}))},e.prototype.getLabels=function(){var t=this.getContiniousValues();return this.hasCustomIntervals||t.length>e.UseIntervalsFrom||this.needUseRateValues?this.intervals.map((function(t){return t.label})):t.map((function(t){return""+t.original}))},Object.defineProperty(e.prototype,"hasCustomIntervals",{get:function(){return!!this.questionOptions&&Array.isArray(this.questionOptions.intervals)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"intervals",{get:function(){if(this.hasCustomIntervals)return this.questionOptions.intervals.reverse();if(this.needUseRateValues){var t=this.question.rateValues;return t.map((function(e,i){return{start:e.value,end:i<t.length-1?t[i+1].value:e.value+1,label:e.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=e.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}),e.prototype.getData=function(){var i=this.getContiniousValues();if(!this.hasCustomIntervals&&i.length<=e.UseIntervalsFrom)return t.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(t){return 0}))),this._continiousData[s[o]].forEach((function(t){for(var e=0;e<r.length;++e)if(r[e].start<=t&&(t<r[e].end||e==r.length-1)){n[o][e]++;break}}));return n},e.IntervalsCount=10,e.UseIntervalsFrom=10,e}(d),g=function(t){function e(e,i,n,s){var o=t.call(this,i,n,s)||this;if(o.visualizers=e,o.visualizersWithSelection=[],o.onAfterVisualizerRenderCallback=function(){o.afterRender(o.contentContainer)},!e||e.length<2)throw new Error("VisualizerArrayWrapper works with visualizers collection only.");return o.visualizers.forEach((function(t){t.onUpdate=function(){return o.invokeOnUpdate()},t.supportSelection&&(o._supportSelection=!0,o.visualizersWithSelection.push(t))})),o.registerToolbarItem("changeVisualizer",(function(){return h.b.createSelector(o.visualizers.map((function(t){return{value:t.name,text:r.a.getString("visualizer_"+t.name)}})),(function(t){return o.visualizer.name===t.value}),(function(t){return o.setVisualizer(t.target.value)}))})),o.visualizer=e[0],o.visualizer.onAfterRender.add(o.onAfterVisualizerRenderCallback),o}return Object(o.b)(e,t),Object.defineProperty(e.prototype,"hasFooter",{get:function(){return!1},enumerable:!1,configurable:!0}),e.prototype.getVisualizers=function(){return this.visualizers},e.prototype.setVisualizer=function(t){this.visualizer&&(this.visualizer.onAfterRender.remove(this.onAfterVisualizerRenderCallback),this.visualizer.destroy()),this.visualizer=this.visualizers.filter((function(e){return e.name===t}))[0],this.refresh(),this.visualizer.onAfterRender.add(this.onAfterVisualizerRenderCallback)},e.prototype.updateData=function(e){t.prototype.updateData.call(this,e),this.visualizers.forEach((function(t){t.updateData(e)}))},Object.defineProperty(e.prototype,"onDataItemSelected",{set:function(t){this.visualizersWithSelection.forEach((function(e){e.onDataItemSelected=t}))},enumerable:!1,configurable:!0}),e.prototype.setSelection=function(t){this.visualizersWithSelection.forEach((function(e){e.setSelection(t)}))},Object.defineProperty(e.prototype,"selection",{get:function(){return this.visualizer.selection||this.selectedItem},enumerable:!1,configurable:!0}),e.prototype.renderContent=function(t){this.visualizerContainer=t,this.visualizer.render(this.visualizerContainer)},e.prototype.setBackgroundColorCore=function(e){t.prototype.setBackgroundColorCore.call(this,e),this.visualizers.forEach((function(t){return t.backgroundColor=e}))},e.prototype.destroy=function(){var e=this;this.visualizers.forEach((function(t){t.onAfterRender.remove(e.onAfterVisualizerRenderCallback),t.onUpdate=void 0})),this.visualizer.destroy(),t.prototype.destroy.call(this)},e}(u);a.registerAlternativesVisualizer(g);var _=function(){function t(t){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 e=h.b.createButton((function(){t.setSelection(void 0)}),r.a.getString("clearButton"));this._htmlElement.appendChild(e)}return Object.defineProperty(t.prototype,"htmlElement",{get:function(){return this._htmlElement},enumerable:!1,configurable:!0}),t.prototype.update=function(t){void 0!==t&&void 0!==t.value?(this._htmlElement.style.display="inline-block",this.text.innerText=r.a.getString("filter")+": ["+t.text+"]"):(this._htmlElement.style.display="none",this.text.innerText="")},t}(),y=i(24),v=function(t){function e(e,i){var r=t.call(this,e)||this;return r._selector=i,r._muuri=void 0,r._layoutingTimer=void 0,r}return Object(o.b)(e,t),e.prototype.startCore=function(t){var e=this;this._muuri=new y(t,{dragStartPredicate:{handle:".sa-question__title--draggable"},items:this._selector,dragEnabled:!0}),this._muuri.on("dragReleaseEnd",(function(t){return e.onMoveCallback&&e.onMoveCallback(t.fromIndex,t.toIndex)}))},e.prototype.stopCore=function(){this._muuri.off("dragReleaseEnd"),this._muuri.destroy(),this._muuri=void 0},e.prototype.updateCore=function(){var t=this;void 0!==this._layoutingTimer&&clearTimeout(this._layoutingTimer),this._layoutingTimer=setTimeout((function(){t._layoutingTimer=void 0,t._muuri.refreshItems(),t._muuri.layout()}),10)},e.prototype.add=function(t,e){this._allowed&&this._muuri.add(t,e)},e.prototype.remove=function(t,e){this._allowed&&this._muuri.remove(t,e)},e}(function(){function t(t){this._allowed=t}return t.prototype.startCore=function(t){},t.prototype.stopCore=function(){},t.prototype.updateCore=function(){},Object.defineProperty(t.prototype,"allowed",{get:function(){return this._allowed},enumerable:!1,configurable:!0}),t.prototype.start=function(t){this._allowed&&this.startCore(t)},t.prototype.stop=function(){this._allowed&&this.stopCore()},t.prototype.update=function(){this._allowed&&this.updateCore()},t.prototype.add=function(t,e){},t.prototype.remove=function(t,e){},t.prototype.destroy=function(){this.stop()},t}());i(25);if(document){var b=i(15),w=document.createElement("div");w.style.display="none",w.innerHTML=b,document.head.appendChild(w)}var C=function(t){function e(i,s,o,a){void 0===o&&(o={}),void 0===a&&(a=void 0);var l=t.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(t,e){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(t,e){return l.moveVisibleElement(t,e)},l.showHeader=!0,l.options.survey&&(r.a.currentLocale=l.options.survey.locale),void 0===a&&(l._elements=l.buildElements(i)),l.haveCommercialLicense=e.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(t){(t instanceof d||t instanceof g)&&t.setSelection(void 0)}))}),r.a.getString("resetFilter"))})),l.registerToolbarItem("addElement",(function(t){if(l.allowHideQuestions){var e=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(t){return{value:t.name,text:t.displayName}})),(function(t){return!1}),(function(t){l.showElement(t.target.value)}));e&&t.replaceChild(o,e)||t.appendChild(o),e=o}else e&&t.removeChild(e),e=void 0};i(),l.onVisibleElementsChanged.add(i)}})),l.locales.length>1){var u=l.locales.map((function(t){return{value:t,text:r.a.getString(t)}}));l.registerToolbarItem("changeLocale",(function(){return h.b.createSelector(u,(function(t){return!!t.value&&l.locale===t.value}),(function(t){var e=t.target.value;l.locale=e}))}))}return l}return Object(o.b)(e,t),e.prototype.showElement=function(t){var e=this.getElement(t),i=this._elements.indexOf(e);e.isVisible=!0;var r=this.renderPanelElement(e,this.contentContainer);this.layoutEngine.add([r],{index:i}),this.visibleElementsChanged(e,"ADDED")},e.prototype.hideElement=function(t){var e=this.getElement(t);e.isVisible=!1,e.renderedElement&&(this.layoutEngine.remove([e.renderedElement]),this.contentContainer.removeChild(e.renderedElement),e.renderedElement=void 0),this.visibleElementsChanged(e,"REMOVED")},e.prototype.makeElementPrivate=function(t){t.isPublic=!1,this.onStateChanged.fire(this,this.state),this.onPermissionsChangedCallback&&this.onPermissionsChangedCallback(this)},e.prototype.makeElementPublic=function(t){t.isPublic=!0,this.onStateChanged.fire(this,this.state),this.onPermissionsChangedCallback&&this.onPermissionsChangedCallback(this)},e.prototype.moveVisibleElement=function(t,e){var i,r,n=this.visibleElements[t],s=this.visibleElements[e];i=this._elements.indexOf(n),r=this._elements.indexOf(s),this.moveElement(i,r)},e.prototype.moveElement=function(t,e){var i=this._elements.splice(t,1);this._elements.splice(e,0,i[0]),this.visibleElementsChanged(i[0],"MOVED")},e.prototype.setBackgroundColorCore=function(e){t.prototype.setBackgroundColorCore.call(this,e),this.visualizers.forEach((function(t){return t.backgroundColor=e}))},e.prototype.buildVisualizers=function(t){var e=this;t.forEach((function(t){var i=e.createVisualizer(t);if(e.allowHideQuestions&&i.registerToolbarItem("removeQuestion",(function(){return h.b.createButton((function(){setTimeout((function(){return e.hideElement(t.name)}),0)}),r.a.getString("hideButton"))})),e.allowMakeQuestionsPrivate&&i.registerToolbarItem("makePrivatePublic",(function(){var i=e.getElement(t.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(t){setTimeout((function(){return e.makeElementPublic(i)}),0)}),(function(t){setTimeout((function(){return e.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}),e.setFilter(t.name,i)}}i.onUpdate=function(){return e.layout()},i.onAfterRender.add(e.onAfterRenderQuestionCallback),e.visualizers.push(i)}))},e.prototype.destroyVisualizers=function(){var t=this;this.visualizers.forEach((function(e){e.onUpdate=void 0,e instanceof d&&(e.onDataItemSelected=void 0),e.onAfterRender.remove(t.onAfterRenderQuestionCallback),e.destroy()})),this.visualizers=[]},Object.defineProperty(e.prototype,"locale",{get:function(){var t=this.options.survey;return t?t.locale:r.a.currentLocale},set:function(t){this.setLocale(t),this.refresh(),this.onStateChanged.fire(this,this.state)},enumerable:!1,configurable:!0}),e.prototype.setLocale=function(t){var e=this,i=this.options.survey;i&&(i.locale=t,(this.questions||[]).forEach((function(t){var i=e.getElement(t.name);i&&(i.displayName=e.processText(t.title))}))),r.a.currentLocale=t},Object.defineProperty(e.prototype,"allowDynamicLayout",{get:function(){return void 0===this.options.allowDynamicLayout||!0===this.options.allowDynamicLayout},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"allowHideQuestions",{get:function(){return void 0===this.options.allowHideQuestions||!0===this.options.allowHideQuestions},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"allowMakeQuestionsPrivate",{get:function(){return!0===this.options.allowMakeQuestionsPrivate},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"layoutEngine",{get:function(){return this._layoutEngine},enumerable:!1,configurable:!0}),e.prototype.buildElements=function(t){var e=this;return(t||[]).map((function(t){return{name:t.name,displayName:e.processText(t.title),isVisible:!0,isPublic:!0,type:void 0}}))},e.prototype.getElements=function(){return(this._elements||[]).map((function(t){return{name:t.name,displayName:t.displayName,isVisible:t.isVisible,isPublic:t.isPublic,type:t.type}}))},Object.defineProperty(e.prototype,"visibleElements",{get:function(){return this._elements.filter((function(t){return t.isVisible}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hiddenElements",{get:function(){return this._elements.filter((function(t){return!t.isVisible}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"publicElements",{get:function(){return this._elements.filter((function(t){return t.isPublic}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"privateElements",{get:function(){return this._elements.filter((function(t){return!t.isPublic}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"locales",{get:function(){return this.options.survey?this.options.survey.getUsedLocales():[]},enumerable:!1,configurable:!0}),e.prototype.getElement=function(t){return this._elements.filter((function(e){return e.name===t}))[0]},e.prototype.getVisualizer=function(t){return this.visualizers.filter((function(e){return e.question.name===t}))[0]},e.prototype.visibleElementsChanged=function(t,e){this.onVisibleElementsChanged.isEmpty||this.onVisibleElementsChanged.fire(this,{elements:this._elements,changed:t,reason:e}),this.onStateChanged.fire(this,this.state),this.layout()},e.prototype.renderPanelElement=function(t,e){var i=this.getVisualizer(t.name),r=h.b.createElement("div");e.appendChild(r);var n=h.b.createElement("div"),s=h.b.createElement("h3"),o=h.b.createElement("div");return s.innerText=t.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),t.renderedElement=r,r},e.prototype.renderToolbar=function(e){e.className+=" sa-panel__header",t.prototype.renderToolbar.call(this,e)},e.prototype.renderContent=function(t){var e=this;t.className+=" sa-panel__content sa-grid",this.visibleElements.forEach((function(i){e.renderPanelElement(i,t)})),this.layoutEngine.start(t)},e.prototype.destroyContent=function(e){this.layoutEngine.stop(),t.prototype.destroyContent.call(this,e)},e.prototype.refresh=function(){this.toolbarContainer&&(this.destroyToolbar(this.toolbarContainer),this.renderToolbar(this.toolbarContainer)),t.prototype.refresh.call(this)},e.prototype.layout=function(){this.layoutEngine.update()},e.prototype.setFilter=function(t,e){this.dataProvider.setFilter(t,e)},Object.defineProperty(e.prototype,"state",{get:function(){var t=this;return{locale:this.locale,elements:[].concat(this._elements.map((function(e){var i=t.getVisualizer(e.name),r=Object(o.a)(Object(o.a)({},e),null==i?void 0:i.getState());return void 0!==r.renderedElement&&delete r.renderedElement,r})))}},set:function(t){var e=this;if(t){if(Array.isArray(t.elements)){var i=this.questions.map((function(t){return t.name}));this._elements=[].concat(t.elements.filter((function(t){return-1!==i.indexOf(t.name)})))}void 0!==t.locale&&this.setLocale(t.locale),this._elements.forEach((function(t){var i=e.getVisualizer(t.name);void 0!==i&&i.setState(t)})),this.refresh()}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"permissions",{get:function(){return this._elements.map((function(t){return{name:t.name,isPublic:t.isPublic}}))},set:function(t){var e=this._elements.map((function(e){return t.forEach((function(t){t.name===e.name&&(e.isPublic=t.isPublic)})),Object(o.a)({},e)}));this._elements=[].concat(e),this.refresh(),this.onPermissionsChangedCallback&&this.onPermissionsChangedCallback(this)},enumerable:!1,configurable:!0}),e.prototype.destroy=function(){t.prototype.destroy.call(this),this.destroyVisualizers()},e.haveCommercialLicense=!1,e}(u),S=function(t){function e(e,i,r,n){void 0===r&&(r={});var s=t.call(this,e,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)(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"panelDynamic"},enumerable:!1,configurable:!0}),e.prototype.updatePanelVisualizerData=function(){var t=this,e=[];this.data.forEach((function(i){void 0!==i[t.question.name]&&(e=e.concat(i[t.question.name]))})),this._panelVisualizer.updateData(e)},e.prototype.updateData=function(e){t.prototype.updateData.call(this,e),this.updatePanelVisualizerData()},e.prototype.onDataChanged=function(){this.updatePanelVisualizerData(),t.prototype.onDataChanged.call(this)},e.prototype.getQuestions=function(){return this.question.template.questions},e.prototype.destroyContent=function(e){this._panelVisualizer.clear(),t.prototype.destroyContent.call(this,this.contentContainer)},e.prototype.renderContent=function(t){this._panelVisualizer.render(t)},e.prototype.destroy=function(){t.prototype.destroy.call(this),this._panelVisualizer.onAfterRender.remove(this.onAfterRenderPanelCallback)},e}(u);a.registerVisualizer("paneldynamic",S);var T=function(t){function e(e,i,r){return t.call(this,e,i,r)||this}return Object(o.b)(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"matrixDynamic"},enumerable:!1,configurable:!0}),e.prototype.getQuestions=function(){var t=this.question.visibleRows;return 0===t.length?[]:t[0].cells.map((function(t){return t.question}))},e}(S);a.registerVisualizer("matrixdynamic",T);var D=function(t){function e(e,i,r,s){void 0===r&&(r={});var o=t.call(this,e,i,r,s||"matrixDropdown")||this;o._matrixDropdownVisualizer=void 0,o.onPanelAfterRenderCallback=function(){o.afterRender(o.contentContainer)},(r=Object.assign({},r)).dataProvider=void 0,r.allowDynamicLayout=!1,r.seriesValues=e.rows.map((function(t){return t.value})),r.seriesLabels=e.rows.map((function(t){return t.text}));var l=o.getQuestions();if(1==r.seriesValues.length&&l.every((function(t){return n.Helpers.isArraysEqual(t.choices,o.question.choices)}))){var h=a.getVisualizersByType("matrixdropdown-grouped");o._matrixDropdownVisualizer=new h[0](o.question,[],r)}else o._matrixDropdownVisualizer=new C(l,[],r);return o._matrixDropdownVisualizer.onAfterRender.add(o.onPanelAfterRenderCallback),o.updateData(i),o}return Object(o.b)(e,t),Object.defineProperty(e.prototype,"matrixDropdownVisualizer",{get:function(){return this._matrixDropdownVisualizer},enumerable:!1,configurable:!0}),e.prototype.updateDropdownVisualizerData=function(){var t=this,e=[];this.data.forEach((function(i){var r=i[t.question.name];r&&Object.keys(r).forEach((function(t){var i=Object.assign({},r[t]);i[s.seriesMarkerKey]=t,e.push(i)}))})),this._matrixDropdownVisualizer.updateData(e)},e.prototype.updateData=function(e){t.prototype.updateData.call(this,e),this.updateDropdownVisualizerData()},e.prototype.onDataChanged=function(){this.updateDropdownVisualizerData(),t.prototype.onDataChanged.call(this)},e.prototype.getQuestions=function(){var t=this.question;return t.columns.map((function(e){var i=e.templateQuestion;return Array.isArray(i.choices)&&0===i.choices.length&&(i.choices=t.choices),i}))},e.prototype.destroyContent=function(e){this._matrixDropdownVisualizer.clear(),t.prototype.destroyContent.call(this,this.contentContainer)},e.prototype.renderContent=function(t){this._matrixDropdownVisualizer.render(t)},e.prototype.destroy=function(){t.prototype.destroy.call(this),this._matrixDropdownVisualizer.onAfterRender.remove(this.onPanelAfterRenderCallback)},e}(u);a.registerVisualizer("matrixdropdown",D);var A=function(){function t(){}return t.setup=function(t,e){return this.setups[t](e)},t.setupPie=function(e){var i=e.getAnswersData(),r=i.datasets,n=i.labels,s=i.colors,o=(i.texts,i.seriesLabels),a=[],l=o.length>1,h={type:e.chartType,y:l?o:n,text:(l?o:n).map((function(i){return t.getTruncatedLabel(i,e.labelTruncateLength)})),hoverinfo:"x+y",mode:"markers",marker:{}};h.hoverinfo="label+value+percent",h.marker.colors=s,h.textposition="inside","doughnut"===e.chartType&&(h.type="pie",h.hole=.4),l||(h.marker.symbol="circle",h.marker.size=16),r.forEach((function(t,e){a.push(Object.assign({},h,{values:t,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:e.backgroundColor,paper_bgcolor:e.backgroundColor,showlegend:!1};return l&&(u.grid={rows:Math.round(a.length/2),columns:2},u.annotations=[],n.forEach((function(t,e){a[e].domain={column:e%2,row:Math.floor(e/2)},a[e].title={position:"bottom center",text:t}}))),{traces:a,layout:u,hasSeries:l}},t.setupBar=function(e){var i=e.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:e.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(t,i){var r=Object.assign({},c,{x:t,text:o[i],hovertext:u.map((function(t,e){return"".concat(o[i][e],", ").concat(t)}))});if(e.showPercentages){var n=e.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 t.getTruncatedLabel(i,e.labelTruncateLength)+" "}))},xaxis:{rangemode:"nonnegative",automargin:!0},plot_bgcolor:e.backgroundColor,paper_bgcolor:e.backgroundColor,showlegend:!1};return h&&(d.showlegend=!0,"stackedbar"==e.chartType?d.barmode="stack":d.height=30*(n.length+1)*a.length+30+30,n.forEach((function(t,i){l[i].marker.color=void 0,l[i].name=t,"stackedbar"===e.chartType?(l[i].type="bar",l[i].width=.5):l[i].width=(e.showPercentages?.7:.5)/l.length})),l.forEach((function(t,i){var r=e.showPercentages?"%":"";l[i].hovertext=[],u.forEach((function(e,n){l[i].hovertext.push("".concat(t.y[n]," : ").concat(t.name,", ").concat(t.text[n]).concat(r))}))}))),{traces:l,layout:d,hasSeries:h}},t.setupVBar=function(t){var e=t.getAnswersData(),i=e.datasets,r=e.labels,n=e.colors,s=e.texts,o=e.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:t.backgroundColor,paper_bgcolor:t.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(e,i){var n=Object.assign({},u,{x:r,y:t.showPercentages?s[i].map((function(t){return t/100})):e,text:s[i]});if(t.showPercentages){var o=t.showOnlyPercentages?"%{text}%":"%{value} (%{text}%)";n.textposition="inside",n.texttemplate=o,n.width=.9,n.bargap=.1}a.push(n)})),t.showPercentages&&t.showOnlyPercentages&&(h.yaxis={automargin:!0,tickformat:".0%",range:[0,1],ticklen:t.showOnlyPercentages?25:5,tickcolor:"transparent"}),{traces:a,layout:h,hasSeries:l}},t.setupScatter=function(e){var i=e.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 t.getTruncatedLabel(i,e.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(t){var e=Object.assign({},h,{x:t});l.push(e)}));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:e.backgroundColor,paper_bgcolor:e.backgroundColor,showlegend:!1};return a&&(u.showlegend=!0,u.height=void 0,n.forEach((function(t,e){l[e].hoverinfo="x+name",l[e].marker.color=void 0,l[e].name=t}))),{traces:l,layout:u,hasSeries:a}},t.imageExportFormat="png",t.onImageSaving=new n.Event,t.onPlotCreating=new n.Event,t.setups={bar:t.setupBar,vbar:t.setupVBar,stackedbar:t.setupBar,doughnut:t.setupPie,pie:t.setupPie,scatter:t.setupScatter},t.getTruncatedLabel=function(t,e){var i="...".length;return e?-1===e||t.length<=e+i?t:t.substring(0,e)+"...":t},t}(),E=i(7),x=i.n(E),P=function(){function t(t){this.model=t,this._chart=void 0}return t.prototype.patchConfigParameters=function(t,e,i,r){},Object.defineProperty(t.prototype,"chart",{get:function(){return this._chart},enumerable:!1,configurable:!0}),t.prototype.create=function(t){var e=this,i=A.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:x.a.Icons.camera,click:function(t){var i={format:A.imageExportFormat,filename:e.model.question.name};A.onImageSaving.fire(e.model,i),x.a.downloadImage(t,i)}}]};void 0!==k.displayModeBar&&(s.displayModeBar=k.displayModeBar),this.patchConfigParameters(t,i.traces,i.layout,s);var o={traces:i.traces,layout:i.layout,config:s};A.onPlotCreating.fire(this.model,o);var a=x.a.newPlot(t,o.traces,o.layout,o.config);t.on("plotly_click",(function(t){var r;if(t.points.length>0){var s="";if(i.hasSeries){s=t.points[0].data.name;var o=t.points[0].label,a=e.model.getSeriesValues()[e.model.getSeriesLabels().indexOf(o)],l=e.model.getSelectedItemByText(s);h=new n.ItemValue(((r={})[a]=l.value,r),o+": "+l.text);e.model.setSelection(h)}else{s=Array.isArray(t.points[0].customdata)?t.points[0].customdata[0]:t.points[0].customdata;var h=e.model.getSelectedItemByText(s);e.model.setSelection(h)}}}));var l=function(){return t.getElementsByClassName("nsewdrag")[0]};return t.on("plotly_hover",(function(){var t=l();t&&(t.style.cursor="pointer")})),t.on("plotly_unhover",(function(){var t=l();t&&(t.style.cursor="")})),this._chart=a,a},t.prototype.destroy=function(t){x.a.purge(t),this._chart=void 0},t}(),k=function(t){function e(i,r,n,s){void 0===n&&(n={});var o=t.call(this,i,r,n,s)||this;return o.chartTypes=[].concat(e.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 P(o),o}return Object(o.b)(e,t),e.prototype.destroyContent=function(e){this._chartAdapter.destroy(e.children[0]),t.prototype.destroyContent.call(this,e)},e.prototype.renderContent=function(t){var e=this,i=h.b.createElement("div");t.appendChild(i),this._chartAdapter.create(i).then((function(){e.afterRender(e.contentContainer)}))},e.prototype.getData=function(){var e=t.prototype.getData.call(this),i=this.getSeriesValues(),r=this.getValues();if(i.length>1){var n=[];return r.forEach((function(t,r){var s=i.map((function(t,i){return e[i][r]}));n.push(s)})),n}return e},e.types=["bar","pie","doughnut","scatter"],e.displayModeBar=void 0,e}(d);a.registerVisualizer("checkbox",k),a.registerVisualizer("radiogroup",k),a.registerVisualizer("dropdown",k),a.registerVisualizer("imagepicker",k);var O=function(t){function e(i,r,n,s){var o=t.call(this,i,r,n,s)||this;return o.chartTypes=e.types,o.chartType=o.chartTypes[0],o._chartAdapter=new P(o),o}return Object(o.b)(e,t),e.prototype.destroyContent=function(e){this._chartAdapter.destroy(e.children[0]),t.prototype.destroyContent.call(this,e)},e.prototype.renderContent=function(t){var e=this,i=h.b.createElement("div");t.appendChild(i),this._chartAdapter.create(i).then((function(){e.afterRender(e.contentContainer)}))},e.types=["bar","stackedbar","pie","doughnut"],e}(p);a.registerVisualizer("matrix",O);var V=function(t){function e(e){return t.call(this,e)||this}return Object(o.b)(e,t),e.prototype.patchConfigParameters=function(t,e,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?e.forEach((function(t){t.marker.colors=s})):"bar"===this.model.chartType&&e.forEach((function(t){t.marker.color=s}))},e}(P),z=function(t){function e(i,r,n,s){var o=t.call(this,i,r,n,s)||this;return o.chartTypes=e.types,o.chartType=o.chartTypes[0],o._chartAdapter=new V(o),o}return Object(o.b)(e,t),e.prototype.destroyContent=function(e){this._chartAdapter.destroy(e.children[0]),t.prototype.destroyContent.call(this,e)},e.prototype.renderContent=function(t){var e=this,i=h.b.createElement("div");t.appendChild(i),this._chartAdapter.create(i).then((function(){e.afterRender(e.contentContainer)}))},e.types=["pie","bar","doughnut"],e}(f);a.registerVisualizer("boolean",z);var M=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(o.b)(e,t),e.prototype.getQuestionResults=function(){var t=this.question.name;return this.data.map((function(e){return e[t]}))},e.prototype.getEmptyData=function(){var t=this.getValues(),e=[];return e.length=t.length,e.fill(0),e},e.prototype.getData=function(){var t=this,e=this.getQuestionResults(),i=this.getValues(),r=this.getEmptyData();return e.forEach((function(e){t.applyResultToPlotlyData(e,r,i)})),[r]},e.prototype.applyResultToPlotlyData=function(t,e,i){t&&e&&i&&t.forEach((function(t,r,n){var s=i.indexOf(t);e[s]=+e[s]+(n.length-r)}))},e}(k);a.registerVisualizer("ranking",M);var L=function(t){function e(i,r,n,s){var o=t.call(this,i,r,n,s)||this;return o.chartTypes=e.types,o.chartType=o.chartTypes[0],o._chartAdapter=new P(o),o}return Object(o.b)(e,t),e.prototype.destroyContent=function(e){this._chartAdapter.destroy(e.children[0]),t.prototype.destroyContent.call(this,e)},e.prototype.renderContent=function(t){var e=this,i=h.b.createElement("div");t.appendChild(i),this._chartAdapter.create(i).then((function(){e.afterRender(e.contentContainer)}))},e.types=["stackedbar","bar","pie","doughnut"],e}(function(t){function e(e,i,r,n){var s=t.call(this,e,i,r,n||"matrixDropdownGrouped")||this;return s.getAnswersData(),s}return Object(o.b)(e,t),Object.defineProperty(e.prototype,"matrixQuestion",{get:function(){return this.question},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dataName",{get:function(){return this.matrixQuestion.columns.map((function(t){return t.name}))},enumerable:!1,configurable:!0}),e.prototype.getSeriesValues=function(){return this.matrixQuestion.columns.map((function(t){return t.name}))},e.prototype.getSeriesLabels=function(){return this.matrixQuestion.columns.map((function(t){return t.title}))},e.prototype.valuesSource=function(){return this.matrixQuestion.choices},e.prototype.isSupportMissingAnswers=function(){return!1},e.prototype.getData=function(){var t=this.getValues(),e=this.getSeriesValues(),i=this.matrixQuestion.rows.map((function(t){return t.value})),r=this.dataProvider.getData({dataName:e,getValues:function(){return t},getLabels:function(){return t},getSeriesValues:function(){return i},getSeriesLabels:function(){return i}}),n=[];return t.forEach((function(t,i){var s=e.map((function(t,e){return r[e][0][i]}));n.push(s)})),n},e}(d));a.registerVisualizer("matrixdropdown-grouped",L);var B=function(t){function e(i,r,n,s){var o=t.call(this,i,r,n,s)||this;return o.chartTypes=e.types,o.chartType=o.chartTypes[0],o._chartAdapter=new P(o),o}return Object(o.b)(e,t),e.prototype.destroyContent=function(e){this._chartAdapter.destroy(e.children[0]),t.prototype.destroyContent.call(this,e)},e.prototype.renderContent=function(t){var e=this,i=h.b.createElement("div");t.appendChild(i),this._chartAdapter.create(i).then((function(){e.afterRender(e.contentContainer)}))},e.prototype.getData=function(){var e=t.prototype.getData.call(this),i=this.getSeriesValues(),r=this.getValues();if(i.length>1){var n=[];return r.forEach((function(t,r){var s=i.map((function(t,i){return e[i][r]}));n.push(s)})),n}return e},e.types=["vbar","bar","scatter"],e}(m);a.registerVisualizer("date",B),a.registerVisualizer("number",B),a.registerVisualizer("rating",B);var R=function(){function t(t){this.model=t,this._chart=void 0}return Object.defineProperty(t.prototype,"chart",{get:function(){return this._chart},enumerable:!1,configurable:!0}),t.prototype.create=function(t){var e=this.model.question,i=this.model.getData(),n=i[0],s=i[1],o=i[2];if("rating"===e.getType()){var a=e.visibleRateValues;o=a[a.length-1].value,s=a[0].value}var l=this.model.generateColors(o,s,I.stepsCount);I.showAsPercentage&&(n=h.a.toPercentage(n,o),s=h.a.toPercentage(s,o),o=h.a.toPercentage(o,o));var u=[{type:"indicator",mode:"gauge+number",gauge:{axis:{range:[s,o]},shape:this.model.chartType,bgcolor:"white",bar:{color:l[0]}},value:n,text:e.name,domain:{x:[0,1],y:[0,1]}}],c={plot_bgcolor:this.model.backgroundColor,paper_bgcolor:this.model.backgroundColor};"bullet"===this.model.chartType&&(c.height=250,c.width=600);var d={data:u,layout:c,config:{displayModeBar:!1,staticPlot:!0,locale:r.a.currentLocale,responsive:!0}};return A.onPlotCreating.fire(this.model,d),x.a.newPlot(t,d.data,d.layout,d.config)},t.prototype.destroy=function(t){x.a.purge(t),this._chart=void 0},t}(),I=function(t){function e(i,r,n,s){var o=t.call(this,i,r,n,s)||this;return o.chartTypes=e.types,o.chartType=o.chartTypes[0],o._chartAdapter=new R(o),o}return Object(o.b)(e,t),e.prototype.destroyContent=function(e){this._chartAdapter.destroy(e.children[0]),t.prototype.destroyContent.call(this,e)},e.prototype.renderContent=function(t){var e=this,i=h.b.createElement("div");t.appendChild(i),this._chartAdapter.create(i).then((function(){e.afterRender(e.contentContainer)}))},e.types=["gauge","bullet"],e}(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(t){return void 0===t&&(t=""),j[t||"en"]||[]}},q=i(20),H=i.n(q),F=function(){function t(t){this.model=t}return Object.defineProperty(t.prototype,"wordcloud",{get:function(){return this._wordcloud},enumerable:!1,configurable:!0}),t.prototype.create=function(e){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){e.appendChild(s);var a={canvas:s,config:{list:n,weightFactor:t.weightFactor,abortThreshold:t.abortThreshold,drawOutOfBound:t.drawOutOfBound,shrinkToFit:t.shrinkToFit,fontFamily:"Segoe UI Bold, sans-serif",color:function(t,e){return i.model.getRandomColor()},rotateRatio:.5,rotationSteps:2,backgroundColor:this.model.backgroundColor,click:function(t){console.log(t[0]+": "+t[1])}}};return t.onWordcloudCreating.fire(this.model,a),this._wordcloud=H()(a.canvas,a.config),this._wordcloud}e.appendChild(o)},t.prototype.destroy=function(t){this._wordcloud=void 0},t.drawOutOfBound=!1,t.shrinkToFit=!0,t.abortThreshold=void 0,t.weightFactor=20,t.onWordcloudCreating=new n.Event,t}(),G=function(t){function e(e,i,r,n){var s=t.call(this,e,i,r,n||"wordcloud")||this;return s._wordcloudAdapter=new F(s),s}return Object(o.b)(e,t),e.prototype.getData=function(){var t=this,e={},i=[],n=r.a.currentLocale;i=n?N.getStopWords(n):N.getStopWords();var s=function(t){(t=""+t).length>15&&(t=t.substring(0,14)+"..."),t&&t.split(" ").forEach((function(t){(t=function(t){return-1!==i.indexOf(t)?"":t}(t.toLowerCase()||""))&&(e[t]?e[t]++:e[t]=1)}))};return this.data.forEach((function(e){var i=e[t.question.name];i&&(Array.isArray(i)?i.forEach(s):"object"==typeof i?Object.keys(i).forEach((function(t){return s(i[t])})):s(i))})),Object.keys(e).map((function(t){return[t,e[t]]}))},e.prototype.destroyContent=function(e){this._wordcloudAdapter.destroy(e),t.prototype.destroyContent.call(this,e)},e.prototype.renderContent=function(t){this._wordcloudAdapter.create(t),this.afterRender(this.contentContainer)},e.prototype.destroy=function(){this._wordcloudAdapter.destroy(this.contentContainer),t.prototype.destroy.call(this)},e}(u);a.registerVisualizer("text",G),a.registerVisualizer("comment",G),a.registerVisualizer("multipletext",G);i(26);var X=function(){function t(t){this.model=t}return t.prototype.create=function(t){var e=this.model.getData(),i=e.columnsCount,n=e.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,t.appendChild(o),n.forEach((function(t){for(var e=h.b.createElement("tr"),r=0;r<i;r++){var n=h.b.createElement("td","sa-text-table__cell",{textContent:t[r]});e.appendChild(n)}o.appendChild(e)})),t.className="sa-text-table__container",t.appendChild(o)}else t.appendChild(s)},t.prototype.destroy=function(t){t.innerHTML=""},t}(),Y=function(t){function e(e,i,r,n){var s=t.call(this,e,i,r,n||"text")||this;return s._textTableAdapter=new X(s),s}return Object(o.b)(e,t),e.prototype.getData=function(){var t=this,e=[],i=0;return this.data.forEach((function(r){var n=r[t.question.name],s=[];n&&(Array.isArray(n)?s.concat(n):"object"==typeof n?Object.keys(n).forEach((function(t){return s.push(n[t])})):s.push(n),e.push(s),s.length>i&&(i=s.length))})),{columnsCount:i,data:e}},e.prototype.destroyContent=function(e){this._textTableAdapter.destroy(e),t.prototype.destroyContent.call(this,e)},e.prototype.renderContent=function(t){this._textTableAdapter.create(t),this.afterRender(this.contentContainer)},e.prototype.destroy=function(){this._textTableAdapter.destroy(this.contentContainer),t.prototype.destroy.call(this)},e}(u);a.registerVisualizer("text",Y),a.registerVisualizer("comment",Y),a.registerVisualizer("multipletext",Y);i(27);var Q=function(){function t(t){this.model=t}return t.prototype.create=function(t){var e=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=e.model.backgroundColor,t.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(t,e){var i=h.b.createElement("tr"),r=h.b.createElement("td","sa-choices-table__cell",{textContent:s[e]});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][e]+"%",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][e]+"%"});i.appendChild(d);var p=h.b.createElement("td","sa-choices-table__cell sa-choices-table__cell-value",{textContent:t});i.appendChild(p),a.appendChild(i)})),t.className="sa-choices-table__container",t.appendChild(a)})):t.appendChild(a)},t.prototype.destroy=function(t){t.innerHTML=""},t}(),U=function(t){function e(e,i,r,n){var s=t.call(this,e,i,r,n||"choices")||this;return s._choicesTableAdapter=new Q(s),s.answersOrder="asc",s.showPercentages=!0,s}return Object(o.b)(e,t),e.prototype.destroyContent=function(e){this._choicesTableAdapter.destroy(e),t.prototype.destroyContent.call(this,e)},e.prototype.renderContent=function(t){this._choicesTableAdapter.create(t),this.afterRender(this.contentContainer)},e.prototype.destroy=function(){this._choicesTableAdapter.destroy(this.contentContainer),t.prototype.destroy.call(this)},e}(d)}])}));
|