WordPress Charts and Graphs Lite - Version 3.4.9

Version Description

  • 2020-11-26
Download this release

Release Info

Developer codeinwp
Plugin Icon WordPress Charts and Graphs Lite
Version 3.4.9
Comparing to
See all releases

Code changes from version 3.4.8 to 3.4.9

CHANGELOG.md CHANGED
@@ -1,4 +1,10 @@
1
 
 
 
 
 
 
 
2
  ### v3.4.8 - 2020-09-29
3
  **Changes:**
4
  * [Fix] Option to edit charts imported from JSON
1
 
2
+ ### v3.4.9 - 2020-11-26
3
+ **Changes:**
4
+ * [Fix] Pie chart slices offset problem in the Gutenberg editor
5
+ * [Fix] Warning is thrown when remote file is used as source
6
+ * [Fix] Bubble chart legend position not working in the Gutenberg editor
7
+
8
  ### v3.4.8 - 2020-09-29
9
  **Changes:**
10
  * [Fix] Option to edit charts imported from JSON
classes/Visualizer/Gutenberg/Block.php CHANGED
@@ -588,14 +588,19 @@ class Visualizer_Gutenberg_Block {
588
  apply_filters( 'visualizer_pro_remove_schedule', $data['id'] );
589
  }
590
 
591
- if ( $source_type === 'Visualizer_Source_Query' ) {
592
- $db_schedule = intval( $data['visualizer-db-schedule'] );
593
- $db_query = $data['visualizer-db-query'];
594
- update_post_meta( $data['id'], Visualizer_Plugin::CF_DB_SCHEDULE, $db_schedule );
595
- update_post_meta( $data['id'], Visualizer_Plugin::CF_DB_QUERY, stripslashes( $db_query ) );
596
- } else {
597
- delete_post_meta( $data['id'], Visualizer_Plugin::CF_DB_SCHEDULE );
598
- delete_post_meta( $data['id'], Visualizer_Plugin::CF_DB_QUERY );
 
 
 
 
 
599
  }
600
 
601
  if ( $source_type === 'Visualizer_Source_Json' ) {
588
  apply_filters( 'visualizer_pro_remove_schedule', $data['id'] );
589
  }
590
 
591
+ // let's check if this is not an external db chart
592
+ // as there is no support for that in the block editor interface
593
+ $external_params = get_post_meta( $data['id'], Visualizer_Plugin::CF_REMOTE_DB_PARAMS, true );
594
+ if ( empty( $external_params ) ) {
595
+ if ( $source_type === 'Visualizer_Source_Query' ) {
596
+ $db_schedule = intval( $data['visualizer-db-schedule'] );
597
+ $db_query = $data['visualizer-db-query'];
598
+ update_post_meta( $data['id'], Visualizer_Plugin::CF_DB_SCHEDULE, $db_schedule );
599
+ update_post_meta( $data['id'], Visualizer_Plugin::CF_DB_QUERY, stripslashes( $db_query ) );
600
+ } else {
601
+ delete_post_meta( $data['id'], Visualizer_Plugin::CF_DB_SCHEDULE );
602
+ delete_post_meta( $data['id'], Visualizer_Plugin::CF_DB_QUERY );
603
+ }
604
  }
605
 
