survey-analytics 1.11.6 → 1.11.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/survey.analytics.css +1 -1
- package/survey.analytics.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 +8 -6
- package/survey.analytics.min.css +1 -1
- package/survey.analytics.min.js +2 -2
- package/survey.analytics.tabulator.css +1 -1
- package/survey.analytics.tabulator.js +1 -1
- package/survey.analytics.tabulator.min.css +1 -1
- package/survey.analytics.tabulator.min.js +1 -1
package/survey.analytics.min.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* surveyjs - SurveyJS Dashboard library v1.11.
|
|
2
|
+
* surveyjs - SurveyJS Dashboard library v1.11.7
|
|
3
3
|
* Copyright (c) 2015-2024 Devsoft Baltic OÜ - http://surveyjs.io/
|
|
4
4
|
* License: MIT (http://www.opensource.org/licenses/mit-license.php)
|
|
5
5
|
*/
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
* Copyright (c) 2018-present, Niklas Rämö <inramo@gmail.com>
|
|
21
21
|
* @license MIT
|
|
22
22
|
*/
|
|
23
|
-
e.exports=function(){"use strict";var e={};function t(){this._events={},this._queue=[],this._counter=0,this._isDestroyed=!1}t.prototype.on=function(e,t){if(this._isDestroyed)return this;var i=this._events[e];return i||(i=this._events[e]=[]),i.push(t),this},t.prototype.off=function(e,t){if(this._isDestroyed)return this;var i=this._events[e];if(!i||!i.length)return this;if(!t)return i.length=0,this;for(var r=i.length;r--;)t===i[r]&&i.splice(r,1);return this},t.prototype.emit=function(e,t,i,r){if(this._isDestroyed)return this;var n=this._events[e];if(!n||!n.length)return this;var s,o=this._queue,a=o.length,l=arguments.length-1;for(s=0;s<n.length;s++)o.push(n[s]);for(++this._counter,s=a,a=o.length;s<a;s++)if(0===l?o[s]():1===l?o[s](t):2===l?o[s](t,i):o[s](t,i,r),this._isDestroyed)return this;return--this._counter,this._counter||(o.length=0),this},t.prototype.destroy=function(){if(this._isDestroyed)return this;var e,t=this._events;for(e in this._isDestroyed=!0,this._queue.length=this._counter=0,t)t[e]&&(t[e].length=0,t[e]=void 0);return this};var i="transform",r="transform",n=window.document.documentElement.style,s=!1;["","Webkit","Moz","O","ms"].forEach((function(e){if(!s){var t=e?e+"Transform":"transform";void 0!==n[t]&&(e=e.toLowerCase(),i=e?"-"+e+"-transform":"transform",r=t,s=!0)}}));var o="function"==typeof WeakMap?new WeakMap:null;function a(e,t){var r=o&&o.get(e);return r||(r=window.getComputedStyle(e,null),o&&o.set(e,r)),r.getPropertyValue("transform"===t?i:t)}var l=/([A-Z])/g;function u(e){return e.replace(l,"-$1").toLowerCase()}function h(e){return"function"==typeof e}function c(e,t){for(var i in t)e.style["transform"===i?r:i]=t[i]}function d(e){this._element=e,this._animation=null,this._callback=null,this._props=[],this._values=[],this._keyframes=[],this._options={},this._isDestroyed=!1,this._onFinish=this._onFinish.bind(this)}d.prototype.start=function(e,t,i){if(!this._isDestroyed){var r=this._animation,n=this._props,s=this._values,o=i||0,a=!1;if(r){var l,u=0;for(var d in t)if(++u,-1===(l=n.indexOf(d))||t[d]!==s[l]){a=!0;break}a||u===n.length||(a=!0)}if(a&&r.cancel(),this._callback=h(o.onFinish)?o.onFinish:null,!r||a){for(d in n.length=s.length=0,t)n.push(d),s.push(t[d]);var p=this._keyframes;p[0]=e,p[1]=t;var f=this._options;f.duration=o.duration||300,f.easing=o.easing||"ease";var m=this._element;(r=m.animate(p,f)).onfinish=this._onFinish,this._animation=r,c(m,t)}}},d.prototype.stop=function(e){if(!this._isDestroyed&&this._animation){var t,i,n,s=this._element,o=this._props,l=this._values;if(e)c(s,e);else for(n=0;n<o.length;n++)i=a(s,u(t=o[n])),s.style["transform"===t?r:t]=i;this._animation.cancel(),this._animation=this._callback=null,o.length=l.length=0}},d.prototype.isAnimating=function(){return!!this._animation},d.prototype.destroy=function(){this._isDestroyed||(this.stop(),this._element=this._options=this._keyframes=null,this._isDestroyed=!0)},d.prototype._onFinish=function(){var e=this._callback;this._animation=this._callback=null,this._props.length=this._values.length=0,e&&e()};var p=["","webkit","moz","ms","o","Webkit","Moz","MS","O"];function f(e,t){for(var i,r,n=t[0].toUpperCase()+t.slice(1),s=0;s<p.length;){if((r=(i=p[s])?i+n:t)in e)return r;++s}return null}var m=(window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame||function(e){return this.setTimeout((function(){e(1e3/60)}),1e3/60)}).bind(window),g=!1;try{var _=Object.defineProperty({},"passive",{get:function(){g=!0}});window.addEventListener("testPassive",null,_),window.removeEventListener("testPassive",null,_)}catch(e){}var v="start",y="move",b="end",w="cancel",C=!(!("ontouchstart"in window)&&!window.TouchEvent),T=!!window.PointerEvent,P=!!window.navigator.msPointerEnabled,A=/(android)/i.test(window.navigator.userAgent),S=!!g&&{passive:!0},E=f(window.document.documentElement.style,"touchAction");function x(e,i){this._element=e,this._emitter=new t,this._isDestroyed=!1,this._cssProps={},this._touchAction="",this._startEvent=null,this._pointerId=null,this._startTime=0,this._startX=0,this._startY=0,this._currentX=0,this._currentY=0,this._preStartCheck=this._preStartCheck.bind(this),this._abortNonCancelable=this._abortNonCancelable.bind(this),this._onStart=this._onStart.bind(this),this._onMove=this._onMove.bind(this),this._onCancel=this._onCancel.bind(this),this._onEnd=this._onEnd.bind(this),this.setCssProps(i),this._touchAction||this.setTouchAction("auto"),e.addEventListener("dragstart",x._preventDefault,!1),e.addEventListener(x._events.start,this._preStartCheck,S),!C||T||P||e.addEventListener(x._mouseEvents.start,this._preStartCheck,S)}function D(){this._nextStep=null,this._queue=[],this._reads={},this._writes={},this._batch=[],this._batchReads={},this._batchWrites={},this._step=this._step.bind(this)}x._pointerEvents={start:"pointerdown",move:"pointermove",cancel:"pointercancel",end:"pointerup"},x._msPointerEvents={start:"MSPointerDown",move:"MSPointerMove",cancel:"MSPointerCancel",end:"MSPointerUp"},x._touchEvents={start:"touchstart",move:"touchmove",cancel:"touchcancel",end:"touchend"},x._mouseEvents={start:"mousedown",move:"mousemove",cancel:"",end:"mouseup"},x._events=T?x._pointerEvents:P?x._msPointerEvents:C?x._touchEvents:x._mouseEvents,x._emitter=new t,x._activeInstances=[],x._preventDefault=function(e){e.preventDefault&&!1!==e.cancelable&&e.preventDefault()},x._activateInstance=function(e){x._activeInstances.indexOf(e)>-1||(x._activeInstances.push(e),x._emitter.on(y,e._onMove),x._emitter.on(w,e._onCancel),x._emitter.on(b,e._onEnd),1===x._activeInstances.length&&x._bindListeners())},x._deactivateInstance=function(e){var t=x._activeInstances.indexOf(e);-1!==t&&(x._activeInstances.splice(t,1),x._emitter.off(y,e._onMove),x._emitter.off(w,e._onCancel),x._emitter.off(b,e._onEnd),x._activeInstances.length||x._unbindListeners())},x._bindListeners=function(){var e=x._events;window.addEventListener(e.move,x._onMove,S),window.addEventListener(e.end,x._onEnd,S),e.cancel&&window.addEventListener(e.cancel,x._onCancel,S)},x._unbindListeners=function(){var e=x._events;window.removeEventListener(e.move,x._onMove,S),window.removeEventListener(e.end,x._onEnd,S),e.cancel&&window.removeEventListener(e.cancel,x._onCancel,S)},x._getEventPointerId=function(e){return"number"==typeof e.pointerId?e.pointerId:e.changedTouches?e.changedTouches[0]?e.changedTouches[0].identifier:null:1},x._getTouchById=function(e,t){if("number"==typeof e.pointerId)return e.pointerId===t?e:null;if(e.changedTouches){for(var i=0;i<e.changedTouches.length;i++)if(e.changedTouches[i].identifier===t)return e.changedTouches[i];return null}return e},x._onMove=function(e){x._emitter.emit(y,e)},x._onCancel=function(e){x._emitter.emit(w,e)},x._onEnd=function(e){x._emitter.emit(b,e)},x.prototype._reset=function(){this._isDestroyed||(this._pointerId=null,this._startTime=0,this._startX=0,this._startY=0,this._currentX=0,this._currentY=0,this._startEvent=null,this._element.removeEventListener(x._touchEvents.start,this._abortNonCancelable,S),x._deactivateInstance(this))},x.prototype._createEvent=function(e,t){var i=this._getTrackedTouch(t);return{type:e,srcEvent:t,distance:this.getDistance(),deltaX:this.getDeltaX(),deltaY:this.getDeltaY(),deltaTime:e===v?0:this.getDeltaTime(),isFirst:e===v,isFinal:e===b||e===w,identifier:this._pointerId,screenX:i.screenX,screenY:i.screenY,clientX:i.clientX,clientY:i.clientY,pageX:i.pageX,pageY:i.pageY,target:i.target}},x.prototype._emit=function(e,t){this._emitter.emit(e,this._createEvent(e,t))},x.prototype._getTrackedTouch=function(e){return null===this._pointerId?null:x._getTouchById(e,this._pointerId)},x.prototype._preStartCheck=function(e){this._isDestroyed||this.isDragging()||A&&!1===e.cancelable||e.button||(this._pointerId=x._getEventPointerId(e),null!==this._pointerId&&(this._startEvent=e,C&&(T||P)?(A&&this._element.addEventListener(x._touchEvents.start,this._abortNonCancelable,S),m(this._onStart)):this._onStart()))},x.prototype._abortNonCancelable=function(e){this._element.removeEventListener(x._touchEvents.start,this._abortNonCancelable,S),this._startEvent&&!1===e.cancelable&&(this._pointerId=null,this._startEvent=null)},x.prototype._onStart=function(){var e=this._startEvent;if(e){this._startEvent=null;var t=this._getTrackedTouch(e);t&&(this._startX=this._currentX=t.clientX,this._startY=this._currentY=t.clientY,this._startTime=Date.now(),this._emit(v,e),x._activateInstance(this))}},x.prototype._onMove=function(e){var t=this._getTrackedTouch(e);t&&(this._currentX=t.clientX,this._currentY=t.clientY,this._emit(y,e))},x.prototype._onCancel=function(e){this._getTrackedTouch(e)&&(this._emit(w,e),this._reset())},x.prototype._onEnd=function(e){this._getTrackedTouch(e)&&(this._emit(b,e),this._reset())},x.prototype.isDragging=function(){return null!==this._pointerId},x.prototype.setTouchAction=function(e){this._touchAction=e,E&&(this._cssProps[E]="",this._element.style[E]=e),C&&(this._element.removeEventListener(x._touchEvents.start,x._preventDefault,!1),this._element.style[E]!==e&&this._element.addEventListener(x._touchEvents.start,x._preventDefault,!1))},x.prototype.setCssProps=function(e){if(e){var t,i,r=this._cssProps,n=this._element;for(t in r)n.style[t]=r[t],delete r[t];for(t in e)e[t]&&("touchAction"!==t?(i=f(n.style,t))&&(r[i]="",n.style[i]=e[t]):this.setTouchAction(e[t]))}},x.prototype.getDeltaX=function(){return this._currentX-this._startX},x.prototype.getDeltaY=function(){return this._currentY-this._startY},x.prototype.getDistance=function(){var e=this.getDeltaX(),t=this.getDeltaY();return Math.sqrt(e*e+t*t)},x.prototype.getDeltaTime=function(){return this._startTime?Date.now()-this._startTime:0},x.prototype.on=function(e,t){this._emitter.on(e,t)},x.prototype.off=function(e,t){this._emitter.off(eventName,t)},x.prototype.destroy=function(){if(!this._isDestroyed){var e=this._element,t=x._events;for(var i in this._reset(),this._emitter.destroy(),e.removeEventListener(t.start,this._preStartCheck,S),e.removeEventListener(x._mouseEvents.start,this._preStartCheck,S),e.removeEventListener("dragstart",x._preventDefault,!1),e.removeEventListener(x._touchEvents.start,x._preventDefault,!1),this._cssProps)e.style[i]=this._cssProps[i],delete this._cssProps[i];this._element=null,this._isDestroyed=!0}},D.prototype.add=function(e,t,i,r){var n=this._queue.indexOf(e);n>-1&&(this._queue[n]=void 0),r?this._queue.unshift(e):this._queue.push(e),this._reads[e]=t,this._writes[e]=i,this._nextStep||(this._nextStep=m(this._step))},D.prototype.cancel=function(e){var t=this._queue.indexOf(e);t>-1&&(this._queue[t]=void 0,delete this._reads[e],delete this._writes[e])},D.prototype._step=function(){var e,t,i=this._queue,r=this._reads,n=this._writes,s=this._batch,o=this._batchReads,a=this._batchWrites,l=i.length;for(this._nextStep=null,t=0;t<l;t++)(e=i[t])&&(s.push(e),o[e]=r[e],delete r[e],a[e]=n[e],delete n[e]);for(i.length=0,t=0;t<l;t++)o[e=s[t]]&&(o[e](),delete o[e]);for(t=0;t<l;t++)a[e=s[t]]&&(a[e](),delete a[e]);s.length=0,!this._nextStep&&i.length&&(this._nextStep=m(this._step))};var k=new D;function V(e){return k.cancel(e+"visibility")}function z(e){return k.cancel(e+"move")}function O(e){return k.cancel(e+"scroll")}function L(e){return k.cancel(e+"placeholder")}var M=window.Element.prototype,B=M.matches||M.matchesSelector||M.webkitMatchesSelector||M.mozMatchesSelector||M.msMatchesSelector||M.oMatchesSelector||function(){return!1};function j(e,t){return B.call(e,t)}function R(e,t){e.classList?e.classList.add(t):j(e,"."+t)||(e.className+=" "+t)}var N=[];function I(e,t,i){var r="number"==typeof i?i:-1;r<0&&(r=e.length-r+1),e.splice.apply(e,N.concat(r,0,t)),N.length=0}function q(e,t,i){var r=e.length,n=Math.max(0,i?r:r-1);return t>n?n:t<0?Math.max(n+t+1,0):t}function F(e,t,i){if(!(e.length<2)){var r=q(e,t),n=q(e,i);r!==n&&e.splice(n,0,e.splice(r,1)[0])}}function H(e,t,i){if(!(e.length<2)){var r,n=q(e,t),s=q(e,i);n!==s&&(r=e[n],e[n]=e[s],e[s]=r)}}var G=0;function X(e,t){var i,r=++G+"debounce";return t>0?function(n){void 0!==i&&(i=window.clearTimeout(i),k.cancel(r),"finish"===n&&e()),"cancel"!==n&&"finish"!==n&&(i=window.setTimeout((function(){i=void 0,k.add(r,e,null,!0)}),t))}:function(t){"cancel"!==t&&e()}}function Y(e){var t=a(e,"transform");if(!t||"none"===t)return!1;var i=a(e,"display");return"inline"!==i&&"none"!==i}function Q(e,t){for(var i=window.document,r=(t?e:e.parentElement)||i;r&&r!==i&&"static"===a(r,"position")&&!Y(r);)r=r.parentElement||i;return r}function W(e,t){return parseFloat(a(e,t))||0}var U={},K={},Z={};function J(e,t){var i,r=t||{};return r.left=0,r.top=0,e===document||(r.left=window.pageXOffset||0,r.top=window.pageYOffset||0,e.self===window.self||(i=e.getBoundingClientRect(),r.left+=i.left,r.top+=i.top,r.left+=W(e,"border-left-width"),r.top+=W(e,"border-top-width"))),r}function $(e,t,i){return Z.left=0,Z.top=0,e===t||i&&(e=Q(e,!0))===(t=Q(t,!0))||(J(e,U),J(t,K),Z.left=K.left-U.left,Z.top=K.top-U.top),Z}function ee(e){var t=a(e,"overflow");return"auto"===t||"scroll"===t||"auto"===(t=a(e,"overflow-x"))||"scroll"===t||"auto"===(t=a(e,"overflow-y"))||"scroll"===t}function te(e,t,i){for(var r=i||[],n=t?e:e.parentNode;n&&n!==document;)n.getRootNode&&n instanceof DocumentFragment?n=n.getRootNode().host:(ee(n)&&r.push(n),n=n.parentNode);return r.push(window),r}var ie,re,ne,se,oe={},ae=/^matrix3d/,le=/([^,]*,){4}/,ue=/([^,]*,){12}/,he=/[^,]*,/;function ce(e){oe.x=0,oe.y=0;var t=a(e,"transform");if(!t||"none"===t)return oe;var i=ae.test(t),r=t.replace(i?ue:le,""),n=r.replace(he,"");return oe.x=parseFloat(r)||0,oe.y=parseFloat(n)||0,oe}function de(e,t){return"translateX("+e+"px) translateY("+t+"px)"}function pe(e,t){e.classList?e.classList.remove(t):j(e,"."+t)&&(e.className=(" "+e.className+" ").replace(" "+t+" "," ").trim())}function fe(e){var t=e._element,i=e.getGrid(),r=i._settings;this._item=e,this._gridId=i._id,this._isDestroyed=!1,this._isMigrating=!1,this._startPredicate=h(r.dragStartPredicate)?r.dragStartPredicate:fe.defaultStartPredicate,this._startPredicateState=0,this._startPredicateResult=void 0,this._hBlockedIndex=null,this._hX1=0,this._hX2=0,this._hY1=0,this._hY2=0,this._reset(),this._preStartCheck=this._preStartCheck.bind(this),this._preEndCheck=this._preEndCheck.bind(this),this._onScroll=this._onScroll.bind(this),this._prepareMove=this._prepareMove.bind(this),this._applyMove=this._applyMove.bind(this),this._prepareScroll=this._prepareScroll.bind(this),this._applyScroll=this._applyScroll.bind(this),this._checkOverlap=this._checkOverlap.bind(this);var n=r.dragSortHeuristics.sortInterval;this._checkOverlapDebounce=X(this._checkOverlap,n),this._dragger=new x(t,r.dragCssProps),this._dragger.on("start",this._preStartCheck),this._dragger.on("move",this._preStartCheck),this._dragger.on("cancel",this._preEndCheck),this._dragger.on("end",this._preEndCheck)}function me(e,t){return e.left+e.width<=t.left||t.left+t.width<=e.left||e.top+e.height<=t.top||t.top+t.height<=e.top?0:(Math.min(e.left+e.width,t.left+t.width)-Math.max(e.left,t.left))*(Math.min(e.top+e.height,t.top+t.height)-Math.max(e.top,t.top))/(Math.min(e.width,t.width)*Math.min(e.height,t.height))*100}function ge(e){this._item=e,this._animate=new d,this._element=null,this._className="",this._didMigrate=!1,this._resetAfterLayout=!1,this._currentLeft=0,this._currentTop=0,this._nextLeft=0,this._nextTop=0,this._setupAnimation=this._setupAnimation.bind(this),this._startAnimation=this._startAnimation.bind(this),this._onLayoutStart=this._onLayoutStart.bind(this),this._onLayoutEnd=this._onLayoutEnd.bind(this),this._onReleaseEnd=this._onReleaseEnd.bind(this),this._onMigrate=this._onMigrate.bind(this)}function _e(){this._queue=[],this._isDestroyed=!1}function ve(e){this._item=e,this._isActive=!1,this._isDestroyed=!1,this._isInterrupted=!1,this._currentStyles={},this._targetStyles={},this._currentLeft=0,this._currentTop=0,this._offsetLeft=0,this._offsetTop=0,this._skipNextAnimation=!1,this._animateOptions={onFinish:this._finish.bind(this)},this._queue=new _e,this._setupAnimation=this._setupAnimation.bind(this),this._startAnimation=this._startAnimation.bind(this)}fe.defaultStartPredicate=function(e,t,i){var r=e._drag,n=r._startPredicateData||r._setupStartPredicate(i);if(!t.isFinal)return!(!n.handleElement&&(n.handleElement=r._getStartPredicateHandle(t),!n.handleElement))&&(n.delay&&(n.event=t,n.delayTimer||(n.delayTimer=window.setTimeout((function(){n.delay=0,r._resolveStartPredicate(n.event)&&(r._forceResolveStartPredicate(n.event),r._resetStartPredicate())}),n.delay))),r._resolveStartPredicate(t));r._finishStartPredicate(t)},fe.defaultSortPredicate=(ie={},re={},ne={},se=[],function(e,t){var i=e._drag,r=i._getGrid(),n=t&&"number"==typeof t.threshold?t.threshold:50,s=t&&"swap"===t.action?"swap":"move";ie.width=e._width,ie.height=e._height,ie.left=i._elementClientX,ie.top=i._elementClientY;var o=function(e,t,i){var r,n,s,o,a=null,l=t._settings.dragSort,u=-1;if(!0===l?(se[0]=t,n=se):n=l.call(t,e),!Array.isArray(n))return a;for(o=0;o<n.length;o++)(s=n[o])._isDestroyed||(s._updateBoundingRect(),re.width=s._width,re.height=s._height,re.left=s._left,re.top=s._top,(r=me(ie,re))>i&&r>u&&(u=r,a=s));return se.length=0,a}(e,r,n);if(!o)return!1;var a,l,u,h,c,d=0,p=0,f=-1;for(o===r?(ie.left=i._gridX+e._marginLeft,ie.top=i._gridY+e._marginTop):(o._updateBorders(1,0,1,0),d=o._left+o._borderLeft,p=o._top+o._borderTop),c=0;c<o._items.length;c++)(u=o._items[c])._isActive&&u!==e&&(l=!0,re.width=u._width,re.height=u._height,re.left=u._left+u._marginLeft+d,re.top=u._top+u._marginTop+p,(h=me(ie,re))>f&&(a=c,f=h));return f<n&&e.getGrid()!==o&&(a=l?-1:0,f=1/0),f>=n&&(ne.grid=o,ne.index=a,ne.action=s,ne)}),fe.prototype.stop=function(){var e=this._item,t=e._element,i=this._getGrid();return this._isActive?this._isMigrating?(this._finishMigration(),this):(z(e._id),O(e._id),this._unbindScrollListeners(),this._checkOverlapDebounce("cancel"),t.parentNode!==i._element&&(i._element.appendChild(t),t.style[r]=de(this._gridX,this._gridY)),pe(t,i._settings.itemDraggingClass),this._reset(),this):this},fe.prototype.destroy=function(){return this._isDestroyed||(this.stop(),this._dragger.destroy(),this._isDestroyed=!0),this},fe.prototype._getGrid=function(){return e[this._gridId]||null},fe.prototype._reset=function(){this._isActive=!1,this._container=null,this._containingBlock=null,this._dragEvent=null,this._scrollEvent=null,this._scrollers=[],this._left=0,this._top=0,this._gridX=0,this._gridY=0,this._elementClientX=0,this._elementClientY=0,this._containerDiffX=0,this._containerDiffY=0},fe.prototype._bindScrollListeners=function(){var e,t,i=this._getGrid()._element,r=this._container,n=this._scrollers;if(n.length=0,te(this._item._element,!1,n),r!==i)for(te(i,!0,e=[]),t=0;t<e.length;t++)n.indexOf(e[t])<0&&n.push(e[t]);for(t=0;t<n.length;t++)n[t].addEventListener("scroll",this._onScroll)},fe.prototype._unbindScrollListeners=function(){var e,t=this._scrollers;for(e=0;e<t.length;e++)t[e].removeEventListener("scroll",this._onScroll);t.length=0},fe.prototype._setupStartPredicate=function(e){var t=e||this._getGrid()._settings.dragStartPredicate||0;return this._startPredicateData={distance:Math.abs(t.distance)||0,delay:Math.max(t.delay,0)||0,handle:"string"==typeof t.handle&&t.handle}},fe.prototype._getStartPredicateHandle=function(e){var t=this._startPredicateData,i=this._item._element,r=i;if(!t.handle)return r;for(r=e.target;r&&!j(r,t.handle);)r=r!==i?r.parentElement:null;return r||null},fe.prototype._resolveStartPredicate=function(e){var t=this._startPredicateData;if(!(e.distance<t.distance||t.delay)){var i=t.handleElement.getBoundingClientRect(),r=i.left+(window.pageXOffset||0),n=i.top+(window.pageYOffset||0),s=i.width,o=i.height;return this._resetStartPredicate(),s&&o&&e.pageX>=r&&e.pageX<r+s&&e.pageY>=n&&e.pageY<n+o}},fe.prototype._forceResolveStartPredicate=function(e){this._isDestroyed||1!==this._startPredicateState||(this._startPredicateState=2,this._onStart(e))},fe.prototype._finishStartPredicate=function(e){var t=this._item._element,i=Math.abs(e.deltaX)<2&&Math.abs(e.deltaY)<2&&e.deltaTime<200;this._resetStartPredicate(),i&&function(e){if("a"===e.tagName.toLowerCase()){var t=e.getAttribute("href");if(t){var i=e.getAttribute("target");i&&"_self"!==i?window.open(t,i):window.location.href=t}}}(t)},fe.prototype._resetHeuristics=function(e){this._hBlockedIndex=null,this._hX1=this._hX2=e.clientX,this._hY1=this._hY2=e.clientY},fe.prototype._checkHeuristics=function(e){var t=this._getGrid()._settings.dragSortHeuristics,i=t.minDragDistance;if(i<=0)return this._hBlockedIndex=null,!0;var r=e.clientX,n=e.clientY,s=r-this._hX2,o=n-this._hY2,a=i>3&&t.minBounceBackAngle>0;if(a||(this._hBlockedIndex=null),Math.abs(s)>i||Math.abs(o)>i){if(a){var l=Math.atan2(s,o),u=Math.atan2(this._hX2-this._hX1,this._hY2-this._hY1),h=Math.atan2(Math.sin(l-u),Math.cos(l-u));Math.abs(h)>t.minBounceBackAngle&&(this._hBlockedIndex=null)}return this._hX1=this._hX2,this._hY1=this._hY2,this._hX2=r,this._hY2=n,!0}return!1},fe.prototype._resetStartPredicate=function(){var e=this._startPredicateData;e&&(e.delayTimer&&(e.delayTimer=window.clearTimeout(e.delayTimer)),this._startPredicateData=null)},fe.prototype._checkOverlap=function(){if(this._isActive){var e,t,i,r,n,s,o,a=this._item,l=this._getGrid()._settings;(e=h(l.dragSortPredicate)?l.dragSortPredicate(a,this._dragEvent):fe.defaultSortPredicate(a,l.dragSortPredicate))&&"number"==typeof e.index&&(o=(t=a.getGrid())!==(r=e.grid||t),i=t._items.indexOf(a),n=q(r._items,e.index,o),s="swap"===e.action?"swap":"move",(o||n!==this._hBlockedIndex)&&(o?(this._hBlockedIndex=null,t._hasListeners("beforeSend")&&t._emit("beforeSend",{item:a,fromGrid:t,fromIndex:i,toGrid:r,toIndex:n}),r._hasListeners("beforeReceive")&&r._emit("beforeReceive",{item:a,fromGrid:t,fromIndex:i,toGrid:r,toIndex:n}),a._gridId=r._id,this._isMigrating=a._gridId!==this._gridId,t._items.splice(i,1),I(r._items,a,n),a._sortData=null,t._hasListeners("send")&&t._emit("send",{item:a,fromGrid:t,fromIndex:i,toGrid:r,toIndex:n}),r._hasListeners("receive")&&r._emit("receive",{item:a,fromGrid:t,fromIndex:i,toGrid:r,toIndex:n}),t.layout(),r.layout()):i!==n&&(this._hBlockedIndex=i,("swap"===s?H:F)(t._items,i,n),t._hasListeners("move")&&t._emit("move",{item:a,fromIndex:i,toIndex:n,action:s}),t.layout())))}},fe.prototype._finishMigration=function(){var e,t,i=this._item,n=i._release,s=i._element,o=i._isActive,a=i.getGrid(),l=a._element,u=a._settings,h=u.dragContainer||l,d=this._getGrid()._settings,p=s.parentNode;this._isMigrating=!1,this.destroy(),pe(s,d.itemClass),pe(s,d.itemVisibleClass),pe(s,d.itemHiddenClass),R(s,u.itemClass),R(s,o?u.itemVisibleClass:u.itemHiddenClass),h!==p&&(h.appendChild(s),t=$(p,h,!0),(e=ce(s)).x-=t.left,e.y-=t.top),i._refreshDimensions(),i._refreshSortData(),t=$(h,l,!0),n._containerDiffX=t.left,n._containerDiffY=t.top,i._drag=u.dragEnabled?new fe(i):null,h!==p&&(s.style[r]=de(e.x,e.y)),i._child.removeAttribute("style"),c(i._child,o?u.visibleStyles:u.hiddenStyles),n.start()},fe.prototype._preStartCheck=function(e){0===this._startPredicateState&&(this._startPredicateState=1),1===this._startPredicateState?(this._startPredicateResult=this._startPredicate(this._item,e),!0===this._startPredicateResult?(this._startPredicateState=2,this._onStart(e)):!1===this._startPredicateResult&&(this._startPredicateState=3)):2===this._startPredicateState&&this._isActive&&this._onMove(e)},fe.prototype._preEndCheck=function(e){var t=2===this._startPredicateState;this._startPredicate(this._item,e),this._startPredicateState=0,t&&this._isActive&&this._onEnd(e)},fe.prototype._onStart=function(e){var t=this._item;if(t._isActive){var i,n=t._element,s=this._getGrid(),o=s._settings,a=t._release,l=t._migrate,u=s._element,h=o.dragContainer||u,c=Q(h,!0),d=ce(n),p=d.x,f=d.y,m=n.getBoundingClientRect(),g=h!==u;this._resetHeuristics(e),g&&(i=$(c,u)),t.isPositioning()&&t._layout.stop(!0,{transform:de(p,f)}),l._isActive&&(p-=l._containerDiffX,f-=l._containerDiffY,l.stop(!0,{transform:de(p,f)})),t.isReleasing()&&a._reset(),this._isActive=!0,this._dragEvent=e,this._container=h,this._containingBlock=c,this._elementClientX=m.left,this._elementClientY=m.top,this._left=this._gridX=p,this._top=this._gridY=f,o.dragPlaceholder.enabled&&t._dragPlaceholder.create(),s._emit("dragInit",t,e),g&&(this._containerDiffX=i.left,this._containerDiffY=i.top,n.parentNode===h?(this._gridX=p-this._containerDiffX,this._gridY=f-this._containerDiffY):(this._left=p+this._containerDiffX,this._top=f+this._containerDiffY,h.appendChild(n),n.style[r]=de(this._left,this._top))),R(n,o.itemDraggingClass),this._bindScrollListeners(),s._emit("dragStart",t,e)}},fe.prototype._onMove=function(e){var t=this._item;if(t._isActive){var i,r,n,s=this._getGrid()._settings.dragAxis;if("y"!==s){var o=e.clientX-this._dragEvent.clientX;this._left+=o,this._gridX+=o,this._elementClientX+=o}if("x"!==s){var a=e.clientY-this._dragEvent.clientY;this._top+=a,this._gridY+=a,this._elementClientY+=a}this._dragEvent=e,i=t._id,r=this._prepareMove,n=this._applyMove,k.add(i+"move",r,n,!0)}else this.stop()},fe.prototype._prepareMove=function(){this._item._isActive&&this._getGrid()._settings.dragSort&&this._checkHeuristics(this._dragEvent)&&this._checkOverlapDebounce()},fe.prototype._applyMove=function(){var e=this._item;e._isActive&&(e._element.style[r]=de(this._left,this._top),this._getGrid()._emit("dragMove",e,this._dragEvent))},fe.prototype._onScroll=function(e){var t,i,r,n=this._item;n._isActive?(this._scrollEvent=e,t=n._id,i=this._prepareScroll,r=this._applyScroll,k.add(t+"scroll",i,r,!0)):this.stop()},fe.prototype._prepareScroll=function(){var e=this._item;if(e._isActive){var t,i=e._element,r=this._getGrid(),n=r._settings,s=n.dragAxis,o=r._element,a=i.getBoundingClientRect(),l=this._elementClientX-a.left,u=this._elementClientY-a.top;this._container!==o&&(t=$(this._containingBlock,o),this._containerDiffX=t.left,this._containerDiffY=t.top),"y"!==s&&(this._left+=l,this._gridX=this._left-this._containerDiffX),"x"!==s&&(this._top+=u,this._gridY=this._top-this._containerDiffY),n.dragSort&&this._checkOverlapDebounce()}},fe.prototype._applyScroll=function(){var e=this._item;e._isActive&&(e._element.style[r]=de(this._left,this._top),this._getGrid()._emit("dragScroll",e,this._scrollEvent))},fe.prototype._onEnd=function(e){var t=this._item,i=t._element,r=this._getGrid(),n=r._settings,s=t._release;t._isActive?(z(t._id),O(t._id),n.dragSort&&this._checkOverlapDebounce("finish"),this._unbindScrollListeners(),s._containerDiffX=this._containerDiffX,s._containerDiffY=this._containerDiffY,this._reset(),pe(i,n.itemDraggingClass),r._emit("dragEnd",t,e),this._isMigrating?this._finishMigration():s.start()):this.stop()},ge.prototype._onLayoutStart=function(){var e=this._item,t=e.getGrid(),i=t._items.indexOf(e),r=t._layout.slots[2*i],n=t._layout.slots[2*i+1];if(this._didMigrate||e._left!==r||e._top!==n){var s,o,a;if(r+=e._marginLeft,n+=e._marginTop,!(t._settings.dragPlaceholder.duration>0)||this._didMigrate){L(e._id);var l={transform:de(r,n)};return this._animate.isAnimating()?this._animate.stop(l):c(this._element,l),void(this._didMigrate&&(t.getElement().appendChild(this._element),this._didMigrate=!1))}this._nextLeft=r,this._nextTop=n,s=e._id,o=this._setupAnimation,a=this._startAnimation,k.add(s+"placeholder",o,a)}},ge.prototype._setupAnimation=function(){if(this.isActive()){var e=ce(this._element);this._currentLeft=e.x,this._currentTop=e.y}},ge.prototype._startAnimation=function(){if(this.isActive()){var e=this._animate,t=this._currentLeft,i=this._currentTop,r=this._nextLeft,n=this._nextTop,s={transform:de(r,n)};if(t!==r||i!==n){var o=this._item.getGrid()._settings.dragPlaceholder,a={transform:de(t,i)};e.start(a,s,{duration:o.duration,easing:o.easing,onFinish:this._onLayoutEnd})}else e.isAnimating()&&e.stop(s)}},ge.prototype._onLayoutEnd=function(){this._resetAfterLayout&&this.reset()},ge.prototype._onReleaseEnd=function(e){if(e._id===this._item._id){if(!this._animate.isAnimating())return void this.reset();this._resetAfterLayout=!0}},ge.prototype._onMigrate=function(e){if(e.item===this._item){var t=this._item.getGrid(),i=e.toGrid;t.off("dragReleaseEnd",this._onReleaseEnd),t.off("layoutStart",this._onLayoutStart),t.off("beforeSend",this._onMigrate),i.on("dragReleaseEnd",this._onReleaseEnd),i.on("layoutStart",this._onLayoutStart),i.on("beforeSend",this._onMigrate),this._didMigrate=!0}},ge.prototype.create=function(){if(this.isActive())this._resetAfterLayout=!1;else{var e,t=this._item,i=t.getGrid(),r=i._settings,n=this._animate;e=h(r.dragPlaceholder.createElement)?r.dragPlaceholder.createElement(t):window.document.createElement("div"),this._element=e,n._element=e,this._className=r.itemPlaceholderClass||"",this._className&&R(e,this._className);var s=t._left+t._marginLeft,o=t._top+t._marginTop;c(e,{display:"block",position:"absolute",left:"0",top:"0",width:t._width+"px",height:t._height+"px",transform:de(s,o)}),i.on("layoutStart",this._onLayoutStart),i.on("dragReleaseEnd",this._onReleaseEnd),i.on("beforeSend",this._onMigrate),h(r.dragPlaceholder.onCreate)&&r.dragPlaceholder.onCreate(t,e),i.getElement().appendChild(e)}},ge.prototype.reset=function(){if(this.isActive()){var e=this._element,t=this._item,i=t.getGrid(),r=i._settings,n=this._animate;this._resetAfterLayout=!1,L(t._id),n.stop(),n._element=null,i.off("dragReleaseEnd",this._onReleaseEnd),i.off("layoutStart",this._onLayoutStart),i.off("beforeSend",this._onMigrate),this._className&&(pe(e,this._className),this._className=""),e.parentNode.removeChild(e),this._element=null,h(r.dragPlaceholder.onRemove)&&r.dragPlaceholder.onRemove(t,e)}},ge.prototype.updateDimensions=function(e,t){this.isActive()&&c(this._element,{width:e+"px",height:t+"px"})},ge.prototype.isActive=function(){return!!this._element},ge.prototype.destroy=function(){this.reset(),this._animate.destroy(),this._item=this._animate=null},_e.prototype.add=function(e){return this._isDestroyed||this._queue.push(e),this},_e.prototype.flush=function(e,t){if(this._isDestroyed)return this;var i,r=this._queue,n=r.length;if(!n)return this;var s=1===n,o=s?r[0]:r.slice(0);if(r.length=0,s)return o(e,t),this;for(i=0;i<n&&(o[i](e,t),!this._isDestroyed);i++);return this},_e.prototype.destroy=function(){return this._isDestroyed||(this._isDestroyed=!0,this._queue.length=0),this},ve.prototype.start=function(e,t){if(!this._isDestroyed){var i,r,n,s,o=this._item,a=o._element,l=o._release,u=o.getGrid()._settings,d=this._isActive,p=l._isActive&&!1===l._isPositioningStarted,f=p?u.dragReleaseDuration:u.layoutDuration,m=p?u.dragReleaseEasing:u.layoutEasing,g=!e&&!this._skipNextAnimation&&f>0;return d&&this._queue.flush(!0,o),p&&(l._isPositioningStarted=!0),h(t)&&this._queue.add(t),g?(this._isActive=!0,this._animateOptions.easing=m,this._animateOptions.duration=f,this._isInterrupted=d,r=o._id,n=this._setupAnimation,s=this._startAnimation,k.add(r+"layout",n,s),this):(this._updateOffsets(),this._updateTargetStyles(),i=o._animate.isAnimating(),this.stop(!1,this._targetStyles),!i&&c(a,this._targetStyles),this._skipNextAnimation=!1,this._finish())}},ve.prototype.stop=function(e,t){if(this._isDestroyed||!this._isActive)return this;var i,r=this._item;return i=r._id,k.cancel(i+"layout"),r._animate.stop(t),pe(r._element,r.getGrid()._settings.itemPositioningClass),this._isActive=!1,e&&this._queue.flush(!0,r),this},ve.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},ve.prototype._updateOffsets=function(){if(!this._isDestroyed){var e=this._item,t=e._migrate,i=e._release;this._offsetLeft=i._isActive?i._containerDiffX:t._isActive?t._containerDiffX:0,this._offsetTop=i._isActive?i._containerDiffY:t._isActive?t._containerDiffY:0}},ve.prototype._updateTargetStyles=function(){this._isDestroyed||(this._targetStyles.transform=de(this._item._left+this._offsetLeft,this._item._top+this._offsetTop))},ve.prototype._finish=function(){if(!this._isDestroyed){var e=this._item,t=e._migrate,i=e._release;this._isActive&&(this._isActive=!1,pe(e._element,e.getGrid()._settings.itemPositioningClass)),i._isActive&&i.stop(),t._isActive&&t.stop(),this._queue.flush(!1,e)}},ve.prototype._setupAnimation=function(){var e=ce(this._item._element);this._currentLeft=e.x,this._currentTop=e.y},ve.prototype._startAnimation=function(){var e=this._item,t=e.getGrid()._settings;if(this._updateOffsets(),this._updateTargetStyles(),e._left===this._currentLeft-this._offsetLeft&&e._top===this._currentTop-this._offsetTop)return this._isInterrupted&&this.stop(!1,this._targetStyles),this._isActive=!1,void this._finish();this._isInterrupted||R(e._element,t.itemPositioningClass),this._currentStyles.transform=de(this._currentLeft,this._currentTop),e._animate.start(this._currentStyles,this._targetStyles,this._animateOptions)};var ye={};function be(e){this._item=e,this._isActive=!1,this._isDestroyed=!1,this._container=!1,this._containerDiffX=0,this._containerDiffY=0}be.prototype.start=function(e,t,i){if(this._isDestroyed)return this;var n,s,o,a,l,u,h,d,p=this._item,f=p._element,m=p.isVisible(),g=p.getGrid(),_=g._settings,v=e._settings,y=e._element,b=e._items,w=g._items.indexOf(p),C=i||window.document.body;if("number"==typeof t)n=q(b,t,!0);else{if(!(s=e._getItem(t)))return this;n=b.indexOf(s)}return(p.isPositioning()||this._isActive||p.isReleasing())&&(h=(u=ce(f)).x,d=u.y),p.isPositioning()&&p._layout.stop(!0,{transform:de(h,d)}),this._isActive&&(h-=this._containerDiffX,d-=this._containerDiffY,this.stop(!0,{transform:de(h,d)})),p.isReleasing()&&(h-=p._release._containerDiffX,d-=p._release._containerDiffY,p._release.stop(!0,{transform:de(h,d)})),p._visibility._stopAnimation(),p._drag&&p._drag.destroy(),p._visibility._queue.flush(!0,p),g._hasListeners("beforeSend")&&g._emit("beforeSend",{item:p,fromGrid:g,fromIndex:w,toGrid:e,toIndex:n}),e._hasListeners("beforeReceive")&&e._emit("beforeReceive",{item:p,fromGrid:g,fromIndex:w,toGrid:e,toIndex:n}),pe(f,_.itemClass),pe(f,_.itemVisibleClass),pe(f,_.itemHiddenClass),R(f,v.itemClass),R(f,m?v.itemVisibleClass:v.itemHiddenClass),g._items.splice(w,1),I(b,p,n),p._gridId=e._id,C!==(o=f.parentNode)&&(C.appendChild(f),a=$(C,o,!0),u||(h=(u=ce(f)).x,d=u.y),f.style[r]=de(h+a.left,d+a.top)),p._child.removeAttribute("style"),c(p._child,m?v.visibleStyles:v.hiddenStyles),f.style.display=m?"block":"hidden",l=$(C,y,!0),p._refreshDimensions(),p._refreshSortData(),p._drag=v.dragEnabled?new fe(p):null,this._isActive=!0,this._container=C,this._containerDiffX=l.left,this._containerDiffY=l.top,g._hasListeners("send")&&g._emit("send",{item:p,fromGrid:g,fromIndex:w,toGrid:e,toIndex:n}),e._hasListeners("receive")&&e._emit("receive",{item:p,fromGrid:g,fromIndex:w,toGrid:e,toIndex:n}),this},be.prototype.stop=function(e,t){if(this._isDestroyed||!this._isActive)return this;var i,r=this._item,n=r._element,s=r.getGrid()._element;return this._container!==s&&(t||(e?(i=ce(n),ye.transform=de(i.x-this._containerDiffX,i.y-this._containerDiffY)):ye.transform=de(r._left,r._top),t=ye),s.appendChild(n),c(n,t)),this._isActive=!1,this._container=null,this._containerDiffX=0,this._containerDiffY=0,this},be.prototype.destroy=function(){return this._isDestroyed||(this.stop(!0),this._item=null,this._isDestroyed=!0),this};var we={};function Ce(e){this._item=e,this._isActive=!1,this._isDestroyed=!1,this._isPositioningStarted=!1,this._containerDiffX=0,this._containerDiffY=0}function Te(e){var t=e._isActive,i=e._element,r=e.getGrid()._settings;this._item=e,this._isDestroyed=!1,this._isHidden=!t,this._isHiding=!1,this._isShowing=!1,this._queue=new _e,this._finishShow=this._finishShow.bind(this),this._finishHide=this._finishHide.bind(this),i.style.display=t?"block":"none",R(i,t?r.itemVisibleClass:r.itemHiddenClass),c(e._child,t?r.visibleStyles:r.hiddenStyles)}Ce.prototype.start=function(){if(this._isDestroyed||this._isActive)return this;var e=this._item,t=e.getGrid();return this._isActive=!0,R(e._element,t._settings.itemReleasingClass),t._emit("dragReleaseStart",e),e._layout.start(!1),this},Ce.prototype.stop=function(e,t){if(this._isDestroyed||!this._isActive)return this;var i,r=this._item,n=r._element,s=r.getGrid(),o=s._element;return this._reset(),n.parentNode!==o&&(t||(e?(i=ce(n),we.transform=de(i.x-this._containerDiffX,i.y-this._containerDiffY)):we.transform=de(r._left,r._top),t=we),o.appendChild(n),c(n,t)),e||s._emit("dragReleaseEnd",r),this},Ce.prototype.destroy=function(){return this._isDestroyed||(this.stop(!0),this._item=null,this._isDestroyed=!0),this},Ce.prototype._reset=function(){if(!this._isDestroyed){var e=this._item;this._isActive=!1,this._isPositioningStarted=!1,this._containerDiffX=0,this._containerDiffY=0,pe(e._element,e.getGrid()._settings.itemReleasingClass)}},Te.prototype.show=function(e,t){if(this._isDestroyed)return this;var i=this._item,r=i._element,n=this._queue,s=h(t)?t:null,o=i.getGrid()._settings;return this._isShowing||this._isHidden?this._isShowing&&!e?(s&&n.add(s),this):(this._isShowing||(n.flush(!0,i),pe(r,o.itemHiddenClass),R(r,o.itemVisibleClass),this._isHiding||(r.style.display="block")),s&&n.add(s),i._isActive=this._isShowing=!0,this._isHiding=this._isHidden=!1,this._startAnimation(!0,e,this._finishShow),this):(s&&s(!1,i),this)},Te.prototype.hide=function(e,t){if(this._isDestroyed)return this;var i=this._item,r=i._element,n=this._queue,s=h(t)?t:null,o=i.getGrid()._settings;return!this._isHiding&&this._isHidden?(s&&s(!1,i),this):this._isHiding&&!e?(s&&n.add(s),this):(this._isHiding||(n.flush(!0,i),R(r,o.itemHiddenClass),pe(r,o.itemVisibleClass)),s&&n.add(s),this._isHidden=this._isHiding=!0,i._isActive=this._isShowing=!1,this._startAnimation(!1,e,this._finishHide),this)},Te.prototype.destroy=function(){if(this._isDestroyed)return this;var e=this._item,t=e._element,i=e.getGrid(),r=this._queue,n=i._settings;return this._stopAnimation({}),r.flush(!0,e).destroy(),pe(t,n.itemVisibleClass),pe(t,n.itemHiddenClass),this._item=null,this._isHiding=this._isShowing=!1,this._isDestroyed=this._isHidden=!0,this},Te.prototype._startAnimation=function(e,t,i){if(!this._isDestroyed){var r,n=this._item,s=n.getGrid()._settings,o=e?s.visibleStyles:s.hiddenStyles,l=parseInt(e?s.showDuration:s.hideDuration)||0,h=(e?s.showEasing:s.hideEasing)||"ease",d=t||l<=0;if(o){if(V(n._id),d)return n._animateChild.isAnimating()?n._animateChild.stop(o):c(n._child,o),void(i&&i());var p,f,m;p=n._id,f=function(){r=function(e,t){var i={};for(var r in t)i[r]=a(e,u(r));return i}(n._child,o)},m=function(){n._animateChild.start(r,o,{duration:l,easing:h,onFinish:i})},k.add(p+"visibility",f,m)}else i&&i()}},Te.prototype._stopAnimation=function(e){if(!this._isDestroyed){var t=this._item;V(t._id),t._animateChild.stop(e)}},Te.prototype._finishShow=function(){this._isHidden||(this._isShowing=!1,this._queue.flush(!1,this._item))};var Pe={};Te.prototype._finishHide=function(){if(this._isHidden){var e=this._item;this._isHiding=!1,Pe.transform=de(0,0),e._layout.stop(!0,Pe),e._element.style.display="none",this._queue.flush(!1,e)}};var Ae,Se,Ee,xe,De=0;function ke(){return++De}function Ve(e,t,i){var n=e._settings;this._id=ke(),this._gridId=e._id,this._isDestroyed=!1,this._left=0,this._top=0,this._element=t,this._child=t.children[0],t.parentNode!==e._element&&e._element.appendChild(t),R(t,n.itemClass),"boolean"!=typeof i&&(i="none"!==a(t,"display")),this._isActive=i,t.style.left="0",t.style.top="0",t.style[r]=de(0,0),this._animate=new d(t),this._animateChild=new d(this._child),this._visibility=new Te(this),this._layout=new ve(this),this._migrate=new be(this),this._release=new Ce(this),this._dragPlaceholder=new ge(this),this._drag=n.dragEnabled?new fe(this):null,this._refreshDimensions(),this._refreshSortData()}function ze(){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 Oe(e){var t=Object.prototype.toString.call(e);return"[object HTMLCollection]"===t||"[object NodeList]"===t}Ve.prototype.getGrid=function(){return e[this._gridId]},Ve.prototype.getElement=function(){return this._element},Ve.prototype.getWidth=function(){return this._width},Ve.prototype.getHeight=function(){return this._height},Ve.prototype.getMargin=function(){return{left:this._marginLeft,right:this._marginRight,top:this._marginTop,bottom:this._marginBottom}},Ve.prototype.getPosition=function(){return{left:this._left,top:this._top}},Ve.prototype.isActive=function(){return this._isActive},Ve.prototype.isVisible=function(){return!!this._visibility&&!this._visibility._isHidden},Ve.prototype.isShowing=function(){return!(!this._visibility||!this._visibility._isShowing)},Ve.prototype.isHiding=function(){return!(!this._visibility||!this._visibility._isHiding)},Ve.prototype.isPositioning=function(){return!(!this._layout||!this._layout._isActive)},Ve.prototype.isDragging=function(){return!(!this._drag||!this._drag._isActive)},Ve.prototype.isReleasing=function(){return!(!this._release||!this._release._isActive)},Ve.prototype.isDestroyed=function(){return this._isDestroyed},Ve.prototype._refreshDimensions=function(){if(!this._isDestroyed&&!this._visibility._isHidden){var e=this._element,t=this._dragPlaceholder,i=e.getBoundingClientRect();this._width=i.width,this._height=i.height,this._marginLeft=Math.max(0,W(e,"margin-left")),this._marginRight=Math.max(0,W(e,"margin-right")),this._marginTop=Math.max(0,W(e,"margin-top")),this._marginBottom=Math.max(0,W(e,"margin-bottom")),t&&t.updateDimensions(this._width,this._height)}},Ve.prototype._refreshSortData=function(){if(!this._isDestroyed){var e,t=this._sortData={},i=this.getGrid()._settings.sortData;for(e in i)t[e]=i[e](this,this._element)}},Ve.prototype._destroy=function(e){if(!this._isDestroyed){var t=this._element,i=this.getGrid(),r=i._settings,n=i._items.indexOf(this);this._release.destroy(),this._migrate.destroy(),this._layout.destroy(),this._visibility.destroy(),this._animate.destroy(),this._animateChild.destroy(),this._dragPlaceholder.destroy(),this._drag&&this._drag.destroy(),t.removeAttribute("style"),this._child.removeAttribute("style"),pe(t,r.itemClass),n>-1&&i._items.splice(n,1),e&&t.parentNode.removeChild(t),this._isActive=!1,this._isDestroyed=!0}},ze.prototype.getLayout=function(e,t,i,r,n){var s,o=this._layout,a=!(!n||!n.fillGaps),l=!(!n||!n.horizontal),u=!(!n||!n.alignRight),h=!(!n||!n.alignBottom),c=!(!n||!n.rounding),d=this._slotSizes;if(o.slots=r||this._slots,o.width=l?0:c?Math.round(t):t,o.height=l?c?Math.round(i):i:0,o.setWidth=l,o.setHeight=!l,o.slots.length=0,d.length=0,!e.length)return o;for(s=0;s<e.length;s++)this._addSlot(e[s],l,a,c,u||h);if(u)for(s=0;s<o.slots.length;s+=2)o.slots[s]=o.width-(o.slots[s]+d[s]);if(h)for(s=1;s<o.slots.length;s+=2)o.slots[s]=o.height-(o.slots[s]+d[s]);return d.length=0,this._freeSlots.length=0,this._newSlots.length=0,this._rectId=0,o},ze.prototype._addSlot=(xe={},function(e,t,i,r,n){var s,o,a,l,u,h,c=this._layout,d=this._freeSlots,p=this._newSlots;for(p.length=0,xe.left=null,xe.top=null,xe.width=e._width+e._marginLeft+e._marginRight,xe.height=e._height+e._marginTop+e._marginBottom,r&&(xe.width=Math.round(xe.width),xe.height=Math.round(xe.height)),u=0;u<d.length;u++)if((o=d[u])&&(s=this._getRect(o),xe.width<=s.width+.001&&xe.height<=s.height+.001)){xe.left=s.left,xe.top=s.top;break}for(null===xe.left&&(xe.left=t?c.width:0,xe.top=t?0:c.height,i||(l=!0)),!t&&xe.top+xe.height>c.height&&(xe.left>0&&p.push(this._addRect(0,c.height,xe.left,1/0)),xe.left+xe.width<c.width&&p.push(this._addRect(xe.left+xe.width,c.height,c.width-xe.left-xe.width,1/0)),c.height=xe.top+xe.height),t&&xe.left+xe.width>c.width&&(xe.top>0&&p.push(this._addRect(c.width,0,1/0,xe.top)),xe.top+xe.height<c.height&&p.push(this._addRect(c.width,xe.top+xe.height,1/0,c.height-xe.top-xe.height)),c.width=xe.left+xe.width),u=i?0:l?d.length:u;u<d.length;u++)if(o=d[u])for(s=this._getRect(o),a=this._splitRect(s,xe),h=0;h<a.length;h++)o=a[h],(s=this._getRect(o)).width>.49&&s.height>.49&&(!t&&s.top<c.height||t&&s.left<c.width)&&p.push(o);p.length&&this._purgeRects(p).sort(t?this._sortRectsLeftTop:this._sortRectsTopLeft),t?c.width=Math.max(c.width,xe.left+xe.width):c.height=Math.max(c.height,xe.top+xe.height),c.slots.push(xe.left,xe.top),n&&this._slotSizes.push(xe.width,xe.height),this._freeSlots=p,this._newSlots=d}),ze.prototype._addRect=function(e,t,i,r){var n=++this._rectId,s=this._rectStore;return s[n]=e||0,s[++this._rectId]=t||0,s[++this._rectId]=i||0,s[++this._rectId]=r||0,n},ze.prototype._getRect=function(e,t){var i=t||this._rectItem,r=this._rectStore;return i.left=r[e]||0,i.top=r[++e]||0,i.width=r[++e]||0,i.height=r[++e]||0,i},ze.prototype._splitRect=(Ee=[],function(e,t){return Ee.length=0,this._doRectsOverlap(e,t)?(e.left<t.left&&Ee.push(this._addRect(e.left,e.top,t.left-e.left,e.height)),e.left+e.width>t.left+t.width&&Ee.push(this._addRect(t.left+t.width,e.top,e.left+e.width-(t.left+t.width),e.height)),e.top<t.top&&Ee.push(this._addRect(e.left,e.top,e.width,t.top-e.top)),e.top+e.height>t.top+t.height&&Ee.push(this._addRect(e.left,t.top+t.height,e.width,e.top+e.height-(t.top+t.height))),Ee):(Ee.push(this._addRect(e.left,e.top,e.width,e.height)),Ee)}),ze.prototype._doRectsOverlap=function(e,t){return!(e.left+e.width<=t.left||t.left+t.width<=e.left||e.top+e.height<=t.top||t.top+t.height<=e.top)},ze.prototype._isRectWithinRect=function(e,t){return e.left>=t.left&&e.top>=t.top&&e.left+e.width<=t.left+t.width&&e.top+e.height<=t.top+t.height},ze.prototype._purgeRects=(Ae={},Se={},function(e){for(var t,i=e.length;i--;)if(t=e.length,e[i])for(this._getRect(e[i],Ae);t--;)if(e[t]&&i!==t&&this._isRectWithinRect(Ae,this._getRect(e[t],Se))){e[i]=0;break}return e}),ze.prototype._sortRectsTopLeft=function(){var e={},t={};return function(i,r){return this._getRect(i,e),this._getRect(r,t),e.top<t.top?-1:e.top>t.top?1:e.left<t.left?-1:e.left>t.left?1:0}}(),ze.prototype._sortRectsLeftTop=function(){var e={},t={};return function(i,r){return this._getRect(i,e),this._getRect(r,t),e.left<t.left?-1:e.left>t.left?1:e.top<t.top?-1:e.top>t.top?1:0}}();var Le=Object.prototype.toString;function Me(e){return"object"==typeof e&&"[object Object]"===Le.call(e)}function Be(e){return Oe(e)?Array.prototype.slice.call(e):Array.prototype.concat(e)}var je=new ze,Re=function(){};function Ne(i,r){var n,s,o,a,l,u,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");h((n=this._settings=(a=Ne.defaultOptions,l=r,u=Ie({},a),l&&(u=Ie(u,l)),u.visibleStyles=(l||0).visibleStyles||(a||0).visibleStyles,u.hiddenStyles=(l||0).hiddenStyles||(a||0).hiddenStyles,u)).dragSort)||(n.dragSort=!!n.dragSort),this._id=ke(),e[this._id]=c,this._isDestroyed=!1,this._layout={id:0,items:[],slots:[],setWidth:!1,setHeight:!1,width:0,height:0},this._emitter=new t,R(i,n.containerClass),this._items=[],"string"==typeof(s=n.items)?Be(i.children).forEach((function(e){("*"===s||j(e,s))&&c._items.push(new Ve(c,e))})):(Array.isArray(s)||Oe(s))&&(this._items=Be(s).map((function(e){return new Ve(c,e)}))),"number"!=typeof(o=n.layoutOnResize)&&(o=!0===o?0:-1),o>=0&&window.addEventListener("resize",c._resizeHandler=X((function(){c.refreshItems().layout()}),o)),n.layoutOnInit&&this.layout(!0)}function Ie(e,t){var i,r,n,s=Object.keys(t),o=s.length;for(n=0;n<o;n++)i=Me(t[r=s[n]]),Me(e[r])&&i?e[r]=Ie(Ie({},e[r]),t[r]):i?e[r]=Ie({},t[r]):Array.isArray(t[r])?e[r]=t[r].slice(0):e[r]=t[r];return e}return Ne.Item=Ve,Ne.ItemLayout=ve,Ne.ItemVisibility=Te,Ne.ItemMigrate=be,Ne.ItemAnimate=d,Ne.ItemDrag=fe,Ne.ItemRelease=Ce,Ne.ItemDragPlaceholder=ge,Ne.Emitter=t,Ne.Dragger=x,Ne.Packer=ze,Ne.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"},Ne.prototype.on=function(e,t){return this._emitter.on(e,t),this},Ne.prototype.off=function(e,t){return this._emitter.off(e,t),this},Ne.prototype.getElement=function(){return this._element},Ne.prototype.getItems=function(e){if(this._isDestroyed||!e&&0!==e)return this._items.slice(0);var t,i,r=[],n=Be(e);for(i=0;i<n.length;i++)(t=this._getItem(n[i]))&&r.push(t);return r},Ne.prototype.refreshItems=function(e){if(this._isDestroyed)return this;var t,i=this.getItems(e);for(t=0;t<i.length;t++)i[t]._refreshDimensions();return this},Ne.prototype.refreshSortData=function(e){if(this._isDestroyed)return this;var t,i=this.getItems(e);for(t=0;t<i.length;t++)i[t]._refreshSortData();return this},Ne.prototype.synchronize=function(){if(this._isDestroyed)return this;var e,t,i,r=this._element,n=this._items;if(n.length){for(i=0;i<n.length;i++)(t=n[i]._element).parentNode===r&&(e=e||window.document.createDocumentFragment()).appendChild(t);e&&r.appendChild(e)}return this._emit("synchronize"),this},Ne.prototype.layout=function(e,t){if(this._isDestroyed)return this;var i,r,n,s=this,o=this._element,l=this._updateLayout(),u=l.id,c=l.items.length,d=c;function p(){if(!(--d>0)){var i=s._layout.id!==u,r=h(e)?e:t;h(r)&&r(i,l.items.slice(0)),!i&&s._hasListeners("layoutEnd")&&s._emit("layoutEnd",l.items.slice(0))}}if((l.setHeight&&"number"==typeof l.height||l.setWidth&&"number"==typeof l.width)&&(i="border-box"===a(o,"box-sizing")),l.setHeight&&("number"==typeof l.height?o.style.height=(i?l.height+this._borderTop+this._borderBottom:l.height)+"px":o.style.height=l.height),l.setWidth&&("number"==typeof l.width?o.style.width=(i?l.width+this._borderLeft+this._borderRight:l.width)+"px":o.style.width=l.width),this._hasListeners("layoutStart")&&this._emit("layoutStart",l.items.slice(0)),!c)return p(),this;for(n=0;n<c;n++)(r=l.items[n])&&(r._left=l.slots[2*n],r._top=l.slots[2*n+1],r.isDragging()?p():r._layout.start(!0===e,p));return this},Ne.prototype.add=function(e,t){if(this._isDestroyed||!e)return[];var i=Be(e);if(!i.length)return i;var r,n,s=t||0,o=s.layout?s.layout:void 0===s.layout,a=this._items,l=!1;for(n=0;n<i.length;n++)r=new Ve(this,i[n],s.isActive),i[n]=r,r._isActive&&(l=!0,r._layout._skipNextAnimation=!0);return I(a,i,s.index),this._hasListeners("add")&&this._emit("add",i.slice(0)),l&&o&&this.layout("instant"===o,h(o)?o:void 0),i},Ne.prototype.remove=function(e,t){if(this._isDestroyed)return this;var i,r,n=t||0,s=n.layout?n.layout:void 0===n.layout,o=!1,a=this.getItems(),l=this.getItems(e),u=[];for(r=0;r<l.length;r++)i=l[r],u.push(a.indexOf(i)),i._isActive&&(o=!0),i._destroy(n.removeElements);return this._hasListeners("remove")&&this._emit("remove",l.slice(0),u),o&&s&&this.layout("instant"===s,h(s)?s:void 0),l},Ne.prototype.show=function(e,t){return this._isDestroyed||this._setItemsVisibility(e,!0,t),this},Ne.prototype.hide=function(e,t){return this._isDestroyed||this._setItemsVisibility(e,!1,t),this},Ne.prototype.filter=function(e,t){if(this._isDestroyed||!this._items.length)return this;var i,r,n=[],s=[],o="string"==typeof e,a=h(e),l=t||0,u=!0===l.instant,c=l.layout?l.layout:void 0===l.layout,d=h(l.onFinish)?l.onFinish:null,p=-1,f=Re;if(d&&(f=function(){++p&&d(n.slice(0),s.slice(0))}),a||o)for(r=0;r<this._items.length;r++)i=this._items[r],(a?e(i):j(i._element,e))?n.push(i):s.push(i);return n.length?this.show(n,{instant:u,onFinish:f,layout:!1}):f(),s.length?this.hide(s,{instant:u,onFinish:f,layout:!1}):f(),(n.length||s.length)&&(this._hasListeners("filter")&&this._emit("filter",n.slice(0),s.slice(0)),c&&this.layout("instant"===c,h(c)?c:void 0)),this},Ne.prototype.sort=function(){var e,t,i,r;function n(e){for(var t={},i=0;i<e.length;i++)t[e[i]._id]=i;return t}function s(e,i){var n=r[e._id],s=r[i._id];return t?s-n:n-s}function o(o,a){for(var l,u,h,c,d=0,p=0;p<e.length;p++)if(l=e[p][0],u=e[p][1],h=(o._sortData?o:o._refreshSortData())._sortData[l],c=(a._sortData?a:a._refreshSortData())._sortData[l],d="desc"===u||!u&&t?c<h?-1:c>h?1:0:h<c?-1:h>c?1:0)return d;return d||(r||(r=n(i)),d=s(o,a)),d}function a(o,a){var l=e(o,a);return t&&l&&(l=-l),l||(r||(r=n(i)),s(o,a))}return function(n,s){if(this._isDestroyed||this._items.length<2)return this;var l,u=this._items,c=s||0,d=c.layout?c.layout:void 0===c.layout;if(e=n,t=!!c.descending,i=u.slice(0),r=null,h(e))u.sort(a);else if("string"==typeof e)e=n.trim().split(" ").map((function(e){return e.split(":")})),u.sort(o);else{if(!Array.isArray(e))return this;if(e.length!==u.length)throw new Error("[Muuri] sort reference items do not match with grid items.");for(l=0;l<u.length;l++){if(e.indexOf(u[l])<0)throw new Error("[Muuri] sort reference items do not match with grid items.");u[l]=e[l]}t&&u.reverse()}return this._hasListeners("sort")&&this._emit("sort",u.slice(0),i),d&&this.layout("instant"===d,h(d)?d:void 0),this}}(),Ne.prototype.move=function(e,t,i){if(this._isDestroyed||this._items.length<2)return this;var r,n,s=this._items,o=i||0,a=o.layout?o.layout:void 0===o.layout,l="swap"===o.action,u=l?"swap":"move",c=this._getItem(e),d=this._getItem(t);return c&&d&&c!==d&&(r=s.indexOf(c),n=s.indexOf(d),l?H(s,r,n):F(s,r,n),this._hasListeners("move")&&this._emit("move",{item:c,fromIndex:r,toIndex:n,action:u}),a&&this.layout("instant"===a,h(a)?a:void 0)),this},Ne.prototype.send=function(e,t,i,r){if(this._isDestroyed||t._isDestroyed||this===t)return this;if(!(e=this._getItem(e)))return this;var n=r||0,s=n.appendTo||window.document.body,o=n.layoutSender?n.layoutSender:void 0===n.layoutSender,a=n.layoutReceiver?n.layoutReceiver:void 0===n.layoutReceiver;return e._migrate.start(t,i,s),e._migrate._isActive&&e._isActive&&(o&&this.layout("instant"===o,h(o)?o:void 0),a&&t.layout("instant"===a,h(a)?a:void 0)),this},Ne.prototype.destroy=function(t){if(this._isDestroyed)return this;var i,r=this._element,n=this._items.slice(0);for(this._resizeHandler&&window.removeEventListener("resize",this._resizeHandler),i=0;i<n.length;i++)n[i]._destroy(t);return pe(r,this._settings.containerClass),r.style.height="",r.style.width="",this._emit("destroy"),this._emitter.destroy(),e[this._id]=void 0,this._isDestroyed=!0,this},Ne.prototype._getItem=function(e){if(this._isDestroyed||!e&&0!==e)return null;if("number"==typeof e)return this._items[e>-1?e:this._items.length+e]||null;if(e instanceof Ve)return e._gridId===this._id?e:null;for(var t=0;t<this._items.length;t++)if(this._items[t]._element===e)return this._items[t];return null},Ne.prototype._updateLayout=function(){var e,t,i,r,n=this._layout,s=this._settings.layout;for(++n.id,n.items.length=0,r=0;r<this._items.length;r++)this._items[r]._isActive&&n.items.push(this._items[r]);return this._refreshDimensions(),e=this._width-this._borderLeft-this._borderRight,t=this._height-this._borderTop-this._borderBottom,i=h(s)?s(n.items,e,t):je.getLayout(n.items,e,t,n.slots,s),n.slots=i.slots,n.setWidth=Boolean(i.setWidth),n.setHeight=Boolean(i.setHeight),n.width=i.width,n.height=i.height,n},Ne.prototype._emit=function(){this._isDestroyed||this._emitter.emit.apply(this._emitter,arguments)},Ne.prototype._hasListeners=function(e){var t=this._emitter._events[e];return!(!t||!t.length)},Ne.prototype._updateBoundingRect=function(){var e=this._element.getBoundingClientRect();this._width=e.width,this._height=e.height,this._left=e.left,this._top=e.top},Ne.prototype._updateBorders=function(e,t,i,r){var n=this._element;e&&(this._borderLeft=W(n,"border-left-width")),t&&(this._borderRight=W(n,"border-right-width")),i&&(this._borderTop=W(n,"border-top-width")),r&&(this._borderBottom=W(n,"border-bottom-width"))},Ne.prototype._refreshDimensions=function(){this._updateBoundingRect(),this._updateBorders(1,1,1,1)},Ne.prototype._setItemsVisibility=function(e,t,i){var r,n,s=this,o=this.getItems(e),a=i||0,l=!0===a.instant,u=a.onFinish,c=a.layout?a.layout:void 0===a.layout,d=o.length,p=t?"showStart":"hideStart",f=t?"showEnd":"hideEnd",m=t?"show":"hide",g=!1,_=[],v=[];if(d){for(this._hasListeners(p)&&this._emit(p,o.slice(0)),n=0;n<o.length;n++)r=o[n],(t&&!r._isActive||!t&&r._isActive)&&(g=!0),t&&!r._isActive&&(r._layout._skipNextAnimation=!0),t&&r._visibility._isHidden&&v.push(r),r._visibility[m](l,(function(e,t){e||_.push(t),--d<1&&(h(u)&&u(_.slice(0)),s._hasListeners(f)&&s._emit(f,_.slice(0)))}));v.length&&this.refreshItems(v),g&&c&&this.layout("instant"===c,h(c)?c:void 0)}else h(u)&&u(o)},Ne}()},function(e,t,i){},function(e,t,i){},function(e,t,i){},function(e,t,i){},function(e,t,i){"use strict";i.r(t),i.d(t,"localization",(function(){return r.a})),i.d(t,"surveyStrings",(function(){return r.b})),i.d(t,"DataProvider",(function(){return s})),i.d(t,"VisualizerFactory",(function(){return c})),i.d(t,"NumberModel",(function(){return d})),i.d(t,"hideEmptyAnswersInData",(function(){return p})),i.d(t,"SelectBase",(function(){return f})),i.d(t,"Matrix",(function(){return m})),i.d(t,"BooleanModel",(function(){return g})),i.d(t,"HistogramModel",(function(){return _})),i.d(t,"VisualizerBase",(function(){return l})),i.d(t,"defaultStatisticsCalculator",(function(){return u})),i.d(t,"VisualizationManager",(function(){return h})),i.d(t,"VisualizationPanel",(function(){return P})),i.d(t,"VisualizationPanelDynamic",(function(){return A})),i.d(t,"VisualizationMatrixDynamic",(function(){return S})),i.d(t,"VisualizationMatrixDropdown",(function(){return E})),i.d(t,"AlternativeVisualizersWrapper",(function(){return v})),i.d(t,"PlotlySetup",(function(){return x})),i.d(t,"PlotlyChartAdapter",(function(){return V})),i.d(t,"SelectBasePlotly",(function(){return z})),i.d(t,"MatrixPlotly",(function(){return O})),i.d(t,"PlotlyBoolChartAdapter",(function(){return L})),i.d(t,"BooleanPlotly",(function(){return M})),i.d(t,"RankingPlotly",(function(){return B})),i.d(t,"MatrixDropdownGroupedPlotly",(function(){return j})),i.d(t,"HistogramPlotly",(function(){return R})),i.d(t,"PlotlyGaugeAdapter",(function(){return N})),i.d(t,"GaugePlotly",(function(){return I})),i.d(t,"WordCloudAdapter",(function(){return X})),i.d(t,"WordCloud",(function(){return Y})),i.d(t,"textHelper",(function(){return F})),i.d(t,"TextTableAdapter",(function(){return Q})),i.d(t,"Text",(function(){return W})),i.d(t,"ChoicesTableAdapter",(function(){return U})),i.d(t,"ChoicesTable",(function(){return K})),i.d(t,"NpsVisualizerWidget",(function(){return Z})),i.d(t,"NpsAdapter",(function(){return J})),i.d(t,"NpsVisualizer",(function(){return $})),i.d(t,"DocumentHelper",(function(){return a.b}));var r=i(0),n=(i(9),i(10),i(11),i(12),i(13),i(14),i(15),i(16),i(17),i(18),i(19),i(3)),s=function(){function e(e){void 0===e&&(e=[]),this._data=e,this.filterValues={},this.onDataChanged=new n.Event}return Object.defineProperty(e.prototype,"data",{get:function(){if(Array.isArray(this._data))return this._data},set:function(e){Array.isArray(e)?this._data=[].concat(e):this._data=e,this.raiseDataChanged()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dataFn",{get:function(){if("function"==typeof this._data)return this._data},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"filteredData",{get:function(){var t=this;void 0===this._filteredData&&(Object.keys(this.filterValues).length>0?this._filteredData=this.data.filter((function(i){return!Object.keys(t.filterValues).some((function(r){var n=t.filterValues[r],s=typeof n,o=i[r];if(Array.isArray(o)&&"object"!==s)return-1==o.indexOf(n);if("object"==typeof o)return"object"!==s||!function(e,t){var i=Object.keys(e),r=Object.keys(t);if(r.length>i.length)return!1;for(var n=0,s=r;n<s.length;n++){var o=s[n];if(t[o]!=e[o])return!1}return!0}(o,n);var a=i[e.seriesMarkerKey];if(a&&"object"===s)return o!==n[a];if("object"===s&&void 0!==n.start&&void 0!==n.end){var l="number"==typeof o?o:Date.parse(o);return!(!isNaN(l)||(l=parseFloat(o),!isNaN(l)))||(l<n.start||l>=n.end)}return i[r]!==t.filterValues[r]}))})):this._filteredData=this.data);return this._filteredData},enumerable:!1,configurable:!0}),e.prototype.setFilter=function(e,t){var i=!0;void 0!==t?(i=this.filterValues[e]!==t,this.filterValues[e]=t):(i=void 0!==this.filterValues[e],delete this.filterValues[e]),i&&this.raiseDataChanged()},e.prototype.raiseDataChanged=function(e){this._filteredData=void 0,this.onDataChanged.isEmpty||this.onDataChanged.fire(this,{questionName:e})},e.prototype.getFilters=function(){var e=this;return Object.keys(this.filterValues).map((function(t){return{field:t,type:"=",value:e.filterValues[t]}}))},e.seriesMarkerKey="__sa_series_name",e}();var o=i(2),a=i(1),l=(i(27),function(){function e(e,t,i,r){void 0===i&&(i={});var o,a=this;this.question=e,this.options=i,this._type=r,this._showToolbar=!0,this._footerVisualizer=void 0,this._dataProvider=void 0,this._getDataCore=void 0,this.labelTruncateLength=27,this.renderResult=void 0,this.toolbarContainer=void 0,this.headerContainer=void 0,this.contentContainer=void 0,this.footerContainer=void 0,this._supportSelection=!1,this.onAfterRender=new n.Event,this.onLocaleChanged=new n.Event,this.onStateChanged=new n.Event,this.toolbarItemCreators={},this._backgroundColor="#f7f7f7",this._calculationsCache=void 0,this.loadingData=!1,this._settingState=!1,this._getDataCore=null===(o=this.questionOptions)||void 0===o?void 0:o.getDataCore,this._dataProvider=i.dataProvider||new s(t),this._dataProvider.onDataChanged.add((function(){return a.onDataChanged()})),this.loadingData=!!this._dataProvider.dataFn,void 0!==i.labelTruncateLength&&(this.labelTruncateLength=i.labelTruncateLength)}return e.prototype.afterRender=function(e){this.onAfterRender.fire(this,{htmlElement:e})},e.prototype.stateChanged=function(e,t){this._settingState||this.onStateChanged.fire(this,this.getState())},Object.defineProperty(e.prototype,"questionOptions",{get:function(){var e;return this.options[null===(e=this.question)||void 0===e?void 0:e.name]},enumerable:!1,configurable:!0}),e.prototype.onDataChanged=function(){this._calculationsCache=void 0,this.loadingData=!!this._dataProvider.dataFn,this.refresh()},Object.defineProperty(e.prototype,"name",{get:function(){return this.question.valueName||this.question.name},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dataNames",{get:function(){return[this.name]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasHeader",{get:function(){return!(!this.options||!this.options.showCorrectAnswers)&&(!!this.question&&!!this.question.correctAnswer)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasFooter",{get:function(){return!!this.question&&(this.question.hasComment||this.question.hasOther)},enumerable:!1,configurable:!0}),e.prototype.createVisualizer=function(e){var t=Object.assign({},this.options);return void 0===t.dataProvider&&(t.dataProvider=this.dataProvider),c.createVisualizer(e,this.data,t)},Object.defineProperty(e.prototype,"footerVisualizer",{get:function(){var e=this;if(this.hasFooter){if(!this._footerVisualizer){var t=new n.QuestionCommentModel(this.question.name+(n.settings||{}).commentPrefix);t.title=this.processText(this.question.title),this._footerVisualizer=this.createVisualizer(t),this._footerVisualizer&&(this._footerVisualizer.onUpdate=function(){return e.invokeOnUpdate()})}return this._footerVisualizer}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"supportSelection",{get:function(){return(void 0===this.options.allowSelection||this.options.allowSelection)&&this._supportSelection},enumerable:!1,configurable:!0}),e.prototype.getSeriesValues=function(){return this.options.seriesValues||[]},e.prototype.getSeriesLabels=function(){return this.options.seriesLabels||this.getSeriesValues()},e.prototype.getValues=function(){throw new Error("Method not implemented.")},e.prototype.getLabels=function(){return this.getValues()},e.prototype.registerToolbarItem=function(e,t){this.toolbarItemCreators[e]=t},e.prototype.unregisterToolbarItem=function(e){if(void 0!==this.toolbarItemCreators[e]){var t=this.toolbarItemCreators[e];return delete this.toolbarItemCreators[e],t}},Object.defineProperty(e.prototype,"type",{get:function(){return this._type||"visualizer"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"data",{get:function(){return this.dataProvider.filteredData},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"surveyData",{get:function(){return this.dataProvider.filteredData},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dataProvider",{get:function(){return this._dataProvider},enumerable:!1,configurable:!0}),e.prototype.updateData=function(e){this.options.dataProvider||(this.dataProvider.data=e),this.hasFooter&&this.footerVisualizer.updateData(e)},e.prototype.invokeOnUpdate=function(){this.onUpdate&&this.onUpdate()},e.prototype.destroy=function(){this.renderResult&&(this.clear(),this.toolbarContainer=void 0,this.headerContainer=void 0,this.contentContainer=void 0,this.footerContainer=void 0,this.renderResult.innerHTML="",this.renderResult=void 0),this._footerVisualizer&&(this._footerVisualizer.destroy(),this._footerVisualizer.onUpdate=void 0,this._footerVisualizer=void 0)},e.prototype.clear=function(){this.toolbarContainer&&this.destroyToolbar(this.toolbarContainer),this.headerContainer&&this.destroyHeader(this.headerContainer),this.contentContainer&&this.destroyContent(this.contentContainer),this.footerContainer&&this.destroyFooter(this.footerContainer)},e.prototype.createToolbarItems=function(e){var t=this;Object.keys(this.toolbarItemCreators||{}).forEach((function(i){var r=t.toolbarItemCreators[i](e);r&&e.appendChild(r)}))},e.prototype.getCorrectAnswerText=function(){return this.question?this.question.correctAnswer:""},e.prototype.destroyToolbar=function(e){e.innerHTML=""},e.prototype.renderToolbar=function(e){if(this.showToolbar){var t=a.b.createElement("div","sa-toolbar");this.createToolbarItems(t),e.appendChild(t)}},e.prototype.destroyHeader=function(e){this.options&&"function"==typeof this.options.destroyHeader?this.options.destroyHeader(e,this):e.innerHTML=""},e.prototype.destroyContent=function(e){this.options&&"function"==typeof this.options.destroyContent?this.options.destroyContent(e,this):e.innerHTML=""},e.prototype.renderHeader=function(e){if(this.options&&"function"==typeof this.options.renderHeader)this.options.renderHeader(e,this);else{var t=a.b.createElement("div","sa-visualizer__correct-answer");t.innerText=r.a.getString("correctAnswer")+this.getCorrectAnswerText(),e.appendChild(t)}},e.prototype.renderContentAsync=function(e){return Object(o.b)(this,void 0,void 0,(function(){return Object(o.d)(this,(function(t){return[2,new Promise((function(t,i){e.innerText=r.a.getString("noVisualizerForQuestion"),t(e)}))]}))}))},e.prototype.renderContent=function(e){var t=this;this.options&&"function"==typeof this.options.renderContent?(this.options.renderContent(e,this),this.afterRender(e)):(this.loadingData&&this.renderLoadingIndicator(this.contentContainer),this.renderContentAsync(e).then((function(e){return t.afterRender(e)})))},e.prototype.destroyFooter=function(e){e.innerHTML=""},e.prototype.renderFooter=function(t){var i=this;if(t.innerHTML="",this.hasFooter){var n=a.b.createElement("h4","sa-visualizer__footer-title",{innerText:r.a.getString("otherCommentTitle")});t.appendChild(n);var s=a.b.createElement("div","sa-visualizer__footer-content");s.style.display=e.otherCommentCollapsed?"none":"block";var o=a.b.createButton((function(){"none"===s.style.display?(s.style.display="block",o.innerText=r.a.getString("hideButton")):(s.style.display="none",o.innerText=r.a.getString(e.otherCommentCollapsed?"showButton":"hideButton")),i.footerVisualizer.invokeOnUpdate()}),r.a.getString("showButton"));t.appendChild(o),t.appendChild(s),this.footerVisualizer.render(s)}},e.prototype.render=function(e){"string"==typeof e&&(e=document.getElementById(e)),this.renderResult=e,this.toolbarContainer=a.b.createElement("div","sa-visualizer__toolbar"),e.appendChild(this.toolbarContainer),this.renderToolbar(this.toolbarContainer),this.hasHeader&&(this.headerContainer=a.b.createElement("div","sa-visualizer__header"),e.appendChild(this.headerContainer),this.renderHeader(this.headerContainer)),this.contentContainer=a.b.createElement("div","sa-visualizer__content"),e.appendChild(this.contentContainer),this.renderContent(this.contentContainer),this.footerContainer=a.b.createElement("div","sa-visualizer__footer"),e.appendChild(this.footerContainer),this.renderFooter(this.footerContainer)},e.prototype.refresh=function(){var e=this;this.headerContainer&&setTimeout((function(){e.destroyHeader(e.headerContainer),e.renderHeader(e.headerContainer),e.invokeOnUpdate()})),this.contentContainer&&setTimeout((function(){e.destroyContent(e.contentContainer),e.renderContent(e.contentContainer),e.invokeOnUpdate()})),this.footerContainer&&setTimeout((function(){e.destroyFooter(e.footerContainer),e.renderFooter(e.footerContainer),e.invokeOnUpdate()}))},e.prototype.processText=function(e){return!1!==this.options.stripHtmlFromTitles?(e||"").replace(/(<([^>]+)>)/gi,""):e},e.prototype.getRandomColor=function(){var e=this.getColors();return e[Math.floor(Math.random()*e.length)]},Object.defineProperty(e.prototype,"backgroundColor",{get:function(){return this.getBackgroundColorCore()},set:function(e){this.setBackgroundColorCore(e)},enumerable:!1,configurable:!0}),e.prototype.getBackgroundColorCore=function(){return this._backgroundColor},e.prototype.setBackgroundColorCore=function(e){this._backgroundColor=e,this.footerVisualizer&&(this.footerVisualizer.backgroundColor=e)},e.prototype.getColors=function(t){void 0===t&&(t=10);for(var i=Array.isArray(e.customColors)&&e.customColors.length>0?e.customColors:e.colors,r=[],n=0;n<t;n++)r=r.concat(i);return r},Object.defineProperty(e.prototype,"showToolbar",{get:function(){return this._showToolbar},set:function(e){e!=this._showToolbar&&(this._showToolbar=e,this.toolbarContainer&&(this.destroyToolbar(this.toolbarContainer),this.renderToolbar(this.toolbarContainer)))},enumerable:!1,configurable:!0}),e.prototype.getData=function(){return this.getCalculatedValuesCore()},e.prototype.getCalculatedValuesCore=function(){return this._getDataCore?this._getDataCore(this):u(this.surveyData,this)},e.prototype.renderLoadingIndicator=function(e){e.appendChild(Object(a.f)())},e.prototype.convertFromExternalData=function(e){return e},e.prototype.getCalculatedValues=function(){var e=this;return new Promise((function(t,i){if(void 0!==e._calculationsCache&&t(e._calculationsCache),e.dataProvider.dataFn){e.loadingData=!0;var r=e.dataProvider.dataFn({visualizer:e,filter:e.dataProvider.getFilters(),callback:function(r){e.loadingData=!1,!r.error&&Array.isArray(r.data)?(e._calculationsCache=e.convertFromExternalData(r.data),t(e._calculationsCache)):i()}});r&&r.then((function(i){e.loadingData=!1,e._calculationsCache=e.convertFromExternalData(i),t(e._calculationsCache)})).catch((function(){e.loadingData=!1,i()}))}else e._calculationsCache=e.getCalculatedValuesCore(),t(e._calculationsCache)}))},e.prototype.getState=function(){return{}},e.prototype.setState=function(e){},Object.defineProperty(e.prototype,"locale",{get:function(){var e=this.options.survey;return e?e.locale:r.a.currentLocale},set:function(e){this.setLocale(e),this.onLocaleChanged.fire(this,{locale:e}),this.refresh()},enumerable:!1,configurable:!0}),e.prototype.setLocale=function(e){r.a.currentLocale=e;var t=this.options.survey;t&&t.locale!==e&&(t.locale=e)},e.suppressVisualizerStubRendering=!1,e.otherCommentCollapsed=!0,e.customColors=[],e.colors=["#86e1fb","#3999fb","#ff6771","#1eb496","#ffc152","#aba1ff","#7d8da5","#4ec46c","#cf37a6","#4e6198"],e}());function u(e,t){var i=t.dataNames,r=[],n=t.getValues(),o={};n.forEach((function(e,t){o[e]=t}));var a=-1!==n.indexOf(void 0),l=t.getSeriesValues(),u={};l.forEach((function(e,t){u[e]=t}));for(var h=l.length||1,c=0;c<i.length;++c){for(var d=new Array,p=0;p<h;++p)d.push(new Array(n.length).fill(0));r.push(d)}return e.forEach((function(e){i.forEach((function(t,i){var n=e[t];if(void 0!==n||a){var h=Array.isArray(n)?n:[n];if(l.length>0)if(void 0!==e[s.seriesMarkerKey]){var c=u[e[s.seriesMarkerKey]]||0;h.forEach((function(e){r[i][c][o[e]]++}))}else h.forEach((function(e){l.forEach((function(t){if(void 0!==e[t]){var n=u[t]||0;r[i][n][o[e[t]]]++}}))}));else h.forEach((function(e){return r[0][0][o[e]]++}))}}))})),t.dataNames.length>1?r:r[0]}var h=function(){function e(){}return e.registerVisualizer=function(t,i,r){void 0===r&&(r=Number.MAX_VALUE);var n=e.vizualizers[t];n||(n=[],e.vizualizers[t]=n),n.push({ctor:i,index:r})},e.unregisterVisualizer=function(t,i){var r=[t];t||(r=Object.keys(e.vizualizers)),r.forEach((function(t){if(i){var r=e.vizualizers[t];if(r){var n=r.filter((function(e){return e.ctor===i}))[0];if(n){var s=r.indexOf(n);-1!==s&&r.splice(s,1)}}}else e.vizualizers[t]=[]}))},e.unregisterVisualizerForAll=function(t){e.unregisterVisualizer(void 0,t)},e.getVisualizersByType=function(t){var i=e.vizualizers[t];return i?((i=[].concat(i)).sort((function(e,t){return e.index-t.index})),i.map((function(e){return e.ctor}))):l.suppressVisualizerStubRendering?[]:[l]},e.getAltVisualizerSelector=function(){return e.alternativesVisualizer||l},e.registerAltVisualizerSelector=function(t){e.alternativesVisualizer=t},e.alternativesVisualizer=void 0,e.vizualizers={},e}(),c=function(){function e(){}return e.createVisualizer=function(e,t,i){var r;r="text"===e.getType()&&e.inputType?e.inputType:e.getType();var n=h.getVisualizersByType(r).map((function(r){return new r(e,t,i)}));return n.length>1?new(h.getAltVisualizerSelector())(n,e,t,i):n[0]},e}(),d=function(e){function t(t,i,n,s){void 0===n&&(n={});var o=e.call(this,t,i,n,s||"number")||this;return o.registerToolbarItem("changeChartType",(function(){return o.chartTypes.length>1?a.b.createSelector(o.chartTypes.map((function(e){return{value:e,text:r.a.getString("chartType_"+e)}})),(function(e){return o.chartType===e.value}),(function(e){o.setChartType(e.target.value)})):null})),o}return Object(o.c)(t,e),t.prototype.onDataChanged=function(){this._resultAverage=void 0,this._resultMin=void 0,this._resultMax=void 0,e.prototype.onDataChanged.call(this)},t.prototype.onChartTypeChanged=function(){},t.prototype.setChartType=function(e){-1!==this.chartTypes.indexOf(e)&&this.chartType!==e&&(this.chartType=e,this.onChartTypeChanged(),this.contentContainer&&(this.destroyContent(this.contentContainer),this.renderContent(this.contentContainer)),this.invokeOnUpdate())},t.prototype.destroy=function(){this._resultAverage=void 0,this._resultMin=void 0,this._resultMax=void 0,e.prototype.destroy.call(this)},t.prototype.generateText=function(e,i,r){var n=[];if(5===r)n=["very high ("+e+")","high","medium","low","very low ("+i+")"];else{n.push(e);for(var s=0;s<r-2;s++)n.push("");n.push(i)}return t.generateTextsCallback?t.generateTextsCallback(this.question,e,i,r,n):n},t.prototype.generateValues=function(e,t){for(var i=[],r=0;r<t;r++)i.push(e/t);return i.push(e),i},t.prototype.generateColors=function(e,t,i){for(var r=this.getColors(),n=[],s=0;s<i;s++)n.push(r[s]);return n.push("rgba(255, 255, 255, 0)"),n},t.prototype.convertFromExternalData=function(e){return[e.value||0,e.minValue||0,e.maxValue||0]},t.prototype.getCalculatedValuesCore=function(){var e=this;if(void 0===this._resultAverage||void 0===this._resultMin||void 0===this._resultMax){this._resultMin=Number.MAX_VALUE,this._resultMax=-Number.MAX_VALUE,this._resultAverage=0;var t=0;this.data.forEach((function(i){if(void 0!==i[e.question.name]){var r=+i[e.question.name];t++,e._resultAverage+=r,e._resultMin>r&&(e._resultMin=r),e._resultMax<r&&(e._resultMax=r)}})),t>0&&(this._resultAverage=this._resultAverage/t),this._resultAverage=Math.ceil(100*this._resultAverage)/100}return[this._resultAverage,this._resultMin,this._resultMax]},t.stepsCount=5,t.showAsPercentage=!1,t}(l);function p(e){var t={datasets:[],labels:[],colors:[],texts:[],seriesLabels:[]};if(0===e.seriesLabels.length){t.datasets.push([]),t.texts.push([]);for(var i=0;i<e.datasets[0].length;i++)0!=e.datasets[0][i]&&(t.datasets[0].push(e.datasets[0][i]),t.labels.push(e.labels[i]),t.colors.push(e.colors[i]),t.texts[0].push(e.texts[0][i]));return t}var r=[];r.length=e.seriesLabels.length;var n=[];n.length=e.labels.length;for(var s=0;s<e.labels.length;s++)for(var o=0;o<e.seriesLabels.length;o++)0!=e.datasets[s][o]&&(r[o]=!0,n[s]=!0);for(s=0;s<n.length;s++)n[s]&&(t.labels.push(e.labels[s]),t.colors.push(e.colors[s]));for(o=0;o<e.seriesLabels.length;o++)r[o]&&t.seriesLabels.push(e.seriesLabels[o]);for(s=0;s<e.labels.length;s++)if(n[s]){var a=[],l=[];for(o=0;o<e.datasets.length;o++)r[o]&&(a.push(e.datasets[s][o]),l.push(e.texts[s][o]));t.datasets.push(a),t.texts.push(l)}return t}var f=function(e){function t(i,s,o,l){var u=e.call(this,i,s,o,l||"selectBase")||this;return u.selectedItem=void 0,u.choicesOrderSelector=void 0,u.showPercentageBtn=void 0,u.emptyAnswersBtn=void 0,u.transposeDataBtn=void 0,u.topNSelector=void 0,u._showPercentages=!1,u._showOnlyPercentages=!1,u._percentagePrecision=0,u._answersOrder="default",u._supportSelection=!0,u._hideEmptyAnswers=!1,u._topN=-1,u.topNValues=[].concat(t.topNValuesDefaults),u._transposeData=!1,u._showMissingAnswers=!1,u.missingAnswersBtn=void 0,u.chartTypes=[],u._chartType="bar",u.onAnswersDataReady=new n.Event,i.visibleChoicesChangedCallback=function(){u.dataProvider.raiseDataChanged()},u._showPercentages=!0===u.options.showPercentages,u._showOnlyPercentages=!0===u.options.showOnlyPercentages,u.options.percentagePrecision&&(u._percentagePrecision=u.options.percentagePrecision),u._hideEmptyAnswers=!0===u.options.hideEmptyAnswers,u._answersOrder=u.options.answersOrder||"default",u._showMissingAnswers=u.isSupportMissingAnswers()&&!0===u.options.showMissingAnswers,u.registerToolbarItem("changeChartType",(function(){return u.chartTypes.length>1?a.b.createSelector(u.chartTypes.map((function(e){return{value:e,text:r.a.getString("chartType_"+e)}})),(function(e){return u.chartType===e.value}),(function(e){u.setChartType(e.target.value)})):null})),u.registerToolbarItem("changeAnswersOrder",(function(){return u.isSupportAnswersOrder()&&(u.choicesOrderSelector=a.b.createSelector([{text:r.a.getString("defaultOrder"),value:"default"},{text:r.a.getString("ascOrder"),value:"asc"},{text:r.a.getString("descOrder"),value:"desc"}],(function(e){return!1}),(function(e){u.answersOrder=e.target.value})),u.updateOrderSelector()),u.choicesOrderSelector})),u.registerToolbarItem("showPercentages",(function(){if(u.options.allowShowPercentages&&(-1!==u.chartTypes.indexOf("bar")||-1!==u.chartTypes.indexOf("stackedbar")))return u.showPercentageBtn=a.b.createButton((function(){u.showPercentages=!u.showPercentages})),u.updateShowPercentageBtn(),u.showPercentageBtn})),u.registerToolbarItem("hideEmptyAnswers",(function(){return u.options.allowHideEmptyAnswers&&(u.emptyAnswersBtn=a.b.createButton((function(){u.hideEmptyAnswers=!u._hideEmptyAnswers})),u.updateEmptyAnswersBtn()),u.emptyAnswersBtn})),u.registerToolbarItem("topNAnswers",(function(){return u.options.allowTopNAnswers&&0===u.getSeriesValues().length&&(u.topNSelector=a.b.createSelector(u.topNValues.map((function(e){return{text:r.a.getString("topNValueText"+e),value:e}})),(function(e){return!1}),(function(e){u.topN=parseInt(e.target.value)})),u.updateTopNSelector()),u.topNSelector})),u.registerToolbarItem("transposeData",(function(){return u.options.allowTransposeData&&(u.transposeDataBtn=a.b.createButton((function(){u.transposeData=!u.transposeData})),u.updateTransposeDataBtn()),u.transposeDataBtn})),u.registerToolbarItem("showMissingAnswers",(function(){return u.isSupportMissingAnswers()&&u.options.allowShowMissingAnswers&&(u.missingAnswersBtn=a.b.createButton((function(){u.showMissingAnswers=!u._showMissingAnswers})),u.updateMissingAnswersBtn()),u.missingAnswersBtn})),u}return Object(o.c)(t,e),Object.defineProperty(t.prototype,"chartType",{get:function(){return this._chartType},set:function(e){this.setChartType(e)},enumerable:!1,configurable:!0}),t.prototype.updateEmptyAnswersBtn=function(){this.emptyAnswersBtn&&(this.emptyAnswersBtn.innerText=this._hideEmptyAnswers?r.a.getString("showEmptyAnswers"):r.a.getString("hideEmptyAnswers"),"bar"==this.chartType||"vbar"==this.chartType||"scatter"==this.chartType?this.emptyAnswersBtn.style.display="inline":this.emptyAnswersBtn.style.display="none")},t.prototype.updateTransposeDataBtn=function(){this.transposeDataBtn&&(this.transposeDataBtn.innerText=this.transposeData?r.a.getString("showPerColumns"):r.a.getString("showPerValues"),this.getSeriesValues().length>0?this.transposeDataBtn.style.display="inline":this.transposeDataBtn.style.display="none")},t.prototype.updateOrderSelector=function(){this.choicesOrderSelector&&("bar"==this.chartType||"vbar"==this.chartType||"scatter"==this.chartType||("pie"==this.chartType||"doughnut"==this.chartType)&&this.topN>0?this.choicesOrderSelector.style.display="inline-flex":this.choicesOrderSelector.style.display="none",this.choicesOrderSelector.getElementsByTagName("select")[0].value=this.answersOrder)},t.prototype.updateShowPercentageBtn=function(){this.showPercentageBtn&&(this.showPercentageBtn.innerText=this._showPercentages?r.a.getString("hidePercentages"):r.a.getString("showPercentages"),"bar"==this.chartType||"vbar"==this.chartType||"stackedbar"==this.chartType?this.showPercentageBtn.style.display="inline":this.showPercentageBtn.style.display="none")},t.prototype.updateTopNSelector=function(){this.topNSelector&&(this.topNSelector.getElementsByTagName("select")[0].value=this._topN)},t.prototype.updateMissingAnswersBtn=function(){this.missingAnswersBtn&&(this.missingAnswersBtn.innerText=this._showMissingAnswers?r.a.getString("hideMissingAnswers"):r.a.getString("showMissingAnswers"))},t.prototype.onChartTypeChanged=function(){this.updateOrderSelector(),this.updateShowPercentageBtn(),this.updateEmptyAnswersBtn(),this.updateTopNSelector(),this.stateChanged("chartType",this._chartType)},t.prototype.setChartType=function(e){-1!==this.chartTypes.indexOf(e)&&this._chartType!==e&&(this._chartType=e,this.onChartTypeChanged(),this.refreshContent())},t.prototype.getCorrectAnswerText=function(){var t=e.prototype.getCorrectAnswerText.call(this),i=Array.isArray(t)?t:[t],r=this.question;return i.map((function(e){return n.ItemValue.getTextOrHtmlByValue(r.choices,e)})).join(", ")},t.prototype.getSelectedItemByText=function(e){var t=this.question;return this.question.hasOther&&e==t.otherText?t.otherItem:t.choices.filter((function(t){return t.text===e}))[0]},t.prototype.setSelection=function(e){this.selectedItem!==e&&(this.selectedItem=e,void 0!==this.onDataItemSelected&&this.onDataItemSelected(void 0!==e?e.value:void 0,void 0!==e?e.text:""))},Object.defineProperty(t.prototype,"selection",{get:function(){return this.selectedItem},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"showOnlyPercentages",{get:function(){return this._showOnlyPercentages},set:function(e){this._showOnlyPercentages=e,this.refreshContent(),this.stateChanged("showOnlyPercentages",e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"showPercentages",{get:function(){return this._showPercentages},set:function(e){this._showPercentages=e,this.updateShowPercentageBtn(),this.refreshContent(),this.stateChanged("showPercentages",e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"answersOrder",{get:function(){return this._answersOrder},set:function(e){this._answersOrder=e,this.updateOrderSelector(),this.refreshContent(),this.stateChanged("answersOrder",e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hideEmptyAnswers",{get:function(){return this._hideEmptyAnswers},set:function(e){this._hideEmptyAnswers=e,this.updateEmptyAnswersBtn(),this.refreshContent(),this.stateChanged("hideEmptyAnswers",e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"transposeData",{get:function(){return this._transposeData},set:function(e){this._transposeData=e,this.updateTransposeDataBtn(),this.refreshContent(),this.stateChanged("transposeData",e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"topN",{get:function(){return this._topN},set:function(e){this._topN=e,this.updateTopNSelector(),this.updateOrderSelector(),this.refreshContent(),this.stateChanged("topN",e)},enumerable:!1,configurable:!0}),t.prototype.isSupportAnswersOrder=function(){return(void 0===this.options.allowChangeAnswersOrder||this.options.allowChangeAnswersOrder)&&0===this.getSeriesValues().length},t.prototype.isSupportMissingAnswers=function(){return!0},Object.defineProperty(t.prototype,"showMissingAnswers",{get:function(){return this._showMissingAnswers},set:function(e){this._showMissingAnswers=this.isSupportMissingAnswers()&&e,this.updateMissingAnswersBtn(),this.dataProvider.raiseDataChanged(this.name),this.refreshContent(),this.stateChanged("showMissingAnsewrs",e)},enumerable:!1,configurable:!0}),t.prototype.refreshContent=function(){this.contentContainer&&(this.destroyContent(this.contentContainer),this.renderContent(this.contentContainer)),this.invokeOnUpdate()},Object.defineProperty(t.prototype,"showValuesInOriginalOrder",{get:function(){return!1!==this.options.showValuesInOriginalOrder},enumerable:!1,configurable:!0}),t.prototype.valuesSource=function(){var e=this.question;return e.choicesFromQuestion&&e.survey&&(e=e.survey.getQuestionByName(e.choicesFromQuestion)),e.activeChoices},t.prototype.getValues=function(){var e=this.valuesSource().map((function(e){return e.value}));return this.question.hasNone&&e.push(this.question.noneItem.value),this.question.hasOther&&e.push("other"),this.showMissingAnswers&&e.unshift(void 0),this.showValuesInOriginalOrder?e.reverse():e},t.prototype.getLabels=function(){var e=this;if(this.options.useValuesAsLabels)return this.getValues();var t=this.valuesSource().map((function(t){return n.ItemValue.getTextOrHtmlByValue(e.valuesSource(),t.value)})),i=this.question;return i.hasNone&&t.push(i.noneText),i.hasOther&&t.push(i.otherText),this.showMissingAnswers&&t.unshift(r.a.getString("missingAnswersLabel")),this.showValuesInOriginalOrder?t.reverse():t},t.prototype.getPercentages=function(e){var t=[],i=this._percentagePrecision;if(e.length<2)e.forEach((function(e,r){var n=e.reduce((function(e,t){return e+t}),0);t[r]=e.map((function(e){var t=i?+(e/n).toFixed(i):Math.round(e/n*1e4);return n&&t/100}))}));else for(var r=0;r<e[0].length;r++){for(var n=0,s=0;s<e.length;s++)n+=e[s][r];for(s=0;s<e.length;s++){Array.isArray(t[s])||(t[s]=[]);var o=i?+(e[s][r]/n*100).toFixed(i):Math.round(e[s][r]/n*100);t[s][r]=n&&o}}return t},t.prototype.answersDataReady=function(e){var t={};return t=this.hideEmptyAnswers?p(e):e,this.topN>0&&(t.datasets[0]=t.datasets[0].slice(-this.topN),t.labels=t.labels.slice(-this.topN),t.colors=t.colors.slice(-this.topN),t.texts[0]=t.texts[0].slice(-this.topN)),t},t.prototype.getAnswersData=function(){return Object(o.b)(this,void 0,void 0,(function(){var e,t,i,r,n,s,l,u,h,c;return Object(o.d)(this,(function(o){switch(o.label){case 0:return e=this.getSeriesLabels(),[4,this.getCalculatedValues()];case 1:return t=o.sent(),i=this.getLabels(),r=this.getColors(),n=this.showPercentages?this.getPercentages(t):t,this.transposeData&&(t=this.transpose(t),n=this.transpose(n),s=e,e=i,i=s),"asc"!=this.answersOrder&&"desc"!=this.answersOrder||(l=this.showPercentages?a.a.zipArrays(i,r,n[0]):a.a.zipArrays(i,r),u=a.a.sortDictionary(l,t[0],"desc"==this.answersOrder),h=a.a.unzipArrays(u.keys),i=h[0],r=h[1],this.showPercentages&&(n[0]=h[2]),t[0]=u.values),c={datasets:t,labels:i,colors:r,texts:n,seriesLabels:e},c=this.answersDataReady(c),this.onAnswersDataReady.fire(this,c),[2,c]}}))}))},t.prototype.convertFromExternalData=function(e){var t=this.getValues(),i=this.getSeriesValues(),r=[];if(i.length>0)for(var n=0;n<t.length;n++){for(var s=[],o=0;o<i.length;o++)e[i[o]]?s.push(e[i[o]][t[n]]||0):s.push(0);r.push(s)}else{for(s=[],n=0;n<t.length;n++)s.push(e[t[n]]||0);r.push(s)}return r},t.prototype.transpose=function(e){for(var t=e[0].length,i=new Array(t),r=0;r<t;++r)i[r]=new Array(e.length);for(r=0;r<e.length;++r)for(var n=0;n<t;++n)i[n][r]=e[r][n];return i},t.prototype.getState=function(){var e=this,i={};return t._stateProperties.forEach((function(t){i[t]=e[t]})),this.selectedItem&&(i.filter=this.selectedItem.value),i},t.prototype.setState=function(e){var i=this;t._stateProperties.forEach((function(t){void 0!==e[t]&&(i[t]=e[t])}));var r=n.ItemValue.getItemByValue(this.question.visibleChoices,e.filter);this.setSelection(null!=r?r:void 0)},t.topNValuesDefaults=[-1,5,10,20],t._stateProperties=["chartType","answersOrder","hideEmptyAnswers","topN"],t}(l),m=function(e){function t(t,i,r,n){return e.call(this,t,i,r,n||"matrix")||this}return Object(o.c)(t,e),Object.defineProperty(t.prototype,"matrixQuestion",{get:function(){return this.question},enumerable:!1,configurable:!0}),t.prototype.isSupportMissingAnswers=function(){return!1},t.prototype.getSeriesValues=function(){return this.matrixQuestion.rows.map((function(e){return""+e.value}))},t.prototype.getSeriesLabels=function(){var e=this;return this.matrixQuestion.rows.map((function(t){return n.ItemValue.getTextOrHtmlByValue(e.matrixQuestion.rows,t.value)}))},t.prototype.getSelectedItemByText=function(e){return this.matrixQuestion.columns.filter((function(t){return t.text===e}))[0]},t.prototype.valuesSource=function(){return this.matrixQuestion.columns},t.prototype.getHasAnswersInAllSeriesArray=function(e){for(var t=Array(),i=0;i<e[0].length;i++)for(var r=0;r<e.length;r++)0!=e[r][i]&&(t[i]=!0);return t},t.prototype.getHasAnswersInSeries=function(e){for(var t=0;t<e.length;t++)if(0!=e[t])return!0;return!1},t.prototype.hideEmptyAnswersInData=function(e){for(var t={datasets:[],labels:[],colors:[],texts:[],seriesLabels:[]},i=this.getHasAnswersInAllSeriesArray(e.datasets),r=0;r<e.datasets.length;r++){if(this.getHasAnswersInSeries(e.datasets[r])){t.labels.push(e.labels[r]),t.colors.push(e.colors[r]);for(var n=[],s=[],o=0;o<e.datasets[0].length;o++)i[o]&&(n.push(e.datasets[r][o]),s.push(e.texts[r][o]));t.datasets.push(n),t.texts.push(s)}}for(r=0;r<e.datasets[0].length;r++)i[r]&&t.seriesLabels.push(e.seriesLabels[r]);return t},t.prototype.getCalculatedValuesCore=function(){var t=e.prototype.getCalculatedValuesCore.call(this),i=this.getSeriesValues(),r=this.getValues(),n=[];return r.forEach((function(e,r){var s=i.map((function(e,i){return t[i][r]}));n.push(s)})),n},t}(f),g=function(e){function t(t,i,r,n){return e.call(this,t,i,r,n||"boolean")||this}return Object(o.c)(t,e),t.prototype.getCorrectAnswerText=function(){var e=this.booleanQuestion.correctAnswer;return void 0!==this.booleanQuestion.valueTrue&&this.booleanQuestion.valueTrue===e||e?this.booleanQuestion.locLabelTrue.textOrHtml:void 0!==this.booleanQuestion.valueFalse&&this.booleanQuestion.valueFalse===e||!e?this.booleanQuestion.locLabelFalse.textOrHtml:e},Object.defineProperty(t.prototype,"booleanQuestion",{get:function(){return this.question},enumerable:!1,configurable:!0}),t.prototype.getSelectedItemByText=function(e){var t=this.getLabels(),i=this.getValues();return new n.ItemValue(i[t.indexOf(e)],e)},t.prototype.getValues=function(){var e=[void 0===this.booleanQuestion.valueTrue||this.booleanQuestion.valueTrue,void 0!==this.booleanQuestion.valueFalse&&this.booleanQuestion.valueFalse];return this.showMissingAnswers&&e.push(void 0),e},t.prototype.getLabels=function(){var e=[].concat(this.getValues());return void 0!==this.booleanQuestion.labelTrue&&(e[0]=this.booleanQuestion.locLabelTrue.textOrHtml),void 0!==this.booleanQuestion.labelFalse&&(e[1]=this.booleanQuestion.locLabelFalse.textOrHtml),this.showMissingAnswers&&(e[2]=r.a.getString("missingAnswersLabel")),e},t.trueColor="",t.falseColor="",t}(f),_=function(e){function t(t,i,r,n){var s=e.call(this,t,i,r,n||"histogram")||this;return s.valueType="number",s._cachedValues=void 0,s._continiousData=void 0,s._cachedIntervals=void 0,s._intervalPrecision=2,void 0!==s.options.intervalPrecision&&(s._intervalPrecision=s.options.intervalPrecision),"text"!==t.getType()||"date"!==t.inputType&&"datetime"!==t.inputType?s.valueType="number":s.valueType="date",s}return Object(o.c)(t,e),t.prototype.reset=function(){this._continiousData=void 0,this._cachedValues=void 0,this._cachedIntervals=void 0},t.prototype.getContiniousValue=function(e){return"date"===this.valueType?Date.parse(e):parseFloat(e)},t.prototype.getString=function(e){return"date"===this.valueType?new Date(e).toLocaleDateString():""+e},t.prototype.toPrecision=function(e){var t=Math.pow(10,this._intervalPrecision);return Math.round(t*e)/t},t.prototype.getSelectedItemByText=function(e){if(this.hasCustomIntervals||this.getContiniousValues().length>t.UseIntervalsFrom){var i=this.intervals.filter((function(t){return t.label===e}))[0];return new n.ItemValue(i,void 0!==i?i.label:"")}var r=this.getLabels(),s=r.indexOf(e);return new n.ItemValue(this.getValues()[s],r[s])},t.prototype.updateData=function(t){this.reset(),e.prototype.updateData.call(this,t)},t.prototype.onDataChanged=function(){this.reset(),e.prototype.onDataChanged.call(this)},t.prototype.getContiniousValues=function(){var e=this;if(void 0===this._cachedValues){var t=this.getSeriesValues();0===t.length&&t.push(""),this._continiousData={},t.forEach((function(t){return e._continiousData[t]=[]}));var i={};this.data.forEach((function(t){var r=t[e.name];if(void 0!==r){var n=t[s.seriesMarkerKey]||"";e._continiousData[n].push(e.getContiniousValue(r)),i[r]=r}})),this._cachedValues=Object.keys(i).map((function(t){return{original:i[t],continious:e.getContiniousValue(t)}})),this._cachedValues.sort((function(e,t){return e.continious-t.continious}))}return this._cachedValues},t.prototype.isSupportMissingAnswers=function(){return!1},Object.defineProperty(t.prototype,"needUseRateValues",{get:function(){return"rating"==this.question.getType()&&Array.isArray(this.question.rateValues)&&this.question.rateValues.length>0},enumerable:!1,configurable:!0}),t.prototype.getValues=function(){return this.intervals.map((function(e){return e.start}))},t.prototype.getLabels=function(){return this.intervals.map((function(e){return e.label}))},Object.defineProperty(t.prototype,"hasCustomIntervals",{get:function(){return!!this.questionOptions&&Array.isArray(this.questionOptions.intervals)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"intervals",{get:function(){if(this.hasCustomIntervals)return this.questionOptions.intervals;if("rating"==this.question.getType()){if(this.needUseRateValues){var e=this.question.rateValues;return e.map((function(t,i){return{start:t.value,end:i<e.length-1?e[i+1].value:t.value+1,label:t.text}}))}for(var i=[],r=this.question.rateMin||0;r<=(this.question.rateMax||t.IntervalsCount-1);r+=this.question.rateStep||1)i.push({start:r,end:r+1,label:""+(this.question.rateMin&&this.question.rateMax?r:r+"-"+(r+1))});return i}if(void 0===this._cachedIntervals){var n=this.getContiniousValues();if(this._cachedIntervals=[],n.length){var s=n[0].continious,o=n[n.length-1].continious,a=t.IntervalsCount,l=(o-s)/a;for(r=0;r<a;++r){var u=s+l,h=this.toPrecision(s),c=this.toPrecision(u);this._cachedIntervals.push({start:h,end:r<a-1?c:c+l/100,label:this.getString(h)+"-"+this.getString(c)}),s=u}}}return this._cachedIntervals},enumerable:!1,configurable:!0}),t.prototype.convertFromExternalData=function(e){return[e]},t.prototype.getCalculatedValuesCore=function(){this.getContiniousValues();var e=this.intervals,t=[],i=this.getSeriesValues();0===i.length&&i.push("");for(var r=0;r<i.length;++r)t.push(e.map((function(e){return 0}))),this._continiousData[i[r]].forEach((function(i){for(var n=0;n<e.length;++n)if(e[n].start<=i&&(i<e[n].end||n==e.length-1)){t[r][n]++;break}}));return t},t.IntervalsCount=10,t.UseIntervalsFrom=10,t}(f),v=function(e){function t(t,i,s,o){var l=e.call(this,i,s,o)||this;if(l.visualizers=t,l.visualizersWithSelection=[],l.onAfterVisualizerRenderCallback=function(){l.afterRender(l.contentContainer)},l.onVisualizerStateChangedCallback=function(e,t){l.stateChanged("visualizer",t)},l.onVisualizerChanged=new n.Event,l.loadingData=!1,!t||t.length<2)throw new Error("VisualizerArrayWrapper works with visualizers collection only.");return l.visualizers.forEach((function(e){e.onUpdate=function(){return l.invokeOnUpdate()},e.supportSelection&&(l._supportSelection=!0,l.visualizersWithSelection.push(e))})),l.registerToolbarItem("changeVisualizer",(function(){return l.visualizerSelector=a.b.createSelector(l.visualizers.map((function(e){return{value:e.type,text:r.a.getString("visualizer_"+e.type)}})),(function(e){return l.visualizer.type===e.value}),(function(e){return l.setVisualizer(e.target.value)}))})),l.visualizer=t[0],l.visualizer.onAfterRender.add(l.onAfterVisualizerRenderCallback),l.visualizer.onStateChanged.add(l.onVisualizerStateChangedCallback),l}return Object(o.c)(t,e),t.prototype.updateVisualizerSelector=function(){this.visualizerSelector&&(this.visualizerSelector.getElementsByTagName("select")[0].value=this.visualizer.type)},Object.defineProperty(t.prototype,"hasFooter",{get:function(){return!1},enumerable:!1,configurable:!0}),t.prototype.getVisualizers=function(){return this.visualizers},t.prototype.setVisualizer=function(e,t){void 0===t&&(t=!1);var i=this.visualizers.filter((function(t){return t.type===e}))[0];i&&i!==this.visualizer&&(this.visualizer&&(this.visualizer.onStateChanged.remove(this.onVisualizerStateChangedCallback),this.visualizer.onAfterRender.remove(this.onAfterVisualizerRenderCallback),this.visualizer.destroy()),this.visualizer=i,this.refresh(),this.visualizer.onAfterRender.add(this.onAfterVisualizerRenderCallback),this.visualizer.onStateChanged.add(this.onVisualizerStateChangedCallback),t||(this.onVisualizerChanged.fire(this,{visualizer:this.visualizer}),this.stateChanged("visualizer",e)),this.updateVisualizerSelector())},t.prototype.updateData=function(t){e.prototype.updateData.call(this,t),this.visualizers.forEach((function(e){e.updateData(t)}))},Object.defineProperty(t.prototype,"onDataItemSelected",{set:function(e){this.visualizersWithSelection.forEach((function(t){t.onDataItemSelected=e}))},enumerable:!1,configurable:!0}),t.prototype.setSelection=function(e){this.visualizersWithSelection.forEach((function(t){t.setSelection(e)}))},Object.defineProperty(t.prototype,"selection",{get:function(){return this.visualizer.selection||this.selectedItem},enumerable:!1,configurable:!0}),t.prototype.renderContent=function(e){this.visualizerContainer=e,this.visualizer.render(this.visualizerContainer)},t.prototype.setBackgroundColorCore=function(t){e.prototype.setBackgroundColorCore.call(this,t),this.visualizers.forEach((function(e){return e.backgroundColor=t}))},t.prototype.getState=function(){var e=this.visualizer.getState(),t={visualizer:this.visualizer.type};return Object.keys(e).length>0&&(t.state=e),t},t.prototype.setState=function(e){e.visualizer&&this.setVisualizer(e.visualizer,!0),e.state&&this.visualizer.setState(e.state)},t.prototype.destroy=function(){var t=this;this.visualizers.forEach((function(e){e.onAfterRender.remove(t.onAfterVisualizerRenderCallback),e.onStateChanged.remove(t.onVisualizerStateChangedCallback),e.onUpdate=void 0})),this.visualizer.destroy(),e.prototype.destroy.call(this)},t}(l);h.registerAltVisualizerSelector(v);var y=function(){function e(e){this._htmlElement=void 0,this.text=void 0,this._htmlElement=a.b.createElement("div","sa-question__filter"),this.text=a.b.createElement("span","sa-question__filter-text"),this._htmlElement.appendChild(this.text);var t=a.b.createButton((function(){e.setSelection(void 0)}),r.a.getString("clearButton"));this._htmlElement.appendChild(t)}return Object.defineProperty(e.prototype,"htmlElement",{get:function(){return this._htmlElement},enumerable:!1,configurable:!0}),e.prototype.update=function(e){void 0!==e&&void 0!==e.value?(this._htmlElement.style.display="inline-flex",this.text.innerText=r.a.getString("filter")+": ["+e.text+"]"):(this._htmlElement.style.display="none",this.text.innerText="")},e}(),b=i(28),w=function(e){function t(t,i,r){void 0===r&&(r=!0);var n=e.call(this,t)||this;return n._selector=i,n.dragEnabled=r,n._muuri=void 0,n._layoutingTimer=void 0,n}return Object(o.c)(t,e),t.prototype.startCore=function(e){var t=this;this._muuri=new b(e,{dragStartPredicate:{handle:".sa-question__title--draggable"},items:this._selector,dragEnabled:this.dragEnabled}),this._muuri.on("dragReleaseEnd",(function(e){var i=e.getGrid().getItems().map((function(e){return e.getElement().dataset.question}));t.onMoveCallback&&t.onMoveCallback(i)}))},t.prototype.stopCore=function(){this._muuri.off("dragReleaseEnd"),this._muuri.destroy(),this._muuri=void 0},t.prototype.updateCore=function(){var e=this;void 0!==this._layoutingTimer&&clearTimeout(this._layoutingTimer),this._layoutingTimer=setTimeout((function(){e._layoutingTimer=void 0,e._muuri.refreshItems(),e._muuri.layout()}),10)},t.prototype.add=function(e,t){this._allowed&&this._muuri.add(e,t)},t.prototype.remove=function(e,t){this._allowed&&this._muuri.remove(e,t)},t}(function(){function e(e){this._allowed=e}return e.prototype.startCore=function(e){},e.prototype.stopCore=function(){},e.prototype.updateCore=function(){},Object.defineProperty(e.prototype,"allowed",{get:function(){return this._allowed},enumerable:!1,configurable:!0}),e.prototype.start=function(e){this._allowed&&this.startCore(e)},e.prototype.stop=function(){this._allowed&&this.stopCore()},e.prototype.update=function(){this._allowed&&this.updateCore()},e.prototype.add=function(e,t){},e.prototype.remove=function(e,t){},e.prototype.destroy=function(){this.stop()},e}());i(29);if(document){var C=i(20),T=document.createElement("div");T.style.display="none",T.innerHTML=C,document.head.appendChild(T)}var P=function(e){function t(i,s,o,l){void 0===o&&(o={}),void 0===l&&(l=void 0);var u=e.call(this,null,s,o,"panel")||this;u.questions=i,u._elements=l,u.visualizers=[],u.haveCommercialLicense=!1,u.renderedQuestionsCount=0,u.onAfterRenderQuestionCallback=function(e,t){u.renderedQuestionsCount++,u.renderedQuestionsCount==u.questions.length&&(u.renderedQuestionsCount=0,u.layoutEngine.update(),u.afterRender(u.contentContainer))},u.onStateChangedCallback=function(e,t){var i;u.stateChanged(null===(i=e.question)||void 0===i?void 0:i.name,t)},u.onAlternativeVisualizerChanged=new n.Event,u.onAlternativeVisualizerChangedCallback=function(e,t){u.onAlternativeVisualizerChanged.fire(e,t)},u.onVisibleElementsChanged=new n.Event,u.onElementShown=new n.Event,u.onElementHidden=new n.Event,u.onElementMoved=new n.Event,u.loadingData=!1;var h=n.hasLicense;if(u.haveCommercialLicense=!!h&&h(4)||t.haveCommercialLicense||void 0!==o.haveCommercialLicense&&o.haveCommercialLicense,u._layoutEngine=o.layoutEngine||new w(u.allowDynamicLayout,".sa-question-layouted",u.allowDragDrop),u._layoutEngine.onMoveCallback=function(e){return u.reorderVisibleElements(e)},u.showToolbar=!0,u.options.survey&&(r.a.currentLocale=u.options.survey.locale),void 0===l&&(u._elements=u.buildElements(i)),u.buildVisualizers(i),u.haveCommercialLicense||u.registerToolbarItem("commercialLicense",(function(){return Object(a.c)()})),u.registerToolbarItem("resetFilter",(function(){return a.b.createButton((function(){u.visualizers.forEach((function(e){(e instanceof f||e instanceof v)&&e.setSelection(void 0)}))}),r.a.getString("resetFilter"))})),u.registerToolbarItem("addElement",(function(e){if(u.allowHideQuestions){var t=void 0,i=function(i,n){var s=u.hiddenElements;if(s.length>0){var o=a.b.createSelector([{name:void 0,displayName:r.a.getString("addElement")}].concat(s).map((function(e){return{value:e.name,text:e.displayName}})),(function(e){return!1}),(function(e){u.showElement(e.target.value)}));t&&e.replaceChild(o,t)||e.appendChild(o),t=o}else t&&e.removeChild(t),t=void 0};i(),u.onVisibleElementsChanged.add(i)}})),!u.options.disableLocaleSwitch&&u.locales.length>1){var c=u.locales.map((function(e){return{value:e,text:r.a.localeNames[e]||r.a.getString(e)||e}}));u.registerToolbarItem("changeLocale",(function(){return a.b.createSelector(c,(function(e){return!!e.value&&(u.locale||n.surveyLocalization.defaultLocale)===e.value}),(function(e){var t=e.target.value;u.locale=t}))}))}return u}return Object(o.c)(t,e),t.prototype.reorderVisibleElements=function(e){var t=this,i=[];e.forEach((function(e){i.push(t._elements.filter((function(t){return t.name===e}))[0])})),this._elements=i,this.visibleElementsChanged(void 0,"REORDERED")},t.prototype.showElementCore=function(e,t){void 0===t&&(t=-1),e.isVisible=!0;var i=this.renderPanelElement(e,this.contentContainer),r=void 0;t>=0&&(r={index:t}),this.layoutEngine.add([i],r)},t.prototype.showElement=function(e){var t=this.getElement(e),i=this._elements.indexOf(t);this.showElementCore(t,i),this.visibleElementsChanged(t,"ADDED")},t.prototype.hideElementCore=function(e){e.isVisible=!1,e.renderedElement&&(this.layoutEngine.remove([e.renderedElement]),this.contentContainer.removeChild(e.renderedElement),e.renderedElement=void 0)},t.prototype.hideElement=function(e){var t=this.getElement(e);this.hideElementCore(t),this.visibleElementsChanged(t,"REMOVED")},t.prototype.hideAllElements=function(){var e=this,t=[];this._elements.forEach((function(i){i.isVisible&&(e.hideElementCore(i),t.push(i))})),this.visibleElementsChanged(void 0,"REMOVEDALL")},t.prototype.showAllElements=function(){var e=this,t=[];this._elements.forEach((function(i){i.isVisible||(e.showElementCore(i),t.push(i))})),this.visibleElementsChanged(void 0,"ADDEDDALL")},t.prototype.makeElementPrivate=function(e){e.isPublic=!1,this.stateChanged("isPublic",!1),this.onPermissionsChangedCallback&&this.onPermissionsChangedCallback(this)},t.prototype.makeElementPublic=function(e){e.isPublic=!0,this.stateChanged("isPublic",!0),this.onPermissionsChangedCallback&&this.onPermissionsChangedCallback(this)},t.prototype.moveVisibleElement=function(e,t){var i,r,n=this.visibleElements[e],s=this.visibleElements[t];i=this._elements.indexOf(n),r=this._elements.indexOf(s),this.moveElement(i,r)},t.prototype.moveElement=function(e,t){var i=this._elements.splice(e,1);this._elements.splice(t,0,i[0]),this.visibleElementsChanged(i[0],"MOVED")},t.prototype.setBackgroundColorCore=function(t){e.prototype.setBackgroundColorCore.call(this,t),this.visualizers.forEach((function(e){return e.backgroundColor=t}))},t.prototype.buildVisualizers=function(e){var t=this;e.forEach((function(e){var i=t.createVisualizer(e);if(i){if(t.allowHideQuestions&&i.registerToolbarItem("removeQuestion",(function(){return a.b.createButton((function(){setTimeout((function(){return t.hideElement(e.name)}),0)}),r.a.getString("hideButton"))})),t.allowMakeQuestionsPrivate&&i.registerToolbarItem("makePrivatePublic",(function(){var i=t.getElement(e.name),n=i.isPublic?"first":"second",s=r.a.getString("makePrivateButton"),o=r.a.getString("makePublicButton");return a.b.createSvgToggleButton("makepublic","makeprivate",s,o,(function(e){setTimeout((function(){return t.makeElementPublic(i)}),0)}),(function(e){setTimeout((function(){return t.makeElementPrivate(i)}),0)}),n)})),i.supportSelection){var n=i,s=new y(n);i.registerToolbarItem("questionFilterInfo",(function(){return s.update(n.selection),s.htmlElement})),n.onDataItemSelected=function(i,r){s.update({value:i,text:r}),t.setFilter(e.name,i)}}i.onUpdate=function(){return t.layout()},i.onAfterRender.add(t.onAfterRenderQuestionCallback),i.onStateChanged.add(t.onStateChangedCallback),i instanceof v&&i.onVisualizerChanged.add(t.onAlternativeVisualizerChangedCallback),t.visualizers.push(i)}}))},t.prototype.destroyVisualizers=function(){var e=this;this.visualizers.forEach((function(t){t.onUpdate=void 0,t instanceof f&&(t.onDataItemSelected=void 0),t instanceof v&&t.onVisualizerChanged.remove(e.onAlternativeVisualizerChangedCallback),t.onStateChanged.remove(e.onStateChangedCallback),t.onAfterRender.remove(e.onAfterRenderQuestionCallback),t.destroy()})),this.visualizers=[]},t.prototype.setLocale=function(t){var i=this;e.prototype.setLocale.call(this,t),(this.questions||[]).forEach((function(e){var t=i.getElement(e.name);t&&(t.displayName=i.processText(e.title))})),this.visualizers.forEach((function(e){e.options.seriesLabels=i.options.seriesLabels,e.locale=t})),this.stateChanged("locale",t)},Object.defineProperty(t.prototype,"allowDynamicLayout",{get:function(){return void 0===this.options.allowDynamicLayout||!0===this.options.allowDynamicLayout},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"allowDragDrop",{get:function(){return!n.IsTouch&&(void 0===this.options.allowDragDrop||!0===this.options.allowDragDrop)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"allowHideQuestions",{get:function(){return void 0===this.options.allowHideQuestions||!0===this.options.allowHideQuestions},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"allowMakeQuestionsPrivate",{get:function(){return!0===this.options.allowMakeQuestionsPrivate},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"layoutEngine",{get:function(){return this._layoutEngine},enumerable:!1,configurable:!0}),t.prototype.buildElements=function(e){var t=this;return(e||[]).map((function(e){return{name:e.name,displayName:t.processText(e.title),isVisible:!0,isPublic:!0}}))},t.prototype.getElements=function(e){var t=[];return(this._elements||[]).forEach((function(i){e&&-1===e.indexOf(i.name)||t.push({name:i.name,displayName:i.displayName,isVisible:i.isVisible,isPublic:i.isPublic})})),t},Object.defineProperty(t.prototype,"visibleElements",{get:function(){return this._elements.filter((function(e){return e.isVisible}))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hiddenElements",{get:function(){return this._elements.filter((function(e){return!e.isVisible}))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"publicElements",{get:function(){return this._elements.filter((function(e){return e.isPublic}))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"privateElements",{get:function(){return this._elements.filter((function(e){return!e.isPublic}))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"locales",{get:function(){return this.options.survey?this.options.survey.getUsedLocales():[]},enumerable:!1,configurable:!0}),t.prototype.getElement=function(e){return this._elements.filter((function(t){return t.name===e}))[0]},t.prototype.getVisualizer=function(e){return this.visualizers.filter((function(t){return t.question.name===e}))[0]},t.prototype.visibleElementsChanged=function(e,t){"SHOWN"!==t||this.onElementShown.isEmpty||this.onElementShown.fire(this,{elements:this._elements,element:e}),"REMOVED"!==t||this.onElementHidden.isEmpty||this.onElementHidden.fire(this,{elements:this._elements,element:e}),"MOVED"!==t||this.onElementMoved.isEmpty||this.onElementMoved.fire(this,{elements:this._elements,element:e}),this.onVisibleElementsChanged.isEmpty||this.onVisibleElementsChanged.fire(this,{elements:this._elements,changed:e,reason:t}),this.stateChanged("visibleElements",t),this.layout()},t.prototype.renderPanelElement=function(e,t){var i=this.getVisualizer(e.name);if(i){var r=a.b.createElement("div");r.dataset.question=e.name,t&&t.appendChild(r);var n=a.b.createElement("div"),s=a.b.createElement("h3"),o=a.b.createElement("div");return s.innerText=e.displayName,r.className=this.allowDynamicLayout?"sa-question sa-question-layouted":"sa-question",s.className="sa-question__title",this.allowDynamicLayout&&this.allowDragDrop&&(s.className=s.className+" sa-question__title--draggable"),n.className="sa-question__content",n.style.backgroundColor=this.backgroundColor,n.appendChild(s),n.appendChild(o),r.appendChild(n),i.render(o),e.renderedElement=r,r}},t.prototype.renderToolbar=function(t){t.className+=" sa-panel__header",e.prototype.renderToolbar.call(this,t)},t.prototype.renderContent=function(e){var t=this;e.className+=" sa-panel__content sa-grid",this.visibleElements.forEach((function(i){t.renderPanelElement(i,e)})),this.layoutEngine.start(e)},t.prototype.destroyContent=function(t){this.layoutEngine.stop(),e.prototype.destroyContent.call(this,t)},t.prototype.refresh=function(){this.toolbarContainer&&(this.destroyToolbar(this.toolbarContainer),this.renderToolbar(this.toolbarContainer)),e.prototype.refresh.call(this)},t.prototype.layout=function(){this.layoutEngine.update()},t.prototype.setFilter=function(e,t){this.dataProvider.setFilter(e,t)},t.prototype.getState=function(){var e=this;return{locale:this.locale,elements:[].concat(this._elements.map((function(t){var i=e.getVisualizer(t.name),r=Object(o.a)(Object(o.a)({},t),null==i?void 0:i.getState());return void 0!==r.renderedElement&&delete r.renderedElement,r})))}},Object.defineProperty(t.prototype,"state",{get:function(){return this.getState()},set:function(e){var t=this;if(e){this._settingState=!0;try{if(Array.isArray(e.elements)){var i=this.questions.map((function(e){return e.name}));this._elements=[].concat(e.elements.filter((function(e){return-1!==i.indexOf(e.name)})))}void 0!==e.locale&&this.setLocale(e.locale),this._elements.forEach((function(e){var i=t.getVisualizer(e.name);void 0!==i&&i.setState(e)}))}finally{this._settingState=!1}this.refresh()}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"permissions",{get:function(){return this._elements.map((function(e){return{name:e.name,isPublic:e.isPublic}}))},set:function(e){var t=this._elements.map((function(t){return e.forEach((function(e){e.name===t.name&&(t.isPublic=e.isPublic)})),Object(o.a)({},t)}));this._elements=[].concat(t),this.refresh(),this.onPermissionsChangedCallback&&this.onPermissionsChangedCallback(this)},enumerable:!1,configurable:!0}),t.prototype.destroy=function(){e.prototype.destroy.call(this),this.destroyVisualizers()},t.haveCommercialLicense=!1,t}(l),A=function(e){function t(t,i,r,n){void 0===r&&(r={});var s=e.call(this,t,i,r,n||"panelDynamic")||this;return s._panelVisualizer=void 0,s.onAfterRenderPanelCallback=function(){s.afterRender(s.contentContainer)},s.loadingData=!1,(r=Object.assign({},r)).allowDynamicLayout=!1,r.dataProvider=void 0,s._panelVisualizer=new P(s.getQuestions(),[],r),s._panelVisualizer.onAfterRender.add(s.onAfterRenderPanelCallback),s.updateData(i),s}return Object(o.c)(t,e),t.prototype.setLocale=function(t){e.prototype.setLocale.call(this,t),this._panelVisualizer.locale=t},Object.defineProperty(t.prototype,"type",{get:function(){return"panelDynamic"},enumerable:!1,configurable:!0}),t.prototype.updatePanelVisualizerData=function(){var e=this,t=[];this.data.forEach((function(i){void 0!==i[e.question.name]&&(t=t.concat(i[e.question.name]))})),this._panelVisualizer.updateData(t)},t.prototype.updateData=function(t){e.prototype.updateData.call(this,t),this.updatePanelVisualizerData()},t.prototype.onDataChanged=function(){this.updatePanelVisualizerData(),e.prototype.onDataChanged.call(this)},t.prototype.getQuestions=function(){return this.question.template.questions},t.prototype.destroyContent=function(t){this._panelVisualizer.clear(),e.prototype.destroyContent.call(this,this.contentContainer)},t.prototype.renderContent=function(e){this._panelVisualizer.render(e)},t.prototype.destroy=function(){e.prototype.destroy.call(this),this._panelVisualizer.onAfterRender.remove(this.onAfterRenderPanelCallback)},t}(l);h.registerVisualizer("paneldynamic",A);var S=function(e){function t(t,i,r){return e.call(this,t,i,r)||this}return Object(o.c)(t,e),Object.defineProperty(t.prototype,"type",{get:function(){return"matrixDynamic"},enumerable:!1,configurable:!0}),t.prototype.getQuestions=function(){var e=this.question.visibleRows;return 0===e.length?[]:e[0].cells.map((function(e){return e.question}))},t}(A);h.registerVisualizer("matrixdynamic",S);var E=function(e){function t(t,i,r,s){void 0===r&&(r={});var o=e.call(this,t,i,r,s||"matrixDropdown")||this;o._matrixDropdownVisualizer=void 0,o.onPanelAfterRenderCallback=function(){o.afterRender(o.contentContainer)},o.loadingData=!1,o._childOptions=Object.assign({},r),o._childOptions.disableLocaleSwitch=!0,o._childOptions.dataProvider=void 0,o._childOptions.allowDynamicLayout=!1,o._childOptions.seriesValues=t.rows.map((function(e){return e.value})),o._childOptions.seriesLabels=t.rows.map((function(e){return e.text}));var a=o.getQuestions();if(1==o._childOptions.seriesValues.length&&a.every((function(e){return n.Helpers.isArraysEqual(e.choices,o.question.choices)}))){var l=h.getVisualizersByType("matrixdropdown-grouped");o._matrixDropdownVisualizer=new l[0](o.question,[],o._childOptions)}else o._matrixDropdownVisualizer=new P(a,[],o._childOptions);return o._matrixDropdownVisualizer.onAfterRender.add(o.onPanelAfterRenderCallback),o.updateData(i),o}return Object(o.c)(t,e),t.prototype.setLocale=function(t){e.prototype.setLocale.call(this,t),this._childOptions.seriesLabels=this.question.rows.map((function(e){return e.text})),this._matrixDropdownVisualizer.locale=t},Object.defineProperty(t.prototype,"matrixDropdownVisualizer",{get:function(){return this._matrixDropdownVisualizer},enumerable:!1,configurable:!0}),t.prototype.updateDropdownVisualizerData=function(){var e=this,t=[];this.data.forEach((function(i){var r=i[e.question.name];r&&Object.keys(r).forEach((function(e){var i=Object.assign({},r[e]);i[s.seriesMarkerKey]=e,t.push(i)}))})),this._matrixDropdownVisualizer.updateData(t)},t.prototype.updateData=function(t){e.prototype.updateData.call(this,t),this.updateDropdownVisualizerData()},t.prototype.onDataChanged=function(){this.updateDropdownVisualizerData(),e.prototype.onDataChanged.call(this)},t.prototype.getQuestions=function(){var e=this.question;return e.columns.map((function(t){var i=t.templateQuestion;return Array.isArray(i.choices)&&0===i.choices.length&&(i.choices=e.choices),i}))},t.prototype.destroyContent=function(t){this._matrixDropdownVisualizer.clear(),e.prototype.destroyContent.call(this,this.contentContainer)},t.prototype.renderContent=function(e){this._matrixDropdownVisualizer.render(e)},t.prototype.destroy=function(){e.prototype.destroy.call(this),this._matrixDropdownVisualizer.onAfterRender.remove(this.onPanelAfterRenderCallback)},t}(l);h.registerVisualizer("matrixdropdown",E);var x=function(){function e(){}return e.setup=function(e,t,i){return this.setups[e](t,i)},e.setupPie=function(t,i){var r=i.datasets,n=i.labels,s=i.colors,o=(i.texts,i.seriesLabels),a=[],l=o.length>1||"matrix"===t.question.getType(),u={type:t.chartType,y:l?o:n,text:(l?o:n).map((function(i){return e.getTruncatedLabel(i,t.labelTruncateLength)})),hoverinfo:"x+y",mode:"markers",marker:{}};u.hoverinfo="label+value+percent",u.marker.colors=s,u.textposition="inside","doughnut"===t.chartType&&(u.type="pie",u.hole=.4),l||(u.marker.symbol="circle",u.marker.size=16),r.forEach((function(e,t){a.push(Object.assign({},u,{values:e,labels:l?o:n,customdata:l?o:n}))}));var h=n.length<10?50*n.length+100:550,c={font:{family:"Segoe UI, sans-serif",size:14,weight:"normal",color:"#404040"},height:h*Math.round(a.length/2)+25,margin:{l:0,t:25,b:0,r:10},colorway:s,hovermode:"closest",plot_bgcolor:t.backgroundColor,paper_bgcolor:t.backgroundColor,showlegend:!1};return l&&(c.annotations=[],n.forEach((function(e,t){a[t].title={position:"bottom center",text:e}})),(a=a.filter((function(e){return!(1===e.values.length&&0===e.values[0])}))).forEach((function(e,t){a[t].domain={column:t%2,row:Math.floor(t/2)}})),c.grid={rows:Math.round(a.length/2),columns:2},c.height=h*Math.round(a.length/2)+25),{traces:a,layout:c,hasSeries:l}},e.setupBar=function(t,i){var r=i.datasets,n=i.labels,s=i.colors,o=i.texts,a=i.seriesLabels,l=[],u=a.length>1||"matrix"===t.question.getType(),h=u?a:n,c={type:t.chartType,y:h,text:h,customdata:u?a:n,hoverinfo:"text",orientation:"h",mode:"markers",textposition:"none",width:.5,bargap:.5,marker:{}};c.marker.color=s,r.forEach((function(e,i){var r=Object.assign({},c,{x:e,text:o[i],hovertext:h.map((function(e,t){return"".concat(o[i][t],", ").concat(e)}))});if(t.showPercentages){var n=t.showOnlyPercentages?"%{text}%":"%{value} (%{text}%)";r.textposition="inside",r.texttemplate=n,r.bargap=.1}l.push(r)}));var d={font:{family:"Segoe UI, sans-serif",size:14,weight:"normal",color:"#404040"},height:30*(n.length+1)+30+30,margin:{t:30,b:30,r:10},colorway:s,hovermode:"closest",yaxis:{automargin:!0,type:"category",orientation:"h",tickmode:"array",tickvals:h,ticktext:h.map((function(i){return e.getTruncatedLabel(i,t.labelTruncateLength)+" "}))},xaxis:{rangemode:"nonnegative",automargin:!0},plot_bgcolor:t.backgroundColor,paper_bgcolor:t.backgroundColor,showlegend:!1};return u&&(d.showlegend=!0,"stackedbar"==t.chartType?d.barmode="stack":d.height=30*(n.length+1)*a.length+30+30,n.forEach((function(e,i){l[i].marker.color=void 0,l[i].name=e,"stackedbar"===t.chartType?(l[i].type="bar",l[i].width=.5):l[i].width=(t.showPercentages?.7:.5)/l.length})),l.forEach((function(e,i){var r=t.showPercentages?"%":"";l[i].hovertext=[],h.forEach((function(t,n){l[i].hovertext.push("".concat(e.y[n]," : ").concat(e.name,", ").concat(e.text[n]).concat(r))}))}))),{traces:l,layout:d,hasSeries:u}},e.setupVBar=function(e,t){var i=t.datasets,r=t.labels,n=t.colors,s=t.texts,o=t.seriesLabels,a=[],l=o.length>1||"matrix"===e.question.getType(),u={font:{family:"Segoe UI, sans-serif",size:14,weight:"normal",color:"#404040"},margin:{t:30,b:30,r:10},colorway:n,hovermode:"closest",plot_bgcolor:e.backgroundColor,paper_bgcolor:e.backgroundColor,showlegend:!1},h={type:"bar",customdata:l?o:r,hoverinfo:"x+y",mode:"markers",textposition:"none",width:.5,bargap:.5,marker:{}};return h.marker.color=n,i.forEach((function(t,i){var n=Object.assign({},h,{x:r,y:e.showPercentages?s[i].map((function(e){return e/100})):t,text:s[i]});if(e.showPercentages){var o=e.showOnlyPercentages?"%{text}%":"%{value} (%{text}%)";n.textposition="inside",n.texttemplate=o,n.width=.9,n.bargap=.1}a.push(n)})),e.showPercentages&&e.showOnlyPercentages&&(u.yaxis={automargin:!0,tickformat:".0%",range:[0,1],ticklen:e.showOnlyPercentages?25:5,tickcolor:"transparent"}),e.getValueType&&"date"==e.getValueType()||(u.xaxis={type:"category"}),{traces:a,layout:u,hasSeries:l}},e.setupScatter=function(t,i){var r=i.datasets,n=i.labels,s=i.colors,o=(i.texts,i.seriesLabels),a=o.length>1||"matrix"===t.question.getType(),l=[],u={type:"scatter",y:(a?o:n).map((function(i){return e.getTruncatedLabel(i,t.labelTruncateLength)})),customdata:a?o:n,text:a?o:n,hoverinfo:"x+y",orientation:"h",mode:"markers",width:.5,marker:{}};a||(u.marker.symbol="circle",u.marker.size=16),r.forEach((function(e){var t=Object.assign({},u,{x:e});l.push(t)}));var h={font:{family:"Segoe UI, sans-serif",size:14,weight:"normal",color:"#404040"},height:30*(n.length+1)+30+30,margin:{t:30,b:30,r:10},colorway:s,hovermode:"closest",yaxis:{automargin:!0,type:"category",ticklen:5,tickcolor:"transparent"},xaxis:{rangemode:"nonnegative",automargin:!0},plot_bgcolor:t.backgroundColor,paper_bgcolor:t.backgroundColor,showlegend:!1};return a&&(h.showlegend=!0,h.height=void 0,n.forEach((function(e,t){l[t].hoverinfo="x+name",l[t].marker.color=void 0,l[t].name=e}))),{traces:l,layout:h,hasSeries:a}},e.imageExportFormat="png",e.onImageSaving=new n.Event,e.onPlotCreating=new n.Event,e.setups={bar:e.setupBar,vbar:e.setupVBar,stackedbar:e.setupBar,doughnut:e.setupPie,pie:e.setupPie,scatter:e.setupScatter},e.getTruncatedLabel=function(e,t){var i="...".length;return t?-1===t||e.length<=t+i?e:e.substring(0,t)+"...":e},e}(),D=i(7),k=i.n(D),V=function(){function e(e){this.model=e,this._chart=void 0}return e.prototype.patchConfigParameters=function(e,t,i,r){},Object.defineProperty(e.prototype,"chart",{get:function(){return this._chart},enumerable:!1,configurable:!0}),e.prototype.create=function(e){return Object(o.b)(this,void 0,void 0,(function(){var t,i,s,a,l,u,h=this;return Object(o.d)(this,(function(o){switch(o.label){case 0:return[4,this.model.getAnswersData()];case 1:return t=o.sent(),i=x.setup(this.model.chartType,this.model,t),s={displaylogo:!1,responsive:!0,locale:r.a.currentLocale,modeBarButtonsToRemove:["toImage"],modeBarButtonsToAdd:[{name:"toImageSjs",title:r.a.getString("saveDiagramAsPNG"),icon:k.a.Icons.camera,click:function(e){var t={format:x.imageExportFormat,filename:h.model.question.name};x.onImageSaving.fire(h.model,t),k.a.downloadImage(e,t)}}]},void 0!==z.displayModeBar&&(s.displayModeBar=z.displayModeBar),this.patchConfigParameters(e,i.traces,i.layout,s),a={traces:i.traces,layout:i.layout,config:s},x.onPlotCreating.fire(this.model,a),l=k.a.newPlot(e,a.traces,a.layout,a.config),e.on("plotly_click",(function(e){var t;if(e.points.length>0){var r="";if(i.hasSeries){r=e.points[0].data.name;var s=e.points[0].label,o=h.model.getSeriesValues()[h.model.getSeriesLabels().indexOf(s)],a=h.model.getSelectedItemByText(r);l=new n.ItemValue(((t={})[o]=a.value,t),s+": "+a.text);h.model.setSelection(l)}else{r=Array.isArray(e.points[0].customdata)?e.points[0].customdata[0]:e.points[0].customdata;var l=h.model.getSelectedItemByText(r);h.model.setSelection(l)}}})),u=function(){return e.getElementsByClassName("nsewdrag")[0]},e.on("plotly_hover",(function(){var e=u();e&&(e.style.cursor="pointer")})),e.on("plotly_unhover",(function(){var e=u();e&&(e.style.cursor="")})),this._chart=l,[2,l]}}))}))},e.prototype.destroy=function(e){k.a.purge(e),this._chart=void 0},e}(),z=function(e){function t(i,r,n,s){void 0===n&&(n={});var o=e.call(this,i,r,n,s)||this;return o.chartTypes=[].concat(t.types),o.getSeriesValues().length>0&&-1===o.chartTypes.indexOf("stackedbar")&&o.chartTypes.push("stackedbar"),n.allowExperimentalFeatures&&o.chartTypes.splice(1,0,"vbar"),o._chartType=o.chartTypes[0],-1!==o.chartTypes.indexOf(n.defaultChartType)&&(o._chartType=n.defaultChartType),o._chartAdapter=new V(o),o}return Object(o.c)(t,e),t.prototype.destroyContent=function(t){this._chartAdapter.destroy(t.children[0]),e.prototype.destroyContent.call(this,t)},t.prototype.renderContentAsync=function(e){return Object(o.b)(this,void 0,void 0,(function(){var t;return Object(o.d)(this,(function(i){switch(i.label){case 0:return t=a.b.createElement("div"),[4,this._chartAdapter.create(t)];case 1:return i.sent(),e.innerHTML="",e.appendChild(t),[2,e]}}))}))},t.prototype.getCalculatedValuesCore=function(){var t=e.prototype.getCalculatedValuesCore.call(this),i=this.getSeriesValues(),r=this.getValues();if(i.length>1){var n=[];return r.forEach((function(e,r){var s=i.map((function(e,i){return t[i][r]}));n.push(s)})),n}return t},t.types=["bar","pie","doughnut","scatter"],t.displayModeBar=void 0,t}(f);h.registerVisualizer("checkbox",z),h.registerVisualizer("radiogroup",z),h.registerVisualizer("dropdown",z),h.registerVisualizer("imagepicker",z),h.registerVisualizer("tagbox",z);var O=function(e){function t(i,r,n,s){var o=e.call(this,i,r,n,s)||this;return o.chartTypes=t.types,o._chartType=o.chartTypes[0],o._chartAdapter=new V(o),o}return Object(o.c)(t,e),t.prototype.destroyContent=function(t){this._chartAdapter.destroy(t.children[0]),e.prototype.destroyContent.call(this,t)},t.prototype.renderContentAsync=function(e){return Object(o.b)(this,void 0,void 0,(function(){var t;return Object(o.d)(this,(function(i){switch(i.label){case 0:return t=a.b.createElement("div"),[4,this._chartAdapter.create(t)];case 1:return i.sent(),e.innerHTML="",e.appendChild(t),[2,e]}}))}))},t.types=["bar","stackedbar","pie","doughnut"],t}(m);h.registerVisualizer("matrix",O);var L=function(e){function t(t){return e.call(this,t)||this}return Object(o.c)(t,e),t.prototype.patchConfigParameters=function(e,t,i,r){var n=this.model.getColors(),s=[M.trueColor||n[0],M.falseColor||n[1]];this.model.showMissingAnswers&&s.push(n[2]),"pie"===this.model.chartType||"doughnut"===this.model.chartType?t.forEach((function(e){e.marker.colors=s})):"bar"===this.model.chartType&&t.forEach((function(e){e.marker.color=s}))},t}(V),M=function(e){function t(i,r,n,s){var o=e.call(this,i,r,n,s)||this;return o.chartTypes=t.types,o._chartType=o.chartTypes[0],o._chartAdapter=new L(o),o}return Object(o.c)(t,e),t.prototype.destroyContent=function(t){this._chartAdapter.destroy(t.children[0]),e.prototype.destroyContent.call(this,t)},t.prototype.renderContentAsync=function(e){return Object(o.b)(this,void 0,void 0,(function(){var t;return Object(o.d)(this,(function(i){switch(i.label){case 0:return t=a.b.createElement("div"),[4,this._chartAdapter.create(t)];case 1:return i.sent(),e.innerHTML="",e.appendChild(t),[2,e]}}))}))},t.types=["pie","bar","doughnut"],t}(g);h.registerVisualizer("boolean",M);var B=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(o.c)(t,e),t.prototype.getQuestionResults=function(){var e=this.question.name;return this.data.map((function(t){return t[e]}))},t.prototype.getEmptyData=function(){var e=this.getValues(),t=[];return t.length=e.length,t.fill(0),t},t.prototype.getCalculatedValuesCore=function(){var e=this,t=this.getQuestionResults(),i=this.getValues(),r=this.getEmptyData();return t.forEach((function(t){e.applyResultToPlotlyData(t,r,i)})),[r]},t.prototype.applyResultToPlotlyData=function(e,t,i){e&&t&&i&&e.forEach((function(e,r,n){var s=i.indexOf(e);t[s]=+t[s]+(n.length-r)}))},t}(z);h.registerVisualizer("ranking",B);var j=function(e){function t(i,r,n,s){var o=e.call(this,i,r,n,s)||this;return o.chartTypes=t.types,o._chartType=o.chartTypes[0],o._chartAdapter=new V(o),o}return Object(o.c)(t,e),t.prototype.destroyContent=function(t){this._chartAdapter.destroy(t.children[0]),e.prototype.destroyContent.call(this,t)},t.prototype.renderContentAsync=function(e){return Object(o.b)(this,void 0,void 0,(function(){var t;return Object(o.d)(this,(function(i){switch(i.label){case 0:return t=a.b.createElement("div"),[4,this._chartAdapter.create(t)];case 1:return i.sent(),e.innerHTML="",e.appendChild(t),[2,e]}}))}))},t.types=["stackedbar","bar","pie","doughnut"],t}(function(e){function t(t,i,r,n){return e.call(this,t,i,r,n||"matrixDropdownGrouped")||this}return Object(o.c)(t,e),Object.defineProperty(t.prototype,"matrixQuestion",{get:function(){return this.question},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dataNames",{get:function(){return this.matrixQuestion.columns.map((function(e){return e.name}))},enumerable:!1,configurable:!0}),t.prototype.getSeriesValues=function(){return this.matrixQuestion.columns.map((function(e){return e.name}))},t.prototype.getSeriesLabels=function(){return this.matrixQuestion.columns.map((function(e){return e.title}))},t.prototype.valuesSource=function(){return this.matrixQuestion.choices},t.prototype.isSupportMissingAnswers=function(){return!1},t.prototype.getCalculatedValuesCore=function(){var e=this.getValues(),t=this.getSeriesValues(),i=this.matrixQuestion.rows.map((function(e){return e.value})),r=u(this.surveyData,{name:this.name,dataNames:t,getValues:function(){return e},getLabels:function(){return e},getSeriesValues:function(){return i},getSeriesLabels:function(){return i}}),n=[];return e.forEach((function(e,i){var s=t.map((function(e,t){return r[t][0][i]}));n.push(s)})),n},t}(f));h.registerVisualizer("matrixdropdown-grouped",j);var R=function(e){function t(i,r,n,s){var o=e.call(this,i,r,n,s)||this;return o.chartTypes=t.types,o._chartType=o.chartTypes[0],o._chartAdapter=new V(o),o}return Object(o.c)(t,e),t.prototype.destroyContent=function(t){this._chartAdapter.destroy(t.children[0]),e.prototype.destroyContent.call(this,t)},t.prototype.renderContentAsync=function(e){return Object(o.b)(this,void 0,void 0,(function(){var t;return Object(o.d)(this,(function(i){switch(i.label){case 0:return t=a.b.createElement("div"),[4,this._chartAdapter.create(t)];case 1:return i.sent(),e.innerHTML="",e.appendChild(t),[2,e]}}))}))},t.prototype.getCalculatedValuesCore=function(){var t=e.prototype.getCalculatedValuesCore.call(this),i=this.getSeriesValues(),r=this.getValues();if(i.length>1){var n=[];return r.forEach((function(e,r){var s=i.map((function(e,i){return t[i][r]}));n.push(s)})),n}return t},t.prototype.getValueType=function(){return this.valueType},t.types=["vbar","bar","scatter"],t}(_);h.registerVisualizer("date",R),h.registerVisualizer("number",R),h.registerVisualizer("rating",R);var N=function(){function e(e){this.model=e,this._chart=void 0}return Object.defineProperty(e.prototype,"chart",{get:function(){return this._chart},enumerable:!1,configurable:!0}),e.prototype.create=function(e){return Object(o.b)(this,void 0,void 0,(function(){var t,i,n,s,l,u,h,c,d,p,f,m,g=this;return Object(o.d)(this,(function(o){switch(o.label){case 0:return t=this.model.question,[4,this.model.getCalculatedValues()];case 1:return i=o.sent(),n=i[0],s=i[1],l=i[2],"rating"===t.getType()&&(u=t.visibleRateValues,l=u[u.length-1].value,s=u[0].value),h=this.model.generateColors(l,s,I.stepsCount),I.showAsPercentage&&(n=a.a.toPercentage(n,l),s=a.a.toPercentage(s,l),l=a.a.toPercentage(l,l)),c=[{type:"indicator",mode:"gauge+number",gauge:{axis:{range:[s,l]},shape:this.model.chartType,bgcolor:"white",bar:{color:h[0]}},value:n,text:t.name,domain:{x:[0,1],y:[0,1]}}],d="bullet"===this.model.chartType?60:30,p={height:250,margin:{l:d,r:d,b:d,t:d,pad:5},plot_bgcolor:this.model.backgroundColor,paper_bgcolor:this.model.backgroundColor},f={displayModeBar:!0,locale:r.a.currentLocale,responsive:!0,displaylogo:!1,modeBarButtonsToRemove:["toImage"],modeBarButtonsToAdd:[{name:"toImageSjs",title:r.a.getString("saveDiagramAsPNG"),icon:k.a.Icons.camera,click:function(e){var t={format:x.imageExportFormat,filename:g.model.question.name};x.onImageSaving.fire(g.model,t),k.a.downloadImage(e,t)}}]},void 0!==I.displayModeBar&&(f.displayModeBar=I.displayModeBar),m={data:c,layout:p,config:f},x.onPlotCreating.fire(this.model,m),[2,k.a.newPlot(e,m.data,m.layout,m.config)]}}))}))},e.prototype.destroy=function(e){k.a.purge(e),this._chart=void 0},e}(),I=function(e){function t(i,r,n,s){var o=e.call(this,i,r,n,s)||this;return o.chartTypes=t.types,o.chartType=o.chartTypes[0],o._chartAdapter=new N(o),o}return Object(o.c)(t,e),t.prototype.destroyContent=function(t){this._chartAdapter.destroy(t.children[0]),e.prototype.destroyContent.call(this,t)},t.prototype.renderContentAsync=function(e){return Object(o.b)(this,void 0,void 0,(function(){var t;return Object(o.d)(this,(function(i){switch(i.label){case 0:return t=a.b.createElement("div"),[4,this._chartAdapter.create(t)];case 1:return i.sent(),e.innerHTML="",e.appendChild(t),[2,e]}}))}))},t.displayModeBar=void 0,t.types=["gauge","bullet"],t}(d);h.registerVisualizer("number",I),h.registerVisualizer("rating",I),h.registerVisualizer("expression",I);var q={en:["...","a","about","above","across","after","again","against","all","almost","alone","along","already","also","although","always","among","an","and","another","any","anybody","anyone","anything","anywhere","are","area","areas","around","as","ask","asked","asking","asks","at","away","b","back","backed","backing","backs","be","became","because","become","becomes","been","before","began","behind","being","beings","best","better","between","big","both","but","by","c","came","can","cannot","case","cases","certain","certainly","clear","clearly","come","could","d","did","differ","different","differently","do","does","done","down","down","downed","downing","downs","during","e","each","early","either","end","ended","ending","ends","enough","even","evenly","ever","every","everybody","everyone","everything","everywhere","f","face","faces","fact","facts","far","felt","few","find","finds","first","for","four","from","full","fully","further","furthered","furthering","furthers","g","gave","general","generally","get","gets","give","given","gives","go","going","good","goods","got","great","greater","greatest","group","grouped","grouping","groups","h","had","has","have","having","he","her","here","herself","high","high","high","higher","highest","him","himself","his","how","however","i","if","important","in","interest","interested","interesting","interests","into","is","it","its","itself","j","just","k","keep","keeps","kind","knew","know","known","knows","l","large","largely","last","later","latest","least","less","let","lets","like","likely","long","longer","longest","m","made","make","making","man","many","may","me","member","members","men","might","more","most","mostly","mr","mrs","much","must","my","myself","n","necessary","need","needed","needing","needs","never","new","new","newer","newest","next","no","nobody","non","noone","not","nothing","now","nowhere","number","numbers","o","of","off","often","old","older","oldest","on","once","one","only","open","opened","opening","opens","or","order","ordered","ordering","orders","other","others","our","out","over","p","part","parted","parting","parts","per","perhaps","place","places","point","pointed","pointing","points","possible","present","presented","presenting","presents","problem","problems","put","puts","q","quite","r","rather","really","right","right","room","rooms","s","said","same","saw","say","says","second","seconds","see","seem","seemed","seeming","seems","sees","several","shall","she","should","show","showed","showing","shows","side","sides","since","small","smaller","smallest","so","some","somebody","someone","something","somewhere","state","states","still","still","such","sure","t","take","taken","than","that","the","their","them","then","there","therefore","these","they","thing","things","think","thinks","this","those","though","thought","thoughts","three","through","thus","to","today","together","too","took","toward","turn","turned","turning","turns","two","u","under","until","up","upon","us","use","used","uses","v","very","w","want","wanted","wanting","wants","was","way","ways","we","well","wells","went","were","what","when","where","whether","which","while","who","whole","whose","why","will","with","within","without","work","worked","working","works","would","x","y","year","years","yet","you","young","younger","youngest","your","yours","z"],no:["...","alle","andre","arbeid","at","av","bare","begge","ble","blei","bli","blir","blitt","bort","bruke","både","båe","da","de","deg","dei","deim","deira","deires","dem","den","denne","der","dere","deres","det","dette","di","din","disse","ditt","du","dykk","dykkar","då","eg","ein","eit","eitt","eller","elles","en","ene","eneste","enhver","enn","er","et","ett","etter","folk","for","fordi","forsøke","fra","få","før","før","først","gjorde","gjøre","god","gå","ha","hadde","han","hans","har","hennar","henne","hennes","her","hjå","ho","hoe","honom","hoss","hossen","hun","hva","hvem","hver","hvilke","hvilken","hvis","hvor","hvordan","hvorfor","i","ikke","ikkje","ingen","ingi","inkje","inn","innen","inni","ja","jeg","kan","kom","korleis","korso","kun","kunne","kva","kvar","kvarhelst","kven","kvi","kvifor","lage","lang","lik","like","makt","man","mange","me","med","medan","meg","meget","mellom","men","mens","mer","mest","mi","min","mine","mitt","mot","mye","mykje","må","måte","navn","ned","nei","no","noe","noen","noka","noko","nokon","nokor","nokre","ny","nå","når","og","også","om","opp","oss","over","part","punkt","på","samme","seg","selv","si","sia","sidan","siden","sin","sine","sist","sitt","sjøl","skal","skulle","slik","slutt","so","som","somme","somt","start","stille","så","sånn","tid","til","tilbake","tilstand","um","under","upp","ut","uten","var","vart","varte","ved","verdi","vere","verte","vi","vil","ville","vite","vore","vors","vort","vår","være","vært","vøre","vørt","æ","å"],nl:["de","en","van","ik","te","dat","die","in","een","hij","het","niet","zijn","is","was","op","aan","met","als","voor","had","er","maar","om","hem","dan","zou","of","wat","mijn","men","dit","zo","door","over","ze","zich","bij","ook","tot","je","mij","uit","der","daar","haar","naar","heb","hoe","heeft","hebben","deze","u","want","nog","zal","me","zij","nu","ge","geen","omdat","iets","worden","toch","al","waren","veel","meer","doen","toen","moet","ben","zonder","kan","hun","dus","alles","onder","ja","eens","hier","wie","werd","altijd","doch","wordt","wezen","kunnen","ons","zelf","tegen","na","reeds","wil","kon","niets","uw","iemand","geweest","andere"],es:["...","a","actualmente","adelante","además","afirmó","agregó","ahora","ahí","al","algo","alguna","algunas","alguno","algunos","algún","alrededor","ambos","ampleamos","ante","anterior","antes","apenas","aproximadamente","aquel","aquellas","aquellos","aqui","aquí","arriba","aseguró","así","atras","aunque","ayer","añadió","aún","bajo","bastante","bien","buen","buena","buenas","bueno","buenos","cada","casi","cerca","cierta","ciertas","cierto","ciertos","cinco","comentó","como","con","conocer","conseguimos","conseguir","considera","consideró","consigo","consigue","consiguen","consigues","contra","cosas","creo","cual","cuales","cualquier","cuando","cuanto","cuatro","cuenta","cómo","da","dado","dan","dar","de","debe","deben","debido","decir","dejó","del","demás","dentro","desde","después","dice","dicen","dicho","dieron","diferente","diferentes","dijeron","dijo","dio","donde","dos","durante","e","ejemplo","el","ella","ellas","ello","ellos","embargo","empleais","emplean","emplear","empleas","empleo","en","encima","encuentra","entonces","entre","era","erais","eramos","eran","eras","eres","es","esa","esas","ese","eso","esos","esta","estaba","estabais","estaban","estabas","estad","estada","estadas","estado","estados","estais","estamos","estan","estando","estar","estaremos","estará","estarán","estarás","estaré","estaréis","estaría","estaríais","estaríamos","estarían","estarías","estas","este","estemos","esto","estos","estoy","estuve","estuviera","estuvierais","estuvieran","estuvieras","estuvieron","estuviese","estuvieseis","estuviesen","estuvieses","estuvimos","estuviste","estuvisteis","estuviéramos","estuviésemos","estuvo","está","estábamos","estáis","están","estás","esté","estéis","estén","estés","ex","existe","existen","explicó","expresó","fin","fue","fuera","fuerais","fueran","fueras","fueron","fuese","fueseis","fuesen","fueses","fui","fuimos","fuiste","fuisteis","fuéramos","fuésemos","gran","grandes","gueno","ha","haber","habida","habidas","habido","habidos","habiendo","habremos","habrá","habrán","habrás","habré","habréis","habría","habríais","habríamos","habrían","habrías","habéis","había","habíais","habíamos","habían","habías","hace","haceis","hacemos","hacen","hacer","hacerlo","haces","hacia","haciendo","hago","han","has","hasta","hay","haya","hayamos","hayan","hayas","hayáis","he","hecho","hemos","hicieron","hizo","hoy","hube","hubiera","hubierais","hubieran","hubieras","hubieron","hubiese","hubieseis","hubiesen","hubieses","hubimos","hubiste","hubisteis","hubiéramos","hubiésemos","hubo","igual","incluso","indicó","informó","intenta","intentais","intentamos","intentan","intentar","intentas","intento","ir","junto","la","lado","largo","las","le","les","llegó","lleva","llevar","lo","los","luego","lugar","manera","manifestó","mayor","me","mediante","mejor","mencionó","menos","mi","mientras","mio","mis","misma","mismas","mismo","mismos","modo","momento","mucha","muchas","mucho","muchos","muy","más","mí","mía","mías","mío","míos","nada","nadie","ni","ninguna","ningunas","ninguno","ningunos","ningún","no","nos","nosotras","nosotros","nuestra","nuestras","nuestro","nuestros","nueva","nuevas","nuevo","nuevos","nunca","o","ocho","os","otra","otras","otro","otros","para","parece","parte","partir","pasada","pasado","pero","pesar","poca","pocas","poco","pocos","podeis","podemos","poder","podria","podriais","podriamos","podrian","podrias","podrá","podrán","podría","podrían","poner","por","por qué","porque","posible","primer","primera","primero","primeros","principalmente","propia","propias","propio","propios","próximo","próximos","pudo","pueda","puede","pueden","puedo","pues","que","quedó","queremos","quien","quienes","quiere","quién","qué","realizado","realizar","realizó","respecto","sabe","sabeis","sabemos","saben","saber","sabes","se","sea","seamos","sean","seas","segunda","segundo","según","seis","ser","seremos","será","serán","serás","seré","seréis","sería","seríais","seríamos","serían","serías","seáis","señaló","si","sido","siempre","siendo","siete","sigue","siguiente","sin","sino","sobre","sois","sola","solamente","solas","solo","solos","somos","son","soy","su","sus","suya","suyas","suyo","suyos","sí","sólo","tal","también","tampoco","tan","tanto","te","tendremos","tendrá","tendrán","tendrás","tendré","tendréis","tendría","tendríais","tendríamos","tendrían","tendrías","tened","teneis","tenemos","tener","tenga","tengamos","tengan","tengas","tengo","tengáis","tenida","tenidas","tenido","tenidos","teniendo","tenéis","tenía","teníais","teníamos","tenían","tenías","tercera","ti","tiempo","tiene","tienen","tienes","toda","todas","todavía","todo","todos","total","trabaja","trabajais","trabajamos","trabajan","trabajar","trabajas","trabajo","tras","trata","través","tres","tu","tus","tuve","tuviera","tuvierais","tuvieran","tuvieras","tuvieron","tuviese","tuvieseis","tuviesen","tuvieses","tuvimos","tuviste","tuvisteis","tuviéramos","tuviésemos","tuvo","tuya","tuyas","tuyo","tuyos","tú","ultimo","un","una","unas","uno","unos","usa","usais","usamos","usan","usar","usas","uso","usted","va","vais","valor","vamos","van","varias","varios","vaya","veces","ver","verdad","verdadera","verdadero","vez","vosotras","vosotros","voy","vuestra","vuestras","vuestro","vuestros","y","ya","yo","él","éramos","ésta","éstas","éste","éstos","última","últimas","último","últimos"]},F={getStopWords:function(e){return void 0===e&&(e=""),q[e||"en"]||[]}},H={spiralResolution:1,spiralLimit:1800,lineHeight:.8,xWordPadding:0,yWordPadding:3,weightFactor:40,topN:40,maxHeight:0,padding:10},G=function(){function e(e){void 0===e&&(e=H),this._options=e,this._words=[],this._placedWords=[],this._minWeight=1,this._weightFactor=1,this._renderedTarget=void 0,this.colors=["black"]}return Object.defineProperty(e.prototype,"words",{get:function(){return this._words},set:function(e){this._words=[].concat(e||[]),this._minWeight=1,this._weightFactor=1,this._words.length>0&&(this._words.sort((function(e,t){return-1*(e[1]-t[1])})),this._minWeight=this._words[this._words.length-1][1],this._weightFactor=(this._words[0][1]-this._minWeight+1)/this._options.weightFactor)},enumerable:!1,configurable:!0}),e.prototype.createWordElement=function(e,t,i){var r=document.createElement("div");return r.style.position="absolute",r.style.fontSize=(t-this._minWeight+1)/this._weightFactor+"px",r.style.lineHeight=this._options.lineHeight+"em",this.colors.length>0&&(r.style.color=this.colors[i%this.colors.length]),r.title=e+" ("+t+")",r.appendChild(document.createTextNode(e)),r},e.prototype.isIntersectWithPlaced=function(e){for(var t=0;t<this._placedWords.length;t+=1){var i=this._placedWords[t].rect;if(!(e.right+this._options.xWordPadding<i.left-this._options.xWordPadding||e.left-this._options.xWordPadding>i.right+this._options.xWordPadding||e.bottom+this._options.yWordPadding<i.top-this._options.yWordPadding||e.top-this._options.yWordPadding>i.bottom+this._options.yWordPadding))return!0}return!1},e.prototype.arrangeWords=function(e,t){for(var i={x:0,y:0},r=i.y,n=i.y,s=Math.min(this._options.topN,this.words.length),o=0;o<s;o+=1){var a=this.createWordElement(this.words[o][0],this.words[o][1],o);e.appendChild(a);for(var l=0;l<this._options.spiralLimit;l++){var u=this._options.spiralResolution*l;i.x=(1+u)*Math.cos(u),i.y=(1+u)*Math.sin(u);var h=t.x+i.x-a.offsetWidth/2,c=t.y+i.y-a.offsetHeight/2;a.style.left=h+"px",a.style.top=c+"px";var d=a.getBoundingClientRect();if(!this.isIntersectWithPlaced(d)){this._placedWords.push({element:a,rect:d,left:h,top:c});break}}r>i.y&&(r=i.y),n<i.y&&(n=i.y)}return[r,n]},e.prototype.render=function(e){var t=this;this._renderedTarget=e;var i=document.createElement("div");i.className="sa-visualizer-wordcloud",i.style.position="relative",e.appendChild(i),this._options.maxHeight>0&&(i.style.height=this._options.maxHeight+"px",i.style.overflow="auto");var r={x:i.offsetWidth/2,y:i.offsetHeight/2},n=this.arrangeWords(i,r),s=n[0],o=n[1];0==this._options.maxHeight&&(i.style.height=o-s+2*this._options.padding+"px"),this._placedWords.forEach((function(e){e.element.style.top=e.top-s+t._options.padding+"px"}))},e.prototype.dispose=function(){this._renderedTarget&&(this._renderedTarget.innerHTML="",this._renderedTarget=void 0)},e}(),X=function(){function e(e){this.model=e}return Object.defineProperty(e.prototype,"wordcloud",{get:function(){return this._wordcloud},enumerable:!1,configurable:!0}),e.prototype.createWordCloud2=function(t){return Object(o.b)(this,void 0,void 0,(function(){var i,n,s,l,u,h=this;return Object(o.d)(this,(function(o){switch(o.label){case 0:return[4,this.model.getCalculatedValues()];case 1:return i=o.sent(),this.model.getColors(),n=a.b.createElement("canvas",""),s=a.b.createElement("p","",{innerText:r.a.getString("noResults")}),0===i.length?(t.appendChild(s),[2]):(t.appendChild(n),l={list:i,weightFactor:e.weightFactor,abortThreshold:e.abortThreshold,drawOutOfBound:e.drawOutOfBound,shrinkToFit:e.shrinkToFit,fontFamily:"Segoe UI Bold, sans-serif",color:function(e,t){return h.model.getRandomColor()},rotateRatio:.5,rotationSteps:2,backgroundColor:this.model.backgroundColor,click:function(e){console.log(e[0]+": "+e[1])}},u={canvas:n,config:l},e.onWordcloudCreating.fire(this.model,u),[2,this._wordcloud])}}))}))},e.prototype.create=function(t){return Object(o.b)(this,void 0,void 0,(function(){var i,n,s,l;return Object(o.d)(this,(function(o){switch(o.label){case 0:return[4,this.model.getCalculatedValues()];case 1:return i=o.sent(),this.model.getColors(),0===i.length?(n=a.b.createElement("p","",{innerText:r.a.getString("noResults")}),t.appendChild(n),[2]):(s=JSON.parse(JSON.stringify(H)),l={config:s},e.onWordcloudCreating.fire(this.model,l),this._wordcloud=new G(s),this._wordcloud.colors=this.model.getColors(),this._wordcloud.words=i,this._wordcloud.render(t),[2,this._wordcloud])}}))}))},e.prototype.destroy=function(e){this._wordcloud&&"function"==typeof this._wordcloud.dispose&&this._wordcloud.dispose(),this._wordcloud=void 0},e.drawOutOfBound=!1,e.shrinkToFit=!0,e.abortThreshold=void 0,e.weightFactor=20,e.onWordcloudCreating=new n.Event,e}(),Y=function(e){function t(t,i,r,n){var s=e.call(this,t,i,r,n||"wordcloud")||this;return s._wordcloudAdapter=new X(s),s}return Object(o.c)(t,e),t.prototype.convertFromExternalData=function(e){var t=[];return Object.keys(e||[]).forEach((function(i){t.push([i,e[i]])})),t},t.prototype.getCalculatedValuesCore=function(){var e=this,t={},i=[],n=r.a.currentLocale;i=n?F.getStopWords(n):F.getStopWords();var s=new RegExp("[.,/#!$%^*;:{}=-_`~()]","g"),o=function(e){(e=""+e)&&e.split(" ").forEach((function(e){var r=(e||"").toLowerCase().replace(s,"");(r=function(e){return-1!==i.indexOf(e)?"":e}(r))&&(t[r]?t[r]++:t[r]=1)}))};return this.surveyData.forEach((function(t){var i=t[e.question.name];i&&(Array.isArray(i)?i.forEach(o):"object"==typeof i?Object.keys(i).forEach((function(e){return o(i[e])})):o(i))})),Object.keys(t).map((function(e){return[e,t[e]]}))},t.prototype.destroyContent=function(t){this._wordcloudAdapter.destroy(t),e.prototype.destroyContent.call(this,t)},t.prototype.renderContentAsync=function(e){return Object(o.b)(this,void 0,void 0,(function(){var t;return Object(o.d)(this,(function(i){switch(i.label){case 0:return t=a.b.createElement("div"),e.appendChild(t),[4,this._wordcloudAdapter.create(t)];case 1:return i.sent(),e.innerHTML="",e.appendChild(t),[2,e]}}))}))},t.prototype.destroy=function(){this._wordcloudAdapter.destroy(this.contentContainer),e.prototype.destroy.call(this)},t}(l);h.registerVisualizer("text",Y),h.registerVisualizer("comment",Y),h.registerVisualizer("multipletext",Y);i(30);var Q=function(){function e(e){this.model=e}return e.prototype.create=function(e){return Object(o.b)(this,void 0,void 0,(function(){var t,i,n,s,l;return Object(o.d)(this,(function(o){switch(o.label){case 0:return[4,this.model.getCalculatedValues()];case 1:return t=o.sent(),i=t.columnCount,n=t.data,s=a.b.createElement("p","",{innerText:r.a.getString("noResults")}),0===n.length?(e.appendChild(s),[2]):((l=a.b.createElement("table","sa-text-table")).style.backgroundColor=this.model.backgroundColor,e.appendChild(l),n.forEach((function(e){for(var t=a.b.createElement("tr"),r=0;r<i;r++){var n=a.b.createElement("td","sa-text-table__cell",{textContent:e[r]});t.appendChild(n)}l.appendChild(t)})),e.className="sa-text-table__container",e.appendChild(l),[2])}}))}))},e.prototype.destroy=function(e){e.innerHTML=""},e}(),W=function(e){function t(t,i,r,n){var s=e.call(this,t,i,r,n||"text")||this;return s._textTableAdapter=new Q(s),s}return Object(o.c)(t,e),t.prototype.getCalculatedValuesCore=function(){var e=this,t=[],i=0;return this.surveyData.forEach((function(r){var n=r[e.question.name],s=[];n&&(Array.isArray(n)?s=s.concat(n):"object"==typeof n?Object.keys(n).forEach((function(e){return s.push(n[e])})):s.push(n),t.push(s),s.length>i&&(i=s.length))})),{columnCount:i,data:t}},t.prototype.destroyContent=function(t){this._textTableAdapter.destroy(t),e.prototype.destroyContent.call(this,t)},t.prototype.renderContentAsync=function(e){return Object(o.b)(this,void 0,void 0,(function(){var t;return Object(o.d)(this,(function(i){switch(i.label){case 0:return t=a.b.createElement("div"),[4,this._textTableAdapter.create(t)];case 1:return i.sent(),e.innerHTML="",e.appendChild(t),[2,e]}}))}))},t.prototype.destroy=function(){this._textTableAdapter.destroy(this.contentContainer),e.prototype.destroy.call(this)},t}(l);h.registerVisualizer("text",W),h.registerVisualizer("comment",W),h.registerVisualizer("multipletext",W);i(31);var U=function(){function e(e){this.model=e}return e.prototype.create=function(e){return Object(o.b)(this,void 0,void 0,(function(){var t,i,n,s,l,u,h=this;return Object(o.d)(this,(function(o){switch(o.label){case 0:return[4,this.model.getAnswersData()];case 1:return t=o.sent(),i=t.datasets,n=t.labels,t.colors,s=t.texts,l=t.seriesLabels,l.length>1,u=a.b.createElement("p","",{innerText:r.a.getString("noResults")}),0===i.length||0===i[0].length?(e.appendChild(u),[2]):(i.forEach((function(t,i){var o=a.b.createElement("table","sa-choices-table");o.style.backgroundColor=h.model.backgroundColor,e.appendChild(o);var l=a.b.createElement("tr"),u=a.b.createElement("th","sa-choices-table__cell-header",{textContent:r.a.getString("answer")});l.appendChild(u);var c=a.b.createElement("th","sa-choices-table__cell-header",{textContent:""});l.appendChild(c);var d=a.b.createElement("th","sa-choices-table__cell-header",{textContent:r.a.getString("percent")});l.appendChild(d);var p=a.b.createElement("th","sa-choices-table__cell-header",{textContent:r.a.getString("responses")});l.appendChild(p),o.appendChild(l),t.forEach((function(e,t){var r=a.b.createElement("tr"),l=a.b.createElement("td","sa-choices-table__cell",{textContent:n[t]});r.appendChild(l);var u=a.b.createElement("td","sa-choices-table__cell"),h=a.b.createElement("div","sa-choices-sparkline"),c=a.b.createElement("div","sa-choices-sparkline-value");c.style.width=s[i][t]+"%",h.appendChild(c),u.appendChild(h),r.appendChild(u);var d=a.b.createElement("td","sa-choices-table__cell sa-choices-table__cell-value",{textContent:s[i][t]+"%"});r.appendChild(d);var p=a.b.createElement("td","sa-choices-table__cell sa-choices-table__cell-value",{textContent:e});r.appendChild(p),o.appendChild(r)})),e.className="sa-choices-table__container",e.appendChild(o)})),[2])}}))}))},e.prototype.destroy=function(e){e.innerHTML=""},e}(),K=function(e){function t(t,i,r,n){var s=e.call(this,t,i,r,n||"choices")||this;return s._choicesTableAdapter=new U(s),s.answersOrder="asc",s.showPercentages=!0,s}return Object(o.c)(t,e),t.prototype.destroyContent=function(t){this._choicesTableAdapter.destroy(t),e.prototype.destroyContent.call(this,t)},t.prototype.renderContentAsync=function(e){return Object(o.b)(this,void 0,void 0,(function(){var t;return Object(o.d)(this,(function(i){switch(i.label){case 0:return t=a.b.createElement("div"),[4,this._choicesTableAdapter.create(t)];case 1:return i.sent(),e.innerHTML="",e.appendChild(t),[2,e]}}))}))},t.prototype.destroy=function(){this._choicesTableAdapter.destroy(this.contentContainer),e.prototype.destroy.call(this)},t}(f),Z=(i(32),function(){function e(e,t){this._model=e,this._data=t,this._renderedTarget=void 0}return e.prototype.renderScorePart=function(e,t,i){var n=a.b.createElement("div","sa-visualizer-nps__score-part"),s=a.b.createElement("div","sa-visualizer-nps__score-part-title");s.innerText=r.a.getString(e),n.appendChild(s);var o=a.b.createElement("div","sa-visualizer-nps__score-part-values");n.appendChild(o);var l=a.b.createElement("div","sa-visualizer-nps__score-part-value");if(l.innerText=""+t,o.appendChild(l),i){var u=a.b.createElement("div","sa-visualizer-nps__score-part-percent");u.innerText=i+"%",o.appendChild(u)}return n},e.prototype.render=function(e){this._renderedTarget=e;var t=a.b.createElement("div","sa-visualizer-nps");t.appendChild(this.renderScorePart("npsScore",this.npsScore)),t.appendChild(this.renderScorePart("npsPromoters",this._data.promoters,this.promotersPercent)),t.appendChild(this.renderScorePart("npsPassives",this._data.total-this._data.promoters-this._data.detractors,this.passivePercent)),t.appendChild(this.renderScorePart("npsDetractors",this._data.detractors,this.detractorsPercent)),e.appendChild(t)},Object.defineProperty(e.prototype,"npsScore",{get:function(){return Object(a.g)((this._data.promoters-this._data.detractors)/this._data.total*100,this._model.precision)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"promotersPercent",{get:function(){return Object(a.g)(this._data.promoters/this._data.total*100,this._model.precision)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"passivePercent",{get:function(){return Object(a.g)((this._data.total-this._data.promoters-this._data.detractors)/this._data.total*100,this._model.precision)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"detractorsPercent",{get:function(){return Object(a.g)(this._data.detractors/this._data.total*100,this._model.precision)},enumerable:!1,configurable:!0}),e.prototype.dispose=function(){this._renderedTarget&&(this._renderedTarget.innerHTML="",this._renderedTarget=void 0)},e}()),J=function(){function e(e){this.model=e}return Object.defineProperty(e.prototype,"npsVisualizer",{get:function(){return this._npsVisualizer},enumerable:!1,configurable:!0}),e.prototype.create=function(e){return Object(o.b)(this,void 0,void 0,(function(){var t;return Object(o.d)(this,(function(i){switch(i.label){case 0:return[4,this.model.getCalculatedValues()];case 1:return t=i.sent(),this._npsVisualizer=new Z(this.model,t),this._npsVisualizer.render(e),[2,this._npsVisualizer]}}))}))},e.prototype.destroy=function(e){this._npsVisualizer&&"function"==typeof this._npsVisualizer.dispose&&this._npsVisualizer.dispose(),this._npsVisualizer=void 0},e}(),$=function(e){function t(t,i,r,n){var s=e.call(this,t,i,r,n||"nps")||this;return s.precision=2,s._npsAdapter=new J(s),s}return Object(o.c)(t,e),t.prototype.getCalculatedValuesCore=function(){var e=this,i={detractors:0,passive:0,promoters:0,total:0};return this.data.forEach((function(r){var n=r[e.question.name],s=parseInt(n);Number.isNaN(s)||(s<=t.DetractorScore?i.detractors++:s>=t.PromoterScore?i.promoters++:i.passive++,i.total++)})),i},t.prototype.destroyContent=function(t){this._npsAdapter.destroy(t),e.prototype.destroyContent.call(this,t)},t.prototype.renderContentAsync=function(e){return Object(o.b)(this,void 0,void 0,(function(){var t;return Object(o.d)(this,(function(i){switch(i.label){case 0:return t=a.b.createElement("div"),e.appendChild(t),[4,this._npsAdapter.create(t)];case 1:return i.sent(),e.innerHTML="",e.appendChild(t),[2,e]}}))}))},t.prototype.destroy=function(){this._npsAdapter.destroy(this.contentContainer),e.prototype.destroy.call(this)},t.DetractorScore=6,t.PromoterScore=9,t}(l)}])}));
|
|
23
|
+
e.exports=function(){"use strict";var e={};function t(){this._events={},this._queue=[],this._counter=0,this._isDestroyed=!1}t.prototype.on=function(e,t){if(this._isDestroyed)return this;var i=this._events[e];return i||(i=this._events[e]=[]),i.push(t),this},t.prototype.off=function(e,t){if(this._isDestroyed)return this;var i=this._events[e];if(!i||!i.length)return this;if(!t)return i.length=0,this;for(var r=i.length;r--;)t===i[r]&&i.splice(r,1);return this},t.prototype.emit=function(e,t,i,r){if(this._isDestroyed)return this;var n=this._events[e];if(!n||!n.length)return this;var s,o=this._queue,a=o.length,l=arguments.length-1;for(s=0;s<n.length;s++)o.push(n[s]);for(++this._counter,s=a,a=o.length;s<a;s++)if(0===l?o[s]():1===l?o[s](t):2===l?o[s](t,i):o[s](t,i,r),this._isDestroyed)return this;return--this._counter,this._counter||(o.length=0),this},t.prototype.destroy=function(){if(this._isDestroyed)return this;var e,t=this._events;for(e in this._isDestroyed=!0,this._queue.length=this._counter=0,t)t[e]&&(t[e].length=0,t[e]=void 0);return this};var i="transform",r="transform",n=window.document.documentElement.style,s=!1;["","Webkit","Moz","O","ms"].forEach((function(e){if(!s){var t=e?e+"Transform":"transform";void 0!==n[t]&&(e=e.toLowerCase(),i=e?"-"+e+"-transform":"transform",r=t,s=!0)}}));var o="function"==typeof WeakMap?new WeakMap:null;function a(e,t){var r=o&&o.get(e);return r||(r=window.getComputedStyle(e,null),o&&o.set(e,r)),r.getPropertyValue("transform"===t?i:t)}var l=/([A-Z])/g;function u(e){return e.replace(l,"-$1").toLowerCase()}function h(e){return"function"==typeof e}function c(e,t){for(var i in t)e.style["transform"===i?r:i]=t[i]}function d(e){this._element=e,this._animation=null,this._callback=null,this._props=[],this._values=[],this._keyframes=[],this._options={},this._isDestroyed=!1,this._onFinish=this._onFinish.bind(this)}d.prototype.start=function(e,t,i){if(!this._isDestroyed){var r=this._animation,n=this._props,s=this._values,o=i||0,a=!1;if(r){var l,u=0;for(var d in t)if(++u,-1===(l=n.indexOf(d))||t[d]!==s[l]){a=!0;break}a||u===n.length||(a=!0)}if(a&&r.cancel(),this._callback=h(o.onFinish)?o.onFinish:null,!r||a){for(d in n.length=s.length=0,t)n.push(d),s.push(t[d]);var p=this._keyframes;p[0]=e,p[1]=t;var f=this._options;f.duration=o.duration||300,f.easing=o.easing||"ease";var m=this._element;(r=m.animate(p,f)).onfinish=this._onFinish,this._animation=r,c(m,t)}}},d.prototype.stop=function(e){if(!this._isDestroyed&&this._animation){var t,i,n,s=this._element,o=this._props,l=this._values;if(e)c(s,e);else for(n=0;n<o.length;n++)i=a(s,u(t=o[n])),s.style["transform"===t?r:t]=i;this._animation.cancel(),this._animation=this._callback=null,o.length=l.length=0}},d.prototype.isAnimating=function(){return!!this._animation},d.prototype.destroy=function(){this._isDestroyed||(this.stop(),this._element=this._options=this._keyframes=null,this._isDestroyed=!0)},d.prototype._onFinish=function(){var e=this._callback;this._animation=this._callback=null,this._props.length=this._values.length=0,e&&e()};var p=["","webkit","moz","ms","o","Webkit","Moz","MS","O"];function f(e,t){for(var i,r,n=t[0].toUpperCase()+t.slice(1),s=0;s<p.length;){if((r=(i=p[s])?i+n:t)in e)return r;++s}return null}var m=(window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame||function(e){return this.setTimeout((function(){e(1e3/60)}),1e3/60)}).bind(window),g=!1;try{var _=Object.defineProperty({},"passive",{get:function(){g=!0}});window.addEventListener("testPassive",null,_),window.removeEventListener("testPassive",null,_)}catch(e){}var v="start",y="move",b="end",w="cancel",C=!(!("ontouchstart"in window)&&!window.TouchEvent),T=!!window.PointerEvent,P=!!window.navigator.msPointerEnabled,A=/(android)/i.test(window.navigator.userAgent),S=!!g&&{passive:!0},E=f(window.document.documentElement.style,"touchAction");function x(e,i){this._element=e,this._emitter=new t,this._isDestroyed=!1,this._cssProps={},this._touchAction="",this._startEvent=null,this._pointerId=null,this._startTime=0,this._startX=0,this._startY=0,this._currentX=0,this._currentY=0,this._preStartCheck=this._preStartCheck.bind(this),this._abortNonCancelable=this._abortNonCancelable.bind(this),this._onStart=this._onStart.bind(this),this._onMove=this._onMove.bind(this),this._onCancel=this._onCancel.bind(this),this._onEnd=this._onEnd.bind(this),this.setCssProps(i),this._touchAction||this.setTouchAction("auto"),e.addEventListener("dragstart",x._preventDefault,!1),e.addEventListener(x._events.start,this._preStartCheck,S),!C||T||P||e.addEventListener(x._mouseEvents.start,this._preStartCheck,S)}function D(){this._nextStep=null,this._queue=[],this._reads={},this._writes={},this._batch=[],this._batchReads={},this._batchWrites={},this._step=this._step.bind(this)}x._pointerEvents={start:"pointerdown",move:"pointermove",cancel:"pointercancel",end:"pointerup"},x._msPointerEvents={start:"MSPointerDown",move:"MSPointerMove",cancel:"MSPointerCancel",end:"MSPointerUp"},x._touchEvents={start:"touchstart",move:"touchmove",cancel:"touchcancel",end:"touchend"},x._mouseEvents={start:"mousedown",move:"mousemove",cancel:"",end:"mouseup"},x._events=T?x._pointerEvents:P?x._msPointerEvents:C?x._touchEvents:x._mouseEvents,x._emitter=new t,x._activeInstances=[],x._preventDefault=function(e){e.preventDefault&&!1!==e.cancelable&&e.preventDefault()},x._activateInstance=function(e){x._activeInstances.indexOf(e)>-1||(x._activeInstances.push(e),x._emitter.on(y,e._onMove),x._emitter.on(w,e._onCancel),x._emitter.on(b,e._onEnd),1===x._activeInstances.length&&x._bindListeners())},x._deactivateInstance=function(e){var t=x._activeInstances.indexOf(e);-1!==t&&(x._activeInstances.splice(t,1),x._emitter.off(y,e._onMove),x._emitter.off(w,e._onCancel),x._emitter.off(b,e._onEnd),x._activeInstances.length||x._unbindListeners())},x._bindListeners=function(){var e=x._events;window.addEventListener(e.move,x._onMove,S),window.addEventListener(e.end,x._onEnd,S),e.cancel&&window.addEventListener(e.cancel,x._onCancel,S)},x._unbindListeners=function(){var e=x._events;window.removeEventListener(e.move,x._onMove,S),window.removeEventListener(e.end,x._onEnd,S),e.cancel&&window.removeEventListener(e.cancel,x._onCancel,S)},x._getEventPointerId=function(e){return"number"==typeof e.pointerId?e.pointerId:e.changedTouches?e.changedTouches[0]?e.changedTouches[0].identifier:null:1},x._getTouchById=function(e,t){if("number"==typeof e.pointerId)return e.pointerId===t?e:null;if(e.changedTouches){for(var i=0;i<e.changedTouches.length;i++)if(e.changedTouches[i].identifier===t)return e.changedTouches[i];return null}return e},x._onMove=function(e){x._emitter.emit(y,e)},x._onCancel=function(e){x._emitter.emit(w,e)},x._onEnd=function(e){x._emitter.emit(b,e)},x.prototype._reset=function(){this._isDestroyed||(this._pointerId=null,this._startTime=0,this._startX=0,this._startY=0,this._currentX=0,this._currentY=0,this._startEvent=null,this._element.removeEventListener(x._touchEvents.start,this._abortNonCancelable,S),x._deactivateInstance(this))},x.prototype._createEvent=function(e,t){var i=this._getTrackedTouch(t);return{type:e,srcEvent:t,distance:this.getDistance(),deltaX:this.getDeltaX(),deltaY:this.getDeltaY(),deltaTime:e===v?0:this.getDeltaTime(),isFirst:e===v,isFinal:e===b||e===w,identifier:this._pointerId,screenX:i.screenX,screenY:i.screenY,clientX:i.clientX,clientY:i.clientY,pageX:i.pageX,pageY:i.pageY,target:i.target}},x.prototype._emit=function(e,t){this._emitter.emit(e,this._createEvent(e,t))},x.prototype._getTrackedTouch=function(e){return null===this._pointerId?null:x._getTouchById(e,this._pointerId)},x.prototype._preStartCheck=function(e){this._isDestroyed||this.isDragging()||A&&!1===e.cancelable||e.button||(this._pointerId=x._getEventPointerId(e),null!==this._pointerId&&(this._startEvent=e,C&&(T||P)?(A&&this._element.addEventListener(x._touchEvents.start,this._abortNonCancelable,S),m(this._onStart)):this._onStart()))},x.prototype._abortNonCancelable=function(e){this._element.removeEventListener(x._touchEvents.start,this._abortNonCancelable,S),this._startEvent&&!1===e.cancelable&&(this._pointerId=null,this._startEvent=null)},x.prototype._onStart=function(){var e=this._startEvent;if(e){this._startEvent=null;var t=this._getTrackedTouch(e);t&&(this._startX=this._currentX=t.clientX,this._startY=this._currentY=t.clientY,this._startTime=Date.now(),this._emit(v,e),x._activateInstance(this))}},x.prototype._onMove=function(e){var t=this._getTrackedTouch(e);t&&(this._currentX=t.clientX,this._currentY=t.clientY,this._emit(y,e))},x.prototype._onCancel=function(e){this._getTrackedTouch(e)&&(this._emit(w,e),this._reset())},x.prototype._onEnd=function(e){this._getTrackedTouch(e)&&(this._emit(b,e),this._reset())},x.prototype.isDragging=function(){return null!==this._pointerId},x.prototype.setTouchAction=function(e){this._touchAction=e,E&&(this._cssProps[E]="",this._element.style[E]=e),C&&(this._element.removeEventListener(x._touchEvents.start,x._preventDefault,!1),this._element.style[E]!==e&&this._element.addEventListener(x._touchEvents.start,x._preventDefault,!1))},x.prototype.setCssProps=function(e){if(e){var t,i,r=this._cssProps,n=this._element;for(t in r)n.style[t]=r[t],delete r[t];for(t in e)e[t]&&("touchAction"!==t?(i=f(n.style,t))&&(r[i]="",n.style[i]=e[t]):this.setTouchAction(e[t]))}},x.prototype.getDeltaX=function(){return this._currentX-this._startX},x.prototype.getDeltaY=function(){return this._currentY-this._startY},x.prototype.getDistance=function(){var e=this.getDeltaX(),t=this.getDeltaY();return Math.sqrt(e*e+t*t)},x.prototype.getDeltaTime=function(){return this._startTime?Date.now()-this._startTime:0},x.prototype.on=function(e,t){this._emitter.on(e,t)},x.prototype.off=function(e,t){this._emitter.off(eventName,t)},x.prototype.destroy=function(){if(!this._isDestroyed){var e=this._element,t=x._events;for(var i in this._reset(),this._emitter.destroy(),e.removeEventListener(t.start,this._preStartCheck,S),e.removeEventListener(x._mouseEvents.start,this._preStartCheck,S),e.removeEventListener("dragstart",x._preventDefault,!1),e.removeEventListener(x._touchEvents.start,x._preventDefault,!1),this._cssProps)e.style[i]=this._cssProps[i],delete this._cssProps[i];this._element=null,this._isDestroyed=!0}},D.prototype.add=function(e,t,i,r){var n=this._queue.indexOf(e);n>-1&&(this._queue[n]=void 0),r?this._queue.unshift(e):this._queue.push(e),this._reads[e]=t,this._writes[e]=i,this._nextStep||(this._nextStep=m(this._step))},D.prototype.cancel=function(e){var t=this._queue.indexOf(e);t>-1&&(this._queue[t]=void 0,delete this._reads[e],delete this._writes[e])},D.prototype._step=function(){var e,t,i=this._queue,r=this._reads,n=this._writes,s=this._batch,o=this._batchReads,a=this._batchWrites,l=i.length;for(this._nextStep=null,t=0;t<l;t++)(e=i[t])&&(s.push(e),o[e]=r[e],delete r[e],a[e]=n[e],delete n[e]);for(i.length=0,t=0;t<l;t++)o[e=s[t]]&&(o[e](),delete o[e]);for(t=0;t<l;t++)a[e=s[t]]&&(a[e](),delete a[e]);s.length=0,!this._nextStep&&i.length&&(this._nextStep=m(this._step))};var k=new D;function V(e){return k.cancel(e+"visibility")}function z(e){return k.cancel(e+"move")}function O(e){return k.cancel(e+"scroll")}function L(e){return k.cancel(e+"placeholder")}var M=window.Element.prototype,B=M.matches||M.matchesSelector||M.webkitMatchesSelector||M.mozMatchesSelector||M.msMatchesSelector||M.oMatchesSelector||function(){return!1};function j(e,t){return B.call(e,t)}function R(e,t){e.classList?e.classList.add(t):j(e,"."+t)||(e.className+=" "+t)}var N=[];function I(e,t,i){var r="number"==typeof i?i:-1;r<0&&(r=e.length-r+1),e.splice.apply(e,N.concat(r,0,t)),N.length=0}function q(e,t,i){var r=e.length,n=Math.max(0,i?r:r-1);return t>n?n:t<0?Math.max(n+t+1,0):t}function F(e,t,i){if(!(e.length<2)){var r=q(e,t),n=q(e,i);r!==n&&e.splice(n,0,e.splice(r,1)[0])}}function H(e,t,i){if(!(e.length<2)){var r,n=q(e,t),s=q(e,i);n!==s&&(r=e[n],e[n]=e[s],e[s]=r)}}var G=0;function X(e,t){var i,r=++G+"debounce";return t>0?function(n){void 0!==i&&(i=window.clearTimeout(i),k.cancel(r),"finish"===n&&e()),"cancel"!==n&&"finish"!==n&&(i=window.setTimeout((function(){i=void 0,k.add(r,e,null,!0)}),t))}:function(t){"cancel"!==t&&e()}}function Y(e){var t=a(e,"transform");if(!t||"none"===t)return!1;var i=a(e,"display");return"inline"!==i&&"none"!==i}function Q(e,t){for(var i=window.document,r=(t?e:e.parentElement)||i;r&&r!==i&&"static"===a(r,"position")&&!Y(r);)r=r.parentElement||i;return r}function W(e,t){return parseFloat(a(e,t))||0}var U={},K={},Z={};function J(e,t){var i,r=t||{};return r.left=0,r.top=0,e===document||(r.left=window.pageXOffset||0,r.top=window.pageYOffset||0,e.self===window.self||(i=e.getBoundingClientRect(),r.left+=i.left,r.top+=i.top,r.left+=W(e,"border-left-width"),r.top+=W(e,"border-top-width"))),r}function $(e,t,i){return Z.left=0,Z.top=0,e===t||i&&(e=Q(e,!0))===(t=Q(t,!0))||(J(e,U),J(t,K),Z.left=K.left-U.left,Z.top=K.top-U.top),Z}function ee(e){var t=a(e,"overflow");return"auto"===t||"scroll"===t||"auto"===(t=a(e,"overflow-x"))||"scroll"===t||"auto"===(t=a(e,"overflow-y"))||"scroll"===t}function te(e,t,i){for(var r=i||[],n=t?e:e.parentNode;n&&n!==document;)n.getRootNode&&n instanceof DocumentFragment?n=n.getRootNode().host:(ee(n)&&r.push(n),n=n.parentNode);return r.push(window),r}var ie,re,ne,se,oe={},ae=/^matrix3d/,le=/([^,]*,){4}/,ue=/([^,]*,){12}/,he=/[^,]*,/;function ce(e){oe.x=0,oe.y=0;var t=a(e,"transform");if(!t||"none"===t)return oe;var i=ae.test(t),r=t.replace(i?ue:le,""),n=r.replace(he,"");return oe.x=parseFloat(r)||0,oe.y=parseFloat(n)||0,oe}function de(e,t){return"translateX("+e+"px) translateY("+t+"px)"}function pe(e,t){e.classList?e.classList.remove(t):j(e,"."+t)&&(e.className=(" "+e.className+" ").replace(" "+t+" "," ").trim())}function fe(e){var t=e._element,i=e.getGrid(),r=i._settings;this._item=e,this._gridId=i._id,this._isDestroyed=!1,this._isMigrating=!1,this._startPredicate=h(r.dragStartPredicate)?r.dragStartPredicate:fe.defaultStartPredicate,this._startPredicateState=0,this._startPredicateResult=void 0,this._hBlockedIndex=null,this._hX1=0,this._hX2=0,this._hY1=0,this._hY2=0,this._reset(),this._preStartCheck=this._preStartCheck.bind(this),this._preEndCheck=this._preEndCheck.bind(this),this._onScroll=this._onScroll.bind(this),this._prepareMove=this._prepareMove.bind(this),this._applyMove=this._applyMove.bind(this),this._prepareScroll=this._prepareScroll.bind(this),this._applyScroll=this._applyScroll.bind(this),this._checkOverlap=this._checkOverlap.bind(this);var n=r.dragSortHeuristics.sortInterval;this._checkOverlapDebounce=X(this._checkOverlap,n),this._dragger=new x(t,r.dragCssProps),this._dragger.on("start",this._preStartCheck),this._dragger.on("move",this._preStartCheck),this._dragger.on("cancel",this._preEndCheck),this._dragger.on("end",this._preEndCheck)}function me(e,t){return e.left+e.width<=t.left||t.left+t.width<=e.left||e.top+e.height<=t.top||t.top+t.height<=e.top?0:(Math.min(e.left+e.width,t.left+t.width)-Math.max(e.left,t.left))*(Math.min(e.top+e.height,t.top+t.height)-Math.max(e.top,t.top))/(Math.min(e.width,t.width)*Math.min(e.height,t.height))*100}function ge(e){this._item=e,this._animate=new d,this._element=null,this._className="",this._didMigrate=!1,this._resetAfterLayout=!1,this._currentLeft=0,this._currentTop=0,this._nextLeft=0,this._nextTop=0,this._setupAnimation=this._setupAnimation.bind(this),this._startAnimation=this._startAnimation.bind(this),this._onLayoutStart=this._onLayoutStart.bind(this),this._onLayoutEnd=this._onLayoutEnd.bind(this),this._onReleaseEnd=this._onReleaseEnd.bind(this),this._onMigrate=this._onMigrate.bind(this)}function _e(){this._queue=[],this._isDestroyed=!1}function ve(e){this._item=e,this._isActive=!1,this._isDestroyed=!1,this._isInterrupted=!1,this._currentStyles={},this._targetStyles={},this._currentLeft=0,this._currentTop=0,this._offsetLeft=0,this._offsetTop=0,this._skipNextAnimation=!1,this._animateOptions={onFinish:this._finish.bind(this)},this._queue=new _e,this._setupAnimation=this._setupAnimation.bind(this),this._startAnimation=this._startAnimation.bind(this)}fe.defaultStartPredicate=function(e,t,i){var r=e._drag,n=r._startPredicateData||r._setupStartPredicate(i);if(!t.isFinal)return!(!n.handleElement&&(n.handleElement=r._getStartPredicateHandle(t),!n.handleElement))&&(n.delay&&(n.event=t,n.delayTimer||(n.delayTimer=window.setTimeout((function(){n.delay=0,r._resolveStartPredicate(n.event)&&(r._forceResolveStartPredicate(n.event),r._resetStartPredicate())}),n.delay))),r._resolveStartPredicate(t));r._finishStartPredicate(t)},fe.defaultSortPredicate=(ie={},re={},ne={},se=[],function(e,t){var i=e._drag,r=i._getGrid(),n=t&&"number"==typeof t.threshold?t.threshold:50,s=t&&"swap"===t.action?"swap":"move";ie.width=e._width,ie.height=e._height,ie.left=i._elementClientX,ie.top=i._elementClientY;var o=function(e,t,i){var r,n,s,o,a=null,l=t._settings.dragSort,u=-1;if(!0===l?(se[0]=t,n=se):n=l.call(t,e),!Array.isArray(n))return a;for(o=0;o<n.length;o++)(s=n[o])._isDestroyed||(s._updateBoundingRect(),re.width=s._width,re.height=s._height,re.left=s._left,re.top=s._top,(r=me(ie,re))>i&&r>u&&(u=r,a=s));return se.length=0,a}(e,r,n);if(!o)return!1;var a,l,u,h,c,d=0,p=0,f=-1;for(o===r?(ie.left=i._gridX+e._marginLeft,ie.top=i._gridY+e._marginTop):(o._updateBorders(1,0,1,0),d=o._left+o._borderLeft,p=o._top+o._borderTop),c=0;c<o._items.length;c++)(u=o._items[c])._isActive&&u!==e&&(l=!0,re.width=u._width,re.height=u._height,re.left=u._left+u._marginLeft+d,re.top=u._top+u._marginTop+p,(h=me(ie,re))>f&&(a=c,f=h));return f<n&&e.getGrid()!==o&&(a=l?-1:0,f=1/0),f>=n&&(ne.grid=o,ne.index=a,ne.action=s,ne)}),fe.prototype.stop=function(){var e=this._item,t=e._element,i=this._getGrid();return this._isActive?this._isMigrating?(this._finishMigration(),this):(z(e._id),O(e._id),this._unbindScrollListeners(),this._checkOverlapDebounce("cancel"),t.parentNode!==i._element&&(i._element.appendChild(t),t.style[r]=de(this._gridX,this._gridY)),pe(t,i._settings.itemDraggingClass),this._reset(),this):this},fe.prototype.destroy=function(){return this._isDestroyed||(this.stop(),this._dragger.destroy(),this._isDestroyed=!0),this},fe.prototype._getGrid=function(){return e[this._gridId]||null},fe.prototype._reset=function(){this._isActive=!1,this._container=null,this._containingBlock=null,this._dragEvent=null,this._scrollEvent=null,this._scrollers=[],this._left=0,this._top=0,this._gridX=0,this._gridY=0,this._elementClientX=0,this._elementClientY=0,this._containerDiffX=0,this._containerDiffY=0},fe.prototype._bindScrollListeners=function(){var e,t,i=this._getGrid()._element,r=this._container,n=this._scrollers;if(n.length=0,te(this._item._element,!1,n),r!==i)for(te(i,!0,e=[]),t=0;t<e.length;t++)n.indexOf(e[t])<0&&n.push(e[t]);for(t=0;t<n.length;t++)n[t].addEventListener("scroll",this._onScroll)},fe.prototype._unbindScrollListeners=function(){var e,t=this._scrollers;for(e=0;e<t.length;e++)t[e].removeEventListener("scroll",this._onScroll);t.length=0},fe.prototype._setupStartPredicate=function(e){var t=e||this._getGrid()._settings.dragStartPredicate||0;return this._startPredicateData={distance:Math.abs(t.distance)||0,delay:Math.max(t.delay,0)||0,handle:"string"==typeof t.handle&&t.handle}},fe.prototype._getStartPredicateHandle=function(e){var t=this._startPredicateData,i=this._item._element,r=i;if(!t.handle)return r;for(r=e.target;r&&!j(r,t.handle);)r=r!==i?r.parentElement:null;return r||null},fe.prototype._resolveStartPredicate=function(e){var t=this._startPredicateData;if(!(e.distance<t.distance||t.delay)){var i=t.handleElement.getBoundingClientRect(),r=i.left+(window.pageXOffset||0),n=i.top+(window.pageYOffset||0),s=i.width,o=i.height;return this._resetStartPredicate(),s&&o&&e.pageX>=r&&e.pageX<r+s&&e.pageY>=n&&e.pageY<n+o}},fe.prototype._forceResolveStartPredicate=function(e){this._isDestroyed||1!==this._startPredicateState||(this._startPredicateState=2,this._onStart(e))},fe.prototype._finishStartPredicate=function(e){var t=this._item._element,i=Math.abs(e.deltaX)<2&&Math.abs(e.deltaY)<2&&e.deltaTime<200;this._resetStartPredicate(),i&&function(e){if("a"===e.tagName.toLowerCase()){var t=e.getAttribute("href");if(t){var i=e.getAttribute("target");i&&"_self"!==i?window.open(t,i):window.location.href=t}}}(t)},fe.prototype._resetHeuristics=function(e){this._hBlockedIndex=null,this._hX1=this._hX2=e.clientX,this._hY1=this._hY2=e.clientY},fe.prototype._checkHeuristics=function(e){var t=this._getGrid()._settings.dragSortHeuristics,i=t.minDragDistance;if(i<=0)return this._hBlockedIndex=null,!0;var r=e.clientX,n=e.clientY,s=r-this._hX2,o=n-this._hY2,a=i>3&&t.minBounceBackAngle>0;if(a||(this._hBlockedIndex=null),Math.abs(s)>i||Math.abs(o)>i){if(a){var l=Math.atan2(s,o),u=Math.atan2(this._hX2-this._hX1,this._hY2-this._hY1),h=Math.atan2(Math.sin(l-u),Math.cos(l-u));Math.abs(h)>t.minBounceBackAngle&&(this._hBlockedIndex=null)}return this._hX1=this._hX2,this._hY1=this._hY2,this._hX2=r,this._hY2=n,!0}return!1},fe.prototype._resetStartPredicate=function(){var e=this._startPredicateData;e&&(e.delayTimer&&(e.delayTimer=window.clearTimeout(e.delayTimer)),this._startPredicateData=null)},fe.prototype._checkOverlap=function(){if(this._isActive){var e,t,i,r,n,s,o,a=this._item,l=this._getGrid()._settings;(e=h(l.dragSortPredicate)?l.dragSortPredicate(a,this._dragEvent):fe.defaultSortPredicate(a,l.dragSortPredicate))&&"number"==typeof e.index&&(o=(t=a.getGrid())!==(r=e.grid||t),i=t._items.indexOf(a),n=q(r._items,e.index,o),s="swap"===e.action?"swap":"move",(o||n!==this._hBlockedIndex)&&(o?(this._hBlockedIndex=null,t._hasListeners("beforeSend")&&t._emit("beforeSend",{item:a,fromGrid:t,fromIndex:i,toGrid:r,toIndex:n}),r._hasListeners("beforeReceive")&&r._emit("beforeReceive",{item:a,fromGrid:t,fromIndex:i,toGrid:r,toIndex:n}),a._gridId=r._id,this._isMigrating=a._gridId!==this._gridId,t._items.splice(i,1),I(r._items,a,n),a._sortData=null,t._hasListeners("send")&&t._emit("send",{item:a,fromGrid:t,fromIndex:i,toGrid:r,toIndex:n}),r._hasListeners("receive")&&r._emit("receive",{item:a,fromGrid:t,fromIndex:i,toGrid:r,toIndex:n}),t.layout(),r.layout()):i!==n&&(this._hBlockedIndex=i,("swap"===s?H:F)(t._items,i,n),t._hasListeners("move")&&t._emit("move",{item:a,fromIndex:i,toIndex:n,action:s}),t.layout())))}},fe.prototype._finishMigration=function(){var e,t,i=this._item,n=i._release,s=i._element,o=i._isActive,a=i.getGrid(),l=a._element,u=a._settings,h=u.dragContainer||l,d=this._getGrid()._settings,p=s.parentNode;this._isMigrating=!1,this.destroy(),pe(s,d.itemClass),pe(s,d.itemVisibleClass),pe(s,d.itemHiddenClass),R(s,u.itemClass),R(s,o?u.itemVisibleClass:u.itemHiddenClass),h!==p&&(h.appendChild(s),t=$(p,h,!0),(e=ce(s)).x-=t.left,e.y-=t.top),i._refreshDimensions(),i._refreshSortData(),t=$(h,l,!0),n._containerDiffX=t.left,n._containerDiffY=t.top,i._drag=u.dragEnabled?new fe(i):null,h!==p&&(s.style[r]=de(e.x,e.y)),i._child.removeAttribute("style"),c(i._child,o?u.visibleStyles:u.hiddenStyles),n.start()},fe.prototype._preStartCheck=function(e){0===this._startPredicateState&&(this._startPredicateState=1),1===this._startPredicateState?(this._startPredicateResult=this._startPredicate(this._item,e),!0===this._startPredicateResult?(this._startPredicateState=2,this._onStart(e)):!1===this._startPredicateResult&&(this._startPredicateState=3)):2===this._startPredicateState&&this._isActive&&this._onMove(e)},fe.prototype._preEndCheck=function(e){var t=2===this._startPredicateState;this._startPredicate(this._item,e),this._startPredicateState=0,t&&this._isActive&&this._onEnd(e)},fe.prototype._onStart=function(e){var t=this._item;if(t._isActive){var i,n=t._element,s=this._getGrid(),o=s._settings,a=t._release,l=t._migrate,u=s._element,h=o.dragContainer||u,c=Q(h,!0),d=ce(n),p=d.x,f=d.y,m=n.getBoundingClientRect(),g=h!==u;this._resetHeuristics(e),g&&(i=$(c,u)),t.isPositioning()&&t._layout.stop(!0,{transform:de(p,f)}),l._isActive&&(p-=l._containerDiffX,f-=l._containerDiffY,l.stop(!0,{transform:de(p,f)})),t.isReleasing()&&a._reset(),this._isActive=!0,this._dragEvent=e,this._container=h,this._containingBlock=c,this._elementClientX=m.left,this._elementClientY=m.top,this._left=this._gridX=p,this._top=this._gridY=f,o.dragPlaceholder.enabled&&t._dragPlaceholder.create(),s._emit("dragInit",t,e),g&&(this._containerDiffX=i.left,this._containerDiffY=i.top,n.parentNode===h?(this._gridX=p-this._containerDiffX,this._gridY=f-this._containerDiffY):(this._left=p+this._containerDiffX,this._top=f+this._containerDiffY,h.appendChild(n),n.style[r]=de(this._left,this._top))),R(n,o.itemDraggingClass),this._bindScrollListeners(),s._emit("dragStart",t,e)}},fe.prototype._onMove=function(e){var t=this._item;if(t._isActive){var i,r,n,s=this._getGrid()._settings.dragAxis;if("y"!==s){var o=e.clientX-this._dragEvent.clientX;this._left+=o,this._gridX+=o,this._elementClientX+=o}if("x"!==s){var a=e.clientY-this._dragEvent.clientY;this._top+=a,this._gridY+=a,this._elementClientY+=a}this._dragEvent=e,i=t._id,r=this._prepareMove,n=this._applyMove,k.add(i+"move",r,n,!0)}else this.stop()},fe.prototype._prepareMove=function(){this._item._isActive&&this._getGrid()._settings.dragSort&&this._checkHeuristics(this._dragEvent)&&this._checkOverlapDebounce()},fe.prototype._applyMove=function(){var e=this._item;e._isActive&&(e._element.style[r]=de(this._left,this._top),this._getGrid()._emit("dragMove",e,this._dragEvent))},fe.prototype._onScroll=function(e){var t,i,r,n=this._item;n._isActive?(this._scrollEvent=e,t=n._id,i=this._prepareScroll,r=this._applyScroll,k.add(t+"scroll",i,r,!0)):this.stop()},fe.prototype._prepareScroll=function(){var e=this._item;if(e._isActive){var t,i=e._element,r=this._getGrid(),n=r._settings,s=n.dragAxis,o=r._element,a=i.getBoundingClientRect(),l=this._elementClientX-a.left,u=this._elementClientY-a.top;this._container!==o&&(t=$(this._containingBlock,o),this._containerDiffX=t.left,this._containerDiffY=t.top),"y"!==s&&(this._left+=l,this._gridX=this._left-this._containerDiffX),"x"!==s&&(this._top+=u,this._gridY=this._top-this._containerDiffY),n.dragSort&&this._checkOverlapDebounce()}},fe.prototype._applyScroll=function(){var e=this._item;e._isActive&&(e._element.style[r]=de(this._left,this._top),this._getGrid()._emit("dragScroll",e,this._scrollEvent))},fe.prototype._onEnd=function(e){var t=this._item,i=t._element,r=this._getGrid(),n=r._settings,s=t._release;t._isActive?(z(t._id),O(t._id),n.dragSort&&this._checkOverlapDebounce("finish"),this._unbindScrollListeners(),s._containerDiffX=this._containerDiffX,s._containerDiffY=this._containerDiffY,this._reset(),pe(i,n.itemDraggingClass),r._emit("dragEnd",t,e),this._isMigrating?this._finishMigration():s.start()):this.stop()},ge.prototype._onLayoutStart=function(){var e=this._item,t=e.getGrid(),i=t._items.indexOf(e),r=t._layout.slots[2*i],n=t._layout.slots[2*i+1];if(this._didMigrate||e._left!==r||e._top!==n){var s,o,a;if(r+=e._marginLeft,n+=e._marginTop,!(t._settings.dragPlaceholder.duration>0)||this._didMigrate){L(e._id);var l={transform:de(r,n)};return this._animate.isAnimating()?this._animate.stop(l):c(this._element,l),void(this._didMigrate&&(t.getElement().appendChild(this._element),this._didMigrate=!1))}this._nextLeft=r,this._nextTop=n,s=e._id,o=this._setupAnimation,a=this._startAnimation,k.add(s+"placeholder",o,a)}},ge.prototype._setupAnimation=function(){if(this.isActive()){var e=ce(this._element);this._currentLeft=e.x,this._currentTop=e.y}},ge.prototype._startAnimation=function(){if(this.isActive()){var e=this._animate,t=this._currentLeft,i=this._currentTop,r=this._nextLeft,n=this._nextTop,s={transform:de(r,n)};if(t!==r||i!==n){var o=this._item.getGrid()._settings.dragPlaceholder,a={transform:de(t,i)};e.start(a,s,{duration:o.duration,easing:o.easing,onFinish:this._onLayoutEnd})}else e.isAnimating()&&e.stop(s)}},ge.prototype._onLayoutEnd=function(){this._resetAfterLayout&&this.reset()},ge.prototype._onReleaseEnd=function(e){if(e._id===this._item._id){if(!this._animate.isAnimating())return void this.reset();this._resetAfterLayout=!0}},ge.prototype._onMigrate=function(e){if(e.item===this._item){var t=this._item.getGrid(),i=e.toGrid;t.off("dragReleaseEnd",this._onReleaseEnd),t.off("layoutStart",this._onLayoutStart),t.off("beforeSend",this._onMigrate),i.on("dragReleaseEnd",this._onReleaseEnd),i.on("layoutStart",this._onLayoutStart),i.on("beforeSend",this._onMigrate),this._didMigrate=!0}},ge.prototype.create=function(){if(this.isActive())this._resetAfterLayout=!1;else{var e,t=this._item,i=t.getGrid(),r=i._settings,n=this._animate;e=h(r.dragPlaceholder.createElement)?r.dragPlaceholder.createElement(t):window.document.createElement("div"),this._element=e,n._element=e,this._className=r.itemPlaceholderClass||"",this._className&&R(e,this._className);var s=t._left+t._marginLeft,o=t._top+t._marginTop;c(e,{display:"block",position:"absolute",left:"0",top:"0",width:t._width+"px",height:t._height+"px",transform:de(s,o)}),i.on("layoutStart",this._onLayoutStart),i.on("dragReleaseEnd",this._onReleaseEnd),i.on("beforeSend",this._onMigrate),h(r.dragPlaceholder.onCreate)&&r.dragPlaceholder.onCreate(t,e),i.getElement().appendChild(e)}},ge.prototype.reset=function(){if(this.isActive()){var e=this._element,t=this._item,i=t.getGrid(),r=i._settings,n=this._animate;this._resetAfterLayout=!1,L(t._id),n.stop(),n._element=null,i.off("dragReleaseEnd",this._onReleaseEnd),i.off("layoutStart",this._onLayoutStart),i.off("beforeSend",this._onMigrate),this._className&&(pe(e,this._className),this._className=""),e.parentNode.removeChild(e),this._element=null,h(r.dragPlaceholder.onRemove)&&r.dragPlaceholder.onRemove(t,e)}},ge.prototype.updateDimensions=function(e,t){this.isActive()&&c(this._element,{width:e+"px",height:t+"px"})},ge.prototype.isActive=function(){return!!this._element},ge.prototype.destroy=function(){this.reset(),this._animate.destroy(),this._item=this._animate=null},_e.prototype.add=function(e){return this._isDestroyed||this._queue.push(e),this},_e.prototype.flush=function(e,t){if(this._isDestroyed)return this;var i,r=this._queue,n=r.length;if(!n)return this;var s=1===n,o=s?r[0]:r.slice(0);if(r.length=0,s)return o(e,t),this;for(i=0;i<n&&(o[i](e,t),!this._isDestroyed);i++);return this},_e.prototype.destroy=function(){return this._isDestroyed||(this._isDestroyed=!0,this._queue.length=0),this},ve.prototype.start=function(e,t){if(!this._isDestroyed){var i,r,n,s,o=this._item,a=o._element,l=o._release,u=o.getGrid()._settings,d=this._isActive,p=l._isActive&&!1===l._isPositioningStarted,f=p?u.dragReleaseDuration:u.layoutDuration,m=p?u.dragReleaseEasing:u.layoutEasing,g=!e&&!this._skipNextAnimation&&f>0;return d&&this._queue.flush(!0,o),p&&(l._isPositioningStarted=!0),h(t)&&this._queue.add(t),g?(this._isActive=!0,this._animateOptions.easing=m,this._animateOptions.duration=f,this._isInterrupted=d,r=o._id,n=this._setupAnimation,s=this._startAnimation,k.add(r+"layout",n,s),this):(this._updateOffsets(),this._updateTargetStyles(),i=o._animate.isAnimating(),this.stop(!1,this._targetStyles),!i&&c(a,this._targetStyles),this._skipNextAnimation=!1,this._finish())}},ve.prototype.stop=function(e,t){if(this._isDestroyed||!this._isActive)return this;var i,r=this._item;return i=r._id,k.cancel(i+"layout"),r._animate.stop(t),pe(r._element,r.getGrid()._settings.itemPositioningClass),this._isActive=!1,e&&this._queue.flush(!0,r),this},ve.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},ve.prototype._updateOffsets=function(){if(!this._isDestroyed){var e=this._item,t=e._migrate,i=e._release;this._offsetLeft=i._isActive?i._containerDiffX:t._isActive?t._containerDiffX:0,this._offsetTop=i._isActive?i._containerDiffY:t._isActive?t._containerDiffY:0}},ve.prototype._updateTargetStyles=function(){this._isDestroyed||(this._targetStyles.transform=de(this._item._left+this._offsetLeft,this._item._top+this._offsetTop))},ve.prototype._finish=function(){if(!this._isDestroyed){var e=this._item,t=e._migrate,i=e._release;this._isActive&&(this._isActive=!1,pe(e._element,e.getGrid()._settings.itemPositioningClass)),i._isActive&&i.stop(),t._isActive&&t.stop(),this._queue.flush(!1,e)}},ve.prototype._setupAnimation=function(){var e=ce(this._item._element);this._currentLeft=e.x,this._currentTop=e.y},ve.prototype._startAnimation=function(){var e=this._item,t=e.getGrid()._settings;if(this._updateOffsets(),this._updateTargetStyles(),e._left===this._currentLeft-this._offsetLeft&&e._top===this._currentTop-this._offsetTop)return this._isInterrupted&&this.stop(!1,this._targetStyles),this._isActive=!1,void this._finish();this._isInterrupted||R(e._element,t.itemPositioningClass),this._currentStyles.transform=de(this._currentLeft,this._currentTop),e._animate.start(this._currentStyles,this._targetStyles,this._animateOptions)};var ye={};function be(e){this._item=e,this._isActive=!1,this._isDestroyed=!1,this._container=!1,this._containerDiffX=0,this._containerDiffY=0}be.prototype.start=function(e,t,i){if(this._isDestroyed)return this;var n,s,o,a,l,u,h,d,p=this._item,f=p._element,m=p.isVisible(),g=p.getGrid(),_=g._settings,v=e._settings,y=e._element,b=e._items,w=g._items.indexOf(p),C=i||window.document.body;if("number"==typeof t)n=q(b,t,!0);else{if(!(s=e._getItem(t)))return this;n=b.indexOf(s)}return(p.isPositioning()||this._isActive||p.isReleasing())&&(h=(u=ce(f)).x,d=u.y),p.isPositioning()&&p._layout.stop(!0,{transform:de(h,d)}),this._isActive&&(h-=this._containerDiffX,d-=this._containerDiffY,this.stop(!0,{transform:de(h,d)})),p.isReleasing()&&(h-=p._release._containerDiffX,d-=p._release._containerDiffY,p._release.stop(!0,{transform:de(h,d)})),p._visibility._stopAnimation(),p._drag&&p._drag.destroy(),p._visibility._queue.flush(!0,p),g._hasListeners("beforeSend")&&g._emit("beforeSend",{item:p,fromGrid:g,fromIndex:w,toGrid:e,toIndex:n}),e._hasListeners("beforeReceive")&&e._emit("beforeReceive",{item:p,fromGrid:g,fromIndex:w,toGrid:e,toIndex:n}),pe(f,_.itemClass),pe(f,_.itemVisibleClass),pe(f,_.itemHiddenClass),R(f,v.itemClass),R(f,m?v.itemVisibleClass:v.itemHiddenClass),g._items.splice(w,1),I(b,p,n),p._gridId=e._id,C!==(o=f.parentNode)&&(C.appendChild(f),a=$(C,o,!0),u||(h=(u=ce(f)).x,d=u.y),f.style[r]=de(h+a.left,d+a.top)),p._child.removeAttribute("style"),c(p._child,m?v.visibleStyles:v.hiddenStyles),f.style.display=m?"block":"hidden",l=$(C,y,!0),p._refreshDimensions(),p._refreshSortData(),p._drag=v.dragEnabled?new fe(p):null,this._isActive=!0,this._container=C,this._containerDiffX=l.left,this._containerDiffY=l.top,g._hasListeners("send")&&g._emit("send",{item:p,fromGrid:g,fromIndex:w,toGrid:e,toIndex:n}),e._hasListeners("receive")&&e._emit("receive",{item:p,fromGrid:g,fromIndex:w,toGrid:e,toIndex:n}),this},be.prototype.stop=function(e,t){if(this._isDestroyed||!this._isActive)return this;var i,r=this._item,n=r._element,s=r.getGrid()._element;return this._container!==s&&(t||(e?(i=ce(n),ye.transform=de(i.x-this._containerDiffX,i.y-this._containerDiffY)):ye.transform=de(r._left,r._top),t=ye),s.appendChild(n),c(n,t)),this._isActive=!1,this._container=null,this._containerDiffX=0,this._containerDiffY=0,this},be.prototype.destroy=function(){return this._isDestroyed||(this.stop(!0),this._item=null,this._isDestroyed=!0),this};var we={};function Ce(e){this._item=e,this._isActive=!1,this._isDestroyed=!1,this._isPositioningStarted=!1,this._containerDiffX=0,this._containerDiffY=0}function Te(e){var t=e._isActive,i=e._element,r=e.getGrid()._settings;this._item=e,this._isDestroyed=!1,this._isHidden=!t,this._isHiding=!1,this._isShowing=!1,this._queue=new _e,this._finishShow=this._finishShow.bind(this),this._finishHide=this._finishHide.bind(this),i.style.display=t?"block":"none",R(i,t?r.itemVisibleClass:r.itemHiddenClass),c(e._child,t?r.visibleStyles:r.hiddenStyles)}Ce.prototype.start=function(){if(this._isDestroyed||this._isActive)return this;var e=this._item,t=e.getGrid();return this._isActive=!0,R(e._element,t._settings.itemReleasingClass),t._emit("dragReleaseStart",e),e._layout.start(!1),this},Ce.prototype.stop=function(e,t){if(this._isDestroyed||!this._isActive)return this;var i,r=this._item,n=r._element,s=r.getGrid(),o=s._element;return this._reset(),n.parentNode!==o&&(t||(e?(i=ce(n),we.transform=de(i.x-this._containerDiffX,i.y-this._containerDiffY)):we.transform=de(r._left,r._top),t=we),o.appendChild(n),c(n,t)),e||s._emit("dragReleaseEnd",r),this},Ce.prototype.destroy=function(){return this._isDestroyed||(this.stop(!0),this._item=null,this._isDestroyed=!0),this},Ce.prototype._reset=function(){if(!this._isDestroyed){var e=this._item;this._isActive=!1,this._isPositioningStarted=!1,this._containerDiffX=0,this._containerDiffY=0,pe(e._element,e.getGrid()._settings.itemReleasingClass)}},Te.prototype.show=function(e,t){if(this._isDestroyed)return this;var i=this._item,r=i._element,n=this._queue,s=h(t)?t:null,o=i.getGrid()._settings;return this._isShowing||this._isHidden?this._isShowing&&!e?(s&&n.add(s),this):(this._isShowing||(n.flush(!0,i),pe(r,o.itemHiddenClass),R(r,o.itemVisibleClass),this._isHiding||(r.style.display="block")),s&&n.add(s),i._isActive=this._isShowing=!0,this._isHiding=this._isHidden=!1,this._startAnimation(!0,e,this._finishShow),this):(s&&s(!1,i),this)},Te.prototype.hide=function(e,t){if(this._isDestroyed)return this;var i=this._item,r=i._element,n=this._queue,s=h(t)?t:null,o=i.getGrid()._settings;return!this._isHiding&&this._isHidden?(s&&s(!1,i),this):this._isHiding&&!e?(s&&n.add(s),this):(this._isHiding||(n.flush(!0,i),R(r,o.itemHiddenClass),pe(r,o.itemVisibleClass)),s&&n.add(s),this._isHidden=this._isHiding=!0,i._isActive=this._isShowing=!1,this._startAnimation(!1,e,this._finishHide),this)},Te.prototype.destroy=function(){if(this._isDestroyed)return this;var e=this._item,t=e._element,i=e.getGrid(),r=this._queue,n=i._settings;return this._stopAnimation({}),r.flush(!0,e).destroy(),pe(t,n.itemVisibleClass),pe(t,n.itemHiddenClass),this._item=null,this._isHiding=this._isShowing=!1,this._isDestroyed=this._isHidden=!0,this},Te.prototype._startAnimation=function(e,t,i){if(!this._isDestroyed){var r,n=this._item,s=n.getGrid()._settings,o=e?s.visibleStyles:s.hiddenStyles,l=parseInt(e?s.showDuration:s.hideDuration)||0,h=(e?s.showEasing:s.hideEasing)||"ease",d=t||l<=0;if(o){if(V(n._id),d)return n._animateChild.isAnimating()?n._animateChild.stop(o):c(n._child,o),void(i&&i());var p,f,m;p=n._id,f=function(){r=function(e,t){var i={};for(var r in t)i[r]=a(e,u(r));return i}(n._child,o)},m=function(){n._animateChild.start(r,o,{duration:l,easing:h,onFinish:i})},k.add(p+"visibility",f,m)}else i&&i()}},Te.prototype._stopAnimation=function(e){if(!this._isDestroyed){var t=this._item;V(t._id),t._animateChild.stop(e)}},Te.prototype._finishShow=function(){this._isHidden||(this._isShowing=!1,this._queue.flush(!1,this._item))};var Pe={};Te.prototype._finishHide=function(){if(this._isHidden){var e=this._item;this._isHiding=!1,Pe.transform=de(0,0),e._layout.stop(!0,Pe),e._element.style.display="none",this._queue.flush(!1,e)}};var Ae,Se,Ee,xe,De=0;function ke(){return++De}function Ve(e,t,i){var n=e._settings;this._id=ke(),this._gridId=e._id,this._isDestroyed=!1,this._left=0,this._top=0,this._element=t,this._child=t.children[0],t.parentNode!==e._element&&e._element.appendChild(t),R(t,n.itemClass),"boolean"!=typeof i&&(i="none"!==a(t,"display")),this._isActive=i,t.style.left="0",t.style.top="0",t.style[r]=de(0,0),this._animate=new d(t),this._animateChild=new d(this._child),this._visibility=new Te(this),this._layout=new ve(this),this._migrate=new be(this),this._release=new Ce(this),this._dragPlaceholder=new ge(this),this._drag=n.dragEnabled?new fe(this):null,this._refreshDimensions(),this._refreshSortData()}function ze(){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 Oe(e){var t=Object.prototype.toString.call(e);return"[object HTMLCollection]"===t||"[object NodeList]"===t}Ve.prototype.getGrid=function(){return e[this._gridId]},Ve.prototype.getElement=function(){return this._element},Ve.prototype.getWidth=function(){return this._width},Ve.prototype.getHeight=function(){return this._height},Ve.prototype.getMargin=function(){return{left:this._marginLeft,right:this._marginRight,top:this._marginTop,bottom:this._marginBottom}},Ve.prototype.getPosition=function(){return{left:this._left,top:this._top}},Ve.prototype.isActive=function(){return this._isActive},Ve.prototype.isVisible=function(){return!!this._visibility&&!this._visibility._isHidden},Ve.prototype.isShowing=function(){return!(!this._visibility||!this._visibility._isShowing)},Ve.prototype.isHiding=function(){return!(!this._visibility||!this._visibility._isHiding)},Ve.prototype.isPositioning=function(){return!(!this._layout||!this._layout._isActive)},Ve.prototype.isDragging=function(){return!(!this._drag||!this._drag._isActive)},Ve.prototype.isReleasing=function(){return!(!this._release||!this._release._isActive)},Ve.prototype.isDestroyed=function(){return this._isDestroyed},Ve.prototype._refreshDimensions=function(){if(!this._isDestroyed&&!this._visibility._isHidden){var e=this._element,t=this._dragPlaceholder,i=e.getBoundingClientRect();this._width=i.width,this._height=i.height,this._marginLeft=Math.max(0,W(e,"margin-left")),this._marginRight=Math.max(0,W(e,"margin-right")),this._marginTop=Math.max(0,W(e,"margin-top")),this._marginBottom=Math.max(0,W(e,"margin-bottom")),t&&t.updateDimensions(this._width,this._height)}},Ve.prototype._refreshSortData=function(){if(!this._isDestroyed){var e,t=this._sortData={},i=this.getGrid()._settings.sortData;for(e in i)t[e]=i[e](this,this._element)}},Ve.prototype._destroy=function(e){if(!this._isDestroyed){var t=this._element,i=this.getGrid(),r=i._settings,n=i._items.indexOf(this);this._release.destroy(),this._migrate.destroy(),this._layout.destroy(),this._visibility.destroy(),this._animate.destroy(),this._animateChild.destroy(),this._dragPlaceholder.destroy(),this._drag&&this._drag.destroy(),t.removeAttribute("style"),this._child.removeAttribute("style"),pe(t,r.itemClass),n>-1&&i._items.splice(n,1),e&&t.parentNode.removeChild(t),this._isActive=!1,this._isDestroyed=!0}},ze.prototype.getLayout=function(e,t,i,r,n){var s,o=this._layout,a=!(!n||!n.fillGaps),l=!(!n||!n.horizontal),u=!(!n||!n.alignRight),h=!(!n||!n.alignBottom),c=!(!n||!n.rounding),d=this._slotSizes;if(o.slots=r||this._slots,o.width=l?0:c?Math.round(t):t,o.height=l?c?Math.round(i):i:0,o.setWidth=l,o.setHeight=!l,o.slots.length=0,d.length=0,!e.length)return o;for(s=0;s<e.length;s++)this._addSlot(e[s],l,a,c,u||h);if(u)for(s=0;s<o.slots.length;s+=2)o.slots[s]=o.width-(o.slots[s]+d[s]);if(h)for(s=1;s<o.slots.length;s+=2)o.slots[s]=o.height-(o.slots[s]+d[s]);return d.length=0,this._freeSlots.length=0,this._newSlots.length=0,this._rectId=0,o},ze.prototype._addSlot=(xe={},function(e,t,i,r,n){var s,o,a,l,u,h,c=this._layout,d=this._freeSlots,p=this._newSlots;for(p.length=0,xe.left=null,xe.top=null,xe.width=e._width+e._marginLeft+e._marginRight,xe.height=e._height+e._marginTop+e._marginBottom,r&&(xe.width=Math.round(xe.width),xe.height=Math.round(xe.height)),u=0;u<d.length;u++)if((o=d[u])&&(s=this._getRect(o),xe.width<=s.width+.001&&xe.height<=s.height+.001)){xe.left=s.left,xe.top=s.top;break}for(null===xe.left&&(xe.left=t?c.width:0,xe.top=t?0:c.height,i||(l=!0)),!t&&xe.top+xe.height>c.height&&(xe.left>0&&p.push(this._addRect(0,c.height,xe.left,1/0)),xe.left+xe.width<c.width&&p.push(this._addRect(xe.left+xe.width,c.height,c.width-xe.left-xe.width,1/0)),c.height=xe.top+xe.height),t&&xe.left+xe.width>c.width&&(xe.top>0&&p.push(this._addRect(c.width,0,1/0,xe.top)),xe.top+xe.height<c.height&&p.push(this._addRect(c.width,xe.top+xe.height,1/0,c.height-xe.top-xe.height)),c.width=xe.left+xe.width),u=i?0:l?d.length:u;u<d.length;u++)if(o=d[u])for(s=this._getRect(o),a=this._splitRect(s,xe),h=0;h<a.length;h++)o=a[h],(s=this._getRect(o)).width>.49&&s.height>.49&&(!t&&s.top<c.height||t&&s.left<c.width)&&p.push(o);p.length&&this._purgeRects(p).sort(t?this._sortRectsLeftTop:this._sortRectsTopLeft),t?c.width=Math.max(c.width,xe.left+xe.width):c.height=Math.max(c.height,xe.top+xe.height),c.slots.push(xe.left,xe.top),n&&this._slotSizes.push(xe.width,xe.height),this._freeSlots=p,this._newSlots=d}),ze.prototype._addRect=function(e,t,i,r){var n=++this._rectId,s=this._rectStore;return s[n]=e||0,s[++this._rectId]=t||0,s[++this._rectId]=i||0,s[++this._rectId]=r||0,n},ze.prototype._getRect=function(e,t){var i=t||this._rectItem,r=this._rectStore;return i.left=r[e]||0,i.top=r[++e]||0,i.width=r[++e]||0,i.height=r[++e]||0,i},ze.prototype._splitRect=(Ee=[],function(e,t){return Ee.length=0,this._doRectsOverlap(e,t)?(e.left<t.left&&Ee.push(this._addRect(e.left,e.top,t.left-e.left,e.height)),e.left+e.width>t.left+t.width&&Ee.push(this._addRect(t.left+t.width,e.top,e.left+e.width-(t.left+t.width),e.height)),e.top<t.top&&Ee.push(this._addRect(e.left,e.top,e.width,t.top-e.top)),e.top+e.height>t.top+t.height&&Ee.push(this._addRect(e.left,t.top+t.height,e.width,e.top+e.height-(t.top+t.height))),Ee):(Ee.push(this._addRect(e.left,e.top,e.width,e.height)),Ee)}),ze.prototype._doRectsOverlap=function(e,t){return!(e.left+e.width<=t.left||t.left+t.width<=e.left||e.top+e.height<=t.top||t.top+t.height<=e.top)},ze.prototype._isRectWithinRect=function(e,t){return e.left>=t.left&&e.top>=t.top&&e.left+e.width<=t.left+t.width&&e.top+e.height<=t.top+t.height},ze.prototype._purgeRects=(Ae={},Se={},function(e){for(var t,i=e.length;i--;)if(t=e.length,e[i])for(this._getRect(e[i],Ae);t--;)if(e[t]&&i!==t&&this._isRectWithinRect(Ae,this._getRect(e[t],Se))){e[i]=0;break}return e}),ze.prototype._sortRectsTopLeft=function(){var e={},t={};return function(i,r){return this._getRect(i,e),this._getRect(r,t),e.top<t.top?-1:e.top>t.top?1:e.left<t.left?-1:e.left>t.left?1:0}}(),ze.prototype._sortRectsLeftTop=function(){var e={},t={};return function(i,r){return this._getRect(i,e),this._getRect(r,t),e.left<t.left?-1:e.left>t.left?1:e.top<t.top?-1:e.top>t.top?1:0}}();var Le=Object.prototype.toString;function Me(e){return"object"==typeof e&&"[object Object]"===Le.call(e)}function Be(e){return Oe(e)?Array.prototype.slice.call(e):Array.prototype.concat(e)}var je=new ze,Re=function(){};function Ne(i,r){var n,s,o,a,l,u,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");h((n=this._settings=(a=Ne.defaultOptions,l=r,u=Ie({},a),l&&(u=Ie(u,l)),u.visibleStyles=(l||0).visibleStyles||(a||0).visibleStyles,u.hiddenStyles=(l||0).hiddenStyles||(a||0).hiddenStyles,u)).dragSort)||(n.dragSort=!!n.dragSort),this._id=ke(),e[this._id]=c,this._isDestroyed=!1,this._layout={id:0,items:[],slots:[],setWidth:!1,setHeight:!1,width:0,height:0},this._emitter=new t,R(i,n.containerClass),this._items=[],"string"==typeof(s=n.items)?Be(i.children).forEach((function(e){("*"===s||j(e,s))&&c._items.push(new Ve(c,e))})):(Array.isArray(s)||Oe(s))&&(this._items=Be(s).map((function(e){return new Ve(c,e)}))),"number"!=typeof(o=n.layoutOnResize)&&(o=!0===o?0:-1),o>=0&&window.addEventListener("resize",c._resizeHandler=X((function(){c.refreshItems().layout()}),o)),n.layoutOnInit&&this.layout(!0)}function Ie(e,t){var i,r,n,s=Object.keys(t),o=s.length;for(n=0;n<o;n++)i=Me(t[r=s[n]]),Me(e[r])&&i?e[r]=Ie(Ie({},e[r]),t[r]):i?e[r]=Ie({},t[r]):Array.isArray(t[r])?e[r]=t[r].slice(0):e[r]=t[r];return e}return Ne.Item=Ve,Ne.ItemLayout=ve,Ne.ItemVisibility=Te,Ne.ItemMigrate=be,Ne.ItemAnimate=d,Ne.ItemDrag=fe,Ne.ItemRelease=Ce,Ne.ItemDragPlaceholder=ge,Ne.Emitter=t,Ne.Dragger=x,Ne.Packer=ze,Ne.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"},Ne.prototype.on=function(e,t){return this._emitter.on(e,t),this},Ne.prototype.off=function(e,t){return this._emitter.off(e,t),this},Ne.prototype.getElement=function(){return this._element},Ne.prototype.getItems=function(e){if(this._isDestroyed||!e&&0!==e)return this._items.slice(0);var t,i,r=[],n=Be(e);for(i=0;i<n.length;i++)(t=this._getItem(n[i]))&&r.push(t);return r},Ne.prototype.refreshItems=function(e){if(this._isDestroyed)return this;var t,i=this.getItems(e);for(t=0;t<i.length;t++)i[t]._refreshDimensions();return this},Ne.prototype.refreshSortData=function(e){if(this._isDestroyed)return this;var t,i=this.getItems(e);for(t=0;t<i.length;t++)i[t]._refreshSortData();return this},Ne.prototype.synchronize=function(){if(this._isDestroyed)return this;var e,t,i,r=this._element,n=this._items;if(n.length){for(i=0;i<n.length;i++)(t=n[i]._element).parentNode===r&&(e=e||window.document.createDocumentFragment()).appendChild(t);e&&r.appendChild(e)}return this._emit("synchronize"),this},Ne.prototype.layout=function(e,t){if(this._isDestroyed)return this;var i,r,n,s=this,o=this._element,l=this._updateLayout(),u=l.id,c=l.items.length,d=c;function p(){if(!(--d>0)){var i=s._layout.id!==u,r=h(e)?e:t;h(r)&&r(i,l.items.slice(0)),!i&&s._hasListeners("layoutEnd")&&s._emit("layoutEnd",l.items.slice(0))}}if((l.setHeight&&"number"==typeof l.height||l.setWidth&&"number"==typeof l.width)&&(i="border-box"===a(o,"box-sizing")),l.setHeight&&("number"==typeof l.height?o.style.height=(i?l.height+this._borderTop+this._borderBottom:l.height)+"px":o.style.height=l.height),l.setWidth&&("number"==typeof l.width?o.style.width=(i?l.width+this._borderLeft+this._borderRight:l.width)+"px":o.style.width=l.width),this._hasListeners("layoutStart")&&this._emit("layoutStart",l.items.slice(0)),!c)return p(),this;for(n=0;n<c;n++)(r=l.items[n])&&(r._left=l.slots[2*n],r._top=l.slots[2*n+1],r.isDragging()?p():r._layout.start(!0===e,p));return this},Ne.prototype.add=function(e,t){if(this._isDestroyed||!e)return[];var i=Be(e);if(!i.length)return i;var r,n,s=t||0,o=s.layout?s.layout:void 0===s.layout,a=this._items,l=!1;for(n=0;n<i.length;n++)r=new Ve(this,i[n],s.isActive),i[n]=r,r._isActive&&(l=!0,r._layout._skipNextAnimation=!0);return I(a,i,s.index),this._hasListeners("add")&&this._emit("add",i.slice(0)),l&&o&&this.layout("instant"===o,h(o)?o:void 0),i},Ne.prototype.remove=function(e,t){if(this._isDestroyed)return this;var i,r,n=t||0,s=n.layout?n.layout:void 0===n.layout,o=!1,a=this.getItems(),l=this.getItems(e),u=[];for(r=0;r<l.length;r++)i=l[r],u.push(a.indexOf(i)),i._isActive&&(o=!0),i._destroy(n.removeElements);return this._hasListeners("remove")&&this._emit("remove",l.slice(0),u),o&&s&&this.layout("instant"===s,h(s)?s:void 0),l},Ne.prototype.show=function(e,t){return this._isDestroyed||this._setItemsVisibility(e,!0,t),this},Ne.prototype.hide=function(e,t){return this._isDestroyed||this._setItemsVisibility(e,!1,t),this},Ne.prototype.filter=function(e,t){if(this._isDestroyed||!this._items.length)return this;var i,r,n=[],s=[],o="string"==typeof e,a=h(e),l=t||0,u=!0===l.instant,c=l.layout?l.layout:void 0===l.layout,d=h(l.onFinish)?l.onFinish:null,p=-1,f=Re;if(d&&(f=function(){++p&&d(n.slice(0),s.slice(0))}),a||o)for(r=0;r<this._items.length;r++)i=this._items[r],(a?e(i):j(i._element,e))?n.push(i):s.push(i);return n.length?this.show(n,{instant:u,onFinish:f,layout:!1}):f(),s.length?this.hide(s,{instant:u,onFinish:f,layout:!1}):f(),(n.length||s.length)&&(this._hasListeners("filter")&&this._emit("filter",n.slice(0),s.slice(0)),c&&this.layout("instant"===c,h(c)?c:void 0)),this},Ne.prototype.sort=function(){var e,t,i,r;function n(e){for(var t={},i=0;i<e.length;i++)t[e[i]._id]=i;return t}function s(e,i){var n=r[e._id],s=r[i._id];return t?s-n:n-s}function o(o,a){for(var l,u,h,c,d=0,p=0;p<e.length;p++)if(l=e[p][0],u=e[p][1],h=(o._sortData?o:o._refreshSortData())._sortData[l],c=(a._sortData?a:a._refreshSortData())._sortData[l],d="desc"===u||!u&&t?c<h?-1:c>h?1:0:h<c?-1:h>c?1:0)return d;return d||(r||(r=n(i)),d=s(o,a)),d}function a(o,a){var l=e(o,a);return t&&l&&(l=-l),l||(r||(r=n(i)),s(o,a))}return function(n,s){if(this._isDestroyed||this._items.length<2)return this;var l,u=this._items,c=s||0,d=c.layout?c.layout:void 0===c.layout;if(e=n,t=!!c.descending,i=u.slice(0),r=null,h(e))u.sort(a);else if("string"==typeof e)e=n.trim().split(" ").map((function(e){return e.split(":")})),u.sort(o);else{if(!Array.isArray(e))return this;if(e.length!==u.length)throw new Error("[Muuri] sort reference items do not match with grid items.");for(l=0;l<u.length;l++){if(e.indexOf(u[l])<0)throw new Error("[Muuri] sort reference items do not match with grid items.");u[l]=e[l]}t&&u.reverse()}return this._hasListeners("sort")&&this._emit("sort",u.slice(0),i),d&&this.layout("instant"===d,h(d)?d:void 0),this}}(),Ne.prototype.move=function(e,t,i){if(this._isDestroyed||this._items.length<2)return this;var r,n,s=this._items,o=i||0,a=o.layout?o.layout:void 0===o.layout,l="swap"===o.action,u=l?"swap":"move",c=this._getItem(e),d=this._getItem(t);return c&&d&&c!==d&&(r=s.indexOf(c),n=s.indexOf(d),l?H(s,r,n):F(s,r,n),this._hasListeners("move")&&this._emit("move",{item:c,fromIndex:r,toIndex:n,action:u}),a&&this.layout("instant"===a,h(a)?a:void 0)),this},Ne.prototype.send=function(e,t,i,r){if(this._isDestroyed||t._isDestroyed||this===t)return this;if(!(e=this._getItem(e)))return this;var n=r||0,s=n.appendTo||window.document.body,o=n.layoutSender?n.layoutSender:void 0===n.layoutSender,a=n.layoutReceiver?n.layoutReceiver:void 0===n.layoutReceiver;return e._migrate.start(t,i,s),e._migrate._isActive&&e._isActive&&(o&&this.layout("instant"===o,h(o)?o:void 0),a&&t.layout("instant"===a,h(a)?a:void 0)),this},Ne.prototype.destroy=function(t){if(this._isDestroyed)return this;var i,r=this._element,n=this._items.slice(0);for(this._resizeHandler&&window.removeEventListener("resize",this._resizeHandler),i=0;i<n.length;i++)n[i]._destroy(t);return pe(r,this._settings.containerClass),r.style.height="",r.style.width="",this._emit("destroy"),this._emitter.destroy(),e[this._id]=void 0,this._isDestroyed=!0,this},Ne.prototype._getItem=function(e){if(this._isDestroyed||!e&&0!==e)return null;if("number"==typeof e)return this._items[e>-1?e:this._items.length+e]||null;if(e instanceof Ve)return e._gridId===this._id?e:null;for(var t=0;t<this._items.length;t++)if(this._items[t]._element===e)return this._items[t];return null},Ne.prototype._updateLayout=function(){var e,t,i,r,n=this._layout,s=this._settings.layout;for(++n.id,n.items.length=0,r=0;r<this._items.length;r++)this._items[r]._isActive&&n.items.push(this._items[r]);return this._refreshDimensions(),e=this._width-this._borderLeft-this._borderRight,t=this._height-this._borderTop-this._borderBottom,i=h(s)?s(n.items,e,t):je.getLayout(n.items,e,t,n.slots,s),n.slots=i.slots,n.setWidth=Boolean(i.setWidth),n.setHeight=Boolean(i.setHeight),n.width=i.width,n.height=i.height,n},Ne.prototype._emit=function(){this._isDestroyed||this._emitter.emit.apply(this._emitter,arguments)},Ne.prototype._hasListeners=function(e){var t=this._emitter._events[e];return!(!t||!t.length)},Ne.prototype._updateBoundingRect=function(){var e=this._element.getBoundingClientRect();this._width=e.width,this._height=e.height,this._left=e.left,this._top=e.top},Ne.prototype._updateBorders=function(e,t,i,r){var n=this._element;e&&(this._borderLeft=W(n,"border-left-width")),t&&(this._borderRight=W(n,"border-right-width")),i&&(this._borderTop=W(n,"border-top-width")),r&&(this._borderBottom=W(n,"border-bottom-width"))},Ne.prototype._refreshDimensions=function(){this._updateBoundingRect(),this._updateBorders(1,1,1,1)},Ne.prototype._setItemsVisibility=function(e,t,i){var r,n,s=this,o=this.getItems(e),a=i||0,l=!0===a.instant,u=a.onFinish,c=a.layout?a.layout:void 0===a.layout,d=o.length,p=t?"showStart":"hideStart",f=t?"showEnd":"hideEnd",m=t?"show":"hide",g=!1,_=[],v=[];if(d){for(this._hasListeners(p)&&this._emit(p,o.slice(0)),n=0;n<o.length;n++)r=o[n],(t&&!r._isActive||!t&&r._isActive)&&(g=!0),t&&!r._isActive&&(r._layout._skipNextAnimation=!0),t&&r._visibility._isHidden&&v.push(r),r._visibility[m](l,(function(e,t){e||_.push(t),--d<1&&(h(u)&&u(_.slice(0)),s._hasListeners(f)&&s._emit(f,_.slice(0)))}));v.length&&this.refreshItems(v),g&&c&&this.layout("instant"===c,h(c)?c:void 0)}else h(u)&&u(o)},Ne}()},function(e,t,i){},function(e,t,i){},function(e,t,i){},function(e,t,i){},function(e,t,i){"use strict";i.r(t),i.d(t,"localization",(function(){return r.a})),i.d(t,"surveyStrings",(function(){return r.b})),i.d(t,"DataProvider",(function(){return s})),i.d(t,"VisualizerFactory",(function(){return c})),i.d(t,"NumberModel",(function(){return d})),i.d(t,"hideEmptyAnswersInData",(function(){return p})),i.d(t,"SelectBase",(function(){return f})),i.d(t,"Matrix",(function(){return m})),i.d(t,"BooleanModel",(function(){return g})),i.d(t,"HistogramModel",(function(){return _})),i.d(t,"VisualizerBase",(function(){return l})),i.d(t,"defaultStatisticsCalculator",(function(){return u})),i.d(t,"VisualizationManager",(function(){return h})),i.d(t,"VisualizationPanel",(function(){return P})),i.d(t,"VisualizationPanelDynamic",(function(){return A})),i.d(t,"VisualizationMatrixDynamic",(function(){return S})),i.d(t,"VisualizationMatrixDropdown",(function(){return E})),i.d(t,"AlternativeVisualizersWrapper",(function(){return v})),i.d(t,"PlotlySetup",(function(){return x})),i.d(t,"PlotlyChartAdapter",(function(){return V})),i.d(t,"SelectBasePlotly",(function(){return z})),i.d(t,"MatrixPlotly",(function(){return O})),i.d(t,"PlotlyBoolChartAdapter",(function(){return L})),i.d(t,"BooleanPlotly",(function(){return M})),i.d(t,"RankingPlotly",(function(){return B})),i.d(t,"MatrixDropdownGroupedPlotly",(function(){return j})),i.d(t,"HistogramPlotly",(function(){return R})),i.d(t,"PlotlyGaugeAdapter",(function(){return N})),i.d(t,"GaugePlotly",(function(){return I})),i.d(t,"WordCloudAdapter",(function(){return X})),i.d(t,"WordCloud",(function(){return Y})),i.d(t,"textHelper",(function(){return F})),i.d(t,"TextTableAdapter",(function(){return Q})),i.d(t,"Text",(function(){return W})),i.d(t,"ChoicesTableAdapter",(function(){return U})),i.d(t,"ChoicesTable",(function(){return K})),i.d(t,"NpsVisualizerWidget",(function(){return Z})),i.d(t,"NpsAdapter",(function(){return J})),i.d(t,"NpsVisualizer",(function(){return $})),i.d(t,"DocumentHelper",(function(){return a.b}));var r=i(0),n=(i(9),i(10),i(11),i(12),i(13),i(14),i(15),i(16),i(17),i(18),i(19),i(3)),s=function(){function e(e){void 0===e&&(e=[]),this._data=e,this.filterValues={},this.onDataChanged=new n.Event}return Object.defineProperty(e.prototype,"data",{get:function(){if(Array.isArray(this._data))return this._data},set:function(e){Array.isArray(e)?this._data=[].concat(e):this._data=e,this.raiseDataChanged()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dataFn",{get:function(){if("function"==typeof this._data)return this._data},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"filteredData",{get:function(){var t=this;void 0===this._filteredData&&(Object.keys(this.filterValues).length>0?this._filteredData=this.data.filter((function(i){return!Object.keys(t.filterValues).some((function(r){var n=t.filterValues[r],s=typeof n,o=i[r];if(Array.isArray(o)&&"object"!==s)return-1==o.indexOf(n);if("object"==typeof o)return"object"!==s||!function(e,t){var i=Object.keys(e),r=Object.keys(t);if(r.length>i.length)return!1;for(var n=0,s=r;n<s.length;n++){var o=s[n];if(t[o]!=e[o])return!1}return!0}(o,n);var a=i[e.seriesMarkerKey];if(a&&"object"===s)return o!==n[a];if("object"===s&&void 0!==n.start&&void 0!==n.end){var l="number"==typeof o?o:Date.parse(o);return!(!isNaN(l)||(l=parseFloat(o),!isNaN(l)))||(l<n.start||l>=n.end)}return i[r]!==t.filterValues[r]}))})):this._filteredData=this.data);return this._filteredData},enumerable:!1,configurable:!0}),e.prototype.setFilter=function(e,t){var i=!0;void 0!==t?(i=this.filterValues[e]!==t,this.filterValues[e]=t):(i=void 0!==this.filterValues[e],delete this.filterValues[e]),i&&this.raiseDataChanged()},e.prototype.raiseDataChanged=function(e){this._filteredData=void 0,this.onDataChanged.isEmpty||this.onDataChanged.fire(this,{questionName:e})},e.prototype.getFilters=function(){var e=this;return Object.keys(this.filterValues).map((function(t){return{field:t,type:"=",value:e.filterValues[t]}}))},e.seriesMarkerKey="__sa_series_name",e}();var o=i(2),a=i(1),l=(i(27),function(){function e(e,t,i,r){void 0===i&&(i={});var o,a=this;this.question=e,this.options=i,this._type=r,this._showToolbar=!0,this._footerVisualizer=void 0,this._dataProvider=void 0,this._getDataCore=void 0,this.labelTruncateLength=27,this.renderResult=void 0,this.toolbarContainer=void 0,this.headerContainer=void 0,this.contentContainer=void 0,this.footerContainer=void 0,this._supportSelection=!1,this.onAfterRender=new n.Event,this.onLocaleChanged=new n.Event,this.onStateChanged=new n.Event,this.toolbarItemCreators={},this._backgroundColor="#f7f7f7",this._calculationsCache=void 0,this.loadingData=!1,this._settingState=!1,this._getDataCore=null===(o=this.questionOptions)||void 0===o?void 0:o.getDataCore,this._dataProvider=i.dataProvider||new s(t),this._dataProvider.onDataChanged.add((function(){return a.onDataChanged()})),this.loadingData=!!this._dataProvider.dataFn,void 0!==i.labelTruncateLength&&(this.labelTruncateLength=i.labelTruncateLength)}return e.prototype.afterRender=function(e){this.onAfterRender.fire(this,{htmlElement:e})},e.prototype.stateChanged=function(e,t){this._settingState||this.onStateChanged.fire(this,this.getState())},Object.defineProperty(e.prototype,"questionOptions",{get:function(){var e;return this.options[null===(e=this.question)||void 0===e?void 0:e.name]},enumerable:!1,configurable:!0}),e.prototype.onDataChanged=function(){this._calculationsCache=void 0,this.loadingData=!!this._dataProvider.dataFn,this.refresh()},Object.defineProperty(e.prototype,"name",{get:function(){return this.question.valueName||this.question.name},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dataNames",{get:function(){return[this.name]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasHeader",{get:function(){return!(!this.options||!this.options.showCorrectAnswers)&&(!!this.question&&!!this.question.correctAnswer)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasFooter",{get:function(){return!!this.question&&(this.question.hasComment||this.question.hasOther)},enumerable:!1,configurable:!0}),e.prototype.createVisualizer=function(e){var t=Object.assign({},this.options);return void 0===t.dataProvider&&(t.dataProvider=this.dataProvider),c.createVisualizer(e,this.data,t)},Object.defineProperty(e.prototype,"footerVisualizer",{get:function(){var e=this;if(this.hasFooter){if(!this._footerVisualizer){var t=new n.QuestionCommentModel(this.question.name+(n.settings||{}).commentPrefix);t.title=this.processText(this.question.title),this._footerVisualizer=this.createVisualizer(t),this._footerVisualizer&&(this._footerVisualizer.onUpdate=function(){return e.invokeOnUpdate()})}return this._footerVisualizer}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"supportSelection",{get:function(){return(void 0===this.options.allowSelection||this.options.allowSelection)&&this._supportSelection},enumerable:!1,configurable:!0}),e.prototype.getSeriesValues=function(){return this.options.seriesValues||[]},e.prototype.getSeriesLabels=function(){return this.options.seriesLabels||this.getSeriesValues()},e.prototype.getValues=function(){throw new Error("Method not implemented.")},e.prototype.getLabels=function(){return this.getValues()},e.prototype.registerToolbarItem=function(e,t){this.toolbarItemCreators[e]=t},e.prototype.unregisterToolbarItem=function(e){if(void 0!==this.toolbarItemCreators[e]){var t=this.toolbarItemCreators[e];return delete this.toolbarItemCreators[e],t}},Object.defineProperty(e.prototype,"type",{get:function(){return this._type||"visualizer"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"data",{get:function(){return this.dataProvider.filteredData},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"surveyData",{get:function(){return this.dataProvider.filteredData},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dataProvider",{get:function(){return this._dataProvider},enumerable:!1,configurable:!0}),e.prototype.updateData=function(e){this.options.dataProvider||(this.dataProvider.data=e),this.hasFooter&&this.footerVisualizer.updateData(e)},e.prototype.invokeOnUpdate=function(){this.onUpdate&&this.onUpdate()},e.prototype.destroy=function(){this.renderResult&&(this.clear(),this.toolbarContainer=void 0,this.headerContainer=void 0,this.contentContainer=void 0,this.footerContainer=void 0,this.renderResult.innerHTML="",this.renderResult=void 0),this._footerVisualizer&&(this._footerVisualizer.destroy(),this._footerVisualizer.onUpdate=void 0,this._footerVisualizer=void 0)},e.prototype.clear=function(){this.toolbarContainer&&this.destroyToolbar(this.toolbarContainer),this.headerContainer&&this.destroyHeader(this.headerContainer),this.contentContainer&&this.destroyContent(this.contentContainer),this.footerContainer&&this.destroyFooter(this.footerContainer)},e.prototype.createToolbarItems=function(e){var t=this;Object.keys(this.toolbarItemCreators||{}).forEach((function(i){var r=t.toolbarItemCreators[i](e);r&&e.appendChild(r)}))},e.prototype.getCorrectAnswerText=function(){return this.question?this.question.correctAnswer:""},e.prototype.destroyToolbar=function(e){e.innerHTML=""},e.prototype.renderToolbar=function(e){if(this.showToolbar){var t=a.b.createElement("div","sa-toolbar");this.createToolbarItems(t),e.appendChild(t)}},e.prototype.destroyHeader=function(e){this.options&&"function"==typeof this.options.destroyHeader?this.options.destroyHeader(e,this):e.innerHTML=""},e.prototype.destroyContent=function(e){this.options&&"function"==typeof this.options.destroyContent?this.options.destroyContent(e,this):e.innerHTML=""},e.prototype.renderHeader=function(e){if(this.options&&"function"==typeof this.options.renderHeader)this.options.renderHeader(e,this);else{var t=a.b.createElement("div","sa-visualizer__correct-answer");t.innerText=r.a.getString("correctAnswer")+this.getCorrectAnswerText(),e.appendChild(t)}},e.prototype.renderContentAsync=function(e){return Object(o.b)(this,void 0,void 0,(function(){return Object(o.d)(this,(function(t){return[2,new Promise((function(t,i){e.innerText=r.a.getString("noVisualizerForQuestion"),t(e)}))]}))}))},e.prototype.renderContent=function(e){var t=this;this.options&&"function"==typeof this.options.renderContent?(this.options.renderContent(e,this),this.afterRender(e)):(this.loadingData&&this.renderLoadingIndicator(this.contentContainer),this.renderContentAsync(e).then((function(e){return t.afterRender(e)})))},e.prototype.destroyFooter=function(e){e.innerHTML=""},e.prototype.renderFooter=function(t){var i=this;if(t.innerHTML="",this.hasFooter){var n=a.b.createElement("h4","sa-visualizer__footer-title",{innerText:r.a.getString("otherCommentTitle")});t.appendChild(n);var s=a.b.createElement("div","sa-visualizer__footer-content");s.style.display=e.otherCommentCollapsed?"none":"block";var o=a.b.createButton((function(){"none"===s.style.display?(s.style.display="block",o.innerText=r.a.getString("hideButton")):(s.style.display="none",o.innerText=r.a.getString(e.otherCommentCollapsed?"showButton":"hideButton")),i.footerVisualizer.invokeOnUpdate()}),r.a.getString("showButton"));t.appendChild(o),t.appendChild(s),this.footerVisualizer.render(s)}},e.prototype.render=function(e){"string"==typeof e&&(e=document.getElementById(e)),this.renderResult=e,this.toolbarContainer=a.b.createElement("div","sa-visualizer__toolbar"),e.appendChild(this.toolbarContainer),this.renderToolbar(this.toolbarContainer),this.hasHeader&&(this.headerContainer=a.b.createElement("div","sa-visualizer__header"),e.appendChild(this.headerContainer),this.renderHeader(this.headerContainer)),this.contentContainer=a.b.createElement("div","sa-visualizer__content"),e.appendChild(this.contentContainer),this.renderContent(this.contentContainer),this.footerContainer=a.b.createElement("div","sa-visualizer__footer"),e.appendChild(this.footerContainer),this.renderFooter(this.footerContainer)},e.prototype.refresh=function(){var e=this;this.headerContainer&&setTimeout((function(){e.destroyHeader(e.headerContainer),e.renderHeader(e.headerContainer),e.invokeOnUpdate()})),this.contentContainer&&setTimeout((function(){e.destroyContent(e.contentContainer),e.renderContent(e.contentContainer),e.invokeOnUpdate()})),this.footerContainer&&setTimeout((function(){e.destroyFooter(e.footerContainer),e.renderFooter(e.footerContainer),e.invokeOnUpdate()}))},e.prototype.processText=function(e){return!1!==this.options.stripHtmlFromTitles?(e||"").replace(/(<([^>]+)>)/gi,""):e},e.prototype.getRandomColor=function(){var e=this.getColors();return e[Math.floor(Math.random()*e.length)]},Object.defineProperty(e.prototype,"backgroundColor",{get:function(){return this.getBackgroundColorCore()},set:function(e){this.setBackgroundColorCore(e)},enumerable:!1,configurable:!0}),e.prototype.getBackgroundColorCore=function(){return this._backgroundColor},e.prototype.setBackgroundColorCore=function(e){this._backgroundColor=e,this.footerVisualizer&&(this.footerVisualizer.backgroundColor=e)},e.prototype.getColors=function(t){void 0===t&&(t=10);for(var i=Array.isArray(e.customColors)&&e.customColors.length>0?e.customColors:e.colors,r=[],n=0;n<t;n++)r=r.concat(i);return r},Object.defineProperty(e.prototype,"showToolbar",{get:function(){return this._showToolbar},set:function(e){e!=this._showToolbar&&(this._showToolbar=e,this.toolbarContainer&&(this.destroyToolbar(this.toolbarContainer),this.renderToolbar(this.toolbarContainer)))},enumerable:!1,configurable:!0}),e.prototype.getData=function(){return this.getCalculatedValuesCore()},e.prototype.getCalculatedValuesCore=function(){return this._getDataCore?this._getDataCore(this):u(this.surveyData,this)},e.prototype.renderLoadingIndicator=function(e){e.appendChild(Object(a.f)())},e.prototype.convertFromExternalData=function(e){return e},e.prototype.getCalculatedValues=function(){var e=this;return new Promise((function(t,i){if(void 0!==e._calculationsCache&&t(e._calculationsCache),e.dataProvider.dataFn){e.loadingData=!0;var r=e.dataProvider.dataFn({visualizer:e,filter:e.dataProvider.getFilters(),callback:function(r){e.loadingData=!1,!r.error&&Array.isArray(r.data)?(e._calculationsCache=e.convertFromExternalData(r.data),t(e._calculationsCache)):i()}});r&&r.then((function(i){e.loadingData=!1,e._calculationsCache=e.convertFromExternalData(i),t(e._calculationsCache)})).catch((function(){e.loadingData=!1,i()}))}else e._calculationsCache=e.getCalculatedValuesCore(),t(e._calculationsCache)}))},e.prototype.getState=function(){return{}},e.prototype.setState=function(e){},Object.defineProperty(e.prototype,"locale",{get:function(){var e=this.options.survey;return e?e.locale:r.a.currentLocale},set:function(e){this.setLocale(e),this.onLocaleChanged.fire(this,{locale:e}),this.refresh()},enumerable:!1,configurable:!0}),e.prototype.setLocale=function(e){r.a.currentLocale=e;var t=this.options.survey;t&&t.locale!==e&&(t.locale=e)},e.suppressVisualizerStubRendering=!1,e.otherCommentCollapsed=!0,e.customColors=[],e.colors=["#86e1fb","#3999fb","#ff6771","#1eb496","#ffc152","#aba1ff","#7d8da5","#4ec46c","#cf37a6","#4e6198"],e}());function u(e,t){var i=t.dataNames,r=[],n=t.getValues(),o={};n.forEach((function(e,t){o[e]=t}));var a=-1!==n.indexOf(void 0),l=t.getSeriesValues(),u={};l.forEach((function(e,t){u[e]=t}));for(var h=l.length||1,c=0;c<i.length;++c){for(var d=new Array,p=0;p<h;++p)d.push(new Array(n.length).fill(0));r.push(d)}return e.forEach((function(e){i.forEach((function(t,i){var n=e[t];if(void 0!==n||a){var h=Array.isArray(n)?n:[n];if(l.length>0)if(void 0!==e[s.seriesMarkerKey]){var c=u[e[s.seriesMarkerKey]]||0;h.forEach((function(e){r[i][c][o[e]]++}))}else h.forEach((function(e){l.forEach((function(t){if(void 0!==e[t]){var n=u[t]||0;r[i][n][o[e[t]]]++}}))}));else h.forEach((function(e){return r[0][0][o[e]]++}))}}))})),t.dataNames.length>1?r:r[0]}var h=function(){function e(){}return e.registerVisualizer=function(t,i,r){void 0===r&&(r=Number.MAX_VALUE);var n=e.vizualizers[t];n||(n=[],e.vizualizers[t]=n),n.push({ctor:i,index:r})},e.unregisterVisualizer=function(t,i){var r=[t];t||(r=Object.keys(e.vizualizers)),r.forEach((function(t){if(i){var r=e.vizualizers[t];if(r){var n=r.filter((function(e){return e.ctor===i}))[0];if(n){var s=r.indexOf(n);-1!==s&&r.splice(s,1)}}}else e.vizualizers[t]=[]}))},e.unregisterVisualizerForAll=function(t){e.unregisterVisualizer(void 0,t)},e.getVisualizersByType=function(t){var i=e.vizualizers[t];return i?((i=[].concat(i)).sort((function(e,t){return e.index-t.index})),i.map((function(e){return e.ctor}))):l.suppressVisualizerStubRendering?[]:[l]},e.getAltVisualizerSelector=function(){return e.alternativesVisualizer||l},e.registerAltVisualizerSelector=function(t){e.alternativesVisualizer=t},e.alternativesVisualizer=void 0,e.vizualizers={},e}(),c=function(){function e(){}return e.createVisualizer=function(e,t,i){var r;r="text"===e.getType()&&e.inputType?e.inputType:e.getType();var n=h.getVisualizersByType(r).map((function(r){return new r(e,t,i)}));return n.length>1?new(h.getAltVisualizerSelector())(n,e,t,i):n[0]},e}(),d=function(e){function t(t,i,n,s){void 0===n&&(n={});var o=e.call(this,t,i,n,s||"number")||this;return o.registerToolbarItem("changeChartType",(function(){return o.chartTypes.length>1?a.b.createSelector(o.chartTypes.map((function(e){return{value:e,text:r.a.getString("chartType_"+e)}})),(function(e){return o.chartType===e.value}),(function(e){o.setChartType(e.target.value)})):null})),o}return Object(o.c)(t,e),t.prototype.onDataChanged=function(){this._resultAverage=void 0,this._resultMin=void 0,this._resultMax=void 0,e.prototype.onDataChanged.call(this)},t.prototype.onChartTypeChanged=function(){},t.prototype.setChartType=function(e){-1!==this.chartTypes.indexOf(e)&&this.chartType!==e&&(this.chartType=e,this.onChartTypeChanged(),this.contentContainer&&(this.destroyContent(this.contentContainer),this.renderContent(this.contentContainer)),this.invokeOnUpdate())},t.prototype.destroy=function(){this._resultAverage=void 0,this._resultMin=void 0,this._resultMax=void 0,e.prototype.destroy.call(this)},t.prototype.generateText=function(e,i,r){var n=[];if(5===r)n=["very high ("+e+")","high","medium","low","very low ("+i+")"];else{n.push(e);for(var s=0;s<r-2;s++)n.push("");n.push(i)}return t.generateTextsCallback?t.generateTextsCallback(this.question,e,i,r,n):n},t.prototype.generateValues=function(e,t){for(var i=[],r=0;r<t;r++)i.push(e/t);return i.push(e),i},t.prototype.generateColors=function(e,t,i){for(var r=this.getColors(),n=[],s=0;s<i;s++)n.push(r[s]);return n.push("rgba(255, 255, 255, 0)"),n},t.prototype.convertFromExternalData=function(e){return[e.value||0,e.minValue||0,e.maxValue||0]},t.prototype.getCalculatedValuesCore=function(){var e=this;if(void 0===this._resultAverage||void 0===this._resultMin||void 0===this._resultMax){this._resultMin=Number.MAX_VALUE,this._resultMax=-Number.MAX_VALUE,this._resultAverage=0;var t=0;this.data.forEach((function(i){if(void 0!==i[e.question.name]){var r=+i[e.question.name];t++,e._resultAverage+=r,e._resultMin>r&&(e._resultMin=r),e._resultMax<r&&(e._resultMax=r)}})),t>0&&(this._resultAverage=this._resultAverage/t),this._resultAverage=Math.ceil(100*this._resultAverage)/100}return[this._resultAverage,this._resultMin,this._resultMax]},t.stepsCount=5,t.showAsPercentage=!1,t}(l);function p(e){var t={datasets:[],labels:[],colors:[],texts:[],seriesLabels:[]};if(0===e.seriesLabels.length){t.datasets.push([]),t.texts.push([]);for(var i=0;i<e.datasets[0].length;i++)0!=e.datasets[0][i]&&(t.datasets[0].push(e.datasets[0][i]),t.labels.push(e.labels[i]),t.colors.push(e.colors[i]),t.texts[0].push(e.texts[0][i]));return t}var r=[];r.length=e.seriesLabels.length;var n=[];n.length=e.labels.length;for(var s=0;s<e.labels.length;s++)for(var o=0;o<e.seriesLabels.length;o++)0!=e.datasets[s][o]&&(r[o]=!0,n[s]=!0);for(s=0;s<n.length;s++)n[s]&&(t.labels.push(e.labels[s]),t.colors.push(e.colors[s]));for(o=0;o<e.seriesLabels.length;o++)r[o]&&t.seriesLabels.push(e.seriesLabels[o]);for(s=0;s<e.labels.length;s++)if(n[s]){var a=[],l=[];for(o=0;o<e.datasets.length;o++)r[o]&&(a.push(e.datasets[s][o]),l.push(e.texts[s][o]));t.datasets.push(a),t.texts.push(l)}return t}var f=function(e){function t(i,s,o,l){var u=e.call(this,i,s,o,l||"selectBase")||this;return u.selectedItem=void 0,u.choicesOrderSelector=void 0,u.showPercentageBtn=void 0,u.emptyAnswersBtn=void 0,u.transposeDataBtn=void 0,u.topNSelector=void 0,u._showPercentages=!1,u._showOnlyPercentages=!1,u._percentagePrecision=0,u._answersOrder="default",u._supportSelection=!0,u._hideEmptyAnswers=!1,u._topN=-1,u.topNValues=[].concat(t.topNValuesDefaults),u._transposeData=!1,u._showMissingAnswers=!1,u.missingAnswersBtn=void 0,u.chartTypes=[],u._chartType="bar",u.onAnswersDataReady=new n.Event,i.visibleChoicesChangedCallback=function(){u.dataProvider.raiseDataChanged()},u._showPercentages=!0===u.options.showPercentages,u._showOnlyPercentages=!0===u.options.showOnlyPercentages,u.options.percentagePrecision&&(u._percentagePrecision=u.options.percentagePrecision),u._hideEmptyAnswers=!0===u.options.hideEmptyAnswers,u._answersOrder=u.options.answersOrder||"default",u._showMissingAnswers=u.isSupportMissingAnswers()&&!0===u.options.showMissingAnswers,u.registerToolbarItem("changeChartType",(function(){return u.chartTypes.length>1?a.b.createSelector(u.chartTypes.map((function(e){return{value:e,text:r.a.getString("chartType_"+e)}})),(function(e){return u.chartType===e.value}),(function(e){u.setChartType(e.target.value)})):null})),u.registerToolbarItem("changeAnswersOrder",(function(){return u.isSupportAnswersOrder()&&(u.choicesOrderSelector=a.b.createSelector([{text:r.a.getString("defaultOrder"),value:"default"},{text:r.a.getString("ascOrder"),value:"asc"},{text:r.a.getString("descOrder"),value:"desc"}],(function(e){return!1}),(function(e){u.answersOrder=e.target.value})),u.updateOrderSelector()),u.choicesOrderSelector})),u.registerToolbarItem("showPercentages",(function(){if(u.options.allowShowPercentages&&(-1!==u.chartTypes.indexOf("bar")||-1!==u.chartTypes.indexOf("stackedbar")))return u.showPercentageBtn=a.b.createButton((function(){u.showPercentages=!u.showPercentages})),u.updateShowPercentageBtn(),u.showPercentageBtn})),u.registerToolbarItem("hideEmptyAnswers",(function(){return u.options.allowHideEmptyAnswers&&(u.emptyAnswersBtn=a.b.createButton((function(){u.hideEmptyAnswers=!u._hideEmptyAnswers})),u.updateEmptyAnswersBtn()),u.emptyAnswersBtn})),u.registerToolbarItem("topNAnswers",(function(){return u.options.allowTopNAnswers&&0===u.getSeriesValues().length&&(u.topNSelector=a.b.createSelector(u.topNValues.map((function(e){return{text:r.a.getString("topNValueText"+e),value:e}})),(function(e){return!1}),(function(e){u.topN=parseInt(e.target.value)})),u.updateTopNSelector()),u.topNSelector})),u.registerToolbarItem("transposeData",(function(){return u.options.allowTransposeData&&(u.transposeDataBtn=a.b.createButton((function(){u.transposeData=!u.transposeData})),u.updateTransposeDataBtn()),u.transposeDataBtn})),u.registerToolbarItem("showMissingAnswers",(function(){return u.isSupportMissingAnswers()&&u.options.allowShowMissingAnswers&&(u.missingAnswersBtn=a.b.createButton((function(){u.showMissingAnswers=!u._showMissingAnswers})),u.updateMissingAnswersBtn()),u.missingAnswersBtn})),u}return Object(o.c)(t,e),Object.defineProperty(t.prototype,"chartType",{get:function(){return this._chartType},set:function(e){this.setChartType(e)},enumerable:!1,configurable:!0}),t.prototype.updateEmptyAnswersBtn=function(){this.emptyAnswersBtn&&(this.emptyAnswersBtn.innerText=this._hideEmptyAnswers?r.a.getString("showEmptyAnswers"):r.a.getString("hideEmptyAnswers"),"bar"==this.chartType||"vbar"==this.chartType||"scatter"==this.chartType?this.emptyAnswersBtn.style.display="inline":this.emptyAnswersBtn.style.display="none")},t.prototype.updateTransposeDataBtn=function(){this.transposeDataBtn&&(this.transposeDataBtn.innerText=this.transposeData?r.a.getString("showPerColumns"):r.a.getString("showPerValues"),this.getSeriesValues().length>0?this.transposeDataBtn.style.display="inline":this.transposeDataBtn.style.display="none")},t.prototype.updateOrderSelector=function(){this.choicesOrderSelector&&("bar"==this.chartType||"vbar"==this.chartType||"scatter"==this.chartType||("pie"==this.chartType||"doughnut"==this.chartType)&&this.topN>0?this.choicesOrderSelector.style.display="inline-flex":this.choicesOrderSelector.style.display="none",this.choicesOrderSelector.getElementsByTagName("select")[0].value=this.answersOrder)},t.prototype.updateShowPercentageBtn=function(){this.showPercentageBtn&&(this.showPercentageBtn.innerText=this._showPercentages?r.a.getString("hidePercentages"):r.a.getString("showPercentages"),"bar"==this.chartType||"vbar"==this.chartType||"stackedbar"==this.chartType?this.showPercentageBtn.style.display="inline":this.showPercentageBtn.style.display="none")},t.prototype.updateTopNSelector=function(){this.topNSelector&&(this.topNSelector.getElementsByTagName("select")[0].value=this._topN)},t.prototype.updateMissingAnswersBtn=function(){this.missingAnswersBtn&&(this.missingAnswersBtn.innerText=this._showMissingAnswers?r.a.getString("hideMissingAnswers"):r.a.getString("showMissingAnswers"))},t.prototype.onChartTypeChanged=function(){this.updateOrderSelector(),this.updateShowPercentageBtn(),this.updateEmptyAnswersBtn(),this.updateTopNSelector(),this.stateChanged("chartType",this._chartType)},t.prototype.setChartType=function(e){-1!==this.chartTypes.indexOf(e)&&this._chartType!==e&&(this._chartType=e,this.onChartTypeChanged(),this.refreshContent())},t.prototype.getCorrectAnswerText=function(){var t=e.prototype.getCorrectAnswerText.call(this),i=Array.isArray(t)?t:[t],r=this.question;return i.map((function(e){return n.ItemValue.getTextOrHtmlByValue(r.choices,e)})).join(", ")},t.prototype.getSelectedItemByText=function(e){var t=this.question;return this.question.hasOther&&e==t.otherText?t.otherItem:t.choices.filter((function(t){return t.text===e}))[0]},t.prototype.setSelection=function(e){this.selectedItem!==e&&(this.selectedItem=e,void 0!==this.onDataItemSelected&&this.onDataItemSelected(void 0!==e?e.value:void 0,void 0!==e?e.text:""))},Object.defineProperty(t.prototype,"selection",{get:function(){return this.selectedItem},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"showOnlyPercentages",{get:function(){return this._showOnlyPercentages},set:function(e){this._showOnlyPercentages=e,this.refreshContent(),this.stateChanged("showOnlyPercentages",e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"showPercentages",{get:function(){return this._showPercentages},set:function(e){this._showPercentages=e,this.updateShowPercentageBtn(),this.refreshContent(),this.stateChanged("showPercentages",e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"answersOrder",{get:function(){return this._answersOrder},set:function(e){this._answersOrder=e,this.updateOrderSelector(),this.refreshContent(),this.stateChanged("answersOrder",e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hideEmptyAnswers",{get:function(){return this._hideEmptyAnswers},set:function(e){this._hideEmptyAnswers=e,this.updateEmptyAnswersBtn(),this.refreshContent(),this.stateChanged("hideEmptyAnswers",e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"transposeData",{get:function(){return this._transposeData},set:function(e){this._transposeData=e,this.updateTransposeDataBtn(),this.refreshContent(),this.stateChanged("transposeData",e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"topN",{get:function(){return this._topN},set:function(e){this._topN=e,this.updateTopNSelector(),this.updateOrderSelector(),this.refreshContent(),this.stateChanged("topN",e)},enumerable:!1,configurable:!0}),t.prototype.isSupportAnswersOrder=function(){return(void 0===this.options.allowChangeAnswersOrder||this.options.allowChangeAnswersOrder)&&0===this.getSeriesValues().length},t.prototype.isSupportMissingAnswers=function(){return!0},Object.defineProperty(t.prototype,"showMissingAnswers",{get:function(){return this._showMissingAnswers},set:function(e){this._showMissingAnswers=this.isSupportMissingAnswers()&&e,this.updateMissingAnswersBtn(),this.dataProvider.raiseDataChanged(this.name),this.refreshContent(),this.stateChanged("showMissingAnsewrs",e)},enumerable:!1,configurable:!0}),t.prototype.refreshContent=function(){this.contentContainer&&(this.destroyContent(this.contentContainer),this.renderContent(this.contentContainer)),this.invokeOnUpdate()},Object.defineProperty(t.prototype,"showValuesInOriginalOrder",{get:function(){return!1!==this.options.showValuesInOriginalOrder},enumerable:!1,configurable:!0}),t.prototype.valuesSource=function(){var e=this.question;return e.choicesFromQuestion&&e.survey&&(e=e.survey.getQuestionByName(e.choicesFromQuestion)),e.activeChoices},t.prototype.getValues=function(){var e=this.valuesSource().map((function(e){return e.value}));return this.question.hasNone&&e.push(this.question.noneItem.value),this.question.hasOther&&e.push("other"),this.showMissingAnswers&&e.unshift(void 0),this.showValuesInOriginalOrder?e.reverse():e},t.prototype.getLabels=function(){var e=this;if(this.options.useValuesAsLabels)return this.getValues();var t=this.valuesSource().map((function(t){return n.ItemValue.getTextOrHtmlByValue(e.valuesSource(),t.value)})),i=this.question;return i.hasNone&&t.push(i.noneText),i.hasOther&&t.push(i.otherText),this.showMissingAnswers&&t.unshift(r.a.getString("missingAnswersLabel")),this.showValuesInOriginalOrder?t.reverse():t},t.prototype.getPercentages=function(e){var t=[],i=this._percentagePrecision;if(e.length<2)e.forEach((function(e,r){var n=e.reduce((function(e,t){return e+t}),0);t[r]=e.map((function(e){var t=i?+(e/n).toFixed(i):Math.round(e/n*1e4);return n&&t/100}))}));else for(var r=0;r<e[0].length;r++){for(var n=0,s=0;s<e.length;s++)n+=e[s][r];for(s=0;s<e.length;s++){Array.isArray(t[s])||(t[s]=[]);var o=i?+(e[s][r]/n*100).toFixed(i):Math.round(e[s][r]/n*100);t[s][r]=n&&o}}return t},t.prototype.answersDataReady=function(e){var t={};return t=this.hideEmptyAnswers?p(e):e,this.topN>0&&(t.datasets[0]=t.datasets[0].slice(-this.topN),t.labels=t.labels.slice(-this.topN),t.colors=t.colors.slice(-this.topN),t.texts[0]=t.texts[0].slice(-this.topN)),t},t.prototype.getAnswersData=function(){return Object(o.b)(this,void 0,void 0,(function(){var e,t,i,r,n,s,l,u,h,c;return Object(o.d)(this,(function(o){switch(o.label){case 0:return e=this.getSeriesLabels(),[4,this.getCalculatedValues()];case 1:return t=o.sent(),i=this.getLabels(),r=this.getColors(),n=this.showPercentages?this.getPercentages(t):t,this.transposeData&&(t=this.transpose(t),n=this.transpose(n),s=e,e=i,i=s),"asc"!=this.answersOrder&&"desc"!=this.answersOrder||(l=this.showPercentages?a.a.zipArrays(i,r,n[0]):a.a.zipArrays(i,r),u=a.a.sortDictionary(l,t[0],"desc"==this.answersOrder),h=a.a.unzipArrays(u.keys),i=h[0],r=h[1],this.showPercentages&&(n[0]=h[2]),t[0]=u.values),c={datasets:t,labels:i,colors:r,texts:n,seriesLabels:e},c=this.answersDataReady(c),this.onAnswersDataReady.fire(this,c),[2,c]}}))}))},t.prototype.convertFromExternalData=function(e){var t=this.getValues(),i=this.getSeriesValues(),r=[];if(i.length>0)for(var n=0;n<t.length;n++){for(var s=[],o=0;o<i.length;o++)e[i[o]]?s.push(e[i[o]][t[n]]||0):s.push(0);r.push(s)}else{for(s=[],n=0;n<t.length;n++)s.push(e[t[n]]||0);r.push(s)}return r},t.prototype.transpose=function(e){for(var t=e[0].length,i=new Array(t),r=0;r<t;++r)i[r]=new Array(e.length);for(r=0;r<e.length;++r)for(var n=0;n<t;++n)i[n][r]=e[r][n];return i},t.prototype.getState=function(){var e=this,i={};return t._stateProperties.forEach((function(t){i[t]=e[t]})),this.selectedItem&&(i.filter=this.selectedItem.value),i},t.prototype.setState=function(e){var i=this;t._stateProperties.forEach((function(t){void 0!==e[t]&&(i[t]=e[t])}));var r=n.ItemValue.getItemByValue(this.question.visibleChoices,e.filter);this.setSelection(null!=r?r:void 0)},t.topNValuesDefaults=[-1,5,10,20],t._stateProperties=["chartType","answersOrder","hideEmptyAnswers","topN"],t}(l),m=function(e){function t(t,i,r,n){return e.call(this,t,i,r,n||"matrix")||this}return Object(o.c)(t,e),Object.defineProperty(t.prototype,"matrixQuestion",{get:function(){return this.question},enumerable:!1,configurable:!0}),t.prototype.isSupportMissingAnswers=function(){return!1},t.prototype.getSeriesValues=function(){return this.matrixQuestion.rows.map((function(e){return""+e.value}))},t.prototype.getSeriesLabels=function(){var e=this;return this.matrixQuestion.rows.map((function(t){return n.ItemValue.getTextOrHtmlByValue(e.matrixQuestion.rows,t.value)}))},t.prototype.getSelectedItemByText=function(e){return this.matrixQuestion.columns.filter((function(t){return t.text===e}))[0]},t.prototype.valuesSource=function(){return this.matrixQuestion.columns},t.prototype.getHasAnswersInAllSeriesArray=function(e){for(var t=Array(),i=0;i<e[0].length;i++)for(var r=0;r<e.length;r++)0!=e[r][i]&&(t[i]=!0);return t},t.prototype.getHasAnswersInSeries=function(e){for(var t=0;t<e.length;t++)if(0!=e[t])return!0;return!1},t.prototype.hideEmptyAnswersInData=function(e){for(var t={datasets:[],labels:[],colors:[],texts:[],seriesLabels:[]},i=this.getHasAnswersInAllSeriesArray(e.datasets),r=0;r<e.datasets.length;r++){if(this.getHasAnswersInSeries(e.datasets[r])){t.labels.push(e.labels[r]),t.colors.push(e.colors[r]);for(var n=[],s=[],o=0;o<e.datasets[0].length;o++)i[o]&&(n.push(e.datasets[r][o]),s.push(e.texts[r][o]));t.datasets.push(n),t.texts.push(s)}}for(r=0;r<e.datasets[0].length;r++)i[r]&&t.seriesLabels.push(e.seriesLabels[r]);return t},t.prototype.getCalculatedValuesCore=function(){var t=e.prototype.getCalculatedValuesCore.call(this),i=this.getSeriesValues(),r=this.getValues(),n=[];return r.forEach((function(e,r){var s=i.map((function(e,i){return t[i][r]}));n.push(s)})),n},t}(f),g=function(e){function t(t,i,r,n){return e.call(this,t,i,r,n||"boolean")||this}return Object(o.c)(t,e),t.prototype.getCorrectAnswerText=function(){var e=this.booleanQuestion.correctAnswer;return void 0!==this.booleanQuestion.valueTrue&&this.booleanQuestion.valueTrue===e||e?this.booleanQuestion.locLabelTrue.textOrHtml:void 0!==this.booleanQuestion.valueFalse&&this.booleanQuestion.valueFalse===e||!e?this.booleanQuestion.locLabelFalse.textOrHtml:e},Object.defineProperty(t.prototype,"booleanQuestion",{get:function(){return this.question},enumerable:!1,configurable:!0}),t.prototype.getSelectedItemByText=function(e){var t=this.getLabels(),i=this.getValues();return new n.ItemValue(i[t.indexOf(e)],e)},t.prototype.getValues=function(){var e=[void 0===this.booleanQuestion.valueTrue||this.booleanQuestion.valueTrue,void 0!==this.booleanQuestion.valueFalse&&this.booleanQuestion.valueFalse];return this.showMissingAnswers&&e.push(void 0),e},t.prototype.getLabels=function(){var e=[].concat(this.getValues());return void 0!==this.booleanQuestion.labelTrue&&(e[0]=this.booleanQuestion.locLabelTrue.textOrHtml),void 0!==this.booleanQuestion.labelFalse&&(e[1]=this.booleanQuestion.locLabelFalse.textOrHtml),this.showMissingAnswers&&(e[2]=r.a.getString("missingAnswersLabel")),e},t.trueColor="",t.falseColor="",t}(f),_=function(e){function t(t,i,r,n){var s=e.call(this,t,i,r,n||"histogram")||this;return s.valueType="number",s._cachedValues=void 0,s._continiousData=void 0,s._cachedIntervals=void 0,s._intervalPrecision=2,void 0!==s.options.intervalPrecision&&(s._intervalPrecision=s.options.intervalPrecision),"text"!==t.getType()||"date"!==t.inputType&&"datetime"!==t.inputType?s.valueType="number":s.valueType="date",s}return Object(o.c)(t,e),t.prototype.reset=function(){this._continiousData=void 0,this._cachedValues=void 0,this._cachedIntervals=void 0},t.prototype.getContiniousValue=function(e){return"date"===this.valueType?Date.parse(e):parseFloat(e)},t.prototype.getString=function(e){return"date"===this.valueType?new Date(e).toLocaleDateString():""+e},t.prototype.toPrecision=function(e){var t=Math.pow(10,this._intervalPrecision);return Math.round(t*e)/t},t.prototype.getSelectedItemByText=function(e){if(this.hasCustomIntervals||this.getContiniousValues().length>t.UseIntervalsFrom){var i=this.intervals.filter((function(t){return t.label===e}))[0];return new n.ItemValue(i,void 0!==i?i.label:"")}var r=this.getLabels(),s=r.indexOf(e);return new n.ItemValue(this.getValues()[s],r[s])},t.prototype.updateData=function(t){this.reset(),e.prototype.updateData.call(this,t)},t.prototype.onDataChanged=function(){this.reset(),e.prototype.onDataChanged.call(this)},t.prototype.getContiniousValues=function(){var e=this;if(void 0===this._cachedValues){var t=this.getSeriesValues();0===t.length&&t.push(""),this._continiousData={},t.forEach((function(t){return e._continiousData[t]=[]}));var i={};this.data.forEach((function(t){var r=t[e.name];if(void 0!==r){var n=t[s.seriesMarkerKey]||"";e._continiousData[n].push(e.getContiniousValue(r)),i[r]=r}})),this._cachedValues=Object.keys(i).map((function(t){return{original:i[t],continious:e.getContiniousValue(t)}})),this._cachedValues.sort((function(e,t){return e.continious-t.continious}))}return this._cachedValues},t.prototype.isSupportMissingAnswers=function(){return!1},Object.defineProperty(t.prototype,"needUseRateValues",{get:function(){return"rating"==this.question.getType()&&Array.isArray(this.question.rateValues)&&this.question.rateValues.length>0},enumerable:!1,configurable:!0}),t.prototype.getValues=function(){return this.intervals.map((function(e){return e.start}))},t.prototype.getLabels=function(){return this.intervals.map((function(e){return e.label}))},Object.defineProperty(t.prototype,"hasCustomIntervals",{get:function(){return!!this.questionOptions&&Array.isArray(this.questionOptions.intervals)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"intervals",{get:function(){if(this.hasCustomIntervals)return this.questionOptions.intervals;if("rating"==this.question.getType()){if(this.needUseRateValues){var e=this.question.rateValues;return e.map((function(t,i){return{start:t.value,end:i<e.length-1?e[i+1].value:t.value+1,label:t.text}}))}for(var i=[],r=this.question.rateMin||0;r<=(this.question.rateMax||t.IntervalsCount-1);r+=this.question.rateStep||1)i.push({start:r,end:r+1,label:""+(this.question.rateMin&&this.question.rateMax?r:r+"-"+(r+1))});return i}if(void 0===this._cachedIntervals){var n=this.getContiniousValues();if(this._cachedIntervals=[],n.length){var s=n[0].continious,o=n[n.length-1].continious,a=t.IntervalsCount,l=(o-s)/a;for(r=0;r<a;++r){var u=s+l,h=this.toPrecision(s),c=this.toPrecision(u);this._cachedIntervals.push({start:h,end:r<a-1?c:c+l/100,label:this.getString(h)+"-"+this.getString(c)}),s=u}}}return this._cachedIntervals},enumerable:!1,configurable:!0}),t.prototype.convertFromExternalData=function(e){return[e]},t.prototype.getCalculatedValuesCore=function(){this.getContiniousValues();var e=this.intervals,t=[],i=this.getSeriesValues();0===i.length&&i.push("");for(var r=0;r<i.length;++r)t.push(e.map((function(e){return 0}))),this._continiousData[i[r]].forEach((function(i){for(var n=0;n<e.length;++n)if(e[n].start<=i&&(i<e[n].end||n==e.length-1)){t[r][n]++;break}}));return t},t.IntervalsCount=10,t.UseIntervalsFrom=10,t}(f),v=function(e){function t(t,i,s,o){var l=e.call(this,i,s,o)||this;if(l.visualizers=t,l.visualizersWithSelection=[],l.onAfterVisualizerRenderCallback=function(){l.afterRender(l.contentContainer)},l.onVisualizerStateChangedCallback=function(e,t){l.stateChanged("visualizer",t)},l.onVisualizerChanged=new n.Event,l.loadingData=!1,!t||t.length<2)throw new Error("VisualizerArrayWrapper works with visualizers collection only.");return l.visualizers.forEach((function(e){e.onUpdate=function(){return l.invokeOnUpdate()},e.supportSelection&&(l._supportSelection=!0,l.visualizersWithSelection.push(e))})),l.registerToolbarItem("changeVisualizer",(function(){return l.visualizerSelector=a.b.createSelector(l.visualizers.map((function(e){return{value:e.type,text:r.a.getString("visualizer_"+e.type)}})),(function(e){return l.visualizer.type===e.value}),(function(e){return l.setVisualizer(e.target.value)}))})),l.visualizer=t[0],l.visualizer.onAfterRender.add(l.onAfterVisualizerRenderCallback),l.visualizer.onStateChanged.add(l.onVisualizerStateChangedCallback),l}return Object(o.c)(t,e),t.prototype.updateVisualizerSelector=function(){this.visualizerSelector&&(this.visualizerSelector.getElementsByTagName("select")[0].value=this.visualizer.type)},Object.defineProperty(t.prototype,"hasFooter",{get:function(){return!1},enumerable:!1,configurable:!0}),t.prototype.getVisualizers=function(){return this.visualizers},t.prototype.setVisualizer=function(e,t){void 0===t&&(t=!1);var i=this.visualizers.filter((function(t){return t.type===e}))[0];i&&i!==this.visualizer&&(this.visualizer&&(this.visualizer.onStateChanged.remove(this.onVisualizerStateChangedCallback),this.visualizer.onAfterRender.remove(this.onAfterVisualizerRenderCallback),this.visualizer.destroy()),this.visualizer=i,this.refresh(),this.visualizer.onAfterRender.add(this.onAfterVisualizerRenderCallback),this.visualizer.onStateChanged.add(this.onVisualizerStateChangedCallback),t||(this.onVisualizerChanged.fire(this,{visualizer:this.visualizer}),this.stateChanged("visualizer",e)),this.updateVisualizerSelector())},t.prototype.updateData=function(t){e.prototype.updateData.call(this,t),this.visualizers.forEach((function(e){e.updateData(t)}))},Object.defineProperty(t.prototype,"onDataItemSelected",{set:function(e){this.visualizersWithSelection.forEach((function(t){t.onDataItemSelected=e}))},enumerable:!1,configurable:!0}),t.prototype.setSelection=function(e){this.visualizersWithSelection.forEach((function(t){t.setSelection(e)}))},Object.defineProperty(t.prototype,"selection",{get:function(){return this.visualizer.selection||this.selectedItem},enumerable:!1,configurable:!0}),t.prototype.renderContent=function(e){this.visualizerContainer=e,this.visualizer.render(this.visualizerContainer)},t.prototype.setBackgroundColorCore=function(t){e.prototype.setBackgroundColorCore.call(this,t),this.visualizers.forEach((function(e){return e.backgroundColor=t}))},t.prototype.getState=function(){var e=this.visualizer.getState(),t={visualizer:this.visualizer.type};return Object.keys(e).length>0&&(t.state=e),t},t.prototype.setState=function(e){e.visualizer&&this.setVisualizer(e.visualizer,!0),e.state&&this.visualizer.setState(e.state)},t.prototype.destroy=function(){var t=this;this.visualizers.forEach((function(e){e.onAfterRender.remove(t.onAfterVisualizerRenderCallback),e.onStateChanged.remove(t.onVisualizerStateChangedCallback),e.onUpdate=void 0})),this.visualizer.destroy(),e.prototype.destroy.call(this)},t}(l);h.registerAltVisualizerSelector(v);var y=function(){function e(e){this._htmlElement=void 0,this.text=void 0,this._htmlElement=a.b.createElement("div","sa-question__filter"),this.text=a.b.createElement("span","sa-question__filter-text"),this._htmlElement.appendChild(this.text);var t=a.b.createButton((function(){e.setSelection(void 0)}),r.a.getString("clearButton"));this._htmlElement.appendChild(t)}return Object.defineProperty(e.prototype,"htmlElement",{get:function(){return this._htmlElement},enumerable:!1,configurable:!0}),e.prototype.update=function(e){void 0!==e&&void 0!==e.value?(this._htmlElement.style.display="inline-flex",this.text.innerText=r.a.getString("filter")+": ["+e.text+"]"):(this._htmlElement.style.display="none",this.text.innerText="")},e}(),b=i(28),w=function(e){function t(t,i,r){void 0===r&&(r=!0);var n=e.call(this,t)||this;return n._selector=i,n.dragEnabled=r,n._muuri=void 0,n._layoutingTimer=void 0,n}return Object(o.c)(t,e),t.prototype.startCore=function(e){var t=this;this._muuri=new b(e,{dragStartPredicate:{handle:".sa-question__title--draggable"},items:this._selector,dragEnabled:this.dragEnabled}),this._muuri.on("dragReleaseEnd",(function(e){var i=e.getGrid().getItems().map((function(e){return e.getElement().dataset.question}));t.onMoveCallback&&t.onMoveCallback(i)}))},t.prototype.stopCore=function(){this._muuri.off("dragReleaseEnd"),this._muuri.destroy(),this._muuri=void 0},t.prototype.updateCore=function(){var e=this;void 0!==this._layoutingTimer&&clearTimeout(this._layoutingTimer),this._layoutingTimer=setTimeout((function(){e._layoutingTimer=void 0,e._muuri.refreshItems(),e._muuri.layout()}),10)},t.prototype.add=function(e,t){this._allowed&&this._muuri.add(e,t)},t.prototype.remove=function(e,t){this._allowed&&this._muuri.remove(e,t)},t}(function(){function e(e){this._allowed=e}return e.prototype.startCore=function(e){},e.prototype.stopCore=function(){},e.prototype.updateCore=function(){},Object.defineProperty(e.prototype,"allowed",{get:function(){return this._allowed},enumerable:!1,configurable:!0}),e.prototype.start=function(e){this._allowed&&this.startCore(e)},e.prototype.stop=function(){this._allowed&&this.stopCore()},e.prototype.update=function(){this._allowed&&this.updateCore()},e.prototype.add=function(e,t){},e.prototype.remove=function(e,t){},e.prototype.destroy=function(){this.stop()},e}());i(29);if(document){var C=i(20),T=document.createElement("div");T.style.display="none",T.innerHTML=C,document.head.appendChild(T)}var P=function(e){function t(i,s,o,l){void 0===o&&(o={}),void 0===l&&(l=void 0);var u=e.call(this,null,s,o,"panel")||this;u.questions=i,u._elements=l,u.visualizers=[],u.haveCommercialLicense=!1,u.renderedQuestionsCount=0,u.onAfterRenderQuestionCallback=function(e,t){u.renderedQuestionsCount++,u.renderedQuestionsCount==u.questions.length&&(u.renderedQuestionsCount=0,u.layoutEngine.update(),u.afterRender(u.contentContainer))},u.onStateChangedCallback=function(e,t){var i;u.stateChanged(null===(i=e.question)||void 0===i?void 0:i.name,t)},u.onAlternativeVisualizerChanged=new n.Event,u.onAlternativeVisualizerChangedCallback=function(e,t){u.onAlternativeVisualizerChanged.fire(e,t)},u.onVisibleElementsChanged=new n.Event,u.onElementShown=new n.Event,u.onElementHidden=new n.Event,u.onElementMoved=new n.Event,u.loadingData=!1;var h=n.hasLicense;if(u.haveCommercialLicense=!!h&&h(4)||t.haveCommercialLicense||void 0!==o.haveCommercialLicense&&o.haveCommercialLicense,u._layoutEngine=o.layoutEngine||new w(u.allowDynamicLayout,".sa-question-layouted",u.allowDragDrop),u._layoutEngine.onMoveCallback=function(e){return u.reorderVisibleElements(e)},u.showToolbar=!0,u.options.survey&&(r.a.currentLocale=u.options.survey.locale),void 0===l&&(u._elements=u.buildElements(i)),u.buildVisualizers(i),u.haveCommercialLicense||u.registerToolbarItem("commercialLicense",(function(){return Object(a.c)()})),u.registerToolbarItem("resetFilter",(function(){return a.b.createButton((function(){u.visualizers.forEach((function(e){(e instanceof f||e instanceof v)&&e.setSelection(void 0)}))}),r.a.getString("resetFilter"))})),u.registerToolbarItem("addElement",(function(e){if(u.allowHideQuestions){var t=void 0,i=function(i,n){var s=u.hiddenElements;if(s.length>0){var o=a.b.createSelector([{name:void 0,displayName:r.a.getString("addElement")}].concat(s).map((function(e){return{value:e.name,text:e.displayName}})),(function(e){return!1}),(function(e){u.showElement(e.target.value)}));t&&e.replaceChild(o,t)||e.appendChild(o),t=o}else t&&e.removeChild(t),t=void 0};i(),u.onVisibleElementsChanged.add(i)}})),!u.options.disableLocaleSwitch&&u.locales.length>1){var c=u.locales.map((function(e){return{value:e,text:r.a.localeNames[e]||r.a.getString(e)||e}}));u.registerToolbarItem("changeLocale",(function(){return a.b.createSelector(c,(function(e){return!!e.value&&(u.locale||n.surveyLocalization.defaultLocale)===e.value}),(function(e){var t=e.target.value;u.locale=t}))}))}return u}return Object(o.c)(t,e),t.prototype.reorderVisibleElements=function(e){var t=this,i=[];e.forEach((function(e){i.push(t._elements.filter((function(t){return t.name===e}))[0])})),this._elements=i,this.visibleElementsChanged(void 0,"REORDERED")},t.prototype.showElementCore=function(e,t){void 0===t&&(t=-1),e.isVisible=!0;var i=this.renderPanelElement(e,this.contentContainer),r=void 0;t>=0&&(r={index:t}),this.layoutEngine.add([i],r)},t.prototype.showElement=function(e){var t=this.getElement(e),i=this._elements.indexOf(t);this.showElementCore(t,i),this.visibleElementsChanged(t,"ADDED")},t.prototype.hideElementCore=function(e){e.isVisible=!1,e.renderedElement&&(this.layoutEngine.remove([e.renderedElement]),this.contentContainer.removeChild(e.renderedElement),e.renderedElement=void 0)},t.prototype.hideElement=function(e){var t=this.getElement(e);this.hideElementCore(t),this.visibleElementsChanged(t,"REMOVED")},t.prototype.hideAllElements=function(){var e=this,t=[];this._elements.forEach((function(i){i.isVisible&&(e.hideElementCore(i),t.push(i))})),this.visibleElementsChanged(void 0,"REMOVEDALL")},t.prototype.showAllElements=function(){var e=this,t=[];this._elements.forEach((function(i){i.isVisible||(e.showElementCore(i),t.push(i))})),this.visibleElementsChanged(void 0,"ADDEDDALL")},t.prototype.makeElementPrivate=function(e){e.isPublic=!1,this.stateChanged("isPublic",!1),this.onPermissionsChangedCallback&&this.onPermissionsChangedCallback(this)},t.prototype.makeElementPublic=function(e){e.isPublic=!0,this.stateChanged("isPublic",!0),this.onPermissionsChangedCallback&&this.onPermissionsChangedCallback(this)},t.prototype.moveVisibleElement=function(e,t){var i,r,n=this.visibleElements[e],s=this.visibleElements[t];i=this._elements.indexOf(n),r=this._elements.indexOf(s),this.moveElement(i,r)},t.prototype.moveElement=function(e,t){var i=this._elements.splice(e,1);this._elements.splice(t,0,i[0]),this.visibleElementsChanged(i[0],"MOVED")},t.prototype.setBackgroundColorCore=function(t){e.prototype.setBackgroundColorCore.call(this,t),this.visualizers.forEach((function(e){return e.backgroundColor=t}))},t.prototype.buildVisualizers=function(e){var t=this;e.forEach((function(e){var i=t.createVisualizer(e);if(i){if(t.allowHideQuestions&&i.registerToolbarItem("removeQuestion",(function(){return a.b.createButton((function(){setTimeout((function(){return t.hideElement(e.name)}),0)}),r.a.getString("hideButton"))})),t.allowMakeQuestionsPrivate&&i.registerToolbarItem("makePrivatePublic",(function(){var i=t.getElement(e.name),n=i.isPublic?"first":"second",s=r.a.getString("makePrivateButton"),o=r.a.getString("makePublicButton");return a.b.createSvgToggleButton("makepublic","makeprivate",s,o,(function(e){setTimeout((function(){return t.makeElementPublic(i)}),0)}),(function(e){setTimeout((function(){return t.makeElementPrivate(i)}),0)}),n)})),i.supportSelection){var n=i,s=new y(n);i.registerToolbarItem("questionFilterInfo",(function(){return s.update(n.selection),s.htmlElement})),n.onDataItemSelected=function(i,r){s.update({value:i,text:r}),t.setFilter(e.name,i)}}i.onUpdate=function(){return t.layout()},i.onAfterRender.add(t.onAfterRenderQuestionCallback),i.onStateChanged.add(t.onStateChangedCallback),i instanceof v&&i.onVisualizerChanged.add(t.onAlternativeVisualizerChangedCallback),t.visualizers.push(i)}}))},t.prototype.destroyVisualizers=function(){var e=this;this.visualizers.forEach((function(t){t.onUpdate=void 0,t instanceof f&&(t.onDataItemSelected=void 0),t instanceof v&&t.onVisualizerChanged.remove(e.onAlternativeVisualizerChangedCallback),t.onStateChanged.remove(e.onStateChangedCallback),t.onAfterRender.remove(e.onAfterRenderQuestionCallback),t.destroy()})),this.visualizers=[]},t.prototype.setLocale=function(t){var i=this;e.prototype.setLocale.call(this,t),(this.questions||[]).forEach((function(e){var t=i.getElement(e.name);t&&(t.displayName=i.processText(e.title))})),this.visualizers.forEach((function(e){e.options.seriesLabels=i.options.seriesLabels,e.locale=t})),this.stateChanged("locale",t)},Object.defineProperty(t.prototype,"allowDynamicLayout",{get:function(){return void 0===this.options.allowDynamicLayout||!0===this.options.allowDynamicLayout},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"allowDragDrop",{get:function(){return!n.IsTouch&&(void 0===this.options.allowDragDrop||!0===this.options.allowDragDrop)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"allowHideQuestions",{get:function(){return void 0===this.options.allowHideQuestions||!0===this.options.allowHideQuestions},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"allowMakeQuestionsPrivate",{get:function(){return!0===this.options.allowMakeQuestionsPrivate},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"layoutEngine",{get:function(){return this._layoutEngine},enumerable:!1,configurable:!0}),t.prototype.buildElements=function(e){var t=this;return(e||[]).map((function(e){return{name:e.name,displayName:t.processText(e.title),isVisible:!0,isPublic:!0}}))},t.prototype.getElements=function(e){var t=[];return(this._elements||[]).forEach((function(i){e&&-1===e.indexOf(i.name)||t.push({name:i.name,displayName:i.displayName,isVisible:i.isVisible,isPublic:i.isPublic})})),t},Object.defineProperty(t.prototype,"visibleElements",{get:function(){return this._elements.filter((function(e){return e.isVisible}))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hiddenElements",{get:function(){return this._elements.filter((function(e){return!e.isVisible}))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"publicElements",{get:function(){return this._elements.filter((function(e){return e.isPublic}))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"privateElements",{get:function(){return this._elements.filter((function(e){return!e.isPublic}))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"locales",{get:function(){return this.options.survey?this.options.survey.getUsedLocales():[]},enumerable:!1,configurable:!0}),t.prototype.getElement=function(e){return this._elements.filter((function(t){return t.name===e}))[0]},t.prototype.getVisualizer=function(e){return this.visualizers.filter((function(t){return t.question.name===e}))[0]},t.prototype.visibleElementsChanged=function(e,t){"SHOWN"!==t||this.onElementShown.isEmpty||this.onElementShown.fire(this,{elements:this._elements,element:e}),"REMOVED"!==t||this.onElementHidden.isEmpty||this.onElementHidden.fire(this,{elements:this._elements,element:e}),"MOVED"!==t||this.onElementMoved.isEmpty||this.onElementMoved.fire(this,{elements:this._elements,element:e}),this.onVisibleElementsChanged.isEmpty||this.onVisibleElementsChanged.fire(this,{elements:this._elements,changed:e,reason:t}),this.stateChanged("visibleElements",t),this.layout()},t.prototype.renderPanelElement=function(e,t){var i=this.getVisualizer(e.name);if(i){var r=a.b.createElement("div");r.dataset.question=e.name,t&&t.appendChild(r);var n=a.b.createElement("div"),s=a.b.createElement("h3"),o=a.b.createElement("div");return s.innerText=e.displayName,r.className=this.allowDynamicLayout?"sa-question sa-question-layouted":"sa-question",s.className="sa-question__title",this.allowDynamicLayout&&this.allowDragDrop&&(s.className=s.className+" sa-question__title--draggable"),n.className="sa-question__content",n.style.backgroundColor=this.backgroundColor,n.appendChild(s),n.appendChild(o),r.appendChild(n),i.render(o),e.renderedElement=r,r}},t.prototype.renderToolbar=function(t){t.className+=" sa-panel__header",e.prototype.renderToolbar.call(this,t)},t.prototype.renderContent=function(e){var t=this;e.className+=" sa-panel__content sa-grid",this.visibleElements.forEach((function(i){t.renderPanelElement(i,e)})),this.layoutEngine.start(e)},t.prototype.destroyContent=function(t){this.layoutEngine.stop(),e.prototype.destroyContent.call(this,t)},t.prototype.refresh=function(){this.toolbarContainer&&(this.destroyToolbar(this.toolbarContainer),this.renderToolbar(this.toolbarContainer)),e.prototype.refresh.call(this)},t.prototype.layout=function(){this.layoutEngine.update()},t.prototype.setFilter=function(e,t){this.dataProvider.setFilter(e,t)},t.prototype.getState=function(){var e=this;return{locale:this.locale,elements:[].concat(this._elements.map((function(t){var i=e.getVisualizer(t.name),r=Object(o.a)(Object(o.a)({},t),null==i?void 0:i.getState());return void 0!==r.renderedElement&&delete r.renderedElement,r})))}},Object.defineProperty(t.prototype,"state",{get:function(){return this.getState()},set:function(e){var t=this;if(e){this._settingState=!0;try{if(Array.isArray(e.elements)){var i=this.questions.map((function(e){return e.name}));this._elements=[].concat(e.elements.filter((function(e){return-1!==i.indexOf(e.name)})))}void 0!==e.locale&&this.setLocale(e.locale),this._elements.forEach((function(e){var i=t.getVisualizer(e.name);void 0!==i&&i.setState(e)}))}finally{this._settingState=!1}this.refresh()}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"permissions",{get:function(){return this._elements.map((function(e){return{name:e.name,isPublic:e.isPublic}}))},set:function(e){var t=this._elements.map((function(t){return e.forEach((function(e){e.name===t.name&&(t.isPublic=e.isPublic)})),Object(o.a)({},t)}));this._elements=[].concat(t),this.refresh(),this.onPermissionsChangedCallback&&this.onPermissionsChangedCallback(this)},enumerable:!1,configurable:!0}),t.prototype.destroy=function(){e.prototype.destroy.call(this),this.destroyVisualizers()},t.haveCommercialLicense=!1,t}(l),A=function(e){function t(t,i,r,n){void 0===r&&(r={});var s=e.call(this,t,i,r,n||"panelDynamic")||this;return s._panelVisualizer=void 0,s.onAfterRenderPanelCallback=function(){s.afterRender(s.contentContainer)},s.loadingData=!1,(r=Object.assign({},r)).allowDynamicLayout=!1,r.dataProvider=void 0,s._panelVisualizer=new P(s.getQuestions(),[],r),s._panelVisualizer.onAfterRender.add(s.onAfterRenderPanelCallback),s.updateData(i),s}return Object(o.c)(t,e),t.prototype.setLocale=function(t){e.prototype.setLocale.call(this,t),this._panelVisualizer.locale=t},Object.defineProperty(t.prototype,"type",{get:function(){return"panelDynamic"},enumerable:!1,configurable:!0}),t.prototype.updatePanelVisualizerData=function(){var e=this,t=[];this.data.forEach((function(i){void 0!==i[e.question.name]&&(t=t.concat(i[e.question.name]))})),this._panelVisualizer.updateData(t)},t.prototype.updateData=function(t){e.prototype.updateData.call(this,t),this.updatePanelVisualizerData()},t.prototype.onDataChanged=function(){this.updatePanelVisualizerData(),e.prototype.onDataChanged.call(this)},t.prototype.getQuestions=function(){return this.question.template.questions},t.prototype.destroyContent=function(t){this._panelVisualizer.clear(),e.prototype.destroyContent.call(this,this.contentContainer)},t.prototype.renderContent=function(e){this._panelVisualizer.render(e)},t.prototype.destroy=function(){e.prototype.destroy.call(this),this._panelVisualizer.onAfterRender.remove(this.onAfterRenderPanelCallback)},t}(l);h.registerVisualizer("paneldynamic",A);var S=function(e){function t(t,i,r){return e.call(this,t,i,r)||this}return Object(o.c)(t,e),Object.defineProperty(t.prototype,"type",{get:function(){return"matrixDynamic"},enumerable:!1,configurable:!0}),t.prototype.getQuestions=function(){var e=this.question.visibleRows;return 0===e.length?[]:e[0].cells.map((function(e){return e.question}))},t}(A);h.registerVisualizer("matrixdynamic",S);var E=function(e){function t(t,i,r,s){void 0===r&&(r={});var o=e.call(this,t,i,r,s||"matrixDropdown")||this;o._matrixDropdownVisualizer=void 0,o.onPanelAfterRenderCallback=function(){o.afterRender(o.contentContainer)},o.loadingData=!1,o._childOptions=Object.assign({},r),o._childOptions.disableLocaleSwitch=!0,o._childOptions.dataProvider=void 0,o._childOptions.allowDynamicLayout=!1,o._childOptions.seriesValues=t.rows.map((function(e){return e.value})),o._childOptions.seriesLabels=t.rows.map((function(e){return e.text}));var a=o.getQuestions();if(1==o._childOptions.seriesValues.length&&a.every((function(e){return n.Helpers.isArraysEqual(e.choices,o.question.choices)}))){var l=h.getVisualizersByType("matrixdropdown-grouped");o._matrixDropdownVisualizer=new l[0](o.question,[],o._childOptions)}else o._matrixDropdownVisualizer=new P(a,[],o._childOptions);return o._matrixDropdownVisualizer.onAfterRender.add(o.onPanelAfterRenderCallback),o.updateData(i),o}return Object(o.c)(t,e),t.prototype.setLocale=function(t){e.prototype.setLocale.call(this,t),this._childOptions.seriesLabels=this.question.rows.map((function(e){return e.text})),this._matrixDropdownVisualizer.locale=t},Object.defineProperty(t.prototype,"matrixDropdownVisualizer",{get:function(){return this._matrixDropdownVisualizer},enumerable:!1,configurable:!0}),t.prototype.updateDropdownVisualizerData=function(){var e=this,t=[];this.data.forEach((function(i){var r=i[e.question.name];r&&Object.keys(r).forEach((function(e){var i=Object.assign({},r[e]);i[s.seriesMarkerKey]=e,t.push(i)}))})),this._matrixDropdownVisualizer.updateData(t)},t.prototype.updateData=function(t){e.prototype.updateData.call(this,t),this.updateDropdownVisualizerData()},t.prototype.onDataChanged=function(){this.updateDropdownVisualizerData(),e.prototype.onDataChanged.call(this)},t.prototype.getQuestions=function(){var e=this.question;return e.columns.map((function(t){var i=t.templateQuestion;return Array.isArray(i.choices)&&0===i.choices.length&&(i.choices=e.choices),i}))},t.prototype.destroyContent=function(t){this._matrixDropdownVisualizer.clear(),e.prototype.destroyContent.call(this,this.contentContainer)},t.prototype.renderContent=function(e){this._matrixDropdownVisualizer.render(e)},t.prototype.destroy=function(){e.prototype.destroy.call(this),this._matrixDropdownVisualizer.onAfterRender.remove(this.onPanelAfterRenderCallback)},t}(l);h.registerVisualizer("matrixdropdown",E);var x=function(){function e(){}return e.setup=function(e,t,i){return this.setups[e](t,i)},e.setupPie=function(t,i){var r=i.datasets,n=i.labels,s=i.colors,o=(i.texts,i.seriesLabels),a=[],l=o.length>1||"matrix"===t.question.getType(),u={type:t.chartType,y:l?o:n,text:(l?o:n).map((function(i){return e.getTruncatedLabel(i,t.labelTruncateLength)})),hoverinfo:"x+y",mode:"markers",marker:{}};u.hoverinfo="label+value+percent",u.marker.colors=s,u.textposition="inside","doughnut"===t.chartType&&(u.type="pie",u.hole=.4),l||(u.marker.symbol="circle",u.marker.size=16),r.forEach((function(e,t){a.push(Object.assign({},u,{values:e,labels:l?o:n,customdata:l?o:n}))}));var h=n.length<10?50*n.length+100:550,c={font:{family:"Segoe UI, sans-serif",size:14,weight:"normal",color:"#404040"},height:h*Math.round(a.length/2)+25,margin:{l:0,t:25,b:0,r:10},colorway:s,hovermode:"closest",plot_bgcolor:t.backgroundColor,paper_bgcolor:t.backgroundColor,showlegend:!1};return l&&(c.annotations=[],n.forEach((function(e,t){a[t].title={position:"bottom center",text:e}})),(a=a.filter((function(e){return!(1===e.values.length&&0===e.values[0])}))).forEach((function(e,t){a[t].domain={column:t%2,row:Math.floor(t/2)}})),c.grid={rows:Math.round(a.length/2),columns:2},c.height=h*Math.round(a.length/2)+25),{traces:a,layout:c,hasSeries:l}},e.setupBar=function(t,i){var r=i.datasets,n=i.labels,s=i.colors,o=i.texts,a=i.seriesLabels,l=[],u=a.length>1||"matrix"===t.question.getType(),h=u?a:n,c={type:t.chartType,y:h,text:h,customdata:u?a:n,hoverinfo:"text",orientation:"h",mode:"markers",textposition:"none",width:.5,bargap:.5,marker:{}};c.marker.color=s,r.forEach((function(e,i){var r=Object.assign({},c,{x:e,text:o[i],hovertext:h.map((function(e,t){return"".concat(o[i][t],", ").concat(e)}))});if(t.showPercentages){var n=t.showOnlyPercentages?"%{text}%":"%{value} (%{text}%)";r.textposition="inside",r.texttemplate=n,r.bargap=.1}l.push(r)}));var d={font:{family:"Segoe UI, sans-serif",size:14,weight:"normal",color:"#404040"},height:30*(n.length+1)+30+30,margin:{t:30,b:30,r:10},colorway:s,hovermode:"closest",yaxis:{automargin:!0,type:"category",orientation:"h",tickmode:"array",tickvals:h,ticktext:h.map((function(i){return e.getTruncatedLabel(i,t.labelTruncateLength)+" "}))},xaxis:{rangemode:"nonnegative",automargin:!0},plot_bgcolor:t.backgroundColor,paper_bgcolor:t.backgroundColor,showlegend:!1};return u&&(d.showlegend=!0,"stackedbar"==t.chartType?d.barmode="stack":d.height=30*(n.length+1)*a.length+30+30,n.forEach((function(e,i){l[i].marker.color=void 0,l[i].name=e,"stackedbar"===t.chartType?(l[i].type="bar",l[i].width=.5):l[i].width=(t.showPercentages?.7:.5)/l.length})),l.forEach((function(e,i){var r=t.showPercentages?"%":"";l[i].hovertext=[],h.forEach((function(t,n){l[i].hovertext.push("".concat(e.y[n]," : ").concat(e.name,", ").concat(e.text[n]).concat(r))}))}))),{traces:l,layout:d,hasSeries:u}},e.setupVBar=function(e,t){var i=t.datasets,r=t.labels,n=t.colors,s=t.texts,o=t.seriesLabels,a=[],l=o.length>1||"matrix"===e.question.getType(),u={font:{family:"Segoe UI, sans-serif",size:14,weight:"normal",color:"#404040"},margin:{t:30,b:30,r:10},colorway:n,hovermode:"closest",plot_bgcolor:e.backgroundColor,paper_bgcolor:e.backgroundColor,showlegend:!1},h={type:"bar",customdata:l?o:r,hoverinfo:"x+y",mode:"markers",textposition:"none",width:.5,bargap:.5,marker:{}};return h.marker.color=n,i.forEach((function(t,i){var n=Object.assign({},h,{x:r,y:e.showPercentages?s[i].map((function(e){return e/100})):t,text:s[i]});if(e.showPercentages){var o=e.showOnlyPercentages?"%{text}%":"%{value} (%{text}%)";n.textposition="inside",n.texttemplate=o,n.width=.9,n.bargap=.1}a.push(n)})),e.showPercentages&&e.showOnlyPercentages&&(u.yaxis={automargin:!0,tickformat:".0%",range:[0,1],ticklen:e.showOnlyPercentages?25:5,tickcolor:"transparent"}),e.getValueType&&"date"==e.getValueType()||(u.xaxis={type:"category"}),{traces:a,layout:u,hasSeries:l}},e.setupScatter=function(t,i){var r=i.datasets,n=i.labels,s=i.colors,o=(i.texts,i.seriesLabels),a=o.length>1||"matrix"===t.question.getType(),l=[],u={type:"scatter",y:(a?o:n).map((function(i){return e.getTruncatedLabel(i,t.labelTruncateLength)})),customdata:a?o:n,text:a?o:n,hoverinfo:"x+y",orientation:"h",mode:"markers",width:.5,marker:{}};a||(u.marker.symbol="circle",u.marker.size=16),r.forEach((function(e){var t=Object.assign({},u,{x:e});l.push(t)}));var h={font:{family:"Segoe UI, sans-serif",size:14,weight:"normal",color:"#404040"},height:30*(n.length+1)+30+30,margin:{t:30,b:30,r:10},colorway:s,hovermode:"closest",yaxis:{automargin:!0,type:"category",ticklen:5,tickcolor:"transparent"},xaxis:{rangemode:"nonnegative",automargin:!0},plot_bgcolor:t.backgroundColor,paper_bgcolor:t.backgroundColor,showlegend:!1};return a&&(h.showlegend=!0,h.height=void 0,n.forEach((function(e,t){l[t].hoverinfo="x+name",l[t].marker.color=void 0,l[t].name=e}))),{traces:l,layout:h,hasSeries:a}},e.imageExportFormat="png",e.onImageSaving=new n.Event,e.onPlotCreating=new n.Event,e.setups={bar:e.setupBar,vbar:e.setupVBar,stackedbar:e.setupBar,doughnut:e.setupPie,pie:e.setupPie,scatter:e.setupScatter},e.getTruncatedLabel=function(e,t){var i="...".length;return t?-1===t||e.length<=t+i?e:e.substring(0,t)+"...":e},e}(),D=i(7),k=i.n(D),V=function(){function e(e){this.model=e,this._chart=void 0}return e.prototype.patchConfigParameters=function(e,t,i,r){},Object.defineProperty(e.prototype,"chart",{get:function(){return this._chart},enumerable:!1,configurable:!0}),e.prototype.create=function(e){return Object(o.b)(this,void 0,void 0,(function(){var t,i,s,a,l,u,h=this;return Object(o.d)(this,(function(o){switch(o.label){case 0:return[4,this.model.getAnswersData()];case 1:return t=o.sent(),i=x.setup(this.model.chartType,this.model,t),s={displaylogo:!1,responsive:!0,locale:r.a.currentLocale,modeBarButtonsToRemove:["toImage"],modeBarButtonsToAdd:[{name:"toImageSjs",title:r.a.getString("saveDiagramAsPNG"),icon:k.a.Icons.camera,click:function(e){var t={format:x.imageExportFormat,filename:h.model.question.name};x.onImageSaving.fire(h.model,t),k.a.downloadImage(e,t)}}]},void 0!==z.displayModeBar&&(s.displayModeBar=z.displayModeBar),this.patchConfigParameters(e,i.traces,i.layout,s),a={traces:i.traces,layout:i.layout,config:s},x.onPlotCreating.fire(this.model,a),l=k.a.newPlot(e,a.traces,a.layout,a.config),e.on("plotly_click",(function(e){var t;if(e.points.length>0){var r="";if(i.hasSeries){r=e.points[0].data.name;var s=e.points[0].label,o=h.model.getSeriesValues()[h.model.getSeriesLabels().indexOf(s)],a=h.model.getSelectedItemByText(r);l=new n.ItemValue(((t={})[o]=a.value,t),s+": "+a.text);h.model.setSelection(l)}else{r=Array.isArray(e.points[0].customdata)?e.points[0].customdata[0]:e.points[0].customdata;var l=h.model.getSelectedItemByText(r);h.model.setSelection(l)}}})),u=function(){return e.getElementsByClassName("nsewdrag")[0]},e.on("plotly_hover",(function(){var e=u();e&&(e.style.cursor="pointer")})),e.on("plotly_unhover",(function(){var e=u();e&&(e.style.cursor="")})),this._chart=l,[2,l]}}))}))},e.prototype.destroy=function(e){k.a.purge(e),this._chart=void 0},e}(),z=function(e){function t(i,r,n,s){void 0===n&&(n={});var o=e.call(this,i,r,n,s)||this;return o.chartTypes=[].concat(t.types),o.getSeriesValues().length>0&&-1===o.chartTypes.indexOf("stackedbar")&&o.chartTypes.push("stackedbar"),n.allowExperimentalFeatures&&o.chartTypes.splice(1,0,"vbar"),o._chartType=o.chartTypes[0],-1!==o.chartTypes.indexOf(n.defaultChartType)&&(o._chartType=n.defaultChartType),o._chartAdapter=new V(o),o}return Object(o.c)(t,e),t.prototype.destroyContent=function(t){this._chartAdapter.destroy(t.children[0]),e.prototype.destroyContent.call(this,t)},t.prototype.renderContentAsync=function(e){return Object(o.b)(this,void 0,void 0,(function(){var t;return Object(o.d)(this,(function(i){switch(i.label){case 0:return t=a.b.createElement("div"),[4,this._chartAdapter.create(t)];case 1:return i.sent(),e.innerHTML="",e.appendChild(t),[2,e]}}))}))},t.prototype.getCalculatedValuesCore=function(){var t=e.prototype.getCalculatedValuesCore.call(this),i=this.getSeriesValues(),r=this.getValues();if(i.length>1){var n=[];return r.forEach((function(e,r){var s=i.map((function(e,i){return t[i][r]}));n.push(s)})),n}return t},t.types=["bar","pie","doughnut","scatter"],t.displayModeBar=void 0,t}(f);h.registerVisualizer("checkbox",z),h.registerVisualizer("radiogroup",z),h.registerVisualizer("dropdown",z),h.registerVisualizer("imagepicker",z),h.registerVisualizer("tagbox",z);var O=function(e){function t(i,r,n,s){var o=e.call(this,i,r,n,s)||this;return o.chartTypes=t.types,o._chartType=o.chartTypes[0],o._chartAdapter=new V(o),o}return Object(o.c)(t,e),t.prototype.destroyContent=function(t){this._chartAdapter.destroy(t.children[0]),e.prototype.destroyContent.call(this,t)},t.prototype.renderContentAsync=function(e){return Object(o.b)(this,void 0,void 0,(function(){var t;return Object(o.d)(this,(function(i){switch(i.label){case 0:return t=a.b.createElement("div"),[4,this._chartAdapter.create(t)];case 1:return i.sent(),e.innerHTML="",e.appendChild(t),[2,e]}}))}))},t.types=["bar","stackedbar","pie","doughnut"],t}(m);h.registerVisualizer("matrix",O);var L=function(e){function t(t){return e.call(this,t)||this}return Object(o.c)(t,e),t.prototype.patchConfigParameters=function(e,t,i,r){var n=this.model.getColors(),s=[M.trueColor||n[0],M.falseColor||n[1]];this.model.showMissingAnswers&&s.push(n[2]),"pie"===this.model.chartType||"doughnut"===this.model.chartType?t.forEach((function(e){e.marker.colors=s})):"bar"===this.model.chartType&&t.forEach((function(e){e.marker.color=s}))},t}(V),M=function(e){function t(i,r,n,s){var o=e.call(this,i,r,n,s)||this;return o.chartTypes=t.types,o._chartType=o.chartTypes[0],o._chartAdapter=new L(o),o}return Object(o.c)(t,e),t.prototype.destroyContent=function(t){this._chartAdapter.destroy(t.children[0]),e.prototype.destroyContent.call(this,t)},t.prototype.renderContentAsync=function(e){return Object(o.b)(this,void 0,void 0,(function(){var t;return Object(o.d)(this,(function(i){switch(i.label){case 0:return t=a.b.createElement("div"),[4,this._chartAdapter.create(t)];case 1:return i.sent(),e.innerHTML="",e.appendChild(t),[2,e]}}))}))},t.types=["pie","bar","doughnut"],t}(g);h.registerVisualizer("boolean",M);var B=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(o.c)(t,e),t.prototype.getQuestionResults=function(){var e=this.question.name;return this.data.map((function(t){return t[e]}))},t.prototype.getEmptyData=function(){var e=this.getValues(),t=[];return t.length=e.length,t.fill(0),t},t.prototype.getCalculatedValuesCore=function(){var e=this,t=this.getQuestionResults(),i=this.getValues(),r=this.getEmptyData();return t.forEach((function(t){e.applyResultToPlotlyData(t,r,i)})),[r]},t.prototype.applyResultToPlotlyData=function(e,t,i){e&&t&&i&&e.forEach((function(e,r,n){var s=i.indexOf(e);t[s]=+t[s]+(n.length-r)}))},t}(z);h.registerVisualizer("ranking",B);var j=function(e){function t(i,r,n,s){var o=e.call(this,i,r,n,s)||this;return o.chartTypes=t.types,o._chartType=o.chartTypes[0],o._chartAdapter=new V(o),o}return Object(o.c)(t,e),t.prototype.destroyContent=function(t){this._chartAdapter.destroy(t.children[0]),e.prototype.destroyContent.call(this,t)},t.prototype.renderContentAsync=function(e){return Object(o.b)(this,void 0,void 0,(function(){var t;return Object(o.d)(this,(function(i){switch(i.label){case 0:return t=a.b.createElement("div"),[4,this._chartAdapter.create(t)];case 1:return i.sent(),e.innerHTML="",e.appendChild(t),[2,e]}}))}))},t.types=["stackedbar","bar","pie","doughnut"],t}(function(e){function t(t,i,r,n){return e.call(this,t,i,r,n||"matrixDropdownGrouped")||this}return Object(o.c)(t,e),Object.defineProperty(t.prototype,"matrixQuestion",{get:function(){return this.question},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dataNames",{get:function(){return this.matrixQuestion.columns.map((function(e){return e.name}))},enumerable:!1,configurable:!0}),t.prototype.getSeriesValues=function(){return this.matrixQuestion.columns.map((function(e){return e.name}))},t.prototype.getSeriesLabels=function(){return this.matrixQuestion.columns.map((function(e){return e.title}))},t.prototype.valuesSource=function(){return this.matrixQuestion.choices},t.prototype.isSupportMissingAnswers=function(){return!1},t.prototype.getCalculatedValuesCore=function(){var e=this.getValues(),t=this.getSeriesValues(),i=this.matrixQuestion.rows.map((function(e){return e.value})),r=u(this.surveyData,{name:this.name,dataNames:t,getValues:function(){return e},getLabels:function(){return e},getSeriesValues:function(){return i},getSeriesLabels:function(){return i}}),n=[];return e.forEach((function(e,i){var s=t.map((function(e,t){return r[t][0][i]}));n.push(s)})),n},t}(f));h.registerVisualizer("matrixdropdown-grouped",j);var R=function(e){function t(i,r,n,s){var o=e.call(this,i,r,n,s)||this;return o.chartTypes=t.types,o._chartType=o.chartTypes[0],o._chartAdapter=new V(o),o}return Object(o.c)(t,e),t.prototype.destroyContent=function(t){this._chartAdapter.destroy(t.children[0]),e.prototype.destroyContent.call(this,t)},t.prototype.renderContentAsync=function(e){return Object(o.b)(this,void 0,void 0,(function(){var t;return Object(o.d)(this,(function(i){switch(i.label){case 0:return t=a.b.createElement("div"),[4,this._chartAdapter.create(t)];case 1:return i.sent(),e.innerHTML="",e.appendChild(t),[2,e]}}))}))},t.prototype.getCalculatedValuesCore=function(){var t=e.prototype.getCalculatedValuesCore.call(this),i=this.getSeriesValues(),r=this.getValues();if(i.length>1){var n=[];return r.forEach((function(e,r){var s=i.map((function(e,i){return t[i][r]}));n.push(s)})),n}return t},t.prototype.getValueType=function(){return this.valueType},t.types=["vbar","bar","scatter"],t}(_);h.registerVisualizer("date",R),h.registerVisualizer("number",R),h.registerVisualizer("rating",R);var N=function(){function e(e){this.model=e,this._chart=void 0}return Object.defineProperty(e.prototype,"chart",{get:function(){return this._chart},enumerable:!1,configurable:!0}),e.prototype.create=function(e){return Object(o.b)(this,void 0,void 0,(function(){var t,i,n,s,l,u,h,c,d,p,f,m,g=this;return Object(o.d)(this,(function(o){switch(o.label){case 0:return t=this.model.question,[4,this.model.getCalculatedValues()];case 1:return i=o.sent(),n=i[0],s=i[1],l=i[2],"rating"===t.getType()&&(u=t.visibleRateValues,l=u[u.length-1].value,s=u[0].value),h=this.model.generateColors(l,s,I.stepsCount),I.showAsPercentage&&(n=a.a.toPercentage(n,l),s=a.a.toPercentage(s,l),l=a.a.toPercentage(l,l)),c=[{type:"indicator",mode:"gauge+number",gauge:{axis:{range:[s,l]},shape:this.model.chartType,bgcolor:"white",bar:{color:h[0]}},value:n,text:t.name,domain:{x:[0,1],y:[0,1]}}],d="bullet"===this.model.chartType?60:30,p={height:250,margin:{l:d,r:d,b:d,t:d,pad:5},plot_bgcolor:this.model.backgroundColor,paper_bgcolor:this.model.backgroundColor},f={displayModeBar:!0,locale:r.a.currentLocale,responsive:!0,displaylogo:!1,modeBarButtonsToRemove:["toImage"],modeBarButtonsToAdd:[{name:"toImageSjs",title:r.a.getString("saveDiagramAsPNG"),icon:k.a.Icons.camera,click:function(e){var t={format:x.imageExportFormat,filename:g.model.question.name};x.onImageSaving.fire(g.model,t),k.a.downloadImage(e,t)}}]},void 0!==I.displayModeBar&&(f.displayModeBar=I.displayModeBar),m={data:c,layout:p,config:f},x.onPlotCreating.fire(this.model,m),[2,k.a.newPlot(e,m.data,m.layout,m.config)]}}))}))},e.prototype.destroy=function(e){k.a.purge(e),this._chart=void 0},e}(),I=function(e){function t(i,r,n,s){var o=e.call(this,i,r,n,s)||this;return o.chartTypes=t.types,o.chartType=o.chartTypes[0],o._chartAdapter=new N(o),o}return Object(o.c)(t,e),t.prototype.destroyContent=function(t){this._chartAdapter.destroy(t.children[0]),e.prototype.destroyContent.call(this,t)},t.prototype.renderContentAsync=function(e){return Object(o.b)(this,void 0,void 0,(function(){var t;return Object(o.d)(this,(function(i){switch(i.label){case 0:return t=a.b.createElement("div"),[4,this._chartAdapter.create(t)];case 1:return i.sent(),e.innerHTML="",e.appendChild(t),[2,e]}}))}))},t.displayModeBar=void 0,t.types=["gauge","bullet"],t}(d);h.registerVisualizer("number",I),h.registerVisualizer("rating",I),h.registerVisualizer("expression",I);var q={en:["...","a","about","above","across","after","again","against","all","almost","alone","along","already","also","although","always","among","an","and","another","any","anybody","anyone","anything","anywhere","are","area","areas","around","as","ask","asked","asking","asks","at","away","b","back","backed","backing","backs","be","became","because","become","becomes","been","before","began","behind","being","beings","best","better","between","big","both","but","by","c","came","can","cannot","case","cases","certain","certainly","clear","clearly","come","could","d","did","differ","different","differently","do","does","done","down","down","downed","downing","downs","during","e","each","early","either","end","ended","ending","ends","enough","even","evenly","ever","every","everybody","everyone","everything","everywhere","f","face","faces","fact","facts","far","felt","few","find","finds","first","for","four","from","full","fully","further","furthered","furthering","furthers","g","gave","general","generally","get","gets","give","given","gives","go","going","good","goods","got","great","greater","greatest","group","grouped","grouping","groups","h","had","has","have","having","he","her","here","herself","high","high","high","higher","highest","him","himself","his","how","however","i","if","important","in","interest","interested","interesting","interests","into","is","it","its","itself","j","just","k","keep","keeps","kind","knew","know","known","knows","l","large","largely","last","later","latest","least","less","let","lets","like","likely","long","longer","longest","m","made","make","making","man","many","may","me","member","members","men","might","more","most","mostly","mr","mrs","much","must","my","myself","n","necessary","need","needed","needing","needs","never","new","new","newer","newest","next","no","nobody","non","noone","not","nothing","now","nowhere","number","numbers","o","of","off","often","old","older","oldest","on","once","one","only","open","opened","opening","opens","or","order","ordered","ordering","orders","other","others","our","out","over","p","part","parted","parting","parts","per","perhaps","place","places","point","pointed","pointing","points","possible","present","presented","presenting","presents","problem","problems","put","puts","q","quite","r","rather","really","right","right","room","rooms","s","said","same","saw","say","says","second","seconds","see","seem","seemed","seeming","seems","sees","several","shall","she","should","show","showed","showing","shows","side","sides","since","small","smaller","smallest","so","some","somebody","someone","something","somewhere","state","states","still","still","such","sure","t","take","taken","than","that","the","their","them","then","there","therefore","these","they","thing","things","think","thinks","this","those","though","thought","thoughts","three","through","thus","to","today","together","too","took","toward","turn","turned","turning","turns","two","u","under","until","up","upon","us","use","used","uses","v","very","w","want","wanted","wanting","wants","was","way","ways","we","well","wells","went","were","what","when","where","whether","which","while","who","whole","whose","why","will","with","within","without","work","worked","working","works","would","x","y","year","years","yet","you","young","younger","youngest","your","yours","z"],no:["...","alle","andre","arbeid","at","av","bare","begge","ble","blei","bli","blir","blitt","bort","bruke","både","båe","da","de","deg","dei","deim","deira","deires","dem","den","denne","der","dere","deres","det","dette","di","din","disse","ditt","du","dykk","dykkar","då","eg","ein","eit","eitt","eller","elles","en","ene","eneste","enhver","enn","er","et","ett","etter","folk","for","fordi","forsøke","fra","få","før","før","først","gjorde","gjøre","god","gå","ha","hadde","han","hans","har","hennar","henne","hennes","her","hjå","ho","hoe","honom","hoss","hossen","hun","hva","hvem","hver","hvilke","hvilken","hvis","hvor","hvordan","hvorfor","i","ikke","ikkje","ingen","ingi","inkje","inn","innen","inni","ja","jeg","kan","kom","korleis","korso","kun","kunne","kva","kvar","kvarhelst","kven","kvi","kvifor","lage","lang","lik","like","makt","man","mange","me","med","medan","meg","meget","mellom","men","mens","mer","mest","mi","min","mine","mitt","mot","mye","mykje","må","måte","navn","ned","nei","no","noe","noen","noka","noko","nokon","nokor","nokre","ny","nå","når","og","også","om","opp","oss","over","part","punkt","på","samme","seg","selv","si","sia","sidan","siden","sin","sine","sist","sitt","sjøl","skal","skulle","slik","slutt","so","som","somme","somt","start","stille","så","sånn","tid","til","tilbake","tilstand","um","under","upp","ut","uten","var","vart","varte","ved","verdi","vere","verte","vi","vil","ville","vite","vore","vors","vort","vår","være","vært","vøre","vørt","æ","å"],nl:["de","en","van","ik","te","dat","die","in","een","hij","het","niet","zijn","is","was","op","aan","met","als","voor","had","er","maar","om","hem","dan","zou","of","wat","mijn","men","dit","zo","door","over","ze","zich","bij","ook","tot","je","mij","uit","der","daar","haar","naar","heb","hoe","heeft","hebben","deze","u","want","nog","zal","me","zij","nu","ge","geen","omdat","iets","worden","toch","al","waren","veel","meer","doen","toen","moet","ben","zonder","kan","hun","dus","alles","onder","ja","eens","hier","wie","werd","altijd","doch","wordt","wezen","kunnen","ons","zelf","tegen","na","reeds","wil","kon","niets","uw","iemand","geweest","andere"],es:["...","a","actualmente","adelante","además","afirmó","agregó","ahora","ahí","al","algo","alguna","algunas","alguno","algunos","algún","alrededor","ambos","ampleamos","ante","anterior","antes","apenas","aproximadamente","aquel","aquellas","aquellos","aqui","aquí","arriba","aseguró","así","atras","aunque","ayer","añadió","aún","bajo","bastante","bien","buen","buena","buenas","bueno","buenos","cada","casi","cerca","cierta","ciertas","cierto","ciertos","cinco","comentó","como","con","conocer","conseguimos","conseguir","considera","consideró","consigo","consigue","consiguen","consigues","contra","cosas","creo","cual","cuales","cualquier","cuando","cuanto","cuatro","cuenta","cómo","da","dado","dan","dar","de","debe","deben","debido","decir","dejó","del","demás","dentro","desde","después","dice","dicen","dicho","dieron","diferente","diferentes","dijeron","dijo","dio","donde","dos","durante","e","ejemplo","el","ella","ellas","ello","ellos","embargo","empleais","emplean","emplear","empleas","empleo","en","encima","encuentra","entonces","entre","era","erais","eramos","eran","eras","eres","es","esa","esas","ese","eso","esos","esta","estaba","estabais","estaban","estabas","estad","estada","estadas","estado","estados","estais","estamos","estan","estando","estar","estaremos","estará","estarán","estarás","estaré","estaréis","estaría","estaríais","estaríamos","estarían","estarías","estas","este","estemos","esto","estos","estoy","estuve","estuviera","estuvierais","estuvieran","estuvieras","estuvieron","estuviese","estuvieseis","estuviesen","estuvieses","estuvimos","estuviste","estuvisteis","estuviéramos","estuviésemos","estuvo","está","estábamos","estáis","están","estás","esté","estéis","estén","estés","ex","existe","existen","explicó","expresó","fin","fue","fuera","fuerais","fueran","fueras","fueron","fuese","fueseis","fuesen","fueses","fui","fuimos","fuiste","fuisteis","fuéramos","fuésemos","gran","grandes","gueno","ha","haber","habida","habidas","habido","habidos","habiendo","habremos","habrá","habrán","habrás","habré","habréis","habría","habríais","habríamos","habrían","habrías","habéis","había","habíais","habíamos","habían","habías","hace","haceis","hacemos","hacen","hacer","hacerlo","haces","hacia","haciendo","hago","han","has","hasta","hay","haya","hayamos","hayan","hayas","hayáis","he","hecho","hemos","hicieron","hizo","hoy","hube","hubiera","hubierais","hubieran","hubieras","hubieron","hubiese","hubieseis","hubiesen","hubieses","hubimos","hubiste","hubisteis","hubiéramos","hubiésemos","hubo","igual","incluso","indicó","informó","intenta","intentais","intentamos","intentan","intentar","intentas","intento","ir","junto","la","lado","largo","las","le","les","llegó","lleva","llevar","lo","los","luego","lugar","manera","manifestó","mayor","me","mediante","mejor","mencionó","menos","mi","mientras","mio","mis","misma","mismas","mismo","mismos","modo","momento","mucha","muchas","mucho","muchos","muy","más","mí","mía","mías","mío","míos","nada","nadie","ni","ninguna","ningunas","ninguno","ningunos","ningún","no","nos","nosotras","nosotros","nuestra","nuestras","nuestro","nuestros","nueva","nuevas","nuevo","nuevos","nunca","o","ocho","os","otra","otras","otro","otros","para","parece","parte","partir","pasada","pasado","pero","pesar","poca","pocas","poco","pocos","podeis","podemos","poder","podria","podriais","podriamos","podrian","podrias","podrá","podrán","podría","podrían","poner","por","por qué","porque","posible","primer","primera","primero","primeros","principalmente","propia","propias","propio","propios","próximo","próximos","pudo","pueda","puede","pueden","puedo","pues","que","quedó","queremos","quien","quienes","quiere","quién","qué","realizado","realizar","realizó","respecto","sabe","sabeis","sabemos","saben","saber","sabes","se","sea","seamos","sean","seas","segunda","segundo","según","seis","ser","seremos","será","serán","serás","seré","seréis","sería","seríais","seríamos","serían","serías","seáis","señaló","si","sido","siempre","siendo","siete","sigue","siguiente","sin","sino","sobre","sois","sola","solamente","solas","solo","solos","somos","son","soy","su","sus","suya","suyas","suyo","suyos","sí","sólo","tal","también","tampoco","tan","tanto","te","tendremos","tendrá","tendrán","tendrás","tendré","tendréis","tendría","tendríais","tendríamos","tendrían","tendrías","tened","teneis","tenemos","tener","tenga","tengamos","tengan","tengas","tengo","tengáis","tenida","tenidas","tenido","tenidos","teniendo","tenéis","tenía","teníais","teníamos","tenían","tenías","tercera","ti","tiempo","tiene","tienen","tienes","toda","todas","todavía","todo","todos","total","trabaja","trabajais","trabajamos","trabajan","trabajar","trabajas","trabajo","tras","trata","través","tres","tu","tus","tuve","tuviera","tuvierais","tuvieran","tuvieras","tuvieron","tuviese","tuvieseis","tuviesen","tuvieses","tuvimos","tuviste","tuvisteis","tuviéramos","tuviésemos","tuvo","tuya","tuyas","tuyo","tuyos","tú","ultimo","un","una","unas","uno","unos","usa","usais","usamos","usan","usar","usas","uso","usted","va","vais","valor","vamos","van","varias","varios","vaya","veces","ver","verdad","verdadera","verdadero","vez","vosotras","vosotros","voy","vuestra","vuestras","vuestro","vuestros","y","ya","yo","él","éramos","ésta","éstas","éste","éstos","última","últimas","último","últimos"]},F={getStopWords:function(e){return void 0===e&&(e=""),q[e||"en"]||[]}},H={spiralResolution:1,spiralLimit:1800,lineHeight:.8,xWordPadding:0,yWordPadding:3,weightFactor:40,topN:40,maxHeight:0,padding:10},G=function(){function e(e){void 0===e&&(e=H),this._options=e,this._words=[],this._placedWords=[],this._minWeight=1,this._weightFactor=1,this._renderedTarget=void 0,this.colors=["black"]}return Object.defineProperty(e.prototype,"words",{get:function(){return this._words},set:function(e){this._words=[].concat(e||[]),this._minWeight=1,this._weightFactor=1,this._words.length>0&&(this._words.sort((function(e,t){return-1*(e[1]-t[1])})),this._minWeight=this._words[this._words.length-1][1],this._weightFactor=(this._words[0][1]-this._minWeight+1)/this._options.weightFactor)},enumerable:!1,configurable:!0}),e.prototype.createWordElement=function(e,t,i){var r=document.createElement("div");return r.style.position="absolute",r.style.fontSize=(t-this._minWeight+1)/this._weightFactor+"px",r.style.lineHeight=this._options.lineHeight+"em",this.colors.length>0&&(r.style.color=this.colors[i%this.colors.length]),r.title=e+" ("+t+")",r.appendChild(document.createTextNode(e)),r},e.prototype.isIntersectWithPlaced=function(e){for(var t=0;t<this._placedWords.length;t+=1){var i=this._placedWords[t].rect;if(!(e.right+this._options.xWordPadding<i.left-this._options.xWordPadding||e.left-this._options.xWordPadding>i.right+this._options.xWordPadding||e.bottom+this._options.yWordPadding<i.top-this._options.yWordPadding||e.top-this._options.yWordPadding>i.bottom+this._options.yWordPadding))return!0}return!1},e.prototype.arrangeWords=function(e,t){for(var i={x:0,y:0},r=i.y,n=i.y,s=Math.min(this._options.topN,this.words.length),o=0;o<s;o+=1){var a=this.createWordElement(this.words[o][0],this.words[o][1],o);e.appendChild(a);for(var l=0;l<this._options.spiralLimit;l++){var u=this._options.spiralResolution*l;i.x=(1+u)*Math.cos(u),i.y=(1+u)*Math.sin(u);var h=t.x+i.x-a.offsetWidth/2,c=t.y+i.y-a.offsetHeight/2;a.style.left=h+"px",a.style.top=c+"px";var d=a.getBoundingClientRect();if(!this.isIntersectWithPlaced(d)){this._placedWords.push({element:a,rect:d,left:h,top:c});break}}var p=i.y-a.offsetHeight/2;r>p&&(r=p);var f=i.y+a.offsetHeight/2;n<f&&(n=f)}return[r,n]},e.prototype.render=function(e){var t=this;this._renderedTarget=e;var i=document.createElement("div");i.className="sa-visualizer-wordcloud",i.style.position="relative",e.appendChild(i),this._options.maxHeight>0&&(i.style.height=this._options.maxHeight+"px",i.style.overflow="auto");var r={x:i.offsetWidth/2,y:i.offsetHeight/2},n=this.arrangeWords(i,r),s=n[0],o=n[1];0==this._options.maxHeight&&(i.style.height=o-s+2*this._options.padding+"px"),this._placedWords.forEach((function(e){e.element.style.top=e.top-s+t._options.padding+"px"}))},e.prototype.dispose=function(){this._renderedTarget&&(this._renderedTarget.innerHTML="",this._renderedTarget=void 0)},e}(),X=function(){function e(e){this.model=e}return Object.defineProperty(e.prototype,"wordcloud",{get:function(){return this._wordcloud},enumerable:!1,configurable:!0}),e.prototype.createWordCloud2=function(t){return Object(o.b)(this,void 0,void 0,(function(){var i,n,s,l,u,h=this;return Object(o.d)(this,(function(o){switch(o.label){case 0:return[4,this.model.getCalculatedValues()];case 1:return i=o.sent(),this.model.getColors(),n=a.b.createElement("canvas",""),s=a.b.createElement("p","",{innerText:r.a.getString("noResults")}),0===i.length?(t.appendChild(s),[2]):(t.appendChild(n),l={list:i,weightFactor:e.weightFactor,abortThreshold:e.abortThreshold,drawOutOfBound:e.drawOutOfBound,shrinkToFit:e.shrinkToFit,fontFamily:"Segoe UI Bold, sans-serif",color:function(e,t){return h.model.getRandomColor()},rotateRatio:.5,rotationSteps:2,backgroundColor:this.model.backgroundColor,click:function(e){console.log(e[0]+": "+e[1])}},u={canvas:n,config:l},e.onWordcloudCreating.fire(this.model,u),[2,this._wordcloud])}}))}))},e.prototype.create=function(t){return Object(o.b)(this,void 0,void 0,(function(){var i,n,s,l;return Object(o.d)(this,(function(o){switch(o.label){case 0:return[4,this.model.getCalculatedValues()];case 1:return i=o.sent(),this.model.getColors(),0===i.length?(n=a.b.createElement("p","",{innerText:r.a.getString("noResults")}),t.appendChild(n),[2]):(s=JSON.parse(JSON.stringify(H)),l={config:s},e.onWordcloudCreating.fire(this.model,l),this._wordcloud=new G(s),this._wordcloud.colors=this.model.getColors(),this._wordcloud.words=i,this._wordcloud.render(t),[2,this._wordcloud])}}))}))},e.prototype.destroy=function(e){this._wordcloud&&"function"==typeof this._wordcloud.dispose&&this._wordcloud.dispose(),this._wordcloud=void 0},e.drawOutOfBound=!1,e.shrinkToFit=!0,e.abortThreshold=void 0,e.weightFactor=20,e.onWordcloudCreating=new n.Event,e}(),Y=function(e){function t(t,i,r,n){var s=e.call(this,t,i,r,n||"wordcloud")||this;return s._wordcloudAdapter=new X(s),s}return Object(o.c)(t,e),t.prototype.convertFromExternalData=function(e){var t=[];return Object.keys(e||[]).forEach((function(i){t.push([i,e[i]])})),t},t.prototype.getCalculatedValuesCore=function(){var e=this,t={},i=[],n=r.a.currentLocale;i=n?F.getStopWords(n):F.getStopWords();var s=new RegExp("[.,/#!$%^*;:{}=-_`~()]","g"),o=function(e){(e=""+e)&&e.split(" ").forEach((function(e){var r=(e||"").toLowerCase().replace(s,"");(r=function(e){return-1!==i.indexOf(e)?"":e}(r))&&(t[r]?t[r]++:t[r]=1)}))};return this.surveyData.forEach((function(t){var i=t[e.question.name];i&&(Array.isArray(i)?i.forEach(o):"object"==typeof i?Object.keys(i).forEach((function(e){return o(i[e])})):o(i))})),Object.keys(t).map((function(e){return[e,t[e]]}))},t.prototype.destroyContent=function(t){this._wordcloudAdapter.destroy(t),e.prototype.destroyContent.call(this,t)},t.prototype.renderContentAsync=function(e){return Object(o.b)(this,void 0,void 0,(function(){var t;return Object(o.d)(this,(function(i){switch(i.label){case 0:return t=a.b.createElement("div"),e.appendChild(t),[4,this._wordcloudAdapter.create(t)];case 1:return i.sent(),e.innerHTML="",e.appendChild(t),[2,e]}}))}))},t.prototype.destroy=function(){this._wordcloudAdapter.destroy(this.contentContainer),e.prototype.destroy.call(this)},t}(l);h.registerVisualizer("text",Y),h.registerVisualizer("comment",Y),h.registerVisualizer("multipletext",Y);i(30);var Q=function(){function e(e){this.model=e}return e.prototype.create=function(e){return Object(o.b)(this,void 0,void 0,(function(){var t,i,n,s,l;return Object(o.d)(this,(function(o){switch(o.label){case 0:return[4,this.model.getCalculatedValues()];case 1:return t=o.sent(),i=t.columnCount,n=t.data,s=a.b.createElement("p","",{innerText:r.a.getString("noResults")}),0===n.length?(e.appendChild(s),[2]):((l=a.b.createElement("table","sa-text-table")).style.backgroundColor=this.model.backgroundColor,e.appendChild(l),n.forEach((function(e){for(var t=a.b.createElement("tr"),r=0;r<i;r++){var n=a.b.createElement("td","sa-text-table__cell",{textContent:e[r]});t.appendChild(n)}l.appendChild(t)})),e.className="sa-text-table__container",e.appendChild(l),[2])}}))}))},e.prototype.destroy=function(e){e.innerHTML=""},e}(),W=function(e){function t(t,i,r,n){var s=e.call(this,t,i,r,n||"text")||this;return s._textTableAdapter=new Q(s),s}return Object(o.c)(t,e),t.prototype.getCalculatedValuesCore=function(){var e=this,t=[],i=0;return this.surveyData.forEach((function(r){var n=r[e.question.name],s=[];n&&(Array.isArray(n)?s=s.concat(n):"object"==typeof n?Object.keys(n).forEach((function(e){return s.push(n[e])})):s.push(n),t.push(s),s.length>i&&(i=s.length))})),{columnCount:i,data:t}},t.prototype.destroyContent=function(t){this._textTableAdapter.destroy(t),e.prototype.destroyContent.call(this,t)},t.prototype.renderContentAsync=function(e){return Object(o.b)(this,void 0,void 0,(function(){var t;return Object(o.d)(this,(function(i){switch(i.label){case 0:return t=a.b.createElement("div"),[4,this._textTableAdapter.create(t)];case 1:return i.sent(),e.innerHTML="",e.appendChild(t),[2,e]}}))}))},t.prototype.destroy=function(){this._textTableAdapter.destroy(this.contentContainer),e.prototype.destroy.call(this)},t}(l);h.registerVisualizer("text",W),h.registerVisualizer("comment",W),h.registerVisualizer("multipletext",W);i(31);var U=function(){function e(e){this.model=e}return e.prototype.create=function(e){return Object(o.b)(this,void 0,void 0,(function(){var t,i,n,s,l,u,h=this;return Object(o.d)(this,(function(o){switch(o.label){case 0:return[4,this.model.getAnswersData()];case 1:return t=o.sent(),i=t.datasets,n=t.labels,t.colors,s=t.texts,l=t.seriesLabels,l.length>1,u=a.b.createElement("p","",{innerText:r.a.getString("noResults")}),0===i.length||0===i[0].length?(e.appendChild(u),[2]):(i.forEach((function(t,i){var o=a.b.createElement("table","sa-choices-table");o.style.backgroundColor=h.model.backgroundColor,e.appendChild(o);var l=a.b.createElement("tr"),u=a.b.createElement("th","sa-choices-table__cell-header",{textContent:r.a.getString("answer")});l.appendChild(u);var c=a.b.createElement("th","sa-choices-table__cell-header",{textContent:""});l.appendChild(c);var d=a.b.createElement("th","sa-choices-table__cell-header",{textContent:r.a.getString("percent")});l.appendChild(d);var p=a.b.createElement("th","sa-choices-table__cell-header",{textContent:r.a.getString("responses")});l.appendChild(p),o.appendChild(l),t.forEach((function(e,t){var r=a.b.createElement("tr"),l=a.b.createElement("td","sa-choices-table__cell",{textContent:n[t]});r.appendChild(l);var u=a.b.createElement("td","sa-choices-table__cell"),h=a.b.createElement("div","sa-choices-sparkline"),c=a.b.createElement("div","sa-choices-sparkline-value");c.style.width=s[i][t]+"%",h.appendChild(c),u.appendChild(h),r.appendChild(u);var d=a.b.createElement("td","sa-choices-table__cell sa-choices-table__cell-value",{textContent:s[i][t]+"%"});r.appendChild(d);var p=a.b.createElement("td","sa-choices-table__cell sa-choices-table__cell-value",{textContent:e});r.appendChild(p),o.appendChild(r)})),e.className="sa-choices-table__container",e.appendChild(o)})),[2])}}))}))},e.prototype.destroy=function(e){e.innerHTML=""},e}(),K=function(e){function t(t,i,r,n){var s=e.call(this,t,i,r,n||"choices")||this;return s._choicesTableAdapter=new U(s),s.answersOrder="asc",s.showPercentages=!0,s}return Object(o.c)(t,e),t.prototype.destroyContent=function(t){this._choicesTableAdapter.destroy(t),e.prototype.destroyContent.call(this,t)},t.prototype.renderContentAsync=function(e){return Object(o.b)(this,void 0,void 0,(function(){var t;return Object(o.d)(this,(function(i){switch(i.label){case 0:return t=a.b.createElement("div"),[4,this._choicesTableAdapter.create(t)];case 1:return i.sent(),e.innerHTML="",e.appendChild(t),[2,e]}}))}))},t.prototype.destroy=function(){this._choicesTableAdapter.destroy(this.contentContainer),e.prototype.destroy.call(this)},t}(f),Z=(i(32),function(){function e(e,t){this._model=e,this._data=t,this._renderedTarget=void 0}return e.prototype.renderScorePart=function(e,t,i){var n=a.b.createElement("div","sa-visualizer-nps__score-part"),s=a.b.createElement("div","sa-visualizer-nps__score-part-title");s.innerText=r.a.getString(e),n.appendChild(s);var o=a.b.createElement("div","sa-visualizer-nps__score-part-values");n.appendChild(o);var l=a.b.createElement("div","sa-visualizer-nps__score-part-value");if(l.innerText=""+t,o.appendChild(l),i){var u=a.b.createElement("div","sa-visualizer-nps__score-part-percent");u.innerText=i+"%",o.appendChild(u)}return n},e.prototype.render=function(e){this._renderedTarget=e;var t=a.b.createElement("div","sa-visualizer-nps");t.appendChild(this.renderScorePart("npsScore",this.npsScore)),t.appendChild(this.renderScorePart("npsPromoters",this._data.promoters,this.promotersPercent)),t.appendChild(this.renderScorePart("npsPassives",this._data.total-this._data.promoters-this._data.detractors,this.passivePercent)),t.appendChild(this.renderScorePart("npsDetractors",this._data.detractors,this.detractorsPercent)),e.appendChild(t)},Object.defineProperty(e.prototype,"npsScore",{get:function(){return Object(a.g)((this._data.promoters-this._data.detractors)/this._data.total*100,this._model.precision)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"promotersPercent",{get:function(){return Object(a.g)(this._data.promoters/this._data.total*100,this._model.precision)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"passivePercent",{get:function(){return Object(a.g)((this._data.total-this._data.promoters-this._data.detractors)/this._data.total*100,this._model.precision)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"detractorsPercent",{get:function(){return Object(a.g)(this._data.detractors/this._data.total*100,this._model.precision)},enumerable:!1,configurable:!0}),e.prototype.dispose=function(){this._renderedTarget&&(this._renderedTarget.innerHTML="",this._renderedTarget=void 0)},e}()),J=function(){function e(e){this.model=e}return Object.defineProperty(e.prototype,"npsVisualizer",{get:function(){return this._npsVisualizer},enumerable:!1,configurable:!0}),e.prototype.create=function(e){return Object(o.b)(this,void 0,void 0,(function(){var t;return Object(o.d)(this,(function(i){switch(i.label){case 0:return[4,this.model.getCalculatedValues()];case 1:return t=i.sent(),this._npsVisualizer=new Z(this.model,t),this._npsVisualizer.render(e),[2,this._npsVisualizer]}}))}))},e.prototype.destroy=function(e){this._npsVisualizer&&"function"==typeof this._npsVisualizer.dispose&&this._npsVisualizer.dispose(),this._npsVisualizer=void 0},e}(),$=function(e){function t(t,i,r,n){var s=e.call(this,t,i,r,n||"nps")||this;return s.precision=2,s._npsAdapter=new J(s),s}return Object(o.c)(t,e),t.prototype.getCalculatedValuesCore=function(){var e=this,i={detractors:0,passive:0,promoters:0,total:0};return this.data.forEach((function(r){var n=r[e.question.name],s=parseInt(n);Number.isNaN(s)||(s<=t.DetractorScore?i.detractors++:s>=t.PromoterScore?i.promoters++:i.passive++,i.total++)})),i},t.prototype.destroyContent=function(t){this._npsAdapter.destroy(t),e.prototype.destroyContent.call(this,t)},t.prototype.renderContentAsync=function(e){return Object(o.b)(this,void 0,void 0,(function(){var t;return Object(o.d)(this,(function(i){switch(i.label){case 0:return t=a.b.createElement("div"),e.appendChild(t),[4,this._npsAdapter.create(t)];case 1:return i.sent(),e.innerHTML="",e.appendChild(t),[2,e]}}))}))},t.prototype.destroy=function(){this._npsAdapter.destroy(this.contentContainer),e.prototype.destroy.call(this)},t.DetractorScore=6,t.PromoterScore=9,t}(l)}])}));
|