survey-analytics 1.9.42 → 1.9.43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/survey.analytics.css +1 -1
- package/survey.analytics.d.ts +2 -1
- package/survey.analytics.datatables.css +1 -1
- package/survey.analytics.datatables.js +1 -1
- package/survey.analytics.datatables.min.css +1 -1
- package/survey.analytics.datatables.min.js +1 -1
- package/survey.analytics.js +29 -20
- 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 Analytics library v1.9.
|
|
2
|
+
* surveyjs - SurveyJS Analytics library v1.9.43
|
|
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 n=i.length;n--;)e===i[n]&&i.splice(n,1);return this},e.prototype.emit=function(t,e,i,n){if(this._isDestroyed)return this;var r=this._events[t];if(!r||!r.length)return this;var o,s=this._queue,a=s.length,l=arguments.length-1;for(o=0;o<r.length;o++)s.push(r[o]);for(++this._counter,o=a,a=s.length;o<a;o++)if(0===l?s[o]():1===l?s[o](e):2===l?s[o](e,i):s[o](e,i,n),this._isDestroyed)return this;return--this._counter,this._counter||(s.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",n="transform",r=window.document.documentElement.style,o=!1;["","Webkit","Moz","O","ms"].forEach((function(t){if(!o){var e=t?t+"Transform":"transform";void 0!==r[e]&&(t=t.toLowerCase(),i=t?"-"+t+"-transform":"transform",n=e,o=!0)}}));var s="function"==typeof WeakMap?new WeakMap:null;function a(t,e){var n=s&&s.get(t);return n||(n=window.getComputedStyle(t,null),s&&s.set(t,n)),n.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?n: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 n=this._animation,r=this._props,o=this._values,s=i||0,a=!1;if(n){var l,h=0;for(var d in e)if(++h,-1===(l=r.indexOf(d))||e[d]!==o[l]){a=!0;break}a||h===r.length||(a=!0)}if(a&&n.cancel(),this._callback=u(s.onFinish)?s.onFinish:null,!n||a){for(d in r.length=o.length=0,e)r.push(d),o.push(e[d]);var p=this._keyframes;p[0]=t,p[1]=e;var f=this._options;f.duration=s.duration||300,f.easing=s.easing||"ease";var m=this._element;(n=m.animate(p,f)).onfinish=this._onFinish,this._animation=n,c(m,e)}}},d.prototype.stop=function(t){if(!this._isDestroyed&&this._animation){var e,i,r,o=this._element,s=this._props,l=this._values;if(t)c(o,t);else for(r=0;r<s.length;r++)i=a(o,h(e=s[r])),o.style["transform"===e?n:e]=i;this._animation.cancel(),this._animation=this._callback=null,s.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,n,r=e[0].toUpperCase()+e.slice(1),o=0;o<p.length;){if((n=(i=p[o])?i+r:e)in t)return n;++o}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),E=!!g&&{passive:!0},A=f(window.document.documentElement.style,"touchAction");function P(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",P._preventDefault,!1),t.addEventListener(P._events.start,this._preStartCheck,E),!C||S||T||t.addEventListener(P._mouseEvents.start,this._preStartCheck,E)}function x(){this._nextStep=null,this._queue=[],this._reads={},this._writes={},this._batch=[],this._batchReads={},this._batchWrites={},this._step=this._step.bind(this)}P._pointerEvents={start:"pointerdown",move:"pointermove",cancel:"pointercancel",end:"pointerup"},P._msPointerEvents={start:"MSPointerDown",move:"MSPointerMove",cancel:"MSPointerCancel",end:"MSPointerUp"},P._touchEvents={start:"touchstart",move:"touchmove",cancel:"touchcancel",end:"touchend"},P._mouseEvents={start:"mousedown",move:"mousemove",cancel:"",end:"mouseup"},P._events=S?P._pointerEvents:T?P._msPointerEvents:C?P._touchEvents:P._mouseEvents,P._emitter=new e,P._activeInstances=[],P._preventDefault=function(t){t.preventDefault&&!1!==t.cancelable&&t.preventDefault()},P._activateInstance=function(t){P._activeInstances.indexOf(t)>-1||(P._activeInstances.push(t),P._emitter.on(v,t._onMove),P._emitter.on(w,t._onCancel),P._emitter.on(b,t._onEnd),1===P._activeInstances.length&&P._bindListeners())},P._deactivateInstance=function(t){var e=P._activeInstances.indexOf(t);-1!==e&&(P._activeInstances.splice(e,1),P._emitter.off(v,t._onMove),P._emitter.off(w,t._onCancel),P._emitter.off(b,t._onEnd),P._activeInstances.length||P._unbindListeners())},P._bindListeners=function(){var t=P._events;window.addEventListener(t.move,P._onMove,E),window.addEventListener(t.end,P._onEnd,E),t.cancel&&window.addEventListener(t.cancel,P._onCancel,E)},P._unbindListeners=function(){var t=P._events;window.removeEventListener(t.move,P._onMove,E),window.removeEventListener(t.end,P._onEnd,E),t.cancel&&window.removeEventListener(t.cancel,P._onCancel,E)},P._getEventPointerId=function(t){return"number"==typeof t.pointerId?t.pointerId:t.changedTouches?t.changedTouches[0]?t.changedTouches[0].identifier:null:1},P._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},P._onMove=function(t){P._emitter.emit(v,t)},P._onCancel=function(t){P._emitter.emit(w,t)},P._onEnd=function(t){P._emitter.emit(b,t)},P.prototype._reset=function(){this._isDestroyed||(this._pointerId=null,this._startTime=0,this._startX=0,this._startY=0,this._currentX=0,this._currentY=0,this._startEvent=null,this._element.removeEventListener(P._touchEvents.start,this._abortNonCancelable,E),P._deactivateInstance(this))},P.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}},P.prototype._emit=function(t,e){this._emitter.emit(t,this._createEvent(t,e))},P.prototype._getTrackedTouch=function(t){return null===this._pointerId?null:P._getTouchById(t,this._pointerId)},P.prototype._preStartCheck=function(t){this._isDestroyed||this.isDragging()||D&&!1===t.cancelable||t.button||(this._pointerId=P._getEventPointerId(t),null!==this._pointerId&&(this._startEvent=t,C&&(S||T)?(D&&this._element.addEventListener(P._touchEvents.start,this._abortNonCancelable,E),m(this._onStart)):this._onStart()))},P.prototype._abortNonCancelable=function(t){this._element.removeEventListener(P._touchEvents.start,this._abortNonCancelable,E),this._startEvent&&!1===t.cancelable&&(this._pointerId=null,this._startEvent=null)},P.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),P._activateInstance(this))}},P.prototype._onMove=function(t){var e=this._getTrackedTouch(t);e&&(this._currentX=e.clientX,this._currentY=e.clientY,this._emit(v,t))},P.prototype._onCancel=function(t){this._getTrackedTouch(t)&&(this._emit(w,t),this._reset())},P.prototype._onEnd=function(t){this._getTrackedTouch(t)&&(this._emit(b,t),this._reset())},P.prototype.isDragging=function(){return null!==this._pointerId},P.prototype.setTouchAction=function(t){this._touchAction=t,A&&(this._cssProps[A]="",this._element.style[A]=t),C&&(this._element.removeEventListener(P._touchEvents.start,P._preventDefault,!1),this._element.style[A]!==t&&this._element.addEventListener(P._touchEvents.start,P._preventDefault,!1))},P.prototype.setCssProps=function(t){if(t){var e,i,n=this._cssProps,r=this._element;for(e in n)r.style[e]=n[e],delete n[e];for(e in t)t[e]&&("touchAction"!==e?(i=f(r.style,e))&&(n[i]="",r.style[i]=t[e]):this.setTouchAction(t[e]))}},P.prototype.getDeltaX=function(){return this._currentX-this._startX},P.prototype.getDeltaY=function(){return this._currentY-this._startY},P.prototype.getDistance=function(){var t=this.getDeltaX(),e=this.getDeltaY();return Math.sqrt(t*t+e*e)},P.prototype.getDeltaTime=function(){return this._startTime?Date.now()-this._startTime:0},P.prototype.on=function(t,e){this._emitter.on(t,e)},P.prototype.off=function(t,e){this._emitter.off(eventName,e)},P.prototype.destroy=function(){if(!this._isDestroyed){var t=this._element,e=P._events;for(var i in this._reset(),this._emitter.destroy(),t.removeEventListener(e.start,this._preStartCheck,E),t.removeEventListener(P._mouseEvents.start,this._preStartCheck,E),t.removeEventListener("dragstart",P._preventDefault,!1),t.removeEventListener(P._touchEvents.start,P._preventDefault,!1),this._cssProps)t.style[i]=this._cssProps[i],delete this._cssProps[i];this._element=null,this._isDestroyed=!0}},x.prototype.add=function(t,e,i,n){var r=this._queue.indexOf(t);r>-1&&(this._queue[r]=void 0),n?this._queue.unshift(t):this._queue.push(t),this._reads[t]=e,this._writes[t]=i,this._nextStep||(this._nextStep=m(this._step))},x.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])},x.prototype._step=function(){var t,e,i=this._queue,n=this._reads,r=this._writes,o=this._batch,s=this._batchReads,a=this._batchWrites,l=i.length;for(this._nextStep=null,e=0;e<l;e++)(t=i[e])&&(o.push(t),s[t]=n[t],delete n[t],a[t]=r[t],delete r[t]);for(i.length=0,e=0;e<l;e++)s[t=o[e]]&&(s[t](),delete s[t]);for(e=0;e<l;e++)a[t=o[e]]&&(a[t](),delete a[t]);o.length=0,!this._nextStep&&i.length&&(this._nextStep=m(this._step))};var k=new x;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 n="number"==typeof i?i:-1;n<0&&(n=t.length-n+1),t.splice.apply(t,j.concat(n,0,e)),j.length=0}function q(t,e,i){var n=t.length,r=Math.max(0,i?n:n-1);return e>r?r:e<0?Math.max(r+e+1,0):e}function H(t,e,i){if(!(t.length<2)){var n=q(t,e),r=q(t,i);n!==r&&t.splice(r,0,t.splice(n,1)[0])}}function F(t,e,i){if(!(t.length<2)){var n,r=q(t,e),o=q(t,i);r!==o&&(n=t[r],t[r]=t[o],t[o]=n)}}var G=0;function X(t,e){var i,n=++G+"debounce";return e>0?function(r){void 0!==i&&(i=window.clearTimeout(i),k.cancel(n),"finish"===r&&t()),"cancel"!==r&&"finish"!==r&&(i=window.setTimeout((function(){i=void 0,k.add(n,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,n=(e?t:t.parentElement)||i;n&&n!==i&&"static"===a(n,"position")&&!Y(n);)n=n.parentElement||i;return n}function U(t,e){return parseFloat(a(t,e))||0}var W={},K={},Z={};function J(t,e){var i,n=e||{};return n.left=0,n.top=0,t===document||(n.left=window.pageXOffset||0,n.top=window.pageYOffset||0,t.self===window.self||(i=t.getBoundingClientRect(),n.left+=i.left,n.top+=i.top,n.left+=U(t,"border-left-width"),n.top+=U(t,"border-top-width"))),n}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 n=i||[],r=e?t:t.parentNode;r&&r!==document;)r.getRootNode&&r instanceof DocumentFragment?r=r.getRootNode().host:(tt(r)&&n.push(r),r=r.parentNode);return n.push(window),n}var it,nt,rt,ot,st={},at=/^matrix3d/,lt=/([^,]*,){4}/,ht=/([^,]*,){12}/,ut=/[^,]*,/;function ct(t){st.x=0,st.y=0;var e=a(t,"transform");if(!e||"none"===e)return st;var i=at.test(e),n=e.replace(i?ht:lt,""),r=n.replace(ut,"");return st.x=parseFloat(n)||0,st.y=parseFloat(r)||0,st}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(),n=i._settings;this._item=t,this._gridId=i._id,this._isDestroyed=!1,this._isMigrating=!1,this._startPredicate=u(n.dragStartPredicate)?n.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 r=n.dragSortHeuristics.sortInterval;this._checkOverlapDebounce=X(this._checkOverlap,r),this._dragger=new P(e,n.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 n=t._drag,r=n._startPredicateData||n._setupStartPredicate(i);if(!e.isFinal)return!(!r.handleElement&&(r.handleElement=n._getStartPredicateHandle(e),!r.handleElement))&&(r.delay&&(r.event=e,r.delayTimer||(r.delayTimer=window.setTimeout((function(){r.delay=0,n._resolveStartPredicate(r.event)&&(n._forceResolveStartPredicate(r.event),n._resetStartPredicate())}),r.delay))),n._resolveStartPredicate(e));n._finishStartPredicate(e)},ft.defaultSortPredicate=(it={},nt={},rt={},ot=[],function(t,e){var i=t._drag,n=i._getGrid(),r=e&&"number"==typeof e.threshold?e.threshold:50,o=e&&"swap"===e.action?"swap":"move";it.width=t._width,it.height=t._height,it.left=i._elementClientX,it.top=i._elementClientY;var s=function(t,e,i){var n,r,o,s,a=null,l=e._settings.dragSort,h=-1;if(!0===l?(ot[0]=e,r=ot):r=l.call(e,t),!Array.isArray(r))return a;for(s=0;s<r.length;s++)(o=r[s])._isDestroyed||(o._updateBoundingRect(),nt.width=o._width,nt.height=o._height,nt.left=o._left,nt.top=o._top,(n=mt(it,nt))>i&&n>h&&(h=n,a=o));return ot.length=0,a}(t,n,r);if(!s)return!1;var a,l,h,u,c,d=0,p=0,f=-1;for(s===n?(it.left=i._gridX+t._marginLeft,it.top=i._gridY+t._marginTop):(s._updateBorders(1,0,1,0),d=s._left+s._borderLeft,p=s._top+s._borderTop),c=0;c<s._items.length;c++)(h=s._items[c])._isActive&&h!==t&&(l=!0,nt.width=h._width,nt.height=h._height,nt.left=h._left+h._marginLeft+d,nt.top=h._top+h._marginTop+p,(u=mt(it,nt))>f&&(a=c,f=u));return f<r&&t.getGrid()!==s&&(a=l?-1:0,f=1/0),f>=r&&(rt.grid=s,rt.index=a,rt.action=o,rt)}),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[n]=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,n=this._container,r=this._scrollers;if(r.length=0,et(this._item._element,!1,r),n!==i)for(et(i,!0,t=[]),e=0;e<t.length;e++)r.indexOf(t[e])<0&&r.push(t[e]);for(e=0;e<r.length;e++)r[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,n=i;if(!e.handle)return n;for(n=t.target;n&&!R(n,e.handle);)n=n!==i?n.parentElement:null;return n||null},ft.prototype._resolveStartPredicate=function(t){var e=this._startPredicateData;if(!(t.distance<e.distance||e.delay)){var i=e.handleElement.getBoundingClientRect(),n=i.left+(window.pageXOffset||0),r=i.top+(window.pageYOffset||0),o=i.width,s=i.height;return this._resetStartPredicate(),o&&s&&t.pageX>=n&&t.pageX<n+o&&t.pageY>=r&&t.pageY<r+s}},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 n=t.clientX,r=t.clientY,o=n-this._hX2,s=r-this._hY2,a=i>3&&e.minBounceBackAngle>0;if(a||(this._hBlockedIndex=null),Math.abs(o)>i||Math.abs(s)>i){if(a){var l=Math.atan2(o,s),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=n,this._hY2=r,!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,n,r,o,s,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&&(s=(e=a.getGrid())!==(n=t.grid||e),i=e._items.indexOf(a),r=q(n._items,t.index,s),o="swap"===t.action?"swap":"move",(s||r!==this._hBlockedIndex)&&(s?(this._hBlockedIndex=null,e._hasListeners("beforeSend")&&e._emit("beforeSend",{item:a,fromGrid:e,fromIndex:i,toGrid:n,toIndex:r}),n._hasListeners("beforeReceive")&&n._emit("beforeReceive",{item:a,fromGrid:e,fromIndex:i,toGrid:n,toIndex:r}),a._gridId=n._id,this._isMigrating=a._gridId!==this._gridId,e._items.splice(i,1),N(n._items,a,r),a._sortData=null,e._hasListeners("send")&&e._emit("send",{item:a,fromGrid:e,fromIndex:i,toGrid:n,toIndex:r}),n._hasListeners("receive")&&n._emit("receive",{item:a,fromGrid:e,fromIndex:i,toGrid:n,toIndex:r}),e.layout(),n.layout()):i!==r&&(this._hBlockedIndex=i,("swap"===o?F:H)(e._items,i,r),e._hasListeners("move")&&e._emit("move",{item:a,fromIndex:i,toIndex:r,action:o}),e.layout())))}},ft.prototype._finishMigration=function(){var t,e,i=this._item,r=i._release,o=i._element,s=i._isActive,a=i.getGrid(),l=a._element,h=a._settings,u=h.dragContainer||l,d=this._getGrid()._settings,p=o.parentNode;this._isMigrating=!1,this.destroy(),pt(o,d.itemClass),pt(o,d.itemVisibleClass),pt(o,d.itemHiddenClass),I(o,h.itemClass),I(o,s?h.itemVisibleClass:h.itemHiddenClass),u!==p&&(u.appendChild(o),e=$(p,u,!0),(t=ct(o)).x-=e.left,t.y-=e.top),i._refreshDimensions(),i._refreshSortData(),e=$(u,l,!0),r._containerDiffX=e.left,r._containerDiffY=e.top,i._drag=h.dragEnabled?new ft(i):null,u!==p&&(o.style[n]=dt(t.x,t.y)),i._child.removeAttribute("style"),c(i._child,s?h.visibleStyles:h.hiddenStyles),r.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,r=e._element,o=this._getGrid(),s=o._settings,a=e._release,l=e._migrate,h=o._element,u=s.dragContainer||h,c=Q(u,!0),d=ct(r),p=d.x,f=d.y,m=r.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,s.dragPlaceholder.enabled&&e._dragPlaceholder.create(),o._emit("dragInit",e,t),g&&(this._containerDiffX=i.left,this._containerDiffY=i.top,r.parentNode===u?(this._gridX=p-this._containerDiffX,this._gridY=f-this._containerDiffY):(this._left=p+this._containerDiffX,this._top=f+this._containerDiffY,u.appendChild(r),r.style[n]=dt(this._left,this._top))),I(r,s.itemDraggingClass),this._bindScrollListeners(),o._emit("dragStart",e,t)}},ft.prototype._onMove=function(t){var e=this._item;if(e._isActive){var i,n,r,o=this._getGrid()._settings.dragAxis;if("y"!==o){var s=t.clientX-this._dragEvent.clientX;this._left+=s,this._gridX+=s,this._elementClientX+=s}if("x"!==o){var a=t.clientY-this._dragEvent.clientY;this._top+=a,this._gridY+=a,this._elementClientY+=a}this._dragEvent=t,i=e._id,n=this._prepareMove,r=this._applyMove,k.add(i+"move",n,r,!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[n]=dt(this._left,this._top),this._getGrid()._emit("dragMove",t,this._dragEvent))},ft.prototype._onScroll=function(t){var e,i,n,r=this._item;r._isActive?(this._scrollEvent=t,e=r._id,i=this._prepareScroll,n=this._applyScroll,k.add(e+"scroll",i,n,!0)):this.stop()},ft.prototype._prepareScroll=function(){var t=this._item;if(t._isActive){var e,i=t._element,n=this._getGrid(),r=n._settings,o=r.dragAxis,s=n._element,a=i.getBoundingClientRect(),l=this._elementClientX-a.left,h=this._elementClientY-a.top;this._container!==s&&(e=$(this._containingBlock,s),this._containerDiffX=e.left,this._containerDiffY=e.top),"y"!==o&&(this._left+=l,this._gridX=this._left-this._containerDiffX),"x"!==o&&(this._top+=h,this._gridY=this._top-this._containerDiffY),r.dragSort&&this._checkOverlapDebounce()}},ft.prototype._applyScroll=function(){var t=this._item;t._isActive&&(t._element.style[n]=dt(this._left,this._top),this._getGrid()._emit("dragScroll",t,this._scrollEvent))},ft.prototype._onEnd=function(t){var e=this._item,i=e._element,n=this._getGrid(),r=n._settings,o=e._release;e._isActive?(V(e._id),z(e._id),r.dragSort&&this._checkOverlapDebounce("finish"),this._unbindScrollListeners(),o._containerDiffX=this._containerDiffX,o._containerDiffY=this._containerDiffY,this._reset(),pt(i,r.itemDraggingClass),n._emit("dragEnd",e,t),this._isMigrating?this._finishMigration():o.start()):this.stop()},gt.prototype._onLayoutStart=function(){var t=this._item,e=t.getGrid(),i=e._items.indexOf(t),n=e._layout.slots[2*i],r=e._layout.slots[2*i+1];if(this._didMigrate||t._left!==n||t._top!==r){var o,s,a;if(n+=t._marginLeft,r+=t._marginTop,!(e._settings.dragPlaceholder.duration>0)||this._didMigrate){M(t._id);var l={transform:dt(n,r)};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=n,this._nextTop=r,o=t._id,s=this._setupAnimation,a=this._startAnimation,k.add(o+"placeholder",s,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,n=this._nextLeft,r=this._nextTop,o={transform:dt(n,r)};if(e!==n||i!==r){var s=this._item.getGrid()._settings.dragPlaceholder,a={transform:dt(e,i)};t.start(a,o,{duration:s.duration,easing:s.easing,onFinish:this._onLayoutEnd})}else t.isAnimating()&&t.stop(o)}},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(),n=i._settings,r=this._animate;t=u(n.dragPlaceholder.createElement)?n.dragPlaceholder.createElement(e):window.document.createElement("div"),this._element=t,r._element=t,this._className=n.itemPlaceholderClass||"",this._className&&I(t,this._className);var o=e._left+e._marginLeft,s=e._top+e._marginTop;c(t,{display:"block",position:"absolute",left:"0",top:"0",width:e._width+"px",height:e._height+"px",transform:dt(o,s)}),i.on("layoutStart",this._onLayoutStart),i.on("dragReleaseEnd",this._onReleaseEnd),i.on("beforeSend",this._onMigrate),u(n.dragPlaceholder.onCreate)&&n.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(),n=i._settings,r=this._animate;this._resetAfterLayout=!1,M(e._id),r.stop(),r._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(n.dragPlaceholder.onRemove)&&n.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,n=this._queue,r=n.length;if(!r)return this;var o=1===r,s=o?n[0]:n.slice(0);if(n.length=0,o)return s(t,e),this;for(i=0;i<r&&(s[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,n,r,o,s=this._item,a=s._element,l=s._release,h=s.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,s),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,n=s._id,r=this._setupAnimation,o=this._startAnimation,k.add(n+"layout",r,o),this):(this._updateOffsets(),this._updateTargetStyles(),i=s._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,n=this._item;return i=n._id,k.cancel(i+"layout"),n._animate.stop(e),pt(n._element,n.getGrid()._settings.itemPositioningClass),this._isActive=!1,t&&this._queue.flush(!0,n),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 r,o,s,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)r=q(b,e,!0);else{if(!(o=t._getItem(e)))return this;r=b.indexOf(o)}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:r}),t._hasListeners("beforeReceive")&&t._emit("beforeReceive",{item:p,fromGrid:g,fromIndex:w,toGrid:t,toIndex:r}),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,r),p._gridId=t._id,C!==(s=f.parentNode)&&(C.appendChild(f),a=$(C,s,!0),h||(u=(h=ct(f)).x,d=h.y),f.style[n]=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:r}),t._hasListeners("receive")&&t._emit("receive",{item:p,fromGrid:g,fromIndex:w,toGrid:t,toIndex:r}),this},bt.prototype.stop=function(t,e){if(this._isDestroyed||!this._isActive)return this;var i,n=this._item,r=n._element,o=n.getGrid()._element;return this._container!==o&&(e||(t?(i=ct(r),vt.transform=dt(i.x-this._containerDiffX,i.y-this._containerDiffY)):vt.transform=dt(n._left,n._top),e=vt),o.appendChild(r),c(r,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,n=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?n.itemVisibleClass:n.itemHiddenClass),c(t._child,e?n.visibleStyles:n.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,n=this._item,r=n._element,o=n.getGrid(),s=o._element;return this._reset(),r.parentNode!==s&&(e||(t?(i=ct(r),wt.transform=dt(i.x-this._containerDiffX,i.y-this._containerDiffY)):wt.transform=dt(n._left,n._top),e=wt),s.appendChild(r),c(r,e)),t||o._emit("dragReleaseEnd",n),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,n=i._element,r=this._queue,o=u(e)?e:null,s=i.getGrid()._settings;return this._isShowing||this._isHidden?this._isShowing&&!t?(o&&r.add(o),this):(this._isShowing||(r.flush(!0,i),pt(n,s.itemHiddenClass),I(n,s.itemVisibleClass),this._isHiding||(n.style.display="block")),o&&r.add(o),i._isActive=this._isShowing=!0,this._isHiding=this._isHidden=!1,this._startAnimation(!0,t,this._finishShow),this):(o&&o(!1,i),this)},St.prototype.hide=function(t,e){if(this._isDestroyed)return this;var i=this._item,n=i._element,r=this._queue,o=u(e)?e:null,s=i.getGrid()._settings;return!this._isHiding&&this._isHidden?(o&&o(!1,i),this):this._isHiding&&!t?(o&&r.add(o),this):(this._isHiding||(r.flush(!0,i),I(n,s.itemHiddenClass),pt(n,s.itemVisibleClass)),o&&r.add(o),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(),n=this._queue,r=i._settings;return this._stopAnimation({}),n.flush(!0,t).destroy(),pt(e,r.itemVisibleClass),pt(e,r.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 n,r=this._item,o=r.getGrid()._settings,s=t?o.visibleStyles:o.hiddenStyles,l=parseInt(t?o.showDuration:o.hideDuration)||0,u=(t?o.showEasing:o.hideEasing)||"ease",d=e||l<=0;if(s){if(O(r._id),d)return r._animateChild.isAnimating()?r._animateChild.stop(s):c(r._child,s),void(i&&i());var p,f,m;p=r._id,f=function(){n=function(t,e){var i={};for(var n in e)i[n]=a(t,h(n));return i}(r._child,s)},m=function(){r._animateChild.start(n,s,{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,Et,At,Pt,xt=0;function kt(){return++xt}function Ot(t,e,i){var r=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,r.itemClass),"boolean"!=typeof i&&(i="none"!==a(e,"display")),this._isActive=i,e.style.left="0",e.style.top="0",e.style[n]=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=r.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(),n=i._settings,r=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,n.itemClass),r>-1&&i._items.splice(r,1),t&&e.parentNode.removeChild(e),this._isActive=!1,this._isDestroyed=!0}},Vt.prototype.getLayout=function(t,e,i,n,r){var o,s=this._layout,a=!(!r||!r.fillGaps),l=!(!r||!r.horizontal),h=!(!r||!r.alignRight),u=!(!r||!r.alignBottom),c=!(!r||!r.rounding),d=this._slotSizes;if(s.slots=n||this._slots,s.width=l?0:c?Math.round(e):e,s.height=l?c?Math.round(i):i:0,s.setWidth=l,s.setHeight=!l,s.slots.length=0,d.length=0,!t.length)return s;for(o=0;o<t.length;o++)this._addSlot(t[o],l,a,c,h||u);if(h)for(o=0;o<s.slots.length;o+=2)s.slots[o]=s.width-(s.slots[o]+d[o]);if(u)for(o=1;o<s.slots.length;o+=2)s.slots[o]=s.height-(s.slots[o]+d[o]);return d.length=0,this._freeSlots.length=0,this._newSlots.length=0,this._rectId=0,s},Vt.prototype._addSlot=(Pt={},function(t,e,i,n,r){var o,s,a,l,h,u,c=this._layout,d=this._freeSlots,p=this._newSlots;for(p.length=0,Pt.left=null,Pt.top=null,Pt.width=t._width+t._marginLeft+t._marginRight,Pt.height=t._height+t._marginTop+t._marginBottom,n&&(Pt.width=Math.round(Pt.width),Pt.height=Math.round(Pt.height)),h=0;h<d.length;h++)if((s=d[h])&&(o=this._getRect(s),Pt.width<=o.width+.001&&Pt.height<=o.height+.001)){Pt.left=o.left,Pt.top=o.top;break}for(null===Pt.left&&(Pt.left=e?c.width:0,Pt.top=e?0:c.height,i||(l=!0)),!e&&Pt.top+Pt.height>c.height&&(Pt.left>0&&p.push(this._addRect(0,c.height,Pt.left,1/0)),Pt.left+Pt.width<c.width&&p.push(this._addRect(Pt.left+Pt.width,c.height,c.width-Pt.left-Pt.width,1/0)),c.height=Pt.top+Pt.height),e&&Pt.left+Pt.width>c.width&&(Pt.top>0&&p.push(this._addRect(c.width,0,1/0,Pt.top)),Pt.top+Pt.height<c.height&&p.push(this._addRect(c.width,Pt.top+Pt.height,1/0,c.height-Pt.top-Pt.height)),c.width=Pt.left+Pt.width),h=i?0:l?d.length:h;h<d.length;h++)if(s=d[h])for(o=this._getRect(s),a=this._splitRect(o,Pt),u=0;u<a.length;u++)s=a[u],(o=this._getRect(s)).width>.49&&o.height>.49&&(!e&&o.top<c.height||e&&o.left<c.width)&&p.push(s);p.length&&this._purgeRects(p).sort(e?this._sortRectsLeftTop:this._sortRectsTopLeft),e?c.width=Math.max(c.width,Pt.left+Pt.width):c.height=Math.max(c.height,Pt.top+Pt.height),c.slots.push(Pt.left,Pt.top),r&&this._slotSizes.push(Pt.width,Pt.height),this._freeSlots=p,this._newSlots=d}),Vt.prototype._addRect=function(t,e,i,n){var r=++this._rectId,o=this._rectStore;return o[r]=t||0,o[++this._rectId]=e||0,o[++this._rectId]=i||0,o[++this._rectId]=n||0,r},Vt.prototype._getRect=function(t,e){var i=e||this._rectItem,n=this._rectStore;return i.left=n[t]||0,i.top=n[++t]||0,i.width=n[++t]||0,i.height=n[++t]||0,i},Vt.prototype._splitRect=(At=[],function(t,e){return At.length=0,this._doRectsOverlap(t,e)?(t.left<e.left&&At.push(this._addRect(t.left,t.top,e.left-t.left,t.height)),t.left+t.width>e.left+e.width&&At.push(this._addRect(e.left+e.width,t.top,t.left+t.width-(e.left+e.width),t.height)),t.top<e.top&&At.push(this._addRect(t.left,t.top,t.width,e.top-t.top)),t.top+t.height>e.top+e.height&&At.push(this._addRect(t.left,e.top+e.height,t.width,t.top+t.height-(e.top+e.height))),At):(At.push(this._addRect(t.left,t.top,t.width,t.height)),At)}),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={},Et={},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],Et))){t[i]=0;break}return t}),Vt.prototype._sortRectsTopLeft=function(){var t={},e={};return function(i,n){return this._getRect(i,t),this._getRect(n,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,n){return this._getRect(i,t),this._getRect(n,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,n){var r,o,s,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((r=this._settings=(a=jt.defaultOptions,l=n,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)||(r.dragSort=!!r.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,r.containerClass),this._items=[],"string"==typeof(o=r.items)?Bt(i.children).forEach((function(t){("*"===o||R(t,o))&&c._items.push(new Ot(c,t))})):(Array.isArray(o)||zt(o))&&(this._items=Bt(o).map((function(t){return new Ot(c,t)}))),"number"!=typeof(s=r.layoutOnResize)&&(s=!0===s?0:-1),s>=0&&window.addEventListener("resize",c._resizeHandler=X((function(){c.refreshItems().layout()}),s)),r.layoutOnInit&&this.layout(!0)}function Nt(t,e){var i,n,r,o=Object.keys(e),s=o.length;for(r=0;r<s;r++)i=Lt(e[n=o[r]]),Lt(t[n])&&i?t[n]=Nt(Nt({},t[n]),e[n]):i?t[n]=Nt({},e[n]):Array.isArray(e[n])?t[n]=e[n].slice(0):t[n]=e[n];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=P,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,n=[],r=Bt(t);for(i=0;i<r.length;i++)(e=this._getItem(r[i]))&&n.push(e);return n},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,n=this._element,r=this._items;if(r.length){for(i=0;i<r.length;i++)(e=r[i]._element).parentNode===n&&(t=t||window.document.createDocumentFragment()).appendChild(e);t&&n.appendChild(t)}return this._emit("synchronize"),this},jt.prototype.layout=function(t,e){if(this._isDestroyed)return this;var i,n,r,o=this,s=this._element,l=this._updateLayout(),h=l.id,c=l.items.length,d=c;function p(){if(!(--d>0)){var i=o._layout.id!==h,n=u(t)?t:e;u(n)&&n(i,l.items.slice(0)),!i&&o._hasListeners("layoutEnd")&&o._emit("layoutEnd",l.items.slice(0))}}if((l.setHeight&&"number"==typeof l.height||l.setWidth&&"number"==typeof l.width)&&(i="border-box"===a(s,"box-sizing")),l.setHeight&&("number"==typeof l.height?s.style.height=(i?l.height+this._borderTop+this._borderBottom:l.height)+"px":s.style.height=l.height),l.setWidth&&("number"==typeof l.width?s.style.width=(i?l.width+this._borderLeft+this._borderRight:l.width)+"px":s.style.width=l.width),this._hasListeners("layoutStart")&&this._emit("layoutStart",l.items.slice(0)),!c)return p(),this;for(r=0;r<c;r++)(n=l.items[r])&&(n._left=l.slots[2*r],n._top=l.slots[2*r+1],n.isDragging()?p():n._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 n,r,o=e||0,s=o.layout?o.layout:void 0===o.layout,a=this._items,l=!1;for(r=0;r<i.length;r++)n=new Ot(this,i[r],o.isActive),i[r]=n,n._isActive&&(l=!0,n._layout._skipNextAnimation=!0);return N(a,i,o.index),this._hasListeners("add")&&this._emit("add",i.slice(0)),l&&s&&this.layout("instant"===s,u(s)?s:void 0),i},jt.prototype.remove=function(t,e){if(this._isDestroyed)return this;var i,n,r=e||0,o=r.layout?r.layout:void 0===r.layout,s=!1,a=this.getItems(),l=this.getItems(t),h=[];for(n=0;n<l.length;n++)i=l[n],h.push(a.indexOf(i)),i._isActive&&(s=!0),i._destroy(r.removeElements);return this._hasListeners("remove")&&this._emit("remove",l.slice(0),h),s&&o&&this.layout("instant"===o,u(o)?o: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,n,r=[],o=[],s="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(r.slice(0),o.slice(0))}),a||s)for(n=0;n<this._items.length;n++)i=this._items[n],(a?t(i):R(i._element,t))?r.push(i):o.push(i);return r.length?this.show(r,{instant:h,onFinish:f,layout:!1}):f(),o.length?this.hide(o,{instant:h,onFinish:f,layout:!1}):f(),(r.length||o.length)&&(this._hasListeners("filter")&&this._emit("filter",r.slice(0),o.slice(0)),c&&this.layout("instant"===c,u(c)?c:void 0)),this},jt.prototype.sort=function(){var t,e,i,n;function r(t){for(var e={},i=0;i<t.length;i++)e[t[i]._id]=i;return e}function o(t,i){var r=n[t._id],o=n[i._id];return e?o-r:r-o}function s(s,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=(s._sortData?s:s._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||(n||(n=r(i)),d=o(s,a)),d}function a(s,a){var l=t(s,a);return e&&l&&(l=-l),l||(n||(n=r(i)),o(s,a))}return function(r,o){if(this._isDestroyed||this._items.length<2)return this;var l,h=this._items,c=o||0,d=c.layout?c.layout:void 0===c.layout;if(t=r,e=!!c.descending,i=h.slice(0),n=null,u(t))h.sort(a);else if("string"==typeof t)t=r.trim().split(" ").map((function(t){return t.split(":")})),h.sort(s);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 n,r,o=this._items,s=i||0,a=s.layout?s.layout:void 0===s.layout,l="swap"===s.action,h=l?"swap":"move",c=this._getItem(t),d=this._getItem(e);return c&&d&&c!==d&&(n=o.indexOf(c),r=o.indexOf(d),l?F(o,n,r):H(o,n,r),this._hasListeners("move")&&this._emit("move",{item:c,fromIndex:n,toIndex:r,action:h}),a&&this.layout("instant"===a,u(a)?a:void 0)),this},jt.prototype.send=function(t,e,i,n){if(this._isDestroyed||e._isDestroyed||this===e)return this;if(!(t=this._getItem(t)))return this;var r=n||0,o=r.appendTo||window.document.body,s=r.layoutSender?r.layoutSender:void 0===r.layoutSender,a=r.layoutReceiver?r.layoutReceiver:void 0===r.layoutReceiver;return t._migrate.start(e,i,o),t._migrate._isActive&&t._isActive&&(s&&this.layout("instant"===s,u(s)?s: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,n=this._element,r=this._items.slice(0);for(this._resizeHandler&&window.removeEventListener("resize",this._resizeHandler),i=0;i<r.length;i++)r[i]._destroy(e);return pt(n,this._settings.containerClass),n.style.height="",n.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,n,r=this._layout,o=this._settings.layout;for(++r.id,r.items.length=0,n=0;n<this._items.length;n++)this._items[n]._isActive&&r.items.push(this._items[n]);return this._refreshDimensions(),t=this._width-this._borderLeft-this._borderRight,e=this._height-this._borderTop-this._borderBottom,i=u(o)?o(r.items,t,e):Rt.getLayout(r.items,t,e,r.slots,o),r.slots=i.slots,r.setWidth=Boolean(i.setWidth),r.setHeight=Boolean(i.setHeight),r.width=i.width,r.height=i.height,r},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,n){var r=this._element;t&&(this._borderLeft=U(r,"border-left-width")),e&&(this._borderRight=U(r,"border-right-width")),i&&(this._borderTop=U(r,"border-top-width")),n&&(this._borderBottom=U(r,"border-bottom-width"))},jt.prototype._refreshDimensions=function(){this._updateBoundingRect(),this._updateBorders(1,1,1,1)},jt.prototype._setItemsVisibility=function(t,e,i){var n,r,o=this,s=this.getItems(t),a=i||0,l=!0===a.instant,h=a.onFinish,c=a.layout?a.layout:void 0===a.layout,d=s.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,s.slice(0)),r=0;r<s.length;r++)n=s[r],(e&&!n._isActive||!e&&n._isActive)&&(g=!0),e&&!n._isActive&&(n._layout._skipNextAnimation=!0),e&&n._visibility._isHidden&&y.push(n),n._visibility[m](l,(function(t,e){t||_.push(e),--d<1&&(u(h)&&h(_.slice(0)),o._hasListeners(f)&&o._emit(f,_.slice(0)))}));y.length&&this.refreshItems(y),g&&c&&this.layout("instant"===c,u(c)?c:void 0)}else u(h)&&h(s)},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 n.a})),i.d(e,"surveyStrings",(function(){return n.b})),i.d(e,"DataProvider",(function(){return o})),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 E})),i.d(e,"PlotlyChartAdapter",(function(){return x})),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 n=i(1);i(9),i(10),i(11),i(12),i(13),i(14);n.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"},n.a.localeNames.es="Spanish";n.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"},n.a.localeNames.it="Italian";var r=i(3),o=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 r.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(n){var r=e.filterValues[n],o=typeof r,s=i[n];if("object"==typeof s)return"object"!==o||!function(t,e){var i=Object.keys(t),n=Object.keys(e);if(n.length>i.length)return!1;for(var r=0,o=n;r<o.length;r++){var s=o[r];if(e[s]!=t[s])return!1}return!0}(s,r);var a=i[t.seriesMarkerKey];if(a&&"object"===o)return s!==r[a];if("object"===o&&void 0!==r.start&&void 0!==r.end){var l="number"==typeof s?s:Date.parse(s);return!(!isNaN(l)||(l=parseFloat(s),!isNaN(l)))||(l<r.start||l>=r.end)}return i[n]!==e.filterValues[n]}))})):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],n=[],r=e.getValues(),o={};r.forEach((function(t,e){o[t]=e}));var s=-1!==r.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(r.length).fill(0));n.push(c)}return this.filteredData.forEach((function(e){i.forEach((function(i,r){var h=e[i];if(void 0!==h||s){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){n[r][c][o[t]]++}))}else u.forEach((function(t){a.forEach((function(e){if(void 0!==t[e]){var i=l[e]||0;n[r][i][o[t[e]]]++}}))}));else u.forEach((function(t){return n[0][0][o[t]]++}))}}))})),Array.isArray(e.dataName)?n:n[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 s=i(2),a=function(){function t(){}return t.registerVisualizer=function(e,i){var n=t.vizualizers[e];n||(n=[],t.vizualizers[e]=n),n.push(i)},t.unregisterVisualizer=function(e,i){var n=t.vizualizers[e];if(n){var r=n.indexOf(i);-1!==r&&n.splice(r,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 n;n="text"===t.getType()&&t.inputType?t.inputType:t.getType();var r=a.getVisualizersByType(n).map((function(n){return new n(t,e,i)}));return r.length>1?new(a.getAlternativesVisualizer())(r,t,e,i):r[0]},t}(),h=i(0),u=(i(23),function(){function t(t,e,i,n){void 0===i&&(i={});var s=this;this.question=t,this.options=i,this._name=n,this._showHeader=!0,this._footerVisualizer=void 0,this._dataProvider=void 0,this.labelTruncateLength=27,this.renderResult=void 0,this.toolbarContainer=void 0,this.contentContainer=void 0,this.footerContainer=void 0,this._supportSelection=!1,this.onAfterRender=new r.Event,this.toolbarItemCreators={},this._backgroundColor="#f7f7f7",this._dataProvider=i.dataProvider||new o(e),this._dataProvider.onDataChanged.add((function(){return s.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,"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 r.QuestionCommentModel(this.question.name+(r.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 n=e.toolbarItemCreators[i](t);n&&t.appendChild(n)}))},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.destroyContent=function(t){this.options&&"function"==typeof this.options.destroyContent?this.options.destroyContent(t,this):t.innerHTML=""},t.prototype.renderContent=function(t){this.options&&"function"==typeof this.options.renderContent?this.options.renderContent(t,this):t.innerText=n.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 r=h.b.createElement("h4","sa-visualizer__footer-title",{innerText:n.a.getString("otherCommentTitle")});e.appendChild(r);var o=h.b.createElement("div","sa-visualizer__footer-content");o.style.display=t.otherCommentCollapsed?"none":"block";var s=h.b.createButton((function(){"none"===o.style.display?(o.style.display="block",s.innerText=n.a.getString("hideButton")):(o.style.display="none",s.innerText=n.a.getString(t.otherCommentCollapsed?"showButton":"hideButton")),i.footerVisualizer.invokeOnUpdate()}),n.a.getString("showButton"));e.appendChild(s),e.appendChild(o),this.footerVisualizer.render(o)}},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.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.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,n=[],r=0;r<e;r++)n=n.concat(i);return n},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,r,o){void 0===r&&(r={});var s=t.call(this,e,i,r,o||"number")||this;return s.registerToolbarItem("changeChartType",(function(){return s.chartTypes.length>1?h.b.createSelector(s.chartTypes.map((function(t){return{value:t,text:n.a.getString("chartType_"+t)}})),(function(t){return s.chartType===t.value}),(function(t){s.setChartType(t.target.value)})):null})),s}return Object(s.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,n){var r=[];if(5===n)r=["very high ("+t+")","high","medium","low","very low ("+i+")"];else{r.push(t);for(var o=0;o<n-2;o++)r.push("");r.push(i)}return e.generateTextsCallback?e.generateTextsCallback(this.question,t,i,n,r):r},e.prototype.generateValues=function(t,e){for(var i=[],n=0;n<e;n++)i.push(t/e);return i.push(t),i},e.prototype.generateColors=function(t,e,i){for(var n=this.getColors(),r=[],o=0;o<i;o++)r.push(n[o]);return r.push("rgba(255, 255, 255, 0)"),r},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 n=+i[t.question.name];e++,t._resultAverage+=n,t._resultMin>n&&(t._resultMin=n),t._resultMax<n&&(t._resultMax=n)}})),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,o,s,a){var l=t.call(this,i,o,s,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 r.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:n.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:n.a.getString("defaultOrder"),value:"default"},{text:n.a.getString("ascOrder"),value:"asc"},{text:n.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:n.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(s.b)(e,t),e.prototype.updateEmptyAnswersBtn=function(){this.emptyAnswersBtn&&(this.emptyAnswersBtn.innerText=this._hideEmptyAnswers?n.a.getString("showEmptyAnswers"):n.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?n.a.getString("showPerColumns"):n.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?n.a.getString("hidePercentages"):n.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?n.a.getString("hideMissingAnswers"):n.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.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 r.ItemValue.getTextOrHtmlByValue(t.valuesSource(),e.value)})),i=this.question;return i.hasOther&&e.push(i.otherText),this.showMissingAnswers&&e.unshift(n.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,n){var r=t.reduce((function(t,e){return t+e}),0);e[n]=t.map((function(t){var e=i?+(t/r).toFixed(i):Math.round(t/r*1e4);return r&&e/100}))}));else for(var n=0;n<t[0].length;n++){for(var r=0,o=0;o<t.length;o++)r+=t[o][n];for(o=0;o<t.length;o++){Array.isArray(e[o])||(e[o]=[]);var s=i?+(t[o][n]/r*100).toFixed(i):Math.round(t[o][n]/r*100);e[o][n]=r&&s}}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(),n=this.getColors(),r=this.showPercentages?this.getPercentages():e;if(this.transposeData){e=this.transpose(e),r=this.transpose(r);var o=t;t=i,i=o}if("asc"==this.answersOrder||"desc"==this.answersOrder){var s=this.showPercentages?h.a.zipArrays(i,n,r[0]):h.a.zipArrays(i,n),a=h.a.sortDictionary(s,e[0],"desc"==this.answersOrder),l=h.a.unzipArrays(a.keys);i=l[0],n=l[1],this.showPercentages&&(r[0]=l[2]),e[0]=a.values}var u={datasets:e,labels:i,colors:n,texts:r,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),n=0;n<e;++n)i[n]=new Array(t.length);for(n=0;n<t.length;++n)for(var r=0;r<e;++r)i[r][n]=t[n][r];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,n,r){var o=t.call(this,e,i,n,r||"matrix")||this;return o.getAnswersData(),o}return Object(s.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 r.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 n=0;n<t.length;n++)0!=t[n][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),n=0;n<t.datasets.length;n++){if(this.getHasAnswersInSeries(t.datasets[n])){e.labels.push(t.labels[n]),e.colors.push(t.colors[n]);for(var r=[],o=[],s=0;s<t.datasets[0].length;s++)i[s]&&(r.push(t.datasets[n][s]),o.push(t.texts[n][s]));e.datasets.push(r),e.texts.push(o)}}for(n=0;n<t.datasets[0].length;n++)i[n]&&e.seriesLabels.push(t.seriesLabels[n]);return e},e.prototype.getData=function(){var e=t.prototype.getData.call(this),i=this.getSeriesValues(),n=this.getValues();if(i.length>1){var r=[];return n.forEach((function(t,n){var o=i.map((function(t,i){return e[i][n]}));r.push(o)})),r}return e},e}(d),f=function(t){function e(e,i,n,r){return t.call(this,e,i,n,r||"boolean")||this}return Object(s.b)(e,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 r.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]=n.a.getString("missingAnswersLabel")),t},e.trueColor="",e.falseColor="",e}(d),m=function(t){function e(e,i,n,r){var o=t.call(this,e,i,n,r||"histogram")||this;return o.valueType="number",o._cachedValues=void 0,o._continiousData=void 0,o._cachedIntervals=void 0,"text"!==e.getType()||"date"!==e.inputType&&"datetime"!==e.inputType?o.valueType="number":o.valueType="date",o}return Object(s.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.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 r.ItemValue(i,void 0!==i?i.label:"")}var n=this.getLabels(),o=n.indexOf(t);return new r.ItemValue(this.getValues()[o],n[o])},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 n=e[t.dataName];if(void 0!==n){var r=e[o.seriesMarkerKey]||"";t._continiousData[r].push(t.getContiniousValue(n)),i[n]=n}})),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 n=i[0].continious-1,r=i[i.length-1].continious+1,o=e.IntervalsCount,s=(r-n)/o,a=0;a<o;++a){var l=n+s;this._cachedIntervals.push({start:n,end:l,label:this.getString(n)+"-"+this.getString(l)}),n=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 n=this.intervals,r=[],o=this.getSeriesValues();0===o.length&&o.push("");for(var s=0;s<o.length;++s)r.push(n.map((function(t){return 0}))),this._continiousData[o[s]].forEach((function(t){for(var e=0;e<n.length;++e)if(n[e].start<=t&&t<n[e].end){r[s][e]++;break}}));return r},e.IntervalsCount=10,e.UseIntervalsFrom=10,e}(d),g=function(t){function e(e,i,r,o){var s=t.call(this,i,r,o)||this;if(s.visualizers=e,s.visualizersWithSelection=[],s.onAfterVisualizerRenderCallback=function(){s.afterRender(s.contentContainer)},!e||e.length<2)throw new Error("VisualizerArrayWrapper works with visualizers collection only.");return s.visualizers.forEach((function(t){t.onUpdate=function(){return s.invokeOnUpdate()},t.supportSelection&&(s._supportSelection=!0,s.visualizersWithSelection.push(t))})),s.registerToolbarItem("changeVisualizer",(function(){return h.b.createSelector(s.visualizers.map((function(t){return{value:t.name,text:n.a.getString("visualizer_"+t.name)}})),(function(t){return s.visualizer.name===t.value}),(function(t){return s.setVisualizer(t.target.value)}))})),s.visualizer=e[0],s.visualizer.onAfterRender.add(s.onAfterVisualizerRenderCallback),s}return Object(s.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)}),n.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=n.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 n=t.call(this,e)||this;return n._selector=i,n._muuri=void 0,n._layoutingTimer=void 0,n}return Object(s.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,o,s,a){void 0===s&&(s={}),void 0===a&&(a=void 0);var l=t.call(this,null,o,s,"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 r.Event,l.onStateChanged=new r.Event,l._layoutEngine=s.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&&(n.a.currentLocale=l.options.survey.locale),void 0===a&&(l._elements=l.buildElements(i)),l.haveCommercialLicense=e.haveCommercialLicense||void 0!==s.haveCommercialLicense&&s.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)}))}),n.a.getString("resetFilter"))})),l.registerToolbarItem("addElement",(function(t){if(l.allowHideQuestions){var e=void 0,i=function(i,r){var o=l.hiddenElements;if(o.length>0){var s=h.b.createSelector([{name:void 0,displayName:n.a.getString("addElement")}].concat(o).map((function(t){return{value:t.name,text:t.displayName}})),(function(t){return!1}),(function(t){l.showElement(t.target.value)}));e&&t.replaceChild(s,e)||t.appendChild(s),e=s}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:n.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(s.b)(e,t),e.prototype.showElement=function(t){var e=this.getElement(t),i=this._elements.indexOf(e);e.isVisible=!0;var n=this.renderPanelElement(e,this.contentContainer);this.layoutEngine.add([n],{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,n,r=this.visibleElements[t],o=this.visibleElements[e];i=this._elements.indexOf(r),n=this._elements.indexOf(o),this.moveElement(i,n)},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)}),n.a.getString("hideButton"))})),e.allowMakeQuestionsPrivate&&i.registerToolbarItem("makePrivatePublic",(function(){var i=e.getElement(t.name),r=i.isPublic?"first":"second",o=n.a.getString("makePrivateButton"),s=n.a.getString("makePublicButton");return h.b.createSvgToggleButton("makepublic","makeprivate",o,s,(function(t){setTimeout((function(){return e.makeElementPublic(i)}),0)}),(function(t){setTimeout((function(){return e.makeElementPrivate(i)}),0)}),r)})),i.supportSelection){var r=i,o=new _(r);i.registerToolbarItem("questionFilterInfo",(function(){return o.update(r.selection),o.htmlElement})),r.onDataItemSelected=function(i,n){o.update({value:i,text:n}),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:n.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))}))),n.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),n=h.b.createElement("div");e.appendChild(n);var r=h.b.createElement("div"),o=h.b.createElement("h3"),s=h.b.createElement("div");return o.innerText=t.displayName,n.className=this.allowDynamicLayout?"sa-question sa-question-layouted":"sa-question",o.className="sa-question__title",this.allowDynamicLayout&&(o.className=o.className+" sa-question__title--draggable"),r.className="sa-question__content",r.style.backgroundColor=this.backgroundColor,r.appendChild(o),r.appendChild(s),n.appendChild(r),i.render(s),t.renderedElement=n,n},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),n=Object(s.a)(Object(s.a)({},e),null==i?void 0:i.getState());return void 0!==n.renderedElement&&delete n.renderedElement,n})))}},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(s.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,n,r){void 0===n&&(n={});var o=t.call(this,e,i,n,r||"panelDynamic")||this;return o._panelVisualizer=void 0,o.onAfterRenderPanelCallback=function(){o.afterRender(o.contentContainer)},(n=Object.assign({},n)).allowDynamicLayout=!1,n.dataProvider=void 0,o._panelVisualizer=new C(o.getQuestions(),[],n),o._panelVisualizer.onAfterRender.add(o.onAfterRenderPanelCallback),o.updateData(i),o}return Object(s.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,n){return t.call(this,e,i,n)||this}return Object(s.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,n,o){void 0===n&&(n={});var s=t.call(this,e,i,n,o||"matrixDropdown")||this;s._matrixDropdownVisualizer=void 0,s.onPanelAfterRenderCallback=function(){s.afterRender(s.contentContainer)},(n=Object.assign({},n)).dataProvider=void 0,n.allowDynamicLayout=!1,n.seriesValues=e.rows.map((function(t){return t.value})),n.seriesLabels=e.rows.map((function(t){return t.text}));var l=s.getQuestions();if(1==n.seriesValues.length&&l.every((function(t){return r.Helpers.isArraysEqual(t.choices,s.question.choices)}))){var h=a.getVisualizersByType("matrixdropdown-grouped");s._matrixDropdownVisualizer=new h[0](s.question,[],n)}else s._matrixDropdownVisualizer=new C(l,[],n);return s._matrixDropdownVisualizer.onAfterRender.add(s.onPanelAfterRenderCallback),s.updateData(i),s}return Object(s.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 n=i[t.question.name];n&&Object.keys(n).forEach((function(t){var i=Object.assign({},n[t]);i[o.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 E=function(){function t(){}return t.setup=function(t,e){return this.setups[t](e)},t.setupPie=function(e){var i=e.getAnswersData(),n=i.datasets,r=i.labels,o=i.colors,s=(i.texts,i.seriesLabels),a=[],l=s.length>1,h={type:e.chartType,y:l?s:r,text:(l?s:r).map((function(i){return t.getTruncatedLabel(i,e.options.labelTruncateLength)})),hoverinfo:"x+y",mode:"markers",marker:{}};h.hoverinfo="label+value+percent",h.marker.colors=o,h.textposition="inside","doughnut"===e.chartType&&(h.type="pie",h.hole=.4),l||(h.marker.symbol="circle",h.marker.size=16),n.forEach((function(t,e){a.push(Object.assign({},h,{values:t,labels:l?s:r,customdata:l?s:r}))}));var u={font:{family:"Segoe UI, sans-serif",size:14,weight:"normal",color:"#404040"},height:(r.length<10?50*r.length+100:550)*Math.round(a.length/2)+25,margin:{l:0,t:25,b:0,r:10},colorway:o,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=[],r.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(),n=i.datasets,r=i.labels,o=i.colors,s=i.texts,a=i.seriesLabels,l=[],h=a.length>1,u=h?a:r,c={type:e.chartType,y:u,text:u,customdata:h?a:r,hoverinfo:"text",orientation:"h",mode:"markers",textposition:"none",width:.5,bargap:.5,marker:{}};c.marker.color=o,n.forEach((function(t,i){var n=Object.assign({},c,{x:t,text:s[i],hovertext:u.map((function(t,e){return"".concat(s[i][e],", ").concat(t)}))});if(e.showPercentages){var r=e.showOnlyPercentages?"%{text}%":"%{value} (%{text}%)";n.textposition="inside",n.texttemplate=r,n.bargap=.1}l.push(n)}));var d={font:{family:"Segoe UI, sans-serif",size:14,weight:"normal",color:"#404040"},height:30*(r.length+1)+30+30,margin:{t:30,b:30,r:10},colorway:o,hovermode:"closest",yaxis:{automargin:!0,type:"category",orientation:"h",tickmode:"array",tickvals:u,ticktext:u.map((function(i){return t.getTruncatedLabel(i,e.options.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*(r.length+1)*a.length+30+30,r.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 n=e.showPercentages?"%":"";l[i].hovertext=[],u.forEach((function(e,r){l[i].hovertext.push("".concat(t.y[r]," : ").concat(t.name,", ").concat(t.text[r]).concat(n))}))}))),{traces:l,layout:d,hasSeries:h}},t.setupVBar=function(t){var e=t.getAnswersData(),i=e.datasets,n=e.labels,r=e.colors,o=e.texts,s=e.seriesLabels,a=[],l=s.length>1,h={font:{family:"Segoe UI, sans-serif",size:14,weight:"normal",color:"#404040"},margin:{t:30,b:30,r:10},colorway:r,hovermode:"closest",plot_bgcolor:t.backgroundColor,paper_bgcolor:t.backgroundColor,showlegend:!1},u={type:"bar",customdata:l?s:n,hoverinfo:"x+y",mode:"markers",textposition:"none",width:.5,bargap:.5,marker:{}};return u.marker.color=r,i.forEach((function(e,i){var r=Object.assign({},u,{x:n,y:t.showPercentages?o[i].map((function(t){return t/100})):e,text:o[i]});if(t.showPercentages){var s=t.showOnlyPercentages?"%{text}%":"%{value} (%{text}%)";r.textposition="inside",r.texttemplate=s,r.width=.9,r.bargap=.1}a.push(r)})),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(),n=i.datasets,r=i.labels,o=i.colors,s=(i.texts,i.seriesLabels),a=s.length>1,l=[],h={type:"scatter",y:(a?s:r).map((function(i){return t.getTruncatedLabel(i,e.options.labelTruncateLength)})),customdata:a?s:r,text:a?s:r,hoverinfo:"x+y",orientation:"h",mode:"markers",width:.5,marker:{}};a||(h.marker.symbol="circle",h.marker.size=16),n.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*(r.length+1)+30+30,margin:{t:30,b:30,r:10},colorway:o,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,r.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 r.Event,t.onPlotCreating=new r.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}(),A=i(7),P=i.n(A),x=function(){function t(t){this.model=t,this._chart=void 0}return t.prototype.patchConfigParameters=function(t,e,i,n){},Object.defineProperty(t.prototype,"chart",{get:function(){return this._chart},enumerable:!1,configurable:!0}),t.prototype.create=function(t){var e=this,i=E.setup(this.model.chartType,this.model),o={displaylogo:!1,responsive:!0,locale:n.a.currentLocale,modeBarButtonsToRemove:["toImage"],modeBarButtonsToAdd:[{name:"toImageSjs",title:n.a.getString("saveDiagramAsPNG"),icon:P.a.Icons.camera,click:function(t){var i={format:E.imageExportFormat,filename:e.model.question.name};E.onImageSaving.fire(e.model,i),P.a.downloadImage(t,i)}}]};void 0!==k.displayModeBar&&(o.displayModeBar=k.displayModeBar),this.patchConfigParameters(t,i.traces,i.layout,o);var s={traces:i.traces,layout:i.layout,config:o};E.onPlotCreating.fire(this.model,s);var a=P.a.newPlot(t,s.traces,s.layout,s.config);t.on("plotly_click",(function(t){var n;if(t.points.length>0){var o="";if(i.hasSeries){o=t.points[0].data.name;var s=t.points[0].label,a=e.model.getSeriesValues()[e.model.getSeriesLabels().indexOf(s)],l=e.model.getSelectedItemByText(o);h=new r.ItemValue(((n={})[a]=l.value,n),s+": "+l.text);e.model.setSelection(h)}else{o=Array.isArray(t.points[0].customdata)?t.points[0].customdata[0]:t.points[0].customdata;var h=e.model.getSelectedItemByText(o);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){P.a.purge(t),this._chart=void 0},t}(),k=function(t){function e(i,n,r,o){void 0===r&&(r={});var s=t.call(this,i,n,r,o)||this;return s.chartTypes=[].concat(e.types),s.getSeriesValues().length>0&&-1===s.chartTypes.indexOf("stackedbar")&&s.chartTypes.push("stackedbar"),r.allowExperimentalFeatures&&s.chartTypes.splice(1,0,"vbar"),s.chartType=s.chartTypes[0],-1!==s.chartTypes.indexOf(r.defaultChartType)&&(s.chartType=r.defaultChartType),s._chartAdapter=new x(s),s}return Object(s.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(),n=this.getValues();if(i.length>1){var r=[];return n.forEach((function(t,n){var o=i.map((function(t,i){return e[i][n]}));r.push(o)})),r}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,n,r,o){var s=t.call(this,i,n,r,o)||this;return s.chartTypes=e.types,s.chartType=s.chartTypes[0],s._chartAdapter=new x(s),s}return Object(s.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(s.b)(e,t),e.prototype.patchConfigParameters=function(t,e,i,n){var r=this.model.getColors(),o=[z.trueColor||r[0],z.falseColor||r[1]];this.model.showMissingAnswers&&o.push(r[2]),"pie"===this.model.chartType||"doughnut"===this.model.chartType?e.forEach((function(t){t.marker.colors=o})):"bar"===this.model.chartType&&e.forEach((function(t){t.marker.color=o}))},e}(x),z=function(t){function e(i,n,r,o){var s=t.call(this,i,n,r,o)||this;return s.chartTypes=e.types,s.chartType=s.chartTypes[0],s._chartAdapter=new V(s),s}return Object(s.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(s.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(),n=this.getEmptyData();return e.forEach((function(e){t.applyResultToPlotlyData(e,n,i)})),[n]},e.prototype.applyResultToPlotlyData=function(t,e,i){t&&e&&i&&t.forEach((function(t,n,r){var o=i.indexOf(t);e[o]=+e[o]+(r.length-n)}))},e}(k);a.registerVisualizer("ranking",M);var L=function(t){function e(i,n,r,o){var s=t.call(this,i,n,r,o)||this;return s.chartTypes=e.types,s.chartType=s.chartTypes[0],s._chartAdapter=new x(s),s}return Object(s.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,n,r){var o=t.call(this,e,i,n,r||"matrixDropdownGrouped")||this;return o.getAnswersData(),o}return Object(s.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})),n=this.dataProvider.getData({dataName:e,getValues:function(){return t},getLabels:function(){return t},getSeriesValues:function(){return i},getSeriesLabels:function(){return i}}),r=[];return t.forEach((function(t,i){var o=e.map((function(t,e){return n[e][0][i]}));r.push(o)})),r},e}(d));a.registerVisualizer("matrixdropdown-grouped",L);var B=function(t){function e(i,n,r,o){var s=t.call(this,i,n,r,o)||this;return s.chartTypes=e.types,s.chartType=s.chartTypes[0],s._chartAdapter=new x(s),s}return Object(s.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(),n=this.getValues();if(i.length>1){var r=[];return n.forEach((function(t,n){var o=i.map((function(t,i){return e[i][n]}));r.push(o)})),r}return e},e.types=["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(),r=i[0],o=i[1],s=i[2];if("rating"===e.getType()){var a=e.visibleRateValues;s=a[a.length-1].value,o=a[0].value}var l=this.model.generateColors(s,o,I.stepsCount);I.showAsPercentage&&(r=h.a.toPercentage(r,s),o=h.a.toPercentage(o,s),s=h.a.toPercentage(s,s));var u=[{type:"indicator",mode:"gauge+number",gauge:{axis:{range:[o,s]},shape:this.model.chartType,bgcolor:"white",bar:{color:l[0]}},value:r,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:n.a.currentLocale,responsive:!0}};return E.onPlotCreating.fire(this.model,d),P.a.newPlot(t,d.data,d.layout,d.config)},t.prototype.destroy=function(t){P.a.purge(t),this._chart=void 0},t}(),I=function(t){function e(i,n,r,o){var s=t.call(this,i,n,r,o)||this;return s.chartTypes=e.types,s.chartType=s.chartTypes[0],s._chartAdapter=new R(s),s}return Object(s.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"]},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,r=this.model.getData(),o=(this.model.getColors(),h.b.createElement("canvas","")),s=h.b.createElement("p","",{innerText:n.a.getString("noResults")});if(0!==r.length){e.appendChild(o);var a={list:r,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 this._wordcloud=H()(o,a),this._wordcloud}e.appendChild(s)},t.prototype.destroy=function(t){this._wordcloud=void 0},t.drawOutOfBound=!1,t.shrinkToFit=!0,t.abortThreshold=void 0,t.weightFactor=20,t}(),G=function(t){function e(e,i,n,r){var o=t.call(this,e,i,n,r||"wordcloud")||this;return o._wordcloudAdapter=new F(o),o}return Object(s.b)(e,t),e.prototype.getData=function(){var t=this,e={},i=[],r=n.a.currentLocale;i=r?N.getStopWords(r):N.getStopWords();var o=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(o):"object"==typeof i?Object.keys(i).forEach((function(t){return o(i[t])})):o(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,r=e.data,o=h.b.createElement("p","",{innerText:n.a.getString("noResults")});if(0!==r.length){var s=h.b.createElement("table","sa-text-table");s.style.backgroundColor=this.model.backgroundColor,t.appendChild(s),r.forEach((function(t){for(var e=h.b.createElement("tr"),n=0;n<i;n++){var r=h.b.createElement("td","sa-text-table__cell",{textContent:t[n]});e.appendChild(r)}s.appendChild(e)})),t.className="sa-text-table__container",t.appendChild(s)}else t.appendChild(o)},t.prototype.destroy=function(t){t.innerHTML=""},t}(),Y=function(t){function e(e,i,n,r){var o=t.call(this,e,i,n,r||"text")||this;return o._textTableAdapter=new X(o),o}return Object(s.b)(e,t),e.prototype.getData=function(){var t=this,e=[],i=0;return this.data.forEach((function(n){var r=n[t.question.name],o=[];r&&(Array.isArray(r)?o.concat(r):"object"==typeof r?Object.keys(r).forEach((function(t){return o.push(r[t])})):o.push(r),e.push(o),o.length>i&&(i=o.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(),r=i.datasets,o=i.labels,s=(i.colors,i.texts),a=(i.seriesLabels.length,h.b.createElement("p","",{innerText:n.a.getString("noResults")}));0!==r.length&&0!==r[0].length?r.forEach((function(i,r){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:n.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:n.a.getString("percent")});l.appendChild(d);var p=h.b.createElement("th","sa-choices-table__cell-header",{textContent:n.a.getString("responses")});l.appendChild(p),a.appendChild(l),i.forEach((function(t,e){var i=h.b.createElement("tr"),n=h.b.createElement("td","sa-choices-table__cell",{textContent:o[e]});i.appendChild(n);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=s[r][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:s[r][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,n,r){var o=t.call(this,e,i,n,r||"choices")||this;return o._choicesTableAdapter=new Q(o),o.answersOrder="asc",o.showPercentages=!0,o}return Object(s.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 n=i.length;n--;)e===i[n]&&i.splice(n,1);return this},e.prototype.emit=function(t,e,i,n){if(this._isDestroyed)return this;var r=this._events[t];if(!r||!r.length)return this;var o,s=this._queue,a=s.length,l=arguments.length-1;for(o=0;o<r.length;o++)s.push(r[o]);for(++this._counter,o=a,a=s.length;o<a;o++)if(0===l?s[o]():1===l?s[o](e):2===l?s[o](e,i):s[o](e,i,n),this._isDestroyed)return this;return--this._counter,this._counter||(s.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",n="transform",r=window.document.documentElement.style,o=!1;["","Webkit","Moz","O","ms"].forEach((function(t){if(!o){var e=t?t+"Transform":"transform";void 0!==r[e]&&(t=t.toLowerCase(),i=t?"-"+t+"-transform":"transform",n=e,o=!0)}}));var s="function"==typeof WeakMap?new WeakMap:null;function a(t,e){var n=s&&s.get(t);return n||(n=window.getComputedStyle(t,null),s&&s.set(t,n)),n.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?n: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 n=this._animation,r=this._props,o=this._values,s=i||0,a=!1;if(n){var l,h=0;for(var d in e)if(++h,-1===(l=r.indexOf(d))||e[d]!==o[l]){a=!0;break}a||h===r.length||(a=!0)}if(a&&n.cancel(),this._callback=u(s.onFinish)?s.onFinish:null,!n||a){for(d in r.length=o.length=0,e)r.push(d),o.push(e[d]);var p=this._keyframes;p[0]=t,p[1]=e;var f=this._options;f.duration=s.duration||300,f.easing=s.easing||"ease";var m=this._element;(n=m.animate(p,f)).onfinish=this._onFinish,this._animation=n,c(m,e)}}},d.prototype.stop=function(t){if(!this._isDestroyed&&this._animation){var e,i,r,o=this._element,s=this._props,l=this._values;if(t)c(o,t);else for(r=0;r<s.length;r++)i=a(o,h(e=s[r])),o.style["transform"===e?n:e]=i;this._animation.cancel(),this._animation=this._callback=null,s.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,n,r=e[0].toUpperCase()+e.slice(1),o=0;o<p.length;){if((n=(i=p[o])?i+r:e)in t)return n;++o}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),E=!!g&&{passive:!0},A=f(window.document.documentElement.style,"touchAction");function P(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",P._preventDefault,!1),t.addEventListener(P._events.start,this._preStartCheck,E),!C||S||T||t.addEventListener(P._mouseEvents.start,this._preStartCheck,E)}function x(){this._nextStep=null,this._queue=[],this._reads={},this._writes={},this._batch=[],this._batchReads={},this._batchWrites={},this._step=this._step.bind(this)}P._pointerEvents={start:"pointerdown",move:"pointermove",cancel:"pointercancel",end:"pointerup"},P._msPointerEvents={start:"MSPointerDown",move:"MSPointerMove",cancel:"MSPointerCancel",end:"MSPointerUp"},P._touchEvents={start:"touchstart",move:"touchmove",cancel:"touchcancel",end:"touchend"},P._mouseEvents={start:"mousedown",move:"mousemove",cancel:"",end:"mouseup"},P._events=S?P._pointerEvents:T?P._msPointerEvents:C?P._touchEvents:P._mouseEvents,P._emitter=new e,P._activeInstances=[],P._preventDefault=function(t){t.preventDefault&&!1!==t.cancelable&&t.preventDefault()},P._activateInstance=function(t){P._activeInstances.indexOf(t)>-1||(P._activeInstances.push(t),P._emitter.on(v,t._onMove),P._emitter.on(w,t._onCancel),P._emitter.on(b,t._onEnd),1===P._activeInstances.length&&P._bindListeners())},P._deactivateInstance=function(t){var e=P._activeInstances.indexOf(t);-1!==e&&(P._activeInstances.splice(e,1),P._emitter.off(v,t._onMove),P._emitter.off(w,t._onCancel),P._emitter.off(b,t._onEnd),P._activeInstances.length||P._unbindListeners())},P._bindListeners=function(){var t=P._events;window.addEventListener(t.move,P._onMove,E),window.addEventListener(t.end,P._onEnd,E),t.cancel&&window.addEventListener(t.cancel,P._onCancel,E)},P._unbindListeners=function(){var t=P._events;window.removeEventListener(t.move,P._onMove,E),window.removeEventListener(t.end,P._onEnd,E),t.cancel&&window.removeEventListener(t.cancel,P._onCancel,E)},P._getEventPointerId=function(t){return"number"==typeof t.pointerId?t.pointerId:t.changedTouches?t.changedTouches[0]?t.changedTouches[0].identifier:null:1},P._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},P._onMove=function(t){P._emitter.emit(v,t)},P._onCancel=function(t){P._emitter.emit(w,t)},P._onEnd=function(t){P._emitter.emit(b,t)},P.prototype._reset=function(){this._isDestroyed||(this._pointerId=null,this._startTime=0,this._startX=0,this._startY=0,this._currentX=0,this._currentY=0,this._startEvent=null,this._element.removeEventListener(P._touchEvents.start,this._abortNonCancelable,E),P._deactivateInstance(this))},P.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}},P.prototype._emit=function(t,e){this._emitter.emit(t,this._createEvent(t,e))},P.prototype._getTrackedTouch=function(t){return null===this._pointerId?null:P._getTouchById(t,this._pointerId)},P.prototype._preStartCheck=function(t){this._isDestroyed||this.isDragging()||D&&!1===t.cancelable||t.button||(this._pointerId=P._getEventPointerId(t),null!==this._pointerId&&(this._startEvent=t,C&&(S||T)?(D&&this._element.addEventListener(P._touchEvents.start,this._abortNonCancelable,E),m(this._onStart)):this._onStart()))},P.prototype._abortNonCancelable=function(t){this._element.removeEventListener(P._touchEvents.start,this._abortNonCancelable,E),this._startEvent&&!1===t.cancelable&&(this._pointerId=null,this._startEvent=null)},P.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),P._activateInstance(this))}},P.prototype._onMove=function(t){var e=this._getTrackedTouch(t);e&&(this._currentX=e.clientX,this._currentY=e.clientY,this._emit(v,t))},P.prototype._onCancel=function(t){this._getTrackedTouch(t)&&(this._emit(w,t),this._reset())},P.prototype._onEnd=function(t){this._getTrackedTouch(t)&&(this._emit(b,t),this._reset())},P.prototype.isDragging=function(){return null!==this._pointerId},P.prototype.setTouchAction=function(t){this._touchAction=t,A&&(this._cssProps[A]="",this._element.style[A]=t),C&&(this._element.removeEventListener(P._touchEvents.start,P._preventDefault,!1),this._element.style[A]!==t&&this._element.addEventListener(P._touchEvents.start,P._preventDefault,!1))},P.prototype.setCssProps=function(t){if(t){var e,i,n=this._cssProps,r=this._element;for(e in n)r.style[e]=n[e],delete n[e];for(e in t)t[e]&&("touchAction"!==e?(i=f(r.style,e))&&(n[i]="",r.style[i]=t[e]):this.setTouchAction(t[e]))}},P.prototype.getDeltaX=function(){return this._currentX-this._startX},P.prototype.getDeltaY=function(){return this._currentY-this._startY},P.prototype.getDistance=function(){var t=this.getDeltaX(),e=this.getDeltaY();return Math.sqrt(t*t+e*e)},P.prototype.getDeltaTime=function(){return this._startTime?Date.now()-this._startTime:0},P.prototype.on=function(t,e){this._emitter.on(t,e)},P.prototype.off=function(t,e){this._emitter.off(eventName,e)},P.prototype.destroy=function(){if(!this._isDestroyed){var t=this._element,e=P._events;for(var i in this._reset(),this._emitter.destroy(),t.removeEventListener(e.start,this._preStartCheck,E),t.removeEventListener(P._mouseEvents.start,this._preStartCheck,E),t.removeEventListener("dragstart",P._preventDefault,!1),t.removeEventListener(P._touchEvents.start,P._preventDefault,!1),this._cssProps)t.style[i]=this._cssProps[i],delete this._cssProps[i];this._element=null,this._isDestroyed=!0}},x.prototype.add=function(t,e,i,n){var r=this._queue.indexOf(t);r>-1&&(this._queue[r]=void 0),n?this._queue.unshift(t):this._queue.push(t),this._reads[t]=e,this._writes[t]=i,this._nextStep||(this._nextStep=m(this._step))},x.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])},x.prototype._step=function(){var t,e,i=this._queue,n=this._reads,r=this._writes,o=this._batch,s=this._batchReads,a=this._batchWrites,l=i.length;for(this._nextStep=null,e=0;e<l;e++)(t=i[e])&&(o.push(t),s[t]=n[t],delete n[t],a[t]=r[t],delete r[t]);for(i.length=0,e=0;e<l;e++)s[t=o[e]]&&(s[t](),delete s[t]);for(e=0;e<l;e++)a[t=o[e]]&&(a[t](),delete a[t]);o.length=0,!this._nextStep&&i.length&&(this._nextStep=m(this._step))};var k=new x;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 n="number"==typeof i?i:-1;n<0&&(n=t.length-n+1),t.splice.apply(t,j.concat(n,0,e)),j.length=0}function q(t,e,i){var n=t.length,r=Math.max(0,i?n:n-1);return e>r?r:e<0?Math.max(r+e+1,0):e}function H(t,e,i){if(!(t.length<2)){var n=q(t,e),r=q(t,i);n!==r&&t.splice(r,0,t.splice(n,1)[0])}}function F(t,e,i){if(!(t.length<2)){var n,r=q(t,e),o=q(t,i);r!==o&&(n=t[r],t[r]=t[o],t[o]=n)}}var G=0;function X(t,e){var i,n=++G+"debounce";return e>0?function(r){void 0!==i&&(i=window.clearTimeout(i),k.cancel(n),"finish"===r&&t()),"cancel"!==r&&"finish"!==r&&(i=window.setTimeout((function(){i=void 0,k.add(n,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,n=(e?t:t.parentElement)||i;n&&n!==i&&"static"===a(n,"position")&&!Y(n);)n=n.parentElement||i;return n}function U(t,e){return parseFloat(a(t,e))||0}var W={},K={},Z={};function J(t,e){var i,n=e||{};return n.left=0,n.top=0,t===document||(n.left=window.pageXOffset||0,n.top=window.pageYOffset||0,t.self===window.self||(i=t.getBoundingClientRect(),n.left+=i.left,n.top+=i.top,n.left+=U(t,"border-left-width"),n.top+=U(t,"border-top-width"))),n}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 n=i||[],r=e?t:t.parentNode;r&&r!==document;)r.getRootNode&&r instanceof DocumentFragment?r=r.getRootNode().host:(tt(r)&&n.push(r),r=r.parentNode);return n.push(window),n}var it,nt,rt,ot,st={},at=/^matrix3d/,lt=/([^,]*,){4}/,ht=/([^,]*,){12}/,ut=/[^,]*,/;function ct(t){st.x=0,st.y=0;var e=a(t,"transform");if(!e||"none"===e)return st;var i=at.test(e),n=e.replace(i?ht:lt,""),r=n.replace(ut,"");return st.x=parseFloat(n)||0,st.y=parseFloat(r)||0,st}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(),n=i._settings;this._item=t,this._gridId=i._id,this._isDestroyed=!1,this._isMigrating=!1,this._startPredicate=u(n.dragStartPredicate)?n.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 r=n.dragSortHeuristics.sortInterval;this._checkOverlapDebounce=X(this._checkOverlap,r),this._dragger=new P(e,n.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 n=t._drag,r=n._startPredicateData||n._setupStartPredicate(i);if(!e.isFinal)return!(!r.handleElement&&(r.handleElement=n._getStartPredicateHandle(e),!r.handleElement))&&(r.delay&&(r.event=e,r.delayTimer||(r.delayTimer=window.setTimeout((function(){r.delay=0,n._resolveStartPredicate(r.event)&&(n._forceResolveStartPredicate(r.event),n._resetStartPredicate())}),r.delay))),n._resolveStartPredicate(e));n._finishStartPredicate(e)},ft.defaultSortPredicate=(it={},nt={},rt={},ot=[],function(t,e){var i=t._drag,n=i._getGrid(),r=e&&"number"==typeof e.threshold?e.threshold:50,o=e&&"swap"===e.action?"swap":"move";it.width=t._width,it.height=t._height,it.left=i._elementClientX,it.top=i._elementClientY;var s=function(t,e,i){var n,r,o,s,a=null,l=e._settings.dragSort,h=-1;if(!0===l?(ot[0]=e,r=ot):r=l.call(e,t),!Array.isArray(r))return a;for(s=0;s<r.length;s++)(o=r[s])._isDestroyed||(o._updateBoundingRect(),nt.width=o._width,nt.height=o._height,nt.left=o._left,nt.top=o._top,(n=mt(it,nt))>i&&n>h&&(h=n,a=o));return ot.length=0,a}(t,n,r);if(!s)return!1;var a,l,h,u,c,d=0,p=0,f=-1;for(s===n?(it.left=i._gridX+t._marginLeft,it.top=i._gridY+t._marginTop):(s._updateBorders(1,0,1,0),d=s._left+s._borderLeft,p=s._top+s._borderTop),c=0;c<s._items.length;c++)(h=s._items[c])._isActive&&h!==t&&(l=!0,nt.width=h._width,nt.height=h._height,nt.left=h._left+h._marginLeft+d,nt.top=h._top+h._marginTop+p,(u=mt(it,nt))>f&&(a=c,f=u));return f<r&&t.getGrid()!==s&&(a=l?-1:0,f=1/0),f>=r&&(rt.grid=s,rt.index=a,rt.action=o,rt)}),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[n]=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,n=this._container,r=this._scrollers;if(r.length=0,et(this._item._element,!1,r),n!==i)for(et(i,!0,t=[]),e=0;e<t.length;e++)r.indexOf(t[e])<0&&r.push(t[e]);for(e=0;e<r.length;e++)r[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,n=i;if(!e.handle)return n;for(n=t.target;n&&!R(n,e.handle);)n=n!==i?n.parentElement:null;return n||null},ft.prototype._resolveStartPredicate=function(t){var e=this._startPredicateData;if(!(t.distance<e.distance||e.delay)){var i=e.handleElement.getBoundingClientRect(),n=i.left+(window.pageXOffset||0),r=i.top+(window.pageYOffset||0),o=i.width,s=i.height;return this._resetStartPredicate(),o&&s&&t.pageX>=n&&t.pageX<n+o&&t.pageY>=r&&t.pageY<r+s}},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 n=t.clientX,r=t.clientY,o=n-this._hX2,s=r-this._hY2,a=i>3&&e.minBounceBackAngle>0;if(a||(this._hBlockedIndex=null),Math.abs(o)>i||Math.abs(s)>i){if(a){var l=Math.atan2(o,s),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=n,this._hY2=r,!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,n,r,o,s,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&&(s=(e=a.getGrid())!==(n=t.grid||e),i=e._items.indexOf(a),r=q(n._items,t.index,s),o="swap"===t.action?"swap":"move",(s||r!==this._hBlockedIndex)&&(s?(this._hBlockedIndex=null,e._hasListeners("beforeSend")&&e._emit("beforeSend",{item:a,fromGrid:e,fromIndex:i,toGrid:n,toIndex:r}),n._hasListeners("beforeReceive")&&n._emit("beforeReceive",{item:a,fromGrid:e,fromIndex:i,toGrid:n,toIndex:r}),a._gridId=n._id,this._isMigrating=a._gridId!==this._gridId,e._items.splice(i,1),N(n._items,a,r),a._sortData=null,e._hasListeners("send")&&e._emit("send",{item:a,fromGrid:e,fromIndex:i,toGrid:n,toIndex:r}),n._hasListeners("receive")&&n._emit("receive",{item:a,fromGrid:e,fromIndex:i,toGrid:n,toIndex:r}),e.layout(),n.layout()):i!==r&&(this._hBlockedIndex=i,("swap"===o?F:H)(e._items,i,r),e._hasListeners("move")&&e._emit("move",{item:a,fromIndex:i,toIndex:r,action:o}),e.layout())))}},ft.prototype._finishMigration=function(){var t,e,i=this._item,r=i._release,o=i._element,s=i._isActive,a=i.getGrid(),l=a._element,h=a._settings,u=h.dragContainer||l,d=this._getGrid()._settings,p=o.parentNode;this._isMigrating=!1,this.destroy(),pt(o,d.itemClass),pt(o,d.itemVisibleClass),pt(o,d.itemHiddenClass),I(o,h.itemClass),I(o,s?h.itemVisibleClass:h.itemHiddenClass),u!==p&&(u.appendChild(o),e=$(p,u,!0),(t=ct(o)).x-=e.left,t.y-=e.top),i._refreshDimensions(),i._refreshSortData(),e=$(u,l,!0),r._containerDiffX=e.left,r._containerDiffY=e.top,i._drag=h.dragEnabled?new ft(i):null,u!==p&&(o.style[n]=dt(t.x,t.y)),i._child.removeAttribute("style"),c(i._child,s?h.visibleStyles:h.hiddenStyles),r.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,r=e._element,o=this._getGrid(),s=o._settings,a=e._release,l=e._migrate,h=o._element,u=s.dragContainer||h,c=Q(u,!0),d=ct(r),p=d.x,f=d.y,m=r.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,s.dragPlaceholder.enabled&&e._dragPlaceholder.create(),o._emit("dragInit",e,t),g&&(this._containerDiffX=i.left,this._containerDiffY=i.top,r.parentNode===u?(this._gridX=p-this._containerDiffX,this._gridY=f-this._containerDiffY):(this._left=p+this._containerDiffX,this._top=f+this._containerDiffY,u.appendChild(r),r.style[n]=dt(this._left,this._top))),I(r,s.itemDraggingClass),this._bindScrollListeners(),o._emit("dragStart",e,t)}},ft.prototype._onMove=function(t){var e=this._item;if(e._isActive){var i,n,r,o=this._getGrid()._settings.dragAxis;if("y"!==o){var s=t.clientX-this._dragEvent.clientX;this._left+=s,this._gridX+=s,this._elementClientX+=s}if("x"!==o){var a=t.clientY-this._dragEvent.clientY;this._top+=a,this._gridY+=a,this._elementClientY+=a}this._dragEvent=t,i=e._id,n=this._prepareMove,r=this._applyMove,k.add(i+"move",n,r,!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[n]=dt(this._left,this._top),this._getGrid()._emit("dragMove",t,this._dragEvent))},ft.prototype._onScroll=function(t){var e,i,n,r=this._item;r._isActive?(this._scrollEvent=t,e=r._id,i=this._prepareScroll,n=this._applyScroll,k.add(e+"scroll",i,n,!0)):this.stop()},ft.prototype._prepareScroll=function(){var t=this._item;if(t._isActive){var e,i=t._element,n=this._getGrid(),r=n._settings,o=r.dragAxis,s=n._element,a=i.getBoundingClientRect(),l=this._elementClientX-a.left,h=this._elementClientY-a.top;this._container!==s&&(e=$(this._containingBlock,s),this._containerDiffX=e.left,this._containerDiffY=e.top),"y"!==o&&(this._left+=l,this._gridX=this._left-this._containerDiffX),"x"!==o&&(this._top+=h,this._gridY=this._top-this._containerDiffY),r.dragSort&&this._checkOverlapDebounce()}},ft.prototype._applyScroll=function(){var t=this._item;t._isActive&&(t._element.style[n]=dt(this._left,this._top),this._getGrid()._emit("dragScroll",t,this._scrollEvent))},ft.prototype._onEnd=function(t){var e=this._item,i=e._element,n=this._getGrid(),r=n._settings,o=e._release;e._isActive?(V(e._id),z(e._id),r.dragSort&&this._checkOverlapDebounce("finish"),this._unbindScrollListeners(),o._containerDiffX=this._containerDiffX,o._containerDiffY=this._containerDiffY,this._reset(),pt(i,r.itemDraggingClass),n._emit("dragEnd",e,t),this._isMigrating?this._finishMigration():o.start()):this.stop()},gt.prototype._onLayoutStart=function(){var t=this._item,e=t.getGrid(),i=e._items.indexOf(t),n=e._layout.slots[2*i],r=e._layout.slots[2*i+1];if(this._didMigrate||t._left!==n||t._top!==r){var o,s,a;if(n+=t._marginLeft,r+=t._marginTop,!(e._settings.dragPlaceholder.duration>0)||this._didMigrate){M(t._id);var l={transform:dt(n,r)};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=n,this._nextTop=r,o=t._id,s=this._setupAnimation,a=this._startAnimation,k.add(o+"placeholder",s,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,n=this._nextLeft,r=this._nextTop,o={transform:dt(n,r)};if(e!==n||i!==r){var s=this._item.getGrid()._settings.dragPlaceholder,a={transform:dt(e,i)};t.start(a,o,{duration:s.duration,easing:s.easing,onFinish:this._onLayoutEnd})}else t.isAnimating()&&t.stop(o)}},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(),n=i._settings,r=this._animate;t=u(n.dragPlaceholder.createElement)?n.dragPlaceholder.createElement(e):window.document.createElement("div"),this._element=t,r._element=t,this._className=n.itemPlaceholderClass||"",this._className&&I(t,this._className);var o=e._left+e._marginLeft,s=e._top+e._marginTop;c(t,{display:"block",position:"absolute",left:"0",top:"0",width:e._width+"px",height:e._height+"px",transform:dt(o,s)}),i.on("layoutStart",this._onLayoutStart),i.on("dragReleaseEnd",this._onReleaseEnd),i.on("beforeSend",this._onMigrate),u(n.dragPlaceholder.onCreate)&&n.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(),n=i._settings,r=this._animate;this._resetAfterLayout=!1,M(e._id),r.stop(),r._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(n.dragPlaceholder.onRemove)&&n.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,n=this._queue,r=n.length;if(!r)return this;var o=1===r,s=o?n[0]:n.slice(0);if(n.length=0,o)return s(t,e),this;for(i=0;i<r&&(s[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,n,r,o,s=this._item,a=s._element,l=s._release,h=s.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,s),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,n=s._id,r=this._setupAnimation,o=this._startAnimation,k.add(n+"layout",r,o),this):(this._updateOffsets(),this._updateTargetStyles(),i=s._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,n=this._item;return i=n._id,k.cancel(i+"layout"),n._animate.stop(e),pt(n._element,n.getGrid()._settings.itemPositioningClass),this._isActive=!1,t&&this._queue.flush(!0,n),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 r,o,s,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)r=q(b,e,!0);else{if(!(o=t._getItem(e)))return this;r=b.indexOf(o)}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:r}),t._hasListeners("beforeReceive")&&t._emit("beforeReceive",{item:p,fromGrid:g,fromIndex:w,toGrid:t,toIndex:r}),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,r),p._gridId=t._id,C!==(s=f.parentNode)&&(C.appendChild(f),a=$(C,s,!0),h||(u=(h=ct(f)).x,d=h.y),f.style[n]=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:r}),t._hasListeners("receive")&&t._emit("receive",{item:p,fromGrid:g,fromIndex:w,toGrid:t,toIndex:r}),this},bt.prototype.stop=function(t,e){if(this._isDestroyed||!this._isActive)return this;var i,n=this._item,r=n._element,o=n.getGrid()._element;return this._container!==o&&(e||(t?(i=ct(r),vt.transform=dt(i.x-this._containerDiffX,i.y-this._containerDiffY)):vt.transform=dt(n._left,n._top),e=vt),o.appendChild(r),c(r,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,n=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?n.itemVisibleClass:n.itemHiddenClass),c(t._child,e?n.visibleStyles:n.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,n=this._item,r=n._element,o=n.getGrid(),s=o._element;return this._reset(),r.parentNode!==s&&(e||(t?(i=ct(r),wt.transform=dt(i.x-this._containerDiffX,i.y-this._containerDiffY)):wt.transform=dt(n._left,n._top),e=wt),s.appendChild(r),c(r,e)),t||o._emit("dragReleaseEnd",n),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,n=i._element,r=this._queue,o=u(e)?e:null,s=i.getGrid()._settings;return this._isShowing||this._isHidden?this._isShowing&&!t?(o&&r.add(o),this):(this._isShowing||(r.flush(!0,i),pt(n,s.itemHiddenClass),I(n,s.itemVisibleClass),this._isHiding||(n.style.display="block")),o&&r.add(o),i._isActive=this._isShowing=!0,this._isHiding=this._isHidden=!1,this._startAnimation(!0,t,this._finishShow),this):(o&&o(!1,i),this)},St.prototype.hide=function(t,e){if(this._isDestroyed)return this;var i=this._item,n=i._element,r=this._queue,o=u(e)?e:null,s=i.getGrid()._settings;return!this._isHiding&&this._isHidden?(o&&o(!1,i),this):this._isHiding&&!t?(o&&r.add(o),this):(this._isHiding||(r.flush(!0,i),I(n,s.itemHiddenClass),pt(n,s.itemVisibleClass)),o&&r.add(o),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(),n=this._queue,r=i._settings;return this._stopAnimation({}),n.flush(!0,t).destroy(),pt(e,r.itemVisibleClass),pt(e,r.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 n,r=this._item,o=r.getGrid()._settings,s=t?o.visibleStyles:o.hiddenStyles,l=parseInt(t?o.showDuration:o.hideDuration)||0,u=(t?o.showEasing:o.hideEasing)||"ease",d=e||l<=0;if(s){if(O(r._id),d)return r._animateChild.isAnimating()?r._animateChild.stop(s):c(r._child,s),void(i&&i());var p,f,m;p=r._id,f=function(){n=function(t,e){var i={};for(var n in e)i[n]=a(t,h(n));return i}(r._child,s)},m=function(){r._animateChild.start(n,s,{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,Et,At,Pt,xt=0;function kt(){return++xt}function Ot(t,e,i){var r=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,r.itemClass),"boolean"!=typeof i&&(i="none"!==a(e,"display")),this._isActive=i,e.style.left="0",e.style.top="0",e.style[n]=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=r.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(),n=i._settings,r=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,n.itemClass),r>-1&&i._items.splice(r,1),t&&e.parentNode.removeChild(e),this._isActive=!1,this._isDestroyed=!0}},Vt.prototype.getLayout=function(t,e,i,n,r){var o,s=this._layout,a=!(!r||!r.fillGaps),l=!(!r||!r.horizontal),h=!(!r||!r.alignRight),u=!(!r||!r.alignBottom),c=!(!r||!r.rounding),d=this._slotSizes;if(s.slots=n||this._slots,s.width=l?0:c?Math.round(e):e,s.height=l?c?Math.round(i):i:0,s.setWidth=l,s.setHeight=!l,s.slots.length=0,d.length=0,!t.length)return s;for(o=0;o<t.length;o++)this._addSlot(t[o],l,a,c,h||u);if(h)for(o=0;o<s.slots.length;o+=2)s.slots[o]=s.width-(s.slots[o]+d[o]);if(u)for(o=1;o<s.slots.length;o+=2)s.slots[o]=s.height-(s.slots[o]+d[o]);return d.length=0,this._freeSlots.length=0,this._newSlots.length=0,this._rectId=0,s},Vt.prototype._addSlot=(Pt={},function(t,e,i,n,r){var o,s,a,l,h,u,c=this._layout,d=this._freeSlots,p=this._newSlots;for(p.length=0,Pt.left=null,Pt.top=null,Pt.width=t._width+t._marginLeft+t._marginRight,Pt.height=t._height+t._marginTop+t._marginBottom,n&&(Pt.width=Math.round(Pt.width),Pt.height=Math.round(Pt.height)),h=0;h<d.length;h++)if((s=d[h])&&(o=this._getRect(s),Pt.width<=o.width+.001&&Pt.height<=o.height+.001)){Pt.left=o.left,Pt.top=o.top;break}for(null===Pt.left&&(Pt.left=e?c.width:0,Pt.top=e?0:c.height,i||(l=!0)),!e&&Pt.top+Pt.height>c.height&&(Pt.left>0&&p.push(this._addRect(0,c.height,Pt.left,1/0)),Pt.left+Pt.width<c.width&&p.push(this._addRect(Pt.left+Pt.width,c.height,c.width-Pt.left-Pt.width,1/0)),c.height=Pt.top+Pt.height),e&&Pt.left+Pt.width>c.width&&(Pt.top>0&&p.push(this._addRect(c.width,0,1/0,Pt.top)),Pt.top+Pt.height<c.height&&p.push(this._addRect(c.width,Pt.top+Pt.height,1/0,c.height-Pt.top-Pt.height)),c.width=Pt.left+Pt.width),h=i?0:l?d.length:h;h<d.length;h++)if(s=d[h])for(o=this._getRect(s),a=this._splitRect(o,Pt),u=0;u<a.length;u++)s=a[u],(o=this._getRect(s)).width>.49&&o.height>.49&&(!e&&o.top<c.height||e&&o.left<c.width)&&p.push(s);p.length&&this._purgeRects(p).sort(e?this._sortRectsLeftTop:this._sortRectsTopLeft),e?c.width=Math.max(c.width,Pt.left+Pt.width):c.height=Math.max(c.height,Pt.top+Pt.height),c.slots.push(Pt.left,Pt.top),r&&this._slotSizes.push(Pt.width,Pt.height),this._freeSlots=p,this._newSlots=d}),Vt.prototype._addRect=function(t,e,i,n){var r=++this._rectId,o=this._rectStore;return o[r]=t||0,o[++this._rectId]=e||0,o[++this._rectId]=i||0,o[++this._rectId]=n||0,r},Vt.prototype._getRect=function(t,e){var i=e||this._rectItem,n=this._rectStore;return i.left=n[t]||0,i.top=n[++t]||0,i.width=n[++t]||0,i.height=n[++t]||0,i},Vt.prototype._splitRect=(At=[],function(t,e){return At.length=0,this._doRectsOverlap(t,e)?(t.left<e.left&&At.push(this._addRect(t.left,t.top,e.left-t.left,t.height)),t.left+t.width>e.left+e.width&&At.push(this._addRect(e.left+e.width,t.top,t.left+t.width-(e.left+e.width),t.height)),t.top<e.top&&At.push(this._addRect(t.left,t.top,t.width,e.top-t.top)),t.top+t.height>e.top+e.height&&At.push(this._addRect(t.left,e.top+e.height,t.width,t.top+t.height-(e.top+e.height))),At):(At.push(this._addRect(t.left,t.top,t.width,t.height)),At)}),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={},Et={},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],Et))){t[i]=0;break}return t}),Vt.prototype._sortRectsTopLeft=function(){var t={},e={};return function(i,n){return this._getRect(i,t),this._getRect(n,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,n){return this._getRect(i,t),this._getRect(n,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,n){var r,o,s,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((r=this._settings=(a=jt.defaultOptions,l=n,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)||(r.dragSort=!!r.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,r.containerClass),this._items=[],"string"==typeof(o=r.items)?Bt(i.children).forEach((function(t){("*"===o||R(t,o))&&c._items.push(new Ot(c,t))})):(Array.isArray(o)||zt(o))&&(this._items=Bt(o).map((function(t){return new Ot(c,t)}))),"number"!=typeof(s=r.layoutOnResize)&&(s=!0===s?0:-1),s>=0&&window.addEventListener("resize",c._resizeHandler=X((function(){c.refreshItems().layout()}),s)),r.layoutOnInit&&this.layout(!0)}function Nt(t,e){var i,n,r,o=Object.keys(e),s=o.length;for(r=0;r<s;r++)i=Lt(e[n=o[r]]),Lt(t[n])&&i?t[n]=Nt(Nt({},t[n]),e[n]):i?t[n]=Nt({},e[n]):Array.isArray(e[n])?t[n]=e[n].slice(0):t[n]=e[n];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=P,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,n=[],r=Bt(t);for(i=0;i<r.length;i++)(e=this._getItem(r[i]))&&n.push(e);return n},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,n=this._element,r=this._items;if(r.length){for(i=0;i<r.length;i++)(e=r[i]._element).parentNode===n&&(t=t||window.document.createDocumentFragment()).appendChild(e);t&&n.appendChild(t)}return this._emit("synchronize"),this},jt.prototype.layout=function(t,e){if(this._isDestroyed)return this;var i,n,r,o=this,s=this._element,l=this._updateLayout(),h=l.id,c=l.items.length,d=c;function p(){if(!(--d>0)){var i=o._layout.id!==h,n=u(t)?t:e;u(n)&&n(i,l.items.slice(0)),!i&&o._hasListeners("layoutEnd")&&o._emit("layoutEnd",l.items.slice(0))}}if((l.setHeight&&"number"==typeof l.height||l.setWidth&&"number"==typeof l.width)&&(i="border-box"===a(s,"box-sizing")),l.setHeight&&("number"==typeof l.height?s.style.height=(i?l.height+this._borderTop+this._borderBottom:l.height)+"px":s.style.height=l.height),l.setWidth&&("number"==typeof l.width?s.style.width=(i?l.width+this._borderLeft+this._borderRight:l.width)+"px":s.style.width=l.width),this._hasListeners("layoutStart")&&this._emit("layoutStart",l.items.slice(0)),!c)return p(),this;for(r=0;r<c;r++)(n=l.items[r])&&(n._left=l.slots[2*r],n._top=l.slots[2*r+1],n.isDragging()?p():n._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 n,r,o=e||0,s=o.layout?o.layout:void 0===o.layout,a=this._items,l=!1;for(r=0;r<i.length;r++)n=new Ot(this,i[r],o.isActive),i[r]=n,n._isActive&&(l=!0,n._layout._skipNextAnimation=!0);return N(a,i,o.index),this._hasListeners("add")&&this._emit("add",i.slice(0)),l&&s&&this.layout("instant"===s,u(s)?s:void 0),i},jt.prototype.remove=function(t,e){if(this._isDestroyed)return this;var i,n,r=e||0,o=r.layout?r.layout:void 0===r.layout,s=!1,a=this.getItems(),l=this.getItems(t),h=[];for(n=0;n<l.length;n++)i=l[n],h.push(a.indexOf(i)),i._isActive&&(s=!0),i._destroy(r.removeElements);return this._hasListeners("remove")&&this._emit("remove",l.slice(0),h),s&&o&&this.layout("instant"===o,u(o)?o: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,n,r=[],o=[],s="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(r.slice(0),o.slice(0))}),a||s)for(n=0;n<this._items.length;n++)i=this._items[n],(a?t(i):R(i._element,t))?r.push(i):o.push(i);return r.length?this.show(r,{instant:h,onFinish:f,layout:!1}):f(),o.length?this.hide(o,{instant:h,onFinish:f,layout:!1}):f(),(r.length||o.length)&&(this._hasListeners("filter")&&this._emit("filter",r.slice(0),o.slice(0)),c&&this.layout("instant"===c,u(c)?c:void 0)),this},jt.prototype.sort=function(){var t,e,i,n;function r(t){for(var e={},i=0;i<t.length;i++)e[t[i]._id]=i;return e}function o(t,i){var r=n[t._id],o=n[i._id];return e?o-r:r-o}function s(s,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=(s._sortData?s:s._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||(n||(n=r(i)),d=o(s,a)),d}function a(s,a){var l=t(s,a);return e&&l&&(l=-l),l||(n||(n=r(i)),o(s,a))}return function(r,o){if(this._isDestroyed||this._items.length<2)return this;var l,h=this._items,c=o||0,d=c.layout?c.layout:void 0===c.layout;if(t=r,e=!!c.descending,i=h.slice(0),n=null,u(t))h.sort(a);else if("string"==typeof t)t=r.trim().split(" ").map((function(t){return t.split(":")})),h.sort(s);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 n,r,o=this._items,s=i||0,a=s.layout?s.layout:void 0===s.layout,l="swap"===s.action,h=l?"swap":"move",c=this._getItem(t),d=this._getItem(e);return c&&d&&c!==d&&(n=o.indexOf(c),r=o.indexOf(d),l?F(o,n,r):H(o,n,r),this._hasListeners("move")&&this._emit("move",{item:c,fromIndex:n,toIndex:r,action:h}),a&&this.layout("instant"===a,u(a)?a:void 0)),this},jt.prototype.send=function(t,e,i,n){if(this._isDestroyed||e._isDestroyed||this===e)return this;if(!(t=this._getItem(t)))return this;var r=n||0,o=r.appendTo||window.document.body,s=r.layoutSender?r.layoutSender:void 0===r.layoutSender,a=r.layoutReceiver?r.layoutReceiver:void 0===r.layoutReceiver;return t._migrate.start(e,i,o),t._migrate._isActive&&t._isActive&&(s&&this.layout("instant"===s,u(s)?s: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,n=this._element,r=this._items.slice(0);for(this._resizeHandler&&window.removeEventListener("resize",this._resizeHandler),i=0;i<r.length;i++)r[i]._destroy(e);return pt(n,this._settings.containerClass),n.style.height="",n.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,n,r=this._layout,o=this._settings.layout;for(++r.id,r.items.length=0,n=0;n<this._items.length;n++)this._items[n]._isActive&&r.items.push(this._items[n]);return this._refreshDimensions(),t=this._width-this._borderLeft-this._borderRight,e=this._height-this._borderTop-this._borderBottom,i=u(o)?o(r.items,t,e):Rt.getLayout(r.items,t,e,r.slots,o),r.slots=i.slots,r.setWidth=Boolean(i.setWidth),r.setHeight=Boolean(i.setHeight),r.width=i.width,r.height=i.height,r},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,n){var r=this._element;t&&(this._borderLeft=U(r,"border-left-width")),e&&(this._borderRight=U(r,"border-right-width")),i&&(this._borderTop=U(r,"border-top-width")),n&&(this._borderBottom=U(r,"border-bottom-width"))},jt.prototype._refreshDimensions=function(){this._updateBoundingRect(),this._updateBorders(1,1,1,1)},jt.prototype._setItemsVisibility=function(t,e,i){var n,r,o=this,s=this.getItems(t),a=i||0,l=!0===a.instant,h=a.onFinish,c=a.layout?a.layout:void 0===a.layout,d=s.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,s.slice(0)),r=0;r<s.length;r++)n=s[r],(e&&!n._isActive||!e&&n._isActive)&&(g=!0),e&&!n._isActive&&(n._layout._skipNextAnimation=!0),e&&n._visibility._isHidden&&y.push(n),n._visibility[m](l,(function(t,e){t||_.push(e),--d<1&&(u(h)&&h(_.slice(0)),o._hasListeners(f)&&o._emit(f,_.slice(0)))}));y.length&&this.refreshItems(y),g&&c&&this.layout("instant"===c,u(c)?c:void 0)}else u(h)&&h(s)},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 n.a})),i.d(e,"surveyStrings",(function(){return n.b})),i.d(e,"DataProvider",(function(){return o})),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 E})),i.d(e,"PlotlyChartAdapter",(function(){return x})),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 n=i(1);i(9),i(10),i(11),i(12),i(13),i(14);n.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"},n.a.localeNames.es="Spanish";n.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"},n.a.localeNames.it="Italian";var r=i(3),o=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 r.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(n){var r=e.filterValues[n],o=typeof r,s=i[n];if("object"==typeof s)return"object"!==o||!function(t,e){var i=Object.keys(t),n=Object.keys(e);if(n.length>i.length)return!1;for(var r=0,o=n;r<o.length;r++){var s=o[r];if(e[s]!=t[s])return!1}return!0}(s,r);var a=i[t.seriesMarkerKey];if(a&&"object"===o)return s!==r[a];if("object"===o&&void 0!==r.start&&void 0!==r.end){var l="number"==typeof s?s:Date.parse(s);return!(!isNaN(l)||(l=parseFloat(s),!isNaN(l)))||(l<r.start||l>=r.end)}return i[n]!==e.filterValues[n]}))})):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],n=[],r=e.getValues(),o={};r.forEach((function(t,e){o[t]=e}));var s=-1!==r.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(r.length).fill(0));n.push(c)}return this.filteredData.forEach((function(e){i.forEach((function(i,r){var h=e[i];if(void 0!==h||s){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){n[r][c][o[t]]++}))}else u.forEach((function(t){a.forEach((function(e){if(void 0!==t[e]){var i=l[e]||0;n[r][i][o[t[e]]]++}}))}));else u.forEach((function(t){return n[0][0][o[t]]++}))}}))})),Array.isArray(e.dataName)?n:n[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 s=i(2),a=function(){function t(){}return t.registerVisualizer=function(e,i){var n=t.vizualizers[e];n||(n=[],t.vizualizers[e]=n),n.push(i)},t.unregisterVisualizer=function(e,i){var n=t.vizualizers[e];if(n){var r=n.indexOf(i);-1!==r&&n.splice(r,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 n;n="text"===t.getType()&&t.inputType?t.inputType:t.getType();var r=a.getVisualizersByType(n).map((function(n){return new n(t,e,i)}));return r.length>1?new(a.getAlternativesVisualizer())(r,t,e,i):r[0]},t}(),h=i(0),u=(i(23),function(){function t(t,e,i,n){void 0===i&&(i={});var s=this;this.question=t,this.options=i,this._name=n,this._showHeader=!0,this._footerVisualizer=void 0,this._dataProvider=void 0,this.labelTruncateLength=27,this.renderResult=void 0,this.toolbarContainer=void 0,this.contentContainer=void 0,this.footerContainer=void 0,this._supportSelection=!1,this.onAfterRender=new r.Event,this.toolbarItemCreators={},this._backgroundColor="#f7f7f7",this._dataProvider=i.dataProvider||new o(e),this._dataProvider.onDataChanged.add((function(){return s.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,"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 r.QuestionCommentModel(this.question.name+(r.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 n=e.toolbarItemCreators[i](t);n&&t.appendChild(n)}))},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.destroyContent=function(t){this.options&&"function"==typeof this.options.destroyContent?this.options.destroyContent(t,this):t.innerHTML=""},t.prototype.renderContent=function(t){this.options&&"function"==typeof this.options.renderContent?this.options.renderContent(t,this):t.innerText=n.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 r=h.b.createElement("h4","sa-visualizer__footer-title",{innerText:n.a.getString("otherCommentTitle")});e.appendChild(r);var o=h.b.createElement("div","sa-visualizer__footer-content");o.style.display=t.otherCommentCollapsed?"none":"block";var s=h.b.createButton((function(){"none"===o.style.display?(o.style.display="block",s.innerText=n.a.getString("hideButton")):(o.style.display="none",s.innerText=n.a.getString(t.otherCommentCollapsed?"showButton":"hideButton")),i.footerVisualizer.invokeOnUpdate()}),n.a.getString("showButton"));e.appendChild(s),e.appendChild(o),this.footerVisualizer.render(o)}},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.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.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,n=[],r=0;r<e;r++)n=n.concat(i);return n},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,r,o){void 0===r&&(r={});var s=t.call(this,e,i,r,o||"number")||this;return s.registerToolbarItem("changeChartType",(function(){return s.chartTypes.length>1?h.b.createSelector(s.chartTypes.map((function(t){return{value:t,text:n.a.getString("chartType_"+t)}})),(function(t){return s.chartType===t.value}),(function(t){s.setChartType(t.target.value)})):null})),s}return Object(s.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,n){var r=[];if(5===n)r=["very high ("+t+")","high","medium","low","very low ("+i+")"];else{r.push(t);for(var o=0;o<n-2;o++)r.push("");r.push(i)}return e.generateTextsCallback?e.generateTextsCallback(this.question,t,i,n,r):r},e.prototype.generateValues=function(t,e){for(var i=[],n=0;n<e;n++)i.push(t/e);return i.push(t),i},e.prototype.generateColors=function(t,e,i){for(var n=this.getColors(),r=[],o=0;o<i;o++)r.push(n[o]);return r.push("rgba(255, 255, 255, 0)"),r},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 n=+i[t.question.name];e++,t._resultAverage+=n,t._resultMin>n&&(t._resultMin=n),t._resultMax<n&&(t._resultMax=n)}})),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,o,s,a){var l=t.call(this,i,o,s,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 r.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:n.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:n.a.getString("defaultOrder"),value:"default"},{text:n.a.getString("ascOrder"),value:"asc"},{text:n.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:n.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(s.b)(e,t),e.prototype.updateEmptyAnswersBtn=function(){this.emptyAnswersBtn&&(this.emptyAnswersBtn.innerText=this._hideEmptyAnswers?n.a.getString("showEmptyAnswers"):n.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?n.a.getString("showPerColumns"):n.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?n.a.getString("hidePercentages"):n.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?n.a.getString("hideMissingAnswers"):n.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.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 r.ItemValue.getTextOrHtmlByValue(t.valuesSource(),e.value)})),i=this.question;return i.hasOther&&e.push(i.otherText),this.showMissingAnswers&&e.unshift(n.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,n){var r=t.reduce((function(t,e){return t+e}),0);e[n]=t.map((function(t){var e=i?+(t/r).toFixed(i):Math.round(t/r*1e4);return r&&e/100}))}));else for(var n=0;n<t[0].length;n++){for(var r=0,o=0;o<t.length;o++)r+=t[o][n];for(o=0;o<t.length;o++){Array.isArray(e[o])||(e[o]=[]);var s=i?+(t[o][n]/r*100).toFixed(i):Math.round(t[o][n]/r*100);e[o][n]=r&&s}}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(),n=this.getColors(),r=this.showPercentages?this.getPercentages():e;if(this.transposeData){e=this.transpose(e),r=this.transpose(r);var o=t;t=i,i=o}if("asc"==this.answersOrder||"desc"==this.answersOrder){var s=this.showPercentages?h.a.zipArrays(i,n,r[0]):h.a.zipArrays(i,n),a=h.a.sortDictionary(s,e[0],"desc"==this.answersOrder),l=h.a.unzipArrays(a.keys);i=l[0],n=l[1],this.showPercentages&&(r[0]=l[2]),e[0]=a.values}var u={datasets:e,labels:i,colors:n,texts:r,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),n=0;n<e;++n)i[n]=new Array(t.length);for(n=0;n<t.length;++n)for(var r=0;r<e;++r)i[r][n]=t[n][r];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,n,r){var o=t.call(this,e,i,n,r||"matrix")||this;return o.getAnswersData(),o}return Object(s.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 r.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 n=0;n<t.length;n++)0!=t[n][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),n=0;n<t.datasets.length;n++){if(this.getHasAnswersInSeries(t.datasets[n])){e.labels.push(t.labels[n]),e.colors.push(t.colors[n]);for(var r=[],o=[],s=0;s<t.datasets[0].length;s++)i[s]&&(r.push(t.datasets[n][s]),o.push(t.texts[n][s]));e.datasets.push(r),e.texts.push(o)}}for(n=0;n<t.datasets[0].length;n++)i[n]&&e.seriesLabels.push(t.seriesLabels[n]);return e},e.prototype.getData=function(){var e=t.prototype.getData.call(this),i=this.getSeriesValues(),n=this.getValues();if(i.length>1){var r=[];return n.forEach((function(t,n){var o=i.map((function(t,i){return e[i][n]}));r.push(o)})),r}return e},e}(d),f=function(t){function e(e,i,n,r){return t.call(this,e,i,n,r||"boolean")||this}return Object(s.b)(e,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 r.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]=n.a.getString("missingAnswersLabel")),t},e.trueColor="",e.falseColor="",e}(d),m=function(t){function e(e,i,n,r){var o=t.call(this,e,i,n,r||"histogram")||this;return o.valueType="number",o._cachedValues=void 0,o._continiousData=void 0,o._cachedIntervals=void 0,"text"!==e.getType()||"date"!==e.inputType&&"datetime"!==e.inputType?o.valueType="number":o.valueType="date",o}return Object(s.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.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 r.ItemValue(i,void 0!==i?i.label:"")}var n=this.getLabels(),o=n.indexOf(t);return new r.ItemValue(this.getValues()[o],n[o])},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 n=e[t.dataName];if(void 0!==n){var r=e[o.seriesMarkerKey]||"";t._continiousData[r].push(t.getContiniousValue(n)),i[n]=n}})),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 n=i[0].continious-1,r=i[i.length-1].continious+1,o=e.IntervalsCount,s=(r-n)/o,a=0;a<o;++a){var l=n+s;this._cachedIntervals.push({start:n,end:l,label:this.getString(n)+"-"+this.getString(l)}),n=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 n=this.intervals,r=[],o=this.getSeriesValues();0===o.length&&o.push("");for(var s=0;s<o.length;++s)r.push(n.map((function(t){return 0}))),this._continiousData[o[s]].forEach((function(t){for(var e=0;e<n.length;++e)if(n[e].start<=t&&t<n[e].end){r[s][e]++;break}}));return r},e.IntervalsCount=10,e.UseIntervalsFrom=10,e}(d),g=function(t){function e(e,i,r,o){var s=t.call(this,i,r,o)||this;if(s.visualizers=e,s.visualizersWithSelection=[],s.onAfterVisualizerRenderCallback=function(){s.afterRender(s.contentContainer)},!e||e.length<2)throw new Error("VisualizerArrayWrapper works with visualizers collection only.");return s.visualizers.forEach((function(t){t.onUpdate=function(){return s.invokeOnUpdate()},t.supportSelection&&(s._supportSelection=!0,s.visualizersWithSelection.push(t))})),s.registerToolbarItem("changeVisualizer",(function(){return h.b.createSelector(s.visualizers.map((function(t){return{value:t.name,text:n.a.getString("visualizer_"+t.name)}})),(function(t){return s.visualizer.name===t.value}),(function(t){return s.setVisualizer(t.target.value)}))})),s.visualizer=e[0],s.visualizer.onAfterRender.add(s.onAfterVisualizerRenderCallback),s}return Object(s.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)}),n.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=n.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 n=t.call(this,e)||this;return n._selector=i,n._muuri=void 0,n._layoutingTimer=void 0,n}return Object(s.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,o,s,a){void 0===s&&(s={}),void 0===a&&(a=void 0);var l=t.call(this,null,o,s,"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 r.Event,l.onStateChanged=new r.Event,l._layoutEngine=s.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&&(n.a.currentLocale=l.options.survey.locale),void 0===a&&(l._elements=l.buildElements(i)),l.haveCommercialLicense=e.haveCommercialLicense||void 0!==s.haveCommercialLicense&&s.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)}))}),n.a.getString("resetFilter"))})),l.registerToolbarItem("addElement",(function(t){if(l.allowHideQuestions){var e=void 0,i=function(i,r){var o=l.hiddenElements;if(o.length>0){var s=h.b.createSelector([{name:void 0,displayName:n.a.getString("addElement")}].concat(o).map((function(t){return{value:t.name,text:t.displayName}})),(function(t){return!1}),(function(t){l.showElement(t.target.value)}));e&&t.replaceChild(s,e)||t.appendChild(s),e=s}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:n.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(s.b)(e,t),e.prototype.showElement=function(t){var e=this.getElement(t),i=this._elements.indexOf(e);e.isVisible=!0;var n=this.renderPanelElement(e,this.contentContainer);this.layoutEngine.add([n],{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,n,r=this.visibleElements[t],o=this.visibleElements[e];i=this._elements.indexOf(r),n=this._elements.indexOf(o),this.moveElement(i,n)},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)}),n.a.getString("hideButton"))})),e.allowMakeQuestionsPrivate&&i.registerToolbarItem("makePrivatePublic",(function(){var i=e.getElement(t.name),r=i.isPublic?"first":"second",o=n.a.getString("makePrivateButton"),s=n.a.getString("makePublicButton");return h.b.createSvgToggleButton("makepublic","makeprivate",o,s,(function(t){setTimeout((function(){return e.makeElementPublic(i)}),0)}),(function(t){setTimeout((function(){return e.makeElementPrivate(i)}),0)}),r)})),i.supportSelection){var r=i,o=new _(r);i.registerToolbarItem("questionFilterInfo",(function(){return o.update(r.selection),o.htmlElement})),r.onDataItemSelected=function(i,n){o.update({value:i,text:n}),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:n.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))}))),n.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),n=h.b.createElement("div");e.appendChild(n);var r=h.b.createElement("div"),o=h.b.createElement("h3"),s=h.b.createElement("div");return o.innerText=t.displayName,n.className=this.allowDynamicLayout?"sa-question sa-question-layouted":"sa-question",o.className="sa-question__title",this.allowDynamicLayout&&(o.className=o.className+" sa-question__title--draggable"),r.className="sa-question__content",r.style.backgroundColor=this.backgroundColor,r.appendChild(o),r.appendChild(s),n.appendChild(r),i.render(s),t.renderedElement=n,n},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),n=Object(s.a)(Object(s.a)({},e),null==i?void 0:i.getState());return void 0!==n.renderedElement&&delete n.renderedElement,n})))}},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(s.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,n,r){void 0===n&&(n={});var o=t.call(this,e,i,n,r||"panelDynamic")||this;return o._panelVisualizer=void 0,o.onAfterRenderPanelCallback=function(){o.afterRender(o.contentContainer)},(n=Object.assign({},n)).allowDynamicLayout=!1,n.dataProvider=void 0,o._panelVisualizer=new C(o.getQuestions(),[],n),o._panelVisualizer.onAfterRender.add(o.onAfterRenderPanelCallback),o.updateData(i),o}return Object(s.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,n){return t.call(this,e,i,n)||this}return Object(s.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,n,o){void 0===n&&(n={});var s=t.call(this,e,i,n,o||"matrixDropdown")||this;s._matrixDropdownVisualizer=void 0,s.onPanelAfterRenderCallback=function(){s.afterRender(s.contentContainer)},(n=Object.assign({},n)).dataProvider=void 0,n.allowDynamicLayout=!1,n.seriesValues=e.rows.map((function(t){return t.value})),n.seriesLabels=e.rows.map((function(t){return t.text}));var l=s.getQuestions();if(1==n.seriesValues.length&&l.every((function(t){return r.Helpers.isArraysEqual(t.choices,s.question.choices)}))){var h=a.getVisualizersByType("matrixdropdown-grouped");s._matrixDropdownVisualizer=new h[0](s.question,[],n)}else s._matrixDropdownVisualizer=new C(l,[],n);return s._matrixDropdownVisualizer.onAfterRender.add(s.onPanelAfterRenderCallback),s.updateData(i),s}return Object(s.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 n=i[t.question.name];n&&Object.keys(n).forEach((function(t){var i=Object.assign({},n[t]);i[o.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 E=function(){function t(){}return t.setup=function(t,e){return this.setups[t](e)},t.setupPie=function(e){var i=e.getAnswersData(),n=i.datasets,r=i.labels,o=i.colors,s=(i.texts,i.seriesLabels),a=[],l=s.length>1,h={type:e.chartType,y:l?s:r,text:(l?s:r).map((function(i){return t.getTruncatedLabel(i,e.options.labelTruncateLength)})),hoverinfo:"x+y",mode:"markers",marker:{}};h.hoverinfo="label+value+percent",h.marker.colors=o,h.textposition="inside","doughnut"===e.chartType&&(h.type="pie",h.hole=.4),l||(h.marker.symbol="circle",h.marker.size=16),n.forEach((function(t,e){a.push(Object.assign({},h,{values:t,labels:l?s:r,customdata:l?s:r}))}));var u={font:{family:"Segoe UI, sans-serif",size:14,weight:"normal",color:"#404040"},height:(r.length<10?50*r.length+100:550)*Math.round(a.length/2)+25,margin:{l:0,t:25,b:0,r:10},colorway:o,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=[],r.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(),n=i.datasets,r=i.labels,o=i.colors,s=i.texts,a=i.seriesLabels,l=[],h=a.length>1,u=h?a:r,c={type:e.chartType,y:u,text:u,customdata:h?a:r,hoverinfo:"text",orientation:"h",mode:"markers",textposition:"none",width:.5,bargap:.5,marker:{}};c.marker.color=o,n.forEach((function(t,i){var n=Object.assign({},c,{x:t,text:s[i],hovertext:u.map((function(t,e){return"".concat(s[i][e],", ").concat(t)}))});if(e.showPercentages){var r=e.showOnlyPercentages?"%{text}%":"%{value} (%{text}%)";n.textposition="inside",n.texttemplate=r,n.bargap=.1}l.push(n)}));var d={font:{family:"Segoe UI, sans-serif",size:14,weight:"normal",color:"#404040"},height:30*(r.length+1)+30+30,margin:{t:30,b:30,r:10},colorway:o,hovermode:"closest",yaxis:{automargin:!0,type:"category",orientation:"h",tickmode:"array",tickvals:u,ticktext:u.map((function(i){return t.getTruncatedLabel(i,e.options.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*(r.length+1)*a.length+30+30,r.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 n=e.showPercentages?"%":"";l[i].hovertext=[],u.forEach((function(e,r){l[i].hovertext.push("".concat(t.y[r]," : ").concat(t.name,", ").concat(t.text[r]).concat(n))}))}))),{traces:l,layout:d,hasSeries:h}},t.setupVBar=function(t){var e=t.getAnswersData(),i=e.datasets,n=e.labels,r=e.colors,o=e.texts,s=e.seriesLabels,a=[],l=s.length>1,h={font:{family:"Segoe UI, sans-serif",size:14,weight:"normal",color:"#404040"},margin:{t:30,b:30,r:10},colorway:r,hovermode:"closest",plot_bgcolor:t.backgroundColor,paper_bgcolor:t.backgroundColor,showlegend:!1},u={type:"bar",customdata:l?s:n,hoverinfo:"x+y",mode:"markers",textposition:"none",width:.5,bargap:.5,marker:{}};return u.marker.color=r,i.forEach((function(e,i){var r=Object.assign({},u,{x:n,y:t.showPercentages?o[i].map((function(t){return t/100})):e,text:o[i]});if(t.showPercentages){var s=t.showOnlyPercentages?"%{text}%":"%{value} (%{text}%)";r.textposition="inside",r.texttemplate=s,r.width=.9,r.bargap=.1}a.push(r)})),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(),n=i.datasets,r=i.labels,o=i.colors,s=(i.texts,i.seriesLabels),a=s.length>1,l=[],h={type:"scatter",y:(a?s:r).map((function(i){return t.getTruncatedLabel(i,e.options.labelTruncateLength)})),customdata:a?s:r,text:a?s:r,hoverinfo:"x+y",orientation:"h",mode:"markers",width:.5,marker:{}};a||(h.marker.symbol="circle",h.marker.size=16),n.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*(r.length+1)+30+30,margin:{t:30,b:30,r:10},colorway:o,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,r.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 r.Event,t.onPlotCreating=new r.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}(),A=i(7),P=i.n(A),x=function(){function t(t){this.model=t,this._chart=void 0}return t.prototype.patchConfigParameters=function(t,e,i,n){},Object.defineProperty(t.prototype,"chart",{get:function(){return this._chart},enumerable:!1,configurable:!0}),t.prototype.create=function(t){var e=this,i=E.setup(this.model.chartType,this.model),o={displaylogo:!1,responsive:!0,locale:n.a.currentLocale,modeBarButtonsToRemove:["toImage"],modeBarButtonsToAdd:[{name:"toImageSjs",title:n.a.getString("saveDiagramAsPNG"),icon:P.a.Icons.camera,click:function(t){var i={format:E.imageExportFormat,filename:e.model.question.name};E.onImageSaving.fire(e.model,i),P.a.downloadImage(t,i)}}]};void 0!==k.displayModeBar&&(o.displayModeBar=k.displayModeBar),this.patchConfigParameters(t,i.traces,i.layout,o);var s={traces:i.traces,layout:i.layout,config:o};E.onPlotCreating.fire(this.model,s);var a=P.a.newPlot(t,s.traces,s.layout,s.config);t.on("plotly_click",(function(t){var n;if(t.points.length>0){var o="";if(i.hasSeries){o=t.points[0].data.name;var s=t.points[0].label,a=e.model.getSeriesValues()[e.model.getSeriesLabels().indexOf(s)],l=e.model.getSelectedItemByText(o);h=new r.ItemValue(((n={})[a]=l.value,n),s+": "+l.text);e.model.setSelection(h)}else{o=Array.isArray(t.points[0].customdata)?t.points[0].customdata[0]:t.points[0].customdata;var h=e.model.getSelectedItemByText(o);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){P.a.purge(t),this._chart=void 0},t}(),k=function(t){function e(i,n,r,o){void 0===r&&(r={});var s=t.call(this,i,n,r,o)||this;return s.chartTypes=[].concat(e.types),s.getSeriesValues().length>0&&-1===s.chartTypes.indexOf("stackedbar")&&s.chartTypes.push("stackedbar"),r.allowExperimentalFeatures&&s.chartTypes.splice(1,0,"vbar"),s.chartType=s.chartTypes[0],-1!==s.chartTypes.indexOf(r.defaultChartType)&&(s.chartType=r.defaultChartType),s._chartAdapter=new x(s),s}return Object(s.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(),n=this.getValues();if(i.length>1){var r=[];return n.forEach((function(t,n){var o=i.map((function(t,i){return e[i][n]}));r.push(o)})),r}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,n,r,o){var s=t.call(this,i,n,r,o)||this;return s.chartTypes=e.types,s.chartType=s.chartTypes[0],s._chartAdapter=new x(s),s}return Object(s.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(s.b)(e,t),e.prototype.patchConfigParameters=function(t,e,i,n){var r=this.model.getColors(),o=[z.trueColor||r[0],z.falseColor||r[1]];this.model.showMissingAnswers&&o.push(r[2]),"pie"===this.model.chartType||"doughnut"===this.model.chartType?e.forEach((function(t){t.marker.colors=o})):"bar"===this.model.chartType&&e.forEach((function(t){t.marker.color=o}))},e}(x),z=function(t){function e(i,n,r,o){var s=t.call(this,i,n,r,o)||this;return s.chartTypes=e.types,s.chartType=s.chartTypes[0],s._chartAdapter=new V(s),s}return Object(s.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(s.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(),n=this.getEmptyData();return e.forEach((function(e){t.applyResultToPlotlyData(e,n,i)})),[n]},e.prototype.applyResultToPlotlyData=function(t,e,i){t&&e&&i&&t.forEach((function(t,n,r){var o=i.indexOf(t);e[o]=+e[o]+(r.length-n)}))},e}(k);a.registerVisualizer("ranking",M);var L=function(t){function e(i,n,r,o){var s=t.call(this,i,n,r,o)||this;return s.chartTypes=e.types,s.chartType=s.chartTypes[0],s._chartAdapter=new x(s),s}return Object(s.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,n,r){var o=t.call(this,e,i,n,r||"matrixDropdownGrouped")||this;return o.getAnswersData(),o}return Object(s.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})),n=this.dataProvider.getData({dataName:e,getValues:function(){return t},getLabels:function(){return t},getSeriesValues:function(){return i},getSeriesLabels:function(){return i}}),r=[];return t.forEach((function(t,i){var o=e.map((function(t,e){return n[e][0][i]}));r.push(o)})),r},e}(d));a.registerVisualizer("matrixdropdown-grouped",L);var B=function(t){function e(i,n,r,o){var s=t.call(this,i,n,r,o)||this;return s.chartTypes=e.types,s.chartType=s.chartTypes[0],s._chartAdapter=new x(s),s}return Object(s.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(),n=this.getValues();if(i.length>1){var r=[];return n.forEach((function(t,n){var o=i.map((function(t,i){return e[i][n]}));r.push(o)})),r}return e},e.types=["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(),r=i[0],o=i[1],s=i[2];if("rating"===e.getType()){var a=e.visibleRateValues;s=a[a.length-1].value,o=a[0].value}var l=this.model.generateColors(s,o,I.stepsCount);I.showAsPercentage&&(r=h.a.toPercentage(r,s),o=h.a.toPercentage(o,s),s=h.a.toPercentage(s,s));var u=[{type:"indicator",mode:"gauge+number",gauge:{axis:{range:[o,s]},shape:this.model.chartType,bgcolor:"white",bar:{color:l[0]}},value:r,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:n.a.currentLocale,responsive:!0}};return E.onPlotCreating.fire(this.model,d),P.a.newPlot(t,d.data,d.layout,d.config)},t.prototype.destroy=function(t){P.a.purge(t),this._chart=void 0},t}(),I=function(t){function e(i,n,r,o){var s=t.call(this,i,n,r,o)||this;return s.chartTypes=e.types,s.chartType=s.chartTypes[0],s._chartAdapter=new R(s),s}return Object(s.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"]},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,r=this.model.getData(),o=(this.model.getColors(),h.b.createElement("canvas","")),s=h.b.createElement("p","",{innerText:n.a.getString("noResults")});if(0!==r.length){e.appendChild(o);var a={canvas:o,config:{list:r,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(s)},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 r.Event,t}(),G=function(t){function e(e,i,n,r){var o=t.call(this,e,i,n,r||"wordcloud")||this;return o._wordcloudAdapter=new F(o),o}return Object(s.b)(e,t),e.prototype.getData=function(){var t=this,e={},i=[],r=n.a.currentLocale;i=r?N.getStopWords(r):N.getStopWords();var o=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(o):"object"==typeof i?Object.keys(i).forEach((function(t){return o(i[t])})):o(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,r=e.data,o=h.b.createElement("p","",{innerText:n.a.getString("noResults")});if(0!==r.length){var s=h.b.createElement("table","sa-text-table");s.style.backgroundColor=this.model.backgroundColor,t.appendChild(s),r.forEach((function(t){for(var e=h.b.createElement("tr"),n=0;n<i;n++){var r=h.b.createElement("td","sa-text-table__cell",{textContent:t[n]});e.appendChild(r)}s.appendChild(e)})),t.className="sa-text-table__container",t.appendChild(s)}else t.appendChild(o)},t.prototype.destroy=function(t){t.innerHTML=""},t}(),Y=function(t){function e(e,i,n,r){var o=t.call(this,e,i,n,r||"text")||this;return o._textTableAdapter=new X(o),o}return Object(s.b)(e,t),e.prototype.getData=function(){var t=this,e=[],i=0;return this.data.forEach((function(n){var r=n[t.question.name],o=[];r&&(Array.isArray(r)?o.concat(r):"object"==typeof r?Object.keys(r).forEach((function(t){return o.push(r[t])})):o.push(r),e.push(o),o.length>i&&(i=o.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(),r=i.datasets,o=i.labels,s=(i.colors,i.texts),a=(i.seriesLabels.length,h.b.createElement("p","",{innerText:n.a.getString("noResults")}));0!==r.length&&0!==r[0].length?r.forEach((function(i,r){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:n.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:n.a.getString("percent")});l.appendChild(d);var p=h.b.createElement("th","sa-choices-table__cell-header",{textContent:n.a.getString("responses")});l.appendChild(p),a.appendChild(l),i.forEach((function(t,e){var i=h.b.createElement("tr"),n=h.b.createElement("td","sa-choices-table__cell",{textContent:o[e]});i.appendChild(n);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=s[r][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:s[r][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,n,r){var o=t.call(this,e,i,n,r||"choices")||this;return o._choicesTableAdapter=new Q(o),o.answersOrder="asc",o.showPercentages=!0,o}return Object(s.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)}])}));
|