WordPress Charts and Graphs Lite - Version 3.7.0

Version Description

Download this release

Release Info

Developer themeisle
Plugin Icon WordPress Charts and Graphs Lite
Version 3.7.0
Comparing to
See all releases

Code changes from version 3.6.1 to 3.7.0

CHANGELOG.md CHANGED
@@ -1,3 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ##### [Version 3.6.1](https://github.com/Codeinwp/visualizer/compare/v3.6.0...v3.6.1) (2021-08-04)
2
 
3
  - Fix broken dropdown style issue
1
+ #### [Version 3.7.0](https://github.com/Codeinwp/visualizer/compare/v3.6.1...v3.7.0) (2021-10-07)
2
+
3
+ #### Features
4
+ - Add option to enable/disable save the chart image
5
+ - Enhanced caching
6
+
7
+ #### Fixes
8
+ - Fix undefined variable errors when using Gutenberg blocks
9
+ - Fix broken chart in iOS and Safari
10
+ - Fix custom refresh time support for DB chart
11
+ - Fix table placed inside accordion cannot be scrolled down (refreshes all the time)
12
+ - Fix pagination doesn't work in the library
13
+ - Fix HTML entities in JSON break Visualizer Table Chart
14
+ - Fix string type columns affect the target of the formatting applied to a number column
15
+
16
  ##### [Version 3.6.1](https://github.com/Codeinwp/visualizer/compare/v3.6.0...v3.6.1) (2021-08-04)
17
 
18
  - Fix broken dropdown style issue
classes/Visualizer/Gutenberg/Block.php CHANGED
@@ -659,6 +659,12 @@ class Visualizer_Gutenberg_Block {
659
 
660
  wp_update_post( $chart );
661
 
 
 
 
 
 
 
662
  $revisions = wp_get_post_revisions( $data['id'], array( 'order' => 'ASC' ) );
663
 
664
  if ( count( $revisions ) > 1 ) {
659
 
660
  wp_update_post( $chart );
661
 
662
+ // Clear existing chart cache.
663
+ $cache_key = Visualizer_Plugin::CF_CHART_CACHE . '_' . $data['id'];
664
+ if ( get_transient( $cache_key ) ) {
665
+ delete_transient( $cache_key );
666
+ }
667
+
668
  $revisions = wp_get_post_revisions( $data['id'], array( 'order' => 'ASC' ) );
669
 
670
  if ( count( $revisions ) > 1 ) {
classes/Visualizer/Gutenberg/build/block.js CHANGED
@@ -61,7 +61,7 @@ object-assign
61
  *
62
  * Copyright © 2014 David Bushell | BSD & MIT license | https://github.com/dbushell/Pikaday
63
  */
64
- !function(t,r){"use strict";var a;try{a=n(0)}catch(e){}e.exports=function(e){var t="function"==typeof e,n=!!window.addEventListener,r=window.document,a=window.setTimeout,i=function(e,t,r,a){n?e.addEventListener(t,r,!!a):e.attachEvent("on"+t,r)},o=function(e,t,r,a){n?e.removeEventListener(t,r,!!a):e.detachEvent("on"+t,r)},s=function(e,t,n){var a;r.createEvent?((a=r.createEvent("HTMLEvents")).initEvent(t,!0,!1),a=_(a,n),e.dispatchEvent(a)):r.createEventObject&&(a=r.createEventObject(),a=_(a,n),e.fireEvent("on"+t,a))},l=function(e,t){return-1!==(" "+e.className+" ").indexOf(" "+t+" ")},u=function(e){return/Array/.test(Object.prototype.toString.call(e))},c=function(e){return/Date/.test(Object.prototype.toString.call(e))&&!isNaN(e.getTime())},d=function(e){var t=e.getDay();return 0===t||6===t},m=function(e){return e%4==0&&e%100!=0||e%400==0},p=function(e,t){return[31,m(e)?29:28,31,30,31,30,31,31,30,31,30,31][t]},h=function(e){c(e)&&e.setHours(0,0,0,0)},f=function(e,t){return e.getTime()===t.getTime()},_=function(e,t,n){var r,a;for(r in t)(a=void 0!==e[r])&&"object"==typeof t[r]&&null!==t[r]&&void 0===t[r].nodeName?c(t[r])?n&&(e[r]=new Date(t[r].getTime())):u(t[r])?n&&(e[r]=t[r].slice(0)):e[r]=_({},t[r],n):!n&&a||(e[r]=t[r]);return e},y=function(e){return e.month<0&&(e.year-=Math.ceil(Math.abs(e.month)/12),e.month+=12),e.month>11&&(e.year+=Math.floor(Math.abs(e.month)/12),e.month-=12),e},b={field:null,bound:void 0,position:"bottom left",reposition:!0,format:"YYYY-MM-DD",defaultDate:null,setDefaultDate:!1,firstDay:0,formatStrict:!1,minDate:null,maxDate:null,yearRange:10,showWeekNumber:!1,minYear:0,maxYear:9999,minMonth:void 0,maxMonth:void 0,startRange:null,endRange:null,isRTL:!1,yearSuffix:"",showMonthAfterYear:!1,showDaysInNextAndPreviousMonths:!1,numberOfMonths:1,mainCalendar:"left",container:void 0,i18n:{previousMonth:"Previous Month",nextMonth:"Next Month",months:["January","February","March","April","May","June","July","August","September","October","November","December"],weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},theme:null,onSelect:null,onOpen:null,onClose:null,onDraw:null},g=function(e,t,n){for(t+=e.firstDay;t>=7;)t-=7;return n?e.i18n.weekdaysShort[t]:e.i18n.weekdays[t]},v=function(e){var t=[],n="false";if(e.isEmpty){if(!e.showDaysInNextAndPreviousMonths)return'<td class="is-empty"></td>';t.push("is-outside-current-month")}return e.isDisabled&&t.push("is-disabled"),e.isToday&&t.push("is-today"),e.isSelected&&(t.push("is-selected"),n="true"),e.isInRange&&t.push("is-inrange"),e.isStartRange&&t.push("is-startrange"),e.isEndRange&&t.push("is-endrange"),'<td data-day="'+e.day+'" class="'+t.join(" ")+'" aria-selected="'+n+'"><button class="pika-button pika-day" type="button" data-pika-year="'+e.year+'" data-pika-month="'+e.month+'" data-pika-day="'+e.day+'">'+e.day+"</button></td>"},w=function(e,t){return"<tr>"+(t?e.reverse():e).join("")+"</tr>"},M=function(e,t,n,r,a,i){var o,s,l,c,d,m=e._o,p=n===m.minYear,h=n===m.maxYear,f='<div id="'+i+'" class="pika-title" role="heading" aria-live="assertive">',_=!0,y=!0;for(l=[],o=0;o<12;o++)l.push('<option value="'+(n===a?o-t:12+o-t)+'"'+(o===r?' selected="selected"':"")+(p&&o<m.minMonth||h&&o>m.maxMonth?'disabled="disabled"':"")+">"+m.i18n.months[o]+"</option>");for(c='<div class="pika-label">'+m.i18n.months[r]+'<select class="pika-select pika-select-month" tabindex="-1">'+l.join("")+"</select></div>",u(m.yearRange)?(o=m.yearRange[0],s=m.yearRange[1]+1):(o=n-m.yearRange,s=1+n+m.yearRange),l=[];o<s&&o<=m.maxYear;o++)o>=m.minYear&&l.push('<option value="'+o+'"'+(o===n?' selected="selected"':"")+">"+o+"</option>");return d='<div class="pika-label">'+n+m.yearSuffix+'<select class="pika-select pika-select-year" tabindex="-1">'+l.join("")+"</select></div>",m.showMonthAfterYear?f+=d+c:f+=c+d,p&&(0===r||m.minMonth>=r)&&(_=!1),h&&(11===r||m.maxMonth<=r)&&(y=!1),0===t&&(f+='<button class="pika-prev'+(_?"":" is-disabled")+'" type="button">'+m.i18n.previousMonth+"</button>"),t===e._o.numberOfMonths-1&&(f+='<button class="pika-next'+(y?"":" is-disabled")+'" type="button">'+m.i18n.nextMonth+"</button>"),f+"</div>"},k=function(o){var s=this,u=s.config(o);s._onMouseDown=function(e){if(s._v){var t=(e=e||window.event).target||e.srcElement;if(t)if(l(t,"is-disabled")||(!l(t,"pika-button")||l(t,"is-empty")||l(t.parentNode,"is-disabled")?l(t,"pika-prev")?s.prevMonth():l(t,"pika-next")&&s.nextMonth():(s.setDate(new Date(t.getAttribute("data-pika-year"),t.getAttribute("data-pika-month"),t.getAttribute("data-pika-day"))),u.bound&&a((function(){s.hide(),u.field&&u.field.blur()}),100))),l(t,"pika-select"))s._c=!0;else{if(!e.preventDefault)return e.returnValue=!1,!1;e.preventDefault()}}},s._onChange=function(e){var t=(e=e||window.event).target||e.srcElement;t&&(l(t,"pika-select-month")?s.gotoMonth(t.value):l(t,"pika-select-year")&&s.gotoYear(t.value))},s._onKeyChange=function(e){if(e=e||window.event,s.isVisible())switch(e.keyCode){case 13:case 27:u.field.blur();break;case 37:e.preventDefault(),s.adjustDate("subtract",1);break;case 38:s.adjustDate("subtract",7);break;case 39:s.adjustDate("add",1);break;case 40:s.adjustDate("add",7)}},s._onInputChange=function(n){var r;n.firedBy!==s&&(r=t?(r=e(u.field.value,u.format,u.formatStrict))&&r.isValid()?r.toDate():null:new Date(Date.parse(u.field.value)),c(r)&&s.setDate(r),s._v||s.show())},s._onInputFocus=function(){s.show()},s._onInputClick=function(){s.show()},s._onInputBlur=function(){var e=r.activeElement;do{if(l(e,"pika-single"))return}while(e=e.parentNode);s._c||(s._b=a((function(){s.hide()}),50)),s._c=!1},s._onClick=function(e){var t=(e=e||window.event).target||e.srcElement,r=t;if(t){!n&&l(t,"pika-select")&&(t.onchange||(t.setAttribute("onchange","return;"),i(t,"change",s._onChange)));do{if(l(r,"pika-single")||r===u.trigger)return}while(r=r.parentNode);s._v&&t!==u.trigger&&r!==u.trigger&&s.hide()}},s.el=r.createElement("div"),s.el.className="pika-single"+(u.isRTL?" is-rtl":"")+(u.theme?" "+u.theme:""),i(s.el,"mousedown",s._onMouseDown,!0),i(s.el,"touchend",s._onMouseDown,!0),i(s.el,"change",s._onChange),i(r,"keydown",s._onKeyChange),u.field&&(u.container?u.container.appendChild(s.el):u.bound?r.body.appendChild(s.el):u.field.parentNode.insertBefore(s.el,u.field.nextSibling),i(u.field,"change",s._onInputChange),u.defaultDate||(t&&u.field.value?u.defaultDate=e(u.field.value,u.format).toDate():u.defaultDate=new Date(Date.parse(u.field.value)),u.setDefaultDate=!0));var d=u.defaultDate;c(d)?u.setDefaultDate?s.setDate(d,!0):s.gotoDate(d):s.gotoDate(new Date),u.bound?(this.hide(),s.el.className+=" is-bound",i(u.trigger,"click",s._onInputClick),i(u.trigger,"focus",s._onInputFocus),i(u.trigger,"blur",s._onInputBlur)):this.show()};return k.prototype={config:function(e){this._o||(this._o=_({},b,!0));var t=_(this._o,e,!0);t.isRTL=!!t.isRTL,t.field=t.field&&t.field.nodeName?t.field:null,t.theme="string"==typeof t.theme&&t.theme?t.theme:null,t.bound=!!(void 0!==t.bound?t.field&&t.bound:t.field),t.trigger=t.trigger&&t.trigger.nodeName?t.trigger:t.field,t.disableWeekends=!!t.disableWeekends,t.disableDayFn="function"==typeof t.disableDayFn?t.disableDayFn:null;var n=parseInt(t.numberOfMonths,10)||1;if(t.numberOfMonths=n>4?4:n,c(t.minDate)||(t.minDate=!1),c(t.maxDate)||(t.maxDate=!1),t.minDate&&t.maxDate&&t.maxDate<t.minDate&&(t.maxDate=t.minDate=!1),t.minDate&&this.setMinDate(t.minDate),t.maxDate&&this.setMaxDate(t.maxDate),u(t.yearRange)){var r=(new Date).getFullYear()-10;t.yearRange[0]=parseInt(t.yearRange[0],10)||r,t.yearRange[1]=parseInt(t.yearRange[1],10)||r}else t.yearRange=Math.abs(parseInt(t.yearRange,10))||b.yearRange,t.yearRange>100&&(t.yearRange=100);return t},toString:function(n){return c(this._d)?t?e(this._d).format(n||this._o.format):this._d.toDateString():""},getMoment:function(){return t?e(this._d):null},setMoment:function(n,r){t&&e.isMoment(n)&&this.setDate(n.toDate(),r)},getDate:function(){return c(this._d)?new Date(this._d.getTime()):new Date},setDate:function(e,t){if(!e)return this._d=null,this._o.field&&(this._o.field.value="",s(this._o.field,"change",{firedBy:this})),this.draw();if("string"==typeof e&&(e=new Date(Date.parse(e))),c(e)){var n=this._o.minDate,r=this._o.maxDate;c(n)&&e<n?e=n:c(r)&&e>r&&(e=r),this._d=new Date(e.getTime()),h(this._d),this.gotoDate(this._d),this._o.field&&(this._o.field.value=this.toString(),s(this._o.field,"change",{firedBy:this})),t||"function"!=typeof this._o.onSelect||this._o.onSelect.call(this,this.getDate())}},gotoDate:function(e){var t=!0;if(c(e)){if(this.calendars){var n=new Date(this.calendars[0].year,this.calendars[0].month,1),r=new Date(this.calendars[this.calendars.length-1].year,this.calendars[this.calendars.length-1].month,1),a=e.getTime();r.setMonth(r.getMonth()+1),r.setDate(r.getDate()-1),t=a<n.getTime()||r.getTime()<a}t&&(this.calendars=[{month:e.getMonth(),year:e.getFullYear()}],"right"===this._o.mainCalendar&&(this.calendars[0].month+=1-this._o.numberOfMonths)),this.adjustCalendars()}},adjustDate:function(n,r){var a,i=this.getDate(),o=24*parseInt(r)*60*60*1e3;"add"===n?a=new Date(i.valueOf()+o):"subtract"===n&&(a=new Date(i.valueOf()-o)),t&&("add"===n?a=e(i).add(r,"days").toDate():"subtract"===n&&(a=e(i).subtract(r,"days").toDate())),this.setDate(a)},adjustCalendars:function(){this.calendars[0]=y(this.calendars[0]);for(var e=1;e<this._o.numberOfMonths;e++)this.calendars[e]=y({month:this.calendars[0].month+e,year:this.calendars[0].year});this.draw()},gotoToday:function(){this.gotoDate(new Date)},gotoMonth:function(e){isNaN(e)||(this.calendars[0].month=parseInt(e,10),this.adjustCalendars())},nextMonth:function(){this.calendars[0].month++,this.adjustCalendars()},prevMonth:function(){this.calendars[0].month--,this.adjustCalendars()},gotoYear:function(e){isNaN(e)||(this.calendars[0].year=parseInt(e,10),this.adjustCalendars())},setMinDate:function(e){e instanceof Date?(h(e),this._o.minDate=e,this._o.minYear=e.getFullYear(),this._o.minMonth=e.getMonth()):(this._o.minDate=b.minDate,this._o.minYear=b.minYear,this._o.minMonth=b.minMonth,this._o.startRange=b.startRange),this.draw()},setMaxDate:function(e){e instanceof Date?(h(e),this._o.maxDate=e,this._o.maxYear=e.getFullYear(),this._o.maxMonth=e.getMonth()):(this._o.maxDate=b.maxDate,this._o.maxYear=b.maxYear,this._o.maxMonth=b.maxMonth,this._o.endRange=b.endRange),this.draw()},setStartRange:function(e){this._o.startRange=e},setEndRange:function(e){this._o.endRange=e},draw:function(e){if(this._v||e){var t,n=this._o,r=n.minYear,i=n.maxYear,o=n.minMonth,s=n.maxMonth,l="";this._y<=r&&(this._y=r,!isNaN(o)&&this._m<o&&(this._m=o)),this._y>=i&&(this._y=i,!isNaN(s)&&this._m>s&&(this._m=s)),t="pika-title-"+Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,2);for(var u=0;u<n.numberOfMonths;u++)l+='<div class="pika-lendar">'+M(this,u,this.calendars[u].year,this.calendars[u].month,this.calendars[0].year,t)+this.render(this.calendars[u].year,this.calendars[u].month,t)+"</div>";this.el.innerHTML=l,n.bound&&"hidden"!==n.field.type&&a((function(){n.trigger.focus()}),1),"function"==typeof this._o.onDraw&&this._o.onDraw(this),n.bound&&n.field.setAttribute("aria-label","Use the arrow keys to pick a date")}},adjustPosition:function(){var e,t,n,a,i,o,s,l,u,c;if(!this._o.container){if(this.el.style.position="absolute",t=e=this._o.trigger,n=this.el.offsetWidth,a=this.el.offsetHeight,i=window.innerWidth||r.documentElement.clientWidth,o=window.innerHeight||r.documentElement.clientHeight,s=window.pageYOffset||r.body.scrollTop||r.documentElement.scrollTop,"function"==typeof e.getBoundingClientRect)l=(c=e.getBoundingClientRect()).left+window.pageXOffset,u=c.bottom+window.pageYOffset;else for(l=t.offsetLeft,u=t.offsetTop+t.offsetHeight;t=t.offsetParent;)l+=t.offsetLeft,u+=t.offsetTop;(this._o.reposition&&l+n>i||this._o.position.indexOf("right")>-1&&l-n+e.offsetWidth>0)&&(l=l-n+e.offsetWidth),(this._o.reposition&&u+a>o+s||this._o.position.indexOf("top")>-1&&u-a-e.offsetHeight>0)&&(u=u-a-e.offsetHeight),this.el.style.left=l+"px",this.el.style.top=u+"px"}},render:function(e,t,n){var r=this._o,a=new Date,i=p(e,t),o=new Date(e,t,1).getDay(),s=[],l=[];h(a),r.firstDay>0&&(o-=r.firstDay)<0&&(o+=7);for(var u,m,_,y,b=0===t?11:t-1,M=11===t?0:t+1,k=0===t?e-1:e,L=11===t?e+1:e,Y=p(k,b),D=i+o,T=D;T>7;)T-=7;D+=7-T;for(var S=0,O=0;S<D;S++){var x=new Date(e,t,S-o+1),j=!!c(this._d)&&f(x,this._d),E=f(x,a),C=S<o||S>=i+o,P=S-o+1,H=t,z=e,A=r.startRange&&f(r.startRange,x),R=r.endRange&&f(r.endRange,x),N=r.startRange&&r.endRange&&r.startRange<x&&x<r.endRange;C&&(S<o?(P=Y+P,H=b,z=k):(P-=i,H=M,z=L));var F={day:P,month:H,year:z,isSelected:j,isToday:E,isDisabled:r.minDate&&x<r.minDate||r.maxDate&&x>r.maxDate||r.disableWeekends&&d(x)||r.disableDayFn&&r.disableDayFn(x),isEmpty:C,isStartRange:A,isEndRange:R,isInRange:N,showDaysInNextAndPreviousMonths:r.showDaysInNextAndPreviousMonths};l.push(v(F)),7==++O&&(r.showWeekNumber&&l.unshift((u=S-o,m=t,_=e,y=void 0,void 0,y=new Date(_,0,1),'<td class="pika-week">'+Math.ceil(((new Date(_,m,u)-y)/864e5+y.getDay()+1)/7)+"</td>")),s.push(w(l,r.isRTL)),l=[],O=0)}return function(e,t,n){return'<table cellpadding="0" cellspacing="0" class="pika-table" role="grid" aria-labelledby="'+n+'">'+function(e){var t,n=[];e.showWeekNumber&&n.push("<th></th>");for(t=0;t<7;t++)n.push('<th scope="col"><abbr title="'+g(e,t)+'">'+g(e,t,!0)+"</abbr></th>");return"<thead><tr>"+(e.isRTL?n.reverse():n).join("")+"</tr></thead>"}(e)+(r=t,"<tbody>"+r.join("")+"</tbody></table>");var r}(r,s,n)},isVisible:function(){return this._v},show:function(){var e,t,n;this.isVisible()||(e=this.el,t="is-hidden",e.className=(n=(" "+e.className+" ").replace(" "+t+" "," ")).trim?n.trim():n.replace(/^\s+|\s+$/g,""),this._v=!0,this.draw(),this._o.bound&&(i(r,"click",this._onClick),this.adjustPosition()),"function"==typeof this._o.onOpen&&this._o.onOpen.call(this))},hide:function(){var e,t,n=this._v;!1!==n&&(this._o.bound&&o(r,"click",this._onClick),this.el.style.position="static",this.el.style.left="auto",this.el.style.top="auto",e=this.el,l(e,t="is-hidden")||(e.className=""===e.className?t:e.className+" "+t),this._v=!1,void 0!==n&&"function"==typeof this._o.onClose&&this._o.onClose.call(this))},destroy:function(){this.hide(),o(this.el,"mousedown",this._onMouseDown,!0),o(this.el,"touchend",this._onMouseDown,!0),o(this.el,"change",this._onChange),this._o.field&&(o(this._o.field,"change",this._onInputChange),this._o.bound&&(o(this._o.trigger,"click",this._onInputClick),o(this._o.trigger,"focus",this._onInputFocus),o(this._o.trigger,"blur",this._onInputBlur))),this.el.parentNode&&this.el.parentNode.removeChild(this.el)}},k}(a)}()},,function(e,t,n){},function(e,t,n){"use strict";n.r(t);var r=n(1),a=n.n(r),i=n(129),o=n.n(i),s=function(e,t){return(s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function l(e,t){function n(){this.constructor=e}s(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var u=function(){return(u=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e}).apply(this,arguments)};function c(e,t,n,r){return new(n||(n=Promise))((function(a,i){function o(e){try{l(r.next(e))}catch(e){i(e)}}function s(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){e.done?a(e.value):new n((function(t){t(e.value)})).then(o,s)}l((r=r.apply(e,t||[])).next())}))}function d(e,t){var n,r,a,i,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(a=2&i[0]?r.return:i[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,i[1])).done)return a;switch(r=0,a&&(i=[2&i[0],a.value]),i[0]){case 0:case 1:a=i;break;case 4:return o.label++,{value:i[1],done:!1};case 5:o.label++,r=i[1],i=[0];continue;case 7:i=o.ops.pop(),o.trys.pop();continue;default:if(!(a=o.trys,(a=a.length>0&&a[a.length-1])||6!==i[0]&&2!==i[0])){o=0;continue}if(3===i[0]&&(!a||i[1]>a[0]&&i[1]<a[3])){o.label=i[1];break}if(6===i[0]&&o.label<a[1]){o.label=a[1],a=i;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(i);break}a[2]&&o.ops.pop(),o.trys.pop();continue}i=t.call(e,o)}catch(e){i=[6,e],r=0}finally{n=a=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}var m={graph_id:null,legend_toggle:!1,graphID:null,options:{colors:null},data:null,rows:null,columns:null,diffdata:null,chartEvents:null,legendToggle:!1,chartActions:null,getChartWrapper:function(e,t){},getChartEditor:null,className:"",style:{},formatters:null,spreadSheetUrl:null,spreadSheetQueryParameters:{headers:1,gid:1},rootProps:{},chartWrapperParams:{},controls:null,render:null,toolbarItems:null,toolbarID:null},p=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.handleGoogleChartsLoaderScriptLoaded=function(e){var n=t.props,r=n.chartVersion,a=n.chartPackages,i=n.chartLanguage,o=n.mapsApiKey,s=n.onLoad;e.charts.load(r||"current",{packages:a||["corechart","controls"],language:i||"en",mapsApiKey:o}),e.charts.setOnLoadCallback((function(){s(e)}))},t}return l(t,e),t.prototype.shouldComponentUpdate=function(e){return e.chartPackages===this.props.chartPackages},t.prototype.render=function(){var e=this,t=this.props.onError;return Object(r.createElement)(o.a,{url:"https://www.gstatic.com/charts/loader.js",onError:t,onLoad:function(){var t=window;t.google&&e.handleGoogleChartsLoaderScriptLoaded(t.google)}})},t}(r.Component),h=0,f=function(){return"reactgooglegraph-"+(h+=1)},_=["#3366CC","#DC3912","#FF9900","#109618","#990099","#3B3EAC","#0099C6","#DD4477","#66AA00","#B82E2E","#316395","#994499","#22AA99","#AAAA11","#6633CC","#E67300","#8B0707","#329262","#5574A6","#3B3EAC"],y=function(e,t,n){return void 0===n&&(n={}),c(void 0,void 0,void 0,(function(){return d(this,(function(r){return[2,new Promise((function(r,a){var i=n.headers?"headers="+n.headers:"headers=0",o=n.query?"&tq="+encodeURIComponent(n.query):"",s=n.gid?"&gid="+n.gid:"",l=n.sheet?"&sheet="+n.sheet:"",u=n.access_token?"&access_token="+n.access_token:"",c=t+"/gviz/tq?"+(""+i+s+l+o+u);new e.visualization.Query(c).send((function(e){e.isError()?a("Error in query: "+e.getMessage()+" "+e.getDetailedMessage()):r(e.getDataTable())}))}))]}))}))},b=Object(r.createContext)(m),g=b.Provider,v=b.Consumer,w=function(e){var t=e.children,n=e.value;return Object(r.createElement)(g,{value:n},t)},M=function(e){var t=e.render;return Object(r.createElement)(v,null,(function(e){return t(e)}))},k=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={hiddenColumns:[]},t.listenToLegendToggle=function(){var e=t.props,n=e.google,r=e.googleChartWrapper;n.visualization.events.addListener(r,"select",(function(){var e=r.getChart().getSelection(),n=r.getDataTable();if(0!==e.length&&null===e[0].row&&null!==n){var a=e[0].column,i=t.getColumnID(n,a);t.state.hiddenColumns.includes(i)?t.setState((function(e){return u({},e,{hiddenColumns:e.hiddenColumns.filter((function(e){return e!==i})).slice()})})):t.setState((function(e){return u({},e,{hiddenColumns:e.hiddenColumns.concat([i])})}))}}))},t.applyFormatters=function(e,n){for(var r=t.props.google,a=0,i=n;a<i.length;a++){var o=i[a];switch(o.type){case"ArrowFormat":(s=new r.visualization.ArrowFormat(o.options)).format(e,o.column);break;case"BarFormat":(s=new r.visualization.BarFormat(o.options)).format(e,o.column);break;case"ColorFormat":for(var s=new r.visualization.ColorFormat(o.options),l=0,u=o.ranges;l<u.length;l++){var c=u[l];s.addRange.apply(s,c)}s.format(e,o.column);break;case"DateFormat":(s=new r.visualization.DateFormat(o.options)).format(e,o.column);break;case"NumberFormat":(s=new r.visualization.NumberFormat(o.options)).format(e,o.column);break;case"PatternFormat":(s=new r.visualization.PatternFormat(o.options)).format(e,o.column)}}},t.getColumnID=function(e,t){return e.getColumnId(t)||e.getColumnLabel(t)},t.draw=function(e){var n=e.data,r=e.diffdata,a=e.rows,i=e.columns,o=e.options,s=e.legend_toggle,l=e.legendToggle,u=e.chartType,m=e.formatters,p=e.spreadSheetUrl,h=e.spreadSheetQueryParameters;return c(t,void 0,void 0,(function(){var e,t,c,f,_,b,g,v,w,M,k,L,Y,D;return d(this,(function(d){switch(d.label){case 0:return e=this.props,t=e.google,c=e.googleChartWrapper,_=null,null!==r&&(b=t.visualization.arrayToDataTable(r.old),g=t.visualization.arrayToDataTable(r.new),_=t.visualization[u].prototype.computeDiff(b,g)),null===n?[3,1]:(f=Array.isArray(n)?t.visualization.arrayToDataTable(n):new t.visualization.DataTable(n),[3,5]);case 1:return null===a||null===i?[3,2]:(f=t.visualization.arrayToDataTable([i].concat(a)),[3,5]);case 2:return null===p?[3,4]:[4,y(t,p,h)];case 3:return f=d.sent(),[3,5];case 4:f=t.visualization.arrayToDataTable([]),d.label=5;case 5:for(v=f.getNumberOfColumns(),w=0;w<v;w+=1)M=this.getColumnID(f,w),this.state.hiddenColumns.includes(M)&&(k=f.getColumnLabel(w),L=f.getColumnId(w),Y=f.getColumnType(w),f.removeColumn(w),f.addColumn({label:k,id:L,type:Y}));return D=c.getChart(),"Timeline"===c.getChartType()&&D&&D.clearChart(),c.setChartType(u),c.setOptions(o),c.setDataTable(f),c.draw(),null!==this.props.googleChartDashboard&&this.props.googleChartDashboard.draw(f),null!==_&&(c.setDataTable(_),c.draw()),null!==m&&(this.applyFormatters(f,m),c.setDataTable(f),c.draw()),!0!==l&&!0!==s||this.grayOutHiddenColumns({options:o}),[2]}}))}))},t.grayOutHiddenColumns=function(e){var n=e.options,r=t.props.googleChartWrapper,a=r.getDataTable();if(null!==a){var i=a.getNumberOfColumns();if(!1!==t.state.hiddenColumns.length>0){var o=Array.from({length:i-1}).map((function(e,r){var i=t.getColumnID(a,r+1);return t.state.hiddenColumns.includes(i)?"#CCCCCC":void 0!==n.colors&&null!==n.colors?n.colors[r]:_[r]}));r.setOptions(u({},n,{colors:o})),r.draw()}}},t.onResize=function(){t.props.googleChartWrapper.draw()},t}return l(t,e),t.prototype.componentDidMount=function(){this.draw(this.props),window.addEventListener("resize",this.onResize),(this.props.legend_toggle||this.props.legendToggle)&&this.listenToLegendToggle()},t.prototype.componentWillUnmount=function(){var e=this.props,t=e.google,n=e.googleChartWrapper;window.removeEventListener("resize",this.onResize),t.visualization.events.removeAllListeners(n),"Timeline"===n.getChartType()&&n.getChart()&&n.getChart().clearChart()},t.prototype.componentDidUpdate=function(){this.draw(this.props)},t.prototype.render=function(){return null},t}(r.Component),L=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l(t,e),t.prototype.componentDidMount=function(){},t.prototype.componentWillUnmount=function(){},t.prototype.shouldComponentUpdate=function(){return!1},t.prototype.render=function(){var e=this.props,t=e.google,n=e.googleChartWrapper,a=e.googleChartDashboard;return Object(r.createElement)(M,{render:function(e){return Object(r.createElement)(k,u({},e,{google:t,googleChartWrapper:n,googleChartDashboard:a}))}})},t}(r.Component),Y=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l(t,e),t.prototype.shouldComponentUpdate=function(){return!1},t.prototype.listenToEvents=function(e){var t=this,n=e.chartEvents,r=e.google,a=e.googleChartWrapper;if(null!==n){r.visualization.events.removeAllListeners(a);for(var i=function(e){var n=e.eventName,i=e.callback;r.visualization.events.addListener(a,n,(function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];i({chartWrapper:a,props:t.props,google:r,eventArgs:e})}))},o=0,s=n;o<s.length;o++){i(s[o])}}},t.prototype.render=function(){var e=this,t=this.props,n=t.google,a=t.googleChartWrapper;return Object(r.createElement)(M,{render:function(t){return e.listenToEvents({chartEvents:t.chartEvents||null,google:n,googleChartWrapper:a}),null}})},t}(r.Component),D=0,T=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={googleChartWrapper:null,googleChartDashboard:null,googleChartControls:null,googleChartEditor:null,isReady:!1},t.graphID=null,t.dashboard_ref=Object(r.createRef)(),t.toolbar_ref=Object(r.createRef)(),t.getGraphID=function(){var e,n=t.props,r=n.graphID,a=n.graph_id;return e=null===r&&null===a?null===t.graphID?f():t.graphID:null!==r&&null===a?r:null!==a&&null===r?a:r,t.graphID=e,t.graphID},t.getControlID=function(e,t){return D+=1,void 0===e?"googlechart-control-"+t+"-"+D:e},t.addControls=function(e,n){var r=t.props,a=r.google,i=r.controls,o=null===i?null:i.map((function(e,n){var r=e.controlID,i=e.controlType,o=e.options,s=e.controlWrapperParams,l=t.getControlID(r,n);return{controlProp:e,control:new a.visualization.ControlWrapper(u({containerId:l,controlType:i,options:o},s))}}));if(null===o)return null;n.bind(o.map((function(e){return e.control})),e);for(var s=function(n){for(var r=n.control,i=n.controlProp.controlEvents,o=function(n){var i=n.callback,o=n.eventName;a.visualization.events.removeListener(r,o,i),a.visualization.events.addListener(r,o,(function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];i({chartWrapper:e,controlWrapper:r,props:t.props,google:a,eventArgs:n})}))},s=0,l=void 0===i?[]:i;s<l.length;s++){o(l[s])}},l=0,c=o;l<c.length;l++){s(c[l])}return o},t.renderChart=function(){var e=t.props,n=e.width,a=e.height,i=e.options,o=e.style,s=e.className,l=e.rootProps,c=e.google,d=u({height:a||i&&i.height,width:n||i&&i.width},o);return Object(r.createElement)("div",u({id:t.getGraphID(),style:d,className:s},l),t.state.isReady&&null!==t.state.googleChartWrapper?Object(r.createElement)(r.Fragment,null,Object(r.createElement)(L,{googleChartWrapper:t.state.googleChartWrapper,google:c,googleChartDashboard:t.state.googleChartDashboard}),Object(r.createElement)(Y,{googleChartWrapper:t.state.googleChartWrapper,google:c})):null)},t.renderControl=function(e){return void 0===e&&(e=function(e){e.control,e.controlProp;return!0}),t.state.isReady&&null!==t.state.googleChartControls?Object(r.createElement)(r.Fragment,null,t.state.googleChartControls.filter((function(t){var n=t.controlProp,r=t.control;return e({control:r,controlProp:n})})).map((function(e){var t=e.control;e.controlProp;return Object(r.createElement)("div",{key:t.getContainerId(),id:t.getContainerId()})}))):null},t.renderToolBar=function(){return null===t.props.toolbarItems?null:Object(r.createElement)("div",{ref:t.toolbar_ref})},t}return l(t,e),t.prototype.componentDidMount=function(){var e=this.props,t=e.options,n=e.google,r=e.chartType,a=e.chartWrapperParams,i=e.toolbarItems,o=e.getChartEditor,s=e.getChartWrapper,l=u({chartType:r,options:t,containerId:this.getGraphID()},a),c=new n.visualization.ChartWrapper(l);c.setOptions(t),s(c,n);var d=new n.visualization.Dashboard(this.dashboard_ref),m=this.addControls(c,d);null!==i&&n.visualization.drawToolbar(this.toolbar_ref.current,i);var p=null;null!==o&&o({chartEditor:p=new n.visualization.ChartEditor,chartWrapper:c,google:n}),this.setState({googleChartEditor:p,googleChartControls:m,googleChartDashboard:d,googleChartWrapper:c,isReady:!0})},t.prototype.componentDidUpdate=function(){if(null!==this.state.googleChartWrapper&&null!==this.state.googleChartDashboard&&null!==this.state.googleChartControls)for(var e=this.props.controls,t=0;t<e.length;t+=1){var n=e[t],r=n.controlType,a=n.options,i=n.controlWrapperParams;i&&"state"in i&&this.state.googleChartControls[t].control.setState(i.state),this.state.googleChartControls[t].control.setOptions(a),this.state.googleChartControls[t].control.setControlType(r)}},t.prototype.shouldComponentUpdate=function(e,t){return this.state.isReady!==t.isReady||e.controls!==this.props.controls},t.prototype.render=function(){var e=this.props,t=e.width,n=e.height,a=e.options,i=e.style,o=u({height:n||a&&a.height,width:t||a&&a.width},i);return null!==this.props.render?Object(r.createElement)("div",{ref:this.dashboard_ref,style:o},Object(r.createElement)("div",{ref:this.toolbar_ref,id:"toolbar"}),this.props.render({renderChart:this.renderChart,renderControl:this.renderControl,renderToolbar:this.renderToolBar})):Object(r.createElement)("div",{ref:this.dashboard_ref,style:o},this.renderControl((function(e){return"bottom"!==e.controlProp.controlPosition})),this.renderChart(),this.renderControl((function(e){return"bottom"===e.controlProp.controlPosition})),this.renderToolBar())},t}(r.Component),S=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._isMounted=!1,t.state={loadingStatus:"loading",google:null},t.onLoad=function(e){if(t.isFullyLoaded(e))t.onSuccess(e);else var n=setInterval((function(){var e=window.google;t._isMounted?e&&t.isFullyLoaded(e)&&(clearInterval(n),t.onSuccess(e)):clearInterval(n)}),1e3)},t.onSuccess=function(e){t.setState({loadingStatus:"ready",google:e})},t.onError=function(){t.setState({loadingStatus:"errored"})},t}return l(t,e),t.prototype.render=function(){var e=this.props,t=e.chartLanguage,n=e.chartPackages,a=e.chartVersion,i=e.mapsApiKey,o=e.loader,s=e.errorElement;return Object(r.createElement)(w,{value:this.props},"ready"===this.state.loadingStatus&&null!==this.state.google?Object(r.createElement)(T,u({},this.props,{google:this.state.google})):"errored"===this.state.loadingStatus&&s?s:o,Object(r.createElement)(p,u({},{chartLanguage:t,chartPackages:n,chartVersion:a,mapsApiKey:i},{onLoad:this.onLoad,onError:this.onError})))},t.prototype.componentDidMount=function(){this._isMounted=!0},t.prototype.componentWillUnmount=function(){this._isMounted=!1},t.prototype.isFullyLoaded=function(e){var t=this.props,n=t.controls,r=t.toolbarItems,a=t.getChartEditor;return e&&e.visualization&&e.visualization.ChartWrapper&&e.visualization.Dashboard&&(!n||e.visualization.ChartWrapper)&&(!a||e.visualization.ChartEditor)&&(!r||e.visualization.drawToolbar)},t.defaultProps=m,t}(r.Component),O=n(130),x=n.n(O);function j(e){return(j="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function E(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function C(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function P(e,t){return(P=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function H(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=R(e);if(t){var a=R(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return z(this,n)}}function z(e,t){return!t||"object"!==j(t)&&"function"!=typeof t?A(e):t}function A(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function R(e){return(R=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var N=wp.element,F=N.Component,W=N.Fragment,I=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&P(e,t)}(i,e);var t,n,r,a=H(i);function i(){var e;return E(this,i),(e=a.apply(this,arguments)).initDataTable=e.initDataTable.bind(A(e)),e.dataRenderer=e.dataRenderer.bind(A(e)),e.table,e.uniqueId=x()(),e}return t=i,(n=[{key:"componentDidMount",value:function(){this.initDataTable(this.props.columns,this.props.rows)}},{key:"componentWillUnmount",value:function(){this.table.destroy()}},{key:"componentDidUpdate",value:function(e){this.props!==e&&(this.props.options.responsive_bool!==e.options.responsive_bool&&"true"===e.options.responsive_bool&&document.getElementById("dataTable-instances-".concat(this.props.id,"-").concat(this.uniqueId)).classList.remove("collapsed"),this.table.destroy(),document.getElementById("dataTable-instances-".concat(this.props.id,"-").concat(this.uniqueId)).innerHTML="",this.initDataTable(this.props.columns,this.props.rows))}},{key:"initDataTable",value:function(e,t){var n=this,r=this.props.options,a=e.map((function(e,t){var r=e.type;switch(e.type){case"number":r="num";break;case"date":case"datetime":case"timeofday":r="date"}return{title:e.label,data:e.label,type:r,render:n.dataRenderer(r,t)}})),i=t.map((function(e){var t={};return a.forEach((function(n,r){var a=e[r];void 0===a&&(a=e[n.data]),t[n.data]=a})),t}));this.table=jQuery("#dataTable-instances-".concat(this.props.id,"-").concat(this.uniqueId)).DataTable({destroy:!0,data:i,columns:a,paging:"true"===r.paging_bool,pageLength:r.pageLength_int||10,pagingType:r.pagingType,ordering:"false"!==r.ordering_bool,fixedHeader:"true"===r.fixedHeader_bool,scrollCollapse:!(!this.props.chartsScreen&&"true"!==r.scrollCollapse_bool),scrollY:(this.props.chartsScreen?180:"true"===r.scrollCollapse_bool&&Number(r.scrollY_int))||!1,responsive:!(!this.props.chartsScreen&&"true"!==r.responsive_bool),searching:!1,select:!1,lengthChange:!1,bFilter:!1,bInfo:!1})}},{key:"dataRenderer",value:function(e,t){var n,r=this.props.options,a=null;if(void 0===r.series||void 0===r.series[t]||void 0===r.series[t].format)return a;switch(e){case"date":case"datetime":case"timeofday":a=r.series[t].format&&r.series[t].format.from&&r.series[t].format.to?jQuery.fn.dataTable.render.moment(r.series[t].format.from,r.series[t].format.to):jQuery.fn.dataTable.render.moment("MM-DD-YYYY");break;case"num":var i=["","","","",""];r.series[t].format.thousands&&(i[0]=r.series[t].format.thousands),r.series[t].format.decimal&&(i[1]=r.series[t].format.decimal),r.series[t].format.precision&&0<parseInt(r.series[t].format.precision)&&(i[2]=r.series[t].format.precision),r.series[t].format.prefix&&(i[3]=r.series[t].format.prefix),r.series[t].format.suffix&&(i[4]=r.series[t].format.suffix),a=(n=jQuery.fn.dataTable.render).number.apply(n,i);break;case"boolean":jQuery.fn.dataTable.render.extra=function(e,n,a){return!0!==e&&"true"!==e||""===r.series[t].format.truthy?!1!==e&&"false"!==e||""===r.series[t].format.falsy?e:r.series[t].format.falsy.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,""):r.series[t].format.truthy.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,"")},a=jQuery.fn.dataTable.render.extra}return a}},{key:"render",value:function(){var e=this.props.options;return wp.element.createElement(W,null,e.customcss&&wp.element.createElement("style",null,e.customcss.oddTableRow&&"#dataTable-instances-".concat(this.props.id,"-").concat(this.uniqueId," tr.odd {\n\t\t\t\t\t\t\t\t").concat(e.customcss.oddTableRow.color?"color: ".concat(e.customcss.oddTableRow.color," !important;"):"","\n\t\t\t\t\t\t\t\t").concat(e.customcss.oddTableRow["background-color"]?"background-color: ".concat(e.customcss.oddTableRow["background-color"]," !important;"):"","\n\t\t\t\t\t\t\t\t").concat(e.customcss.oddTableRow.transform?"transform: rotate( ".concat(e.customcss.oddTableRow.transform,"deg ) !important;"):"","\n\t\t\t\t\t\t\t}"),e.customcss.evenTableRow&&"#dataTable-instances-".concat(this.props.id,"-").concat(this.uniqueId," tr.even {\n\t\t\t\t\t\t\t\t").concat(e.customcss.evenTableRow.color?"color: ".concat(e.customcss.evenTableRow.color," !important;"):"","\n\t\t\t\t\t\t\t\t").concat(e.customcss.evenTableRow["background-color"]?"background-color: ".concat(e.customcss.evenTableRow["background-color"]," !important;"):"","\n\t\t\t\t\t\t\t\t").concat(e.customcss.evenTableRow.transform?"transform: rotate( ".concat(e.customcss.evenTableRow.transform,"deg ) !important;"):"","\n\t\t\t\t\t\t\t}"),e.customcss.tableCell&&"#dataTable-instances-".concat(this.props.id,"-").concat(this.uniqueId," tr td,\n\t\t\t\t\t\t\t#dataTable-instances-").concat(this.props.id,"-").concat(this.uniqueId,"_wrapper tr th {\n\t\t\t\t\t\t\t\t").concat(e.customcss.tableCell.color?"color: ".concat(e.customcss.tableCell.color," !important;"):"","\n\t\t\t\t\t\t\t\t").concat(e.customcss.tableCell["background-color"]?"background-color: ".concat(e.customcss.tableCell["background-color"]," !important;"):"","\n\t\t\t\t\t\t\t\t").concat(e.customcss.tableCell.transform?"transform: rotate( ".concat(e.customcss.tableCell.transform,"deg ) !important;"):"","\n\t\t\t\t\t\t\t}")),wp.element.createElement("table",{id:"dataTable-instances-".concat(this.props.id,"-").concat(this.uniqueId)}))}}])&&C(t.prototype,n),r&&C(t,r),i}(F),B=n(4),J=n.n(B),U=n(131),V=n.n(U),q=function(e){return Object.keys(e["visualizer-series"]).map((function(t){void 0!==e["visualizer-series"][t].type&&"date"===e["visualizer-series"][t].type&&Object.keys(e["visualizer-data"]).map((function(n){return e["visualizer-data"][n][t]=new Date(e["visualizer-data"][n][t])}))})),e},G=function(e){var t;if(Array.isArray(e))return 0<e.length;if(J()(e)){for(t in e)return!0;return!1}return"string"==typeof e?0<e.length:null!=e},$=function(e){return V()(e,G)},K=function(e){return e.width="",e.height="",e.backgroundColor={},e.chartArea={},$(e)},Z=function(e){try{JSON.parse(e)}catch(e){return!1}return!0},Q=function(e,t){return!0===e[t]||"true"===e[t]||"1"===e[t]||1===e[t]},X=function(e){switch(e["visualizer-chart-library"]){case"GoogleCharts":return ee(e)}},ee=function(e){var t=e["visualizer-settings"],n=e["visualizer-chart-type"],r=e["visualizer-series"],a=[];if(t.series)switch(n){case"tabular":for(var i in t.series)if(r[(i=parseInt(i))+1]&&t.series[i].format&&""!==t.series[i].format){var o=i+1,s=te(r[i+1].type);s&&a.push({type:s,options:{pattern:t.series[i].format},column:o})}break;default:for(var l=0;l<t.series.length;l++)if(r[l+1]&&void 0!==t.series[l]&&t.series[l].format&&""!==t.series[l].format){var u=l+1,c=te(r[l+1].type);c&&a.push({type:c,options:{pattern:t.series[l].format},column:u})}}else"pie"===n&&t.format&&""!==t.format&&a.push({type:te("number"),options:{pattern:t.format},column:1});if(t.hAxis&&r[0]){var d=te(r[0].type);d&&a.push({type:d,options:{pattern:t.hAxis.format},column:0})}return a},te=function(e){switch(e){case"number":return"NumberFormat";case"date":case"datetime":case"timeofday":return"DateFormat"}return null};function ne(e){return(ne="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function re(e,t,n,r,a,i,o){try{var s=e[i](o),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,a)}function ae(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var i=e.apply(t,n);function o(e){re(i,r,a,o,s,"next",e)}function s(e){re(i,r,a,o,s,"throw",e)}o(void 0)}))}}function ie(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function oe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function se(e,t){return(se=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function le(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=de(e);if(t){var a=de(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return ue(this,n)}}function ue(e,t){return!t||"object"!==ne(t)&&"function"!=typeof t?ce(e):t}function ce(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function de(e){return(de=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var me=lodash.startCase,pe=wp.i18n.__,he=wp.apiFetch,fe=wp.element,_e=fe.Component,ye=fe.Fragment,be=wp.components,ge=be.Button,ve=be.Dashicon,we=be.ExternalLink,Me=be.Notice,ke=be.Placeholder,Le=be.Spinner,Ye=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&se(e,t)}(s,e);var t,n,r,a,i,o=le(s);function s(){var e;return ie(this,s),(e=o.apply(this,arguments)).loadMoreCharts=e.loadMoreCharts.bind(ce(e)),e.state={charts:null,isBusy:!1,chartsLoaded:!1,perPage:visualizerLocalize.chartsPerPage},e}return t=s,(n=[{key:"componentDidMount",value:(i=ae(regeneratorRuntime.mark((function e(){var t,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=visualizerLocalize.chartsPerPage,e.next=3,he({path:"wp/v2/visualizer/?per_page="+t+"&meta_key=visualizer-chart-library&meta_value=ChartJS"});case 3:n=e.sent,this.setState({charts:n});case 5:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"loadMoreCharts",value:(a=ae(regeneratorRuntime.mark((function e(){var t,n,r,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.state.charts.length,n=this.state.chartsLoaded,r=this.state.perPage,this.setState({isBusy:!0}),e.next=6,he({path:"wp/v2/visualizer/?per_page=".concat(r,"&meta_key=visualizer-chart-library&meta_value=ChartJS&offset=").concat(t)});case 6:a=e.sent,r>a.length&&(n=!0),this.setState({charts:this.state.charts.concat(a),isBusy:!1,chartsLoaded:n});case 9:case"end":return e.stop()}}),e,this)}))),function(){return a.apply(this,arguments)})},{key:"render",value:function(){var e=this,t="undefined"!=typeof google?google.visualization.Version:"current",n=this.state,r=n.charts,a=n.isBusy,i=n.chartsLoaded,o=n.perPage;return wp.element.createElement("div",{className:"visualizer-settings__charts"},wp.element.createElement(Me,{status:"warning",isDismissible:!1},pe("ChartJS charts are currently not available for selection here, you must visit the library, get the shortcode, and add the chart here in a shortcode tag."),wp.element.createElement(we,{href:visualizerLocalize.adminPage},pe("Click here to visit Visualizer Charts Library."))),null!==r?1<=r.length?wp.element.createElement(ye,null,wp.element.createElement("div",{className:"visualizer-settings__charts-grid"},Object.keys(r).map((function(n){var a,i,o,s=q(r[n].chart_data);if(a=s["visualizer-settings"].title?s["visualizer-settings"].title:"#".concat(r[n].id),0<=["gauge","tabular","timeline"].indexOf(s["visualizer-chart-type"])?"DataTable"===s["visualizer-chart-library"]?i=s["visualizer-chart-type"]:("tabular"===(i=s["visualizer-chart-type"])&&(i="table"),i=me(i)):i="".concat(me(s["visualizer-chart-type"]),"Chart"),!s["visualizer-chart-library"]||"ChartJS"!==s["visualizer-chart-library"])return s["visualizer-data-exploded"]&&(o=pe("Annotations in this chart may not display here but they will display in the front end.")),wp.element.createElement("div",{className:"visualizer-settings__charts-single","data-chart-type":i,key:"chart-".concat(r[n].id)},wp.element.createElement("div",{className:"visualizer-settings__charts-title"},a),"DataTable"===s["visualizer-chart-library"]?wp.element.createElement(I,{id:r[n].id,rows:s["visualizer-data"],columns:s["visualizer-series"],chartsScreen:!0,options:s["visualizer-settings"]}):(s["visualizer-data-exploded"],wp.element.createElement(S,{chartVersion:t,chartType:i,rows:s["visualizer-data"],columns:s["visualizer-series"],options:K(s["visualizer-settings"]),formatters:X(s)})),wp.element.createElement("div",{className:"visualizer-settings__charts-footer"},wp.element.createElement("sub",null,o)),wp.element.createElement("div",{className:"visualizer-settings__charts-controls",title:pe("Insert Chart"),onClick:function(){return e.props.getChart(r[n].id)}},wp.element.createElement(ve,{icon:"upload"})))}))),!i&&o-1<r.length&&wp.element.createElement(ge,{isPrimary:!0,isLarge:!0,onClick:this.loadMoreCharts,isBusy:a},pe("Load More"))):wp.element.createElement("p",{className:"visualizer-no-charts"},pe("No charts found.")):wp.element.createElement(ke,null,wp.element.createElement(Le,null)))}}])&&oe(t.prototype,n),r&&oe(t,r),s}(_e);function De(e){return(De="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Te(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Se(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Oe(e,t){return(Oe=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function xe(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Ce(e);if(t){var a=Ce(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return je(this,n)}}function je(e,t){return!t||"object"!==De(t)&&"function"!=typeof t?Ee(e):t}function Ee(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ce(e){return(Ce=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Pe=wp.i18n.__,He=wp.element.Component,ze=wp.components,Ae=ze.Button,Re=ze.ExternalLink,Ne=ze.PanelBody,Fe=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Oe(e,t)}(i,e);var t,n,r,a=xe(i);function i(){var e;return Te(this,i),(e=a.apply(this,arguments)).uploadInput=React.createRef(),e.fileUploaded=e.fileUploaded.bind(Ee(e)),e.uploadImport=e.uploadImport.bind(Ee(e)),e.state={uploadLabel:Pe("Upload")},e}return t=i,(n=[{key:"fileUploaded",value:function(e){"text/csv"===e.target.files[0].type&&this.setState({uploadLabel:Pe("Upload")})}},{key:"uploadImport",value:function(){this.props.readUploadedFile(this.uploadInput),this.setState({uploadLabel:Pe("Uploaded")})}},{key:"render",value:function(){return wp.element.createElement(Ne,{title:Pe("Import data from file"),initialOpen:!1},wp.element.createElement("p",null,Pe("Select and upload your data CSV file here. The first row of the CSV file should contain the column headings. The second one should contain series type (string, number, boolean, date, datetime, timeofday).")),wp.element.createElement("p",null,Pe("If you are unsure about how to format your data CSV then please take a look at this sample: "),wp.element.createElement(Re,{href:"".concat(visualizerLocalize.absurl,"samples/").concat(this.props.chart["visualizer-chart-type"],".csv")},"".concat(this.props.chart["visualizer-chart-type"],".csv"))),wp.element.createElement("input",{type:"file",accept:"text/csv",ref:this.uploadInput,onChange:this.fileUploaded}),wp.element.createElement(Ae,{isPrimary:!0,onClick:this.uploadImport},this.state.uploadLabel))}}])&&Se(t.prototype,n),r&&Se(t,r),i}(He);function We(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ie(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?We(Object(n),!0).forEach((function(t){Be(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):We(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Be(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Je(e){return(Je="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ue(e,t,n,r,a,i,o){try{var s=e[i](o),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,a)}function Ve(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var i=e.apply(t,n);function o(e){Ue(i,r,a,o,s,"next",e)}function s(e){Ue(i,r,a,o,s,"throw",e)}o(void 0)}))}}function qe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ge(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function $e(e,t){return($e=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Ke(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Xe(e);if(t){var a=Xe(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Ze(this,n)}}function Ze(e,t){return!t||"object"!==Je(t)&&"function"!=typeof t?Qe(e):t}function Qe(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Xe(e){return(Xe=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var et=wp.i18n.__,tt=wp,nt=(tt.apiFetch,tt.apiRequest),rt=wp.element.Component,at=wp.components,it=at.Button,ot=at.ExternalLink,st=at.IconButton,lt=at.Modal,ut=at.PanelBody,ct=at.SelectControl,dt=at.TextControl,mt=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&$e(e,t)}(c,e);var t,n,r,a,i,o,s,l,u=Ke(c);function c(){var e;return qe(this,c),(e=u.apply(this,arguments)).openModal=e.openModal.bind(Qe(e)),e.initTable=e.initTable.bind(Qe(e)),e.onToggle=e.onToggle.bind(Qe(e)),e.toggleHeaders=e.toggleHeaders.bind(Qe(e)),e.getJSONRoot=e.getJSONRoot.bind(Qe(e)),e.getJSONData=e.getJSONData.bind(Qe(e)),e.getTableData=e.getTableData.bind(Qe(e)),e.state={isOpen:!1,isLoading:!1,isFirstStepOpen:!0,isSecondStepOpen:!1,isThirdStepOpen:!1,isFourthStepOpen:!1,isHeaderPanelOpen:!1,endpointRoots:[],endpointPaging:[],table:null,requestHeaders:{method:"GET",username:"",password:"",auth:""}},e}return t=c,(n=[{key:"openModal",value:(l=Ve(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.setState({isOpen:!0});case 2:t=document.querySelector("#visualizer-json-query-table"),this.state.isFourthStepOpen&&null!==this.state.table&&(t.innerHTML=this.state.table,this.initTable());case 4:case"end":return e.stop()}}),e,this)}))),function(){return l.apply(this,arguments)})},{key:"initTable",value:function(){jQuery("#visualizer-json-query-table table").DataTable({paging:!1,searching:!1,ordering:!1,select:!1,scrollX:"600px",scrollY:"400px",info:!1,colReorder:{fixedColumnsLeft:1},dom:"Bt",buttons:[{extend:"colvis",columns:":gt(0)",collectionLayout:"four-column"}]})}},{key:"onToggle",value:(s=Ve(regeneratorRuntime.mark((function e(t){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null===this.state.table&&this.state.endpointRoots&&0<this.state.endpointRoots.length&&("isFirstStepOpen"===t||"isSecondStepOpen"===t)&&this.setState({isFirstStepOpen:"isFirstStepOpen"===t,isSecondStepOpen:"isSecondStepOpen"===t,isThirdStepOpen:!1,isFourthStepOpen:!1}),null===this.state.table){e.next=5;break}return e.next=4,this.setState({isFirstStepOpen:"isFirstStepOpen"===t,isSecondStepOpen:"isSecondStepOpen"===t,isThirdStepOpen:"isThirdStepOpen"===t,isFourthStepOpen:"isFourthStepOpen"===t});case 4:"isFourthStepOpen"===t&&(n=document.querySelector("#visualizer-json-query-table"),this.state.isFourthStepOpen&&(n.innerHTML=this.state.table,this.initTable()));case 5:case"end":return e.stop()}}),e,this)}))),function(e){return s.apply(this,arguments)})},{key:"toggleHeaders",value:function(){this.setState({isHeaderPanelOpen:!this.state.isHeaderPanelOpen})}},{key:"getJSONRoot",value:(o=Ve(regeneratorRuntime.mark((function e(){var t,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.setState({isLoading:!0,endpointRoots:[],endpointPaging:[],table:null}),e.next=3,nt({path:"/visualizer/v1/get-json-root?url=".concat(this.props.chart["visualizer-json-url"]),data:{method:this.props.chart["visualizer-json-headers"]?this.props.chart["visualizer-json-headers"].method:this.state.requestHeaders.method,username:this.props.chart["visualizer-json-headers"]&&"object"===Je(this.props.chart["visualizer-json-headers"].auth)?this.props.chart["visualizer-json-headers"].auth.username:this.state.requestHeaders.username,password:this.props.chart["visualizer-json-headers"]&&"object"===Je(this.props.chart["visualizer-json-headers"].auth)?this.props.chart["visualizer-json-headers"].auth.password:this.state.requestHeaders.password,auth:this.props.chart["visualizer-json-headers"]&&"object"!==Je(this.props.chart["visualizer-json-headers"].auth)?this.props.chart["visualizer-json-headers"].auth:this.state.requestHeaders.auth},method:"GET"});case 3:(t=e.sent).success?(n=Object.keys(t.data.roots).map((function(e){return{label:t.data.roots[e].replace(/>/g," ➤ "),value:t.data.roots[e]}})),this.setState({isLoading:!1,isFirstStepOpen:!1,isSecondStepOpen:!0,endpointRoots:n})):(this.setState({isLoading:!1}),alert(t.data.msg));case 5:case"end":return e.stop()}}),e,this)}))),function(){return o.apply(this,arguments)})},{key:"getJSONData",value:(i=Ve(regeneratorRuntime.mark((function e(){var t,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.setState({isLoading:!0}),e.next=3,nt({path:"/visualizer/v1/get-json-data?url=".concat(this.props.chart["visualizer-json-url"],"&chart=").concat(this.props.id),data:{root:this.props.chart["visualizer-json-root"]||this.state.endpointRoots[0].value,method:this.props.chart["visualizer-json-headers"]?this.props.chart["visualizer-json-headers"].method:this.state.requestHeaders.method,username:this.props.chart["visualizer-json-headers"]&&"object"===Je(this.props.chart["visualizer-json-headers"].auth)?this.props.chart["visualizer-json-headers"].auth.username:this.state.requestHeaders.username,password:this.props.chart["visualizer-json-headers"]&&"object"===Je(this.props.chart["visualizer-json-headers"].auth)?this.props.chart["visualizer-json-headers"].auth.password:this.state.requestHeaders.password,auth:this.props.chart["visualizer-json-headers"]&&"object"!==Je(this.props.chart["visualizer-json-headers"].auth)?this.props.chart["visualizer-json-headers"].auth:this.state.requestHeaders.auth},method:"GET"});case 3:(t=e.sent).success?(n=[{label:et("Don't use pagination"),value:0}],t.data.paging&&"root>next"===t.data.paging[0]&&n.push({label:et("Get first 5 pages using root ➤ next"),value:"root>next"}),this.setState({isLoading:!1,isSecondStepOpen:!1,isFourthStepOpen:!0,endpointPaging:n,table:t.data.table}),document.querySelector("#visualizer-json-query-table").innerHTML=t.data.table,this.initTable()):(this.setState({isLoading:!1}),alert(t.data.msg));case 5:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"getTableData",value:(a=Ve(regeneratorRuntime.mark((function e(){var t,n,r,a,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.setState({isLoading:!0}),t=document.querySelectorAll("#visualizer-json-query-table input"),n=document.querySelectorAll("#visualizer-json-query-table select"),r=[],a={},t.forEach((function(e){return r.push(e.value)})),n.forEach((function(e){return a[e.name]=e.value})),e.next=9,nt({path:"/visualizer/v1/set-json-data",data:Ie({url:this.props.chart["visualizer-json-url"],method:this.props.chart["visualizer-json-headers"]?this.props.chart["visualizer-json-headers"].method:this.state.requestHeaders.method,username:this.props.chart["visualizer-json-headers"]&&"object"===Je(this.props.chart["visualizer-json-headers"].auth)?this.props.chart["visualizer-json-headers"].auth.username:this.state.requestHeaders.username,password:this.props.chart["visualizer-json-headers"]&&"object"===Je(this.props.chart["visualizer-json-headers"].auth)?this.props.chart["visualizer-json-headers"].auth.password:this.state.requestHeaders.password,auth:this.props.chart["visualizer-json-headers"]&&"object"!==Je(this.props.chart["visualizer-json-headers"].auth)?this.props.chart["visualizer-json-headers"].auth:this.state.requestHeaders.auth,root:this.props.chart["visualizer-json-root"]||this.state.endpointRoots[0].value,paging:this.props.chart["visualizer-json-paging"]||0,header:r},a),method:"GET"});case 9:(i=e.sent).success?(this.props.JSONImportData(i.data.name,JSON.parse(i.data.series),JSON.parse(i.data.data)),this.setState({isOpen:!1,isLoading:!1})):(alert(i.data.msg),this.setState({isLoading:!1}));case 11:case"end":return e.stop()}}),e,this)}))),function(){return a.apply(this,arguments)})},{key:"render",value:function(){var e=this;return wp.element.createElement(ut,{title:et("Import from JSON"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement("p",null,et("You can choose here to import or synchronize your chart data with a remote JSON source.")),wp.element.createElement("p",null,wp.element.createElement(ot,{href:"https://docs.themeisle.com/article/1052-how-to-generate-charts-from-json-data-rest-endpoints"},et("For more info check this tutorial."))),wp.element.createElement(ct,{label:et("How often do you want to check the url?"),value:this.props.chart["visualizer-json-schedule"]?this.props.chart["visualizer-json-schedule"]:1,options:[{label:et("One-time"),value:"-1"},{label:et("Live"),value:"0"},{label:et("Each hour"),value:"1"},{label:et("Each 12 hours"),value:"12"},{label:et("Each day"),value:"24"},{label:et("Each 3 days"),value:"72"}],onChange:this.props.editSchedule}),wp.element.createElement(it,{isPrimary:!0,isLarge:!0,onClick:this.openModal},et("Modify Parameters")),this.state.isOpen&&wp.element.createElement(lt,{title:et("Import from JSON"),className:"visualizer-json-query-modal",shouldCloseOnClickOutside:!1,onRequestClose:function(){e.setState({isOpen:!1,isTableRendered:!1})}},wp.element.createElement(ut,{title:et("Step 1: Specify the JSON endpoint/URL"),opened:this.state.isFirstStepOpen,onToggle:function(){return e.onToggle("isFirstStepOpen")}},wp.element.createElement("p",null,et("If you want to add authentication, add headers to the endpoint or change the request in any way, please refer to our document here:")),wp.element.createElement("p",null,wp.element.createElement(ot,{href:"https://docs.themeisle.com/article/1043-visualizer-how-to-extend-rest-endpoints-with-json-response"},et("How to extend REST endpoints with JSON response"))),wp.element.createElement(dt,{placeholder:et("Please enter the URL of your JSON file"),value:this.props.chart["visualizer-json-url"]?this.props.chart["visualizer-json-url"]:"",onChange:this.props.editJSONURL}),wp.element.createElement(st,{icon:"arrow-right-alt2",label:et("Add Headers"),onClick:this.toggleHeaders},et("Add Headers")),this.state.isHeaderPanelOpen&&wp.element.createElement("div",{className:"visualizer-json-query-modal-headers-panel"},wp.element.createElement(ct,{label:et("Request Type"),value:this.props.chart["visualizer-json-headers"]?this.props.chart["visualizer-json-headers"].method:this.state.requestHeaders.method,options:[{value:"GET",label:et("GET")},{value:"POST",label:et("POST")}],onChange:function(t){var n=Ie({},e.state.requestHeaders),r=e.state.requestHeaders;n.method=t,r=Ie(Ie({},r),{},{method:t}),e.setState({requestHeaders:r}),e.props.editJSONHeaders(n)}}),wp.element.createElement("p",null,et("Credentials")),wp.element.createElement(dt,{label:et("Username"),placeholder:et("Username/Access Key"),value:this.props.chart["visualizer-json-headers"]&&"object"===Je(this.props.chart["visualizer-json-headers"].auth)?this.props.chart["visualizer-json-headers"].auth.username:this.state.requestHeaders.username,onChange:function(t){var n=Ie({},e.state.requestHeaders),r=e.state.requestHeaders;n.auth={username:t,password:e.props.chart["visualizer-json-headers"]&&"object"===Je(e.props.chart["visualizer-json-headers"].auth)?e.props.chart["visualizer-json-headers"].auth.password:e.state.requestHeaders.password},r=Ie(Ie({},r),{},{username:t,password:n.password}),e.setState({requestHeaders:r}),e.props.editJSONHeaders(n)}}),wp.element.createElement("span",{className:"visualizer-json-query-modal-field-separator"},et("&")),wp.element.createElement(dt,{label:et("Password"),placeholder:et("Password/Secret Key"),type:"password",value:this.props.chart["visualizer-json-headers"]&&"object"===Je(this.props.chart["visualizer-json-headers"].auth)?this.props.chart["visualizer-json-headers"].auth.password:this.state.requestHeaders.password,onChange:function(t){var n=Ie({},e.state.requestHeaders),r=e.state.requestHeaders;n.auth={username:e.props.chart["visualizer-json-headers"]&&"object"===Je(e.props.chart["visualizer-json-headers"].auth)?e.props.chart["visualizer-json-headers"].auth.username:e.state.requestHeaders.username,password:t},r=Ie(Ie({},r),{},{username:n.username,password:t}),e.setState({requestHeaders:r}),e.props.editJSONHeaders(n)}}),wp.element.createElement("p",null,et("OR")),wp.element.createElement(dt,{label:et("Authorization"),placeholder:et("e.g. SharedKey <AccountName>:<Signature>"),value:this.props.chart["visualizer-json-headers"]&&"object"!==Je(this.props.chart["visualizer-json-headers"].auth)?this.props.chart["visualizer-json-headers"].auth:this.state.requestHeaders.auth,onChange:function(t){var n=Ie({},e.state.requestHeaders),r=e.state.requestHeaders;n.auth=t,r=Ie(Ie({},r),{},{auth:t}),e.setState({requestHeaders:r}),e.props.editJSONHeaders(n)}})),wp.element.createElement(it,{isPrimary:!0,isLarge:!0,isBusy:this.state.isLoading,disabled:this.state.isLoading,onClick:this.getJSONRoot},et("Fetch Endpoint"))),wp.element.createElement(ut,{title:et("Step 2: Choose the JSON root"),initialOpen:!1,opened:this.state.isSecondStepOpen,onToggle:function(){return e.onToggle("isSecondStepOpen")}},wp.element.createElement("p",null,et("If you see Invalid Data, you may have selected the wrong root to fetch data from. Please select an alternative.")),wp.element.createElement(ct,{value:this.props.chart["visualizer-json-root"],options:this.state.endpointRoots,onChange:this.props.editJSONRoot}),wp.element.createElement(it,{isPrimary:!0,isLarge:!0,isBusy:this.state.isLoading,disabled:this.state.isLoading,onClick:this.getJSONData},et("Parse Endpoint"))),wp.element.createElement(ut,{title:et("Step 3: Specify miscellaneous parameters"),initialOpen:!1,opened:this.state.isThirdStepOpen,onToggle:function(){return e.onToggle("isThirdStepOpen")}},"community"!==visualizerLocalize.isPro?wp.element.createElement(ct,{value:this.props.chart["visualizer-json-paging"]||0,options:this.state.endpointPaging,onChange:this.props.editJSONPaging}):wp.element.createElement("p",null,et("Enable this feature in PRO version!"))),wp.element.createElement(ut,{title:et("Step 4: Select the data to display in the chart"),initialOpen:!1,opened:this.state.isFourthStepOpen,onToggle:function(){return e.onToggle("isFourthStepOpen")}},wp.element.createElement("ul",null,wp.element.createElement("li",null,et("Select whether to include the data in the chart. Each column selected will form one series.")),wp.element.createElement("li",null,et("If a column is selected to be included, specify its data type.")),wp.element.createElement("li",null,et("You can use drag/drop to reorder the columns but this column position is not saved. So when you reload the table, you may have to reorder again.")),wp.element.createElement("li",null,et("You can select any number of columns but the chart type selected will determine how many will display in the chart."))),wp.element.createElement("div",{id:"visualizer-json-query-table"}),wp.element.createElement(it,{isPrimary:!0,isLarge:!0,isBusy:this.state.isLoading,disabled:this.state.isLoading,onClick:this.getTableData},et("Save & Show Chart")))))}}])&&Ge(t.prototype,n),r&&Ge(t,r),c}(rt);function pt(e){return(pt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ht(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ft(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function _t(e,t){return(_t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function yt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=gt(e);if(t){var a=gt(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return bt(this,n)}}function bt(e,t){return!t||"object"!==pt(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function gt(e){return(gt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var vt=wp.i18n.__,wt=wp.element.Component,Mt=wp.components,kt=Mt.Button,Lt=Mt.ExternalLink,Yt=Mt.PanelBody,Dt=Mt.SelectControl,Tt=Mt.TextControl,St=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&_t(e,t)}(i,e);var t,n,r,a=yt(i);function i(){return ht(this,i),a.apply(this,arguments)}return t=i,(n=[{key:"render",value:function(){var e=this;return wp.element.createElement(Yt,{title:vt("Import data from URL"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(Yt,{title:vt("One Time Import"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement("p",null,vt("You can use this to import data from a remote CSV file. The first row of the CSV file should contain the column headings. The second one should contain series type (string, number, boolean, date, datetime, timeofday).")),wp.element.createElement("p",null,vt("If you are unsure about how to format your data CSV then please take a look at this sample: "),wp.element.createElement(Lt,{href:"".concat(visualizerLocalize.absurl,"samples/").concat(this.props.chart["visualizer-chart-type"],".csv")},"".concat(this.props.chart["visualizer-chart-type"],".csv"))),wp.element.createElement("p",null,vt("You can also import data from Google Spreadsheet.")),wp.element.createElement(Tt,{placeholder:vt("Please enter the URL of your CSV file"),value:this.props.chart["visualizer-chart-url"]?this.props.chart["visualizer-chart-url"]:"",onChange:this.props.editURL}),wp.element.createElement(kt,{isPrimary:!0,isLarge:!0,isBusy:"uploadData"===this.props.isLoading,disabled:"uploadData"===this.props.isLoading,onClick:function(){return e.props.uploadData(!1)}},vt("Import Data"))),"business"===visualizerLocalize.isPro?wp.element.createElement(Yt,{title:vt("Schedule Import"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement("p",null,vt("You can choose here to synchronize your chart data with a remote CSV file. ")),wp.element.createElement("p",null,vt("You can also synchronize with your Google Spreadsheet file.")),wp.element.createElement("p",null,vt("We will update the chart data based on your time interval preference by overwritting the current data with the one from the URL.")),wp.element.createElement(Tt,{placeholder:vt("Please enter the URL of your CSV file"),value:this.props.chart["visualizer-chart-url"]?this.props.chart["visualizer-chart-url"]:"",onChange:this.props.editURL}),wp.element.createElement(Dt,{label:vt("How often do you want to check the url?"),value:this.props.chart["visualizer-chart-schedule"]?this.props.chart["visualizer-chart-schedule"]:1,options:[{label:vt("Each hour"),value:"1"},{label:vt("Each 12 hours"),value:"12"},{label:vt("Each day"),value:"24"},{label:vt("Each 3 days"),value:"72"}],onChange:this.props.editSchedule}),wp.element.createElement(kt,{isPrimary:!0,isLarge:!0,isBusy:"uploadData"===this.props.isLoading,disabled:"uploadData"===this.props.isLoading,onClick:function(){return e.props.uploadData(!0)}},vt("Save Schedule"))):wp.element.createElement(Yt,{title:vt("Schedule Import"),icon:"lock",className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement("p",null,vt("Upgrade your license to at least the DEVELOPER version to activate this feature!")),wp.element.createElement(kt,{isPrimary:!0,href:visualizerLocalize.proTeaser,target:"_blank"},vt("Buy Now"))),wp.element.createElement(mt,{id:this.props.id,chart:this.props.chart,editSchedule:this.props.editJSONSchedule,editJSONURL:this.props.editJSONURL,editJSONHeaders:this.props.editJSONHeaders,editJSONRoot:this.props.editJSONRoot,editJSONPaging:this.props.editJSONPaging,JSONImportData:this.props.JSONImportData}))}}])&&ft(t.prototype,n),r&&ft(t,r),i}(wt);function Ot(e){return(Ot="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function xt(e,t,n,r,a,i,o){try{var s=e[i](o),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,a)}function jt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Et(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Ct(e,t){return(Ct=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Pt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=zt(e);if(t){var a=zt(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Ht(this,n)}}function Ht(e,t){return!t||"object"!==Ot(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function zt(e){return(zt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var At=wp.i18n.__,Rt=wp.apiFetch,Nt=wp.element,Ft=Nt.Component,Wt=Nt.Fragment,It=wp.components,Bt=It.Button,Jt=It.PanelBody,Ut=It.Placeholder,Vt=It.SelectControl,qt=It.Spinner,Gt=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ct(e,t)}(s,e);var t,n,r,a,i,o=Pt(s);function s(){var e;return jt(this,s),(e=o.apply(this,arguments)).state={id:"",charts:[]},e}return t=s,(n=[{key:"componentDidMount",value:(a=regeneratorRuntime.mark((function e(){var t,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Rt({path:"wp/v2/visualizer/?per_page=100"});case 2:t=(t=e.sent).map((function(e,t){var r=e.chart_data["visualizer-settings"].title?e.chart_data["visualizer-settings"].title:"#".concat(e.id);return 0===t&&(n=e.id),{value:e.id,label:r}})),this.setState({id:n,charts:t});case 5:case"end":return e.stop()}}),e,this)})),i=function(){var e=this,t=arguments;return new Promise((function(n,r){var i=a.apply(e,t);function o(e){xt(i,n,r,o,s,"next",e)}function s(e){xt(i,n,r,o,s,"throw",e)}o(void 0)}))},function(){return i.apply(this,arguments)})},{key:"render",value:function(){var e=this;return"community"!==visualizerLocalize.isPro?wp.element.createElement(Jt,{title:At("Import from other chart"),initialOpen:!1},1<=this.state.charts.length?wp.element.createElement(Wt,null,wp.element.createElement(Vt,{label:At("You can import here data from your previously created charts."),value:this.state.id,options:this.state.charts,onChange:function(t){return e.setState({id:t})}}),wp.element.createElement(Bt,{isPrimary:!0,isLarge:!0,isBusy:"getChartData"===this.props.isLoading,onClick:function(){return e.props.getChartData(e.state.id)}},At("Import Chart"))):wp.element.createElement(Ut,null,wp.element.createElement(qt,null))):wp.element.createElement(Jt,{title:At("Import from other chart"),icon:"lock",initialOpen:!1},wp.element.createElement("p",null,At("Enable this feature in PRO version!")),wp.element.createElement(Bt,{isPrimary:!0,href:visualizerLocalize.proTeaser,target:"_blank"},At("Buy Now")))}}])&&Et(t.prototype,n),r&&Et(t,r),s}(Ft);function $t(e){return($t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Kt(e,t,n,r,a,i,o){try{var s=e[i](o),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,a)}function Zt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Qt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Xt(e,t){return(Xt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function en(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=rn(e);if(t){var a=rn(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return tn(this,n)}}function tn(e,t){return!t||"object"!==$t(t)&&"function"!=typeof t?nn(e):t}function nn(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function rn(e){return(rn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var an=wp.i18n.__,on=wp.apiRequest,sn=wp.components,ln=sn.Button,un=sn.ExternalLink,cn=wp.element,dn=cn.Component,mn=cn.Fragment,pn=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Xt(e,t)}(s,e);var t,n,r,a,i,o=en(s);function s(){var e;return Zt(this,s),(e=o.apply(this,arguments)).onSave=e.onSave.bind(nn(e)),e.state={isLoading:!1,success:!1,query:"",name:"",series:{},data:[]},e}return t=s,(n=[{key:"componentDidMount",value:function(){var e=wp.CodeMirror||CodeMirror,t=document.querySelector(".visualizer-db-query"),n=e.fromTextArea(t,{autofocus:!0,mode:"text/x-mysql",lineWrapping:!0,dragDrop:!1,matchBrackets:!0,autoCloseBrackets:!0,extraKeys:{"Ctrl-Space":"autocomplete"},hintOptions:{tables:visualizerLocalize.sqlTable}});n.on("inputRead",(function(){n.save()}))}},{key:"onSave",value:(a=regeneratorRuntime.mark((function e(){var t,n,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=document.querySelector(".visualizer-db-query").value,(n=document.querySelector("#visualizer-db-query-table")).innerHTML="",e.next=5,this.setState({isLoading:!0});case 5:return e.next=7,on({path:"/visualizer/v1/get-query-data",data:{query:t},method:"GET"});case 7:return r=e.sent,e.next=10,this.setState({isLoading:!1,success:r.success,query:t,name:r.data.name||"",series:r.data.series||{},data:r.data.data||[]});case 10:n.innerHTML=r.data.table||r.data.msg,this.state.success&&jQuery("#results").DataTable({paging:!1});case 12:case"end":return e.stop()}}),e,this)})),i=function(){var e=this,t=arguments;return new Promise((function(n,r){var i=a.apply(e,t);function o(e){Kt(i,n,r,o,s,"next",e)}function s(e){Kt(i,n,r,o,s,"throw",e)}o(void 0)}))},function(){return i.apply(this,arguments)})},{key:"render",value:function(){var e=this;return wp.element.createElement(mn,null,wp.element.createElement("textarea",{className:"visualizer-db-query",placeholder:an("Your query goes here…")},this.props.chart["visualizer-db-query"]),wp.element.createElement("div",{className:"visualizer-db-query-actions"},wp.element.createElement(ln,{isLarge:!0,isDefault:!0,isBusy:this.state.isLoading,onClick:this.onSave},an("Show Results")),wp.element.createElement(ln,{isLarge:!0,isPrimary:!0,disabled:!this.state.success,onClick:function(){return e.props.save(e.state.query,e.state.name,e.state.series,e.state.data)}},an("Save"))),wp.element.createElement("ul",null,wp.element.createElement("li",null,wp.element.createElement(un,{href:"https://docs.themeisle.com/article/970-visualizer-sample-queries-to-generate-charts"},an("Examples of queries and links to resources that you can use with this feature."))),wp.element.createElement("li",null,an("Use Control+Space for autocompleting keywords or table names."))),wp.element.createElement("div",{id:"visualizer-db-query-table",className:!this.state.success&&"db-wizard-error"}))}}])&&Qt(t.prototype,n),r&&Qt(t,r),s}(dn);function hn(e){return(hn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function fn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _n(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function yn(e,t){return(yn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function bn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=wn(e);if(t){var a=wn(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return gn(this,n)}}function gn(e,t){return!t||"object"!==hn(t)&&"function"!=typeof t?vn(e):t}function vn(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function wn(e){return(wn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Mn=wp.i18n.__,kn=wp.element.Component,Ln=wp.components,Yn=Ln.Button,Dn=Ln.Modal,Tn=Ln.PanelBody,Sn=Ln.SelectControl,On=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&yn(e,t)}(i,e);var t,n,r,a=bn(i);function i(){var e;return fn(this,i),(e=a.apply(this,arguments)).save=e.save.bind(vn(e)),e.state={isOpen:!1},e}return t=i,(n=[{key:"save",value:function(e,t,n,r){this.props.databaseImportData(e,t,n,r),this.setState({isOpen:!1})}},{key:"render",value:function(){var e=this;return"business"!==visualizerLocalize.isPro?wp.element.createElement(Tn,{title:Mn("Import data from database"),icon:"lock",initialOpen:!1},wp.element.createElement("p",null,Mn("Upgrade your license to at least the DEVELOPER version to activate this feature!")),wp.element.createElement(Yn,{isPrimary:!0,href:visualizerLocalize.proTeaser,target:"_blank"},Mn("Buy Now"))):wp.element.createElement(Tn,{title:Mn("Import data from database"),initialOpen:!1},wp.element.createElement("p",null,Mn("You can import data from the database here.")),wp.element.createElement("p",null,Mn("How often do you want to refresh the data from the database.")),wp.element.createElement(Sn,{label:Mn("How often do you want to check the url?"),value:this.props.chart["visualizer-db-schedule"]?this.props.chart["visualizer-db-schedule"]:0,options:[{label:Mn("Live"),value:"0"},{label:Mn("Each hour"),value:"1"},{label:Mn("Each 12 hours"),value:"12"},{label:Mn("Each day"),value:"24"},{label:Mn("Each 3 days"),value:"72"}],onChange:this.props.editSchedule}),wp.element.createElement(Yn,{isPrimary:!0,isLarge:!0,onClick:function(){return e.setState({isOpen:!0})}},Mn("Create Query")),this.state.isOpen&&wp.element.createElement(Dn,{title:Mn("Import from database"),onRequestClose:function(){return e.setState({isOpen:!1})},className:"visualizer-db-query-modal",shouldCloseOnClickOutside:!1},wp.element.createElement(pn,{chart:this.props.chart,changeQuery:this.props.changeQuery,save:this.save})))}}])&&_n(t.prototype,n),r&&_n(t,r),i}(kn),xn=n(132);n(152);function jn(e){return(jn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function En(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Cn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Pn(e,t){return(Pn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Hn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=An(e);if(t){var a=An(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return zn(this,n)}}function zn(e,t){return!t||"object"!==jn(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function An(e){return(An=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Rn=wp.i18n.__,Nn=wp.element.Component,Fn=wp.components,Wn=Fn.Button,In=Fn.ButtonGroup,Bn=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Pn(e,t)}(i,e);var t,n,r,a=Hn(i);function i(){var e;return En(this,i),(e=a.apply(this,arguments)).data=[],e.dates=[],e.types=["string","number","boolean","date","datetime","timeofday"],e}return t=i,(n=[{key:"componentWillMount",value:function(){var e=this;this.data[this.data.length]=[],this.data[this.data.length]=[],this.props.chart["visualizer-series"].map((function(t,n){e.data[0][n]=t.label,e.data[1][n]=t.type,"date"===t.type&&e.dates.push(n)})),this.props.chart["visualizer-data"].map((function(t){e.data[e.data.length]=t}))}},{key:"render",value:function(){var e=this;return wp.element.createElement("div",{className:"visualizer-chart-editor"},wp.element.createElement(xn.HotTable,{data:this.data,allowInsertRow:!0,contextMenu:!0,rowHeaders:!0,colHeaders:!0,allowInvalid:!1,className:"htEditor",cells:function(t,n,r){var a;return 1===t&&(a={type:"autocomplete",source:e.types,strict:!1}),0<=e.dates.indexOf(n)&&1<t&&(a={type:"date",dateFormat:"YYYY-MM-DD",correctFormat:!0}),a}}),wp.element.createElement(In,null,wp.element.createElement(Wn,{isDefault:!0,isLarge:!0,onClick:this.props.toggleModal},Rn("Close")),wp.element.createElement(Wn,{isPrimary:!0,isLarge:!0,onClick:function(t){e.props.toggleModal(),e.props.editChartData(e.data,"Visualizer_Source_Csv")}},Rn("Save"))))}}])&&Cn(t.prototype,n),r&&Cn(t,r),i}(Nn);function Jn(e){return(Jn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Un(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Vn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function qn(e,t){return(qn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Gn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Zn(e);if(t){var a=Zn(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return $n(this,n)}}function $n(e,t){return!t||"object"!==Jn(t)&&"function"!=typeof t?Kn(e):t}function Kn(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Zn(e){return(Zn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Qn=wp.i18n.__,Xn=wp.element,er=Xn.Component,tr=Xn.Fragment,nr=wp.components,rr=nr.Button,ar=nr.Modal,ir=nr.PanelBody,or=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&qn(e,t)}(i,e);var t,n,r,a=Gn(i);function i(){var e;return Un(this,i),(e=a.apply(this,arguments)).toggleModal=e.toggleModal.bind(Kn(e)),e.state={isOpen:!1},e}return t=i,(n=[{key:"toggleModal",value:function(){this.setState({isOpen:!this.state.isOpen})}},{key:"render",value:function(){return"community"!==visualizerLocalize.isPro?wp.element.createElement(tr,null,wp.element.createElement(ir,{title:Qn("Manual Data"),initialOpen:!1},wp.element.createElement("p",null,Qn("You can manually edit the chart data using a spreadsheet like editor.")),wp.element.createElement(rr,{isPrimary:!0,isLarge:!0,isBusy:this.state.isOpen,onClick:this.toggleModal},Qn("View Editor"))),this.state.isOpen&&wp.element.createElement(ar,{title:"Chart Editor",onRequestClose:this.toggleModal,shouldCloseOnClickOutside:!1},wp.element.createElement(Bn,{chart:this.props.chart,editChartData:this.props.editChartData,toggleModal:this.toggleModal}))):wp.element.createElement(ir,{title:Qn("Manual Data"),icon:"lock",initialOpen:!1},wp.element.createElement("p",null,Qn("Enable this feature in PRO version!")),wp.element.createElement(rr,{isPrimary:!0,href:visualizerLocalize.proTeaser,target:"_blank"},Qn("Buy Now")))}}])&&Vn(t.prototype,n),r&&Vn(t,r),i}(er);function sr(e){return(sr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function lr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ur(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function cr(e,t){return(cr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function dr(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=pr(e);if(t){var a=pr(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return mr(this,n)}}function mr(e,t){return!t||"object"!==sr(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function pr(e){return(pr=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var hr=wp.i18n.__,fr=wp.element.Component,_r=(wp.blockEditor||wp.editor).ColorPalette,yr=wp.components,br=yr.BaseControl,gr=yr.CheckboxControl,vr=yr.PanelBody,wr=yr.SelectControl,Mr=yr.TextControl,kr=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&cr(e,t)}(i,e);var t,n,r,a=dr(i);function i(){return lr(this,i),a.apply(this,arguments)}return t=i,(n=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-chart-type"],n=this.props.chart["visualizer-settings"],r=[{label:hr("The tooltip will be displayed when the user hovers over an element"),value:"focus"}];-1>=["timeline"].indexOf(t)&&(r[1]={label:hr("The tooltip will be displayed when the user selects an element"),value:"selection"}),r[2]={label:hr("The tooltip will not be displayed"),value:"none"};var a=[{label:hr("Left of the chart"),value:"left"},{label:hr("Right of the chart"),value:"right"},{label:hr("Above the chart"),value:"top"},{label:hr("Below the chart"),value:"bottom"},{label:hr("Omit the legend"),value:"none"}];"pie"!==t&&a.push({label:hr("Inside the chart"),value:"in"}),"bubble"===t&&(a=a.filter((function(e){return"left"!==e.value})));var i=hr("Text to display above the chart.");return 0<=["tabular","dataTable","gauge","geo","timeline"].indexOf(t)&&(i=hr("Text to display in the back-end admin area")),wp.element.createElement(vr,{title:hr("General Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(vr,{title:hr("Title"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Mr,{label:hr("Chart Title"),help:i,value:n.title,onChange:function(t){n.title=t,e.props.edit(n)}}),-1>=["tabular","dataTable","gauge","geo","pie","timeline"].indexOf(t)&&wp.element.createElement(wr,{label:hr("Chart Title Position"),help:hr("Where to place the chart title, compared to the chart area."),value:n.titlePosition?n.titlePosition:"out",options:[{label:hr("Inside the chart"),value:"in"},{label:hr("Outside the chart"),value:"out"},{label:hr("None"),value:"none"}],onChange:function(t){n.titlePosition=t,e.props.edit(n)}}),-1>=["tabular","dataTable","gauge","geo","timeline"].indexOf(t)&&wp.element.createElement(br,{label:hr("Chart Title Color")},wp.element.createElement(_r,{value:n.titleTextStyle.color,onChange:function(t){n.titleTextStyle.color=t,e.props.edit(n)}})),-1>=["tabular","dataTable","gauge","geo","pie","timeline"].indexOf(t)&&wp.element.createElement(wr,{label:hr("Axes Titles Position"),help:hr("Determines where to place the axis titles, compared to the chart area."),value:n.axisTitlesPosition?n.axisTitlesPosition:"out",options:[{label:hr("Inside the chart"),value:"in"},{label:hr("Outside the chart"),value:"out"},{label:hr("None"),value:"none"}],onChange:function(t){n.axisTitlesPosition=t,e.props.edit(n)}})),-1>=["tabular","dataTable","gauge","geo","pie","timeline"].indexOf(t)&&wp.element.createElement(vr,{title:hr("Font Styles"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(wr,{label:hr("Font Family"),help:hr("The default font family for all text in the chart."),value:n.fontName?n.fontName:"Arial",options:[{label:hr("Arial"),value:"Arial"},{label:hr("Sans Serif"),value:"Sans Serif"},{label:hr("Serif"),value:"serif"},{label:hr("Arial"),value:"Arial"},{label:hr("Wide"),value:"Arial black"},{label:hr("Narrow"),value:"Arial Narrow"},{label:hr("Comic Sans MS"),value:"Comic Sans MS"},{label:hr("Courier New"),value:"Courier New"},{label:hr("Garamond"),value:"Garamond"},{label:hr("Georgia"),value:"Georgia"},{label:hr("Tahoma"),value:"Tahoma"},{label:hr("Verdana"),value:"Verdana"}],onChange:function(t){n.fontName=t,e.props.edit(n)}}),wp.element.createElement(wr,{label:hr("Font Size"),help:hr("The default font size for all text in the chart."),value:n.fontSize?n.fontSize:"15",options:[{label:"7",value:"7"},{label:"8",value:"8"},{label:"9",value:"9"},{label:"10",value:"10"},{label:"11",value:"11"},{label:"12",value:"12"},{label:"13",value:"13"},{label:"14",value:"14"},{label:"15",value:"15"},{label:"16",value:"16"},{label:"17",value:"17"},{label:"18",value:"18"},{label:"19",value:"19"},{label:"20",value:"20"}],onChange:function(t){n.fontSize=t,e.props.edit(n)}})),-1>=["tabular","dataTable","gauge","geo","timeline"].indexOf(t)&&wp.element.createElement(vr,{title:hr("Legend"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(wr,{label:hr("Position"),help:hr("Determines where to place the legend, compared to the chart area."),value:n.legend.position?n.legend.position:"right",options:a,onChange:function(r){if("pie"!==t){var a="left"===r?1:0;n.series&&Object.keys(n.series).map((function(e){n.series[e].targetAxisIndex=a}))}n.legend.position=r,e.props.edit(n)}}),wp.element.createElement(wr,{label:hr("Alignment"),help:hr("Determines the alignment of the legend."),value:n.legend.alignment?n.legend.alignment:"15",options:[{label:hr("Aligned to the start of the allocated area"),value:"start"},{label:hr("Centered in the allocated area"),value:"center"},{label:hr("Aligned to the end of the allocated area"),value:"end"}],onChange:function(t){n.legend.alignment=t,e.props.edit(n)}}),wp.element.createElement(br,{label:hr("Font Color")},wp.element.createElement(_r,{value:n.legend.textStyle.color,onChange:function(t){n.legend.textStyle.color=t,e.props.edit(n)}}))),-1>=["tabular","gauge","geo","dataTable","timeline"].indexOf(t)&&wp.element.createElement(vr,{title:hr("Tooltip"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(wr,{label:hr("Trigger"),help:hr("Determines the user interaction that causes the tooltip to be displayed."),value:n.tooltip.trigger?n.tooltip.trigger:"focus",options:r,onChange:function(t){n.tooltip.trigger=t,e.props.edit(n)}}),wp.element.createElement(wr,{label:hr("Show Color Code"),help:hr("If set to yes, will show colored squares next to the slice information in the tooltip."),value:n.tooltip.showColorCode?n.tooltip.showColorCode:"0",options:[{label:hr("Yes"),value:"1"},{label:hr("No"),value:"0"}],onChange:function(t){n.tooltip.showColorCode=t,e.props.edit(n)}}),0<=["pie"].indexOf(t)&&wp.element.createElement(wr,{label:hr("Text"),help:hr("Determines what information to display when the user hovers over a pie slice."),value:n.tooltip.text?n.tooltip.text:"both",options:[{label:hr("Display both the absolute value of the slice and the percentage of the whole"),value:"both"},{label:hr("Display only the absolute value of the slice"),value:"value"},{label:hr("Display only the percentage of the whole represented by the slice"),value:"percentage"}],onChange:function(t){n.tooltip.text=t,e.props.edit(n)}})),-1>=["tabular","dataTable","gauge","geo","pie","timeline"].indexOf(t)&&wp.element.createElement(vr,{title:hr("Animation"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(gr,{label:hr("Animate on startup?"),help:hr("Determines if the chart will animate on the initial draw."),checked:Number(n.animation.startup),onChange:function(t){n.animation.startup=t?"1":"0",e.props.edit(n)}}),wp.element.createElement(Mr,{label:hr("Duration"),help:hr("The duration of the animation, in milliseconds."),type:"number",value:n.animation.duration,onChange:function(t){n.animation.duration=t,e.props.edit(n)}}),wp.element.createElement(wr,{label:hr("Easing"),help:hr("The easing function applied to the animation."),value:n.animation.easing?n.animation.easing:"linear",options:[{label:hr("Constant speed"),value:"linear"},{label:hr("Start slow and speed up"),value:"in"},{label:hr("Start fast and slow down"),value:"out"},{label:hr("Start slow, speed up, then slow down"),value:"inAndOut"}],onChange:function(t){n.animation.easing=t,e.props.edit(n)}})))}}])&&ur(t.prototype,n),r&&ur(t,r),i}(fr);function Lr(e){return(Lr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Yr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Dr(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Tr(e,t){return(Tr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Sr(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=xr(e);if(t){var a=xr(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Or(this,n)}}function Or(e,t){return!t||"object"!==Lr(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function xr(e){return(xr=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var jr=wp.i18n.__,Er=wp.element.Component,Cr=wp.components,Pr=Cr.PanelBody,Hr=Cr.Notice,zr=Cr.TextControl,Ar=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Tr(e,t)}(i,e);var t,n,r,a=Sr(i);function i(){return Yr(this,i),a.apply(this,arguments)}return t=i,(n=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(Pr,{title:jr("Instance Settings"),initialOpen:!0,className:"visualizer-instance-panel"},wp.element.createElement(Hr,{status:"info",isDismissible:!1},wp.element.createElement("p",null,jr("These settings are valid only for this instance of the chart.")),wp.element.createElement("p",null,jr("This means that if you insert this chart again elsewhere, these values will not persist."))),wp.element.createElement(zr,{label:jr("Should this instance lazy Load?"),help:jr("-1: do not lazy load. Any number greater than -1 will lazy load the chart once the viewport is that many pixels away from the chart"),value:this.props.attributes.lazy?Number(this.props.attributes.lazy):-1,type:"number",min:"-1",max:"1000",step:"1",onChange:function(n){e.props.attributes.lazy=n,e.props.edit(t)}}))}}])&&Dr(t.prototype,n),r&&Dr(t,r),i}(Er);function Rr(e){return(Rr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Nr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Fr(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Wr(e,t){return(Wr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Ir(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Jr(e);if(t){var a=Jr(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Br(this,n)}}function Br(e,t){return!t||"object"!==Rr(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Jr(e){return(Jr=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Ur=wp.i18n.__,Vr=wp.element,qr=Vr.Component,Gr=Vr.Fragment,$r=(wp.blockEditor||wp.editor).ColorPalette,Kr=wp.components,Zr=Kr.BaseControl,Qr=Kr.ExternalLink,Xr=Kr.PanelBody,ea=Kr.SelectControl,ta=Kr.TextControl,na=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Wr(e,t)}(i,e);var t,n,r,a=Ir(i);function i(){return Nr(this,i),a.apply(this,arguments)}return t=i,(n=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-chart-type"],n=this.props.chart["visualizer-settings"];return wp.element.createElement(Xr,{title:Ur("Horizontal Axis Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(Xr,{title:Ur("General Settings"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(ta,{label:Ur("Axis Title"),help:Ur("The title of the horizontal axis."),value:n.hAxis.title,onChange:function(t){n.hAxis.title=t,e.props.edit(n)}}),wp.element.createElement(ea,{label:Ur("Text Position"),help:Ur("Position of the horizontal axis text, relative to the chart area."),value:n.hAxis.textPosition?n.hAxis.textPosition:"out",options:[{label:Ur("Inside the chart"),value:"in"},{label:Ur("Outside the chart"),value:"out"},{label:Ur("None"),value:"none"}],onChange:function(t){n.hAxis.textPosition=t,e.props.edit(n)}}),wp.element.createElement(ea,{label:Ur("Direction"),help:Ur("The direction in which the values along the horizontal axis grow."),value:n.hAxis.direction?n.hAxis.direction:"1",options:[{label:Ur("Identical Direction"),value:"1"},{label:Ur("Reverse Direction"),value:"-1"}],onChange:function(t){n.hAxis.direction=t,e.props.edit(n)}}),wp.element.createElement(Zr,{label:Ur("Base Line Color")},wp.element.createElement($r,{value:n.hAxis.baselineColor,onChange:function(t){n.hAxis.baselineColor=t,e.props.edit(n)}})),wp.element.createElement(Zr,{label:Ur("Axis Text Color")},wp.element.createElement($r,{value:n.hAxis.textStyle.color||n.hAxis.textStyle,onChange:function(t){n.hAxis.textStyle={},n.hAxis.textStyle.color=t,e.props.edit(n)}})),-1>=["column"].indexOf(t)&&wp.element.createElement(Gr,null,wp.element.createElement(ta,{label:Ur("Number Format"),help:Ur("Enter custom format pattern to apply to horizontal axis labels."),value:n.hAxis.format,onChange:function(t){n.hAxis.format=t,e.props.edit(n)}}),wp.element.createElement("p",null,Ur("For number axis labels, this is a subset of the formatting "),wp.element.createElement(Qr,{href:"http://icu-project.org/apiref/icu4c/classDecimalFormat.html#_details"},Ur("ICU pattern set.")),Ur(" For instance, $#,###.## will display values $1,234.56 for value 1234.56. Pay attention that if you use #%% percentage format then your values will be multiplied by 100.")),wp.element.createElement("p",null,Ur("For date axis labels, this is a subset of the date formatting "),wp.element.createElement(Qr,{href:"http://userguide.icu-project.org/formatparse/datetime#TOC-Date-Time-Format-Syntax"},Ur("ICU date and time format."))))),-1>=["column"].indexOf(t)&&wp.element.createElement(Gr,null,wp.element.createElement(Xr,{title:Ur("Grid Lines"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(ta,{label:Ur("Count"),help:Ur("The approximate number of horizontal gridlines inside the chart area. You can specify a value of -1 to automatically compute the number of gridlines, 0 or 1 to draw no gridlines, or 2 or more to only draw gridline. Any number greater than 2 will be used to compute the minSpacing between gridlines."),value:n.hAxis.gridlines?n.hAxis.gridlines.count:"",onChange:function(t){n.hAxis.gridlines||(n.hAxis.gridlines={}),n.hAxis.gridlines.count=t,e.props.edit(n)}}),wp.element.createElement(Zr,{label:Ur("Color")},wp.element.createElement($r,{value:n.hAxis.gridlines?n.hAxis.gridlines.color:"",onChange:function(t){n.hAxis.gridlines||(n.hAxis.gridlines={}),n.hAxis.gridlines.color=t,e.props.edit(n)}}))),wp.element.createElement(Xr,{title:Ur("Minor Grid Lines"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(ta,{label:Ur("Count"),help:Ur("Specify 0 to disable the minor gridlines."),value:n.hAxis.minorGridlines?n.hAxis.minorGridlines.count:"",onChange:function(t){n.hAxis.minorGridlines||(n.hAxis.minorGridlines={}),n.hAxis.minorGridlines.count=t,e.props.edit(n)}}),wp.element.createElement(Zr,{label:Ur("Color")},wp.element.createElement($r,{value:n.hAxis.minorGridlines?n.hAxis.minorGridlines.color:"",onChange:function(t){n.hAxis.minorGridlines||(n.hAxis.minorGridlines={}),n.hAxis.minorGridlines.color=t,e.props.edit(n)}}))),wp.element.createElement(Xr,{title:Ur("View Window"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(ta,{label:Ur("Maximun Value"),help:Ur("The maximum vertical data value to render."),value:n.hAxis.viewWindow?n.hAxis.viewWindow.max:"",onChange:function(t){n.hAxis.viewWindow||(n.hAxis.viewWindow={}),n.hAxis.viewWindow.max=t,e.props.edit(n)}}),wp.element.createElement(ta,{label:Ur("Minimum Value"),help:Ur("The minimum vertical data value to render."),value:n.hAxis.viewWindow?n.hAxis.viewWindow.min:"",onChange:function(t){n.hAxis.viewWindow||(n.hAxis.viewWindow={}),n.hAxis.viewWindow.min=t,e.props.edit(n)}}))))}}])&&Fr(t.prototype,n),r&&Fr(t,r),i}(qr);function ra(e){return(ra="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function aa(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ia(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function oa(e,t){return(oa=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function sa(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=ua(e);if(t){var a=ua(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return la(this,n)}}function la(e,t){return!t||"object"!==ra(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function ua(e){return(ua=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var ca=wp.i18n.__,da=wp.element,ma=da.Component,pa=da.Fragment,ha=(wp.blockEditor||wp.editor).ColorPalette,fa=wp.components,_a=fa.BaseControl,ya=fa.ExternalLink,ba=fa.PanelBody,ga=fa.SelectControl,va=fa.TextControl,wa=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&oa(e,t)}(i,e);var t,n,r,a=sa(i);function i(){return aa(this,i),a.apply(this,arguments)}return t=i,(n=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-chart-type"],n=this.props.chart["visualizer-settings"];return wp.element.createElement(ba,{title:ca("Vertical Axis Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(ba,{title:ca("General Settings"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(va,{label:ca("Axis Title"),help:ca("The title of the Vertical axis."),value:n.vAxis.title,onChange:function(t){n.vAxis.title=t,e.props.edit(n)}}),wp.element.createElement(ga,{label:ca("Text Position"),help:ca("Position of the Vertical axis text, relative to the chart area."),value:n.vAxis.textPosition?n.vAxis.textPosition:"out",options:[{label:ca("Inside the chart"),value:"in"},{label:ca("Outside the chart"),value:"out"},{label:ca("None"),value:"none"}],onChange:function(t){n.vAxis.textPosition=t,e.props.edit(n)}}),wp.element.createElement(ga,{label:ca("Direction"),help:ca("The direction in which the values along the Vertical axis grow."),value:n.vAxis.direction?n.vAxis.direction:"1",options:[{label:ca("Identical Direction"),value:"1"},{label:ca("Reverse Direction"),value:"-1"}],onChange:function(t){n.vAxis.direction=t,e.props.edit(n)}}),wp.element.createElement(_a,{label:ca("Base Line Color")},wp.element.createElement(ha,{value:n.vAxis.baselineColor,onChange:function(t){n.vAxis.baselineColor=t,e.props.edit(n)}})),wp.element.createElement(_a,{label:ca("Axis Text Color")},wp.element.createElement(ha,{value:n.vAxis.textStyle.color||n.vAxis.textStyle,onChange:function(t){n.vAxis.textStyle={},n.vAxis.textStyle.color=t,e.props.edit(n)}})),-1>=["bar"].indexOf(t)&&wp.element.createElement(pa,null,wp.element.createElement(va,{label:ca("Number Format"),help:ca("Enter custom format pattern to apply to Vertical axis labels."),value:n.vAxis.format,onChange:function(t){n.vAxis.format=t,e.props.edit(n)}}),wp.element.createElement("p",null,ca("For number axis labels, this is a subset of the formatting "),wp.element.createElement(ya,{href:"http://icu-project.org/apiref/icu4c/classDecimalFormat.html#_details"},ca("ICU pattern set.")),ca(" For instance, $#,###.## will display values $1,234.56 for value 1234.56. Pay attention that if you use #%% percentage format then your values will be multiplied by 100.")),wp.element.createElement("p",null,ca("For date axis labels, this is a subset of the date formatting "),wp.element.createElement(ya,{href:"http://userguide.icu-project.org/formatparse/datetime#TOC-Date-Time-Format-Syntax"},ca("ICU date and time format."))))),-1>=["bar"].indexOf(t)&&wp.element.createElement(pa,null,wp.element.createElement(ba,{title:ca("Grid Lines"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(va,{label:ca("Count"),help:ca("The approximate number of vertical gridlines inside the chart area. You can specify a value of -1 to automatically compute the number of gridlines, 0 or 1 to draw no gridlines, or 2 or more to only draw gridline. Any number greater than 2 will be used to compute the minSpacing between gridlines."),value:n.vAxis.gridlines?n.vAxis.gridlines.count:"",onChange:function(t){n.vAxis.gridlines||(n.vAxis.gridlines={}),n.vAxis.gridlines.count=t,e.props.edit(n)}}),wp.element.createElement(_a,{label:ca("Color")},wp.element.createElement(ha,{value:n.vAxis.gridlines?n.vAxis.gridlines.color:"",onChange:function(t){n.vAxis.gridlines||(n.vAxis.gridlines={}),n.vAxis.gridlines.color=t,e.props.edit(n)}}))),wp.element.createElement(ba,{title:ca("Minor Grid Lines"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(va,{label:ca("Count"),help:ca("Specify 0 to disable the minor gridlines."),value:n.vAxis.minorGridlines?n.vAxis.minorGridlines.count:"",onChange:function(t){n.vAxis.minorGridlines||(n.vAxis.minorGridlines={}),n.vAxis.minorGridlines.count=t,e.props.edit(n)}}),wp.element.createElement(_a,{label:ca("Color")},wp.element.createElement(ha,{value:n.vAxis.minorGridlines?n.vAxis.minorGridlines.color:"",onChange:function(t){n.vAxis.minorGridlines||(n.vAxis.minorGridlines={}),n.vAxis.minorGridlines.color=t,e.props.edit(n)}}))),wp.element.createElement(ba,{title:ca("View Window"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(va,{label:ca("Maximun Value"),help:ca("The maximum vertical data value to render."),value:n.vAxis.viewWindow?n.vAxis.viewWindow.max:"",onChange:function(t){n.vAxis.viewWindow||(n.vAxis.viewWindow={}),n.vAxis.viewWindow.max=t,e.props.edit(n)}}),wp.element.createElement(va,{label:ca("Minimum Value"),help:ca("The minimum vertical data value to render."),value:n.vAxis.viewWindow?n.vAxis.viewWindow.min:"",onChange:function(t){n.vAxis.viewWindow||(n.vAxis.viewWindow={}),n.vAxis.viewWindow.min=t,e.props.edit(n)}}))))}}])&&ia(t.prototype,n),r&&ia(t,r),i}(ma);function Ma(e){return(Ma="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ka(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function La(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Ya(e,t){return(Ya=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Da(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Sa(e);if(t){var a=Sa(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Ta(this,n)}}function Ta(e,t){return!t||"object"!==Ma(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Sa(e){return(Sa=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Oa=wp.i18n.__,xa=wp.element,ja=xa.Component,Ea=xa.Fragment,Ca=(wp.blockEditor||wp.editor).ColorPalette,Pa=wp.components,Ha=Pa.BaseControl,za=Pa.ExternalLink,Aa=Pa.PanelBody,Ra=Pa.SelectControl,Na=Pa.TextControl,Fa=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ya(e,t)}(i,e);var t,n,r,a=Da(i);function i(){return ka(this,i),a.apply(this,arguments)}return t=i,(n=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(Aa,{title:Oa("Pie Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(Ea,null,wp.element.createElement(Na,{label:Oa("Number Format"),help:Oa("Enter custom format pattern to apply to chart labels."),value:t.format,onChange:function(n){t.format=n,e.props.edit(t)}}),wp.element.createElement("p",null,Oa("For number axis labels, this is a subset of the formatting "),wp.element.createElement(za,{href:"http://icu-project.org/apiref/icu4c/classDecimalFormat.html#_details"},Oa("ICU pattern set.")),Oa(" For instance, $#,###.## will display values $1,234.56 for value 1234.56. Pay attention that if you use #%% percentage format then your values will be multiplied by 100.")),wp.element.createElement("p",null,Oa("For date axis labels, this is a subset of the date formatting "),wp.element.createElement(za,{href:"http://userguide.icu-project.org/formatparse/datetime#TOC-Date-Time-Format-Syntax"},Oa("ICU date and time format.")))),wp.element.createElement(Ra,{label:Oa("Is 3D"),help:Oa("If set to yes, displays a three-dimensional chart."),value:t.is3D?t.is3D:"0",options:[{label:Oa("Yes"),value:"1"},{label:Oa("No"),value:"0"}],onChange:function(n){t.is3D=n,e.props.edit(t)}}),wp.element.createElement(Ra,{label:Oa("Reverse Categories"),help:Oa("If set to yes, will draw slices counterclockwise."),value:t.reverseCategories?t.reverseCategories:"0",options:[{label:Oa("Yes"),value:"1"},{label:Oa("No"),value:"0"}],onChange:function(n){t.reverseCategories=n,e.props.edit(t)}}),wp.element.createElement(Ra,{label:Oa("Slice Text"),help:Oa("The content of the text displayed on the slice."),value:t.pieSliceText?t.pieSliceText:"percentage",options:[{label:Oa("The percentage of the slice size out of the total"),value:"percentage"},{label:Oa("The quantitative value of the slice"),value:"value"},{label:Oa("The name of the slice"),value:"label"},{label:Oa("The quantitative value and percentage of the slice"),value:"value-and-percentage"},{label:Oa("No text is displayed"),value:"none"}],onChange:function(n){t.pieSliceText=n,e.props.edit(t)}}),wp.element.createElement(Na,{label:Oa("Pie Hole"),help:Oa("If between 0 and 1, displays a donut chart. The hole with have a radius equal to number times the radius of the chart. Only applicable when the chart is two-dimensional."),placeholder:Oa("0.5"),value:t.pieHole,onChange:function(n){t.pieHole=n,e.props.edit(t)}}),wp.element.createElement(Na,{label:Oa("Start Angle"),help:Oa("The angle, in degrees, to rotate the chart by. The default of 0 will orient the leftmost edge of the first slice directly up."),value:t.pieStartAngle,onChange:function(n){t.pieStartAngle=n,e.props.edit(t)}}),wp.element.createElement(Ha,{label:Oa("Slice Border Color")},wp.element.createElement(Ca,{value:t.pieSliceBorderColor,onChange:function(n){t.pieSliceBorderColor=n,e.props.edit(t)}})))}}])&&La(t.prototype,n),r&&La(t,r),i}(ja);function Wa(e){return(Wa="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ia(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ba(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Ja(e,t){return(Ja=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Ua(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=qa(e);if(t){var a=qa(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Va(this,n)}}function Va(e,t){return!t||"object"!==Wa(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function qa(e){return(qa=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Ga=wp.i18n.__,$a=wp.element.Component,Ka=(wp.blockEditor||wp.editor).ColorPalette,Za=wp.components,Qa=Za.BaseControl,Xa=Za.PanelBody,ei=Za.TextControl,ti=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ja(e,t)}(i,e);var t,n,r,a=Ua(i);function i(){return Ia(this,i),a.apply(this,arguments)}return t=i,(n=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(Xa,{title:Ga("Residue Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(ei,{label:Ga("Visibility Threshold"),help:Ga("The slice relative part, below which a slice will not show individually. All slices that have not passed this threshold will be combined to a single slice, whose size is the sum of all their sizes. Default is not to show individually any slice which is smaller than half a degree."),placeholder:Ga("0.001388889"),value:t.sliceVisibilityThreshold,onChange:function(n){t.sliceVisibilityThreshold=n,e.props.edit(t)}}),wp.element.createElement(ei,{label:Ga("Residue Slice Label"),help:Ga("A label for the combination slice that holds all slices below slice visibility threshold."),value:t.pieResidueSliceLabel,onChange:function(n){t.pieResidueSliceLabel=n,e.props.edit(t)}}),wp.element.createElement(Qa,{label:Ga("Residue Slice Color")},wp.element.createElement(Ka,{value:t.pieResidueSliceColor,onChange:function(n){t.pieResidueSliceColor=n,e.props.edit(t)}})))}}])&&Ba(t.prototype,n),r&&Ba(t,r),i}($a);function ni(e){return(ni="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ri(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ai(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ii(e,t){return(ii=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function oi(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=li(e);if(t){var a=li(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return si(this,n)}}function si(e,t){return!t||"object"!==ni(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function li(e){return(li=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var ui=wp.i18n.__,ci=wp.element,di=ci.Component,mi=ci.Fragment,pi=wp.components,hi=pi.PanelBody,fi=pi.SelectControl,_i=pi.TextControl,yi=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ii(e,t)}(i,e);var t,n,r,a=oi(i);function i(){return ri(this,i),a.apply(this,arguments)}return t=i,(n=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-chart-type"],n=this.props.chart["visualizer-settings"];return wp.element.createElement(hi,{title:ui("Lines Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(_i,{label:ui("Line Width"),help:ui("Data line width in pixels. Use zero to hide all lines."),value:n.lineWidth,onChange:function(t){n.lineWidth=t,e.props.edit(n)}}),wp.element.createElement(_i,{label:ui("Point Size"),help:ui("Diameter of displayed points in pixels. Use zero to hide all the points."),value:n.pointSize,onChange:function(t){n.pointSize=t,e.props.edit(n)}}),-1>=["area"].indexOf(t)&&wp.element.createElement(fi,{label:ui("Curve Type"),help:ui("Determines whether the series has to be presented in the legend or not."),value:n.curveType?n.curveType:"none",options:[{label:ui("Straight line without curve"),value:"none"},{label:ui("The angles of the line will be smoothed"),value:"function"}],onChange:function(t){n.curveType=t,e.props.edit(n)}}),-1>=["scatter"].indexOf(t)&&wp.element.createElement(fi,{label:ui("Focus Target"),help:ui("The type of the entity that receives focus on mouse hover. Also affects which entity is selected by mouse click."),value:n.focusTarget?n.focusTarget:"datum",options:[{label:ui("Focus on a single data point."),value:"datum"},{label:ui("Focus on a grouping of all data points along the major axis."),value:"category"}],onChange:function(t){n.focusTarget=t,e.props.edit(n)}}),wp.element.createElement(fi,{label:ui("Selection Mode"),help:ui("Determines how many data points an user can select on a chart."),value:n.selectionMode?n.selectionMode:"single",options:[{label:ui("Single data point"),value:"single"},{label:ui("Multiple data points"),value:"multiple"}],onChange:function(t){n.selectionMode=t,e.props.edit(n)}}),wp.element.createElement(fi,{label:ui("Aggregation Target"),help:ui("Determines how multiple data selections are rolled up into tooltips. To make it working you need to set multiple selection mode and tooltip trigger to display it when an user selects an element."),value:n.aggregationTarget?n.aggregationTarget:"auto",options:[{label:ui("Group selected data by x-value"),value:"category"},{label:ui("Group selected data by series"),value:"series"},{label:ui("Group selected data by x-value if all selections have the same x-value, and by series otherwise"),value:"auto"},{label:ui("Show only one tooltip per selection"),value:"none"}],onChange:function(t){n.aggregationTarget=t,e.props.edit(n)}}),wp.element.createElement(_i,{label:ui("Point Opacity"),help:ui("The transparency of data points, with 1.0 being completely opaque and 0.0 fully transparent."),value:n.dataOpacity,onChange:function(t){n.dataOpacity=t,e.props.edit(n)}}),-1>=["scatter","line"].indexOf(t)&&wp.element.createElement(mi,null,wp.element.createElement(_i,{label:ui("Area Opacity"),help:ui("The default opacity of the colored area under an area chart series, where 0.0 is fully transparent and 1.0 is fully opaque. To specify opacity for an individual series, set the area opacity value in the series property."),value:n.areaOpacity,onChange:function(t){n.areaOpacity=t,e.props.edit(n)}}),wp.element.createElement(fi,{label:ui("Is Stacked"),help:ui("If set to yes, series elements are stacked."),value:n.isStacked?n.isStacked:"0",options:[{label:ui("Yes"),value:"1"},{label:ui("No"),value:"0"}],onChange:function(t){n.isStacked=t,e.props.edit(n)}})),-1>=["scatter","area"].indexOf(t)&&wp.element.createElement(fi,{label:ui("Interpolate Nulls"),help:ui("Whether to guess the value of missing points. If yes, it will guess the value of any missing data based on neighboring points. If no, it will leave a break in the line at the unknown point."),value:n.interpolateNulls?n.interpolateNulls:"0",options:[{label:ui("Yes"),value:"1"},{label:ui("No"),value:"0"}],onChange:function(t){n.interpolateNulls=t,e.props.edit(n)}}))}}])&&ai(t.prototype,n),r&&ai(t,r),i}(di);function bi(e){return(bi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function gi(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function vi(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function wi(e,t){return(wi=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Mi(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Li(e);if(t){var a=Li(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return ki(this,n)}}function ki(e,t){return!t||"object"!==bi(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Li(e){return(Li=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Yi=wp.i18n.__,Di=wp.element.Component,Ti=wp.components,Si=Ti.PanelBody,Oi=Ti.SelectControl,xi=Ti.TextControl,ji=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&wi(e,t)}(i,e);var t,n,r,a=Mi(i);function i(){return gi(this,i),a.apply(this,arguments)}return t=i,(n=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(Si,{title:Yi("Bars Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(Oi,{label:Yi("Focus Target"),help:Yi("The type of the entity that receives focus on mouse hover. Also affects which entity is selected by mouse click."),value:t.focusTarget?t.focusTarget:"datum",options:[{label:Yi("Focus on a single data point."),value:"datum"},{label:Yi("Focus on a grouping of all data points along the major axis."),value:"category"}],onChange:function(n){t.focusTarget=n,e.props.edit(t)}}),wp.element.createElement(Oi,{label:Yi("Is Stacked"),help:Yi("If set to yes, series elements are stacked."),value:t.isStacked?t.isStacked:"0",options:[{label:Yi("Yes"),value:"1"},{label:Yi("No"),value:"0"}],onChange:function(n){t.isStacked=n,e.props.edit(t)}}),wp.element.createElement(xi,{label:Yi("Bars Opacity"),help:Yi("Bars transparency, with 1.0 being completely opaque and 0.0 fully transparent."),value:t.dataOpacity,onChange:function(n){t.dataOpacity=n,e.props.edit(t)}}))}}])&&vi(t.prototype,n),r&&vi(t,r),i}(Di);function Ei(e){return(Ei="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ci(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Pi(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Hi(e,t){return(Hi=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function zi(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Ri(e);if(t){var a=Ri(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Ai(this,n)}}function Ai(e,t){return!t||"object"!==Ei(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Ri(e){return(Ri=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Ni=wp.i18n.__,Fi=wp.element.Component,Wi=(wp.blockEditor||wp.editor).ColorPalette,Ii=wp.components,Bi=Ii.BaseControl,Ji=Ii.PanelBody,Ui=Ii.SelectControl,Vi=Ii.TextControl,qi=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Hi(e,t)}(i,e);var t,n,r,a=zi(i);function i(){return Ci(this,i),a.apply(this,arguments)}return t=i,(n=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(Ji,{title:Ni("Candles Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(Ji,{title:Ni("General Settings"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Ui,{label:Ni("Focus Target"),help:Ni("The type of the entity that receives focus on mouse hover. Also affects which entity is selected by mouse click."),value:t.focusTarget?t.focusTarget:"datum",options:[{label:Ni("Focus on a single data point."),value:"datum"},{label:Ni("Focus on a grouping of all data points along the major axis."),value:"category"}],onChange:function(n){t.focusTarget=n,e.props.edit(t)}}),wp.element.createElement(Ui,{label:Ni("Selection Mode"),help:Ni("Determines how many data points an user can select on a chart."),value:t.selectionMode?t.selectionMode:"single",options:[{label:Ni("Single data point"),value:"single"},{label:Ni("Multiple data points"),value:"multiple"}],onChange:function(n){t.selectionMode=n,e.props.edit(t)}}),wp.element.createElement(Ui,{label:Ni("Aggregation Target"),help:Ni("Determines how multiple data selections are rolled up into tooltips. To make it working you need to set multiple selection mode and tooltip trigger to display it when an user selects an element."),value:t.aggregationTarget?t.aggregationTarget:"auto",options:[{label:Ni("Group selected data by x-value"),value:"category"},{label:Ni("Group selected data by series"),value:"series"},{label:Ni("Group selected data by x-value if all selections have the same x-value, and by series otherwise"),value:"auto"},{label:Ni("Show only one tooltip per selection"),value:"none"}],onChange:function(n){t.aggregationTarget=n,e.props.edit(t)}})),wp.element.createElement(Ji,{title:Ni("Failing Candles"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Vi,{label:Ni("Stroke Width"),help:Ni("The stroke width of falling candles."),value:t.candlestick.fallingColor.strokeWidth,onChange:function(n){t.candlestick.fallingColor.strokeWidth=n,e.props.edit(t)}}),wp.element.createElement(Bi,{label:Ni("Stroke Color")},wp.element.createElement(Wi,{value:t.candlestick.fallingColor.stroke,onChange:function(n){t.candlestick.fallingColor.stroke=n,e.props.edit(t)}})),wp.element.createElement(Bi,{label:Ni("Fill Color")},wp.element.createElement(Wi,{value:t.candlestick.fallingColor.fill,onChange:function(n){t.candlestick.fallingColor.fill=n,e.props.edit(t)}}))),wp.element.createElement(Ji,{title:Ni("Rising Candles"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Vi,{label:Ni("Stroke Width"),help:Ni("The stroke width of rising candles."),value:t.candlestick.risingColor.strokeWidth,onChange:function(n){t.candlestick.risingColor.strokeWidth=n,e.props.edit(t)}}),wp.element.createElement(Bi,{label:Ni("Stroke Color")},wp.element.createElement(Wi,{value:t.candlestick.risingColor.stroke,onChange:function(n){t.candlestick.risingColor.stroke=n,e.props.edit(t)}})),wp.element.createElement(Bi,{label:Ni("Fill Color")},wp.element.createElement(Wi,{value:t.candlestick.risingColor.fill,onChange:function(n){t.candlestick.risingColor.fill=n,e.props.edit(t)}}))))}}])&&Pi(t.prototype,n),r&&Pi(t,r),i}(Fi);function Gi(e){return(Gi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function $i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ki(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Zi(e,t){return(Zi=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Qi(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=eo(e);if(t){var a=eo(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Xi(this,n)}}function Xi(e,t){return!t||"object"!==Gi(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function eo(e){return(eo=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var to=wp.i18n.__,no=wp.element.Component,ro=wp.components,ao=ro.ExternalLink,io=ro.PanelBody,oo=ro.SelectControl,so=ro.TextControl,lo=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Zi(e,t)}(i,e);var t,n,r,a=Qi(i);function i(){return $i(this,i),a.apply(this,arguments)}return t=i,(n=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(io,{title:to("Map Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(io,{title:to("API"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(so,{label:to("API Key"),help:to("Add the Google Maps API key."),value:t.map_api_key,onChange:function(n){t.map_api_key=n,e.props.edit(t)}}),wp.element.createElement(ao,{href:"https://developers.google.com/maps/documentation/javascript/get-api-key"},to("Get API Keys"))),wp.element.createElement(io,{title:to("Region"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement("ul",{className:"visualizer-list"},wp.element.createElement("li",null,to("A map of the entire world using 'world'.")),wp.element.createElement("li",null,to("A continent or a sub-continent, specified by its 3-digit code, e.g., '011' for Western Africa. "),wp.element.createElement(ao,{href:"https://google-developers.appspot.com/chart/interactive/docs/gallery/geochart#Continent_Hierarchy"},to("More info here."))),wp.element.createElement("li",null,to("A country, specified by its ISO 3166-1 alpha-2 code, e.g., 'AU' for Australia. "),wp.element.createElement(ao,{href:"http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2"},to("More info here."))),wp.element.createElement("li",null,to("A state in the United States, specified by its ISO 3166-2:US code, e.g., 'US-AL' for Alabama. Note that the resolution option must be set to either 'provinces' or 'metros'. "),wp.element.createElement(ao,{href:"http://en.wikipedia.org/wiki/ISO_3166-2:US"},to("More info here.")))),wp.element.createElement(so,{label:to("Reigion"),help:to("Configure the region area to display on the map. (Surrounding areas will be displayed as well.)"),value:t.region,onChange:function(n){t.region=n,e.props.edit(t)}})),wp.element.createElement(io,{title:to("Resolution"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement("ul",{className:"visualizer-list"},wp.element.createElement("li",null,to("'countries' - Supported for all regions, except for US state regions.")),wp.element.createElement("li",null,to("'provinces' - Supported only for country regions and US state regions. Not supported for all countries; please test a country to see whether this option is supported.")),wp.element.createElement("li",null,to("'metros' - Supported for the US country region and US state regions only."))),wp.element.createElement(oo,{label:to("Resolution"),help:to("The resolution of the map borders."),value:t.resolution?t.resolution:"countries",options:[{label:to("Countries"),value:"countries"},{label:to("Provinces"),value:"provinces"},{label:to("Metros"),value:"metros"}],onChange:function(n){t.resolution=n,e.props.edit(t)}})),wp.element.createElement(io,{title:to("Display Mode"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement("ul",{className:"visualizer-list"},wp.element.createElement("li",null,to("'auto' - Choose based on the format of the data.")),wp.element.createElement("li",null,to("'regions' - This is a region map.")),wp.element.createElement("li",null,to("'markers' - This is a marker map."))),wp.element.createElement(oo,{label:to("Display Mode"),help:to("Determines which type of map this is."),value:t.displayMode?t.displayMode:"auto",options:[{label:to("Auto"),value:"auto"},{label:to("Regions"),value:"regions"},{label:to("Markers"),value:"markers"}],onChange:function(n){t.displayMode=n,e.props.edit(t)}})),wp.element.createElement(io,{title:to("Tooltip"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(oo,{label:to("Trigger"),help:to("Determines the user interaction that causes the tooltip to be displayed."),value:t.tooltip.trigger?t.tooltip.trigger:"focus",options:[{label:to("The tooltip will be displayed when the user hovers over an element"),value:"focus"},{label:to("The tooltip will not be displayed"),value:"none"}],onChange:function(n){t.tooltip.trigger=n,e.props.edit(t)}})))}}])&&Ki(t.prototype,n),r&&Ki(t,r),i}(no);function uo(e){return(uo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function co(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function mo(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function po(e,t){return(po=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ho(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=_o(e);if(t){var a=_o(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return fo(this,n)}}function fo(e,t){return!t||"object"!==uo(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function _o(e){return(_o=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var yo=wp.i18n.__,bo=wp.element.Component,go=(wp.blockEditor||wp.editor).ColorPalette,vo=wp.components,wo=vo.BaseControl,Mo=vo.PanelBody,ko=vo.TextControl,Lo=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&po(e,t)}(i,e);var t,n,r,a=ho(i);function i(){return co(this,i),a.apply(this,arguments)}return t=i,(n=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(Mo,{title:yo("Color Axis"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(ko,{label:yo("Minimum Values"),help:yo("Determines the minimum values of color axis."),value:t.colorAxis.minValue,onChange:function(n){t.colorAxis.minValue=n,e.props.edit(t)}}),wp.element.createElement(ko,{label:yo("Maximum Values"),help:yo("Determines the maximum values of color axis."),value:t.colorAxis.maxValue,onChange:function(n){t.colorAxis.maxValue=n,e.props.edit(t)}}),wp.element.createElement(wo,{label:yo("Minimum Value")},wp.element.createElement(go,{value:t.colorAxis.colors[0],onChange:function(n){t.colorAxis.colors[0]=n,e.props.edit(t)}})),wp.element.createElement(wo,{label:yo("Intermediate Value")},wp.element.createElement(go,{value:t.colorAxis.colors[1],onChange:function(n){t.colorAxis.colors[1]=n,e.props.edit(t)}})),wp.element.createElement(wo,{label:yo("Maximum Value")},wp.element.createElement(go,{value:t.colorAxis.colors[2],onChange:function(n){t.colorAxis.colors[2]=n,e.props.edit(t)}})),wp.element.createElement(wo,{label:yo("Dateless Region")},wp.element.createElement(go,{value:t.datalessRegionColor,onChange:function(n){t.datalessRegionColor=n,e.props.edit(t)}})))}}])&&mo(t.prototype,n),r&&mo(t,r),i}(bo);function Yo(e){return(Yo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Do(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function To(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function So(e,t){return(So=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Oo(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=jo(e);if(t){var a=jo(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return xo(this,n)}}function xo(e,t){return!t||"object"!==Yo(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function jo(e){return(jo=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Eo=wp.i18n.__,Co=wp.element,Po=Co.Component,Ho=Co.Fragment,zo=wp.components,Ao=zo.ExternalLink,Ro=zo.PanelBody,No=zo.TextControl,Fo=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&So(e,t)}(i,e);var t,n,r,a=Oo(i);function i(){return Do(this,i),a.apply(this,arguments)}return t=i,(n=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(Ro,{title:Eo("Size Axis"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(No,{label:Eo("Minimum Values"),help:Eo("Determines the minimum values of size axis."),value:t.sizeAxis.minValue,onChange:function(n){t.sizeAxis.minValue=n,e.props.edit(t)}}),wp.element.createElement(No,{label:Eo("Maximum Values"),help:Eo("Determines the maximum values of size axis."),value:t.sizeAxis.maxValue,onChange:function(n){t.sizeAxis.maxValue=n,e.props.edit(t)}}),wp.element.createElement(No,{label:Eo("Minimum Marker Radius"),help:Eo("Determines the radius of the smallest possible bubbles, in pixels."),value:t.sizeAxis.minSize,onChange:function(n){t.sizeAxis.minSize=n,e.props.edit(t)}}),wp.element.createElement(No,{label:Eo("Maximum Marker Radius"),help:Eo("Determines the radius of the largest possible bubbles, in pixels."),value:t.sizeAxis.maxSize,onChange:function(n){t.sizeAxis.maxSize=n,e.props.edit(t)}}),wp.element.createElement(No,{label:Eo("Marker Opacity"),help:Eo("The opacity of the markers, where 0.0 is fully transparent and 1.0 is fully opaque."),value:t.markerOpacity,onChange:function(n){t.markerOpacity=n,e.props.edit(t)}}),wp.element.createElement(Ho,null,wp.element.createElement(No,{label:Eo("Number Format"),help:Eo("Enter custom format pattern to apply to this series value."),value:t.series[0].format,onChange:function(n){t.series[0].format=n,e.props.edit(t)}}),wp.element.createElement("p",null,Eo("For number axis labels, this is a subset of the formatting "),wp.element.createElement(Ao,{href:"http://icu-project.org/apiref/icu4c/classDecimalFormat.html#_details"},Eo("ICU pattern set.")),Eo(" For instance, $#,###.## will display values $1,234.56 for value 1234.56. Pay attention that if you use #%% percentage format then your values will be multiplied by 100."))))}}])&&To(t.prototype,n),r&&To(t,r),i}(Po);function Wo(e){return(Wo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Io(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Bo(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Jo(e,t){return(Jo=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Uo(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=qo(e);if(t){var a=qo(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Vo(this,n)}}function Vo(e,t){return!t||"object"!==Wo(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function qo(e){return(qo=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Go=wp.i18n.__,$o=wp.element.Component,Ko=wp.components,Zo=Ko.PanelBody,Qo=Ko.SelectControl,Xo=Ko.TextControl,es=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Jo(e,t)}(i,e);var t,n,r,a=Uo(i);function i(){return Io(this,i),a.apply(this,arguments)}return t=i,(n=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(Zo,{title:Go("Magnifying Glass"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(Qo,{label:Go("Enabled"),help:Go("If yes, when the user lingers over a cluttered marker, a magnifiying glass will be opened."),value:t.magnifyingGlass.enable?t.magnifyingGlass.enable:"1",options:[{label:Go("Yes"),value:"1"},{label:Go("No"),value:"0"}],onChange:function(n){t.magnifyingGlass.enable=n,e.props.edit(t)}}),wp.element.createElement(Xo,{label:Go("Zoom Factor"),help:Go("The zoom factor of the magnifying glass. Can be any number greater than 0."),value:t.magnifyingGlass.zoomFactor,onChange:function(n){t.magnifyingGlass.zoomFactor=n,e.props.edit(t)}}))}}])&&Bo(t.prototype,n),r&&Bo(t,r),i}($o);function ts(e){return(ts="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ns(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function rs(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function as(e,t){return(as=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function is(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=ss(e);if(t){var a=ss(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return os(this,n)}}function os(e,t){return!t||"object"!==ts(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function ss(e){return(ss=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var ls=wp.i18n.__,us=wp.element,cs=us.Component,ds=us.Fragment,ms=(wp.blockEditor||wp.editor).ColorPalette,ps=wp.components,hs=ps.BaseControl,fs=ps.ExternalLink,_s=ps.PanelBody,ys=ps.TextControl,bs=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&as(e,t)}(i,e);var t,n,r,a=is(i);function i(){return ns(this,i),a.apply(this,arguments)}return t=i,(n=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(_s,{title:ls("Gauge Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(_s,{title:ls("Tick Settings"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(ys,{label:ls("Minimum Values"),help:ls("Determines the minimum values of gauge."),value:t.min,onChange:function(n){t.min=n,e.props.edit(t)}}),wp.element.createElement(ys,{label:ls("Maximum Values"),help:ls("Determines the maximum values of gauge."),value:t.max,onChange:function(n){t.max=n,e.props.edit(t)}}),wp.element.createElement(ys,{label:ls("Minor Ticks"),help:ls("The number of minor tick section in each major tick section."),value:t.minorTicks,onChange:function(n){t.minorTicks=n,e.props.edit(t)}}),wp.element.createElement(ds,null,wp.element.createElement(ys,{label:ls("Number Format"),help:ls("Enter custom format pattern to apply to this series value."),value:t.series[0].format,onChange:function(n){t.series[0].format=n,e.props.edit(t)}}),wp.element.createElement("p",null,ls("For number axis labels, this is a subset of the formatting "),wp.element.createElement(fs,{href:"http://icu-project.org/apiref/icu4c/classDecimalFormat.html#_details"},ls("ICU pattern set.")),ls(" For instance, $#,###.## will display values $1,234.56 for value 1234.56. Pay attention that if you use #%% percentage format then your values will be multiplied by 100.")))),wp.element.createElement(_s,{title:ls("Green Color"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(ys,{label:ls("Minimum Range"),help:ls("The lowest values for a range marked by a green color."),value:t.greenFrom,onChange:function(n){t.greenFrom=n,e.props.edit(t)}}),wp.element.createElement(ys,{label:ls("Maximum Range"),help:ls("The highest values for a range marked by a green color."),value:t.greenTo,onChange:function(n){t.greenTo=n,e.props.edit(t)}}),wp.element.createElement(hs,{label:ls("Green Color")},wp.element.createElement(ms,{value:t.greenColor,onChange:function(n){t.greenColor=n,e.props.edit(t)}}))),wp.element.createElement(_s,{title:ls("Yellow Color"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(ys,{label:ls("Minimum Range"),help:ls("The lowest values for a range marked by a yellow color."),value:t.yellowFrom,onChange:function(n){t.yellowFrom=n,e.props.edit(t)}}),wp.element.createElement(ys,{label:ls("Maximum Range"),help:ls("The highest values for a range marked by a yellow color."),value:t.yellowTo,onChange:function(n){t.yellowTo=n,e.props.edit(t)}}),wp.element.createElement(hs,{label:ls("Yellow Color")},wp.element.createElement(ms,{value:t.yellowColor,onChange:function(n){t.yellowColor=n,e.props.edit(t)}}))),wp.element.createElement(_s,{title:ls("Red Color"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(ys,{label:ls("Minimum Range"),help:ls("The lowest values for a range marked by a red color."),value:t.redFrom,onChange:function(n){t.redFrom=n,e.props.edit(t)}}),wp.element.createElement(ys,{label:ls("Maximum Range"),help:ls("The highest values for a range marked by a red color."),value:t.redTo,onChange:function(n){t.redTo=n,e.props.edit(t)}}),wp.element.createElement(hs,{label:ls("Red Color")},wp.element.createElement(ms,{value:t.redColor,onChange:function(n){t.redColor=n,e.props.edit(t)}}))))}}])&&rs(t.prototype,n),r&&rs(t,r),i}(cs);function gs(e){return(gs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function vs(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ws(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Ms(e,t){return(Ms=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ks(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Ds(e);if(t){var a=Ds(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Ls(this,n)}}function Ls(e,t){return!t||"object"!==gs(t)&&"function"!=typeof t?Ys(e):t}function Ys(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ds(e){return(Ds=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Ts=wp.i18n.__,Ss=wp.element.Component,Os=(wp.blockEditor||wp.editor).ColorPalette,xs=wp.components,js=xs.BaseControl,Es=xs.CheckboxControl,Cs=xs.PanelBody,Ps=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ms(e,t)}(i,e);var t,n,r,a=ks(i);function i(){var e;return vs(this,i),(e=a.apply(this,arguments)).mapValues=e.mapValues.bind(Ys(e)),e}return t=i,(n=[{key:"mapValues",value:function(e,t){return void 0===e.timeline?e[t]:e.timeline[t]}},{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return this.mapValues(t,"showRowLabels"),wp.element.createElement(Cs,{title:Ts("Timeline Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(Es,{label:Ts("Show Row Label"),help:Ts("If checked, shows the category/row label."),checked:Number(this.mapValues(t,"showRowLabels")),onChange:function(n){void 0===t.timeline&&(t.timeline={}),t.timeline.showRowLabels=!Number(e.mapValues(t,"showRowLabels")),e.props.edit(t)}}),wp.element.createElement(Es,{label:Ts("Group by Row Label"),help:Ts("If checked, groups the bars on the basis of the category/row label."),checked:Number(this.mapValues(t,"groupByRowLabel")),onChange:function(n){void 0===t.timeline&&(t.timeline={}),t.timeline.groupByRowLabel=!Number(e.mapValues(t,"groupByRowLabel")),e.props.edit(t)}}),wp.element.createElement(Es,{label:Ts("Color by Row Label"),help:Ts("If checked, colors every bar on the row the same."),checked:Number(this.mapValues(t,"colorByRowLabel")),onChange:function(n){void 0===t.timeline&&(t.timeline={}),t.timeline.colorByRowLabel=!Number(e.mapValues(t,"colorByRowLabel")),e.props.edit(t)}}),wp.element.createElement(js,{label:Ts("Single Color")},wp.element.createElement(Os,{value:this.mapValues(t,"singleColor"),onChange:function(n){void 0===t.timeline&&(t.timeline={}),t.timeline.singleColor=n,e.props.edit(t)}})))}}])&&ws(t.prototype,n),r&&ws(t,r),i}(Ss);function Hs(e){return(Hs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function zs(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function As(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Rs(e,t){return(Rs=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Ns(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Ws(e);if(t){var a=Ws(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Fs(this,n)}}function Fs(e,t){return!t||"object"!==Hs(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Ws(e){return(Ws=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Is=wp.i18n.__,Bs=wp.element,Js=Bs.Component,Us=Bs.Fragment,Vs=wp.components,qs=Vs.CheckboxControl,Gs=Vs.PanelBody,$s=Vs.SelectControl,Ks=Vs.TextControl,Zs=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Rs(e,t)}(i,e);var t,n,r,a=Ns(i);function i(){return zs(this,i),a.apply(this,arguments)}return t=i,(n=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"],n=(this.props.chart["visualizer-chart-type"],this.props.chart["visualizer-chart-library"]);return wp.element.createElement(Gs,{title:Is("Table Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},"DataTable"===n?wp.element.createElement(Us,null,wp.element.createElement(qs,{label:Is("Enable Pagination"),help:Is("To enable paging through the data."),checked:"true"===t.paging_bool,onChange:function(n){t.paging_bool="true",n||(t.paging_bool="false"),e.props.edit(t)}}),wp.element.createElement(Ks,{label:Is("Number of rows per page"),help:Is("The number of rows in each page, when paging is enabled."),type:"number",value:t.pageLength_int,placeholder:10,onChange:function(n){t.pageLength_int=n,e.props.edit(t)}}),wp.element.createElement($s,{label:Is("Pagination type"),help:Is("Determines what type of pagination options to show."),value:t.pagingType,options:[{label:Is("Page number buttons only"),value:"numbers"},{label:Is("'Previous' and 'Next' buttons only"),value:"simple"},{label:Is("'Previous' and 'Next' buttons, plus page numbers"),value:"simple_numbers"},{label:Is("'First', 'Previous', 'Next' and 'Last' buttons"),value:"full"},{label:Is("'First', 'Previous', 'Next' and 'Last' buttons, plus page numbers"),value:"full_numbers"},{label:Is("'First' and 'Last' buttons, plus page numbers"),value:"first_last_numbers"}],onChange:function(n){t.pagingType=n,e.props.edit(t)}}),wp.element.createElement(qs,{label:Is("Scroll Collapse"),help:Is("Allow the table to reduce in height when a limited number of rows are shown."),checked:"true"===t.scrollCollapse_bool,onChange:function(n){t.scrollCollapse_bool="true",n||(t.scrollCollapse_bool="false"),e.props.edit(t)}}),"true"===t.scrollCollapse_bool&&wp.element.createElement(Ks,{label:Is("Vertical Height"),help:Is("Vertical scrolling will constrain the table to the given height."),type:"number",value:t.scrollY_int,placeholder:300,onChange:function(n){t.scrollY_int=n,e.props.edit(t)}}),wp.element.createElement(qs,{label:Is("Disable Sort"),help:Is("To disable sorting on columns."),checked:"false"===t.ordering_bool,onChange:function(n){t.ordering_bool="true",n&&(t.ordering_bool="false"),e.props.edit(t)}}),wp.element.createElement(qs,{label:Is("Freeze Header/Footer"),help:Is("Freeze the header and footer."),checked:"true"===t.fixedHeader_bool,onChange:function(n){t.fixedHeader_bool="true",n||(t.fixedHeader_bool="false"),e.props.edit(t)}}),wp.element.createElement(qs,{label:Is("Responsive"),help:Is("Enable the table to be responsive."),checked:"true"===t.responsive_bool,onChange:function(n){t.responsive_bool="true",n||(t.responsive_bool="false"),e.props.edit(t)}})):wp.element.createElement(Us,null,wp.element.createElement($s,{label:Is("Enable Pagination"),help:Is("To enable paging through the data."),value:t.page?t.page:"disable",options:[{label:Is("Enable"),value:"enable"},{label:Is("Disable"),value:"disable"}],onChange:function(n){t.page=n,e.props.edit(t)}}),wp.element.createElement(Ks,{label:Is("Number of rows per page"),help:Is("The number of rows in each page, when paging is enabled."),type:"number",value:t.pageSize,onChange:function(n){t.pageSize=n,e.props.edit(t)}}),wp.element.createElement($s,{label:Is("Disable Sort"),help:Is("To disable sorting on columns."),value:t.sort?t.sort:"enable",options:[{label:Is("Enable"),value:"enable"},{label:Is("Disable"),value:"disable"}],onChange:function(n){t.sort=n,e.props.edit(t)}}),wp.element.createElement(Ks,{label:Is("Freeze Columns"),help:Is("The number of columns from the left that will be frozen."),type:"number",value:t.frozenColumns,onChange:function(n){t.frozenColumns=n,e.props.edit(t)}}),wp.element.createElement(qs,{label:Is("Allow HTML"),help:Is("If enabled, formatted values of cells that include HTML tags will be rendered as HTML."),checked:Number(t.allowHtml),onChange:function(n){t.allowHtml=!Number(t.allowHtml),e.props.edit(t)}}),wp.element.createElement(qs,{label:Is("Right to Left table"),help:Is("Adds basic support for right-to-left languages."),checked:Number(t.rtlTable),onChange:function(n){t.rtlTable=!Number(t.rtlTable),e.props.edit(t)}})))}}])&&As(t.prototype,n),r&&As(t,r),i}(Js);function Qs(e){return(Qs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Xs(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function el(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function tl(e,t){return(tl=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function nl(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=al(e);if(t){var a=al(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return rl(this,n)}}function rl(e,t){return!t||"object"!==Qs(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function al(e){return(al=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var il=wp.i18n.__,ol=wp.element,sl=ol.Component,ll=ol.Fragment,ul=(wp.blockEditor||wp.editor).ColorPalette,cl=wp.components,dl=cl.BaseControl,ml=cl.PanelBody,pl=cl.TextControl,hl=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&tl(e,t)}(i,e);var t,n,r,a=nl(i);function i(){return Xs(this,i),a.apply(this,arguments)}return t=i,(n=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"],n=(this.props.chart["visualizer-chart-type"],this.props.chart["visualizer-chart-library"]);return wp.element.createElement(ml,{title:il("Row/Cell Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},"DataTable"===n?wp.element.createElement(ll,null,wp.element.createElement(ml,{title:il("Odd Table Row"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(dl,{label:il("Background Color")},wp.element.createElement(ul,{value:t.customcss.oddTableRow["background-color"],onChange:function(n){t.customcss.oddTableRow["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(dl,{label:il("Color")},wp.element.createElement(ul,{value:t.customcss.oddTableRow.color,onChange:function(n){t.customcss.oddTableRow.color=n,e.props.edit(t)}})),wp.element.createElement(pl,{label:il("Text Orientation"),help:il("In degrees."),type:"number",value:t.customcss.oddTableRow.transform,onChange:function(n){t.customcss.oddTableRow.transform=n,e.props.edit(t)}})),wp.element.createElement(ml,{title:il("Even Table Row"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(dl,{label:il("Background Color")},wp.element.createElement(ul,{value:t.customcss.evenTableRow["background-color"],onChange:function(n){t.customcss.evenTableRow["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(dl,{label:il("Color")},wp.element.createElement(ul,{value:t.customcss.evenTableRow.color,onChange:function(n){t.customcss.evenTableRow.color=n,e.props.edit(t)}})),wp.element.createElement(pl,{label:il("Text Orientation"),help:il("In degrees."),type:"number",value:t.customcss.evenTableRow.transform,onChange:function(n){t.customcss.evenTableRow.transform=n,e.props.edit(t)}})),wp.element.createElement(ml,{title:il("Table Cell"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(dl,{label:il("Background Color")},wp.element.createElement(ul,{value:t.customcss.tableCell["background-color"],onChange:function(n){t.customcss.tableCell["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(dl,{label:il("Color")},wp.element.createElement(ul,{value:t.customcss.tableCell.color,onChange:function(n){t.customcss.tableCell.color=n,e.props.edit(t)}})),wp.element.createElement(pl,{label:il("Text Orientation"),help:il("In degrees."),type:"number",value:t.customcss.tableCell.transform,onChange:function(n){t.customcss.tableCell.transform=n,e.props.edit(t)}}))):wp.element.createElement(ll,null,wp.element.createElement(ml,{title:il("Header Row"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(dl,{label:il("Background Color")},wp.element.createElement(ul,{value:t.customcss.headerRow["background-color"],onChange:function(n){t.customcss.headerRow["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(dl,{label:il("Color")},wp.element.createElement(ul,{value:t.customcss.headerRow.color,onChange:function(n){t.customcss.headerRow.color=n,e.props.edit(t)}})),wp.element.createElement(pl,{label:il("Text Orientation"),help:il("In degrees."),type:"number",value:t.customcss.headerRow.transform,onChange:function(n){t.customcss.headerRow.transform=n,e.props.edit(t)}})),wp.element.createElement(ml,{title:il("Table Row"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(dl,{label:il("Background Color")},wp.element.createElement(ul,{value:t.customcss.tableRow["background-color"],onChange:function(n){t.customcss.tableRow["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(dl,{label:il("Color")},wp.element.createElement(ul,{value:t.customcss.tableRow.color,onChange:function(n){t.customcss.tableRow.color=n,e.props.edit(t)}})),wp.element.createElement(pl,{label:il("Text Orientation"),help:il("In degrees."),type:"number",value:t.customcss.tableRow.transform,onChange:function(n){t.customcss.tableRow.transform=n,e.props.edit(t)}})),wp.element.createElement(ml,{title:il("Odd Table Row"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(dl,{label:il("Background Color")},wp.element.createElement(ul,{value:t.customcss.oddTableRow["background-color"],onChange:function(n){t.customcss.oddTableRow["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(dl,{label:il("Color")},wp.element.createElement(ul,{value:t.customcss.oddTableRow.color,onChange:function(n){t.customcss.oddTableRow.color=n,e.props.edit(t)}})),wp.element.createElement(pl,{label:il("Text Orientation"),help:il("In degrees."),type:"number",value:t.customcss.oddTableRow.transform,onChange:function(n){t.customcss.oddTableRow.transform=n,e.props.edit(t)}})),wp.element.createElement(ml,{title:il("Selected Table Row"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(dl,{label:il("Background Color")},wp.element.createElement(ul,{value:t.customcss.selectedTableRow["background-color"],onChange:function(n){t.customcss.selectedTableRow["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(dl,{label:il("Color")},wp.element.createElement(ul,{value:t.customcss.selectedTableRow.color,onChange:function(n){t.customcss.selectedTableRow.color=n,e.props.edit(t)}})),wp.element.createElement(pl,{label:il("Text Orientation"),help:il("In degrees."),type:"number",value:t.customcss.selectedTableRow.transform,onChange:function(n){t.customcss.selectedTableRow.transform=n,e.props.edit(t)}})),wp.element.createElement(ml,{title:il("Hover Table Row"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(dl,{label:il("Background Color")},wp.element.createElement(ul,{value:t.customcss.hoverTableRow["background-color"],onChange:function(n){t.customcss.hoverTableRow["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(dl,{label:il("Color")},wp.element.createElement(ul,{value:t.customcss.hoverTableRow.color,onChange:function(n){t.customcss.hoverTableRow.color=n,e.props.edit(t)}})),wp.element.createElement(pl,{label:il("Text Orientation"),help:il("In degrees."),type:"number",value:t.customcss.hoverTableRow.transform,onChange:function(n){t.customcss.hoverTableRow.transform=n,e.props.edit(t)}})),wp.element.createElement(ml,{title:il("Header Cell"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(dl,{label:il("Background Color")},wp.element.createElement(ul,{value:t.customcss.headerCell["background-color"],onChange:function(n){t.customcss.headerCell["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(dl,{label:il("Color")},wp.element.createElement(ul,{value:t.customcss.headerCell.color,onChange:function(n){t.customcss.headerCell.color=n,e.props.edit(t)}})),wp.element.createElement(pl,{label:il("Text Orientation"),help:il("In degrees."),type:"number",value:t.customcss.headerCell.transform,onChange:function(n){t.customcss.headerCell.transform=n,e.props.edit(t)}})),wp.element.createElement(ml,{title:il("Table Cell"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(dl,{label:il("Background Color")},wp.element.createElement(ul,{value:t.customcss.tableCell["background-color"],onChange:function(n){t.customcss.tableCell["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(dl,{label:il("Color")},wp.element.createElement(ul,{value:t.customcss.tableCell.color,onChange:function(n){t.customcss.tableCell.color=n,e.props.edit(t)}})),wp.element.createElement(pl,{label:il("Text Orientation"),help:il("In degrees."),type:"number",value:t.customcss.tableCell.transform,onChange:function(n){t.customcss.tableCell.transform=n,e.props.edit(t)}}))))}}])&&el(t.prototype,n),r&&el(t,r),i}(sl);function fl(e){return(fl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function yl(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function bl(e,t){return(bl=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function gl(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=wl(e);if(t){var a=wl(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return vl(this,n)}}function vl(e,t){return!t||"object"!==fl(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function wl(e){return(wl=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Ml=wp.i18n.__,kl=wp.element.Component,Ll=wp.components,Yl=Ll.PanelBody,Dl=Ll.SelectControl,Tl=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&bl(e,t)}(i,e);var t,n,r,a=gl(i);function i(){return _l(this,i),a.apply(this,arguments)}return t=i,(n=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(Yl,{title:Ml("Combo Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(Dl,{label:Ml("Chart Type"),help:Ml("Select the default chart type."),value:t.seriesType?t.seriesType:"area",options:[{label:Ml("Area"),value:"area"},{label:Ml("Bar"),value:"bars"},{label:Ml("Candlesticks"),value:"candlesticks"},{label:Ml("Line"),value:"line"},{label:Ml("Stepped Area"),value:"steppedArea"}],onChange:function(n){t.seriesType=n,e.props.edit(t)}}))}}])&&yl(t.prototype,n),r&&yl(t,r),i}(kl);function Sl(e){return(Sl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ol(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function xl(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function jl(e,t){return(jl=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function El(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Pl(e);if(t){var a=Pl(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Cl(this,n)}}function Cl(e,t){return!t||"object"!==Sl(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Pl(e){return(Pl=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Hl=wp.i18n.__,zl=wp.element,Al=zl.Component,Rl=zl.Fragment,Nl=(wp.blockEditor||wp.editor).ColorPalette,Fl=wp.components,Wl=Fl.BaseControl,Il=Fl.ExternalLink,Bl=Fl.PanelBody,Jl=Fl.SelectControl,Ul=Fl.TextControl,Vl=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&jl(e,t)}(i,e);var t,n,r,a=El(i);function i(){return Ol(this,i),a.apply(this,arguments)}return t=i,(n=[{key:"componentDidMount",value:function(){var e=this.props.chart["visualizer-settings"];Object.keys(e.series).map((function(t){void 0!==e.series[t]&&(e.series[t].temp=1)})),this.props.edit(e)}},{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-chart-type"],n=this.props.chart["visualizer-settings"],r=this.props.chart["visualizer-series"];return wp.element.createElement(Bl,{title:Hl("Series Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},Object.keys(n.series).map((function(a,i){var o=parseInt(a);return"tabular"!==t&&(o=i),a++,wp.element.createElement(Bl,{title:r[a].label,className:"visualizer-inner-sections",initialOpen:!1},-1>=["tabular","pie"].indexOf(t)&&wp.element.createElement(Jl,{label:Hl("Visible In Legend"),help:Hl("Determines whether the series has to be presented in the legend or not."),value:n.series[i].visibleInLegend?n.series[i].visibleInLegend:"1",options:[{label:Hl("Yes"),value:"1"},{label:Hl("No"),value:"0"}],onChange:function(t){n.series[i].visibleInLegend=t,e.props.edit(n)}}),-1>=["tabular","candlestick","combo","column","bar"].indexOf(t)&&wp.element.createElement(Rl,null,wp.element.createElement(Ul,{label:Hl("Line Width"),help:Hl("Overrides the global line width value for this series."),value:n.series[i].lineWidth,onChange:function(t){n.series[i].lineWidth=t,e.props.edit(n)}}),wp.element.createElement(Ul,{label:Hl("Point Size"),help:Hl("Overrides the global point size value for this series."),value:n.series[i].pointSize,onChange:function(t){n.series[i].pointSize=t,e.props.edit(n)}})),-1>=["candlestick"].indexOf(t)&&"number"===r[a].type?wp.element.createElement(Rl,null,wp.element.createElement(Ul,{label:Hl("Format"),help:Hl("Enter custom format pattern to apply to this series value."),value:n.series[o].format,onChange:function(t){n.series[o].format=t,e.props.edit(n)}}),wp.element.createElement("p",null,Hl("For number axis labels, this is a subset of the formatting "),wp.element.createElement(Il,{href:"http://icu-project.org/apiref/icu4c/classDecimalFormat.html#_details"},Hl("ICU pattern set.")),Hl(" For instance, $#,###.## will display values $1,234.56 for value 1234.56. Pay attention that if you use #%% percentage format then your values will be multiplied by 100."))):0<=["date","datetime","timeofday"].indexOf(r[a].type)&&wp.element.createElement(Rl,null,wp.element.createElement(Ul,{label:Hl("Date Format"),help:Hl("Enter custom format pattern to apply to this series value."),placeholder:"dd LLLL yyyy",value:n.series[o].format,onChange:function(t){n.series[o].format=t,e.props.edit(n)}}),wp.element.createElement("p",null,Hl("This is a subset of the date formatting "),wp.element.createElement(Il,{href:"http://userguide.icu-project.org/formatparse/datetime#TOC-Date-Time-Format-Syntax"},Hl("ICU date and time format.")))),0<=["scatter","line"].indexOf(t)&&wp.element.createElement(Jl,{label:Hl("Curve Type"),help:Hl("Determines whether the series has to be presented in the legend or not."),value:n.series[i].curveType?n.series[i].curveType:"none",options:[{label:Hl("Straight line without curve"),value:"none"},{label:Hl("The angles of the line will be smoothed"),value:"function"}],onChange:function(t){n.series[i].curveType=t,e.props.edit(n)}}),0<=["area"].indexOf(t)&&wp.element.createElement(Ul,{label:Hl("Area Opacity"),help:Hl("The opacity of the colored area, where 0.0 is fully transparent and 1.0 is fully opaque."),value:n.series[i].areaOpacity,onChange:function(t){n.series[i].areaOpacity=t,e.props.edit(n)}}),0<=["combo"].indexOf(t)&&wp.element.createElement(Jl,{label:Hl("Chart Type"),help:Hl("Select the type of chart to show for this series."),value:n.series[i].type?n.series[i].type:"area",options:[{label:Hl("Area"),value:"area"},{label:Hl("Bar"),value:"bars"},{label:Hl("Candlesticks"),value:"candlesticks"},{label:Hl("Line"),value:"line"},{label:Hl("Stepped Area"),value:"steppedArea"}],onChange:function(t){n.series[i].type=t,e.props.edit(n)}}),-1>=["tabular"].indexOf(t)&&wp.element.createElement(Wl,{label:Hl("Color")},wp.element.createElement(Nl,{value:n.series[i].color,onChange:function(t){n.series[i].color=t,e.props.edit(n)}})))})))}}])&&xl(t.prototype,n),r&&xl(t,r),i}(Al);function ql(e){return(ql="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Gl(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $l(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Kl(e,t){return(Kl=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Zl(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Xl(e);if(t){var a=Xl(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Ql(this,n)}}function Ql(e,t){return!t||"object"!==ql(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Xl(e){return(Xl=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var eu=wp.i18n.__,tu=wp.element.Component,nu=(wp.blockEditor||wp.editor).ColorPalette,ru=wp.components,au=ru.BaseControl,iu=ru.PanelBody,ou=ru.TextControl,su=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Kl(e,t)}(i,e);var t,n,r,a=Zl(i);function i(){return Gl(this,i),a.apply(this,arguments)}return t=i,(n=[{key:"componentDidMount",value:function(){var e=this.props.chart["visualizer-settings"];Object.keys(e.slices).map((function(t){void 0!==e.slices[t]&&(e.slices[t].temp=1)})),this.props.edit(e)}},{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"],n=this.props.chart["visualizer-data"];return wp.element.createElement(iu,{title:eu("Slices Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},Object.keys(t.slices).map((function(r){return wp.element.createElement(iu,{title:n[r][0],className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(ou,{label:eu("Slice Offset"),help:eu("How far to separate the slice from the rest of the pie, from 0.0 (not at all) to 1.0 (the pie's radius)."),value:t.slices[r].offset,onChange:function(n){t.slices[r].offset=n,e.props.edit(t)},type:"number",min:"0",step:"0.1"}),wp.element.createElement(au,{label:eu("Format")},wp.element.createElement(nu,{value:t.slices[r].color,onChange:function(n){t.slices[r].color=n,e.props.edit(t)}})))})))}}])&&$l(t.prototype,n),r&&$l(t,r),i}(tu);function lu(e){return(lu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function uu(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function cu(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function du(e,t){return(du=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function mu(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=hu(e);if(t){var a=hu(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return pu(this,n)}}function pu(e,t){return!t||"object"!==lu(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function hu(e){return(hu=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var fu=wp.i18n.__,_u=wp.element.Component,yu=(wp.blockEditor||wp.editor).ColorPalette,bu=wp.components,gu=bu.CheckboxControl,vu=bu.BaseControl,wu=bu.PanelBody,Mu=bu.TextControl,ku=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&du(e,t)}(i,e);var t,n,r,a=mu(i);function i(){return uu(this,i),a.apply(this,arguments)}return t=i,(n=[{key:"componentDidMount",value:function(){}},{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(wu,{title:fu("Bubble Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(Mu,{label:fu("Opacity"),help:fu("The default opacity of the bubbles, where 0.0 is fully transparent and 1.0 is fully opaque."),type:"number",min:"0",max:"1",step:"0.1",value:t.bubble.opacity,onChange:function(n){t.bubble||(t.bubble={}),t.bubble.opacity=n,e.props.edit(t)}}),wp.element.createElement(vu,{label:fu("Stroke Color")},wp.element.createElement(yu,{value:t.bubble.stroke,onChange:function(n){t.bubble||(t.bubble={}),t.bubble.stroke=n,e.props.edit(t)}})),wp.element.createElement(gu,{label:fu("Sort Bubbles by Size"),help:fu("If checked, sorts the bubbles by size so the smaller bubbles appear above the larger bubbles. If unchecked, bubbles are sorted according to their order in the table."),checked:Q(t,"sortBubblesBySize"),onChange:function(n){t.sortBubblesBySize=n,e.props.edit(t)}}),wp.element.createElement(Mu,{label:fu("Size (max)"),help:fu("The size value (as appears in the chart data) to be mapped to sizeAxis.maxSize. Larger values will be cropped to this value."),type:"number",step:"1",value:t.sizeAxis.maxValue,onChange:function(n){t.sizeAxis||(t.sizeAxis={}),t.sizeAxis.maxValue=n,e.props.edit(t)}}),wp.element.createElement(Mu,{label:fu("Size (min)"),help:fu("The size value (as appears in the chart data) to be mapped to sizeAxis.minSize. Smaller values will be cropped to this value."),type:"number",step:"1",value:t.sizeAxis.minValue,onChange:function(n){t.sizeAxis||(t.sizeAxis={}),t.sizeAxis.minValue=n,e.props.edit(t)}}))}}])&&cu(t.prototype,n),r&&cu(t,r),i}(_u);function Lu(e){return(Lu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Yu(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Du(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Tu(e,t){return(Tu=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Su(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=xu(e);if(t){var a=xu(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Ou(this,n)}}function Ou(e,t){return!t||"object"!==Lu(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function xu(e){return(xu=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var ju=wp.i18n.__,Eu=wp.element,Cu=Eu.Component,Pu=Eu.Fragment,Hu=wp.components,zu=Hu.ExternalLink,Au=Hu.PanelBody,Ru=Hu.TextControl,Nu=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Tu(e,t)}(i,e);var t,n,r,a=Su(i);function i(){return Yu(this,i),a.apply(this,arguments)}return t=i,(n=[{key:"componentDidMount",value:function(){var e=this.props.chart["visualizer-settings"];e.series&&(Object.keys(e.series).map((function(t){void 0!==e.series[t]&&(e.series[t].temp=1)})),this.props.edit(e))}},{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"],n=this.props.chart["visualizer-series"];return this.props.chart["visualizer-chart-type"],t.series?wp.element.createElement(Au,{title:ju("Column Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},Object.keys(t.series).map((function(r){return"string"===n[r].type?null:wp.element.createElement(Au,{title:n[r].label,className:"visualizer-inner-sections",initialOpen:!1},0<=["date","datetime","timeofday"].indexOf(n[r].type)&&wp.element.createElement(Pu,null,wp.element.createElement(Ru,{label:ju("Display Date Format"),help:ju("Enter custom format pattern to apply to this series value."),value:t.series[r].format?t.series[r].format.to:"",onChange:function(n){t.series[r].format||(t.series[r].format={}),t.series[r].format.to=n,e.props.edit(t)}}),wp.element.createElement(Ru,{label:ju("Source Date Format"),help:ju("What format is the source date in?"),value:t.series[r].format?t.series[r].format.from:"",onChange:function(n){t.series[r].format||(t.series[r].format={}),t.series[r].format.from=n,e.props.edit(t)}}),wp.element.createElement("p",null,ju("You can find more info on "),wp.element.createElement(zu,{href:"https://momentjs.com/docs/#/displaying/"},ju("date and time formats here.")))),"number"===n[r].type&&wp.element.createElement(Pu,null,wp.element.createElement(Ru,{label:ju("Thousands Separator"),value:t.series[r].format?t.series[r].format.thousands:"",onChange:function(n){t.series[r].format||(t.series[r].format={}),t.series[r].format.thousands=n,e.props.edit(t)}}),wp.element.createElement(Ru,{label:ju("Decimal Separator"),value:t.series[r].format?t.series[r].format.decimal:"",onChange:function(n){t.series[r].format||(t.series[r].format={}),t.series[r].format.decimal=n,e.props.edit(t)}}),wp.element.createElement(Ru,{label:ju("Precision"),help:ju("Round values to how many decimal places?"),value:t.series[r].format?t.series[r].format.precision:"",type:"number",min:"0",onChange:function(n){100<n||(t.series[r].format||(t.series[r].format={}),t.series[r].format.precision=n,e.props.edit(t))}}),wp.element.createElement(Ru,{label:ju("Prefix"),value:t.series[r].format?t.series[r].format.prefix:"",onChange:function(n){t.series[r].format||(t.series[r].format={}),t.series[r].format.prefix=n,e.props.edit(t)}}),wp.element.createElement(Ru,{label:ju("Suffix"),value:t.series[r].format?t.series[r].format.suffix:"",onChange:function(n){t.series[r].format||(t.series[r].format={}),t.series[r].format.suffix=n,e.props.edit(t)}})),"boolean"===n[r].type&&wp.element.createElement(Pu,null,wp.element.createElement(Ru,{label:ju("Truthy value"),help:ju("Provide the HTML entity code for the value the table should display when the value of the column is true. e.g. tick mark (Code: &#10004;) instead of true"),value:t.series[r].format?t.series[r].format.truthy:"",onChange:function(n){t.series[r].truthy||(t.series[r].truthy={}),t.series[r].format.truthy=n,e.props.edit(t)}}),wp.element.createElement(Ru,{label:ju("Falsy value"),help:ju("Provide the HTML entity code for the value the table should display when the value of the column is false. e.g. cross mark (Code: &#10006;) instead of false"),value:t.series[r].format?t.series[r].format.falsy:"",onChange:function(n){t.series[r].falsy||(t.series[r].falsy={}),t.series[r].format.falsy=n,e.props.edit(t)}})))}))):null}}])&&Du(t.prototype,n),r&&Du(t,r),i}(Cu);function Fu(e){return(Fu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Wu(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Iu(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Bu(e,t){return(Bu=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Ju(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Vu(e);if(t){var a=Vu(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Uu(this,n)}}function Uu(e,t){return!t||"object"!==Fu(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Vu(e){return(Vu=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var qu=wp.i18n.__,Gu=wp.element,$u=Gu.Component,Ku=Gu.Fragment,Zu=(wp.blockEditor||wp.editor).ColorPalette,Qu=wp.components,Xu=Qu.BaseControl,ec=Qu.CheckboxControl,tc=Qu.PanelBody,nc=Qu.SelectControl,rc=Qu.TextControl,ac=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Bu(e,t)}(i,e);var t,n,r,a=Ju(i);function i(){return Wu(this,i),a.apply(this,arguments)}return t=i,(n=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-chart-type"],n=this.props.chart["visualizer-settings"];return wp.element.createElement(tc,{title:qu("Layout And Chart Area"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(tc,{title:qu("Layout"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(rc,{label:qu("Width of Chart"),help:qu("Determines the total width of the chart."),value:n.width,onChange:function(t){n.width=t,e.props.edit(n)}}),wp.element.createElement(rc,{label:qu("Height of Chart"),help:qu("Determines the total height of the chart."),value:n.height,onChange:function(t){n.height=t,e.props.edit(n)}}),0<=["geo"].indexOf(t)&&wp.element.createElement(nc,{label:qu("Keep Aspect Ratio"),help:qu("If yes, the map will be drawn at the largest size that can fit inside the chart area at its natural aspect ratio. If only one of the width and height options is specified, the other one will be calculated according to the aspect ratio. If no, the map will be stretched to the exact size of the chart as specified by the width and height options."),value:n.keepAspectRatio?n.isStacked:"1",options:[{label:qu("Yes"),value:"1"},{label:qu("No"),value:"0"}],onChange:function(t){n.keepAspectRatio=t,e.props.edit(n)}}),-1>=["gauge","tabular"].indexOf(t)&&wp.element.createElement(Ku,null,wp.element.createElement(rc,{label:qu("Stroke Width"),help:qu("The chart border width in pixels."),value:n.backgroundColor.strokeWidth,onChange:function(t){n.backgroundColor.strokeWidth=t,e.props.edit(n)}}),wp.element.createElement(Xu,{label:qu("Stroke Color")},wp.element.createElement(Zu,{value:n.backgroundColor.stroke,onChange:function(t){n.backgroundColor.stroke=t,e.props.edit(n)}})),wp.element.createElement(Xu,{label:qu("Background Color")},wp.element.createElement(Zu,{value:n.backgroundColor.fill,onChange:function(t){n.backgroundColor.fill=t,e.props.edit(n)}})),wp.element.createElement(ec,{label:qu("Transparent Background?"),checked:"transparent"===n.backgroundColor.fill,onChange:function(t){n.backgroundColor.fill="transparent"===n.backgroundColor.fill?"":"transparent",e.props.edit(n)}}))),-1>=["geo","gauge","tabular"].indexOf(t)&&wp.element.createElement(tc,{title:qu("Chart Area"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(rc,{label:qu("Left Margin"),help:qu("Determines how far to draw the chart from the left border."),value:n.chartArea.left,onChange:function(t){n.chartArea.left=t,e.props.edit(n)}}),wp.element.createElement(rc,{label:qu("Top Margin"),help:qu("Determines how far to draw the chart from the top border."),value:n.chartArea.top,onChange:function(t){n.chartArea.top=t,e.props.edit(n)}}),wp.element.createElement(rc,{label:qu("Width Of Chart Area"),help:qu("Determines the width of the chart area."),value:n.chartArea.width,onChange:function(t){n.chartArea.width=t,e.props.edit(n)}}),wp.element.createElement(rc,{label:qu("Height Of Chart Area"),help:qu("Determines the hight of the chart area."),value:n.chartArea.height,onChange:function(t){n.chartArea.height=t,e.props.edit(n)}})))}}])&&Iu(t.prototype,n),r&&Iu(t,r),i}($u);function ic(e){return(ic="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function oc(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function sc(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function lc(e,t){return(lc=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function uc(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=dc(e);if(t){var a=dc(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return cc(this,n)}}function cc(e,t){return!t||"object"!==ic(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function dc(e){return(dc=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var mc=wp.i18n.__,pc=wp.element,hc=pc.Component,fc=pc.Fragment,_c=wp.components,yc=_c.CheckboxControl,bc=_c.PanelBody,gc=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&lc(e,t)}(i,e);var t,n,r,a=uc(i);function i(){return oc(this,i),a.apply(this,arguments)}return t=i,(n=[{key:"componentDidMount",value:function(){var e=this.props.chart["visualizer-settings"];void 0===e.actions&&(e.actions=[]),this.props.edit(e)}},{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"],n=this.props.chart["visualizer-chart-type"];return wp.element.createElement(bc,{title:mc("Frontend Actions"),initialOpen:!1,className:"visualizer-advanced-panel"},void 0!==t.actions&&wp.element.createElement(fc,null,wp.element.createElement(yc,{label:mc("Print"),help:mc("To enable printing the data."),checked:0<=t.actions.indexOf("print"),onChange:function(n){if(0<=t.actions.indexOf("print")){var r=t.actions.indexOf("print");-1!==r&&t.actions.splice(r,1)}else t.actions.push("print");e.props.edit(t)}}),wp.element.createElement(yc,{label:mc("CSV"),help:mc("To enable downloading the data as a CSV."),checked:0<=t.actions.indexOf("csv;application/csv"),onChange:function(n){if(0<=t.actions.indexOf("csv;application/csv")){var r=t.actions.indexOf("csv;application/csv");-1!==r&&t.actions.splice(r,1)}else t.actions.push("csv;application/csv");e.props.edit(t)}}),wp.element.createElement(yc,{label:mc("Excel"),help:mc("To enable downloading the data as an Excel spreadsheet."),checked:0<=t.actions.indexOf("xls;application/vnd.ms-excel"),onChange:function(n){if(0<=t.actions.indexOf("xls;application/vnd.ms-excel")){var r=t.actions.indexOf("xls;application/vnd.ms-excel");-1!==r&&t.actions.splice(r,1)}else t.actions.push("xls;application/vnd.ms-excel");e.props.edit(t)}}),wp.element.createElement(yc,{label:mc("Copy"),help:mc("To enable copying the data to the clipboard."),checked:0<=t.actions.indexOf("copy"),onChange:function(n){if(0<=t.actions.indexOf("copy")){var r=t.actions.indexOf("copy");-1!==r&&t.actions.splice(r,1)}else t.actions.push("copy");e.props.edit(t)}}),-1>=["dataTable","tabular","gauge","table"].indexOf(n)&&wp.element.createElement(yc,{label:mc("Download Image"),help:mc("To download the chart as an image."),checked:0<=t.actions.indexOf("image"),onChange:function(n){if(0<=t.actions.indexOf("image")){var r=t.actions.indexOf("image");-1!==r&&t.actions.splice(r,1)}else t.actions.push("image");e.props.edit(t)}})))}}])&&sc(t.prototype,n),r&&sc(t,r),i}(hc);function vc(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){vc(e,t,n[t])}))}return e}var Mc={dark_vscode_tribute:{default:"#D4D4D4",background:"#1E1E1E",background_warning:"#1E1E1E",string:"#CE8453",number:"#B5CE9F",colon:"#49B8F7",keys:"#9CDCFE",keys_whiteSpace:"#AF74A5",primitive:"#6392C6"},light_mitsuketa_tribute:{default:"#D4D4D4",background:"#FCFDFD",background_warning:"#FEECEB",string:"#FA7921",number:"#70CE35",colon:"#49B8F7",keys:"#59A5D8",keys_whiteSpace:"#835FB6",primitive:"#386FA4"}},kc=n(2);const Lc={getCaller:(e=1)=>{var t=(new Error).stack.replace(/^Error\s+/,"");return t=(t=t.split("\n")[e]).replace(/^\s+at Object./,"").replace(/^\s+at /,"").replace(/ \(.+\)$/,"")},throwError:(e="unknown function",t="unknown parameter",n="to be defined")=>{throw["@",e,"(): Expected parameter '",t,"' ",n].join("")},isUndefined:(e="<unknown parameter>",t)=>{[null,void 0].indexOf(t)>-1&&Lc.throwError(Lc.getCaller(2),e)},isFalsy:(e="<unknown parameter>",t)=>{t||Lc.throwError(Lc.getCaller(2),e)},isNoneOf:(e="<unknown parameter>",t,n=[])=>{-1===n.indexOf(t)&&Lc.throwError(Lc.getCaller(2),e,"to be any of"+JSON.stringify(n))},isAnyOf:(e="<unknown parameter>",t,n=[])=>{n.indexOf(t)>-1&&Lc.throwError(Lc.getCaller(2),e,"not to be any of"+JSON.stringify(n))},isNotType:(e="<unknown parameter>",t,n="")=>{Object(kc.getType)(t)!==n.toLowerCase()&&Lc.throwError(Lc.getCaller(2),e,"to be type "+n.toLowerCase())},isAnyTypeOf:(e="<unknown parameter>",t,n=[])=>{n.forEach(n=>{Object(kc.getType)(t)===n&&Lc.throwError(Lc.getCaller(2),e,"not to be type of "+n.toLowerCase())})},missingKey:(e="<unknown parameter>",t,n="")=>{Lc.isUndefined(e,t),-1===Object.keys(t).indexOf(n)&&Lc.throwError(Lc.getCaller(2),e,"to contain '"+n+"' key")},missingAnyKeys:(e="<unknown parameter>",t,n=[""])=>{Lc.isUndefined(e,t);const r=Object.keys(t);n.forEach(t=>{-1===r.indexOf(t)&&Lc.throwError(Lc.getCaller(2),e,"to contain '"+t+"' key")})},containsUndefined:(e="<unknown parameter>",t)=>{[void 0,null].forEach(n=>{const r=Object(kc.locate)(t,n);r&&Lc.throwError(Lc.getCaller(2),e,"not to contain '"+JSON.stringify(n)+"' at "+r)})},isInvalidPath:(e="<unknown parameter>",t)=>{Lc.isUndefined(e,t),Lc.isNotType(e,t,"string"),Lc.isAnyOf(e,t,["","/"]),".$[]#".split().forEach(n=>{t.indexOf(n)>-1&&Lc.throwError(Lc.getCaller(2),e,"not to contain invalid character '"+n+"'")}),t.match(/\/{2,}/g)&&Lc.throwError(Lc.getCaller(2),e,"not to contain consecutive forward slash characters")},isInvalidWriteData:(e="<unknown parameter>",t)=>{Lc.isUndefined(e,t),Lc.containsUndefined(e,t)}};var Yc=Lc;const Dc=(e,t)=>t?Object.keys(t).reduce((e,n)=>e.replace(new RegExp(`\\{${n}\\}`,"gi"),(e=>Array.isArray(e)?e.join(", "):"string"==typeof e?e:""+e)(t[n])),e):e;var Tc={format:"{reason} at line {line}",symbols:{colon:"colon",comma:"comma",semicolon:"semicolon",slash:"slash",backslash:"backslash",brackets:{round:"round brackets",square:"square brackets",curly:"curly brackets",angle:"angle brackets"},period:"period",quotes:{single:"single quote",double:"double quote",grave:"grave accent"},space:"space",ampersand:"ampersand",asterisk:"asterisk",at:"at sign",equals:"equals sign",hash:"hash",percent:"percent",plus:"plus",minus:"minus",dash:"dash",hyphen:"hyphen",tilde:"tilde",underscore:"underscore",bar:"vertical bar"},types:{key:"key",value:"value",number:"number",string:"string",primitive:"primitive",boolean:"boolean",character:"character",integer:"integer",array:"array",float:"float"},invalidToken:{tokenSequence:{prohibited:"'{firstToken}' token cannot be followed by '{secondToken}' token(s)",permitted:"'{firstToken}' token can only be followed by '{secondToken}' token(s)"},termSequence:{prohibited:"A {firstTerm} cannot be followed by a {secondTerm}",permitted:"A {firstTerm} can only be followed by a {secondTerm}"},double:"'{token}' token cannot be followed by another '{token}' token",useInstead:"'{badToken}' token is not accepted. Use '{goodToken}' instead",unexpected:"Unexpected '{token}' token found"},brace:{curly:{missingOpen:"Missing '{' open curly brace",missingClose:"Open '{' curly brace is missing closing '}' curly brace",cannotWrap:"'{token}' token cannot be wrapped in '{}' curly braces"},square:{missingOpen:"Missing '[' open square brace",missingClose:"Open '[' square brace is missing closing ']' square brace",cannotWrap:"'{token}' token cannot be wrapped in '[]' square braces"}},string:{missingOpen:"Missing/invalid opening string '{quote}' token",missingClose:"Missing/invalid closing string '{quote}' token",mustBeWrappedByQuotes:"Strings must be wrapped by quotes",nonAlphanumeric:"Non-alphanumeric token '{token}' is not allowed outside string notation",unexpectedKey:"Unexpected key found at string position"},key:{numberAndLetterMissingQuotes:"Key beginning with number and containing letters must be wrapped by quotes",spaceMissingQuotes:"Key containing space must be wrapped by quotes",unexpectedString:"Unexpected string found at key position"},noTrailingOrLeadingComma:"Trailing or leading commas in arrays and objects are not permitted"};
65
  /** @license react-json-editor-ajrm v2.5.13
66
  *
67
  * This source code is licensed under the MIT license found in the
61
  *
62
  * Copyright © 2014 David Bushell | BSD & MIT license | https://github.com/dbushell/Pikaday
63
  */
64
+ !function(t,r){"use strict";var a;try{a=n(0)}catch(e){}e.exports=function(e){var t="function"==typeof e,n=!!window.addEventListener,r=window.document,a=window.setTimeout,i=function(e,t,r,a){n?e.addEventListener(t,r,!!a):e.attachEvent("on"+t,r)},o=function(e,t,r,a){n?e.removeEventListener(t,r,!!a):e.detachEvent("on"+t,r)},s=function(e,t,n){var a;r.createEvent?((a=r.createEvent("HTMLEvents")).initEvent(t,!0,!1),a=_(a,n),e.dispatchEvent(a)):r.createEventObject&&(a=r.createEventObject(),a=_(a,n),e.fireEvent("on"+t,a))},l=function(e,t){return-1!==(" "+e.className+" ").indexOf(" "+t+" ")},u=function(e){return/Array/.test(Object.prototype.toString.call(e))},c=function(e){return/Date/.test(Object.prototype.toString.call(e))&&!isNaN(e.getTime())},d=function(e){var t=e.getDay();return 0===t||6===t},m=function(e){return e%4==0&&e%100!=0||e%400==0},p=function(e,t){return[31,m(e)?29:28,31,30,31,30,31,31,30,31,30,31][t]},h=function(e){c(e)&&e.setHours(0,0,0,0)},f=function(e,t){return e.getTime()===t.getTime()},_=function(e,t,n){var r,a;for(r in t)(a=void 0!==e[r])&&"object"==typeof t[r]&&null!==t[r]&&void 0===t[r].nodeName?c(t[r])?n&&(e[r]=new Date(t[r].getTime())):u(t[r])?n&&(e[r]=t[r].slice(0)):e[r]=_({},t[r],n):!n&&a||(e[r]=t[r]);return e},y=function(e){return e.month<0&&(e.year-=Math.ceil(Math.abs(e.month)/12),e.month+=12),e.month>11&&(e.year+=Math.floor(Math.abs(e.month)/12),e.month-=12),e},b={field:null,bound:void 0,position:"bottom left",reposition:!0,format:"YYYY-MM-DD",defaultDate:null,setDefaultDate:!1,firstDay:0,formatStrict:!1,minDate:null,maxDate:null,yearRange:10,showWeekNumber:!1,minYear:0,maxYear:9999,minMonth:void 0,maxMonth:void 0,startRange:null,endRange:null,isRTL:!1,yearSuffix:"",showMonthAfterYear:!1,showDaysInNextAndPreviousMonths:!1,numberOfMonths:1,mainCalendar:"left",container:void 0,i18n:{previousMonth:"Previous Month",nextMonth:"Next Month",months:["January","February","March","April","May","June","July","August","September","October","November","December"],weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},theme:null,onSelect:null,onOpen:null,onClose:null,onDraw:null},g=function(e,t,n){for(t+=e.firstDay;t>=7;)t-=7;return n?e.i18n.weekdaysShort[t]:e.i18n.weekdays[t]},v=function(e){var t=[],n="false";if(e.isEmpty){if(!e.showDaysInNextAndPreviousMonths)return'<td class="is-empty"></td>';t.push("is-outside-current-month")}return e.isDisabled&&t.push("is-disabled"),e.isToday&&t.push("is-today"),e.isSelected&&(t.push("is-selected"),n="true"),e.isInRange&&t.push("is-inrange"),e.isStartRange&&t.push("is-startrange"),e.isEndRange&&t.push("is-endrange"),'<td data-day="'+e.day+'" class="'+t.join(" ")+'" aria-selected="'+n+'"><button class="pika-button pika-day" type="button" data-pika-year="'+e.year+'" data-pika-month="'+e.month+'" data-pika-day="'+e.day+'">'+e.day+"</button></td>"},w=function(e,t){return"<tr>"+(t?e.reverse():e).join("")+"</tr>"},M=function(e,t,n,r,a,i){var o,s,l,c,d,m=e._o,p=n===m.minYear,h=n===m.maxYear,f='<div id="'+i+'" class="pika-title" role="heading" aria-live="assertive">',_=!0,y=!0;for(l=[],o=0;o<12;o++)l.push('<option value="'+(n===a?o-t:12+o-t)+'"'+(o===r?' selected="selected"':"")+(p&&o<m.minMonth||h&&o>m.maxMonth?'disabled="disabled"':"")+">"+m.i18n.months[o]+"</option>");for(c='<div class="pika-label">'+m.i18n.months[r]+'<select class="pika-select pika-select-month" tabindex="-1">'+l.join("")+"</select></div>",u(m.yearRange)?(o=m.yearRange[0],s=m.yearRange[1]+1):(o=n-m.yearRange,s=1+n+m.yearRange),l=[];o<s&&o<=m.maxYear;o++)o>=m.minYear&&l.push('<option value="'+o+'"'+(o===n?' selected="selected"':"")+">"+o+"</option>");return d='<div class="pika-label">'+n+m.yearSuffix+'<select class="pika-select pika-select-year" tabindex="-1">'+l.join("")+"</select></div>",m.showMonthAfterYear?f+=d+c:f+=c+d,p&&(0===r||m.minMonth>=r)&&(_=!1),h&&(11===r||m.maxMonth<=r)&&(y=!1),0===t&&(f+='<button class="pika-prev'+(_?"":" is-disabled")+'" type="button">'+m.i18n.previousMonth+"</button>"),t===e._o.numberOfMonths-1&&(f+='<button class="pika-next'+(y?"":" is-disabled")+'" type="button">'+m.i18n.nextMonth+"</button>"),f+"</div>"},k=function(o){var s=this,u=s.config(o);s._onMouseDown=function(e){if(s._v){var t=(e=e||window.event).target||e.srcElement;if(t)if(l(t,"is-disabled")||(!l(t,"pika-button")||l(t,"is-empty")||l(t.parentNode,"is-disabled")?l(t,"pika-prev")?s.prevMonth():l(t,"pika-next")&&s.nextMonth():(s.setDate(new Date(t.getAttribute("data-pika-year"),t.getAttribute("data-pika-month"),t.getAttribute("data-pika-day"))),u.bound&&a((function(){s.hide(),u.field&&u.field.blur()}),100))),l(t,"pika-select"))s._c=!0;else{if(!e.preventDefault)return e.returnValue=!1,!1;e.preventDefault()}}},s._onChange=function(e){var t=(e=e||window.event).target||e.srcElement;t&&(l(t,"pika-select-month")?s.gotoMonth(t.value):l(t,"pika-select-year")&&s.gotoYear(t.value))},s._onKeyChange=function(e){if(e=e||window.event,s.isVisible())switch(e.keyCode){case 13:case 27:u.field.blur();break;case 37:e.preventDefault(),s.adjustDate("subtract",1);break;case 38:s.adjustDate("subtract",7);break;case 39:s.adjustDate("add",1);break;case 40:s.adjustDate("add",7)}},s._onInputChange=function(n){var r;n.firedBy!==s&&(r=t?(r=e(u.field.value,u.format,u.formatStrict))&&r.isValid()?r.toDate():null:new Date(Date.parse(u.field.value)),c(r)&&s.setDate(r),s._v||s.show())},s._onInputFocus=function(){s.show()},s._onInputClick=function(){s.show()},s._onInputBlur=function(){var e=r.activeElement;do{if(l(e,"pika-single"))return}while(e=e.parentNode);s._c||(s._b=a((function(){s.hide()}),50)),s._c=!1},s._onClick=function(e){var t=(e=e||window.event).target||e.srcElement,r=t;if(t){!n&&l(t,"pika-select")&&(t.onchange||(t.setAttribute("onchange","return;"),i(t,"change",s._onChange)));do{if(l(r,"pika-single")||r===u.trigger)return}while(r=r.parentNode);s._v&&t!==u.trigger&&r!==u.trigger&&s.hide()}},s.el=r.createElement("div"),s.el.className="pika-single"+(u.isRTL?" is-rtl":"")+(u.theme?" "+u.theme:""),i(s.el,"mousedown",s._onMouseDown,!0),i(s.el,"touchend",s._onMouseDown,!0),i(s.el,"change",s._onChange),i(r,"keydown",s._onKeyChange),u.field&&(u.container?u.container.appendChild(s.el):u.bound?r.body.appendChild(s.el):u.field.parentNode.insertBefore(s.el,u.field.nextSibling),i(u.field,"change",s._onInputChange),u.defaultDate||(t&&u.field.value?u.defaultDate=e(u.field.value,u.format).toDate():u.defaultDate=new Date(Date.parse(u.field.value)),u.setDefaultDate=!0));var d=u.defaultDate;c(d)?u.setDefaultDate?s.setDate(d,!0):s.gotoDate(d):s.gotoDate(new Date),u.bound?(this.hide(),s.el.className+=" is-bound",i(u.trigger,"click",s._onInputClick),i(u.trigger,"focus",s._onInputFocus),i(u.trigger,"blur",s._onInputBlur)):this.show()};return k.prototype={config:function(e){this._o||(this._o=_({},b,!0));var t=_(this._o,e,!0);t.isRTL=!!t.isRTL,t.field=t.field&&t.field.nodeName?t.field:null,t.theme="string"==typeof t.theme&&t.theme?t.theme:null,t.bound=!!(void 0!==t.bound?t.field&&t.bound:t.field),t.trigger=t.trigger&&t.trigger.nodeName?t.trigger:t.field,t.disableWeekends=!!t.disableWeekends,t.disableDayFn="function"==typeof t.disableDayFn?t.disableDayFn:null;var n=parseInt(t.numberOfMonths,10)||1;if(t.numberOfMonths=n>4?4:n,c(t.minDate)||(t.minDate=!1),c(t.maxDate)||(t.maxDate=!1),t.minDate&&t.maxDate&&t.maxDate<t.minDate&&(t.maxDate=t.minDate=!1),t.minDate&&this.setMinDate(t.minDate),t.maxDate&&this.setMaxDate(t.maxDate),u(t.yearRange)){var r=(new Date).getFullYear()-10;t.yearRange[0]=parseInt(t.yearRange[0],10)||r,t.yearRange[1]=parseInt(t.yearRange[1],10)||r}else t.yearRange=Math.abs(parseInt(t.yearRange,10))||b.yearRange,t.yearRange>100&&(t.yearRange=100);return t},toString:function(n){return c(this._d)?t?e(this._d).format(n||this._o.format):this._d.toDateString():""},getMoment:function(){return t?e(this._d):null},setMoment:function(n,r){t&&e.isMoment(n)&&this.setDate(n.toDate(),r)},getDate:function(){return c(this._d)?new Date(this._d.getTime()):new Date},setDate:function(e,t){if(!e)return this._d=null,this._o.field&&(this._o.field.value="",s(this._o.field,"change",{firedBy:this})),this.draw();if("string"==typeof e&&(e=new Date(Date.parse(e))),c(e)){var n=this._o.minDate,r=this._o.maxDate;c(n)&&e<n?e=n:c(r)&&e>r&&(e=r),this._d=new Date(e.getTime()),h(this._d),this.gotoDate(this._d),this._o.field&&(this._o.field.value=this.toString(),s(this._o.field,"change",{firedBy:this})),t||"function"!=typeof this._o.onSelect||this._o.onSelect.call(this,this.getDate())}},gotoDate:function(e){var t=!0;if(c(e)){if(this.calendars){var n=new Date(this.calendars[0].year,this.calendars[0].month,1),r=new Date(this.calendars[this.calendars.length-1].year,this.calendars[this.calendars.length-1].month,1),a=e.getTime();r.setMonth(r.getMonth()+1),r.setDate(r.getDate()-1),t=a<n.getTime()||r.getTime()<a}t&&(this.calendars=[{month:e.getMonth(),year:e.getFullYear()}],"right"===this._o.mainCalendar&&(this.calendars[0].month+=1-this._o.numberOfMonths)),this.adjustCalendars()}},adjustDate:function(n,r){var a,i=this.getDate(),o=24*parseInt(r)*60*60*1e3;"add"===n?a=new Date(i.valueOf()+o):"subtract"===n&&(a=new Date(i.valueOf()-o)),t&&("add"===n?a=e(i).add(r,"days").toDate():"subtract"===n&&(a=e(i).subtract(r,"days").toDate())),this.setDate(a)},adjustCalendars:function(){this.calendars[0]=y(this.calendars[0]);for(var e=1;e<this._o.numberOfMonths;e++)this.calendars[e]=y({month:this.calendars[0].month+e,year:this.calendars[0].year});this.draw()},gotoToday:function(){this.gotoDate(new Date)},gotoMonth:function(e){isNaN(e)||(this.calendars[0].month=parseInt(e,10),this.adjustCalendars())},nextMonth:function(){this.calendars[0].month++,this.adjustCalendars()},prevMonth:function(){this.calendars[0].month--,this.adjustCalendars()},gotoYear:function(e){isNaN(e)||(this.calendars[0].year=parseInt(e,10),this.adjustCalendars())},setMinDate:function(e){e instanceof Date?(h(e),this._o.minDate=e,this._o.minYear=e.getFullYear(),this._o.minMonth=e.getMonth()):(this._o.minDate=b.minDate,this._o.minYear=b.minYear,this._o.minMonth=b.minMonth,this._o.startRange=b.startRange),this.draw()},setMaxDate:function(e){e instanceof Date?(h(e),this._o.maxDate=e,this._o.maxYear=e.getFullYear(),this._o.maxMonth=e.getMonth()):(this._o.maxDate=b.maxDate,this._o.maxYear=b.maxYear,this._o.maxMonth=b.maxMonth,this._o.endRange=b.endRange),this.draw()},setStartRange:function(e){this._o.startRange=e},setEndRange:function(e){this._o.endRange=e},draw:function(e){if(this._v||e){var t,n=this._o,r=n.minYear,i=n.maxYear,o=n.minMonth,s=n.maxMonth,l="";this._y<=r&&(this._y=r,!isNaN(o)&&this._m<o&&(this._m=o)),this._y>=i&&(this._y=i,!isNaN(s)&&this._m>s&&(this._m=s)),t="pika-title-"+Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,2);for(var u=0;u<n.numberOfMonths;u++)l+='<div class="pika-lendar">'+M(this,u,this.calendars[u].year,this.calendars[u].month,this.calendars[0].year,t)+this.render(this.calendars[u].year,this.calendars[u].month,t)+"</div>";this.el.innerHTML=l,n.bound&&"hidden"!==n.field.type&&a((function(){n.trigger.focus()}),1),"function"==typeof this._o.onDraw&&this._o.onDraw(this),n.bound&&n.field.setAttribute("aria-label","Use the arrow keys to pick a date")}},adjustPosition:function(){var e,t,n,a,i,o,s,l,u,c;if(!this._o.container){if(this.el.style.position="absolute",t=e=this._o.trigger,n=this.el.offsetWidth,a=this.el.offsetHeight,i=window.innerWidth||r.documentElement.clientWidth,o=window.innerHeight||r.documentElement.clientHeight,s=window.pageYOffset||r.body.scrollTop||r.documentElement.scrollTop,"function"==typeof e.getBoundingClientRect)l=(c=e.getBoundingClientRect()).left+window.pageXOffset,u=c.bottom+window.pageYOffset;else for(l=t.offsetLeft,u=t.offsetTop+t.offsetHeight;t=t.offsetParent;)l+=t.offsetLeft,u+=t.offsetTop;(this._o.reposition&&l+n>i||this._o.position.indexOf("right")>-1&&l-n+e.offsetWidth>0)&&(l=l-n+e.offsetWidth),(this._o.reposition&&u+a>o+s||this._o.position.indexOf("top")>-1&&u-a-e.offsetHeight>0)&&(u=u-a-e.offsetHeight),this.el.style.left=l+"px",this.el.style.top=u+"px"}},render:function(e,t,n){var r=this._o,a=new Date,i=p(e,t),o=new Date(e,t,1).getDay(),s=[],l=[];h(a),r.firstDay>0&&(o-=r.firstDay)<0&&(o+=7);for(var u,m,_,y,b=0===t?11:t-1,M=11===t?0:t+1,k=0===t?e-1:e,L=11===t?e+1:e,Y=p(k,b),D=i+o,T=D;T>7;)T-=7;D+=7-T;for(var S=0,O=0;S<D;S++){var x=new Date(e,t,S-o+1),j=!!c(this._d)&&f(x,this._d),E=f(x,a),C=S<o||S>=i+o,P=S-o+1,H=t,z=e,A=r.startRange&&f(r.startRange,x),R=r.endRange&&f(r.endRange,x),N=r.startRange&&r.endRange&&r.startRange<x&&x<r.endRange;C&&(S<o?(P=Y+P,H=b,z=k):(P-=i,H=M,z=L));var F={day:P,month:H,year:z,isSelected:j,isToday:E,isDisabled:r.minDate&&x<r.minDate||r.maxDate&&x>r.maxDate||r.disableWeekends&&d(x)||r.disableDayFn&&r.disableDayFn(x),isEmpty:C,isStartRange:A,isEndRange:R,isInRange:N,showDaysInNextAndPreviousMonths:r.showDaysInNextAndPreviousMonths};l.push(v(F)),7==++O&&(r.showWeekNumber&&l.unshift((u=S-o,m=t,_=e,y=void 0,void 0,y=new Date(_,0,1),'<td class="pika-week">'+Math.ceil(((new Date(_,m,u)-y)/864e5+y.getDay()+1)/7)+"</td>")),s.push(w(l,r.isRTL)),l=[],O=0)}return function(e,t,n){return'<table cellpadding="0" cellspacing="0" class="pika-table" role="grid" aria-labelledby="'+n+'">'+function(e){var t,n=[];e.showWeekNumber&&n.push("<th></th>");for(t=0;t<7;t++)n.push('<th scope="col"><abbr title="'+g(e,t)+'">'+g(e,t,!0)+"</abbr></th>");return"<thead><tr>"+(e.isRTL?n.reverse():n).join("")+"</tr></thead>"}(e)+(r=t,"<tbody>"+r.join("")+"</tbody></table>");var r}(r,s,n)},isVisible:function(){return this._v},show:function(){var e,t,n;this.isVisible()||(e=this.el,t="is-hidden",e.className=(n=(" "+e.className+" ").replace(" "+t+" "," ")).trim?n.trim():n.replace(/^\s+|\s+$/g,""),this._v=!0,this.draw(),this._o.bound&&(i(r,"click",this._onClick),this.adjustPosition()),"function"==typeof this._o.onOpen&&this._o.onOpen.call(this))},hide:function(){var e,t,n=this._v;!1!==n&&(this._o.bound&&o(r,"click",this._onClick),this.el.style.position="static",this.el.style.left="auto",this.el.style.top="auto",e=this.el,l(e,t="is-hidden")||(e.className=""===e.className?t:e.className+" "+t),this._v=!1,void 0!==n&&"function"==typeof this._o.onClose&&this._o.onClose.call(this))},destroy:function(){this.hide(),o(this.el,"mousedown",this._onMouseDown,!0),o(this.el,"touchend",this._onMouseDown,!0),o(this.el,"change",this._onChange),this._o.field&&(o(this._o.field,"change",this._onInputChange),this._o.bound&&(o(this._o.trigger,"click",this._onInputClick),o(this._o.trigger,"focus",this._onInputFocus),o(this._o.trigger,"blur",this._onInputBlur))),this.el.parentNode&&this.el.parentNode.removeChild(this.el)}},k}(a)}()},,function(e,t,n){},function(e,t,n){"use strict";n.r(t);var r=n(1),a=n.n(r),i=n(129),o=n.n(i),s=function(e,t){return(s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function l(e,t){function n(){this.constructor=e}s(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var u=function(){return(u=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e}).apply(this,arguments)};function c(e,t,n,r){return new(n||(n=Promise))((function(a,i){function o(e){try{l(r.next(e))}catch(e){i(e)}}function s(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){e.done?a(e.value):new n((function(t){t(e.value)})).then(o,s)}l((r=r.apply(e,t||[])).next())}))}function d(e,t){var n,r,a,i,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(a=2&i[0]?r.return:i[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,i[1])).done)return a;switch(r=0,a&&(i=[2&i[0],a.value]),i[0]){case 0:case 1:a=i;break;case 4:return o.label++,{value:i[1],done:!1};case 5:o.label++,r=i[1],i=[0];continue;case 7:i=o.ops.pop(),o.trys.pop();continue;default:if(!(a=o.trys,(a=a.length>0&&a[a.length-1])||6!==i[0]&&2!==i[0])){o=0;continue}if(3===i[0]&&(!a||i[1]>a[0]&&i[1]<a[3])){o.label=i[1];break}if(6===i[0]&&o.label<a[1]){o.label=a[1],a=i;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(i);break}a[2]&&o.ops.pop(),o.trys.pop();continue}i=t.call(e,o)}catch(e){i=[6,e],r=0}finally{n=a=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}var m={graph_id:null,legend_toggle:!1,graphID:null,options:{colors:null},data:null,rows:null,columns:null,diffdata:null,chartEvents:null,legendToggle:!1,chartActions:null,getChartWrapper:function(e,t){},getChartEditor:null,className:"",style:{},formatters:null,spreadSheetUrl:null,spreadSheetQueryParameters:{headers:1,gid:1},rootProps:{},chartWrapperParams:{},controls:null,render:null,toolbarItems:null,toolbarID:null},p=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.handleGoogleChartsLoaderScriptLoaded=function(e){var n=t.props,r=n.chartVersion,a=n.chartPackages,i=n.chartLanguage,o=n.mapsApiKey,s=n.onLoad;e.charts.load(r||"current",{packages:a||["corechart","controls"],language:i||"en",mapsApiKey:o}),e.charts.setOnLoadCallback((function(){s(e)}))},t}return l(t,e),t.prototype.shouldComponentUpdate=function(e){return e.chartPackages===this.props.chartPackages},t.prototype.render=function(){var e=this,t=this.props.onError;return Object(r.createElement)(o.a,{url:"https://www.gstatic.com/charts/loader.js",onError:t,onLoad:function(){var t=window;t.google&&e.handleGoogleChartsLoaderScriptLoaded(t.google)}})},t}(r.Component),h=0,f=function(){return"reactgooglegraph-"+(h+=1)},_=["#3366CC","#DC3912","#FF9900","#109618","#990099","#3B3EAC","#0099C6","#DD4477","#66AA00","#B82E2E","#316395","#994499","#22AA99","#AAAA11","#6633CC","#E67300","#8B0707","#329262","#5574A6","#3B3EAC"],y=function(e,t,n){return void 0===n&&(n={}),c(void 0,void 0,void 0,(function(){return d(this,(function(r){return[2,new Promise((function(r,a){var i=n.headers?"headers="+n.headers:"headers=0",o=n.query?"&tq="+encodeURIComponent(n.query):"",s=n.gid?"&gid="+n.gid:"",l=n.sheet?"&sheet="+n.sheet:"",u=n.access_token?"&access_token="+n.access_token:"",c=t+"/gviz/tq?"+(""+i+s+l+o+u);new e.visualization.Query(c).send((function(e){e.isError()?a("Error in query: "+e.getMessage()+" "+e.getDetailedMessage()):r(e.getDataTable())}))}))]}))}))},b=Object(r.createContext)(m),g=b.Provider,v=b.Consumer,w=function(e){var t=e.children,n=e.value;return Object(r.createElement)(g,{value:n},t)},M=function(e){var t=e.render;return Object(r.createElement)(v,null,(function(e){return t(e)}))},k=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={hiddenColumns:[]},t.listenToLegendToggle=function(){var e=t.props,n=e.google,r=e.googleChartWrapper;n.visualization.events.addListener(r,"select",(function(){var e=r.getChart().getSelection(),n=r.getDataTable();if(0!==e.length&&null===e[0].row&&null!==n){var a=e[0].column,i=t.getColumnID(n,a);t.state.hiddenColumns.includes(i)?t.setState((function(e){return u({},e,{hiddenColumns:e.hiddenColumns.filter((function(e){return e!==i})).slice()})})):t.setState((function(e){return u({},e,{hiddenColumns:e.hiddenColumns.concat([i])})}))}}))},t.applyFormatters=function(e,n){for(var r=t.props.google,a=0,i=n;a<i.length;a++){var o=i[a];switch(o.type){case"ArrowFormat":(s=new r.visualization.ArrowFormat(o.options)).format(e,o.column);break;case"BarFormat":(s=new r.visualization.BarFormat(o.options)).format(e,o.column);break;case"ColorFormat":for(var s=new r.visualization.ColorFormat(o.options),l=0,u=o.ranges;l<u.length;l++){var c=u[l];s.addRange.apply(s,c)}s.format(e,o.column);break;case"DateFormat":(s=new r.visualization.DateFormat(o.options)).format(e,o.column);break;case"NumberFormat":(s=new r.visualization.NumberFormat(o.options)).format(e,o.column);break;case"PatternFormat":(s=new r.visualization.PatternFormat(o.options)).format(e,o.column)}}},t.getColumnID=function(e,t){return e.getColumnId(t)||e.getColumnLabel(t)},t.draw=function(e){var n=e.data,r=e.diffdata,a=e.rows,i=e.columns,o=e.options,s=e.legend_toggle,l=e.legendToggle,u=e.chartType,m=e.formatters,p=e.spreadSheetUrl,h=e.spreadSheetQueryParameters;return c(t,void 0,void 0,(function(){var e,t,c,f,_,b,g,v,w,M,k,L,Y,D;return d(this,(function(d){switch(d.label){case 0:return e=this.props,t=e.google,c=e.googleChartWrapper,_=null,null!==r&&(b=t.visualization.arrayToDataTable(r.old),g=t.visualization.arrayToDataTable(r.new),_=t.visualization[u].prototype.computeDiff(b,g)),null===n?[3,1]:(f=Array.isArray(n)?t.visualization.arrayToDataTable(n):new t.visualization.DataTable(n),[3,5]);case 1:return null===a||null===i?[3,2]:(f=t.visualization.arrayToDataTable([i].concat(a)),[3,5]);case 2:return null===p?[3,4]:[4,y(t,p,h)];case 3:return f=d.sent(),[3,5];case 4:f=t.visualization.arrayToDataTable([]),d.label=5;case 5:for(v=f.getNumberOfColumns(),w=0;w<v;w+=1)M=this.getColumnID(f,w),this.state.hiddenColumns.includes(M)&&(k=f.getColumnLabel(w),L=f.getColumnId(w),Y=f.getColumnType(w),f.removeColumn(w),f.addColumn({label:k,id:L,type:Y}));return D=c.getChart(),"Timeline"===c.getChartType()&&D&&D.clearChart(),c.setChartType(u),c.setOptions(o),c.setDataTable(f),c.draw(),null!==this.props.googleChartDashboard&&this.props.googleChartDashboard.draw(f),null!==_&&(c.setDataTable(_),c.draw()),null!==m&&(this.applyFormatters(f,m),c.setDataTable(f),c.draw()),!0!==l&&!0!==s||this.grayOutHiddenColumns({options:o}),[2]}}))}))},t.grayOutHiddenColumns=function(e){var n=e.options,r=t.props.googleChartWrapper,a=r.getDataTable();if(null!==a){var i=a.getNumberOfColumns();if(!1!==t.state.hiddenColumns.length>0){var o=Array.from({length:i-1}).map((function(e,r){var i=t.getColumnID(a,r+1);return t.state.hiddenColumns.includes(i)?"#CCCCCC":void 0!==n.colors&&null!==n.colors?n.colors[r]:_[r]}));r.setOptions(u({},n,{colors:o})),r.draw()}}},t.onResize=function(){t.props.googleChartWrapper.draw()},t}return l(t,e),t.prototype.componentDidMount=function(){this.draw(this.props),window.addEventListener("resize",this.onResize),(this.props.legend_toggle||this.props.legendToggle)&&this.listenToLegendToggle()},t.prototype.componentWillUnmount=function(){var e=this.props,t=e.google,n=e.googleChartWrapper;window.removeEventListener("resize",this.onResize),t.visualization.events.removeAllListeners(n),"Timeline"===n.getChartType()&&n.getChart()&&n.getChart().clearChart()},t.prototype.componentDidUpdate=function(){this.draw(this.props)},t.prototype.render=function(){return null},t}(r.Component),L=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l(t,e),t.prototype.componentDidMount=function(){},t.prototype.componentWillUnmount=function(){},t.prototype.shouldComponentUpdate=function(){return!1},t.prototype.render=function(){var e=this.props,t=e.google,n=e.googleChartWrapper,a=e.googleChartDashboard;return Object(r.createElement)(M,{render:function(e){return Object(r.createElement)(k,u({},e,{google:t,googleChartWrapper:n,googleChartDashboard:a}))}})},t}(r.Component),Y=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l(t,e),t.prototype.shouldComponentUpdate=function(){return!1},t.prototype.listenToEvents=function(e){var t=this,n=e.chartEvents,r=e.google,a=e.googleChartWrapper;if(null!==n){r.visualization.events.removeAllListeners(a);for(var i=function(e){var n=e.eventName,i=e.callback;r.visualization.events.addListener(a,n,(function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];i({chartWrapper:a,props:t.props,google:r,eventArgs:e})}))},o=0,s=n;o<s.length;o++){i(s[o])}}},t.prototype.render=function(){var e=this,t=this.props,n=t.google,a=t.googleChartWrapper;return Object(r.createElement)(M,{render:function(t){return e.listenToEvents({chartEvents:t.chartEvents||null,google:n,googleChartWrapper:a}),null}})},t}(r.Component),D=0,T=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={googleChartWrapper:null,googleChartDashboard:null,googleChartControls:null,googleChartEditor:null,isReady:!1},t.graphID=null,t.dashboard_ref=Object(r.createRef)(),t.toolbar_ref=Object(r.createRef)(),t.getGraphID=function(){var e,n=t.props,r=n.graphID,a=n.graph_id;return e=null===r&&null===a?null===t.graphID?f():t.graphID:null!==r&&null===a?r:null!==a&&null===r?a:r,t.graphID=e,t.graphID},t.getControlID=function(e,t){return D+=1,void 0===e?"googlechart-control-"+t+"-"+D:e},t.addControls=function(e,n){var r=t.props,a=r.google,i=r.controls,o=null===i?null:i.map((function(e,n){var r=e.controlID,i=e.controlType,o=e.options,s=e.controlWrapperParams,l=t.getControlID(r,n);return{controlProp:e,control:new a.visualization.ControlWrapper(u({containerId:l,controlType:i,options:o},s))}}));if(null===o)return null;n.bind(o.map((function(e){return e.control})),e);for(var s=function(n){for(var r=n.control,i=n.controlProp.controlEvents,o=function(n){var i=n.callback,o=n.eventName;a.visualization.events.removeListener(r,o,i),a.visualization.events.addListener(r,o,(function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];i({chartWrapper:e,controlWrapper:r,props:t.props,google:a,eventArgs:n})}))},s=0,l=void 0===i?[]:i;s<l.length;s++){o(l[s])}},l=0,c=o;l<c.length;l++){s(c[l])}return o},t.renderChart=function(){var e=t.props,n=e.width,a=e.height,i=e.options,o=e.style,s=e.className,l=e.rootProps,c=e.google,d=u({height:a||i&&i.height,width:n||i&&i.width},o);return Object(r.createElement)("div",u({id:t.getGraphID(),style:d,className:s},l),t.state.isReady&&null!==t.state.googleChartWrapper?Object(r.createElement)(r.Fragment,null,Object(r.createElement)(L,{googleChartWrapper:t.state.googleChartWrapper,google:c,googleChartDashboard:t.state.googleChartDashboard}),Object(r.createElement)(Y,{googleChartWrapper:t.state.googleChartWrapper,google:c})):null)},t.renderControl=function(e){return void 0===e&&(e=function(e){e.control,e.controlProp;return!0}),t.state.isReady&&null!==t.state.googleChartControls?Object(r.createElement)(r.Fragment,null,t.state.googleChartControls.filter((function(t){var n=t.controlProp,r=t.control;return e({control:r,controlProp:n})})).map((function(e){var t=e.control;e.controlProp;return Object(r.createElement)("div",{key:t.getContainerId(),id:t.getContainerId()})}))):null},t.renderToolBar=function(){return null===t.props.toolbarItems?null:Object(r.createElement)("div",{ref:t.toolbar_ref})},t}return l(t,e),t.prototype.componentDidMount=function(){var e=this.props,t=e.options,n=e.google,r=e.chartType,a=e.chartWrapperParams,i=e.toolbarItems,o=e.getChartEditor,s=e.getChartWrapper,l=u({chartType:r,options:t,containerId:this.getGraphID()},a),c=new n.visualization.ChartWrapper(l);c.setOptions(t),s(c,n);var d=new n.visualization.Dashboard(this.dashboard_ref),m=this.addControls(c,d);null!==i&&n.visualization.drawToolbar(this.toolbar_ref.current,i);var p=null;null!==o&&o({chartEditor:p=new n.visualization.ChartEditor,chartWrapper:c,google:n}),this.setState({googleChartEditor:p,googleChartControls:m,googleChartDashboard:d,googleChartWrapper:c,isReady:!0})},t.prototype.componentDidUpdate=function(){if(null!==this.state.googleChartWrapper&&null!==this.state.googleChartDashboard&&null!==this.state.googleChartControls)for(var e=this.props.controls,t=0;t<e.length;t+=1){var n=e[t],r=n.controlType,a=n.options,i=n.controlWrapperParams;i&&"state"in i&&this.state.googleChartControls[t].control.setState(i.state),this.state.googleChartControls[t].control.setOptions(a),this.state.googleChartControls[t].control.setControlType(r)}},t.prototype.shouldComponentUpdate=function(e,t){return this.state.isReady!==t.isReady||e.controls!==this.props.controls},t.prototype.render=function(){var e=this.props,t=e.width,n=e.height,a=e.options,i=e.style,o=u({height:n||a&&a.height,width:t||a&&a.width},i);return null!==this.props.render?Object(r.createElement)("div",{ref:this.dashboard_ref,style:o},Object(r.createElement)("div",{ref:this.toolbar_ref,id:"toolbar"}),this.props.render({renderChart:this.renderChart,renderControl:this.renderControl,renderToolbar:this.renderToolBar})):Object(r.createElement)("div",{ref:this.dashboard_ref,style:o},this.renderControl((function(e){return"bottom"!==e.controlProp.controlPosition})),this.renderChart(),this.renderControl((function(e){return"bottom"===e.controlProp.controlPosition})),this.renderToolBar())},t}(r.Component),S=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._isMounted=!1,t.state={loadingStatus:"loading",google:null},t.onLoad=function(e){if(t.isFullyLoaded(e))t.onSuccess(e);else var n=setInterval((function(){var e=window.google;t._isMounted?e&&t.isFullyLoaded(e)&&(clearInterval(n),t.onSuccess(e)):clearInterval(n)}),1e3)},t.onSuccess=function(e){t.setState({loadingStatus:"ready",google:e})},t.onError=function(){t.setState({loadingStatus:"errored"})},t}return l(t,e),t.prototype.render=function(){var e=this.props,t=e.chartLanguage,n=e.chartPackages,a=e.chartVersion,i=e.mapsApiKey,o=e.loader,s=e.errorElement;return Object(r.createElement)(w,{value:this.props},"ready"===this.state.loadingStatus&&null!==this.state.google?Object(r.createElement)(T,u({},this.props,{google:this.state.google})):"errored"===this.state.loadingStatus&&s?s:o,Object(r.createElement)(p,u({},{chartLanguage:t,chartPackages:n,chartVersion:a,mapsApiKey:i},{onLoad:this.onLoad,onError:this.onError})))},t.prototype.componentDidMount=function(){this._isMounted=!0},t.prototype.componentWillUnmount=function(){this._isMounted=!1},t.prototype.isFullyLoaded=function(e){var t=this.props,n=t.controls,r=t.toolbarItems,a=t.getChartEditor;return e&&e.visualization&&e.visualization.ChartWrapper&&e.visualization.Dashboard&&(!n||e.visualization.ChartWrapper)&&(!a||e.visualization.ChartEditor)&&(!r||e.visualization.drawToolbar)},t.defaultProps=m,t}(r.Component),O=n(130),x=n.n(O);function j(e){return(j="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function E(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function C(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function P(e,t){return(P=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function H(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=R(e);if(t){var a=R(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return z(this,n)}}function z(e,t){return!t||"object"!==j(t)&&"function"!=typeof t?A(e):t}function A(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function R(e){return(R=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var N=wp.element,F=N.Component,W=N.Fragment,I=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&P(e,t)}(i,e);var t,n,r,a=H(i);function i(){var e;return E(this,i),(e=a.apply(this,arguments)).initDataTable=e.initDataTable.bind(A(e)),e.dataRenderer=e.dataRenderer.bind(A(e)),e.table,e.uniqueId=x()(),e}return t=i,(n=[{key:"componentDidMount",value:function(){this.initDataTable(this.props.columns,this.props.rows)}},{key:"componentWillUnmount",value:function(){this.table.destroy()}},{key:"componentDidUpdate",value:function(e){this.props!==e&&(this.props.options.responsive_bool!==e.options.responsive_bool&&"true"===e.options.responsive_bool&&document.getElementById("dataTable-instances-".concat(this.props.id,"-").concat(this.uniqueId)).classList.remove("collapsed"),this.table.destroy(),document.getElementById("dataTable-instances-".concat(this.props.id,"-").concat(this.uniqueId)).innerHTML="",this.initDataTable(this.props.columns,this.props.rows))}},{key:"initDataTable",value:function(e,t){var n=this,r=this.props.options,a=e.map((function(e,t){var r=e.type;switch(e.type){case"number":r="num";break;case"date":case"datetime":case"timeofday":r="date"}return{title:e.label,data:e.label,type:r,render:n.dataRenderer(r,t)}})),i=t.map((function(e){var t={};return a.forEach((function(n,r){var a=e[r];void 0===a&&(a=e[n.data]),t[n.data]=a})),t}));this.table=jQuery("#dataTable-instances-".concat(this.props.id,"-").concat(this.uniqueId)).DataTable({destroy:!0,data:i,columns:a,paging:"true"===r.paging_bool,pageLength:r.pageLength_int||10,pagingType:r.pagingType,ordering:"false"!==r.ordering_bool,fixedHeader:"true"===r.fixedHeader_bool,scrollCollapse:!(!this.props.chartsScreen&&"true"!==r.scrollCollapse_bool),scrollY:(this.props.chartsScreen?180:"true"===r.scrollCollapse_bool&&Number(r.scrollY_int))||!1,responsive:!(!this.props.chartsScreen&&"true"!==r.responsive_bool),searching:!1,select:!1,lengthChange:!1,bFilter:!1,bInfo:!1})}},{key:"dataRenderer",value:function(e,t){var n,r=this.props.options,a=null;if(void 0===r.series||void 0===r.series[t]||void 0===r.series[t].format)return a;switch(e){case"date":case"datetime":case"timeofday":a=r.series[t].format&&r.series[t].format.from&&r.series[t].format.to?jQuery.fn.dataTable.render.moment(r.series[t].format.from,r.series[t].format.to):jQuery.fn.dataTable.render.moment("MM-DD-YYYY");break;case"num":var i=["","","","",""];r.series[t].format.thousands&&(i[0]=r.series[t].format.thousands),r.series[t].format.decimal&&(i[1]=r.series[t].format.decimal),r.series[t].format.precision&&0<parseInt(r.series[t].format.precision)&&(i[2]=r.series[t].format.precision),r.series[t].format.prefix&&(i[3]=r.series[t].format.prefix),r.series[t].format.suffix&&(i[4]=r.series[t].format.suffix),a=(n=jQuery.fn.dataTable.render).number.apply(n,i);break;case"boolean":jQuery.fn.dataTable.render.extra=function(e,n,a){return!0!==e&&"true"!==e||""===r.series[t].format.truthy?!1!==e&&"false"!==e||""===r.series[t].format.falsy?e:r.series[t].format.falsy.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,""):r.series[t].format.truthy.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,"")},a=jQuery.fn.dataTable.render.extra}return a}},{key:"render",value:function(){var e=this.props.options;return wp.element.createElement(W,null,e.customcss&&wp.element.createElement("style",null,e.customcss.oddTableRow&&"#dataTable-instances-".concat(this.props.id,"-").concat(this.uniqueId," tr.odd {\n\t\t\t\t\t\t\t\t").concat(e.customcss.oddTableRow.color?"color: ".concat(e.customcss.oddTableRow.color," !important;"):"","\n\t\t\t\t\t\t\t\t").concat(e.customcss.oddTableRow["background-color"]?"background-color: ".concat(e.customcss.oddTableRow["background-color"]," !important;"):"","\n\t\t\t\t\t\t\t\t").concat(e.customcss.oddTableRow.transform?"transform: rotate( ".concat(e.customcss.oddTableRow.transform,"deg ) !important;"):"","\n\t\t\t\t\t\t\t}"),e.customcss.evenTableRow&&"#dataTable-instances-".concat(this.props.id,"-").concat(this.uniqueId," tr.even {\n\t\t\t\t\t\t\t\t").concat(e.customcss.evenTableRow.color?"color: ".concat(e.customcss.evenTableRow.color," !important;"):"","\n\t\t\t\t\t\t\t\t").concat(e.customcss.evenTableRow["background-color"]?"background-color: ".concat(e.customcss.evenTableRow["background-color"]," !important;"):"","\n\t\t\t\t\t\t\t\t").concat(e.customcss.evenTableRow.transform?"transform: rotate( ".concat(e.customcss.evenTableRow.transform,"deg ) !important;"):"","\n\t\t\t\t\t\t\t}"),e.customcss.tableCell&&"#dataTable-instances-".concat(this.props.id,"-").concat(this.uniqueId," tr td,\n\t\t\t\t\t\t\t#dataTable-instances-").concat(this.props.id,"-").concat(this.uniqueId,"_wrapper tr th {\n\t\t\t\t\t\t\t\t").concat(e.customcss.tableCell.color?"color: ".concat(e.customcss.tableCell.color," !important;"):"","\n\t\t\t\t\t\t\t\t").concat(e.customcss.tableCell["background-color"]?"background-color: ".concat(e.customcss.tableCell["background-color"]," !important;"):"","\n\t\t\t\t\t\t\t\t").concat(e.customcss.tableCell.transform?"transform: rotate( ".concat(e.customcss.tableCell.transform,"deg ) !important;"):"","\n\t\t\t\t\t\t\t}")),wp.element.createElement("table",{id:"dataTable-instances-".concat(this.props.id,"-").concat(this.uniqueId)}))}}])&&C(t.prototype,n),r&&C(t,r),i}(F),B=n(4),J=n.n(B),U=n(131),V=n.n(U),q=function(e){return Object.keys(e["visualizer-series"]).map((function(t){void 0!==e["visualizer-series"][t].type&&"date"===e["visualizer-series"][t].type&&Object.keys(e["visualizer-data"]).map((function(n){return e["visualizer-data"][n][t]=new Date(e["visualizer-data"][n][t])}))})),e},G=function(e){var t;if(Array.isArray(e))return 0<e.length;if(J()(e)){for(t in e)return!0;return!1}return"string"==typeof e?0<e.length:null!=e},$=function(e){return V()(e,G)},K=function(e){return e.width="",e.height="",e.backgroundColor={},e.chartArea={},$(e)},Z=function(e){try{JSON.parse(e)}catch(e){return!1}return!0},Q=function(e,t){return!0===e[t]||"true"===e[t]||"1"===e[t]||1===e[t]},X=function(e){switch(e["visualizer-chart-library"]){case"GoogleCharts":return ee(e)}},ee=function(e){var t=e["visualizer-settings"],n=e["visualizer-chart-type"],r=e["visualizer-series"],a=[];if(t.series)switch(n){case"tabular":for(var i in t.series)if(r[(i=parseInt(i))+1]&&t.series[i].format&&""!==t.series[i].format){var o=i+1,s=te(r[i+1].type);s&&a.push({type:s,options:{pattern:t.series[i].format},column:o})}break;default:for(var l=0;l<t.series.length;l++)if(r[l+1]&&void 0!==t.series[l]&&t.series[l].format&&""!==t.series[l].format){var u=l+1,c=te(r[l+1].type);c&&a.push({type:c,options:{pattern:t.series[l].format},column:u})}}else"pie"===n&&t.format&&""!==t.format&&a.push({type:te("number"),options:{pattern:t.format},column:1});if(t.hAxis&&r[0]){var d=te(r[0].type);d&&a.push({type:d,options:{pattern:t.hAxis.format},column:0})}return a},te=function(e){switch(e){case"number":return"NumberFormat";case"date":case"datetime":case"timeofday":return"DateFormat"}return null};function ne(e){return(ne="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function re(e,t,n,r,a,i,o){try{var s=e[i](o),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,a)}function ae(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var i=e.apply(t,n);function o(e){re(i,r,a,o,s,"next",e)}function s(e){re(i,r,a,o,s,"throw",e)}o(void 0)}))}}function ie(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function oe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function se(e,t){return(se=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function le(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=de(e);if(t){var a=de(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return ue(this,n)}}function ue(e,t){return!t||"object"!==ne(t)&&"function"!=typeof t?ce(e):t}function ce(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function de(e){return(de=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var me=lodash.startCase,pe=wp.i18n.__,he=wp.apiFetch,fe=wp.element,_e=fe.Component,ye=fe.Fragment,be=wp.components,ge=be.Button,ve=be.Dashicon,we=be.ExternalLink,Me=be.Notice,ke=be.Placeholder,Le=be.Spinner,Ye=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&se(e,t)}(s,e);var t,n,r,a,i,o=le(s);function s(){var e;return ie(this,s),(e=o.apply(this,arguments)).loadMoreCharts=e.loadMoreCharts.bind(ce(e)),e.state={charts:null,isBusy:!1,chartsLoaded:!1,perPage:visualizerLocalize.chartsPerPage},e}return t=s,(n=[{key:"componentDidMount",value:(i=ae(regeneratorRuntime.mark((function e(){var t,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=visualizerLocalize.chartsPerPage,e.next=3,he({path:"wp/v2/visualizer/?per_page="+t+"&meta_key=visualizer-chart-library&meta_value=ChartJS"});case 3:n=e.sent,this.setState({charts:n});case 5:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"loadMoreCharts",value:(a=ae(regeneratorRuntime.mark((function e(){var t,n,r,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.state.charts.length,n=this.state.chartsLoaded,r=this.state.perPage,this.setState({isBusy:!0}),e.next=6,he({path:"wp/v2/visualizer/?per_page=".concat(r,"&meta_key=visualizer-chart-library&meta_value=ChartJS&offset=").concat(t)});case 6:a=e.sent,r>a.length&&(n=!0),this.setState({charts:this.state.charts.concat(a),isBusy:!1,chartsLoaded:n});case 9:case"end":return e.stop()}}),e,this)}))),function(){return a.apply(this,arguments)})},{key:"render",value:function(){var e=this,t="undefined"!=typeof google?google.visualization.Version:"current",n=this.state,r=n.charts,a=n.isBusy,i=n.chartsLoaded,o=n.perPage;return wp.element.createElement("div",{className:"visualizer-settings__charts"},wp.element.createElement(Me,{status:"warning",isDismissible:!1},pe("ChartJS charts are currently not available for selection here, you must visit the library, get the shortcode, and add the chart here in a shortcode tag."),wp.element.createElement(we,{href:visualizerLocalize.adminPage},pe("Click here to visit Visualizer Charts Library."))),null!==r?1<=r.length?wp.element.createElement(ye,null,wp.element.createElement("div",{className:"visualizer-settings__charts-grid"},Object.keys(r).map((function(n){var a,i,o,s=q(r[n].chart_data);if(a=s["visualizer-settings"].title?s["visualizer-settings"].title:"#".concat(r[n].id),0<=["gauge","tabular","timeline"].indexOf(s["visualizer-chart-type"])?"DataTable"===s["visualizer-chart-library"]?i=s["visualizer-chart-type"]:("tabular"===(i=s["visualizer-chart-type"])&&(i="table"),i=me(i)):i="".concat(me(s["visualizer-chart-type"]),"Chart"),!s["visualizer-chart-library"]||"ChartJS"!==s["visualizer-chart-library"])return s["visualizer-data-exploded"]&&(o=pe("Annotations in this chart may not display here but they will display in the front end.")),wp.element.createElement("div",{className:"visualizer-settings__charts-single","data-chart-type":i,key:"chart-".concat(r[n].id)},wp.element.createElement("div",{className:"visualizer-settings__charts-title"},a),"DataTable"===s["visualizer-chart-library"]?wp.element.createElement(I,{id:r[n].id,rows:s["visualizer-data"],columns:s["visualizer-series"],chartsScreen:!0,options:s["visualizer-settings"]}):(s["visualizer-data-exploded"],wp.element.createElement(S,{chartVersion:t,chartType:i,rows:s["visualizer-data"],columns:s["visualizer-series"],options:K(s["visualizer-settings"]),formatters:X(s)})),wp.element.createElement("div",{className:"visualizer-settings__charts-footer"},wp.element.createElement("sub",null,o)),wp.element.createElement("div",{className:"visualizer-settings__charts-controls",title:pe("Insert Chart"),onClick:function(){return e.props.getChart(r[n].id)}},wp.element.createElement(ve,{icon:"upload"})))}))),!i&&o-1<r.length&&wp.element.createElement(ge,{isPrimary:!0,isLarge:!0,onClick:this.loadMoreCharts,isBusy:a},pe("Load More"))):wp.element.createElement("p",{className:"visualizer-no-charts"},pe("No charts found.")):wp.element.createElement(ke,null,wp.element.createElement(Le,null)))}}])&&oe(t.prototype,n),r&&oe(t,r),s}(_e);function De(e){return(De="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Te(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Se(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Oe(e,t){return(Oe=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function xe(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Ce(e);if(t){var a=Ce(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return je(this,n)}}function je(e,t){return!t||"object"!==De(t)&&"function"!=typeof t?Ee(e):t}function Ee(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ce(e){return(Ce=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Pe=wp.i18n.__,He=wp.element.Component,ze=wp.components,Ae=ze.Button,Re=ze.ExternalLink,Ne=ze.PanelBody,Fe=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Oe(e,t)}(i,e);var t,n,r,a=xe(i);function i(){var e;return Te(this,i),(e=a.apply(this,arguments)).uploadInput=React.createRef(),e.fileUploaded=e.fileUploaded.bind(Ee(e)),e.uploadImport=e.uploadImport.bind(Ee(e)),e.state={uploadLabel:Pe("Upload")},e}return t=i,(n=[{key:"fileUploaded",value:function(e){"text/csv"===e.target.files[0].type&&this.setState({uploadLabel:Pe("Upload")})}},{key:"uploadImport",value:function(){this.props.readUploadedFile(this.uploadInput),this.setState({uploadLabel:Pe("Uploaded")})}},{key:"render",value:function(){return wp.element.createElement(Ne,{title:Pe("Import data from file"),initialOpen:!1},wp.element.createElement("p",null,Pe("Select and upload your data CSV file here. The first row of the CSV file should contain the column headings. The second one should contain series type (string, number, boolean, date, datetime, timeofday).")),wp.element.createElement("p",null,Pe("If you are unsure about how to format your data CSV then please take a look at this sample: "),wp.element.createElement(Re,{href:"".concat(visualizerLocalize.absurl,"samples/").concat(this.props.chart["visualizer-chart-type"],".csv")},"".concat(this.props.chart["visualizer-chart-type"],".csv"))),wp.element.createElement("input",{type:"file",accept:"text/csv",ref:this.uploadInput,onChange:this.fileUploaded}),wp.element.createElement(Ae,{isPrimary:!0,onClick:this.uploadImport},this.state.uploadLabel))}}])&&Se(t.prototype,n),r&&Se(t,r),i}(He);function We(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ie(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?We(Object(n),!0).forEach((function(t){Be(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):We(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Be(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Je(e){return(Je="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ue(e,t,n,r,a,i,o){try{var s=e[i](o),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,a)}function Ve(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var i=e.apply(t,n);function o(e){Ue(i,r,a,o,s,"next",e)}function s(e){Ue(i,r,a,o,s,"throw",e)}o(void 0)}))}}function qe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ge(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function $e(e,t){return($e=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Ke(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Xe(e);if(t){var a=Xe(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Ze(this,n)}}function Ze(e,t){return!t||"object"!==Je(t)&&"function"!=typeof t?Qe(e):t}function Qe(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Xe(e){return(Xe=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var et=wp.i18n.__,tt=wp,nt=(tt.apiFetch,tt.apiRequest),rt=wp.element.Component,at=wp.components,it=at.Button,ot=at.ExternalLink,st=at.IconButton,lt=at.Modal,ut=at.PanelBody,ct=at.SelectControl,dt=at.TextControl,mt=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&$e(e,t)}(c,e);var t,n,r,a,i,o,s,l,u=Ke(c);function c(){var e;return qe(this,c),(e=u.apply(this,arguments)).openModal=e.openModal.bind(Qe(e)),e.initTable=e.initTable.bind(Qe(e)),e.onToggle=e.onToggle.bind(Qe(e)),e.toggleHeaders=e.toggleHeaders.bind(Qe(e)),e.getJSONRoot=e.getJSONRoot.bind(Qe(e)),e.getJSONData=e.getJSONData.bind(Qe(e)),e.getTableData=e.getTableData.bind(Qe(e)),e.state={isOpen:!1,isLoading:!1,isFirstStepOpen:!0,isSecondStepOpen:!1,isThirdStepOpen:!1,isFourthStepOpen:!1,isHeaderPanelOpen:!1,endpointRoots:[],endpointPaging:[],table:null,requestHeaders:{method:"GET",username:"",password:"",auth:""}},e}return t=c,(n=[{key:"openModal",value:(l=Ve(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.setState({isOpen:!0});case 2:t=document.querySelector("#visualizer-json-query-table"),this.state.isFourthStepOpen&&null!==this.state.table&&(t.innerHTML=this.state.table,this.initTable());case 4:case"end":return e.stop()}}),e,this)}))),function(){return l.apply(this,arguments)})},{key:"initTable",value:function(){jQuery("#visualizer-json-query-table table").DataTable({paging:!1,searching:!1,ordering:!1,select:!1,scrollX:"600px",scrollY:"400px",info:!1,colReorder:{fixedColumnsLeft:1},dom:"Bt",buttons:[{extend:"colvis",columns:":gt(0)",collectionLayout:"four-column"}]})}},{key:"onToggle",value:(s=Ve(regeneratorRuntime.mark((function e(t){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null===this.state.table&&this.state.endpointRoots&&0<this.state.endpointRoots.length&&("isFirstStepOpen"===t||"isSecondStepOpen"===t)&&this.setState({isFirstStepOpen:"isFirstStepOpen"===t,isSecondStepOpen:"isSecondStepOpen"===t,isThirdStepOpen:!1,isFourthStepOpen:!1}),null===this.state.table){e.next=5;break}return e.next=4,this.setState({isFirstStepOpen:"isFirstStepOpen"===t,isSecondStepOpen:"isSecondStepOpen"===t,isThirdStepOpen:"isThirdStepOpen"===t,isFourthStepOpen:"isFourthStepOpen"===t});case 4:"isFourthStepOpen"===t&&(n=document.querySelector("#visualizer-json-query-table"),this.state.isFourthStepOpen&&(n.innerHTML=this.state.table,this.initTable()));case 5:case"end":return e.stop()}}),e,this)}))),function(e){return s.apply(this,arguments)})},{key:"toggleHeaders",value:function(){this.setState({isHeaderPanelOpen:!this.state.isHeaderPanelOpen})}},{key:"getJSONRoot",value:(o=Ve(regeneratorRuntime.mark((function e(){var t,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.setState({isLoading:!0,endpointRoots:[],endpointPaging:[],table:null}),e.next=3,nt({path:"/visualizer/v1/get-json-root?url=".concat(this.props.chart["visualizer-json-url"]),data:{method:this.props.chart["visualizer-json-headers"]?this.props.chart["visualizer-json-headers"].method:this.state.requestHeaders.method,username:this.props.chart["visualizer-json-headers"]&&"object"===Je(this.props.chart["visualizer-json-headers"].auth)?this.props.chart["visualizer-json-headers"].auth.username:this.state.requestHeaders.username,password:this.props.chart["visualizer-json-headers"]&&"object"===Je(this.props.chart["visualizer-json-headers"].auth)?this.props.chart["visualizer-json-headers"].auth.password:this.state.requestHeaders.password,auth:this.props.chart["visualizer-json-headers"]&&"object"!==Je(this.props.chart["visualizer-json-headers"].auth)?this.props.chart["visualizer-json-headers"].auth:this.state.requestHeaders.auth},method:"GET"});case 3:(t=e.sent).success?(n=Object.keys(t.data.roots).map((function(e){return{label:t.data.roots[e].replace(/>/g," ➤ "),value:t.data.roots[e]}})),this.setState({isLoading:!1,isFirstStepOpen:!1,isSecondStepOpen:!0,endpointRoots:n})):(this.setState({isLoading:!1}),alert(t.data.msg));case 5:case"end":return e.stop()}}),e,this)}))),function(){return o.apply(this,arguments)})},{key:"getJSONData",value:(i=Ve(regeneratorRuntime.mark((function e(){var t,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.setState({isLoading:!0}),e.next=3,nt({path:"/visualizer/v1/get-json-data?url=".concat(this.props.chart["visualizer-json-url"],"&chart=").concat(this.props.id),data:{root:this.props.chart["visualizer-json-root"]||this.state.endpointRoots[0].value,method:this.props.chart["visualizer-json-headers"]?this.props.chart["visualizer-json-headers"].method:this.state.requestHeaders.method,username:this.props.chart["visualizer-json-headers"]&&"object"===Je(this.props.chart["visualizer-json-headers"].auth)?this.props.chart["visualizer-json-headers"].auth.username:this.state.requestHeaders.username,password:this.props.chart["visualizer-json-headers"]&&"object"===Je(this.props.chart["visualizer-json-headers"].auth)?this.props.chart["visualizer-json-headers"].auth.password:this.state.requestHeaders.password,auth:this.props.chart["visualizer-json-headers"]&&"object"!==Je(this.props.chart["visualizer-json-headers"].auth)?this.props.chart["visualizer-json-headers"].auth:this.state.requestHeaders.auth},method:"GET"});case 3:(t=e.sent).success?(n=[{label:et("Don't use pagination"),value:0}],t.data.paging&&"root>next"===t.data.paging[0]&&n.push({label:et("Get first 5 pages using root ➤ next"),value:"root>next"}),this.setState({isLoading:!1,isSecondStepOpen:!1,isFourthStepOpen:!0,endpointPaging:n,table:t.data.table}),document.querySelector("#visualizer-json-query-table").innerHTML=t.data.table,this.initTable()):(this.setState({isLoading:!1}),alert(t.data.msg));case 5:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"getTableData",value:(a=Ve(regeneratorRuntime.mark((function e(){var t,n,r,a,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.setState({isLoading:!0}),t=document.querySelectorAll("#visualizer-json-query-table input"),n=document.querySelectorAll("#visualizer-json-query-table select"),r=[],a={},t.forEach((function(e){return r.push(e.value)})),n.forEach((function(e){return a[e.name]=e.value})),e.next=9,nt({path:"/visualizer/v1/set-json-data",data:Ie({url:this.props.chart["visualizer-json-url"],method:this.props.chart["visualizer-json-headers"]?this.props.chart["visualizer-json-headers"].method:this.state.requestHeaders.method,username:this.props.chart["visualizer-json-headers"]&&"object"===Je(this.props.chart["visualizer-json-headers"].auth)?this.props.chart["visualizer-json-headers"].auth.username:this.state.requestHeaders.username,password:this.props.chart["visualizer-json-headers"]&&"object"===Je(this.props.chart["visualizer-json-headers"].auth)?this.props.chart["visualizer-json-headers"].auth.password:this.state.requestHeaders.password,auth:this.props.chart["visualizer-json-headers"]&&"object"!==Je(this.props.chart["visualizer-json-headers"].auth)?this.props.chart["visualizer-json-headers"].auth:this.state.requestHeaders.auth,root:this.props.chart["visualizer-json-root"]||this.state.endpointRoots[0].value,paging:this.props.chart["visualizer-json-paging"]||0,header:r},a),method:"GET"});case 9:(i=e.sent).success?(this.props.JSONImportData(i.data.name,JSON.parse(i.data.series),JSON.parse(i.data.data)),this.setState({isOpen:!1,isLoading:!1})):(alert(i.data.msg),this.setState({isLoading:!1}));case 11:case"end":return e.stop()}}),e,this)}))),function(){return a.apply(this,arguments)})},{key:"render",value:function(){var e=this;return wp.element.createElement(ut,{title:et("Import from JSON"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement("p",null,et("You can choose here to import or synchronize your chart data with a remote JSON source.")),wp.element.createElement("p",null,wp.element.createElement(ot,{href:"https://docs.themeisle.com/article/1052-how-to-generate-charts-from-json-data-rest-endpoints"},et("For more info check this tutorial."))),wp.element.createElement(ct,{label:et("How often do you want to check the url?"),value:this.props.chart["visualizer-json-schedule"]?this.props.chart["visualizer-json-schedule"]:1,options:[{label:et("One-time"),value:"-1"},{label:et("Live"),value:"0"},{label:et("Each hour"),value:"1"},{label:et("Each 12 hours"),value:"12"},{label:et("Each day"),value:"24"},{label:et("Each 3 days"),value:"72"}],onChange:this.props.editSchedule}),wp.element.createElement(it,{isPrimary:!0,isLarge:!0,onClick:this.openModal},et("Modify Parameters")),this.state.isOpen&&wp.element.createElement(lt,{title:et("Import from JSON"),className:"visualizer-json-query-modal",shouldCloseOnClickOutside:!1,onRequestClose:function(){e.setState({isOpen:!1,isTableRendered:!1})}},wp.element.createElement(ut,{title:et("Step 1: Specify the JSON endpoint/URL"),opened:this.state.isFirstStepOpen,onToggle:function(){return e.onToggle("isFirstStepOpen")}},wp.element.createElement("p",null,et("If you want to add authentication, add headers to the endpoint or change the request in any way, please refer to our document here:")),wp.element.createElement("p",null,wp.element.createElement(ot,{href:"https://docs.themeisle.com/article/1043-visualizer-how-to-extend-rest-endpoints-with-json-response"},et("How to extend REST endpoints with JSON response"))),wp.element.createElement(dt,{placeholder:et("Please enter the URL of your JSON file"),value:this.props.chart["visualizer-json-url"]?this.props.chart["visualizer-json-url"]:"",onChange:this.props.editJSONURL}),wp.element.createElement(st,{icon:"arrow-right-alt2",label:et("Add Headers"),onClick:this.toggleHeaders},et("Add Headers")),this.state.isHeaderPanelOpen&&wp.element.createElement("div",{className:"visualizer-json-query-modal-headers-panel"},wp.element.createElement(ct,{label:et("Request Type"),value:this.props.chart["visualizer-json-headers"]?this.props.chart["visualizer-json-headers"].method:this.state.requestHeaders.method,options:[{value:"GET",label:et("GET")},{value:"POST",label:et("POST")}],onChange:function(t){var n=Ie({},e.state.requestHeaders),r=e.state.requestHeaders;n.method=t,r=Ie(Ie({},r),{},{method:t}),e.setState({requestHeaders:r}),e.props.editJSONHeaders(n)}}),wp.element.createElement("p",null,et("Credentials")),wp.element.createElement(dt,{label:et("Username"),placeholder:et("Username/Access Key"),value:this.props.chart["visualizer-json-headers"]&&"object"===Je(this.props.chart["visualizer-json-headers"].auth)?this.props.chart["visualizer-json-headers"].auth.username:this.state.requestHeaders.username,onChange:function(t){var n=Ie({},e.state.requestHeaders),r=e.state.requestHeaders;n.auth={username:t,password:e.props.chart["visualizer-json-headers"]&&"object"===Je(e.props.chart["visualizer-json-headers"].auth)?e.props.chart["visualizer-json-headers"].auth.password:e.state.requestHeaders.password},r=Ie(Ie({},r),{},{username:t,password:n.password}),e.setState({requestHeaders:r}),e.props.editJSONHeaders(n)}}),wp.element.createElement("span",{className:"visualizer-json-query-modal-field-separator"},et("&")),wp.element.createElement(dt,{label:et("Password"),placeholder:et("Password/Secret Key"),type:"password",value:this.props.chart["visualizer-json-headers"]&&"object"===Je(this.props.chart["visualizer-json-headers"].auth)?this.props.chart["visualizer-json-headers"].auth.password:this.state.requestHeaders.password,onChange:function(t){var n=Ie({},e.state.requestHeaders),r=e.state.requestHeaders;n.auth={username:e.props.chart["visualizer-json-headers"]&&"object"===Je(e.props.chart["visualizer-json-headers"].auth)?e.props.chart["visualizer-json-headers"].auth.username:e.state.requestHeaders.username,password:t},r=Ie(Ie({},r),{},{username:n.username,password:t}),e.setState({requestHeaders:r}),e.props.editJSONHeaders(n)}}),wp.element.createElement("p",null,et("OR")),wp.element.createElement(dt,{label:et("Authorization"),placeholder:et("e.g. SharedKey <AccountName>:<Signature>"),value:this.props.chart["visualizer-json-headers"]&&"object"!==Je(this.props.chart["visualizer-json-headers"].auth)?this.props.chart["visualizer-json-headers"].auth:this.state.requestHeaders.auth,onChange:function(t){var n=Ie({},e.state.requestHeaders),r=e.state.requestHeaders;n.auth=t,r=Ie(Ie({},r),{},{auth:t}),e.setState({requestHeaders:r}),e.props.editJSONHeaders(n)}})),wp.element.createElement(it,{isPrimary:!0,isLarge:!0,isBusy:this.state.isLoading,disabled:this.state.isLoading,onClick:this.getJSONRoot},et("Fetch Endpoint"))),wp.element.createElement(ut,{title:et("Step 2: Choose the JSON root"),initialOpen:!1,opened:this.state.isSecondStepOpen,onToggle:function(){return e.onToggle("isSecondStepOpen")}},wp.element.createElement("p",null,et("If you see Invalid Data, you may have selected the wrong root to fetch data from. Please select an alternative.")),wp.element.createElement(ct,{value:this.props.chart["visualizer-json-root"],options:this.state.endpointRoots,onChange:this.props.editJSONRoot}),wp.element.createElement(it,{isPrimary:!0,isLarge:!0,isBusy:this.state.isLoading,disabled:this.state.isLoading,onClick:this.getJSONData},et("Parse Endpoint"))),wp.element.createElement(ut,{title:et("Step 3: Specify miscellaneous parameters"),initialOpen:!1,opened:this.state.isThirdStepOpen,onToggle:function(){return e.onToggle("isThirdStepOpen")}},"community"!==visualizerLocalize.isPro?wp.element.createElement(ct,{value:this.props.chart["visualizer-json-paging"]||0,options:this.state.endpointPaging,onChange:this.props.editJSONPaging}):wp.element.createElement("p",null,et("Enable this feature in PRO version!"))),wp.element.createElement(ut,{title:et("Step 4: Select the data to display in the chart"),initialOpen:!1,opened:this.state.isFourthStepOpen,onToggle:function(){return e.onToggle("isFourthStepOpen")}},wp.element.createElement("ul",null,wp.element.createElement("li",null,et("Select whether to include the data in the chart. Each column selected will form one series.")),wp.element.createElement("li",null,et("If a column is selected to be included, specify its data type.")),wp.element.createElement("li",null,et("You can use drag/drop to reorder the columns but this column position is not saved. So when you reload the table, you may have to reorder again.")),wp.element.createElement("li",null,et("You can select any number of columns but the chart type selected will determine how many will display in the chart."))),wp.element.createElement("div",{id:"visualizer-json-query-table"}),wp.element.createElement(it,{isPrimary:!0,isLarge:!0,isBusy:this.state.isLoading,disabled:this.state.isLoading,onClick:this.getTableData},et("Save & Show Chart")))))}}])&&Ge(t.prototype,n),r&&Ge(t,r),c}(rt);function pt(e){return(pt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ht(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ft(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function _t(e,t){return(_t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function yt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=gt(e);if(t){var a=gt(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return bt(this,n)}}function bt(e,t){return!t||"object"!==pt(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function gt(e){return(gt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var vt=wp.i18n.__,wt=wp.element.Component,Mt=wp.components,kt=Mt.Button,Lt=Mt.ExternalLink,Yt=Mt.PanelBody,Dt=Mt.SelectControl,Tt=Mt.TextControl,St=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&_t(e,t)}(i,e);var t,n,r,a=yt(i);function i(){return ht(this,i),a.apply(this,arguments)}return t=i,(n=[{key:"render",value:function(){var e=this;return wp.element.createElement(Yt,{title:vt("Import data from URL"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(Yt,{title:vt("One Time Import"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement("p",null,vt("You can use this to import data from a remote CSV file. The first row of the CSV file should contain the column headings. The second one should contain series type (string, number, boolean, date, datetime, timeofday).")),wp.element.createElement("p",null,vt("If you are unsure about how to format your data CSV then please take a look at this sample: "),wp.element.createElement(Lt,{href:"".concat(visualizerLocalize.absurl,"samples/").concat(this.props.chart["visualizer-chart-type"],".csv")},"".concat(this.props.chart["visualizer-chart-type"],".csv"))),wp.element.createElement("p",null,vt("You can also import data from Google Spreadsheet.")),wp.element.createElement(Tt,{placeholder:vt("Please enter the URL of your CSV file"),value:this.props.chart["visualizer-chart-url"]?this.props.chart["visualizer-chart-url"]:"",onChange:this.props.editURL}),wp.element.createElement(kt,{isPrimary:!0,isLarge:!0,isBusy:"uploadData"===this.props.isLoading,disabled:"uploadData"===this.props.isLoading,onClick:function(){return e.props.uploadData(!1)}},vt("Import Data"))),"business"===visualizerLocalize.isPro?wp.element.createElement(Yt,{title:vt("Schedule Import"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement("p",null,vt("You can choose here to synchronize your chart data with a remote CSV file. ")),wp.element.createElement("p",null,vt("You can also synchronize with your Google Spreadsheet file.")),wp.element.createElement("p",null,vt("We will update the chart data based on your time interval preference by overwritting the current data with the one from the URL.")),wp.element.createElement(Tt,{placeholder:vt("Please enter the URL of your CSV file"),value:this.props.chart["visualizer-chart-url"]?this.props.chart["visualizer-chart-url"]:"",onChange:this.props.editURL}),wp.element.createElement(Dt,{label:vt("How often do you want to check the url?"),value:this.props.chart["visualizer-chart-schedule"]?this.props.chart["visualizer-chart-schedule"]:1,options:[{label:vt("Each hour"),value:"1"},{label:vt("Each 12 hours"),value:"12"},{label:vt("Each day"),value:"24"},{label:vt("Each 3 days"),value:"72"}],onChange:this.props.editSchedule}),wp.element.createElement(kt,{isPrimary:!0,isLarge:!0,isBusy:"uploadData"===this.props.isLoading,disabled:"uploadData"===this.props.isLoading,onClick:function(){return e.props.uploadData(!0)}},vt("Save Schedule"))):wp.element.createElement(Yt,{title:vt("Schedule Import"),icon:"lock",className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement("p",null,vt("Upgrade your license to at least the DEVELOPER version to activate this feature!")),wp.element.createElement(kt,{isPrimary:!0,href:visualizerLocalize.proTeaser,target:"_blank"},vt("Buy Now"))),wp.element.createElement(mt,{id:this.props.id,chart:this.props.chart,editSchedule:this.props.editJSONSchedule,editJSONURL:this.props.editJSONURL,editJSONHeaders:this.props.editJSONHeaders,editJSONRoot:this.props.editJSONRoot,editJSONPaging:this.props.editJSONPaging,JSONImportData:this.props.JSONImportData}))}}])&&ft(t.prototype,n),r&&ft(t,r),i}(wt);function Ot(e){return(Ot="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function xt(e,t,n,r,a,i,o){try{var s=e[i](o),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,a)}function jt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Et(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Ct(e,t){return(Ct=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Pt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=zt(e);if(t){var a=zt(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Ht(this,n)}}function Ht(e,t){return!t||"object"!==Ot(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function zt(e){return(zt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var At=wp.i18n.__,Rt=wp.apiFetch,Nt=wp.element,Ft=Nt.Component,Wt=Nt.Fragment,It=wp.components,Bt=It.Button,Jt=It.PanelBody,Ut=It.Placeholder,Vt=It.SelectControl,qt=It.Spinner,Gt=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ct(e,t)}(s,e);var t,n,r,a,i,o=Pt(s);function s(){var e;return jt(this,s),(e=o.apply(this,arguments)).state={id:"",charts:[]},e}return t=s,(n=[{key:"componentDidMount",value:(a=regeneratorRuntime.mark((function e(){var t,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Rt({path:"wp/v2/visualizer/?per_page=100"});case 2:t=(t=e.sent).map((function(e,t){var r=e.chart_data["visualizer-settings"].title?e.chart_data["visualizer-settings"].title:"#".concat(e.id);return 0===t&&(n=e.id),{value:e.id,label:r}})),this.setState({id:n,charts:t});case 5:case"end":return e.stop()}}),e,this)})),i=function(){var e=this,t=arguments;return new Promise((function(n,r){var i=a.apply(e,t);function o(e){xt(i,n,r,o,s,"next",e)}function s(e){xt(i,n,r,o,s,"throw",e)}o(void 0)}))},function(){return i.apply(this,arguments)})},{key:"render",value:function(){var e=this;return"community"!==visualizerLocalize.isPro?wp.element.createElement(Jt,{title:At("Import from other chart"),initialOpen:!1},1<=this.state.charts.length?wp.element.createElement(Wt,null,wp.element.createElement(Vt,{label:At("You can import here data from your previously created charts."),value:this.state.id,options:this.state.charts,onChange:function(t){return e.setState({id:t})}}),wp.element.createElement(Bt,{isPrimary:!0,isLarge:!0,isBusy:"getChartData"===this.props.isLoading,onClick:function(){return e.props.getChartData(e.state.id)}},At("Import Chart"))):wp.element.createElement(Ut,null,wp.element.createElement(qt,null))):wp.element.createElement(Jt,{title:At("Import from other chart"),icon:"lock",initialOpen:!1},wp.element.createElement("p",null,At("Enable this feature in PRO version!")),wp.element.createElement(Bt,{isPrimary:!0,href:visualizerLocalize.proTeaser,target:"_blank"},At("Buy Now")))}}])&&Et(t.prototype,n),r&&Et(t,r),s}(Ft);function $t(e){return($t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Kt(e,t,n,r,a,i,o){try{var s=e[i](o),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,a)}function Zt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Qt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Xt(e,t){return(Xt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function en(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=rn(e);if(t){var a=rn(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return tn(this,n)}}function tn(e,t){return!t||"object"!==$t(t)&&"function"!=typeof t?nn(e):t}function nn(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function rn(e){return(rn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var an=wp.i18n.__,on=wp.apiRequest,sn=wp.components,ln=sn.Button,un=sn.ExternalLink,cn=wp.element,dn=cn.Component,mn=cn.Fragment,pn=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Xt(e,t)}(s,e);var t,n,r,a,i,o=en(s);function s(){var e;return Zt(this,s),(e=o.apply(this,arguments)).onSave=e.onSave.bind(nn(e)),e.state={isLoading:!1,success:!1,query:"",name:"",series:{},data:[]},e}return t=s,(n=[{key:"componentDidMount",value:function(){var e=wp.CodeMirror||CodeMirror,t=document.querySelector(".visualizer-db-query"),n=e.fromTextArea(t,{autofocus:!0,mode:"text/x-mysql",lineWrapping:!0,dragDrop:!1,matchBrackets:!0,autoCloseBrackets:!0,extraKeys:{"Ctrl-Space":"autocomplete"},hintOptions:{tables:visualizerLocalize.sqlTable}});n.on("inputRead",(function(){n.save()}))}},{key:"onSave",value:(a=regeneratorRuntime.mark((function e(){var t,n,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=document.querySelector(".visualizer-db-query").value,(n=document.querySelector("#visualizer-db-query-table")).innerHTML="",e.next=5,this.setState({isLoading:!0});case 5:return e.next=7,on({path:"/visualizer/v1/get-query-data",data:{query:t},method:"GET"});case 7:return r=e.sent,e.next=10,this.setState({isLoading:!1,success:r.success,query:t,name:r.data.name||"",series:r.data.series||{},data:r.data.data||[]});case 10:n.innerHTML=r.data.table||r.data.msg,this.state.success&&jQuery("#results").DataTable({paging:!1});case 12:case"end":return e.stop()}}),e,this)})),i=function(){var e=this,t=arguments;return new Promise((function(n,r){var i=a.apply(e,t);function o(e){Kt(i,n,r,o,s,"next",e)}function s(e){Kt(i,n,r,o,s,"throw",e)}o(void 0)}))},function(){return i.apply(this,arguments)})},{key:"render",value:function(){var e=this;return wp.element.createElement(mn,null,wp.element.createElement("textarea",{className:"visualizer-db-query",placeholder:an("Your query goes here…")},this.props.chart["visualizer-db-query"]),wp.element.createElement("div",{className:"visualizer-db-query-actions"},wp.element.createElement(ln,{isLarge:!0,isDefault:!0,isBusy:this.state.isLoading,onClick:this.onSave},an("Show Results")),wp.element.createElement(ln,{isLarge:!0,isPrimary:!0,disabled:!this.state.success,onClick:function(){return e.props.save(e.state.query,e.state.name,e.state.series,e.state.data)}},an("Save"))),wp.element.createElement("ul",null,wp.element.createElement("li",null,wp.element.createElement(un,{href:"https://docs.themeisle.com/article/970-visualizer-sample-queries-to-generate-charts"},an("Examples of queries and links to resources that you can use with this feature."))),wp.element.createElement("li",null,an("Use Control+Space for autocompleting keywords or table names."))),wp.element.createElement("div",{id:"visualizer-db-query-table",className:!this.state.success&&"db-wizard-error"}))}}])&&Qt(t.prototype,n),r&&Qt(t,r),s}(dn);function hn(e){return(hn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function fn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _n(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function yn(e,t){return(yn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function bn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=wn(e);if(t){var a=wn(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return gn(this,n)}}function gn(e,t){return!t||"object"!==hn(t)&&"function"!=typeof t?vn(e):t}function vn(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function wn(e){return(wn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Mn=wp.i18n.__,kn=wp.element.Component,Ln=wp.components,Yn=Ln.Button,Dn=Ln.Modal,Tn=Ln.PanelBody,Sn=Ln.SelectControl,On=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&yn(e,t)}(i,e);var t,n,r,a=bn(i);function i(){var e;return fn(this,i),(e=a.apply(this,arguments)).save=e.save.bind(vn(e)),e.state={isOpen:!1},e}return t=i,(n=[{key:"save",value:function(e,t,n,r){this.props.databaseImportData(e,t,n,r),this.setState({isOpen:!1})}},{key:"render",value:function(){var e=this;return"business"!==visualizerLocalize.isPro?wp.element.createElement(Tn,{title:Mn("Import data from database"),icon:"lock",initialOpen:!1},wp.element.createElement("p",null,Mn("Upgrade your license to at least the DEVELOPER version to activate this feature!")),wp.element.createElement(Yn,{isPrimary:!0,href:visualizerLocalize.proTeaser,target:"_blank"},Mn("Buy Now"))):wp.element.createElement(Tn,{title:Mn("Import data from database"),initialOpen:!1},wp.element.createElement("p",null,Mn("You can import data from the database here.")),wp.element.createElement("p",null,Mn("How often do you want to refresh the data from the database.")),wp.element.createElement(Sn,{label:Mn("How often do you want to check the url?"),value:this.props.chart["visualizer-db-schedule"]?this.props.chart["visualizer-db-schedule"]:0,options:[{label:Mn("Live"),value:"0"},{label:Mn("Each hour"),value:"1"},{label:Mn("Each 12 hours"),value:"12"},{label:Mn("Each day"),value:"24"},{label:Mn("Each 3 days"),value:"72"}],onChange:this.props.editSchedule}),wp.element.createElement(Yn,{isPrimary:!0,isLarge:!0,onClick:function(){return e.setState({isOpen:!0})}},Mn("Create Query")),this.state.isOpen&&wp.element.createElement(Dn,{title:Mn("Import from database"),onRequestClose:function(){return e.setState({isOpen:!1})},className:"visualizer-db-query-modal",shouldCloseOnClickOutside:!1},wp.element.createElement(pn,{chart:this.props.chart,changeQuery:this.props.changeQuery,save:this.save})))}}])&&_n(t.prototype,n),r&&_n(t,r),i}(kn),xn=n(132);n(152);function jn(e){return(jn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function En(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Cn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Pn(e,t){return(Pn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Hn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=An(e);if(t){var a=An(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return zn(this,n)}}function zn(e,t){return!t||"object"!==jn(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function An(e){return(An=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Rn=wp.i18n.__,Nn=wp.element.Component,Fn=wp.components,Wn=Fn.Button,In=Fn.ButtonGroup,Bn=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Pn(e,t)}(i,e);var t,n,r,a=Hn(i);function i(){var e;return En(this,i),(e=a.apply(this,arguments)).data=[],e.dates=[],e.types=["string","number","boolean","date","datetime","timeofday"],e}return t=i,(n=[{key:"componentWillMount",value:function(){var e=this;this.data[this.data.length]=[],this.data[this.data.length]=[],this.props.chart["visualizer-series"].map((function(t,n){e.data[0][n]=t.label,e.data[1][n]=t.type,"date"===t.type&&e.dates.push(n)})),this.props.chart["visualizer-data"].map((function(t){e.data[e.data.length]=t}))}},{key:"render",value:function(){var e=this;return wp.element.createElement("div",{className:"visualizer-chart-editor"},wp.element.createElement(xn.HotTable,{data:this.data,allowInsertRow:!0,contextMenu:!0,rowHeaders:!0,colHeaders:!0,allowInvalid:!1,className:"htEditor",cells:function(t,n,r){var a;return 1===t&&(a={type:"autocomplete",source:e.types,strict:!1}),0<=e.dates.indexOf(n)&&1<t&&(a={type:"date",dateFormat:"YYYY-MM-DD",correctFormat:!0}),a}}),wp.element.createElement(In,null,wp.element.createElement(Wn,{isDefault:!0,isLarge:!0,onClick:this.props.toggleModal},Rn("Close")),wp.element.createElement(Wn,{isPrimary:!0,isLarge:!0,onClick:function(t){e.props.toggleModal(),e.props.editChartData(e.data,"Visualizer_Source_Csv")}},Rn("Save"))))}}])&&Cn(t.prototype,n),r&&Cn(t,r),i}(Nn);function Jn(e){return(Jn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Un(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Vn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function qn(e,t){return(qn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Gn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Zn(e);if(t){var a=Zn(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return $n(this,n)}}function $n(e,t){return!t||"object"!==Jn(t)&&"function"!=typeof t?Kn(e):t}function Kn(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Zn(e){return(Zn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Qn=wp.i18n.__,Xn=wp.element,er=Xn.Component,tr=Xn.Fragment,nr=wp.components,rr=nr.Button,ar=nr.Modal,ir=nr.PanelBody,or=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&qn(e,t)}(i,e);var t,n,r,a=Gn(i);function i(){var e;return Un(this,i),(e=a.apply(this,arguments)).toggleModal=e.toggleModal.bind(Kn(e)),e.state={isOpen:!1},e}return t=i,(n=[{key:"toggleModal",value:function(){this.setState({isOpen:!this.state.isOpen})}},{key:"render",value:function(){return"community"!==visualizerLocalize.isPro?wp.element.createElement(tr,null,wp.element.createElement(ir,{title:Qn("Manual Data"),initialOpen:!1},wp.element.createElement("p",null,Qn("You can manually edit the chart data using a spreadsheet like editor.")),wp.element.createElement(rr,{isPrimary:!0,isLarge:!0,isBusy:this.state.isOpen,onClick:this.toggleModal},Qn("View Editor"))),this.state.isOpen&&wp.element.createElement(ar,{title:"Chart Editor",onRequestClose:this.toggleModal,shouldCloseOnClickOutside:!1},wp.element.createElement(Bn,{chart:this.props.chart,editChartData:this.props.editChartData,toggleModal:this.toggleModal}))):wp.element.createElement(ir,{title:Qn("Manual Data"),icon:"lock",initialOpen:!1},wp.element.createElement("p",null,Qn("Enable this feature in PRO version!")),wp.element.createElement(rr,{isPrimary:!0,href:visualizerLocalize.proTeaser,target:"_blank"},Qn("Buy Now")))}}])&&Vn(t.prototype,n),r&&Vn(t,r),i}(er);function sr(e){return(sr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function lr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ur(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function cr(e,t){return(cr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function dr(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=pr(e);if(t){var a=pr(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return mr(this,n)}}function mr(e,t){return!t||"object"!==sr(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function pr(e){return(pr=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var hr=wp.i18n.__,fr=wp.element.Component,_r=(wp.blockEditor||wp.editor).ColorPalette,yr=wp.components,br=yr.BaseControl,gr=yr.CheckboxControl,vr=yr.PanelBody,wr=yr.SelectControl,Mr=yr.TextControl,kr=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&cr(e,t)}(i,e);var t,n,r,a=dr(i);function i(){return lr(this,i),a.apply(this,arguments)}return t=i,(n=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-chart-type"],n=this.props.chart["visualizer-settings"],r=[{label:hr("The tooltip will be displayed when the user hovers over an element"),value:"focus"}];-1>=["timeline"].indexOf(t)&&(r[1]={label:hr("The tooltip will be displayed when the user selects an element"),value:"selection"}),r[2]={label:hr("The tooltip will not be displayed"),value:"none"};var a=[{label:hr("Left of the chart"),value:"left"},{label:hr("Right of the chart"),value:"right"},{label:hr("Above the chart"),value:"top"},{label:hr("Below the chart"),value:"bottom"},{label:hr("Omit the legend"),value:"none"}];"pie"!==t&&a.push({label:hr("Inside the chart"),value:"in"}),"bubble"===t&&(a=a.filter((function(e){return"left"!==e.value})));var i=hr("Text to display above the chart.");return 0<=["tabular","dataTable","gauge","geo","timeline"].indexOf(t)&&(i=hr("Text to display in the back-end admin area")),wp.element.createElement(vr,{title:hr("General Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(vr,{title:hr("Title"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Mr,{label:hr("Chart Title"),help:i,value:n.title,onChange:function(t){n.title=t,e.props.edit(n)}}),-1>=["tabular","dataTable","gauge","geo","pie","timeline"].indexOf(t)&&wp.element.createElement(wr,{label:hr("Chart Title Position"),help:hr("Where to place the chart title, compared to the chart area."),value:n.titlePosition?n.titlePosition:"out",options:[{label:hr("Inside the chart"),value:"in"},{label:hr("Outside the chart"),value:"out"},{label:hr("None"),value:"none"}],onChange:function(t){n.titlePosition=t,e.props.edit(n)}}),-1>=["tabular","dataTable","gauge","geo","timeline"].indexOf(t)&&wp.element.createElement(br,{label:hr("Chart Title Color")},wp.element.createElement(_r,{value:n.titleTextStyle.color,onChange:function(t){n.titleTextStyle.color=t,e.props.edit(n)}})),-1>=["tabular","dataTable","gauge","geo","pie","timeline"].indexOf(t)&&wp.element.createElement(wr,{label:hr("Axes Titles Position"),help:hr("Determines where to place the axis titles, compared to the chart area."),value:n.axisTitlesPosition?n.axisTitlesPosition:"out",options:[{label:hr("Inside the chart"),value:"in"},{label:hr("Outside the chart"),value:"out"},{label:hr("None"),value:"none"}],onChange:function(t){n.axisTitlesPosition=t,e.props.edit(n)}})),-1>=["tabular","dataTable","gauge","geo","pie","timeline"].indexOf(t)&&wp.element.createElement(vr,{title:hr("Font Styles"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(wr,{label:hr("Font Family"),help:hr("The default font family for all text in the chart."),value:n.fontName?n.fontName:"Arial",options:[{label:hr("Arial"),value:"Arial"},{label:hr("Sans Serif"),value:"Sans Serif"},{label:hr("Serif"),value:"serif"},{label:hr("Arial"),value:"Arial"},{label:hr("Wide"),value:"Arial black"},{label:hr("Narrow"),value:"Arial Narrow"},{label:hr("Comic Sans MS"),value:"Comic Sans MS"},{label:hr("Courier New"),value:"Courier New"},{label:hr("Garamond"),value:"Garamond"},{label:hr("Georgia"),value:"Georgia"},{label:hr("Tahoma"),value:"Tahoma"},{label:hr("Verdana"),value:"Verdana"}],onChange:function(t){n.fontName=t,e.props.edit(n)}}),wp.element.createElement(wr,{label:hr("Font Size"),help:hr("The default font size for all text in the chart."),value:n.fontSize?n.fontSize:"15",options:[{label:"7",value:"7"},{label:"8",value:"8"},{label:"9",value:"9"},{label:"10",value:"10"},{label:"11",value:"11"},{label:"12",value:"12"},{label:"13",value:"13"},{label:"14",value:"14"},{label:"15",value:"15"},{label:"16",value:"16"},{label:"17",value:"17"},{label:"18",value:"18"},{label:"19",value:"19"},{label:"20",value:"20"}],onChange:function(t){n.fontSize=t,e.props.edit(n)}})),-1>=["tabular","dataTable","gauge","geo","timeline"].indexOf(t)&&wp.element.createElement(vr,{title:hr("Legend"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(wr,{label:hr("Position"),help:hr("Determines where to place the legend, compared to the chart area."),value:n.legend.position?n.legend.position:"right",options:a,onChange:function(r){if("pie"!==t){var a="left"===r?1:0;n.series&&Object.keys(n.series).map((function(e){n.series[e].targetAxisIndex=a}))}n.legend.position=r,e.props.edit(n)}}),wp.element.createElement(wr,{label:hr("Alignment"),help:hr("Determines the alignment of the legend."),value:n.legend.alignment?n.legend.alignment:"15",options:[{label:hr("Aligned to the start of the allocated area"),value:"start"},{label:hr("Centered in the allocated area"),value:"center"},{label:hr("Aligned to the end of the allocated area"),value:"end"}],onChange:function(t){n.legend.alignment=t,e.props.edit(n)}}),wp.element.createElement(br,{label:hr("Font Color")},wp.element.createElement(_r,{value:n.legend.textStyle.color,onChange:function(t){n.legend.textStyle.color=t,e.props.edit(n)}}))),-1>=["tabular","gauge","geo","dataTable","timeline"].indexOf(t)&&wp.element.createElement(vr,{title:hr("Tooltip"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(wr,{label:hr("Trigger"),help:hr("Determines the user interaction that causes the tooltip to be displayed."),value:n.tooltip.trigger?n.tooltip.trigger:"focus",options:r,onChange:function(t){n.tooltip.trigger=t,e.props.edit(n)}}),wp.element.createElement(wr,{label:hr("Show Color Code"),help:hr("If set to yes, will show colored squares next to the slice information in the tooltip."),value:n.tooltip.showColorCode?n.tooltip.showColorCode:"0",options:[{label:hr("Yes"),value:"1"},{label:hr("No"),value:"0"}],onChange:function(t){n.tooltip.showColorCode=t,e.props.edit(n)}}),0<=["pie"].indexOf(t)&&wp.element.createElement(wr,{label:hr("Text"),help:hr("Determines what information to display when the user hovers over a pie slice."),value:n.tooltip.text?n.tooltip.text:"both",options:[{label:hr("Display both the absolute value of the slice and the percentage of the whole"),value:"both"},{label:hr("Display only the absolute value of the slice"),value:"value"},{label:hr("Display only the percentage of the whole represented by the slice"),value:"percentage"}],onChange:function(t){n.tooltip.text=t,e.props.edit(n)}})),-1>=["tabular","dataTable","gauge","geo","pie","timeline"].indexOf(t)&&wp.element.createElement(vr,{title:hr("Animation"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(gr,{label:hr("Animate on startup?"),help:hr("Determines if the chart will animate on the initial draw."),checked:Number(n.animation.startup),onChange:function(t){n.animation.startup=t?"1":"0",e.props.edit(n)}}),wp.element.createElement(Mr,{label:hr("Duration"),help:hr("The duration of the animation, in milliseconds."),type:"number",value:n.animation.duration,onChange:function(t){n.animation.duration=t,e.props.edit(n)}}),wp.element.createElement(wr,{label:hr("Easing"),help:hr("The easing function applied to the animation."),value:n.animation.easing?n.animation.easing:"linear",options:[{label:hr("Constant speed"),value:"linear"},{label:hr("Start slow and speed up"),value:"in"},{label:hr("Start fast and slow down"),value:"out"},{label:hr("Start slow, speed up, then slow down"),value:"inAndOut"}],onChange:function(t){n.animation.easing=t,e.props.edit(n)}})))}}])&&ur(t.prototype,n),r&&ur(t,r),i}(fr);function Lr(e){return(Lr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Yr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Dr(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Tr(e,t){return(Tr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Sr(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=xr(e);if(t){var a=xr(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Or(this,n)}}function Or(e,t){return!t||"object"!==Lr(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function xr(e){return(xr=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var jr=wp.i18n.__,Er=wp.element.Component,Cr=wp.components,Pr=Cr.PanelBody,Hr=Cr.Notice,zr=Cr.TextControl,Ar=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Tr(e,t)}(i,e);var t,n,r,a=Sr(i);function i(){return Yr(this,i),a.apply(this,arguments)}return t=i,(n=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(Pr,{title:jr("Instance Settings"),initialOpen:!0,className:"visualizer-instance-panel"},wp.element.createElement(Hr,{status:"info",isDismissible:!1},wp.element.createElement("p",null,jr("These settings are valid only for this instance of the chart.")),wp.element.createElement("p",null,jr("This means that if you insert this chart again elsewhere, these values will not persist."))),wp.element.createElement(zr,{label:jr("Should this instance lazy Load?"),help:jr("-1: do not lazy load. Any number greater than -1 will lazy load the chart once the viewport is that many pixels away from the chart"),value:this.props.attributes.lazy?Number(this.props.attributes.lazy):-1,type:"number",min:"-1",max:"1000",step:"1",onChange:function(n){e.props.attributes.lazy=n,e.props.edit(t)}}))}}])&&Dr(t.prototype,n),r&&Dr(t,r),i}(Er);function Rr(e){return(Rr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Nr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Fr(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Wr(e,t){return(Wr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Ir(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Jr(e);if(t){var a=Jr(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Br(this,n)}}function Br(e,t){return!t||"object"!==Rr(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Jr(e){return(Jr=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Ur=wp.i18n.__,Vr=wp.element,qr=Vr.Component,Gr=Vr.Fragment,$r=(wp.blockEditor||wp.editor).ColorPalette,Kr=wp.components,Zr=Kr.BaseControl,Qr=Kr.ExternalLink,Xr=Kr.PanelBody,ea=Kr.SelectControl,ta=Kr.TextControl,na=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Wr(e,t)}(i,e);var t,n,r,a=Ir(i);function i(){return Nr(this,i),a.apply(this,arguments)}return t=i,(n=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-chart-type"],n=this.props.chart["visualizer-settings"];return wp.element.createElement(Xr,{title:Ur("Horizontal Axis Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(Xr,{title:Ur("General Settings"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(ta,{label:Ur("Axis Title"),help:Ur("The title of the horizontal axis."),value:n.hAxis.title,onChange:function(t){n.hAxis.title=t,e.props.edit(n)}}),wp.element.createElement(ea,{label:Ur("Text Position"),help:Ur("Position of the horizontal axis text, relative to the chart area."),value:n.hAxis.textPosition?n.hAxis.textPosition:"out",options:[{label:Ur("Inside the chart"),value:"in"},{label:Ur("Outside the chart"),value:"out"},{label:Ur("None"),value:"none"}],onChange:function(t){n.hAxis.textPosition=t,e.props.edit(n)}}),wp.element.createElement(ea,{label:Ur("Direction"),help:Ur("The direction in which the values along the horizontal axis grow."),value:n.hAxis.direction?n.hAxis.direction:"1",options:[{label:Ur("Identical Direction"),value:"1"},{label:Ur("Reverse Direction"),value:"-1"}],onChange:function(t){n.hAxis.direction=t,e.props.edit(n)}}),wp.element.createElement(Zr,{label:Ur("Base Line Color")},wp.element.createElement($r,{value:n.hAxis.baselineColor,onChange:function(t){n.hAxis.baselineColor=t,e.props.edit(n)}})),wp.element.createElement(Zr,{label:Ur("Axis Text Color")},wp.element.createElement($r,{value:n.hAxis.textStyle.color||n.hAxis.textStyle,onChange:function(t){n.hAxis.textStyle={},n.hAxis.textStyle.color=t,e.props.edit(n)}})),-1>=["column"].indexOf(t)&&wp.element.createElement(Gr,null,wp.element.createElement(ta,{label:Ur("Number Format"),help:Ur("Enter custom format pattern to apply to horizontal axis labels."),value:n.hAxis.format,onChange:function(t){n.hAxis.format=t,e.props.edit(n)}}),wp.element.createElement("p",null,Ur("For number axis labels, this is a subset of the formatting "),wp.element.createElement(Qr,{href:"http://icu-project.org/apiref/icu4c/classDecimalFormat.html#_details"},Ur("ICU pattern set.")),Ur(" For instance, $#,###.## will display values $1,234.56 for value 1234.56. Pay attention that if you use #%% percentage format then your values will be multiplied by 100.")),wp.element.createElement("p",null,Ur("For date axis labels, this is a subset of the date formatting "),wp.element.createElement(Qr,{href:"http://userguide.icu-project.org/formatparse/datetime#TOC-Date-Time-Format-Syntax"},Ur("ICU date and time format."))))),-1>=["column"].indexOf(t)&&wp.element.createElement(Gr,null,wp.element.createElement(Xr,{title:Ur("Grid Lines"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(ta,{label:Ur("Count"),help:Ur("The approximate number of horizontal gridlines inside the chart area. You can specify a value of -1 to automatically compute the number of gridlines, 0 or 1 to draw no gridlines, or 2 or more to only draw gridline. Any number greater than 2 will be used to compute the minSpacing between gridlines."),value:n.hAxis.gridlines?n.hAxis.gridlines.count:"",onChange:function(t){n.hAxis.gridlines||(n.hAxis.gridlines={}),n.hAxis.gridlines.count=t,e.props.edit(n)}}),wp.element.createElement(Zr,{label:Ur("Color")},wp.element.createElement($r,{value:n.hAxis.gridlines?n.hAxis.gridlines.color:"",onChange:function(t){n.hAxis.gridlines||(n.hAxis.gridlines={}),n.hAxis.gridlines.color=t,e.props.edit(n)}}))),wp.element.createElement(Xr,{title:Ur("Minor Grid Lines"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(ta,{label:Ur("Count"),help:Ur("Specify 0 to disable the minor gridlines."),value:n.hAxis.minorGridlines?n.hAxis.minorGridlines.count:"",onChange:function(t){n.hAxis.minorGridlines||(n.hAxis.minorGridlines={}),n.hAxis.minorGridlines.count=t,e.props.edit(n)}}),wp.element.createElement(Zr,{label:Ur("Color")},wp.element.createElement($r,{value:n.hAxis.minorGridlines?n.hAxis.minorGridlines.color:"",onChange:function(t){n.hAxis.minorGridlines||(n.hAxis.minorGridlines={}),n.hAxis.minorGridlines.color=t,e.props.edit(n)}}))),wp.element.createElement(Xr,{title:Ur("View Window"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(ta,{label:Ur("Maximun Value"),help:Ur("The maximum vertical data value to render."),value:n.hAxis.viewWindow?n.hAxis.viewWindow.max:"",onChange:function(t){n.hAxis.viewWindow||(n.hAxis.viewWindow={}),n.hAxis.viewWindow.max=t,e.props.edit(n)}}),wp.element.createElement(ta,{label:Ur("Minimum Value"),help:Ur("The minimum vertical data value to render."),value:n.hAxis.viewWindow?n.hAxis.viewWindow.min:"",onChange:function(t){n.hAxis.viewWindow||(n.hAxis.viewWindow={}),n.hAxis.viewWindow.min=t,e.props.edit(n)}}))))}}])&&Fr(t.prototype,n),r&&Fr(t,r),i}(qr);function ra(e){return(ra="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function aa(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ia(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function oa(e,t){return(oa=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function sa(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=ua(e);if(t){var a=ua(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return la(this,n)}}function la(e,t){return!t||"object"!==ra(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function ua(e){return(ua=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var ca=wp.i18n.__,da=wp.element,ma=da.Component,pa=da.Fragment,ha=(wp.blockEditor||wp.editor).ColorPalette,fa=wp.components,_a=fa.BaseControl,ya=fa.ExternalLink,ba=fa.PanelBody,ga=fa.SelectControl,va=fa.TextControl,wa=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&oa(e,t)}(i,e);var t,n,r,a=sa(i);function i(){return aa(this,i),a.apply(this,arguments)}return t=i,(n=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-chart-type"],n=this.props.chart["visualizer-settings"];return wp.element.createElement(ba,{title:ca("Vertical Axis Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(ba,{title:ca("General Settings"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(va,{label:ca("Axis Title"),help:ca("The title of the Vertical axis."),value:n.vAxis.title,onChange:function(t){n.vAxis.title=t,e.props.edit(n)}}),wp.element.createElement(ga,{label:ca("Text Position"),help:ca("Position of the Vertical axis text, relative to the chart area."),value:n.vAxis.textPosition?n.vAxis.textPosition:"out",options:[{label:ca("Inside the chart"),value:"in"},{label:ca("Outside the chart"),value:"out"},{label:ca("None"),value:"none"}],onChange:function(t){n.vAxis.textPosition=t,e.props.edit(n)}}),wp.element.createElement(ga,{label:ca("Direction"),help:ca("The direction in which the values along the Vertical axis grow."),value:n.vAxis.direction?n.vAxis.direction:"1",options:[{label:ca("Identical Direction"),value:"1"},{label:ca("Reverse Direction"),value:"-1"}],onChange:function(t){n.vAxis.direction=t,e.props.edit(n)}}),wp.element.createElement(_a,{label:ca("Base Line Color")},wp.element.createElement(ha,{value:n.vAxis.baselineColor,onChange:function(t){n.vAxis.baselineColor=t,e.props.edit(n)}})),wp.element.createElement(_a,{label:ca("Axis Text Color")},wp.element.createElement(ha,{value:n.vAxis.textStyle.color||n.vAxis.textStyle,onChange:function(t){n.vAxis.textStyle={},n.vAxis.textStyle.color=t,e.props.edit(n)}})),-1>=["bar"].indexOf(t)&&wp.element.createElement(pa,null,wp.element.createElement(va,{label:ca("Number Format"),help:ca("Enter custom format pattern to apply to Vertical axis labels."),value:n.vAxis.format,onChange:function(t){n.vAxis.format=t,e.props.edit(n)}}),wp.element.createElement("p",null,ca("For number axis labels, this is a subset of the formatting "),wp.element.createElement(ya,{href:"http://icu-project.org/apiref/icu4c/classDecimalFormat.html#_details"},ca("ICU pattern set.")),ca(" For instance, $#,###.## will display values $1,234.56 for value 1234.56. Pay attention that if you use #%% percentage format then your values will be multiplied by 100.")),wp.element.createElement("p",null,ca("For date axis labels, this is a subset of the date formatting "),wp.element.createElement(ya,{href:"http://userguide.icu-project.org/formatparse/datetime#TOC-Date-Time-Format-Syntax"},ca("ICU date and time format."))))),-1>=["bar"].indexOf(t)&&wp.element.createElement(pa,null,wp.element.createElement(ba,{title:ca("Grid Lines"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(va,{label:ca("Count"),help:ca("The approximate number of vertical gridlines inside the chart area. You can specify a value of -1 to automatically compute the number of gridlines, 0 or 1 to draw no gridlines, or 2 or more to only draw gridline. Any number greater than 2 will be used to compute the minSpacing between gridlines."),value:n.vAxis.gridlines?n.vAxis.gridlines.count:"",onChange:function(t){n.vAxis.gridlines||(n.vAxis.gridlines={}),n.vAxis.gridlines.count=t,e.props.edit(n)}}),wp.element.createElement(_a,{label:ca("Color")},wp.element.createElement(ha,{value:n.vAxis.gridlines?n.vAxis.gridlines.color:"",onChange:function(t){n.vAxis.gridlines||(n.vAxis.gridlines={}),n.vAxis.gridlines.color=t,e.props.edit(n)}}))),wp.element.createElement(ba,{title:ca("Minor Grid Lines"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(va,{label:ca("Count"),help:ca("Specify 0 to disable the minor gridlines."),value:n.vAxis.minorGridlines?n.vAxis.minorGridlines.count:"",onChange:function(t){n.vAxis.minorGridlines||(n.vAxis.minorGridlines={}),n.vAxis.minorGridlines.count=t,e.props.edit(n)}}),wp.element.createElement(_a,{label:ca("Color")},wp.element.createElement(ha,{value:n.vAxis.minorGridlines?n.vAxis.minorGridlines.color:"",onChange:function(t){n.vAxis.minorGridlines||(n.vAxis.minorGridlines={}),n.vAxis.minorGridlines.color=t,e.props.edit(n)}}))),wp.element.createElement(ba,{title:ca("View Window"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(va,{label:ca("Maximun Value"),help:ca("The maximum vertical data value to render."),value:n.vAxis.viewWindow?n.vAxis.viewWindow.max:"",onChange:function(t){n.vAxis.viewWindow||(n.vAxis.viewWindow={}),n.vAxis.viewWindow.max=t,e.props.edit(n)}}),wp.element.createElement(va,{label:ca("Minimum Value"),help:ca("The minimum vertical data value to render."),value:n.vAxis.viewWindow?n.vAxis.viewWindow.min:"",onChange:function(t){n.vAxis.viewWindow||(n.vAxis.viewWindow={}),n.vAxis.viewWindow.min=t,e.props.edit(n)}}))))}}])&&ia(t.prototype,n),r&&ia(t,r),i}(ma);function Ma(e){return(Ma="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ka(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function La(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Ya(e,t){return(Ya=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Da(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Sa(e);if(t){var a=Sa(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Ta(this,n)}}function Ta(e,t){return!t||"object"!==Ma(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Sa(e){return(Sa=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Oa=wp.i18n.__,xa=wp.element,ja=xa.Component,Ea=xa.Fragment,Ca=(wp.blockEditor||wp.editor).ColorPalette,Pa=wp.components,Ha=Pa.BaseControl,za=Pa.ExternalLink,Aa=Pa.PanelBody,Ra=Pa.SelectControl,Na=Pa.TextControl,Fa=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ya(e,t)}(i,e);var t,n,r,a=Da(i);function i(){return ka(this,i),a.apply(this,arguments)}return t=i,(n=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(Aa,{title:Oa("Pie Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(Ea,null,wp.element.createElement(Na,{label:Oa("Number Format"),help:Oa("Enter custom format pattern to apply to chart labels."),value:t.format,onChange:function(n){t.format=n,e.props.edit(t)}}),wp.element.createElement("p",null,Oa("For number axis labels, this is a subset of the formatting "),wp.element.createElement(za,{href:"http://icu-project.org/apiref/icu4c/classDecimalFormat.html#_details"},Oa("ICU pattern set.")),Oa(" For instance, $#,###.## will display values $1,234.56 for value 1234.56. Pay attention that if you use #%% percentage format then your values will be multiplied by 100.")),wp.element.createElement("p",null,Oa("For date axis labels, this is a subset of the date formatting "),wp.element.createElement(za,{href:"http://userguide.icu-project.org/formatparse/datetime#TOC-Date-Time-Format-Syntax"},Oa("ICU date and time format.")))),wp.element.createElement(Ra,{label:Oa("Is 3D"),help:Oa("If set to yes, displays a three-dimensional chart."),value:t.is3D?t.is3D:"0",options:[{label:Oa("Yes"),value:"1"},{label:Oa("No"),value:"0"}],onChange:function(n){t.is3D=n,e.props.edit(t)}}),wp.element.createElement(Ra,{label:Oa("Reverse Categories"),help:Oa("If set to yes, will draw slices counterclockwise."),value:t.reverseCategories?t.reverseCategories:"0",options:[{label:Oa("Yes"),value:"1"},{label:Oa("No"),value:"0"}],onChange:function(n){t.reverseCategories=n,e.props.edit(t)}}),wp.element.createElement(Ra,{label:Oa("Slice Text"),help:Oa("The content of the text displayed on the slice."),value:t.pieSliceText?t.pieSliceText:"percentage",options:[{label:Oa("The percentage of the slice size out of the total"),value:"percentage"},{label:Oa("The quantitative value of the slice"),value:"value"},{label:Oa("The name of the slice"),value:"label"},{label:Oa("The quantitative value and percentage of the slice"),value:"value-and-percentage"},{label:Oa("No text is displayed"),value:"none"}],onChange:function(n){t.pieSliceText=n,e.props.edit(t)}}),wp.element.createElement(Na,{label:Oa("Pie Hole"),help:Oa("If between 0 and 1, displays a donut chart. The hole with have a radius equal to number times the radius of the chart. Only applicable when the chart is two-dimensional."),placeholder:Oa("0.5"),value:t.pieHole,onChange:function(n){t.pieHole=n,e.props.edit(t)}}),wp.element.createElement(Na,{label:Oa("Start Angle"),help:Oa("The angle, in degrees, to rotate the chart by. The default of 0 will orient the leftmost edge of the first slice directly up."),value:t.pieStartAngle,onChange:function(n){t.pieStartAngle=n,e.props.edit(t)}}),wp.element.createElement(Ha,{label:Oa("Slice Border Color")},wp.element.createElement(Ca,{value:t.pieSliceBorderColor,onChange:function(n){t.pieSliceBorderColor=n,e.props.edit(t)}})))}}])&&La(t.prototype,n),r&&La(t,r),i}(ja);function Wa(e){return(Wa="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ia(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ba(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Ja(e,t){return(Ja=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Ua(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=qa(e);if(t){var a=qa(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Va(this,n)}}function Va(e,t){return!t||"object"!==Wa(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function qa(e){return(qa=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Ga=wp.i18n.__,$a=wp.element.Component,Ka=(wp.blockEditor||wp.editor).ColorPalette,Za=wp.components,Qa=Za.BaseControl,Xa=Za.PanelBody,ei=Za.TextControl,ti=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ja(e,t)}(i,e);var t,n,r,a=Ua(i);function i(){return Ia(this,i),a.apply(this,arguments)}return t=i,(n=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(Xa,{title:Ga("Residue Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(ei,{label:Ga("Visibility Threshold"),help:Ga("The slice relative part, below which a slice will not show individually. All slices that have not passed this threshold will be combined to a single slice, whose size is the sum of all their sizes. Default is not to show individually any slice which is smaller than half a degree."),placeholder:Ga("0.001388889"),value:t.sliceVisibilityThreshold,onChange:function(n){t.sliceVisibilityThreshold=n,e.props.edit(t)}}),wp.element.createElement(ei,{label:Ga("Residue Slice Label"),help:Ga("A label for the combination slice that holds all slices below slice visibility threshold."),value:t.pieResidueSliceLabel,onChange:function(n){t.pieResidueSliceLabel=n,e.props.edit(t)}}),wp.element.createElement(Qa,{label:Ga("Residue Slice Color")},wp.element.createElement(Ka,{value:t.pieResidueSliceColor,onChange:function(n){t.pieResidueSliceColor=n,e.props.edit(t)}})))}}])&&Ba(t.prototype,n),r&&Ba(t,r),i}($a);function ni(e){return(ni="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ri(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ai(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ii(e,t){return(ii=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function oi(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=li(e);if(t){var a=li(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return si(this,n)}}function si(e,t){return!t||"object"!==ni(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function li(e){return(li=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var ui=wp.i18n.__,ci=wp.element,di=ci.Component,mi=ci.Fragment,pi=wp.components,hi=pi.PanelBody,fi=pi.SelectControl,_i=pi.TextControl,yi=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ii(e,t)}(i,e);var t,n,r,a=oi(i);function i(){return ri(this,i),a.apply(this,arguments)}return t=i,(n=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-chart-type"],n=this.props.chart["visualizer-settings"];return wp.element.createElement(hi,{title:ui("Lines Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(_i,{label:ui("Line Width"),help:ui("Data line width in pixels. Use zero to hide all lines."),value:n.lineWidth,onChange:function(t){n.lineWidth=t,e.props.edit(n)}}),wp.element.createElement(_i,{label:ui("Point Size"),help:ui("Diameter of displayed points in pixels. Use zero to hide all the points."),value:n.pointSize,onChange:function(t){n.pointSize=t,e.props.edit(n)}}),-1>=["area"].indexOf(t)&&wp.element.createElement(fi,{label:ui("Curve Type"),help:ui("Determines whether the series has to be presented in the legend or not."),value:n.curveType?n.curveType:"none",options:[{label:ui("Straight line without curve"),value:"none"},{label:ui("The angles of the line will be smoothed"),value:"function"}],onChange:function(t){n.curveType=t,e.props.edit(n)}}),-1>=["scatter"].indexOf(t)&&wp.element.createElement(fi,{label:ui("Focus Target"),help:ui("The type of the entity that receives focus on mouse hover. Also affects which entity is selected by mouse click."),value:n.focusTarget?n.focusTarget:"datum",options:[{label:ui("Focus on a single data point."),value:"datum"},{label:ui("Focus on a grouping of all data points along the major axis."),value:"category"}],onChange:function(t){n.focusTarget=t,e.props.edit(n)}}),wp.element.createElement(fi,{label:ui("Selection Mode"),help:ui("Determines how many data points an user can select on a chart."),value:n.selectionMode?n.selectionMode:"single",options:[{label:ui("Single data point"),value:"single"},{label:ui("Multiple data points"),value:"multiple"}],onChange:function(t){n.selectionMode=t,e.props.edit(n)}}),wp.element.createElement(fi,{label:ui("Aggregation Target"),help:ui("Determines how multiple data selections are rolled up into tooltips. To make it working you need to set multiple selection mode and tooltip trigger to display it when an user selects an element."),value:n.aggregationTarget?n.aggregationTarget:"auto",options:[{label:ui("Group selected data by x-value"),value:"category"},{label:ui("Group selected data by series"),value:"series"},{label:ui("Group selected data by x-value if all selections have the same x-value, and by series otherwise"),value:"auto"},{label:ui("Show only one tooltip per selection"),value:"none"}],onChange:function(t){n.aggregationTarget=t,e.props.edit(n)}}),wp.element.createElement(_i,{label:ui("Point Opacity"),help:ui("The transparency of data points, with 1.0 being completely opaque and 0.0 fully transparent."),value:n.dataOpacity,onChange:function(t){n.dataOpacity=t,e.props.edit(n)}}),-1>=["scatter","line"].indexOf(t)&&wp.element.createElement(mi,null,wp.element.createElement(_i,{label:ui("Area Opacity"),help:ui("The default opacity of the colored area under an area chart series, where 0.0 is fully transparent and 1.0 is fully opaque. To specify opacity for an individual series, set the area opacity value in the series property."),value:n.areaOpacity,onChange:function(t){n.areaOpacity=t,e.props.edit(n)}}),wp.element.createElement(fi,{label:ui("Is Stacked"),help:ui("If set to yes, series elements are stacked."),value:n.isStacked?n.isStacked:"0",options:[{label:ui("Yes"),value:"1"},{label:ui("No"),value:"0"}],onChange:function(t){n.isStacked=t,e.props.edit(n)}})),-1>=["scatter","area"].indexOf(t)&&wp.element.createElement(fi,{label:ui("Interpolate Nulls"),help:ui("Whether to guess the value of missing points. If yes, it will guess the value of any missing data based on neighboring points. If no, it will leave a break in the line at the unknown point."),value:n.interpolateNulls?n.interpolateNulls:"0",options:[{label:ui("Yes"),value:"1"},{label:ui("No"),value:"0"}],onChange:function(t){n.interpolateNulls=t,e.props.edit(n)}}))}}])&&ai(t.prototype,n),r&&ai(t,r),i}(di);function bi(e){return(bi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function gi(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function vi(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function wi(e,t){return(wi=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Mi(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Li(e);if(t){var a=Li(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return ki(this,n)}}function ki(e,t){return!t||"object"!==bi(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Li(e){return(Li=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Yi=wp.i18n.__,Di=wp.element.Component,Ti=wp.components,Si=Ti.PanelBody,Oi=Ti.SelectControl,xi=Ti.TextControl,ji=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&wi(e,t)}(i,e);var t,n,r,a=Mi(i);function i(){return gi(this,i),a.apply(this,arguments)}return t=i,(n=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(Si,{title:Yi("Bars Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(Oi,{label:Yi("Focus Target"),help:Yi("The type of the entity that receives focus on mouse hover. Also affects which entity is selected by mouse click."),value:t.focusTarget?t.focusTarget:"datum",options:[{label:Yi("Focus on a single data point."),value:"datum"},{label:Yi("Focus on a grouping of all data points along the major axis."),value:"category"}],onChange:function(n){t.focusTarget=n,e.props.edit(t)}}),wp.element.createElement(Oi,{label:Yi("Is Stacked"),help:Yi("If set to yes, series elements are stacked."),value:t.isStacked?t.isStacked:"0",options:[{label:Yi("Yes"),value:"1"},{label:Yi("No"),value:"0"}],onChange:function(n){t.isStacked=n,e.props.edit(t)}}),wp.element.createElement(xi,{label:Yi("Bars Opacity"),help:Yi("Bars transparency, with 1.0 being completely opaque and 0.0 fully transparent."),value:t.dataOpacity,onChange:function(n){t.dataOpacity=n,e.props.edit(t)}}))}}])&&vi(t.prototype,n),r&&vi(t,r),i}(Di);function Ei(e){return(Ei="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ci(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Pi(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Hi(e,t){return(Hi=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function zi(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Ri(e);if(t){var a=Ri(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Ai(this,n)}}function Ai(e,t){return!t||"object"!==Ei(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Ri(e){return(Ri=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Ni=wp.i18n.__,Fi=wp.element.Component,Wi=(wp.blockEditor||wp.editor).ColorPalette,Ii=wp.components,Bi=Ii.BaseControl,Ji=Ii.PanelBody,Ui=Ii.SelectControl,Vi=Ii.TextControl,qi=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Hi(e,t)}(i,e);var t,n,r,a=zi(i);function i(){return Ci(this,i),a.apply(this,arguments)}return t=i,(n=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(Ji,{title:Ni("Candles Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(Ji,{title:Ni("General Settings"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Ui,{label:Ni("Focus Target"),help:Ni("The type of the entity that receives focus on mouse hover. Also affects which entity is selected by mouse click."),value:t.focusTarget?t.focusTarget:"datum",options:[{label:Ni("Focus on a single data point."),value:"datum"},{label:Ni("Focus on a grouping of all data points along the major axis."),value:"category"}],onChange:function(n){t.focusTarget=n,e.props.edit(t)}}),wp.element.createElement(Ui,{label:Ni("Selection Mode"),help:Ni("Determines how many data points an user can select on a chart."),value:t.selectionMode?t.selectionMode:"single",options:[{label:Ni("Single data point"),value:"single"},{label:Ni("Multiple data points"),value:"multiple"}],onChange:function(n){t.selectionMode=n,e.props.edit(t)}}),wp.element.createElement(Ui,{label:Ni("Aggregation Target"),help:Ni("Determines how multiple data selections are rolled up into tooltips. To make it working you need to set multiple selection mode and tooltip trigger to display it when an user selects an element."),value:t.aggregationTarget?t.aggregationTarget:"auto",options:[{label:Ni("Group selected data by x-value"),value:"category"},{label:Ni("Group selected data by series"),value:"series"},{label:Ni("Group selected data by x-value if all selections have the same x-value, and by series otherwise"),value:"auto"},{label:Ni("Show only one tooltip per selection"),value:"none"}],onChange:function(n){t.aggregationTarget=n,e.props.edit(t)}})),wp.element.createElement(Ji,{title:Ni("Failing Candles"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Vi,{label:Ni("Stroke Width"),help:Ni("The stroke width of falling candles."),value:t.candlestick.fallingColor.strokeWidth,onChange:function(n){t.candlestick.fallingColor.strokeWidth=n,e.props.edit(t)}}),wp.element.createElement(Bi,{label:Ni("Stroke Color")},wp.element.createElement(Wi,{value:t.candlestick.fallingColor.stroke,onChange:function(n){t.candlestick.fallingColor.stroke=n,e.props.edit(t)}})),wp.element.createElement(Bi,{label:Ni("Fill Color")},wp.element.createElement(Wi,{value:t.candlestick.fallingColor.fill,onChange:function(n){t.candlestick.fallingColor.fill=n,e.props.edit(t)}}))),wp.element.createElement(Ji,{title:Ni("Rising Candles"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Vi,{label:Ni("Stroke Width"),help:Ni("The stroke width of rising candles."),value:t.candlestick.risingColor.strokeWidth,onChange:function(n){t.candlestick.risingColor.strokeWidth=n,e.props.edit(t)}}),wp.element.createElement(Bi,{label:Ni("Stroke Color")},wp.element.createElement(Wi,{value:t.candlestick.risingColor.stroke,onChange:function(n){t.candlestick.risingColor.stroke=n,e.props.edit(t)}})),wp.element.createElement(Bi,{label:Ni("Fill Color")},wp.element.createElement(Wi,{value:t.candlestick.risingColor.fill,onChange:function(n){t.candlestick.risingColor.fill=n,e.props.edit(t)}}))))}}])&&Pi(t.prototype,n),r&&Pi(t,r),i}(Fi);function Gi(e){return(Gi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function $i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ki(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Zi(e,t){return(Zi=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Qi(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=eo(e);if(t){var a=eo(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Xi(this,n)}}function Xi(e,t){return!t||"object"!==Gi(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function eo(e){return(eo=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var to=wp.i18n.__,no=wp.element.Component,ro=wp.components,ao=ro.ExternalLink,io=ro.PanelBody,oo=ro.SelectControl,so=ro.TextControl,lo=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Zi(e,t)}(i,e);var t,n,r,a=Qi(i);function i(){return $i(this,i),a.apply(this,arguments)}return t=i,(n=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(io,{title:to("Map Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(io,{title:to("API"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(so,{label:to("API Key"),help:to("Add the Google Maps API key."),value:t.map_api_key,onChange:function(n){t.map_api_key=n,e.props.edit(t)}}),wp.element.createElement(ao,{href:"https://developers.google.com/maps/documentation/javascript/get-api-key"},to("Get API Keys"))),wp.element.createElement(io,{title:to("Region"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement("ul",{className:"visualizer-list"},wp.element.createElement("li",null,to("A map of the entire world using 'world'.")),wp.element.createElement("li",null,to("A continent or a sub-continent, specified by its 3-digit code, e.g., '011' for Western Africa. "),wp.element.createElement(ao,{href:"https://google-developers.appspot.com/chart/interactive/docs/gallery/geochart#Continent_Hierarchy"},to("More info here."))),wp.element.createElement("li",null,to("A country, specified by its ISO 3166-1 alpha-2 code, e.g., 'AU' for Australia. "),wp.element.createElement(ao,{href:"http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2"},to("More info here."))),wp.element.createElement("li",null,to("A state in the United States, specified by its ISO 3166-2:US code, e.g., 'US-AL' for Alabama. Note that the resolution option must be set to either 'provinces' or 'metros'. "),wp.element.createElement(ao,{href:"http://en.wikipedia.org/wiki/ISO_3166-2:US"},to("More info here.")))),wp.element.createElement(so,{label:to("Reigion"),help:to("Configure the region area to display on the map. (Surrounding areas will be displayed as well.)"),value:t.region,onChange:function(n){t.region=n,e.props.edit(t)}})),wp.element.createElement(io,{title:to("Resolution"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement("ul",{className:"visualizer-list"},wp.element.createElement("li",null,to("'countries' - Supported for all regions, except for US state regions.")),wp.element.createElement("li",null,to("'provinces' - Supported only for country regions and US state regions. Not supported for all countries; please test a country to see whether this option is supported.")),wp.element.createElement("li",null,to("'metros' - Supported for the US country region and US state regions only."))),wp.element.createElement(oo,{label:to("Resolution"),help:to("The resolution of the map borders."),value:t.resolution?t.resolution:"countries",options:[{label:to("Countries"),value:"countries"},{label:to("Provinces"),value:"provinces"},{label:to("Metros"),value:"metros"}],onChange:function(n){t.resolution=n,e.props.edit(t)}})),wp.element.createElement(io,{title:to("Display Mode"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement("ul",{className:"visualizer-list"},wp.element.createElement("li",null,to("'auto' - Choose based on the format of the data.")),wp.element.createElement("li",null,to("'regions' - This is a region map.")),wp.element.createElement("li",null,to("'markers' - This is a marker map."))),wp.element.createElement(oo,{label:to("Display Mode"),help:to("Determines which type of map this is."),value:t.displayMode?t.displayMode:"auto",options:[{label:to("Auto"),value:"auto"},{label:to("Regions"),value:"regions"},{label:to("Markers"),value:"markers"}],onChange:function(n){t.displayMode=n,e.props.edit(t)}})),wp.element.createElement(io,{title:to("Tooltip"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(oo,{label:to("Trigger"),help:to("Determines the user interaction that causes the tooltip to be displayed."),value:t.tooltip.trigger?t.tooltip.trigger:"focus",options:[{label:to("The tooltip will be displayed when the user hovers over an element"),value:"focus"},{label:to("The tooltip will not be displayed"),value:"none"}],onChange:function(n){t.tooltip.trigger=n,e.props.edit(t)}})))}}])&&Ki(t.prototype,n),r&&Ki(t,r),i}(no);function uo(e){return(uo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function co(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function mo(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function po(e,t){return(po=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ho(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=_o(e);if(t){var a=_o(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return fo(this,n)}}function fo(e,t){return!t||"object"!==uo(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function _o(e){return(_o=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var yo=wp.i18n.__,bo=wp.element.Component,go=(wp.blockEditor||wp.editor).ColorPalette,vo=wp.components,wo=vo.BaseControl,Mo=vo.PanelBody,ko=vo.TextControl,Lo=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&po(e,t)}(i,e);var t,n,r,a=ho(i);function i(){return co(this,i),a.apply(this,arguments)}return t=i,(n=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(Mo,{title:yo("Color Axis"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(ko,{label:yo("Minimum Values"),help:yo("Determines the minimum values of color axis."),value:t.colorAxis.minValue,onChange:function(n){t.colorAxis.minValue=n,e.props.edit(t)}}),wp.element.createElement(ko,{label:yo("Maximum Values"),help:yo("Determines the maximum values of color axis."),value:t.colorAxis.maxValue,onChange:function(n){t.colorAxis.maxValue=n,e.props.edit(t)}}),wp.element.createElement(wo,{label:yo("Minimum Value")},wp.element.createElement(go,{value:t.colorAxis.colors[0],onChange:function(n){t.colorAxis.colors[0]=n,e.props.edit(t)}})),wp.element.createElement(wo,{label:yo("Intermediate Value")},wp.element.createElement(go,{value:t.colorAxis.colors[1],onChange:function(n){t.colorAxis.colors[1]=n,e.props.edit(t)}})),wp.element.createElement(wo,{label:yo("Maximum Value")},wp.element.createElement(go,{value:t.colorAxis.colors[2],onChange:function(n){t.colorAxis.colors[2]=n,e.props.edit(t)}})),wp.element.createElement(wo,{label:yo("Dateless Region")},wp.element.createElement(go,{value:t.datalessRegionColor,onChange:function(n){t.datalessRegionColor=n,e.props.edit(t)}})))}}])&&mo(t.prototype,n),r&&mo(t,r),i}(bo);function Yo(e){return(Yo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Do(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function To(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function So(e,t){return(So=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Oo(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=jo(e);if(t){var a=jo(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return xo(this,n)}}function xo(e,t){return!t||"object"!==Yo(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function jo(e){return(jo=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Eo=wp.i18n.__,Co=wp.element,Po=Co.Component,Ho=Co.Fragment,zo=wp.components,Ao=zo.ExternalLink,Ro=zo.PanelBody,No=zo.TextControl,Fo=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&So(e,t)}(i,e);var t,n,r,a=Oo(i);function i(){return Do(this,i),a.apply(this,arguments)}return t=i,(n=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(Ro,{title:Eo("Size Axis"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(No,{label:Eo("Minimum Values"),help:Eo("Determines the minimum values of size axis."),value:t.sizeAxis.minValue,onChange:function(n){t.sizeAxis.minValue=n,e.props.edit(t)}}),wp.element.createElement(No,{label:Eo("Maximum Values"),help:Eo("Determines the maximum values of size axis."),value:t.sizeAxis.maxValue,onChange:function(n){t.sizeAxis.maxValue=n,e.props.edit(t)}}),wp.element.createElement(No,{label:Eo("Minimum Marker Radius"),help:Eo("Determines the radius of the smallest possible bubbles, in pixels."),value:t.sizeAxis.minSize,onChange:function(n){t.sizeAxis.minSize=n,e.props.edit(t)}}),wp.element.createElement(No,{label:Eo("Maximum Marker Radius"),help:Eo("Determines the radius of the largest possible bubbles, in pixels."),value:t.sizeAxis.maxSize,onChange:function(n){t.sizeAxis.maxSize=n,e.props.edit(t)}}),wp.element.createElement(No,{label:Eo("Marker Opacity"),help:Eo("The opacity of the markers, where 0.0 is fully transparent and 1.0 is fully opaque."),value:t.markerOpacity,onChange:function(n){t.markerOpacity=n,e.props.edit(t)}}),wp.element.createElement(Ho,null,wp.element.createElement(No,{label:Eo("Number Format"),help:Eo("Enter custom format pattern to apply to this series value."),value:t.series[0].format,onChange:function(n){t.series[0].format=n,e.props.edit(t)}}),wp.element.createElement("p",null,Eo("For number axis labels, this is a subset of the formatting "),wp.element.createElement(Ao,{href:"http://icu-project.org/apiref/icu4c/classDecimalFormat.html#_details"},Eo("ICU pattern set.")),Eo(" For instance, $#,###.## will display values $1,234.56 for value 1234.56. Pay attention that if you use #%% percentage format then your values will be multiplied by 100."))))}}])&&To(t.prototype,n),r&&To(t,r),i}(Po);function Wo(e){return(Wo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Io(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Bo(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Jo(e,t){return(Jo=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Uo(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=qo(e);if(t){var a=qo(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Vo(this,n)}}function Vo(e,t){return!t||"object"!==Wo(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function qo(e){return(qo=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Go=wp.i18n.__,$o=wp.element.Component,Ko=wp.components,Zo=Ko.PanelBody,Qo=Ko.SelectControl,Xo=Ko.TextControl,es=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Jo(e,t)}(i,e);var t,n,r,a=Uo(i);function i(){return Io(this,i),a.apply(this,arguments)}return t=i,(n=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(Zo,{title:Go("Magnifying Glass"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(Qo,{label:Go("Enabled"),help:Go("If yes, when the user lingers over a cluttered marker, a magnifiying glass will be opened."),value:t.magnifyingGlass.enable?t.magnifyingGlass.enable:"1",options:[{label:Go("Yes"),value:"1"},{label:Go("No"),value:"0"}],onChange:function(n){t.magnifyingGlass.enable=n,e.props.edit(t)}}),wp.element.createElement(Xo,{label:Go("Zoom Factor"),help:Go("The zoom factor of the magnifying glass. Can be any number greater than 0."),value:t.magnifyingGlass.zoomFactor,onChange:function(n){t.magnifyingGlass.zoomFactor=n,e.props.edit(t)}}))}}])&&Bo(t.prototype,n),r&&Bo(t,r),i}($o);function ts(e){return(ts="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ns(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function rs(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function as(e,t){return(as=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function is(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=ss(e);if(t){var a=ss(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return os(this,n)}}function os(e,t){return!t||"object"!==ts(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function ss(e){return(ss=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var ls=wp.i18n.__,us=wp.element,cs=us.Component,ds=us.Fragment,ms=(wp.blockEditor||wp.editor).ColorPalette,ps=wp.components,hs=ps.BaseControl,fs=ps.ExternalLink,_s=ps.PanelBody,ys=ps.TextControl,bs=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&as(e,t)}(i,e);var t,n,r,a=is(i);function i(){return ns(this,i),a.apply(this,arguments)}return t=i,(n=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(_s,{title:ls("Gauge Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(_s,{title:ls("Tick Settings"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(ys,{label:ls("Minimum Values"),help:ls("Determines the minimum values of gauge."),value:t.min,onChange:function(n){t.min=n,e.props.edit(t)}}),wp.element.createElement(ys,{label:ls("Maximum Values"),help:ls("Determines the maximum values of gauge."),value:t.max,onChange:function(n){t.max=n,e.props.edit(t)}}),wp.element.createElement(ys,{label:ls("Minor Ticks"),help:ls("The number of minor tick section in each major tick section."),value:t.minorTicks,onChange:function(n){t.minorTicks=n,e.props.edit(t)}}),wp.element.createElement(ds,null,wp.element.createElement(ys,{label:ls("Number Format"),help:ls("Enter custom format pattern to apply to this series value."),value:t.series[0].format,onChange:function(n){t.series[0].format=n,e.props.edit(t)}}),wp.element.createElement("p",null,ls("For number axis labels, this is a subset of the formatting "),wp.element.createElement(fs,{href:"http://icu-project.org/apiref/icu4c/classDecimalFormat.html#_details"},ls("ICU pattern set.")),ls(" For instance, $#,###.## will display values $1,234.56 for value 1234.56. Pay attention that if you use #%% percentage format then your values will be multiplied by 100.")))),wp.element.createElement(_s,{title:ls("Green Color"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(ys,{label:ls("Minimum Range"),help:ls("The lowest values for a range marked by a green color."),value:t.greenFrom,onChange:function(n){t.greenFrom=n,e.props.edit(t)}}),wp.element.createElement(ys,{label:ls("Maximum Range"),help:ls("The highest values for a range marked by a green color."),value:t.greenTo,onChange:function(n){t.greenTo=n,e.props.edit(t)}}),wp.element.createElement(hs,{label:ls("Green Color")},wp.element.createElement(ms,{value:t.greenColor,onChange:function(n){t.greenColor=n,e.props.edit(t)}}))),wp.element.createElement(_s,{title:ls("Yellow Color"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(ys,{label:ls("Minimum Range"),help:ls("The lowest values for a range marked by a yellow color."),value:t.yellowFrom,onChange:function(n){t.yellowFrom=n,e.props.edit(t)}}),wp.element.createElement(ys,{label:ls("Maximum Range"),help:ls("The highest values for a range marked by a yellow color."),value:t.yellowTo,onChange:function(n){t.yellowTo=n,e.props.edit(t)}}),wp.element.createElement(hs,{label:ls("Yellow Color")},wp.element.createElement(ms,{value:t.yellowColor,onChange:function(n){t.yellowColor=n,e.props.edit(t)}}))),wp.element.createElement(_s,{title:ls("Red Color"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(ys,{label:ls("Minimum Range"),help:ls("The lowest values for a range marked by a red color."),value:t.redFrom,onChange:function(n){t.redFrom=n,e.props.edit(t)}}),wp.element.createElement(ys,{label:ls("Maximum Range"),help:ls("The highest values for a range marked by a red color."),value:t.redTo,onChange:function(n){t.redTo=n,e.props.edit(t)}}),wp.element.createElement(hs,{label:ls("Red Color")},wp.element.createElement(ms,{value:t.redColor,onChange:function(n){t.redColor=n,e.props.edit(t)}}))))}}])&&rs(t.prototype,n),r&&rs(t,r),i}(cs);function gs(e){return(gs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function vs(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ws(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Ms(e,t){return(Ms=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ks(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Ds(e);if(t){var a=Ds(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Ls(this,n)}}function Ls(e,t){return!t||"object"!==gs(t)&&"function"!=typeof t?Ys(e):t}function Ys(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ds(e){return(Ds=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Ts=wp.i18n.__,Ss=wp.element.Component,Os=(wp.blockEditor||wp.editor).ColorPalette,xs=wp.components,js=xs.BaseControl,Es=xs.CheckboxControl,Cs=xs.PanelBody,Ps=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ms(e,t)}(i,e);var t,n,r,a=ks(i);function i(){var e;return vs(this,i),(e=a.apply(this,arguments)).mapValues=e.mapValues.bind(Ys(e)),e}return t=i,(n=[{key:"mapValues",value:function(e,t){return void 0===e.timeline?e[t]:e.timeline[t]}},{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return this.mapValues(t,"showRowLabels"),wp.element.createElement(Cs,{title:Ts("Timeline Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(Es,{label:Ts("Show Row Label"),help:Ts("If checked, shows the category/row label."),checked:Number(this.mapValues(t,"showRowLabels")),onChange:function(n){void 0===t.timeline&&(t.timeline={}),t.timeline.showRowLabels=!Number(e.mapValues(t,"showRowLabels")),e.props.edit(t)}}),wp.element.createElement(Es,{label:Ts("Group by Row Label"),help:Ts("If checked, groups the bars on the basis of the category/row label."),checked:Number(this.mapValues(t,"groupByRowLabel")),onChange:function(n){void 0===t.timeline&&(t.timeline={}),t.timeline.groupByRowLabel=!Number(e.mapValues(t,"groupByRowLabel")),e.props.edit(t)}}),wp.element.createElement(Es,{label:Ts("Color by Row Label"),help:Ts("If checked, colors every bar on the row the same."),checked:Number(this.mapValues(t,"colorByRowLabel")),onChange:function(n){void 0===t.timeline&&(t.timeline={}),t.timeline.colorByRowLabel=!Number(e.mapValues(t,"colorByRowLabel")),e.props.edit(t)}}),wp.element.createElement(js,{label:Ts("Single Color")},wp.element.createElement(Os,{value:this.mapValues(t,"singleColor"),onChange:function(n){void 0===t.timeline&&(t.timeline={}),t.timeline.singleColor=n,e.props.edit(t)}})))}}])&&ws(t.prototype,n),r&&ws(t,r),i}(Ss);function Hs(e){return(Hs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function zs(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function As(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Rs(e,t){return(Rs=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Ns(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Ws(e);if(t){var a=Ws(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Fs(this,n)}}function Fs(e,t){return!t||"object"!==Hs(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Ws(e){return(Ws=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Is=wp.i18n.__,Bs=wp.element,Js=Bs.Component,Us=Bs.Fragment,Vs=wp.components,qs=Vs.CheckboxControl,Gs=Vs.PanelBody,$s=Vs.SelectControl,Ks=Vs.TextControl,Zs=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Rs(e,t)}(i,e);var t,n,r,a=Ns(i);function i(){return zs(this,i),a.apply(this,arguments)}return t=i,(n=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"],n=(this.props.chart["visualizer-chart-type"],this.props.chart["visualizer-chart-library"]);return wp.element.createElement(Gs,{title:Is("Table Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},"DataTable"===n?wp.element.createElement(Us,null,wp.element.createElement(qs,{label:Is("Enable Pagination"),help:Is("To enable paging through the data."),checked:"true"===t.paging_bool,onChange:function(n){t.paging_bool="true",n||(t.paging_bool="false"),e.props.edit(t)}}),wp.element.createElement(Ks,{label:Is("Number of rows per page"),help:Is("The number of rows in each page, when paging is enabled."),type:"number",value:t.pageLength_int,placeholder:10,onChange:function(n){t.pageLength_int=n,e.props.edit(t)}}),wp.element.createElement($s,{label:Is("Pagination type"),help:Is("Determines what type of pagination options to show."),value:t.pagingType,options:[{label:Is("Page number buttons only"),value:"numbers"},{label:Is("'Previous' and 'Next' buttons only"),value:"simple"},{label:Is("'Previous' and 'Next' buttons, plus page numbers"),value:"simple_numbers"},{label:Is("'First', 'Previous', 'Next' and 'Last' buttons"),value:"full"},{label:Is("'First', 'Previous', 'Next' and 'Last' buttons, plus page numbers"),value:"full_numbers"},{label:Is("'First' and 'Last' buttons, plus page numbers"),value:"first_last_numbers"}],onChange:function(n){t.pagingType=n,e.props.edit(t)}}),wp.element.createElement(qs,{label:Is("Scroll Collapse"),help:Is("Allow the table to reduce in height when a limited number of rows are shown."),checked:"true"===t.scrollCollapse_bool,onChange:function(n){t.scrollCollapse_bool="true",n||(t.scrollCollapse_bool="false"),e.props.edit(t)}}),"true"===t.scrollCollapse_bool&&wp.element.createElement(Ks,{label:Is("Vertical Height"),help:Is("Vertical scrolling will constrain the table to the given height."),type:"number",value:t.scrollY_int,placeholder:300,onChange:function(n){t.scrollY_int=n,e.props.edit(t)}}),wp.element.createElement(qs,{label:Is("Disable Sort"),help:Is("To disable sorting on columns."),checked:"false"===t.ordering_bool,onChange:function(n){t.ordering_bool="true",n&&(t.ordering_bool="false"),e.props.edit(t)}}),wp.element.createElement(qs,{label:Is("Freeze Header/Footer"),help:Is("Freeze the header and footer."),checked:"true"===t.fixedHeader_bool,onChange:function(n){t.fixedHeader_bool="true",n||(t.fixedHeader_bool="false"),e.props.edit(t)}}),wp.element.createElement(qs,{label:Is("Responsive"),help:Is("Enable the table to be responsive."),checked:"true"===t.responsive_bool,onChange:function(n){t.responsive_bool="true",n||(t.responsive_bool="false"),e.props.edit(t)}})):wp.element.createElement(Us,null,wp.element.createElement($s,{label:Is("Enable Pagination"),help:Is("To enable paging through the data."),value:t.page?t.page:"disable",options:[{label:Is("Enable"),value:"enable"},{label:Is("Disable"),value:"disable"}],onChange:function(n){t.page=n,e.props.edit(t)}}),wp.element.createElement(Ks,{label:Is("Number of rows per page"),help:Is("The number of rows in each page, when paging is enabled."),type:"number",value:t.pageSize,onChange:function(n){t.pageSize=n,e.props.edit(t)}}),wp.element.createElement($s,{label:Is("Disable Sort"),help:Is("To disable sorting on columns."),value:t.sort?t.sort:"enable",options:[{label:Is("Enable"),value:"enable"},{label:Is("Disable"),value:"disable"}],onChange:function(n){t.sort=n,e.props.edit(t)}}),wp.element.createElement(Ks,{label:Is("Freeze Columns"),help:Is("The number of columns from the left that will be frozen."),type:"number",value:t.frozenColumns,onChange:function(n){t.frozenColumns=n,e.props.edit(t)}}),wp.element.createElement(qs,{label:Is("Allow HTML"),help:Is("If enabled, formatted values of cells that include HTML tags will be rendered as HTML."),checked:Number(t.allowHtml),onChange:function(n){t.allowHtml=!Number(t.allowHtml),e.props.edit(t)}}),wp.element.createElement(qs,{label:Is("Right to Left table"),help:Is("Adds basic support for right-to-left languages."),checked:Number(t.rtlTable),onChange:function(n){t.rtlTable=!Number(t.rtlTable),e.props.edit(t)}})))}}])&&As(t.prototype,n),r&&As(t,r),i}(Js);function Qs(e){return(Qs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Xs(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function el(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function tl(e,t){return(tl=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function nl(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=al(e);if(t){var a=al(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return rl(this,n)}}function rl(e,t){return!t||"object"!==Qs(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function al(e){return(al=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var il=wp.i18n.__,ol=wp.element,sl=ol.Component,ll=ol.Fragment,ul=(wp.blockEditor||wp.editor).ColorPalette,cl=wp.components,dl=cl.BaseControl,ml=cl.PanelBody,pl=cl.TextControl,hl=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&tl(e,t)}(i,e);var t,n,r,a=nl(i);function i(){return Xs(this,i),a.apply(this,arguments)}return t=i,(n=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"],n=(this.props.chart["visualizer-chart-type"],this.props.chart["visualizer-chart-library"]);return wp.element.createElement(ml,{title:il("Row/Cell Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},"DataTable"===n?wp.element.createElement(ll,null,wp.element.createElement(ml,{title:il("Odd Table Row"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(dl,{label:il("Background Color")},wp.element.createElement(ul,{value:t.customcss.oddTableRow["background-color"],onChange:function(n){t.customcss.oddTableRow["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(dl,{label:il("Color")},wp.element.createElement(ul,{value:t.customcss.oddTableRow.color,onChange:function(n){t.customcss.oddTableRow.color=n,e.props.edit(t)}})),wp.element.createElement(pl,{label:il("Text Orientation"),help:il("In degrees."),type:"number",value:t.customcss.oddTableRow.transform,onChange:function(n){t.customcss.oddTableRow.transform=n,e.props.edit(t)}})),wp.element.createElement(ml,{title:il("Even Table Row"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(dl,{label:il("Background Color")},wp.element.createElement(ul,{value:t.customcss.evenTableRow["background-color"],onChange:function(n){t.customcss.evenTableRow["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(dl,{label:il("Color")},wp.element.createElement(ul,{value:t.customcss.evenTableRow.color,onChange:function(n){t.customcss.evenTableRow.color=n,e.props.edit(t)}})),wp.element.createElement(pl,{label:il("Text Orientation"),help:il("In degrees."),type:"number",value:t.customcss.evenTableRow.transform,onChange:function(n){t.customcss.evenTableRow.transform=n,e.props.edit(t)}})),wp.element.createElement(ml,{title:il("Table Cell"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(dl,{label:il("Background Color")},wp.element.createElement(ul,{value:t.customcss.tableCell["background-color"],onChange:function(n){t.customcss.tableCell["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(dl,{label:il("Color")},wp.element.createElement(ul,{value:t.customcss.tableCell.color,onChange:function(n){t.customcss.tableCell.color=n,e.props.edit(t)}})),wp.element.createElement(pl,{label:il("Text Orientation"),help:il("In degrees."),type:"number",value:t.customcss.tableCell.transform,onChange:function(n){t.customcss.tableCell.transform=n,e.props.edit(t)}}))):wp.element.createElement(ll,null,wp.element.createElement(ml,{title:il("Header Row"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(dl,{label:il("Background Color")},wp.element.createElement(ul,{value:t.customcss.headerRow["background-color"],onChange:function(n){t.customcss.headerRow["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(dl,{label:il("Color")},wp.element.createElement(ul,{value:t.customcss.headerRow.color,onChange:function(n){t.customcss.headerRow.color=n,e.props.edit(t)}})),wp.element.createElement(pl,{label:il("Text Orientation"),help:il("In degrees."),type:"number",value:t.customcss.headerRow.transform,onChange:function(n){t.customcss.headerRow.transform=n,e.props.edit(t)}})),wp.element.createElement(ml,{title:il("Table Row"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(dl,{label:il("Background Color")},wp.element.createElement(ul,{value:t.customcss.tableRow["background-color"],onChange:function(n){t.customcss.tableRow["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(dl,{label:il("Color")},wp.element.createElement(ul,{value:t.customcss.tableRow.color,onChange:function(n){t.customcss.tableRow.color=n,e.props.edit(t)}})),wp.element.createElement(pl,{label:il("Text Orientation"),help:il("In degrees."),type:"number",value:t.customcss.tableRow.transform,onChange:function(n){t.customcss.tableRow.transform=n,e.props.edit(t)}})),wp.element.createElement(ml,{title:il("Odd Table Row"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(dl,{label:il("Background Color")},wp.element.createElement(ul,{value:t.customcss.oddTableRow["background-color"],onChange:function(n){t.customcss.oddTableRow["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(dl,{label:il("Color")},wp.element.createElement(ul,{value:t.customcss.oddTableRow.color,onChange:function(n){t.customcss.oddTableRow.color=n,e.props.edit(t)}})),wp.element.createElement(pl,{label:il("Text Orientation"),help:il("In degrees."),type:"number",value:t.customcss.oddTableRow.transform,onChange:function(n){t.customcss.oddTableRow.transform=n,e.props.edit(t)}})),wp.element.createElement(ml,{title:il("Selected Table Row"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(dl,{label:il("Background Color")},wp.element.createElement(ul,{value:t.customcss.selectedTableRow["background-color"],onChange:function(n){t.customcss.selectedTableRow["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(dl,{label:il("Color")},wp.element.createElement(ul,{value:t.customcss.selectedTableRow.color,onChange:function(n){t.customcss.selectedTableRow.color=n,e.props.edit(t)}})),wp.element.createElement(pl,{label:il("Text Orientation"),help:il("In degrees."),type:"number",value:t.customcss.selectedTableRow.transform,onChange:function(n){t.customcss.selectedTableRow.transform=n,e.props.edit(t)}})),wp.element.createElement(ml,{title:il("Hover Table Row"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(dl,{label:il("Background Color")},wp.element.createElement(ul,{value:t.customcss.hoverTableRow["background-color"],onChange:function(n){t.customcss.hoverTableRow["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(dl,{label:il("Color")},wp.element.createElement(ul,{value:t.customcss.hoverTableRow.color,onChange:function(n){t.customcss.hoverTableRow.color=n,e.props.edit(t)}})),wp.element.createElement(pl,{label:il("Text Orientation"),help:il("In degrees."),type:"number",value:t.customcss.hoverTableRow.transform,onChange:function(n){t.customcss.hoverTableRow.transform=n,e.props.edit(t)}})),wp.element.createElement(ml,{title:il("Header Cell"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(dl,{label:il("Background Color")},wp.element.createElement(ul,{value:t.customcss.headerCell["background-color"],onChange:function(n){t.customcss.headerCell["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(dl,{label:il("Color")},wp.element.createElement(ul,{value:t.customcss.headerCell.color,onChange:function(n){t.customcss.headerCell.color=n,e.props.edit(t)}})),wp.element.createElement(pl,{label:il("Text Orientation"),help:il("In degrees."),type:"number",value:t.customcss.headerCell.transform,onChange:function(n){t.customcss.headerCell.transform=n,e.props.edit(t)}})),wp.element.createElement(ml,{title:il("Table Cell"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(dl,{label:il("Background Color")},wp.element.createElement(ul,{value:t.customcss.tableCell["background-color"],onChange:function(n){t.customcss.tableCell["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(dl,{label:il("Color")},wp.element.createElement(ul,{value:t.customcss.tableCell.color,onChange:function(n){t.customcss.tableCell.color=n,e.props.edit(t)}})),wp.element.createElement(pl,{label:il("Text Orientation"),help:il("In degrees."),type:"number",value:t.customcss.tableCell.transform,onChange:function(n){t.customcss.tableCell.transform=n,e.props.edit(t)}}))))}}])&&el(t.prototype,n),r&&el(t,r),i}(sl);function fl(e){return(fl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function yl(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function bl(e,t){return(bl=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function gl(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=wl(e);if(t){var a=wl(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return vl(this,n)}}function vl(e,t){return!t||"object"!==fl(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function wl(e){return(wl=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Ml=wp.i18n.__,kl=wp.element.Component,Ll=wp.components,Yl=Ll.PanelBody,Dl=Ll.SelectControl,Tl=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&bl(e,t)}(i,e);var t,n,r,a=gl(i);function i(){return _l(this,i),a.apply(this,arguments)}return t=i,(n=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(Yl,{title:Ml("Combo Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(Dl,{label:Ml("Chart Type"),help:Ml("Select the default chart type."),value:t.seriesType?t.seriesType:"area",options:[{label:Ml("Area"),value:"area"},{label:Ml("Bar"),value:"bars"},{label:Ml("Candlesticks"),value:"candlesticks"},{label:Ml("Line"),value:"line"},{label:Ml("Stepped Area"),value:"steppedArea"}],onChange:function(n){t.seriesType=n,e.props.edit(t)}}))}}])&&yl(t.prototype,n),r&&yl(t,r),i}(kl);function Sl(e){return(Sl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ol(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function xl(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function jl(e,t){return(jl=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function El(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Pl(e);if(t){var a=Pl(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Cl(this,n)}}function Cl(e,t){return!t||"object"!==Sl(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Pl(e){return(Pl=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Hl=wp.i18n.__,zl=wp.element,Al=zl.Component,Rl=zl.Fragment,Nl=(wp.blockEditor||wp.editor).ColorPalette,Fl=wp.components,Wl=Fl.BaseControl,Il=Fl.ExternalLink,Bl=Fl.PanelBody,Jl=Fl.SelectControl,Ul=Fl.TextControl,Vl=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&jl(e,t)}(i,e);var t,n,r,a=El(i);function i(){return Ol(this,i),a.apply(this,arguments)}return t=i,(n=[{key:"componentDidMount",value:function(){var e=this.props.chart["visualizer-settings"];Object.keys(e.series).map((function(t){void 0!==e.series[t]&&(e.series[t].temp=1)})),this.props.edit(e)}},{key:"render",value:function(){var e=this,t=(this.props.chart["visualizer-chart-type"],this.props.chart["visualizer-settings"]),n=this.props.chart["visualizer-series"];return wp.element.createElement(Bl,{title:Hl("Series Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},Object.keys(t.series).map((function(r,a){var i=parseInt(r),o=n[r].label||"",s=n[r].type||"";return"tabular"!==s&&(i=a),r++,wp.element.createElement(Bl,{title:o,className:"visualizer-inner-sections",initialOpen:!1},-1>=["tabular","pie"].indexOf(s)&&wp.element.createElement(Jl,{label:Hl("Visible In Legend"),help:Hl("Determines whether the series has to be presented in the legend or not."),value:t.series[a].visibleInLegend?t.series[a].visibleInLegend:"1",options:[{label:Hl("Yes"),value:"1"},{label:Hl("No"),value:"0"}],onChange:function(n){t.series[a].visibleInLegend=n,e.props.edit(t)}}),-1>=["tabular","candlestick","combo","column","bar"].indexOf(s)&&wp.element.createElement(Rl,null,wp.element.createElement(Ul,{label:Hl("Line Width"),help:Hl("Overrides the global line width value for this series."),value:t.series[a].lineWidth,onChange:function(n){t.series[a].lineWidth=n,e.props.edit(t)}}),wp.element.createElement(Ul,{label:Hl("Point Size"),help:Hl("Overrides the global point size value for this series."),value:t.series[a].pointSize,onChange:function(n){t.series[a].pointSize=n,e.props.edit(t)}})),-1>=["candlestick"].indexOf(s)&&s&&"number"===s?wp.element.createElement(Rl,null,wp.element.createElement(Ul,{label:Hl("Format"),help:Hl("Enter custom format pattern to apply to this series value."),value:t.series[i].format,onChange:function(n){t.series[i].format=n,e.props.edit(t)}}),wp.element.createElement("p",null,Hl("For number axis labels, this is a subset of the formatting "),wp.element.createElement(Il,{href:"http://icu-project.org/apiref/icu4c/classDecimalFormat.html#_details"},Hl("ICU pattern set.")),Hl(" For instance, $#,###.## will display values $1,234.56 for value 1234.56. Pay attention that if you use #%% percentage format then your values will be multiplied by 100."))):0<=["date","datetime","timeofday"].indexOf(s)&&wp.element.createElement(Rl,null,wp.element.createElement(Ul,{label:Hl("Date Format"),help:Hl("Enter custom format pattern to apply to this series value."),placeholder:"dd LLLL yyyy",value:t.series[i].format,onChange:function(n){t.series[i].format=n,e.props.edit(t)}}),wp.element.createElement("p",null,Hl("This is a subset of the date formatting "),wp.element.createElement(Il,{href:"http://userguide.icu-project.org/formatparse/datetime#TOC-Date-Time-Format-Syntax"},Hl("ICU date and time format.")))),0<=["scatter","line"].indexOf(s)&&wp.element.createElement(Jl,{label:Hl("Curve Type"),help:Hl("Determines whether the series has to be presented in the legend or not."),value:t.series[a].curveType?t.series[a].curveType:"none",options:[{label:Hl("Straight line without curve"),value:"none"},{label:Hl("The angles of the line will be smoothed"),value:"function"}],onChange:function(n){t.series[a].curveType=n,e.props.edit(t)}}),0<=["area"].indexOf(s)&&wp.element.createElement(Ul,{label:Hl("Area Opacity"),help:Hl("The opacity of the colored area, where 0.0 is fully transparent and 1.0 is fully opaque."),value:t.series[a].areaOpacity,onChange:function(n){t.series[a].areaOpacity=n,e.props.edit(t)}}),0<=["combo"].indexOf(s)&&wp.element.createElement(Jl,{label:Hl("Chart Type"),help:Hl("Select the type of chart to show for this series."),value:t.series[a].type?t.series[a].type:"area",options:[{label:Hl("Area"),value:"area"},{label:Hl("Bar"),value:"bars"},{label:Hl("Candlesticks"),value:"candlesticks"},{label:Hl("Line"),value:"line"},{label:Hl("Stepped Area"),value:"steppedArea"}],onChange:function(n){t.series[a].type=n,e.props.edit(t)}}),-1>=["tabular"].indexOf(s)&&wp.element.createElement(Wl,{label:Hl("Color")},wp.element.createElement(Nl,{value:t.series[a].color,onChange:function(n){t.series[a].color=n,e.props.edit(t)}})))})))}}])&&xl(t.prototype,n),r&&xl(t,r),i}(Al);function ql(e){return(ql="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Gl(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $l(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Kl(e,t){return(Kl=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Zl(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Xl(e);if(t){var a=Xl(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Ql(this,n)}}function Ql(e,t){return!t||"object"!==ql(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Xl(e){return(Xl=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var eu=wp.i18n.__,tu=wp.element.Component,nu=(wp.blockEditor||wp.editor).ColorPalette,ru=wp.components,au=ru.BaseControl,iu=ru.PanelBody,ou=ru.TextControl,su=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Kl(e,t)}(i,e);var t,n,r,a=Zl(i);function i(){return Gl(this,i),a.apply(this,arguments)}return t=i,(n=[{key:"componentDidMount",value:function(){var e=this.props.chart["visualizer-settings"];Object.keys(e.slices).map((function(t){void 0!==e.slices[t]&&(e.slices[t].temp=1)})),this.props.edit(e)}},{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"],n=this.props.chart["visualizer-data"];return wp.element.createElement(iu,{title:eu("Slices Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},Object.keys(t.slices).map((function(r){return wp.element.createElement(iu,{title:n[r][0],className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(ou,{label:eu("Slice Offset"),help:eu("How far to separate the slice from the rest of the pie, from 0.0 (not at all) to 1.0 (the pie's radius)."),value:t.slices[r].offset,onChange:function(n){t.slices[r].offset=n,e.props.edit(t)},type:"number",min:"0",step:"0.1"}),wp.element.createElement(au,{label:eu("Format")},wp.element.createElement(nu,{value:t.slices[r].color,onChange:function(n){t.slices[r].color=n,e.props.edit(t)}})))})))}}])&&$l(t.prototype,n),r&&$l(t,r),i}(tu);function lu(e){return(lu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function uu(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function cu(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function du(e,t){return(du=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function mu(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=hu(e);if(t){var a=hu(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return pu(this,n)}}function pu(e,t){return!t||"object"!==lu(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function hu(e){return(hu=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var fu=wp.i18n.__,_u=wp.element.Component,yu=(wp.blockEditor||wp.editor).ColorPalette,bu=wp.components,gu=bu.CheckboxControl,vu=bu.BaseControl,wu=bu.PanelBody,Mu=bu.TextControl,ku=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&du(e,t)}(i,e);var t,n,r,a=mu(i);function i(){return uu(this,i),a.apply(this,arguments)}return t=i,(n=[{key:"componentDidMount",value:function(){}},{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(wu,{title:fu("Bubble Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(Mu,{label:fu("Opacity"),help:fu("The default opacity of the bubbles, where 0.0 is fully transparent and 1.0 is fully opaque."),type:"number",min:"0",max:"1",step:"0.1",value:t.bubble.opacity,onChange:function(n){t.bubble||(t.bubble={}),t.bubble.opacity=n,e.props.edit(t)}}),wp.element.createElement(vu,{label:fu("Stroke Color")},wp.element.createElement(yu,{value:t.bubble.stroke,onChange:function(n){t.bubble||(t.bubble={}),t.bubble.stroke=n,e.props.edit(t)}})),wp.element.createElement(gu,{label:fu("Sort Bubbles by Size"),help:fu("If checked, sorts the bubbles by size so the smaller bubbles appear above the larger bubbles. If unchecked, bubbles are sorted according to their order in the table."),checked:Q(t,"sortBubblesBySize"),onChange:function(n){t.sortBubblesBySize=n,e.props.edit(t)}}),wp.element.createElement(Mu,{label:fu("Size (max)"),help:fu("The size value (as appears in the chart data) to be mapped to sizeAxis.maxSize. Larger values will be cropped to this value."),type:"number",step:"1",value:t.sizeAxis.maxValue,onChange:function(n){t.sizeAxis||(t.sizeAxis={}),t.sizeAxis.maxValue=n,e.props.edit(t)}}),wp.element.createElement(Mu,{label:fu("Size (min)"),help:fu("The size value (as appears in the chart data) to be mapped to sizeAxis.minSize. Smaller values will be cropped to this value."),type:"number",step:"1",value:t.sizeAxis.minValue,onChange:function(n){t.sizeAxis||(t.sizeAxis={}),t.sizeAxis.minValue=n,e.props.edit(t)}}))}}])&&cu(t.prototype,n),r&&cu(t,r),i}(_u);function Lu(e){return(Lu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Yu(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Du(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Tu(e,t){return(Tu=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Su(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=xu(e);if(t){var a=xu(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Ou(this,n)}}function Ou(e,t){return!t||"object"!==Lu(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function xu(e){return(xu=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var ju=wp.i18n.__,Eu=wp.element,Cu=Eu.Component,Pu=Eu.Fragment,Hu=wp.components,zu=Hu.ExternalLink,Au=Hu.PanelBody,Ru=Hu.TextControl,Nu=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Tu(e,t)}(i,e);var t,n,r,a=Su(i);function i(){return Yu(this,i),a.apply(this,arguments)}return t=i,(n=[{key:"componentDidMount",value:function(){var e=this.props.chart["visualizer-settings"];e.series&&(Object.keys(e.series).map((function(t){void 0!==e.series[t]&&(e.series[t].temp=1)})),this.props.edit(e))}},{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"],n=this.props.chart["visualizer-series"];return this.props.chart["visualizer-chart-type"],t.series?wp.element.createElement(Au,{title:ju("Column Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},Object.keys(t.series).map((function(r){return"string"===n[r].type?null:wp.element.createElement(Au,{title:n[r].label,className:"visualizer-inner-sections",initialOpen:!1},0<=["date","datetime","timeofday"].indexOf(n[r].type)&&wp.element.createElement(Pu,null,wp.element.createElement(Ru,{label:ju("Display Date Format"),help:ju("Enter custom format pattern to apply to this series value."),value:t.series[r].format?t.series[r].format.to:"",onChange:function(n){t.series[r].format||(t.series[r].format={}),t.series[r].format.to=n,e.props.edit(t)}}),wp.element.createElement(Ru,{label:ju("Source Date Format"),help:ju("What format is the source date in?"),value:t.series[r].format?t.series[r].format.from:"",onChange:function(n){t.series[r].format||(t.series[r].format={}),t.series[r].format.from=n,e.props.edit(t)}}),wp.element.createElement("p",null,ju("You can find more info on "),wp.element.createElement(zu,{href:"https://momentjs.com/docs/#/displaying/"},ju("date and time formats here.")))),"number"===n[r].type&&wp.element.createElement(Pu,null,wp.element.createElement(Ru,{label:ju("Thousands Separator"),value:t.series[r].format?t.series[r].format.thousands:"",onChange:function(n){t.series[r].format||(t.series[r].format={}),t.series[r].format.thousands=n,e.props.edit(t)}}),wp.element.createElement(Ru,{label:ju("Decimal Separator"),value:t.series[r].format?t.series[r].format.decimal:"",onChange:function(n){t.series[r].format||(t.series[r].format={}),t.series[r].format.decimal=n,e.props.edit(t)}}),wp.element.createElement(Ru,{label:ju("Precision"),help:ju("Round values to how many decimal places?"),value:t.series[r].format?t.series[r].format.precision:"",type:"number",min:"0",onChange:function(n){100<n||(t.series[r].format||(t.series[r].format={}),t.series[r].format.precision=n,e.props.edit(t))}}),wp.element.createElement(Ru,{label:ju("Prefix"),value:t.series[r].format?t.series[r].format.prefix:"",onChange:function(n){t.series[r].format||(t.series[r].format={}),t.series[r].format.prefix=n,e.props.edit(t)}}),wp.element.createElement(Ru,{label:ju("Suffix"),value:t.series[r].format?t.series[r].format.suffix:"",onChange:function(n){t.series[r].format||(t.series[r].format={}),t.series[r].format.suffix=n,e.props.edit(t)}})),"boolean"===n[r].type&&wp.element.createElement(Pu,null,wp.element.createElement(Ru,{label:ju("Truthy value"),help:ju("Provide the HTML entity code for the value the table should display when the value of the column is true. e.g. tick mark (Code: &#10004;) instead of true"),value:t.series[r].format?t.series[r].format.truthy:"",onChange:function(n){t.series[r].truthy||(t.series[r].truthy={}),t.series[r].format.truthy=n,e.props.edit(t)}}),wp.element.createElement(Ru,{label:ju("Falsy value"),help:ju("Provide the HTML entity code for the value the table should display when the value of the column is false. e.g. cross mark (Code: &#10006;) instead of false"),value:t.series[r].format?t.series[r].format.falsy:"",onChange:function(n){t.series[r].falsy||(t.series[r].falsy={}),t.series[r].format.falsy=n,e.props.edit(t)}})))}))):null}}])&&Du(t.prototype,n),r&&Du(t,r),i}(Cu);function Fu(e){return(Fu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Wu(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Iu(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Bu(e,t){return(Bu=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Ju(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Vu(e);if(t){var a=Vu(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Uu(this,n)}}function Uu(e,t){return!t||"object"!==Fu(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Vu(e){return(Vu=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var qu=wp.i18n.__,Gu=wp.element,$u=Gu.Component,Ku=Gu.Fragment,Zu=(wp.blockEditor||wp.editor).ColorPalette,Qu=wp.components,Xu=Qu.BaseControl,ec=Qu.CheckboxControl,tc=Qu.PanelBody,nc=Qu.SelectControl,rc=Qu.TextControl,ac=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Bu(e,t)}(i,e);var t,n,r,a=Ju(i);function i(){return Wu(this,i),a.apply(this,arguments)}return t=i,(n=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-chart-type"],n=this.props.chart["visualizer-settings"];return wp.element.createElement(tc,{title:qu("Layout And Chart Area"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(tc,{title:qu("Layout"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(rc,{label:qu("Width of Chart"),help:qu("Determines the total width of the chart."),value:n.width,onChange:function(t){n.width=t,e.props.edit(n)}}),wp.element.createElement(rc,{label:qu("Height of Chart"),help:qu("Determines the total height of the chart."),value:n.height,onChange:function(t){n.height=t,e.props.edit(n)}}),0<=["geo"].indexOf(t)&&wp.element.createElement(nc,{label:qu("Keep Aspect Ratio"),help:qu("If yes, the map will be drawn at the largest size that can fit inside the chart area at its natural aspect ratio. If only one of the width and height options is specified, the other one will be calculated according to the aspect ratio. If no, the map will be stretched to the exact size of the chart as specified by the width and height options."),value:n.keepAspectRatio?n.isStacked:"1",options:[{label:qu("Yes"),value:"1"},{label:qu("No"),value:"0"}],onChange:function(t){n.keepAspectRatio=t,e.props.edit(n)}}),-1>=["gauge","tabular"].indexOf(t)&&wp.element.createElement(Ku,null,wp.element.createElement(rc,{label:qu("Stroke Width"),help:qu("The chart border width in pixels."),value:n.backgroundColor.strokeWidth,onChange:function(t){n.backgroundColor.strokeWidth=t,e.props.edit(n)}}),wp.element.createElement(Xu,{label:qu("Stroke Color")},wp.element.createElement(Zu,{value:n.backgroundColor.stroke,onChange:function(t){n.backgroundColor.stroke=t,e.props.edit(n)}})),wp.element.createElement(Xu,{label:qu("Background Color")},wp.element.createElement(Zu,{value:n.backgroundColor.fill,onChange:function(t){n.backgroundColor.fill=t,e.props.edit(n)}})),wp.element.createElement(ec,{label:qu("Transparent Background?"),checked:"transparent"===n.backgroundColor.fill,onChange:function(t){n.backgroundColor.fill="transparent"===n.backgroundColor.fill?"":"transparent",e.props.edit(n)}}))),-1>=["geo","gauge","tabular"].indexOf(t)&&wp.element.createElement(tc,{title:qu("Chart Area"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(rc,{label:qu("Left Margin"),help:qu("Determines how far to draw the chart from the left border."),value:n.chartArea.left,onChange:function(t){n.chartArea.left=t,e.props.edit(n)}}),wp.element.createElement(rc,{label:qu("Top Margin"),help:qu("Determines how far to draw the chart from the top border."),value:n.chartArea.top,onChange:function(t){n.chartArea.top=t,e.props.edit(n)}}),wp.element.createElement(rc,{label:qu("Width Of Chart Area"),help:qu("Determines the width of the chart area."),value:n.chartArea.width,onChange:function(t){n.chartArea.width=t,e.props.edit(n)}}),wp.element.createElement(rc,{label:qu("Height Of Chart Area"),help:qu("Determines the hight of the chart area."),value:n.chartArea.height,onChange:function(t){n.chartArea.height=t,e.props.edit(n)}})))}}])&&Iu(t.prototype,n),r&&Iu(t,r),i}($u);function ic(e){return(ic="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function oc(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function sc(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function lc(e,t){return(lc=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function uc(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=dc(e);if(t){var a=dc(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return cc(this,n)}}function cc(e,t){return!t||"object"!==ic(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function dc(e){return(dc=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var mc=wp.i18n.__,pc=wp.element,hc=pc.Component,fc=pc.Fragment,_c=wp.components,yc=_c.CheckboxControl,bc=_c.PanelBody,gc=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&lc(e,t)}(i,e);var t,n,r,a=uc(i);function i(){return oc(this,i),a.apply(this,arguments)}return t=i,(n=[{key:"componentDidMount",value:function(){var e=this.props.chart["visualizer-settings"];void 0===e.actions&&(e.actions=[]),this.props.edit(e)}},{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"],n=this.props.chart["visualizer-chart-type"];return wp.element.createElement(bc,{title:mc("Frontend Actions"),initialOpen:!1,className:"visualizer-advanced-panel"},void 0!==t.actions&&wp.element.createElement(fc,null,wp.element.createElement(yc,{label:mc("Print"),help:mc("To enable printing the data."),checked:0<=t.actions.indexOf("print"),onChange:function(n){if(0<=t.actions.indexOf("print")){var r=t.actions.indexOf("print");-1!==r&&t.actions.splice(r,1)}else t.actions.push("print");e.props.edit(t)}}),wp.element.createElement(yc,{label:mc("CSV"),help:mc("To enable downloading the data as a CSV."),checked:0<=t.actions.indexOf("csv;application/csv"),onChange:function(n){if(0<=t.actions.indexOf("csv;application/csv")){var r=t.actions.indexOf("csv;application/csv");-1!==r&&t.actions.splice(r,1)}else t.actions.push("csv;application/csv");e.props.edit(t)}}),wp.element.createElement(yc,{label:mc("Excel"),help:mc("To enable downloading the data as an Excel spreadsheet."),checked:0<=t.actions.indexOf("xls;application/vnd.ms-excel"),onChange:function(n){if(0<=t.actions.indexOf("xls;application/vnd.ms-excel")){var r=t.actions.indexOf("xls;application/vnd.ms-excel");-1!==r&&t.actions.splice(r,1)}else t.actions.push("xls;application/vnd.ms-excel");e.props.edit(t)}}),wp.element.createElement(yc,{label:mc("Copy"),help:mc("To enable copying the data to the clipboard."),checked:0<=t.actions.indexOf("copy"),onChange:function(n){if(0<=t.actions.indexOf("copy")){var r=t.actions.indexOf("copy");-1!==r&&t.actions.splice(r,1)}else t.actions.push("copy");e.props.edit(t)}}),-1>=["dataTable","tabular","gauge","table"].indexOf(n)&&wp.element.createElement(yc,{label:mc("Download Image"),help:mc("To download the chart as an image."),checked:0<=t.actions.indexOf("image"),onChange:function(n){if(0<=t.actions.indexOf("image")){var r=t.actions.indexOf("image");-1!==r&&t.actions.splice(r,1)}else t.actions.push("image");e.props.edit(t)}})))}}])&&sc(t.prototype,n),r&&sc(t,r),i}(hc);function vc(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){vc(e,t,n[t])}))}return e}var Mc={dark_vscode_tribute:{default:"#D4D4D4",background:"#1E1E1E",background_warning:"#1E1E1E",string:"#CE8453",number:"#B5CE9F",colon:"#49B8F7",keys:"#9CDCFE",keys_whiteSpace:"#AF74A5",primitive:"#6392C6"},light_mitsuketa_tribute:{default:"#D4D4D4",background:"#FCFDFD",background_warning:"#FEECEB",string:"#FA7921",number:"#70CE35",colon:"#49B8F7",keys:"#59A5D8",keys_whiteSpace:"#835FB6",primitive:"#386FA4"}},kc=n(2);const Lc={getCaller:(e=1)=>{var t=(new Error).stack.replace(/^Error\s+/,"");return t=(t=t.split("\n")[e]).replace(/^\s+at Object./,"").replace(/^\s+at /,"").replace(/ \(.+\)$/,"")},throwError:(e="unknown function",t="unknown parameter",n="to be defined")=>{throw["@",e,"(): Expected parameter '",t,"' ",n].join("")},isUndefined:(e="<unknown parameter>",t)=>{[null,void 0].indexOf(t)>-1&&Lc.throwError(Lc.getCaller(2),e)},isFalsy:(e="<unknown parameter>",t)=>{t||Lc.throwError(Lc.getCaller(2),e)},isNoneOf:(e="<unknown parameter>",t,n=[])=>{-1===n.indexOf(t)&&Lc.throwError(Lc.getCaller(2),e,"to be any of"+JSON.stringify(n))},isAnyOf:(e="<unknown parameter>",t,n=[])=>{n.indexOf(t)>-1&&Lc.throwError(Lc.getCaller(2),e,"not to be any of"+JSON.stringify(n))},isNotType:(e="<unknown parameter>",t,n="")=>{Object(kc.getType)(t)!==n.toLowerCase()&&Lc.throwError(Lc.getCaller(2),e,"to be type "+n.toLowerCase())},isAnyTypeOf:(e="<unknown parameter>",t,n=[])=>{n.forEach(n=>{Object(kc.getType)(t)===n&&Lc.throwError(Lc.getCaller(2),e,"not to be type of "+n.toLowerCase())})},missingKey:(e="<unknown parameter>",t,n="")=>{Lc.isUndefined(e,t),-1===Object.keys(t).indexOf(n)&&Lc.throwError(Lc.getCaller(2),e,"to contain '"+n+"' key")},missingAnyKeys:(e="<unknown parameter>",t,n=[""])=>{Lc.isUndefined(e,t);const r=Object.keys(t);n.forEach(t=>{-1===r.indexOf(t)&&Lc.throwError(Lc.getCaller(2),e,"to contain '"+t+"' key")})},containsUndefined:(e="<unknown parameter>",t)=>{[void 0,null].forEach(n=>{const r=Object(kc.locate)(t,n);r&&Lc.throwError(Lc.getCaller(2),e,"not to contain '"+JSON.stringify(n)+"' at "+r)})},isInvalidPath:(e="<unknown parameter>",t)=>{Lc.isUndefined(e,t),Lc.isNotType(e,t,"string"),Lc.isAnyOf(e,t,["","/"]),".$[]#".split().forEach(n=>{t.indexOf(n)>-1&&Lc.throwError(Lc.getCaller(2),e,"not to contain invalid character '"+n+"'")}),t.match(/\/{2,}/g)&&Lc.throwError(Lc.getCaller(2),e,"not to contain consecutive forward slash characters")},isInvalidWriteData:(e="<unknown parameter>",t)=>{Lc.isUndefined(e,t),Lc.containsUndefined(e,t)}};var Yc=Lc;const Dc=(e,t)=>t?Object.keys(t).reduce((e,n)=>e.replace(new RegExp(`\\{${n}\\}`,"gi"),(e=>Array.isArray(e)?e.join(", "):"string"==typeof e?e:""+e)(t[n])),e):e;var Tc={format:"{reason} at line {line}",symbols:{colon:"colon",comma:"comma",semicolon:"semicolon",slash:"slash",backslash:"backslash",brackets:{round:"round brackets",square:"square brackets",curly:"curly brackets",angle:"angle brackets"},period:"period",quotes:{single:"single quote",double:"double quote",grave:"grave accent"},space:"space",ampersand:"ampersand",asterisk:"asterisk",at:"at sign",equals:"equals sign",hash:"hash",percent:"percent",plus:"plus",minus:"minus",dash:"dash",hyphen:"hyphen",tilde:"tilde",underscore:"underscore",bar:"vertical bar"},types:{key:"key",value:"value",number:"number",string:"string",primitive:"primitive",boolean:"boolean",character:"character",integer:"integer",array:"array",float:"float"},invalidToken:{tokenSequence:{prohibited:"'{firstToken}' token cannot be followed by '{secondToken}' token(s)",permitted:"'{firstToken}' token can only be followed by '{secondToken}' token(s)"},termSequence:{prohibited:"A {firstTerm} cannot be followed by a {secondTerm}",permitted:"A {firstTerm} can only be followed by a {secondTerm}"},double:"'{token}' token cannot be followed by another '{token}' token",useInstead:"'{badToken}' token is not accepted. Use '{goodToken}' instead",unexpected:"Unexpected '{token}' token found"},brace:{curly:{missingOpen:"Missing '{' open curly brace",missingClose:"Open '{' curly brace is missing closing '}' curly brace",cannotWrap:"'{token}' token cannot be wrapped in '{}' curly braces"},square:{missingOpen:"Missing '[' open square brace",missingClose:"Open '[' square brace is missing closing ']' square brace",cannotWrap:"'{token}' token cannot be wrapped in '[]' square braces"}},string:{missingOpen:"Missing/invalid opening string '{quote}' token",missingClose:"Missing/invalid closing string '{quote}' token",mustBeWrappedByQuotes:"Strings must be wrapped by quotes",nonAlphanumeric:"Non-alphanumeric token '{token}' is not allowed outside string notation",unexpectedKey:"Unexpected key found at string position"},key:{numberAndLetterMissingQuotes:"Key beginning with number and containing letters must be wrapped by quotes",spaceMissingQuotes:"Key containing space must be wrapped by quotes",unexpectedString:"Unexpected string found at key position"},noTrailingOrLeadingComma:"Trailing or leading commas in arrays and objects are not permitted"};
65
  /** @license react-json-editor-ajrm v2.5.13
66
  *
67
  * This source code is licensed under the MIT license found in the
classes/Visualizer/Gutenberg/src/Components/Sidebar/SeriesSettings.js CHANGED
@@ -61,6 +61,8 @@ class SeriesSettings extends Component {
61
  { Object.keys( settings.series )
62
  .map( ( i, index ) => {
63
  let indexToFormat = parseInt( i );
 
 
64
 
65
  if ( 'tabular' !== type ) {
66
  indexToFormat = index;
@@ -70,7 +72,7 @@ class SeriesSettings extends Component {
70
 
71
  return (
72
  <PanelBody
73
- title={ series[i].label }
74
  className="visualizer-inner-sections"
75
  initialOpen={ false }
76
  >
@@ -121,7 +123,7 @@ class SeriesSettings extends Component {
121
 
122
  { ( -1 >= [ 'candlestick' ].indexOf( type ) ) &&
123
 
124
- ( 'number' === series[i].type ) ? (
125
 
126
  <Fragment>
127
 
@@ -147,7 +149,7 @@ class SeriesSettings extends Component {
147
 
148
  ) :
149
 
150
- ( 0 <= [ 'date', 'datetime', 'timeofday' ].indexOf( series[i].type ) ) && (
151
 
152
  <Fragment>
153
 
61
  { Object.keys( settings.series )
62
  .map( ( i, index ) => {
63
  let indexToFormat = parseInt( i );
64
+ let label = series[i].label || '';
65
+ let type = series[i].type || '';
66
 
67
  if ( 'tabular' !== type ) {
68
  indexToFormat = index;
72
 
73
  return (
74
  <PanelBody
75
+ title={ label }
76
  className="visualizer-inner-sections"
77
  initialOpen={ false }
78
  >
123
 
124
  { ( -1 >= [ 'candlestick' ].indexOf( type ) ) &&
125
 
126
+ ( type && 'number' === type ) ? (
127
 
128
  <Fragment>
129
 
149
 
150
  ) :
151
 
152
+ ( 0 <= [ 'date', 'datetime', 'timeofday' ].indexOf( type ) ) && (
153
 
154
  <Fragment>
155
 
classes/Visualizer/Module.php CHANGED
@@ -740,7 +740,7 @@ class Visualizer_Module {
740
  */
741
  public static function get_chart_data( $chart, $type, $run_filter = true ) {
742
  // change HTML entities
743
- $data = unserialize( html_entity_decode( $chart->post_content ) );
744
  $altered = array();
745
  foreach ( $data as $index => $array ) {
746
  if ( ! is_array( $index ) && is_array( $array ) ) {
740
  */
741
  public static function get_chart_data( $chart, $type, $run_filter = true ) {
742
  // change HTML entities
743
+ $data = unserialize( html_entity_decode( htmlentities( $chart->post_content ) ) );
744
  $altered = array();
745
  foreach ( $data as $index => $array ) {
746
  if ( ! is_array( $index ) && is_array( $array ) ) {
classes/Visualizer/Module/Admin.php CHANGED
@@ -703,7 +703,7 @@ class Visualizer_Module_Admin extends Visualizer_Module {
703
  $args = array(
704
  'label' => __( 'Number of charts per page:', 'visualizer' ),
705
  'default' => 6,
706
- 'option' => 'visualizer_per_page_library',
707
  );
708
  add_screen_option( 'per_page', $args );
709
  }
@@ -712,7 +712,7 @@ class Visualizer_Module_Admin extends Visualizer_Module {
712
  * Returns the screen option for pagination.
713
  */
714
  function setScreenOptions( $status, $option, $value ) {
715
- if ( 'visualizer_per_page_library' === $option ) {
716
  return $value;
717
  }
718
  }
703
  $args = array(
704
  'label' => __( 'Number of charts per page:', 'visualizer' ),
705
  'default' => 6,
706
+ 'option' => 'visualizer_library_per_page',
707
  );
708
  add_screen_option( 'per_page', $args );
709
  }
712
  * Returns the screen option for pagination.
713
  */
714
  function setScreenOptions( $status, $option, $value ) {
715
+ if ( 'visualizer_library_per_page' === $option ) {
716
  return $value;
717
  }
718
  }
classes/Visualizer/Module/Chart.php CHANGED
@@ -527,8 +527,10 @@ class Visualizer_Module_Chart extends Visualizer_Module {
527
  defined( 'WP_TESTS_DOMAIN' ) ? wp_die() : exit();
528
  }
529
 
 
 
530
  if ( isset( $_POST['chart-img'] ) && ! empty( $_POST['chart-img'] ) ) {
531
- $attachment_id = $this->save_chart_image( $_POST['chart-img'], $chart_id );
532
  if ( $attachment_id ) {
533
  update_post_meta( $chart_id, Visualizer_Plugin::CF_CHART_IMAGE, $attachment_id );
534
  }
@@ -596,6 +598,14 @@ class Visualizer_Module_Chart extends Visualizer_Module {
596
  $this->_chart = $this->handleExistingRevisions( $chart_id, $this->_chart );
597
  }
598
 
 
 
 
 
 
 
 
 
599
  switch ( $tab ) {
600
  case 'settings':
601
  $this->_handleDataAndSettingsPage();
@@ -1334,7 +1344,7 @@ class Visualizer_Module_Chart extends Visualizer_Module {
1334
  $hours = filter_input(
1335
  INPUT_POST,
1336
  'refresh',
1337
- FILTER_VALIDATE_INT,
1338
  array(
1339
  'options' => array(
1340
  'min_range' => -1,
@@ -1343,7 +1353,7 @@ class Visualizer_Module_Chart extends Visualizer_Module {
1343
  )
1344
  );
1345
 
1346
- if ( ! is_int( $hours ) ) {
1347
  $hours = -1;
1348
  }
1349
 
@@ -1437,9 +1447,20 @@ class Visualizer_Module_Chart extends Visualizer_Module {
1437
  *
1438
  * @param string $base64_img Chart image.
1439
  * @param int $chart_id Chart ID.
 
1440
  * @return attachment ID
1441
  */
1442
- public function save_chart_image( $base64_img, $chart_id ) {
 
 
 
 
 
 
 
 
 
 
1443
  // Upload dir.
1444
  $upload_dir = wp_upload_dir();
1445
  $upload_path = str_replace( '/', DIRECTORY_SEPARATOR, $upload_dir['path'] ) . DIRECTORY_SEPARATOR;
@@ -1451,12 +1472,6 @@ class Visualizer_Module_Chart extends Visualizer_Module {
1451
  $file_type = 'image/png';
1452
  $hashed_filename = $filename;
1453
 
1454
- // Delete old chart image.
1455
- $old_attachment_id = get_post_meta( $chart_id, Visualizer_Plugin::CF_CHART_IMAGE, true );
1456
- if ( $old_attachment_id ) {
1457
- wp_delete_attachment( $old_attachment_id, true );
1458
- }
1459
-
1460
  // Save the image in the uploads directory.
1461
  require_once ABSPATH . '/wp-admin/includes/file.php';
1462
  \WP_Filesystem();
527
  defined( 'WP_TESTS_DOMAIN' ) ? wp_die() : exit();
528
  }
529
 
530
+ $_POST['save_chart_image'] = isset( $_POST['save_chart_image'] ) && 'yes' === $_POST['save_chart_image'] ? true : false;
531
+
532
  if ( isset( $_POST['chart-img'] ) && ! empty( $_POST['chart-img'] ) ) {
533
+ $attachment_id = $this->save_chart_image( $_POST['chart-img'], $chart_id, $_POST['save_chart_image'] );
534
  if ( $attachment_id ) {
535
  update_post_meta( $chart_id, Visualizer_Plugin::CF_CHART_IMAGE, $attachment_id );
536
  }
598
  $this->_chart = $this->handleExistingRevisions( $chart_id, $this->_chart );
599
  }
600
 
601
+ // Clear existing chart cache.
602
+ if ( isset( $_POST['save'] ) && 1 === intval( $_POST['save'] ) ) {
603
+ $cache_key = Visualizer_Plugin::CF_CHART_CACHE . '_' . $chart_id;
604
+ if ( get_transient( $cache_key ) ) {
605
+ delete_transient( $cache_key );
606
+ }
607
+ }
608
+
609
  switch ( $tab ) {
610
  case 'settings':
611
  $this->_handleDataAndSettingsPage();
1344
  $hours = filter_input(
1345
  INPUT_POST,
1346
  'refresh',
1347
+ FILTER_VALIDATE_FLOAT,
1348
  array(
1349
  'options' => array(
1350
  'min_range' => -1,
1353
  )
1354
  );
1355
 
1356
+ if ( ! is_numeric( $hours ) ) {
1357
  $hours = -1;
1358
  }
1359
 
1447
  *
1448
  * @param string $base64_img Chart image.
1449
  * @param int $chart_id Chart ID.
1450
+ * @param bool $save_attachment Save attachment.
1451
  * @return attachment ID
1452
  */
1453
+ public function save_chart_image( $base64_img, $chart_id, $save_attachment = true ) {
1454
+ // Delete old chart image.
1455
+ $old_attachment_id = get_post_meta( $chart_id, Visualizer_Plugin::CF_CHART_IMAGE, true );
1456
+ if ( $old_attachment_id ) {
1457
+ wp_delete_attachment( $old_attachment_id, true );
1458
+ }
1459
+
1460
+ if ( ! $save_attachment ) {
1461
+ return 0;
1462
+ }
1463
+
1464
  // Upload dir.
1465
  $upload_dir = wp_upload_dir();
1466
  $upload_path = str_replace( '/', DIRECTORY_SEPARATOR, $upload_dir['path'] ) . DIRECTORY_SEPARATOR;
1472
  $file_type = 'image/png';
1473
  $hashed_filename = $filename;
1474
 
 
 
 
 
 
 
1475
  // Save the image in the uploads directory.
1476
  require_once ABSPATH . '/wp-admin/includes/file.php';
1477
  \WP_Filesystem();
classes/Visualizer/Module/Frontend.php CHANGED
@@ -277,11 +277,16 @@ class Visualizer_Module_Frontend extends Visualizer_Module {
277
  ),
278
  $atts
279
  );
280
- // if empty id or chart does not exists, then return empty string
281
- if ( ! $atts['id'] || ! ( $chart = get_post( $atts['id'] ) ) || $chart->post_type !== Visualizer_Plugin::CPT_VISUALIZER ) {
 
 
282
  return '';
283
  }
284
 
 
 
 
285
  // do not show the chart?
286
  if ( ! apply_filters( 'visualizer_pro_show_chart', true, $atts['id'] ) ) {
287
  return '';
@@ -309,18 +314,16 @@ class Visualizer_Module_Frontend extends Visualizer_Module {
309
  $attributes['data-lazy-limit'] = $atts['lazy'];
310
  }
311
 
312
- $type = get_post_meta( $chart->ID, Visualizer_Plugin::CF_CHART_TYPE, true );
313
-
314
  $chart = apply_filters( 'visualizer_schedule_refresh_chart', $chart, $chart->ID, false );
315
 
316
- // fetch and update settings
317
- $settings = get_post_meta( $chart->ID, Visualizer_Plugin::CF_SETTINGS, true );
318
  if ( empty( $settings['height'] ) ) {
319
  $settings['height'] = '400';
320
  }
321
 
322
  // handle series filter hooks
323
- $series = apply_filters( Visualizer_Plugin::FILTER_GET_CHART_SERIES, get_post_meta( $chart->ID, Visualizer_Plugin::CF_SERIES, true ), $chart->ID, $type );
324
 
325
  // handle settings filter hooks
326
  $settings = apply_filters( Visualizer_Plugin::FILTER_GET_CHART_SETTINGS, $settings, $chart->ID, $type );
@@ -345,7 +348,7 @@ class Visualizer_Module_Frontend extends Visualizer_Module {
345
  }
346
 
347
  if ( 'yes' === $atts['use_image'] ) {
348
- $chart_image = get_post_meta( $chart->ID, Visualizer_Plugin::CF_CHART_IMAGE, true );
349
  if ( $chart_image ) {
350
  return '<div id="' . $id . '"' . $this->getHtmlAttributes( $attributes ) . '>' . wp_get_attachment_image( $chart_image, 'full' ) . '</div>';
351
  }
@@ -544,4 +547,41 @@ class Visualizer_Module_Frontend extends Visualizer_Module {
544
 
545
  return '<script type="application/ld+json">' . $schema . '</script>';
546
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
547
  }
277
  ),
278
  $atts
279
  );
280
+
281
+ $chart_data = $this->getChartData( Visualizer_Plugin::CF_CHART_CACHE, $atts['id'] );
282
+ // if empty chart does not exists, then return empty string.
283
+ if ( ! $chart_data ) {
284
  return '';
285
  }
286
 
287
+ $chart = $chart_data['chart'];
288
+ $type = $chart_data['type'];
289
+ $series = $chart_data['series'];
290
  // do not show the chart?
291
  if ( ! apply_filters( 'visualizer_pro_show_chart', true, $atts['id'] ) ) {
292
  return '';
314
  $attributes['data-lazy-limit'] = $atts['lazy'];
315
  }
316
 
 
 
317
  $chart = apply_filters( 'visualizer_schedule_refresh_chart', $chart, $chart->ID, false );
318
 
319
+ // Get and update settings.
320
+ $settings = $chart_data['settings'];
321
  if ( empty( $settings['height'] ) ) {
322
  $settings['height'] = '400';
323
  }
324
 
325
  // handle series filter hooks
326
+ $series = apply_filters( Visualizer_Plugin::FILTER_GET_CHART_SERIES, $series, $chart->ID, $type );
327
 
328
  // handle settings filter hooks
329
  $settings = apply_filters( Visualizer_Plugin::FILTER_GET_CHART_SETTINGS, $settings, $chart->ID, $type );
348
  }
349
 
350
  if ( 'yes' === $atts['use_image'] ) {
351
+ $chart_image = $chart_data['chart_image'];
352
  if ( $chart_image ) {
353
  return '<div id="' . $id . '"' . $this->getHtmlAttributes( $attributes ) . '>' . wp_get_attachment_image( $chart_image, 'full' ) . '</div>';
354
  }
547
 
548
  return '<script type="application/ld+json">' . $schema . '</script>';
549
  }
550
+
551
+ /**
552
+ * Get chart by ID.
553
+ *
554
+ * @param string $cache_key Cache key.
555
+ * @param int $chart_id Chart ID.
556
+ * @return mixed
557
+ */
558
+ private function getChartData( $cache_key = '', $chart_id = 0 ) {
559
+ if ( ! $chart_id ) {
560
+ return false;
561
+ }
562
+ // Create unique cache key of each chart.
563
+ $cache_key .= '_' . $chart_id;
564
+ // Get chart from cache.
565
+ $chart = get_transient( $cache_key );
566
+ if ( $chart ) {
567
+ return $chart;
568
+ }
569
+
570
+ // Get chart by ID.
571
+ $chart = get_post( $chart_id );
572
+ if ( $chart && Visualizer_Plugin::CPT_VISUALIZER === $chart->post_type ) {
573
+ $chart_data = array(
574
+ 'chart' => $chart,
575
+ 'type' => get_post_meta( $chart->ID, Visualizer_Plugin::CF_CHART_TYPE, true ),
576
+ 'settings' => get_post_meta( $chart->ID, Visualizer_Plugin::CF_SETTINGS, true ),
577
+ 'series' => get_post_meta( $chart->ID, Visualizer_Plugin::CF_SERIES, true ),
578
+ 'chart_image' => get_post_meta( $chart->ID, Visualizer_Plugin::CF_CHART_IMAGE, true ),
579
+ );
580
+ // Put the results in a transient. Expire after 12 hours.
581
+ set_transient( $cache_key, $chart_data, apply_filters( Visualizer_Plugin::FILTER_HANDLE_CACHE_EXPIRATION_TIME, 12 * HOUR_IN_SECONDS ) );
582
+ return $chart_data;
583
+ }
584
+
585
+ return false;
586
+ }
587
  }
classes/Visualizer/Module/Setup.php CHANGED
@@ -207,7 +207,7 @@ class Visualizer_Module_Setup extends Visualizer_Module {
207
  */
208
  private function activate_on_site() {
209
  wp_clear_scheduled_hook( 'visualizer_schedule_refresh_db' );
210
- wp_schedule_event( strtotime( 'midnight' ) - get_option( 'gmt_offset' ) * HOUR_IN_SECONDS, 'hourly', 'visualizer_schedule_refresh_db' );
211
  add_option( 'visualizer-activated', true );
212
  }
213
 
@@ -394,6 +394,11 @@ class Visualizer_Module_Setup extends Visualizer_Module {
394
 
395
  // if the time is nigh, we force an update.
396
  $this->refresh_db_for_chart( null, $chart_id, true );
 
 
 
 
 
397
  $hours = get_post_meta( $chart_id, Visualizer_Plugin::CF_DB_SCHEDULE, true );
398
  $new_schedules[ $chart_id ] = time() + $hours * HOUR_IN_SECONDS;
399
  }
207
  */
208
  private function activate_on_site() {
209
  wp_clear_scheduled_hook( 'visualizer_schedule_refresh_db' );
210
+ wp_schedule_event( strtotime( 'midnight' ) - get_option( 'gmt_offset' ) * HOUR_IN_SECONDS, apply_filters( 'visualizer_chart_schedule_interval', 'hourly' ), 'visualizer_schedule_refresh_db' );
211
  add_option( 'visualizer-activated', true );
212
  }
213
 
394
 
395
  // if the time is nigh, we force an update.
396
  $this->refresh_db_for_chart( null, $chart_id, true );
397
+ // Clear existing chart cache.
398
+ $cache_key = Visualizer_Plugin::CF_CHART_CACHE . '_' . $chart_id;
399
+ if ( get_transient( $cache_key ) ) {
400
+ delete_transient( $cache_key );
401
+ }
402
  $hours = get_post_meta( $chart_id, Visualizer_Plugin::CF_DB_SCHEDULE, true );
403
  $new_schedules[ $chart_id ] = time() + $hours * HOUR_IN_SECONDS;
404
  }
classes/Visualizer/Plugin.php CHANGED
@@ -28,7 +28,7 @@
28
  class Visualizer_Plugin {
29
 
30
  const NAME = 'visualizer';
31
- const VERSION = '3.6.1';
32
 
33
  // custom post types
34
  const CPT_VISUALIZER = 'visualizer';
@@ -89,6 +89,7 @@ class Visualizer_Plugin {
89
  const FILTER_UNDO_REVISIONS = 'visualizer-undo-revisions';
90
  const FILTER_HANDLE_REVISIONS = 'visualizer-handle-revisions';
91
  const FILTER_GET_CHART_DATA_AS = 'visualizer-get-chart-data-as';
 
92
 
93
  const CF_DB_SCHEDULE = 'visualizer-db-schedule';
94
  const CF_DB_QUERY = 'visualizer-db-query';
@@ -99,6 +100,8 @@ class Visualizer_Plugin {
99
  const PRO_TEASER_URL = 'https://themeisle.com/plugins/visualizer-charts-and-graphs/upgrade/#pricing';
100
  const PRO_TEASER_TITLE = 'Check PRO version ';
101
 
 
 
102
  /**
103
  * Name of the option for WordPress DB.
104
  */
28
  class Visualizer_Plugin {
29
 
30
  const NAME = 'visualizer';
31
+ const VERSION = '3.7.0';
32
 
33
  // custom post types
34
  const CPT_VISUALIZER = 'visualizer';
89
  const FILTER_UNDO_REVISIONS = 'visualizer-undo-revisions';
90
  const FILTER_HANDLE_REVISIONS = 'visualizer-handle-revisions';
91
  const FILTER_GET_CHART_DATA_AS = 'visualizer-get-chart-data-as';
92
+ const FILTER_HANDLE_CACHE_EXPIRATION_TIME = 'visualizer-handle-expiration-time';
93
 
94
  const CF_DB_SCHEDULE = 'visualizer-db-schedule';
95
  const CF_DB_QUERY = 'visualizer-db-query';
100
  const PRO_TEASER_URL = 'https://themeisle.com/plugins/visualizer-charts-and-graphs/upgrade/#pricing';
101
  const PRO_TEASER_TITLE = 'Check PRO version ';
102
 
103
+ const CF_CHART_CACHE = 'visualizer-chart-cache';
104
+
105
  /**
106
  * Name of the option for WordPress DB.
107
  */
classes/Visualizer/Render/Sidebar.php CHANGED
@@ -510,4 +510,26 @@ abstract class Visualizer_Render_Sidebar extends Visualizer_Render {
510
  }
511
 
512
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
513
  }
510
  }
511
 
512
  }
513
+
514
+ /**
515
+ * Renders save chart as image setting group.
516
+ *
517
+ * @access protected
518
+ */
519
+ protected function _renderChartImageSettings() {
520
+ // Default enable if amp is active.
521
+ $is_amp = function_exists( 'amp_is_enabled' ) && amp_is_enabled();
522
+ $this->save_chart_image = null === $this->save_chart_image && $is_amp ? true : $this->save_chart_image;
523
+
524
+ self::_renderSectionStart( esc_html__( 'Save chart as an image inside Media Library', 'visualizer' ), false );
525
+ self::_renderCheckboxItem(
526
+ esc_html__( 'Save inside media library?', 'visualizer' ),
527
+ 'save_chart_image',
528
+ $this->save_chart_image ? true : false,
529
+ 'yes',
530
+ esc_html__( 'To enable save the image as an inside media library.', 'visualizer' ),
531
+ false
532
+ );
533
+ self::_renderSectionEnd();
534
+ }
535
  }
classes/Visualizer/Render/Sidebar/ChartJS.php CHANGED
@@ -310,6 +310,9 @@ abstract class Visualizer_Render_Sidebar_ChartJS extends Visualizer_Render_Sideb
310
  ''
311
  );
312
  self::_renderSectionEnd();
 
 
 
313
  self::_renderGroupEnd();
314
  }
315
 
310
  ''
311
  );
312
  self::_renderSectionEnd();
313
+
314
+ self::_renderChartImageSettings();
315
+
316
  self::_renderGroupEnd();
317
  }
318
 
classes/Visualizer/Render/Sidebar/Google.php CHANGED
@@ -251,6 +251,9 @@ abstract class Visualizer_Render_Sidebar_Google extends Visualizer_Render_Sideba
251
  ''
252
  );
253
  self::_renderSectionEnd();
 
 
 
254
  do_action( 'visualizer_chart_settings', get_class( $this ), $this->_data, 'general', array( 'generic' => true ) );
255
 
256
  self::_renderGroupEnd();
251
  ''
252
  );
253
  self::_renderSectionEnd();
254
+
255
+ self::_renderChartImageSettings();
256
+
257
  do_action( 'visualizer_chart_settings', get_class( $this ), $this->_data, 'general', array( 'generic' => true ) );
258
 
259
  self::_renderGroupEnd();
classes/Visualizer/Render/Sidebar/Type/DataTable/DataTable.php CHANGED
@@ -149,6 +149,9 @@ class Visualizer_Render_Sidebar_Type_DataTable_DataTable extends Visualizer_Rend
149
  );
150
 
151
  self::_renderSectionEnd();
 
 
 
152
  self::_renderGroupEnd();
153
  }
154
 
149
  );
150
 
151
  self::_renderSectionEnd();
152
+
153
+ self::_renderChartImageSettings();
154
+
155
  self::_renderGroupEnd();
156
  }
157
 
classes/Visualizer/Render/Sidebar/Type/DataTable/Tabular.php CHANGED
@@ -147,6 +147,9 @@ class Visualizer_Render_Sidebar_Type_DataTable_Tabular extends Visualizer_Render
147
  );
148
 
149
  self::_renderSectionEnd();
 
 
 
150
  self::_renderGroupEnd();
151
  }
152
 
147
  );
148
 
149
  self::_renderSectionEnd();
150
+
151
+ self::_renderChartImageSettings();
152
+
153
  self::_renderGroupEnd();
154
  }
155
 
classes/Visualizer/Render/Sidebar/Type/GoogleCharts/Gauge.php CHANGED
@@ -102,6 +102,8 @@ class Visualizer_Render_Sidebar_Type_GoogleCharts_Gauge extends Visualizer_Rende
102
  );
103
  self::_renderSectionEnd();
104
 
 
 
105
  self::_renderGroupEnd();
106
  }
107
 
102
  );
103
  self::_renderSectionEnd();
104
 
105
+ self::_renderChartImageSettings();
106
+
107
  self::_renderGroupEnd();
108
  }
109
 
classes/Visualizer/Render/Sidebar/Type/GoogleCharts/Geo.php CHANGED
@@ -86,6 +86,9 @@ class Visualizer_Render_Sidebar_Type_GoogleCharts_Geo extends Visualizer_Render_
86
  ''
87
  );
88
  self::_renderSectionEnd();
 
 
 
89
  self::_renderGroupEnd();
90
  }
91
 
86
  ''
87
  );
88
  self::_renderSectionEnd();
89
+
90
+ self::_renderChartImageSettings();
91
+
92
  self::_renderGroupEnd();
93
  }
94
 
classes/Visualizer/Render/Sidebar/Type/GoogleCharts/Tabular.php CHANGED
@@ -94,6 +94,9 @@ class Visualizer_Render_Sidebar_Type_GoogleCharts_Tabular extends Visualizer_Ren
94
  $this->creator,
95
  ''
96
  );
 
 
 
97
  self::_renderGroupEnd();
98
  }
99
 
94
  $this->creator,
95
  ''
96
  );
97
+
98
+ self::_renderChartImageSettings();
99
+
100
  self::_renderGroupEnd();
101
  }
102
 
css/media.css CHANGED
@@ -1,5 +1,5 @@
1
  /*
2
- Version: 3.6.1
3
  */
4
  #visualizer-library-view {
5
  padding: 30px 10px 10px 30px;
1
  /*
2
+ Version: 3.7.0
3
  */
4
  #visualizer-library-view {
5
  padding: 30px 10px 10px 30px;
index.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Visualizer: Tables and Charts for WordPress
4
  Plugin URI: https://themeisle.com/plugins/visualizer-charts-and-graphs-lite/
5
  Description: A simple, easy to use and quite powerful tool to create, manage and embed interactive charts into your WordPress posts and pages. The plugin uses Google Visualization API to render charts, which supports cross-browser compatibility (adopting VML for older IE versions) and cross-platform portability to iOS and new Android releases.
6
- Version: 3.6.1
7
  Author: Themeisle
8
  Author URI: http://themeisle.com
9
  Requires at least: 3.5
3
  Plugin Name: Visualizer: Tables and Charts for WordPress
4
  Plugin URI: https://themeisle.com/plugins/visualizer-charts-and-graphs-lite/
5
  Description: A simple, easy to use and quite powerful tool to create, manage and embed interactive charts into your WordPress posts and pages. The plugin uses Google Visualization API to render charts, which supports cross-browser compatibility (adopting VML for older IE versions) and cross-platform portability to iOS and new Android releases.
6
+ Version: 3.7.0
7
  Author: Themeisle
8
  Author URI: http://themeisle.com
9
  Requires at least: 3.5
js/render-google.js CHANGED
@@ -20,7 +20,12 @@ var __visualizer_chart_images = [];
20
  // remember, some charts do not support annotations so they should not be included in this.
21
  var no_annotation_charts = ['tabular', 'timeline', 'gauge', 'geo', 'bubble', 'candlestick'];
22
  if ( undefined !== chart.settings && undefined !== chart.settings.series && undefined === chart.settings.series.length ) {
23
- chart.settings.series = Object.values( chart.settings.series );
 
 
 
 
 
24
  }
25
  if(id !== 'canvas' && typeof chart.series !== 'undefined' && typeof chart.settings.series !== 'undefined' && ! no_annotation_charts.includes(chart.type) ) {
26
  hasAnnotation = chart.series.length - chart.settings.series.length > 1;
@@ -34,6 +39,10 @@ var __visualizer_chart_images = [];
34
  function renderSpecificChart(id, chart) {
35
  var render, container, series, data, table, settings, i, j, row, date, axis, property, format, formatter;
36
 
 
 
 
 
37
  if(chart.library !== 'google'){
38
  return;
39
  }
@@ -253,7 +262,7 @@ var __visualizer_chart_images = [];
253
  case 'date':
254
  // fall-through.
255
  case 'datetime':
256
- date = new Date(data[i][j]);
257
  data[i][j] = null;
258
  if (Object.prototype.toString.call(date) === "[object Date]") {
259
  if (!isNaN(date.getTime())) {
@@ -309,12 +318,21 @@ var __visualizer_chart_images = [];
309
  gv.events.addListener(render, 'ready', function () {
310
  var arr = id.split('-');
311
  __visualizer_chart_images[ arr[0] + '-' + arr[1] ] = '';
 
 
 
 
 
 
 
312
  try{
313
- var img = render.getImageURI();
314
- __visualizer_chart_images[ arr[0] + '-' + arr[1] ] = img;
315
- $('body').trigger('visualizer:render:chart', {id: arr[1], image: img});
316
- if ( $( '#chart-img' ).length ) {
317
- $( '#chart-img' ).val( img );
 
 
318
  }
319
  }catch(error){
320
  var canvas = document.getElementById( 'canvas' );
@@ -376,7 +394,8 @@ var __visualizer_chart_images = [];
376
 
377
  function render() {
378
  for (var id in (all_charts || {})) {
379
- if (document.getElementById( id ).offsetParent !== null) {
 
380
  renderChart(id);
381
  }
382
  }
@@ -394,7 +413,7 @@ var __visualizer_chart_images = [];
394
 
395
  if ( $( '.visualizer-hidden-container' ).length ) {
396
  setInterval( function() {
397
- $( '.visualizer-hidden-container' ).find(".visualizer-front").resize();
398
  }, 500 );
399
  }
400
  });
20
  // remember, some charts do not support annotations so they should not be included in this.
21
  var no_annotation_charts = ['tabular', 'timeline', 'gauge', 'geo', 'bubble', 'candlestick'];
22
  if ( undefined !== chart.settings && undefined !== chart.settings.series && undefined === chart.settings.series.length ) {
23
+ var chartSeries = [];
24
+ var chartSeriesValue = Object.values( chart.settings.series );
25
+ $.each( Object.keys( chart.settings.series ), function( index, element ) {
26
+ chartSeries[element] = chartSeriesValue[index];
27
+ } );
28
+ chart.settings.series = chartSeries;
29
  }
30
  if(id !== 'canvas' && typeof chart.series !== 'undefined' && typeof chart.settings.series !== 'undefined' && ! no_annotation_charts.includes(chart.type) ) {
31
  hasAnnotation = chart.series.length - chart.settings.series.length > 1;
39
  function renderSpecificChart(id, chart) {
40
  var render, container, series, data, table, settings, i, j, row, date, axis, property, format, formatter;
41
 
42
+ if ( $('#' + id).hasClass('visualizer-chart-loaded') ) {
43
+ return;
44
+ }
45
+
46
  if(chart.library !== 'google'){
47
  return;
48
  }
262
  case 'date':
263
  // fall-through.
264
  case 'datetime':
265
+ date = new Date(Date.parse(data[i][j].replace(/-/g, '/')));
266
  data[i][j] = null;
267
  if (Object.prototype.toString.call(date) === "[object Date]") {
268
  if (!isNaN(date.getTime())) {
318
  gv.events.addListener(render, 'ready', function () {
319
  var arr = id.split('-');
320
  __visualizer_chart_images[ arr[0] + '-' + arr[1] ] = '';
321
+
322
+ if (render.container && $(render.container).is(':visible')) {
323
+ if ($(render.container).parents('div').next( '#sidebar' ).length === 0) {
324
+ $(render.container).addClass( 'visualizer-chart-loaded' );
325
+ }
326
+ }
327
+
328
  try{
329
+ if ( typeof render.getImageURI !== 'undefined' ) {
330
+ var img = render.getImageURI();
331
+ __visualizer_chart_images[ arr[0] + '-' + arr[1] ] = img;
332
+ $('body').trigger('visualizer:render:chart', {id: arr[1], image: img});
333
+ if ( $( '#chart-img' ).length ) {
334
+ $( '#chart-img' ).val( img );
335
+ }
336
  }
337
  }catch(error){
338
  var canvas = document.getElementById( 'canvas' );
394
 
395
  function render() {
396
  for (var id in (all_charts || {})) {
397
+ var chartElement = document.getElementById( id );
398
+ if (chartElement && chartElement.offsetParent) {
399
  renderChart(id);
400
  }
401
  }
413
 
414
  if ( $( '.visualizer-hidden-container' ).length ) {
415
  setInterval( function() {
416
+ $( '.visualizer-hidden-container' ).find(".visualizer-front:not(.visualizer-chart-loaded)").resize();
417
  }, 500 );
418
  }
419
  });
readme.txt CHANGED
@@ -2,7 +2,7 @@
2
  Contributors: codeinwp,themeisle,marius2012,marius_codeinwp,hardeepasrani,rozroz,Madalin_ThemeIsle
3
  Tags: tables, charts, pie, visualization, graphs
4
  Requires at least: 3.5
5
- Tested up to: 5.7
6
  Requires PHP: 5.6
7
  Stable tag: trunk
8
  License: GPL v2.0 or later
@@ -163,6 +163,24 @@ Pay attention that to turn your shortcodes into graphs, your theme has to have `
163
 
164
  == Changelog ==
165
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
166
  ##### [Version 3.6.1](https://github.com/Codeinwp/visualizer/compare/v3.6.0...v3.6.1) (2021-08-04)
167
 
168
  - Fix broken dropdown style issue
2
  Contributors: codeinwp,themeisle,marius2012,marius_codeinwp,hardeepasrani,rozroz,Madalin_ThemeIsle
3
  Tags: tables, charts, pie, visualization, graphs
4
  Requires at least: 3.5
5
+ Tested up to: 5.8
6
  Requires PHP: 5.6
7
  Stable tag: trunk
8
  License: GPL v2.0 or later
163
 
164
  == Changelog ==
165
 
166
+ #### [Version 3.7.0](https://github.com/Codeinwp/visualizer/compare/v3.6.1...v3.7.0) (2021-10-07)
167
+
168
+ #### Features
169
+ - Add option to enable/disable save the chart image
170
+ - Enhanced caching
171
+
172
+ #### Fixes
173
+ - Fix undefined variable errors when using Gutenberg blocks
174
+ - Fix broken chart in iOS and Safari
175
+ - Fix custom refresh time support for DB chart
176
+ - Fix table placed inside accordion cannot be scrolled down (refreshes all the time)
177
+ - Fix pagination doesn't work in the library
178
+ - Fix HTML entities in JSON break Visualizer Table Chart
179
+ - Fix string type columns affect the target of the formatting applied to a number column
180
+
181
+
182
+
183
+
184
  ##### [Version 3.6.1](https://github.com/Codeinwp/visualizer/compare/v3.6.0...v3.6.1) (2021-08-04)
185
 
186
  - Fix broken dropdown style issue
vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
- return ComposerAutoloaderInit0430f6411d24184151cbf3a06294c9f0::getLoader();
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInitceeb3fdb7bed0fc4821f80dd5d6e1a0a::getLoader();
vendor/composer/ClassLoader.php CHANGED
@@ -42,30 +42,75 @@ namespace Composer\Autoload;
42
  */
43
  class ClassLoader
44
  {
 
45
  private $vendorDir;
46
 
47
  // PSR-4
 
 
 
 
48
  private $prefixLengthsPsr4 = array();
 
 
 
 
49
  private $prefixDirsPsr4 = array();
 
 
 
 
50
  private $fallbackDirsPsr4 = array();
51
 
52
  // PSR-0
 
 
 
 
53
  private $prefixesPsr0 = array();
 
 
 
 
54
  private $fallbackDirsPsr0 = array();
55
 
 
56
  private $useIncludePath = false;
 
 
 
 
 
57
  private $classMap = array();
 
 
58
  private $classMapAuthoritative = false;
 
 
 
 
 
59
  private $missingClasses = array();
 
 
60
  private $apcuPrefix;
61
 
 
 
 
62
  private static $registeredLoaders = array();
63
 
 
 
 
64
  public function __construct($vendorDir = null)
65
  {
66
  $this->vendorDir = $vendorDir;
67
  }
68
 
 
 
 
69
  public function getPrefixes()
70
  {
71
  if (!empty($this->prefixesPsr0)) {
@@ -75,28 +120,47 @@ class ClassLoader
75
  return array();
76
  }
77
 
 
 
 
 
78
  public function getPrefixesPsr4()
79
  {
80
  return $this->prefixDirsPsr4;
81
  }
82
 
 
 
 
 
83
  public function getFallbackDirs()
84
  {
85
  return $this->fallbackDirsPsr0;
86
  }
87
 
 
 
 
 
88
  public function getFallbackDirsPsr4()
89
  {
90
  return $this->fallbackDirsPsr4;
91
  }
92
 
 
 
 
 
93
  public function getClassMap()
94
  {
95
  return $this->classMap;
96
  }
97
 
98
  /**
99
- * @param array $classMap Class to filename map
 
 
 
100
  */
101
  public function addClassMap(array $classMap)
102
  {
@@ -111,9 +175,11 @@ class ClassLoader
111
  * Registers a set of PSR-0 directories for a given prefix, either
112
  * appending or prepending to the ones previously set for this prefix.
113
  *
114
- * @param string $prefix The prefix
115
- * @param array|string $paths The PSR-0 root directories
116
- * @param bool $prepend Whether to prepend the directories
 
 
117
  */
118
  public function add($prefix, $paths, $prepend = false)
119
  {
@@ -156,11 +222,13 @@ class ClassLoader
156
  * Registers a set of PSR-4 directories for a given namespace, either
157
  * appending or prepending to the ones previously set for this namespace.
158
  *
159
- * @param string $prefix The prefix/namespace, with trailing '\\'
160
- * @param array|string $paths The PSR-4 base directories
161
- * @param bool $prepend Whether to prepend the directories
162
  *
163
  * @throws \InvalidArgumentException
 
 
164
  */
165
  public function addPsr4($prefix, $paths, $prepend = false)
166
  {
@@ -204,8 +272,10 @@ class ClassLoader
204
  * Registers a set of PSR-0 directories for a given prefix,
205
  * replacing any others previously set for this prefix.
206
  *
207
- * @param string $prefix The prefix
208
- * @param array|string $paths The PSR-0 base directories
 
 
209
  */
210
  public function set($prefix, $paths)
211
  {
@@ -220,10 +290,12 @@ class ClassLoader
220
  * Registers a set of PSR-4 directories for a given namespace,
221
  * replacing any others previously set for this namespace.
222
  *
223
- * @param string $prefix The prefix/namespace, with trailing '\\'
224
- * @param array|string $paths The PSR-4 base directories
225
  *
226
  * @throws \InvalidArgumentException
 
 
227
  */
228
  public function setPsr4($prefix, $paths)
229
  {
@@ -243,6 +315,8 @@ class ClassLoader
243
  * Turns on searching the include path for class files.
244
  *
245
  * @param bool $useIncludePath
 
 
246
  */
247
  public function setUseIncludePath($useIncludePath)
248
  {
@@ -265,6 +339,8 @@ class ClassLoader
265
  * that have not been registered with the class map.
266
  *
267
  * @param bool $classMapAuthoritative
 
 
268
  */
269
  public function setClassMapAuthoritative($classMapAuthoritative)
270
  {
@@ -285,6 +361,8 @@ class ClassLoader
285
  * APCu prefix to use to cache found/not-found classes, if the extension is enabled.
286
  *
287
  * @param string|null $apcuPrefix
 
 
288
  */
289
  public function setApcuPrefix($apcuPrefix)
290
  {
@@ -305,6 +383,8 @@ class ClassLoader
305
  * Registers this instance as an autoloader.
306
  *
307
  * @param bool $prepend Whether to prepend the autoloader or not
 
 
308
  */
309
  public function register($prepend = false)
310
  {
@@ -324,6 +404,8 @@ class ClassLoader
324
 
325
  /**
326
  * Unregisters this instance as an autoloader.
 
 
327
  */
328
  public function unregister()
329
  {
@@ -403,6 +485,11 @@ class ClassLoader
403
  return self::$registeredLoaders;
404
  }
405
 
 
 
 
 
 
406
  private function findFileWithExtension($class, $ext)
407
  {
408
  // PSR-4 lookup
@@ -474,6 +561,10 @@ class ClassLoader
474
  * Scope isolated include.
475
  *
476
  * Prevents access to $this/self from included files.
 
 
 
 
477
  */
478
  function includeFile($file)
479
  {
42
  */
43
  class ClassLoader
44
  {
45
+ /** @var ?string */
46
  private $vendorDir;
47
 
48
  // PSR-4
49
+ /**
50
+ * @var array[]
51
+ * @psalm-var array<string, array<string, int>>
52
+ */
53
  private $prefixLengthsPsr4 = array();
54
+ /**
55
+ * @var array[]
56
+ * @psalm-var array<string, array<int, string>>
57
+ */
58
  private $prefixDirsPsr4 = array();
59
+ /**
60
+ * @var array[]
61
+ * @psalm-var array<string, string>
62
+ */
63
  private $fallbackDirsPsr4 = array();
64
 
65
  // PSR-0
66
+ /**
67
+ * @var array[]
68
+ * @psalm-var array<string, array<string, string[]>>
69
+ */
70
  private $prefixesPsr0 = array();
71
+ /**
72
+ * @var array[]
73
+ * @psalm-var array<string, string>
74
+ */
75
  private $fallbackDirsPsr0 = array();
76
 
77
+ /** @var bool */
78
  private $useIncludePath = false;
79
+
80
+ /**
81
+ * @var string[]
82
+ * @psalm-var array<string, string>
83
+ */
84
  private $classMap = array();
85
+
86
+ /** @var bool */
87
  private $classMapAuthoritative = false;
88
+
89
+ /**
90
+ * @var bool[]
91
+ * @psalm-var array<string, bool>
92
+ */
93
  private $missingClasses = array();
94
+
95
+ /** @var ?string */
96
  private $apcuPrefix;
97
 
98
+ /**
99
+ * @var self[]
100
+ */
101
  private static $registeredLoaders = array();
102
 
103
+ /**
104
+ * @param ?string $vendorDir
105
+ */
106
  public function __construct($vendorDir = null)
107
  {
108
  $this->vendorDir = $vendorDir;
109
  }
110
 
111
+ /**
112
+ * @return string[]
113
+ */
114
  public function getPrefixes()
115
  {
116
  if (!empty($this->prefixesPsr0)) {
120
  return array();
121
  }
122
 
123
+ /**
124
+ * @return array[]
125
+ * @psalm-return array<string, array<int, string>>
126
+ */
127
  public function getPrefixesPsr4()
128
  {
129
  return $this->prefixDirsPsr4;
130
  }
131
 
132
+ /**
133
+ * @return array[]
134
+ * @psalm-return array<string, string>
135
+ */
136
  public function getFallbackDirs()
137
  {
138
  return $this->fallbackDirsPsr0;
139
  }
140
 
141
+ /**
142
+ * @return array[]
143
+ * @psalm-return array<string, string>
144
+ */
145
  public function getFallbackDirsPsr4()
146
  {
147
  return $this->fallbackDirsPsr4;
148
  }
149
 
150
+ /**
151
+ * @return string[] Array of classname => path
152
+ * @psalm-var array<string, string>
153
+ */
154
  public function getClassMap()
155
  {
156
  return $this->classMap;
157
  }
158
 
159
  /**
160
+ * @param string[] $classMap Class to filename map
161
+ * @psalm-param array<string, string> $classMap
162
+ *
163
+ * @return void
164
  */
165
  public function addClassMap(array $classMap)
166
  {
175
  * Registers a set of PSR-0 directories for a given prefix, either
176
  * appending or prepending to the ones previously set for this prefix.
177
  *
178
+ * @param string $prefix The prefix
179
+ * @param string[]|string $paths The PSR-0 root directories
180
+ * @param bool $prepend Whether to prepend the directories
181
+ *
182
+ * @return void
183
  */
184
  public function add($prefix, $paths, $prepend = false)
185
  {
222
  * Registers a set of PSR-4 directories for a given namespace, either
223
  * appending or prepending to the ones previously set for this namespace.
224
  *
225
+ * @param string $prefix The prefix/namespace, with trailing '\\'
226
+ * @param string[]|string $paths The PSR-4 base directories
227
+ * @param bool $prepend Whether to prepend the directories
228
  *
229
  * @throws \InvalidArgumentException
230
+ *
231
+ * @return void
232
  */
233
  public function addPsr4($prefix, $paths, $prepend = false)
234
  {
272
  * Registers a set of PSR-0 directories for a given prefix,
273
  * replacing any others previously set for this prefix.
274
  *
275
+ * @param string $prefix The prefix
276
+ * @param string[]|string $paths The PSR-0 base directories
277
+ *
278
+ * @return void
279
  */
280
  public function set($prefix, $paths)
281
  {
290
  * Registers a set of PSR-4 directories for a given namespace,
291
  * replacing any others previously set for this namespace.
292
  *
293
+ * @param string $prefix The prefix/namespace, with trailing '\\'
294
+ * @param string[]|string $paths The PSR-4 base directories
295
  *
296
  * @throws \InvalidArgumentException
297
+ *
298
+ * @return void
299
  */
300
  public function setPsr4($prefix, $paths)
301
  {
315
  * Turns on searching the include path for class files.
316
  *
317
  * @param bool $useIncludePath
318
+ *
319
+ * @return void
320
  */
321
  public function setUseIncludePath($useIncludePath)
322
  {
339
  * that have not been registered with the class map.
340
  *
341
  * @param bool $classMapAuthoritative
342
+ *
343
+ * @return void
344
  */
345
  public function setClassMapAuthoritative($classMapAuthoritative)
346
  {
361
  * APCu prefix to use to cache found/not-found classes, if the extension is enabled.
362
  *
363
  * @param string|null $apcuPrefix
364
+ *
365
+ * @return void
366
  */
367
  public function setApcuPrefix($apcuPrefix)
368
  {
383
  * Registers this instance as an autoloader.
384
  *
385
  * @param bool $prepend Whether to prepend the autoloader or not
386
+ *
387
+ * @return void
388
  */
389
  public function register($prepend = false)
390
  {
404
 
405
  /**
406
  * Unregisters this instance as an autoloader.
407
+ *
408
+ * @return void
409
  */
410
  public function unregister()
411
  {
485
  return self::$registeredLoaders;
486
  }
487
 
488
+ /**
489
+ * @param string $class
490
+ * @param string $ext
491
+ * @return string|false
492
+ */
493
  private function findFileWithExtension($class, $ext)
494
  {
495
  // PSR-4 lookup
561
  * Scope isolated include.
562
  *
563
  * Prevents access to $this/self from included files.
564
+ *
565
+ * @param string $file
566
+ * @return void
567
+ * @private
568
  */
569
  function includeFile($file)
570
  {
vendor/composer/InstalledVersions.php CHANGED
@@ -20,7 +20,7 @@ use Composer\Semver\VersionParser;
20
  *
21
  * See also https://getcomposer.org/doc/07-runtime.md#installed-versions
22
  *
23
- * To require it's presence, you can require `composer-runtime-api ^2.0`
24
  */
25
  class InstalledVersions
26
  {
@@ -228,7 +228,7 @@ class InstalledVersions
228
 
229
  /**
230
  * @return array
231
- * @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}
232
  */
233
  public static function getRootPackage()
234
  {
@@ -242,7 +242,7 @@ class InstalledVersions
242
  *
243
  * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect.
244
  * @return array[]
245
- * @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string}>}
246
  */
247
  public static function getRawData()
248
  {
@@ -265,7 +265,7 @@ class InstalledVersions
265
  * Returns the raw data of all installed.php which are currently loaded for custom implementations
266
  *
267
  * @return array[]
268
- * @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string}>}>
269
  */
270
  public static function getAllRawData()
271
  {
@@ -288,7 +288,7 @@ class InstalledVersions
288
  * @param array[] $data A vendor/composer/installed.php data set
289
  * @return void
290
  *
291
- * @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string}>} $data
292
  */
293
  public static function reload($data)
294
  {
@@ -298,7 +298,7 @@ class InstalledVersions
298
 
299
  /**
300
  * @return array[]
301
- * @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string}>}>
302
  */
303
  private static function getInstalled()
304
  {
20
  *
21
  * See also https://getcomposer.org/doc/07-runtime.md#installed-versions
22
  *
23
+ * To require its presence, you can require `composer-runtime-api ^2.0`
24
  */
25
  class InstalledVersions
26
  {
228
 
229
  /**
230
  * @return array
231
+ * @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}
232
  */
233
  public static function getRootPackage()
234
  {
242
  *
243
  * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect.
244
  * @return array[]
245
+ * @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}
246
  */
247
  public static function getRawData()
248
  {
265
  * Returns the raw data of all installed.php which are currently loaded for custom implementations
266
  *
267
  * @return array[]
268
+ * @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
269
  */
270
  public static function getAllRawData()
271
  {
288
  * @param array[] $data A vendor/composer/installed.php data set
289
  * @return void
290
  *
291
+ * @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>} $data
292
  */
293
  public static function reload($data)
294
  {
298
 
299
  /**
300
  * @return array[]
301
+ * @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
302
  */
303
  private static function getInstalled()
304
  {
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInit0430f6411d24184151cbf3a06294c9f0
6
  {
7
  private static $loader;
8
 
@@ -24,15 +24,15 @@ class ComposerAutoloaderInit0430f6411d24184151cbf3a06294c9f0
24
 
25
  require __DIR__ . '/platform_check.php';
26
 
27
- spl_autoload_register(array('ComposerAutoloaderInit0430f6411d24184151cbf3a06294c9f0', 'loadClassLoader'), true, true);
28
  self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
29
- spl_autoload_unregister(array('ComposerAutoloaderInit0430f6411d24184151cbf3a06294c9f0', 'loadClassLoader'));
30
 
31
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
32
  if ($useStaticLoader) {
33
  require __DIR__ . '/autoload_static.php';
34
 
35
- call_user_func(\Composer\Autoload\ComposerStaticInit0430f6411d24184151cbf3a06294c9f0::getInitializer($loader));
36
  } else {
37
  $map = require __DIR__ . '/autoload_namespaces.php';
38
  foreach ($map as $namespace => $path) {
@@ -53,19 +53,19 @@ class ComposerAutoloaderInit0430f6411d24184151cbf3a06294c9f0
53
  $loader->register(true);
54
 
55
  if ($useStaticLoader) {
56
- $includeFiles = Composer\Autoload\ComposerStaticInit0430f6411d24184151cbf3a06294c9f0::$files;
57
  } else {
58
  $includeFiles = require __DIR__ . '/autoload_files.php';
59
  }
60
  foreach ($includeFiles as $fileIdentifier => $file) {
61
- composerRequire0430f6411d24184151cbf3a06294c9f0($fileIdentifier, $file);
62
  }
63
 
64
  return $loader;
65
  }
66
  }
67
 
68
- function composerRequire0430f6411d24184151cbf3a06294c9f0($fileIdentifier, $file)
69
  {
70
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
71
  require $file;
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderInitceeb3fdb7bed0fc4821f80dd5d6e1a0a
6
  {
7
  private static $loader;
8
 
24
 
25
  require __DIR__ . '/platform_check.php';
26
 
27
+ spl_autoload_register(array('ComposerAutoloaderInitceeb3fdb7bed0fc4821f80dd5d6e1a0a', 'loadClassLoader'), true, true);
28
  self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
29
+ spl_autoload_unregister(array('ComposerAutoloaderInitceeb3fdb7bed0fc4821f80dd5d6e1a0a', 'loadClassLoader'));
30
 
31
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
32
  if ($useStaticLoader) {
33
  require __DIR__ . '/autoload_static.php';
34
 
35
+ call_user_func(\Composer\Autoload\ComposerStaticInitceeb3fdb7bed0fc4821f80dd5d6e1a0a::getInitializer($loader));
36
  } else {
37
  $map = require __DIR__ . '/autoload_namespaces.php';
38
  foreach ($map as $namespace => $path) {
53
  $loader->register(true);
54
 
55
  if ($useStaticLoader) {
56
+ $includeFiles = Composer\Autoload\ComposerStaticInitceeb3fdb7bed0fc4821f80dd5d6e1a0a::$files;
57
  } else {
58
  $includeFiles = require __DIR__ . '/autoload_files.php';
59
  }
60
  foreach ($includeFiles as $fileIdentifier => $file) {
61
+ composerRequireceeb3fdb7bed0fc4821f80dd5d6e1a0a($fileIdentifier, $file);
62
  }
63
 
64
  return $loader;
65
  }
66
  }
67
 
68
+ function composerRequireceeb3fdb7bed0fc4821f80dd5d6e1a0a($fileIdentifier, $file)
69
  {
70
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
71
  require $file;
vendor/composer/autoload_static.php CHANGED
@@ -4,7 +4,7 @@
4
 
5
  namespace Composer\Autoload;
6
 
7
- class ComposerStaticInit0430f6411d24184151cbf3a06294c9f0
8
  {
9
  public static $files = array (
10
  '3af723442581d6c310bf44543f9f5c60' => __DIR__ . '/..' . '/markbaker/matrix/classes/src/Functions/adjoint.php',
@@ -356,10 +356,10 @@ class ComposerStaticInit0430f6411d24184151cbf3a06294c9f0
356
  public static function getInitializer(ClassLoader $loader)
357
  {
358
  return \Closure::bind(function () use ($loader) {
359
- $loader->prefixLengthsPsr4 = ComposerStaticInit0430f6411d24184151cbf3a06294c9f0::$prefixLengthsPsr4;
360
- $loader->prefixDirsPsr4 = ComposerStaticInit0430f6411d24184151cbf3a06294c9f0::$prefixDirsPsr4;
361
- $loader->prefixesPsr0 = ComposerStaticInit0430f6411d24184151cbf3a06294c9f0::$prefixesPsr0;
362
- $loader->classMap = ComposerStaticInit0430f6411d24184151cbf3a06294c9f0::$classMap;
363
 
364
  }, null, ClassLoader::class);
365
  }
4
 
5
  namespace Composer\Autoload;
6
 
7
+ class ComposerStaticInitceeb3fdb7bed0fc4821f80dd5d6e1a0a
8
  {
9
  public static $files = array (
10
  '3af723442581d6c310bf44543f9f5c60' => __DIR__ . '/..' . '/markbaker/matrix/classes/src/Functions/adjoint.php',
356
  public static function getInitializer(ClassLoader $loader)
357
  {
358
  return \Closure::bind(function () use ($loader) {
359
+ $loader->prefixLengthsPsr4 = ComposerStaticInitceeb3fdb7bed0fc4821f80dd5d6e1a0a::$prefixLengthsPsr4;
360
+ $loader->prefixDirsPsr4 = ComposerStaticInitceeb3fdb7bed0fc4821f80dd5d6e1a0a::$prefixDirsPsr4;
361
+ $loader->prefixesPsr0 = ComposerStaticInitceeb3fdb7bed0fc4821f80dd5d6e1a0a::$prefixesPsr0;
362
+ $loader->classMap = ComposerStaticInitceeb3fdb7bed0fc4821f80dd5d6e1a0a::$classMap;
363
 
364
  }, null, ClassLoader::class);
365
  }
vendor/composer/installed.php CHANGED
@@ -1,11 +1,11 @@
1
  <?php return array(
2
  'root' => array(
3
- 'pretty_version' => 'v3.6.1',
4
- 'version' => '3.6.1.0',
5
  'type' => 'wordpress-plugin',
6
  'install_path' => __DIR__ . '/../../',
7
  'aliases' => array(),
8
- 'reference' => '1865bc3bf11adc4f6e630f41f8def36019294e1b',
9
  'name' => 'codeinwp/visualizer',
10
  'dev' => false,
11
  ),
@@ -22,12 +22,12 @@
22
  'dev_requirement' => false,
23
  ),
24
  'codeinwp/visualizer' => array(
25
- 'pretty_version' => 'v3.6.1',
26
- 'version' => '3.6.1.0',
27
  'type' => 'wordpress-plugin',
28
  'install_path' => __DIR__ . '/../../',
29
  'aliases' => array(),
30
- 'reference' => '1865bc3bf11adc4f6e630f41f8def36019294e1b',
31
  'dev_requirement' => false,
32
  ),
33
  'markbaker/complex' => array(
1
  <?php return array(
2
  'root' => array(
3
+ 'pretty_version' => 'v3.7.0',
4
+ 'version' => '3.7.0.0',
5
  'type' => 'wordpress-plugin',
6
  'install_path' => __DIR__ . '/../../',
7
  'aliases' => array(),
8
+ 'reference' => '0437b398f6fd31bb9cefd2665d948b7b5d313e50',
9
  'name' => 'codeinwp/visualizer',
10
  'dev' => false,
11
  ),
22
  'dev_requirement' => false,
23
  ),
24
  'codeinwp/visualizer' => array(
25
+ 'pretty_version' => 'v3.7.0',
26
+ 'version' => '3.7.0.0',
27
  'type' => 'wordpress-plugin',
28
  'install_path' => __DIR__ . '/../../',
29
  'aliases' => array(),
30
+ 'reference' => '0437b398f6fd31bb9cefd2665d948b7b5d313e50',
31
  'dev_requirement' => false,
32
  ),
33
  'markbaker/complex' => array(