606
  if ( $source_type === 'Visualizer_Source_Json' ) {
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},g={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},b=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=_({},g,!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))||g.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=g.minDate,this._o.minYear=g.minYear,this._o.minMonth=g.minMonth,this._o.startRange=g.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=g.maxDate,this._o.maxYear=g.maxYear,this._o.maxMonth=g.maxMonth,this._o.endRange=g.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,g=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,g),D=i+o,T=D;T>7;)T-=7;D+=7-T;for(var S=0,O=0;S<D;S++){var j=new Date(e,t,S-o+1),x=!!c(this._d)&&f(j,this._d),E=f(j,a),C=S<o||S>=i+o,P=S-o+1,H=t,z=e,A=r.startRange&&f(r.startRange,j),N=r.endRange&&f(r.endRange,j),F=r.startRange&&r.endRange&&r.startRange<j&&j<r.endRange;C&&(S<o?(P=Y+P,H=g,z=k):(P-=i,H=M,z=L));var R={day:P,month:H,year:z,isSelected:x,isToday:E,isDisabled:r.minDate&&j<r.minDate||r.maxDate&&j>r.maxDate||r.disableWeekends&&d(j)||r.disableDayFn&&r.disableDayFn(j),isEmpty:C,isStartRange:A,isEndRange:N,isInRange:F,showDaysInNextAndPreviousMonths:r.showDaysInNextAndPreviousMonths};l.push(v(R)),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="'+b(e,t)+'">'+b(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=(a=o.trys).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())}))}))]}))}))},g=Object(r.createContext)(m),b=g.Provider,v=g.Consumer,w=function(e){var t=e.children,n=e.value;return Object(r.createElement)(b,{value:n},t)},M=function(e){var t=e.render;return Object(r.createElement)(v,null,(function(e){return t(e)}))},k="#CCCCCC",L=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,_,g,b,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&&(g=t.visualization.arrayToDataTable(r.old),b=t.visualization.arrayToDataTable(r.new),_=t.visualization[u].prototype.computeDiff(g,b)),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)?k: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),Y=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)(L,u({},e,{google:t,googleChartWrapper:n,googleChartDashboard:a}))}})},t}(r.Component),D=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),T=0,S=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 T+=1,void 0===e?"googlechart-control-"+t+"-"+T: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)(Y,{googleChartWrapper:t.state.googleChartWrapper,google:c,googleChartDashboard:t.state.googleChartDashboard}),Object(r.createElement)(D,{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),O=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)(S,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),j=n(130),x=n.n(j);function E(e){return(E="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 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){return(P=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function H(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function z(e,t){return(z=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var A=wp.element,N=A.Component,F=A.Fragment,R=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t){return!t||"object"!==E(t)&&"function"!=typeof t?H(e):t}(this,P(t).apply(this,arguments))).initDataTable=e.initDataTable.bind(H(e)),e.dataRenderer=e.dataRenderer.bind(H(e)),e.table,e.uniqueId=x()(),e}var n,r,a;return 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&&z(e,t)}(t,e),n=t,(r=[{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(F,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(n.prototype,r),a&&C(n,a),t}(N),W=n(4),I=n.n(W),B=n(131),J=n.n(B),U=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},q=function(e){var t;if(Array.isArray(e))return 0<e.length;if(I()(e)){for(t in e)return!0;return!1}return"string"==typeof e?0<e.length:null!=e},V=function(e){return J()(e,q)},G=function(e){return e.width="",e.height="",e.backgroundColor={},e.chartArea={},V(e)},$=function(e){try{JSON.parse(e)}catch(e){return!1}return!0},K=function(e,t){return!0===e[t]||"true"===e[t]||"1"===e[t]||1===e[t]},Z=function(e){switch(e["visualizer-chart-library"]){case"GoogleCharts":return Q(e)}},Q=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=X(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=X(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:X("number"),options:{pattern:t.format},column:1});if(t.hAxis&&r[0]){var d=X(r[0].type);d&&a.push({type:d,options:{pattern:t.hAxis.format},column:0})}return a},X=function(e){switch(e){case"number":return"NumberFormat";case"date":case"datetime":case"timeofday":return"DateFormat"}return null};function ee(e){return(ee="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,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 ne(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var i=e.apply(t,n);function o(e){te(i,r,a,o,s,"next",e)}function s(e){te(i,r,a,o,s,"throw",e)}o(void 0)}))}}function re(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 ae(e){return(ae=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ie(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function oe(e,t){return(oe=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var se=lodash.startCase,le=wp.i18n.__,ue=wp.apiFetch,ce=wp.element,de=ce.Component,me=ce.Fragment,pe=wp.components,he=pe.Button,fe=pe.Dashicon,_e=pe.ExternalLink,ye=pe.Notice,ge=pe.Placeholder,be=pe.Spinner,ve=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t){return!t||"object"!==ee(t)&&"function"!=typeof t?ie(e):t}(this,ae(t).apply(this,arguments))).loadMoreCharts=e.loadMoreCharts.bind(ie(e)),e.state={charts:null,isBusy:!1,chartsLoaded:!1,perPage:visualizerLocalize.chartsPerPage},e}var n,r,a,i,o;return 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)}(t,e),n=t,(r=[{key:"componentDidMount",value:(o=ne(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,ue({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 o.apply(this,arguments)})},{key:"loadMoreCharts",value:(i=ne(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,ue({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 i.apply(this,arguments)})},{key:"render",value:function(){var e=this,t=this.state,n=t.charts,r=t.isBusy,a=t.chartsLoaded,i=t.perPage;return wp.element.createElement("div",{className:"visualizer-settings__charts"},wp.element.createElement(ye,{status:"warning",isDismissible:!1},le("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(_e,{href:visualizerLocalize.adminPage},le("Click here to visit Visualizer Charts Library."))),null!==n?1<=n.length?wp.element.createElement(me,null,wp.element.createElement("div",{className:"visualizer-settings__charts-grid"},Object.keys(n).map((function(t){var r,a,i,o=U(n[t].chart_data);if(r=o["visualizer-settings"].title?o["visualizer-settings"].title:"#".concat(n[t].id),0<=["gauge","tabular","timeline"].indexOf(o["visualizer-chart-type"])?"DataTable"===o["visualizer-chart-library"]?a=o["visualizer-chart-type"]:("tabular"===(a=o["visualizer-chart-type"])&&(a="table"),a=se(a)):a="".concat(se(o["visualizer-chart-type"]),"Chart"),!o["visualizer-chart-library"]||"ChartJS"!==o["visualizer-chart-library"])return o["visualizer-data-exploded"]&&(i=le("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":a,key:"chart-".concat(n[t].id)},wp.element.createElement("div",{className:"visualizer-settings__charts-title"},r),"DataTable"===o["visualizer-chart-library"]?wp.element.createElement(R,{id:n[t].id,rows:o["visualizer-data"],columns:o["visualizer-series"],chartsScreen:!0,options:o["visualizer-settings"]}):(o["visualizer-data-exploded"],wp.element.createElement(O,{chartType:a,rows:o["visualizer-data"],columns:o["visualizer-series"],options:G(o["visualizer-settings"]),formatters:Z(o)})),wp.element.createElement("div",{className:"visualizer-settings__charts-footer"},wp.element.createElement("sub",null,i)),wp.element.createElement("div",{className:"visualizer-settings__charts-controls",title:le("Insert Chart"),onClick:function(){return e.props.getChart(n[t].id)}},wp.element.createElement(fe,{icon:"upload"})))}))),!a&&i-1<n.length&&wp.element.createElement(he,{isPrimary:!0,isLarge:!0,onClick:this.loadMoreCharts,isBusy:r},le("Load More"))):wp.element.createElement("p",{className:"visualizer-no-charts"},le("No charts found.")):wp.element.createElement(ge,null,wp.element.createElement(be,null)))}}])&&re(n.prototype,r),a&&re(n,a),t}(de);function we(e){return(we="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 Me(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 ke(e){return(ke=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Le(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ye(e,t){return(Ye=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var De=wp.i18n.__,Te=wp.element.Component,Se=wp.components,Oe=Se.Button,je=Se.ExternalLink,xe=Se.PanelBody,Ee=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t){return!t||"object"!==we(t)&&"function"!=typeof t?Le(e):t}(this,ke(t).apply(this,arguments))).uploadInput=React.createRef(),e.fileUploaded=e.fileUploaded.bind(Le(e)),e.uploadImport=e.uploadImport.bind(Le(e)),e.state={uploadLabel:De("Upload")},e}var n,r,a;return 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&&Ye(e,t)}(t,e),n=t,(r=[{key:"fileUploaded",value:function(e){"text/csv"===e.target.files[0].type&&this.setState({uploadLabel:De("Upload")})}},{key:"uploadImport",value:function(){this.props.readUploadedFile(this.uploadInput),this.setState({uploadLabel:De("Uploaded")})}},{key:"render",value:function(){return wp.element.createElement(xe,{title:De("Import data from file"),initialOpen:!1},wp.element.createElement("p",null,De("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,De("If you are unsure about how to format your data CSV then please take a look at this sample: "),wp.element.createElement(je,{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(Oe,{isPrimary:!0,onClick:this.uploadImport},this.state.uploadLabel))}}])&&Me(n.prototype,r),a&&Me(n,a),t}(Te);function Ce(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 Pe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ce(n,!0).forEach((function(t){He(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ce(n).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function He(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ze(e){return(ze="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 Ae(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 Ne(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var i=e.apply(t,n);function o(e){Ae(i,r,a,o,s,"next",e)}function s(e){Ae(i,r,a,o,s,"throw",e)}o(void 0)}))}}function Fe(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 Re(e){return(Re=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function We(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ie(e,t){return(Ie=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Be=wp.i18n.__,Je=wp,Ue=(Je.apiFetch,Je.apiRequest),qe=wp.element.Component,Ve=wp.components,Ge=Ve.Button,$e=Ve.ExternalLink,Ke=Ve.IconButton,Ze=Ve.Modal,Qe=Ve.PanelBody,Xe=Ve.SelectControl,et=Ve.TextControl,tt=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t){return!t||"object"!==ze(t)&&"function"!=typeof t?We(e):t}(this,Re(t).apply(this,arguments))).openModal=e.openModal.bind(We(e)),e.initTable=e.initTable.bind(We(e)),e.onToggle=e.onToggle.bind(We(e)),e.toggleHeaders=e.toggleHeaders.bind(We(e)),e.getJSONRoot=e.getJSONRoot.bind(We(e)),e.getJSONData=e.getJSONData.bind(We(e)),e.getTableData=e.getTableData.bind(We(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}var n,r,a,i,o,s,l,u;return 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&&Ie(e,t)}(t,e),n=t,(r=[{key:"openModal",value:(u=Ne(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 u.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:(l=Ne(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 l.apply(this,arguments)})},{key:"toggleHeaders",value:function(){this.setState({isHeaderPanelOpen:!this.state.isHeaderPanelOpen})}},{key:"getJSONRoot",value:(s=Ne(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,Ue({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"===ze(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"===ze(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"!==ze(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 s.apply(this,arguments)})},{key:"getJSONData",value:(o=Ne(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,Ue({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"===ze(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"===ze(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"!==ze(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:Be("Don't use pagination"),value:0}],t.data.paging&&"root>next"===t.data.paging[0]&&n.push({label:Be("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 o.apply(this,arguments)})},{key:"getTableData",value:(i=Ne(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,Ue({path:"/visualizer/v1/set-json-data",data:Pe({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"===ze(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"===ze(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"!==ze(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 i.apply(this,arguments)})},{key:"render",value:function(){var e=this;return wp.element.createElement(Qe,{title:Be("Import from JSON"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement("p",null,Be("You can choose here to import or synchronize your chart data with a remote JSON source.")),wp.element.createElement("p",null,wp.element.createElement($e,{href:"https://docs.themeisle.com/article/1052-how-to-generate-charts-from-json-data-rest-endpoints"},Be("For more info check this tutorial."))),wp.element.createElement(Xe,{label:Be("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:Be("One-time"),value:"-1"},{label:Be("Live"),value:"0"},{label:Be("Each hour"),value:"1"},{label:Be("Each 12 hours"),value:"12"},{label:Be("Each day"),value:"24"},{label:Be("Each 3 days"),value:"72"}],onChange:this.props.editSchedule}),wp.element.createElement(Ge,{isPrimary:!0,isLarge:!0,onClick:this.openModal},Be("Modify Parameters")),this.state.isOpen&&wp.element.createElement(Ze,{title:Be("Import from JSON"),className:"visualizer-json-query-modal",shouldCloseOnClickOutside:!1,onRequestClose:function(){e.setState({isOpen:!1,isTableRendered:!1})}},wp.element.createElement(Qe,{title:Be("Step 1: Specify the JSON endpoint/URL"),opened:this.state.isFirstStepOpen,onToggle:function(){return e.onToggle("isFirstStepOpen")}},wp.element.createElement("p",null,Be("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($e,{href:"https://docs.themeisle.com/article/1043-visualizer-how-to-extend-rest-endpoints-with-json-response"},Be("How to extend REST endpoints with JSON response"))),wp.element.createElement(et,{placeholder:Be("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(Ke,{icon:"arrow-right-alt2",label:Be("Add Headers"),onClick:this.toggleHeaders},Be("Add Headers")),this.state.isHeaderPanelOpen&&wp.element.createElement("div",{className:"visualizer-json-query-modal-headers-panel"},wp.element.createElement(Xe,{label:Be("Request Type"),value:this.props.chart["visualizer-json-headers"]?this.props.chart["visualizer-json-headers"].method:this.state.requestHeaders.method,options:[{value:"GET",label:Be("GET")},{value:"POST",label:Be("POST")}],onChange:function(t){var n=Pe({},e.state.requestHeaders),r=e.state.requestHeaders;n.method=t,r=Pe({},r,{method:t}),e.setState({requestHeaders:r}),e.props.editJSONHeaders(n)}}),wp.element.createElement("p",null,Be("Credentials")),wp.element.createElement(et,{label:Be("Username"),placeholder:Be("Username/Access Key"),value:this.props.chart["visualizer-json-headers"]&&"object"===ze(this.props.chart["visualizer-json-headers"].auth)?this.props.chart["visualizer-json-headers"].auth.username:this.state.requestHeaders.username,onChange:function(t){var n=Pe({},e.state.requestHeaders),r=e.state.requestHeaders;n.auth={username:t,password:e.props.chart["visualizer-json-headers"]&&"object"===ze(e.props.chart["visualizer-json-headers"].auth)?e.props.chart["visualizer-json-headers"].auth.password:e.state.requestHeaders.password},r=Pe({},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"},Be("&")),wp.element.createElement(et,{label:Be("Password"),placeholder:Be("Password/Secret Key"),type:"password",value:this.props.chart["visualizer-json-headers"]&&"object"===ze(this.props.chart["visualizer-json-headers"].auth)?this.props.chart["visualizer-json-headers"].auth.password:this.state.requestHeaders.password,onChange:function(t){var n=Pe({},e.state.requestHeaders),r=e.state.requestHeaders;n.auth={username:e.props.chart["visualizer-json-headers"]&&"object"===ze(e.props.chart["visualizer-json-headers"].auth)?e.props.chart["visualizer-json-headers"].auth.username:e.state.requestHeaders.username,password:t},r=Pe({},r,{username:n.username,password:t}),e.setState({requestHeaders:r}),e.props.editJSONHeaders(n)}}),wp.element.createElement("p",null,Be("OR")),wp.element.createElement(et,{label:Be("Authorization"),placeholder:Be("e.g. SharedKey <AccountName>:<Signature>"),value:this.props.chart["visualizer-json-headers"]&&"object"!==ze(this.props.chart["visualizer-json-headers"].auth)?this.props.chart["visualizer-json-headers"].auth:this.state.requestHeaders.auth,onChange:function(t){var n=Pe({},e.state.requestHeaders),r=e.state.requestHeaders;n.auth=t,r=Pe({},r,{auth:t}),e.setState({requestHeaders:r}),e.props.editJSONHeaders(n)}})),wp.element.createElement(Ge,{isPrimary:!0,isLarge:!0,isBusy:this.state.isLoading,disabled:this.state.isLoading,onClick:this.getJSONRoot},Be("Fetch Endpoint"))),wp.element.createElement(Qe,{title:Be("Step 2: Choose the JSON root"),initialOpen:!1,opened:this.state.isSecondStepOpen,onToggle:function(){return e.onToggle("isSecondStepOpen")}},wp.element.createElement("p",null,Be("If you see Invalid Data, you may have selected the wrong root to fetch data from. Please select an alternative.")),wp.element.createElement(Xe,{value:this.props.chart["visualizer-json-root"],options:this.state.endpointRoots,onChange:this.props.editJSONRoot}),wp.element.createElement(Ge,{isPrimary:!0,isLarge:!0,isBusy:this.state.isLoading,disabled:this.state.isLoading,onClick:this.getJSONData},Be("Parse Endpoint"))),wp.element.createElement(Qe,{title:Be("Step 3: Specify miscellaneous parameters"),initialOpen:!1,opened:this.state.isThirdStepOpen,onToggle:function(){return e.onToggle("isThirdStepOpen")}},"community"!==visualizerLocalize.isPro?wp.element.createElement(Xe,{value:this.props.chart["visualizer-json-paging"]||0,options:this.state.endpointPaging,onChange:this.props.editJSONPaging}):wp.element.createElement("p",null,Be("Enable this feature in PRO version!"))),wp.element.createElement(Qe,{title:Be("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,Be("Select whether to include the data in the chart. Each column selected will form one series.")),wp.element.createElement("li",null,Be("If a column is selected to be included, specify its data type.")),wp.element.createElement("li",null,Be("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,Be("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(Ge,{isPrimary:!0,isLarge:!0,isBusy:this.state.isLoading,disabled:this.state.isLoading,onClick:this.getTableData},Be("Save & Show Chart")))))}}])&&Fe(n.prototype,r),a&&Fe(n,a),t}(qe);function nt(e){return(nt="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 rt(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 at(e,t){return!t||"object"!==nt(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 it(e){return(it=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ot(e,t){return(ot=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var st=wp.i18n.__,lt=wp.element.Component,ut=wp.components,ct=ut.Button,dt=ut.ExternalLink,mt=ut.PanelBody,pt=ut.SelectControl,ht=ut.TextControl,ft=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),at(this,it(t).apply(this,arguments))}var n,r,a;return 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&&ot(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this;return wp.element.createElement(mt,{title:st("Import data from URL"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(mt,{title:st("One Time Import"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement("p",null,st("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,st("If you are unsure about how to format your data CSV then please take a look at this sample: "),wp.element.createElement(dt,{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,st("You can also import data from Google Spreadsheet.")),wp.element.createElement(ht,{placeholder:st("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(ct,{isPrimary:!0,isLarge:!0,isBusy:"uploadData"===this.props.isLoading,disabled:"uploadData"===this.props.isLoading,onClick:function(){return e.props.uploadData(!1)}},st("Import Data"))),"business"===visualizerLocalize.isPro?wp.element.createElement(mt,{title:st("Schedule Import"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement("p",null,st("You can choose here to synchronize your chart data with a remote CSV file. ")),wp.element.createElement("p",null,st("You can also synchronize with your Google Spreadsheet file.")),wp.element.createElement("p",null,st("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(ht,{placeholder:st("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(pt,{label:st("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:st("Each hour"),value:"1"},{label:st("Each 12 hours"),value:"12"},{label:st("Each day"),value:"24"},{label:st("Each 3 days"),value:"72"}],onChange:this.props.editSchedule}),wp.element.createElement(ct,{isPrimary:!0,isLarge:!0,isBusy:"uploadData"===this.props.isLoading,disabled:"uploadData"===this.props.isLoading,onClick:function(){return e.props.uploadData(!0)}},st("Save Schedule"))):wp.element.createElement(mt,{title:st("Schedule Import"),icon:"lock",className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement("p",null,st("Upgrade your license to at least the DEVELOPER version to activate this feature!")),wp.element.createElement(ct,{isPrimary:!0,href:visualizerLocalize.proTeaser,target:"_blank"},st("Buy Now"))),wp.element.createElement(tt,{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}))}}])&&rt(n.prototype,r),a&&rt(n,a),t}(lt);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 yt(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 gt(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 bt(e,t){return!t||"object"!==_t(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 vt(e){return(vt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function wt(e,t){return(wt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Mt=wp.i18n.__,kt=wp.apiFetch,Lt=wp.element,Yt=Lt.Component,Dt=Lt.Fragment,Tt=wp.components,St=Tt.Button,Ot=Tt.PanelBody,jt=Tt.Placeholder,xt=Tt.SelectControl,Et=Tt.Spinner,Ct=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=bt(this,vt(t).apply(this,arguments))).state={id:"",charts:[]},e}var n,r,a,i,o;return 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&&wt(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:(i=regeneratorRuntime.mark((function e(){var t,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,kt({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)})),o=function(){var e=this,t=arguments;return new Promise((function(n,r){var a=i.apply(e,t);function o(e){yt(a,n,r,o,s,"next",e)}function s(e){yt(a,n,r,o,s,"throw",e)}o(void 0)}))},function(){return o.apply(this,arguments)})},{key:"render",value:function(){var e=this;return"community"!==visualizerLocalize.isPro?wp.element.createElement(Ot,{title:Mt("Import from other chart"),initialOpen:!1},1<=this.state.charts.length?wp.element.createElement(Dt,null,wp.element.createElement(xt,{label:Mt("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(St,{isPrimary:!0,isLarge:!0,isBusy:"getChartData"===this.props.isLoading,onClick:function(){return e.props.getChartData(e.state.id)}},Mt("Import Chart"))):wp.element.createElement(jt,null,wp.element.createElement(Et,null))):wp.element.createElement(Ot,{title:Mt("Import from other chart"),icon:"lock",initialOpen:!1},wp.element.createElement("p",null,Mt("Enable this feature in PRO version!")),wp.element.createElement(St,{isPrimary:!0,href:visualizerLocalize.proTeaser,target:"_blank"},Mt("Buy Now")))}}])&&gt(n.prototype,r),a&&gt(n,a),t}(Yt);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,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){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 At(e){return(At=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Nt(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ft(e,t){return(Ft=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Rt=wp.i18n.__,Wt=wp.apiRequest,It=wp.components,Bt=It.Button,Jt=It.ExternalLink,Ut=wp.element,qt=Ut.Component,Vt=Ut.Fragment,Gt=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t){return!t||"object"!==Pt(t)&&"function"!=typeof t?Nt(e):t}(this,At(t).apply(this,arguments))).onSave=e.onSave.bind(Nt(e)),e.state={isLoading:!1,success:!1,query:"",name:"",series:{},data:[]},e}var n,r,a,i,o;return 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&&Ft(e,t)}(t,e),n=t,(r=[{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:(i=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,Wt({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)})),o=function(){var e=this,t=arguments;return new Promise((function(n,r){var a=i.apply(e,t);function o(e){Ht(a,n,r,o,s,"next",e)}function s(e){Ht(a,n,r,o,s,"throw",e)}o(void 0)}))},function(){return o.apply(this,arguments)})},{key:"render",value:function(){var e=this;return wp.element.createElement(Vt,null,wp.element.createElement("textarea",{className:"visualizer-db-query",placeholder:Rt("Your query goes here…")},this.props.chart["visualizer-db-query"]),wp.element.createElement("div",{className:"visualizer-db-query-actions"},wp.element.createElement(Bt,{isLarge:!0,isDefault:!0,isBusy:this.state.isLoading,onClick:this.onSave},Rt("Show Results")),wp.element.createElement(Bt,{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)}},Rt("Save"))),wp.element.createElement("ul",null,wp.element.createElement("li",null,wp.element.createElement(Jt,{href:"https://docs.themeisle.com/article/970-visualizer-sample-queries-to-generate-charts"},Rt("Examples of queries and links to resources that you can use with this feature."))),wp.element.createElement("li",null,Rt("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"}))}}])&&zt(n.prototype,r),a&&zt(n,a),t}(qt);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){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 Zt(e){return(Zt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Qt(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Xt(e,t){return(Xt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var en=wp.i18n.__,tn=wp.element.Component,nn=wp.components,rn=nn.Button,an=nn.Modal,on=nn.PanelBody,sn=nn.SelectControl,ln=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t){return!t||"object"!==$t(t)&&"function"!=typeof t?Qt(e):t}(this,Zt(t).apply(this,arguments))).save=e.save.bind(Qt(e)),e.state={isOpen:!1},e}var n,r,a;return 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)}(t,e),n=t,(r=[{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(on,{title:en("Import data from database"),icon:"lock",initialOpen:!1},wp.element.createElement("p",null,en("Upgrade your license to at least the DEVELOPER version to activate this feature!")),wp.element.createElement(rn,{isPrimary:!0,href:visualizerLocalize.proTeaser,target:"_blank"},en("Buy Now"))):wp.element.createElement(on,{title:en("Import data from database"),initialOpen:!1},wp.element.createElement("p",null,en("You can import data from the database here.")),wp.element.createElement("p",null,en("How often do you want to refresh the data from the database.")),wp.element.createElement(sn,{label:en("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:en("Live"),value:"0"},{label:en("Each hour"),value:"1"},{label:en("Each 12 hours"),value:"12"},{label:en("Each day"),value:"24"},{label:en("Each 3 days"),value:"72"}],onChange:this.props.editSchedule}),wp.element.createElement(rn,{isPrimary:!0,isLarge:!0,onClick:function(){return e.setState({isOpen:!0})}},en("Create Query")),this.state.isOpen&&wp.element.createElement(an,{title:en("Import from database"),onRequestClose:function(){return e.setState({isOpen:!1})},className:"visualizer-db-query-modal",shouldCloseOnClickOutside:!1},wp.element.createElement(Gt,{chart:this.props.chart,changeQuery:this.props.changeQuery,save:this.save})))}}])&&Kt(n.prototype,r),a&&Kt(n,a),t}(tn),un=n(132);n(152);function cn(e){return(cn="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 dn(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 mn(e,t){return!t||"object"!==cn(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 pn(e){return(pn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function hn(e,t){return(hn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var fn=wp.i18n.__,_n=wp.element.Component,yn=wp.components,gn=yn.Button,bn=yn.ButtonGroup,vn=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=mn(this,pn(t).apply(this,arguments))).data=[],e.dates=[],e.types=["string","number","boolean","date","datetime","timeofday"],e}var n,r,a;return 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&&hn(e,t)}(t,e),n=t,(r=[{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(un.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(bn,null,wp.element.createElement(gn,{isDefault:!0,isLarge:!0,onClick:this.props.toggleModal},fn("Close")),wp.element.createElement(gn,{isPrimary:!0,isLarge:!0,onClick:function(t){e.props.toggleModal(),e.props.editChartData(e.data,"Visualizer_Source_Csv")}},fn("Save"))))}}])&&dn(n.prototype,r),a&&dn(n,a),t}(_n);function wn(e){return(wn="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 Mn(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 kn(e){return(kn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Ln(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Yn(e,t){return(Yn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Dn=wp.i18n.__,Tn=wp.element,Sn=Tn.Component,On=Tn.Fragment,jn=wp.components,xn=jn.Button,En=jn.Modal,Cn=jn.PanelBody,Pn=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t){return!t||"object"!==wn(t)&&"function"!=typeof t?Ln(e):t}(this,kn(t).apply(this,arguments))).toggleModal=e.toggleModal.bind(Ln(e)),e.state={isOpen:!1},e}var n,r,a;return 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)}(t,e),n=t,(r=[{key:"toggleModal",value:function(){this.setState({isOpen:!this.state.isOpen})}},{key:"render",value:function(){return"community"!==visualizerLocalize.isPro?wp.element.createElement(On,null,wp.element.createElement(Cn,{title:Dn("Manual Data"),initialOpen:!1},wp.element.createElement("p",null,Dn("You can manually edit the chart data using a spreadsheet like editor.")),wp.element.createElement(xn,{isPrimary:!0,isLarge:!0,isBusy:this.state.isOpen,onClick:this.toggleModal},Dn("View Editor"))),this.state.isOpen&&wp.element.createElement(En,{title:"Chart Editor",onRequestClose:this.toggleModal,shouldCloseOnClickOutside:!1},wp.element.createElement(vn,{chart:this.props.chart,editChartData:this.props.editChartData,toggleModal:this.toggleModal}))):wp.element.createElement(Cn,{title:Dn("Manual Data"),icon:"lock",initialOpen:!1},wp.element.createElement("p",null,Dn("Enable this feature in PRO version!")),wp.element.createElement(xn,{isPrimary:!0,href:visualizerLocalize.proTeaser,target:"_blank"},Dn("Buy Now")))}}])&&Mn(n.prototype,r),a&&Mn(n,a),t}(Sn);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 zn(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 An(e,t){return!t||"object"!==Hn(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 Nn(e){return(Nn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Fn(e,t){return(Fn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Rn=wp.i18n.__,Wn=wp.element.Component,In=(wp.blockEditor||wp.editor).ColorPalette,Bn=wp.components,Jn=Bn.BaseControl,Un=Bn.CheckboxControl,qn=Bn.PanelBody,Vn=Bn.SelectControl,Gn=Bn.TextControl,$n=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),An(this,Nn(t).apply(this,arguments))}var n,r,a;return 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&&Fn(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-chart-type"],n=this.props.chart["visualizer-settings"],r=[{label:Rn("The tooltip will be displayed when the user hovers over an element"),value:"focus"}];-1>=["timeline"].indexOf(t)&&(r[1]={label:Rn("The tooltip will be displayed when the user selects an element"),value:"selection"}),r[2]={label:Rn("The tooltip will not be displayed"),value:"none"};var a=[{label:Rn("Left of the chart"),value:"left"},{label:Rn("Right of the chart"),value:"right"},{label:Rn("Above the chart"),value:"top"},{label:Rn("Below the chart"),value:"bottom"},{label:Rn("Omit the legend"),value:"none"}];"pie"!==t&&a.push({label:Rn("Inside the chart"),value:"in"});var i=Rn("Text to display above the chart.");return 0<=["tabular","dataTable","gauge","geo","timeline"].indexOf(t)&&(i=Rn("Text to display in the back-end admin area")),wp.element.createElement(qn,{title:Rn("General Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(qn,{title:Rn("Title"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Gn,{label:Rn("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(Vn,{label:Rn("Chart Title Position"),help:Rn("Where to place the chart title, compared to the chart area."),value:n.titlePosition?n.titlePosition:"out",options:[{label:Rn("Inside the chart"),value:"in"},{label:Rn("Outside the chart"),value:"out"},{label:Rn("None"),value:"none"}],onChange:function(t){n.titlePosition=t,e.props.edit(n)}}),-1>=["tabular","dataTable","gauge","geo","timeline"].indexOf(t)&&wp.element.createElement(Jn,{label:Rn("Chart Title Color")},wp.element.createElement(In,{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(Vn,{label:Rn("Axes Titles Position"),help:Rn("Determines where to place the axis titles, compared to the chart area."),value:n.axisTitlesPosition?n.axisTitlesPosition:"out",options:[{label:Rn("Inside the chart"),value:"in"},{label:Rn("Outside the chart"),value:"out"},{label:Rn("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(qn,{title:Rn("Font Styles"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Vn,{label:Rn("Font Family"),help:Rn("The default font family for all text in the chart."),value:n.fontName?n.fontName:"Arial",options:[{label:Rn("Arial"),value:"Arial"},{label:Rn("Sans Serif"),value:"Sans Serif"},{label:Rn("Serif"),value:"serif"},{label:Rn("Arial"),value:"Arial"},{label:Rn("Wide"),value:"Arial black"},{label:Rn("Narrow"),value:"Arial Narrow"},{label:Rn("Comic Sans MS"),value:"Comic Sans MS"},{label:Rn("Courier New"),value:"Courier New"},{label:Rn("Garamond"),value:"Garamond"},{label:Rn("Georgia"),value:"Georgia"},{label:Rn("Tahoma"),value:"Tahoma"},{label:Rn("Verdana"),value:"Verdana"}],onChange:function(t){n.fontName=t,e.props.edit(n)}}),wp.element.createElement(Vn,{label:Rn("Font Size"),help:Rn("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(qn,{title:Rn("Legend"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Vn,{label:Rn("Position"),help:Rn("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;Object.keys(n.series).map((function(e){n.series[e].targetAxisIndex=a}))}n.legend.position=r,e.props.edit(n)}}),wp.element.createElement(Vn,{label:Rn("Alignment"),help:Rn("Determines the alignment of the legend."),value:n.legend.alignment?n.legend.alignment:"15",options:[{label:Rn("Aligned to the start of the allocated area"),value:"start"},{label:Rn("Centered in the allocated area"),value:"center"},{label:Rn("Aligned to the end of the allocated area"),value:"end"}],onChange:function(t){n.legend.alignment=t,e.props.edit(n)}}),wp.element.createElement(Jn,{label:Rn("Font Color")},wp.element.createElement(In,{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(qn,{title:Rn("Tooltip"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Vn,{label:Rn("Trigger"),help:Rn("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(Vn,{label:Rn("Show Color Code"),help:Rn("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:Rn("Yes"),value:"1"},{label:Rn("No"),value:"0"}],onChange:function(t){n.tooltip.showColorCode=t,e.props.edit(n)}}),0<=["pie"].indexOf(t)&&wp.element.createElement(Vn,{label:Rn("Text"),help:Rn("Determines what information to display when the user hovers over a pie slice."),value:n.tooltip.text?n.tooltip.text:"both",options:[{label:Rn("Display both the absolute value of the slice and the percentage of the whole"),value:"both"},{label:Rn("Display only the absolute value of the slice"),value:"value"},{label:Rn("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(qn,{title:Rn("Animation"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Un,{label:Rn("Animate on startup?"),help:Rn("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(Gn,{label:Rn("Duration"),help:Rn("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(Vn,{label:Rn("Easing"),help:Rn("The easing function applied to the animation."),value:n.animation.easing?n.animation.easing:"linear",options:[{label:Rn("Constant speed"),value:"linear"},{label:Rn("Start slow and speed up"),value:"in"},{label:Rn("Start fast and slow down"),value:"out"},{label:Rn("Start slow, speed up, then slow down"),value:"inAndOut"}],onChange:function(t){n.animation.easing=t,e.props.edit(n)}})))}}])&&zn(n.prototype,r),a&&zn(n,a),t}(Wn);function Kn(e){return(Kn="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 Zn(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!t||"object"!==Kn(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 Xn(e){return(Xn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function er(e,t){return(er=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var tr=wp.i18n.__,nr=wp.element.Component,rr=wp.components,ar=rr.PanelBody,ir=rr.Notice,or=rr.TextControl,sr=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Qn(this,Xn(t).apply(this,arguments))}var n,r,a;return 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&&er(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(ar,{title:tr("Instance Settings"),initialOpen:!0,className:"visualizer-instance-panel"},wp.element.createElement(ir,{status:"info",isDismissible:!1},wp.element.createElement("p",null,tr("These settings are valid only for this instance of the chart.")),wp.element.createElement("p",null,tr("This means that if you insert this chart again elsewhere, these values will not persist."))),wp.element.createElement(or,{label:tr("Should this instance lazy Load?"),help:tr("-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)}}))}}])&&Zn(n.prototype,r),a&&Zn(n,a),t}(nr);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 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!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 dr(e){return(dr=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function mr(e,t){return(mr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var pr=wp.i18n.__,hr=wp.element,fr=hr.Component,_r=hr.Fragment,yr=(wp.blockEditor||wp.editor).ColorPalette,gr=wp.components,br=gr.BaseControl,vr=gr.ExternalLink,wr=gr.PanelBody,Mr=gr.SelectControl,kr=gr.TextControl,Lr=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),cr(this,dr(t).apply(this,arguments))}var n,r,a;return 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&&mr(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-chart-type"],n=this.props.chart["visualizer-settings"];return wp.element.createElement(wr,{title:pr("Horizontal Axis Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(wr,{title:pr("General Settings"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(kr,{label:pr("Axis Title"),help:pr("The title of the horizontal axis."),value:n.hAxis.title,onChange:function(t){n.hAxis.title=t,e.props.edit(n)}}),wp.element.createElement(Mr,{label:pr("Text Position"),help:pr("Position of the horizontal axis text, relative to the chart area."),value:n.hAxis.textPosition?n.hAxis.textPosition:"out",options:[{label:pr("Inside the chart"),value:"in"},{label:pr("Outside the chart"),value:"out"},{label:pr("None"),value:"none"}],onChange:function(t){n.hAxis.textPosition=t,e.props.edit(n)}}),wp.element.createElement(Mr,{label:pr("Direction"),help:pr("The direction in which the values along the horizontal axis grow."),value:n.hAxis.direction?n.hAxis.direction:"1",options:[{label:pr("Identical Direction"),value:"1"},{label:pr("Reverse Direction"),value:"-1"}],onChange:function(t){n.hAxis.direction=t,e.props.edit(n)}}),wp.element.createElement(br,{label:pr("Base Line Color")},wp.element.createElement(yr,{value:n.hAxis.baselineColor,onChange:function(t){n.hAxis.baselineColor=t,e.props.edit(n)}})),wp.element.createElement(br,{label:pr("Axis Text Color")},wp.element.createElement(yr,{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(_r,null,wp.element.createElement(kr,{label:pr("Number Format"),help:pr("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,pr("For number axis labels, this is a subset of the formatting "),wp.element.createElement(vr,{href:"http://icu-project.org/apiref/icu4c/classDecimalFormat.html#_details"},pr("ICU pattern set.")),pr(" 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,pr("For date axis labels, this is a subset of the date formatting "),wp.element.createElement(vr,{href:"http://userguide.icu-project.org/formatparse/datetime#TOC-Date-Time-Format-Syntax"},pr("ICU date and time format."))))),-1>=["column"].indexOf(t)&&wp.element.createElement(_r,null,wp.element.createElement(wr,{title:pr("Grid Lines"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(kr,{label:pr("Count"),help:pr("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(br,{label:pr("Color")},wp.element.createElement(yr,{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(wr,{title:pr("Minor Grid Lines"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(kr,{label:pr("Count"),help:pr("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(br,{label:pr("Color")},wp.element.createElement(yr,{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(wr,{title:pr("View Window"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(kr,{label:pr("Maximun Value"),help:pr("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(kr,{label:pr("Minimum Value"),help:pr("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)}}))))}}])&&ur(n.prototype,r),a&&ur(n,a),t}(fr);function Yr(e){return(Yr="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 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!t||"object"!==Yr(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 Sr(e){return(Sr=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Or(e,t){return(Or=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var jr=wp.i18n.__,xr=wp.element,Er=xr.Component,Cr=xr.Fragment,Pr=(wp.blockEditor||wp.editor).ColorPalette,Hr=wp.components,zr=Hr.BaseControl,Ar=Hr.ExternalLink,Nr=Hr.PanelBody,Fr=Hr.SelectControl,Rr=Hr.TextControl,Wr=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Tr(this,Sr(t).apply(this,arguments))}var n,r,a;return 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&&Or(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-chart-type"],n=this.props.chart["visualizer-settings"];return wp.element.createElement(Nr,{title:jr("Vertical Axis Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(Nr,{title:jr("General Settings"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Rr,{label:jr("Axis Title"),help:jr("The title of the Vertical axis."),value:n.vAxis.title,onChange:function(t){n.vAxis.title=t,e.props.edit(n)}}),wp.element.createElement(Fr,{label:jr("Text Position"),help:jr("Position of the Vertical axis text, relative to the chart area."),value:n.vAxis.textPosition?n.vAxis.textPosition:"out",options:[{label:jr("Inside the chart"),value:"in"},{label:jr("Outside the chart"),value:"out"},{label:jr("None"),value:"none"}],onChange:function(t){n.vAxis.textPosition=t,e.props.edit(n)}}),wp.element.createElement(Fr,{label:jr("Direction"),help:jr("The direction in which the values along the Vertical axis grow."),value:n.vAxis.direction?n.vAxis.direction:"1",options:[{label:jr("Identical Direction"),value:"1"},{label:jr("Reverse Direction"),value:"-1"}],onChange:function(t){n.vAxis.direction=t,e.props.edit(n)}}),wp.element.createElement(zr,{label:jr("Base Line Color")},wp.element.createElement(Pr,{value:n.vAxis.baselineColor,onChange:function(t){n.vAxis.baselineColor=t,e.props.edit(n)}})),wp.element.createElement(zr,{label:jr("Axis Text Color")},wp.element.createElement(Pr,{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(Cr,null,wp.element.createElement(Rr,{label:jr("Number Format"),help:jr("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,jr("For number axis labels, this is a subset of the formatting "),wp.element.createElement(Ar,{href:"http://icu-project.org/apiref/icu4c/classDecimalFormat.html#_details"},jr("ICU pattern set.")),jr(" 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,jr("For date axis labels, this is a subset of the date formatting "),wp.element.createElement(Ar,{href:"http://userguide.icu-project.org/formatparse/datetime#TOC-Date-Time-Format-Syntax"},jr("ICU date and time format."))))),-1>=["bar"].indexOf(t)&&wp.element.createElement(Cr,null,wp.element.createElement(Nr,{title:jr("Grid Lines"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Rr,{label:jr("Count"),help:jr("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(zr,{label:jr("Color")},wp.element.createElement(Pr,{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(Nr,{title:jr("Minor Grid Lines"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Rr,{label:jr("Count"),help:jr("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(zr,{label:jr("Color")},wp.element.createElement(Pr,{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(Nr,{title:jr("View Window"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Rr,{label:jr("Maximun Value"),help:jr("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(Rr,{label:jr("Minimum Value"),help:jr("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)}}))))}}])&&Dr(n.prototype,r),a&&Dr(n,a),t}(Er);function Ir(e){return(Ir="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 Br(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 Jr(e,t){return!t||"object"!==Ir(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 Ur(e){return(Ur=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function qr(e,t){return(qr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Vr=wp.i18n.__,Gr=wp.element,$r=Gr.Component,Kr=Gr.Fragment,Zr=(wp.blockEditor||wp.editor).ColorPalette,Qr=wp.components,Xr=Qr.BaseControl,ea=Qr.ExternalLink,ta=Qr.PanelBody,na=Qr.SelectControl,ra=Qr.TextControl,aa=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Jr(this,Ur(t).apply(this,arguments))}var n,r,a;return 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&&qr(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(ta,{title:Vr("Pie Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(Kr,null,wp.element.createElement(ra,{label:Vr("Number Format"),help:Vr("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,Vr("For number axis labels, this is a subset of the formatting "),wp.element.createElement(ea,{href:"http://icu-project.org/apiref/icu4c/classDecimalFormat.html#_details"},Vr("ICU pattern set.")),Vr(" 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,Vr("For date axis labels, this is a subset of the date formatting "),wp.element.createElement(ea,{href:"http://userguide.icu-project.org/formatparse/datetime#TOC-Date-Time-Format-Syntax"},Vr("ICU date and time format.")))),wp.element.createElement(na,{label:Vr("Is 3D"),help:Vr("If set to yes, displays a three-dimensional chart."),value:t.is3D?t.is3D:"0",options:[{label:Vr("Yes"),value:"1"},{label:Vr("No"),value:"0"}],onChange:function(n){t.is3D=n,e.props.edit(t)}}),wp.element.createElement(na,{label:Vr("Reverse Categories"),help:Vr("If set to yes, will draw slices counterclockwise."),value:t.reverseCategories?t.reverseCategories:"0",options:[{label:Vr("Yes"),value:"1"},{label:Vr("No"),value:"0"}],onChange:function(n){t.reverseCategories=n,e.props.edit(t)}}),wp.element.createElement(na,{label:Vr("Slice Text"),help:Vr("The content of the text displayed on the slice."),value:t.pieSliceText?t.pieSliceText:"percentage",options:[{label:Vr("The percentage of the slice size out of the total"),value:"percentage"},{label:Vr("The quantitative value of the slice"),value:"value"},{label:Vr("The name of the slice"),value:"label"},{label:Vr("The quantitative value and percentage of the slice"),value:"value-and-percentage"},{label:Vr("No text is displayed"),value:"none"}],onChange:function(n){t.pieSliceText=n,e.props.edit(t)}}),wp.element.createElement(ra,{label:Vr("Pie Hole"),help:Vr("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:Vr("0.5"),value:t.pieHole,onChange:function(n){t.pieHole=n,e.props.edit(t)}}),wp.element.createElement(ra,{label:Vr("Start Angle"),help:Vr("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(Xr,{label:Vr("Slice Border Color")},wp.element.createElement(Zr,{value:t.pieSliceBorderColor,onChange:function(n){t.pieSliceBorderColor=n,e.props.edit(t)}})))}}])&&Br(n.prototype,r),a&&Br(n,a),t}($r);function ia(e){return(ia="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 oa(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 sa(e,t){return!t||"object"!==ia(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 la(e){return(la=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ua(e,t){return(ua=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var ca=wp.i18n.__,da=wp.element.Component,ma=(wp.blockEditor||wp.editor).ColorPalette,pa=wp.components,ha=pa.BaseControl,fa=pa.PanelBody,_a=pa.TextControl,ya=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),sa(this,la(t).apply(this,arguments))}var n,r,a;return 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&&ua(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(fa,{title:ca("Residue Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(_a,{label:ca("Visibility Threshold"),help:ca("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:ca("0.001388889"),value:t.sliceVisibilityThreshold,onChange:function(n){t.sliceVisibilityThreshold=n,e.props.edit(t)}}),wp.element.createElement(_a,{label:ca("Residue Slice Label"),help:ca("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(ha,{label:ca("Residue Slice Color")},wp.element.createElement(ma,{value:t.pieResidueSliceColor,onChange:function(n){t.pieResidueSliceColor=n,e.props.edit(t)}})))}}])&&oa(n.prototype,r),a&&oa(n,a),t}(da);function ga(e){return(ga="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 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 va(e,t){return!t||"object"!==ga(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 wa(e){return(wa=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Ma(e,t){return(Ma=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var ka=wp.i18n.__,La=wp.element,Ya=La.Component,Da=La.Fragment,Ta=wp.components,Sa=Ta.PanelBody,Oa=Ta.SelectControl,ja=Ta.TextControl,xa=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),va(this,wa(t).apply(this,arguments))}var n,r,a;return 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&&Ma(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-chart-type"],n=this.props.chart["visualizer-settings"];return wp.element.createElement(Sa,{title:ka("Lines Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(ja,{label:ka("Line Width"),help:ka("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(ja,{label:ka("Point Size"),help:ka("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(Oa,{label:ka("Curve Type"),help:ka("Determines whether the series has to be presented in the legend or not."),value:n.curveType?n.curveType:"none",options:[{label:ka("Straight line without curve"),value:"none"},{label:ka("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(Oa,{label:ka("Focus Target"),help:ka("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:ka("Focus on a single data point."),value:"datum"},{label:ka("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(Oa,{label:ka("Selection Mode"),help:ka("Determines how many data points an user can select on a chart."),value:n.selectionMode?n.selectionMode:"single",options:[{label:ka("Single data point"),value:"single"},{label:ka("Multiple data points"),value:"multiple"}],onChange:function(t){n.selectionMode=t,e.props.edit(n)}}),wp.element.createElement(Oa,{label:ka("Aggregation Target"),help:ka("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:ka("Group selected data by x-value"),value:"category"},{label:ka("Group selected data by series"),value:"series"},{label:ka("Group selected data by x-value if all selections have the same x-value, and by series otherwise"),value:"auto"},{label:ka("Show only one tooltip per selection"),value:"none"}],onChange:function(t){n.aggregationTarget=t,e.props.edit(n)}}),wp.element.createElement(ja,{label:ka("Point Opacity"),help:ka("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(Da,null,wp.element.createElement(ja,{label:ka("Area Opacity"),help:ka("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(Oa,{label:ka("Is Stacked"),help:ka("If set to yes, series elements are stacked."),value:n.isStacked?n.isStacked:"0",options:[{label:ka("Yes"),value:"1"},{label:ka("No"),value:"0"}],onChange:function(t){n.isStacked=t,e.props.edit(n)}})),-1>=["scatter","area"].indexOf(t)&&wp.element.createElement(Oa,{label:ka("Interpolate Nulls"),help:ka("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:ka("Yes"),value:"1"},{label:ka("No"),value:"0"}],onChange:function(t){n.interpolateNulls=t,e.props.edit(n)}}))}}])&&ba(n.prototype,r),a&&ba(n,a),t}(Ya);function Ea(e){return(Ea="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 Ca(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 Pa(e,t){return!t||"object"!==Ea(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 Ha(e){return(Ha=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function za(e,t){return(za=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Aa=wp.i18n.__,Na=wp.element.Component,Fa=wp.components,Ra=Fa.PanelBody,Wa=Fa.SelectControl,Ia=Fa.TextControl,Ba=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Pa(this,Ha(t).apply(this,arguments))}var n,r,a;return 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&&za(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(Ra,{title:Aa("Bars Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(Wa,{label:Aa("Focus Target"),help:Aa("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:Aa("Focus on a single data point."),value:"datum"},{label:Aa("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(Wa,{label:Aa("Is Stacked"),help:Aa("If set to yes, series elements are stacked."),value:t.isStacked?t.isStacked:"0",options:[{label:Aa("Yes"),value:"1"},{label:Aa("No"),value:"0"}],onChange:function(n){t.isStacked=n,e.props.edit(t)}}),wp.element.createElement(Ia,{label:Aa("Bars Opacity"),help:Aa("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)}}))}}])&&Ca(n.prototype,r),a&&Ca(n,a),t}(Na);function Ja(e){return(Ja="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 Ua(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 qa(e,t){return!t||"object"!==Ja(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 Va(e){return(Va=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Ga(e,t){return(Ga=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var $a=wp.i18n.__,Ka=wp.element.Component,Za=(wp.blockEditor||wp.editor).ColorPalette,Qa=wp.components,Xa=Qa.BaseControl,ei=Qa.PanelBody,ti=Qa.SelectControl,ni=Qa.TextControl,ri=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),qa(this,Va(t).apply(this,arguments))}var n,r,a;return 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&&Ga(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(ei,{title:$a("Candles Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(ei,{title:$a("General Settings"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(ti,{label:$a("Focus Target"),help:$a("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:$a("Focus on a single data point."),value:"datum"},{label:$a("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(ti,{label:$a("Selection Mode"),help:$a("Determines how many data points an user can select on a chart."),value:t.selectionMode?t.selectionMode:"single",options:[{label:$a("Single data point"),value:"single"},{label:$a("Multiple data points"),value:"multiple"}],onChange:function(n){t.selectionMode=n,e.props.edit(t)}}),wp.element.createElement(ti,{label:$a("Aggregation Target"),help:$a("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:$a("Group selected data by x-value"),value:"category"},{label:$a("Group selected data by series"),value:"series"},{label:$a("Group selected data by x-value if all selections have the same x-value, and by series otherwise"),value:"auto"},{label:$a("Show only one tooltip per selection"),value:"none"}],onChange:function(n){t.aggregationTarget=n,e.props.edit(t)}})),wp.element.createElement(ei,{title:$a("Failing Candles"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(ni,{label:$a("Stroke Width"),help:$a("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(Xa,{label:$a("Stroke Color")},wp.element.createElement(Za,{value:t.candlestick.fallingColor.stroke,onChange:function(n){t.candlestick.fallingColor.stroke=n,e.props.edit(t)}})),wp.element.createElement(Xa,{label:$a("Fill Color")},wp.element.createElement(Za,{value:t.candlestick.fallingColor.fill,onChange:function(n){t.candlestick.fallingColor.fill=n,e.props.edit(t)}}))),wp.element.createElement(ei,{title:$a("Rising Candles"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(ni,{label:$a("Stroke Width"),help:$a("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(Xa,{label:$a("Stroke Color")},wp.element.createElement(Za,{value:t.candlestick.risingColor.stroke,onChange:function(n){t.candlestick.risingColor.stroke=n,e.props.edit(t)}})),wp.element.createElement(Xa,{label:$a("Fill Color")},wp.element.createElement(Za,{value:t.candlestick.risingColor.fill,onChange:function(n){t.candlestick.risingColor.fill=n,e.props.edit(t)}}))))}}])&&Ua(n.prototype,r),a&&Ua(n,a),t}(Ka);function ai(e){return(ai="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 ii(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 oi(e,t){return!t||"object"!==ai(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 si(e){return(si=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function li(e,t){return(li=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var ui=wp.i18n.__,ci=wp.element.Component,di=wp.components,mi=di.ExternalLink,pi=di.PanelBody,hi=di.SelectControl,fi=di.TextControl,_i=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),oi(this,si(t).apply(this,arguments))}var n,r,a;return 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&&li(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(pi,{title:ui("Map Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(pi,{title:ui("API"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(fi,{label:ui("API Key"),help:ui("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(mi,{href:"https://developers.google.com/maps/documentation/javascript/get-api-key"},ui("Get API Keys"))),wp.element.createElement(pi,{title:ui("Region"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement("ul",{className:"visualizer-list"},wp.element.createElement("li",null,ui("A map of the entire world using 'world'.")),wp.element.createElement("li",null,ui("A continent or a sub-continent, specified by its 3-digit code, e.g., '011' for Western Africa. "),wp.element.createElement(mi,{href:"https://google-developers.appspot.com/chart/interactive/docs/gallery/geochart#Continent_Hierarchy"},ui("More info here."))),wp.element.createElement("li",null,ui("A country, specified by its ISO 3166-1 alpha-2 code, e.g., 'AU' for Australia. "),wp.element.createElement(mi,{href:"http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2"},ui("More info here."))),wp.element.createElement("li",null,ui("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(mi,{href:"http://en.wikipedia.org/wiki/ISO_3166-2:US"},ui("More info here.")))),wp.element.createElement(fi,{label:ui("Reigion"),help:ui("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(pi,{title:ui("Resolution"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement("ul",{className:"visualizer-list"},wp.element.createElement("li",null,ui("'countries' - Supported for all regions, except for US state regions.")),wp.element.createElement("li",null,ui("'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,ui("'metros' - Supported for the US country region and US state regions only."))),wp.element.createElement(hi,{label:ui("Resolution"),help:ui("The resolution of the map borders."),value:t.resolution?t.resolution:"countries",options:[{label:ui("Countries"),value:"countries"},{label:ui("Provinces"),value:"provinces"},{label:ui("Metros"),value:"metros"}],onChange:function(n){t.resolution=n,e.props.edit(t)}})),wp.element.createElement(pi,{title:ui("Display Mode"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement("ul",{className:"visualizer-list"},wp.element.createElement("li",null,ui("'auto' - Choose based on the format of the data.")),wp.element.createElement("li",null,ui("'regions' - This is a region map.")),wp.element.createElement("li",null,ui("'markers' - This is a marker map."))),wp.element.createElement(hi,{label:ui("Display Mode"),help:ui("Determines which type of map this is."),value:t.displayMode?t.displayMode:"auto",options:[{label:ui("Auto"),value:"auto"},{label:ui("Regions"),value:"regions"},{label:ui("Markers"),value:"markers"}],onChange:function(n){t.displayMode=n,e.props.edit(t)}})),wp.element.createElement(pi,{title:ui("Tooltip"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(hi,{label:ui("Trigger"),help:ui("Determines the user interaction that causes the tooltip to be displayed."),value:t.tooltip.trigger?t.tooltip.trigger:"focus",options:[{label:ui("The tooltip will be displayed when the user hovers over an element"),value:"focus"},{label:ui("The tooltip will not be displayed"),value:"none"}],onChange:function(n){t.tooltip.trigger=n,e.props.edit(t)}})))}}])&&ii(n.prototype,r),a&&ii(n,a),t}(ci);function yi(e){return(yi="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){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 bi(e,t){return!t||"object"!==yi(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 vi(e){return(vi=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function wi(e,t){return(wi=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Mi=wp.i18n.__,ki=wp.element.Component,Li=(wp.blockEditor||wp.editor).ColorPalette,Yi=wp.components,Di=Yi.BaseControl,Ti=Yi.PanelBody,Si=Yi.TextControl,Oi=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),bi(this,vi(t).apply(this,arguments))}var n,r,a;return 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)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(Ti,{title:Mi("Color Axis"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(Si,{label:Mi("Minimum Values"),help:Mi("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(Si,{label:Mi("Maximum Values"),help:Mi("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(Di,{label:Mi("Minimum Value")},wp.element.createElement(Li,{value:t.colorAxis.colors[0],onChange:function(n){t.colorAxis.colors[0]=n,e.props.edit(t)}})),wp.element.createElement(Di,{label:Mi("Intermediate Value")},wp.element.createElement(Li,{value:t.colorAxis.colors[1],onChange:function(n){t.colorAxis.colors[1]=n,e.props.edit(t)}})),wp.element.createElement(Di,{label:Mi("Maximum Value")},wp.element.createElement(Li,{value:t.colorAxis.colors[2],onChange:function(n){t.colorAxis.colors[2]=n,e.props.edit(t)}})),wp.element.createElement(Di,{label:Mi("Dateless Region")},wp.element.createElement(Li,{value:t.datalessRegionColor,onChange:function(n){t.datalessRegionColor=n,e.props.edit(t)}})))}}])&&gi(n.prototype,r),a&&gi(n,a),t}(ki);function ji(e){return(ji="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 xi(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 Ei(e,t){return!t||"object"!==ji(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 Ci(e){return(Ci=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Pi(e,t){return(Pi=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Hi=wp.i18n.__,zi=wp.element,Ai=zi.Component,Ni=zi.Fragment,Fi=wp.components,Ri=Fi.ExternalLink,Wi=Fi.PanelBody,Ii=Fi.TextControl,Bi=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Ei(this,Ci(t).apply(this,arguments))}var n,r,a;return 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&&Pi(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(Wi,{title:Hi("Size Axis"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(Ii,{label:Hi("Minimum Values"),help:Hi("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(Ii,{label:Hi("Maximum Values"),help:Hi("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(Ii,{label:Hi("Minimum Marker Radius"),help:Hi("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(Ii,{label:Hi("Maximum Marker Radius"),help:Hi("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(Ii,{label:Hi("Marker Opacity"),help:Hi("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(Ni,null,wp.element.createElement(Ii,{label:Hi("Number Format"),help:Hi("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,Hi("For number axis labels, this is a subset of the formatting "),wp.element.createElement(Ri,{href:"http://icu-project.org/apiref/icu4c/classDecimalFormat.html#_details"},Hi("ICU pattern set.")),Hi(" 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."))))}}])&&xi(n.prototype,r),a&&xi(n,a),t}(Ai);function Ji(e){return(Ji="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 Ui(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 qi(e,t){return!t||"object"!==Ji(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 Vi(e){return(Vi=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Gi(e,t){return(Gi=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var $i=wp.i18n.__,Ki=wp.element.Component,Zi=wp.components,Qi=Zi.PanelBody,Xi=Zi.SelectControl,eo=Zi.TextControl,to=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),qi(this,Vi(t).apply(this,arguments))}var n,r,a;return 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&&Gi(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(Qi,{title:$i("Magnifying Glass"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(Xi,{label:$i("Enabled"),help:$i("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:$i("Yes"),value:"1"},{label:$i("No"),value:"0"}],onChange:function(n){t.magnifyingGlass.enable=n,e.props.edit(t)}}),wp.element.createElement(eo,{label:$i("Zoom Factor"),help:$i("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)}}))}}])&&Ui(n.prototype,r),a&&Ui(n,a),t}(Ki);function no(e){return(no="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 ro(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 ao(e,t){return!t||"object"!==no(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 io(e){return(io=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function oo(e,t){return(oo=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var so=wp.i18n.__,lo=wp.element,uo=lo.Component,co=lo.Fragment,mo=(wp.blockEditor||wp.editor).ColorPalette,po=wp.components,ho=po.BaseControl,fo=po.ExternalLink,_o=po.PanelBody,yo=po.TextControl,go=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),ao(this,io(t).apply(this,arguments))}var n,r,a;return 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&&oo(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(_o,{title:so("Gauge Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(_o,{title:so("Tick Settings"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(yo,{label:so("Minimum Values"),help:so("Determines the minimum values of gauge."),value:t.min,onChange:function(n){t.min=n,e.props.edit(t)}}),wp.element.createElement(yo,{label:so("Maximum Values"),help:so("Determines the maximum values of gauge."),value:t.max,onChange:function(n){t.max=n,e.props.edit(t)}}),wp.element.createElement(yo,{label:so("Minor Ticks"),help:so("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(co,null,wp.element.createElement(yo,{label:so("Number Format"),help:so("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,so("For number axis labels, this is a subset of the formatting "),wp.element.createElement(fo,{href:"http://icu-project.org/apiref/icu4c/classDecimalFormat.html#_details"},so("ICU pattern set.")),so(" 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(_o,{title:so("Green Color"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(yo,{label:so("Minimum Range"),help:so("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(yo,{label:so("Maximum Range"),help:so("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(ho,{label:so("Green Color")},wp.element.createElement(mo,{value:t.greenColor,onChange:function(n){t.greenColor=n,e.props.edit(t)}}))),wp.element.createElement(_o,{title:so("Yellow Color"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(yo,{label:so("Minimum Range"),help:so("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(yo,{label:so("Maximum Range"),help:so("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(ho,{label:so("Yellow Color")},wp.element.createElement(mo,{value:t.yellowColor,onChange:function(n){t.yellowColor=n,e.props.edit(t)}}))),wp.element.createElement(_o,{title:so("Red Color"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(yo,{label:so("Minimum Range"),help:so("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(yo,{label:so("Maximum Range"),help:so("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(ho,{label:so("Red Color")},wp.element.createElement(mo,{value:t.redColor,onChange:function(n){t.redColor=n,e.props.edit(t)}}))))}}])&&ro(n.prototype,r),a&&ro(n,a),t}(uo);function bo(e){return(bo="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 vo(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 wo(e){return(wo=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Mo(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ko(e,t){return(ko=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Lo=wp.i18n.__,Yo=wp.element.Component,Do=(wp.blockEditor||wp.editor).ColorPalette,To=wp.components,So=To.BaseControl,Oo=To.CheckboxControl,jo=To.PanelBody,xo=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t){return!t||"object"!==bo(t)&&"function"!=typeof t?Mo(e):t}(this,wo(t).apply(this,arguments))).mapValues=e.mapValues.bind(Mo(e)),e}var n,r,a;return 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&&ko(e,t)}(t,e),n=t,(r=[{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(jo,{title:Lo("Timeline Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(Oo,{label:Lo("Show Row Label"),help:Lo("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(Oo,{label:Lo("Group by Row Label"),help:Lo("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(Oo,{label:Lo("Color by Row Label"),help:Lo("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(So,{label:Lo("Single Color")},wp.element.createElement(Do,{value:this.mapValues(t,"singleColor"),onChange:function(n){void 0===t.timeline&&(t.timeline={}),t.timeline.singleColor=n,e.props.edit(t)}})))}}])&&vo(n.prototype,r),a&&vo(n,a),t}(Yo);function Eo(e){return(Eo="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){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!t||"object"!==Eo(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 Ho(e){return(Ho=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function zo(e,t){return(zo=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Ao=wp.i18n.__,No=wp.element,Fo=No.Component,Ro=No.Fragment,Wo=wp.components,Io=Wo.CheckboxControl,Bo=Wo.PanelBody,Jo=Wo.SelectControl,Uo=Wo.TextControl,qo=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Po(this,Ho(t).apply(this,arguments))}var n,r,a;return 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&&zo(e,t)}(t,e),n=t,(r=[{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(Bo,{title:Ao("Table Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},"DataTable"===n?wp.element.createElement(Ro,null,wp.element.createElement(Io,{label:Ao("Enable Pagination"),help:Ao("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(Uo,{label:Ao("Number of rows per page"),help:Ao("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(Jo,{label:Ao("Pagination type"),help:Ao("Determines what type of pagination options to show."),value:t.pagingType,options:[{label:Ao("Page number buttons only"),value:"numbers"},{label:Ao("'Previous' and 'Next' buttons only"),value:"simple"},{label:Ao("'Previous' and 'Next' buttons, plus page numbers"),value:"simple_numbers"},{label:Ao("'First', 'Previous', 'Next' and 'Last' buttons"),value:"full"},{label:Ao("'First', 'Previous', 'Next' and 'Last' buttons, plus page numbers"),value:"full_numbers"},{label:Ao("'First' and 'Last' buttons, plus page numbers"),value:"first_last_numbers"}],onChange:function(n){t.pagingType=n,e.props.edit(t)}}),wp.element.createElement(Io,{label:Ao("Scroll Collapse"),help:Ao("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(Uo,{label:Ao("Vertical Height"),help:Ao("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(Io,{label:Ao("Disable Sort"),help:Ao("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(Io,{label:Ao("Freeze Header/Footer"),help:Ao("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(Io,{label:Ao("Responsive"),help:Ao("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(Ro,null,wp.element.createElement(Jo,{label:Ao("Enable Pagination"),help:Ao("To enable paging through the data."),value:t.page?t.page:"disable",options:[{label:Ao("Enable"),value:"enable"},{label:Ao("Disable"),value:"disable"}],onChange:function(n){t.page=n,e.props.edit(t)}}),wp.element.createElement(Uo,{label:Ao("Number of rows per page"),help:Ao("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(Jo,{label:Ao("Disable Sort"),help:Ao("To disable sorting on columns."),value:t.sort?t.sort:"enable",options:[{label:Ao("Enable"),value:"enable"},{label:Ao("Disable"),value:"disable"}],onChange:function(n){t.sort=n,e.props.edit(t)}}),wp.element.createElement(Uo,{label:Ao("Freeze Columns"),help:Ao("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(Io,{label:Ao("Allow HTML"),help:Ao("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(Io,{label:Ao("Right to Left table"),help:Ao("Adds basic support for right-to-left languages."),checked:Number(t.rtlTable),onChange:function(n){t.rtlTable=!Number(t.rtlTable),e.props.edit(t)}})))}}])&&Co(n.prototype,r),a&&Co(n,a),t}(Fo);function Vo(e){return(Vo="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 Go(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 $o(e,t){return!t||"object"!==Vo(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 Ko(e){return(Ko=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Zo(e,t){return(Zo=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Qo=wp.i18n.__,Xo=wp.element,es=Xo.Component,ts=Xo.Fragment,ns=(wp.blockEditor||wp.editor).ColorPalette,rs=wp.components,as=rs.BaseControl,is=rs.PanelBody,os=rs.TextControl,ss=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),$o(this,Ko(t).apply(this,arguments))}var n,r,a;return 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&&Zo(e,t)}(t,e),n=t,(r=[{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(is,{title:Qo("Row/Cell Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},"DataTable"===n?wp.element.createElement(ts,null,wp.element.createElement(is,{title:Qo("Odd Table Row"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(as,{label:Qo("Background Color")},wp.element.createElement(ns,{value:t.customcss.oddTableRow["background-color"],onChange:function(n){t.customcss.oddTableRow["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(as,{label:Qo("Color")},wp.element.createElement(ns,{value:t.customcss.oddTableRow.color,onChange:function(n){t.customcss.oddTableRow.color=n,e.props.edit(t)}})),wp.element.createElement(os,{label:Qo("Text Orientation"),help:Qo("In degrees."),type:"number",value:t.customcss.oddTableRow.transform,onChange:function(n){t.customcss.oddTableRow.transform=n,e.props.edit(t)}})),wp.element.createElement(is,{title:Qo("Even Table Row"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(as,{label:Qo("Background Color")},wp.element.createElement(ns,{value:t.customcss.evenTableRow["background-color"],onChange:function(n){t.customcss.evenTableRow["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(as,{label:Qo("Color")},wp.element.createElement(ns,{value:t.customcss.evenTableRow.color,onChange:function(n){t.customcss.evenTableRow.color=n,e.props.edit(t)}})),wp.element.createElement(os,{label:Qo("Text Orientation"),help:Qo("In degrees."),type:"number",value:t.customcss.evenTableRow.transform,onChange:function(n){t.customcss.evenTableRow.transform=n,e.props.edit(t)}})),wp.element.createElement(is,{title:Qo("Table Cell"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(as,{label:Qo("Background Color")},wp.element.createElement(ns,{value:t.customcss.tableCell["background-color"],onChange:function(n){t.customcss.tableCell["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(as,{label:Qo("Color")},wp.element.createElement(ns,{value:t.customcss.tableCell.color,onChange:function(n){t.customcss.tableCell.color=n,e.props.edit(t)}})),wp.element.createElement(os,{label:Qo("Text Orientation"),help:Qo("In degrees."),type:"number",value:t.customcss.tableCell.transform,onChange:function(n){t.customcss.tableCell.transform=n,e.props.edit(t)}}))):wp.element.createElement(ts,null,wp.element.createElement(is,{title:Qo("Header Row"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(as,{label:Qo("Background Color")},wp.element.createElement(ns,{value:t.customcss.headerRow["background-color"],onChange:function(n){t.customcss.headerRow["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(as,{label:Qo("Color")},wp.element.createElement(ns,{value:t.customcss.headerRow.color,onChange:function(n){t.customcss.headerRow.color=n,e.props.edit(t)}})),wp.element.createElement(os,{label:Qo("Text Orientation"),help:Qo("In degrees."),type:"number",value:t.customcss.headerRow.transform,onChange:function(n){t.customcss.headerRow.transform=n,e.props.edit(t)}})),wp.element.createElement(is,{title:Qo("Table Row"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(as,{label:Qo("Background Color")},wp.element.createElement(ns,{value:t.customcss.tableRow["background-color"],onChange:function(n){t.customcss.tableRow["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(as,{label:Qo("Color")},wp.element.createElement(ns,{value:t.customcss.tableRow.color,onChange:function(n){t.customcss.tableRow.color=n,e.props.edit(t)}})),wp.element.createElement(os,{label:Qo("Text Orientation"),help:Qo("In degrees."),type:"number",value:t.customcss.tableRow.transform,onChange:function(n){t.customcss.tableRow.transform=n,e.props.edit(t)}})),wp.element.createElement(is,{title:Qo("Odd Table Row"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(as,{label:Qo("Background Color")},wp.element.createElement(ns,{value:t.customcss.oddTableRow["background-color"],onChange:function(n){t.customcss.oddTableRow["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(as,{label:Qo("Color")},wp.element.createElement(ns,{value:t.customcss.oddTableRow.color,onChange:function(n){t.customcss.oddTableRow.color=n,e.props.edit(t)}})),wp.element.createElement(os,{label:Qo("Text Orientation"),help:Qo("In degrees."),type:"number",value:t.customcss.oddTableRow.transform,onChange:function(n){t.customcss.oddTableRow.transform=n,e.props.edit(t)}})),wp.element.createElement(is,{title:Qo("Selected Table Row"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(as,{label:Qo("Background Color")},wp.element.createElement(ns,{value:t.customcss.selectedTableRow["background-color"],onChange:function(n){t.customcss.selectedTableRow["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(as,{label:Qo("Color")},wp.element.createElement(ns,{value:t.customcss.selectedTableRow.color,onChange:function(n){t.customcss.selectedTableRow.color=n,e.props.edit(t)}})),wp.element.createElement(os,{label:Qo("Text Orientation"),help:Qo("In degrees."),type:"number",value:t.customcss.selectedTableRow.transform,onChange:function(n){t.customcss.selectedTableRow.transform=n,e.props.edit(t)}})),wp.element.createElement(is,{title:Qo("Hover Table Row"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(as,{label:Qo("Background Color")},wp.element.createElement(ns,{value:t.customcss.hoverTableRow["background-color"],onChange:function(n){t.customcss.hoverTableRow["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(as,{label:Qo("Color")},wp.element.createElement(ns,{value:t.customcss.hoverTableRow.color,onChange:function(n){t.customcss.hoverTableRow.color=n,e.props.edit(t)}})),wp.element.createElement(os,{label:Qo("Text Orientation"),help:Qo("In degrees."),type:"number",value:t.customcss.hoverTableRow.transform,onChange:function(n){t.customcss.hoverTableRow.transform=n,e.props.edit(t)}})),wp.element.createElement(is,{title:Qo("Header Cell"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(as,{label:Qo("Background Color")},wp.element.createElement(ns,{value:t.customcss.headerCell["background-color"],onChange:function(n){t.customcss.headerCell["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(as,{label:Qo("Color")},wp.element.createElement(ns,{value:t.customcss.headerCell.color,onChange:function(n){t.customcss.headerCell.color=n,e.props.edit(t)}})),wp.element.createElement(os,{label:Qo("Text Orientation"),help:Qo("In degrees."),type:"number",value:t.customcss.headerCell.transform,onChange:function(n){t.customcss.headerCell.transform=n,e.props.edit(t)}})),wp.element.createElement(is,{title:Qo("Table Cell"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(as,{label:Qo("Background Color")},wp.element.createElement(ns,{value:t.customcss.tableCell["background-color"],onChange:function(n){t.customcss.tableCell["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(as,{label:Qo("Color")},wp.element.createElement(ns,{value:t.customcss.tableCell.color,onChange:function(n){t.customcss.tableCell.color=n,e.props.edit(t)}})),wp.element.createElement(os,{label:Qo("Text Orientation"),help:Qo("In degrees."),type:"number",value:t.customcss.tableCell.transform,onChange:function(n){t.customcss.tableCell.transform=n,e.props.edit(t)}}))))}}])&&Go(n.prototype,r),a&&Go(n,a),t}(es);function ls(e){return(ls="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 us(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 cs(e,t){return!t||"object"!==ls(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 ds(e){return(ds=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ms(e,t){return(ms=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var ps=wp.i18n.__,hs=wp.element.Component,fs=wp.components,_s=fs.PanelBody,ys=fs.SelectControl,gs=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),cs(this,ds(t).apply(this,arguments))}var n,r,a;return 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)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(_s,{title:ps("Combo Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(ys,{label:ps("Chart Type"),help:ps("Select the default chart type."),value:t.seriesType?t.seriesType:"area",options:[{label:ps("Area"),value:"area"},{label:ps("Bar"),value:"bars"},{label:ps("Candlesticks"),value:"candlesticks"},{label:ps("Line"),value:"line"},{label:ps("Stepped Area"),value:"steppedArea"}],onChange:function(n){t.seriesType=n,e.props.edit(t)}}))}}])&&us(n.prototype,r),a&&us(n,a),t}(hs);function bs(e){return(bs="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){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 ws(e,t){return!t||"object"!==bs(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 Ms(e){return(Ms=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ks(e,t){return(ks=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Ls=wp.i18n.__,Ys=wp.element,Ds=Ys.Component,Ts=Ys.Fragment,Ss=(wp.blockEditor||wp.editor).ColorPalette,Os=wp.components,js=Os.BaseControl,xs=Os.ExternalLink,Es=Os.PanelBody,Cs=Os.SelectControl,Ps=Os.TextControl,Hs=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),ws(this,Ms(t).apply(this,arguments))}var n,r,a;return 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&&ks(e,t)}(t,e),n=t,(r=[{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(Es,{title:Ls("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(Es,{title:r[a].label,className:"visualizer-inner-sections",initialOpen:!1},-1>=["tabular","pie"].indexOf(t)&&wp.element.createElement(Cs,{label:Ls("Visible In Legend"),help:Ls("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:Ls("Yes"),value:"1"},{label:Ls("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(Ts,null,wp.element.createElement(Ps,{label:Ls("Line Width"),help:Ls("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(Ps,{label:Ls("Point Size"),help:Ls("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(Ts,null,wp.element.createElement(Ps,{label:Ls("Format"),help:Ls("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,Ls("For number axis labels, this is a subset of the formatting "),wp.element.createElement(xs,{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."))):0<=["date","datetime","timeofday"].indexOf(r[a].type)&&wp.element.createElement(Ts,null,wp.element.createElement(Ps,{label:Ls("Date Format"),help:Ls("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,Ls("This is a subset of the date formatting "),wp.element.createElement(xs,{href:"http://userguide.icu-project.org/formatparse/datetime#TOC-Date-Time-Format-Syntax"},Ls("ICU date and time format.")))),0<=["scatter","line"].indexOf(t)&&wp.element.createElement(Cs,{label:Ls("Curve Type"),help:Ls("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:Ls("Straight line without curve"),value:"none"},{label:Ls("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(Ps,{label:Ls("Area Opacity"),help:Ls("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(Cs,{label:Ls("Chart Type"),help:Ls("Select the type of chart to show for this series."),value:n.series[i].type?n.series[i].type:"area",options:[{label:Ls("Area"),value:"area"},{label:Ls("Bar"),value:"bars"},{label:Ls("Candlesticks"),value:"candlesticks"},{label:Ls("Line"),value:"line"},{label:Ls("Stepped Area"),value:"steppedArea"}],onChange:function(t){n.series[i].type=t,e.props.edit(n)}}),-1>=["tabular"].indexOf(t)&&wp.element.createElement(js,{label:Ls("Color")},wp.element.createElement(Ss,{value:n.series[i].color,onChange:function(t){n.series[i].color=t,e.props.edit(n)}})))})))}}])&&vs(n.prototype,r),a&&vs(n,a),t}(Ds);function zs(e){return(zs="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 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 Ns(e,t){return!t||"object"!==zs(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 Fs(e){return(Fs=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Rs(e,t){return(Rs=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Ws=wp.i18n.__,Is=wp.element.Component,Bs=(wp.blockEditor||wp.editor).ColorPalette,Js=wp.components,Us=Js.BaseControl,qs=Js.PanelBody,Vs=Js.TextControl,Gs=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Ns(this,Fs(t).apply(this,arguments))}var n,r,a;return 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)}(t,e),n=t,(r=[{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(qs,{title:Ws("Slices Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},Object.keys(t.slices).map((function(r){return wp.element.createElement(qs,{title:n[r][0],className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Vs,{label:Ws("Slice Offset"),help:Ws("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)}}),wp.element.createElement(Us,{label:Ws("Format")},wp.element.createElement(Bs,{value:t.slices[r].color,onChange:function(n){t.slices[r].color=n,e.props.edit(t)}})))})))}}])&&As(n.prototype,r),a&&As(n,a),t}(Is);function $s(e){return($s="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 Ks(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 Zs(e,t){return!t||"object"!==$s(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 Qs(e){return(Qs=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Xs(e,t){return(Xs=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var el=wp.i18n.__,tl=wp.element.Component,nl=(wp.blockEditor||wp.editor).ColorPalette,rl=wp.components,al=rl.CheckboxControl,il=rl.BaseControl,ol=rl.PanelBody,sl=rl.TextControl,ll=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Zs(this,Qs(t).apply(this,arguments))}var n,r,a;return 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&&Xs(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:function(){}},{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(ol,{title:el("Bubble Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(sl,{label:el("Opacity"),help:el("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(il,{label:el("Stroke Color")},wp.element.createElement(nl,{value:t.bubble.stroke,onChange:function(n){t.bubble||(t.bubble={}),t.bubble.stroke=n,e.props.edit(t)}})),wp.element.createElement(al,{label:el("Sort Bubbles by Size"),help:el("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:K(t,"sortBubblesBySize"),onChange:function(n){t.sortBubblesBySize=n,e.props.edit(t)}}),wp.element.createElement(sl,{label:el("Size (max)"),help:el("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(sl,{label:el("Size (min)"),help:el("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)}}))}}])&&Ks(n.prototype,r),a&&Ks(n,a),t}(tl);function ul(e){return(ul="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 cl(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 dl(e,t){return!t||"object"!==ul(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 ml(e){return(ml=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function pl(e,t){return(pl=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var hl=wp.i18n.__,fl=wp.element,_l=fl.Component,yl=fl.Fragment,gl=wp.components,bl=gl.ExternalLink,vl=gl.PanelBody,wl=gl.TextControl,Ml=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),dl(this,ml(t).apply(this,arguments))}var n,r,a;return 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&&pl(e,t)}(t,e),n=t,(r=[{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(vl,{title:hl("Column Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},Object.keys(t.series).map((function(r){return"string"===n[r].type?null:wp.element.createElement(vl,{title:n[r].label,className:"visualizer-inner-sections",initialOpen:!1},0<=["date","datetime","timeofday"].indexOf(n[r].type)&&wp.element.createElement(yl,null,wp.element.createElement(wl,{label:hl("Display Date Format"),help:hl("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(wl,{label:hl("Source Date Format"),help:hl("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,hl("You can find more info on "),wp.element.createElement(bl,{href:"https://momentjs.com/docs/#/displaying/"},hl("date and time formats here.")))),"number"===n[r].type&&wp.element.createElement(yl,null,wp.element.createElement(wl,{label:hl("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(wl,{label:hl("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(wl,{label:hl("Precision"),help:hl("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(wl,{label:hl("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(wl,{label:hl("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(yl,null,wp.element.createElement(wl,{label:hl("Truthy value"),help:hl("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(wl,{label:hl("Falsy value"),help:hl("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}}])&&cl(n.prototype,r),a&&cl(n,a),t}(_l);function kl(e){return(kl="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 Ll(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 Yl(e,t){return!t||"object"!==kl(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 Dl(e){return(Dl=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Tl(e,t){return(Tl=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Sl=wp.i18n.__,Ol=wp.element,jl=Ol.Component,xl=Ol.Fragment,El=(wp.blockEditor||wp.editor).ColorPalette,Cl=wp.components,Pl=Cl.BaseControl,Hl=Cl.CheckboxControl,zl=Cl.PanelBody,Al=Cl.SelectControl,Nl=Cl.TextControl,Fl=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Yl(this,Dl(t).apply(this,arguments))}var n,r,a;return 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)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-chart-type"],n=this.props.chart["visualizer-settings"];return wp.element.createElement(zl,{title:Sl("Layout And Chart Area"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(zl,{title:Sl("Layout"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Nl,{label:Sl("Width of Chart"),help:Sl("Determines the total width of the chart."),value:n.width,onChange:function(t){n.width=t,e.props.edit(n)}}),wp.element.createElement(Nl,{label:Sl("Height of Chart"),help:Sl("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(Al,{label:Sl("Keep Aspect Ratio"),help:Sl("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:Sl("Yes"),value:"1"},{label:Sl("No"),value:"0"}],onChange:function(t){n.keepAspectRatio=t,e.props.edit(n)}}),-1>=["gauge"].indexOf(t)&&wp.element.createElement(xl,null,wp.element.createElement(Nl,{label:Sl("Stroke Width"),help:Sl("The chart border width in pixels."),value:n.backgroundColor.strokeWidth,onChange:function(t){n.backgroundColor.strokeWidth=t,e.props.edit(n)}}),wp.element.createElement(Pl,{label:Sl("Stroke Color")},wp.element.createElement(El,{value:n.backgroundColor.stroke,onChange:function(t){n.backgroundColor.stroke=t,e.props.edit(n)}})),wp.element.createElement(Pl,{label:Sl("Background Color")},wp.element.createElement(El,{value:n.backgroundColor.fill,onChange:function(t){n.backgroundColor.fill=t,e.props.edit(n)}})),wp.element.createElement(Hl,{label:Sl("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"].indexOf(t)&&wp.element.createElement(zl,{title:Sl("Chart Area"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Nl,{label:Sl("Left Margin"),help:Sl("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(Nl,{label:Sl("Top Margin"),help:Sl("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(Nl,{label:Sl("Width Of Chart Area"),help:Sl("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(Nl,{label:Sl("Height Of Chart Area"),help:Sl("Determines the hight of the chart area."),value:n.chartArea.height,onChange:function(t){n.chartArea.height=t,e.props.edit(n)}})))}}])&&Ll(n.prototype,r),a&&Ll(n,a),t}(jl);function Rl(e){return(Rl="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 Wl(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 Il(e,t){return!t||"object"!==Rl(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 Bl(e){return(Bl=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Jl(e,t){return(Jl=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Ul=wp.i18n.__,ql=wp.element,Vl=ql.Component,Gl=ql.Fragment,$l=wp.components,Kl=$l.CheckboxControl,Zl=$l.PanelBody,Ql=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Il(this,Bl(t).apply(this,arguments))}var n,r,a;return 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)}(t,e),n=t,(r=[{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(Zl,{title:Ul("Frontend Actions"),initialOpen:!1,className:"visualizer-advanced-panel"},void 0!==t.actions&&wp.element.createElement(Gl,null,wp.element.createElement(Kl,{label:Ul("Print"),help:Ul("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(Kl,{label:Ul("CSV"),help:Ul("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(Kl,{label:Ul("Excel"),help:Ul("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(Kl,{label:Ul("Copy"),help:Ul("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(Kl,{label:Ul("Download Image"),help:Ul("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)}})))}}])&&Wl(n.prototype,r),a&&Wl(n,a),t}(Vl);function Xl(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eu(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?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){Xl(e,t,n[t])}))}return e}var tu={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"}},nu=n(2);const ru={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&&ru.throwError(ru.getCaller(2),e)},isFalsy:(e="<unknown parameter>",t)=>{t||ru.throwError(ru.getCaller(2),e)},isNoneOf:(e="<unknown parameter>",t,n=[])=>{-1===n.indexOf(t)&&ru.throwError(ru.getCaller(2),e,"to be any of"+JSON.stringify(n))},isAnyOf:(e="<unknown parameter>",t,n=[])=>{n.indexOf(t)>-1&&ru.throwError(ru.getCaller(2),e,"not to be any of"+JSON.stringify(n))},isNotType:(e="<unknown parameter>",t,n="")=>{Object(nu.getType)(t)!==n.toLowerCase()&&ru.throwError(ru.getCaller(2),e,"to be type "+n.toLowerCase())},isAnyTypeOf:(e="<unknown parameter>",t,n=[])=>{n.forEach(n=>{Object(nu.getType)(t)===n&&ru.throwError(ru.getCaller(2),e,"not to be type of "+n.toLowerCase())})},missingKey:(e="<unknown parameter>",t,n="")=>{ru.isUndefined(e,t),-1===Object.keys(t).indexOf(n)&&ru.throwError(ru.getCaller(2),e,"to contain '"+n+"' key")},missingAnyKeys:(e="<unknown parameter>",t,n=[""])=>{ru.isUndefined(e,t);const r=Object.keys(t);n.forEach(t=>{-1===r.indexOf(t)&&ru.throwError(ru.getCaller(2),e,"to contain '"+t+"' key")})},containsUndefined:(e="<unknown parameter>",t)=>{[void 0,null].forEach(n=>{const r=Object(nu.locate)(t,n);r&&ru.throwError(ru.getCaller(2),e,"not to contain '"+JSON.stringify(n)+"' at "+r)})},isInvalidPath:(e="<unknown parameter>",t)=>{ru.isUndefined(e,t),ru.isNotType(e,t,"string"),ru.isAnyOf(e,t,["","/"]),".$[]#".split().forEach(n=>{t.indexOf(n)>-1&&ru.throwError(ru.getCaller(2),e,"not to contain invalid character '"+n+"'")}),t.match(/\/{2,}/g)&&ru.throwError(ru.getCaller(2),e,"not to contain consecutive forward slash characters")},isInvalidWriteData:(e="<unknown parameter>",t)=>{ru.isUndefined(e,t),ru.containsUndefined(e,t)}};var au=ru;const iu=(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 ou={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.9
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},g={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},b=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=_({},g,!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))||g.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=g.minDate,this._o.minYear=g.minYear,this._o.minMonth=g.minMonth,this._o.startRange=g.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=g.maxDate,this._o.maxYear=g.maxYear,this._o.maxMonth=g.maxMonth,this._o.endRange=g.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,g=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,g),D=i+o,T=D;T>7;)T-=7;D+=7-T;for(var S=0,O=0;S<D;S++){var j=new Date(e,t,S-o+1),x=!!c(this._d)&&f(j,this._d),E=f(j,a),C=S<o||S>=i+o,P=S-o+1,H=t,z=e,A=r.startRange&&f(r.startRange,j),N=r.endRange&&f(r.endRange,j),F=r.startRange&&r.endRange&&r.startRange<j&&j<r.endRange;C&&(S<o?(P=Y+P,H=g,z=k):(P-=i,H=M,z=L));var R={day:P,month:H,year:z,isSelected:x,isToday:E,isDisabled:r.minDate&&j<r.minDate||r.maxDate&&j>r.maxDate||r.disableWeekends&&d(j)||r.disableDayFn&&r.disableDayFn(j),isEmpty:C,isStartRange:A,isEndRange:N,isInRange:F,showDaysInNextAndPreviousMonths:r.showDaysInNextAndPreviousMonths};l.push(v(R)),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="'+b(e,t)+'">'+b(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=(a=o.trys).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())}))}))]}))}))},g=Object(r.createContext)(m),b=g.Provider,v=g.Consumer,w=function(e){var t=e.children,n=e.value;return Object(r.createElement)(b,{value:n},t)},M=function(e){var t=e.render;return Object(r.createElement)(v,null,(function(e){return t(e)}))},k="#CCCCCC",L=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,_,g,b,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&&(g=t.visualization.arrayToDataTable(r.old),b=t.visualization.arrayToDataTable(r.new),_=t.visualization[u].prototype.computeDiff(g,b)),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)?k: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),Y=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)(L,u({},e,{google:t,googleChartWrapper:n,googleChartDashboard:a}))}})},t}(r.Component),D=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),T=0,S=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 T+=1,void 0===e?"googlechart-control-"+t+"-"+T: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)(Y,{googleChartWrapper:t.state.googleChartWrapper,google:c,googleChartDashboard:t.state.googleChartDashboard}),Object(r.createElement)(D,{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),O=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)(S,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),j=n(130),x=n.n(j);function E(e){return(E="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 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){return(P=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function H(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function z(e,t){return(z=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var A=wp.element,N=A.Component,F=A.Fragment,R=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t){return!t||"object"!==E(t)&&"function"!=typeof t?H(e):t}(this,P(t).apply(this,arguments))).initDataTable=e.initDataTable.bind(H(e)),e.dataRenderer=e.dataRenderer.bind(H(e)),e.table,e.uniqueId=x()(),e}var n,r,a;return 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&&z(e,t)}(t,e),n=t,(r=[{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(F,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(n.prototype,r),a&&C(n,a),t}(N),W=n(4),I=n.n(W),B=n(131),J=n.n(B),U=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},q=function(e){var t;if(Array.isArray(e))return 0<e.length;if(I()(e)){for(t in e)return!0;return!1}return"string"==typeof e?0<e.length:null!=e},V=function(e){return J()(e,q)},G=function(e){return e.width="",e.height="",e.backgroundColor={},e.chartArea={},V(e)},$=function(e){try{JSON.parse(e)}catch(e){return!1}return!0},K=function(e,t){return!0===e[t]||"true"===e[t]||"1"===e[t]||1===e[t]},Z=function(e){switch(e["visualizer-chart-library"]){case"GoogleCharts":return Q(e)}},Q=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=X(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=X(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:X("number"),options:{pattern:t.format},column:1});if(t.hAxis&&r[0]){var d=X(r[0].type);d&&a.push({type:d,options:{pattern:t.hAxis.format},column:0})}return a},X=function(e){switch(e){case"number":return"NumberFormat";case"date":case"datetime":case"timeofday":return"DateFormat"}return null};function ee(e){return(ee="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,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 ne(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var i=e.apply(t,n);function o(e){te(i,r,a,o,s,"next",e)}function s(e){te(i,r,a,o,s,"throw",e)}o(void 0)}))}}function re(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 ae(e){return(ae=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ie(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function oe(e,t){return(oe=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var se=lodash.startCase,le=wp.i18n.__,ue=wp.apiFetch,ce=wp.element,de=ce.Component,me=ce.Fragment,pe=wp.components,he=pe.Button,fe=pe.Dashicon,_e=pe.ExternalLink,ye=pe.Notice,ge=pe.Placeholder,be=pe.Spinner,ve=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t){return!t||"object"!==ee(t)&&"function"!=typeof t?ie(e):t}(this,ae(t).apply(this,arguments))).loadMoreCharts=e.loadMoreCharts.bind(ie(e)),e.state={charts:null,isBusy:!1,chartsLoaded:!1,perPage:visualizerLocalize.chartsPerPage},e}var n,r,a,i,o;return 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)}(t,e),n=t,(r=[{key:"componentDidMount",value:(o=ne(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,ue({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 o.apply(this,arguments)})},{key:"loadMoreCharts",value:(i=ne(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,ue({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 i.apply(this,arguments)})},{key:"render",value:function(){var e=this,t=this.state,n=t.charts,r=t.isBusy,a=t.chartsLoaded,i=t.perPage;return wp.element.createElement("div",{className:"visualizer-settings__charts"},wp.element.createElement(ye,{status:"warning",isDismissible:!1},le("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(_e,{href:visualizerLocalize.adminPage},le("Click here to visit Visualizer Charts Library."))),null!==n?1<=n.length?wp.element.createElement(me,null,wp.element.createElement("div",{className:"visualizer-settings__charts-grid"},Object.keys(n).map((function(t){var r,a,i,o=U(n[t].chart_data);if(r=o["visualizer-settings"].title?o["visualizer-settings"].title:"#".concat(n[t].id),0<=["gauge","tabular","timeline"].indexOf(o["visualizer-chart-type"])?"DataTable"===o["visualizer-chart-library"]?a=o["visualizer-chart-type"]:("tabular"===(a=o["visualizer-chart-type"])&&(a="table"),a=se(a)):a="".concat(se(o["visualizer-chart-type"]),"Chart"),!o["visualizer-chart-library"]||"ChartJS"!==o["visualizer-chart-library"])return o["visualizer-data-exploded"]&&(i=le("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":a,key:"chart-".concat(n[t].id)},wp.element.createElement("div",{className:"visualizer-settings__charts-title"},r),"DataTable"===o["visualizer-chart-library"]?wp.element.createElement(R,{id:n[t].id,rows:o["visualizer-data"],columns:o["visualizer-series"],chartsScreen:!0,options:o["visualizer-settings"]}):(o["visualizer-data-exploded"],wp.element.createElement(O,{chartType:a,rows:o["visualizer-data"],columns:o["visualizer-series"],options:G(o["visualizer-settings"]),formatters:Z(o)})),wp.element.createElement("div",{className:"visualizer-settings__charts-footer"},wp.element.createElement("sub",null,i)),wp.element.createElement("div",{className:"visualizer-settings__charts-controls",title:le("Insert Chart"),onClick:function(){return e.props.getChart(n[t].id)}},wp.element.createElement(fe,{icon:"upload"})))}))),!a&&i-1<n.length&&wp.element.createElement(he,{isPrimary:!0,isLarge:!0,onClick:this.loadMoreCharts,isBusy:r},le("Load More"))):wp.element.createElement("p",{className:"visualizer-no-charts"},le("No charts found.")):wp.element.createElement(ge,null,wp.element.createElement(be,null)))}}])&&re(n.prototype,r),a&&re(n,a),t}(de);function we(e){return(we="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 Me(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 ke(e){return(ke=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Le(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ye(e,t){return(Ye=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var De=wp.i18n.__,Te=wp.element.Component,Se=wp.components,Oe=Se.Button,je=Se.ExternalLink,xe=Se.PanelBody,Ee=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t){return!t||"object"!==we(t)&&"function"!=typeof t?Le(e):t}(this,ke(t).apply(this,arguments))).uploadInput=React.createRef(),e.fileUploaded=e.fileUploaded.bind(Le(e)),e.uploadImport=e.uploadImport.bind(Le(e)),e.state={uploadLabel:De("Upload")},e}var n,r,a;return 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&&Ye(e,t)}(t,e),n=t,(r=[{key:"fileUploaded",value:function(e){"text/csv"===e.target.files[0].type&&this.setState({uploadLabel:De("Upload")})}},{key:"uploadImport",value:function(){this.props.readUploadedFile(this.uploadInput),this.setState({uploadLabel:De("Uploaded")})}},{key:"render",value:function(){return wp.element.createElement(xe,{title:De("Import data from file"),initialOpen:!1},wp.element.createElement("p",null,De("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,De("If you are unsure about how to format your data CSV then please take a look at this sample: "),wp.element.createElement(je,{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(Oe,{isPrimary:!0,onClick:this.uploadImport},this.state.uploadLabel))}}])&&Me(n.prototype,r),a&&Me(n,a),t}(Te);function Ce(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 Pe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ce(n,!0).forEach((function(t){He(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ce(n).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function He(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ze(e){return(ze="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 Ae(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 Ne(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var i=e.apply(t,n);function o(e){Ae(i,r,a,o,s,"next",e)}function s(e){Ae(i,r,a,o,s,"throw",e)}o(void 0)}))}}function Fe(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 Re(e){return(Re=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function We(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ie(e,t){return(Ie=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Be=wp.i18n.__,Je=wp,Ue=(Je.apiFetch,Je.apiRequest),qe=wp.element.Component,Ve=wp.components,Ge=Ve.Button,$e=Ve.ExternalLink,Ke=Ve.IconButton,Ze=Ve.Modal,Qe=Ve.PanelBody,Xe=Ve.SelectControl,et=Ve.TextControl,tt=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t){return!t||"object"!==ze(t)&&"function"!=typeof t?We(e):t}(this,Re(t).apply(this,arguments))).openModal=e.openModal.bind(We(e)),e.initTable=e.initTable.bind(We(e)),e.onToggle=e.onToggle.bind(We(e)),e.toggleHeaders=e.toggleHeaders.bind(We(e)),e.getJSONRoot=e.getJSONRoot.bind(We(e)),e.getJSONData=e.getJSONData.bind(We(e)),e.getTableData=e.getTableData.bind(We(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}var n,r,a,i,o,s,l,u;return 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&&Ie(e,t)}(t,e),n=t,(r=[{key:"openModal",value:(u=Ne(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 u.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:(l=Ne(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 l.apply(this,arguments)})},{key:"toggleHeaders",value:function(){this.setState({isHeaderPanelOpen:!this.state.isHeaderPanelOpen})}},{key:"getJSONRoot",value:(s=Ne(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,Ue({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"===ze(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"===ze(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"!==ze(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 s.apply(this,arguments)})},{key:"getJSONData",value:(o=Ne(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,Ue({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"===ze(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"===ze(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"!==ze(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:Be("Don't use pagination"),value:0}],t.data.paging&&"root>next"===t.data.paging[0]&&n.push({label:Be("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 o.apply(this,arguments)})},{key:"getTableData",value:(i=Ne(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,Ue({path:"/visualizer/v1/set-json-data",data:Pe({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"===ze(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"===ze(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"!==ze(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 i.apply(this,arguments)})},{key:"render",value:function(){var e=this;return wp.element.createElement(Qe,{title:Be("Import from JSON"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement("p",null,Be("You can choose here to import or synchronize your chart data with a remote JSON source.")),wp.element.createElement("p",null,wp.element.createElement($e,{href:"https://docs.themeisle.com/article/1052-how-to-generate-charts-from-json-data-rest-endpoints"},Be("For more info check this tutorial."))),wp.element.createElement(Xe,{label:Be("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:Be("One-time"),value:"-1"},{label:Be("Live"),value:"0"},{label:Be("Each hour"),value:"1"},{label:Be("Each 12 hours"),value:"12"},{label:Be("Each day"),value:"24"},{label:Be("Each 3 days"),value:"72"}],onChange:this.props.editSchedule}),wp.element.createElement(Ge,{isPrimary:!0,isLarge:!0,onClick:this.openModal},Be("Modify Parameters")),this.state.isOpen&&wp.element.createElement(Ze,{title:Be("Import from JSON"),className:"visualizer-json-query-modal",shouldCloseOnClickOutside:!1,onRequestClose:function(){e.setState({isOpen:!1,isTableRendered:!1})}},wp.element.createElement(Qe,{title:Be("Step 1: Specify the JSON endpoint/URL"),opened:this.state.isFirstStepOpen,onToggle:function(){return e.onToggle("isFirstStepOpen")}},wp.element.createElement("p",null,Be("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($e,{href:"https://docs.themeisle.com/article/1043-visualizer-how-to-extend-rest-endpoints-with-json-response"},Be("How to extend REST endpoints with JSON response"))),wp.element.createElement(et,{placeholder:Be("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(Ke,{icon:"arrow-right-alt2",label:Be("Add Headers"),onClick:this.toggleHeaders},Be("Add Headers")),this.state.isHeaderPanelOpen&&wp.element.createElement("div",{className:"visualizer-json-query-modal-headers-panel"},wp.element.createElement(Xe,{label:Be("Request Type"),value:this.props.chart["visualizer-json-headers"]?this.props.chart["visualizer-json-headers"].method:this.state.requestHeaders.method,options:[{value:"GET",label:Be("GET")},{value:"POST",label:Be("POST")}],onChange:function(t){var n=Pe({},e.state.requestHeaders),r=e.state.requestHeaders;n.method=t,r=Pe({},r,{method:t}),e.setState({requestHeaders:r}),e.props.editJSONHeaders(n)}}),wp.element.createElement("p",null,Be("Credentials")),wp.element.createElement(et,{label:Be("Username"),placeholder:Be("Username/Access Key"),value:this.props.chart["visualizer-json-headers"]&&"object"===ze(this.props.chart["visualizer-json-headers"].auth)?this.props.chart["visualizer-json-headers"].auth.username:this.state.requestHeaders.username,onChange:function(t){var n=Pe({},e.state.requestHeaders),r=e.state.requestHeaders;n.auth={username:t,password:e.props.chart["visualizer-json-headers"]&&"object"===ze(e.props.chart["visualizer-json-headers"].auth)?e.props.chart["visualizer-json-headers"].auth.password:e.state.requestHeaders.password},r=Pe({},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"},Be("&")),wp.element.createElement(et,{label:Be("Password"),placeholder:Be("Password/Secret Key"),type:"password",value:this.props.chart["visualizer-json-headers"]&&"object"===ze(this.props.chart["visualizer-json-headers"].auth)?this.props.chart["visualizer-json-headers"].auth.password:this.state.requestHeaders.password,onChange:function(t){var n=Pe({},e.state.requestHeaders),r=e.state.requestHeaders;n.auth={username:e.props.chart["visualizer-json-headers"]&&"object"===ze(e.props.chart["visualizer-json-headers"].auth)?e.props.chart["visualizer-json-headers"].auth.username:e.state.requestHeaders.username,password:t},r=Pe({},r,{username:n.username,password:t}),e.setState({requestHeaders:r}),e.props.editJSONHeaders(n)}}),wp.element.createElement("p",null,Be("OR")),wp.element.createElement(et,{label:Be("Authorization"),placeholder:Be("e.g. SharedKey <AccountName>:<Signature>"),value:this.props.chart["visualizer-json-headers"]&&"object"!==ze(this.props.chart["visualizer-json-headers"].auth)?this.props.chart["visualizer-json-headers"].auth:this.state.requestHeaders.auth,onChange:function(t){var n=Pe({},e.state.requestHeaders),r=e.state.requestHeaders;n.auth=t,r=Pe({},r,{auth:t}),e.setState({requestHeaders:r}),e.props.editJSONHeaders(n)}})),wp.element.createElement(Ge,{isPrimary:!0,isLarge:!0,isBusy:this.state.isLoading,disabled:this.state.isLoading,onClick:this.getJSONRoot},Be("Fetch Endpoint"))),wp.element.createElement(Qe,{title:Be("Step 2: Choose the JSON root"),initialOpen:!1,opened:this.state.isSecondStepOpen,onToggle:function(){return e.onToggle("isSecondStepOpen")}},wp.element.createElement("p",null,Be("If you see Invalid Data, you may have selected the wrong root to fetch data from. Please select an alternative.")),wp.element.createElement(Xe,{value:this.props.chart["visualizer-json-root"],options:this.state.endpointRoots,onChange:this.props.editJSONRoot}),wp.element.createElement(Ge,{isPrimary:!0,isLarge:!0,isBusy:this.state.isLoading,disabled:this.state.isLoading,onClick:this.getJSONData},Be("Parse Endpoint"))),wp.element.createElement(Qe,{title:Be("Step 3: Specify miscellaneous parameters"),initialOpen:!1,opened:this.state.isThirdStepOpen,onToggle:function(){return e.onToggle("isThirdStepOpen")}},"community"!==visualizerLocalize.isPro?wp.element.createElement(Xe,{value:this.props.chart["visualizer-json-paging"]||0,options:this.state.endpointPaging,onChange:this.props.editJSONPaging}):wp.element.createElement("p",null,Be("Enable this feature in PRO version!"))),wp.element.createElement(Qe,{title:Be("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,Be("Select whether to include the data in the chart. Each column selected will form one series.")),wp.element.createElement("li",null,Be("If a column is selected to be included, specify its data type.")),wp.element.createElement("li",null,Be("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,Be("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(Ge,{isPrimary:!0,isLarge:!0,isBusy:this.state.isLoading,disabled:this.state.isLoading,onClick:this.getTableData},Be("Save & Show Chart")))))}}])&&Fe(n.prototype,r),a&&Fe(n,a),t}(qe);function nt(e){return(nt="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 rt(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 at(e,t){return!t||"object"!==nt(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 it(e){return(it=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ot(e,t){return(ot=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var st=wp.i18n.__,lt=wp.element.Component,ut=wp.components,ct=ut.Button,dt=ut.ExternalLink,mt=ut.PanelBody,pt=ut.SelectControl,ht=ut.TextControl,ft=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),at(this,it(t).apply(this,arguments))}var n,r,a;return 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&&ot(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this;return wp.element.createElement(mt,{title:st("Import data from URL"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(mt,{title:st("One Time Import"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement("p",null,st("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,st("If you are unsure about how to format your data CSV then please take a look at this sample: "),wp.element.createElement(dt,{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,st("You can also import data from Google Spreadsheet.")),wp.element.createElement(ht,{placeholder:st("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(ct,{isPrimary:!0,isLarge:!0,isBusy:"uploadData"===this.props.isLoading,disabled:"uploadData"===this.props.isLoading,onClick:function(){return e.props.uploadData(!1)}},st("Import Data"))),"business"===visualizerLocalize.isPro?wp.element.createElement(mt,{title:st("Schedule Import"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement("p",null,st("You can choose here to synchronize your chart data with a remote CSV file. ")),wp.element.createElement("p",null,st("You can also synchronize with your Google Spreadsheet file.")),wp.element.createElement("p",null,st("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(ht,{placeholder:st("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(pt,{label:st("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:st("Each hour"),value:"1"},{label:st("Each 12 hours"),value:"12"},{label:st("Each day"),value:"24"},{label:st("Each 3 days"),value:"72"}],onChange:this.props.editSchedule}),wp.element.createElement(ct,{isPrimary:!0,isLarge:!0,isBusy:"uploadData"===this.props.isLoading,disabled:"uploadData"===this.props.isLoading,onClick:function(){return e.props.uploadData(!0)}},st("Save Schedule"))):wp.element.createElement(mt,{title:st("Schedule Import"),icon:"lock",className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement("p",null,st("Upgrade your license to at least the DEVELOPER version to activate this feature!")),wp.element.createElement(ct,{isPrimary:!0,href:visualizerLocalize.proTeaser,target:"_blank"},st("Buy Now"))),wp.element.createElement(tt,{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}))}}])&&rt(n.prototype,r),a&&rt(n,a),t}(lt);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 yt(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 gt(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 bt(e,t){return!t||"object"!==_t(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 vt(e){return(vt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function wt(e,t){return(wt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Mt=wp.i18n.__,kt=wp.apiFetch,Lt=wp.element,Yt=Lt.Component,Dt=Lt.Fragment,Tt=wp.components,St=Tt.Button,Ot=Tt.PanelBody,jt=Tt.Placeholder,xt=Tt.SelectControl,Et=Tt.Spinner,Ct=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=bt(this,vt(t).apply(this,arguments))).state={id:"",charts:[]},e}var n,r,a,i,o;return 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&&wt(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:(i=regeneratorRuntime.mark((function e(){var t,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,kt({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)})),o=function(){var e=this,t=arguments;return new Promise((function(n,r){var a=i.apply(e,t);function o(e){yt(a,n,r,o,s,"next",e)}function s(e){yt(a,n,r,o,s,"throw",e)}o(void 0)}))},function(){return o.apply(this,arguments)})},{key:"render",value:function(){var e=this;return"community"!==visualizerLocalize.isPro?wp.element.createElement(Ot,{title:Mt("Import from other chart"),initialOpen:!1},1<=this.state.charts.length?wp.element.createElement(Dt,null,wp.element.createElement(xt,{label:Mt("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(St,{isPrimary:!0,isLarge:!0,isBusy:"getChartData"===this.props.isLoading,onClick:function(){return e.props.getChartData(e.state.id)}},Mt("Import Chart"))):wp.element.createElement(jt,null,wp.element.createElement(Et,null))):wp.element.createElement(Ot,{title:Mt("Import from other chart"),icon:"lock",initialOpen:!1},wp.element.createElement("p",null,Mt("Enable this feature in PRO version!")),wp.element.createElement(St,{isPrimary:!0,href:visualizerLocalize.proTeaser,target:"_blank"},Mt("Buy Now")))}}])&&gt(n.prototype,r),a&&gt(n,a),t}(Yt);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,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){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 At(e){return(At=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Nt(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ft(e,t){return(Ft=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Rt=wp.i18n.__,Wt=wp.apiRequest,It=wp.components,Bt=It.Button,Jt=It.ExternalLink,Ut=wp.element,qt=Ut.Component,Vt=Ut.Fragment,Gt=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t){return!t||"object"!==Pt(t)&&"function"!=typeof t?Nt(e):t}(this,At(t).apply(this,arguments))).onSave=e.onSave.bind(Nt(e)),e.state={isLoading:!1,success:!1,query:"",name:"",series:{},data:[]},e}var n,r,a,i,o;return 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&&Ft(e,t)}(t,e),n=t,(r=[{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:(i=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,Wt({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)})),o=function(){var e=this,t=arguments;return new Promise((function(n,r){var a=i.apply(e,t);function o(e){Ht(a,n,r,o,s,"next",e)}function s(e){Ht(a,n,r,o,s,"throw",e)}o(void 0)}))},function(){return o.apply(this,arguments)})},{key:"render",value:function(){var e=this;return wp.element.createElement(Vt,null,wp.element.createElement("textarea",{className:"visualizer-db-query",placeholder:Rt("Your query goes here…")},this.props.chart["visualizer-db-query"]),wp.element.createElement("div",{className:"visualizer-db-query-actions"},wp.element.createElement(Bt,{isLarge:!0,isDefault:!0,isBusy:this.state.isLoading,onClick:this.onSave},Rt("Show Results")),wp.element.createElement(Bt,{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)}},Rt("Save"))),wp.element.createElement("ul",null,wp.element.createElement("li",null,wp.element.createElement(Jt,{href:"https://docs.themeisle.com/article/970-visualizer-sample-queries-to-generate-charts"},Rt("Examples of queries and links to resources that you can use with this feature."))),wp.element.createElement("li",null,Rt("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"}))}}])&&zt(n.prototype,r),a&&zt(n,a),t}(qt);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){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 Zt(e){return(Zt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Qt(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Xt(e,t){return(Xt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var en=wp.i18n.__,tn=wp.element.Component,nn=wp.components,rn=nn.Button,an=nn.Modal,on=nn.PanelBody,sn=nn.SelectControl,ln=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t){return!t||"object"!==$t(t)&&"function"!=typeof t?Qt(e):t}(this,Zt(t).apply(this,arguments))).save=e.save.bind(Qt(e)),e.state={isOpen:!1},e}var n,r,a;return 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)}(t,e),n=t,(r=[{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(on,{title:en("Import data from database"),icon:"lock",initialOpen:!1},wp.element.createElement("p",null,en("Upgrade your license to at least the DEVELOPER version to activate this feature!")),wp.element.createElement(rn,{isPrimary:!0,href:visualizerLocalize.proTeaser,target:"_blank"},en("Buy Now"))):wp.element.createElement(on,{title:en("Import data from database"),initialOpen:!1},wp.element.createElement("p",null,en("You can import data from the database here.")),wp.element.createElement("p",null,en("How often do you want to refresh the data from the database.")),wp.element.createElement(sn,{label:en("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:en("Live"),value:"0"},{label:en("Each hour"),value:"1"},{label:en("Each 12 hours"),value:"12"},{label:en("Each day"),value:"24"},{label:en("Each 3 days"),value:"72"}],onChange:this.props.editSchedule}),wp.element.createElement(rn,{isPrimary:!0,isLarge:!0,onClick:function(){return e.setState({isOpen:!0})}},en("Create Query")),this.state.isOpen&&wp.element.createElement(an,{title:en("Import from database"),onRequestClose:function(){return e.setState({isOpen:!1})},className:"visualizer-db-query-modal",shouldCloseOnClickOutside:!1},wp.element.createElement(Gt,{chart:this.props.chart,changeQuery:this.props.changeQuery,save:this.save})))}}])&&Kt(n.prototype,r),a&&Kt(n,a),t}(tn),un=n(132);n(152);function cn(e){return(cn="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 dn(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 mn(e,t){return!t||"object"!==cn(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 pn(e){return(pn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function hn(e,t){return(hn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var fn=wp.i18n.__,_n=wp.element.Component,yn=wp.components,gn=yn.Button,bn=yn.ButtonGroup,vn=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=mn(this,pn(t).apply(this,arguments))).data=[],e.dates=[],e.types=["string","number","boolean","date","datetime","timeofday"],e}var n,r,a;return 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&&hn(e,t)}(t,e),n=t,(r=[{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(un.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(bn,null,wp.element.createElement(gn,{isDefault:!0,isLarge:!0,onClick:this.props.toggleModal},fn("Close")),wp.element.createElement(gn,{isPrimary:!0,isLarge:!0,onClick:function(t){e.props.toggleModal(),e.props.editChartData(e.data,"Visualizer_Source_Csv")}},fn("Save"))))}}])&&dn(n.prototype,r),a&&dn(n,a),t}(_n);function wn(e){return(wn="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 Mn(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 kn(e){return(kn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Ln(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Yn(e,t){return(Yn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Dn=wp.i18n.__,Tn=wp.element,Sn=Tn.Component,On=Tn.Fragment,jn=wp.components,xn=jn.Button,En=jn.Modal,Cn=jn.PanelBody,Pn=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t){return!t||"object"!==wn(t)&&"function"!=typeof t?Ln(e):t}(this,kn(t).apply(this,arguments))).toggleModal=e.toggleModal.bind(Ln(e)),e.state={isOpen:!1},e}var n,r,a;return 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)}(t,e),n=t,(r=[{key:"toggleModal",value:function(){this.setState({isOpen:!this.state.isOpen})}},{key:"render",value:function(){return"community"!==visualizerLocalize.isPro?wp.element.createElement(On,null,wp.element.createElement(Cn,{title:Dn("Manual Data"),initialOpen:!1},wp.element.createElement("p",null,Dn("You can manually edit the chart data using a spreadsheet like editor.")),wp.element.createElement(xn,{isPrimary:!0,isLarge:!0,isBusy:this.state.isOpen,onClick:this.toggleModal},Dn("View Editor"))),this.state.isOpen&&wp.element.createElement(En,{title:"Chart Editor",onRequestClose:this.toggleModal,shouldCloseOnClickOutside:!1},wp.element.createElement(vn,{chart:this.props.chart,editChartData:this.props.editChartData,toggleModal:this.toggleModal}))):wp.element.createElement(Cn,{title:Dn("Manual Data"),icon:"lock",initialOpen:!1},wp.element.createElement("p",null,Dn("Enable this feature in PRO version!")),wp.element.createElement(xn,{isPrimary:!0,href:visualizerLocalize.proTeaser,target:"_blank"},Dn("Buy Now")))}}])&&Mn(n.prototype,r),a&&Mn(n,a),t}(Sn);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 zn(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 An(e,t){return!t||"object"!==Hn(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 Nn(e){return(Nn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Fn(e,t){return(Fn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Rn=wp.i18n.__,Wn=wp.element.Component,In=(wp.blockEditor||wp.editor).ColorPalette,Bn=wp.components,Jn=Bn.BaseControl,Un=Bn.CheckboxControl,qn=Bn.PanelBody,Vn=Bn.SelectControl,Gn=Bn.TextControl,$n=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),An(this,Nn(t).apply(this,arguments))}var n,r,a;return 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&&Fn(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-chart-type"],n=this.props.chart["visualizer-settings"],r=[{label:Rn("The tooltip will be displayed when the user hovers over an element"),value:"focus"}];-1>=["timeline"].indexOf(t)&&(r[1]={label:Rn("The tooltip will be displayed when the user selects an element"),value:"selection"}),r[2]={label:Rn("The tooltip will not be displayed"),value:"none"};var a=[{label:Rn("Left of the chart"),value:"left"},{label:Rn("Right of the chart"),value:"right"},{label:Rn("Above the chart"),value:"top"},{label:Rn("Below the chart"),value:"bottom"},{label:Rn("Omit the legend"),value:"none"}];"pie"!==t&&a.push({label:Rn("Inside the chart"),value:"in"}),"bubble"===t&&(a=a.filter((function(e){return"left"!==e.value})));var i=Rn("Text to display above the chart.");return 0<=["tabular","dataTable","gauge","geo","timeline"].indexOf(t)&&(i=Rn("Text to display in the back-end admin area")),wp.element.createElement(qn,{title:Rn("General Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(qn,{title:Rn("Title"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Gn,{label:Rn("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(Vn,{label:Rn("Chart Title Position"),help:Rn("Where to place the chart title, compared to the chart area."),value:n.titlePosition?n.titlePosition:"out",options:[{label:Rn("Inside the chart"),value:"in"},{label:Rn("Outside the chart"),value:"out"},{label:Rn("None"),value:"none"}],onChange:function(t){n.titlePosition=t,e.props.edit(n)}}),-1>=["tabular","dataTable","gauge","geo","timeline"].indexOf(t)&&wp.element.createElement(Jn,{label:Rn("Chart Title Color")},wp.element.createElement(In,{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(Vn,{label:Rn("Axes Titles Position"),help:Rn("Determines where to place the axis titles, compared to the chart area."),value:n.axisTitlesPosition?n.axisTitlesPosition:"out",options:[{label:Rn("Inside the chart"),value:"in"},{label:Rn("Outside the chart"),value:"out"},{label:Rn("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(qn,{title:Rn("Font Styles"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Vn,{label:Rn("Font Family"),help:Rn("The default font family for all text in the chart."),value:n.fontName?n.fontName:"Arial",options:[{label:Rn("Arial"),value:"Arial"},{label:Rn("Sans Serif"),value:"Sans Serif"},{label:Rn("Serif"),value:"serif"},{label:Rn("Arial"),value:"Arial"},{label:Rn("Wide"),value:"Arial black"},{label:Rn("Narrow"),value:"Arial Narrow"},{label:Rn("Comic Sans MS"),value:"Comic Sans MS"},{label:Rn("Courier New"),value:"Courier New"},{label:Rn("Garamond"),value:"Garamond"},{label:Rn("Georgia"),value:"Georgia"},{label:Rn("Tahoma"),value:"Tahoma"},{label:Rn("Verdana"),value:"Verdana"}],onChange:function(t){n.fontName=t,e.props.edit(n)}}),wp.element.createElement(Vn,{label:Rn("Font Size"),help:Rn("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(qn,{title:Rn("Legend"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Vn,{label:Rn("Position"),help:Rn("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(Vn,{label:Rn("Alignment"),help:Rn("Determines the alignment of the legend."),value:n.legend.alignment?n.legend.alignment:"15",options:[{label:Rn("Aligned to the start of the allocated area"),value:"start"},{label:Rn("Centered in the allocated area"),value:"center"},{label:Rn("Aligned to the end of the allocated area"),value:"end"}],onChange:function(t){n.legend.alignment=t,e.props.edit(n)}}),wp.element.createElement(Jn,{label:Rn("Font Color")},wp.element.createElement(In,{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(qn,{title:Rn("Tooltip"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Vn,{label:Rn("Trigger"),help:Rn("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(Vn,{label:Rn("Show Color Code"),help:Rn("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:Rn("Yes"),value:"1"},{label:Rn("No"),value:"0"}],onChange:function(t){n.tooltip.showColorCode=t,e.props.edit(n)}}),0<=["pie"].indexOf(t)&&wp.element.createElement(Vn,{label:Rn("Text"),help:Rn("Determines what information to display when the user hovers over a pie slice."),value:n.tooltip.text?n.tooltip.text:"both",options:[{label:Rn("Display both the absolute value of the slice and the percentage of the whole"),value:"both"},{label:Rn("Display only the absolute value of the slice"),value:"value"},{label:Rn("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(qn,{title:Rn("Animation"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Un,{label:Rn("Animate on startup?"),help:Rn("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(Gn,{label:Rn("Duration"),help:Rn("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(Vn,{label:Rn("Easing"),help:Rn("The easing function applied to the animation."),value:n.animation.easing?n.animation.easing:"linear",options:[{label:Rn("Constant speed"),value:"linear"},{label:Rn("Start slow and speed up"),value:"in"},{label:Rn("Start fast and slow down"),value:"out"},{label:Rn("Start slow, speed up, then slow down"),value:"inAndOut"}],onChange:function(t){n.animation.easing=t,e.props.edit(n)}})))}}])&&zn(n.prototype,r),a&&zn(n,a),t}(Wn);function Kn(e){return(Kn="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 Zn(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!t||"object"!==Kn(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 Xn(e){return(Xn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function er(e,t){return(er=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var tr=wp.i18n.__,nr=wp.element.Component,rr=wp.components,ar=rr.PanelBody,ir=rr.Notice,or=rr.TextControl,sr=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Qn(this,Xn(t).apply(this,arguments))}var n,r,a;return 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&&er(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(ar,{title:tr("Instance Settings"),initialOpen:!0,className:"visualizer-instance-panel"},wp.element.createElement(ir,{status:"info",isDismissible:!1},wp.element.createElement("p",null,tr("These settings are valid only for this instance of the chart.")),wp.element.createElement("p",null,tr("This means that if you insert this chart again elsewhere, these values will not persist."))),wp.element.createElement(or,{label:tr("Should this instance lazy Load?"),help:tr("-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)}}))}}])&&Zn(n.prototype,r),a&&Zn(n,a),t}(nr);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 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!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 dr(e){return(dr=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function mr(e,t){return(mr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var pr=wp.i18n.__,hr=wp.element,fr=hr.Component,_r=hr.Fragment,yr=(wp.blockEditor||wp.editor).ColorPalette,gr=wp.components,br=gr.BaseControl,vr=gr.ExternalLink,wr=gr.PanelBody,Mr=gr.SelectControl,kr=gr.TextControl,Lr=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),cr(this,dr(t).apply(this,arguments))}var n,r,a;return 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&&mr(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-chart-type"],n=this.props.chart["visualizer-settings"];return wp.element.createElement(wr,{title:pr("Horizontal Axis Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(wr,{title:pr("General Settings"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(kr,{label:pr("Axis Title"),help:pr("The title of the horizontal axis."),value:n.hAxis.title,onChange:function(t){n.hAxis.title=t,e.props.edit(n)}}),wp.element.createElement(Mr,{label:pr("Text Position"),help:pr("Position of the horizontal axis text, relative to the chart area."),value:n.hAxis.textPosition?n.hAxis.textPosition:"out",options:[{label:pr("Inside the chart"),value:"in"},{label:pr("Outside the chart"),value:"out"},{label:pr("None"),value:"none"}],onChange:function(t){n.hAxis.textPosition=t,e.props.edit(n)}}),wp.element.createElement(Mr,{label:pr("Direction"),help:pr("The direction in which the values along the horizontal axis grow."),value:n.hAxis.direction?n.hAxis.direction:"1",options:[{label:pr("Identical Direction"),value:"1"},{label:pr("Reverse Direction"),value:"-1"}],onChange:function(t){n.hAxis.direction=t,e.props.edit(n)}}),wp.element.createElement(br,{label:pr("Base Line Color")},wp.element.createElement(yr,{value:n.hAxis.baselineColor,onChange:function(t){n.hAxis.baselineColor=t,e.props.edit(n)}})),wp.element.createElement(br,{label:pr("Axis Text Color")},wp.element.createElement(yr,{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(_r,null,wp.element.createElement(kr,{label:pr("Number Format"),help:pr("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,pr("For number axis labels, this is a subset of the formatting "),wp.element.createElement(vr,{href:"http://icu-project.org/apiref/icu4c/classDecimalFormat.html#_details"},pr("ICU pattern set.")),pr(" 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,pr("For date axis labels, this is a subset of the date formatting "),wp.element.createElement(vr,{href:"http://userguide.icu-project.org/formatparse/datetime#TOC-Date-Time-Format-Syntax"},pr("ICU date and time format."))))),-1>=["column"].indexOf(t)&&wp.element.createElement(_r,null,wp.element.createElement(wr,{title:pr("Grid Lines"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(kr,{label:pr("Count"),help:pr("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(br,{label:pr("Color")},wp.element.createElement(yr,{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(wr,{title:pr("Minor Grid Lines"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(kr,{label:pr("Count"),help:pr("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(br,{label:pr("Color")},wp.element.createElement(yr,{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(wr,{title:pr("View Window"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(kr,{label:pr("Maximun Value"),help:pr("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(kr,{label:pr("Minimum Value"),help:pr("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)}}))))}}])&&ur(n.prototype,r),a&&ur(n,a),t}(fr);function Yr(e){return(Yr="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 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!t||"object"!==Yr(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 Sr(e){return(Sr=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Or(e,t){return(Or=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var jr=wp.i18n.__,xr=wp.element,Er=xr.Component,Cr=xr.Fragment,Pr=(wp.blockEditor||wp.editor).ColorPalette,Hr=wp.components,zr=Hr.BaseControl,Ar=Hr.ExternalLink,Nr=Hr.PanelBody,Fr=Hr.SelectControl,Rr=Hr.TextControl,Wr=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Tr(this,Sr(t).apply(this,arguments))}var n,r,a;return 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&&Or(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-chart-type"],n=this.props.chart["visualizer-settings"];return wp.element.createElement(Nr,{title:jr("Vertical Axis Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(Nr,{title:jr("General Settings"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Rr,{label:jr("Axis Title"),help:jr("The title of the Vertical axis."),value:n.vAxis.title,onChange:function(t){n.vAxis.title=t,e.props.edit(n)}}),wp.element.createElement(Fr,{label:jr("Text Position"),help:jr("Position of the Vertical axis text, relative to the chart area."),value:n.vAxis.textPosition?n.vAxis.textPosition:"out",options:[{label:jr("Inside the chart"),value:"in"},{label:jr("Outside the chart"),value:"out"},{label:jr("None"),value:"none"}],onChange:function(t){n.vAxis.textPosition=t,e.props.edit(n)}}),wp.element.createElement(Fr,{label:jr("Direction"),help:jr("The direction in which the values along the Vertical axis grow."),value:n.vAxis.direction?n.vAxis.direction:"1",options:[{label:jr("Identical Direction"),value:"1"},{label:jr("Reverse Direction"),value:"-1"}],onChange:function(t){n.vAxis.direction=t,e.props.edit(n)}}),wp.element.createElement(zr,{label:jr("Base Line Color")},wp.element.createElement(Pr,{value:n.vAxis.baselineColor,onChange:function(t){n.vAxis.baselineColor=t,e.props.edit(n)}})),wp.element.createElement(zr,{label:jr("Axis Text Color")},wp.element.createElement(Pr,{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(Cr,null,wp.element.createElement(Rr,{label:jr("Number Format"),help:jr("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,jr("For number axis labels, this is a subset of the formatting "),wp.element.createElement(Ar,{href:"http://icu-project.org/apiref/icu4c/classDecimalFormat.html#_details"},jr("ICU pattern set.")),jr(" 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,jr("For date axis labels, this is a subset of the date formatting "),wp.element.createElement(Ar,{href:"http://userguide.icu-project.org/formatparse/datetime#TOC-Date-Time-Format-Syntax"},jr("ICU date and time format."))))),-1>=["bar"].indexOf(t)&&wp.element.createElement(Cr,null,wp.element.createElement(Nr,{title:jr("Grid Lines"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Rr,{label:jr("Count"),help:jr("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(zr,{label:jr("Color")},wp.element.createElement(Pr,{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(Nr,{title:jr("Minor Grid Lines"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Rr,{label:jr("Count"),help:jr("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(zr,{label:jr("Color")},wp.element.createElement(Pr,{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(Nr,{title:jr("View Window"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Rr,{label:jr("Maximun Value"),help:jr("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(Rr,{label:jr("Minimum Value"),help:jr("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)}}))))}}])&&Dr(n.prototype,r),a&&Dr(n,a),t}(Er);function Ir(e){return(Ir="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 Br(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 Jr(e,t){return!t||"object"!==Ir(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 Ur(e){return(Ur=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function qr(e,t){return(qr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Vr=wp.i18n.__,Gr=wp.element,$r=Gr.Component,Kr=Gr.Fragment,Zr=(wp.blockEditor||wp.editor).ColorPalette,Qr=wp.components,Xr=Qr.BaseControl,ea=Qr.ExternalLink,ta=Qr.PanelBody,na=Qr.SelectControl,ra=Qr.TextControl,aa=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Jr(this,Ur(t).apply(this,arguments))}var n,r,a;return 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&&qr(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(ta,{title:Vr("Pie Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(Kr,null,wp.element.createElement(ra,{label:Vr("Number Format"),help:Vr("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,Vr("For number axis labels, this is a subset of the formatting "),wp.element.createElement(ea,{href:"http://icu-project.org/apiref/icu4c/classDecimalFormat.html#_details"},Vr("ICU pattern set.")),Vr(" 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,Vr("For date axis labels, this is a subset of the date formatting "),wp.element.createElement(ea,{href:"http://userguide.icu-project.org/formatparse/datetime#TOC-Date-Time-Format-Syntax"},Vr("ICU date and time format.")))),wp.element.createElement(na,{label:Vr("Is 3D"),help:Vr("If set to yes, displays a three-dimensional chart."),value:t.is3D?t.is3D:"0",options:[{label:Vr("Yes"),value:"1"},{label:Vr("No"),value:"0"}],onChange:function(n){t.is3D=n,e.props.edit(t)}}),wp.element.createElement(na,{label:Vr("Reverse Categories"),help:Vr("If set to yes, will draw slices counterclockwise."),value:t.reverseCategories?t.reverseCategories:"0",options:[{label:Vr("Yes"),value:"1"},{label:Vr("No"),value:"0"}],onChange:function(n){t.reverseCategories=n,e.props.edit(t)}}),wp.element.createElement(na,{label:Vr("Slice Text"),help:Vr("The content of the text displayed on the slice."),value:t.pieSliceText?t.pieSliceText:"percentage",options:[{label:Vr("The percentage of the slice size out of the total"),value:"percentage"},{label:Vr("The quantitative value of the slice"),value:"value"},{label:Vr("The name of the slice"),value:"label"},{label:Vr("The quantitative value and percentage of the slice"),value:"value-and-percentage"},{label:Vr("No text is displayed"),value:"none"}],onChange:function(n){t.pieSliceText=n,e.props.edit(t)}}),wp.element.createElement(ra,{label:Vr("Pie Hole"),help:Vr("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:Vr("0.5"),value:t.pieHole,onChange:function(n){t.pieHole=n,e.props.edit(t)}}),wp.element.createElement(ra,{label:Vr("Start Angle"),help:Vr("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(Xr,{label:Vr("Slice Border Color")},wp.element.createElement(Zr,{value:t.pieSliceBorderColor,onChange:function(n){t.pieSliceBorderColor=n,e.props.edit(t)}})))}}])&&Br(n.prototype,r),a&&Br(n,a),t}($r);function ia(e){return(ia="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 oa(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 sa(e,t){return!t||"object"!==ia(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 la(e){return(la=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ua(e,t){return(ua=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var ca=wp.i18n.__,da=wp.element.Component,ma=(wp.blockEditor||wp.editor).ColorPalette,pa=wp.components,ha=pa.BaseControl,fa=pa.PanelBody,_a=pa.TextControl,ya=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),sa(this,la(t).apply(this,arguments))}var n,r,a;return 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&&ua(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(fa,{title:ca("Residue Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(_a,{label:ca("Visibility Threshold"),help:ca("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:ca("0.001388889"),value:t.sliceVisibilityThreshold,onChange:function(n){t.sliceVisibilityThreshold=n,e.props.edit(t)}}),wp.element.createElement(_a,{label:ca("Residue Slice Label"),help:ca("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(ha,{label:ca("Residue Slice Color")},wp.element.createElement(ma,{value:t.pieResidueSliceColor,onChange:function(n){t.pieResidueSliceColor=n,e.props.edit(t)}})))}}])&&oa(n.prototype,r),a&&oa(n,a),t}(da);function ga(e){return(ga="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 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 va(e,t){return!t||"object"!==ga(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 wa(e){return(wa=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Ma(e,t){return(Ma=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var ka=wp.i18n.__,La=wp.element,Ya=La.Component,Da=La.Fragment,Ta=wp.components,Sa=Ta.PanelBody,Oa=Ta.SelectControl,ja=Ta.TextControl,xa=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),va(this,wa(t).apply(this,arguments))}var n,r,a;return 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&&Ma(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-chart-type"],n=this.props.chart["visualizer-settings"];return wp.element.createElement(Sa,{title:ka("Lines Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(ja,{label:ka("Line Width"),help:ka("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(ja,{label:ka("Point Size"),help:ka("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(Oa,{label:ka("Curve Type"),help:ka("Determines whether the series has to be presented in the legend or not."),value:n.curveType?n.curveType:"none",options:[{label:ka("Straight line without curve"),value:"none"},{label:ka("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(Oa,{label:ka("Focus Target"),help:ka("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:ka("Focus on a single data point."),value:"datum"},{label:ka("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(Oa,{label:ka("Selection Mode"),help:ka("Determines how many data points an user can select on a chart."),value:n.selectionMode?n.selectionMode:"single",options:[{label:ka("Single data point"),value:"single"},{label:ka("Multiple data points"),value:"multiple"}],onChange:function(t){n.selectionMode=t,e.props.edit(n)}}),wp.element.createElement(Oa,{label:ka("Aggregation Target"),help:ka("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:ka("Group selected data by x-value"),value:"category"},{label:ka("Group selected data by series"),value:"series"},{label:ka("Group selected data by x-value if all selections have the same x-value, and by series otherwise"),value:"auto"},{label:ka("Show only one tooltip per selection"),value:"none"}],onChange:function(t){n.aggregationTarget=t,e.props.edit(n)}}),wp.element.createElement(ja,{label:ka("Point Opacity"),help:ka("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(Da,null,wp.element.createElement(ja,{label:ka("Area Opacity"),help:ka("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(Oa,{label:ka("Is Stacked"),help:ka("If set to yes, series elements are stacked."),value:n.isStacked?n.isStacked:"0",options:[{label:ka("Yes"),value:"1"},{label:ka("No"),value:"0"}],onChange:function(t){n.isStacked=t,e.props.edit(n)}})),-1>=["scatter","area"].indexOf(t)&&wp.element.createElement(Oa,{label:ka("Interpolate Nulls"),help:ka("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:ka("Yes"),value:"1"},{label:ka("No"),value:"0"}],onChange:function(t){n.interpolateNulls=t,e.props.edit(n)}}))}}])&&ba(n.prototype,r),a&&ba(n,a),t}(Ya);function Ea(e){return(Ea="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 Ca(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 Pa(e,t){return!t||"object"!==Ea(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 Ha(e){return(Ha=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function za(e,t){return(za=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Aa=wp.i18n.__,Na=wp.element.Component,Fa=wp.components,Ra=Fa.PanelBody,Wa=Fa.SelectControl,Ia=Fa.TextControl,Ba=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Pa(this,Ha(t).apply(this,arguments))}var n,r,a;return 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&&za(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(Ra,{title:Aa("Bars Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(Wa,{label:Aa("Focus Target"),help:Aa("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:Aa("Focus on a single data point."),value:"datum"},{label:Aa("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(Wa,{label:Aa("Is Stacked"),help:Aa("If set to yes, series elements are stacked."),value:t.isStacked?t.isStacked:"0",options:[{label:Aa("Yes"),value:"1"},{label:Aa("No"),value:"0"}],onChange:function(n){t.isStacked=n,e.props.edit(t)}}),wp.element.createElement(Ia,{label:Aa("Bars Opacity"),help:Aa("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)}}))}}])&&Ca(n.prototype,r),a&&Ca(n,a),t}(Na);function Ja(e){return(Ja="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 Ua(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 qa(e,t){return!t||"object"!==Ja(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 Va(e){return(Va=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Ga(e,t){return(Ga=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var $a=wp.i18n.__,Ka=wp.element.Component,Za=(wp.blockEditor||wp.editor).ColorPalette,Qa=wp.components,Xa=Qa.BaseControl,ei=Qa.PanelBody,ti=Qa.SelectControl,ni=Qa.TextControl,ri=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),qa(this,Va(t).apply(this,arguments))}var n,r,a;return 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&&Ga(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(ei,{title:$a("Candles Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(ei,{title:$a("General Settings"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(ti,{label:$a("Focus Target"),help:$a("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:$a("Focus on a single data point."),value:"datum"},{label:$a("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(ti,{label:$a("Selection Mode"),help:$a("Determines how many data points an user can select on a chart."),value:t.selectionMode?t.selectionMode:"single",options:[{label:$a("Single data point"),value:"single"},{label:$a("Multiple data points"),value:"multiple"}],onChange:function(n){t.selectionMode=n,e.props.edit(t)}}),wp.element.createElement(ti,{label:$a("Aggregation Target"),help:$a("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:$a("Group selected data by x-value"),value:"category"},{label:$a("Group selected data by series"),value:"series"},{label:$a("Group selected data by x-value if all selections have the same x-value, and by series otherwise"),value:"auto"},{label:$a("Show only one tooltip per selection"),value:"none"}],onChange:function(n){t.aggregationTarget=n,e.props.edit(t)}})),wp.element.createElement(ei,{title:$a("Failing Candles"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(ni,{label:$a("Stroke Width"),help:$a("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(Xa,{label:$a("Stroke Color")},wp.element.createElement(Za,{value:t.candlestick.fallingColor.stroke,onChange:function(n){t.candlestick.fallingColor.stroke=n,e.props.edit(t)}})),wp.element.createElement(Xa,{label:$a("Fill Color")},wp.element.createElement(Za,{value:t.candlestick.fallingColor.fill,onChange:function(n){t.candlestick.fallingColor.fill=n,e.props.edit(t)}}))),wp.element.createElement(ei,{title:$a("Rising Candles"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(ni,{label:$a("Stroke Width"),help:$a("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(Xa,{label:$a("Stroke Color")},wp.element.createElement(Za,{value:t.candlestick.risingColor.stroke,onChange:function(n){t.candlestick.risingColor.stroke=n,e.props.edit(t)}})),wp.element.createElement(Xa,{label:$a("Fill Color")},wp.element.createElement(Za,{value:t.candlestick.risingColor.fill,onChange:function(n){t.candlestick.risingColor.fill=n,e.props.edit(t)}}))))}}])&&Ua(n.prototype,r),a&&Ua(n,a),t}(Ka);function ai(e){return(ai="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 ii(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 oi(e,t){return!t||"object"!==ai(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 si(e){return(si=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function li(e,t){return(li=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var ui=wp.i18n.__,ci=wp.element.Component,di=wp.components,mi=di.ExternalLink,pi=di.PanelBody,hi=di.SelectControl,fi=di.TextControl,_i=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),oi(this,si(t).apply(this,arguments))}var n,r,a;return 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&&li(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(pi,{title:ui("Map Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(pi,{title:ui("API"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(fi,{label:ui("API Key"),help:ui("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(mi,{href:"https://developers.google.com/maps/documentation/javascript/get-api-key"},ui("Get API Keys"))),wp.element.createElement(pi,{title:ui("Region"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement("ul",{className:"visualizer-list"},wp.element.createElement("li",null,ui("A map of the entire world using 'world'.")),wp.element.createElement("li",null,ui("A continent or a sub-continent, specified by its 3-digit code, e.g., '011' for Western Africa. "),wp.element.createElement(mi,{href:"https://google-developers.appspot.com/chart/interactive/docs/gallery/geochart#Continent_Hierarchy"},ui("More info here."))),wp.element.createElement("li",null,ui("A country, specified by its ISO 3166-1 alpha-2 code, e.g., 'AU' for Australia. "),wp.element.createElement(mi,{href:"http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2"},ui("More info here."))),wp.element.createElement("li",null,ui("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(mi,{href:"http://en.wikipedia.org/wiki/ISO_3166-2:US"},ui("More info here.")))),wp.element.createElement(fi,{label:ui("Reigion"),help:ui("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(pi,{title:ui("Resolution"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement("ul",{className:"visualizer-list"},wp.element.createElement("li",null,ui("'countries' - Supported for all regions, except for US state regions.")),wp.element.createElement("li",null,ui("'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,ui("'metros' - Supported for the US country region and US state regions only."))),wp.element.createElement(hi,{label:ui("Resolution"),help:ui("The resolution of the map borders."),value:t.resolution?t.resolution:"countries",options:[{label:ui("Countries"),value:"countries"},{label:ui("Provinces"),value:"provinces"},{label:ui("Metros"),value:"metros"}],onChange:function(n){t.resolution=n,e.props.edit(t)}})),wp.element.createElement(pi,{title:ui("Display Mode"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement("ul",{className:"visualizer-list"},wp.element.createElement("li",null,ui("'auto' - Choose based on the format of the data.")),wp.element.createElement("li",null,ui("'regions' - This is a region map.")),wp.element.createElement("li",null,ui("'markers' - This is a marker map."))),wp.element.createElement(hi,{label:ui("Display Mode"),help:ui("Determines which type of map this is."),value:t.displayMode?t.displayMode:"auto",options:[{label:ui("Auto"),value:"auto"},{label:ui("Regions"),value:"regions"},{label:ui("Markers"),value:"markers"}],onChange:function(n){t.displayMode=n,e.props.edit(t)}})),wp.element.createElement(pi,{title:ui("Tooltip"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(hi,{label:ui("Trigger"),help:ui("Determines the user interaction that causes the tooltip to be displayed."),value:t.tooltip.trigger?t.tooltip.trigger:"focus",options:[{label:ui("The tooltip will be displayed when the user hovers over an element"),value:"focus"},{label:ui("The tooltip will not be displayed"),value:"none"}],onChange:function(n){t.tooltip.trigger=n,e.props.edit(t)}})))}}])&&ii(n.prototype,r),a&&ii(n,a),t}(ci);function yi(e){return(yi="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){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 bi(e,t){return!t||"object"!==yi(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 vi(e){return(vi=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function wi(e,t){return(wi=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Mi=wp.i18n.__,ki=wp.element.Component,Li=(wp.blockEditor||wp.editor).ColorPalette,Yi=wp.components,Di=Yi.BaseControl,Ti=Yi.PanelBody,Si=Yi.TextControl,Oi=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),bi(this,vi(t).apply(this,arguments))}var n,r,a;return 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)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(Ti,{title:Mi("Color Axis"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(Si,{label:Mi("Minimum Values"),help:Mi("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(Si,{label:Mi("Maximum Values"),help:Mi("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(Di,{label:Mi("Minimum Value")},wp.element.createElement(Li,{value:t.colorAxis.colors[0],onChange:function(n){t.colorAxis.colors[0]=n,e.props.edit(t)}})),wp.element.createElement(Di,{label:Mi("Intermediate Value")},wp.element.createElement(Li,{value:t.colorAxis.colors[1],onChange:function(n){t.colorAxis.colors[1]=n,e.props.edit(t)}})),wp.element.createElement(Di,{label:Mi("Maximum Value")},wp.element.createElement(Li,{value:t.colorAxis.colors[2],onChange:function(n){t.colorAxis.colors[2]=n,e.props.edit(t)}})),wp.element.createElement(Di,{label:Mi("Dateless Region")},wp.element.createElement(Li,{value:t.datalessRegionColor,onChange:function(n){t.datalessRegionColor=n,e.props.edit(t)}})))}}])&&gi(n.prototype,r),a&&gi(n,a),t}(ki);function ji(e){return(ji="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 xi(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 Ei(e,t){return!t||"object"!==ji(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 Ci(e){return(Ci=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Pi(e,t){return(Pi=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Hi=wp.i18n.__,zi=wp.element,Ai=zi.Component,Ni=zi.Fragment,Fi=wp.components,Ri=Fi.ExternalLink,Wi=Fi.PanelBody,Ii=Fi.TextControl,Bi=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Ei(this,Ci(t).apply(this,arguments))}var n,r,a;return 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&&Pi(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(Wi,{title:Hi("Size Axis"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(Ii,{label:Hi("Minimum Values"),help:Hi("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(Ii,{label:Hi("Maximum Values"),help:Hi("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(Ii,{label:Hi("Minimum Marker Radius"),help:Hi("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(Ii,{label:Hi("Maximum Marker Radius"),help:Hi("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(Ii,{label:Hi("Marker Opacity"),help:Hi("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(Ni,null,wp.element.createElement(Ii,{label:Hi("Number Format"),help:Hi("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,Hi("For number axis labels, this is a subset of the formatting "),wp.element.createElement(Ri,{href:"http://icu-project.org/apiref/icu4c/classDecimalFormat.html#_details"},Hi("ICU pattern set.")),Hi(" 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."))))}}])&&xi(n.prototype,r),a&&xi(n,a),t}(Ai);function Ji(e){return(Ji="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 Ui(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 qi(e,t){return!t||"object"!==Ji(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 Vi(e){return(Vi=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Gi(e,t){return(Gi=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var $i=wp.i18n.__,Ki=wp.element.Component,Zi=wp.components,Qi=Zi.PanelBody,Xi=Zi.SelectControl,eo=Zi.TextControl,to=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),qi(this,Vi(t).apply(this,arguments))}var n,r,a;return 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&&Gi(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(Qi,{title:$i("Magnifying Glass"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(Xi,{label:$i("Enabled"),help:$i("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:$i("Yes"),value:"1"},{label:$i("No"),value:"0"}],onChange:function(n){t.magnifyingGlass.enable=n,e.props.edit(t)}}),wp.element.createElement(eo,{label:$i("Zoom Factor"),help:$i("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)}}))}}])&&Ui(n.prototype,r),a&&Ui(n,a),t}(Ki);function no(e){return(no="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 ro(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 ao(e,t){return!t||"object"!==no(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 io(e){return(io=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function oo(e,t){return(oo=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var so=wp.i18n.__,lo=wp.element,uo=lo.Component,co=lo.Fragment,mo=(wp.blockEditor||wp.editor).ColorPalette,po=wp.components,ho=po.BaseControl,fo=po.ExternalLink,_o=po.PanelBody,yo=po.TextControl,go=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),ao(this,io(t).apply(this,arguments))}var n,r,a;return 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&&oo(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(_o,{title:so("Gauge Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(_o,{title:so("Tick Settings"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(yo,{label:so("Minimum Values"),help:so("Determines the minimum values of gauge."),value:t.min,onChange:function(n){t.min=n,e.props.edit(t)}}),wp.element.createElement(yo,{label:so("Maximum Values"),help:so("Determines the maximum values of gauge."),value:t.max,onChange:function(n){t.max=n,e.props.edit(t)}}),wp.element.createElement(yo,{label:so("Minor Ticks"),help:so("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(co,null,wp.element.createElement(yo,{label:so("Number Format"),help:so("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,so("For number axis labels, this is a subset of the formatting "),wp.element.createElement(fo,{href:"http://icu-project.org/apiref/icu4c/classDecimalFormat.html#_details"},so("ICU pattern set.")),so(" 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(_o,{title:so("Green Color"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(yo,{label:so("Minimum Range"),help:so("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(yo,{label:so("Maximum Range"),help:so("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(ho,{label:so("Green Color")},wp.element.createElement(mo,{value:t.greenColor,onChange:function(n){t.greenColor=n,e.props.edit(t)}}))),wp.element.createElement(_o,{title:so("Yellow Color"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(yo,{label:so("Minimum Range"),help:so("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(yo,{label:so("Maximum Range"),help:so("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(ho,{label:so("Yellow Color")},wp.element.createElement(mo,{value:t.yellowColor,onChange:function(n){t.yellowColor=n,e.props.edit(t)}}))),wp.element.createElement(_o,{title:so("Red Color"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(yo,{label:so("Minimum Range"),help:so("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(yo,{label:so("Maximum Range"),help:so("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(ho,{label:so("Red Color")},wp.element.createElement(mo,{value:t.redColor,onChange:function(n){t.redColor=n,e.props.edit(t)}}))))}}])&&ro(n.prototype,r),a&&ro(n,a),t}(uo);function bo(e){return(bo="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 vo(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 wo(e){return(wo=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Mo(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ko(e,t){return(ko=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Lo=wp.i18n.__,Yo=wp.element.Component,Do=(wp.blockEditor||wp.editor).ColorPalette,To=wp.components,So=To.BaseControl,Oo=To.CheckboxControl,jo=To.PanelBody,xo=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t){return!t||"object"!==bo(t)&&"function"!=typeof t?Mo(e):t}(this,wo(t).apply(this,arguments))).mapValues=e.mapValues.bind(Mo(e)),e}var n,r,a;return 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&&ko(e,t)}(t,e),n=t,(r=[{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(jo,{title:Lo("Timeline Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(Oo,{label:Lo("Show Row Label"),help:Lo("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(Oo,{label:Lo("Group by Row Label"),help:Lo("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(Oo,{label:Lo("Color by Row Label"),help:Lo("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(So,{label:Lo("Single Color")},wp.element.createElement(Do,{value:this.mapValues(t,"singleColor"),onChange:function(n){void 0===t.timeline&&(t.timeline={}),t.timeline.singleColor=n,e.props.edit(t)}})))}}])&&vo(n.prototype,r),a&&vo(n,a),t}(Yo);function Eo(e){return(Eo="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){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!t||"object"!==Eo(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 Ho(e){return(Ho=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function zo(e,t){return(zo=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Ao=wp.i18n.__,No=wp.element,Fo=No.Component,Ro=No.Fragment,Wo=wp.components,Io=Wo.CheckboxControl,Bo=Wo.PanelBody,Jo=Wo.SelectControl,Uo=Wo.TextControl,qo=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Po(this,Ho(t).apply(this,arguments))}var n,r,a;return 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&&zo(e,t)}(t,e),n=t,(r=[{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(Bo,{title:Ao("Table Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},"DataTable"===n?wp.element.createElement(Ro,null,wp.element.createElement(Io,{label:Ao("Enable Pagination"),help:Ao("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(Uo,{label:Ao("Number of rows per page"),help:Ao("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(Jo,{label:Ao("Pagination type"),help:Ao("Determines what type of pagination options to show."),value:t.pagingType,options:[{label:Ao("Page number buttons only"),value:"numbers"},{label:Ao("'Previous' and 'Next' buttons only"),value:"simple"},{label:Ao("'Previous' and 'Next' buttons, plus page numbers"),value:"simple_numbers"},{label:Ao("'First', 'Previous', 'Next' and 'Last' buttons"),value:"full"},{label:Ao("'First', 'Previous', 'Next' and 'Last' buttons, plus page numbers"),value:"full_numbers"},{label:Ao("'First' and 'Last' buttons, plus page numbers"),value:"first_last_numbers"}],onChange:function(n){t.pagingType=n,e.props.edit(t)}}),wp.element.createElement(Io,{label:Ao("Scroll Collapse"),help:Ao("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(Uo,{label:Ao("Vertical Height"),help:Ao("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(Io,{label:Ao("Disable Sort"),help:Ao("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(Io,{label:Ao("Freeze Header/Footer"),help:Ao("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(Io,{label:Ao("Responsive"),help:Ao("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(Ro,null,wp.element.createElement(Jo,{label:Ao("Enable Pagination"),help:Ao("To enable paging through the data."),value:t.page?t.page:"disable",options:[{label:Ao("Enable"),value:"enable"},{label:Ao("Disable"),value:"disable"}],onChange:function(n){t.page=n,e.props.edit(t)}}),wp.element.createElement(Uo,{label:Ao("Number of rows per page"),help:Ao("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(Jo,{label:Ao("Disable Sort"),help:Ao("To disable sorting on columns."),value:t.sort?t.sort:"enable",options:[{label:Ao("Enable"),value:"enable"},{label:Ao("Disable"),value:"disable"}],onChange:function(n){t.sort=n,e.props.edit(t)}}),wp.element.createElement(Uo,{label:Ao("Freeze Columns"),help:Ao("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(Io,{label:Ao("Allow HTML"),help:Ao("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(Io,{label:Ao("Right to Left table"),help:Ao("Adds basic support for right-to-left languages."),checked:Number(t.rtlTable),onChange:function(n){t.rtlTable=!Number(t.rtlTable),e.props.edit(t)}})))}}])&&Co(n.prototype,r),a&&Co(n,a),t}(Fo);function Vo(e){return(Vo="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 Go(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 $o(e,t){return!t||"object"!==Vo(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 Ko(e){return(Ko=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Zo(e,t){return(Zo=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Qo=wp.i18n.__,Xo=wp.element,es=Xo.Component,ts=Xo.Fragment,ns=(wp.blockEditor||wp.editor).ColorPalette,rs=wp.components,as=rs.BaseControl,is=rs.PanelBody,os=rs.TextControl,ss=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),$o(this,Ko(t).apply(this,arguments))}var n,r,a;return 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&&Zo(e,t)}(t,e),n=t,(r=[{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(is,{title:Qo("Row/Cell Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},"DataTable"===n?wp.element.createElement(ts,null,wp.element.createElement(is,{title:Qo("Odd Table Row"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(as,{label:Qo("Background Color")},wp.element.createElement(ns,{value:t.customcss.oddTableRow["background-color"],onChange:function(n){t.customcss.oddTableRow["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(as,{label:Qo("Color")},wp.element.createElement(ns,{value:t.customcss.oddTableRow.color,onChange:function(n){t.customcss.oddTableRow.color=n,e.props.edit(t)}})),wp.element.createElement(os,{label:Qo("Text Orientation"),help:Qo("In degrees."),type:"number",value:t.customcss.oddTableRow.transform,onChange:function(n){t.customcss.oddTableRow.transform=n,e.props.edit(t)}})),wp.element.createElement(is,{title:Qo("Even Table Row"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(as,{label:Qo("Background Color")},wp.element.createElement(ns,{value:t.customcss.evenTableRow["background-color"],onChange:function(n){t.customcss.evenTableRow["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(as,{label:Qo("Color")},wp.element.createElement(ns,{value:t.customcss.evenTableRow.color,onChange:function(n){t.customcss.evenTableRow.color=n,e.props.edit(t)}})),wp.element.createElement(os,{label:Qo("Text Orientation"),help:Qo("In degrees."),type:"number",value:t.customcss.evenTableRow.transform,onChange:function(n){t.customcss.evenTableRow.transform=n,e.props.edit(t)}})),wp.element.createElement(is,{title:Qo("Table Cell"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(as,{label:Qo("Background Color")},wp.element.createElement(ns,{value:t.customcss.tableCell["background-color"],onChange:function(n){t.customcss.tableCell["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(as,{label:Qo("Color")},wp.element.createElement(ns,{value:t.customcss.tableCell.color,onChange:function(n){t.customcss.tableCell.color=n,e.props.edit(t)}})),wp.element.createElement(os,{label:Qo("Text Orientation"),help:Qo("In degrees."),type:"number",value:t.customcss.tableCell.transform,onChange:function(n){t.customcss.tableCell.transform=n,e.props.edit(t)}}))):wp.element.createElement(ts,null,wp.element.createElement(is,{title:Qo("Header Row"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(as,{label:Qo("Background Color")},wp.element.createElement(ns,{value:t.customcss.headerRow["background-color"],onChange:function(n){t.customcss.headerRow["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(as,{label:Qo("Color")},wp.element.createElement(ns,{value:t.customcss.headerRow.color,onChange:function(n){t.customcss.headerRow.color=n,e.props.edit(t)}})),wp.element.createElement(os,{label:Qo("Text Orientation"),help:Qo("In degrees."),type:"number",value:t.customcss.headerRow.transform,onChange:function(n){t.customcss.headerRow.transform=n,e.props.edit(t)}})),wp.element.createElement(is,{title:Qo("Table Row"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(as,{label:Qo("Background Color")},wp.element.createElement(ns,{value:t.customcss.tableRow["background-color"],onChange:function(n){t.customcss.tableRow["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(as,{label:Qo("Color")},wp.element.createElement(ns,{value:t.customcss.tableRow.color,onChange:function(n){t.customcss.tableRow.color=n,e.props.edit(t)}})),wp.element.createElement(os,{label:Qo("Text Orientation"),help:Qo("In degrees."),type:"number",value:t.customcss.tableRow.transform,onChange:function(n){t.customcss.tableRow.transform=n,e.props.edit(t)}})),wp.element.createElement(is,{title:Qo("Odd Table Row"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(as,{label:Qo("Background Color")},wp.element.createElement(ns,{value:t.customcss.oddTableRow["background-color"],onChange:function(n){t.customcss.oddTableRow["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(as,{label:Qo("Color")},wp.element.createElement(ns,{value:t.customcss.oddTableRow.color,onChange:function(n){t.customcss.oddTableRow.color=n,e.props.edit(t)}})),wp.element.createElement(os,{label:Qo("Text Orientation"),help:Qo("In degrees."),type:"number",value:t.customcss.oddTableRow.transform,onChange:function(n){t.customcss.oddTableRow.transform=n,e.props.edit(t)}})),wp.element.createElement(is,{title:Qo("Selected Table Row"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(as,{label:Qo("Background Color")},wp.element.createElement(ns,{value:t.customcss.selectedTableRow["background-color"],onChange:function(n){t.customcss.selectedTableRow["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(as,{label:Qo("Color")},wp.element.createElement(ns,{value:t.customcss.selectedTableRow.color,onChange:function(n){t.customcss.selectedTableRow.color=n,e.props.edit(t)}})),wp.element.createElement(os,{label:Qo("Text Orientation"),help:Qo("In degrees."),type:"number",value:t.customcss.selectedTableRow.transform,onChange:function(n){t.customcss.selectedTableRow.transform=n,e.props.edit(t)}})),wp.element.createElement(is,{title:Qo("Hover Table Row"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(as,{label:Qo("Background Color")},wp.element.createElement(ns,{value:t.customcss.hoverTableRow["background-color"],onChange:function(n){t.customcss.hoverTableRow["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(as,{label:Qo("Color")},wp.element.createElement(ns,{value:t.customcss.hoverTableRow.color,onChange:function(n){t.customcss.hoverTableRow.color=n,e.props.edit(t)}})),wp.element.createElement(os,{label:Qo("Text Orientation"),help:Qo("In degrees."),type:"number",value:t.customcss.hoverTableRow.transform,onChange:function(n){t.customcss.hoverTableRow.transform=n,e.props.edit(t)}})),wp.element.createElement(is,{title:Qo("Header Cell"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(as,{label:Qo("Background Color")},wp.element.createElement(ns,{value:t.customcss.headerCell["background-color"],onChange:function(n){t.customcss.headerCell["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(as,{label:Qo("Color")},wp.element.createElement(ns,{value:t.customcss.headerCell.color,onChange:function(n){t.customcss.headerCell.color=n,e.props.edit(t)}})),wp.element.createElement(os,{label:Qo("Text Orientation"),help:Qo("In degrees."),type:"number",value:t.customcss.headerCell.transform,onChange:function(n){t.customcss.headerCell.transform=n,e.props.edit(t)}})),wp.element.createElement(is,{title:Qo("Table Cell"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(as,{label:Qo("Background Color")},wp.element.createElement(ns,{value:t.customcss.tableCell["background-color"],onChange:function(n){t.customcss.tableCell["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(as,{label:Qo("Color")},wp.element.createElement(ns,{value:t.customcss.tableCell.color,onChange:function(n){t.customcss.tableCell.color=n,e.props.edit(t)}})),wp.element.createElement(os,{label:Qo("Text Orientation"),help:Qo("In degrees."),type:"number",value:t.customcss.tableCell.transform,onChange:function(n){t.customcss.tableCell.transform=n,e.props.edit(t)}}))))}}])&&Go(n.prototype,r),a&&Go(n,a),t}(es);function ls(e){return(ls="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 us(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 cs(e,t){return!t||"object"!==ls(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 ds(e){return(ds=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ms(e,t){return(ms=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var ps=wp.i18n.__,hs=wp.element.Component,fs=wp.components,_s=fs.PanelBody,ys=fs.SelectControl,gs=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),cs(this,ds(t).apply(this,arguments))}var n,r,a;return 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)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(_s,{title:ps("Combo Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(ys,{label:ps("Chart Type"),help:ps("Select the default chart type."),value:t.seriesType?t.seriesType:"area",options:[{label:ps("Area"),value:"area"},{label:ps("Bar"),value:"bars"},{label:ps("Candlesticks"),value:"candlesticks"},{label:ps("Line"),value:"line"},{label:ps("Stepped Area"),value:"steppedArea"}],onChange:function(n){t.seriesType=n,e.props.edit(t)}}))}}])&&us(n.prototype,r),a&&us(n,a),t}(hs);function bs(e){return(bs="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){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 ws(e,t){return!t||"object"!==bs(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 Ms(e){return(Ms=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ks(e,t){return(ks=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Ls=wp.i18n.__,Ys=wp.element,Ds=Ys.Component,Ts=Ys.Fragment,Ss=(wp.blockEditor||wp.editor).ColorPalette,Os=wp.components,js=Os.BaseControl,xs=Os.ExternalLink,Es=Os.PanelBody,Cs=Os.SelectControl,Ps=Os.TextControl,Hs=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),ws(this,Ms(t).apply(this,arguments))}var n,r,a;return 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&&ks(e,t)}(t,e),n=t,(r=[{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(Es,{title:Ls("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(Es,{title:r[a].label,className:"visualizer-inner-sections",initialOpen:!1},-1>=["tabular","pie"].indexOf(t)&&wp.element.createElement(Cs,{label:Ls("Visible In Legend"),help:Ls("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:Ls("Yes"),value:"1"},{label:Ls("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(Ts,null,wp.element.createElement(Ps,{label:Ls("Line Width"),help:Ls("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(Ps,{label:Ls("Point Size"),help:Ls("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(Ts,null,wp.element.createElement(Ps,{label:Ls("Format"),help:Ls("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,Ls("For number axis labels, this is a subset of the formatting "),wp.element.createElement(xs,{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."))):0<=["date","datetime","timeofday"].indexOf(r[a].type)&&wp.element.createElement(Ts,null,wp.element.createElement(Ps,{label:Ls("Date Format"),help:Ls("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,Ls("This is a subset of the date formatting "),wp.element.createElement(xs,{href:"http://userguide.icu-project.org/formatparse/datetime#TOC-Date-Time-Format-Syntax"},Ls("ICU date and time format.")))),0<=["scatter","line"].indexOf(t)&&wp.element.createElement(Cs,{label:Ls("Curve Type"),help:Ls("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:Ls("Straight line without curve"),value:"none"},{label:Ls("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(Ps,{label:Ls("Area Opacity"),help:Ls("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(Cs,{label:Ls("Chart Type"),help:Ls("Select the type of chart to show for this series."),value:n.series[i].type?n.series[i].type:"area",options:[{label:Ls("Area"),value:"area"},{label:Ls("Bar"),value:"bars"},{label:Ls("Candlesticks"),value:"candlesticks"},{label:Ls("Line"),value:"line"},{label:Ls("Stepped Area"),value:"steppedArea"}],onChange:function(t){n.series[i].type=t,e.props.edit(n)}}),-1>=["tabular"].indexOf(t)&&wp.element.createElement(js,{label:Ls("Color")},wp.element.createElement(Ss,{value:n.series[i].color,onChange:function(t){n.series[i].color=t,e.props.edit(n)}})))})))}}])&&vs(n.prototype,r),a&&vs(n,a),t}(Ds);function zs(e){return(zs="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 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 Ns(e,t){return!t||"object"!==zs(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 Fs(e){return(Fs=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Rs(e,t){return(Rs=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Ws=wp.i18n.__,Is=wp.element.Component,Bs=(wp.blockEditor||wp.editor).ColorPalette,Js=wp.components,Us=Js.BaseControl,qs=Js.PanelBody,Vs=Js.TextControl,Gs=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Ns(this,Fs(t).apply(this,arguments))}var n,r,a;return 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)}(t,e),n=t,(r=[{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(qs,{title:Ws("Slices Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},Object.keys(t.slices).map((function(r){return wp.element.createElement(qs,{title:n[r][0],className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Vs,{label:Ws("Slice Offset"),help:Ws("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(Us,{label:Ws("Format")},wp.element.createElement(Bs,{value:t.slices[r].color,onChange:function(n){t.slices[r].color=n,e.props.edit(t)}})))})))}}])&&As(n.prototype,r),a&&As(n,a),t}(Is);function $s(e){return($s="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 Ks(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 Zs(e,t){return!t||"object"!==$s(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 Qs(e){return(Qs=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Xs(e,t){return(Xs=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var el=wp.i18n.__,tl=wp.element.Component,nl=(wp.blockEditor||wp.editor).ColorPalette,rl=wp.components,al=rl.CheckboxControl,il=rl.BaseControl,ol=rl.PanelBody,sl=rl.TextControl,ll=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Zs(this,Qs(t).apply(this,arguments))}var n,r,a;return 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&&Xs(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:function(){}},{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(ol,{title:el("Bubble Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(sl,{label:el("Opacity"),help:el("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(il,{label:el("Stroke Color")},wp.element.createElement(nl,{value:t.bubble.stroke,onChange:function(n){t.bubble||(t.bubble={}),t.bubble.stroke=n,e.props.edit(t)}})),wp.element.createElement(al,{label:el("Sort Bubbles by Size"),help:el("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:K(t,"sortBubblesBySize"),onChange:function(n){t.sortBubblesBySize=n,e.props.edit(t)}}),wp.element.createElement(sl,{label:el("Size (max)"),help:el("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(sl,{label:el("Size (min)"),help:el("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)}}))}}])&&Ks(n.prototype,r),a&&Ks(n,a),t}(tl);function ul(e){return(ul="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 cl(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 dl(e,t){return!t||"object"!==ul(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 ml(e){return(ml=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function pl(e,t){return(pl=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var hl=wp.i18n.__,fl=wp.element,_l=fl.Component,yl=fl.Fragment,gl=wp.components,bl=gl.ExternalLink,vl=gl.PanelBody,wl=gl.TextControl,Ml=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),dl(this,ml(t).apply(this,arguments))}var n,r,a;return 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&&pl(e,t)}(t,e),n=t,(r=[{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(vl,{title:hl("Column Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},Object.keys(t.series).map((function(r){return"string"===n[r].type?null:wp.element.createElement(vl,{title:n[r].label,className:"visualizer-inner-sections",initialOpen:!1},0<=["date","datetime","timeofday"].indexOf(n[r].type)&&wp.element.createElement(yl,null,wp.element.createElement(wl,{label:hl("Display Date Format"),help:hl("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(wl,{label:hl("Source Date Format"),help:hl("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,hl("You can find more info on "),wp.element.createElement(bl,{href:"https://momentjs.com/docs/#/displaying/"},hl("date and time formats here.")))),"number"===n[r].type&&wp.element.createElement(yl,null,wp.element.createElement(wl,{label:hl("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(wl,{label:hl("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(wl,{label:hl("Precision"),help:hl("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(wl,{label:hl("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(wl,{label:hl("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(yl,null,wp.element.createElement(wl,{label:hl("Truthy value"),help:hl("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(wl,{label:hl("Falsy value"),help:hl("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}}])&&cl(n.prototype,r),a&&cl(n,a),t}(_l);function kl(e){return(kl="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 Ll(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 Yl(e,t){return!t||"object"!==kl(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 Dl(e){return(Dl=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Tl(e,t){return(Tl=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Sl=wp.i18n.__,Ol=wp.element,jl=Ol.Component,xl=Ol.Fragment,El=(wp.blockEditor||wp.editor).ColorPalette,Cl=wp.components,Pl=Cl.BaseControl,Hl=Cl.CheckboxControl,zl=Cl.PanelBody,Al=Cl.SelectControl,Nl=Cl.TextControl,Fl=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Yl(this,Dl(t).apply(this,arguments))}var n,r,a;return 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)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-chart-type"],n=this.props.chart["visualizer-settings"];return wp.element.createElement(zl,{title:Sl("Layout And Chart Area"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(zl,{title:Sl("Layout"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Nl,{label:Sl("Width of Chart"),help:Sl("Determines the total width of the chart."),value:n.width,onChange:function(t){n.width=t,e.props.edit(n)}}),wp.element.createElement(Nl,{label:Sl("Height of Chart"),help:Sl("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(Al,{label:Sl("Keep Aspect Ratio"),help:Sl("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:Sl("Yes"),value:"1"},{label:Sl("No"),value:"0"}],onChange:function(t){n.keepAspectRatio=t,e.props.edit(n)}}),-1>=["gauge"].indexOf(t)&&wp.element.createElement(xl,null,wp.element.createElement(Nl,{label:Sl("Stroke Width"),help:Sl("The chart border width in pixels."),value:n.backgroundColor.strokeWidth,onChange:function(t){n.backgroundColor.strokeWidth=t,e.props.edit(n)}}),wp.element.createElement(Pl,{label:Sl("Stroke Color")},wp.element.createElement(El,{value:n.backgroundColor.stroke,onChange:function(t){n.backgroundColor.stroke=t,e.props.edit(n)}})),wp.element.createElement(Pl,{label:Sl("Background Color")},wp.element.createElement(El,{value:n.backgroundColor.fill,onChange:function(t){n.backgroundColor.fill=t,e.props.edit(n)}})),wp.element.createElement(Hl,{label:Sl("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"].indexOf(t)&&wp.element.createElement(zl,{title:Sl("Chart Area"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Nl,{label:Sl("Left Margin"),help:Sl("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(Nl,{label:Sl("Top Margin"),help:Sl("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(Nl,{label:Sl("Width Of Chart Area"),help:Sl("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(Nl,{label:Sl("Height Of Chart Area"),help:Sl("Determines the hight of the chart area."),value:n.chartArea.height,onChange:function(t){n.chartArea.height=t,e.props.edit(n)}})))}}])&&Ll(n.prototype,r),a&&Ll(n,a),t}(jl);function Rl(e){return(Rl="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 Wl(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 Il(e,t){return!t||"object"!==Rl(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 Bl(e){return(Bl=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Jl(e,t){return(Jl=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Ul=wp.i18n.__,ql=wp.element,Vl=ql.Component,Gl=ql.Fragment,$l=wp.components,Kl=$l.CheckboxControl,Zl=$l.PanelBody,Ql=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Il(this,Bl(t).apply(this,arguments))}var n,r,a;return 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)}(t,e),n=t,(r=[{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(Zl,{title:Ul("Frontend Actions"),initialOpen:!1,className:"visualizer-advanced-panel"},void 0!==t.actions&&wp.element.createElement(Gl,null,wp.element.createElement(Kl,{label:Ul("Print"),help:Ul("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(Kl,{label:Ul("CSV"),help:Ul("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(Kl,{label:Ul("Excel"),help:Ul("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(Kl,{label:Ul("Copy"),help:Ul("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(Kl,{label:Ul("Download Image"),help:Ul("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)}})))}}])&&Wl(n.prototype,r),a&&Wl(n,a),t}(Vl);function Xl(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eu(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?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){Xl(e,t,n[t])}))}return e}var tu={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"}},nu=n(2);const ru={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&&ru.throwError(ru.getCaller(2),e)},isFalsy:(e="<unknown parameter>",t)=>{t||ru.throwError(ru.getCaller(2),e)},isNoneOf:(e="<unknown parameter>",t,n=[])=>{-1===n.indexOf(t)&&ru.throwError(ru.getCaller(2),e,"to be any of"+JSON.stringify(n))},isAnyOf:(e="<unknown parameter>",t,n=[])=>{n.indexOf(t)>-1&&ru.throwError(ru.getCaller(2),e,"not to be any of"+JSON.stringify(n))},isNotType:(e="<unknown parameter>",t,n="")=>{Object(nu.getType)(t)!==n.toLowerCase()&&ru.throwError(ru.getCaller(2),e,"to be type "+n.toLowerCase())},isAnyTypeOf:(e="<unknown parameter>",t,n=[])=>{n.forEach(n=>{Object(nu.getType)(t)===n&&ru.throwError(ru.getCaller(2),e,"not to be type of "+n.toLowerCase())})},missingKey:(e="<unknown parameter>",t,n="")=>{ru.isUndefined(e,t),-1===Object.keys(t).indexOf(n)&&ru.throwError(ru.getCaller(2),e,"to contain '"+n+"' key")},missingAnyKeys:(e="<unknown parameter>",t,n=[""])=>{ru.isUndefined(e,t);const r=Object.keys(t);n.forEach(t=>{-1===r.indexOf(t)&&ru.throwError(ru.getCaller(2),e,"to contain '"+t+"' key")})},containsUndefined:(e="<unknown parameter>",t)=>{[void 0,null].forEach(n=>{const r=Object(nu.locate)(t,n);r&&ru.throwError(ru.getCaller(2),e,"not to contain '"+JSON.stringify(n)+"' at "+r)})},isInvalidPath:(e="<unknown parameter>",t)=>{ru.isUndefined(e,t),ru.isNotType(e,t,"string"),ru.isAnyOf(e,t,["","/"]),".$[]#".split().forEach(n=>{t.indexOf(n)>-1&&ru.throwError(ru.getCaller(2),e,"not to contain invalid character '"+n+"'")}),t.match(/\/{2,}/g)&&ru.throwError(ru.getCaller(2),e,"not to contain consecutive forward slash characters")},isInvalidWriteData:(e="<unknown parameter>",t)=>{ru.isUndefined(e,t),ru.containsUndefined(e,t)}};var au=ru;const iu=(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 ou={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.9
66
  *
67
  * This source code is licensed under the MIT license found in the
classes/Visualizer/Gutenberg/src/Components/Sidebar/GeneralSettings.js CHANGED
@@ -46,6 +46,12 @@ class GeneralSettings extends Component {
46
  positions.push({ label: __( 'Inside the chart' ), value: 'in' });
47
  }
48
 
 
 
 
 
 
 
49
  let titleHelp = __( 'Text to display above the chart.' );
50
  if ( 0 <= [ 'tabular', 'dataTable', 'gauge', 'geo', 'timeline' ].indexOf( type ) ) {
51
  titleHelp = __( 'Text to display in the back-end admin area' );
@@ -200,9 +206,11 @@ class GeneralSettings extends Component {
200
  if ( 'pie' !== type ) {
201
  let axis = 'left' === e ? 1 : 0;
202
 
203
- Object.keys( settings.series ).map( i => {
204
- settings.series[i].targetAxisIndex = axis;
205
- });
 
 
206
  }
207
 
208
  settings.legend.position = e;
46
  positions.push({ label: __( 'Inside the chart' ), value: 'in' });
47
  }
48
 
49
+ if ( 'bubble' === type ) {
50
+ positions = positions.filter( function( obj ) {
51
+ return 'left' !== obj.value;
52
+ });
53
+ }
54
+
55
  let titleHelp = __( 'Text to display above the chart.' );
56
  if ( 0 <= [ 'tabular', 'dataTable', 'gauge', 'geo', 'timeline' ].indexOf( type ) ) {
57
  titleHelp = __( 'Text to display in the back-end admin area' );
206
  if ( 'pie' !== type ) {
207
  let axis = 'left' === e ? 1 : 0;
208
 
209
+ if ( settings.series ) {
210
+ Object.keys( settings.series ).map( i => {
211
+ settings.series[i].targetAxisIndex = axis;
212
+ });
213
+ }
214
  }
215
 
216
  settings.legend.position = e;
classes/Visualizer/Gutenberg/src/Components/Sidebar/SlicesSettings.js CHANGED
@@ -68,6 +68,9 @@ class SlicesSettings extends Component {
68
  settings.slices[i].offset = e;
69
  this.props.edit( settings );
70
  } }
 
 
 
71
  />
72
 
73
  <BaseControl
68
  settings.slices[i].offset = e;
69
  this.props.edit( settings );
70
  } }
71
+ type="number"
72
+ min="0"
73
+ step="0.1"
74
  />
75
 
76
  <BaseControl
classes/Visualizer/Module/Chart.php CHANGED
@@ -1401,7 +1401,7 @@ class Visualizer_Module_Chart extends Visualizer_Module {
1401
  )
1402
  );
1403
 
1404
- if ( ! $hours ) {
1405
  $hours = -1;
1406
  }
1407
 
1401
  )
1402
  );
1403
 
1404
+ if ( 0 !== $hours && empty( $hours ) ) {
1405
  $hours = -1;
1406
  }
1407
 
classes/Visualizer/Module/Setup.php CHANGED
@@ -190,12 +190,50 @@ class Visualizer_Module_Setup extends Visualizer_Module {
190
  /**
191
  * Activate the plugin
192
  */
193
- public function activate() {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
194
  wp_clear_scheduled_hook( 'visualizer_schedule_refresh_db' );
195
  wp_schedule_event( strtotime( 'midnight' ) - get_option( 'gmt_offset' ) * HOUR_IN_SECONDS, 'hourly', 'visualizer_schedule_refresh_db' );
196
  add_option( 'visualizer-activated', true );
197
  }
198
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
199
  /**
200
  * Check if plugin has been activated and then redirect to the correct page.
201
  */
@@ -218,14 +256,6 @@ class Visualizer_Module_Setup extends Visualizer_Module {
218
  }
219
 
220
 
221
- /**
222
- * Deactivate the plugin
223
- */
224
- public function deactivate() {
225
- wp_clear_scheduled_hook( 'visualizer_schedule_refresh_db' );
226
- delete_option( 'visualizer-activated', true );
227
- }
228
-
229
  /**
230
  * Refresh the specific chart from the db.
231
  *
@@ -306,6 +336,18 @@ class Visualizer_Module_Setup extends Visualizer_Module {
306
  update_post_meta( $chart_id, Visualizer_Plugin::CF_SERIES, $source->getSeries() );
307
  }
308
 
 
 
 
 
 
 
 
 
 
 
 
 
309
  wp_update_post(
310
  array(
311
  'ID' => $chart_id,
@@ -313,6 +355,10 @@ class Visualizer_Module_Setup extends Visualizer_Module {
313
  )
314
  );
315
 
 
 
 
 
316
  $chart = get_post( $chart_id );
317
  delete_post_meta( $chart_id, Visualizer_Plugin::CF_ERROR );
318
  } else {
190
  /**
191
  * Activate the plugin
192
  */
193
+ public function activate( $network_wide ) {
194
+ if ( is_multisite() && $network_wide ) {
195
+ foreach ( get_sites( array( 'fields' => 'ids' ) ) as $blog_id ) {
196
+ switch_to_blog( $blog_id );
197
+ $this->activate_on_site();
198
+ restore_current_blog();
199
+ }
200
+ } else {
201
+ $this->activate_on_site();
202
+ }
203
+ }
204
+
205
+ /**
206
+ * Activates the plugin on a particular blog instance (supports multisite and single site).
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
 
214
+ /**
215
+ * Deactivate the plugin
216
+ */
217
+ public function deactivate( $network_wide ) {
218
+ if ( is_multisite() && $network_wide ) {
219
+ foreach ( get_sites( array( 'fields' => 'ids' ) ) as $blog_id ) {
220
+ switch_to_blog( $blog_id );
221
+ $this->deactivate_on_site();
222
+ restore_current_blog();
223
+ }
224
+ } else {
225
+ $this->deactivate_on_site();
226
+ }
227
+ }
228
+
229
+ /**
230
+ * Deactivates the plugin on a particular blog instance (supports multisite and single site).
231
+ */
232
+ private function deactivate_on_site() {
233
+ wp_clear_scheduled_hook( 'visualizer_schedule_refresh_db' );
234
+ delete_option( 'visualizer-activated', true );
235
+ }
236
+
237
  /**
238
  * Check if plugin has been activated and then redirect to the correct page.
239
  */
256
  }
257
 
258
 
 
 
 
 
 
 
 
 
259
  /**
260
  * Refresh the specific chart from the db.
261
  *
336
  update_post_meta( $chart_id, Visualizer_Plugin::CF_SERIES, $source->getSeries() );
337
  }
338
 
339
+ $allow_html = false;
340
+ $settings = get_post_meta( $chart_id, Visualizer_Plugin::CF_SETTINGS, true );
341
+ if ( isset( $settings['allowHtml'] ) && intval( $settings['allowHtml'] ) === 1 ) {
342
+ $allow_html = true;
343
+ }
344
+
345
+ $allow_html = apply_filters( 'visualizer_allow_html_content', $allow_html, $chart_id, $chart );
346
+
347
+ if ( $allow_html ) {
348
+ kses_remove_filters();
349
+ }
350
+
351
  wp_update_post(
352
  array(
353
  'ID' => $chart_id,
355
  )
356
  );
357
 
358
+ if ( $allow_html ) {
359
+ kses_init_filters();
360
+ }
361
+
362
  $chart = get_post( $chart_id );
363
  delete_post_meta( $chart_id, Visualizer_Plugin::CF_ERROR );
364
  } else {
classes/Visualizer/Plugin.php CHANGED
@@ -28,7 +28,7 @@
28
  class Visualizer_Plugin {
29
 
30
  const NAME = 'visualizer';
31
- const VERSION = '3.4.8';
32
 
33
  // custom post types
34
  const CPT_VISUALIZER = 'visualizer';
28
  class Visualizer_Plugin {
29
 
30
  const NAME = 'visualizer';
31
+ const VERSION = '3.4.9';
32
 
33
  // custom post types
34
  const CPT_VISUALIZER = 'visualizer';
classes/Visualizer/Render/Sidebar/Google.php CHANGED
@@ -67,10 +67,15 @@ abstract class Visualizer_Render_Sidebar_Google extends Visualizer_Render_Sideba
67
  'none' => esc_html__( 'Omit the legend', 'visualizer' ),
68
  );
69
 
70
- if ( ! in_array( $this->get_chart_type( false ), array( 'Pie' ), true ) ) {
 
71
  $this->_legendPositions['in'] = esc_html__( 'Inside the chart', 'visualizer' );
72
  }
73
 
 
 
 
 
74
  $this->_alignments = array(
75
  '' => '',
76
  'start' => esc_html__( 'Aligned to the start of the allocated area', 'visualizer' ),
67
  'none' => esc_html__( 'Omit the legend', 'visualizer' ),
68
  );
69
 
70
+ $chart_type = $this->get_chart_type( false );
71
+ if ( ! in_array( $chart_type, array( 'Pie' ), true ) ) {
72
  $this->_legendPositions['in'] = esc_html__( 'Inside the chart', 'visualizer' );
73
  }
74
 
75
+ if ( in_array( $chart_type, array( 'Bubble' ), true ) ) {
76
+ unset( $this->_legendPositions['left'] );
77
+ }
78
+
79
  $this->_alignments = array(
80
  '' => '',
81
  'start' => esc_html__( 'Aligned to the start of the allocated area', 'visualizer' ),
classes/Visualizer/Render/Sidebar/Type/GoogleCharts/Pie.php CHANGED
@@ -186,9 +186,11 @@ class Visualizer_Render_Sidebar_Type_GoogleCharts_Pie extends Visualizer_Render_
186
  self::_renderTextItem(
187
  esc_html__( 'Slice Offset', 'visualizer' ),
188
  'slices[' . $i . '][offset]',
189
- isset( $this->slices[ $i ]['offset'] ) ? $this->slices[ $i ]['offset'] : null,
190
  esc_html__( "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).", 'visualizer' ),
191
- '0.0'
 
 
192
  );
193
 
194
  self::_renderColorPickerItem(
186
  self::_renderTextItem(
187
  esc_html__( 'Slice Offset', 'visualizer' ),
188
  'slices[' . $i . '][offset]',
189
+ isset( $this->slices[ $i ]['offset'] ) && ! empty( $this->slices[ $i ]['offset'] ) ? $this->slices[ $i ]['offset'] : 0,
190
  esc_html__( "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).", 'visualizer' ),
191
+ '0.0',
192
+ 'number',
193
+ array( 'step' => 0.1, 'min' => 0 )
194
  );
195
 
196
  self::_renderColorPickerItem(
classes/Visualizer/Source/Csv/Remote.php CHANGED
@@ -47,7 +47,7 @@ class Visualizer_Source_Csv_Remote extends Visualizer_Source_Csv {
47
  * @access public
48
  * @return string The serialized array of data.
49
  */
50
- public function getData() {
51
  return serialize(
52
  array(
53
  'source' => $this->_filename,
47
  * @access public
48
  * @return string The serialized array of data.
49
  */
50
+ public function getData( $dumb = false ) {
51
  return serialize(
52
  array(
53
  'source' => $this->_filename,
css/media.css CHANGED
@@ -1,5 +1,5 @@
1
  /*
2
- Version: 3.4.8
3
  */
4
  #visualizer-library-view {
5
  padding: 30px 10px 10px 30px;
1
  /*
2
+ Version: 3.4.9
3
  */
4
  #visualizer-library-view {
5
  padding: 30px 10px 10px 30px;
index.php CHANGED
@@ -4,7 +4,7 @@
4
  Plugin Name: Visualizer: Tables and Charts for WordPress
5
  Plugin URI: https://themeisle.com/plugins/visualizer-charts-and-graphs-lite/
6
  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.
7
- Version: 3.4.8
8
  Author: Themeisle
9
  Author URI: http://themeisle.com
10
  License: GPL v2.0 or later
4
  Plugin Name: Visualizer: Tables and Charts for WordPress
5
  Plugin URI: https://themeisle.com/plugins/visualizer-charts-and-graphs-lite/
6
  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.
7
+ Version: 3.4.9
8
  Author: Themeisle
9
  Author URI: http://themeisle.com
10
  License: GPL v2.0 or later
readme.md CHANGED
@@ -162,6 +162,13 @@ Pay attention that to turn your shortcodes into graphs, your theme has to have `
162
  13. Bar chart
163
 
164
  ## Changelog ##
 
 
 
 
 
 
 
165
  ### 3.4.8 - 2020-09-29 ###
166
 
167
  * [Fix] Option to edit charts imported from JSON
162
  13. Bar chart
163
 
164
  ## Changelog ##
165
+ ### 3.4.9 - 2020-11-26 ###
166
+
167
+ * [Fix] Pie chart slices offset problem in the Gutenberg editor
168
+ * [Fix] Warning is thrown when remote file is used as source
169
+ * [Fix] Bubble chart legend position not working in the Gutenberg editor
170
+
171
+
172
  ### 3.4.8 - 2020-09-29 ###
173
 
174
  * [Fix] Option to edit charts imported from JSON
readme.txt CHANGED
@@ -162,6 +162,13 @@ Pay attention that to turn your shortcodes into graphs, your theme has to have `
162
  13. Bar chart
163
 
164
  == Changelog ==
 
 
 
 
 
 
 
165
  = 3.4.8 - 2020-09-29 =
166
 
167
  * [Fix] Option to edit charts imported from JSON
162
  13. Bar chart
163
 
164
  == Changelog ==
165
+ = 3.4.9 - 2020-11-26 =
166
+
167
+ * [Fix] Pie chart slices offset problem in the Gutenberg editor
168
+ * [Fix] Warning is thrown when remote file is used as source
169
+ * [Fix] Bubble chart legend position not working in the Gutenberg editor
170
+
171
+
172
  = 3.4.8 - 2020-09-29 =
173
 
174
  * [Fix] Option to edit charts imported from JSON
themeisle-hash.json CHANGED
@@ -1 +1 @@
1
- {"index.php":"e696714581e4570da2662a4e020bbbd8"}
1
+ {"index.php":"c877ac07d6e33d8895c85daab3a4abe1"}
vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer' . '/autoload_real.php';
6
 
7
- return ComposerAutoloaderInitdf8ca61d0ce3ba51ffd2e60730040b6a::getLoader();
4
 
5
  require_once __DIR__ . '/composer' . '/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInit17dd138edaf95f9013b3fcb9af1dff72::getLoader();
vendor/autoload_52.php DELETED
@@ -1,7 +0,0 @@
1
- <?php
2
-
3
- // autoload_52.php generated by xrstf/composer-php52
4
-
5
- require_once dirname(__FILE__) . '/composer'.'/autoload_real_52.php';
6
-
7
- return ComposerAutoloaderInit311343bf50bf69c8e1a92d52e2929e1f::getLoader();
 
 
 
 
 
 
 
vendor/codeinwp/themeisle-sdk/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
 
 
 
 
 
1
  ##### [Version 3.2.15](https://github.com/Codeinwp/themeisle-sdk/compare/v3.2.14...v3.2.15) (2020-07-23)
2
 
3
  * remove no redundant module
1
+ ##### [Version 3.2.16](https://github.com/Codeinwp/themeisle-sdk/compare/v3.2.15...v3.2.16) (2020-11-17)
2
+
3
+ * Fix long texts on rollback.
4
+ * Fix RTL mode for uninstall feedback.
5
+
6
  ##### [Version 3.2.15](https://github.com/Codeinwp/themeisle-sdk/compare/v3.2.14...v3.2.15) (2020-07-23)
7
 
8
  * remove no redundant module
vendor/codeinwp/themeisle-sdk/load.php CHANGED
@@ -14,7 +14,7 @@ if ( ! defined( 'ABSPATH' ) ) {
14
  return;
15
  }
16
  // Current SDK version and path.
17
- $themeisle_sdk_version = '3.2.15';
18
  $themeisle_sdk_path = dirname( __FILE__ );
19
 
20
  global $themeisle_sdk_max_version;
14
  return;
15
  }
16
  // Current SDK version and path.
17
+ $themeisle_sdk_version = '3.2.16';
18
  $themeisle_sdk_path = dirname( __FILE__ );
19
 
20
  global $themeisle_sdk_max_version;
vendor/codeinwp/themeisle-sdk/src/Modules/Rollback.php CHANGED
@@ -228,6 +228,9 @@ class Rollback extends Abstract_Module {
228
 
229
  $transient = get_transient( $this->product->get_key() . '_warning_rollback' );
230
 
 
 
 
231
  if ( false === $transient ) {
232
  set_transient( $this->product->get_key() . '_warning_rollback', 'in progress', 30 );
233
  require_once( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' );
@@ -268,6 +271,9 @@ class Rollback extends Abstract_Module {
268
 
269
  $transient = get_transient( $this->product->get_key() . '_warning_rollback' );
270
 
 
 
 
271
  if ( false === $transient ) {
272
  set_transient( $this->product->get_key() . '_warning_rollback', 'in progress', 30 );
273
  require_once( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' );
228
 
229
  $transient = get_transient( $this->product->get_key() . '_warning_rollback' );
230
 
231
+ // Style fix for the api link that gets outside the content.
232
+ echo '<style>body#error-page{word-break:break-word;}</style>';
233
+
234
  if ( false === $transient ) {
235
  set_transient( $this->product->get_key() . '_warning_rollback', 'in progress', 30 );
236
  require_once( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' );
271
 
272
  $transient = get_transient( $this->product->get_key() . '_warning_rollback' );
273
 
274
+ // Style fix for the api link that gets outside the content.
275
+ echo '<style>body#error-page{word-break:break-word;}</style>';
276
+
277
  if ( false === $transient ) {
278
  set_transient( $this->product->get_key() . '_warning_rollback', 'in progress', 30 );
279
  require_once( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' );
vendor/codeinwp/themeisle-sdk/src/Modules/Uninstall_feedback.php CHANGED
@@ -236,7 +236,7 @@ class Uninstall_Feedback extends Abstract_Module {
236
  }
237
 
238
  .ti-feedback .popup--form input[type="radio"] {
239
- margin: 0 10px 0 0;
240
  }
241
 
242
  .ti-feedback .popup--form input[type="radio"]:checked ~ textarea {
@@ -314,7 +314,7 @@ class Uninstall_Feedback extends Abstract_Module {
314
  }
315
 
316
  .ti-feedback .buttons input:last-child {
317
- margin-left: auto;
318
  }
319
 
320
  .ti-theme-uninstall-feedback-drawer {
@@ -366,13 +366,19 @@ class Uninstall_Feedback extends Abstract_Module {
366
  content: "";
367
  display: block;
368
  position: absolute;
369
- border: 20px solid #23A1CE;
370
- left: -10px;
371
  top: 50%;
372
- border-top: 20px solid transparent;
373
- border-bottom: 20px solid transparent;
374
- border-left: 0;
375
  transform: translateY(-50%);
 
 
 
 
 
 
 
 
 
 
 
376
  }
377
 
378
  .ti-plugin-uninstall-feedback-popup {
@@ -380,7 +386,7 @@ class Uninstall_Feedback extends Abstract_Module {
380
  position: absolute;
381
  white-space: normal;
382
  width: 400px;
383
- left: 100%;
384
  top: -15px;
385
  }
386
 
236
  }
237
 
238
  .ti-feedback .popup--form input[type="radio"] {
239
+ <?php echo is_rtl() ? 'margin: 0 0 0 10px;' : 'margin: 0 10px 0 0;'; ?>
240
  }
241
 
242
  .ti-feedback .popup--form input[type="radio"]:checked ~ textarea {
314
  }
315
 
316
  .ti-feedback .buttons input:last-child {
317
+ <?php echo is_rtl() ? 'margin-right: auto;' : 'margin-left: auto;'; ?>
318
  }
319
 
320
  .ti-theme-uninstall-feedback-drawer {
366
  content: "";
367
  display: block;
368
  position: absolute;
 
 
369
  top: 50%;
 
 
 
370
  transform: translateY(-50%);
371
+ <?php
372
+ echo is_rtl() ?
373
+ 'right: -10px;
374
+ border-top: 20px solid transparent;
375
+ border-left: 20px solid #23A1CE;
376
+ border-bottom: 20px solid transparent;' :
377
+ 'left: -10px;
378
+ border-top: 20px solid transparent;
379
+ border-right: 20px solid #23A1CE;
380
+ border-bottom: 20px solid transparent;';
381
+ ?>
382
  }
383
 
384
  .ti-plugin-uninstall-feedback-popup {
386
  position: absolute;
387
  white-space: normal;
388
  width: 400px;
389
+ <?php echo is_rtl() ? 'right: calc( 100% + 15px );' : 'left: calc( 100% + 15px );'; ?>
390
  top: -15px;
391
  }
392
 
vendor/composer/ClassLoader52.php DELETED
@@ -1,271 +0,0 @@
1
- <?php
2
- /*
3
- * Copyright (c) 2013, Christoph Mewes, http://www.xrstf.de
4
- *
5
- * This file is released under the terms of the MIT license. You can find the
6
- * complete text in the attached LICENSE file or online at:
7
- *
8
- * http://www.opensource.org/licenses/mit-license.php
9
- *
10
- * --------------------------------------------------------------------------
11
- *
12
- * 99% of this is copied as-is from the original Composer source code and is
13
- * released under MIT license as well. Copyright goes to:
14
- *
15
- * - Fabien Potencier <fabien@symfony.com>
16
- * - Jordi Boggiano <j.boggiano@seld.be>
17
- */
18
-
19
- class xrstf_Composer52_ClassLoader {
20
- private $prefixes = array();
21
- private $fallbackDirs = array();
22
- private $useIncludePath = false;
23
- private $classMap = array();
24
- private $classMapAuthoratative = false;
25
- private $allowUnderscore = false;
26
-
27
- /**
28
- * @param boolean $flag true to allow class names with a leading underscore, false to disable
29
- */
30
- public function setAllowUnderscore($flag) {
31
- $this->allowUnderscore = (boolean) $flag;
32
- }
33
-
34
- /**
35
- * @return array
36
- */
37
- public function getPrefixes() {
38
- return $this->prefixes;
39
- }
40
-
41
- /**
42
- * Turns off searching the prefix and fallback directories for classes
43
- * that have not been registered with the class map.
44
- *
45
- * @param bool $classMapAuthoratative
46
- */
47
- public function setClassMapAuthoritative($classMapAuthoratative) {
48
- $this->classMapAuthoratative = $classMapAuthoratative;
49
- }
50
-
51
- /**
52
- * Should class lookup fail if not found in the current class map?
53
- *
54
- * @return bool
55
- */
56
- public function getClassMapAuthoratative() {
57
- return $this->classMapAuthoratative;
58
- }
59
-
60
- /**
61
- * @return array
62
- */
63
- public function getFallbackDirs() {
64
- return $this->fallbackDirs;
65
- }
66
-
67
- /**
68
- * @return array
69
- */
70
- public function getClassMap() {
71
- return $this->classMap;
72
- }
73
-
74
- /**
75
- * @param array $classMap class to filename map
76
- */
77
- public function addClassMap(array $classMap) {
78
- if ($this->classMap) {
79
- $this->classMap = array_merge($this->classMap, $classMap);
80
- }
81
- else {
82
- $this->classMap = $classMap;
83
- }
84
- }
85
-
86
- /**
87
- * Registers a set of classes, merging with any others previously set.
88
- *
89
- * @param string $prefix the classes prefix
90
- * @param array|string $paths the location(s) of the classes
91
- * @param bool $prepend prepend the location(s)
92
- */
93
- public function add($prefix, $paths, $prepend = false) {
94
- if (!$prefix) {
95
- if ($prepend) {
96
- $this->fallbackDirs = array_merge(
97
- (array) $paths,
98
- $this->fallbackDirs
99
- );
100
- }
101
- else {
102
- $this->fallbackDirs = array_merge(
103
- $this->fallbackDirs,
104
- (array) $paths
105
- );
106
- }
107
-
108
- return;
109
- }
110
-
111
- if (!isset($this->prefixes[$prefix])) {
112
- $this->prefixes[$prefix] = (array) $paths;
113
- return;
114
- }
115
-
116
- if ($prepend) {
117
- $this->prefixes[$prefix] = array_merge(
118
- (array) $paths,
119
- $this->prefixes[$prefix]
120
- );
121
- }
122
- else {
123
- $this->prefixes[$prefix] = array_merge(
124
- $this->prefixes[$prefix],
125
- (array) $paths
126
- );
127
- }
128
- }
129
-
130
- /**
131
- * Registers a set of classes, replacing any others previously set.
132
- *
133
- * @param string $prefix the classes prefix
134
- * @param array|string $paths the location(s) of the classes
135
- */
136
- public function set($prefix, $paths) {
137
- if (!$prefix) {
138
- $this->fallbackDirs = (array) $paths;
139
- return;
140
- }
141
-
142
- $this->prefixes[$prefix] = (array) $paths;
143
- }
144
-
145
- /**
146
- * Turns on searching the include path for class files.
147
- *
148
- * @param bool $useIncludePath
149
- */
150
- public function setUseIncludePath($useIncludePath) {
151
- $this->useIncludePath = $useIncludePath;
152
- }
153
-
154
- /**
155
- * Can be used to check if the autoloader uses the include path to check
156
- * for classes.
157
- *
158
- * @return bool
159
- */
160
- public function getUseIncludePath() {
161
- return $this->useIncludePath;
162
- }
163
-
164
- /**
165
- * Registers this instance as an autoloader.
166
- */
167
- public function register() {
168
- spl_autoload_register(array($this, 'loadClass'), true);
169
- }
170
-
171
- /**
172
- * Unregisters this instance as an autoloader.
173
- */
174
- public function unregister() {
175
- spl_autoload_unregister(array($this, 'loadClass'));
176
- }
177
-
178
- /**
179
- * Loads the given class or interface.
180
- *
181
- * @param string $class the name of the class
182
- * @return bool|null true, if loaded
183
- */
184
- public function loadClass($class) {
185
- if ($file = $this->findFile($class)) {
186
- include $file;
187
- return true;
188
- }
189
- }
190
-
191
- /**
192
- * Finds the path to the file where the class is defined.
193
- *
194
- * @param string $class the name of the class
195
- * @return string|null the path, if found
196
- */
197
- public function findFile($class) {
198
- if ('\\' === $class[0]) {
199
- $class = substr($class, 1);
200
- }
201
-
202
- if (isset($this->classMap[$class])) {
203
- return $this->classMap[$class];
204
- }
205
- elseif ($this->classMapAuthoratative) {
206
- return false;
207
- }
208
-
209
- $classPath = $this->getClassPath($class);
210
-
211
- foreach ($this->prefixes as $prefix => $dirs) {
212
- if (0 === strpos($class, $prefix)) {
213
- foreach ($dirs as $dir) {
214
- if (file_exists($dir.DIRECTORY_SEPARATOR.$classPath)) {
215
- return $dir.DIRECTORY_SEPARATOR.$classPath;
216
- }
217
- }
218
- }
219
- }
220
-
221
- foreach ($this->fallbackDirs as $dir) {
222
- if (file_exists($dir.DIRECTORY_SEPARATOR.$classPath)) {
223
- return $dir.DIRECTORY_SEPARATOR.$classPath;
224
- }
225
- }
226
-
227
- if ($this->useIncludePath && $file = self::resolveIncludePath($classPath)) {
228
- return $file;
229
- }
230
-
231
- return $this->classMap[$class] = false;
232
- }
233
-
234
- private function getClassPath($class) {
235
- if (false !== $pos = strrpos($class, '\\')) {
236
- // namespaced class name
237
- $classPath = str_replace('\\', DIRECTORY_SEPARATOR, substr($class, 0, $pos)).DIRECTORY_SEPARATOR;
238
- $className = substr($class, $pos + 1);
239
- }
240
- else {
241
- // PEAR-like class name
242
- $classPath = null;
243
- $className = $class;
244
- }
245
-
246
- $className = str_replace('_', DIRECTORY_SEPARATOR, $className);
247
-
248
- // restore the prefix
249
- if ($this->allowUnderscore && DIRECTORY_SEPARATOR === $className[0]) {
250
- $className[0] = '_';
251
- }
252
-
253
- $classPath .= $className.'.php';
254
-
255
- return $classPath;
256
- }
257
-
258
- public static function resolveIncludePath($classPath) {
259
- $paths = explode(PATH_SEPARATOR, get_include_path());
260
-
261
- foreach ($paths as $path) {
262
- $path = rtrim($path, '/\\');
263
-
264
- if ($file = file_exists($path.DIRECTORY_SEPARATOR.$file)) {
265
- return $file;
266
- }
267
- }
268
-
269
- return false;
270
- }
271
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/autoload_namespaces.php CHANGED
@@ -6,6 +6,5 @@ $vendorDir = dirname(dirname(__FILE__));
6
  $baseDir = dirname($vendorDir);
7
 
8
  return array(
9
- 'xrstf\\Composer52' => array($vendorDir . '/xrstf/composer-php52/lib'),
10
  'ForceUTF8\\' => array($vendorDir . '/neitanod/forceutf8/src'),
11
  );
6
  $baseDir = dirname($vendorDir);
7
 
8
  return array(
 
9
  'ForceUTF8\\' => array($vendorDir . '/neitanod/forceutf8/src'),
10
  );
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInitdf8ca61d0ce3ba51ffd2e60730040b6a
6
  {
7
  private static $loader;
8
 
@@ -19,9 +19,9 @@ class ComposerAutoloaderInitdf8ca61d0ce3ba51ffd2e60730040b6a
19
  return self::$loader;
20
  }
21
 
22
- spl_autoload_register(array('ComposerAutoloaderInitdf8ca61d0ce3ba51ffd2e60730040b6a', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
- spl_autoload_unregister(array('ComposerAutoloaderInitdf8ca61d0ce3ba51ffd2e60730040b6a', 'loadClassLoader'));
25
 
26
  $map = require __DIR__ . '/autoload_namespaces.php';
27
  foreach ($map as $namespace => $path) {
@@ -42,14 +42,14 @@ class ComposerAutoloaderInitdf8ca61d0ce3ba51ffd2e60730040b6a
42
 
43
  $includeFiles = require __DIR__ . '/autoload_files.php';
44
  foreach ($includeFiles as $fileIdentifier => $file) {
45
- composerRequiredf8ca61d0ce3ba51ffd2e60730040b6a($fileIdentifier, $file);
46
  }
47
 
48
  return $loader;
49
  }
50
  }
51
 
52
- function composerRequiredf8ca61d0ce3ba51ffd2e60730040b6a($fileIdentifier, $file)
53
  {
54
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
55
  require $file;
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderInit17dd138edaf95f9013b3fcb9af1dff72
6
  {
7
  private static $loader;
8
 
19
  return self::$loader;
20
  }
21
 
22
+ spl_autoload_register(array('ComposerAutoloaderInit17dd138edaf95f9013b3fcb9af1dff72', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
+ spl_autoload_unregister(array('ComposerAutoloaderInit17dd138edaf95f9013b3fcb9af1dff72', 'loadClassLoader'));
25
 
26
  $map = require __DIR__ . '/autoload_namespaces.php';
27
  foreach ($map as $namespace => $path) {
42
 
43
  $includeFiles = require __DIR__ . '/autoload_files.php';
44
  foreach ($includeFiles as $fileIdentifier => $file) {
45
+ composerRequire17dd138edaf95f9013b3fcb9af1dff72($fileIdentifier, $file);
46
  }
47
 
48
  return $loader;
49
  }
50
  }
51
 
52
+ function composerRequire17dd138edaf95f9013b3fcb9af1dff72($fileIdentifier, $file)
53
  {
54
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
55
  require $file;
vendor/composer/autoload_real_52.php DELETED
@@ -1,105 +0,0 @@
1
- <?php
2
-
3
- // autoload_real_52.php generated by xrstf/composer-php52
4
-
5
- class ComposerAutoloaderInit311343bf50bf69c8e1a92d52e2929e1f {
6
- private static $loader;
7
-
8
- public static function loadClassLoader($class) {
9
- if ('xrstf_Composer52_ClassLoader' === $class) {
10
- require dirname(__FILE__).'/ClassLoader52.php';
11
- }
12
- }
13
-
14
- /**
15
- * @return xrstf_Composer52_ClassLoader
16
- */
17
- public static function getLoader() {
18
- if (null !== self::$loader) {
19
- return self::$loader;
20
- }
21
-
22
- spl_autoload_register(array('ComposerAutoloaderInit311343bf50bf69c8e1a92d52e2929e1f', 'loadClassLoader'), true /*, true */);
23
- self::$loader = $loader = new xrstf_Composer52_ClassLoader();
24
- spl_autoload_unregister(array('ComposerAutoloaderInit311343bf50bf69c8e1a92d52e2929e1f', 'loadClassLoader'));
25
-
26
- $vendorDir = dirname(dirname(__FILE__));
27
- $baseDir = dirname($vendorDir);
28
- $dir = dirname(__FILE__);
29
-
30
- $map = require $dir.'/autoload_namespaces.php';
31
- foreach ($map as $namespace => $path) {
32
- $loader->add($namespace, $path);
33
- }
34
-
35
- $classMap = require $dir.'/autoload_classmap.php';
36
- if ($classMap) {
37
- $loader->addClassMap($classMap);
38
- }
39
-
40
- $loader->register(true);
41
-
42
- // require $vendorDir . '/markbaker/matrix/classes/src/functions/adjoint.php'; // disabled because of PHP 5.3 syntax
43
- // require $vendorDir . '/markbaker/matrix/classes/src/functions/antidiagonal.php'; // disabled because of PHP 5.3 syntax
44
- // require $vendorDir . '/markbaker/matrix/classes/src/functions/cofactors.php'; // disabled because of PHP 5.3 syntax
45
- // require $vendorDir . '/markbaker/matrix/classes/src/functions/determinant.php'; // disabled because of PHP 5.3 syntax
46
- // require $vendorDir . '/markbaker/matrix/classes/src/functions/diagonal.php'; // disabled because of PHP 5.3 syntax
47
- // require $vendorDir . '/markbaker/matrix/classes/src/functions/identity.php'; // disabled because of PHP 5.3 syntax
48
- // require $vendorDir . '/markbaker/matrix/classes/src/functions/inverse.php'; // disabled because of PHP 5.3 syntax
49
- // require $vendorDir . '/markbaker/matrix/classes/src/functions/minors.php'; // disabled because of PHP 5.3 syntax
50
- // require $vendorDir . '/markbaker/matrix/classes/src/functions/trace.php'; // disabled because of PHP 5.3 syntax
51
- // require $vendorDir . '/markbaker/matrix/classes/src/functions/transpose.php'; // disabled because of PHP 5.3 syntax
52
- // require $vendorDir . '/markbaker/matrix/classes/src/operations/add.php'; // disabled because of PHP 5.3 syntax
53
- // require $vendorDir . '/markbaker/matrix/classes/src/operations/directsum.php'; // disabled because of PHP 5.3 syntax
54
- // require $vendorDir . '/markbaker/matrix/classes/src/operations/subtract.php'; // disabled because of PHP 5.3 syntax
55
- // require $vendorDir . '/markbaker/matrix/classes/src/operations/multiply.php'; // disabled because of PHP 5.3 syntax
56
- // require $vendorDir . '/markbaker/matrix/classes/src/operations/divideby.php'; // disabled because of PHP 5.3 syntax
57
- // require $vendorDir . '/markbaker/matrix/classes/src/operations/divideinto.php'; // disabled because of PHP 5.3 syntax
58
- // require $vendorDir . '/markbaker/complex/classes/src/functions/abs.php'; // disabled because of PHP 5.3 syntax
59
- // require $vendorDir . '/markbaker/complex/classes/src/functions/acos.php'; // disabled because of PHP 5.3 syntax
60
- // require $vendorDir . '/markbaker/complex/classes/src/functions/acosh.php'; // disabled because of PHP 5.3 syntax
61
- // require $vendorDir . '/markbaker/complex/classes/src/functions/acot.php'; // disabled because of PHP 5.3 syntax
62
- // require $vendorDir . '/markbaker/complex/classes/src/functions/acoth.php'; // disabled because of PHP 5.3 syntax
63
- // require $vendorDir . '/markbaker/complex/classes/src/functions/acsc.php'; // disabled because of PHP 5.3 syntax
64
- // require $vendorDir . '/markbaker/complex/classes/src/functions/acsch.php'; // disabled because of PHP 5.3 syntax
65
- // require $vendorDir . '/markbaker/complex/classes/src/functions/argument.php'; // disabled because of PHP 5.3 syntax
66
- // require $vendorDir . '/markbaker/complex/classes/src/functions/asec.php'; // disabled because of PHP 5.3 syntax
67
- // require $vendorDir . '/markbaker/complex/classes/src/functions/asech.php'; // disabled because of PHP 5.3 syntax
68
- // require $vendorDir . '/markbaker/complex/classes/src/functions/asin.php'; // disabled because of PHP 5.3 syntax
69
- // require $vendorDir . '/markbaker/complex/classes/src/functions/asinh.php'; // disabled because of PHP 5.3 syntax
70
- // require $vendorDir . '/markbaker/complex/classes/src/functions/atan.php'; // disabled because of PHP 5.3 syntax
71
- // require $vendorDir . '/markbaker/complex/classes/src/functions/atanh.php'; // disabled because of PHP 5.3 syntax
72
- // require $vendorDir . '/markbaker/complex/classes/src/functions/conjugate.php'; // disabled because of PHP 5.3 syntax
73
- // require $vendorDir . '/markbaker/complex/classes/src/functions/cos.php'; // disabled because of PHP 5.3 syntax
74
- // require $vendorDir . '/markbaker/complex/classes/src/functions/cosh.php'; // disabled because of PHP 5.3 syntax
75
- // require $vendorDir . '/markbaker/complex/classes/src/functions/cot.php'; // disabled because of PHP 5.3 syntax
76
- // require $vendorDir . '/markbaker/complex/classes/src/functions/coth.php'; // disabled because of PHP 5.3 syntax
77
- // require $vendorDir . '/markbaker/complex/classes/src/functions/csc.php'; // disabled because of PHP 5.3 syntax
78
- // require $vendorDir . '/markbaker/complex/classes/src/functions/csch.php'; // disabled because of PHP 5.3 syntax
79
- // require $vendorDir . '/markbaker/complex/classes/src/functions/exp.php'; // disabled because of PHP 5.3 syntax
80
- // require $vendorDir . '/markbaker/complex/classes/src/functions/inverse.php'; // disabled because of PHP 5.3 syntax
81
- // require $vendorDir . '/markbaker/complex/classes/src/functions/ln.php'; // disabled because of PHP 5.3 syntax
82
- // require $vendorDir . '/markbaker/complex/classes/src/functions/log2.php'; // disabled because of PHP 5.3 syntax
83
- // require $vendorDir . '/markbaker/complex/classes/src/functions/log10.php'; // disabled because of PHP 5.3 syntax
84
- // require $vendorDir . '/markbaker/complex/classes/src/functions/negative.php'; // disabled because of PHP 5.3 syntax
85
- // require $vendorDir . '/markbaker/complex/classes/src/functions/pow.php'; // disabled because of PHP 5.3 syntax
86
- // require $vendorDir . '/markbaker/complex/classes/src/functions/rho.php'; // disabled because of PHP 5.3 syntax
87
- // require $vendorDir . '/markbaker/complex/classes/src/functions/sec.php'; // disabled because of PHP 5.3 syntax
88
- // require $vendorDir . '/markbaker/complex/classes/src/functions/sech.php'; // disabled because of PHP 5.3 syntax
89
- // require $vendorDir . '/markbaker/complex/classes/src/functions/sin.php'; // disabled because of PHP 5.3 syntax
90
- // require $vendorDir . '/markbaker/complex/classes/src/functions/sinh.php'; // disabled because of PHP 5.3 syntax
91
- // require $vendorDir . '/markbaker/complex/classes/src/functions/sqrt.php'; // disabled because of PHP 5.3 syntax
92
- // require $vendorDir . '/markbaker/complex/classes/src/functions/tan.php'; // disabled because of PHP 5.3 syntax
93
- // require $vendorDir . '/markbaker/complex/classes/src/functions/tanh.php'; // disabled because of PHP 5.3 syntax
94
- // require $vendorDir . '/markbaker/complex/classes/src/functions/theta.php'; // disabled because of PHP 5.3 syntax
95
- // require $vendorDir . '/markbaker/complex/classes/src/operations/add.php'; // disabled because of PHP 5.3 syntax
96
- // require $vendorDir . '/markbaker/complex/classes/src/operations/subtract.php'; // disabled because of PHP 5.3 syntax
97
- // require $vendorDir . '/markbaker/complex/classes/src/operations/multiply.php'; // disabled because of PHP 5.3 syntax
98
- // require $vendorDir . '/markbaker/complex/classes/src/operations/divideby.php'; // disabled because of PHP 5.3 syntax
99
- // require $vendorDir . '/markbaker/complex/classes/src/operations/divideinto.php'; // disabled because of PHP 5.3 syntax
100
- require $vendorDir . '/codeinwp/themeisle-sdk/load.php';
101
- // require $vendorDir . '/phpoffice/phpspreadsheet/src/Bootstrap.php'; // disabled because of PHP 5.3 syntax
102
-
103
- return $loader;
104
- }
105
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installed.json CHANGED
@@ -6,20 +6,22 @@
6
  "source": {
7
  "type": "git",
8
  "url": "https://github.com/Codeinwp/themeisle-sdk.git",
9
- "reference": "95b7447a5f4faba410c281c4bf278fbd740fed71"
10
  },
11
  "dist": {
12
  "type": "zip",
13
- "url": "https://api.github.com/repos/Codeinwp/themeisle-sdk/zipball/95b7447a5f4faba410c281c4bf278fbd740fed71",
14
- "reference": "95b7447a5f4faba410c281c4bf278fbd740fed71",
15
  "shasum": ""
16
  },
17
  "require-dev": {
18
- "dealerdirect/phpcodesniffer-composer-installer": "^0.4.4",
19
- "squizlabs/php_codesniffer": "^3.1",
20
- "wp-coding-standards/wpcs": "^1.0.0"
 
 
21
  },
22
- "time": "2020-07-23 15:02:10",
23
  "type": "library",
24
  "installation-source": "source",
25
  "notification-url": "https://packagist.org/downloads/",
@@ -33,45 +35,12 @@
33
  "homepage": "https://themeisle.com"
34
  }
35
  ],
36
- "description": "ThemeIsle SDK.",
37
  "homepage": "https://github.com/Codeinwp/themeisle-sdk",
38
  "keywords": [
39
  "wordpress"
40
  ]
41
  },
42
- {
43
- "name": "xrstf/composer-php52",
44
- "version": "v1.0.20",
45
- "version_normalized": "1.0.20.0",
46
- "source": {
47
- "type": "git",
48
- "url": "https://github.com/composer-php52/composer-php52.git",
49
- "reference": "bd41459d5e27df8d33057842b32377c39e97a5a8"
50
- },
51
- "dist": {
52
- "type": "zip",
53
- "url": "https://api.github.com/repos/composer-php52/composer-php52/zipball/bd41459d5e27df8d33057842b32377c39e97a5a8",
54
- "reference": "bd41459d5e27df8d33057842b32377c39e97a5a8",
55
- "shasum": ""
56
- },
57
- "time": "2016-04-16 21:52:24",
58
- "type": "library",
59
- "extra": {
60
- "branch-alias": {
61
- "dev-default": "1.x-dev"
62
- }
63
- },
64
- "installation-source": "dist",
65
- "autoload": {
66
- "psr-0": {
67
- "xrstf\\Composer52": "lib/"
68
- }
69
- },
70
- "notification-url": "https://packagist.org/downloads/",
71
- "license": [
72
- "MIT"
73
- ]
74
- },
75
  {
76
  "name": "markbaker/matrix",
77
  "version": "1.2.1",
6
  "source": {
7
  "type": "git",
8
  "url": "https://github.com/Codeinwp/themeisle-sdk.git",
9
+ "reference": "b116dffbe39ea9e37169fdd683bab54c545fe560"
10
  },
11
  "dist": {
12
  "type": "zip",
13
+ "url": "https://api.github.com/repos/Codeinwp/themeisle-sdk/zipball/b116dffbe39ea9e37169fdd683bab54c545fe560",
14
+ "reference": "b116dffbe39ea9e37169fdd683bab54c545fe560",
15
  "shasum": ""
16
  },
17
  "require-dev": {
18
+ "automattic/vipwpcs": "^1.0.0",
19
+ "dealerdirect/phpcodesniffer-composer-installer": "0.7.0",
20
+ "phpcompatibility/php-compatibility": "^9",
21
+ "squizlabs/php_codesniffer": "^3.3",
22
+ "wp-coding-standards/wpcs": "^1"
23
  },
24
+ "time": "2020-11-17 08:35:16",
25
  "type": "library",
26
  "installation-source": "source",
27
  "notification-url": "https://packagist.org/downloads/",
35
  "homepage": "https://themeisle.com"
36
  }
37
  ],
38
+ "description": "ThemeIsle SDK",
39
  "homepage": "https://github.com/Codeinwp/themeisle-sdk",
40
  "keywords": [
41
  "wordpress"
42
  ]
43
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
44
  {
45
  "name": "markbaker/matrix",
46
  "version": "1.2.1",
vendor/xrstf/composer-php52/LICENSE DELETED
@@ -1,19 +0,0 @@
1
- Copyright (c) 2013 Christoph Mewes
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining a copy
4
- of this software and associated documentation files (the "Software"), to deal
5
- in the Software without restriction, including without limitation the rights
6
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- copies of the Software, and to permit persons to whom the Software is furnished
8
- to do so, subject to the following conditions:
9
-
10
- The above copyright notice and this permission notice shall be included in all
11
- copies or substantial portions of the Software.
12
-
13
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
- THE SOFTWARE.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/xrstf/composer-php52/README.md DELETED
@@ -1,37 +0,0 @@
1
- PHP 5.2 Autoloading for Composer
2
- ================================
3
-
4
- This package provides an easy way to get a PHP 5.2 compatible autoloader out of Composer. The generated autoloader is fully compatible to the original and is written into separate files, each ending with `_52.php`.
5
-
6
- Legacy
7
- ------
8
-
9
- Please do not use this, if you can avoid it. It's a horrible hack, often breaks and is extremely tied to Composer's interna. This package was originally developed in 2012, when PHP 5.2 was much more common on cheap webhosts.
10
-
11
- In 2016, this package has been moved from Bitbucket to a Github organization, because the original developer could no longer reliably maintain it. This is the reason for this legacy package name ``xrstf/...``.
12
-
13
- Usage
14
- -----
15
-
16
- In your project's `composer.json`, add the following lines:
17
-
18
- ```json
19
- {
20
- "require": {
21
- "xrstf/composer-php52": "1.*"
22
- },
23
- "scripts": {
24
- "post-install-cmd": [
25
- "xrstf\\Composer52\\Generator::onPostInstallCmd"
26
- ],
27
- "post-update-cmd": [
28
- "xrstf\\Composer52\\Generator::onPostInstallCmd"
29
- ],
30
- "post-autoload-dump": [
31
- "xrstf\\Composer52\\Generator::onPostInstallCmd"
32
- ]
33
- }
34
- }
35
- ```
36
-
37
- After the next update/install, you will have a `vendor/autoload_52.php` file, that you can simply include and use in PHP 5.2 projects.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/xrstf/composer-php52/lib/xrstf/Composer52/AutoloadGenerator.php DELETED
@@ -1,346 +0,0 @@
1
- <?php
2
- /*
3
- * Copyright (c) 2013, Christoph Mewes, http://www.xrstf.de
4
- *
5
- * This file is released under the terms of the MIT license. You can find the
6
- * complete text in the attached LICENSE file or online at:
7
- *
8
- * http://www.opensource.org/licenses/mit-license.php
9
- *
10
- * --------------------------------------------------------------------------
11
- *
12
- * 99% of this is copied as-is from the original Composer source code and is
13
- * released under MIT license as well. Copyright goes to:
14
- *
15
- * - Igor Wiedler <igor@wiedler.ch>
16
- * - Jordi Boggiano <j.boggiano@seld.be>
17
- */
18
-
19
- namespace xrstf\Composer52;
20
-
21
- use Composer\Autoload\AutoloadGenerator as BaseGenerator;
22
- use Composer\Autoload\ClassMapGenerator;
23
- use Composer\Config;
24
- use Composer\Installer\InstallationManager;
25
- use Composer\Package\AliasPackage;
26
- use Composer\Package\PackageInterface;
27
- use Composer\Repository\InstalledRepositoryInterface;
28
- use Composer\Util\Filesystem;
29
-
30
- class AutoloadGenerator extends BaseGenerator {
31
-
32
- /**
33
- * @var bool
34
- */
35
- private $classMapAuthoritative = false;
36
-
37
- public function __construct() {
38
- // do nothing (but keep this constructor so we can build an instance without the need for an event dispatcher)
39
- }
40
-
41
- /**
42
- * Whether or not generated autoloader considers the class map
43
- * authoritative.
44
- *
45
- * @param bool $classMapAuthoritative
46
- */
47
- public function setClassMapAuthoritative($classMapAuthoritative)
48
- {
49
- $this->classMapAuthoritative = (boolean) $classMapAuthoritative;
50
- }
51
-
52
- public function dump(Config $config, InstalledRepositoryInterface $localRepo, PackageInterface $mainPackage, InstallationManager $installationManager, $targetDir, $scanPsr0Packages = false, $suffix = '') {
53
- if ($this->classMapAuthoritative) {
54
- // Force scanPsr0Packages when classmap is authoritative
55
- $scanPsr0Packages = true;
56
- }
57
-
58
- $filesystem = new Filesystem();
59
- $filesystem->ensureDirectoryExists($config->get('vendor-dir'));
60
-
61
- $cwd = getcwd();
62
- $basePath = $filesystem->normalizePath($cwd);
63
- $vendorPath = $filesystem->normalizePath(realpath($config->get('vendor-dir')));
64
- $targetDir = $vendorPath.'/'.$targetDir;
65
- $filesystem->ensureDirectoryExists($targetDir);
66
-
67
- $useGlobalIncludePath = (bool) $config->get('use-include-path');
68
- $prependAutoloader = $config->get('prepend-autoloader') === false ? 'false' : 'true';
69
- $classMapAuthoritative = $config->get('classmap-authoritative');
70
-
71
- $vendorPathCode = $filesystem->findShortestPathCode(realpath($targetDir), $vendorPath, true);
72
- $vendorPathToTargetDirCode = $filesystem->findShortestPathCode($vendorPath, realpath($targetDir), true);
73
-
74
- $appBaseDirCode = $filesystem->findShortestPathCode($vendorPath, $basePath, true);
75
- $appBaseDirCode = str_replace('__DIR__', '$vendorDir', $appBaseDirCode);
76
-
77
- // add 5.2 compat
78
- $vendorPathCode = str_replace('__DIR__', 'dirname(__FILE__)', $vendorPathCode);
79
- $vendorPathToTargetDirCode = str_replace('__DIR__', 'dirname(__FILE__)', $vendorPathToTargetDirCode);
80
-
81
- $packageMap = $this->buildPackageMap($installationManager, $mainPackage, $localRepo->getCanonicalPackages());
82
- $autoloads = $this->parseAutoloads($packageMap, $mainPackage);
83
-
84
- // add custom psr-0 autoloading if the root package has a target dir
85
- $targetDirLoader = null;
86
- $mainAutoload = $mainPackage->getAutoload();
87
- if ($mainPackage->getTargetDir() && !empty($mainAutoload['psr-0'])) {
88
- $levels = count(explode('/', $filesystem->normalizePath($mainPackage->getTargetDir())));
89
- $prefixes = implode(', ', array_map(function ($prefix) {
90
- return var_export($prefix, true);
91
- }, array_keys($mainAutoload['psr-0'])));
92
-
93
- $baseDirFromTargetDirCode = $filesystem->findShortestPathCode($targetDir, $basePath, true);
94
-
95
- $targetDirLoader = <<<EOF
96
-
97
- public static function autoload(\$class) {
98
- \$dir = $baseDirFromTargetDirCode.'/';
99
- \$prefixes = array($prefixes);
100
-
101
- foreach (\$prefixes as \$prefix) {
102
- if (0 !== strpos(\$class, \$prefix)) {
103
- continue;
104
- }
105
-
106
- \$path = explode(DIRECTORY_SEPARATOR, self::getClassPath(\$class));
107
- \$path = \$dir.implode('/', array_slice(\$path, $levels));
108
-
109
- if (!\$path = self::resolveIncludePath(\$path)) {
110
- return false;
111
- }
112
-
113
- require \$path;
114
- return true;
115
- }
116
- }
117
-
118
- EOF;
119
- }
120
-
121
- $filesCode = "";
122
- $autoloads['files'] = new \RecursiveIteratorIterator(new \RecursiveArrayIterator($autoloads['files']));
123
- foreach ($autoloads['files'] as $functionFile) {
124
- // don't include file if it is using PHP 5.3+ syntax
125
- // https://bitbucket.org/xrstf/composer-php52/issue/4
126
- if ($this->isPHP53($functionFile)) {
127
- $filesCode .= '// require '.$this->getPathCode($filesystem, $basePath, $vendorPath, $functionFile)."; // disabled because of PHP 5.3 syntax\n";
128
- }
129
- else {
130
- $filesCode .= ' require '.$this->getPathCode($filesystem, $basePath, $vendorPath, $functionFile).";\n";
131
- }
132
- }
133
-
134
- if (!$suffix) {
135
- $suffix = md5(uniqid('', true));
136
- }
137
-
138
- $includePathFile = $this->getIncludePathsFile($packageMap, $filesystem, $basePath, $vendorPath, $vendorPathCode, $appBaseDirCode);
139
-
140
- file_put_contents($vendorPath.'/autoload_52.php', $this->getAutoloadFile($vendorPathToTargetDirCode, $suffix));
141
- file_put_contents($targetDir.'/autoload_real_52.php', $this->getAutoloadRealFile(true, (bool) $includePathFile, $targetDirLoader, $filesCode, $vendorPathCode, $appBaseDirCode, $suffix, $useGlobalIncludePath, $prependAutoloader));
142
-
143
- // use stream_copy_to_stream instead of copy
144
- // to work around https://bugs.php.net/bug.php?id=64634
145
- $sourceLoader = fopen(__DIR__.'/ClassLoader.php', 'r');
146
- $targetLoader = fopen($targetDir.'/ClassLoader52.php', 'w+');
147
- stream_copy_to_stream($sourceLoader, $targetLoader);
148
- fclose($sourceLoader);
149
- fclose($targetLoader);
150
- unset($sourceLoader, $targetLoader);
151
- }
152
-
153
- protected function isPHP53($file) {
154
- $tokens = token_get_all(file_get_contents($file));
155
- $php53 = array(T_DIR, T_GOTO, T_NAMESPACE, T_NS_C, T_NS_SEPARATOR, T_USE);
156
-
157
- // PHP 5.4+
158
- if (defined('T_TRAIT')) {
159
- $php53[] = T_TRAIT;
160
- $php53[] = T_TRAIT_C;
161
- $php53[] = T_TRAIT_C;
162
- }
163
-
164
- // PHP 5.5+
165
- if (defined('T_FINALLY')) {
166
- $php53[] = T_FINALLY;
167
- $php53[] = T_YIELD;
168
- }
169
-
170
- foreach ($tokens as $token) {
171
- if (is_array($token) && in_array($token[0], $php53)) {
172
- return true;
173
- }
174
- }
175
-
176
- return false;
177
- }
178
-
179
- protected function getIncludePathsFile(array $packageMap, Filesystem $filesystem, $basePath, $vendorPath, $vendorPathCode, $appBaseDirCode) {
180
- $includePaths = array();
181
-
182
- foreach ($packageMap as $item) {
183
- list($package, $installPath) = $item;
184
-
185
- if (null !== $package->getTargetDir() && strlen($package->getTargetDir()) > 0) {
186
- $installPath = substr($installPath, 0, -strlen('/'.$package->getTargetDir()));
187
- }
188
-
189
- foreach ($package->getIncludePaths() as $includePath) {
190
- $includePath = trim($includePath, '/');
191
- $includePaths[] = empty($installPath) ? $includePath : $installPath.'/'.$includePath;
192
- }
193
- }
194
-
195
- if (!$includePaths) {
196
- return;
197
- }
198
-
199
- $includePathsFile = <<<EOF
200
- <?php
201
-
202
- // include_paths_52.php generated by xrstf/composer-php52
203
-
204
- \$vendorDir = $vendorPathCode;
205
- \$baseDir = $appBaseDirCode;
206
-
207
- return array(
208
-
209
- EOF;
210
-
211
- foreach ($includePaths as $path) {
212
- $includePathsFile .= "\t" . $this->getPathCode($filesystem, $basePath, $vendorPath, $path) . ",\n";
213
- }
214
-
215
- return $includePathsFile . ");\n";
216
- }
217
-
218
- protected function getAutoloadFile($vendorPathToTargetDirCode, $suffix) {
219
- return <<<AUTOLOAD
220
- <?php
221
-
222
- // autoload_52.php generated by xrstf/composer-php52
223
-
224
- require_once $vendorPathToTargetDirCode.'/autoload_real_52.php';
225
-
226
- return ComposerAutoloaderInit$suffix::getLoader();
227
-
228
- AUTOLOAD;
229
- }
230
-
231
- protected function getAutoloadRealFile($useClassMap, $useIncludePath, $targetDirLoader, $filesCode, $vendorPathCode, $appBaseDirCode, $suffix, $useGlobalIncludePath, $prependAutoloader, $staticPhpVersion = 70000) {
232
- // TODO the class ComposerAutoloaderInit should be revert to a closure
233
- // when APC has been fixed:
234
- // - https://github.com/composer/composer/issues/959
235
- // - https://bugs.php.net/bug.php?id=52144
236
- // - https://bugs.php.net/bug.php?id=61576
237
- // - https://bugs.php.net/bug.php?id=59298
238
-
239
- if ($filesCode) {
240
- $filesCode = "\n\n".rtrim($filesCode);
241
- }
242
-
243
- $file = <<<HEADER
244
- <?php
245
-
246
- // autoload_real_52.php generated by xrstf/composer-php52
247
-
248
- class ComposerAutoloaderInit$suffix {
249
- private static \$loader;
250
-
251
- public static function loadClassLoader(\$class) {
252
- if ('xrstf_Composer52_ClassLoader' === \$class) {
253
- require dirname(__FILE__).'/ClassLoader52.php';
254
- }
255
- }
256
-
257
- /**
258
- * @return xrstf_Composer52_ClassLoader
259
- */
260
- public static function getLoader() {
261
- if (null !== self::\$loader) {
262
- return self::\$loader;
263
- }
264
-
265
- spl_autoload_register(array('ComposerAutoloaderInit$suffix', 'loadClassLoader'), true /*, true */);
266
- self::\$loader = \$loader = new xrstf_Composer52_ClassLoader();
267
- spl_autoload_unregister(array('ComposerAutoloaderInit$suffix', 'loadClassLoader'));
268
-
269
- \$vendorDir = $vendorPathCode;
270
- \$baseDir = $appBaseDirCode;
271
- \$dir = dirname(__FILE__);
272
-
273
-
274
- HEADER;
275
-
276
- if ($useIncludePath) {
277
- $file .= <<<'INCLUDE_PATH'
278
- $includePaths = require $dir.'/include_paths.php';
279
- array_push($includePaths, get_include_path());
280
- set_include_path(implode(PATH_SEPARATOR, $includePaths));
281
-
282
-
283
- INCLUDE_PATH;
284
- }
285
-
286
- $file .= <<<'PSR0'
287
- $map = require $dir.'/autoload_namespaces.php';
288
- foreach ($map as $namespace => $path) {
289
- $loader->add($namespace, $path);
290
- }
291
-
292
-
293
- PSR0;
294
-
295
- if ($useClassMap) {
296
- $file .= <<<'CLASSMAP'
297
- $classMap = require $dir.'/autoload_classmap.php';
298
- if ($classMap) {
299
- $loader->addClassMap($classMap);
300
- }
301
-
302
-
303
- CLASSMAP;
304
- }
305
-
306
- if ($this->classMapAuthoritative) {
307
- $file .= <<<'CLASSMAPAUTHORITATIVE'
308
- $loader->setClassMapAuthoritative(true);
309
-
310
- CLASSMAPAUTHORITATIVE;
311
- }
312
-
313
- if ($useGlobalIncludePath) {
314
- $file .= <<<'INCLUDEPATH'
315
- $loader->setUseIncludePath(true);
316
-
317
-
318
- INCLUDEPATH;
319
- }
320
-
321
- if ($targetDirLoader) {
322
- $file .= <<<REGISTER_AUTOLOAD
323
- spl_autoload_register(array('ComposerAutoloaderInit$suffix', 'autoload'), true);
324
-
325
-
326
- REGISTER_AUTOLOAD;
327
-
328
- }
329
-
330
- $file .= <<<METHOD_FOOTER
331
- \$loader->register($prependAutoloader);{$filesCode}
332
-
333
- return \$loader;
334
- }
335
-
336
- METHOD_FOOTER;
337
-
338
- $file .= $targetDirLoader;
339
-
340
- return $file . <<<FOOTER
341
- }
342
-
343
- FOOTER;
344
-
345
- }
346
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/xrstf/composer-php52/lib/xrstf/Composer52/ClassLoader.php DELETED
@@ -1,271 +0,0 @@
1
- <?php
2
- /*
3
- * Copyright (c) 2013, Christoph Mewes, http://www.xrstf.de
4
- *
5
- * This file is released under the terms of the MIT license. You can find the
6
- * complete text in the attached LICENSE file or online at:
7
- *
8
- * http://www.opensource.org/licenses/mit-license.php
9
- *
10
- * --------------------------------------------------------------------------
11
- *
12
- * 99% of this is copied as-is from the original Composer source code and is
13
- * released under MIT license as well. Copyright goes to:
14
- *
15
- * - Fabien Potencier <fabien@symfony.com>
16
- * - Jordi Boggiano <j.boggiano@seld.be>
17
- */
18
-
19
- class xrstf_Composer52_ClassLoader {
20
- private $prefixes = array();
21
- private $fallbackDirs = array();
22
- private $useIncludePath = false;
23
- private $classMap = array();
24
- private $classMapAuthoratative = false;
25
- private $allowUnderscore = false;
26
-
27
- /**
28
- * @param boolean $flag true to allow class names with a leading underscore, false to disable
29
- */
30
- public function setAllowUnderscore($flag) {
31
- $this->allowUnderscore = (boolean) $flag;
32
- }
33
-
34
- /**
35
- * @return array
36
- */
37
- public function getPrefixes() {
38
- return $this->prefixes;
39
- }
40
-
41
- /**
42
- * Turns off searching the prefix and fallback directories for classes
43
- * that have not been registered with the class map.
44
- *
45
- * @param bool $classMapAuthoratative
46
- */
47
- public function setClassMapAuthoritative($classMapAuthoratative) {
48
- $this->classMapAuthoratative = $classMapAuthoratative;
49
- }
50
-
51
- /**
52
- * Should class lookup fail if not found in the current class map?
53
- *
54
- * @return bool
55
- */
56
- public function getClassMapAuthoratative() {
57
- return $this->classMapAuthoratative;
58
- }
59
-
60
- /**
61
- * @return array
62
- */
63
- public function getFallbackDirs() {
64
- return $this->fallbackDirs;
65
- }
66
-
67
- /**
68
- * @return array
69
- */
70
- public function getClassMap() {
71
- return $this->classMap;
72
- }
73
-
74
- /**
75
- * @param array $classMap class to filename map
76
- */
77
- public function addClassMap(array $classMap) {
78
- if ($this->classMap) {
79
- $this->classMap = array_merge($this->classMap, $classMap);
80
- }
81
- else {
82
- $this->classMap = $classMap;
83
- }
84
- }
85
-
86
- /**
87
- * Registers a set of classes, merging with any others previously set.
88
- *
89
- * @param string $prefix the classes prefix
90
- * @param array|string $paths the location(s) of the classes
91
- * @param bool $prepend prepend the location(s)
92
- */
93
- public function add($prefix, $paths, $prepend = false) {
94
- if (!$prefix) {
95
- if ($prepend) {
96
- $this->fallbackDirs = array_merge(
97
- (array) $paths,
98
- $this->fallbackDirs
99
- );
100
- }
101
- else {
102
- $this->fallbackDirs = array_merge(
103
- $this->fallbackDirs,
104
- (array) $paths
105
- );
106
- }
107
-
108
- return;
109
- }
110
-
111
- if (!isset($this->prefixes[$prefix])) {
112
- $this->prefixes[$prefix] = (array) $paths;
113
- return;
114
- }
115
-
116
- if ($prepend) {
117
- $this->prefixes[$prefix] = array_merge(
118
- (array) $paths,
119
- $this->prefixes[$prefix]
120
- );
121
- }
122
- else {
123
- $this->prefixes[$prefix] = array_merge(
124
- $this->prefixes[$prefix],
125
- (array) $paths
126
- );
127
- }
128
- }
129
-
130
- /**
131
- * Registers a set of classes, replacing any others previously set.
132
- *
133
- * @param string $prefix the classes prefix
134
- * @param array|string $paths the location(s) of the classes
135
- */
136
- public function set($prefix, $paths) {
137
- if (!$prefix) {
138
- $this->fallbackDirs = (array) $paths;
139
- return;
140
- }
141
-
142
- $this->prefixes[$prefix] = (array) $paths;
143
- }
144
-
145
- /**
146
- * Turns on searching the include path for class files.
147
- *
148
- * @param bool $useIncludePath
149
- */
150
- public function setUseIncludePath($useIncludePath) {
151
- $this->useIncludePath = $useIncludePath;
152
- }
153
-
154
- /**
155
- * Can be used to check if the autoloader uses the include path to check
156
- * for classes.
157
- *
158
- * @return bool
159
- */
160
- public function getUseIncludePath() {
161
- return $this->useIncludePath;
162
- }
163
-
164
- /**
165
- * Registers this instance as an autoloader.
166
- */
167
- public function register() {
168
- spl_autoload_register(array($this, 'loadClass'), true);
169
- }
170
-
171
- /**
172
- * Unregisters this instance as an autoloader.
173
- */
174
- public function unregister() {
175
- spl_autoload_unregister(array($this, 'loadClass'));
176
- }
177
-
178
- /**
179
- * Loads the given class or interface.
180
- *
181
- * @param string $class the name of the class
182
- * @return bool|null true, if loaded
183
- */
184
- public function loadClass($class) {
185
- if ($file = $this->findFile($class)) {
186
- include $file;
187
- return true;
188
- }
189
- }
190
-
191
- /**
192
- * Finds the path to the file where the class is defined.
193
- *
194
- * @param string $class the name of the class
195
- * @return string|null the path, if found
196
- */
197
- public function findFile($class) {
198
- if ('\\' === $class[0]) {
199
- $class = substr($class, 1);
200
- }
201
-
202
- if (isset($this->classMap[$class])) {
203
- return $this->classMap[$class];
204
- }
205
- elseif ($this->classMapAuthoratative) {
206
- return false;
207
- }
208
-
209
- $classPath = $this->getClassPath($class);
210
-
211
- foreach ($this->prefixes as $prefix => $dirs) {
212
- if (0 === strpos($class, $prefix)) {
213
- foreach ($dirs as $dir) {
214
- if (file_exists($dir.DIRECTORY_SEPARATOR.$classPath)) {
215
- return $dir.DIRECTORY_SEPARATOR.$classPath;
216
- }
217
- }
218
- }
219
- }
220
-
221
- foreach ($this->fallbackDirs as $dir) {
222
- if (file_exists($dir.DIRECTORY_SEPARATOR.$classPath)) {
223
- return $dir.DIRECTORY_SEPARATOR.$classPath;
224
- }
225
- }
226
-
227
- if ($this->useIncludePath && $file = self::resolveIncludePath($classPath)) {
228
- return $file;
229
- }
230
-
231
- return $this->classMap[$class] = false;
232
- }
233
-
234
- private function getClassPath($class) {
235
- if (false !== $pos = strrpos($class, '\\')) {
236
- // namespaced class name
237
- $classPath = str_replace('\\', DIRECTORY_SEPARATOR, substr($class, 0, $pos)).DIRECTORY_SEPARATOR;
238
- $className = substr($class, $pos + 1);
239
- }
240
- else {
241
- // PEAR-like class name
242
- $classPath = null;
243
- $className = $class;
244
- }
245
-
246
- $className = str_replace('_', DIRECTORY_SEPARATOR, $className);
247
-
248
- // restore the prefix
249
- if ($this->allowUnderscore && DIRECTORY_SEPARATOR === $className[0]) {
250
- $className[0] = '_';
251
- }
252
-
253
- $classPath .= $className.'.php';
254
-
255
- return $classPath;
256
- }
257
-
258
- public static function resolveIncludePath($classPath) {
259
- $paths = explode(PATH_SEPARATOR, get_include_path());
260
-
261
- foreach ($paths as $path) {
262
- $path = rtrim($path, '/\\');
263
-
264
- if ($file = file_exists($path.DIRECTORY_SEPARATOR.$file)) {
265
- return $file;
266
- }
267
- }
268
-
269
- return false;
270
- }
271
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/xrstf/composer-php52/lib/xrstf/Composer52/Generator.php DELETED
@@ -1,39 +0,0 @@
1
- <?php
2
- /*
3
- * Copyright (c) 2013, Christoph Mewes, http://www.xrstf.de
4
- *
5
- * This file is released under the terms of the MIT license. You can find the
6
- * complete text in the attached LICENSE file or online at:
7
- *
8
- * http://www.opensource.org/licenses/mit-license.php
9
- */
10
-
11
- namespace xrstf\Composer52;
12
-
13
- use Composer\Repository\CompositeRepository;
14
- use Composer\Script\Event;
15
-
16
- class Generator {
17
- public static function onPostInstallCmd(Event $event) {
18
- $composer = $event->getComposer();
19
- $installationManager = $composer->getInstallationManager();
20
- $repoManager = $composer->getRepositoryManager();
21
- $localRepo = $repoManager->getLocalRepository();
22
- $package = $composer->getPackage();
23
- $config = $composer->getConfig();
24
-
25
- // We can't gain access to the Command's input object, so we have to look
26
- // for -o / --optimize-autoloader ourselves. Sadly, neither getopt() works
27
- // (always returns an empty array), nor does Symfony's Console Input, as
28
- // it expects a full definition of the current command line and we can't
29
- // provide that.
30
-
31
- $args = $_SERVER['argv'];
32
- $optimize = in_array('-o', $args) || in_array('--optimize-autoloader', $args) || in_array('--optimize', $args);
33
-
34
- $suffix = $config->get('autoloader-suffix');
35
-
36
- $generator = new AutoloadGenerator();
37
- $generator->dump($config, $localRepo, $package, $installationManager, 'composer', $optimize, $suffix);
38
- }
39
- }