WordPress Charts and Graphs Lite - Version 3.7.3

Version Description

Download this release

Release Info

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

Code changes from version 3.7.2 to 3.7.3

CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
 
 
 
 
 
 
 
1
  ##### [Version 3.7.2](https://github.com/Codeinwp/visualizer/compare/v3.7.1...v3.7.2) (2021-12-20)
2
 
3
  - Add latest chartJS library support in the bar chart
1
+ ##### [Version 3.7.3](https://github.com/Codeinwp/visualizer/compare/v3.7.2...v3.7.3) (2022-01-19)
2
+
3
+ - Fix multiple charts lazy rendering issue
4
+ - Upgrade jQuery UI core library CDN
5
+ - Fix console error when rendering multiple charts
6
+ - Keep only Line / Pie / bar / Table charts in free version
7
+
8
  ##### [Version 3.7.2](https://github.com/Codeinwp/visualizer/compare/v3.7.1...v3.7.2) (2021-12-20)
9
 
10
  - Add latest chartJS library support in the bar chart
classes/Visualizer/Gutenberg/Block.php CHANGED
@@ -111,6 +111,7 @@ class Visualizer_Gutenberg_Block {
111
  'adminPage' => menu_page_url( 'visualizer', false ),
112
  'sqlTable' => $table_col_mapping,
113
  'chartsPerPage' => defined( 'TI_CYPRESS_TESTING' ) ? 20 : 6,
 
114
  );
115
  wp_localize_script( 'visualizer-gutenberg-block', 'visualizerLocalize', $translation_array );
116
 
111
  'adminPage' => menu_page_url( 'visualizer', false ),
112
  'sqlTable' => $table_col_mapping,
113
  'chartsPerPage' => defined( 'TI_CYPRESS_TESTING' ) ? 20 : 6,
114
+ 'proFeaturesLocked' => Visualizer_Module_Admin::proFeaturesLocked(),
115
  );
116
  wp_localize_script( 'visualizer-gutenberg-block', 'visualizerLocalize', $translation_array );
117
 
classes/Visualizer/Gutenberg/build/block.js CHANGED
@@ -333,9 +333,9 @@ object-assign
333
  *
334
  * Copyright © 2014 David Bushell | BSD & MIT license | https://github.com/dbushell/Pikaday
335
  */
336
- !function(t,a){"use strict";var r;try{r=n(0)}catch(e){}e.exports=function(e){var t="function"==typeof e,n=!!window.addEventListener,a=window.document,r=window.setTimeout,s=function(e,t,a,r){n?e.addEventListener(t,a,!!r):e.attachEvent("on"+t,a)},i=function(e,t,a,r){n?e.removeEventListener(t,a,!!r):e.detachEvent("on"+t,a)},o=function(e,t,n){var r;a.createEvent?((r=a.createEvent("HTMLEvents")).initEvent(t,!0,!1),r=f(r,n),e.dispatchEvent(r)):a.createEventObject&&(r=a.createEventObject(),r=f(r,n),e.fireEvent("on"+t,r))},l=function(e,t){return-1!==(" "+e.className+" ").indexOf(" "+t+" ")},u=function(e){return/Array/.test(Object.prototype.toString.call(e))},d=function(e){return/Date/.test(Object.prototype.toString.call(e))&&!isNaN(e.getTime())},c=function(e){var t=e.getDay();return 0===t||6===t},m=function(e){return e%4==0&&e%100!=0||e%400==0},_=function(e,t){return[31,m(e)?29:28,31,30,31,30,31,31,30,31,30,31][t]},h=function(e){d(e)&&e.setHours(0,0,0,0)},p=function(e,t){return e.getTime()===t.getTime()},f=function(e,t,n){var a,r;for(a in t)(r=void 0!==e[a])&&"object"==typeof t[a]&&null!==t[a]&&void 0===t[a].nodeName?d(t[a])?n&&(e[a]=new Date(t[a].getTime())):u(t[a])?n&&(e[a]=t[a].slice(0)):e[a]=f({},t[a],n):!n&&r||(e[a]=t[a]);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},M={field:null,bound:void 0,position:"bottom left",reposition:!0,format:"YYYY-MM-DD",defaultDate:null,setDefaultDate:!1,firstDay:0,formatStrict:!1,minDate:null,maxDate:null,yearRange:10,showWeekNumber:!1,minYear:0,maxYear:9999,minMonth:void 0,maxMonth:void 0,startRange:null,endRange:null,isRTL:!1,yearSuffix:"",showMonthAfterYear:!1,showDaysInNextAndPreviousMonths:!1,numberOfMonths:1,mainCalendar:"left",container:void 0,i18n:{previousMonth:"Previous Month",nextMonth:"Next Month",months:["January","February","March","April","May","June","July","August","September","October","November","December"],weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},theme:null,onSelect:null,onOpen:null,onClose:null,onDraw:null},g=function(e,t,n){for(t+=e.firstDay;t>=7;)t-=7;return n?e.i18n.weekdaysShort[t]:e.i18n.weekdays[t]},L=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>"},b=function(e,t){return"<tr>"+(t?e.reverse():e).join("")+"</tr>"},v=function(e,t,n,a,r,s){var i,o,l,d,c,m=e._o,_=n===m.minYear,h=n===m.maxYear,p='<div id="'+s+'" class="pika-title" role="heading" aria-live="assertive">',f=!0,y=!0;for(l=[],i=0;i<12;i++)l.push('<option value="'+(n===r?i-t:12+i-t)+'"'+(i===a?' selected="selected"':"")+(_&&i<m.minMonth||h&&i>m.maxMonth?'disabled="disabled"':"")+">"+m.i18n.months[i]+"</option>");for(d='<div class="pika-label">'+m.i18n.months[a]+'<select class="pika-select pika-select-month" tabindex="-1">'+l.join("")+"</select></div>",u(m.yearRange)?(i=m.yearRange[0],o=m.yearRange[1]+1):(i=n-m.yearRange,o=1+n+m.yearRange),l=[];i<o&&i<=m.maxYear;i++)i>=m.minYear&&l.push('<option value="'+i+'"'+(i===n?' selected="selected"':"")+">"+i+"</option>");return c='<div class="pika-label">'+n+m.yearSuffix+'<select class="pika-select pika-select-year" tabindex="-1">'+l.join("")+"</select></div>",m.showMonthAfterYear?p+=c+d:p+=d+c,_&&(0===a||m.minMonth>=a)&&(f=!1),h&&(11===a||m.maxMonth<=a)&&(y=!1),0===t&&(p+='<button class="pika-prev'+(f?"":" is-disabled")+'" type="button">'+m.i18n.previousMonth+"</button>"),t===e._o.numberOfMonths-1&&(p+='<button class="pika-next'+(y?"":" is-disabled")+'" type="button">'+m.i18n.nextMonth+"</button>"),p+"</div>"},Y=function(i){var o=this,u=o.config(i);o._onMouseDown=function(e){if(o._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")?o.prevMonth():l(t,"pika-next")&&o.nextMonth():(o.setDate(new Date(t.getAttribute("data-pika-year"),t.getAttribute("data-pika-month"),t.getAttribute("data-pika-day"))),u.bound&&r((function(){o.hide(),u.field&&u.field.blur()}),100))),l(t,"pika-select"))o._c=!0;else{if(!e.preventDefault)return e.returnValue=!1,!1;e.preventDefault()}}},o._onChange=function(e){var t=(e=e||window.event).target||e.srcElement;t&&(l(t,"pika-select-month")?o.gotoMonth(t.value):l(t,"pika-select-year")&&o.gotoYear(t.value))},o._onKeyChange=function(e){if(e=e||window.event,o.isVisible())switch(e.keyCode){case 13:case 27:u.field.blur();break;case 37:e.preventDefault(),o.adjustDate("subtract",1);break;case 38:o.adjustDate("subtract",7);break;case 39:o.adjustDate("add",1);break;case 40:o.adjustDate("add",7)}},o._onInputChange=function(n){var a;n.firedBy!==o&&(a=t?(a=e(u.field.value,u.format,u.formatStrict))&&a.isValid()?a.toDate():null:new Date(Date.parse(u.field.value)),d(a)&&o.setDate(a),o._v||o.show())},o._onInputFocus=function(){o.show()},o._onInputClick=function(){o.show()},o._onInputBlur=function(){var e=a.activeElement;do{if(l(e,"pika-single"))return}while(e=e.parentNode);o._c||(o._b=r((function(){o.hide()}),50)),o._c=!1},o._onClick=function(e){var t=(e=e||window.event).target||e.srcElement,a=t;if(t){!n&&l(t,"pika-select")&&(t.onchange||(t.setAttribute("onchange","return;"),s(t,"change",o._onChange)));do{if(l(a,"pika-single")||a===u.trigger)return}while(a=a.parentNode);o._v&&t!==u.trigger&&a!==u.trigger&&o.hide()}},o.el=a.createElement("div"),o.el.className="pika-single"+(u.isRTL?" is-rtl":"")+(u.theme?" "+u.theme:""),s(o.el,"mousedown",o._onMouseDown,!0),s(o.el,"touchend",o._onMouseDown,!0),s(o.el,"change",o._onChange),s(a,"keydown",o._onKeyChange),u.field&&(u.container?u.container.appendChild(o.el):u.bound?a.body.appendChild(o.el):u.field.parentNode.insertBefore(o.el,u.field.nextSibling),s(u.field,"change",o._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 c=u.defaultDate;d(c)?u.setDefaultDate?o.setDate(c,!0):o.gotoDate(c):o.gotoDate(new Date),u.bound?(this.hide(),o.el.className+=" is-bound",s(u.trigger,"click",o._onInputClick),s(u.trigger,"focus",o._onInputFocus),s(u.trigger,"blur",o._onInputBlur)):this.show()};return Y.prototype={config:function(e){this._o||(this._o=f({},M,!0));var t=f(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,d(t.minDate)||(t.minDate=!1),d(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 a=(new Date).getFullYear()-10;t.yearRange[0]=parseInt(t.yearRange[0],10)||a,t.yearRange[1]=parseInt(t.yearRange[1],10)||a}else t.yearRange=Math.abs(parseInt(t.yearRange,10))||M.yearRange,t.yearRange>100&&(t.yearRange=100);return t},toString:function(n){return d(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,a){t&&e.isMoment(n)&&this.setDate(n.toDate(),a)},getDate:function(){return d(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="",o(this._o.field,"change",{firedBy:this})),this.draw();if("string"==typeof e&&(e=new Date(Date.parse(e))),d(e)){var n=this._o.minDate,a=this._o.maxDate;d(n)&&e<n?e=n:d(a)&&e>a&&(e=a),this._d=new Date(e.getTime()),h(this._d),this.gotoDate(this._d),this._o.field&&(this._o.field.value=this.toString(),o(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(d(e)){if(this.calendars){var n=new Date(this.calendars[0].year,this.calendars[0].month,1),a=new Date(this.calendars[this.calendars.length-1].year,this.calendars[this.calendars.length-1].month,1),r=e.getTime();a.setMonth(a.getMonth()+1),a.setDate(a.getDate()-1),t=r<n.getTime()||a.getTime()<r}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,a){var r,s=this.getDate(),i=24*parseInt(a)*60*60*1e3;"add"===n?r=new Date(s.valueOf()+i):"subtract"===n&&(r=new Date(s.valueOf()-i)),t&&("add"===n?r=e(s).add(a,"days").toDate():"subtract"===n&&(r=e(s).subtract(a,"days").toDate())),this.setDate(r)},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=M.minDate,this._o.minYear=M.minYear,this._o.minMonth=M.minMonth,this._o.startRange=M.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=M.maxDate,this._o.maxYear=M.maxYear,this._o.maxMonth=M.maxMonth,this._o.endRange=M.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,a=n.minYear,s=n.maxYear,i=n.minMonth,o=n.maxMonth,l="";this._y<=a&&(this._y=a,!isNaN(i)&&this._m<i&&(this._m=i)),this._y>=s&&(this._y=s,!isNaN(o)&&this._m>o&&(this._m=o)),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">'+v(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&&r((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,r,s,i,o,l,u,d;if(!this._o.container){if(this.el.style.position="absolute",t=e=this._o.trigger,n=this.el.offsetWidth,r=this.el.offsetHeight,s=window.innerWidth||a.documentElement.clientWidth,i=window.innerHeight||a.documentElement.clientHeight,o=window.pageYOffset||a.body.scrollTop||a.documentElement.scrollTop,"function"==typeof e.getBoundingClientRect)l=(d=e.getBoundingClientRect()).left+window.pageXOffset,u=d.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>s||this._o.position.indexOf("right")>-1&&l-n+e.offsetWidth>0)&&(l=l-n+e.offsetWidth),(this._o.reposition&&u+r>i+o||this._o.position.indexOf("top")>-1&&u-r-e.offsetHeight>0)&&(u=u-r-e.offsetHeight),this.el.style.left=l+"px",this.el.style.top=u+"px"}},render:function(e,t,n){var a=this._o,r=new Date,s=_(e,t),i=new Date(e,t,1).getDay(),o=[],l=[];h(r),a.firstDay>0&&(i-=a.firstDay)<0&&(i+=7);for(var u,m,f,y,M=0===t?11:t-1,v=11===t?0:t+1,Y=0===t?e-1:e,w=11===t?e+1:e,k=_(Y,M),D=s+i,T=D;T>7;)T-=7;D+=7-T;for(var S=0,j=0;S<D;S++){var O=new Date(e,t,S-i+1),x=!!d(this._d)&&p(O,this._d),H=p(O,r),E=S<i||S>=s+i,P=S-i+1,C=t,z=e,A=a.startRange&&p(a.startRange,O),W=a.endRange&&p(a.endRange,O),R=a.startRange&&a.endRange&&a.startRange<O&&O<a.endRange;E&&(S<i?(P=k+P,C=M,z=Y):(P-=s,C=v,z=w));var F={day:P,month:C,year:z,isSelected:x,isToday:H,isDisabled:a.minDate&&O<a.minDate||a.maxDate&&O>a.maxDate||a.disableWeekends&&c(O)||a.disableDayFn&&a.disableDayFn(O),isEmpty:E,isStartRange:A,isEndRange:W,isInRange:R,showDaysInNextAndPreviousMonths:a.showDaysInNextAndPreviousMonths};l.push(L(F)),7==++j&&(a.showWeekNumber&&l.unshift((u=S-i,m=t,f=e,y=void 0,void 0,y=new Date(f,0,1),'<td class="pika-week">'+Math.ceil(((new Date(f,m,u)-y)/864e5+y.getDay()+1)/7)+"</td>")),o.push(b(l,a.isRTL)),l=[],j=0)}return function(e,t,n){return'<table cellpadding="0" cellspacing="0" class="pika-table" role="grid" aria-labelledby="'+n+'">'+function(e){var t,n=[];e.showWeekNumber&&n.push("<th></th>");for(t=0;t<7;t++)n.push('<th scope="col"><abbr title="'+g(e,t)+'">'+g(e,t,!0)+"</abbr></th>");return"<thead><tr>"+(e.isRTL?n.reverse():n).join("")+"</tr></thead>"}(e)+(a=t,"<tbody>"+a.join("")+"</tbody></table>");var a}(a,o,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&&(s(a,"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&&i(a,"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(),i(this.el,"mousedown",this._onMouseDown,!0),i(this.el,"touchend",this._onMouseDown,!0),i(this.el,"change",this._onChange),this._o.field&&(i(this._o.field,"change",this._onInputChange),this._o.bound&&(i(this._o.trigger,"click",this._onInputClick),i(this._o.trigger,"focus",this._onInputFocus),i(this._o.trigger,"blur",this._onInputBlur))),this.el.parentNode&&this.el.parentNode.removeChild(this.el)}},Y}(r)}()},function(e,t,n){var a={"./af":130,"./af.js":130,"./ar":131,"./ar-dz":132,"./ar-dz.js":132,"./ar-kw":133,"./ar-kw.js":133,"./ar-ly":134,"./ar-ly.js":134,"./ar-ma":135,"./ar-ma.js":135,"./ar-sa":136,"./ar-sa.js":136,"./ar-tn":137,"./ar-tn.js":137,"./ar.js":131,"./az":138,"./az.js":138,"./be":139,"./be.js":139,"./bg":140,"./bg.js":140,"./bm":141,"./bm.js":141,"./bn":142,"./bn-bd":143,"./bn-bd.js":143,"./bn.js":142,"./bo":144,"./bo.js":144,"./br":145,"./br.js":145,"./bs":146,"./bs.js":146,"./ca":147,"./ca.js":147,"./cs":148,"./cs.js":148,"./cv":149,"./cv.js":149,"./cy":150,"./cy.js":150,"./da":151,"./da.js":151,"./de":152,"./de-at":153,"./de-at.js":153,"./de-ch":154,"./de-ch.js":154,"./de.js":152,"./dv":155,"./dv.js":155,"./el":156,"./el.js":156,"./en-au":157,"./en-au.js":157,"./en-ca":158,"./en-ca.js":158,"./en-gb":159,"./en-gb.js":159,"./en-ie":160,"./en-ie.js":160,"./en-il":161,"./en-il.js":161,"./en-in":162,"./en-in.js":162,"./en-nz":163,"./en-nz.js":163,"./en-sg":164,"./en-sg.js":164,"./eo":165,"./eo.js":165,"./es":166,"./es-do":167,"./es-do.js":167,"./es-mx":168,"./es-mx.js":168,"./es-us":169,"./es-us.js":169,"./es.js":166,"./et":170,"./et.js":170,"./eu":171,"./eu.js":171,"./fa":172,"./fa.js":172,"./fi":173,"./fi.js":173,"./fil":174,"./fil.js":174,"./fo":175,"./fo.js":175,"./fr":176,"./fr-ca":177,"./fr-ca.js":177,"./fr-ch":178,"./fr-ch.js":178,"./fr.js":176,"./fy":179,"./fy.js":179,"./ga":180,"./ga.js":180,"./gd":181,"./gd.js":181,"./gl":182,"./gl.js":182,"./gom-deva":183,"./gom-deva.js":183,"./gom-latn":184,"./gom-latn.js":184,"./gu":185,"./gu.js":185,"./he":186,"./he.js":186,"./hi":187,"./hi.js":187,"./hr":188,"./hr.js":188,"./hu":189,"./hu.js":189,"./hy-am":190,"./hy-am.js":190,"./id":191,"./id.js":191,"./is":192,"./is.js":192,"./it":193,"./it-ch":194,"./it-ch.js":194,"./it.js":193,"./ja":195,"./ja.js":195,"./jv":196,"./jv.js":196,"./ka":197,"./ka.js":197,"./kk":198,"./kk.js":198,"./km":199,"./km.js":199,"./kn":200,"./kn.js":200,"./ko":201,"./ko.js":201,"./ku":202,"./ku.js":202,"./ky":203,"./ky.js":203,"./lb":204,"./lb.js":204,"./lo":205,"./lo.js":205,"./lt":206,"./lt.js":206,"./lv":207,"./lv.js":207,"./me":208,"./me.js":208,"./mi":209,"./mi.js":209,"./mk":210,"./mk.js":210,"./ml":211,"./ml.js":211,"./mn":212,"./mn.js":212,"./mr":213,"./mr.js":213,"./ms":214,"./ms-my":215,"./ms-my.js":215,"./ms.js":214,"./mt":216,"./mt.js":216,"./my":217,"./my.js":217,"./nb":218,"./nb.js":218,"./ne":219,"./ne.js":219,"./nl":220,"./nl-be":221,"./nl-be.js":221,"./nl.js":220,"./nn":222,"./nn.js":222,"./oc-lnc":223,"./oc-lnc.js":223,"./pa-in":224,"./pa-in.js":224,"./pl":225,"./pl.js":225,"./pt":226,"./pt-br":227,"./pt-br.js":227,"./pt.js":226,"./ro":228,"./ro.js":228,"./ru":229,"./ru.js":229,"./sd":230,"./sd.js":230,"./se":231,"./se.js":231,"./si":232,"./si.js":232,"./sk":233,"./sk.js":233,"./sl":234,"./sl.js":234,"./sq":235,"./sq.js":235,"./sr":236,"./sr-cyrl":237,"./sr-cyrl.js":237,"./sr.js":236,"./ss":238,"./ss.js":238,"./sv":239,"./sv.js":239,"./sw":240,"./sw.js":240,"./ta":241,"./ta.js":241,"./te":242,"./te.js":242,"./tet":243,"./tet.js":243,"./tg":244,"./tg.js":244,"./th":245,"./th.js":245,"./tk":246,"./tk.js":246,"./tl-ph":247,"./tl-ph.js":247,"./tlh":248,"./tlh.js":248,"./tr":249,"./tr.js":249,"./tzl":250,"./tzl.js":250,"./tzm":251,"./tzm-latn":252,"./tzm-latn.js":252,"./tzm.js":251,"./ug-cn":253,"./ug-cn.js":253,"./uk":254,"./uk.js":254,"./ur":255,"./ur.js":255,"./uz":256,"./uz-latn":257,"./uz-latn.js":257,"./uz.js":256,"./vi":258,"./vi.js":258,"./x-pseudo":259,"./x-pseudo.js":259,"./yo":260,"./yo.js":260,"./zh-cn":261,"./zh-cn.js":261,"./zh-hk":262,"./zh-hk.js":262,"./zh-mo":263,"./zh-mo.js":263,"./zh-tw":264,"./zh-tw.js":264};function r(e){var t=s(e);return n(t)}function s(e){if(!n.o(a,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return a[e]}r.keys=function(){return Object.keys(a)},r.resolve=s,e.exports=r,r.id=288},,function(e,t,n){},function(e,t,n){"use strict";n.r(t);var a=n(2),r=n.n(a),s=n(265),i=n.n(s),o=function(e,t){return(o=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}o(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,a=arguments.length;n<a;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};function d(e,t,n,a){return new(n||(n=Promise))((function(r,s){function i(e){try{l(a.next(e))}catch(e){s(e)}}function o(e){try{l(a.throw(e))}catch(e){s(e)}}function l(e){e.done?r(e.value):new n((function(t){t(e.value)})).then(i,o)}l((a=a.apply(e,t||[])).next())}))}function c(e,t){var n,a,r,s,i={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,a&&(r=2&s[0]?a.return:s[0]?a.throw||((r=a.return)&&r.call(a),0):a.next)&&!(r=r.call(a,s[1])).done)return r;switch(a=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,a=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(r=i.trys,(r=r.length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){i.label=s[1];break}if(6===s[0]&&i.label<r[1]){i.label=r[1],r=s;break}if(r&&i.label<r[2]){i.label=r[2],i.ops.push(s);break}r[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(e){s=[6,e],a=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}}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},_=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.handleGoogleChartsLoaderScriptLoaded=function(e){var n=t.props,a=n.chartVersion,r=n.chartPackages,s=n.chartLanguage,i=n.mapsApiKey,o=n.onLoad;e.charts.load(a||"current",{packages:r||["corechart","controls"],language:s||"en",mapsApiKey:i}),e.charts.setOnLoadCallback((function(){o(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(a.createElement)(i.a,{url:"https://www.gstatic.com/charts/loader.js",onError:t,onLoad:function(){var t=window;t.google&&e.handleGoogleChartsLoaderScriptLoaded(t.google)}})},t}(a.Component),h=0,p=function(){return"reactgooglegraph-"+(h+=1)},f=["#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={}),d(void 0,void 0,void 0,(function(){return c(this,(function(a){return[2,new Promise((function(a,r){var s=n.headers?"headers="+n.headers:"headers=0",i=n.query?"&tq="+encodeURIComponent(n.query):"",o=n.gid?"&gid="+n.gid:"",l=n.sheet?"&sheet="+n.sheet:"",u=n.access_token?"&access_token="+n.access_token:"",d=t+"/gviz/tq?"+(""+s+o+l+i+u);new e.visualization.Query(d).send((function(e){e.isError()?r("Error in query: "+e.getMessage()+" "+e.getDetailedMessage()):a(e.getDataTable())}))}))]}))}))},M=Object(a.createContext)(m),g=M.Provider,L=M.Consumer,b=function(e){var t=e.children,n=e.value;return Object(a.createElement)(g,{value:n},t)},v=function(e){var t=e.render;return Object(a.createElement)(L,null,(function(e){return t(e)}))},Y=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,a=e.googleChartWrapper;n.visualization.events.addListener(a,"select",(function(){var e=a.getChart().getSelection(),n=a.getDataTable();if(0!==e.length&&null===e[0].row&&null!==n){var r=e[0].column,s=t.getColumnID(n,r);t.state.hiddenColumns.includes(s)?t.setState((function(e){return u({},e,{hiddenColumns:e.hiddenColumns.filter((function(e){return e!==s})).slice()})})):t.setState((function(e){return u({},e,{hiddenColumns:e.hiddenColumns.concat([s])})}))}}))},t.applyFormatters=function(e,n){for(var a=t.props.google,r=0,s=n;r<s.length;r++){var i=s[r];switch(i.type){case"ArrowFormat":(o=new a.visualization.ArrowFormat(i.options)).format(e,i.column);break;case"BarFormat":(o=new a.visualization.BarFormat(i.options)).format(e,i.column);break;case"ColorFormat":for(var o=new a.visualization.ColorFormat(i.options),l=0,u=i.ranges;l<u.length;l++){var d=u[l];o.addRange.apply(o,d)}o.format(e,i.column);break;case"DateFormat":(o=new a.visualization.DateFormat(i.options)).format(e,i.column);break;case"NumberFormat":(o=new a.visualization.NumberFormat(i.options)).format(e,i.column);break;case"PatternFormat":(o=new a.visualization.PatternFormat(i.options)).format(e,i.column)}}},t.getColumnID=function(e,t){return e.getColumnId(t)||e.getColumnLabel(t)},t.draw=function(e){var n=e.data,a=e.diffdata,r=e.rows,s=e.columns,i=e.options,o=e.legend_toggle,l=e.legendToggle,u=e.chartType,m=e.formatters,_=e.spreadSheetUrl,h=e.spreadSheetQueryParameters;return d(t,void 0,void 0,(function(){var e,t,d,p,f,M,g,L,b,v,Y,w,k,D;return c(this,(function(c){switch(c.label){case 0:return e=this.props,t=e.google,d=e.googleChartWrapper,f=null,null!==a&&(M=t.visualization.arrayToDataTable(a.old),g=t.visualization.arrayToDataTable(a.new),f=t.visualization[u].prototype.computeDiff(M,g)),null===n?[3,1]:(p=Array.isArray(n)?t.visualization.arrayToDataTable(n):new t.visualization.DataTable(n),[3,5]);case 1:return null===r||null===s?[3,2]:(p=t.visualization.arrayToDataTable([s].concat(r)),[3,5]);case 2:return null===_?[3,4]:[4,y(t,_,h)];case 3:return p=c.sent(),[3,5];case 4:p=t.visualization.arrayToDataTable([]),c.label=5;case 5:for(L=p.getNumberOfColumns(),b=0;b<L;b+=1)v=this.getColumnID(p,b),this.state.hiddenColumns.includes(v)&&(Y=p.getColumnLabel(b),w=p.getColumnId(b),k=p.getColumnType(b),p.removeColumn(b),p.addColumn({label:Y,id:w,type:k}));return D=d.getChart(),"Timeline"===d.getChartType()&&D&&D.clearChart(),d.setChartType(u),d.setOptions(i),d.setDataTable(p),d.draw(),null!==this.props.googleChartDashboard&&this.props.googleChartDashboard.draw(p),null!==f&&(d.setDataTable(f),d.draw()),null!==m&&(this.applyFormatters(p,m),d.setDataTable(p),d.draw()),!0!==l&&!0!==o||this.grayOutHiddenColumns({options:i}),[2]}}))}))},t.grayOutHiddenColumns=function(e){var n=e.options,a=t.props.googleChartWrapper,r=a.getDataTable();if(null!==r){var s=r.getNumberOfColumns();if(!1!==t.state.hiddenColumns.length>0){var i=Array.from({length:s-1}).map((function(e,a){var s=t.getColumnID(r,a+1);return t.state.hiddenColumns.includes(s)?"#CCCCCC":void 0!==n.colors&&null!==n.colors?n.colors[a]:f[a]}));a.setOptions(u({},n,{colors:i})),a.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}(a.Component),w=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,r=e.googleChartDashboard;return Object(a.createElement)(v,{render:function(e){return Object(a.createElement)(Y,u({},e,{google:t,googleChartWrapper:n,googleChartDashboard:r}))}})},t}(a.Component),k=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,a=e.google,r=e.googleChartWrapper;if(null!==n){a.visualization.events.removeAllListeners(r);for(var s=function(e){var n=e.eventName,s=e.callback;a.visualization.events.addListener(r,n,(function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];s({chartWrapper:r,props:t.props,google:a,eventArgs:e})}))},i=0,o=n;i<o.length;i++){s(o[i])}}},t.prototype.render=function(){var e=this,t=this.props,n=t.google,r=t.googleChartWrapper;return Object(a.createElement)(v,{render:function(t){return e.listenToEvents({chartEvents:t.chartEvents||null,google:n,googleChartWrapper:r}),null}})},t}(a.Component),D=0,T=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={googleChartWrapper:null,googleChartDashboard:null,googleChartControls:null,googleChartEditor:null,isReady:!1},t.graphID=null,t.dashboard_ref=Object(a.createRef)(),t.toolbar_ref=Object(a.createRef)(),t.getGraphID=function(){var e,n=t.props,a=n.graphID,r=n.graph_id;return e=null===a&&null===r?null===t.graphID?p():t.graphID:null!==a&&null===r?a:null!==r&&null===a?r:a,t.graphID=e,t.graphID},t.getControlID=function(e,t){return D+=1,void 0===e?"googlechart-control-"+t+"-"+D:e},t.addControls=function(e,n){var a=t.props,r=a.google,s=a.controls,i=null===s?null:s.map((function(e,n){var a=e.controlID,s=e.controlType,i=e.options,o=e.controlWrapperParams,l=t.getControlID(a,n);return{controlProp:e,control:new r.visualization.ControlWrapper(u({containerId:l,controlType:s,options:i},o))}}));if(null===i)return null;n.bind(i.map((function(e){return e.control})),e);for(var o=function(n){for(var a=n.control,s=n.controlProp.controlEvents,i=function(n){var s=n.callback,i=n.eventName;r.visualization.events.removeListener(a,i,s),r.visualization.events.addListener(a,i,(function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];s({chartWrapper:e,controlWrapper:a,props:t.props,google:r,eventArgs:n})}))},o=0,l=void 0===s?[]:s;o<l.length;o++){i(l[o])}},l=0,d=i;l<d.length;l++){o(d[l])}return i},t.renderChart=function(){var e=t.props,n=e.width,r=e.height,s=e.options,i=e.style,o=e.className,l=e.rootProps,d=e.google,c=u({height:r||s&&s.height,width:n||s&&s.width},i);return Object(a.createElement)("div",u({id:t.getGraphID(),style:c,className:o},l),t.state.isReady&&null!==t.state.googleChartWrapper?Object(a.createElement)(a.Fragment,null,Object(a.createElement)(w,{googleChartWrapper:t.state.googleChartWrapper,google:d,googleChartDashboard:t.state.googleChartDashboard}),Object(a.createElement)(k,{googleChartWrapper:t.state.googleChartWrapper,google:d})):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(a.createElement)(a.Fragment,null,t.state.googleChartControls.filter((function(t){var n=t.controlProp,a=t.control;return e({control:a,controlProp:n})})).map((function(e){var t=e.control;e.controlProp;return Object(a.createElement)("div",{key:t.getContainerId(),id:t.getContainerId()})}))):null},t.renderToolBar=function(){return null===t.props.toolbarItems?null:Object(a.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,a=e.chartType,r=e.chartWrapperParams,s=e.toolbarItems,i=e.getChartEditor,o=e.getChartWrapper,l=u({chartType:a,options:t,containerId:this.getGraphID()},r),d=new n.visualization.ChartWrapper(l);d.setOptions(t),o(d,n);var c=new n.visualization.Dashboard(this.dashboard_ref),m=this.addControls(d,c);null!==s&&n.visualization.drawToolbar(this.toolbar_ref.current,s);var _=null;null!==i&&i({chartEditor:_=new n.visualization.ChartEditor,chartWrapper:d,google:n}),this.setState({googleChartEditor:_,googleChartControls:m,googleChartDashboard:c,googleChartWrapper:d,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],a=n.controlType,r=n.options,s=n.controlWrapperParams;s&&"state"in s&&this.state.googleChartControls[t].control.setState(s.state),this.state.googleChartControls[t].control.setOptions(r),this.state.googleChartControls[t].control.setControlType(a)}},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,r=e.options,s=e.style,i=u({height:n||r&&r.height,width:t||r&&r.width},s);return null!==this.props.render?Object(a.createElement)("div",{ref:this.dashboard_ref,style:i},Object(a.createElement)("div",{ref:this.toolbar_ref,id:"toolbar"}),this.props.render({renderChart:this.renderChart,renderControl:this.renderControl,renderToolbar:this.renderToolBar})):Object(a.createElement)("div",{ref:this.dashboard_ref,style:i},this.renderControl((function(e){return"bottom"!==e.controlProp.controlPosition})),this.renderChart(),this.renderControl((function(e){return"bottom"===e.controlProp.controlPosition})),this.renderToolBar())},t}(a.Component),S=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._isMounted=!1,t.state={loadingStatus:"loading",google:null},t.onLoad=function(e){if(t.isFullyLoaded(e))t.onSuccess(e);else var n=setInterval((function(){var e=window.google;t._isMounted?e&&t.isFullyLoaded(e)&&(clearInterval(n),t.onSuccess(e)):clearInterval(n)}),1e3)},t.onSuccess=function(e){t.setState({loadingStatus:"ready",google:e})},t.onError=function(){t.setState({loadingStatus:"errored"})},t}return l(t,e),t.prototype.render=function(){var e=this.props,t=e.chartLanguage,n=e.chartPackages,r=e.chartVersion,s=e.mapsApiKey,i=e.loader,o=e.errorElement;return Object(a.createElement)(b,{value:this.props},"ready"===this.state.loadingStatus&&null!==this.state.google?Object(a.createElement)(T,u({},this.props,{google:this.state.google})):"errored"===this.state.loadingStatus&&o?o:i,Object(a.createElement)(_,u({},{chartLanguage:t,chartPackages:n,chartVersion:r,mapsApiKey:s},{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,a=t.toolbarItems,r=t.getChartEditor;return e&&e.visualization&&e.visualization.ChartWrapper&&e.visualization.Dashboard&&(!n||e.visualization.ChartWrapper)&&(!r||e.visualization.ChartEditor)&&(!a||e.visualization.drawToolbar)},t.defaultProps=m,t}(a.Component),j=n(266),O=n.n(j);function x(e){return(x="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 H(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function E(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function P(e,t){return(P=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function C(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=W(e);if(t){var r=W(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return z(this,n)}}function z(e,t){if(t&&("object"===x(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return A(e)}function A(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function W(e){return(W=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var R=wp.element,F=R.Component,N=R.Fragment,I=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&P(e,t)}(s,e);var t,n,a,r=C(s);function s(){var e;return H(this,s),(e=r.apply(this,arguments)).initDataTable=e.initDataTable.bind(A(e)),e.dataRenderer=e.dataRenderer.bind(A(e)),e.table,e.uniqueId=O()(),e}return t=s,(n=[{key:"componentDidMount",value:function(){this.initDataTable(this.props.columns,this.props.rows)}},{key:"componentWillUnmount",value:function(){this.table.destroy()}},{key:"componentDidUpdate",value:function(e){this.props!==e&&(this.props.options.responsive_bool!==e.options.responsive_bool&&"true"===e.options.responsive_bool&&document.getElementById("dataTable-instances-".concat(this.props.id,"-").concat(this.uniqueId)).classList.remove("collapsed"),this.table.destroy(),document.getElementById("dataTable-instances-".concat(this.props.id,"-").concat(this.uniqueId)).innerHTML="",this.initDataTable(this.props.columns,this.props.rows))}},{key:"initDataTable",value:function(e,t){var n=this,a=this.props.options,r=e.map((function(e,t){var a=e.type;switch(e.type){case"number":a="num";break;case"date":case"datetime":case"timeofday":a="date"}return{title:e.label,data:e.label,type:a,render:n.dataRenderer(a,t)}})),s=t.map((function(e){var t={};return r.forEach((function(n,a){var r=e[a];void 0===r&&(r=e[n.data]),t[n.data]=r})),t}));this.table=jQuery("#dataTable-instances-".concat(this.props.id,"-").concat(this.uniqueId)).DataTable({destroy:!0,data:s,columns:r,paging:"true"===a.paging_bool,pageLength:a.pageLength_int||10,pagingType:a.pagingType,ordering:"false"!==a.ordering_bool,fixedHeader:"true"===a.fixedHeader_bool,scrollCollapse:!(!this.props.chartsScreen&&"true"!==a.scrollCollapse_bool),scrollY:(this.props.chartsScreen?180:"true"===a.scrollCollapse_bool&&Number(a.scrollY_int))||!1,responsive:!(!this.props.chartsScreen&&"true"!==a.responsive_bool),searching:!1,select:!1,lengthChange:!1,bFilter:!1,bInfo:!1})}},{key:"dataRenderer",value:function(e,t){var n,a=this.props.options,r=null;if(void 0===a.series||void 0===a.series[t]||void 0===a.series[t].format)return r;switch(e){case"date":case"datetime":case"timeofday":r=a.series[t].format&&a.series[t].format.from&&a.series[t].format.to?jQuery.fn.dataTable.render.moment(a.series[t].format.from,a.series[t].format.to):jQuery.fn.dataTable.render.moment("MM-DD-YYYY");break;case"num":var s=["","","","",""];a.series[t].format.thousands&&(s[0]=a.series[t].format.thousands),a.series[t].format.decimal&&(s[1]=a.series[t].format.decimal),a.series[t].format.precision&&0<parseInt(a.series[t].format.precision)&&(s[2]=a.series[t].format.precision),a.series[t].format.prefix&&(s[3]=a.series[t].format.prefix),a.series[t].format.suffix&&(s[4]=a.series[t].format.suffix),r=(n=jQuery.fn.dataTable.render).number.apply(n,s);break;case"boolean":jQuery.fn.dataTable.render.extra=function(e,n,r){return!0!==e&&"true"!==e||""===a.series[t].format.truthy?!1!==e&&"false"!==e||""===a.series[t].format.falsy?e:a.series[t].format.falsy.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,""):a.series[t].format.truthy.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,"")},r=jQuery.fn.dataTable.render.extra}return r}},{key:"render",value:function(){var e=this.props.options;return wp.element.createElement(N,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)}))}}])&&E(t.prototype,n),a&&E(t,a),s}(F),J=n(6),B=n.n(J),U=n(267),V=n.n(U),G=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(B()(e)){for(t in e)return!0;return!1}return"string"==typeof e?0<e.length:null!=e},K=function(e){return V()(e,q)},$=function(e){return e.width="",e.height="",e.backgroundColor={},e.chartArea={},K(e)},Z=function(e){try{JSON.parse(e)}catch(e){return!1}return!0},Q=function(e,t){return!0===e[t]||"true"===e[t]||"1"===e[t]||1===e[t]},X=function(e){switch(e["visualizer-chart-library"]){case"GoogleCharts":return ee(e)}},ee=function(e){var t=e["visualizer-settings"],n=e["visualizer-chart-type"],a=e["visualizer-series"],r=[];if(t.series)switch(n){case"tabular":for(var s in t.series)if(a[(s=parseInt(s))+1]&&t.series[s].format&&""!==t.series[s].format){var i=s+1,o=te(a[s+1].type);o&&r.push({type:o,options:{pattern:t.series[s].format},column:i})}break;default:for(var l=0;l<t.series.length;l++)if(a[l+1]&&void 0!==t.series[l]&&t.series[l].format&&""!==t.series[l].format){var u=l+1,d=te(a[l+1].type);d&&r.push({type:d,options:{pattern:t.series[l].format},column:u})}}else"pie"===n&&t.format&&""!==t.format&&r.push({type:te("number"),options:{pattern:t.format},column:1});if(t.hAxis&&a[0]){var c=te(a[0].type);c&&r.push({type:c,options:{pattern:t.hAxis.format},column:0})}return r},te=function(e){switch(e){case"number":return"NumberFormat";case"date":case"datetime":case"timeofday":return"DateFormat"}return null};function ne(e){return(ne="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ae(e,t,n,a,r,s,i){try{var o=e[s](i),l=o.value}catch(e){return void n(e)}o.done?t(l):Promise.resolve(l).then(a,r)}function re(e){return function(){var t=this,n=arguments;return new Promise((function(a,r){var s=e.apply(t,n);function i(e){ae(s,a,r,i,o,"next",e)}function o(e){ae(s,a,r,i,o,"throw",e)}i(void 0)}))}}function se(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ie(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function oe(e,t){return(oe=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function le(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=ce(e);if(t){var r=ce(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return ue(this,n)}}function ue(e,t){if(t&&("object"===ne(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return de(e)}function de(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ce(e){return(ce=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var me=lodash.startCase,_e=wp.i18n.__,he=wp.apiFetch,pe=wp.element,fe=pe.Component,ye=pe.Fragment,Me=wp.components,ge=Me.Button,Le=Me.Dashicon,be=Me.ExternalLink,ve=Me.Notice,Ye=Me.Placeholder,we=Me.Spinner,ke=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&oe(e,t)}(o,e);var t,n,a,r,s,i=le(o);function o(){var e;return se(this,o),(e=i.apply(this,arguments)).loadMoreCharts=e.loadMoreCharts.bind(de(e)),e.state={charts:null,isBusy:!1,chartsLoaded:!1,perPage:visualizerLocalize.chartsPerPage},e}return t=o,(n=[{key:"componentDidMount",value:(s=re(regeneratorRuntime.mark((function e(){var t,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=visualizerLocalize.chartsPerPage,e.next=3,he({path:"wp/v2/visualizer/?per_page="+t+"&meta_key=visualizer-chart-library&meta_value=ChartJS"});case 3:n=e.sent,this.setState({charts:n});case 5:case"end":return e.stop()}}),e,this)}))),function(){return s.apply(this,arguments)})},{key:"loadMoreCharts",value:(r=re(regeneratorRuntime.mark((function e(){var t,n,a,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.state.charts.length,n=this.state.chartsLoaded,a=this.state.perPage,this.setState({isBusy:!0}),e.next=6,he({path:"wp/v2/visualizer/?per_page=".concat(a,"&meta_key=visualizer-chart-library&meta_value=ChartJS&offset=").concat(t)});case 6:r=e.sent,a>r.length&&(n=!0),this.setState({charts:this.state.charts.concat(r),isBusy:!1,chartsLoaded:n});case 9:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"render",value:function(){var e=this,t="undefined"!=typeof google?google.visualization.Version:"current",n=this.state,a=n.charts,r=n.isBusy,s=n.chartsLoaded,i=n.perPage;return wp.element.createElement("div",{className:"visualizer-settings__charts"},wp.element.createElement(ve,{status:"warning",isDismissible:!1},_e("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(be,{href:visualizerLocalize.adminPage},_e("Click here to visit Visualizer Charts Library."))),null!==a?1<=a.length?wp.element.createElement(ye,null,wp.element.createElement("div",{className:"visualizer-settings__charts-grid"},Object.keys(a).map((function(n){var r,s,i,o=G(a[n].chart_data);if(r=o["visualizer-settings"].title?o["visualizer-settings"].title:"#".concat(a[n].id),0<=["gauge","tabular","timeline"].indexOf(o["visualizer-chart-type"])?"DataTable"===o["visualizer-chart-library"]?s=o["visualizer-chart-type"]:("tabular"===(s=o["visualizer-chart-type"])&&(s="table"),s=me(s)):s="".concat(me(o["visualizer-chart-type"]),"Chart"),!o["visualizer-chart-library"]||"ChartJS"!==o["visualizer-chart-library"])return o["visualizer-data-exploded"]&&(i=_e("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":s,key:"chart-".concat(a[n].id)},wp.element.createElement("div",{className:"visualizer-settings__charts-title"},r),"DataTable"===o["visualizer-chart-library"]?wp.element.createElement(I,{id:a[n].id,rows:o["visualizer-data"],columns:o["visualizer-series"],chartsScreen:!0,options:o["visualizer-settings"]}):(o["visualizer-data-exploded"],wp.element.createElement(S,{chartVersion:t,chartType:s,rows:o["visualizer-data"],columns:o["visualizer-series"],options:$(o["visualizer-settings"]),formatters:X(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:_e("Insert Chart"),onClick:function(){return e.props.getChart(a[n].id)}},wp.element.createElement(Le,{icon:"upload"})))}))),!s&&i-1<a.length&&wp.element.createElement(ge,{isPrimary:!0,isLarge:!0,onClick:this.loadMoreCharts,isBusy:r},_e("Load More"))):wp.element.createElement("p",{className:"visualizer-no-charts"},_e("No charts found.")):wp.element.createElement(Ye,null,wp.element.createElement(we,null)))}}])&&ie(t.prototype,n),a&&ie(t,a),o}(fe);function De(e){return(De="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Te(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Se(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function je(e,t){return(je=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Oe(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=Ee(e);if(t){var r=Ee(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return xe(this,n)}}function xe(e,t){if(t&&("object"===De(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return He(e)}function He(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ee(e){return(Ee=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Pe=wp.i18n.__,Ce=wp.element.Component,ze=wp.components,Ae=ze.Button,We=ze.ExternalLink,Re=ze.PanelBody,Fe=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&je(e,t)}(s,e);var t,n,a,r=Oe(s);function s(){var e;return Te(this,s),(e=r.apply(this,arguments)).uploadInput=React.createRef(),e.fileUploaded=e.fileUploaded.bind(He(e)),e.uploadImport=e.uploadImport.bind(He(e)),e.state={uploadLabel:Pe("Upload")},e}return t=s,(n=[{key:"fileUploaded",value:function(e){"text/csv"===e.target.files[0].type&&this.setState({uploadLabel:Pe("Upload")})}},{key:"uploadImport",value:function(){this.props.readUploadedFile(this.uploadInput),this.setState({uploadLabel:Pe("Uploaded")})}},{key:"render",value:function(){return wp.element.createElement(Re,{title:Pe("Import data from file"),initialOpen:!1},wp.element.createElement("p",null,Pe("Select and upload your data CSV file here. The first row of the CSV file should contain the column headings. The second one should contain series type (string, number, boolean, date, datetime, timeofday).")),wp.element.createElement("p",null,Pe("If you are unsure about how to format your data CSV then please take a look at this sample: "),wp.element.createElement(We,{href:"".concat(visualizerLocalize.absurl,"samples/").concat(this.props.chart["visualizer-chart-type"],".csv")},"".concat(this.props.chart["visualizer-chart-type"],".csv"))),wp.element.createElement("input",{type:"file",accept:"text/csv",ref:this.uploadInput,onChange:this.fileUploaded}),wp.element.createElement(Ae,{isPrimary:!0,onClick:this.uploadImport},this.state.uploadLabel))}}])&&Se(t.prototype,n),a&&Se(t,a),s}(Ce);function Ne(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function Ie(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ne(Object(n),!0).forEach((function(t){Je(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ne(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Je(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Be(e){return(Be="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ue(e,t,n,a,r,s,i){try{var o=e[s](i),l=o.value}catch(e){return void n(e)}o.done?t(l):Promise.resolve(l).then(a,r)}function Ve(e){return function(){var t=this,n=arguments;return new Promise((function(a,r){var s=e.apply(t,n);function i(e){Ue(s,a,r,i,o,"next",e)}function o(e){Ue(s,a,r,i,o,"throw",e)}i(void 0)}))}}function Ge(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function qe(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function Ke(e,t){return(Ke=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function $e(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=Xe(e);if(t){var r=Xe(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return Ze(this,n)}}function Ze(e,t){if(t&&("object"===Be(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Qe(e)}function Qe(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Xe(e){return(Xe=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var et=wp.i18n.__,tt=wp,nt=(tt.apiFetch,tt.apiRequest),at=wp.element.Component,rt=wp.components,st=rt.Button,it=rt.ExternalLink,ot=rt.IconButton,lt=rt.Modal,ut=rt.PanelBody,dt=rt.SelectControl,ct=rt.TextControl,mt=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ke(e,t)}(d,e);var t,n,a,r,s,i,o,l,u=$e(d);function d(){var e;return Ge(this,d),(e=u.apply(this,arguments)).openModal=e.openModal.bind(Qe(e)),e.initTable=e.initTable.bind(Qe(e)),e.onToggle=e.onToggle.bind(Qe(e)),e.toggleHeaders=e.toggleHeaders.bind(Qe(e)),e.getJSONRoot=e.getJSONRoot.bind(Qe(e)),e.getJSONData=e.getJSONData.bind(Qe(e)),e.getTableData=e.getTableData.bind(Qe(e)),e.state={isOpen:!1,isLoading:!1,isFirstStepOpen:!0,isSecondStepOpen:!1,isThirdStepOpen:!1,isFourthStepOpen:!1,isHeaderPanelOpen:!1,endpointRoots:[],endpointPaging:[],table:null,requestHeaders:{method:"GET",username:"",password:"",auth:""}},e}return t=d,(n=[{key:"openModal",value:(l=Ve(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.setState({isOpen:!0});case 2:t=document.querySelector("#visualizer-json-query-table"),this.state.isFourthStepOpen&&null!==this.state.table&&(t.innerHTML=this.state.table,this.initTable());case 4:case"end":return e.stop()}}),e,this)}))),function(){return l.apply(this,arguments)})},{key:"initTable",value:function(){jQuery("#visualizer-json-query-table table").DataTable({paging:!1,searching:!1,ordering:!1,select:!1,scrollX:"600px",scrollY:"400px",info:!1,colReorder:{fixedColumnsLeft:1},dom:"Bt",buttons:[{extend:"colvis",columns:":gt(0)",collectionLayout:"four-column"}]})}},{key:"onToggle",value:(o=Ve(regeneratorRuntime.mark((function e(t){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null===this.state.table&&this.state.endpointRoots&&0<this.state.endpointRoots.length&&("isFirstStepOpen"===t||"isSecondStepOpen"===t)&&this.setState({isFirstStepOpen:"isFirstStepOpen"===t,isSecondStepOpen:"isSecondStepOpen"===t,isThirdStepOpen:!1,isFourthStepOpen:!1}),null===this.state.table){e.next=5;break}return e.next=4,this.setState({isFirstStepOpen:"isFirstStepOpen"===t,isSecondStepOpen:"isSecondStepOpen"===t,isThirdStepOpen:"isThirdStepOpen"===t,isFourthStepOpen:"isFourthStepOpen"===t});case 4:"isFourthStepOpen"===t&&(n=document.querySelector("#visualizer-json-query-table"),this.state.isFourthStepOpen&&(n.innerHTML=this.state.table,this.initTable()));case 5:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:"toggleHeaders",value:function(){this.setState({isHeaderPanelOpen:!this.state.isHeaderPanelOpen})}},{key:"getJSONRoot",value:(i=Ve(regeneratorRuntime.mark((function e(){var t,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.setState({isLoading:!0,endpointRoots:[],endpointPaging:[],table:null}),e.next=3,nt({path:"/visualizer/v1/get-json-root?url=".concat(this.props.chart["visualizer-json-url"]),data:{method:this.props.chart["visualizer-json-headers"]?this.props.chart["visualizer-json-headers"].method:this.state.requestHeaders.method,username:this.props.chart["visualizer-json-headers"]&&"object"===Be(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"===Be(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"!==Be(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 i.apply(this,arguments)})},{key:"getJSONData",value:(s=Ve(regeneratorRuntime.mark((function e(){var t,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.setState({isLoading:!0}),e.next=3,nt({path:"/visualizer/v1/get-json-data?url=".concat(this.props.chart["visualizer-json-url"],"&chart=").concat(this.props.id),data:{root:this.props.chart["visualizer-json-root"]||this.state.endpointRoots[0].value,method:this.props.chart["visualizer-json-headers"]?this.props.chart["visualizer-json-headers"].method:this.state.requestHeaders.method,username:this.props.chart["visualizer-json-headers"]&&"object"===Be(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"===Be(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"!==Be(this.props.chart["visualizer-json-headers"].auth)?this.props.chart["visualizer-json-headers"].auth:this.state.requestHeaders.auth},method:"GET"});case 3:(t=e.sent).success?(n=[{label:et("Don't use pagination"),value:0}],t.data.paging&&"root>next"===t.data.paging[0]&&n.push({label:et("Get first 5 pages using root ➤ next"),value:"root>next"}),this.setState({isLoading:!1,isSecondStepOpen:!1,isFourthStepOpen:!0,endpointPaging:n,table:t.data.table}),document.querySelector("#visualizer-json-query-table").innerHTML=t.data.table,this.initTable()):(this.setState({isLoading:!1}),alert(t.data.msg));case 5:case"end":return e.stop()}}),e,this)}))),function(){return s.apply(this,arguments)})},{key:"getTableData",value:(r=Ve(regeneratorRuntime.mark((function e(){var t,n,a,r,s;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"),a=[],r={},t.forEach((function(e){return a.push(e.value)})),n.forEach((function(e){return r[e.name]=e.value})),e.next=9,nt({path:"/visualizer/v1/set-json-data",data:Ie({url:this.props.chart["visualizer-json-url"],method:this.props.chart["visualizer-json-headers"]?this.props.chart["visualizer-json-headers"].method:this.state.requestHeaders.method,username:this.props.chart["visualizer-json-headers"]&&"object"===Be(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"===Be(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"!==Be(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:a},r),method:"GET"});case 9:(s=e.sent).success?(this.props.JSONImportData(s.data.name,JSON.parse(s.data.series),JSON.parse(s.data.data)),this.setState({isOpen:!1,isLoading:!1})):(alert(s.data.msg),this.setState({isLoading:!1}));case 11:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"render",value:function(){var e=this;return wp.element.createElement(ut,{title:et("Import from JSON"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement("p",null,et("You can choose here to import or synchronize your chart data with a remote JSON source.")),wp.element.createElement("p",null,wp.element.createElement(it,{href:"https://docs.themeisle.com/article/1052-how-to-generate-charts-from-json-data-rest-endpoints"},et("For more info check this tutorial."))),wp.element.createElement(dt,{label:et("How often do you want to check the url?"),value:this.props.chart["visualizer-json-schedule"]?this.props.chart["visualizer-json-schedule"]:1,options:[{label:et("One-time"),value:"-1"},{label:et("Live"),value:"0"},{label:et("Each hour"),value:"1"},{label:et("Each 12 hours"),value:"12"},{label:et("Each day"),value:"24"},{label:et("Each 3 days"),value:"72"}],onChange:this.props.editSchedule}),wp.element.createElement(st,{isPrimary:!0,isLarge:!0,onClick:this.openModal},et("Modify Parameters")),this.state.isOpen&&wp.element.createElement(lt,{title:et("Import from JSON"),className:"visualizer-json-query-modal",shouldCloseOnClickOutside:!1,onRequestClose:function(){e.setState({isOpen:!1,isTableRendered:!1})}},wp.element.createElement(ut,{title:et("Step 1: Specify the JSON endpoint/URL"),opened:this.state.isFirstStepOpen,onToggle:function(){return e.onToggle("isFirstStepOpen")}},wp.element.createElement("p",null,et("If you want to add authentication, add headers to the endpoint or change the request in any way, please refer to our document here:")),wp.element.createElement("p",null,wp.element.createElement(it,{href:"https://docs.themeisle.com/article/1043-visualizer-how-to-extend-rest-endpoints-with-json-response"},et("How to extend REST endpoints with JSON response"))),wp.element.createElement(ct,{placeholder:et("Please enter the URL of your JSON file"),value:this.props.chart["visualizer-json-url"]?this.props.chart["visualizer-json-url"]:"",onChange:this.props.editJSONURL}),wp.element.createElement(ot,{icon:"arrow-right-alt2",label:et("Add Headers"),onClick:this.toggleHeaders},et("Add Headers")),this.state.isHeaderPanelOpen&&wp.element.createElement("div",{className:"visualizer-json-query-modal-headers-panel"},wp.element.createElement(dt,{label:et("Request Type"),value:this.props.chart["visualizer-json-headers"]?this.props.chart["visualizer-json-headers"].method:this.state.requestHeaders.method,options:[{value:"GET",label:et("GET")},{value:"POST",label:et("POST")}],onChange:function(t){var n=Ie({},e.state.requestHeaders),a=e.state.requestHeaders;n.method=t,a=Ie(Ie({},a),{},{method:t}),e.setState({requestHeaders:a}),e.props.editJSONHeaders(n)}}),wp.element.createElement("p",null,et("Credentials")),wp.element.createElement(ct,{label:et("Username"),placeholder:et("Username/Access Key"),value:this.props.chart["visualizer-json-headers"]&&"object"===Be(this.props.chart["visualizer-json-headers"].auth)?this.props.chart["visualizer-json-headers"].auth.username:this.state.requestHeaders.username,onChange:function(t){var n=Ie({},e.state.requestHeaders),a=e.state.requestHeaders;n.auth={username:t,password:e.props.chart["visualizer-json-headers"]&&"object"===Be(e.props.chart["visualizer-json-headers"].auth)?e.props.chart["visualizer-json-headers"].auth.password:e.state.requestHeaders.password},a=Ie(Ie({},a),{},{username:t,password:n.password}),e.setState({requestHeaders:a}),e.props.editJSONHeaders(n)}}),wp.element.createElement("span",{className:"visualizer-json-query-modal-field-separator"},et("&")),wp.element.createElement(ct,{label:et("Password"),placeholder:et("Password/Secret Key"),type:"password",value:this.props.chart["visualizer-json-headers"]&&"object"===Be(this.props.chart["visualizer-json-headers"].auth)?this.props.chart["visualizer-json-headers"].auth.password:this.state.requestHeaders.password,onChange:function(t){var n=Ie({},e.state.requestHeaders),a=e.state.requestHeaders;n.auth={username:e.props.chart["visualizer-json-headers"]&&"object"===Be(e.props.chart["visualizer-json-headers"].auth)?e.props.chart["visualizer-json-headers"].auth.username:e.state.requestHeaders.username,password:t},a=Ie(Ie({},a),{},{username:n.username,password:t}),e.setState({requestHeaders:a}),e.props.editJSONHeaders(n)}}),wp.element.createElement("p",null,et("OR")),wp.element.createElement(ct,{label:et("Authorization"),placeholder:et("e.g. SharedKey <AccountName>:<Signature>"),value:this.props.chart["visualizer-json-headers"]&&"object"!==Be(this.props.chart["visualizer-json-headers"].auth)?this.props.chart["visualizer-json-headers"].auth:this.state.requestHeaders.auth,onChange:function(t){var n=Ie({},e.state.requestHeaders),a=e.state.requestHeaders;n.auth=t,a=Ie(Ie({},a),{},{auth:t}),e.setState({requestHeaders:a}),e.props.editJSONHeaders(n)}})),wp.element.createElement(st,{isPrimary:!0,isLarge:!0,isBusy:this.state.isLoading,disabled:this.state.isLoading,onClick:this.getJSONRoot},et("Fetch Endpoint"))),wp.element.createElement(ut,{title:et("Step 2: Choose the JSON root"),initialOpen:!1,opened:this.state.isSecondStepOpen,onToggle:function(){return e.onToggle("isSecondStepOpen")}},wp.element.createElement("p",null,et("If you see Invalid Data, you may have selected the wrong root to fetch data from. Please select an alternative.")),wp.element.createElement(dt,{value:this.props.chart["visualizer-json-root"],options:this.state.endpointRoots,onChange:this.props.editJSONRoot}),wp.element.createElement(st,{isPrimary:!0,isLarge:!0,isBusy:this.state.isLoading,disabled:this.state.isLoading,onClick:this.getJSONData},et("Parse Endpoint"))),wp.element.createElement(ut,{title:et("Step 3: Specify miscellaneous parameters"),initialOpen:!1,opened:this.state.isThirdStepOpen,onToggle:function(){return e.onToggle("isThirdStepOpen")}},"community"!==visualizerLocalize.isPro?wp.element.createElement(dt,{value:this.props.chart["visualizer-json-paging"]||0,options:this.state.endpointPaging,onChange:this.props.editJSONPaging}):wp.element.createElement("p",null,et("Enable this feature in PRO version!"))),wp.element.createElement(ut,{title:et("Step 4: Select the data to display in the chart"),initialOpen:!1,opened:this.state.isFourthStepOpen,onToggle:function(){return e.onToggle("isFourthStepOpen")}},wp.element.createElement("ul",null,wp.element.createElement("li",null,et("Select whether to include the data in the chart. Each column selected will form one series.")),wp.element.createElement("li",null,et("If a column is selected to be included, specify its data type.")),wp.element.createElement("li",null,et("You can use drag/drop to reorder the columns but this column position is not saved. So when you reload the table, you may have to reorder again.")),wp.element.createElement("li",null,et("You can select any number of columns but the chart type selected will determine how many will display in the chart."))),wp.element.createElement("div",{id:"visualizer-json-query-table"}),wp.element.createElement(st,{isPrimary:!0,isLarge:!0,isBusy:this.state.isLoading,disabled:this.state.isLoading,onClick:this.getTableData},et("Save & Show Chart")))))}}])&&qe(t.prototype,n),a&&qe(t,a),d}(at);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 ht(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function pt(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function ft(e,t){return(ft=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function yt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=gt(e);if(t){var r=gt(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return Mt(this,n)}}function Mt(e,t){if(t&&("object"===_t(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function gt(e){return(gt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Lt=wp.i18n.__,bt=wp.element.Component,vt=wp.components,Yt=vt.Button,wt=vt.ExternalLink,kt=vt.PanelBody,Dt=vt.SelectControl,Tt=vt.TextControl,St=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ft(e,t)}(s,e);var t,n,a,r=yt(s);function s(){return ht(this,s),r.apply(this,arguments)}return t=s,(n=[{key:"render",value:function(){var e=this;return wp.element.createElement(kt,{title:Lt("Import data from URL"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(kt,{title:Lt("One Time Import"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement("p",null,Lt("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,Lt("If you are unsure about how to format your data CSV then please take a look at this sample: "),wp.element.createElement(wt,{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,Lt("You can also import data from Google Spreadsheet.")),wp.element.createElement(Tt,{placeholder:Lt("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(Yt,{isPrimary:!0,isLarge:!0,isBusy:"uploadData"===this.props.isLoading,disabled:"uploadData"===this.props.isLoading,onClick:function(){return e.props.uploadData(!1)}},Lt("Import Data"))),"business"===visualizerLocalize.isPro?wp.element.createElement(kt,{title:Lt("Schedule Import"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement("p",null,Lt("You can choose here to synchronize your chart data with a remote CSV file. ")),wp.element.createElement("p",null,Lt("You can also synchronize with your Google Spreadsheet file.")),wp.element.createElement("p",null,Lt("We will update the chart data based on your time interval preference by overwritting the current data with the one from the URL.")),wp.element.createElement(Tt,{placeholder:Lt("Please enter the URL of your CSV file"),value:this.props.chart["visualizer-chart-url"]?this.props.chart["visualizer-chart-url"]:"",onChange:this.props.editURL}),wp.element.createElement(Dt,{label:Lt("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:Lt("Each hour"),value:"1"},{label:Lt("Each 12 hours"),value:"12"},{label:Lt("Each day"),value:"24"},{label:Lt("Each 3 days"),value:"72"}],onChange:this.props.editSchedule}),wp.element.createElement(Yt,{isPrimary:!0,isLarge:!0,isBusy:"uploadData"===this.props.isLoading,disabled:"uploadData"===this.props.isLoading,onClick:function(){return e.props.uploadData(!0)}},Lt("Save Schedule"))):wp.element.createElement(kt,{title:Lt("Schedule Import"),icon:"lock",className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement("p",null,Lt("Upgrade your license to at least the DEVELOPER version to activate this feature!")),wp.element.createElement(Yt,{isPrimary:!0,href:visualizerLocalize.proTeaser,target:"_blank"},Lt("Buy Now"))),wp.element.createElement(mt,{id:this.props.id,chart:this.props.chart,editSchedule:this.props.editJSONSchedule,editJSONURL:this.props.editJSONURL,editJSONHeaders:this.props.editJSONHeaders,editJSONRoot:this.props.editJSONRoot,editJSONPaging:this.props.editJSONPaging,JSONImportData:this.props.JSONImportData}))}}])&&pt(t.prototype,n),a&&pt(t,a),s}(bt);function jt(e){return(jt="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 Ot(e,t,n,a,r,s,i){try{var o=e[s](i),l=o.value}catch(e){return void n(e)}o.done?t(l):Promise.resolve(l).then(a,r)}function xt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ht(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function Et(e,t){return(Et=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Pt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=zt(e);if(t){var r=zt(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return Ct(this,n)}}function Ct(e,t){if(t&&("object"===jt(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function zt(e){return(zt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var At=wp.i18n.__,Wt=wp.apiFetch,Rt=wp.element,Ft=Rt.Component,Nt=Rt.Fragment,It=wp.components,Jt=It.Button,Bt=It.PanelBody,Ut=It.Placeholder,Vt=It.SelectControl,Gt=It.Spinner,qt=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Et(e,t)}(o,e);var t,n,a,r,s,i=Pt(o);function o(){var e;return xt(this,o),(e=i.apply(this,arguments)).state={id:"",charts:[]},e}return t=o,(n=[{key:"componentDidMount",value:(r=regeneratorRuntime.mark((function e(){var t,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Wt({path:"wp/v2/visualizer/?per_page=100"});case 2:t=(t=e.sent).map((function(e,t){var a=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:a}})),this.setState({id:n,charts:t});case 5:case"end":return e.stop()}}),e,this)})),s=function(){var e=this,t=arguments;return new Promise((function(n,a){var s=r.apply(e,t);function i(e){Ot(s,n,a,i,o,"next",e)}function o(e){Ot(s,n,a,i,o,"throw",e)}i(void 0)}))},function(){return s.apply(this,arguments)})},{key:"render",value:function(){var e=this;return"community"!==visualizerLocalize.isPro?wp.element.createElement(Bt,{title:At("Import from other chart"),initialOpen:!1},1<=this.state.charts.length?wp.element.createElement(Nt,null,wp.element.createElement(Vt,{label:At("You can import here data from your previously created charts."),value:this.state.id,options:this.state.charts,onChange:function(t){return e.setState({id:t})}}),wp.element.createElement(Jt,{isPrimary:!0,isLarge:!0,isBusy:"getChartData"===this.props.isLoading,onClick:function(){return e.props.getChartData(e.state.id)}},At("Import Chart"))):wp.element.createElement(Ut,null,wp.element.createElement(Gt,null))):wp.element.createElement(Bt,{title:At("Import from other chart"),icon:"lock",initialOpen:!1},wp.element.createElement("p",null,At("Enable this feature in PRO version!")),wp.element.createElement(Jt,{isPrimary:!0,href:visualizerLocalize.proTeaser,target:"_blank"},At("Buy Now")))}}])&&Ht(t.prototype,n),a&&Ht(t,a),o}(Ft);function Kt(e){return(Kt="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 $t(e,t,n,a,r,s,i){try{var o=e[s](i),l=o.value}catch(e){return void n(e)}o.done?t(l):Promise.resolve(l).then(a,r)}function Zt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Qt(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function Xt(e,t){return(Xt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function en(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=an(e);if(t){var r=an(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return tn(this,n)}}function tn(e,t){if(t&&("object"===Kt(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return nn(e)}function nn(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function an(e){return(an=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var rn=wp.i18n.__,sn=wp.apiRequest,on=wp.components,ln=on.Button,un=on.ExternalLink,dn=wp.element,cn=dn.Component,mn=dn.Fragment,_n=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Xt(e,t)}(o,e);var t,n,a,r,s,i=en(o);function o(){var e;return Zt(this,o),(e=i.apply(this,arguments)).onSave=e.onSave.bind(nn(e)),e.state={isLoading:!1,success:!1,query:"",name:"",series:{},data:[]},e}return t=o,(n=[{key:"componentDidMount",value:function(){var e=wp.CodeMirror||CodeMirror,t=document.querySelector(".visualizer-db-query"),n=e.fromTextArea(t,{autofocus:!0,mode:"text/x-mysql",lineWrapping:!0,dragDrop:!1,matchBrackets:!0,autoCloseBrackets:!0,extraKeys:{"Ctrl-Space":"autocomplete"},hintOptions:{tables:visualizerLocalize.sqlTable}});n.on("inputRead",(function(){n.save()}))}},{key:"onSave",value:(r=regeneratorRuntime.mark((function e(){var t,n,a;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,sn({path:"/visualizer/v1/get-query-data",data:{query:t},method:"GET"});case 7:return a=e.sent,e.next=10,this.setState({isLoading:!1,success:a.success,query:t,name:a.data.name||"",series:a.data.series||{},data:a.data.data||[]});case 10:n.innerHTML=a.data.table||a.data.msg,this.state.success&&jQuery("#results").DataTable({paging:!1});case 12:case"end":return e.stop()}}),e,this)})),s=function(){var e=this,t=arguments;return new Promise((function(n,a){var s=r.apply(e,t);function i(e){$t(s,n,a,i,o,"next",e)}function o(e){$t(s,n,a,i,o,"throw",e)}i(void 0)}))},function(){return s.apply(this,arguments)})},{key:"render",value:function(){var e=this;return wp.element.createElement(mn,null,wp.element.createElement("textarea",{className:"visualizer-db-query",placeholder:rn("Your query goes here…")},this.props.chart["visualizer-db-query"]),wp.element.createElement("div",{className:"visualizer-db-query-actions"},wp.element.createElement(ln,{isLarge:!0,isDefault:!0,isBusy:this.state.isLoading,onClick:this.onSave},rn("Show Results")),wp.element.createElement(ln,{isLarge:!0,isPrimary:!0,disabled:!this.state.success,onClick:function(){return e.props.save(e.state.query,e.state.name,e.state.series,e.state.data)}},rn("Save"))),wp.element.createElement("ul",null,wp.element.createElement("li",null,wp.element.createElement(un,{href:"https://docs.themeisle.com/article/970-visualizer-sample-queries-to-generate-charts"},rn("Examples of queries and links to resources that you can use with this feature."))),wp.element.createElement("li",null,rn("Use Control+Space for autocompleting keywords or table names."))),wp.element.createElement("div",{id:"visualizer-db-query-table",className:!this.state.success&&"db-wizard-error"}))}}])&&Qt(t.prototype,n),a&&Qt(t,a),o}(cn);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 pn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function fn(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function yn(e,t){return(yn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Mn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=bn(e);if(t){var r=bn(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return gn(this,n)}}function gn(e,t){if(t&&("object"===hn(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Ln(e)}function Ln(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function bn(e){return(bn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var vn=wp.i18n.__,Yn=wp.element.Component,wn=wp.components,kn=wn.Button,Dn=wn.Modal,Tn=wn.PanelBody,Sn=wn.SelectControl,jn=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&yn(e,t)}(s,e);var t,n,a,r=Mn(s);function s(){var e;return pn(this,s),(e=r.apply(this,arguments)).save=e.save.bind(Ln(e)),e.state={isOpen:!1},e}return t=s,(n=[{key:"save",value:function(e,t,n,a){this.props.databaseImportData(e,t,n,a),this.setState({isOpen:!1})}},{key:"render",value:function(){var e=this;return"business"!==visualizerLocalize.isPro?wp.element.createElement(Tn,{title:vn("Import data from database"),icon:"lock",initialOpen:!1},wp.element.createElement("p",null,vn("Upgrade your license to at least the DEVELOPER version to activate this feature!")),wp.element.createElement(kn,{isPrimary:!0,href:visualizerLocalize.proTeaser,target:"_blank"},vn("Buy Now"))):wp.element.createElement(Tn,{title:vn("Import data from database"),initialOpen:!1},wp.element.createElement("p",null,vn("You can import data from the database here.")),wp.element.createElement("p",null,vn("How often do you want to refresh the data from the database.")),wp.element.createElement(Sn,{label:vn("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:vn("Live"),value:"0"},{label:vn("Each hour"),value:"1"},{label:vn("Each 12 hours"),value:"12"},{label:vn("Each day"),value:"24"},{label:vn("Each 3 days"),value:"72"}],onChange:this.props.editSchedule}),wp.element.createElement(kn,{isPrimary:!0,isLarge:!0,onClick:function(){return e.setState({isOpen:!0})}},vn("Create Query")),this.state.isOpen&&wp.element.createElement(Dn,{title:vn("Import from database"),onRequestClose:function(){return e.setState({isOpen:!1})},className:"visualizer-db-query-modal",shouldCloseOnClickOutside:!1},wp.element.createElement(_n,{chart:this.props.chart,changeQuery:this.props.changeQuery,save:this.save})))}}])&&fn(t.prototype,n),a&&fn(t,a),s}(Yn),On=n(268);n(289);function xn(e){return(xn="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 Hn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function En(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function Pn(e,t){return(Pn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Cn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=An(e);if(t){var r=An(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return zn(this,n)}}function zn(e,t){if(t&&("object"===xn(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function An(e){return(An=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Wn=wp.i18n.__,Rn=wp.element.Component,Fn=wp.components,Nn=Fn.Button,In=Fn.ButtonGroup,Jn=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Pn(e,t)}(s,e);var t,n,a,r=Cn(s);function s(){var e;return Hn(this,s),(e=r.apply(this,arguments)).data=[],e.dates=[],e.types=["string","number","boolean","date","datetime","timeofday"],e}return t=s,(n=[{key:"componentWillMount",value:function(){var e=this;this.data[this.data.length]=[],this.data[this.data.length]=[],this.props.chart["visualizer-series"].map((function(t,n){e.data[0][n]=t.label,e.data[1][n]=t.type,"date"===t.type&&e.dates.push(n)})),this.props.chart["visualizer-data"].map((function(t){e.data[e.data.length]=t}))}},{key:"render",value:function(){var e=this;return wp.element.createElement("div",{className:"visualizer-chart-editor"},wp.element.createElement(On.HotTable,{data:this.data,allowInsertRow:!0,contextMenu:!0,rowHeaders:!0,colHeaders:!0,allowInvalid:!1,className:"htEditor",cells:function(t,n,a){var r;return 1===t&&(r={type:"autocomplete",source:e.types,strict:!1}),0<=e.dates.indexOf(n)&&1<t&&(r={type:"date",dateFormat:"YYYY-MM-DD",correctFormat:!0}),r}}),wp.element.createElement(In,null,wp.element.createElement(Nn,{isDefault:!0,isLarge:!0,onClick:this.props.toggleModal},Wn("Close")),wp.element.createElement(Nn,{isPrimary:!0,isLarge:!0,onClick:function(t){e.props.toggleModal(),e.props.editChartData(e.data,"Visualizer_Source_Csv")}},Wn("Save"))))}}])&&En(t.prototype,n),a&&En(t,a),s}(Rn);function Bn(e){return(Bn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Un(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Vn(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function Gn(e,t){return(Gn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function qn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=Zn(e);if(t){var r=Zn(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return Kn(this,n)}}function Kn(e,t){if(t&&("object"===Bn(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return $n(e)}function $n(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Zn(e){return(Zn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Qn=wp.i18n.__,Xn=wp.element,ea=Xn.Component,ta=Xn.Fragment,na=wp.components,aa=na.Button,ra=na.Modal,sa=na.PanelBody,ia=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Gn(e,t)}(s,e);var t,n,a,r=qn(s);function s(){var e;return Un(this,s),(e=r.apply(this,arguments)).toggleModal=e.toggleModal.bind($n(e)),e.state={isOpen:!1},e}return t=s,(n=[{key:"toggleModal",value:function(){this.setState({isOpen:!this.state.isOpen})}},{key:"render",value:function(){return"community"!==visualizerLocalize.isPro?wp.element.createElement(ta,null,wp.element.createElement(sa,{title:Qn("Manual Data"),initialOpen:!1},wp.element.createElement("p",null,Qn("You can manually edit the chart data using a spreadsheet like editor.")),wp.element.createElement(aa,{isPrimary:!0,isLarge:!0,isBusy:this.state.isOpen,onClick:this.toggleModal},Qn("View Editor"))),this.state.isOpen&&wp.element.createElement(ra,{title:"Chart Editor",onRequestClose:this.toggleModal,shouldCloseOnClickOutside:!1},wp.element.createElement(Jn,{chart:this.props.chart,editChartData:this.props.editChartData,toggleModal:this.toggleModal}))):wp.element.createElement(sa,{title:Qn("Manual Data"),icon:"lock",initialOpen:!1},wp.element.createElement("p",null,Qn("Enable this feature in PRO version!")),wp.element.createElement(aa,{isPrimary:!0,href:visualizerLocalize.proTeaser,target:"_blank"},Qn("Buy Now")))}}])&&Vn(t.prototype,n),a&&Vn(t,a),s}(ea);function oa(e){return(oa="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 la(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ua(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function da(e,t){return(da=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ca(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=_a(e);if(t){var r=_a(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return ma(this,n)}}function ma(e,t){if(t&&("object"===oa(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function _a(e){return(_a=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var ha=wp.i18n.__,pa=wp.element.Component,fa=(wp.blockEditor||wp.editor).ColorPalette,ya=wp.components,Ma=ya.BaseControl,ga=ya.CheckboxControl,La=ya.PanelBody,ba=ya.SelectControl,va=ya.TextControl,Ya=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&da(e,t)}(s,e);var t,n,a,r=ca(s);function s(){return la(this,s),r.apply(this,arguments)}return t=s,(n=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-chart-type"],n=this.props.chart["visualizer-settings"],a=[{label:ha("The tooltip will be displayed when the user hovers over an element"),value:"focus"}];-1>=["timeline"].indexOf(t)&&(a[1]={label:ha("The tooltip will be displayed when the user selects an element"),value:"selection"}),a[2]={label:ha("The tooltip will not be displayed"),value:"none"};var r=[{label:ha("Left of the chart"),value:"left"},{label:ha("Right of the chart"),value:"right"},{label:ha("Above the chart"),value:"top"},{label:ha("Below the chart"),value:"bottom"},{label:ha("Omit the legend"),value:"none"}];"pie"!==t&&r.push({label:ha("Inside the chart"),value:"in"}),"bubble"===t&&(r=r.filter((function(e){return"left"!==e.value})));var s=ha("Text to display above the chart.");return 0<=["tabular","dataTable","gauge","geo","timeline"].indexOf(t)&&(s=ha("Text to display in the back-end admin area")),wp.element.createElement(La,{title:ha("General Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(La,{title:ha("Title"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(va,{label:ha("Chart Title"),help:s,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(ba,{label:ha("Chart Title Position"),help:ha("Where to place the chart title, compared to the chart area."),value:n.titlePosition?n.titlePosition:"out",options:[{label:ha("Inside the chart"),value:"in"},{label:ha("Outside the chart"),value:"out"},{label:ha("None"),value:"none"}],onChange:function(t){n.titlePosition=t,e.props.edit(n)}}),-1>=["tabular","dataTable","gauge","geo","timeline"].indexOf(t)&&wp.element.createElement(Ma,{label:ha("Chart Title Color")},wp.element.createElement(fa,{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(ba,{label:ha("Axes Titles Position"),help:ha("Determines where to place the axis titles, compared to the chart area."),value:n.axisTitlesPosition?n.axisTitlesPosition:"out",options:[{label:ha("Inside the chart"),value:"in"},{label:ha("Outside the chart"),value:"out"},{label:ha("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(La,{title:ha("Font Styles"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(ba,{label:ha("Font Family"),help:ha("The default font family for all text in the chart."),value:n.fontName?n.fontName:"Arial",options:[{label:ha("Arial"),value:"Arial"},{label:ha("Sans Serif"),value:"Sans Serif"},{label:ha("Serif"),value:"serif"},{label:ha("Arial"),value:"Arial"},{label:ha("Wide"),value:"Arial black"},{label:ha("Narrow"),value:"Arial Narrow"},{label:ha("Comic Sans MS"),value:"Comic Sans MS"},{label:ha("Courier New"),value:"Courier New"},{label:ha("Garamond"),value:"Garamond"},{label:ha("Georgia"),value:"Georgia"},{label:ha("Tahoma"),value:"Tahoma"},{label:ha("Verdana"),value:"Verdana"}],onChange:function(t){n.fontName=t,e.props.edit(n)}}),wp.element.createElement(ba,{label:ha("Font Size"),help:ha("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(La,{title:ha("Legend"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(ba,{label:ha("Position"),help:ha("Determines where to place the legend, compared to the chart area."),value:n.legend.position?n.legend.position:"right",options:r,onChange:function(a){if("pie"!==t){var r="left"===a?1:0;n.series&&Object.keys(n.series).map((function(e){n.series[e].targetAxisIndex=r}))}n.legend.position=a,e.props.edit(n)}}),wp.element.createElement(ba,{label:ha("Alignment"),help:ha("Determines the alignment of the legend."),value:n.legend.alignment?n.legend.alignment:"15",options:[{label:ha("Aligned to the start of the allocated area"),value:"start"},{label:ha("Centered in the allocated area"),value:"center"},{label:ha("Aligned to the end of the allocated area"),value:"end"}],onChange:function(t){n.legend.alignment=t,e.props.edit(n)}}),wp.element.createElement(Ma,{label:ha("Font Color")},wp.element.createElement(fa,{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(La,{title:ha("Tooltip"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(ba,{label:ha("Trigger"),help:ha("Determines the user interaction that causes the tooltip to be displayed."),value:n.tooltip.trigger?n.tooltip.trigger:"focus",options:a,onChange:function(t){n.tooltip.trigger=t,e.props.edit(n)}}),wp.element.createElement(ba,{label:ha("Show Color Code"),help:ha("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:ha("Yes"),value:"1"},{label:ha("No"),value:"0"}],onChange:function(t){n.tooltip.showColorCode=t,e.props.edit(n)}}),0<=["pie"].indexOf(t)&&wp.element.createElement(ba,{label:ha("Text"),help:ha("Determines what information to display when the user hovers over a pie slice."),value:n.tooltip.text?n.tooltip.text:"both",options:[{label:ha("Display both the absolute value of the slice and the percentage of the whole"),value:"both"},{label:ha("Display only the absolute value of the slice"),value:"value"},{label:ha("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(La,{title:ha("Animation"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(ga,{label:ha("Animate on startup?"),help:ha("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(va,{label:ha("Duration"),help:ha("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(ba,{label:ha("Easing"),help:ha("The easing function applied to the animation."),value:n.animation.easing?n.animation.easing:"linear",options:[{label:ha("Constant speed"),value:"linear"},{label:ha("Start slow and speed up"),value:"in"},{label:ha("Start fast and slow down"),value:"out"},{label:ha("Start slow, speed up, then slow down"),value:"inAndOut"}],onChange:function(t){n.animation.easing=t,e.props.edit(n)}})))}}])&&ua(t.prototype,n),a&&ua(t,a),s}(pa);function wa(e){return(wa="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ka(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Da(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function Ta(e,t){return(Ta=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Sa(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=Oa(e);if(t){var r=Oa(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return ja(this,n)}}function ja(e,t){if(t&&("object"===wa(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Oa(e){return(Oa=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var xa=wp.i18n.__,Ha=wp.element.Component,Ea=wp.components,Pa=Ea.PanelBody,Ca=Ea.Notice,za=Ea.TextControl,Aa=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ta(e,t)}(s,e);var t,n,a,r=Sa(s);function s(){return ka(this,s),r.apply(this,arguments)}return t=s,(n=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(Pa,{title:xa("Instance Settings"),initialOpen:!0,className:"visualizer-instance-panel"},wp.element.createElement(Ca,{status:"info",isDismissible:!1},wp.element.createElement("p",null,xa("These settings are valid only for this instance of the chart.")),wp.element.createElement("p",null,xa("This means that if you insert this chart again elsewhere, these values will not persist."))),wp.element.createElement(za,{label:xa("Should this instance lazy Load?"),help:xa("-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)}}))}}])&&Da(t.prototype,n),a&&Da(t,a),s}(Ha);function Wa(e){return(Wa="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ra(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Fa(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function Na(e,t){return(Na=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Ia(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=Ba(e);if(t){var r=Ba(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return Ja(this,n)}}function Ja(e,t){if(t&&("object"===Wa(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Ba(e){return(Ba=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Ua=wp.i18n.__,Va=wp.element,Ga=Va.Component,qa=Va.Fragment,Ka=(wp.blockEditor||wp.editor).ColorPalette,$a=wp.components,Za=$a.BaseControl,Qa=$a.ExternalLink,Xa=$a.PanelBody,er=$a.SelectControl,tr=$a.TextControl,nr=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Na(e,t)}(s,e);var t,n,a,r=Ia(s);function s(){return Ra(this,s),r.apply(this,arguments)}return t=s,(n=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-chart-type"],n=this.props.chart["visualizer-settings"];return wp.element.createElement(Xa,{title:Ua("Horizontal Axis Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(Xa,{title:Ua("General Settings"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(tr,{label:Ua("Axis Title"),help:Ua("The title of the horizontal axis."),value:n.hAxis.title,onChange:function(t){n.hAxis.title=t,e.props.edit(n)}}),wp.element.createElement(er,{label:Ua("Text Position"),help:Ua("Position of the horizontal axis text, relative to the chart area."),value:n.hAxis.textPosition?n.hAxis.textPosition:"out",options:[{label:Ua("Inside the chart"),value:"in"},{label:Ua("Outside the chart"),value:"out"},{label:Ua("None"),value:"none"}],onChange:function(t){n.hAxis.textPosition=t,e.props.edit(n)}}),wp.element.createElement(er,{label:Ua("Direction"),help:Ua("The direction in which the values along the horizontal axis grow."),value:n.hAxis.direction?n.hAxis.direction:"1",options:[{label:Ua("Identical Direction"),value:"1"},{label:Ua("Reverse Direction"),value:"-1"}],onChange:function(t){n.hAxis.direction=t,e.props.edit(n)}}),wp.element.createElement(Za,{label:Ua("Base Line Color")},wp.element.createElement(Ka,{value:n.hAxis.baselineColor,onChange:function(t){n.hAxis.baselineColor=t,e.props.edit(n)}})),wp.element.createElement(Za,{label:Ua("Axis Text Color")},wp.element.createElement(Ka,{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(qa,null,wp.element.createElement(tr,{label:Ua("Number Format"),help:Ua("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,Ua("For number axis labels, this is a subset of the formatting "),wp.element.createElement(Qa,{href:"http://icu-project.org/apiref/icu4c/classDecimalFormat.html#_details"},Ua("ICU pattern set.")),Ua(" 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,Ua("For date axis labels, this is a subset of the date formatting "),wp.element.createElement(Qa,{href:"http://userguide.icu-project.org/formatparse/datetime#TOC-Date-Time-Format-Syntax"},Ua("ICU date and time format."))))),-1>=["column"].indexOf(t)&&wp.element.createElement(qa,null,wp.element.createElement(Xa,{title:Ua("Grid Lines"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(tr,{label:Ua("Count"),help:Ua("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(Za,{label:Ua("Color")},wp.element.createElement(Ka,{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(Xa,{title:Ua("Minor Grid Lines"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(tr,{label:Ua("Count"),help:Ua("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(Za,{label:Ua("Color")},wp.element.createElement(Ka,{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(Xa,{title:Ua("View Window"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(tr,{label:Ua("Maximun Value"),help:Ua("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(tr,{label:Ua("Minimum Value"),help:Ua("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)}}))))}}])&&Fa(t.prototype,n),a&&Fa(t,a),s}(Ga);function ar(e){return(ar="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 rr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function sr(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function ir(e,t){return(ir=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function or(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=ur(e);if(t){var r=ur(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return lr(this,n)}}function lr(e,t){if(t&&("object"===ar(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function ur(e){return(ur=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var dr=wp.i18n.__,cr=wp.element,mr=cr.Component,_r=cr.Fragment,hr=(wp.blockEditor||wp.editor).ColorPalette,pr=wp.components,fr=pr.BaseControl,yr=pr.ExternalLink,Mr=pr.PanelBody,gr=pr.SelectControl,Lr=pr.TextControl,br=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ir(e,t)}(s,e);var t,n,a,r=or(s);function s(){return rr(this,s),r.apply(this,arguments)}return t=s,(n=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-chart-type"],n=this.props.chart["visualizer-settings"];return wp.element.createElement(Mr,{title:dr("Vertical Axis Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(Mr,{title:dr("General Settings"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Lr,{label:dr("Axis Title"),help:dr("The title of the Vertical axis."),value:n.vAxis.title,onChange:function(t){n.vAxis.title=t,e.props.edit(n)}}),wp.element.createElement(gr,{label:dr("Text Position"),help:dr("Position of the Vertical axis text, relative to the chart area."),value:n.vAxis.textPosition?n.vAxis.textPosition:"out",options:[{label:dr("Inside the chart"),value:"in"},{label:dr("Outside the chart"),value:"out"},{label:dr("None"),value:"none"}],onChange:function(t){n.vAxis.textPosition=t,e.props.edit(n)}}),wp.element.createElement(gr,{label:dr("Direction"),help:dr("The direction in which the values along the Vertical axis grow."),value:n.vAxis.direction?n.vAxis.direction:"1",options:[{label:dr("Identical Direction"),value:"1"},{label:dr("Reverse Direction"),value:"-1"}],onChange:function(t){n.vAxis.direction=t,e.props.edit(n)}}),wp.element.createElement(fr,{label:dr("Base Line Color")},wp.element.createElement(hr,{value:n.vAxis.baselineColor,onChange:function(t){n.vAxis.baselineColor=t,e.props.edit(n)}})),wp.element.createElement(fr,{label:dr("Axis Text Color")},wp.element.createElement(hr,{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(_r,null,wp.element.createElement(Lr,{label:dr("Number Format"),help:dr("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,dr("For number axis labels, this is a subset of the formatting "),wp.element.createElement(yr,{href:"http://icu-project.org/apiref/icu4c/classDecimalFormat.html#_details"},dr("ICU pattern set.")),dr(" 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,dr("For date axis labels, this is a subset of the date formatting "),wp.element.createElement(yr,{href:"http://userguide.icu-project.org/formatparse/datetime#TOC-Date-Time-Format-Syntax"},dr("ICU date and time format."))))),-1>=["bar"].indexOf(t)&&wp.element.createElement(_r,null,wp.element.createElement(Mr,{title:dr("Grid Lines"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Lr,{label:dr("Count"),help:dr("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(fr,{label:dr("Color")},wp.element.createElement(hr,{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(Mr,{title:dr("Minor Grid Lines"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Lr,{label:dr("Count"),help:dr("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(fr,{label:dr("Color")},wp.element.createElement(hr,{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(Mr,{title:dr("View Window"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Lr,{label:dr("Maximun Value"),help:dr("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(Lr,{label:dr("Minimum Value"),help:dr("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)}}))))}}])&&sr(t.prototype,n),a&&sr(t,a),s}(mr);function vr(e){return(vr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Yr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function wr(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function kr(e,t){return(kr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Dr(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=Sr(e);if(t){var r=Sr(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return Tr(this,n)}}function Tr(e,t){if(t&&("object"===vr(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Sr(e){return(Sr=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var jr=wp.i18n.__,Or=wp.element,xr=Or.Component,Hr=Or.Fragment,Er=(wp.blockEditor||wp.editor).ColorPalette,Pr=wp.components,Cr=Pr.BaseControl,zr=Pr.ExternalLink,Ar=Pr.PanelBody,Wr=Pr.SelectControl,Rr=Pr.TextControl,Fr=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&kr(e,t)}(s,e);var t,n,a,r=Dr(s);function s(){return Yr(this,s),r.apply(this,arguments)}return t=s,(n=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(Ar,{title:jr("Pie Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(Hr,null,wp.element.createElement(Rr,{label:jr("Number Format"),help:jr("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,jr("For number axis labels, this is a subset of the formatting "),wp.element.createElement(zr,{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(zr,{href:"http://userguide.icu-project.org/formatparse/datetime#TOC-Date-Time-Format-Syntax"},jr("ICU date and time format.")))),wp.element.createElement(Wr,{label:jr("Is 3D"),help:jr("If set to yes, displays a three-dimensional chart."),value:t.is3D?t.is3D:"0",options:[{label:jr("Yes"),value:"1"},{label:jr("No"),value:"0"}],onChange:function(n){t.is3D=n,e.props.edit(t)}}),wp.element.createElement(Wr,{label:jr("Reverse Categories"),help:jr("If set to yes, will draw slices counterclockwise."),value:t.reverseCategories?t.reverseCategories:"0",options:[{label:jr("Yes"),value:"1"},{label:jr("No"),value:"0"}],onChange:function(n){t.reverseCategories=n,e.props.edit(t)}}),wp.element.createElement(Wr,{label:jr("Slice Text"),help:jr("The content of the text displayed on the slice."),value:t.pieSliceText?t.pieSliceText:"percentage",options:[{label:jr("The percentage of the slice size out of the total"),value:"percentage"},{label:jr("The quantitative value of the slice"),value:"value"},{label:jr("The name of the slice"),value:"label"},{label:jr("The quantitative value and percentage of the slice"),value:"value-and-percentage"},{label:jr("No text is displayed"),value:"none"}],onChange:function(n){t.pieSliceText=n,e.props.edit(t)}}),wp.element.createElement(Rr,{label:jr("Pie Hole"),help:jr("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:jr("0.5"),value:t.pieHole,onChange:function(n){t.pieHole=n,e.props.edit(t)}}),wp.element.createElement(Rr,{label:jr("Start Angle"),help:jr("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(Cr,{label:jr("Slice Border Color")},wp.element.createElement(Er,{value:t.pieSliceBorderColor,onChange:function(n){t.pieSliceBorderColor=n,e.props.edit(t)}})))}}])&&wr(t.prototype,n),a&&wr(t,a),s}(xr);function Nr(e){return(Nr="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 Ir(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Jr(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function Br(e,t){return(Br=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Ur(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=Gr(e);if(t){var r=Gr(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return Vr(this,n)}}function Vr(e,t){if(t&&("object"===Nr(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Gr(e){return(Gr=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var qr=wp.i18n.__,Kr=wp.element.Component,$r=(wp.blockEditor||wp.editor).ColorPalette,Zr=wp.components,Qr=Zr.BaseControl,Xr=Zr.PanelBody,es=Zr.TextControl,ts=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Br(e,t)}(s,e);var t,n,a,r=Ur(s);function s(){return Ir(this,s),r.apply(this,arguments)}return t=s,(n=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(Xr,{title:qr("Residue Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(es,{label:qr("Visibility Threshold"),help:qr("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:qr("0.001388889"),value:t.sliceVisibilityThreshold,onChange:function(n){t.sliceVisibilityThreshold=n,e.props.edit(t)}}),wp.element.createElement(es,{label:qr("Residue Slice Label"),help:qr("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(Qr,{label:qr("Residue Slice Color")},wp.element.createElement($r,{value:t.pieResidueSliceColor,onChange:function(n){t.pieResidueSliceColor=n,e.props.edit(t)}})))}}])&&Jr(t.prototype,n),a&&Jr(t,a),s}(Kr);function ns(e){return(ns="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){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function rs(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function ss(e,t){return(ss=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function is(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=ls(e);if(t){var r=ls(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return os(this,n)}}function os(e,t){if(t&&("object"===ns(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function ls(e){return(ls=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var us=wp.i18n.__,ds=wp.element,cs=ds.Component,ms=ds.Fragment,_s=wp.components,hs=_s.PanelBody,ps=_s.SelectControl,fs=_s.TextControl,ys=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ss(e,t)}(s,e);var t,n,a,r=is(s);function s(){return as(this,s),r.apply(this,arguments)}return t=s,(n=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-chart-type"],n=this.props.chart["visualizer-settings"];return wp.element.createElement(hs,{title:us("Lines Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(fs,{label:us("Line Width"),help:us("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(fs,{label:us("Point Size"),help:us("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(ps,{label:us("Curve Type"),help:us("Determines whether the series has to be presented in the legend or not."),value:n.curveType?n.curveType:"none",options:[{label:us("Straight line without curve"),value:"none"},{label:us("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(ps,{label:us("Focus Target"),help:us("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:us("Focus on a single data point."),value:"datum"},{label:us("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(ps,{label:us("Selection Mode"),help:us("Determines how many data points an user can select on a chart."),value:n.selectionMode?n.selectionMode:"single",options:[{label:us("Single data point"),value:"single"},{label:us("Multiple data points"),value:"multiple"}],onChange:function(t){n.selectionMode=t,e.props.edit(n)}}),wp.element.createElement(ps,{label:us("Aggregation Target"),help:us("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:us("Group selected data by x-value"),value:"category"},{label:us("Group selected data by series"),value:"series"},{label:us("Group selected data by x-value if all selections have the same x-value, and by series otherwise"),value:"auto"},{label:us("Show only one tooltip per selection"),value:"none"}],onChange:function(t){n.aggregationTarget=t,e.props.edit(n)}}),wp.element.createElement(fs,{label:us("Point Opacity"),help:us("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(ms,null,wp.element.createElement(fs,{label:us("Area Opacity"),help:us("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(ps,{label:us("Is Stacked"),help:us("If set to yes, series elements are stacked."),value:n.isStacked?n.isStacked:"0",options:[{label:us("Yes"),value:"1"},{label:us("No"),value:"0"}],onChange:function(t){n.isStacked=t,e.props.edit(n)}})),-1>=["scatter","area"].indexOf(t)&&wp.element.createElement(ps,{label:us("Interpolate Nulls"),help:us("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:us("Yes"),value:"1"},{label:us("No"),value:"0"}],onChange:function(t){n.interpolateNulls=t,e.props.edit(n)}}))}}])&&rs(t.prototype,n),a&&rs(t,a),s}(cs);function Ms(e){return(Ms="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 gs(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ls(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function bs(e,t){return(bs=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function vs(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=ws(e);if(t){var r=ws(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return Ys(this,n)}}function Ys(e,t){if(t&&("object"===Ms(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function ws(e){return(ws=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var ks=wp.i18n.__,Ds=wp.element.Component,Ts=wp.components,Ss=Ts.PanelBody,js=Ts.SelectControl,Os=Ts.TextControl,xs=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&bs(e,t)}(s,e);var t,n,a,r=vs(s);function s(){return gs(this,s),r.apply(this,arguments)}return t=s,(n=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(Ss,{title:ks("Bars Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(js,{label:ks("Focus Target"),help:ks("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:ks("Focus on a single data point."),value:"datum"},{label:ks("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(js,{label:ks("Is Stacked"),help:ks("If set to yes, series elements are stacked."),value:t.isStacked?t.isStacked:"0",options:[{label:ks("Yes"),value:"1"},{label:ks("No"),value:"0"}],onChange:function(n){t.isStacked=n,e.props.edit(t)}}),wp.element.createElement(Os,{label:ks("Bars Opacity"),help:ks("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)}}))}}])&&Ls(t.prototype,n),a&&Ls(t,a),s}(Ds);function Hs(e){return(Hs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Es(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ps(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function Cs(e,t){return(Cs=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function zs(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=Ws(e);if(t){var r=Ws(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return As(this,n)}}function As(e,t){if(t&&("object"===Hs(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Ws(e){return(Ws=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Rs=wp.i18n.__,Fs=wp.element.Component,Ns=(wp.blockEditor||wp.editor).ColorPalette,Is=wp.components,Js=Is.BaseControl,Bs=Is.PanelBody,Us=Is.SelectControl,Vs=Is.TextControl,Gs=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Cs(e,t)}(s,e);var t,n,a,r=zs(s);function s(){return Es(this,s),r.apply(this,arguments)}return t=s,(n=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(Bs,{title:Rs("Candles Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(Bs,{title:Rs("General Settings"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Us,{label:Rs("Focus Target"),help:Rs("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:Rs("Focus on a single data point."),value:"datum"},{label:Rs("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(Us,{label:Rs("Selection Mode"),help:Rs("Determines how many data points an user can select on a chart."),value:t.selectionMode?t.selectionMode:"single",options:[{label:Rs("Single data point"),value:"single"},{label:Rs("Multiple data points"),value:"multiple"}],onChange:function(n){t.selectionMode=n,e.props.edit(t)}}),wp.element.createElement(Us,{label:Rs("Aggregation Target"),help:Rs("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:Rs("Group selected data by x-value"),value:"category"},{label:Rs("Group selected data by series"),value:"series"},{label:Rs("Group selected data by x-value if all selections have the same x-value, and by series otherwise"),value:"auto"},{label:Rs("Show only one tooltip per selection"),value:"none"}],onChange:function(n){t.aggregationTarget=n,e.props.edit(t)}})),wp.element.createElement(Bs,{title:Rs("Failing Candles"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Vs,{label:Rs("Stroke Width"),help:Rs("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(Js,{label:Rs("Stroke Color")},wp.element.createElement(Ns,{value:t.candlestick.fallingColor.stroke,onChange:function(n){t.candlestick.fallingColor.stroke=n,e.props.edit(t)}})),wp.element.createElement(Js,{label:Rs("Fill Color")},wp.element.createElement(Ns,{value:t.candlestick.fallingColor.fill,onChange:function(n){t.candlestick.fallingColor.fill=n,e.props.edit(t)}}))),wp.element.createElement(Bs,{title:Rs("Rising Candles"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Vs,{label:Rs("Stroke Width"),help:Rs("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(Js,{label:Rs("Stroke Color")},wp.element.createElement(Ns,{value:t.candlestick.risingColor.stroke,onChange:function(n){t.candlestick.risingColor.stroke=n,e.props.edit(t)}})),wp.element.createElement(Js,{label:Rs("Fill Color")},wp.element.createElement(Ns,{value:t.candlestick.risingColor.fill,onChange:function(n){t.candlestick.risingColor.fill=n,e.props.edit(t)}}))))}}])&&Ps(t.prototype,n),a&&Ps(t,a),s}(Fs);function qs(e){return(qs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ks(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $s(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function Zs(e,t){return(Zs=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Qs(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=ei(e);if(t){var r=ei(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return Xs(this,n)}}function Xs(e,t){if(t&&("object"===qs(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function ei(e){return(ei=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var ti=wp.i18n.__,ni=wp.element.Component,ai=wp.components,ri=ai.ExternalLink,si=ai.PanelBody,ii=ai.SelectControl,oi=ai.TextControl,li=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Zs(e,t)}(s,e);var t,n,a,r=Qs(s);function s(){return Ks(this,s),r.apply(this,arguments)}return t=s,(n=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(si,{title:ti("Map Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(si,{title:ti("API"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(oi,{label:ti("API Key"),help:ti("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(ri,{href:"https://developers.google.com/maps/documentation/javascript/get-api-key"},ti("Get API Keys"))),wp.element.createElement(si,{title:ti("Region"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement("ul",{className:"visualizer-list"},wp.element.createElement("li",null,ti("A map of the entire world using 'world'.")),wp.element.createElement("li",null,ti("A continent or a sub-continent, specified by its 3-digit code, e.g., '011' for Western Africa. "),wp.element.createElement(ri,{href:"https://google-developers.appspot.com/chart/interactive/docs/gallery/geochart#Continent_Hierarchy"},ti("More info here."))),wp.element.createElement("li",null,ti("A country, specified by its ISO 3166-1 alpha-2 code, e.g., 'AU' for Australia. "),wp.element.createElement(ri,{href:"http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2"},ti("More info here."))),wp.element.createElement("li",null,ti("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(ri,{href:"http://en.wikipedia.org/wiki/ISO_3166-2:US"},ti("More info here.")))),wp.element.createElement(oi,{label:ti("Reigion"),help:ti("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(si,{title:ti("Resolution"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement("ul",{className:"visualizer-list"},wp.element.createElement("li",null,ti("'countries' - Supported for all regions, except for US state regions.")),wp.element.createElement("li",null,ti("'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,ti("'metros' - Supported for the US country region and US state regions only."))),wp.element.createElement(ii,{label:ti("Resolution"),help:ti("The resolution of the map borders."),value:t.resolution?t.resolution:"countries",options:[{label:ti("Countries"),value:"countries"},{label:ti("Provinces"),value:"provinces"},{label:ti("Metros"),value:"metros"}],onChange:function(n){t.resolution=n,e.props.edit(t)}})),wp.element.createElement(si,{title:ti("Display Mode"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement("ul",{className:"visualizer-list"},wp.element.createElement("li",null,ti("'auto' - Choose based on the format of the data.")),wp.element.createElement("li",null,ti("'regions' - This is a region map.")),wp.element.createElement("li",null,ti("'markers' - This is a marker map."))),wp.element.createElement(ii,{label:ti("Display Mode"),help:ti("Determines which type of map this is."),value:t.displayMode?t.displayMode:"auto",options:[{label:ti("Auto"),value:"auto"},{label:ti("Regions"),value:"regions"},{label:ti("Markers"),value:"markers"}],onChange:function(n){t.displayMode=n,e.props.edit(t)}})),wp.element.createElement(si,{title:ti("Tooltip"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(ii,{label:ti("Trigger"),help:ti("Determines the user interaction that causes the tooltip to be displayed."),value:t.tooltip.trigger?t.tooltip.trigger:"focus",options:[{label:ti("The tooltip will be displayed when the user hovers over an element"),value:"focus"},{label:ti("The tooltip will not be displayed"),value:"none"}],onChange:function(n){t.tooltip.trigger=n,e.props.edit(t)}})))}}])&&$s(t.prototype,n),a&&$s(t,a),s}(ni);function ui(e){return(ui="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 di(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ci(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function mi(e,t){return(mi=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function _i(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=pi(e);if(t){var r=pi(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return hi(this,n)}}function hi(e,t){if(t&&("object"===ui(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function pi(e){return(pi=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var fi=wp.i18n.__,yi=wp.element.Component,Mi=(wp.blockEditor||wp.editor).ColorPalette,gi=wp.components,Li=gi.BaseControl,bi=gi.PanelBody,vi=gi.TextControl,Yi=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&mi(e,t)}(s,e);var t,n,a,r=_i(s);function s(){return di(this,s),r.apply(this,arguments)}return t=s,(n=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(bi,{title:fi("Color Axis"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(vi,{label:fi("Minimum Values"),help:fi("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(vi,{label:fi("Maximum Values"),help:fi("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(Li,{label:fi("Minimum Value")},wp.element.createElement(Mi,{value:t.colorAxis.colors[0],onChange:function(n){t.colorAxis.colors[0]=n,e.props.edit(t)}})),wp.element.createElement(Li,{label:fi("Intermediate Value")},wp.element.createElement(Mi,{value:t.colorAxis.colors[1],onChange:function(n){t.colorAxis.colors[1]=n,e.props.edit(t)}})),wp.element.createElement(Li,{label:fi("Maximum Value")},wp.element.createElement(Mi,{value:t.colorAxis.colors[2],onChange:function(n){t.colorAxis.colors[2]=n,e.props.edit(t)}})),wp.element.createElement(Li,{label:fi("Dateless Region")},wp.element.createElement(Mi,{value:t.datalessRegionColor,onChange:function(n){t.datalessRegionColor=n,e.props.edit(t)}})))}}])&&ci(t.prototype,n),a&&ci(t,a),s}(yi);function wi(e){return(wi="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 ki(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Di(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function Ti(e,t){return(Ti=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Si(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=Oi(e);if(t){var r=Oi(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return ji(this,n)}}function ji(e,t){if(t&&("object"===wi(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Oi(e){return(Oi=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var xi=wp.i18n.__,Hi=wp.element,Ei=Hi.Component,Pi=Hi.Fragment,Ci=wp.components,zi=Ci.ExternalLink,Ai=Ci.PanelBody,Wi=Ci.TextControl,Ri=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ti(e,t)}(s,e);var t,n,a,r=Si(s);function s(){return ki(this,s),r.apply(this,arguments)}return t=s,(n=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(Ai,{title:xi("Size Axis"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(Wi,{label:xi("Minimum Values"),help:xi("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(Wi,{label:xi("Maximum Values"),help:xi("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(Wi,{label:xi("Minimum Marker Radius"),help:xi("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(Wi,{label:xi("Maximum Marker Radius"),help:xi("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(Wi,{label:xi("Marker Opacity"),help:xi("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(Pi,null,wp.element.createElement(Wi,{label:xi("Number Format"),help:xi("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,xi("For number axis labels, this is a subset of the formatting "),wp.element.createElement(zi,{href:"http://icu-project.org/apiref/icu4c/classDecimalFormat.html#_details"},xi("ICU pattern set.")),xi(" 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."))))}}])&&Di(t.prototype,n),a&&Di(t,a),s}(Ei);function Fi(e){return(Fi="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 Ni(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ii(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function Ji(e,t){return(Ji=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Bi(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=Vi(e);if(t){var r=Vi(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return Ui(this,n)}}function Ui(e,t){if(t&&("object"===Fi(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Vi(e){return(Vi=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Gi=wp.i18n.__,qi=wp.element.Component,Ki=wp.components,$i=Ki.PanelBody,Zi=Ki.SelectControl,Qi=Ki.TextControl,Xi=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ji(e,t)}(s,e);var t,n,a,r=Bi(s);function s(){return Ni(this,s),r.apply(this,arguments)}return t=s,(n=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement($i,{title:Gi("Magnifying Glass"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(Zi,{label:Gi("Enabled"),help:Gi("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:Gi("Yes"),value:"1"},{label:Gi("No"),value:"0"}],onChange:function(n){t.magnifyingGlass.enable=n,e.props.edit(t)}}),wp.element.createElement(Qi,{label:Gi("Zoom Factor"),help:Gi("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)}}))}}])&&Ii(t.prototype,n),a&&Ii(t,a),s}(qi);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 to(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function no(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function ao(e,t){return(ao=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ro(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=io(e);if(t){var r=io(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return so(this,n)}}function so(e,t){if(t&&("object"===eo(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function io(e){return(io=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var oo=wp.i18n.__,lo=wp.element,uo=lo.Component,co=lo.Fragment,mo=(wp.blockEditor||wp.editor).ColorPalette,_o=wp.components,ho=_o.BaseControl,po=_o.ExternalLink,fo=_o.PanelBody,yo=_o.TextControl,Mo=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ao(e,t)}(s,e);var t,n,a,r=ro(s);function s(){return to(this,s),r.apply(this,arguments)}return t=s,(n=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(fo,{title:oo("Gauge Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(fo,{title:oo("Tick Settings"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(yo,{label:oo("Minimum Values"),help:oo("Determines the minimum values of gauge."),value:t.min,onChange:function(n){t.min=n,e.props.edit(t)}}),wp.element.createElement(yo,{label:oo("Maximum Values"),help:oo("Determines the maximum values of gauge."),value:t.max,onChange:function(n){t.max=n,e.props.edit(t)}}),wp.element.createElement(yo,{label:oo("Minor Ticks"),help:oo("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:oo("Number Format"),help:oo("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,oo("For number axis labels, this is a subset of the formatting "),wp.element.createElement(po,{href:"http://icu-project.org/apiref/icu4c/classDecimalFormat.html#_details"},oo("ICU pattern set.")),oo(" 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(fo,{title:oo("Green Color"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(yo,{label:oo("Minimum Range"),help:oo("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:oo("Maximum Range"),help:oo("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:oo("Green Color")},wp.element.createElement(mo,{value:t.greenColor,onChange:function(n){t.greenColor=n,e.props.edit(t)}}))),wp.element.createElement(fo,{title:oo("Yellow Color"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(yo,{label:oo("Minimum Range"),help:oo("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:oo("Maximum Range"),help:oo("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:oo("Yellow Color")},wp.element.createElement(mo,{value:t.yellowColor,onChange:function(n){t.yellowColor=n,e.props.edit(t)}}))),wp.element.createElement(fo,{title:oo("Red Color"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(yo,{label:oo("Minimum Range"),help:oo("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:oo("Maximum Range"),help:oo("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:oo("Red Color")},wp.element.createElement(mo,{value:t.redColor,onChange:function(n){t.redColor=n,e.props.edit(t)}}))))}}])&&no(t.prototype,n),a&&no(t,a),s}(uo);function go(e){return(go="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 Lo(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function bo(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function vo(e,t){return(vo=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Yo(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=Do(e);if(t){var r=Do(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return wo(this,n)}}function wo(e,t){if(t&&("object"===go(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return ko(e)}function ko(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Do(e){return(Do=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var To=wp.i18n.__,So=wp.element.Component,jo=(wp.blockEditor||wp.editor).ColorPalette,Oo=wp.components,xo=Oo.BaseControl,Ho=Oo.CheckboxControl,Eo=Oo.PanelBody,Po=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&vo(e,t)}(s,e);var t,n,a,r=Yo(s);function s(){var e;return Lo(this,s),(e=r.apply(this,arguments)).mapValues=e.mapValues.bind(ko(e)),e}return t=s,(n=[{key:"mapValues",value:function(e,t){return void 0===e.timeline?e[t]:e.timeline[t]}},{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return this.mapValues(t,"showRowLabels"),wp.element.createElement(Eo,{title:To("Timeline Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(Ho,{label:To("Show Row Label"),help:To("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(Ho,{label:To("Group by Row Label"),help:To("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(Ho,{label:To("Color by Row Label"),help:To("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(xo,{label:To("Single Color")},wp.element.createElement(jo,{value:this.mapValues(t,"singleColor"),onChange:function(n){void 0===t.timeline&&(t.timeline={}),t.timeline.singleColor=n,e.props.edit(t)}})))}}])&&bo(t.prototype,n),a&&bo(t,a),s}(So);function Co(e){return(Co="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 zo(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ao(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function Wo(e,t){return(Wo=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Ro(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=No(e);if(t){var r=No(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return Fo(this,n)}}function Fo(e,t){if(t&&("object"===Co(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function No(e){return(No=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Io=wp.i18n.__,Jo=wp.element,Bo=Jo.Component,Uo=Jo.Fragment,Vo=wp.components,Go=Vo.CheckboxControl,qo=Vo.PanelBody,Ko=Vo.SelectControl,$o=Vo.TextControl,Zo=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Wo(e,t)}(s,e);var t,n,a,r=Ro(s);function s(){return zo(this,s),r.apply(this,arguments)}return t=s,(n=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"],n=(this.props.chart["visualizer-chart-type"],this.props.chart["visualizer-chart-library"]);return wp.element.createElement(qo,{title:Io("Table Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},"DataTable"===n?wp.element.createElement(Uo,null,wp.element.createElement(Go,{label:Io("Enable Pagination"),help:Io("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($o,{label:Io("Number of rows per page"),help:Io("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(Ko,{label:Io("Pagination type"),help:Io("Determines what type of pagination options to show."),value:t.pagingType,options:[{label:Io("Page number buttons only"),value:"numbers"},{label:Io("'Previous' and 'Next' buttons only"),value:"simple"},{label:Io("'Previous' and 'Next' buttons, plus page numbers"),value:"simple_numbers"},{label:Io("'First', 'Previous', 'Next' and 'Last' buttons"),value:"full"},{label:Io("'First', 'Previous', 'Next' and 'Last' buttons, plus page numbers"),value:"full_numbers"},{label:Io("'First' and 'Last' buttons, plus page numbers"),value:"first_last_numbers"}],onChange:function(n){t.pagingType=n,e.props.edit(t)}}),wp.element.createElement(Go,{label:Io("Scroll Collapse"),help:Io("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($o,{label:Io("Vertical Height"),help:Io("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(Go,{label:Io("Disable Sort"),help:Io("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(Go,{label:Io("Freeze Header/Footer"),help:Io("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(Go,{label:Io("Responsive"),help:Io("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(Uo,null,wp.element.createElement(Ko,{label:Io("Enable Pagination"),help:Io("To enable paging through the data."),value:t.page?t.page:"disable",options:[{label:Io("Enable"),value:"enable"},{label:Io("Disable"),value:"disable"}],onChange:function(n){t.page=n,e.props.edit(t)}}),wp.element.createElement($o,{label:Io("Number of rows per page"),help:Io("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(Ko,{label:Io("Disable Sort"),help:Io("To disable sorting on columns."),value:t.sort?t.sort:"enable",options:[{label:Io("Enable"),value:"enable"},{label:Io("Disable"),value:"disable"}],onChange:function(n){t.sort=n,e.props.edit(t)}}),wp.element.createElement($o,{label:Io("Freeze Columns"),help:Io("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(Go,{label:Io("Allow HTML"),help:Io("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(Go,{label:Io("Right to Left table"),help:Io("Adds basic support for right-to-left languages."),checked:Number(t.rtlTable),onChange:function(n){t.rtlTable=!Number(t.rtlTable),e.props.edit(t)}})))}}])&&Ao(t.prototype,n),a&&Ao(t,a),s}(Bo);function Qo(e){return(Qo="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 Xo(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function el(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function tl(e,t){return(tl=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function nl(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=rl(e);if(t){var r=rl(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return al(this,n)}}function al(e,t){if(t&&("object"===Qo(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function rl(e){return(rl=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var sl=wp.i18n.__,il=wp.element,ol=il.Component,ll=il.Fragment,ul=(wp.blockEditor||wp.editor).ColorPalette,dl=wp.components,cl=dl.BaseControl,ml=dl.PanelBody,_l=dl.TextControl,hl=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&tl(e,t)}(s,e);var t,n,a,r=nl(s);function s(){return Xo(this,s),r.apply(this,arguments)}return t=s,(n=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"],n=(this.props.chart["visualizer-chart-type"],this.props.chart["visualizer-chart-library"]);return wp.element.createElement(ml,{title:sl("Row/Cell Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},"DataTable"===n?wp.element.createElement(ll,null,wp.element.createElement(ml,{title:sl("Odd Table Row"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(cl,{label:sl("Background Color")},wp.element.createElement(ul,{value:t.customcss.oddTableRow["background-color"],onChange:function(n){t.customcss.oddTableRow["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(cl,{label:sl("Color")},wp.element.createElement(ul,{value:t.customcss.oddTableRow.color,onChange:function(n){t.customcss.oddTableRow.color=n,e.props.edit(t)}})),wp.element.createElement(_l,{label:sl("Text Orientation"),help:sl("In degrees."),type:"number",value:t.customcss.oddTableRow.transform,onChange:function(n){t.customcss.oddTableRow.transform=n,e.props.edit(t)}})),wp.element.createElement(ml,{title:sl("Even Table Row"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(cl,{label:sl("Background Color")},wp.element.createElement(ul,{value:t.customcss.evenTableRow["background-color"],onChange:function(n){t.customcss.evenTableRow["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(cl,{label:sl("Color")},wp.element.createElement(ul,{value:t.customcss.evenTableRow.color,onChange:function(n){t.customcss.evenTableRow.color=n,e.props.edit(t)}})),wp.element.createElement(_l,{label:sl("Text Orientation"),help:sl("In degrees."),type:"number",value:t.customcss.evenTableRow.transform,onChange:function(n){t.customcss.evenTableRow.transform=n,e.props.edit(t)}})),wp.element.createElement(ml,{title:sl("Table Cell"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(cl,{label:sl("Background Color")},wp.element.createElement(ul,{value:t.customcss.tableCell["background-color"],onChange:function(n){t.customcss.tableCell["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(cl,{label:sl("Color")},wp.element.createElement(ul,{value:t.customcss.tableCell.color,onChange:function(n){t.customcss.tableCell.color=n,e.props.edit(t)}})),wp.element.createElement(_l,{label:sl("Text Orientation"),help:sl("In degrees."),type:"number",value:t.customcss.tableCell.transform,onChange:function(n){t.customcss.tableCell.transform=n,e.props.edit(t)}}))):wp.element.createElement(ll,null,wp.element.createElement(ml,{title:sl("Header Row"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(cl,{label:sl("Background Color")},wp.element.createElement(ul,{value:t.customcss.headerRow["background-color"],onChange:function(n){t.customcss.headerRow["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(cl,{label:sl("Color")},wp.element.createElement(ul,{value:t.customcss.headerRow.color,onChange:function(n){t.customcss.headerRow.color=n,e.props.edit(t)}})),wp.element.createElement(_l,{label:sl("Text Orientation"),help:sl("In degrees."),type:"number",value:t.customcss.headerRow.transform,onChange:function(n){t.customcss.headerRow.transform=n,e.props.edit(t)}})),wp.element.createElement(ml,{title:sl("Table Row"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(cl,{label:sl("Background Color")},wp.element.createElement(ul,{value:t.customcss.tableRow["background-color"],onChange:function(n){t.customcss.tableRow["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(cl,{label:sl("Color")},wp.element.createElement(ul,{value:t.customcss.tableRow.color,onChange:function(n){t.customcss.tableRow.color=n,e.props.edit(t)}})),wp.element.createElement(_l,{label:sl("Text Orientation"),help:sl("In degrees."),type:"number",value:t.customcss.tableRow.transform,onChange:function(n){t.customcss.tableRow.transform=n,e.props.edit(t)}})),wp.element.createElement(ml,{title:sl("Odd Table Row"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(cl,{label:sl("Background Color")},wp.element.createElement(ul,{value:t.customcss.oddTableRow["background-color"],onChange:function(n){t.customcss.oddTableRow["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(cl,{label:sl("Color")},wp.element.createElement(ul,{value:t.customcss.oddTableRow.color,onChange:function(n){t.customcss.oddTableRow.color=n,e.props.edit(t)}})),wp.element.createElement(_l,{label:sl("Text Orientation"),help:sl("In degrees."),type:"number",value:t.customcss.oddTableRow.transform,onChange:function(n){t.customcss.oddTableRow.transform=n,e.props.edit(t)}})),wp.element.createElement(ml,{title:sl("Selected Table Row"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(cl,{label:sl("Background Color")},wp.element.createElement(ul,{value:t.customcss.selectedTableRow["background-color"],onChange:function(n){t.customcss.selectedTableRow["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(cl,{label:sl("Color")},wp.element.createElement(ul,{value:t.customcss.selectedTableRow.color,onChange:function(n){t.customcss.selectedTableRow.color=n,e.props.edit(t)}})),wp.element.createElement(_l,{label:sl("Text Orientation"),help:sl("In degrees."),type:"number",value:t.customcss.selectedTableRow.transform,onChange:function(n){t.customcss.selectedTableRow.transform=n,e.props.edit(t)}})),wp.element.createElement(ml,{title:sl("Hover Table Row"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(cl,{label:sl("Background Color")},wp.element.createElement(ul,{value:t.customcss.hoverTableRow["background-color"],onChange:function(n){t.customcss.hoverTableRow["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(cl,{label:sl("Color")},wp.element.createElement(ul,{value:t.customcss.hoverTableRow.color,onChange:function(n){t.customcss.hoverTableRow.color=n,e.props.edit(t)}})),wp.element.createElement(_l,{label:sl("Text Orientation"),help:sl("In degrees."),type:"number",value:t.customcss.hoverTableRow.transform,onChange:function(n){t.customcss.hoverTableRow.transform=n,e.props.edit(t)}})),wp.element.createElement(ml,{title:sl("Header Cell"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(cl,{label:sl("Background Color")},wp.element.createElement(ul,{value:t.customcss.headerCell["background-color"],onChange:function(n){t.customcss.headerCell["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(cl,{label:sl("Color")},wp.element.createElement(ul,{value:t.customcss.headerCell.color,onChange:function(n){t.customcss.headerCell.color=n,e.props.edit(t)}})),wp.element.createElement(_l,{label:sl("Text Orientation"),help:sl("In degrees."),type:"number",value:t.customcss.headerCell.transform,onChange:function(n){t.customcss.headerCell.transform=n,e.props.edit(t)}})),wp.element.createElement(ml,{title:sl("Table Cell"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(cl,{label:sl("Background Color")},wp.element.createElement(ul,{value:t.customcss.tableCell["background-color"],onChange:function(n){t.customcss.tableCell["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(cl,{label:sl("Color")},wp.element.createElement(ul,{value:t.customcss.tableCell.color,onChange:function(n){t.customcss.tableCell.color=n,e.props.edit(t)}})),wp.element.createElement(_l,{label:sl("Text Orientation"),help:sl("In degrees."),type:"number",value:t.customcss.tableCell.transform,onChange:function(n){t.customcss.tableCell.transform=n,e.props.edit(t)}}))))}}])&&el(t.prototype,n),a&&el(t,a),s}(ol);function pl(e){return(pl="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 fl(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function yl(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function Ml(e,t){return(Ml=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function gl(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=bl(e);if(t){var r=bl(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return Ll(this,n)}}function Ll(e,t){if(t&&("object"===pl(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function bl(e){return(bl=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var vl=wp.i18n.__,Yl=wp.element.Component,wl=wp.components,kl=wl.PanelBody,Dl=wl.SelectControl,Tl=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ml(e,t)}(s,e);var t,n,a,r=gl(s);function s(){return fl(this,s),r.apply(this,arguments)}return t=s,(n=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(kl,{title:vl("Combo Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(Dl,{label:vl("Chart Type"),help:vl("Select the default chart type."),value:t.seriesType?t.seriesType:"area",options:[{label:vl("Area"),value:"area"},{label:vl("Bar"),value:"bars"},{label:vl("Candlesticks"),value:"candlesticks"},{label:vl("Line"),value:"line"},{label:vl("Stepped Area"),value:"steppedArea"}],onChange:function(n){t.seriesType=n,e.props.edit(t)}}))}}])&&yl(t.prototype,n),a&&yl(t,a),s}(Yl);function Sl(e){return(Sl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function jl(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ol(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function xl(e,t){return(xl=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Hl(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=Pl(e);if(t){var r=Pl(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return El(this,n)}}function El(e,t){if(t&&("object"===Sl(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Pl(e){return(Pl=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Cl=wp.i18n.__,zl=wp.element,Al=zl.Component,Wl=zl.Fragment,Rl=(wp.blockEditor||wp.editor).ColorPalette,Fl=wp.components,Nl=Fl.BaseControl,Il=Fl.ExternalLink,Jl=Fl.PanelBody,Bl=Fl.SelectControl,Ul=Fl.TextControl,Vl=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&xl(e,t)}(s,e);var t,n,a,r=Hl(s);function s(){return jl(this,s),r.apply(this,arguments)}return t=s,(n=[{key:"componentDidMount",value:function(){var e=this.props.chart["visualizer-settings"];Object.keys(e.series).map((function(t){void 0!==e.series[t]&&(e.series[t].temp=1)})),this.props.edit(e)}},{key:"render",value:function(){var e=this,t=(this.props.chart["visualizer-chart-type"],this.props.chart["visualizer-settings"]),n=this.props.chart["visualizer-series"];return wp.element.createElement(Jl,{title:Cl("Series Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},Object.keys(t.series).map((function(a,r){var s=parseInt(a),i=n[a].label||"",o=n[a].type||"",l=0;return"tabular"!==o&&(s=r),a++,wp.element.createElement(Jl,{title:i,className:"visualizer-inner-sections",initialOpen:!1},-1>=["tabular","pie"].indexOf(o)&&wp.element.createElement(Bl,{label:Cl("Visible In Legend"),help:Cl("Determines whether the series has to be presented in the legend or not."),value:t.series[r].visibleInLegend?t.series[r].visibleInLegend:"1",options:[{label:Cl("Yes"),value:"1"},{label:Cl("No"),value:"0"}],onChange:function(n){t.series[r].visibleInLegend=n,e.props.edit(t)}}),-1>=["tabular","candlestick","combo","column","bar"].indexOf(o)&&wp.element.createElement(Wl,null,wp.element.createElement(Ul,{label:Cl("Line Width"),help:Cl("Overrides the global line width value for this series."),value:t.series[r].lineWidth,onChange:function(n){t.series[r].lineWidth=n,e.props.edit(t)},onKeyUp:function(n){clearTimeout(l),l=setTimeout((function(){""!=t.series[r].lineWidth&&0>=t.series[r].lineWidth&&(t.series[r].lineWidth="0.1",e.props.edit(t))}),700)}}),wp.element.createElement(Ul,{label:Cl("Point Size"),help:Cl("Overrides the global point size value for this series."),value:t.series[r].pointSize,onChange:function(n){t.series[r].pointSize=n,e.props.edit(t)}})),-1>=["candlestick"].indexOf(o)&&o&&"number"===o?wp.element.createElement(Wl,null,wp.element.createElement(Ul,{label:Cl("Format"),help:Cl("Enter custom format pattern to apply to this series value."),value:t.series[s].format,onChange:function(n){t.series[s].format=n,e.props.edit(t)}}),wp.element.createElement("p",null,Cl("For number axis labels, this is a subset of the formatting "),wp.element.createElement(Il,{href:"http://icu-project.org/apiref/icu4c/classDecimalFormat.html#_details"},Cl("ICU pattern set.")),Cl(" 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(o)&&wp.element.createElement(Wl,null,wp.element.createElement(Ul,{label:Cl("Date Format"),help:Cl("Enter custom format pattern to apply to this series value."),placeholder:"dd LLLL yyyy",value:t.series[s].format,onChange:function(n){t.series[s].format=n,e.props.edit(t)}}),wp.element.createElement("p",null,Cl("This is a subset of the date formatting "),wp.element.createElement(Il,{href:"http://userguide.icu-project.org/formatparse/datetime#TOC-Date-Time-Format-Syntax"},Cl("ICU date and time format.")))),0<=["scatter","line"].indexOf(o)&&wp.element.createElement(Bl,{label:Cl("Curve Type"),help:Cl("Determines whether the series has to be presented in the legend or not."),value:t.series[r].curveType?t.series[r].curveType:"none",options:[{label:Cl("Straight line without curve"),value:"none"},{label:Cl("The angles of the line will be smoothed"),value:"function"}],onChange:function(n){t.series[r].curveType=n,e.props.edit(t)}}),0<=["area"].indexOf(o)&&wp.element.createElement(Ul,{label:Cl("Area Opacity"),help:Cl("The opacity of the colored area, where 0.0 is fully transparent and 1.0 is fully opaque."),value:t.series[r].areaOpacity,onChange:function(n){t.series[r].areaOpacity=n,e.props.edit(t)}}),0<=["combo"].indexOf(o)&&wp.element.createElement(Bl,{label:Cl("Chart Type"),help:Cl("Select the type of chart to show for this series."),value:t.series[r].type?t.series[r].type:"area",options:[{label:Cl("Area"),value:"area"},{label:Cl("Bar"),value:"bars"},{label:Cl("Candlesticks"),value:"candlesticks"},{label:Cl("Line"),value:"line"},{label:Cl("Stepped Area"),value:"steppedArea"}],onChange:function(n){t.series[r].type=n,e.props.edit(t)}}),-1>=["tabular"].indexOf(o)&&wp.element.createElement(Nl,{label:Cl("Color")},wp.element.createElement(Rl,{value:t.series[r].color,onChange:function(n){t.series[r].color=n,e.props.edit(t)}})))})))}}])&&Ol(t.prototype,n),a&&Ol(t,a),s}(Al);function Gl(e){return(Gl="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 ql(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Kl(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function $l(e,t){return($l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Zl(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=Xl(e);if(t){var r=Xl(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return Ql(this,n)}}function Ql(e,t){if(t&&("object"===Gl(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Xl(e){return(Xl=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var eu=wp.i18n.__,tu=wp.element.Component,nu=(wp.blockEditor||wp.editor).ColorPalette,au=wp.components,ru=au.BaseControl,su=au.PanelBody,iu=au.TextControl,ou=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&$l(e,t)}(s,e);var t,n,a,r=Zl(s);function s(){return ql(this,s),r.apply(this,arguments)}return t=s,(n=[{key:"componentDidMount",value:function(){var e=this.props.chart["visualizer-settings"];Object.keys(e.slices).map((function(t){void 0!==e.slices[t]&&(e.slices[t].temp=1)})),this.props.edit(e)}},{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"],n=this.props.chart["visualizer-data"];return wp.element.createElement(su,{title:eu("Slices Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},Object.keys(t.slices).map((function(a){return wp.element.createElement(su,{title:n[a][0],className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(iu,{label:eu("Slice Offset"),help:eu("How far to separate the slice from the rest of the pie, from 0.0 (not at all) to 1.0 (the pie's radius)."),value:t.slices[a].offset,onChange:function(n){t.slices[a].offset=n,e.props.edit(t)},type:"number",min:"0",step:"0.1"}),wp.element.createElement(ru,{label:eu("Format")},wp.element.createElement(nu,{value:t.slices[a].color,onChange:function(n){t.slices[a].color=n,e.props.edit(t)}})))})))}}])&&Kl(t.prototype,n),a&&Kl(t,a),s}(tu);function lu(e){return(lu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function uu(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function du(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function cu(e,t){return(cu=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function mu(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=hu(e);if(t){var r=hu(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return _u(this,n)}}function _u(e,t){if(t&&("object"===lu(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function hu(e){return(hu=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var pu=wp.i18n.__,fu=wp.element.Component,yu=(wp.blockEditor||wp.editor).ColorPalette,Mu=wp.components,gu=Mu.CheckboxControl,Lu=Mu.BaseControl,bu=Mu.PanelBody,vu=Mu.TextControl,Yu=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&cu(e,t)}(s,e);var t,n,a,r=mu(s);function s(){return uu(this,s),r.apply(this,arguments)}return t=s,(n=[{key:"componentDidMount",value:function(){}},{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(bu,{title:pu("Bubble Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(vu,{label:pu("Opacity"),help:pu("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(Lu,{label:pu("Stroke Color")},wp.element.createElement(yu,{value:t.bubble.stroke,onChange:function(n){t.bubble||(t.bubble={}),t.bubble.stroke=n,e.props.edit(t)}})),wp.element.createElement(gu,{label:pu("Sort Bubbles by Size"),help:pu("If checked, sorts the bubbles by size so the smaller bubbles appear above the larger bubbles. If unchecked, bubbles are sorted according to their order in the table."),checked:Q(t,"sortBubblesBySize"),onChange:function(n){t.sortBubblesBySize=n,e.props.edit(t)}}),wp.element.createElement(vu,{label:pu("Size (max)"),help:pu("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(vu,{label:pu("Size (min)"),help:pu("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)}}))}}])&&du(t.prototype,n),a&&du(t,a),s}(fu);function wu(e){return(wu="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 ku(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Du(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function Tu(e,t){return(Tu=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Su(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=Ou(e);if(t){var r=Ou(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return ju(this,n)}}function ju(e,t){if(t&&("object"===wu(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Ou(e){return(Ou=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var xu=wp.i18n.__,Hu=wp.element,Eu=Hu.Component,Pu=Hu.Fragment,Cu=wp.components,zu=Cu.ExternalLink,Au=Cu.PanelBody,Wu=Cu.TextControl,Ru=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Tu(e,t)}(s,e);var t,n,a,r=Su(s);function s(){return ku(this,s),r.apply(this,arguments)}return t=s,(n=[{key:"componentDidMount",value:function(){var e=this.props.chart["visualizer-settings"];e.series&&(Object.keys(e.series).map((function(t){void 0!==e.series[t]&&(e.series[t].temp=1)})),this.props.edit(e))}},{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"],n=this.props.chart["visualizer-series"];return this.props.chart["visualizer-chart-type"],t.series?wp.element.createElement(Au,{title:xu("Column Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},Object.keys(t.series).map((function(a){return"string"===n[a].type?null:wp.element.createElement(Au,{title:n[a].label,className:"visualizer-inner-sections",initialOpen:!1},0<=["date","datetime","timeofday"].indexOf(n[a].type)&&wp.element.createElement(Pu,null,wp.element.createElement(Wu,{label:xu("Display Date Format"),help:xu("Enter custom format pattern to apply to this series value."),value:t.series[a].format?t.series[a].format.to:"",onChange:function(n){t.series[a].format||(t.series[a].format={}),t.series[a].format.to=n,e.props.edit(t)}}),wp.element.createElement(Wu,{label:xu("Source Date Format"),help:xu("What format is the source date in?"),value:t.series[a].format?t.series[a].format.from:"",onChange:function(n){t.series[a].format||(t.series[a].format={}),t.series[a].format.from=n,e.props.edit(t)}}),wp.element.createElement("p",null,xu("You can find more info on "),wp.element.createElement(zu,{href:"https://momentjs.com/docs/#/displaying/"},xu("date and time formats here.")))),"number"===n[a].type&&wp.element.createElement(Pu,null,wp.element.createElement(Wu,{label:xu("Thousands Separator"),value:t.series[a].format?t.series[a].format.thousands:"",onChange:function(n){t.series[a].format||(t.series[a].format={}),t.series[a].format.thousands=n,e.props.edit(t)}}),wp.element.createElement(Wu,{label:xu("Decimal Separator"),value:t.series[a].format?t.series[a].format.decimal:"",onChange:function(n){t.series[a].format||(t.series[a].format={}),t.series[a].format.decimal=n,e.props.edit(t)}}),wp.element.createElement(Wu,{label:xu("Precision"),help:xu("Round values to how many decimal places?"),value:t.series[a].format?t.series[a].format.precision:"",type:"number",min:"0",onChange:function(n){100<n||(t.series[a].format||(t.series[a].format={}),t.series[a].format.precision=n,e.props.edit(t))}}),wp.element.createElement(Wu,{label:xu("Prefix"),value:t.series[a].format?t.series[a].format.prefix:"",onChange:function(n){t.series[a].format||(t.series[a].format={}),t.series[a].format.prefix=n,e.props.edit(t)}}),wp.element.createElement(Wu,{label:xu("Suffix"),value:t.series[a].format?t.series[a].format.suffix:"",onChange:function(n){t.series[a].format||(t.series[a].format={}),t.series[a].format.suffix=n,e.props.edit(t)}})),"boolean"===n[a].type&&wp.element.createElement(Pu,null,wp.element.createElement(Wu,{label:xu("Truthy value"),help:xu("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[a].format?t.series[a].format.truthy:"",onChange:function(n){t.series[a].truthy||(t.series[a].truthy={}),t.series[a].format.truthy=n,e.props.edit(t)}}),wp.element.createElement(Wu,{label:xu("Falsy value"),help:xu("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[a].format?t.series[a].format.falsy:"",onChange:function(n){t.series[a].falsy||(t.series[a].falsy={}),t.series[a].format.falsy=n,e.props.edit(t)}})))}))):null}}])&&Du(t.prototype,n),a&&Du(t,a),s}(Eu);function Fu(e){return(Fu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Nu(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Iu(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function Ju(e,t){return(Ju=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Bu(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=Vu(e);if(t){var r=Vu(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return Uu(this,n)}}function Uu(e,t){if(t&&("object"===Fu(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Vu(e){return(Vu=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Gu=wp.i18n.__,qu=wp.element,Ku=qu.Component,$u=qu.Fragment,Zu=(wp.blockEditor||wp.editor).ColorPalette,Qu=wp.components,Xu=Qu.BaseControl,ed=Qu.CheckboxControl,td=Qu.PanelBody,nd=Qu.SelectControl,ad=Qu.TextControl,rd=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ju(e,t)}(s,e);var t,n,a,r=Bu(s);function s(){return Nu(this,s),r.apply(this,arguments)}return t=s,(n=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-chart-type"],n=this.props.chart["visualizer-settings"];return wp.element.createElement(td,{title:Gu("Layout And Chart Area"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(td,{title:Gu("Layout"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(ad,{label:Gu("Width of Chart"),help:Gu("Determines the total width of the chart."),value:n.width,onChange:function(t){n.width=t,e.props.edit(n)}}),wp.element.createElement(ad,{label:Gu("Height of Chart"),help:Gu("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(nd,{label:Gu("Keep Aspect Ratio"),help:Gu("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:Gu("Yes"),value:"1"},{label:Gu("No"),value:"0"}],onChange:function(t){n.keepAspectRatio=t,e.props.edit(n)}}),-1>=["gauge","tabular"].indexOf(t)&&wp.element.createElement($u,null,wp.element.createElement(ad,{label:Gu("Stroke Width"),help:Gu("The chart border width in pixels."),value:n.backgroundColor.strokeWidth,onChange:function(t){n.backgroundColor.strokeWidth=t,e.props.edit(n)}}),wp.element.createElement(Xu,{label:Gu("Stroke Color")},wp.element.createElement(Zu,{value:n.backgroundColor.stroke,onChange:function(t){n.backgroundColor.stroke=t,e.props.edit(n)}})),wp.element.createElement(Xu,{label:Gu("Background Color")},wp.element.createElement(Zu,{value:n.backgroundColor.fill,onChange:function(t){n.backgroundColor.fill=t,e.props.edit(n)}})),wp.element.createElement(ed,{label:Gu("Transparent Background?"),checked:"transparent"===n.backgroundColor.fill,onChange:function(t){n.backgroundColor.fill="transparent"===n.backgroundColor.fill?"":"transparent",e.props.edit(n)}}))),-1>=["geo","gauge","tabular"].indexOf(t)&&wp.element.createElement(td,{title:Gu("Chart Area"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(ad,{label:Gu("Left Margin"),help:Gu("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(ad,{label:Gu("Top Margin"),help:Gu("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(ad,{label:Gu("Width Of Chart Area"),help:Gu("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(ad,{label:Gu("Height Of Chart Area"),help:Gu("Determines the hight of the chart area."),value:n.chartArea.height,onChange:function(t){n.chartArea.height=t,e.props.edit(n)}})))}}])&&Iu(t.prototype,n),a&&Iu(t,a),s}(Ku);function sd(e){return(sd="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 id(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function od(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function ld(e,t){return(ld=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ud(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=cd(e);if(t){var r=cd(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return dd(this,n)}}function dd(e,t){if(t&&("object"===sd(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function cd(e){return(cd=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var md=wp.i18n.__,_d=wp.element,hd=_d.Component,pd=_d.Fragment,fd=wp.components,yd=fd.CheckboxControl,Md=fd.PanelBody,gd=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ld(e,t)}(s,e);var t,n,a,r=ud(s);function s(){return id(this,s),r.apply(this,arguments)}return t=s,(n=[{key:"componentDidMount",value:function(){var e=this.props.chart["visualizer-settings"];void 0===e.actions&&(e.actions=[]),this.props.edit(e)}},{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"],n=this.props.chart["visualizer-chart-type"];return wp.element.createElement(Md,{title:md("Frontend Actions"),initialOpen:!1,className:"visualizer-advanced-panel"},void 0!==t.actions&&wp.element.createElement(pd,null,wp.element.createElement(yd,{label:md("Print"),help:md("To enable printing the data."),checked:0<=t.actions.indexOf("print"),onChange:function(n){if(0<=t.actions.indexOf("print")){var a=t.actions.indexOf("print");-1!==a&&t.actions.splice(a,1)}else t.actions.push("print");e.props.edit(t)}}),wp.element.createElement(yd,{label:md("CSV"),help:md("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 a=t.actions.indexOf("csv;application/csv");-1!==a&&t.actions.splice(a,1)}else t.actions.push("csv;application/csv");e.props.edit(t)}}),wp.element.createElement(yd,{label:md("Excel"),help:md("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 a=t.actions.indexOf("xls;application/vnd.ms-excel");-1!==a&&t.actions.splice(a,1)}else t.actions.push("xls;application/vnd.ms-excel");e.props.edit(t)}}),wp.element.createElement(yd,{label:md("Copy"),help:md("To enable copying the data to the clipboard."),checked:0<=t.actions.indexOf("copy"),onChange:function(n){if(0<=t.actions.indexOf("copy")){var a=t.actions.indexOf("copy");-1!==a&&t.actions.splice(a,1)}else t.actions.push("copy");e.props.edit(t)}}),-1>=["dataTable","tabular","gauge","table"].indexOf(n)&&wp.element.createElement(yd,{label:md("Download Image"),help:md("To download the chart as an image."),checked:0<=t.actions.indexOf("image"),onChange:function(n){if(0<=t.actions.indexOf("image")){var a=t.actions.indexOf("image");-1!==a&&t.actions.splice(a,1)}else t.actions.push("image");e.props.edit(t)}})))}}])&&od(t.prototype,n),a&&od(t,a),s}(hd);function Ld(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bd(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},a=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&a.push.apply(a,Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),a.forEach((function(t){Ld(e,t,n[t])}))}return e}var vd={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"}},Yd=n(3);const wd={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&&wd.throwError(wd.getCaller(2),e)},isFalsy:(e="<unknown parameter>",t)=>{t||wd.throwError(wd.getCaller(2),e)},isNoneOf:(e="<unknown parameter>",t,n=[])=>{-1===n.indexOf(t)&&wd.throwError(wd.getCaller(2),e,"to be any of"+JSON.stringify(n))},isAnyOf:(e="<unknown parameter>",t,n=[])=>{n.indexOf(t)>-1&&wd.throwError(wd.getCaller(2),e,"not to be any of"+JSON.stringify(n))},isNotType:(e="<unknown parameter>",t,n="")=>{Object(Yd.getType)(t)!==n.toLowerCase()&&wd.throwError(wd.getCaller(2),e,"to be type "+n.toLowerCase())},isAnyTypeOf:(e="<unknown parameter>",t,n=[])=>{n.forEach(n=>{Object(Yd.getType)(t)===n&&wd.throwError(wd.getCaller(2),e,"not to be type of "+n.toLowerCase())})},missingKey:(e="<unknown parameter>",t,n="")=>{wd.isUndefined(e,t),-1===Object.keys(t).indexOf(n)&&wd.throwError(wd.getCaller(2),e,"to contain '"+n+"' key")},missingAnyKeys:(e="<unknown parameter>",t,n=[""])=>{wd.isUndefined(e,t);const a=Object.keys(t);n.forEach(t=>{-1===a.indexOf(t)&&wd.throwError(wd.getCaller(2),e,"to contain '"+t+"' key")})},containsUndefined:(e="<unknown parameter>",t)=>{[void 0,null].forEach(n=>{const a=Object(Yd.locate)(t,n);a&&wd.throwError(wd.getCaller(2),e,"not to contain '"+JSON.stringify(n)+"' at "+a)})},isInvalidPath:(e="<unknown parameter>",t)=>{wd.isUndefined(e,t),wd.isNotType(e,t,"string"),wd.isAnyOf(e,t,["","/"]),".$[]#".split().forEach(n=>{t.indexOf(n)>-1&&wd.throwError(wd.getCaller(2),e,"not to contain invalid character '"+n+"'")}),t.match(/\/{2,}/g)&&wd.throwError(wd.getCaller(2),e,"not to contain consecutive forward slash characters")},isInvalidWriteData:(e="<unknown parameter>",t)=>{wd.isUndefined(e,t),wd.containsUndefined(e,t)}};var kd=wd;const Dd=(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 Td={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"};
337
  /** @license react-json-editor-ajrm v2.5.13
338
  *
339
  * This source code is licensed under the MIT license found in the
340
  * LICENSE file in the root directory of this source tree.
341
- */class Sd extends a.Component{constructor(e){super(e),this.updateInternalProps=this.updateInternalProps.bind(this),this.createMarkup=this.createMarkup.bind(this),this.onClick=this.onClick.bind(this),this.onBlur=this.onBlur.bind(this),this.update=this.update.bind(this),this.getCursorPosition=this.getCursorPosition.bind(this),this.setCursorPosition=this.setCursorPosition.bind(this),this.scheduledUpdate=this.scheduledUpdate.bind(this),this.setUpdateTime=this.setUpdateTime.bind(this),this.renderLabels=this.renderLabels.bind(this),this.newSpan=this.newSpan.bind(this),this.renderErrorMessage=this.renderErrorMessage.bind(this),this.onScroll=this.onScroll.bind(this),this.showPlaceholder=this.showPlaceholder.bind(this),this.tokenize=this.tokenize.bind(this),this.onKeyPress=this.onKeyPress.bind(this),this.onKeyDown=this.onKeyDown.bind(this),this.onPaste=this.onPaste.bind(this),this.stopEvent=this.stopEvent.bind(this),this.refContent=null,this.refLabels=null,this.updateInternalProps(),this.renderCount=1,this.state={prevPlaceholder:"",markupText:"",plainText:"",json:"",jsObject:void 0,lines:!1,error:!1},this.props.locale||console.warn("[react-json-editor-ajrm - Deprecation Warning] You did not provide a 'locale' prop for your JSON input - This will be required in a future version. English has been set as a default.")}updateInternalProps(){let e={},t={},n=vd.dark_vscode_tribute;"theme"in this.props&&"string"==typeof this.props.theme&&this.props.theme in vd&&(n=vd[this.props.theme]),e=n,"colors"in this.props&&(e={default:"default"in this.props.colors?this.props.colors.default:e.default,string:"string"in this.props.colors?this.props.colors.string:e.string,number:"number"in this.props.colors?this.props.colors.number:e.number,colon:"colon"in this.props.colors?this.props.colors.colon:e.colon,keys:"keys"in this.props.colors?this.props.colors.keys:e.keys,keys_whiteSpace:"keys_whiteSpace"in this.props.colors?this.props.colors.keys_whiteSpace:e.keys_whiteSpace,primitive:"primitive"in this.props.colors?this.props.colors.primitive:e.primitive,error:"error"in this.props.colors?this.props.colors.error:e.error,background:"background"in this.props.colors?this.props.colors.background:e.background,background_warning:"background_warning"in this.props.colors?this.props.colors.background_warning:e.background_warning}),this.colors=e,t="style"in this.props?{outerBox:"outerBox"in this.props.style?this.props.style.outerBox:{},container:"container"in this.props.style?this.props.style.container:{},warningBox:"warningBox"in this.props.style?this.props.style.warningBox:{},errorMessage:"errorMessage"in this.props.style?this.props.style.errorMessage:{},body:"body"in this.props.style?this.props.style.body:{},labelColumn:"labelColumn"in this.props.style?this.props.style.labelColumn:{},labels:"labels"in this.props.style?this.props.style.labels:{},contentBox:"contentBox"in this.props.style?this.props.style.contentBox:{}}:{outerBox:{},container:{},warningBox:{},errorMessage:{},body:{},labelColumn:{},labels:{},contentBox:{}},this.style=t,this.confirmGood=!("confirmGood"in this.props)||this.props.confirmGood;const a=this.props.height||"610px",r=this.props.width||"479px";this.totalHeight=a,this.totalWidth=r,!("onKeyPressUpdate"in this.props)||this.props.onKeyPressUpdate?this.timer||(this.timer=setInterval(this.scheduledUpdate,100)):this.timer&&(clearInterval(this.timer),this.timer=!1),this.updateTime=!1,this.waitAfterKeyPress="waitAfterKeyPress"in this.props?this.props.waitAfterKeyPress:1e3,this.resetConfiguration="reset"in this.props&&this.props.reset}render(){const e=this.props.id,t=this.state.markupText,n=this.props.error||this.state.error,a=this.colors,s=this.style,i=this.confirmGood,o=this.totalHeight,l=this.totalWidth,u=!!this.props.error||!!n&&"token"in n;return this.renderCount++,r.a.createElement("div",{name:"outer-box",id:e&&e+"-outer-box",style:bd({display:"block",overflow:"none",height:o,width:l,margin:0,boxSizing:"border-box",position:"relative"},s.outerBox)},i?r.a.createElement("div",{style:{opacity:u?0:1,height:"30px",width:"30px",position:"absolute",top:0,right:0,transform:"translate(-25%,25%)",pointerEvents:"none",transitionDuration:"0.2s",transitionTimingFunction:"cubic-bezier(0, 1, 0.5, 1)"}},r.a.createElement("svg",{height:"30px",width:"30px",viewBox:"0 0 100 100"},r.a.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",fill:"green",opacity:"0.85",d:"M39.363,79L16,55.49l11.347-11.419L39.694,56.49L72.983,23L84,34.085L39.363,79z"}))):void 0,r.a.createElement("div",{name:"container",id:e&&e+"-container",style:bd({display:"block",height:o,width:l,margin:0,boxSizing:"border-box",overflow:"hidden",fontFamily:"Roboto, sans-serif"},s.container),onClick:this.onClick},r.a.createElement("div",{name:"warning-box",id:e&&e+"-warning-box",style:bd({display:"block",overflow:"hidden",height:u?"60px":"0px",width:"100%",margin:0,backgroundColor:a.background_warning,transitionDuration:"0.2s",transitionTimingFunction:"cubic-bezier(0, 1, 0.5, 1)"},s.warningBox),onClick:this.onClick},r.a.createElement("span",{style:{display:"inline-block",height:"60px",width:"60px",margin:0,boxSizing:"border-box",overflow:"hidden",verticalAlign:"top",pointerEvents:"none"},onClick:this.onClick},r.a.createElement("div",{style:{position:"relative",top:0,left:0,height:"60px",width:"60px",margin:0,pointerEvents:"none"},onClick:this.onClick},r.a.createElement("div",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",pointerEvents:"none"},onClick:this.onClick},r.a.createElement("svg",{height:"25px",width:"25px",viewBox:"0 0 100 100"},r.a.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",fill:"red",d:"M73.9,5.75c0.467-0.467,1.067-0.7,1.8-0.7c0.7,0,1.283,0.233,1.75,0.7l16.8,16.8 c0.467,0.5,0.7,1.084,0.7,1.75c0,0.733-0.233,1.334-0.7,1.801L70.35,50l23.9,23.95c0.5,0.467,0.75,1.066,0.75,1.8 c0,0.667-0.25,1.25-0.75,1.75l-16.8,16.75c-0.534,0.467-1.117,0.7-1.75,0.7s-1.233-0.233-1.8-0.7L50,70.351L26.1,94.25 c-0.567,0.467-1.167,0.7-1.8,0.7c-0.667,0-1.283-0.233-1.85-0.7L5.75,77.5C5.25,77,5,76.417,5,75.75c0-0.733,0.25-1.333,0.75-1.8 L29.65,50L5.75,26.101C5.25,25.667,5,25.066,5,24.3c0-0.666,0.25-1.25,0.75-1.75l16.8-16.8c0.467-0.467,1.05-0.7,1.75-0.7 c0.733,0,1.333,0.233,1.8,0.7L50,29.65L73.9,5.75z"}))))),r.a.createElement("span",{style:{display:"inline-block",height:"60px",width:"calc(100% - 60px)",margin:0,overflow:"hidden",verticalAlign:"top",position:"absolute",pointerEvents:"none"},onClick:this.onClick},this.renderErrorMessage())),r.a.createElement("div",{name:"body",id:e&&e+"-body",style:bd({display:"flex",overflow:"none",height:u?"calc(100% - 60px)":"100%",width:"",margin:0,resize:"none",fontFamily:"Roboto Mono, Monaco, monospace",fontSize:"11px",backgroundColor:a.background,transitionDuration:"0.2s",transitionTimingFunction:"cubic-bezier(0, 1, 0.5, 1)"},s.body),onClick:this.onClick},r.a.createElement("span",{name:"labels",id:e&&e+"-labels",ref:e=>this.refLabels=e,style:bd({display:"inline-block",boxSizing:"border-box",verticalAlign:"top",height:"100%",width:"44px",margin:0,padding:"5px 0px 5px 10px",overflow:"hidden",color:"#D4D4D4"},s.labelColumn),onClick:this.onClick},this.renderLabels()),r.a.createElement("span",{id:e,ref:e=>this.refContent=e,contentEditable:!0,style:bd({display:"inline-block",boxSizing:"border-box",verticalAlign:"top",height:"100%",width:"",flex:1,margin:0,padding:"5px",overflowX:"hidden",overflowY:"auto",wordWrap:"break-word",whiteSpace:"pre-line",color:"#D4D4D4",outline:"none"},s.contentBox),dangerouslySetInnerHTML:this.createMarkup(t),onKeyPress:this.onKeyPress,onKeyDown:this.onKeyDown,onClick:this.onClick,onBlur:this.onBlur,onScroll:this.onScroll,onPaste:this.onPaste,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1}))))}renderErrorMessage(){const e=this.props.locale||Td,t=this.props.error||this.state.error,n=this.style;if(t)return r.a.createElement("p",{style:bd({color:"red",fontSize:"12px",position:"absolute",width:"calc(100% - 60px)",height:"60px",boxSizing:"border-box",margin:0,padding:0,paddingRight:"10px",overflowWrap:"break-word",display:"flex",flexDirection:"column",justifyContent:"center"},n.errorMessage)},Dd(e.format,t))}renderLabels(){const e=this.colors,t=this.style,n=this.props.error||this.state.error,a=n?n.line:-1,s=this.state.lines?this.state.lines:1;let i=new Array(s);for(var o=0;o<s-1;o++)i[o]=o+1;return i.map(n=>{const s=n!==a?e.default:"red";return r.a.createElement("div",{key:n,style:bd({},t.labels,{color:s})},n)})}createMarkup(e){return void 0===e?{__html:""}:{__html:""+e}}newSpan(e,t,n){let a=this.colors,r=t.type,s=t.string,i="";switch(r){case"string":case"number":case"primitive":case"error":i=a[t.type];break;case"key":i=" "===s?a.keys_whiteSpace:a.keys;break;case"symbol":i=":"===s?a.colon:a.default;break;default:i=a.default}return s.length!==s.replace(/</g,"").replace(/>/g,"").length&&(s="<xmp style=display:inline;>"+s+"</xmp>"),'<span type="'+r+'" value="'+s+'" depth="'+n+'" style="color:'+i+'">'+s+"</span>"}getCursorPosition(e){let t,n=window.getSelection(),a=-1,r=0;if(n.focusNode&&(e=>{for(;null!==e;){if(e===this.refContent)return!0;e=e.parentNode}return!1})(n.focusNode))for(t=n.focusNode,a=n.focusOffset;t&&t!==this.refContent;)if(t.previousSibling)t=t.previousSibling,e&&"BR"===t.nodeName&&r++,a+=t.textContent.length;else if(t=t.parentNode,null===t)break;return a+r}setCursorPosition(e){if([!1,null,void 0].indexOf(e)>-1)return;const t=(e,n,a)=>{if(a||((a=document.createRange()).selectNode(e),a.setStart(e,0)),0===n.count)a.setEnd(e,n.count);else if(e&&n.count>0)if(e.nodeType===Node.TEXT_NODE)e.textContent.length<n.count?n.count-=e.textContent.length:(a.setEnd(e,n.count),n.count=0);else for(var r=0;r<e.childNodes.length&&(a=t(e.childNodes[r],n,a),0!==n.count);r++);return a};e>0?(e=>{if(e<0)return;let n=window.getSelection(),a=t(this.refContent,{count:e});a&&(a.collapse(!1),n.removeAllRanges(),n.addRange(a))})(e):this.refContent.focus()}update(e=0,t=!0){const n=this.refContent,a=this.tokenize(n);"onChange"in this.props&&this.props.onChange({plainText:a.indented,markupText:a.markup,json:a.json,jsObject:a.jsObject,lines:a.lines,error:a.error});let r=this.getCursorPosition(a.error)+e;this.setState({plainText:a.indented,markupText:a.markup,json:a.json,jsObject:a.jsObject,lines:a.lines,error:a.error}),this.updateTime=!1,t&&this.setCursorPosition(r)}scheduledUpdate(){if("onKeyPressUpdate"in this.props&&!1===this.props.onKeyPressUpdate)return;const{updateTime:e}=this;!1!==e&&(e>(new Date).getTime()||this.update())}setUpdateTime(){"onKeyPressUpdate"in this.props&&!1===this.props.onKeyPressUpdate||(this.updateTime=(new Date).getTime()+this.waitAfterKeyPress)}stopEvent(e){e&&(e.preventDefault(),e.stopPropagation())}onKeyPress(e){const t=e.ctrlKey||e.metaKey;this.props.viewOnly&&!t&&this.stopEvent(e),t||this.setUpdateTime()}onKeyDown(e){const t=!!this.props.viewOnly,n=e.ctrlKey||e.metaKey;switch(e.key){case"Tab":if(this.stopEvent(e),t)break;document.execCommand("insertText",!1," "),this.setUpdateTime();break;case"Backspace":case"Delete":t&&this.stopEvent(e),this.setUpdateTime();break;case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"ArrowDown":this.setUpdateTime();break;case"a":case"c":t&&!n&&this.stopEvent(e);break;default:t&&this.stopEvent(e)}}onPaste(e){if(this.props.viewOnly)this.stopEvent(e);else{e.preventDefault();var t=e.clipboardData.getData("text/plain");document.execCommand("insertText",!1,t)}this.update()}onClick(){!("viewOnly"in this.props)||this.props.viewOnly}onBlur(){if("viewOnly"in this.props&&this.props.viewOnly)return;const e=this.refContent,t=this.tokenize(e);"onBlur"in this.props&&this.props.onBlur({plainText:t.indented,markupText:t.markup,json:t.json,jsObject:t.jsObject,lines:t.lines,error:t.error})}onScroll(e){this.refLabels.scrollTop=e.target.scrollTop}componentDidUpdate(){this.updateInternalProps(),this.showPlaceholder()}componentDidMount(){this.showPlaceholder()}componentWillUnmount(){this.timer&&clearInterval(this.timer)}showPlaceholder(){if(!("placeholder"in this.props))return;const{placeholder:e}=this.props;if([void 0,null].indexOf(e)>-1)return;const{prevPlaceholder:t,jsObject:n}=this.state,{resetConfiguration:a}=this,r=Object(Yd.getType)(e);-1===["object","array"].indexOf(r)&&kd.throwError("showPlaceholder","placeholder","either an object or an array");let s=!Object(Yd.identical)(e,t);if(s||a&&void 0!==n&&(s=!Object(Yd.identical)(e,n)),!s)return;const i=this.tokenize(e);this.setState({prevPlaceholder:e,plainText:i.indentation,markupText:i.markup,lines:i.lines,error:i.error})}tokenize(e){if("object"!=typeof e)return console.error("tokenize() expects object type properties only. Got '"+typeof e+"' type instead.");const t=this.props.locale||Td,n=this.newSpan;if("nodeType"in e){const L=e.cloneNode(!0);if(!L.hasChildNodes())return"";const b=L.childNodes;let v={tokens_unknown:[],tokens_proto:[],tokens_split:[],tokens_fallback:[],tokens_normalize:[],tokens_merge:[],tokens_plainText:"",indented:"",json:"",jsObject:void 0,markup:""};for(var a=0;a<b.length;a++){let e=b[a],t={};switch(e.nodeName){case"SPAN":t={string:e.textContent,type:e.attributes.type.textContent},v.tokens_unknown.push(t);break;case"DIV":v.tokens_unknown.push({string:e.textContent,type:"unknown"});break;case"BR":""===e.textContent&&v.tokens_unknown.push({string:"\n",type:"unknown"});break;case"#text":v.tokens_unknown.push({string:e.wholeText,type:"unknown"});break;case"FONT":v.tokens_unknown.push({string:e.textContent,type:"unknown"});break;default:console.error("Unrecognized node:",{child:e})}}function r(e,t=""){let n={active:!1,string:"",number:"",symbol:"",space:"",delimiter:"",quarks:[]};function a(e,a){switch(a){case"symbol":case"delimiter":n.active&&n.quarks.push({string:n[n.active],type:t+"-"+n.active}),n[n.active]="",n.active=a,n[n.active]=e;break;default:a!==n.active||[n.string,e].indexOf("\n")>-1?(n.active&&n.quarks.push({string:n[n.active],type:t+"-"+n.active}),n[n.active]="",n.active=a,n[n.active]=e):n[a]+=e}}for(var r=0;r<e.length;r++){const t=e.charAt(r);switch(t){case'"':case"'":a(t,"delimiter");break;case" ":case" ":a(t,"space");break;case"{":case"}":case"[":case"]":case":":case",":a(t,"symbol");break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":"string"===n.active?a(t,"string"):a(t,"number");break;case"-":if(r<e.length-1&&"0123456789".indexOf(e.charAt(r+1))>-1){a(t,"number");break}case".":if(r<e.length-1&&r>0&&"0123456789".indexOf(e.charAt(r+1))>-1&&"0123456789".indexOf(e.charAt(r-1))>-1){a(t,"number");break}default:a(t,"string")}}return n.active&&(n.quarks.push({string:n[n.active],type:t+"-"+n.active}),n[n.active]="",n.active=!1),n.quarks}for(a=0;a<v.tokens_unknown.length;a++){let e=v.tokens_unknown[a];v.tokens_proto=v.tokens_proto.concat(r(e.string,"proto"))}function s(e,t){let n="",a="",r=!1;switch(t){case"primitive":if(-1===["true","false","null","undefined"].indexOf(e))return!1;break;case"string":if(e.length<2)return!1;if(n=e.charAt(0),a=e.charAt(e.length-1),r="'\"".indexOf(n),-1===r)return!1;if(n!==a)return!1;for(var s=0;s<e.length;s++)if(s>0&&s<e.length-1&&e.charAt(s)==="'\""[r]&&"\\"!==e.charAt(s-1))return!1;break;case"key":if(0===e.length)return!1;if(n=e.charAt(0),a=e.charAt(e.length-1),r="'\"".indexOf(n),r>-1){if(1===e.length)return!1;if(n!==a)return!1;for(s=0;s<e.length;s++)if(s>0&&s<e.length-1&&e.charAt(s)==="'\""[r]&&"\\"!==e.charAt(s-1))return!1}else{const t="'\"`.,:;{}[]&<>=~*%\\|/-+!?@^  ";for(s=0;s<t.length;s++){const n=t.charAt(s);if(e.indexOf(n)>-1)return!1}}break;case"number":for(s=0;s<e.length;s++)if(-1==="0123456789".indexOf(e.charAt(s)))if(0===s){if("-"!==e.charAt(0))return!1}else if("."!==e.charAt(s))return!1;break;case"symbol":if(e.length>1)return!1;if(-1==="{[:]},".indexOf(e))return!1;break;case"colon":if(e.length>1)return!1;if(":"!==e)return!1;break;default:return!0}return!0}for(a=0;a<v.tokens_proto.length;a++){let e=v.tokens_proto[a];-1===e.type.indexOf("proto")?s(e.string,e.type)?v.tokens_split.push(e):v.tokens_split=v.tokens_split.concat(r(e.string,"split")):v.tokens_split.push(e)}for(a=0;a<v.tokens_split.length;a++){let e=v.tokens_split[a],t=e.type,n=e.string,r=n.length,s=[];t.indexOf("-")>-1&&(t=t.slice(t.indexOf("-")+1),"string"!==t&&s.push("string"),s.push("key"),s.push("error"));let i={string:n,length:r,type:t,fallback:s};v.tokens_fallback.push(i)}function i(){const e=v.tokens_normalize.length-1;if(e<1)return!1;for(var t=e;t>=0;t--){const e=v.tokens_normalize[t];switch(e.type){case"space":case"linebreak":break;default:return e}}return!1}let Y={brackets:[],stringOpen:!1,isValue:!1};for(a=0;a<v.tokens_fallback.length;a++){let e=v.tokens_fallback[a];const t=e.type,n=e.string;let r={type:t,string:n};switch(t){case"symbol":case"colon":if(Y.stringOpen){Y.isValue?r.type="string":r.type="key";break}switch(n){case"[":case"{":Y.brackets.push(n),Y.isValue="["===Y.brackets[Y.brackets.length-1];break;case"]":case"}":Y.brackets.pop(),Y.isValue="["===Y.brackets[Y.brackets.length-1];break;case",":if("colon"===i().type)break;Y.isValue="["===Y.brackets[Y.brackets.length-1];break;case":":r.type="colon",Y.isValue=!0}break;case"delimiter":if(Y.isValue?r.type="string":r.type="key",!Y.stringOpen){Y.stringOpen=n;break}if(a>0){const e=v.tokens_fallback[a-1],t=e.string,n=e.type,r=t.charAt(t.length-1);if("string"===n&&"\\"===r)break}if(Y.stringOpen===n){Y.stringOpen=!1;break}break;case"primitive":case"string":if(["false","true","null","undefined"].indexOf(n)>-1){const e=v.tokens_normalize.length-1;if(e>=0){if("string"!==v.tokens_normalize[e].type){r.type="primitive";break}r.type="string";break}r.type="primitive";break}if("\n"===n&&!Y.stringOpen){r.type="linebreak";break}Y.isValue?r.type="string":r.type="key";break;case"space":case"number":Y.stringOpen&&(Y.isValue?r.type="string":r.type="key")}v.tokens_normalize.push(r)}for(a=0;a<v.tokens_normalize.length;a++){const e=v.tokens_normalize[a];let t={string:e.string,type:e.type,tokens:[a]};if(-1===["symbol","colon"].indexOf(e.type)&&a+1<v.tokens_normalize.length){let n=0;for(var o=a+1;o<v.tokens_normalize.length;o++){const a=v.tokens_normalize[o];if(e.type!==a.type)break;t.string+=a.string,t.tokens.push(o),n++}a+=n}v.tokens_merge.push(t)}const w="'\"",k="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_$";var l=!1,u=v.tokens_merge.length>0?1:0;function d(e,t,n=0){l={token:e,line:u,reason:t},v.tokens_merge[e+n].type="error"}function c(e,t){if(void 0===e&&console.error("tokenID argument must be an integer."),void 0===t&&console.error("options argument must be an array."),e===v.tokens_merge.length-1)return!1;for(var n=e+1;n<v.tokens_merge.length;n++){const e=v.tokens_merge[n];switch(e.type){case"space":case"linebreak":break;case"symbol":case"colon":return t.indexOf(e.string)>-1&&n;default:return!1}}return!1}function m(e,t){if(void 0===e&&console.error("tokenID argument must be an integer."),void 0===t&&console.error("options argument must be an array."),0===e)return!1;for(var n=e-1;n>=0;n--){const e=v.tokens_merge[n];switch(e.type){case"space":case"linebreak":break;case"symbol":case"colon":return t.indexOf(e.string)>-1;default:return!1}}return!1}function _(e){if(void 0===e&&console.error("tokenID argument must be an integer."),0===e)return!1;for(var t=e-1;t>=0;t--){const e=v.tokens_merge[t];switch(e.type){case"space":case"linebreak":break;default:return e.type}}return!1}Y={brackets:[],stringOpen:!1,isValue:!1};let D=[];for(a=0;a<v.tokens_merge.length&&!l;a++){let e=v.tokens_merge[a],n=e.string,r=e.type,s=!1;switch(r){case"space":break;case"linebreak":u++;break;case"symbol":switch(n){case"{":case"[":if(s=m(a,["}","]"]),s){d(a,Dd(t.invalidToken.tokenSequence.prohibited,{firstToken:v.tokens_merge[s].string,secondToken:n}));break}if("["===n&&a>0&&!m(a,[":","[",","])){d(a,Dd(t.invalidToken.tokenSequence.permitted,{firstToken:"[",secondToken:[":","[",","]}));break}if("{"===n&&m(a,["{"])){d(a,Dd(t.invalidToken.double,{token:"{"}));break}Y.brackets.push(n),Y.isValue="["===Y.brackets[Y.brackets.length-1],D.push({i:a,line:u,string:n});break;case"}":case"]":if("}"===n&&"{"!==Y.brackets[Y.brackets.length-1]){d(a,Dd(t.brace.curly.missingOpen));break}if("}"===n&&m(a,[","])){d(a,Dd(t.invalidToken.tokenSequence.prohibited,{firstToken:",",secondToken:"}"}));break}if("]"===n&&"["!==Y.brackets[Y.brackets.length-1]){d(a,Dd(t.brace.square.missingOpen));break}if("]"===n&&m(a,[":"])){d(a,Dd(t.invalidToken.tokenSequence.prohibited,{firstToken:":",secondToken:"]"}));break}Y.brackets.pop(),Y.isValue="["===Y.brackets[Y.brackets.length-1],D.push({i:a,line:u,string:n});break;case",":if(s=m(a,["{"]),s){if(c(a,["}"])){d(a,Dd(t.brace.curly.cannotWrap,{token:","}));break}d(a,Dd(t.invalidToken.tokenSequence.prohibited,{firstToken:"{",secondToken:","}));break}if(c(a,["}",",","]"])){d(a,Dd(t.noTrailingOrLeadingComma));break}switch(s=_(a),s){case"key":case"colon":d(a,Dd(t.invalidToken.termSequence.prohibited,{firstTerm:"key"===s?t.types.key:t.symbols.colon,secondTerm:t.symbols.comma}));break;case"symbol":if(m(a,["{"])){d(a,Dd(t.invalidToken.tokenSequence.prohibited,{firstToken:"{",secondToken:","}));break}}Y.isValue="["===Y.brackets[Y.brackets.length-1]}v.json+=n;break;case"colon":if(s=m(a,["["]),s&&c(a,["]"])){d(a,Dd(t.brace.square.cannotWrap,{token:":"}));break}if(s){d(a,Dd(t.invalidToken.tokenSequence.prohibited,{firstToken:"[",secondToken:":"}));break}if("key"!==_(a)){d(a,Dd(t.invalidToken.termSequence.permitted,{firstTerm:t.symbols.colon,secondTerm:t.types.key}));break}if(c(a,["}","]"])){d(a,Dd(t.invalidToken.termSequence.permitted,{firstTerm:t.symbols.colon,secondTerm:t.types.value}));break}Y.isValue=!0,v.json+=n;break;case"key":case"string":let e=n.charAt(0),i=n.charAt(n.length-1);w.indexOf(e);if(-1===w.indexOf(e)&&-1!==w.indexOf(i)){d(a,Dd(t.string.missingOpen,{quote:e}));break}if(-1===w.indexOf(i)&&-1!==w.indexOf(e)){d(a,Dd(t.string.missingClose,{quote:e}));break}if(w.indexOf(e)>-1&&e!==i){d(a,Dd(t.string.missingClose,{quote:e}));break}if("string"===r&&-1===w.indexOf(e)&&-1===w.indexOf(i)){d(a,Dd(t.string.mustBeWrappedByQuotes));break}if("key"===r&&c(a,["}","]"])&&d(a,Dd(t.invalidToken.termSequence.permitted,{firstTerm:t.types.key,secondTerm:t.symbols.colon})),-1===w.indexOf(e)&&-1===w.indexOf(i))for(var h=0;h<n.length&&!l;h++){const e=n.charAt(h);if(-1===k.indexOf(e)){d(a,Dd(t.string.nonAlphanumeric,{token:e}));break}}if("'"===e?n='"'+n.slice(1,-1)+'"':'"'!==e&&(n='"'+n+'"'),"key"===r&&"key"===_(a)){if(a>0&&!isNaN(v.tokens_merge[a-1])){v.tokens_merge[a-1]+=v.tokens_merge[a],d(a,Dd(t.key.numberAndLetterMissingQuotes));break}d(a,Dd(t.key.spaceMissingQuotes));break}if("key"===r&&!m(a,["{",","])){d(a,Dd(t.invalidToken.tokenSequence.permitted,{firstToken:r,secondToken:["{",","]}));break}if("string"===r&&!m(a,["[",":",","])){d(a,Dd(t.invalidToken.tokenSequence.permitted,{firstToken:r,secondToken:["[",":",","]}));break}if("key"===r&&Y.isValue){d(a,Dd(t.string.unexpectedKey));break}if("string"===r&&!Y.isValue){d(a,Dd(t.key.unexpectedString));break}v.json+=n;break;case"number":case"primitive":if(m(a,["{"]))v.tokens_merge[a].type="key",r=v.tokens_merge[a].type,n='"'+n+'"';else if("key"===_(a))v.tokens_merge[a].type="key",r=v.tokens_merge[a].type;else if(!m(a,["[",":",","])){d(a,Dd(t.invalidToken.tokenSequence.permitted,{firstToken:r,secondToken:["[",":",","]}));break}"key"!==r&&(Y.isValue||(v.tokens_merge[a].type="key",r=v.tokens_merge[a].type,n='"'+n+'"')),"primitive"===r&&"undefined"===n&&d(a,Dd(t.invalidToken.useInstead,{badToken:"undefined",goodToken:"null"})),v.json+=n}}let T="";for(a=0;a<v.json.length;a++){let e=v.json.charAt(a),t="";a+1<v.json.length&&(t=v.json.charAt(a+1),"\\"===e&&"'"===t)?(T+=t,a++):T+=e}if(v.json=T,!l){const e=Math.ceil(D.length/2);let n=0,a=!1;function p(e){D.splice(e+1,1),D.splice(e,1),a||(a=!0)}for(;D.length>0;){a=!1;for(var f=0;f<D.length-1;f++){const e=D[f].string+D[f+1].string;["[]","{}"].indexOf(e)>-1&&p(f)}if(n++,!a)break;if(n>=e)break}if(D.length>0){const e=D[0].string,n=D[0].i,a="["===e?"]":"}";u=D[0].line,d(n,Dd(t.brace["]"===a?"square":"curly"].missingClose))}}if(!l&&-1===[void 0,""].indexOf(v.json))try{v.jsObject=JSON.parse(v.json)}catch(e){const n=e.message,a=n.indexOf("position");if(-1===a)throw new Error("Error parsing failed");const r=n.substring(a+9,n.length),s=parseInt(r);let i=0,o=0,c=!1,m=1,_=!1;for(;i<s&&!_&&(c=v.tokens_merge[o],"linebreak"===c.type&&m++,-1===["space","linebreak"].indexOf(c.type)&&(i+=c.string.length),!(i>=s));)o++,v.tokens_merge[o+1]||(_=!0);u=m;let h=0;for(let e=0;e<c.string.length;e++){const n=c.string.charAt(e);"\\"===n?h=h>0?h+1:1:(h%2==0&&0!==h||-1==="'\"bfnrt".indexOf(n)&&d(o,Dd(t.invalidToken.unexpected,{token:"\\"})),h=0)}l||d(o,Dd(t.invalidToken.unexpected,{token:c.string}))}let S=1,j=0;function y(e=!1){return function(e=!1){return S++,j>0||e?"<br>":""}(e)+function(){for(var e=[],t=0;t<2*j;t++)e.push("&nbsp;");return e.join("")}()}if(!l)for(a=0;a<v.tokens_merge.length;a++){const e=v.tokens_merge[a],t=e.string;switch(e.type){case"space":case"linebreak":break;case"string":case"number":case"primitive":case"error":v.markup+=(m(a,[",","["])?y():"")+n(a,e,j);break;case"key":v.markup+=y()+n(a,e,j);break;case"colon":v.markup+=n(a,e,j)+"&nbsp;";break;case"symbol":switch(t){case"[":case"{":v.markup+=(m(a,[":"])?"":y())+n(a,e,j),j++;break;case"]":case"}":j--;const t=a===v.tokens_merge.length-1,r=a>0?["[","{"].indexOf(v.tokens_merge[a-1].string)>-1?"":y(t):"";v.markup+=r+n(a,e,j);break;case",":v.markup+=n(a,e,j)}}}if(l){let e=1;function M(e){let t=0;for(var n=0;n<e.length;n++)["\n","\r"].indexOf(e[n])>-1&&t++;return t}S=1;for(a=0;a<v.tokens_merge.length;a++){const t=v.tokens_merge[a],r=t.type,s=t.string;"linebreak"===r&&S++,v.markup+=n(a,t,j),e+=M(s)}S++,e++,S<e&&(S=e)}for(a=0;a<v.tokens_merge.length;a++){let e=v.tokens_merge[a];v.indented+=e.string,-1===["space","linebreak"].indexOf(e.type)&&(v.tokens_plainText+=e.string)}if(l){"modifyErrorText"in this.props&&((g=this.props.modifyErrorText)&&"[object Function]"==={}.toString.call(g)&&(l.reason=this.props.modifyErrorText(l.reason)))}return{tokens:v.tokens_merge,noSpaces:v.tokens_plainText,indented:v.indented,json:v.json,jsObject:v.jsObject,markup:v.markup,lines:S,error:l}}var g;if(!("nodeType"in e)){let t={inputText:JSON.stringify(e),position:0,currentChar:"",tokenPrimary:"",tokenSecondary:"",brackets:[],isValue:!1,stringOpen:!1,stringStart:0,tokens:[]};function L(){return"\\"===t.currentChar}function b(){if(-1==="'\"".indexOf(t.currentChar))return!1;if(!t.stringOpen)return Y(),t.stringStart=t.position,t.stringOpen=t.currentChar,!0;if(t.stringOpen===t.currentChar){Y();return w(t.inputText.substring(t.stringStart,t.position+1)),t.stringOpen=!1,!0}return!1}function v(){if(-1===":,{}[]".indexOf(t.currentChar))return!1;if(t.stringOpen)return!1;switch(Y(),w(t.currentChar),t.currentChar){case":":return t.isValue=!0,!0;case"{":case"[":t.brackets.push(t.currentChar);break;case"}":case"]":t.brackets.pop()}return":"!==t.currentChar&&(t.isValue="["===t.brackets[t.brackets.length-1]),!0}function Y(){return 0!==t.tokenSecondary.length&&(t.tokens.push(t.tokenSecondary),t.tokenSecondary="",!0)}function w(e){return 0!==e.length&&(t.tokens.push(e),!0)}for(a=0;a<t.inputText.length;a++){t.position=a,t.currentChar=t.inputText.charAt(t.position);const e=v(),n=b(),r=L();e||n||r||t.stringOpen||(t.tokenSecondary+=t.currentChar)}let r={brackets:[],isValue:!1,tokens:[]};r.tokens=t.tokens.map(e=>{let t="",n="",a="";switch(e){case",":t="symbol",n=e,a=e,r.isValue="["===r.brackets[r.brackets.length-1];break;case":":t="symbol",n=e,a=e,r.isValue=!0;break;case"{":case"[":t="symbol",n=e,a=e,r.brackets.push(e),r.isValue="["===r.brackets[r.brackets.length-1];break;case"}":case"]":t="symbol",n=e,a=e,r.brackets.pop(),r.isValue="["===r.brackets[r.brackets.length-1];break;case"undefined":t="primitive",n=e,a=void 0;break;case"null":t="primitive",n=e,a=null;break;case"false":t="primitive",n=e,a=!1;break;case"true":t="primitive",n=e,a=!0;break;default:const i=e.charAt(0);if("'\"".indexOf(i)>-1){if(t=r.isValue?"string":"key","key"===t&&(n=function(e){if(0===e.length)return e;if(['""',"''"].indexOf(e)>-1)return"''";let t=!1;for(var n=0;n<2;n++)if([e.charAt(0),e.charAt(e.length-1)].indexOf(['"',"'"][n])>-1){t=!0;break}t&&e.length>=2&&(e=e.slice(1,-1));const a=e.replace(/\w/g,""),r=(e.replace(/\W+/g,""),((e,t)=>{let n=!1;for(var a=0;a<t.length&&(0!==a||!isNaN(t.charAt(a)));a++)if(isNaN(t.charAt(a))){n=!0;break}return!(e.length>0||n)})(a,e));if((e=>{for(var t=0;t<e.length;t++)if(["'",'"'].indexOf(e.charAt(t))>-1)return!0;return!1})(a)){let t="";const n=e.split("");for(var s=0;s<n.length;s++){let e=n[s];["'",'"'].indexOf(e)>-1&&(e="\\"+e),t+=e}e=t}return r?e:"'"+e+"'"}(e)),"string"===t){n="";const t=e.slice(1,-1).split("");for(var s=0;s<t.length;s++){let e=t[s];"'\"".indexOf(e)>-1&&(e="\\"+e),n+=e}n="'"+n+"'"}a=n;break}if(!isNaN(e)){t="number",n=e,a=Number(e);break}if(e.length>0&&!r.isValue){t="key",n=e,n.indexOf(" ")>-1&&(n="'"+n+"'"),a=n;break}}return{type:t,string:n,value:a,depth:r.brackets.length}});let s="";for(a=0;a<r.tokens.length;a++){s+=r.tokens[a].string}function k(e){for(var t=[],n=0;n<2*e;n++)t.push(" ");return(e>0?"\n":"")+t.join("")}let i="";for(a=0;a<r.tokens.length;a++){let e=r.tokens[a];switch(e.string){case"[":case"{":const t=a<r.tokens.length-1-1?r.tokens[a+1]:"";-1==="}]".indexOf(t.string)?i+=e.string+k(e.depth):i+=e.string;break;case"]":case"}":const n=a>0?r.tokens[a-1]:"";-1==="[{".indexOf(n.string)?i+=k(e.depth)+e.string:i+=e.string;break;case":":i+=e.string+" ";break;case",":i+=e.string+k(e.depth);break;default:i+=e.string}}let o=1;function D(e){var t=[];e>0&&o++;for(var n=0;n<2*e;n++)t.push("&nbsp;");return(e>0?"<br>":"")+t.join("")}let l="";const u=r.tokens.length-1;for(a=0;a<r.tokens.length;a++){let e=r.tokens[a],t=n(a,e,e.depth);switch(e.string){case"{":case"[":const n=a<r.tokens.length-1-1?r.tokens[a+1]:"";-1==="}]".indexOf(n.string)?l+=t+D(e.depth):l+=t;break;case"}":case"]":const s=a>0?r.tokens[a-1]:"";-1==="[{".indexOf(s.string)?l+=D(e.depth)+(u===a?"<br>":"")+t:l+=t;break;case":":l+=t+" ";break;case",":l+=t+D(e.depth);break;default:l+=t}}return o+=2,{tokens:r.tokens,noSpaces:s,indented:i,json:JSON.stringify(e),jsObject:e,markup:l,lines:o}}}}var jd=Sd,Od=n(269),xd=n.n(Od);function Hd(e){return(Hd="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 Ed(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Pd(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function Cd(e,t){return(Cd=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function zd(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=Rd(e);if(t){var r=Rd(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return Ad(this,n)}}function Ad(e,t){if(t&&("object"===Hd(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Wd(e)}function Wd(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Rd(e){return(Rd=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Fd=wp.i18n.__,Nd=wp.element.Component,Id=wp.components,Jd=Id.ExternalLink,Bd=Id.PanelBody,Ud=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Cd(e,t)}(s,e);var t,n,a,r=zd(s);function s(){var e;return Ed(this,s),(e=r.apply(this,arguments)).isValidJSON=e.isValidJSON.bind(Wd(e)),e}return t=s,(n=[{key:"isValidJSON",value:function(e){try{JSON.parse(e)}catch(e){return!1}return!0}},{key:"render",value:function(){var e,t=this,n=this.props.chart["visualizer-settings"];return e=0<=["gauge","tabular","timeline"].indexOf(this.props.chart["visualizer-chart-type"])?this.props.chart["visualizer-chart-type"]:"".concat(this.props.chart["visualizer-chart-type"],"chart"),wp.element.createElement(Bd,{title:Fd("Manual Configuration"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement("p",null,Fd("Configure the graph by providing configuration variables right from the Google Visualization API.")),wp.element.createElement("p",null,wp.element.createElement(Jd,{href:"https://developers.google.com/chart/interactive/docs/gallery/".concat(e,"#configuration-options")},Fd("Google Visualization API"))),wp.element.createElement(jd,{locale:xd.a,theme:"light_mitsuketa_tribute",placeholder:Z(n.manual)?JSON.parse(n.manual):{},width:"100%",height:"250px",style:{errorMessage:{height:"100%",fontSize:"10px"},container:{border:"1px solid #ddd",boxShadow:"inset 0 1px 2px rgba(0,0,0,.07)"},labelColumn:{background:"#F5F5F5",width:"auto",padding:"5px 10px 5px 10px"}},onChange:function(e){!1===e.error&&(n.manual=e.json,t.props.edit(n))}}))}}])&&Pd(t.prototype,n),a&&Pd(t,a),s}(Nd);function Vd(e){return(Vd="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 Gd(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function qd(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function Kd(e,t){return(Kd=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function $d(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=Qd(e);if(t){var r=Qd(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return Zd(this,n)}}function Zd(e,t){if(t&&("object"===Vd(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Qd(e){return(Qd=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Xd=wp.element,ec=Xd.Component,tc=Xd.Fragment,nc=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Kd(e,t)}(s,e);var t,n,a,r=$d(s);function s(){return Gd(this,s),r.apply(this,arguments)}return t=s,(n=[{key:"render",value:function(){var e=this.props.chart["visualizer-chart-type"],t=this.props.chart["visualizer-chart-library"];return wp.element.createElement(tc,null,wp.element.createElement(Aa,{chart:this.props.chart,attributes:this.props.attributes,edit:this.props.edit}),wp.element.createElement(Ya,{chart:this.props.chart,edit:this.props.edit}),-1>=["tabular","dataTable","gauge","geo","pie","timeline"].indexOf(e)&&wp.element.createElement(nr,{chart:this.props.chart,edit:this.props.edit}),-1>=["tabular","dataTable","gauge","geo","pie","timeline"].indexOf(e)&&wp.element.createElement(br,{chart:this.props.chart,edit:this.props.edit}),0<=["pie"].indexOf(e)&&wp.element.createElement(tc,null,wp.element.createElement(Fr,{chart:this.props.chart,edit:this.props.edit}),wp.element.createElement(ts,{chart:this.props.chart,edit:this.props.edit})),0<=["area","scatter","line"].indexOf(e)&&wp.element.createElement(ys,{chart:this.props.chart,edit:this.props.edit}),0<=["bar","column"].indexOf(e)&&wp.element.createElement(xs,{chart:this.props.chart,edit:this.props.edit}),0<=["candlestick"].indexOf(e)&&wp.element.createElement(Gs,{chart:this.props.chart,edit:this.props.edit}),0<=["geo"].indexOf(e)&&wp.element.createElement(tc,null,wp.element.createElement(li,{chart:this.props.chart,edit:this.props.edit}),wp.element.createElement(Yi,{chart:this.props.chart,edit:this.props.edit}),wp.element.createElement(Ri,{chart:this.props.chart,edit:this.props.edit}),wp.element.createElement(Xi,{chart:this.props.chart,edit:this.props.edit})),0<=["gauge"].indexOf(e)&&wp.element.createElement(Mo,{chart:this.props.chart,edit:this.props.edit}),0<=["timeline"].indexOf(e)&&wp.element.createElement(Po,{chart:this.props.chart,edit:this.props.edit}),0<=["tabular","dataTable"].indexOf(e)&&wp.element.createElement(tc,null,wp.element.createElement(Zo,{chart:this.props.chart,edit:this.props.edit}),wp.element.createElement(hl,{chart:this.props.chart,edit:this.props.edit})),0<=["combo"].indexOf(e)&&wp.element.createElement(Tl,{chart:this.props.chart,edit:this.props.edit}),-1>=["timeline","bubble","gauge","geo","pie","tabular","dataTable"].indexOf(e)&&wp.element.createElement(Vl,{chart:this.props.chart,edit:this.props.edit}),"tabular"===e&&"GoogleCharts"===t&&wp.element.createElement(Vl,{chart:this.props.chart,edit:this.props.edit}),0<=["bubble"].indexOf(e)&&wp.element.createElement(Yu,{chart:this.props.chart,edit:this.props.edit}),0<=["pie"].indexOf(e)&&wp.element.createElement(ou,{chart:this.props.chart,edit:this.props.edit}),"DataTable"===t&&wp.element.createElement(Ru,{chart:this.props.chart,edit:this.props.edit}),"DataTable"!==t&&wp.element.createElement(rd,{chart:this.props.chart,edit:this.props.edit}),wp.element.createElement(gd,{chart:this.props.chart,edit:this.props.edit}),"DataTable"!==t&&wp.element.createElement(Ud,{chart:this.props.chart,edit:this.props.edit}))}}])&&qd(t.prototype,n),a&&qd(t,a),s}(ec);function ac(e){return(ac="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 rc(e,t,n,a,r,s,i){try{var o=e[s](i),l=o.value}catch(e){return void n(e)}o.done?t(l):Promise.resolve(l).then(a,r)}function sc(e){return function(){var t=this,n=arguments;return new Promise((function(a,r){var s=e.apply(t,n);function i(e){rc(s,a,r,i,o,"next",e)}function o(e){rc(s,a,r,i,o,"throw",e)}i(void 0)}))}}function ic(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function oc(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function lc(e,t){return(lc=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function uc(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=mc(e);if(t){var r=mc(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return dc(this,n)}}function dc(e,t){if(t&&("object"===ac(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return cc(e)}function cc(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function mc(e){return(mc=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var _c=wp.i18n.__,hc=wp.apiFetch,pc=wp.element,fc=pc.Component,yc=pc.Fragment,Mc=wp.components,gc=Mc.Button,Lc=Mc.PanelBody,bc=Mc.SelectControl,vc=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&lc(e,t)}(o,e);var t,n,a,r,s,i=uc(o);function o(){var e;return ic(this,o),(e=i.apply(this,arguments)).getPermissionData=e.getPermissionData.bind(cc(e)),e.state={users:[],roles:[]},e}return t=o,(n=[{key:"componentDidMount",value:(s=sc(regeneratorRuntime.mark((function e(){var t,n,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("business"!==visualizerLocalize.isPro){e.next=14;break}if(void 0===(t=this.props.chart["visualizer-permissions"]).permissions){e.next=14;break}if(void 0===t.permissions.read||void 0===t.permissions.edit){e.next=14;break}if("users"!==t.permissions.read&&"users"!==t.permissions.edit){e.next=9;break}return e.next=7,hc({path:"/visualizer/v1/get-permission-data?type=users"});case 7:n=e.sent,this.setState({users:n});case 9:if("roles"!==t.permissions.read&&"roles"!==t.permissions.edit){e.next=14;break}return e.next=12,hc({path:"/visualizer/v1/get-permission-data?type=roles"});case 12:a=e.sent,this.setState({roles:a});case 14:case"end":return e.stop()}}),e,this)}))),function(){return s.apply(this,arguments)})},{key:"getPermissionData",value:(r=sc(regeneratorRuntime.mark((function e(t){var n,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("business"!==visualizerLocalize.isPro){e.next=11;break}if("users"!==t||0!==this.state.users.length){e.next=6;break}return e.next=4,hc({path:"/visualizer/v1/get-permission-data?type=".concat(t)});case 4:n=e.sent,this.setState({users:n});case 6:if("roles"!==t||0!==this.state.roles.length){e.next=11;break}return e.next=9,hc({path:"/visualizer/v1/get-permission-data?type=".concat(t)});case 9:a=e.sent,this.setState({roles:a});case 11:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-permissions"];return wp.element.createElement(yc,null,"business"===visualizerLocalize.isPro?wp.element.createElement(Lc,{title:_c("Who can see this chart?"),initialOpen:!1},wp.element.createElement(bc,{label:_c("Select who can view the chart on the front-end."),value:t.permissions.read,options:[{value:"all",label:"All Users"},{value:"users",label:"Select Users"},{value:"roles",label:"Select Roles"}],onChange:function(n){t.permissions.read=n,e.props.edit(t),"users"!==n&&"roles"!==n||e.getPermissionData(n)}}),("users"===t.permissions.read||"roles"===t.permissions.read)&&wp.element.createElement(bc,{multiple:!0,value:t.permissions["read-specific"],options:"users"===t.permissions.read&&this.state.users||"roles"===t.permissions.read&&this.state.roles,onChange:function(n){t.permissions["read-specific"]=n,e.props.edit(t)}})):wp.element.createElement(Lc,{title:_c("Who can see this chart?"),icon:"lock",initialOpen:!1},wp.element.createElement("p",null,_c("Upgrade your license to at least the DEVELOPER version to activate this feature!")),wp.element.createElement(gc,{isPrimary:!0,href:visualizerLocalize.proTeaser,target:"_blank"},_c("Buy Now"))),"business"===visualizerLocalize.isPro?wp.element.createElement(Lc,{title:_c("Who can edit this chart?"),initialOpen:!1},wp.element.createElement(bc,{label:_c("Select who can edit the chart on the front-end."),value:t.permissions.edit,options:[{value:"all",label:"All Users"},{value:"users",label:"Select Users"},{value:"roles",label:"Select Roles"}],onChange:function(n){t.permissions.edit=n,e.props.edit(t),"users"!==n&&"roles"!==n||e.getPermissionData(n)}}),("users"===t.permissions.edit||"roles"===t.permissions.edit)&&wp.element.createElement(bc,{multiple:!0,value:t.permissions["edit-specific"],options:"users"===t.permissions.edit&&this.state.users||"roles"===t.permissions.edit&&this.state.roles,onChange:function(n){t.permissions["edit-specific"]=n,e.props.edit(t)}})):wp.element.createElement(Lc,{title:_c("Who can edit this chart?"),icon:"lock",initialOpen:!1},wp.element.createElement("p",null,_c("Upgrade your license to at least the DEVELOPER version to activate this feature!")),wp.element.createElement(gc,{isPrimary:!0,href:visualizerLocalize.proTeaser,target:"_blank"},_c("Buy Now"))))}}])&&oc(t.prototype,n),a&&oc(t,a),o}(fc),Yc=n(270),wc=n.n(Yc),kc=wp.components,Dc=kc.Button,Tc=kc.Dashicon,Sc=kc.G,jc=kc.Path,Oc=kc.SVG;var xc=function(e){var t=e.label,n=e.icon,a=e.className,r=e.isBack,s=e.onClick,i=wc()("components-panel__body","components-panel__body-button",a,{"visualizer-panel-back":r});return wp.element.createElement("div",{className:i},wp.element.createElement("h2",{className:"components-panel__body-title"},wp.element.createElement(Dc,{className:"components-panel__body-toggle",onClick:s},wp.element.createElement(Oc,{className:"components-panel__arrow",width:"24px",height:"24px",viewBox:"-12 -12 48 48",xmlns:"http://www.w3.org/2000/svg"},wp.element.createElement(Sc,null,wp.element.createElement(jc,{fill:"none",d:"M0,0h24v24H0V0z"})),wp.element.createElement(Sc,null,wp.element.createElement(jc,{d:"M7.41,8.59L12,13.17l4.59-4.58L18,10l-6,6l-6-6L7.41,8.59z"}))),n&&wp.element.createElement(Tc,{icon:n,className:"components-panel__icon"}),t)))},Hc=n(4),Ec=n.n(Hc);function Pc(e){return(Pc="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 Cc(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function zc(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function Ac(e,t){return(Ac=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Wc(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=Fc(e);if(t){var r=Fc(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return Rc(this,n)}}function Rc(e,t){if(t&&("object"===Pc(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Fc(e){return(Fc=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Nc=lodash.startCase,Ic=wp.i18n.__,Jc=wp.element,Bc=Jc.Component,Uc=Jc.Fragment,Vc=(wp.blockEditor||wp.editor).InspectorControls,Gc=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ac(e,t)}(s,e);var t,n,a,r=Wc(s);function s(){var e;return Cc(this,s),(e=r.apply(this,arguments)).state={route:"home"},e}return t=s,(n=[{key:"render",value:function(){var e,t,n=this,a="undefined"!=typeof google?google.visualization.Version:"current",r=G(JSON.parse(JSON.stringify(this.props.chart)));return 0<=["gauge","tabular","timeline"].indexOf(this.props.chart["visualizer-chart-type"])?"DataTable"===r["visualizer-chart-library"]?e=r["visualizer-chart-type"]:("tabular"===(e=this.props.chart["visualizer-chart-type"])&&(e="table"),e=Nc(e)):e="".concat(Nc(this.props.chart["visualizer-chart-type"]),"Chart"),r["visualizer-data-exploded"]&&(t=Ic("Annotations in this chart may not display here but they will display in the front end.")),wp.element.createElement(Uc,null,"home"===this.state.route&&wp.element.createElement(Vc,null,wp.element.createElement(Fe,{chart:this.props.chart,readUploadedFile:this.props.readUploadedFile}),wp.element.createElement(St,{id:this.props.id,chart:this.props.chart,editURL:this.props.editURL,isLoading:this.props.isLoading,uploadData:this.props.uploadData,editSchedule:this.props.editSchedule,editJSONSchedule:this.props.editJSONSchedule,editJSONURL:this.props.editJSONURL,editJSONHeaders:this.props.editJSONHeaders,editJSONRoot:this.props.editJSONRoot,editJSONPaging:this.props.editJSONPaging,JSONImportData:this.props.JSONImportData}),wp.element.createElement(qt,{getChartData:this.props.getChartData,isLoading:this.props.isLoading}),wp.element.createElement(jn,{chart:this.props.chart,editSchedule:this.props.editDatabaseSchedule,databaseImportData:this.props.databaseImportData}),wp.element.createElement(ia,{chart:this.props.chart,editChartData:this.props.editChartData}),wp.element.createElement(xc,{label:Ic("Advanced Options"),className:"visualizer-advanced-options",icon:"admin-tools",onClick:function(){return n.setState({route:"showAdvanced"})}}),wp.element.createElement(xc,{label:Ic("Chart Permissions"),icon:"admin-users",onClick:function(){return n.setState({route:"showPermissions"})}})),("showAdvanced"===this.state.route||"showPermissions"===this.state.route)&&wp.element.createElement(Vc,null,wp.element.createElement(xc,{label:Ic("Chart Settings"),onClick:function(){return n.setState({route:"home"})},isBack:!0}),"showAdvanced"===this.state.route&&wp.element.createElement(nc,{chart:this.props.chart,attributes:this.props.attributes,edit:this.props.editSettings}),"showPermissions"===this.state.route&&wp.element.createElement(vc,{chart:this.props.chart,edit:this.props.editPermissions})),wp.element.createElement("div",{className:"visualizer-settings__chart","data-chart-type":e},null!==this.props.chart&&"DataTable"===r["visualizer-chart-library"]?wp.element.createElement(I,{id:this.props.id,rows:r["visualizer-data"],columns:r["visualizer-series"],options:r["visualizer-settings"]}):(r["visualizer-data-exploded"],wp.element.createElement(S,{chartVersion:a,chartType:e,rows:r["visualizer-data"],columns:r["visualizer-series"],options:Z(this.props.chart["visualizer-settings"].manual)?Ec()(K(this.props.chart["visualizer-settings"]),JSON.parse(this.props.chart["visualizer-settings"].manual)):K(this.props.chart["visualizer-settings"]),height:"500px",formatters:X(r)})),wp.element.createElement("div",{className:"visualizer-settings__charts-footer"},wp.element.createElement("sub",null,t))))}}])&&zc(t.prototype,n),a&&zc(t,a),s}(Bc);function qc(e){return(qc="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 Kc(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $c(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function Zc(e,t){return(Zc=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Qc(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=em(e);if(t){var r=em(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return Xc(this,n)}}function Xc(e,t){if(t&&("object"===qc(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function em(e){return(em=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var tm=lodash.startCase,nm=wp.i18n.__,am=wp.element,rm=am.Component,sm=am.Fragment,im=wp.components,om=im.Button,lm=im.Dashicon,um=im.Toolbar,dm=im.Tooltip,cm=(wp.blockEditor||wp.editor).BlockControls,mm=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Zc(e,t)}(s,e);var t,n,a,r=Qc(s);function s(){return Kc(this,s),r.apply(this,arguments)}return t=s,(n=[{key:"render",value:function(){var e,t,n="undefined"!=typeof google?google.visualization.Version:"current",a=G(JSON.parse(JSON.stringify(this.props.chart)));return 0<=["gauge","tabular","timeline"].indexOf(this.props.chart["visualizer-chart-type"])?"DataTable"===a["visualizer-chart-library"]?e=a["visualizer-chart-type"]:("tabular"===(e=this.props.chart["visualizer-chart-type"])&&(e="table"),e=tm(e)):e="".concat(tm(this.props.chart["visualizer-chart-type"]),"Chart"),a["visualizer-data-exploded"]&&(t=nm("Annotations in this chart may not display here but they will display in the front end.")),this.props.chart["visualizer-series"]&&0<=["date","datetime","timeofday"].indexOf(this.props.chart["visualizer-series"][0].type)&&this.props.chart["visualizer-settings"]&&""==this.props.chart["visualizer-settings"].hAxis.format&&(this.props.chart["visualizer-settings"].hAxis.format="YYYY-MM-dd"),wp.element.createElement("div",{className:this.props.className},null!==this.props.chart&&wp.element.createElement(sm,null,wp.element.createElement(cm,{key:"toolbar-controls"},wp.element.createElement(um,{className:"components-toolbar"},wp.element.createElement(dm,{text:nm("Edit Chart")},wp.element.createElement(om,{className:"components-icon-button components-toolbar__control edit-pie-chart",onClick:this.props.editChart},wp.element.createElement(lm,{icon:"edit"}))))),"DataTable"===a["visualizer-chart-library"]?wp.element.createElement(I,{id:this.props.id,rows:a["visualizer-data"],columns:a["visualizer-series"],options:a["visualizer-settings"]}):(a["visualizer-data-exploded"],wp.element.createElement(S,{chartVersion:n,chartType:e,rows:a["visualizer-data"],columns:a["visualizer-series"],options:Z(this.props.chart["visualizer-settings"].manual)?Ec()(K(this.props.chart["visualizer-settings"]),JSON.parse(this.props.chart["visualizer-settings"].manual)):K(this.props.chart["visualizer-settings"]),height:"500px",formatters:X(a)})),wp.element.createElement("div",{className:"visualizer-settings__charts-footer"},wp.element.createElement("sub",null,t))))}}])&&$c(t.prototype,n),a&&$c(t,a),s}(rm);function _m(e){return(_m="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 hm(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function pm(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?hm(Object(n),!0).forEach((function(t){fm(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hm(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function fm(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ym(e,t,n,a,r,s,i){try{var o=e[s](i),l=o.value}catch(e){return void n(e)}o.done?t(l):Promise.resolve(l).then(a,r)}function Mm(e){return function(){var t=this,n=arguments;return new Promise((function(a,r){var s=e.apply(t,n);function i(e){ym(s,a,r,i,o,"next",e)}function o(e){ym(s,a,r,i,o,"throw",e)}i(void 0)}))}}function gm(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Lm(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function bm(e,t){return(bm=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function vm(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=km(e);if(t){var r=km(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return Ym(this,n)}}function Ym(e,t){if(t&&("object"===_m(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return wm(e)}function wm(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function km(e){return(km=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Dm=wp.i18n.__,Tm=wp,Sm=Tm.apiFetch,jm=Tm.apiRequest,Om=wp.element,xm=Om.Component,Hm=Om.Fragment,Em=wp.components,Pm=Em.Button,Cm=Em.ButtonGroup,zm=Em.Dashicon,Am=Em.Placeholder,Wm=Em.Notice,Rm=Em.Spinner,Fm=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&bm(e,t)}(l,e);var t,n,a,r,s,i,o=vm(l);function l(){var e;return gm(this,l),(e=o.apply(this,arguments)).getChart=e.getChart.bind(wm(e)),e.editChart=e.editChart.bind(wm(e)),e.editSettings=e.editSettings.bind(wm(e)),e.editPermissions=e.editPermissions.bind(wm(e)),e.readUploadedFile=e.readUploadedFile.bind(wm(e)),e.editURL=e.editURL.bind(wm(e)),e.editSchedule=e.editSchedule.bind(wm(e)),e.editJSONSchedule=e.editJSONSchedule.bind(wm(e)),e.editJSONURL=e.editJSONURL.bind(wm(e)),e.editJSONHeaders=e.editJSONHeaders.bind(wm(e)),e.editJSONRoot=e.editJSONRoot.bind(wm(e)),e.editJSONPaging=e.editJSONPaging.bind(wm(e)),e.JSONImportData=e.JSONImportData.bind(wm(e)),e.editDatabaseSchedule=e.editDatabaseSchedule.bind(wm(e)),e.databaseImportData=e.databaseImportData.bind(wm(e)),e.uploadData=e.uploadData.bind(wm(e)),e.getChartData=e.getChartData.bind(wm(e)),e.editChartData=e.editChartData.bind(wm(e)),e.updateChart=e.updateChart.bind(wm(e)),e.state={route:e.props.attributes.route?e.props.attributes.route:"home",chart:null,isModified:!1,isLoading:!1,isScheduled:!1},e}return t=l,(n=[{key:"componentDidMount",value:(i=Mm(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.props.attributes.id){e.next=5;break}return e.next=3,Sm({path:"wp/v2/visualizer/".concat(this.props.attributes.id)}).catch((function(e){}));case 3:(t=e.sent)?this.setState({chart:t.chart_data}):this.setState({route:"error"});case 5:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"getChart",value:(s=Mm(regeneratorRuntime.mark((function e(t){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.setState({isLoading:"getChart"});case 2:return e.next=4,Sm({path:"wp/v2/visualizer/".concat(t)});case 4:n=e.sent,this.setState({route:"chartSelect",chart:n.chart_data,isLoading:!0,isModified:!0}),this.props.setAttributes({id:t,route:"chartSelect",lazy:-1});case 7:case"end":return e.stop()}}),e,this)}))),function(e){return s.apply(this,arguments)})},{key:"editChart",value:function(){this.setState({route:"chartSelect"}),this.props.setAttributes({route:"chartSelect"})}},{key:"editSettings",value:function(e){var t=pm({},this.state.chart);t["visualizer-settings"]=e,this.setState({chart:t,isModified:!0})}},{key:"editPermissions",value:function(e){var t=pm({},this.state.chart);t["visualizer-permissions"]=e,this.setState({chart:t,isModified:!0})}},{key:"readUploadedFile",value:function(e){var t=this,n=e.current.files[0],a=new FileReader;a.onload=function(){var e=function(e,t){t=t||",";for(var n=new RegExp("(\\"+t+"|\\r?\\n|\\r|^)(?:'([^']*(?:''[^']*)*)'|([^'\\"+t+"\\r\\n]*))","gi"),a=[[]],r=null;r=n.exec(e);){var s=r[1];s.length&&s!==t&&a.push([]);var i=void 0;i=r[2]?r[2].replace(new RegExp("''","g"),"'"):r[3],a[a.length-1].push(i)}return a}(a.result);t.editChartData(e,"Visualizer_Source_Csv")},a.readAsText(n)}},{key:"editURL",value:function(e){var t=pm({},this.state.chart);t["visualizer-chart-url"]=e,this.setState({chart:t})}},{key:"editSchedule",value:function(e){var t=pm({},this.state.chart);t["visualizer-chart-schedule"]=e,this.setState({chart:t,isModified:!0})}},{key:"editJSONSchedule",value:function(e){var t=pm({},this.state.chart);t["visualizer-json-schedule"]=e,this.setState({chart:t,isModified:!0})}},{key:"editJSONURL",value:function(e){var t=pm({},this.state.chart);t["visualizer-json-url"]=e,this.setState({chart:t})}},{key:"editJSONHeaders",value:function(e){var t=pm({},this.state.chart);delete e.username,delete e.password,t["visualizer-json-headers"]=e,this.setState({chart:t})}},{key:"editJSONRoot",value:function(e){var t=pm({},this.state.chart);t["visualizer-json-root"]=e,this.setState({chart:t})}},{key:"editJSONPaging",value:function(e){var t=pm({},this.state.chart);t["visualizer-json-paging"]=e,this.setState({chart:t})}},{key:"JSONImportData",value:function(e,t,n){var a=pm({},this.state.chart);a["visualizer-source"]=e,a["visualizer-default-data"]=0,a["visualizer-series"]=t,a["visualizer-data"]=n,this.setState({chart:a,isModified:!0})}},{key:"editDatabaseSchedule",value:function(e){var t=pm({},this.state.chart);t["visualizer-db-schedule"]=e,this.setState({chart:t,isModified:!0})}},{key:"databaseImportData",value:function(e,t,n,a){var r=pm({},this.state.chart);r["visualizer-source"]=t,r["visualizer-default-data"]=0,r["visualizer-series"]=n,r["visualizer-data"]=a,r["visualizer-db-query"]=e,this.setState({chart:r,isModified:!0})}},{key:"uploadData",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.setState({isLoading:"uploadData",isScheduled:t}),jm({path:"/visualizer/v1/upload-data?url=".concat(this.state.chart["visualizer-chart-url"]),method:"POST"}).then((function(t){if(2<=Object.keys(t).length){var n=pm({},e.state.chart);n["visualizer-source"]="Visualizer_Source_Csv_Remote",n["visualizer-default-data"]=0,n["visualizer-series"]=t.series,n["visualizer-data"]=t.data;var a=n["visualizer-series"],r=n["visualizer-settings"],s=a,i="series";return"pie"===n["visualizer-chart-type"]&&(s=n["visualizer-data"],i="slices"),s.map((function(e,t){if("pie"===n["visualizer-chart-type"]||0!==t){var a="pie"!==n["visualizer-chart-type"]?t-1:t;void 0===r[i][a]&&(r[i][a]={},r[i][a].temp=1)}})),r[i]=r[i].filter((function(e,t){return t<("pie"!==n["visualizer-chart-type"]?s.length-1:s.length)})),n["visualizer-settings"]=r,e.setState({chart:n,isModified:!0,isLoading:!1}),t}e.setState({isLoading:!1})}),(function(t){return e.setState({isLoading:!1}),t}))}},{key:"getChartData",value:(r=Mm(regeneratorRuntime.mark((function e(t){var n,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.setState({isLoading:"getChartData"});case 2:return e.next=4,Sm({path:"wp/v2/visualizer/".concat(t)});case 4:n=e.sent,(a=pm({},this.state.chart))["visualizer-source"]="Visualizer_Source_Csv",a["visualizer-default-data"]=0,a["visualizer-series"]=n.chart_data["visualizer-series"],a["visualizer-data"]=n.chart_data["visualizer-data"],this.setState({isLoading:!1,chart:a});case 11:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"editChartData",value:function(e,t){var n=pm({},this.state.chart),a=[],r=pm({},n["visualizer-settings"]),s=n["visualizer-chart-type"];e[0].map((function(t,n){a[n]={label:t,type:e[1][n]}})),e.splice(0,2);var i=a,o="series";switch(s){case"pie":i=e,o="slices",e.map((function(e,t){switch(a[1].type){case"number":e[1]=parseFloat(e[1])}}));break;case"tabular":e.map((function(e,t){a.map((function(t,n){switch(t.type){case"boolean":"string"==typeof e[n]&&(e[n]="true"===e[n])}}))}))}i.map((function(e,t){if("pie"===s||0!==t){var n="pie"!==s?t-1:t;Array.isArray(r[o])&&void 0===r[o][n]&&(r[o][n]={},r[o][n].temp=1)}})),Array.isArray(r[o])&&(r[o]=r[o].filter((function(e,t){return t<(-1>=["pie","tabular","dataTable"].indexOf(s)?i.length-1:i.length)}))),n["visualizer-source"]=t,n["visualizer-default-data"]=0,n["visualizer-data"]=e,n["visualizer-series"]=a,n["visualizer-settings"]=r,n["visualizer-chart-url"]="",this.setState({chart:n,isModified:!0,isScheduled:!1})}},{key:"updateChart",value:function(){var e=this;this.setState({isLoading:"updateChart"});var t=this.state.chart;!1===this.state.isScheduled&&(t["visualizer-chart-schedule"]="");var n="series";"pie"===t["visualizer-chart-type"]&&(n="slices"),-1>=["bubble","timeline"].indexOf(t["visualizer-chart-type"])&&Object.keys(t["visualizer-settings"][n]).map((function(e){void 0!==t["visualizer-settings"][n][e]&&void 0!==t["visualizer-settings"][n][e].temp&&delete t["visualizer-settings"][n][e].temp})),jm({path:"/visualizer/v1/update-chart?id=".concat(this.props.attributes.id),method:"POST",data:t}).then((function(t){return e.setState({isLoading:!1,isModified:!1}),t}),(function(e){return e}))}},{key:"render",value:function(){var e=this;return"error"===this.state.route?wp.element.createElement(Wm,{status:"error",isDismissible:!1},wp.element.createElement(zm,{icon:"chart-pie"}),Dm("This chart is not available; it might have been deleted. Please delete this block and resubmit your chart.")):"renderChart"===this.state.route&&null!==this.state.chart?wp.element.createElement(mm,{id:this.props.attributes.id,chart:this.state.chart,className:this.props.className,editChart:this.editChart}):wp.element.createElement("div",{className:"visualizer-settings"},wp.element.createElement("div",{className:"visualizer-settings__title"},wp.element.createElement(zm,{icon:"chart-pie"}),Dm("Visualizer")),"home"===this.state.route&&wp.element.createElement("div",{className:"visualizer-settings__content"},wp.element.createElement("div",{className:"visualizer-settings__content-description"},Dm("Make a new chart or display an existing one?")),wp.element.createElement("a",{href:visualizerLocalize.adminPage,target:"_blank",className:"visualizer-settings__content-option"},wp.element.createElement("span",{className:"visualizer-settings__content-option-title"},Dm("Create a new chart")),wp.element.createElement("div",{className:"visualizer-settings__content-option-icon"},wp.element.createElement(zm,{icon:"arrow-right-alt2"}))),wp.element.createElement("div",{className:"visualizer-settings__content-option",onClick:function(){e.setState({route:"showCharts"}),e.props.setAttributes({route:"showCharts"})}},wp.element.createElement("span",{className:"visualizer-settings__content-option-title"},Dm("Display an existing chart")),wp.element.createElement("div",{className:"visualizer-settings__content-option-icon"},wp.element.createElement(zm,{icon:"arrow-right-alt2"})))),("getChart"===this.state.isLoading||"chartSelect"===this.state.route&&null===this.state.chart||"renderChart"===this.state.route&&null===this.state.chart)&&wp.element.createElement(Am,null,wp.element.createElement(Rm,null)),"showCharts"===this.state.route&&!1===this.state.isLoading&&wp.element.createElement(ke,{getChart:this.getChart}),"chartSelect"===this.state.route&&null!==this.state.chart&&wp.element.createElement(Gc,{id:this.props.attributes.id,attributes:this.props.attributes,chart:this.state.chart,editSettings:this.editSettings,editPermissions:this.editPermissions,url:this.state.url,readUploadedFile:this.readUploadedFile,editURL:this.editURL,editSchedule:this.editSchedule,editJSONURL:this.editJSONURL,editJSONHeaders:this.editJSONHeaders,editJSONSchedule:this.editJSONSchedule,editJSONRoot:this.editJSONRoot,editJSONPaging:this.editJSONPaging,JSONImportData:this.JSONImportData,editDatabaseSchedule:this.editDatabaseSchedule,databaseImportData:this.databaseImportData,uploadData:this.uploadData,getChartData:this.getChartData,editChartData:this.editChartData,isLoading:this.state.isLoading}),wp.element.createElement("div",{className:"visualizer-settings__controls"},("showCharts"===this.state.route||"chartSelect"===this.state.route)&&wp.element.createElement(Cm,null,wp.element.createElement(Pm,{isDefault:!0,isLarge:!0,onClick:function(){var t;"showCharts"===e.state.route?t="home":"chartSelect"===e.state.route&&(t="showCharts"),e.setState({route:t}),e.props.setAttributes({route:t})}},Dm("Back")),"chartSelect"===this.state.route&&wp.element.createElement(Hm,null,!1===this.state.isModified?wp.element.createElement(Pm,{isDefault:!0,isLarge:!0,className:"visualizer-bttn-done",onClick:function(){e.setState({route:"renderChart",isModified:!0}),e.props.setAttributes({route:"renderChart"})}},Dm("Done")):wp.element.createElement(Pm,{isPrimary:!0,isLarge:!0,className:"visualizer-bttn-save",isBusy:"updateChart"===this.state.isLoading,disabled:"updateChart"===this.state.isLoading,onClick:this.updateChart},Dm("Save"))))))}}])&&Lm(t.prototype,n),a&&Lm(t,a),l}(xm),Nm=(n(290),wp.i18n.__),Im=wp.blocks.registerBlockType;t.default=Im("visualizer/chart",{title:Nm("Visualizer Chart"),description:Nm("A simple, easy to use and quite powerful tool to create, manage and embed interactive charts into your WordPress posts and pages."),category:"common",icon:"chart-pie",keywords:[Nm("Visualizer"),Nm("Chart"),Nm("Google Charts")],attributes:{id:{type:"number"},lazy:{default:"-1",type:"string"},route:{type:"string"}},supports:{customClassName:!1},edit:Fm,save:function(){return null}})}]);
333
  *
334
  * Copyright © 2014 David Bushell | BSD & MIT license | https://github.com/dbushell/Pikaday
335
  */
336
+ !function(t,a){"use strict";var r;try{r=n(0)}catch(e){}e.exports=function(e){var t="function"==typeof e,n=!!window.addEventListener,a=window.document,r=window.setTimeout,s=function(e,t,a,r){n?e.addEventListener(t,a,!!r):e.attachEvent("on"+t,a)},i=function(e,t,a,r){n?e.removeEventListener(t,a,!!r):e.detachEvent("on"+t,a)},o=function(e,t,n){var r;a.createEvent?((r=a.createEvent("HTMLEvents")).initEvent(t,!0,!1),r=f(r,n),e.dispatchEvent(r)):a.createEventObject&&(r=a.createEventObject(),r=f(r,n),e.fireEvent("on"+t,r))},l=function(e,t){return-1!==(" "+e.className+" ").indexOf(" "+t+" ")},u=function(e){return/Array/.test(Object.prototype.toString.call(e))},d=function(e){return/Date/.test(Object.prototype.toString.call(e))&&!isNaN(e.getTime())},c=function(e){var t=e.getDay();return 0===t||6===t},m=function(e){return e%4==0&&e%100!=0||e%400==0},_=function(e,t){return[31,m(e)?29:28,31,30,31,30,31,31,30,31,30,31][t]},h=function(e){d(e)&&e.setHours(0,0,0,0)},p=function(e,t){return e.getTime()===t.getTime()},f=function(e,t,n){var a,r;for(a in t)(r=void 0!==e[a])&&"object"==typeof t[a]&&null!==t[a]&&void 0===t[a].nodeName?d(t[a])?n&&(e[a]=new Date(t[a].getTime())):u(t[a])?n&&(e[a]=t[a].slice(0)):e[a]=f({},t[a],n):!n&&r||(e[a]=t[a]);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},M={field:null,bound:void 0,position:"bottom left",reposition:!0,format:"YYYY-MM-DD",defaultDate:null,setDefaultDate:!1,firstDay:0,formatStrict:!1,minDate:null,maxDate:null,yearRange:10,showWeekNumber:!1,minYear:0,maxYear:9999,minMonth:void 0,maxMonth:void 0,startRange:null,endRange:null,isRTL:!1,yearSuffix:"",showMonthAfterYear:!1,showDaysInNextAndPreviousMonths:!1,numberOfMonths:1,mainCalendar:"left",container:void 0,i18n:{previousMonth:"Previous Month",nextMonth:"Next Month",months:["January","February","March","April","May","June","July","August","September","October","November","December"],weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},theme:null,onSelect:null,onOpen:null,onClose:null,onDraw:null},g=function(e,t,n){for(t+=e.firstDay;t>=7;)t-=7;return n?e.i18n.weekdaysShort[t]:e.i18n.weekdays[t]},L=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>"},b=function(e,t){return"<tr>"+(t?e.reverse():e).join("")+"</tr>"},v=function(e,t,n,a,r,s){var i,o,l,d,c,m=e._o,_=n===m.minYear,h=n===m.maxYear,p='<div id="'+s+'" class="pika-title" role="heading" aria-live="assertive">',f=!0,y=!0;for(l=[],i=0;i<12;i++)l.push('<option value="'+(n===r?i-t:12+i-t)+'"'+(i===a?' selected="selected"':"")+(_&&i<m.minMonth||h&&i>m.maxMonth?'disabled="disabled"':"")+">"+m.i18n.months[i]+"</option>");for(d='<div class="pika-label">'+m.i18n.months[a]+'<select class="pika-select pika-select-month" tabindex="-1">'+l.join("")+"</select></div>",u(m.yearRange)?(i=m.yearRange[0],o=m.yearRange[1]+1):(i=n-m.yearRange,o=1+n+m.yearRange),l=[];i<o&&i<=m.maxYear;i++)i>=m.minYear&&l.push('<option value="'+i+'"'+(i===n?' selected="selected"':"")+">"+i+"</option>");return c='<div class="pika-label">'+n+m.yearSuffix+'<select class="pika-select pika-select-year" tabindex="-1">'+l.join("")+"</select></div>",m.showMonthAfterYear?p+=c+d:p+=d+c,_&&(0===a||m.minMonth>=a)&&(f=!1),h&&(11===a||m.maxMonth<=a)&&(y=!1),0===t&&(p+='<button class="pika-prev'+(f?"":" is-disabled")+'" type="button">'+m.i18n.previousMonth+"</button>"),t===e._o.numberOfMonths-1&&(p+='<button class="pika-next'+(y?"":" is-disabled")+'" type="button">'+m.i18n.nextMonth+"</button>"),p+"</div>"},Y=function(i){var o=this,u=o.config(i);o._onMouseDown=function(e){if(o._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")?o.prevMonth():l(t,"pika-next")&&o.nextMonth():(o.setDate(new Date(t.getAttribute("data-pika-year"),t.getAttribute("data-pika-month"),t.getAttribute("data-pika-day"))),u.bound&&r((function(){o.hide(),u.field&&u.field.blur()}),100))),l(t,"pika-select"))o._c=!0;else{if(!e.preventDefault)return e.returnValue=!1,!1;e.preventDefault()}}},o._onChange=function(e){var t=(e=e||window.event).target||e.srcElement;t&&(l(t,"pika-select-month")?o.gotoMonth(t.value):l(t,"pika-select-year")&&o.gotoYear(t.value))},o._onKeyChange=function(e){if(e=e||window.event,o.isVisible())switch(e.keyCode){case 13:case 27:u.field.blur();break;case 37:e.preventDefault(),o.adjustDate("subtract",1);break;case 38:o.adjustDate("subtract",7);break;case 39:o.adjustDate("add",1);break;case 40:o.adjustDate("add",7)}},o._onInputChange=function(n){var a;n.firedBy!==o&&(a=t?(a=e(u.field.value,u.format,u.formatStrict))&&a.isValid()?a.toDate():null:new Date(Date.parse(u.field.value)),d(a)&&o.setDate(a),o._v||o.show())},o._onInputFocus=function(){o.show()},o._onInputClick=function(){o.show()},o._onInputBlur=function(){var e=a.activeElement;do{if(l(e,"pika-single"))return}while(e=e.parentNode);o._c||(o._b=r((function(){o.hide()}),50)),o._c=!1},o._onClick=function(e){var t=(e=e||window.event).target||e.srcElement,a=t;if(t){!n&&l(t,"pika-select")&&(t.onchange||(t.setAttribute("onchange","return;"),s(t,"change",o._onChange)));do{if(l(a,"pika-single")||a===u.trigger)return}while(a=a.parentNode);o._v&&t!==u.trigger&&a!==u.trigger&&o.hide()}},o.el=a.createElement("div"),o.el.className="pika-single"+(u.isRTL?" is-rtl":"")+(u.theme?" "+u.theme:""),s(o.el,"mousedown",o._onMouseDown,!0),s(o.el,"touchend",o._onMouseDown,!0),s(o.el,"change",o._onChange),s(a,"keydown",o._onKeyChange),u.field&&(u.container?u.container.appendChild(o.el):u.bound?a.body.appendChild(o.el):u.field.parentNode.insertBefore(o.el,u.field.nextSibling),s(u.field,"change",o._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 c=u.defaultDate;d(c)?u.setDefaultDate?o.setDate(c,!0):o.gotoDate(c):o.gotoDate(new Date),u.bound?(this.hide(),o.el.className+=" is-bound",s(u.trigger,"click",o._onInputClick),s(u.trigger,"focus",o._onInputFocus),s(u.trigger,"blur",o._onInputBlur)):this.show()};return Y.prototype={config:function(e){this._o||(this._o=f({},M,!0));var t=f(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,d(t.minDate)||(t.minDate=!1),d(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 a=(new Date).getFullYear()-10;t.yearRange[0]=parseInt(t.yearRange[0],10)||a,t.yearRange[1]=parseInt(t.yearRange[1],10)||a}else t.yearRange=Math.abs(parseInt(t.yearRange,10))||M.yearRange,t.yearRange>100&&(t.yearRange=100);return t},toString:function(n){return d(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,a){t&&e.isMoment(n)&&this.setDate(n.toDate(),a)},getDate:function(){return d(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="",o(this._o.field,"change",{firedBy:this})),this.draw();if("string"==typeof e&&(e=new Date(Date.parse(e))),d(e)){var n=this._o.minDate,a=this._o.maxDate;d(n)&&e<n?e=n:d(a)&&e>a&&(e=a),this._d=new Date(e.getTime()),h(this._d),this.gotoDate(this._d),this._o.field&&(this._o.field.value=this.toString(),o(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(d(e)){if(this.calendars){var n=new Date(this.calendars[0].year,this.calendars[0].month,1),a=new Date(this.calendars[this.calendars.length-1].year,this.calendars[this.calendars.length-1].month,1),r=e.getTime();a.setMonth(a.getMonth()+1),a.setDate(a.getDate()-1),t=r<n.getTime()||a.getTime()<r}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,a){var r,s=this.getDate(),i=24*parseInt(a)*60*60*1e3;"add"===n?r=new Date(s.valueOf()+i):"subtract"===n&&(r=new Date(s.valueOf()-i)),t&&("add"===n?r=e(s).add(a,"days").toDate():"subtract"===n&&(r=e(s).subtract(a,"days").toDate())),this.setDate(r)},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=M.minDate,this._o.minYear=M.minYear,this._o.minMonth=M.minMonth,this._o.startRange=M.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=M.maxDate,this._o.maxYear=M.maxYear,this._o.maxMonth=M.maxMonth,this._o.endRange=M.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,a=n.minYear,s=n.maxYear,i=n.minMonth,o=n.maxMonth,l="";this._y<=a&&(this._y=a,!isNaN(i)&&this._m<i&&(this._m=i)),this._y>=s&&(this._y=s,!isNaN(o)&&this._m>o&&(this._m=o)),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">'+v(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&&r((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,r,s,i,o,l,u,d;if(!this._o.container){if(this.el.style.position="absolute",t=e=this._o.trigger,n=this.el.offsetWidth,r=this.el.offsetHeight,s=window.innerWidth||a.documentElement.clientWidth,i=window.innerHeight||a.documentElement.clientHeight,o=window.pageYOffset||a.body.scrollTop||a.documentElement.scrollTop,"function"==typeof e.getBoundingClientRect)l=(d=e.getBoundingClientRect()).left+window.pageXOffset,u=d.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>s||this._o.position.indexOf("right")>-1&&l-n+e.offsetWidth>0)&&(l=l-n+e.offsetWidth),(this._o.reposition&&u+r>i+o||this._o.position.indexOf("top")>-1&&u-r-e.offsetHeight>0)&&(u=u-r-e.offsetHeight),this.el.style.left=l+"px",this.el.style.top=u+"px"}},render:function(e,t,n){var a=this._o,r=new Date,s=_(e,t),i=new Date(e,t,1).getDay(),o=[],l=[];h(r),a.firstDay>0&&(i-=a.firstDay)<0&&(i+=7);for(var u,m,f,y,M=0===t?11:t-1,v=11===t?0:t+1,Y=0===t?e-1:e,w=11===t?e+1:e,k=_(Y,M),D=s+i,T=D;T>7;)T-=7;D+=7-T;for(var S=0,j=0;S<D;S++){var O=new Date(e,t,S-i+1),x=!!d(this._d)&&p(O,this._d),H=p(O,r),E=S<i||S>=s+i,P=S-i+1,C=t,z=e,A=a.startRange&&p(a.startRange,O),W=a.endRange&&p(a.endRange,O),R=a.startRange&&a.endRange&&a.startRange<O&&O<a.endRange;E&&(S<i?(P=k+P,C=M,z=Y):(P-=s,C=v,z=w));var F={day:P,month:C,year:z,isSelected:x,isToday:H,isDisabled:a.minDate&&O<a.minDate||a.maxDate&&O>a.maxDate||a.disableWeekends&&c(O)||a.disableDayFn&&a.disableDayFn(O),isEmpty:E,isStartRange:A,isEndRange:W,isInRange:R,showDaysInNextAndPreviousMonths:a.showDaysInNextAndPreviousMonths};l.push(L(F)),7==++j&&(a.showWeekNumber&&l.unshift((u=S-i,m=t,f=e,y=void 0,void 0,y=new Date(f,0,1),'<td class="pika-week">'+Math.ceil(((new Date(f,m,u)-y)/864e5+y.getDay()+1)/7)+"</td>")),o.push(b(l,a.isRTL)),l=[],j=0)}return function(e,t,n){return'<table cellpadding="0" cellspacing="0" class="pika-table" role="grid" aria-labelledby="'+n+'">'+function(e){var t,n=[];e.showWeekNumber&&n.push("<th></th>");for(t=0;t<7;t++)n.push('<th scope="col"><abbr title="'+g(e,t)+'">'+g(e,t,!0)+"</abbr></th>");return"<thead><tr>"+(e.isRTL?n.reverse():n).join("")+"</tr></thead>"}(e)+(a=t,"<tbody>"+a.join("")+"</tbody></table>");var a}(a,o,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&&(s(a,"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&&i(a,"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(),i(this.el,"mousedown",this._onMouseDown,!0),i(this.el,"touchend",this._onMouseDown,!0),i(this.el,"change",this._onChange),this._o.field&&(i(this._o.field,"change",this._onInputChange),this._o.bound&&(i(this._o.trigger,"click",this._onInputClick),i(this._o.trigger,"focus",this._onInputFocus),i(this._o.trigger,"blur",this._onInputBlur))),this.el.parentNode&&this.el.parentNode.removeChild(this.el)}},Y}(r)}()},function(e,t,n){var a={"./af":130,"./af.js":130,"./ar":131,"./ar-dz":132,"./ar-dz.js":132,"./ar-kw":133,"./ar-kw.js":133,"./ar-ly":134,"./ar-ly.js":134,"./ar-ma":135,"./ar-ma.js":135,"./ar-sa":136,"./ar-sa.js":136,"./ar-tn":137,"./ar-tn.js":137,"./ar.js":131,"./az":138,"./az.js":138,"./be":139,"./be.js":139,"./bg":140,"./bg.js":140,"./bm":141,"./bm.js":141,"./bn":142,"./bn-bd":143,"./bn-bd.js":143,"./bn.js":142,"./bo":144,"./bo.js":144,"./br":145,"./br.js":145,"./bs":146,"./bs.js":146,"./ca":147,"./ca.js":147,"./cs":148,"./cs.js":148,"./cv":149,"./cv.js":149,"./cy":150,"./cy.js":150,"./da":151,"./da.js":151,"./de":152,"./de-at":153,"./de-at.js":153,"./de-ch":154,"./de-ch.js":154,"./de.js":152,"./dv":155,"./dv.js":155,"./el":156,"./el.js":156,"./en-au":157,"./en-au.js":157,"./en-ca":158,"./en-ca.js":158,"./en-gb":159,"./en-gb.js":159,"./en-ie":160,"./en-ie.js":160,"./en-il":161,"./en-il.js":161,"./en-in":162,"./en-in.js":162,"./en-nz":163,"./en-nz.js":163,"./en-sg":164,"./en-sg.js":164,"./eo":165,"./eo.js":165,"./es":166,"./es-do":167,"./es-do.js":167,"./es-mx":168,"./es-mx.js":168,"./es-us":169,"./es-us.js":169,"./es.js":166,"./et":170,"./et.js":170,"./eu":171,"./eu.js":171,"./fa":172,"./fa.js":172,"./fi":173,"./fi.js":173,"./fil":174,"./fil.js":174,"./fo":175,"./fo.js":175,"./fr":176,"./fr-ca":177,"./fr-ca.js":177,"./fr-ch":178,"./fr-ch.js":178,"./fr.js":176,"./fy":179,"./fy.js":179,"./ga":180,"./ga.js":180,"./gd":181,"./gd.js":181,"./gl":182,"./gl.js":182,"./gom-deva":183,"./gom-deva.js":183,"./gom-latn":184,"./gom-latn.js":184,"./gu":185,"./gu.js":185,"./he":186,"./he.js":186,"./hi":187,"./hi.js":187,"./hr":188,"./hr.js":188,"./hu":189,"./hu.js":189,"./hy-am":190,"./hy-am.js":190,"./id":191,"./id.js":191,"./is":192,"./is.js":192,"./it":193,"./it-ch":194,"./it-ch.js":194,"./it.js":193,"./ja":195,"./ja.js":195,"./jv":196,"./jv.js":196,"./ka":197,"./ka.js":197,"./kk":198,"./kk.js":198,"./km":199,"./km.js":199,"./kn":200,"./kn.js":200,"./ko":201,"./ko.js":201,"./ku":202,"./ku.js":202,"./ky":203,"./ky.js":203,"./lb":204,"./lb.js":204,"./lo":205,"./lo.js":205,"./lt":206,"./lt.js":206,"./lv":207,"./lv.js":207,"./me":208,"./me.js":208,"./mi":209,"./mi.js":209,"./mk":210,"./mk.js":210,"./ml":211,"./ml.js":211,"./mn":212,"./mn.js":212,"./mr":213,"./mr.js":213,"./ms":214,"./ms-my":215,"./ms-my.js":215,"./ms.js":214,"./mt":216,"./mt.js":216,"./my":217,"./my.js":217,"./nb":218,"./nb.js":218,"./ne":219,"./ne.js":219,"./nl":220,"./nl-be":221,"./nl-be.js":221,"./nl.js":220,"./nn":222,"./nn.js":222,"./oc-lnc":223,"./oc-lnc.js":223,"./pa-in":224,"./pa-in.js":224,"./pl":225,"./pl.js":225,"./pt":226,"./pt-br":227,"./pt-br.js":227,"./pt.js":226,"./ro":228,"./ro.js":228,"./ru":229,"./ru.js":229,"./sd":230,"./sd.js":230,"./se":231,"./se.js":231,"./si":232,"./si.js":232,"./sk":233,"./sk.js":233,"./sl":234,"./sl.js":234,"./sq":235,"./sq.js":235,"./sr":236,"./sr-cyrl":237,"./sr-cyrl.js":237,"./sr.js":236,"./ss":238,"./ss.js":238,"./sv":239,"./sv.js":239,"./sw":240,"./sw.js":240,"./ta":241,"./ta.js":241,"./te":242,"./te.js":242,"./tet":243,"./tet.js":243,"./tg":244,"./tg.js":244,"./th":245,"./th.js":245,"./tk":246,"./tk.js":246,"./tl-ph":247,"./tl-ph.js":247,"./tlh":248,"./tlh.js":248,"./tr":249,"./tr.js":249,"./tzl":250,"./tzl.js":250,"./tzm":251,"./tzm-latn":252,"./tzm-latn.js":252,"./tzm.js":251,"./ug-cn":253,"./ug-cn.js":253,"./uk":254,"./uk.js":254,"./ur":255,"./ur.js":255,"./uz":256,"./uz-latn":257,"./uz-latn.js":257,"./uz.js":256,"./vi":258,"./vi.js":258,"./x-pseudo":259,"./x-pseudo.js":259,"./yo":260,"./yo.js":260,"./zh-cn":261,"./zh-cn.js":261,"./zh-hk":262,"./zh-hk.js":262,"./zh-mo":263,"./zh-mo.js":263,"./zh-tw":264,"./zh-tw.js":264};function r(e){var t=s(e);return n(t)}function s(e){if(!n.o(a,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return a[e]}r.keys=function(){return Object.keys(a)},r.resolve=s,e.exports=r,r.id=288},,function(e,t,n){},function(e,t,n){"use strict";n.r(t);var a=n(2),r=n.n(a),s=n(265),i=n.n(s),o=function(e,t){return(o=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}o(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,a=arguments.length;n<a;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};function d(e,t,n,a){return new(n||(n=Promise))((function(r,s){function i(e){try{l(a.next(e))}catch(e){s(e)}}function o(e){try{l(a.throw(e))}catch(e){s(e)}}function l(e){e.done?r(e.value):new n((function(t){t(e.value)})).then(i,o)}l((a=a.apply(e,t||[])).next())}))}function c(e,t){var n,a,r,s,i={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,a&&(r=2&s[0]?a.return:s[0]?a.throw||((r=a.return)&&r.call(a),0):a.next)&&!(r=r.call(a,s[1])).done)return r;switch(a=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,a=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(r=i.trys,(r=r.length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){i.label=s[1];break}if(6===s[0]&&i.label<r[1]){i.label=r[1],r=s;break}if(r&&i.label<r[2]){i.label=r[2],i.ops.push(s);break}r[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(e){s=[6,e],a=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}}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},_=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.handleGoogleChartsLoaderScriptLoaded=function(e){var n=t.props,a=n.chartVersion,r=n.chartPackages,s=n.chartLanguage,i=n.mapsApiKey,o=n.onLoad;e.charts.load(a||"current",{packages:r||["corechart","controls"],language:s||"en",mapsApiKey:i}),e.charts.setOnLoadCallback((function(){o(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(a.createElement)(i.a,{url:"https://www.gstatic.com/charts/loader.js",onError:t,onLoad:function(){var t=window;t.google&&e.handleGoogleChartsLoaderScriptLoaded(t.google)}})},t}(a.Component),h=0,p=function(){return"reactgooglegraph-"+(h+=1)},f=["#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={}),d(void 0,void 0,void 0,(function(){return c(this,(function(a){return[2,new Promise((function(a,r){var s=n.headers?"headers="+n.headers:"headers=0",i=n.query?"&tq="+encodeURIComponent(n.query):"",o=n.gid?"&gid="+n.gid:"",l=n.sheet?"&sheet="+n.sheet:"",u=n.access_token?"&access_token="+n.access_token:"",d=t+"/gviz/tq?"+(""+s+o+l+i+u);new e.visualization.Query(d).send((function(e){e.isError()?r("Error in query: "+e.getMessage()+" "+e.getDetailedMessage()):a(e.getDataTable())}))}))]}))}))},M=Object(a.createContext)(m),g=M.Provider,L=M.Consumer,b=function(e){var t=e.children,n=e.value;return Object(a.createElement)(g,{value:n},t)},v=function(e){var t=e.render;return Object(a.createElement)(L,null,(function(e){return t(e)}))},Y=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,a=e.googleChartWrapper;n.visualization.events.addListener(a,"select",(function(){var e=a.getChart().getSelection(),n=a.getDataTable();if(0!==e.length&&null===e[0].row&&null!==n){var r=e[0].column,s=t.getColumnID(n,r);t.state.hiddenColumns.includes(s)?t.setState((function(e){return u({},e,{hiddenColumns:e.hiddenColumns.filter((function(e){return e!==s})).slice()})})):t.setState((function(e){return u({},e,{hiddenColumns:e.hiddenColumns.concat([s])})}))}}))},t.applyFormatters=function(e,n){for(var a=t.props.google,r=0,s=n;r<s.length;r++){var i=s[r];switch(i.type){case"ArrowFormat":(o=new a.visualization.ArrowFormat(i.options)).format(e,i.column);break;case"BarFormat":(o=new a.visualization.BarFormat(i.options)).format(e,i.column);break;case"ColorFormat":for(var o=new a.visualization.ColorFormat(i.options),l=0,u=i.ranges;l<u.length;l++){var d=u[l];o.addRange.apply(o,d)}o.format(e,i.column);break;case"DateFormat":(o=new a.visualization.DateFormat(i.options)).format(e,i.column);break;case"NumberFormat":(o=new a.visualization.NumberFormat(i.options)).format(e,i.column);break;case"PatternFormat":(o=new a.visualization.PatternFormat(i.options)).format(e,i.column)}}},t.getColumnID=function(e,t){return e.getColumnId(t)||e.getColumnLabel(t)},t.draw=function(e){var n=e.data,a=e.diffdata,r=e.rows,s=e.columns,i=e.options,o=e.legend_toggle,l=e.legendToggle,u=e.chartType,m=e.formatters,_=e.spreadSheetUrl,h=e.spreadSheetQueryParameters;return d(t,void 0,void 0,(function(){var e,t,d,p,f,M,g,L,b,v,Y,w,k,D;return c(this,(function(c){switch(c.label){case 0:return e=this.props,t=e.google,d=e.googleChartWrapper,f=null,null!==a&&(M=t.visualization.arrayToDataTable(a.old),g=t.visualization.arrayToDataTable(a.new),f=t.visualization[u].prototype.computeDiff(M,g)),null===n?[3,1]:(p=Array.isArray(n)?t.visualization.arrayToDataTable(n):new t.visualization.DataTable(n),[3,5]);case 1:return null===r||null===s?[3,2]:(p=t.visualization.arrayToDataTable([s].concat(r)),[3,5]);case 2:return null===_?[3,4]:[4,y(t,_,h)];case 3:return p=c.sent(),[3,5];case 4:p=t.visualization.arrayToDataTable([]),c.label=5;case 5:for(L=p.getNumberOfColumns(),b=0;b<L;b+=1)v=this.getColumnID(p,b),this.state.hiddenColumns.includes(v)&&(Y=p.getColumnLabel(b),w=p.getColumnId(b),k=p.getColumnType(b),p.removeColumn(b),p.addColumn({label:Y,id:w,type:k}));return D=d.getChart(),"Timeline"===d.getChartType()&&D&&D.clearChart(),d.setChartType(u),d.setOptions(i),d.setDataTable(p),d.draw(),null!==this.props.googleChartDashboard&&this.props.googleChartDashboard.draw(p),null!==f&&(d.setDataTable(f),d.draw()),null!==m&&(this.applyFormatters(p,m),d.setDataTable(p),d.draw()),!0!==l&&!0!==o||this.grayOutHiddenColumns({options:i}),[2]}}))}))},t.grayOutHiddenColumns=function(e){var n=e.options,a=t.props.googleChartWrapper,r=a.getDataTable();if(null!==r){var s=r.getNumberOfColumns();if(!1!==t.state.hiddenColumns.length>0){var i=Array.from({length:s-1}).map((function(e,a){var s=t.getColumnID(r,a+1);return t.state.hiddenColumns.includes(s)?"#CCCCCC":void 0!==n.colors&&null!==n.colors?n.colors[a]:f[a]}));a.setOptions(u({},n,{colors:i})),a.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}(a.Component),w=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,r=e.googleChartDashboard;return Object(a.createElement)(v,{render:function(e){return Object(a.createElement)(Y,u({},e,{google:t,googleChartWrapper:n,googleChartDashboard:r}))}})},t}(a.Component),k=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,a=e.google,r=e.googleChartWrapper;if(null!==n){a.visualization.events.removeAllListeners(r);for(var s=function(e){var n=e.eventName,s=e.callback;a.visualization.events.addListener(r,n,(function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];s({chartWrapper:r,props:t.props,google:a,eventArgs:e})}))},i=0,o=n;i<o.length;i++){s(o[i])}}},t.prototype.render=function(){var e=this,t=this.props,n=t.google,r=t.googleChartWrapper;return Object(a.createElement)(v,{render:function(t){return e.listenToEvents({chartEvents:t.chartEvents||null,google:n,googleChartWrapper:r}),null}})},t}(a.Component),D=0,T=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={googleChartWrapper:null,googleChartDashboard:null,googleChartControls:null,googleChartEditor:null,isReady:!1},t.graphID=null,t.dashboard_ref=Object(a.createRef)(),t.toolbar_ref=Object(a.createRef)(),t.getGraphID=function(){var e,n=t.props,a=n.graphID,r=n.graph_id;return e=null===a&&null===r?null===t.graphID?p():t.graphID:null!==a&&null===r?a:null!==r&&null===a?r:a,t.graphID=e,t.graphID},t.getControlID=function(e,t){return D+=1,void 0===e?"googlechart-control-"+t+"-"+D:e},t.addControls=function(e,n){var a=t.props,r=a.google,s=a.controls,i=null===s?null:s.map((function(e,n){var a=e.controlID,s=e.controlType,i=e.options,o=e.controlWrapperParams,l=t.getControlID(a,n);return{controlProp:e,control:new r.visualization.ControlWrapper(u({containerId:l,controlType:s,options:i},o))}}));if(null===i)return null;n.bind(i.map((function(e){return e.control})),e);for(var o=function(n){for(var a=n.control,s=n.controlProp.controlEvents,i=function(n){var s=n.callback,i=n.eventName;r.visualization.events.removeListener(a,i,s),r.visualization.events.addListener(a,i,(function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];s({chartWrapper:e,controlWrapper:a,props:t.props,google:r,eventArgs:n})}))},o=0,l=void 0===s?[]:s;o<l.length;o++){i(l[o])}},l=0,d=i;l<d.length;l++){o(d[l])}return i},t.renderChart=function(){var e=t.props,n=e.width,r=e.height,s=e.options,i=e.style,o=e.className,l=e.rootProps,d=e.google,c=u({height:r||s&&s.height,width:n||s&&s.width},i);return Object(a.createElement)("div",u({id:t.getGraphID(),style:c,className:o},l),t.state.isReady&&null!==t.state.googleChartWrapper?Object(a.createElement)(a.Fragment,null,Object(a.createElement)(w,{googleChartWrapper:t.state.googleChartWrapper,google:d,googleChartDashboard:t.state.googleChartDashboard}),Object(a.createElement)(k,{googleChartWrapper:t.state.googleChartWrapper,google:d})):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(a.createElement)(a.Fragment,null,t.state.googleChartControls.filter((function(t){var n=t.controlProp,a=t.control;return e({control:a,controlProp:n})})).map((function(e){var t=e.control;e.controlProp;return Object(a.createElement)("div",{key:t.getContainerId(),id:t.getContainerId()})}))):null},t.renderToolBar=function(){return null===t.props.toolbarItems?null:Object(a.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,a=e.chartType,r=e.chartWrapperParams,s=e.toolbarItems,i=e.getChartEditor,o=e.getChartWrapper,l=u({chartType:a,options:t,containerId:this.getGraphID()},r),d=new n.visualization.ChartWrapper(l);d.setOptions(t),o(d,n);var c=new n.visualization.Dashboard(this.dashboard_ref),m=this.addControls(d,c);null!==s&&n.visualization.drawToolbar(this.toolbar_ref.current,s);var _=null;null!==i&&i({chartEditor:_=new n.visualization.ChartEditor,chartWrapper:d,google:n}),this.setState({googleChartEditor:_,googleChartControls:m,googleChartDashboard:c,googleChartWrapper:d,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],a=n.controlType,r=n.options,s=n.controlWrapperParams;s&&"state"in s&&this.state.googleChartControls[t].control.setState(s.state),this.state.googleChartControls[t].control.setOptions(r),this.state.googleChartControls[t].control.setControlType(a)}},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,r=e.options,s=e.style,i=u({height:n||r&&r.height,width:t||r&&r.width},s);return null!==this.props.render?Object(a.createElement)("div",{ref:this.dashboard_ref,style:i},Object(a.createElement)("div",{ref:this.toolbar_ref,id:"toolbar"}),this.props.render({renderChart:this.renderChart,renderControl:this.renderControl,renderToolbar:this.renderToolBar})):Object(a.createElement)("div",{ref:this.dashboard_ref,style:i},this.renderControl((function(e){return"bottom"!==e.controlProp.controlPosition})),this.renderChart(),this.renderControl((function(e){return"bottom"===e.controlProp.controlPosition})),this.renderToolBar())},t}(a.Component),S=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._isMounted=!1,t.state={loadingStatus:"loading",google:null},t.onLoad=function(e){if(t.isFullyLoaded(e))t.onSuccess(e);else var n=setInterval((function(){var e=window.google;t._isMounted?e&&t.isFullyLoaded(e)&&(clearInterval(n),t.onSuccess(e)):clearInterval(n)}),1e3)},t.onSuccess=function(e){t.setState({loadingStatus:"ready",google:e})},t.onError=function(){t.setState({loadingStatus:"errored"})},t}return l(t,e),t.prototype.render=function(){var e=this.props,t=e.chartLanguage,n=e.chartPackages,r=e.chartVersion,s=e.mapsApiKey,i=e.loader,o=e.errorElement;return Object(a.createElement)(b,{value:this.props},"ready"===this.state.loadingStatus&&null!==this.state.google?Object(a.createElement)(T,u({},this.props,{google:this.state.google})):"errored"===this.state.loadingStatus&&o?o:i,Object(a.createElement)(_,u({},{chartLanguage:t,chartPackages:n,chartVersion:r,mapsApiKey:s},{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,a=t.toolbarItems,r=t.getChartEditor;return e&&e.visualization&&e.visualization.ChartWrapper&&e.visualization.Dashboard&&(!n||e.visualization.ChartWrapper)&&(!r||e.visualization.ChartEditor)&&(!a||e.visualization.drawToolbar)},t.defaultProps=m,t}(a.Component),j=n(266),O=n.n(j);function x(e){return(x="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 H(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function E(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function P(e,t){return(P=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function C(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=W(e);if(t){var r=W(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return z(this,n)}}function z(e,t){if(t&&("object"===x(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return A(e)}function A(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function W(e){return(W=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var R=wp.element,F=R.Component,N=R.Fragment,I=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&P(e,t)}(s,e);var t,n,a,r=C(s);function s(){var e;return H(this,s),(e=r.apply(this,arguments)).initDataTable=e.initDataTable.bind(A(e)),e.dataRenderer=e.dataRenderer.bind(A(e)),e.table,e.uniqueId=O()(),e}return t=s,(n=[{key:"componentDidMount",value:function(){this.initDataTable(this.props.columns,this.props.rows)}},{key:"componentWillUnmount",value:function(){this.table.destroy()}},{key:"componentDidUpdate",value:function(e){this.props!==e&&(this.props.options.responsive_bool!==e.options.responsive_bool&&"true"===e.options.responsive_bool&&document.getElementById("dataTable-instances-".concat(this.props.id,"-").concat(this.uniqueId)).classList.remove("collapsed"),this.table.destroy(),document.getElementById("dataTable-instances-".concat(this.props.id,"-").concat(this.uniqueId)).innerHTML="",this.initDataTable(this.props.columns,this.props.rows))}},{key:"initDataTable",value:function(e,t){var n=this,a=this.props.options,r=e.map((function(e,t){var a=e.type;switch(e.type){case"number":a="num";break;case"date":case"datetime":case"timeofday":a="date"}return{title:e.label,data:e.label,type:a,render:n.dataRenderer(a,t)}})),s=t.map((function(e){var t={};return r.forEach((function(n,a){var r=e[a];void 0===r&&(r=e[n.data]),t[n.data]=r})),t}));this.table=jQuery("#dataTable-instances-".concat(this.props.id,"-").concat(this.uniqueId)).DataTable({destroy:!0,data:s,columns:r,paging:"true"===a.paging_bool,pageLength:a.pageLength_int||10,pagingType:a.pagingType,ordering:"false"!==a.ordering_bool,fixedHeader:"true"===a.fixedHeader_bool,scrollCollapse:!(!this.props.chartsScreen&&"true"!==a.scrollCollapse_bool),scrollY:(this.props.chartsScreen?180:"true"===a.scrollCollapse_bool&&Number(a.scrollY_int))||!1,responsive:!(!this.props.chartsScreen&&"true"!==a.responsive_bool),searching:!1,select:!1,lengthChange:!1,bFilter:!1,bInfo:!1})}},{key:"dataRenderer",value:function(e,t){var n,a=this.props.options,r=null;if(void 0===a.series||void 0===a.series[t]||void 0===a.series[t].format)return r;switch(e){case"date":case"datetime":case"timeofday":r=a.series[t].format&&a.series[t].format.from&&a.series[t].format.to?jQuery.fn.dataTable.render.moment(a.series[t].format.from,a.series[t].format.to):jQuery.fn.dataTable.render.moment("MM-DD-YYYY");break;case"num":var s=["","","","",""];a.series[t].format.thousands&&(s[0]=a.series[t].format.thousands),a.series[t].format.decimal&&(s[1]=a.series[t].format.decimal),a.series[t].format.precision&&0<parseInt(a.series[t].format.precision)&&(s[2]=a.series[t].format.precision),a.series[t].format.prefix&&(s[3]=a.series[t].format.prefix),a.series[t].format.suffix&&(s[4]=a.series[t].format.suffix),r=(n=jQuery.fn.dataTable.render).number.apply(n,s);break;case"boolean":jQuery.fn.dataTable.render.extra=function(e,n,r){return!0!==e&&"true"!==e||""===a.series[t].format.truthy?!1!==e&&"false"!==e||""===a.series[t].format.falsy?e:a.series[t].format.falsy.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,""):a.series[t].format.truthy.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,"")},r=jQuery.fn.dataTable.render.extra}return r}},{key:"render",value:function(){var e=this.props.options;return wp.element.createElement(N,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)}))}}])&&E(t.prototype,n),a&&E(t,a),s}(F),J=n(6),B=n.n(J),U=n(267),V=n.n(U),G=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(B()(e)){for(t in e)return!0;return!1}return"string"==typeof e?0<e.length:null!=e},K=function(e){return V()(e,q)},$=function(e){return e.width="",e.height="",e.backgroundColor={},e.chartArea={},K(e)},Z=function(e){try{JSON.parse(e)}catch(e){return!1}return!0},Q=function(e,t){return!0===e[t]||"true"===e[t]||"1"===e[t]||1===e[t]},X=function(e){switch(e["visualizer-chart-library"]){case"GoogleCharts":return ee(e)}},ee=function(e){var t=e["visualizer-settings"],n=e["visualizer-chart-type"],a=e["visualizer-series"],r=[];if(t.series)switch(n){case"tabular":for(var s in t.series)if(a[(s=parseInt(s))+1]&&t.series[s].format&&""!==t.series[s].format){var i=s+1,o=te(a[s+1].type);o&&r.push({type:o,options:{pattern:t.series[s].format},column:i})}break;default:for(var l=0;l<t.series.length;l++)if(a[l+1]&&void 0!==t.series[l]&&t.series[l].format&&""!==t.series[l].format){var u=l+1,d=te(a[l+1].type);d&&r.push({type:d,options:{pattern:t.series[l].format},column:u})}}else"pie"===n&&t.format&&""!==t.format&&r.push({type:te("number"),options:{pattern:t.format},column:1});if(t.hAxis&&a[0]){var c=te(a[0].type);c&&r.push({type:c,options:{pattern:t.hAxis.format},column:0})}return r},te=function(e){switch(e){case"number":return"NumberFormat";case"date":case"datetime":case"timeofday":return"DateFormat"}return null};function ne(e){return(ne="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ae(e,t,n,a,r,s,i){try{var o=e[s](i),l=o.value}catch(e){return void n(e)}o.done?t(l):Promise.resolve(l).then(a,r)}function re(e){return function(){var t=this,n=arguments;return new Promise((function(a,r){var s=e.apply(t,n);function i(e){ae(s,a,r,i,o,"next",e)}function o(e){ae(s,a,r,i,o,"throw",e)}i(void 0)}))}}function se(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ie(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function oe(e,t){return(oe=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function le(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=ce(e);if(t){var r=ce(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return ue(this,n)}}function ue(e,t){if(t&&("object"===ne(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return de(e)}function de(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ce(e){return(ce=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var me=lodash.startCase,_e=wp.i18n.__,he=wp.apiFetch,pe=wp.element,fe=pe.Component,ye=pe.Fragment,Me=wp.components,ge=Me.Button,Le=Me.Dashicon,be=Me.ExternalLink,ve=Me.Notice,Ye=Me.Placeholder,we=Me.Spinner,ke=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&oe(e,t)}(o,e);var t,n,a,r,s,i=le(o);function o(){var e;return se(this,o),(e=i.apply(this,arguments)).loadMoreCharts=e.loadMoreCharts.bind(de(e)),e.state={charts:null,isBusy:!1,chartsLoaded:!1,perPage:visualizerLocalize.chartsPerPage},e}return t=o,(n=[{key:"componentDidMount",value:(s=re(regeneratorRuntime.mark((function e(){var t,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=visualizerLocalize.chartsPerPage,e.next=3,he({path:"wp/v2/visualizer/?per_page="+t+"&meta_key=visualizer-chart-library&meta_value=ChartJS"});case 3:n=e.sent,this.setState({charts:n});case 5:case"end":return e.stop()}}),e,this)}))),function(){return s.apply(this,arguments)})},{key:"loadMoreCharts",value:(r=re(regeneratorRuntime.mark((function e(){var t,n,a,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.state.charts.length,n=this.state.chartsLoaded,a=this.state.perPage,this.setState({isBusy:!0}),e.next=6,he({path:"wp/v2/visualizer/?per_page=".concat(a,"&meta_key=visualizer-chart-library&meta_value=ChartJS&offset=").concat(t)});case 6:r=e.sent,a>r.length&&(n=!0),this.setState({charts:this.state.charts.concat(r),isBusy:!1,chartsLoaded:n});case 9:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"render",value:function(){var e=this,t="undefined"!=typeof google?google.visualization.Version:"current",n=this.state,a=n.charts,r=n.isBusy,s=n.chartsLoaded,i=n.perPage;return wp.element.createElement("div",{className:"visualizer-settings__charts"},wp.element.createElement(ve,{status:"warning",isDismissible:!1},_e("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(be,{href:visualizerLocalize.adminPage},_e("Click here to visit Visualizer Charts Library."))),null!==a?1<=a.length?wp.element.createElement(ye,null,wp.element.createElement("div",{className:"visualizer-settings__charts-grid"},Object.keys(a).map((function(n){var r,s,i,o=G(a[n].chart_data);if(r=o["visualizer-settings"].title?o["visualizer-settings"].title:"#".concat(a[n].id),0<=["gauge","tabular","timeline"].indexOf(o["visualizer-chart-type"])?"DataTable"===o["visualizer-chart-library"]?s=o["visualizer-chart-type"]:("tabular"===(s=o["visualizer-chart-type"])&&(s="table"),s=me(s)):s="".concat(me(o["visualizer-chart-type"]),"Chart"),!o["visualizer-chart-library"]||"ChartJS"!==o["visualizer-chart-library"])return o["visualizer-data-exploded"]&&(i=_e("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":s,key:"chart-".concat(a[n].id)},wp.element.createElement("div",{className:"visualizer-settings__charts-title"},r),"DataTable"===o["visualizer-chart-library"]?wp.element.createElement(I,{id:a[n].id,rows:o["visualizer-data"],columns:o["visualizer-series"],chartsScreen:!0,options:o["visualizer-settings"]}):(o["visualizer-data-exploded"],wp.element.createElement(S,{chartVersion:t,chartType:s,rows:o["visualizer-data"],columns:o["visualizer-series"],options:$(o["visualizer-settings"]),formatters:X(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:_e("Insert Chart"),onClick:function(){return e.props.getChart(a[n].id)}},wp.element.createElement(Le,{icon:"upload"})))}))),!s&&i-1<a.length&&wp.element.createElement(ge,{isPrimary:!0,isLarge:!0,onClick:this.loadMoreCharts,isBusy:r},_e("Load More"))):wp.element.createElement("p",{className:"visualizer-no-charts"},_e("No charts found.")):wp.element.createElement(Ye,null,wp.element.createElement(we,null)))}}])&&ie(t.prototype,n),a&&ie(t,a),o}(fe);function De(e){return(De="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Te(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Se(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function je(e,t){return(je=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Oe(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=Ee(e);if(t){var r=Ee(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return xe(this,n)}}function xe(e,t){if(t&&("object"===De(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return He(e)}function He(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ee(e){return(Ee=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Pe=wp.i18n.__,Ce=wp.element.Component,ze=wp.components,Ae=ze.Button,We=ze.ExternalLink,Re=ze.PanelBody,Fe=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&je(e,t)}(s,e);var t,n,a,r=Oe(s);function s(){var e;return Te(this,s),(e=r.apply(this,arguments)).uploadInput=React.createRef(),e.fileUploaded=e.fileUploaded.bind(He(e)),e.uploadImport=e.uploadImport.bind(He(e)),e.state={uploadLabel:Pe("Upload")},e}return t=s,(n=[{key:"fileUploaded",value:function(e){"text/csv"===e.target.files[0].type&&this.setState({uploadLabel:Pe("Upload")})}},{key:"uploadImport",value:function(){this.props.readUploadedFile(this.uploadInput),this.setState({uploadLabel:Pe("Uploaded")})}},{key:"render",value:function(){return wp.element.createElement(Re,{title:Pe("Import data from file"),initialOpen:!1},wp.element.createElement("p",null,Pe("Select and upload your data CSV file here. The first row of the CSV file should contain the column headings. The second one should contain series type (string, number, boolean, date, datetime, timeofday).")),wp.element.createElement("p",null,Pe("If you are unsure about how to format your data CSV then please take a look at this sample: "),wp.element.createElement(We,{href:"".concat(visualizerLocalize.absurl,"samples/").concat(this.props.chart["visualizer-chart-type"],".csv")},"".concat(this.props.chart["visualizer-chart-type"],".csv"))),wp.element.createElement("input",{type:"file",accept:"text/csv",ref:this.uploadInput,onChange:this.fileUploaded}),wp.element.createElement(Ae,{isPrimary:!0,onClick:this.uploadImport},this.state.uploadLabel))}}])&&Se(t.prototype,n),a&&Se(t,a),s}(Ce);function Ne(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function Ie(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ne(Object(n),!0).forEach((function(t){Je(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ne(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Je(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Be(e){return(Be="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ue(e,t,n,a,r,s,i){try{var o=e[s](i),l=o.value}catch(e){return void n(e)}o.done?t(l):Promise.resolve(l).then(a,r)}function Ve(e){return function(){var t=this,n=arguments;return new Promise((function(a,r){var s=e.apply(t,n);function i(e){Ue(s,a,r,i,o,"next",e)}function o(e){Ue(s,a,r,i,o,"throw",e)}i(void 0)}))}}function Ge(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function qe(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function Ke(e,t){return(Ke=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function $e(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=Xe(e);if(t){var r=Xe(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return Ze(this,n)}}function Ze(e,t){if(t&&("object"===Be(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Qe(e)}function Qe(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Xe(e){return(Xe=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var et=wp.i18n.__,tt=wp,nt=(tt.apiFetch,tt.apiRequest),at=wp.element.Component,rt=wp.components,st=rt.Button,it=rt.ExternalLink,ot=rt.IconButton,lt=rt.Modal,ut=rt.PanelBody,dt=rt.SelectControl,ct=rt.TextControl,mt=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ke(e,t)}(d,e);var t,n,a,r,s,i,o,l,u=$e(d);function d(){var e;return Ge(this,d),(e=u.apply(this,arguments)).openModal=e.openModal.bind(Qe(e)),e.initTable=e.initTable.bind(Qe(e)),e.onToggle=e.onToggle.bind(Qe(e)),e.toggleHeaders=e.toggleHeaders.bind(Qe(e)),e.getJSONRoot=e.getJSONRoot.bind(Qe(e)),e.getJSONData=e.getJSONData.bind(Qe(e)),e.getTableData=e.getTableData.bind(Qe(e)),e.state={isOpen:!1,isLoading:!1,isFirstStepOpen:!0,isSecondStepOpen:!1,isThirdStepOpen:!1,isFourthStepOpen:!1,isHeaderPanelOpen:!1,endpointRoots:[],endpointPaging:[],table:null,requestHeaders:{method:"GET",username:"",password:"",auth:""}},e}return t=d,(n=[{key:"openModal",value:(l=Ve(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.setState({isOpen:!0});case 2:t=document.querySelector("#visualizer-json-query-table"),this.state.isFourthStepOpen&&null!==this.state.table&&(t.innerHTML=this.state.table,this.initTable());case 4:case"end":return e.stop()}}),e,this)}))),function(){return l.apply(this,arguments)})},{key:"initTable",value:function(){jQuery("#visualizer-json-query-table table").DataTable({paging:!1,searching:!1,ordering:!1,select:!1,scrollX:"600px",scrollY:"400px",info:!1,colReorder:{fixedColumnsLeft:1},dom:"Bt",buttons:[{extend:"colvis",columns:":gt(0)",collectionLayout:"four-column"}]})}},{key:"onToggle",value:(o=Ve(regeneratorRuntime.mark((function e(t){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null===this.state.table&&this.state.endpointRoots&&0<this.state.endpointRoots.length&&("isFirstStepOpen"===t||"isSecondStepOpen"===t)&&this.setState({isFirstStepOpen:"isFirstStepOpen"===t,isSecondStepOpen:"isSecondStepOpen"===t,isThirdStepOpen:!1,isFourthStepOpen:!1}),null===this.state.table){e.next=5;break}return e.next=4,this.setState({isFirstStepOpen:"isFirstStepOpen"===t,isSecondStepOpen:"isSecondStepOpen"===t,isThirdStepOpen:"isThirdStepOpen"===t,isFourthStepOpen:"isFourthStepOpen"===t});case 4:"isFourthStepOpen"===t&&(n=document.querySelector("#visualizer-json-query-table"),this.state.isFourthStepOpen&&(n.innerHTML=this.state.table,this.initTable()));case 5:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:"toggleHeaders",value:function(){this.setState({isHeaderPanelOpen:!this.state.isHeaderPanelOpen})}},{key:"getJSONRoot",value:(i=Ve(regeneratorRuntime.mark((function e(){var t,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.setState({isLoading:!0,endpointRoots:[],endpointPaging:[],table:null}),e.next=3,nt({path:"/visualizer/v1/get-json-root?url=".concat(this.props.chart["visualizer-json-url"]),data:{method:this.props.chart["visualizer-json-headers"]?this.props.chart["visualizer-json-headers"].method:this.state.requestHeaders.method,username:this.props.chart["visualizer-json-headers"]&&"object"===Be(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"===Be(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"!==Be(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 i.apply(this,arguments)})},{key:"getJSONData",value:(s=Ve(regeneratorRuntime.mark((function e(){var t,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.setState({isLoading:!0}),e.next=3,nt({path:"/visualizer/v1/get-json-data?url=".concat(this.props.chart["visualizer-json-url"],"&chart=").concat(this.props.id),data:{root:this.props.chart["visualizer-json-root"]||this.state.endpointRoots[0].value,method:this.props.chart["visualizer-json-headers"]?this.props.chart["visualizer-json-headers"].method:this.state.requestHeaders.method,username:this.props.chart["visualizer-json-headers"]&&"object"===Be(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"===Be(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"!==Be(this.props.chart["visualizer-json-headers"].auth)?this.props.chart["visualizer-json-headers"].auth:this.state.requestHeaders.auth},method:"GET"});case 3:(t=e.sent).success?(n=[{label:et("Don't use pagination"),value:0}],t.data.paging&&"root>next"===t.data.paging[0]&&n.push({label:et("Get first 5 pages using root ➤ next"),value:"root>next"}),this.setState({isLoading:!1,isSecondStepOpen:!1,isFourthStepOpen:!0,endpointPaging:n,table:t.data.table}),document.querySelector("#visualizer-json-query-table").innerHTML=t.data.table,this.initTable()):(this.setState({isLoading:!1}),alert(t.data.msg));case 5:case"end":return e.stop()}}),e,this)}))),function(){return s.apply(this,arguments)})},{key:"getTableData",value:(r=Ve(regeneratorRuntime.mark((function e(){var t,n,a,r,s;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"),a=[],r={},t.forEach((function(e){return a.push(e.value)})),n.forEach((function(e){return r[e.name]=e.value})),e.next=9,nt({path:"/visualizer/v1/set-json-data",data:Ie({url:this.props.chart["visualizer-json-url"],method:this.props.chart["visualizer-json-headers"]?this.props.chart["visualizer-json-headers"].method:this.state.requestHeaders.method,username:this.props.chart["visualizer-json-headers"]&&"object"===Be(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"===Be(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"!==Be(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:a},r),method:"GET"});case 9:(s=e.sent).success?(this.props.JSONImportData(s.data.name,JSON.parse(s.data.series),JSON.parse(s.data.data)),this.setState({isOpen:!1,isLoading:!1})):(alert(s.data.msg),this.setState({isLoading:!1}));case 11:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"render",value:function(){var e=this;return wp.element.createElement(ut,{title:et("Import from JSON"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement("p",null,et("You can choose here to import or synchronize your chart data with a remote JSON source.")),wp.element.createElement("p",null,wp.element.createElement(it,{href:"https://docs.themeisle.com/article/1052-how-to-generate-charts-from-json-data-rest-endpoints"},et("For more info check this tutorial."))),wp.element.createElement(dt,{label:et("How often do you want to check the url?"),value:this.props.chart["visualizer-json-schedule"]?this.props.chart["visualizer-json-schedule"]:1,options:[{label:et("One-time"),value:"-1"},{label:et("Live"),value:"0"},{label:et("Each hour"),value:"1"},{label:et("Each 12 hours"),value:"12"},{label:et("Each day"),value:"24"},{label:et("Each 3 days"),value:"72"}],onChange:this.props.editSchedule}),wp.element.createElement(st,{isPrimary:!0,isLarge:!0,onClick:this.openModal},et("Modify Parameters")),this.state.isOpen&&wp.element.createElement(lt,{title:et("Import from JSON"),className:"visualizer-json-query-modal",shouldCloseOnClickOutside:!1,onRequestClose:function(){e.setState({isOpen:!1,isTableRendered:!1})}},wp.element.createElement(ut,{title:et("Step 1: Specify the JSON endpoint/URL"),opened:this.state.isFirstStepOpen,onToggle:function(){return e.onToggle("isFirstStepOpen")}},wp.element.createElement("p",null,et("If you want to add authentication, add headers to the endpoint or change the request in any way, please refer to our document here:")),wp.element.createElement("p",null,wp.element.createElement(it,{href:"https://docs.themeisle.com/article/1043-visualizer-how-to-extend-rest-endpoints-with-json-response"},et("How to extend REST endpoints with JSON response"))),wp.element.createElement(ct,{placeholder:et("Please enter the URL of your JSON file"),value:this.props.chart["visualizer-json-url"]?this.props.chart["visualizer-json-url"]:"",onChange:this.props.editJSONURL}),wp.element.createElement(ot,{icon:"arrow-right-alt2",label:et("Add Headers"),onClick:this.toggleHeaders},et("Add Headers")),this.state.isHeaderPanelOpen&&wp.element.createElement("div",{className:"visualizer-json-query-modal-headers-panel"},wp.element.createElement(dt,{label:et("Request Type"),value:this.props.chart["visualizer-json-headers"]?this.props.chart["visualizer-json-headers"].method:this.state.requestHeaders.method,options:[{value:"GET",label:et("GET")},{value:"POST",label:et("POST")}],onChange:function(t){var n=Ie({},e.state.requestHeaders),a=e.state.requestHeaders;n.method=t,a=Ie(Ie({},a),{},{method:t}),e.setState({requestHeaders:a}),e.props.editJSONHeaders(n)}}),wp.element.createElement("p",null,et("Credentials")),wp.element.createElement(ct,{label:et("Username"),placeholder:et("Username/Access Key"),value:this.props.chart["visualizer-json-headers"]&&"object"===Be(this.props.chart["visualizer-json-headers"].auth)?this.props.chart["visualizer-json-headers"].auth.username:this.state.requestHeaders.username,onChange:function(t){var n=Ie({},e.state.requestHeaders),a=e.state.requestHeaders;n.auth={username:t,password:e.props.chart["visualizer-json-headers"]&&"object"===Be(e.props.chart["visualizer-json-headers"].auth)?e.props.chart["visualizer-json-headers"].auth.password:e.state.requestHeaders.password},a=Ie(Ie({},a),{},{username:t,password:n.password}),e.setState({requestHeaders:a}),e.props.editJSONHeaders(n)}}),wp.element.createElement("span",{className:"visualizer-json-query-modal-field-separator"},et("&")),wp.element.createElement(ct,{label:et("Password"),placeholder:et("Password/Secret Key"),type:"password",value:this.props.chart["visualizer-json-headers"]&&"object"===Be(this.props.chart["visualizer-json-headers"].auth)?this.props.chart["visualizer-json-headers"].auth.password:this.state.requestHeaders.password,onChange:function(t){var n=Ie({},e.state.requestHeaders),a=e.state.requestHeaders;n.auth={username:e.props.chart["visualizer-json-headers"]&&"object"===Be(e.props.chart["visualizer-json-headers"].auth)?e.props.chart["visualizer-json-headers"].auth.username:e.state.requestHeaders.username,password:t},a=Ie(Ie({},a),{},{username:n.username,password:t}),e.setState({requestHeaders:a}),e.props.editJSONHeaders(n)}}),wp.element.createElement("p",null,et("OR")),wp.element.createElement(ct,{label:et("Authorization"),placeholder:et("e.g. SharedKey <AccountName>:<Signature>"),value:this.props.chart["visualizer-json-headers"]&&"object"!==Be(this.props.chart["visualizer-json-headers"].auth)?this.props.chart["visualizer-json-headers"].auth:this.state.requestHeaders.auth,onChange:function(t){var n=Ie({},e.state.requestHeaders),a=e.state.requestHeaders;n.auth=t,a=Ie(Ie({},a),{},{auth:t}),e.setState({requestHeaders:a}),e.props.editJSONHeaders(n)}})),wp.element.createElement(st,{isPrimary:!0,isLarge:!0,isBusy:this.state.isLoading,disabled:this.state.isLoading,onClick:this.getJSONRoot},et("Fetch Endpoint"))),wp.element.createElement(ut,{title:et("Step 2: Choose the JSON root"),initialOpen:!1,opened:this.state.isSecondStepOpen,onToggle:function(){return e.onToggle("isSecondStepOpen")}},wp.element.createElement("p",null,et("If you see Invalid Data, you may have selected the wrong root to fetch data from. Please select an alternative.")),wp.element.createElement(dt,{value:this.props.chart["visualizer-json-root"],options:this.state.endpointRoots,onChange:this.props.editJSONRoot}),wp.element.createElement(st,{isPrimary:!0,isLarge:!0,isBusy:this.state.isLoading,disabled:this.state.isLoading,onClick:this.getJSONData},et("Parse Endpoint"))),wp.element.createElement(ut,{title:et("Step 3: Specify miscellaneous parameters"),initialOpen:!1,opened:this.state.isThirdStepOpen,onToggle:function(){return e.onToggle("isThirdStepOpen")}},"community"!==visualizerLocalize.isPro?wp.element.createElement(dt,{value:this.props.chart["visualizer-json-paging"]||0,options:this.state.endpointPaging,onChange:this.props.editJSONPaging}):wp.element.createElement("p",null,et("Enable this feature in PRO version!"))),wp.element.createElement(ut,{title:et("Step 4: Select the data to display in the chart"),initialOpen:!1,opened:this.state.isFourthStepOpen,onToggle:function(){return e.onToggle("isFourthStepOpen")}},wp.element.createElement("ul",null,wp.element.createElement("li",null,et("Select whether to include the data in the chart. Each column selected will form one series.")),wp.element.createElement("li",null,et("If a column is selected to be included, specify its data type.")),wp.element.createElement("li",null,et("You can use drag/drop to reorder the columns but this column position is not saved. So when you reload the table, you may have to reorder again.")),wp.element.createElement("li",null,et("You can select any number of columns but the chart type selected will determine how many will display in the chart."))),wp.element.createElement("div",{id:"visualizer-json-query-table"}),wp.element.createElement(st,{isPrimary:!0,isLarge:!0,isBusy:this.state.isLoading,disabled:this.state.isLoading,onClick:this.getTableData},et("Save & Show Chart")))))}}])&&qe(t.prototype,n),a&&qe(t,a),d}(at);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 ht(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function pt(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function ft(e,t){return(ft=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function yt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=gt(e);if(t){var r=gt(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return Mt(this,n)}}function Mt(e,t){if(t&&("object"===_t(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function gt(e){return(gt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Lt=wp.i18n.__,bt=wp.element.Component,vt=wp.components,Yt=vt.Button,wt=vt.ExternalLink,kt=vt.PanelBody,Dt=vt.SelectControl,Tt=vt.TextControl,St=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ft(e,t)}(s,e);var t,n,a,r=yt(s);function s(){return ht(this,s),r.apply(this,arguments)}return t=s,(n=[{key:"render",value:function(){var e=this;return wp.element.createElement(kt,{title:Lt("Import data from URL"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(kt,{title:Lt("One Time Import"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement("p",null,Lt("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,Lt("If you are unsure about how to format your data CSV then please take a look at this sample: "),wp.element.createElement(wt,{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,Lt("You can also import data from Google Spreadsheet.")),wp.element.createElement(Tt,{placeholder:Lt("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(Yt,{isPrimary:!0,isLarge:!0,isBusy:"uploadData"===this.props.isLoading,disabled:"uploadData"===this.props.isLoading,onClick:function(){return e.props.uploadData(!1)}},Lt("Import Data"))),"business"===visualizerLocalize.isPro?wp.element.createElement(kt,{title:Lt("Schedule Import"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement("p",null,Lt("You can choose here to synchronize your chart data with a remote CSV file. ")),wp.element.createElement("p",null,Lt("You can also synchronize with your Google Spreadsheet file.")),wp.element.createElement("p",null,Lt("We will update the chart data based on your time interval preference by overwritting the current data with the one from the URL.")),wp.element.createElement(Tt,{placeholder:Lt("Please enter the URL of your CSV file"),value:this.props.chart["visualizer-chart-url"]?this.props.chart["visualizer-chart-url"]:"",onChange:this.props.editURL}),wp.element.createElement(Dt,{label:Lt("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:Lt("Each hour"),value:"1"},{label:Lt("Each 12 hours"),value:"12"},{label:Lt("Each day"),value:"24"},{label:Lt("Each 3 days"),value:"72"}],onChange:this.props.editSchedule}),wp.element.createElement(Yt,{isPrimary:!0,isLarge:!0,isBusy:"uploadData"===this.props.isLoading,disabled:"uploadData"===this.props.isLoading,onClick:function(){return e.props.uploadData(!0)}},Lt("Save Schedule"))):wp.element.createElement(kt,{title:Lt("Schedule Import"),icon:"lock",className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement("p",null,Lt("Upgrade your license to at least the DEVELOPER version to activate this feature!")),wp.element.createElement(Yt,{isPrimary:!0,href:visualizerLocalize.proTeaser,target:"_blank"},Lt("Buy Now"))),wp.element.createElement(mt,{id:this.props.id,chart:this.props.chart,editSchedule:this.props.editJSONSchedule,editJSONURL:this.props.editJSONURL,editJSONHeaders:this.props.editJSONHeaders,editJSONRoot:this.props.editJSONRoot,editJSONPaging:this.props.editJSONPaging,JSONImportData:this.props.JSONImportData}))}}])&&pt(t.prototype,n),a&&pt(t,a),s}(bt);function jt(e){return(jt="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 Ot(e,t,n,a,r,s,i){try{var o=e[s](i),l=o.value}catch(e){return void n(e)}o.done?t(l):Promise.resolve(l).then(a,r)}function xt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ht(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function Et(e,t){return(Et=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Pt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=zt(e);if(t){var r=zt(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return Ct(this,n)}}function Ct(e,t){if(t&&("object"===jt(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function zt(e){return(zt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var At=wp.i18n.__,Wt=wp.apiFetch,Rt=wp.element,Ft=Rt.Component,Nt=Rt.Fragment,It=wp.components,Jt=It.Button,Bt=It.PanelBody,Ut=It.Placeholder,Vt=It.SelectControl,Gt=It.Spinner,qt=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Et(e,t)}(o,e);var t,n,a,r,s,i=Pt(o);function o(){var e;return xt(this,o),(e=i.apply(this,arguments)).state={id:"",charts:[]},e}return t=o,(n=[{key:"componentDidMount",value:(r=regeneratorRuntime.mark((function e(){var t,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Wt({path:"wp/v2/visualizer/?per_page=100"});case 2:t=(t=e.sent).map((function(e,t){var a=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:a}})),this.setState({id:n,charts:t});case 5:case"end":return e.stop()}}),e,this)})),s=function(){var e=this,t=arguments;return new Promise((function(n,a){var s=r.apply(e,t);function i(e){Ot(s,n,a,i,o,"next",e)}function o(e){Ot(s,n,a,i,o,"throw",e)}i(void 0)}))},function(){return s.apply(this,arguments)})},{key:"render",value:function(){var e=this;return"community"!==visualizerLocalize.isPro?wp.element.createElement(Bt,{title:At("Import from other chart"),initialOpen:!1},1<=this.state.charts.length?wp.element.createElement(Nt,null,wp.element.createElement(Vt,{label:At("You can import here data from your previously created charts."),value:this.state.id,options:this.state.charts,onChange:function(t){return e.setState({id:t})}}),wp.element.createElement(Jt,{isPrimary:!0,isLarge:!0,isBusy:"getChartData"===this.props.isLoading,onClick:function(){return e.props.getChartData(e.state.id)}},At("Import Chart"))):wp.element.createElement(Ut,null,wp.element.createElement(Gt,null))):wp.element.createElement(Bt,{title:At("Import from other chart"),icon:"lock",initialOpen:!1},wp.element.createElement("p",null,At("Enable this feature in PRO version!")),wp.element.createElement(Jt,{isPrimary:!0,href:visualizerLocalize.proTeaser,target:"_blank"},At("Buy Now")))}}])&&Ht(t.prototype,n),a&&Ht(t,a),o}(Ft);function Kt(e){return(Kt="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 $t(e,t,n,a,r,s,i){try{var o=e[s](i),l=o.value}catch(e){return void n(e)}o.done?t(l):Promise.resolve(l).then(a,r)}function Zt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Qt(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function Xt(e,t){return(Xt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function en(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=an(e);if(t){var r=an(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return tn(this,n)}}function tn(e,t){if(t&&("object"===Kt(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return nn(e)}function nn(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function an(e){return(an=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var rn=wp.i18n.__,sn=wp.apiRequest,on=wp.components,ln=on.Button,un=on.ExternalLink,dn=wp.element,cn=dn.Component,mn=dn.Fragment,_n=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Xt(e,t)}(o,e);var t,n,a,r,s,i=en(o);function o(){var e;return Zt(this,o),(e=i.apply(this,arguments)).onSave=e.onSave.bind(nn(e)),e.state={isLoading:!1,success:!1,query:"",name:"",series:{},data:[]},e}return t=o,(n=[{key:"componentDidMount",value:function(){var e=wp.CodeMirror||CodeMirror,t=document.querySelector(".visualizer-db-query"),n=e.fromTextArea(t,{autofocus:!0,mode:"text/x-mysql",lineWrapping:!0,dragDrop:!1,matchBrackets:!0,autoCloseBrackets:!0,extraKeys:{"Ctrl-Space":"autocomplete"},hintOptions:{tables:visualizerLocalize.sqlTable}});n.on("inputRead",(function(){n.save()}))}},{key:"onSave",value:(r=regeneratorRuntime.mark((function e(){var t,n,a;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,sn({path:"/visualizer/v1/get-query-data",data:{query:t},method:"GET"});case 7:return a=e.sent,e.next=10,this.setState({isLoading:!1,success:a.success,query:t,name:a.data.name||"",series:a.data.series||{},data:a.data.data||[]});case 10:n.innerHTML=a.data.table||a.data.msg,this.state.success&&jQuery("#results").DataTable({paging:!1});case 12:case"end":return e.stop()}}),e,this)})),s=function(){var e=this,t=arguments;return new Promise((function(n,a){var s=r.apply(e,t);function i(e){$t(s,n,a,i,o,"next",e)}function o(e){$t(s,n,a,i,o,"throw",e)}i(void 0)}))},function(){return s.apply(this,arguments)})},{key:"render",value:function(){var e=this;return wp.element.createElement(mn,null,wp.element.createElement("textarea",{className:"visualizer-db-query",placeholder:rn("Your query goes here…")},this.props.chart["visualizer-db-query"]),wp.element.createElement("div",{className:"visualizer-db-query-actions"},wp.element.createElement(ln,{isLarge:!0,isDefault:!0,isBusy:this.state.isLoading,onClick:this.onSave},rn("Show Results")),wp.element.createElement(ln,{isLarge:!0,isPrimary:!0,disabled:!this.state.success,onClick:function(){return e.props.save(e.state.query,e.state.name,e.state.series,e.state.data)}},rn("Save"))),wp.element.createElement("ul",null,wp.element.createElement("li",null,wp.element.createElement(un,{href:"https://docs.themeisle.com/article/970-visualizer-sample-queries-to-generate-charts"},rn("Examples of queries and links to resources that you can use with this feature."))),wp.element.createElement("li",null,rn("Use Control+Space for autocompleting keywords or table names."))),wp.element.createElement("div",{id:"visualizer-db-query-table",className:!this.state.success&&"db-wizard-error"}))}}])&&Qt(t.prototype,n),a&&Qt(t,a),o}(cn);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 pn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function fn(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function yn(e,t){return(yn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Mn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=bn(e);if(t){var r=bn(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return gn(this,n)}}function gn(e,t){if(t&&("object"===hn(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Ln(e)}function Ln(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function bn(e){return(bn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var vn=wp.i18n.__,Yn=wp.element.Component,wn=wp.components,kn=wn.Button,Dn=wn.Modal,Tn=wn.PanelBody,Sn=wn.SelectControl,jn=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&yn(e,t)}(s,e);var t,n,a,r=Mn(s);function s(){var e;return pn(this,s),(e=r.apply(this,arguments)).save=e.save.bind(Ln(e)),e.state={isOpen:!1},e}return t=s,(n=[{key:"save",value:function(e,t,n,a){this.props.databaseImportData(e,t,n,a),this.setState({isOpen:!1})}},{key:"render",value:function(){var e=this;return"business"!==visualizerLocalize.isPro?wp.element.createElement(Tn,{title:vn("Import data from database"),icon:"lock",initialOpen:!1},wp.element.createElement("p",null,vn("Upgrade your license to at least the DEVELOPER version to activate this feature!")),wp.element.createElement(kn,{isPrimary:!0,href:visualizerLocalize.proTeaser,target:"_blank"},vn("Buy Now"))):wp.element.createElement(Tn,{title:vn("Import data from database"),initialOpen:!1},wp.element.createElement("p",null,vn("You can import data from the database here.")),wp.element.createElement("p",null,vn("How often do you want to refresh the data from the database.")),wp.element.createElement(Sn,{label:vn("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:vn("Live"),value:"0"},{label:vn("Each hour"),value:"1"},{label:vn("Each 12 hours"),value:"12"},{label:vn("Each day"),value:"24"},{label:vn("Each 3 days"),value:"72"}],onChange:this.props.editSchedule}),wp.element.createElement(kn,{isPrimary:!0,isLarge:!0,onClick:function(){return e.setState({isOpen:!0})}},vn("Create Query")),this.state.isOpen&&wp.element.createElement(Dn,{title:vn("Import from database"),onRequestClose:function(){return e.setState({isOpen:!1})},className:"visualizer-db-query-modal",shouldCloseOnClickOutside:!1},wp.element.createElement(_n,{chart:this.props.chart,changeQuery:this.props.changeQuery,save:this.save})))}}])&&fn(t.prototype,n),a&&fn(t,a),s}(Yn),On=n(268);n(289);function xn(e){return(xn="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 Hn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function En(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function Pn(e,t){return(Pn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Cn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=An(e);if(t){var r=An(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return zn(this,n)}}function zn(e,t){if(t&&("object"===xn(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function An(e){return(An=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Wn=wp.i18n.__,Rn=wp.element.Component,Fn=wp.components,Nn=Fn.Button,In=Fn.ButtonGroup,Jn=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Pn(e,t)}(s,e);var t,n,a,r=Cn(s);function s(){var e;return Hn(this,s),(e=r.apply(this,arguments)).data=[],e.dates=[],e.types=["string","number","boolean","date","datetime","timeofday"],e}return t=s,(n=[{key:"componentWillMount",value:function(){var e=this;this.data[this.data.length]=[],this.data[this.data.length]=[],this.props.chart["visualizer-series"].map((function(t,n){e.data[0][n]=t.label,e.data[1][n]=t.type,"date"===t.type&&e.dates.push(n)})),this.props.chart["visualizer-data"].map((function(t){e.data[e.data.length]=t}))}},{key:"render",value:function(){var e=this;return wp.element.createElement("div",{className:"visualizer-chart-editor"},wp.element.createElement(On.HotTable,{data:this.data,allowInsertRow:!0,contextMenu:!0,rowHeaders:!0,colHeaders:!0,allowInvalid:!1,className:"htEditor",cells:function(t,n,a){var r;return 1===t&&(r={type:"autocomplete",source:e.types,strict:!1}),0<=e.dates.indexOf(n)&&1<t&&(r={type:"date",dateFormat:"YYYY-MM-DD",correctFormat:!0}),r}}),wp.element.createElement(In,null,wp.element.createElement(Nn,{isDefault:!0,isLarge:!0,onClick:this.props.toggleModal},Wn("Close")),wp.element.createElement(Nn,{isPrimary:!0,isLarge:!0,onClick:function(t){e.props.toggleModal(),e.props.editChartData(e.data,"Visualizer_Source_Csv")}},Wn("Save"))))}}])&&En(t.prototype,n),a&&En(t,a),s}(Rn);function Bn(e){return(Bn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Un(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Vn(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function Gn(e,t){return(Gn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function qn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=Zn(e);if(t){var r=Zn(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return Kn(this,n)}}function Kn(e,t){if(t&&("object"===Bn(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return $n(e)}function $n(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Zn(e){return(Zn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Qn=wp.i18n.__,Xn=wp.element,ea=Xn.Component,ta=Xn.Fragment,na=wp.components,aa=na.Button,ra=na.Modal,sa=na.PanelBody,ia=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Gn(e,t)}(s,e);var t,n,a,r=qn(s);function s(){var e;return Un(this,s),(e=r.apply(this,arguments)).toggleModal=e.toggleModal.bind($n(e)),e.state={isOpen:!1},e}return t=s,(n=[{key:"toggleModal",value:function(){this.setState({isOpen:!this.state.isOpen})}},{key:"render",value:function(){return"community"!==visualizerLocalize.isPro?wp.element.createElement(ta,null,wp.element.createElement(sa,{title:Qn("Manual Data"),initialOpen:!1},wp.element.createElement("p",null,Qn("You can manually edit the chart data using a spreadsheet like editor.")),wp.element.createElement(aa,{isPrimary:!0,isLarge:!0,isBusy:this.state.isOpen,onClick:this.toggleModal},Qn("View Editor"))),this.state.isOpen&&wp.element.createElement(ra,{title:"Chart Editor",onRequestClose:this.toggleModal,shouldCloseOnClickOutside:!1},wp.element.createElement(Jn,{chart:this.props.chart,editChartData:this.props.editChartData,toggleModal:this.toggleModal}))):wp.element.createElement(sa,{title:Qn("Manual Data"),icon:"lock",initialOpen:!1},wp.element.createElement("p",null,Qn("Enable this feature in PRO version!")),wp.element.createElement(aa,{isPrimary:!0,href:visualizerLocalize.proTeaser,target:"_blank"},Qn("Buy Now")))}}])&&Vn(t.prototype,n),a&&Vn(t,a),s}(ea);function oa(e){return(oa="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 la(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ua(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function da(e,t){return(da=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ca(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=_a(e);if(t){var r=_a(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return ma(this,n)}}function ma(e,t){if(t&&("object"===oa(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function _a(e){return(_a=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var ha=wp.i18n.__,pa=wp.element.Component,fa=(wp.blockEditor||wp.editor).ColorPalette,ya=wp.components,Ma=ya.BaseControl,ga=ya.CheckboxControl,La=ya.PanelBody,ba=ya.SelectControl,va=ya.TextControl,Ya=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&da(e,t)}(s,e);var t,n,a,r=ca(s);function s(){return la(this,s),r.apply(this,arguments)}return t=s,(n=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-chart-type"],n=this.props.chart["visualizer-settings"],a=[{label:ha("The tooltip will be displayed when the user hovers over an element"),value:"focus"}];-1>=["timeline"].indexOf(t)&&(a[1]={label:ha("The tooltip will be displayed when the user selects an element"),value:"selection"}),a[2]={label:ha("The tooltip will not be displayed"),value:"none"};var r=[{label:ha("Left of the chart"),value:"left"},{label:ha("Right of the chart"),value:"right"},{label:ha("Above the chart"),value:"top"},{label:ha("Below the chart"),value:"bottom"},{label:ha("Omit the legend"),value:"none"}];"pie"!==t&&r.push({label:ha("Inside the chart"),value:"in"}),"bubble"===t&&(r=r.filter((function(e){return"left"!==e.value})));var s=ha("Text to display above the chart.");return 0<=["tabular","dataTable","gauge","geo","timeline"].indexOf(t)&&(s=ha("Text to display in the back-end admin area")),wp.element.createElement(La,{title:ha("General Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(La,{title:ha("Title"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(va,{label:ha("Chart Title"),help:s,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(ba,{label:ha("Chart Title Position"),help:ha("Where to place the chart title, compared to the chart area."),value:n.titlePosition?n.titlePosition:"out",options:[{label:ha("Inside the chart"),value:"in"},{label:ha("Outside the chart"),value:"out"},{label:ha("None"),value:"none"}],onChange:function(t){n.titlePosition=t,e.props.edit(n)}}),-1>=["tabular","dataTable","gauge","geo","timeline"].indexOf(t)&&wp.element.createElement(Ma,{label:ha("Chart Title Color")},wp.element.createElement(fa,{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(ba,{label:ha("Axes Titles Position"),help:ha("Determines where to place the axis titles, compared to the chart area."),value:n.axisTitlesPosition?n.axisTitlesPosition:"out",options:[{label:ha("Inside the chart"),value:"in"},{label:ha("Outside the chart"),value:"out"},{label:ha("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(La,{title:ha("Font Styles"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(ba,{label:ha("Font Family"),help:ha("The default font family for all text in the chart."),value:n.fontName?n.fontName:"Arial",options:[{label:ha("Arial"),value:"Arial"},{label:ha("Sans Serif"),value:"Sans Serif"},{label:ha("Serif"),value:"serif"},{label:ha("Arial"),value:"Arial"},{label:ha("Wide"),value:"Arial black"},{label:ha("Narrow"),value:"Arial Narrow"},{label:ha("Comic Sans MS"),value:"Comic Sans MS"},{label:ha("Courier New"),value:"Courier New"},{label:ha("Garamond"),value:"Garamond"},{label:ha("Georgia"),value:"Georgia"},{label:ha("Tahoma"),value:"Tahoma"},{label:ha("Verdana"),value:"Verdana"}],onChange:function(t){n.fontName=t,e.props.edit(n)}}),wp.element.createElement(ba,{label:ha("Font Size"),help:ha("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(La,{title:ha("Legend"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(ba,{label:ha("Position"),help:ha("Determines where to place the legend, compared to the chart area."),value:n.legend.position?n.legend.position:"right",options:r,onChange:function(a){if("pie"!==t){var r="left"===a?1:0;n.series&&Object.keys(n.series).map((function(e){n.series[e].targetAxisIndex=r}))}n.legend.position=a,e.props.edit(n)}}),wp.element.createElement(ba,{label:ha("Alignment"),help:ha("Determines the alignment of the legend."),value:n.legend.alignment?n.legend.alignment:"15",options:[{label:ha("Aligned to the start of the allocated area"),value:"start"},{label:ha("Centered in the allocated area"),value:"center"},{label:ha("Aligned to the end of the allocated area"),value:"end"}],onChange:function(t){n.legend.alignment=t,e.props.edit(n)}}),wp.element.createElement(Ma,{label:ha("Font Color")},wp.element.createElement(fa,{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(La,{title:ha("Tooltip"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(ba,{label:ha("Trigger"),help:ha("Determines the user interaction that causes the tooltip to be displayed."),value:n.tooltip.trigger?n.tooltip.trigger:"focus",options:a,onChange:function(t){n.tooltip.trigger=t,e.props.edit(n)}}),wp.element.createElement(ba,{label:ha("Show Color Code"),help:ha("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:ha("Yes"),value:"1"},{label:ha("No"),value:"0"}],onChange:function(t){n.tooltip.showColorCode=t,e.props.edit(n)}}),0<=["pie"].indexOf(t)&&wp.element.createElement(ba,{label:ha("Text"),help:ha("Determines what information to display when the user hovers over a pie slice."),value:n.tooltip.text?n.tooltip.text:"both",options:[{label:ha("Display both the absolute value of the slice and the percentage of the whole"),value:"both"},{label:ha("Display only the absolute value of the slice"),value:"value"},{label:ha("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(La,{title:ha("Animation"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(ga,{label:ha("Animate on startup?"),help:ha("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(va,{label:ha("Duration"),help:ha("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(ba,{label:ha("Easing"),help:ha("The easing function applied to the animation."),value:n.animation.easing?n.animation.easing:"linear",options:[{label:ha("Constant speed"),value:"linear"},{label:ha("Start slow and speed up"),value:"in"},{label:ha("Start fast and slow down"),value:"out"},{label:ha("Start slow, speed up, then slow down"),value:"inAndOut"}],onChange:function(t){n.animation.easing=t,e.props.edit(n)}})))}}])&&ua(t.prototype,n),a&&ua(t,a),s}(pa);function wa(e){return(wa="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ka(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Da(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function Ta(e,t){return(Ta=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Sa(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=Oa(e);if(t){var r=Oa(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return ja(this,n)}}function ja(e,t){if(t&&("object"===wa(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Oa(e){return(Oa=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var xa=wp.i18n.__,Ha=wp.element.Component,Ea=wp.components,Pa=Ea.PanelBody,Ca=Ea.Notice,za=Ea.TextControl,Aa=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ta(e,t)}(s,e);var t,n,a,r=Sa(s);function s(){return ka(this,s),r.apply(this,arguments)}return t=s,(n=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(Pa,{title:xa("Instance Settings"),initialOpen:!0,className:"visualizer-instance-panel"},wp.element.createElement(Ca,{status:"info",isDismissible:!1},wp.element.createElement("p",null,xa("These settings are valid only for this instance of the chart.")),wp.element.createElement("p",null,xa("This means that if you insert this chart again elsewhere, these values will not persist."))),wp.element.createElement(za,{label:xa("Should this instance lazy Load?"),help:xa("-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)}}))}}])&&Da(t.prototype,n),a&&Da(t,a),s}(Ha);function Wa(e){return(Wa="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ra(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Fa(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function Na(e,t){return(Na=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Ia(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=Ba(e);if(t){var r=Ba(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return Ja(this,n)}}function Ja(e,t){if(t&&("object"===Wa(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Ba(e){return(Ba=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Ua=wp.i18n.__,Va=wp.element,Ga=Va.Component,qa=Va.Fragment,Ka=(wp.blockEditor||wp.editor).ColorPalette,$a=wp.components,Za=$a.BaseControl,Qa=$a.ExternalLink,Xa=$a.PanelBody,er=$a.SelectControl,tr=$a.TextControl,nr=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Na(e,t)}(s,e);var t,n,a,r=Ia(s);function s(){return Ra(this,s),r.apply(this,arguments)}return t=s,(n=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-chart-type"],n=this.props.chart["visualizer-settings"];return wp.element.createElement(Xa,{title:Ua("Horizontal Axis Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(Xa,{title:Ua("General Settings"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(tr,{label:Ua("Axis Title"),help:Ua("The title of the horizontal axis."),value:n.hAxis.title,onChange:function(t){n.hAxis.title=t,e.props.edit(n)}}),wp.element.createElement(er,{label:Ua("Text Position"),help:Ua("Position of the horizontal axis text, relative to the chart area."),value:n.hAxis.textPosition?n.hAxis.textPosition:"out",options:[{label:Ua("Inside the chart"),value:"in"},{label:Ua("Outside the chart"),value:"out"},{label:Ua("None"),value:"none"}],onChange:function(t){n.hAxis.textPosition=t,e.props.edit(n)}}),wp.element.createElement(er,{label:Ua("Direction"),help:Ua("The direction in which the values along the horizontal axis grow."),value:n.hAxis.direction?n.hAxis.direction:"1",options:[{label:Ua("Identical Direction"),value:"1"},{label:Ua("Reverse Direction"),value:"-1"}],onChange:function(t){n.hAxis.direction=t,e.props.edit(n)}}),wp.element.createElement(Za,{label:Ua("Base Line Color")},wp.element.createElement(Ka,{value:n.hAxis.baselineColor,onChange:function(t){n.hAxis.baselineColor=t,e.props.edit(n)}})),wp.element.createElement(Za,{label:Ua("Axis Text Color")},wp.element.createElement(Ka,{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(qa,null,wp.element.createElement(tr,{label:Ua("Number Format"),help:Ua("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,Ua("For number axis labels, this is a subset of the formatting "),wp.element.createElement(Qa,{href:"http://icu-project.org/apiref/icu4c/classDecimalFormat.html#_details"},Ua("ICU pattern set.")),Ua(" 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,Ua("For date axis labels, this is a subset of the date formatting "),wp.element.createElement(Qa,{href:"http://userguide.icu-project.org/formatparse/datetime#TOC-Date-Time-Format-Syntax"},Ua("ICU date and time format."))))),-1>=["column"].indexOf(t)&&wp.element.createElement(qa,null,wp.element.createElement(Xa,{title:Ua("Grid Lines"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(tr,{label:Ua("Count"),help:Ua("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(Za,{label:Ua("Color")},wp.element.createElement(Ka,{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(Xa,{title:Ua("Minor Grid Lines"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(tr,{label:Ua("Count"),help:Ua("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(Za,{label:Ua("Color")},wp.element.createElement(Ka,{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(Xa,{title:Ua("View Window"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(tr,{label:Ua("Maximun Value"),help:Ua("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(tr,{label:Ua("Minimum Value"),help:Ua("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)}}))))}}])&&Fa(t.prototype,n),a&&Fa(t,a),s}(Ga);function ar(e){return(ar="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 rr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function sr(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function ir(e,t){return(ir=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function or(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=ur(e);if(t){var r=ur(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return lr(this,n)}}function lr(e,t){if(t&&("object"===ar(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function ur(e){return(ur=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var dr=wp.i18n.__,cr=wp.element,mr=cr.Component,_r=cr.Fragment,hr=(wp.blockEditor||wp.editor).ColorPalette,pr=wp.components,fr=pr.BaseControl,yr=pr.ExternalLink,Mr=pr.PanelBody,gr=pr.SelectControl,Lr=pr.TextControl,br=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ir(e,t)}(s,e);var t,n,a,r=or(s);function s(){return rr(this,s),r.apply(this,arguments)}return t=s,(n=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-chart-type"],n=this.props.chart["visualizer-settings"];return wp.element.createElement(Mr,{title:dr("Vertical Axis Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(Mr,{title:dr("General Settings"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Lr,{label:dr("Axis Title"),help:dr("The title of the Vertical axis."),value:n.vAxis.title,onChange:function(t){n.vAxis.title=t,e.props.edit(n)}}),wp.element.createElement(gr,{label:dr("Text Position"),help:dr("Position of the Vertical axis text, relative to the chart area."),value:n.vAxis.textPosition?n.vAxis.textPosition:"out",options:[{label:dr("Inside the chart"),value:"in"},{label:dr("Outside the chart"),value:"out"},{label:dr("None"),value:"none"}],onChange:function(t){n.vAxis.textPosition=t,e.props.edit(n)}}),wp.element.createElement(gr,{label:dr("Direction"),help:dr("The direction in which the values along the Vertical axis grow."),value:n.vAxis.direction?n.vAxis.direction:"1",options:[{label:dr("Identical Direction"),value:"1"},{label:dr("Reverse Direction"),value:"-1"}],onChange:function(t){n.vAxis.direction=t,e.props.edit(n)}}),wp.element.createElement(fr,{label:dr("Base Line Color")},wp.element.createElement(hr,{value:n.vAxis.baselineColor,onChange:function(t){n.vAxis.baselineColor=t,e.props.edit(n)}})),wp.element.createElement(fr,{label:dr("Axis Text Color")},wp.element.createElement(hr,{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(_r,null,wp.element.createElement(Lr,{label:dr("Number Format"),help:dr("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,dr("For number axis labels, this is a subset of the formatting "),wp.element.createElement(yr,{href:"http://icu-project.org/apiref/icu4c/classDecimalFormat.html#_details"},dr("ICU pattern set.")),dr(" 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,dr("For date axis labels, this is a subset of the date formatting "),wp.element.createElement(yr,{href:"http://userguide.icu-project.org/formatparse/datetime#TOC-Date-Time-Format-Syntax"},dr("ICU date and time format."))))),-1>=["bar"].indexOf(t)&&wp.element.createElement(_r,null,wp.element.createElement(Mr,{title:dr("Grid Lines"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Lr,{label:dr("Count"),help:dr("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(fr,{label:dr("Color")},wp.element.createElement(hr,{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(Mr,{title:dr("Minor Grid Lines"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Lr,{label:dr("Count"),help:dr("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(fr,{label:dr("Color")},wp.element.createElement(hr,{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(Mr,{title:dr("View Window"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Lr,{label:dr("Maximun Value"),help:dr("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(Lr,{label:dr("Minimum Value"),help:dr("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)}}))))}}])&&sr(t.prototype,n),a&&sr(t,a),s}(mr);function vr(e){return(vr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Yr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function wr(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function kr(e,t){return(kr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Dr(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=Sr(e);if(t){var r=Sr(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return Tr(this,n)}}function Tr(e,t){if(t&&("object"===vr(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Sr(e){return(Sr=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var jr=wp.i18n.__,Or=wp.element,xr=Or.Component,Hr=Or.Fragment,Er=(wp.blockEditor||wp.editor).ColorPalette,Pr=wp.components,Cr=Pr.BaseControl,zr=Pr.ExternalLink,Ar=Pr.PanelBody,Wr=Pr.SelectControl,Rr=Pr.TextControl,Fr=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&kr(e,t)}(s,e);var t,n,a,r=Dr(s);function s(){return Yr(this,s),r.apply(this,arguments)}return t=s,(n=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(Ar,{title:jr("Pie Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(Hr,null,wp.element.createElement(Rr,{label:jr("Number Format"),help:jr("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,jr("For number axis labels, this is a subset of the formatting "),wp.element.createElement(zr,{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(zr,{href:"http://userguide.icu-project.org/formatparse/datetime#TOC-Date-Time-Format-Syntax"},jr("ICU date and time format.")))),wp.element.createElement(Wr,{label:jr("Is 3D"),help:jr("If set to yes, displays a three-dimensional chart."),value:t.is3D?t.is3D:"0",options:[{label:jr("Yes"),value:"1"},{label:jr("No"),value:"0"}],onChange:function(n){t.is3D=n,e.props.edit(t)}}),wp.element.createElement(Wr,{label:jr("Reverse Categories"),help:jr("If set to yes, will draw slices counterclockwise."),value:t.reverseCategories?t.reverseCategories:"0",options:[{label:jr("Yes"),value:"1"},{label:jr("No"),value:"0"}],onChange:function(n){t.reverseCategories=n,e.props.edit(t)}}),wp.element.createElement(Wr,{label:jr("Slice Text"),help:jr("The content of the text displayed on the slice."),value:t.pieSliceText?t.pieSliceText:"percentage",options:[{label:jr("The percentage of the slice size out of the total"),value:"percentage"},{label:jr("The quantitative value of the slice"),value:"value"},{label:jr("The name of the slice"),value:"label"},{label:jr("The quantitative value and percentage of the slice"),value:"value-and-percentage"},{label:jr("No text is displayed"),value:"none"}],onChange:function(n){t.pieSliceText=n,e.props.edit(t)}}),wp.element.createElement(Rr,{label:jr("Pie Hole"),help:jr("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:jr("0.5"),value:t.pieHole,onChange:function(n){t.pieHole=n,e.props.edit(t)}}),wp.element.createElement(Rr,{label:jr("Start Angle"),help:jr("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(Cr,{label:jr("Slice Border Color")},wp.element.createElement(Er,{value:t.pieSliceBorderColor,onChange:function(n){t.pieSliceBorderColor=n,e.props.edit(t)}})))}}])&&wr(t.prototype,n),a&&wr(t,a),s}(xr);function Nr(e){return(Nr="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 Ir(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Jr(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function Br(e,t){return(Br=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Ur(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=Gr(e);if(t){var r=Gr(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return Vr(this,n)}}function Vr(e,t){if(t&&("object"===Nr(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Gr(e){return(Gr=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var qr=wp.i18n.__,Kr=wp.element.Component,$r=(wp.blockEditor||wp.editor).ColorPalette,Zr=wp.components,Qr=Zr.BaseControl,Xr=Zr.PanelBody,es=Zr.TextControl,ts=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Br(e,t)}(s,e);var t,n,a,r=Ur(s);function s(){return Ir(this,s),r.apply(this,arguments)}return t=s,(n=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(Xr,{title:qr("Residue Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(es,{label:qr("Visibility Threshold"),help:qr("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:qr("0.001388889"),value:t.sliceVisibilityThreshold,onChange:function(n){t.sliceVisibilityThreshold=n,e.props.edit(t)}}),wp.element.createElement(es,{label:qr("Residue Slice Label"),help:qr("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(Qr,{label:qr("Residue Slice Color")},wp.element.createElement($r,{value:t.pieResidueSliceColor,onChange:function(n){t.pieResidueSliceColor=n,e.props.edit(t)}})))}}])&&Jr(t.prototype,n),a&&Jr(t,a),s}(Kr);function ns(e){return(ns="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){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function rs(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function ss(e,t){return(ss=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function is(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=ls(e);if(t){var r=ls(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return os(this,n)}}function os(e,t){if(t&&("object"===ns(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function ls(e){return(ls=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var us=wp.i18n.__,ds=wp.element,cs=ds.Component,ms=ds.Fragment,_s=wp.components,hs=_s.PanelBody,ps=_s.SelectControl,fs=_s.TextControl,ys=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ss(e,t)}(s,e);var t,n,a,r=is(s);function s(){return as(this,s),r.apply(this,arguments)}return t=s,(n=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-chart-type"],n=this.props.chart["visualizer-settings"];return wp.element.createElement(hs,{title:us("Lines Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(fs,{label:us("Line Width"),help:us("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(fs,{label:us("Point Size"),help:us("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(ps,{label:us("Curve Type"),help:us("Determines whether the series has to be presented in the legend or not."),value:n.curveType?n.curveType:"none",options:[{label:us("Straight line without curve"),value:"none"},{label:us("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(ps,{label:us("Focus Target"),help:us("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:us("Focus on a single data point."),value:"datum"},{label:us("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(ps,{label:us("Selection Mode"),help:us("Determines how many data points an user can select on a chart."),value:n.selectionMode?n.selectionMode:"single",options:[{label:us("Single data point"),value:"single"},{label:us("Multiple data points"),value:"multiple"}],onChange:function(t){n.selectionMode=t,e.props.edit(n)}}),wp.element.createElement(ps,{label:us("Aggregation Target"),help:us("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:us("Group selected data by x-value"),value:"category"},{label:us("Group selected data by series"),value:"series"},{label:us("Group selected data by x-value if all selections have the same x-value, and by series otherwise"),value:"auto"},{label:us("Show only one tooltip per selection"),value:"none"}],onChange:function(t){n.aggregationTarget=t,e.props.edit(n)}}),wp.element.createElement(fs,{label:us("Point Opacity"),help:us("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(ms,null,wp.element.createElement(fs,{label:us("Area Opacity"),help:us("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(ps,{label:us("Is Stacked"),help:us("If set to yes, series elements are stacked."),value:n.isStacked?n.isStacked:"0",options:[{label:us("Yes"),value:"1"},{label:us("No"),value:"0"}],onChange:function(t){n.isStacked=t,e.props.edit(n)}})),-1>=["scatter","area"].indexOf(t)&&wp.element.createElement(ps,{label:us("Interpolate Nulls"),help:us("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:us("Yes"),value:"1"},{label:us("No"),value:"0"}],onChange:function(t){n.interpolateNulls=t,e.props.edit(n)}}))}}])&&rs(t.prototype,n),a&&rs(t,a),s}(cs);function Ms(e){return(Ms="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 gs(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ls(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function bs(e,t){return(bs=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function vs(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=ws(e);if(t){var r=ws(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return Ys(this,n)}}function Ys(e,t){if(t&&("object"===Ms(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function ws(e){return(ws=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var ks=wp.i18n.__,Ds=wp.element.Component,Ts=wp.components,Ss=Ts.PanelBody,js=Ts.SelectControl,Os=Ts.TextControl,xs=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&bs(e,t)}(s,e);var t,n,a,r=vs(s);function s(){return gs(this,s),r.apply(this,arguments)}return t=s,(n=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(Ss,{title:ks("Bars Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(js,{label:ks("Focus Target"),help:ks("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:ks("Focus on a single data point."),value:"datum"},{label:ks("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(js,{label:ks("Is Stacked"),help:ks("If set to yes, series elements are stacked."),value:t.isStacked?t.isStacked:"0",options:[{label:ks("Yes"),value:"1"},{label:ks("No"),value:"0"}],onChange:function(n){t.isStacked=n,e.props.edit(t)}}),wp.element.createElement(Os,{label:ks("Bars Opacity"),help:ks("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)}}))}}])&&Ls(t.prototype,n),a&&Ls(t,a),s}(Ds);function Hs(e){return(Hs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Es(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ps(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function Cs(e,t){return(Cs=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function zs(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=Ws(e);if(t){var r=Ws(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return As(this,n)}}function As(e,t){if(t&&("object"===Hs(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Ws(e){return(Ws=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Rs=wp.i18n.__,Fs=wp.element.Component,Ns=(wp.blockEditor||wp.editor).ColorPalette,Is=wp.components,Js=Is.BaseControl,Bs=Is.PanelBody,Us=Is.SelectControl,Vs=Is.TextControl,Gs=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Cs(e,t)}(s,e);var t,n,a,r=zs(s);function s(){return Es(this,s),r.apply(this,arguments)}return t=s,(n=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(Bs,{title:Rs("Candles Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(Bs,{title:Rs("General Settings"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Us,{label:Rs("Focus Target"),help:Rs("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:Rs("Focus on a single data point."),value:"datum"},{label:Rs("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(Us,{label:Rs("Selection Mode"),help:Rs("Determines how many data points an user can select on a chart."),value:t.selectionMode?t.selectionMode:"single",options:[{label:Rs("Single data point"),value:"single"},{label:Rs("Multiple data points"),value:"multiple"}],onChange:function(n){t.selectionMode=n,e.props.edit(t)}}),wp.element.createElement(Us,{label:Rs("Aggregation Target"),help:Rs("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:Rs("Group selected data by x-value"),value:"category"},{label:Rs("Group selected data by series"),value:"series"},{label:Rs("Group selected data by x-value if all selections have the same x-value, and by series otherwise"),value:"auto"},{label:Rs("Show only one tooltip per selection"),value:"none"}],onChange:function(n){t.aggregationTarget=n,e.props.edit(t)}})),wp.element.createElement(Bs,{title:Rs("Failing Candles"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Vs,{label:Rs("Stroke Width"),help:Rs("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(Js,{label:Rs("Stroke Color")},wp.element.createElement(Ns,{value:t.candlestick.fallingColor.stroke,onChange:function(n){t.candlestick.fallingColor.stroke=n,e.props.edit(t)}})),wp.element.createElement(Js,{label:Rs("Fill Color")},wp.element.createElement(Ns,{value:t.candlestick.fallingColor.fill,onChange:function(n){t.candlestick.fallingColor.fill=n,e.props.edit(t)}}))),wp.element.createElement(Bs,{title:Rs("Rising Candles"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Vs,{label:Rs("Stroke Width"),help:Rs("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(Js,{label:Rs("Stroke Color")},wp.element.createElement(Ns,{value:t.candlestick.risingColor.stroke,onChange:function(n){t.candlestick.risingColor.stroke=n,e.props.edit(t)}})),wp.element.createElement(Js,{label:Rs("Fill Color")},wp.element.createElement(Ns,{value:t.candlestick.risingColor.fill,onChange:function(n){t.candlestick.risingColor.fill=n,e.props.edit(t)}}))))}}])&&Ps(t.prototype,n),a&&Ps(t,a),s}(Fs);function qs(e){return(qs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ks(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $s(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function Zs(e,t){return(Zs=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Qs(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=ei(e);if(t){var r=ei(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return Xs(this,n)}}function Xs(e,t){if(t&&("object"===qs(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function ei(e){return(ei=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var ti=wp.i18n.__,ni=wp.element.Component,ai=wp.components,ri=ai.ExternalLink,si=ai.PanelBody,ii=ai.SelectControl,oi=ai.TextControl,li=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Zs(e,t)}(s,e);var t,n,a,r=Qs(s);function s(){return Ks(this,s),r.apply(this,arguments)}return t=s,(n=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(si,{title:ti("Map Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(si,{title:ti("API"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(oi,{label:ti("API Key"),help:ti("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(ri,{href:"https://developers.google.com/maps/documentation/javascript/get-api-key"},ti("Get API Keys"))),wp.element.createElement(si,{title:ti("Region"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement("ul",{className:"visualizer-list"},wp.element.createElement("li",null,ti("A map of the entire world using 'world'.")),wp.element.createElement("li",null,ti("A continent or a sub-continent, specified by its 3-digit code, e.g., '011' for Western Africa. "),wp.element.createElement(ri,{href:"https://google-developers.appspot.com/chart/interactive/docs/gallery/geochart#Continent_Hierarchy"},ti("More info here."))),wp.element.createElement("li",null,ti("A country, specified by its ISO 3166-1 alpha-2 code, e.g., 'AU' for Australia. "),wp.element.createElement(ri,{href:"http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2"},ti("More info here."))),wp.element.createElement("li",null,ti("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(ri,{href:"http://en.wikipedia.org/wiki/ISO_3166-2:US"},ti("More info here.")))),wp.element.createElement(oi,{label:ti("Reigion"),help:ti("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(si,{title:ti("Resolution"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement("ul",{className:"visualizer-list"},wp.element.createElement("li",null,ti("'countries' - Supported for all regions, except for US state regions.")),wp.element.createElement("li",null,ti("'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,ti("'metros' - Supported for the US country region and US state regions only."))),wp.element.createElement(ii,{label:ti("Resolution"),help:ti("The resolution of the map borders."),value:t.resolution?t.resolution:"countries",options:[{label:ti("Countries"),value:"countries"},{label:ti("Provinces"),value:"provinces"},{label:ti("Metros"),value:"metros"}],onChange:function(n){t.resolution=n,e.props.edit(t)}})),wp.element.createElement(si,{title:ti("Display Mode"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement("ul",{className:"visualizer-list"},wp.element.createElement("li",null,ti("'auto' - Choose based on the format of the data.")),wp.element.createElement("li",null,ti("'regions' - This is a region map.")),wp.element.createElement("li",null,ti("'markers' - This is a marker map."))),wp.element.createElement(ii,{label:ti("Display Mode"),help:ti("Determines which type of map this is."),value:t.displayMode?t.displayMode:"auto",options:[{label:ti("Auto"),value:"auto"},{label:ti("Regions"),value:"regions"},{label:ti("Markers"),value:"markers"}],onChange:function(n){t.displayMode=n,e.props.edit(t)}})),wp.element.createElement(si,{title:ti("Tooltip"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(ii,{label:ti("Trigger"),help:ti("Determines the user interaction that causes the tooltip to be displayed."),value:t.tooltip.trigger?t.tooltip.trigger:"focus",options:[{label:ti("The tooltip will be displayed when the user hovers over an element"),value:"focus"},{label:ti("The tooltip will not be displayed"),value:"none"}],onChange:function(n){t.tooltip.trigger=n,e.props.edit(t)}})))}}])&&$s(t.prototype,n),a&&$s(t,a),s}(ni);function ui(e){return(ui="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 di(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ci(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function mi(e,t){return(mi=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function _i(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=pi(e);if(t){var r=pi(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return hi(this,n)}}function hi(e,t){if(t&&("object"===ui(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function pi(e){return(pi=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var fi=wp.i18n.__,yi=wp.element.Component,Mi=(wp.blockEditor||wp.editor).ColorPalette,gi=wp.components,Li=gi.BaseControl,bi=gi.PanelBody,vi=gi.TextControl,Yi=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&mi(e,t)}(s,e);var t,n,a,r=_i(s);function s(){return di(this,s),r.apply(this,arguments)}return t=s,(n=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(bi,{title:fi("Color Axis"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(vi,{label:fi("Minimum Values"),help:fi("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(vi,{label:fi("Maximum Values"),help:fi("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(Li,{label:fi("Minimum Value")},wp.element.createElement(Mi,{value:t.colorAxis.colors[0],onChange:function(n){t.colorAxis.colors[0]=n,e.props.edit(t)}})),wp.element.createElement(Li,{label:fi("Intermediate Value")},wp.element.createElement(Mi,{value:t.colorAxis.colors[1],onChange:function(n){t.colorAxis.colors[1]=n,e.props.edit(t)}})),wp.element.createElement(Li,{label:fi("Maximum Value")},wp.element.createElement(Mi,{value:t.colorAxis.colors[2],onChange:function(n){t.colorAxis.colors[2]=n,e.props.edit(t)}})),wp.element.createElement(Li,{label:fi("Dateless Region")},wp.element.createElement(Mi,{value:t.datalessRegionColor,onChange:function(n){t.datalessRegionColor=n,e.props.edit(t)}})))}}])&&ci(t.prototype,n),a&&ci(t,a),s}(yi);function wi(e){return(wi="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 ki(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Di(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function Ti(e,t){return(Ti=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Si(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=Oi(e);if(t){var r=Oi(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return ji(this,n)}}function ji(e,t){if(t&&("object"===wi(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Oi(e){return(Oi=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var xi=wp.i18n.__,Hi=wp.element,Ei=Hi.Component,Pi=Hi.Fragment,Ci=wp.components,zi=Ci.ExternalLink,Ai=Ci.PanelBody,Wi=Ci.TextControl,Ri=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ti(e,t)}(s,e);var t,n,a,r=Si(s);function s(){return ki(this,s),r.apply(this,arguments)}return t=s,(n=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(Ai,{title:xi("Size Axis"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(Wi,{label:xi("Minimum Values"),help:xi("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(Wi,{label:xi("Maximum Values"),help:xi("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(Wi,{label:xi("Minimum Marker Radius"),help:xi("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(Wi,{label:xi("Maximum Marker Radius"),help:xi("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(Wi,{label:xi("Marker Opacity"),help:xi("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(Pi,null,wp.element.createElement(Wi,{label:xi("Number Format"),help:xi("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,xi("For number axis labels, this is a subset of the formatting "),wp.element.createElement(zi,{href:"http://icu-project.org/apiref/icu4c/classDecimalFormat.html#_details"},xi("ICU pattern set.")),xi(" 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."))))}}])&&Di(t.prototype,n),a&&Di(t,a),s}(Ei);function Fi(e){return(Fi="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 Ni(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ii(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function Ji(e,t){return(Ji=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Bi(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=Vi(e);if(t){var r=Vi(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return Ui(this,n)}}function Ui(e,t){if(t&&("object"===Fi(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Vi(e){return(Vi=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Gi=wp.i18n.__,qi=wp.element.Component,Ki=wp.components,$i=Ki.PanelBody,Zi=Ki.SelectControl,Qi=Ki.TextControl,Xi=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ji(e,t)}(s,e);var t,n,a,r=Bi(s);function s(){return Ni(this,s),r.apply(this,arguments)}return t=s,(n=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement($i,{title:Gi("Magnifying Glass"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(Zi,{label:Gi("Enabled"),help:Gi("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:Gi("Yes"),value:"1"},{label:Gi("No"),value:"0"}],onChange:function(n){t.magnifyingGlass.enable=n,e.props.edit(t)}}),wp.element.createElement(Qi,{label:Gi("Zoom Factor"),help:Gi("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)}}))}}])&&Ii(t.prototype,n),a&&Ii(t,a),s}(qi);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 to(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function no(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function ao(e,t){return(ao=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ro(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=io(e);if(t){var r=io(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return so(this,n)}}function so(e,t){if(t&&("object"===eo(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function io(e){return(io=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var oo=wp.i18n.__,lo=wp.element,uo=lo.Component,co=lo.Fragment,mo=(wp.blockEditor||wp.editor).ColorPalette,_o=wp.components,ho=_o.BaseControl,po=_o.ExternalLink,fo=_o.PanelBody,yo=_o.TextControl,Mo=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ao(e,t)}(s,e);var t,n,a,r=ro(s);function s(){return to(this,s),r.apply(this,arguments)}return t=s,(n=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(fo,{title:oo("Gauge Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(fo,{title:oo("Tick Settings"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(yo,{label:oo("Minimum Values"),help:oo("Determines the minimum values of gauge."),value:t.min,onChange:function(n){t.min=n,e.props.edit(t)}}),wp.element.createElement(yo,{label:oo("Maximum Values"),help:oo("Determines the maximum values of gauge."),value:t.max,onChange:function(n){t.max=n,e.props.edit(t)}}),wp.element.createElement(yo,{label:oo("Minor Ticks"),help:oo("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:oo("Number Format"),help:oo("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,oo("For number axis labels, this is a subset of the formatting "),wp.element.createElement(po,{href:"http://icu-project.org/apiref/icu4c/classDecimalFormat.html#_details"},oo("ICU pattern set.")),oo(" 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(fo,{title:oo("Green Color"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(yo,{label:oo("Minimum Range"),help:oo("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:oo("Maximum Range"),help:oo("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:oo("Green Color")},wp.element.createElement(mo,{value:t.greenColor,onChange:function(n){t.greenColor=n,e.props.edit(t)}}))),wp.element.createElement(fo,{title:oo("Yellow Color"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(yo,{label:oo("Minimum Range"),help:oo("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:oo("Maximum Range"),help:oo("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:oo("Yellow Color")},wp.element.createElement(mo,{value:t.yellowColor,onChange:function(n){t.yellowColor=n,e.props.edit(t)}}))),wp.element.createElement(fo,{title:oo("Red Color"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(yo,{label:oo("Minimum Range"),help:oo("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:oo("Maximum Range"),help:oo("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:oo("Red Color")},wp.element.createElement(mo,{value:t.redColor,onChange:function(n){t.redColor=n,e.props.edit(t)}}))))}}])&&no(t.prototype,n),a&&no(t,a),s}(uo);function go(e){return(go="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 Lo(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function bo(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function vo(e,t){return(vo=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Yo(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=Do(e);if(t){var r=Do(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return wo(this,n)}}function wo(e,t){if(t&&("object"===go(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return ko(e)}function ko(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Do(e){return(Do=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var To=wp.i18n.__,So=wp.element.Component,jo=(wp.blockEditor||wp.editor).ColorPalette,Oo=wp.components,xo=Oo.BaseControl,Ho=Oo.CheckboxControl,Eo=Oo.PanelBody,Po=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&vo(e,t)}(s,e);var t,n,a,r=Yo(s);function s(){var e;return Lo(this,s),(e=r.apply(this,arguments)).mapValues=e.mapValues.bind(ko(e)),e}return t=s,(n=[{key:"mapValues",value:function(e,t){return void 0===e.timeline?e[t]:e.timeline[t]}},{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return this.mapValues(t,"showRowLabels"),wp.element.createElement(Eo,{title:To("Timeline Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(Ho,{label:To("Show Row Label"),help:To("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(Ho,{label:To("Group by Row Label"),help:To("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(Ho,{label:To("Color by Row Label"),help:To("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(xo,{label:To("Single Color")},wp.element.createElement(jo,{value:this.mapValues(t,"singleColor"),onChange:function(n){void 0===t.timeline&&(t.timeline={}),t.timeline.singleColor=n,e.props.edit(t)}})))}}])&&bo(t.prototype,n),a&&bo(t,a),s}(So);function Co(e){return(Co="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 zo(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ao(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function Wo(e,t){return(Wo=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Ro(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=No(e);if(t){var r=No(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return Fo(this,n)}}function Fo(e,t){if(t&&("object"===Co(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function No(e){return(No=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Io=wp.i18n.__,Jo=wp.element,Bo=Jo.Component,Uo=Jo.Fragment,Vo=wp.components,Go=Vo.CheckboxControl,qo=Vo.PanelBody,Ko=Vo.SelectControl,$o=Vo.TextControl,Zo=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Wo(e,t)}(s,e);var t,n,a,r=Ro(s);function s(){return zo(this,s),r.apply(this,arguments)}return t=s,(n=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"],n=(this.props.chart["visualizer-chart-type"],this.props.chart["visualizer-chart-library"]);return wp.element.createElement(qo,{title:Io("Table Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},"DataTable"===n?wp.element.createElement(Uo,null,wp.element.createElement(Go,{label:Io("Enable Pagination"),help:Io("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($o,{label:Io("Number of rows per page"),help:Io("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(Ko,{label:Io("Pagination type"),help:Io("Determines what type of pagination options to show."),value:t.pagingType,options:[{label:Io("Page number buttons only"),value:"numbers"},{label:Io("'Previous' and 'Next' buttons only"),value:"simple"},{label:Io("'Previous' and 'Next' buttons, plus page numbers"),value:"simple_numbers"},{label:Io("'First', 'Previous', 'Next' and 'Last' buttons"),value:"full"},{label:Io("'First', 'Previous', 'Next' and 'Last' buttons, plus page numbers"),value:"full_numbers"},{label:Io("'First' and 'Last' buttons, plus page numbers"),value:"first_last_numbers"}],onChange:function(n){t.pagingType=n,e.props.edit(t)}}),wp.element.createElement(Go,{label:Io("Scroll Collapse"),help:Io("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($o,{label:Io("Vertical Height"),help:Io("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(Go,{label:Io("Disable Sort"),help:Io("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(Go,{label:Io("Freeze Header/Footer"),help:Io("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(Go,{label:Io("Responsive"),help:Io("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(Uo,null,wp.element.createElement(Ko,{label:Io("Enable Pagination"),help:Io("To enable paging through the data."),value:t.page?t.page:"disable",options:[{label:Io("Enable"),value:"enable"},{label:Io("Disable"),value:"disable"}],onChange:function(n){t.page=n,e.props.edit(t)}}),wp.element.createElement($o,{label:Io("Number of rows per page"),help:Io("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(Ko,{label:Io("Disable Sort"),help:Io("To disable sorting on columns."),value:t.sort?t.sort:"enable",options:[{label:Io("Enable"),value:"enable"},{label:Io("Disable"),value:"disable"}],onChange:function(n){t.sort=n,e.props.edit(t)}}),wp.element.createElement($o,{label:Io("Freeze Columns"),help:Io("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(Go,{label:Io("Allow HTML"),help:Io("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(Go,{label:Io("Right to Left table"),help:Io("Adds basic support for right-to-left languages."),checked:Number(t.rtlTable),onChange:function(n){t.rtlTable=!Number(t.rtlTable),e.props.edit(t)}})))}}])&&Ao(t.prototype,n),a&&Ao(t,a),s}(Bo);function Qo(e){return(Qo="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 Xo(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function el(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function tl(e,t){return(tl=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function nl(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=rl(e);if(t){var r=rl(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return al(this,n)}}function al(e,t){if(t&&("object"===Qo(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function rl(e){return(rl=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var sl=wp.i18n.__,il=wp.element,ol=il.Component,ll=il.Fragment,ul=(wp.blockEditor||wp.editor).ColorPalette,dl=wp.components,cl=dl.BaseControl,ml=dl.PanelBody,_l=dl.TextControl,hl=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&tl(e,t)}(s,e);var t,n,a,r=nl(s);function s(){return Xo(this,s),r.apply(this,arguments)}return t=s,(n=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"],n=(this.props.chart["visualizer-chart-type"],this.props.chart["visualizer-chart-library"]);return wp.element.createElement(ml,{title:sl("Row/Cell Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},"DataTable"===n?wp.element.createElement(ll,null,wp.element.createElement(ml,{title:sl("Odd Table Row"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(cl,{label:sl("Background Color")},wp.element.createElement(ul,{value:t.customcss.oddTableRow["background-color"],onChange:function(n){t.customcss.oddTableRow["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(cl,{label:sl("Color")},wp.element.createElement(ul,{value:t.customcss.oddTableRow.color,onChange:function(n){t.customcss.oddTableRow.color=n,e.props.edit(t)}})),wp.element.createElement(_l,{label:sl("Text Orientation"),help:sl("In degrees."),type:"number",value:t.customcss.oddTableRow.transform,onChange:function(n){t.customcss.oddTableRow.transform=n,e.props.edit(t)}})),wp.element.createElement(ml,{title:sl("Even Table Row"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(cl,{label:sl("Background Color")},wp.element.createElement(ul,{value:t.customcss.evenTableRow["background-color"],onChange:function(n){t.customcss.evenTableRow["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(cl,{label:sl("Color")},wp.element.createElement(ul,{value:t.customcss.evenTableRow.color,onChange:function(n){t.customcss.evenTableRow.color=n,e.props.edit(t)}})),wp.element.createElement(_l,{label:sl("Text Orientation"),help:sl("In degrees."),type:"number",value:t.customcss.evenTableRow.transform,onChange:function(n){t.customcss.evenTableRow.transform=n,e.props.edit(t)}})),wp.element.createElement(ml,{title:sl("Table Cell"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(cl,{label:sl("Background Color")},wp.element.createElement(ul,{value:t.customcss.tableCell["background-color"],onChange:function(n){t.customcss.tableCell["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(cl,{label:sl("Color")},wp.element.createElement(ul,{value:t.customcss.tableCell.color,onChange:function(n){t.customcss.tableCell.color=n,e.props.edit(t)}})),wp.element.createElement(_l,{label:sl("Text Orientation"),help:sl("In degrees."),type:"number",value:t.customcss.tableCell.transform,onChange:function(n){t.customcss.tableCell.transform=n,e.props.edit(t)}}))):wp.element.createElement(ll,null,wp.element.createElement(ml,{title:sl("Header Row"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(cl,{label:sl("Background Color")},wp.element.createElement(ul,{value:t.customcss.headerRow["background-color"],onChange:function(n){t.customcss.headerRow["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(cl,{label:sl("Color")},wp.element.createElement(ul,{value:t.customcss.headerRow.color,onChange:function(n){t.customcss.headerRow.color=n,e.props.edit(t)}})),wp.element.createElement(_l,{label:sl("Text Orientation"),help:sl("In degrees."),type:"number",value:t.customcss.headerRow.transform,onChange:function(n){t.customcss.headerRow.transform=n,e.props.edit(t)}})),wp.element.createElement(ml,{title:sl("Table Row"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(cl,{label:sl("Background Color")},wp.element.createElement(ul,{value:t.customcss.tableRow["background-color"],onChange:function(n){t.customcss.tableRow["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(cl,{label:sl("Color")},wp.element.createElement(ul,{value:t.customcss.tableRow.color,onChange:function(n){t.customcss.tableRow.color=n,e.props.edit(t)}})),wp.element.createElement(_l,{label:sl("Text Orientation"),help:sl("In degrees."),type:"number",value:t.customcss.tableRow.transform,onChange:function(n){t.customcss.tableRow.transform=n,e.props.edit(t)}})),wp.element.createElement(ml,{title:sl("Odd Table Row"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(cl,{label:sl("Background Color")},wp.element.createElement(ul,{value:t.customcss.oddTableRow["background-color"],onChange:function(n){t.customcss.oddTableRow["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(cl,{label:sl("Color")},wp.element.createElement(ul,{value:t.customcss.oddTableRow.color,onChange:function(n){t.customcss.oddTableRow.color=n,e.props.edit(t)}})),wp.element.createElement(_l,{label:sl("Text Orientation"),help:sl("In degrees."),type:"number",value:t.customcss.oddTableRow.transform,onChange:function(n){t.customcss.oddTableRow.transform=n,e.props.edit(t)}})),wp.element.createElement(ml,{title:sl("Selected Table Row"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(cl,{label:sl("Background Color")},wp.element.createElement(ul,{value:t.customcss.selectedTableRow["background-color"],onChange:function(n){t.customcss.selectedTableRow["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(cl,{label:sl("Color")},wp.element.createElement(ul,{value:t.customcss.selectedTableRow.color,onChange:function(n){t.customcss.selectedTableRow.color=n,e.props.edit(t)}})),wp.element.createElement(_l,{label:sl("Text Orientation"),help:sl("In degrees."),type:"number",value:t.customcss.selectedTableRow.transform,onChange:function(n){t.customcss.selectedTableRow.transform=n,e.props.edit(t)}})),wp.element.createElement(ml,{title:sl("Hover Table Row"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(cl,{label:sl("Background Color")},wp.element.createElement(ul,{value:t.customcss.hoverTableRow["background-color"],onChange:function(n){t.customcss.hoverTableRow["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(cl,{label:sl("Color")},wp.element.createElement(ul,{value:t.customcss.hoverTableRow.color,onChange:function(n){t.customcss.hoverTableRow.color=n,e.props.edit(t)}})),wp.element.createElement(_l,{label:sl("Text Orientation"),help:sl("In degrees."),type:"number",value:t.customcss.hoverTableRow.transform,onChange:function(n){t.customcss.hoverTableRow.transform=n,e.props.edit(t)}})),wp.element.createElement(ml,{title:sl("Header Cell"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(cl,{label:sl("Background Color")},wp.element.createElement(ul,{value:t.customcss.headerCell["background-color"],onChange:function(n){t.customcss.headerCell["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(cl,{label:sl("Color")},wp.element.createElement(ul,{value:t.customcss.headerCell.color,onChange:function(n){t.customcss.headerCell.color=n,e.props.edit(t)}})),wp.element.createElement(_l,{label:sl("Text Orientation"),help:sl("In degrees."),type:"number",value:t.customcss.headerCell.transform,onChange:function(n){t.customcss.headerCell.transform=n,e.props.edit(t)}})),wp.element.createElement(ml,{title:sl("Table Cell"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(cl,{label:sl("Background Color")},wp.element.createElement(ul,{value:t.customcss.tableCell["background-color"],onChange:function(n){t.customcss.tableCell["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(cl,{label:sl("Color")},wp.element.createElement(ul,{value:t.customcss.tableCell.color,onChange:function(n){t.customcss.tableCell.color=n,e.props.edit(t)}})),wp.element.createElement(_l,{label:sl("Text Orientation"),help:sl("In degrees."),type:"number",value:t.customcss.tableCell.transform,onChange:function(n){t.customcss.tableCell.transform=n,e.props.edit(t)}}))))}}])&&el(t.prototype,n),a&&el(t,a),s}(ol);function pl(e){return(pl="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 fl(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function yl(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function Ml(e,t){return(Ml=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function gl(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=bl(e);if(t){var r=bl(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return Ll(this,n)}}function Ll(e,t){if(t&&("object"===pl(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function bl(e){return(bl=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var vl=wp.i18n.__,Yl=wp.element.Component,wl=wp.components,kl=wl.PanelBody,Dl=wl.SelectControl,Tl=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ml(e,t)}(s,e);var t,n,a,r=gl(s);function s(){return fl(this,s),r.apply(this,arguments)}return t=s,(n=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(kl,{title:vl("Combo Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(Dl,{label:vl("Chart Type"),help:vl("Select the default chart type."),value:t.seriesType?t.seriesType:"area",options:[{label:vl("Area"),value:"area"},{label:vl("Bar"),value:"bars"},{label:vl("Candlesticks"),value:"candlesticks"},{label:vl("Line"),value:"line"},{label:vl("Stepped Area"),value:"steppedArea"}],onChange:function(n){t.seriesType=n,e.props.edit(t)}}))}}])&&yl(t.prototype,n),a&&yl(t,a),s}(Yl);function Sl(e){return(Sl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function jl(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ol(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function xl(e,t){return(xl=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Hl(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=Pl(e);if(t){var r=Pl(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return El(this,n)}}function El(e,t){if(t&&("object"===Sl(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Pl(e){return(Pl=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Cl=wp.i18n.__,zl=wp.element,Al=zl.Component,Wl=zl.Fragment,Rl=(wp.blockEditor||wp.editor).ColorPalette,Fl=wp.components,Nl=Fl.BaseControl,Il=Fl.ExternalLink,Jl=Fl.PanelBody,Bl=Fl.SelectControl,Ul=Fl.TextControl,Vl=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&xl(e,t)}(s,e);var t,n,a,r=Hl(s);function s(){return jl(this,s),r.apply(this,arguments)}return t=s,(n=[{key:"componentDidMount",value:function(){var e=this.props.chart["visualizer-settings"];Object.keys(e.series).map((function(t){void 0!==e.series[t]&&(e.series[t].temp=1)})),this.props.edit(e)}},{key:"render",value:function(){var e=this,t=(this.props.chart["visualizer-chart-type"],this.props.chart["visualizer-settings"]),n=this.props.chart["visualizer-series"];return wp.element.createElement(Jl,{title:Cl("Series Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},Object.keys(t.series).map((function(a,r){var s=parseInt(a),i=n[a].label||"",o=n[a].type||"",l=0;return"tabular"!==o&&(s=r),a++,wp.element.createElement(Jl,{title:i,className:"visualizer-inner-sections",initialOpen:!1},-1>=["tabular","pie"].indexOf(o)&&wp.element.createElement(Bl,{label:Cl("Visible In Legend"),help:Cl("Determines whether the series has to be presented in the legend or not."),value:t.series[r].visibleInLegend?t.series[r].visibleInLegend:"1",options:[{label:Cl("Yes"),value:"1"},{label:Cl("No"),value:"0"}],onChange:function(n){t.series[r].visibleInLegend=n,e.props.edit(t)}}),-1>=["tabular","candlestick","combo","column","bar"].indexOf(o)&&wp.element.createElement(Wl,null,wp.element.createElement(Ul,{label:Cl("Line Width"),help:Cl("Overrides the global line width value for this series."),value:t.series[r].lineWidth,onChange:function(n){t.series[r].lineWidth=n,e.props.edit(t)},onKeyUp:function(n){clearTimeout(l),l=setTimeout((function(){""!=t.series[r].lineWidth&&0>=t.series[r].lineWidth&&(t.series[r].lineWidth="0.1",e.props.edit(t))}),700)}}),wp.element.createElement(Ul,{label:Cl("Point Size"),help:Cl("Overrides the global point size value for this series."),value:t.series[r].pointSize,onChange:function(n){t.series[r].pointSize=n,e.props.edit(t)}})),-1>=["candlestick"].indexOf(o)&&o&&"number"===o?wp.element.createElement(Wl,null,wp.element.createElement(Ul,{label:Cl("Format"),help:Cl("Enter custom format pattern to apply to this series value."),value:t.series[s].format,onChange:function(n){t.series[s].format=n,e.props.edit(t)}}),wp.element.createElement("p",null,Cl("For number axis labels, this is a subset of the formatting "),wp.element.createElement(Il,{href:"http://icu-project.org/apiref/icu4c/classDecimalFormat.html#_details"},Cl("ICU pattern set.")),Cl(" 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(o)&&wp.element.createElement(Wl,null,wp.element.createElement(Ul,{label:Cl("Date Format"),help:Cl("Enter custom format pattern to apply to this series value."),placeholder:"dd LLLL yyyy",value:t.series[s].format,onChange:function(n){t.series[s].format=n,e.props.edit(t)}}),wp.element.createElement("p",null,Cl("This is a subset of the date formatting "),wp.element.createElement(Il,{href:"http://userguide.icu-project.org/formatparse/datetime#TOC-Date-Time-Format-Syntax"},Cl("ICU date and time format.")))),0<=["scatter","line"].indexOf(o)&&wp.element.createElement(Bl,{label:Cl("Curve Type"),help:Cl("Determines whether the series has to be presented in the legend or not."),value:t.series[r].curveType?t.series[r].curveType:"none",options:[{label:Cl("Straight line without curve"),value:"none"},{label:Cl("The angles of the line will be smoothed"),value:"function"}],onChange:function(n){t.series[r].curveType=n,e.props.edit(t)}}),0<=["area"].indexOf(o)&&wp.element.createElement(Ul,{label:Cl("Area Opacity"),help:Cl("The opacity of the colored area, where 0.0 is fully transparent and 1.0 is fully opaque."),value:t.series[r].areaOpacity,onChange:function(n){t.series[r].areaOpacity=n,e.props.edit(t)}}),0<=["combo"].indexOf(o)&&wp.element.createElement(Bl,{label:Cl("Chart Type"),help:Cl("Select the type of chart to show for this series."),value:t.series[r].type?t.series[r].type:"area",options:[{label:Cl("Area"),value:"area"},{label:Cl("Bar"),value:"bars"},{label:Cl("Candlesticks"),value:"candlesticks"},{label:Cl("Line"),value:"line"},{label:Cl("Stepped Area"),value:"steppedArea"}],onChange:function(n){t.series[r].type=n,e.props.edit(t)}}),-1>=["tabular"].indexOf(o)&&wp.element.createElement(Nl,{label:Cl("Color")},wp.element.createElement(Rl,{value:t.series[r].color,onChange:function(n){t.series[r].color=n,e.props.edit(t)}})))})))}}])&&Ol(t.prototype,n),a&&Ol(t,a),s}(Al);function Gl(e){return(Gl="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 ql(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Kl(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function $l(e,t){return($l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Zl(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=Xl(e);if(t){var r=Xl(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return Ql(this,n)}}function Ql(e,t){if(t&&("object"===Gl(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Xl(e){return(Xl=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var eu=wp.i18n.__,tu=wp.element.Component,nu=(wp.blockEditor||wp.editor).ColorPalette,au=wp.components,ru=au.BaseControl,su=au.PanelBody,iu=au.TextControl,ou=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&$l(e,t)}(s,e);var t,n,a,r=Zl(s);function s(){return ql(this,s),r.apply(this,arguments)}return t=s,(n=[{key:"componentDidMount",value:function(){var e=this.props.chart["visualizer-settings"];Object.keys(e.slices).map((function(t){void 0!==e.slices[t]&&(e.slices[t].temp=1)})),this.props.edit(e)}},{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"],n=this.props.chart["visualizer-data"];return wp.element.createElement(su,{title:eu("Slices Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},Object.keys(t.slices).map((function(a){return wp.element.createElement(su,{title:n[a][0],className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(iu,{label:eu("Slice Offset"),help:eu("How far to separate the slice from the rest of the pie, from 0.0 (not at all) to 1.0 (the pie's radius)."),value:t.slices[a].offset,onChange:function(n){t.slices[a].offset=n,e.props.edit(t)},type:"number",min:"0",step:"0.1"}),wp.element.createElement(ru,{label:eu("Format")},wp.element.createElement(nu,{value:t.slices[a].color,onChange:function(n){t.slices[a].color=n,e.props.edit(t)}})))})))}}])&&Kl(t.prototype,n),a&&Kl(t,a),s}(tu);function lu(e){return(lu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function uu(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function du(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function cu(e,t){return(cu=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function mu(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=hu(e);if(t){var r=hu(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return _u(this,n)}}function _u(e,t){if(t&&("object"===lu(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function hu(e){return(hu=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var pu=wp.i18n.__,fu=wp.element.Component,yu=(wp.blockEditor||wp.editor).ColorPalette,Mu=wp.components,gu=Mu.CheckboxControl,Lu=Mu.BaseControl,bu=Mu.PanelBody,vu=Mu.TextControl,Yu=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&cu(e,t)}(s,e);var t,n,a,r=mu(s);function s(){return uu(this,s),r.apply(this,arguments)}return t=s,(n=[{key:"componentDidMount",value:function(){}},{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(bu,{title:pu("Bubble Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(vu,{label:pu("Opacity"),help:pu("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(Lu,{label:pu("Stroke Color")},wp.element.createElement(yu,{value:t.bubble.stroke,onChange:function(n){t.bubble||(t.bubble={}),t.bubble.stroke=n,e.props.edit(t)}})),wp.element.createElement(gu,{label:pu("Sort Bubbles by Size"),help:pu("If checked, sorts the bubbles by size so the smaller bubbles appear above the larger bubbles. If unchecked, bubbles are sorted according to their order in the table."),checked:Q(t,"sortBubblesBySize"),onChange:function(n){t.sortBubblesBySize=n,e.props.edit(t)}}),wp.element.createElement(vu,{label:pu("Size (max)"),help:pu("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(vu,{label:pu("Size (min)"),help:pu("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)}}))}}])&&du(t.prototype,n),a&&du(t,a),s}(fu);function wu(e){return(wu="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 ku(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Du(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function Tu(e,t){return(Tu=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Su(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=Ou(e);if(t){var r=Ou(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return ju(this,n)}}function ju(e,t){if(t&&("object"===wu(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Ou(e){return(Ou=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var xu=wp.i18n.__,Hu=wp.element,Eu=Hu.Component,Pu=Hu.Fragment,Cu=wp.components,zu=Cu.ExternalLink,Au=Cu.PanelBody,Wu=Cu.TextControl,Ru=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Tu(e,t)}(s,e);var t,n,a,r=Su(s);function s(){return ku(this,s),r.apply(this,arguments)}return t=s,(n=[{key:"componentDidMount",value:function(){var e=this.props.chart["visualizer-settings"];e.series&&(Object.keys(e.series).map((function(t){void 0!==e.series[t]&&(e.series[t].temp=1)})),this.props.edit(e))}},{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"],n=this.props.chart["visualizer-series"];return this.props.chart["visualizer-chart-type"],t.series?wp.element.createElement(Au,{title:xu("Column Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},Object.keys(t.series).map((function(a){return"string"===n[a].type?null:wp.element.createElement(Au,{title:n[a].label,className:"visualizer-inner-sections",initialOpen:!1},0<=["date","datetime","timeofday"].indexOf(n[a].type)&&wp.element.createElement(Pu,null,wp.element.createElement(Wu,{label:xu("Display Date Format"),help:xu("Enter custom format pattern to apply to this series value."),value:t.series[a].format?t.series[a].format.to:"",onChange:function(n){t.series[a].format||(t.series[a].format={}),t.series[a].format.to=n,e.props.edit(t)}}),wp.element.createElement(Wu,{label:xu("Source Date Format"),help:xu("What format is the source date in?"),value:t.series[a].format?t.series[a].format.from:"",onChange:function(n){t.series[a].format||(t.series[a].format={}),t.series[a].format.from=n,e.props.edit(t)}}),wp.element.createElement("p",null,xu("You can find more info on "),wp.element.createElement(zu,{href:"https://momentjs.com/docs/#/displaying/"},xu("date and time formats here.")))),"number"===n[a].type&&wp.element.createElement(Pu,null,wp.element.createElement(Wu,{label:xu("Thousands Separator"),value:t.series[a].format?t.series[a].format.thousands:"",onChange:function(n){t.series[a].format||(t.series[a].format={}),t.series[a].format.thousands=n,e.props.edit(t)}}),wp.element.createElement(Wu,{label:xu("Decimal Separator"),value:t.series[a].format?t.series[a].format.decimal:"",onChange:function(n){t.series[a].format||(t.series[a].format={}),t.series[a].format.decimal=n,e.props.edit(t)}}),wp.element.createElement(Wu,{label:xu("Precision"),help:xu("Round values to how many decimal places?"),value:t.series[a].format?t.series[a].format.precision:"",type:"number",min:"0",onChange:function(n){100<n||(t.series[a].format||(t.series[a].format={}),t.series[a].format.precision=n,e.props.edit(t))}}),wp.element.createElement(Wu,{label:xu("Prefix"),value:t.series[a].format?t.series[a].format.prefix:"",onChange:function(n){t.series[a].format||(t.series[a].format={}),t.series[a].format.prefix=n,e.props.edit(t)}}),wp.element.createElement(Wu,{label:xu("Suffix"),value:t.series[a].format?t.series[a].format.suffix:"",onChange:function(n){t.series[a].format||(t.series[a].format={}),t.series[a].format.suffix=n,e.props.edit(t)}})),"boolean"===n[a].type&&wp.element.createElement(Pu,null,wp.element.createElement(Wu,{label:xu("Truthy value"),help:xu("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[a].format?t.series[a].format.truthy:"",onChange:function(n){t.series[a].truthy||(t.series[a].truthy={}),t.series[a].format.truthy=n,e.props.edit(t)}}),wp.element.createElement(Wu,{label:xu("Falsy value"),help:xu("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[a].format?t.series[a].format.falsy:"",onChange:function(n){t.series[a].falsy||(t.series[a].falsy={}),t.series[a].format.falsy=n,e.props.edit(t)}})))}))):null}}])&&Du(t.prototype,n),a&&Du(t,a),s}(Eu);function Fu(e){return(Fu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Nu(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Iu(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function Ju(e,t){return(Ju=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Bu(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=Vu(e);if(t){var r=Vu(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return Uu(this,n)}}function Uu(e,t){if(t&&("object"===Fu(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Vu(e){return(Vu=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Gu=wp.i18n.__,qu=wp.element,Ku=qu.Component,$u=qu.Fragment,Zu=(wp.blockEditor||wp.editor).ColorPalette,Qu=wp.components,Xu=Qu.BaseControl,ed=Qu.CheckboxControl,td=Qu.PanelBody,nd=Qu.SelectControl,ad=Qu.TextControl,rd=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ju(e,t)}(s,e);var t,n,a,r=Bu(s);function s(){return Nu(this,s),r.apply(this,arguments)}return t=s,(n=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-chart-type"],n=this.props.chart["visualizer-settings"];return wp.element.createElement(td,{title:Gu("Layout And Chart Area"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(td,{title:Gu("Layout"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(ad,{label:Gu("Width of Chart"),help:Gu("Determines the total width of the chart."),value:n.width,onChange:function(t){n.width=t,e.props.edit(n)}}),wp.element.createElement(ad,{label:Gu("Height of Chart"),help:Gu("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(nd,{label:Gu("Keep Aspect Ratio"),help:Gu("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:Gu("Yes"),value:"1"},{label:Gu("No"),value:"0"}],onChange:function(t){n.keepAspectRatio=t,e.props.edit(n)}}),-1>=["gauge","tabular"].indexOf(t)&&wp.element.createElement($u,null,wp.element.createElement(ad,{label:Gu("Stroke Width"),help:Gu("The chart border width in pixels."),value:n.backgroundColor.strokeWidth,onChange:function(t){n.backgroundColor.strokeWidth=t,e.props.edit(n)}}),wp.element.createElement(Xu,{label:Gu("Stroke Color")},wp.element.createElement(Zu,{value:n.backgroundColor.stroke,onChange:function(t){n.backgroundColor.stroke=t,e.props.edit(n)}})),wp.element.createElement(Xu,{label:Gu("Background Color")},wp.element.createElement(Zu,{value:n.backgroundColor.fill,onChange:function(t){n.backgroundColor.fill=t,e.props.edit(n)}})),wp.element.createElement(ed,{label:Gu("Transparent Background?"),checked:"transparent"===n.backgroundColor.fill,onChange:function(t){n.backgroundColor.fill="transparent"===n.backgroundColor.fill?"":"transparent",e.props.edit(n)}}))),-1>=["geo","gauge","tabular"].indexOf(t)&&wp.element.createElement(td,{title:Gu("Chart Area"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(ad,{label:Gu("Left Margin"),help:Gu("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(ad,{label:Gu("Top Margin"),help:Gu("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(ad,{label:Gu("Width Of Chart Area"),help:Gu("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(ad,{label:Gu("Height Of Chart Area"),help:Gu("Determines the hight of the chart area."),value:n.chartArea.height,onChange:function(t){n.chartArea.height=t,e.props.edit(n)}})))}}])&&Iu(t.prototype,n),a&&Iu(t,a),s}(Ku);function sd(e){return(sd="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 id(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function od(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function ld(e,t){return(ld=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ud(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=cd(e);if(t){var r=cd(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return dd(this,n)}}function dd(e,t){if(t&&("object"===sd(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function cd(e){return(cd=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var md=wp.i18n.__,_d=wp.element,hd=_d.Component,pd=_d.Fragment,fd=wp.components,yd=fd.Button,Md=fd.CheckboxControl,gd=fd.PanelBody,Ld=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ld(e,t)}(s,e);var t,n,a,r=ud(s);function s(){return id(this,s),r.apply(this,arguments)}return t=s,(n=[{key:"componentDidMount",value:function(){var e=this.props.chart["visualizer-settings"];void 0===e.actions&&(e.actions=[]),this.props.edit(e)}},{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"],n=this.props.chart["visualizer-chart-type"];return""!==visualizerLocalize.proFeaturesLocked?wp.element.createElement(gd,{title:md("Frontend Actions"),initialOpen:!1,className:"visualizer-advanced-panel"},void 0!==t.actions&&wp.element.createElement(pd,null,wp.element.createElement(Md,{label:md("Print"),help:md("To enable printing the data."),checked:0<=t.actions.indexOf("print"),onChange:function(n){if(0<=t.actions.indexOf("print")){var a=t.actions.indexOf("print");-1!==a&&t.actions.splice(a,1)}else t.actions.push("print");e.props.edit(t)}}),wp.element.createElement(Md,{label:md("CSV"),help:md("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 a=t.actions.indexOf("csv;application/csv");-1!==a&&t.actions.splice(a,1)}else t.actions.push("csv;application/csv");e.props.edit(t)}}),wp.element.createElement(Md,{label:md("Excel"),help:md("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 a=t.actions.indexOf("xls;application/vnd.ms-excel");-1!==a&&t.actions.splice(a,1)}else t.actions.push("xls;application/vnd.ms-excel");e.props.edit(t)}}),wp.element.createElement(Md,{label:md("Copy"),help:md("To enable copying the data to the clipboard."),checked:0<=t.actions.indexOf("copy"),onChange:function(n){if(0<=t.actions.indexOf("copy")){var a=t.actions.indexOf("copy");-1!==a&&t.actions.splice(a,1)}else t.actions.push("copy");e.props.edit(t)}}),-1>=["dataTable","tabular","gauge","table"].indexOf(n)&&wp.element.createElement(Md,{label:md("Download Image"),help:md("To download the chart as an image."),checked:0<=t.actions.indexOf("image"),onChange:function(n){if(0<=t.actions.indexOf("image")){var a=t.actions.indexOf("image");-1!==a&&t.actions.splice(a,1)}else t.actions.push("image");e.props.edit(t)}}))):wp.element.createElement(gd,{title:md("Frontend Actions"),initialOpen:!1,icon:"lock",className:"visualizer-advanced-panel"},wp.element.createElement("p",null,md("Enable this feature in PRO version!")),wp.element.createElement(yd,{isPrimary:!0,href:visualizerLocalize.proTeaser,target:"_blank"},md("Buy Now")))}}])&&od(t.prototype,n),a&&od(t,a),s}(hd);function bd(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vd(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},a=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&a.push.apply(a,Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),a.forEach((function(t){bd(e,t,n[t])}))}return e}var Yd={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"}},wd=n(3);const kd={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&&kd.throwError(kd.getCaller(2),e)},isFalsy:(e="<unknown parameter>",t)=>{t||kd.throwError(kd.getCaller(2),e)},isNoneOf:(e="<unknown parameter>",t,n=[])=>{-1===n.indexOf(t)&&kd.throwError(kd.getCaller(2),e,"to be any of"+JSON.stringify(n))},isAnyOf:(e="<unknown parameter>",t,n=[])=>{n.indexOf(t)>-1&&kd.throwError(kd.getCaller(2),e,"not to be any of"+JSON.stringify(n))},isNotType:(e="<unknown parameter>",t,n="")=>{Object(wd.getType)(t)!==n.toLowerCase()&&kd.throwError(kd.getCaller(2),e,"to be type "+n.toLowerCase())},isAnyTypeOf:(e="<unknown parameter>",t,n=[])=>{n.forEach(n=>{Object(wd.getType)(t)===n&&kd.throwError(kd.getCaller(2),e,"not to be type of "+n.toLowerCase())})},missingKey:(e="<unknown parameter>",t,n="")=>{kd.isUndefined(e,t),-1===Object.keys(t).indexOf(n)&&kd.throwError(kd.getCaller(2),e,"to contain '"+n+"' key")},missingAnyKeys:(e="<unknown parameter>",t,n=[""])=>{kd.isUndefined(e,t);const a=Object.keys(t);n.forEach(t=>{-1===a.indexOf(t)&&kd.throwError(kd.getCaller(2),e,"to contain '"+t+"' key")})},containsUndefined:(e="<unknown parameter>",t)=>{[void 0,null].forEach(n=>{const a=Object(wd.locate)(t,n);a&&kd.throwError(kd.getCaller(2),e,"not to contain '"+JSON.stringify(n)+"' at "+a)})},isInvalidPath:(e="<unknown parameter>",t)=>{kd.isUndefined(e,t),kd.isNotType(e,t,"string"),kd.isAnyOf(e,t,["","/"]),".$[]#".split().forEach(n=>{t.indexOf(n)>-1&&kd.throwError(kd.getCaller(2),e,"not to contain invalid character '"+n+"'")}),t.match(/\/{2,}/g)&&kd.throwError(kd.getCaller(2),e,"not to contain consecutive forward slash characters")},isInvalidWriteData:(e="<unknown parameter>",t)=>{kd.isUndefined(e,t),kd.containsUndefined(e,t)}};var Dd=kd;const Td=(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 Sd={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"};
337
  /** @license react-json-editor-ajrm v2.5.13
338
  *
339
  * This source code is licensed under the MIT license found in the
340
  * LICENSE file in the root directory of this source tree.
341
+ */class jd extends a.Component{constructor(e){super(e),this.updateInternalProps=this.updateInternalProps.bind(this),this.createMarkup=this.createMarkup.bind(this),this.onClick=this.onClick.bind(this),this.onBlur=this.onBlur.bind(this),this.update=this.update.bind(this),this.getCursorPosition=this.getCursorPosition.bind(this),this.setCursorPosition=this.setCursorPosition.bind(this),this.scheduledUpdate=this.scheduledUpdate.bind(this),this.setUpdateTime=this.setUpdateTime.bind(this),this.renderLabels=this.renderLabels.bind(this),this.newSpan=this.newSpan.bind(this),this.renderErrorMessage=this.renderErrorMessage.bind(this),this.onScroll=this.onScroll.bind(this),this.showPlaceholder=this.showPlaceholder.bind(this),this.tokenize=this.tokenize.bind(this),this.onKeyPress=this.onKeyPress.bind(this),this.onKeyDown=this.onKeyDown.bind(this),this.onPaste=this.onPaste.bind(this),this.stopEvent=this.stopEvent.bind(this),this.refContent=null,this.refLabels=null,this.updateInternalProps(),this.renderCount=1,this.state={prevPlaceholder:"",markupText:"",plainText:"",json:"",jsObject:void 0,lines:!1,error:!1},this.props.locale||console.warn("[react-json-editor-ajrm - Deprecation Warning] You did not provide a 'locale' prop for your JSON input - This will be required in a future version. English has been set as a default.")}updateInternalProps(){let e={},t={},n=Yd.dark_vscode_tribute;"theme"in this.props&&"string"==typeof this.props.theme&&this.props.theme in Yd&&(n=Yd[this.props.theme]),e=n,"colors"in this.props&&(e={default:"default"in this.props.colors?this.props.colors.default:e.default,string:"string"in this.props.colors?this.props.colors.string:e.string,number:"number"in this.props.colors?this.props.colors.number:e.number,colon:"colon"in this.props.colors?this.props.colors.colon:e.colon,keys:"keys"in this.props.colors?this.props.colors.keys:e.keys,keys_whiteSpace:"keys_whiteSpace"in this.props.colors?this.props.colors.keys_whiteSpace:e.keys_whiteSpace,primitive:"primitive"in this.props.colors?this.props.colors.primitive:e.primitive,error:"error"in this.props.colors?this.props.colors.error:e.error,background:"background"in this.props.colors?this.props.colors.background:e.background,background_warning:"background_warning"in this.props.colors?this.props.colors.background_warning:e.background_warning}),this.colors=e,t="style"in this.props?{outerBox:"outerBox"in this.props.style?this.props.style.outerBox:{},container:"container"in this.props.style?this.props.style.container:{},warningBox:"warningBox"in this.props.style?this.props.style.warningBox:{},errorMessage:"errorMessage"in this.props.style?this.props.style.errorMessage:{},body:"body"in this.props.style?this.props.style.body:{},labelColumn:"labelColumn"in this.props.style?this.props.style.labelColumn:{},labels:"labels"in this.props.style?this.props.style.labels:{},contentBox:"contentBox"in this.props.style?this.props.style.contentBox:{}}:{outerBox:{},container:{},warningBox:{},errorMessage:{},body:{},labelColumn:{},labels:{},contentBox:{}},this.style=t,this.confirmGood=!("confirmGood"in this.props)||this.props.confirmGood;const a=this.props.height||"610px",r=this.props.width||"479px";this.totalHeight=a,this.totalWidth=r,!("onKeyPressUpdate"in this.props)||this.props.onKeyPressUpdate?this.timer||(this.timer=setInterval(this.scheduledUpdate,100)):this.timer&&(clearInterval(this.timer),this.timer=!1),this.updateTime=!1,this.waitAfterKeyPress="waitAfterKeyPress"in this.props?this.props.waitAfterKeyPress:1e3,this.resetConfiguration="reset"in this.props&&this.props.reset}render(){const e=this.props.id,t=this.state.markupText,n=this.props.error||this.state.error,a=this.colors,s=this.style,i=this.confirmGood,o=this.totalHeight,l=this.totalWidth,u=!!this.props.error||!!n&&"token"in n;return this.renderCount++,r.a.createElement("div",{name:"outer-box",id:e&&e+"-outer-box",style:vd({display:"block",overflow:"none",height:o,width:l,margin:0,boxSizing:"border-box",position:"relative"},s.outerBox)},i?r.a.createElement("div",{style:{opacity:u?0:1,height:"30px",width:"30px",position:"absolute",top:0,right:0,transform:"translate(-25%,25%)",pointerEvents:"none",transitionDuration:"0.2s",transitionTimingFunction:"cubic-bezier(0, 1, 0.5, 1)"}},r.a.createElement("svg",{height:"30px",width:"30px",viewBox:"0 0 100 100"},r.a.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",fill:"green",opacity:"0.85",d:"M39.363,79L16,55.49l11.347-11.419L39.694,56.49L72.983,23L84,34.085L39.363,79z"}))):void 0,r.a.createElement("div",{name:"container",id:e&&e+"-container",style:vd({display:"block",height:o,width:l,margin:0,boxSizing:"border-box",overflow:"hidden",fontFamily:"Roboto, sans-serif"},s.container),onClick:this.onClick},r.a.createElement("div",{name:"warning-box",id:e&&e+"-warning-box",style:vd({display:"block",overflow:"hidden",height:u?"60px":"0px",width:"100%",margin:0,backgroundColor:a.background_warning,transitionDuration:"0.2s",transitionTimingFunction:"cubic-bezier(0, 1, 0.5, 1)"},s.warningBox),onClick:this.onClick},r.a.createElement("span",{style:{display:"inline-block",height:"60px",width:"60px",margin:0,boxSizing:"border-box",overflow:"hidden",verticalAlign:"top",pointerEvents:"none"},onClick:this.onClick},r.a.createElement("div",{style:{position:"relative",top:0,left:0,height:"60px",width:"60px",margin:0,pointerEvents:"none"},onClick:this.onClick},r.a.createElement("div",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",pointerEvents:"none"},onClick:this.onClick},r.a.createElement("svg",{height:"25px",width:"25px",viewBox:"0 0 100 100"},r.a.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",fill:"red",d:"M73.9,5.75c0.467-0.467,1.067-0.7,1.8-0.7c0.7,0,1.283,0.233,1.75,0.7l16.8,16.8 c0.467,0.5,0.7,1.084,0.7,1.75c0,0.733-0.233,1.334-0.7,1.801L70.35,50l23.9,23.95c0.5,0.467,0.75,1.066,0.75,1.8 c0,0.667-0.25,1.25-0.75,1.75l-16.8,16.75c-0.534,0.467-1.117,0.7-1.75,0.7s-1.233-0.233-1.8-0.7L50,70.351L26.1,94.25 c-0.567,0.467-1.167,0.7-1.8,0.7c-0.667,0-1.283-0.233-1.85-0.7L5.75,77.5C5.25,77,5,76.417,5,75.75c0-0.733,0.25-1.333,0.75-1.8 L29.65,50L5.75,26.101C5.25,25.667,5,25.066,5,24.3c0-0.666,0.25-1.25,0.75-1.75l16.8-16.8c0.467-0.467,1.05-0.7,1.75-0.7 c0.733,0,1.333,0.233,1.8,0.7L50,29.65L73.9,5.75z"}))))),r.a.createElement("span",{style:{display:"inline-block",height:"60px",width:"calc(100% - 60px)",margin:0,overflow:"hidden",verticalAlign:"top",position:"absolute",pointerEvents:"none"},onClick:this.onClick},this.renderErrorMessage())),r.a.createElement("div",{name:"body",id:e&&e+"-body",style:vd({display:"flex",overflow:"none",height:u?"calc(100% - 60px)":"100%",width:"",margin:0,resize:"none",fontFamily:"Roboto Mono, Monaco, monospace",fontSize:"11px",backgroundColor:a.background,transitionDuration:"0.2s",transitionTimingFunction:"cubic-bezier(0, 1, 0.5, 1)"},s.body),onClick:this.onClick},r.a.createElement("span",{name:"labels",id:e&&e+"-labels",ref:e=>this.refLabels=e,style:vd({display:"inline-block",boxSizing:"border-box",verticalAlign:"top",height:"100%",width:"44px",margin:0,padding:"5px 0px 5px 10px",overflow:"hidden",color:"#D4D4D4"},s.labelColumn),onClick:this.onClick},this.renderLabels()),r.a.createElement("span",{id:e,ref:e=>this.refContent=e,contentEditable:!0,style:vd({display:"inline-block",boxSizing:"border-box",verticalAlign:"top",height:"100%",width:"",flex:1,margin:0,padding:"5px",overflowX:"hidden",overflowY:"auto",wordWrap:"break-word",whiteSpace:"pre-line",color:"#D4D4D4",outline:"none"},s.contentBox),dangerouslySetInnerHTML:this.createMarkup(t),onKeyPress:this.onKeyPress,onKeyDown:this.onKeyDown,onClick:this.onClick,onBlur:this.onBlur,onScroll:this.onScroll,onPaste:this.onPaste,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1}))))}renderErrorMessage(){const e=this.props.locale||Sd,t=this.props.error||this.state.error,n=this.style;if(t)return r.a.createElement("p",{style:vd({color:"red",fontSize:"12px",position:"absolute",width:"calc(100% - 60px)",height:"60px",boxSizing:"border-box",margin:0,padding:0,paddingRight:"10px",overflowWrap:"break-word",display:"flex",flexDirection:"column",justifyContent:"center"},n.errorMessage)},Td(e.format,t))}renderLabels(){const e=this.colors,t=this.style,n=this.props.error||this.state.error,a=n?n.line:-1,s=this.state.lines?this.state.lines:1;let i=new Array(s);for(var o=0;o<s-1;o++)i[o]=o+1;return i.map(n=>{const s=n!==a?e.default:"red";return r.a.createElement("div",{key:n,style:vd({},t.labels,{color:s})},n)})}createMarkup(e){return void 0===e?{__html:""}:{__html:""+e}}newSpan(e,t,n){let a=this.colors,r=t.type,s=t.string,i="";switch(r){case"string":case"number":case"primitive":case"error":i=a[t.type];break;case"key":i=" "===s?a.keys_whiteSpace:a.keys;break;case"symbol":i=":"===s?a.colon:a.default;break;default:i=a.default}return s.length!==s.replace(/</g,"").replace(/>/g,"").length&&(s="<xmp style=display:inline;>"+s+"</xmp>"),'<span type="'+r+'" value="'+s+'" depth="'+n+'" style="color:'+i+'">'+s+"</span>"}getCursorPosition(e){let t,n=window.getSelection(),a=-1,r=0;if(n.focusNode&&(e=>{for(;null!==e;){if(e===this.refContent)return!0;e=e.parentNode}return!1})(n.focusNode))for(t=n.focusNode,a=n.focusOffset;t&&t!==this.refContent;)if(t.previousSibling)t=t.previousSibling,e&&"BR"===t.nodeName&&r++,a+=t.textContent.length;else if(t=t.parentNode,null===t)break;return a+r}setCursorPosition(e){if([!1,null,void 0].indexOf(e)>-1)return;const t=(e,n,a)=>{if(a||((a=document.createRange()).selectNode(e),a.setStart(e,0)),0===n.count)a.setEnd(e,n.count);else if(e&&n.count>0)if(e.nodeType===Node.TEXT_NODE)e.textContent.length<n.count?n.count-=e.textContent.length:(a.setEnd(e,n.count),n.count=0);else for(var r=0;r<e.childNodes.length&&(a=t(e.childNodes[r],n,a),0!==n.count);r++);return a};e>0?(e=>{if(e<0)return;let n=window.getSelection(),a=t(this.refContent,{count:e});a&&(a.collapse(!1),n.removeAllRanges(),n.addRange(a))})(e):this.refContent.focus()}update(e=0,t=!0){const n=this.refContent,a=this.tokenize(n);"onChange"in this.props&&this.props.onChange({plainText:a.indented,markupText:a.markup,json:a.json,jsObject:a.jsObject,lines:a.lines,error:a.error});let r=this.getCursorPosition(a.error)+e;this.setState({plainText:a.indented,markupText:a.markup,json:a.json,jsObject:a.jsObject,lines:a.lines,error:a.error}),this.updateTime=!1,t&&this.setCursorPosition(r)}scheduledUpdate(){if("onKeyPressUpdate"in this.props&&!1===this.props.onKeyPressUpdate)return;const{updateTime:e}=this;!1!==e&&(e>(new Date).getTime()||this.update())}setUpdateTime(){"onKeyPressUpdate"in this.props&&!1===this.props.onKeyPressUpdate||(this.updateTime=(new Date).getTime()+this.waitAfterKeyPress)}stopEvent(e){e&&(e.preventDefault(),e.stopPropagation())}onKeyPress(e){const t=e.ctrlKey||e.metaKey;this.props.viewOnly&&!t&&this.stopEvent(e),t||this.setUpdateTime()}onKeyDown(e){const t=!!this.props.viewOnly,n=e.ctrlKey||e.metaKey;switch(e.key){case"Tab":if(this.stopEvent(e),t)break;document.execCommand("insertText",!1," "),this.setUpdateTime();break;case"Backspace":case"Delete":t&&this.stopEvent(e),this.setUpdateTime();break;case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"ArrowDown":this.setUpdateTime();break;case"a":case"c":t&&!n&&this.stopEvent(e);break;default:t&&this.stopEvent(e)}}onPaste(e){if(this.props.viewOnly)this.stopEvent(e);else{e.preventDefault();var t=e.clipboardData.getData("text/plain");document.execCommand("insertText",!1,t)}this.update()}onClick(){!("viewOnly"in this.props)||this.props.viewOnly}onBlur(){if("viewOnly"in this.props&&this.props.viewOnly)return;const e=this.refContent,t=this.tokenize(e);"onBlur"in this.props&&this.props.onBlur({plainText:t.indented,markupText:t.markup,json:t.json,jsObject:t.jsObject,lines:t.lines,error:t.error})}onScroll(e){this.refLabels.scrollTop=e.target.scrollTop}componentDidUpdate(){this.updateInternalProps(),this.showPlaceholder()}componentDidMount(){this.showPlaceholder()}componentWillUnmount(){this.timer&&clearInterval(this.timer)}showPlaceholder(){if(!("placeholder"in this.props))return;const{placeholder:e}=this.props;if([void 0,null].indexOf(e)>-1)return;const{prevPlaceholder:t,jsObject:n}=this.state,{resetConfiguration:a}=this,r=Object(wd.getType)(e);-1===["object","array"].indexOf(r)&&Dd.throwError("showPlaceholder","placeholder","either an object or an array");let s=!Object(wd.identical)(e,t);if(s||a&&void 0!==n&&(s=!Object(wd.identical)(e,n)),!s)return;const i=this.tokenize(e);this.setState({prevPlaceholder:e,plainText:i.indentation,markupText:i.markup,lines:i.lines,error:i.error})}tokenize(e){if("object"!=typeof e)return console.error("tokenize() expects object type properties only. Got '"+typeof e+"' type instead.");const t=this.props.locale||Sd,n=this.newSpan;if("nodeType"in e){const L=e.cloneNode(!0);if(!L.hasChildNodes())return"";const b=L.childNodes;let v={tokens_unknown:[],tokens_proto:[],tokens_split:[],tokens_fallback:[],tokens_normalize:[],tokens_merge:[],tokens_plainText:"",indented:"",json:"",jsObject:void 0,markup:""};for(var a=0;a<b.length;a++){let e=b[a],t={};switch(e.nodeName){case"SPAN":t={string:e.textContent,type:e.attributes.type.textContent},v.tokens_unknown.push(t);break;case"DIV":v.tokens_unknown.push({string:e.textContent,type:"unknown"});break;case"BR":""===e.textContent&&v.tokens_unknown.push({string:"\n",type:"unknown"});break;case"#text":v.tokens_unknown.push({string:e.wholeText,type:"unknown"});break;case"FONT":v.tokens_unknown.push({string:e.textContent,type:"unknown"});break;default:console.error("Unrecognized node:",{child:e})}}function r(e,t=""){let n={active:!1,string:"",number:"",symbol:"",space:"",delimiter:"",quarks:[]};function a(e,a){switch(a){case"symbol":case"delimiter":n.active&&n.quarks.push({string:n[n.active],type:t+"-"+n.active}),n[n.active]="",n.active=a,n[n.active]=e;break;default:a!==n.active||[n.string,e].indexOf("\n")>-1?(n.active&&n.quarks.push({string:n[n.active],type:t+"-"+n.active}),n[n.active]="",n.active=a,n[n.active]=e):n[a]+=e}}for(var r=0;r<e.length;r++){const t=e.charAt(r);switch(t){case'"':case"'":a(t,"delimiter");break;case" ":case" ":a(t,"space");break;case"{":case"}":case"[":case"]":case":":case",":a(t,"symbol");break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":"string"===n.active?a(t,"string"):a(t,"number");break;case"-":if(r<e.length-1&&"0123456789".indexOf(e.charAt(r+1))>-1){a(t,"number");break}case".":if(r<e.length-1&&r>0&&"0123456789".indexOf(e.charAt(r+1))>-1&&"0123456789".indexOf(e.charAt(r-1))>-1){a(t,"number");break}default:a(t,"string")}}return n.active&&(n.quarks.push({string:n[n.active],type:t+"-"+n.active}),n[n.active]="",n.active=!1),n.quarks}for(a=0;a<v.tokens_unknown.length;a++){let e=v.tokens_unknown[a];v.tokens_proto=v.tokens_proto.concat(r(e.string,"proto"))}function s(e,t){let n="",a="",r=!1;switch(t){case"primitive":if(-1===["true","false","null","undefined"].indexOf(e))return!1;break;case"string":if(e.length<2)return!1;if(n=e.charAt(0),a=e.charAt(e.length-1),r="'\"".indexOf(n),-1===r)return!1;if(n!==a)return!1;for(var s=0;s<e.length;s++)if(s>0&&s<e.length-1&&e.charAt(s)==="'\""[r]&&"\\"!==e.charAt(s-1))return!1;break;case"key":if(0===e.length)return!1;if(n=e.charAt(0),a=e.charAt(e.length-1),r="'\"".indexOf(n),r>-1){if(1===e.length)return!1;if(n!==a)return!1;for(s=0;s<e.length;s++)if(s>0&&s<e.length-1&&e.charAt(s)==="'\""[r]&&"\\"!==e.charAt(s-1))return!1}else{const t="'\"`.,:;{}[]&<>=~*%\\|/-+!?@^  ";for(s=0;s<t.length;s++){const n=t.charAt(s);if(e.indexOf(n)>-1)return!1}}break;case"number":for(s=0;s<e.length;s++)if(-1==="0123456789".indexOf(e.charAt(s)))if(0===s){if("-"!==e.charAt(0))return!1}else if("."!==e.charAt(s))return!1;break;case"symbol":if(e.length>1)return!1;if(-1==="{[:]},".indexOf(e))return!1;break;case"colon":if(e.length>1)return!1;if(":"!==e)return!1;break;default:return!0}return!0}for(a=0;a<v.tokens_proto.length;a++){let e=v.tokens_proto[a];-1===e.type.indexOf("proto")?s(e.string,e.type)?v.tokens_split.push(e):v.tokens_split=v.tokens_split.concat(r(e.string,"split")):v.tokens_split.push(e)}for(a=0;a<v.tokens_split.length;a++){let e=v.tokens_split[a],t=e.type,n=e.string,r=n.length,s=[];t.indexOf("-")>-1&&(t=t.slice(t.indexOf("-")+1),"string"!==t&&s.push("string"),s.push("key"),s.push("error"));let i={string:n,length:r,type:t,fallback:s};v.tokens_fallback.push(i)}function i(){const e=v.tokens_normalize.length-1;if(e<1)return!1;for(var t=e;t>=0;t--){const e=v.tokens_normalize[t];switch(e.type){case"space":case"linebreak":break;default:return e}}return!1}let Y={brackets:[],stringOpen:!1,isValue:!1};for(a=0;a<v.tokens_fallback.length;a++){let e=v.tokens_fallback[a];const t=e.type,n=e.string;let r={type:t,string:n};switch(t){case"symbol":case"colon":if(Y.stringOpen){Y.isValue?r.type="string":r.type="key";break}switch(n){case"[":case"{":Y.brackets.push(n),Y.isValue="["===Y.brackets[Y.brackets.length-1];break;case"]":case"}":Y.brackets.pop(),Y.isValue="["===Y.brackets[Y.brackets.length-1];break;case",":if("colon"===i().type)break;Y.isValue="["===Y.brackets[Y.brackets.length-1];break;case":":r.type="colon",Y.isValue=!0}break;case"delimiter":if(Y.isValue?r.type="string":r.type="key",!Y.stringOpen){Y.stringOpen=n;break}if(a>0){const e=v.tokens_fallback[a-1],t=e.string,n=e.type,r=t.charAt(t.length-1);if("string"===n&&"\\"===r)break}if(Y.stringOpen===n){Y.stringOpen=!1;break}break;case"primitive":case"string":if(["false","true","null","undefined"].indexOf(n)>-1){const e=v.tokens_normalize.length-1;if(e>=0){if("string"!==v.tokens_normalize[e].type){r.type="primitive";break}r.type="string";break}r.type="primitive";break}if("\n"===n&&!Y.stringOpen){r.type="linebreak";break}Y.isValue?r.type="string":r.type="key";break;case"space":case"number":Y.stringOpen&&(Y.isValue?r.type="string":r.type="key")}v.tokens_normalize.push(r)}for(a=0;a<v.tokens_normalize.length;a++){const e=v.tokens_normalize[a];let t={string:e.string,type:e.type,tokens:[a]};if(-1===["symbol","colon"].indexOf(e.type)&&a+1<v.tokens_normalize.length){let n=0;for(var o=a+1;o<v.tokens_normalize.length;o++){const a=v.tokens_normalize[o];if(e.type!==a.type)break;t.string+=a.string,t.tokens.push(o),n++}a+=n}v.tokens_merge.push(t)}const w="'\"",k="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_$";var l=!1,u=v.tokens_merge.length>0?1:0;function d(e,t,n=0){l={token:e,line:u,reason:t},v.tokens_merge[e+n].type="error"}function c(e,t){if(void 0===e&&console.error("tokenID argument must be an integer."),void 0===t&&console.error("options argument must be an array."),e===v.tokens_merge.length-1)return!1;for(var n=e+1;n<v.tokens_merge.length;n++){const e=v.tokens_merge[n];switch(e.type){case"space":case"linebreak":break;case"symbol":case"colon":return t.indexOf(e.string)>-1&&n;default:return!1}}return!1}function m(e,t){if(void 0===e&&console.error("tokenID argument must be an integer."),void 0===t&&console.error("options argument must be an array."),0===e)return!1;for(var n=e-1;n>=0;n--){const e=v.tokens_merge[n];switch(e.type){case"space":case"linebreak":break;case"symbol":case"colon":return t.indexOf(e.string)>-1;default:return!1}}return!1}function _(e){if(void 0===e&&console.error("tokenID argument must be an integer."),0===e)return!1;for(var t=e-1;t>=0;t--){const e=v.tokens_merge[t];switch(e.type){case"space":case"linebreak":break;default:return e.type}}return!1}Y={brackets:[],stringOpen:!1,isValue:!1};let D=[];for(a=0;a<v.tokens_merge.length&&!l;a++){let e=v.tokens_merge[a],n=e.string,r=e.type,s=!1;switch(r){case"space":break;case"linebreak":u++;break;case"symbol":switch(n){case"{":case"[":if(s=m(a,["}","]"]),s){d(a,Td(t.invalidToken.tokenSequence.prohibited,{firstToken:v.tokens_merge[s].string,secondToken:n}));break}if("["===n&&a>0&&!m(a,[":","[",","])){d(a,Td(t.invalidToken.tokenSequence.permitted,{firstToken:"[",secondToken:[":","[",","]}));break}if("{"===n&&m(a,["{"])){d(a,Td(t.invalidToken.double,{token:"{"}));break}Y.brackets.push(n),Y.isValue="["===Y.brackets[Y.brackets.length-1],D.push({i:a,line:u,string:n});break;case"}":case"]":if("}"===n&&"{"!==Y.brackets[Y.brackets.length-1]){d(a,Td(t.brace.curly.missingOpen));break}if("}"===n&&m(a,[","])){d(a,Td(t.invalidToken.tokenSequence.prohibited,{firstToken:",",secondToken:"}"}));break}if("]"===n&&"["!==Y.brackets[Y.brackets.length-1]){d(a,Td(t.brace.square.missingOpen));break}if("]"===n&&m(a,[":"])){d(a,Td(t.invalidToken.tokenSequence.prohibited,{firstToken:":",secondToken:"]"}));break}Y.brackets.pop(),Y.isValue="["===Y.brackets[Y.brackets.length-1],D.push({i:a,line:u,string:n});break;case",":if(s=m(a,["{"]),s){if(c(a,["}"])){d(a,Td(t.brace.curly.cannotWrap,{token:","}));break}d(a,Td(t.invalidToken.tokenSequence.prohibited,{firstToken:"{",secondToken:","}));break}if(c(a,["}",",","]"])){d(a,Td(t.noTrailingOrLeadingComma));break}switch(s=_(a),s){case"key":case"colon":d(a,Td(t.invalidToken.termSequence.prohibited,{firstTerm:"key"===s?t.types.key:t.symbols.colon,secondTerm:t.symbols.comma}));break;case"symbol":if(m(a,["{"])){d(a,Td(t.invalidToken.tokenSequence.prohibited,{firstToken:"{",secondToken:","}));break}}Y.isValue="["===Y.brackets[Y.brackets.length-1]}v.json+=n;break;case"colon":if(s=m(a,["["]),s&&c(a,["]"])){d(a,Td(t.brace.square.cannotWrap,{token:":"}));break}if(s){d(a,Td(t.invalidToken.tokenSequence.prohibited,{firstToken:"[",secondToken:":"}));break}if("key"!==_(a)){d(a,Td(t.invalidToken.termSequence.permitted,{firstTerm:t.symbols.colon,secondTerm:t.types.key}));break}if(c(a,["}","]"])){d(a,Td(t.invalidToken.termSequence.permitted,{firstTerm:t.symbols.colon,secondTerm:t.types.value}));break}Y.isValue=!0,v.json+=n;break;case"key":case"string":let e=n.charAt(0),i=n.charAt(n.length-1);w.indexOf(e);if(-1===w.indexOf(e)&&-1!==w.indexOf(i)){d(a,Td(t.string.missingOpen,{quote:e}));break}if(-1===w.indexOf(i)&&-1!==w.indexOf(e)){d(a,Td(t.string.missingClose,{quote:e}));break}if(w.indexOf(e)>-1&&e!==i){d(a,Td(t.string.missingClose,{quote:e}));break}if("string"===r&&-1===w.indexOf(e)&&-1===w.indexOf(i)){d(a,Td(t.string.mustBeWrappedByQuotes));break}if("key"===r&&c(a,["}","]"])&&d(a,Td(t.invalidToken.termSequence.permitted,{firstTerm:t.types.key,secondTerm:t.symbols.colon})),-1===w.indexOf(e)&&-1===w.indexOf(i))for(var h=0;h<n.length&&!l;h++){const e=n.charAt(h);if(-1===k.indexOf(e)){d(a,Td(t.string.nonAlphanumeric,{token:e}));break}}if("'"===e?n='"'+n.slice(1,-1)+'"':'"'!==e&&(n='"'+n+'"'),"key"===r&&"key"===_(a)){if(a>0&&!isNaN(v.tokens_merge[a-1])){v.tokens_merge[a-1]+=v.tokens_merge[a],d(a,Td(t.key.numberAndLetterMissingQuotes));break}d(a,Td(t.key.spaceMissingQuotes));break}if("key"===r&&!m(a,["{",","])){d(a,Td(t.invalidToken.tokenSequence.permitted,{firstToken:r,secondToken:["{",","]}));break}if("string"===r&&!m(a,["[",":",","])){d(a,Td(t.invalidToken.tokenSequence.permitted,{firstToken:r,secondToken:["[",":",","]}));break}if("key"===r&&Y.isValue){d(a,Td(t.string.unexpectedKey));break}if("string"===r&&!Y.isValue){d(a,Td(t.key.unexpectedString));break}v.json+=n;break;case"number":case"primitive":if(m(a,["{"]))v.tokens_merge[a].type="key",r=v.tokens_merge[a].type,n='"'+n+'"';else if("key"===_(a))v.tokens_merge[a].type="key",r=v.tokens_merge[a].type;else if(!m(a,["[",":",","])){d(a,Td(t.invalidToken.tokenSequence.permitted,{firstToken:r,secondToken:["[",":",","]}));break}"key"!==r&&(Y.isValue||(v.tokens_merge[a].type="key",r=v.tokens_merge[a].type,n='"'+n+'"')),"primitive"===r&&"undefined"===n&&d(a,Td(t.invalidToken.useInstead,{badToken:"undefined",goodToken:"null"})),v.json+=n}}let T="";for(a=0;a<v.json.length;a++){let e=v.json.charAt(a),t="";a+1<v.json.length&&(t=v.json.charAt(a+1),"\\"===e&&"'"===t)?(T+=t,a++):T+=e}if(v.json=T,!l){const e=Math.ceil(D.length/2);let n=0,a=!1;function p(e){D.splice(e+1,1),D.splice(e,1),a||(a=!0)}for(;D.length>0;){a=!1;for(var f=0;f<D.length-1;f++){const e=D[f].string+D[f+1].string;["[]","{}"].indexOf(e)>-1&&p(f)}if(n++,!a)break;if(n>=e)break}if(D.length>0){const e=D[0].string,n=D[0].i,a="["===e?"]":"}";u=D[0].line,d(n,Td(t.brace["]"===a?"square":"curly"].missingClose))}}if(!l&&-1===[void 0,""].indexOf(v.json))try{v.jsObject=JSON.parse(v.json)}catch(e){const n=e.message,a=n.indexOf("position");if(-1===a)throw new Error("Error parsing failed");const r=n.substring(a+9,n.length),s=parseInt(r);let i=0,o=0,c=!1,m=1,_=!1;for(;i<s&&!_&&(c=v.tokens_merge[o],"linebreak"===c.type&&m++,-1===["space","linebreak"].indexOf(c.type)&&(i+=c.string.length),!(i>=s));)o++,v.tokens_merge[o+1]||(_=!0);u=m;let h=0;for(let e=0;e<c.string.length;e++){const n=c.string.charAt(e);"\\"===n?h=h>0?h+1:1:(h%2==0&&0!==h||-1==="'\"bfnrt".indexOf(n)&&d(o,Td(t.invalidToken.unexpected,{token:"\\"})),h=0)}l||d(o,Td(t.invalidToken.unexpected,{token:c.string}))}let S=1,j=0;function y(e=!1){return function(e=!1){return S++,j>0||e?"<br>":""}(e)+function(){for(var e=[],t=0;t<2*j;t++)e.push("&nbsp;");return e.join("")}()}if(!l)for(a=0;a<v.tokens_merge.length;a++){const e=v.tokens_merge[a],t=e.string;switch(e.type){case"space":case"linebreak":break;case"string":case"number":case"primitive":case"error":v.markup+=(m(a,[",","["])?y():"")+n(a,e,j);break;case"key":v.markup+=y()+n(a,e,j);break;case"colon":v.markup+=n(a,e,j)+"&nbsp;";break;case"symbol":switch(t){case"[":case"{":v.markup+=(m(a,[":"])?"":y())+n(a,e,j),j++;break;case"]":case"}":j--;const t=a===v.tokens_merge.length-1,r=a>0?["[","{"].indexOf(v.tokens_merge[a-1].string)>-1?"":y(t):"";v.markup+=r+n(a,e,j);break;case",":v.markup+=n(a,e,j)}}}if(l){let e=1;function M(e){let t=0;for(var n=0;n<e.length;n++)["\n","\r"].indexOf(e[n])>-1&&t++;return t}S=1;for(a=0;a<v.tokens_merge.length;a++){const t=v.tokens_merge[a],r=t.type,s=t.string;"linebreak"===r&&S++,v.markup+=n(a,t,j),e+=M(s)}S++,e++,S<e&&(S=e)}for(a=0;a<v.tokens_merge.length;a++){let e=v.tokens_merge[a];v.indented+=e.string,-1===["space","linebreak"].indexOf(e.type)&&(v.tokens_plainText+=e.string)}if(l){"modifyErrorText"in this.props&&((g=this.props.modifyErrorText)&&"[object Function]"==={}.toString.call(g)&&(l.reason=this.props.modifyErrorText(l.reason)))}return{tokens:v.tokens_merge,noSpaces:v.tokens_plainText,indented:v.indented,json:v.json,jsObject:v.jsObject,markup:v.markup,lines:S,error:l}}var g;if(!("nodeType"in e)){let t={inputText:JSON.stringify(e),position:0,currentChar:"",tokenPrimary:"",tokenSecondary:"",brackets:[],isValue:!1,stringOpen:!1,stringStart:0,tokens:[]};function L(){return"\\"===t.currentChar}function b(){if(-1==="'\"".indexOf(t.currentChar))return!1;if(!t.stringOpen)return Y(),t.stringStart=t.position,t.stringOpen=t.currentChar,!0;if(t.stringOpen===t.currentChar){Y();return w(t.inputText.substring(t.stringStart,t.position+1)),t.stringOpen=!1,!0}return!1}function v(){if(-1===":,{}[]".indexOf(t.currentChar))return!1;if(t.stringOpen)return!1;switch(Y(),w(t.currentChar),t.currentChar){case":":return t.isValue=!0,!0;case"{":case"[":t.brackets.push(t.currentChar);break;case"}":case"]":t.brackets.pop()}return":"!==t.currentChar&&(t.isValue="["===t.brackets[t.brackets.length-1]),!0}function Y(){return 0!==t.tokenSecondary.length&&(t.tokens.push(t.tokenSecondary),t.tokenSecondary="",!0)}function w(e){return 0!==e.length&&(t.tokens.push(e),!0)}for(a=0;a<t.inputText.length;a++){t.position=a,t.currentChar=t.inputText.charAt(t.position);const e=v(),n=b(),r=L();e||n||r||t.stringOpen||(t.tokenSecondary+=t.currentChar)}let r={brackets:[],isValue:!1,tokens:[]};r.tokens=t.tokens.map(e=>{let t="",n="",a="";switch(e){case",":t="symbol",n=e,a=e,r.isValue="["===r.brackets[r.brackets.length-1];break;case":":t="symbol",n=e,a=e,r.isValue=!0;break;case"{":case"[":t="symbol",n=e,a=e,r.brackets.push(e),r.isValue="["===r.brackets[r.brackets.length-1];break;case"}":case"]":t="symbol",n=e,a=e,r.brackets.pop(),r.isValue="["===r.brackets[r.brackets.length-1];break;case"undefined":t="primitive",n=e,a=void 0;break;case"null":t="primitive",n=e,a=null;break;case"false":t="primitive",n=e,a=!1;break;case"true":t="primitive",n=e,a=!0;break;default:const i=e.charAt(0);if("'\"".indexOf(i)>-1){if(t=r.isValue?"string":"key","key"===t&&(n=function(e){if(0===e.length)return e;if(['""',"''"].indexOf(e)>-1)return"''";let t=!1;for(var n=0;n<2;n++)if([e.charAt(0),e.charAt(e.length-1)].indexOf(['"',"'"][n])>-1){t=!0;break}t&&e.length>=2&&(e=e.slice(1,-1));const a=e.replace(/\w/g,""),r=(e.replace(/\W+/g,""),((e,t)=>{let n=!1;for(var a=0;a<t.length&&(0!==a||!isNaN(t.charAt(a)));a++)if(isNaN(t.charAt(a))){n=!0;break}return!(e.length>0||n)})(a,e));if((e=>{for(var t=0;t<e.length;t++)if(["'",'"'].indexOf(e.charAt(t))>-1)return!0;return!1})(a)){let t="";const n=e.split("");for(var s=0;s<n.length;s++){let e=n[s];["'",'"'].indexOf(e)>-1&&(e="\\"+e),t+=e}e=t}return r?e:"'"+e+"'"}(e)),"string"===t){n="";const t=e.slice(1,-1).split("");for(var s=0;s<t.length;s++){let e=t[s];"'\"".indexOf(e)>-1&&(e="\\"+e),n+=e}n="'"+n+"'"}a=n;break}if(!isNaN(e)){t="number",n=e,a=Number(e);break}if(e.length>0&&!r.isValue){t="key",n=e,n.indexOf(" ")>-1&&(n="'"+n+"'"),a=n;break}}return{type:t,string:n,value:a,depth:r.brackets.length}});let s="";for(a=0;a<r.tokens.length;a++){s+=r.tokens[a].string}function k(e){for(var t=[],n=0;n<2*e;n++)t.push(" ");return(e>0?"\n":"")+t.join("")}let i="";for(a=0;a<r.tokens.length;a++){let e=r.tokens[a];switch(e.string){case"[":case"{":const t=a<r.tokens.length-1-1?r.tokens[a+1]:"";-1==="}]".indexOf(t.string)?i+=e.string+k(e.depth):i+=e.string;break;case"]":case"}":const n=a>0?r.tokens[a-1]:"";-1==="[{".indexOf(n.string)?i+=k(e.depth)+e.string:i+=e.string;break;case":":i+=e.string+" ";break;case",":i+=e.string+k(e.depth);break;default:i+=e.string}}let o=1;function D(e){var t=[];e>0&&o++;for(var n=0;n<2*e;n++)t.push("&nbsp;");return(e>0?"<br>":"")+t.join("")}let l="";const u=r.tokens.length-1;for(a=0;a<r.tokens.length;a++){let e=r.tokens[a],t=n(a,e,e.depth);switch(e.string){case"{":case"[":const n=a<r.tokens.length-1-1?r.tokens[a+1]:"";-1==="}]".indexOf(n.string)?l+=t+D(e.depth):l+=t;break;case"}":case"]":const s=a>0?r.tokens[a-1]:"";-1==="[{".indexOf(s.string)?l+=D(e.depth)+(u===a?"<br>":"")+t:l+=t;break;case":":l+=t+" ";break;case",":l+=t+D(e.depth);break;default:l+=t}}return o+=2,{tokens:r.tokens,noSpaces:s,indented:i,json:JSON.stringify(e),jsObject:e,markup:l,lines:o}}}}var Od=jd,xd=n(269),Hd=n.n(xd);function Ed(e){return(Ed="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 Pd(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Cd(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function zd(e,t){return(zd=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Ad(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=Fd(e);if(t){var r=Fd(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return Wd(this,n)}}function Wd(e,t){if(t&&("object"===Ed(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Rd(e)}function Rd(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Fd(e){return(Fd=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Nd=wp.i18n.__,Id=wp.element.Component,Jd=wp.components,Bd=Jd.ExternalLink,Ud=Jd.PanelBody,Vd=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&zd(e,t)}(s,e);var t,n,a,r=Ad(s);function s(){var e;return Pd(this,s),(e=r.apply(this,arguments)).isValidJSON=e.isValidJSON.bind(Rd(e)),e}return t=s,(n=[{key:"isValidJSON",value:function(e){try{JSON.parse(e)}catch(e){return!1}return!0}},{key:"render",value:function(){var e,t=this,n=this.props.chart["visualizer-settings"];return e=0<=["gauge","tabular","timeline"].indexOf(this.props.chart["visualizer-chart-type"])?this.props.chart["visualizer-chart-type"]:"".concat(this.props.chart["visualizer-chart-type"],"chart"),wp.element.createElement(Ud,{title:Nd("Manual Configuration"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement("p",null,Nd("Configure the graph by providing configuration variables right from the Google Visualization API.")),wp.element.createElement("p",null,wp.element.createElement(Bd,{href:"https://developers.google.com/chart/interactive/docs/gallery/".concat(e,"#configuration-options")},Nd("Google Visualization API"))),wp.element.createElement(Od,{locale:Hd.a,theme:"light_mitsuketa_tribute",placeholder:Z(n.manual)?JSON.parse(n.manual):{},width:"100%",height:"250px",style:{errorMessage:{height:"100%",fontSize:"10px"},container:{border:"1px solid #ddd",boxShadow:"inset 0 1px 2px rgba(0,0,0,.07)"},labelColumn:{background:"#F5F5F5",width:"auto",padding:"5px 10px 5px 10px"}},onChange:function(e){!1===e.error&&(n.manual=e.json,t.props.edit(n))}}))}}])&&Cd(t.prototype,n),a&&Cd(t,a),s}(Id);function Gd(e){return(Gd="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 qd(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Kd(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function $d(e,t){return($d=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Zd(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=Xd(e);if(t){var r=Xd(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return Qd(this,n)}}function Qd(e,t){if(t&&("object"===Gd(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Xd(e){return(Xd=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var ec=wp.element,tc=ec.Component,nc=ec.Fragment,ac=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&$d(e,t)}(s,e);var t,n,a,r=Zd(s);function s(){return qd(this,s),r.apply(this,arguments)}return t=s,(n=[{key:"render",value:function(){var e=this.props.chart["visualizer-chart-type"],t=this.props.chart["visualizer-chart-library"];return wp.element.createElement(nc,null,wp.element.createElement(Aa,{chart:this.props.chart,attributes:this.props.attributes,edit:this.props.edit}),wp.element.createElement(Ya,{chart:this.props.chart,edit:this.props.edit}),-1>=["tabular","dataTable","gauge","geo","pie","timeline"].indexOf(e)&&wp.element.createElement(nr,{chart:this.props.chart,edit:this.props.edit}),-1>=["tabular","dataTable","gauge","geo","pie","timeline"].indexOf(e)&&wp.element.createElement(br,{chart:this.props.chart,edit:this.props.edit}),0<=["pie"].indexOf(e)&&wp.element.createElement(nc,null,wp.element.createElement(Fr,{chart:this.props.chart,edit:this.props.edit}),wp.element.createElement(ts,{chart:this.props.chart,edit:this.props.edit})),0<=["area","scatter","line"].indexOf(e)&&wp.element.createElement(ys,{chart:this.props.chart,edit:this.props.edit}),0<=["bar","column"].indexOf(e)&&wp.element.createElement(xs,{chart:this.props.chart,edit:this.props.edit}),0<=["candlestick"].indexOf(e)&&wp.element.createElement(Gs,{chart:this.props.chart,edit:this.props.edit}),0<=["geo"].indexOf(e)&&wp.element.createElement(nc,null,wp.element.createElement(li,{chart:this.props.chart,edit:this.props.edit}),wp.element.createElement(Yi,{chart:this.props.chart,edit:this.props.edit}),wp.element.createElement(Ri,{chart:this.props.chart,edit:this.props.edit}),wp.element.createElement(Xi,{chart:this.props.chart,edit:this.props.edit})),0<=["gauge"].indexOf(e)&&wp.element.createElement(Mo,{chart:this.props.chart,edit:this.props.edit}),0<=["timeline"].indexOf(e)&&wp.element.createElement(Po,{chart:this.props.chart,edit:this.props.edit}),0<=["tabular","dataTable"].indexOf(e)&&wp.element.createElement(nc,null,wp.element.createElement(Zo,{chart:this.props.chart,edit:this.props.edit}),wp.element.createElement(hl,{chart:this.props.chart,edit:this.props.edit})),0<=["combo"].indexOf(e)&&wp.element.createElement(Tl,{chart:this.props.chart,edit:this.props.edit}),-1>=["timeline","bubble","gauge","geo","pie","tabular","dataTable"].indexOf(e)&&wp.element.createElement(Vl,{chart:this.props.chart,edit:this.props.edit}),"tabular"===e&&"GoogleCharts"===t&&wp.element.createElement(Vl,{chart:this.props.chart,edit:this.props.edit}),0<=["bubble"].indexOf(e)&&wp.element.createElement(Yu,{chart:this.props.chart,edit:this.props.edit}),0<=["pie"].indexOf(e)&&wp.element.createElement(ou,{chart:this.props.chart,edit:this.props.edit}),"DataTable"===t&&wp.element.createElement(Ru,{chart:this.props.chart,edit:this.props.edit}),"DataTable"!==t&&wp.element.createElement(rd,{chart:this.props.chart,edit:this.props.edit}),wp.element.createElement(Ld,{chart:this.props.chart,edit:this.props.edit}),"DataTable"!==t&&wp.element.createElement(Vd,{chart:this.props.chart,edit:this.props.edit}))}}])&&Kd(t.prototype,n),a&&Kd(t,a),s}(tc);function rc(e){return(rc="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 sc(e,t,n,a,r,s,i){try{var o=e[s](i),l=o.value}catch(e){return void n(e)}o.done?t(l):Promise.resolve(l).then(a,r)}function ic(e){return function(){var t=this,n=arguments;return new Promise((function(a,r){var s=e.apply(t,n);function i(e){sc(s,a,r,i,o,"next",e)}function o(e){sc(s,a,r,i,o,"throw",e)}i(void 0)}))}}function oc(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function lc(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function uc(e,t){return(uc=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function dc(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=_c(e);if(t){var r=_c(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return cc(this,n)}}function cc(e,t){if(t&&("object"===rc(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return mc(e)}function mc(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _c(e){return(_c=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var hc=wp.i18n.__,pc=wp.apiFetch,fc=wp.element,yc=fc.Component,Mc=fc.Fragment,gc=wp.components,Lc=gc.Button,bc=gc.PanelBody,vc=gc.SelectControl,Yc=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&uc(e,t)}(o,e);var t,n,a,r,s,i=dc(o);function o(){var e;return oc(this,o),(e=i.apply(this,arguments)).getPermissionData=e.getPermissionData.bind(mc(e)),e.state={users:[],roles:[]},e}return t=o,(n=[{key:"componentDidMount",value:(s=ic(regeneratorRuntime.mark((function e(){var t,n,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("business"!==visualizerLocalize.isPro){e.next=14;break}if(void 0===(t=this.props.chart["visualizer-permissions"]).permissions){e.next=14;break}if(void 0===t.permissions.read||void 0===t.permissions.edit){e.next=14;break}if("users"!==t.permissions.read&&"users"!==t.permissions.edit){e.next=9;break}return e.next=7,pc({path:"/visualizer/v1/get-permission-data?type=users"});case 7:n=e.sent,this.setState({users:n});case 9:if("roles"!==t.permissions.read&&"roles"!==t.permissions.edit){e.next=14;break}return e.next=12,pc({path:"/visualizer/v1/get-permission-data?type=roles"});case 12:a=e.sent,this.setState({roles:a});case 14:case"end":return e.stop()}}),e,this)}))),function(){return s.apply(this,arguments)})},{key:"getPermissionData",value:(r=ic(regeneratorRuntime.mark((function e(t){var n,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("business"!==visualizerLocalize.isPro){e.next=11;break}if("users"!==t||0!==this.state.users.length){e.next=6;break}return e.next=4,pc({path:"/visualizer/v1/get-permission-data?type=".concat(t)});case 4:n=e.sent,this.setState({users:n});case 6:if("roles"!==t||0!==this.state.roles.length){e.next=11;break}return e.next=9,pc({path:"/visualizer/v1/get-permission-data?type=".concat(t)});case 9:a=e.sent,this.setState({roles:a});case 11:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-permissions"];return wp.element.createElement(Mc,null,"business"===visualizerLocalize.isPro?wp.element.createElement(bc,{title:hc("Who can see this chart?"),initialOpen:!1},wp.element.createElement(vc,{label:hc("Select who can view the chart on the front-end."),value:t.permissions.read,options:[{value:"all",label:"All Users"},{value:"users",label:"Select Users"},{value:"roles",label:"Select Roles"}],onChange:function(n){t.permissions.read=n,e.props.edit(t),"users"!==n&&"roles"!==n||e.getPermissionData(n)}}),("users"===t.permissions.read||"roles"===t.permissions.read)&&wp.element.createElement(vc,{multiple:!0,value:t.permissions["read-specific"],options:"users"===t.permissions.read&&this.state.users||"roles"===t.permissions.read&&this.state.roles,onChange:function(n){t.permissions["read-specific"]=n,e.props.edit(t)}})):wp.element.createElement(bc,{title:hc("Who can see this chart?"),icon:"lock",initialOpen:!1},wp.element.createElement("p",null,hc("Upgrade your license to at least the DEVELOPER version to activate this feature!")),wp.element.createElement(Lc,{isPrimary:!0,href:visualizerLocalize.proTeaser,target:"_blank"},hc("Buy Now"))),"business"===visualizerLocalize.isPro?wp.element.createElement(bc,{title:hc("Who can edit this chart?"),initialOpen:!1},wp.element.createElement(vc,{label:hc("Select who can edit the chart on the front-end."),value:t.permissions.edit,options:[{value:"all",label:"All Users"},{value:"users",label:"Select Users"},{value:"roles",label:"Select Roles"}],onChange:function(n){t.permissions.edit=n,e.props.edit(t),"users"!==n&&"roles"!==n||e.getPermissionData(n)}}),("users"===t.permissions.edit||"roles"===t.permissions.edit)&&wp.element.createElement(vc,{multiple:!0,value:t.permissions["edit-specific"],options:"users"===t.permissions.edit&&this.state.users||"roles"===t.permissions.edit&&this.state.roles,onChange:function(n){t.permissions["edit-specific"]=n,e.props.edit(t)}})):wp.element.createElement(bc,{title:hc("Who can edit this chart?"),icon:"lock",initialOpen:!1},wp.element.createElement("p",null,hc("Upgrade your license to at least the DEVELOPER version to activate this feature!")),wp.element.createElement(Lc,{isPrimary:!0,href:visualizerLocalize.proTeaser,target:"_blank"},hc("Buy Now"))))}}])&&lc(t.prototype,n),a&&lc(t,a),o}(yc),wc=n(270),kc=n.n(wc),Dc=wp.components,Tc=Dc.Button,Sc=Dc.Dashicon,jc=Dc.G,Oc=Dc.Path,xc=Dc.SVG;var Hc=function(e){var t=e.label,n=e.icon,a=e.className,r=e.isBack,s=e.onClick,i=kc()("components-panel__body","components-panel__body-button",a,{"visualizer-panel-back":r});return wp.element.createElement("div",{className:i},wp.element.createElement("h2",{className:"components-panel__body-title"},wp.element.createElement(Tc,{className:"components-panel__body-toggle",onClick:s},wp.element.createElement(xc,{className:"components-panel__arrow",width:"24px",height:"24px",viewBox:"-12 -12 48 48",xmlns:"http://www.w3.org/2000/svg"},wp.element.createElement(jc,null,wp.element.createElement(Oc,{fill:"none",d:"M0,0h24v24H0V0z"})),wp.element.createElement(jc,null,wp.element.createElement(Oc,{d:"M7.41,8.59L12,13.17l4.59-4.58L18,10l-6,6l-6-6L7.41,8.59z"}))),n&&wp.element.createElement(Sc,{icon:n,className:"components-panel__icon"}),t)))},Ec=n(4),Pc=n.n(Ec);function Cc(e){return(Cc="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 zc(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ac(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function Wc(e,t){return(Wc=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Rc(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=Nc(e);if(t){var r=Nc(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return Fc(this,n)}}function Fc(e,t){if(t&&("object"===Cc(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Nc(e){return(Nc=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Ic=lodash.startCase,Jc=wp.i18n.__,Bc=wp.element,Uc=Bc.Component,Vc=Bc.Fragment,Gc=(wp.blockEditor||wp.editor).InspectorControls,qc=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Wc(e,t)}(s,e);var t,n,a,r=Rc(s);function s(){var e;return zc(this,s),(e=r.apply(this,arguments)).state={route:"home"},e}return t=s,(n=[{key:"render",value:function(){var e,t,n=this,a="undefined"!=typeof google?google.visualization.Version:"current",r=G(JSON.parse(JSON.stringify(this.props.chart)));return 0<=["gauge","tabular","timeline"].indexOf(this.props.chart["visualizer-chart-type"])?"DataTable"===r["visualizer-chart-library"]?e=r["visualizer-chart-type"]:("tabular"===(e=this.props.chart["visualizer-chart-type"])&&(e="table"),e=Ic(e)):e="".concat(Ic(this.props.chart["visualizer-chart-type"]),"Chart"),r["visualizer-data-exploded"]&&(t=Jc("Annotations in this chart may not display here but they will display in the front end.")),wp.element.createElement(Vc,null,"home"===this.state.route&&wp.element.createElement(Gc,null,wp.element.createElement(Fe,{chart:this.props.chart,readUploadedFile:this.props.readUploadedFile}),wp.element.createElement(St,{id:this.props.id,chart:this.props.chart,editURL:this.props.editURL,isLoading:this.props.isLoading,uploadData:this.props.uploadData,editSchedule:this.props.editSchedule,editJSONSchedule:this.props.editJSONSchedule,editJSONURL:this.props.editJSONURL,editJSONHeaders:this.props.editJSONHeaders,editJSONRoot:this.props.editJSONRoot,editJSONPaging:this.props.editJSONPaging,JSONImportData:this.props.JSONImportData}),wp.element.createElement(qt,{getChartData:this.props.getChartData,isLoading:this.props.isLoading}),wp.element.createElement(jn,{chart:this.props.chart,editSchedule:this.props.editDatabaseSchedule,databaseImportData:this.props.databaseImportData}),wp.element.createElement(ia,{chart:this.props.chart,editChartData:this.props.editChartData}),wp.element.createElement(Hc,{label:Jc("Advanced Options"),className:"visualizer-advanced-options",icon:"admin-tools",onClick:function(){return n.setState({route:"showAdvanced"})}}),wp.element.createElement(Hc,{label:Jc("Chart Permissions"),icon:"admin-users",onClick:function(){return n.setState({route:"showPermissions"})}})),("showAdvanced"===this.state.route||"showPermissions"===this.state.route)&&wp.element.createElement(Gc,null,wp.element.createElement(Hc,{label:Jc("Chart Settings"),onClick:function(){return n.setState({route:"home"})},isBack:!0}),"showAdvanced"===this.state.route&&wp.element.createElement(ac,{chart:this.props.chart,attributes:this.props.attributes,edit:this.props.editSettings}),"showPermissions"===this.state.route&&wp.element.createElement(Yc,{chart:this.props.chart,edit:this.props.editPermissions})),wp.element.createElement("div",{className:"visualizer-settings__chart","data-chart-type":e},null!==this.props.chart&&"DataTable"===r["visualizer-chart-library"]?wp.element.createElement(I,{id:this.props.id,rows:r["visualizer-data"],columns:r["visualizer-series"],options:r["visualizer-settings"]}):(r["visualizer-data-exploded"],wp.element.createElement(S,{chartVersion:a,chartType:e,rows:r["visualizer-data"],columns:r["visualizer-series"],options:Z(this.props.chart["visualizer-settings"].manual)?Pc()(K(this.props.chart["visualizer-settings"]),JSON.parse(this.props.chart["visualizer-settings"].manual)):K(this.props.chart["visualizer-settings"]),height:"500px",formatters:X(r)})),wp.element.createElement("div",{className:"visualizer-settings__charts-footer"},wp.element.createElement("sub",null,t))))}}])&&Ac(t.prototype,n),a&&Ac(t,a),s}(Uc);function Kc(e){return(Kc="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){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Zc(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function Qc(e,t){return(Qc=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Xc(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=tm(e);if(t){var r=tm(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return em(this,n)}}function em(e,t){if(t&&("object"===Kc(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function tm(e){return(tm=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var nm=lodash.startCase,am=wp.i18n.__,rm=wp.element,sm=rm.Component,im=rm.Fragment,om=wp.components,lm=om.Button,um=om.Dashicon,dm=om.Toolbar,cm=om.Tooltip,mm=(wp.blockEditor||wp.editor).BlockControls,_m=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Qc(e,t)}(s,e);var t,n,a,r=Xc(s);function s(){return $c(this,s),r.apply(this,arguments)}return t=s,(n=[{key:"render",value:function(){var e,t,n="undefined"!=typeof google?google.visualization.Version:"current",a=G(JSON.parse(JSON.stringify(this.props.chart)));return 0<=["gauge","tabular","timeline"].indexOf(this.props.chart["visualizer-chart-type"])?"DataTable"===a["visualizer-chart-library"]?e=a["visualizer-chart-type"]:("tabular"===(e=this.props.chart["visualizer-chart-type"])&&(e="table"),e=nm(e)):e="".concat(nm(this.props.chart["visualizer-chart-type"]),"Chart"),a["visualizer-data-exploded"]&&(t=am("Annotations in this chart may not display here but they will display in the front end.")),this.props.chart["visualizer-series"]&&0<=["date","datetime","timeofday"].indexOf(this.props.chart["visualizer-series"][0].type)&&this.props.chart["visualizer-settings"]&&""==this.props.chart["visualizer-settings"].hAxis.format&&(this.props.chart["visualizer-settings"].hAxis.format="YYYY-MM-dd"),wp.element.createElement("div",{className:this.props.className},null!==this.props.chart&&wp.element.createElement(im,null,wp.element.createElement(mm,{key:"toolbar-controls"},wp.element.createElement(dm,{className:"components-toolbar"},wp.element.createElement(cm,{text:am("Edit Chart")},wp.element.createElement(lm,{className:"components-icon-button components-toolbar__control edit-pie-chart",onClick:this.props.editChart},wp.element.createElement(um,{icon:"edit"}))))),"DataTable"===a["visualizer-chart-library"]?wp.element.createElement(I,{id:this.props.id,rows:a["visualizer-data"],columns:a["visualizer-series"],options:a["visualizer-settings"]}):(a["visualizer-data-exploded"],wp.element.createElement(S,{chartVersion:n,chartType:e,rows:a["visualizer-data"],columns:a["visualizer-series"],options:Z(this.props.chart["visualizer-settings"].manual)?Pc()(K(this.props.chart["visualizer-settings"]),JSON.parse(this.props.chart["visualizer-settings"].manual)):K(this.props.chart["visualizer-settings"]),height:"500px",formatters:X(a)})),wp.element.createElement("div",{className:"visualizer-settings__charts-footer"},wp.element.createElement("sub",null,t))))}}])&&Zc(t.prototype,n),a&&Zc(t,a),s}(sm);function hm(e){return(hm="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 pm(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function fm(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?pm(Object(n),!0).forEach((function(t){ym(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pm(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ym(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Mm(e,t,n,a,r,s,i){try{var o=e[s](i),l=o.value}catch(e){return void n(e)}o.done?t(l):Promise.resolve(l).then(a,r)}function gm(e){return function(){var t=this,n=arguments;return new Promise((function(a,r){var s=e.apply(t,n);function i(e){Mm(s,a,r,i,o,"next",e)}function o(e){Mm(s,a,r,i,o,"throw",e)}i(void 0)}))}}function Lm(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function bm(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function vm(e,t){return(vm=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Ym(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=Dm(e);if(t){var r=Dm(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return wm(this,n)}}function wm(e,t){if(t&&("object"===hm(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return km(e)}function km(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Dm(e){return(Dm=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Tm=wp.i18n.__,Sm=wp,jm=Sm.apiFetch,Om=Sm.apiRequest,xm=wp.element,Hm=xm.Component,Em=xm.Fragment,Pm=wp.components,Cm=Pm.Button,zm=Pm.ButtonGroup,Am=Pm.Dashicon,Wm=Pm.Placeholder,Rm=Pm.Notice,Fm=Pm.Spinner,Nm=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&vm(e,t)}(l,e);var t,n,a,r,s,i,o=Ym(l);function l(){var e;return Lm(this,l),(e=o.apply(this,arguments)).getChart=e.getChart.bind(km(e)),e.editChart=e.editChart.bind(km(e)),e.editSettings=e.editSettings.bind(km(e)),e.editPermissions=e.editPermissions.bind(km(e)),e.readUploadedFile=e.readUploadedFile.bind(km(e)),e.editURL=e.editURL.bind(km(e)),e.editSchedule=e.editSchedule.bind(km(e)),e.editJSONSchedule=e.editJSONSchedule.bind(km(e)),e.editJSONURL=e.editJSONURL.bind(km(e)),e.editJSONHeaders=e.editJSONHeaders.bind(km(e)),e.editJSONRoot=e.editJSONRoot.bind(km(e)),e.editJSONPaging=e.editJSONPaging.bind(km(e)),e.JSONImportData=e.JSONImportData.bind(km(e)),e.editDatabaseSchedule=e.editDatabaseSchedule.bind(km(e)),e.databaseImportData=e.databaseImportData.bind(km(e)),e.uploadData=e.uploadData.bind(km(e)),e.getChartData=e.getChartData.bind(km(e)),e.editChartData=e.editChartData.bind(km(e)),e.updateChart=e.updateChart.bind(km(e)),e.state={route:e.props.attributes.route?e.props.attributes.route:"home",chart:null,isModified:!1,isLoading:!1,isScheduled:!1},e}return t=l,(n=[{key:"componentDidMount",value:(i=gm(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.props.attributes.id){e.next=5;break}return e.next=3,jm({path:"wp/v2/visualizer/".concat(this.props.attributes.id)}).catch((function(e){}));case 3:(t=e.sent)?this.setState({chart:t.chart_data}):this.setState({route:"error"});case 5:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"getChart",value:(s=gm(regeneratorRuntime.mark((function e(t){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.setState({isLoading:"getChart"});case 2:return e.next=4,jm({path:"wp/v2/visualizer/".concat(t)});case 4:n=e.sent,this.setState({route:"chartSelect",chart:n.chart_data,isLoading:!0,isModified:!0}),this.props.setAttributes({id:t,route:"chartSelect",lazy:-1});case 7:case"end":return e.stop()}}),e,this)}))),function(e){return s.apply(this,arguments)})},{key:"editChart",value:function(){this.setState({route:"chartSelect"}),this.props.setAttributes({route:"chartSelect"})}},{key:"editSettings",value:function(e){var t=fm({},this.state.chart);t["visualizer-settings"]=e,this.setState({chart:t,isModified:!0})}},{key:"editPermissions",value:function(e){var t=fm({},this.state.chart);t["visualizer-permissions"]=e,this.setState({chart:t,isModified:!0})}},{key:"readUploadedFile",value:function(e){var t=this,n=e.current.files[0],a=new FileReader;a.onload=function(){var e=function(e,t){t=t||",";for(var n=new RegExp("(\\"+t+"|\\r?\\n|\\r|^)(?:'([^']*(?:''[^']*)*)'|([^'\\"+t+"\\r\\n]*))","gi"),a=[[]],r=null;r=n.exec(e);){var s=r[1];s.length&&s!==t&&a.push([]);var i=void 0;i=r[2]?r[2].replace(new RegExp("''","g"),"'"):r[3],a[a.length-1].push(i)}return a}(a.result);t.editChartData(e,"Visualizer_Source_Csv")},a.readAsText(n)}},{key:"editURL",value:function(e){var t=fm({},this.state.chart);t["visualizer-chart-url"]=e,this.setState({chart:t})}},{key:"editSchedule",value:function(e){var t=fm({},this.state.chart);t["visualizer-chart-schedule"]=e,this.setState({chart:t,isModified:!0})}},{key:"editJSONSchedule",value:function(e){var t=fm({},this.state.chart);t["visualizer-json-schedule"]=e,this.setState({chart:t,isModified:!0})}},{key:"editJSONURL",value:function(e){var t=fm({},this.state.chart);t["visualizer-json-url"]=e,this.setState({chart:t})}},{key:"editJSONHeaders",value:function(e){var t=fm({},this.state.chart);delete e.username,delete e.password,t["visualizer-json-headers"]=e,this.setState({chart:t})}},{key:"editJSONRoot",value:function(e){var t=fm({},this.state.chart);t["visualizer-json-root"]=e,this.setState({chart:t})}},{key:"editJSONPaging",value:function(e){var t=fm({},this.state.chart);t["visualizer-json-paging"]=e,this.setState({chart:t})}},{key:"JSONImportData",value:function(e,t,n){var a=fm({},this.state.chart);a["visualizer-source"]=e,a["visualizer-default-data"]=0,a["visualizer-series"]=t,a["visualizer-data"]=n,this.setState({chart:a,isModified:!0})}},{key:"editDatabaseSchedule",value:function(e){var t=fm({},this.state.chart);t["visualizer-db-schedule"]=e,this.setState({chart:t,isModified:!0})}},{key:"databaseImportData",value:function(e,t,n,a){var r=fm({},this.state.chart);r["visualizer-source"]=t,r["visualizer-default-data"]=0,r["visualizer-series"]=n,r["visualizer-data"]=a,r["visualizer-db-query"]=e,this.setState({chart:r,isModified:!0})}},{key:"uploadData",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.setState({isLoading:"uploadData",isScheduled:t}),Om({path:"/visualizer/v1/upload-data?url=".concat(this.state.chart["visualizer-chart-url"]),method:"POST"}).then((function(t){if(2<=Object.keys(t).length){var n=fm({},e.state.chart);n["visualizer-source"]="Visualizer_Source_Csv_Remote",n["visualizer-default-data"]=0,n["visualizer-series"]=t.series,n["visualizer-data"]=t.data;var a=n["visualizer-series"],r=n["visualizer-settings"],s=a,i="series";return"pie"===n["visualizer-chart-type"]&&(s=n["visualizer-data"],i="slices"),s.map((function(e,t){if("pie"===n["visualizer-chart-type"]||0!==t){var a="pie"!==n["visualizer-chart-type"]?t-1:t;void 0===r[i][a]&&(r[i][a]={},r[i][a].temp=1)}})),r[i]=r[i].filter((function(e,t){return t<("pie"!==n["visualizer-chart-type"]?s.length-1:s.length)})),n["visualizer-settings"]=r,e.setState({chart:n,isModified:!0,isLoading:!1}),t}e.setState({isLoading:!1})}),(function(t){return e.setState({isLoading:!1}),t}))}},{key:"getChartData",value:(r=gm(regeneratorRuntime.mark((function e(t){var n,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.setState({isLoading:"getChartData"});case 2:return e.next=4,jm({path:"wp/v2/visualizer/".concat(t)});case 4:n=e.sent,(a=fm({},this.state.chart))["visualizer-source"]="Visualizer_Source_Csv",a["visualizer-default-data"]=0,a["visualizer-series"]=n.chart_data["visualizer-series"],a["visualizer-data"]=n.chart_data["visualizer-data"],this.setState({isLoading:!1,chart:a});case 11:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"editChartData",value:function(e,t){var n=fm({},this.state.chart),a=[],r=fm({},n["visualizer-settings"]),s=n["visualizer-chart-type"];e[0].map((function(t,n){a[n]={label:t,type:e[1][n]}})),e.splice(0,2);var i=a,o="series";switch(s){case"pie":i=e,o="slices",e.map((function(e,t){switch(a[1].type){case"number":e[1]=parseFloat(e[1])}}));break;case"tabular":e.map((function(e,t){a.map((function(t,n){switch(t.type){case"boolean":"string"==typeof e[n]&&(e[n]="true"===e[n])}}))}))}i.map((function(e,t){if("pie"===s||0!==t){var n="pie"!==s?t-1:t;Array.isArray(r[o])&&void 0===r[o][n]&&(r[o][n]={},r[o][n].temp=1)}})),Array.isArray(r[o])&&(r[o]=r[o].filter((function(e,t){return t<(-1>=["pie","tabular","dataTable"].indexOf(s)?i.length-1:i.length)}))),n["visualizer-source"]=t,n["visualizer-default-data"]=0,n["visualizer-data"]=e,n["visualizer-series"]=a,n["visualizer-settings"]=r,n["visualizer-chart-url"]="",this.setState({chart:n,isModified:!0,isScheduled:!1})}},{key:"updateChart",value:function(){var e=this;this.setState({isLoading:"updateChart"});var t=this.state.chart;!1===this.state.isScheduled&&(t["visualizer-chart-schedule"]="");var n="series";"pie"===t["visualizer-chart-type"]&&(n="slices"),-1>=["bubble","timeline"].indexOf(t["visualizer-chart-type"])&&Object.keys(t["visualizer-settings"][n]).map((function(e){void 0!==t["visualizer-settings"][n][e]&&void 0!==t["visualizer-settings"][n][e].temp&&delete t["visualizer-settings"][n][e].temp})),Om({path:"/visualizer/v1/update-chart?id=".concat(this.props.attributes.id),method:"POST",data:t}).then((function(t){return e.setState({isLoading:!1,isModified:!1}),t}),(function(e){return e}))}},{key:"render",value:function(){var e=this;return"error"===this.state.route?wp.element.createElement(Rm,{status:"error",isDismissible:!1},wp.element.createElement(Am,{icon:"chart-pie"}),Tm("This chart is not available; it might have been deleted. Please delete this block and resubmit your chart.")):"renderChart"===this.state.route&&null!==this.state.chart?wp.element.createElement(_m,{id:this.props.attributes.id,chart:this.state.chart,className:this.props.className,editChart:this.editChart}):wp.element.createElement("div",{className:"visualizer-settings"},wp.element.createElement("div",{className:"visualizer-settings__title"},wp.element.createElement(Am,{icon:"chart-pie"}),Tm("Visualizer")),"home"===this.state.route&&wp.element.createElement("div",{className:"visualizer-settings__content"},wp.element.createElement("div",{className:"visualizer-settings__content-description"},Tm("Make a new chart or display an existing one?")),wp.element.createElement("a",{href:visualizerLocalize.adminPage,target:"_blank",className:"visualizer-settings__content-option"},wp.element.createElement("span",{className:"visualizer-settings__content-option-title"},Tm("Create a new chart")),wp.element.createElement("div",{className:"visualizer-settings__content-option-icon"},wp.element.createElement(Am,{icon:"arrow-right-alt2"}))),wp.element.createElement("div",{className:"visualizer-settings__content-option",onClick:function(){e.setState({route:"showCharts"}),e.props.setAttributes({route:"showCharts"})}},wp.element.createElement("span",{className:"visualizer-settings__content-option-title"},Tm("Display an existing chart")),wp.element.createElement("div",{className:"visualizer-settings__content-option-icon"},wp.element.createElement(Am,{icon:"arrow-right-alt2"})))),("getChart"===this.state.isLoading||"chartSelect"===this.state.route&&null===this.state.chart||"renderChart"===this.state.route&&null===this.state.chart)&&wp.element.createElement(Wm,null,wp.element.createElement(Fm,null)),"showCharts"===this.state.route&&!1===this.state.isLoading&&wp.element.createElement(ke,{getChart:this.getChart}),"chartSelect"===this.state.route&&null!==this.state.chart&&wp.element.createElement(qc,{id:this.props.attributes.id,attributes:this.props.attributes,chart:this.state.chart,editSettings:this.editSettings,editPermissions:this.editPermissions,url:this.state.url,readUploadedFile:this.readUploadedFile,editURL:this.editURL,editSchedule:this.editSchedule,editJSONURL:this.editJSONURL,editJSONHeaders:this.editJSONHeaders,editJSONSchedule:this.editJSONSchedule,editJSONRoot:this.editJSONRoot,editJSONPaging:this.editJSONPaging,JSONImportData:this.JSONImportData,editDatabaseSchedule:this.editDatabaseSchedule,databaseImportData:this.databaseImportData,uploadData:this.uploadData,getChartData:this.getChartData,editChartData:this.editChartData,isLoading:this.state.isLoading}),wp.element.createElement("div",{className:"visualizer-settings__controls"},("showCharts"===this.state.route||"chartSelect"===this.state.route)&&wp.element.createElement(zm,null,wp.element.createElement(Cm,{isDefault:!0,isLarge:!0,onClick:function(){var t;"showCharts"===e.state.route?t="home":"chartSelect"===e.state.route&&(t="showCharts"),e.setState({route:t}),e.props.setAttributes({route:t})}},Tm("Back")),"chartSelect"===this.state.route&&wp.element.createElement(Em,null,!1===this.state.isModified?wp.element.createElement(Cm,{isDefault:!0,isLarge:!0,className:"visualizer-bttn-done",onClick:function(){e.setState({route:"renderChart",isModified:!0}),e.props.setAttributes({route:"renderChart"})}},Tm("Done")):wp.element.createElement(Cm,{isPrimary:!0,isLarge:!0,className:"visualizer-bttn-save",isBusy:"updateChart"===this.state.isLoading,disabled:"updateChart"===this.state.isLoading,onClick:this.updateChart},Tm("Save"))))))}}])&&bm(t.prototype,n),a&&bm(t,a),l}(Hm),Im=(n(290),wp.i18n.__),Jm=wp.blocks.registerBlockType;t.default=Jm("visualizer/chart",{title:Im("Visualizer Chart"),description:Im("A simple, easy to use and quite powerful tool to create, manage and embed interactive charts into your WordPress posts and pages."),category:"common",icon:"chart-pie",keywords:[Im("Visualizer"),Im("Chart"),Im("Google Charts")],attributes:{id:{type:"number"},lazy:{default:"-1",type:"string"},route:{type:"string"}},supports:{customClassName:!1},edit:Nm,save:function(){return null}})}]);
classes/Visualizer/Gutenberg/src/Components/Sidebar/FrontendActions.js CHANGED
@@ -9,6 +9,7 @@ const {
9
  } = wp.element;
10
 
11
  const {
 
12
  CheckboxControl,
13
  PanelBody
14
  } = wp.components;
@@ -34,6 +35,7 @@ class FrontendActions extends Component {
34
  const type = this.props.chart['visualizer-chart-type'];
35
 
36
  return (
 
37
  <PanelBody
38
  title={ __( 'Frontend Actions' ) }
39
  initialOpen={ false }
@@ -135,7 +137,25 @@ class FrontendActions extends Component {
135
 
136
  ) }
137
 
138
- </PanelBody>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
139
  );
140
  }
141
  }
9
  } = wp.element;
10
 
11
  const {
12
+ Button,
13
  CheckboxControl,
14
  PanelBody
15
  } = wp.components;
35
  const type = this.props.chart['visualizer-chart-type'];
36
 
37
  return (
38
+ ( '' !== visualizerLocalize.proFeaturesLocked ) ?
39
  <PanelBody
40
  title={ __( 'Frontend Actions' ) }
41
  initialOpen={ false }
137
 
138
  ) }
139
 
140
+ </PanelBody> :
141
+ <PanelBody
142
+ title={ __( 'Frontend Actions' ) }
143
+ initialOpen={ false }
144
+ icon="lock"
145
+ className="visualizer-advanced-panel"
146
+ >
147
+
148
+ <p>{ __( 'Enable this feature in PRO version!' ) }</p>
149
+
150
+ <Button
151
+ isPrimary
152
+ href={ visualizerLocalize.proTeaser }
153
+ target="_blank"
154
+ >
155
+ { __( 'Buy Now' ) }
156
+ </Button>
157
+
158
+ </PanelBody>
159
  );
160
  }
161
  }
classes/Visualizer/Module/Admin.php CHANGED
@@ -389,64 +389,66 @@ class Visualizer_Module_Admin extends Visualizer_Module {
389
  );
390
  }
391
 
 
 
392
  $types = array_merge(
393
  $additional,
394
  array(
395
  'tabular' => array(
396
  'name' => esc_html__( 'Table', 'visualizer' ),
397
  'enabled' => true,
398
- 'supports' => array( 'Google Charts', 'DataTable' ),
399
  ),
400
  'pie' => array(
401
  'name' => esc_html__( 'Pie/Donut', 'visualizer' ),
402
  'enabled' => true,
403
- 'supports' => array( 'Google Charts', 'ChartJS' ),
404
  ),
405
  'line' => array(
406
  'name' => esc_html__( 'Line', 'visualizer' ),
407
  'enabled' => true,
408
- 'supports' => array( 'Google Charts', 'ChartJS' ),
 
 
 
 
 
409
  ),
410
  'area' => array(
411
  'name' => esc_html__( 'Area', 'visualizer' ),
412
- 'enabled' => true,
413
  // in ChartJS, the fill option is used to make Line chart an area: https://www.chartjs.org/docs/latest/charts/area.html
414
  'supports' => array( 'Google Charts' ),
415
  ),
416
  'geo' => array(
417
  'name' => esc_html__( 'Geo', 'visualizer' ),
418
- 'enabled' => true,
419
  'supports' => array( 'Google Charts' ),
420
  ),
421
- 'bar' => array(
422
- 'name' => esc_html__( 'Bar', 'visualizer' ),
423
- 'enabled' => true,
424
- 'supports' => array( 'Google Charts', 'ChartJS' ),
425
- ),
426
  'column' => array(
427
  'name' => esc_html__( 'Column', 'visualizer' ),
428
- 'enabled' => true,
429
  'supports' => array( 'Google Charts', 'ChartJS' ),
430
  ),
431
  'bubble' => array(
432
  'name' => esc_html__( 'Bubble', 'visualizer' ),
433
- 'enabled' => true,
434
  // chartjs' bubble is ugly looking (and it won't work off the default bubble.csv) so it is being excluded for the time being.
435
  'supports' => array( 'Google Charts' ),
436
  ),
437
  'scatter' => array(
438
  'name' => esc_html__( 'Scatter', 'visualizer' ),
439
- 'enabled' => true,
440
  'supports' => array( 'Google Charts' ),
441
  ),
442
  'gauge' => array(
443
  'name' => esc_html__( 'Gauge', 'visualizer' ),
444
- 'enabled' => true,
445
  'supports' => array( 'Google Charts' ),
446
  ),
447
  'candlestick' => array(
448
  'name' => esc_html__( 'Candlestick', 'visualizer' ),
449
- 'enabled' => true,
450
  'supports' => array( 'Google Charts' ),
451
  ),
452
  // pro types
@@ -1046,4 +1048,15 @@ class Visualizer_Module_Admin extends Visualizer_Module {
1046
  return $plugin_meta;
1047
  }
1048
 
 
 
 
 
 
 
 
 
 
 
 
1049
  }
389
  );
390
  }
391
 
392
+ $enabled = self::proFeaturesLocked();
393
+
394
  $types = array_merge(
395
  $additional,
396
  array(
397
  'tabular' => array(
398
  'name' => esc_html__( 'Table', 'visualizer' ),
399
  'enabled' => true,
400
+ 'supports' => $enabled ? array( 'Google Charts', 'DataTable' ) : array( 'DataTable' ),
401
  ),
402
  'pie' => array(
403
  'name' => esc_html__( 'Pie/Donut', 'visualizer' ),
404
  'enabled' => true,
405
+ 'supports' => $enabled ? array( 'Google Charts', 'ChartJS' ) : array( 'Google Charts' ),
406
  ),
407
  'line' => array(
408
  'name' => esc_html__( 'Line', 'visualizer' ),
409
  'enabled' => true,
410
+ 'supports' => $enabled ? array( 'Google Charts', 'ChartJS' ) : array( 'Google Charts' ),
411
+ ),
412
+ 'bar' => array(
413
+ 'name' => esc_html__( 'Bar', 'visualizer' ),
414
+ 'enabled' => true,
415
+ 'supports' => $enabled ? array( 'Google Charts', 'ChartJS' ) : array( 'Google Charts' ),
416
  ),
417
  'area' => array(
418
  'name' => esc_html__( 'Area', 'visualizer' ),
419
+ 'enabled' => $enabled,
420
  // in ChartJS, the fill option is used to make Line chart an area: https://www.chartjs.org/docs/latest/charts/area.html
421
  'supports' => array( 'Google Charts' ),
422
  ),
423
  'geo' => array(
424
  'name' => esc_html__( 'Geo', 'visualizer' ),
425
+ 'enabled' => $enabled,
426
  'supports' => array( 'Google Charts' ),
427
  ),
 
 
 
 
 
428
  'column' => array(
429
  'name' => esc_html__( 'Column', 'visualizer' ),
430
+ 'enabled' => $enabled,
431
  'supports' => array( 'Google Charts', 'ChartJS' ),
432
  ),
433
  'bubble' => array(
434
  'name' => esc_html__( 'Bubble', 'visualizer' ),
435
+ 'enabled' => $enabled,
436
  // chartjs' bubble is ugly looking (and it won't work off the default bubble.csv) so it is being excluded for the time being.
437
  'supports' => array( 'Google Charts' ),
438
  ),
439
  'scatter' => array(
440
  'name' => esc_html__( 'Scatter', 'visualizer' ),
441
+ 'enabled' => $enabled,
442
  'supports' => array( 'Google Charts' ),
443
  ),
444
  'gauge' => array(
445
  'name' => esc_html__( 'Gauge', 'visualizer' ),
446
+ 'enabled' => $enabled,
447
  'supports' => array( 'Google Charts' ),
448
  ),
449
  'candlestick' => array(
450
  'name' => esc_html__( 'Candlestick', 'visualizer' ),
451
+ 'enabled' => $enabled,
452
  'supports' => array( 'Google Charts' ),
453
  ),
454
  // pro types
1048
  return $plugin_meta;
1049
  }
1050
 
1051
+ /**
1052
+ * If check is existing user.
1053
+ *
1054
+ * @return bool Default false
1055
+ */
1056
+ public static function proFeaturesLocked() {
1057
+ if ( Visualizer_Module::is_pro() ) {
1058
+ return true;
1059
+ }
1060
+ return 'yes' === get_option( 'visualizer-new-user', 'yes' ) ? false : true;
1061
+ }
1062
  }
classes/Visualizer/Module/Chart.php CHANGED
@@ -633,7 +633,7 @@ class Visualizer_Module_Chart extends Visualizer_Module {
633
  // data tables assets.
634
  wp_register_script( 'visualizer-datatables', VISUALIZER_ABSURL . 'js/lib/datatables.min.js', array( 'jquery-ui-core' ), Visualizer_Plugin::VERSION );
635
  wp_register_style( 'visualizer-datatables', VISUALIZER_ABSURL . 'css/lib/datatables.min.css', array(), Visualizer_Plugin::VERSION );
636
- wp_register_style( 'visualizer-jquery-ui', sprintf( '//ajax.googleapis.com/ajax/libs/jqueryui/%s/themes/smoothness/jquery-ui.css', $wp_scripts->registered['jquery-ui-core']->ver ), array( 'visualizer-datatables' ), Visualizer_Plugin::VERSION );
637
  wp_enqueue_script( 'visualizer-datatables' );
638
  wp_enqueue_style( 'visualizer-jquery-ui' );
639
 
633
  // data tables assets.
634
  wp_register_script( 'visualizer-datatables', VISUALIZER_ABSURL . 'js/lib/datatables.min.js', array( 'jquery-ui-core' ), Visualizer_Plugin::VERSION );
635
  wp_register_style( 'visualizer-datatables', VISUALIZER_ABSURL . 'css/lib/datatables.min.css', array(), Visualizer_Plugin::VERSION );
636
+ wp_register_style( 'visualizer-jquery-ui', sprintf( '//code.jquery.com/ui/%s/themes/smoothness/jquery-ui.css', $wp_scripts->registered['jquery-ui-core']->ver ), array( 'visualizer-datatables' ), Visualizer_Plugin::VERSION );
637
  wp_enqueue_script( 'visualizer-datatables' );
638
  wp_enqueue_style( 'visualizer-jquery-ui' );
639
 
classes/Visualizer/Module/Frontend.php CHANGED
@@ -436,6 +436,7 @@ class Visualizer_Module_Frontend extends Visualizer_Module {
436
 
437
  $_charts = array();
438
  $_charts_type = '';
 
439
  foreach ( $this->_charts as $id => $array ) {
440
  $_charts = $this->_charts;
441
  $library = $array['library'];
@@ -450,24 +451,26 @@ class Visualizer_Module_Frontend extends Visualizer_Module {
450
  );
451
  wp_enqueue_script( "visualizer-render-$library" );
452
  }
453
- }
454
- if ( wp_script_is( "visualizer-render-$_charts_type" ) ) {
455
- wp_localize_script(
456
- "visualizer-render-$_charts_type",
457
- 'visualizer',
458
- array(
459
- 'charts' => $_charts,
460
- 'language' => $this->get_language(),
461
- 'map_api_key' => get_option( 'visualizer-map-api-key' ),
462
- 'rest_url' => version_compare( $wp_version, '4.7.0', '>=' ) ? rest_url( 'visualizer/v' . VISUALIZER_REST_VERSION . '/action/#id#/#type#/' ) : '',
463
- 'wp_nonce' => wp_create_nonce( 'wp_rest' ),
464
- 'i10n' => array(
465
- 'copied' => __( 'The data has been copied to your clipboard. Hit Ctrl-V/Cmd-V in your spreadsheet editor to paste the data.', 'visualizer' ),
466
- ),
467
- 'page_type' => 'frontend',
468
- 'is_front' => true,
469
- )
470
- );
 
 
471
  }
472
 
473
  // return placeholder div
@@ -669,9 +672,13 @@ class Visualizer_Module_Frontend extends Visualizer_Module {
669
 
670
  function visualizerLoadScripts() {
671
  document.querySelectorAll("script[data-visualizer-script]").forEach(function(elem) {
672
- jQuery.getScript( elem.getAttribute("data-visualizer-script"), function() {
 
673
  elem.setAttribute("src", elem.getAttribute("data-visualizer-script"));
674
  elem.removeAttribute("data-visualizer-script");
 
 
 
675
  } );
676
  });
677
  }
436
 
437
  $_charts = array();
438
  $_charts_type = '';
439
+ $count = 0;
440
  foreach ( $this->_charts as $id => $array ) {
441
  $_charts = $this->_charts;
442
  $library = $array['library'];
451
  );
452
  wp_enqueue_script( "visualizer-render-$library" );
453
  }
454
+
455
+ if ( wp_script_is( "visualizer-render-$_charts_type" ) && 0 === $count ) {
456
+ wp_localize_script(
457
+ "visualizer-render-$_charts_type",
458
+ 'visualizer',
459
+ array(
460
+ 'charts' => $this->_charts,
461
+ 'language' => $this->get_language(),
462
+ 'map_api_key' => get_option( 'visualizer-map-api-key' ),
463
+ 'rest_url' => version_compare( $wp_version, '4.7.0', '>=' ) ? rest_url( 'visualizer/v' . VISUALIZER_REST_VERSION . '/action/#id#/#type#/' ) : '',
464
+ 'wp_nonce' => wp_create_nonce( 'wp_rest' ),
465
+ 'i10n' => array(
466
+ 'copied' => __( 'The data has been copied to your clipboard. Hit Ctrl-V/Cmd-V in your spreadsheet editor to paste the data.', 'visualizer' ),
467
+ ),
468
+ 'page_type' => 'frontend',
469
+ 'is_front' => true,
470
+ )
471
+ );
472
+ }
473
+ $count++;
474
  }
475
 
476
  // return placeholder div
672
 
673
  function visualizerLoadScripts() {
674
  document.querySelectorAll("script[data-visualizer-script]").forEach(function(elem) {
675
+ jQuery.getScript( elem.getAttribute("data-visualizer-script") )
676
+ .done( function( script, textStatus ) {
677
  elem.setAttribute("src", elem.getAttribute("data-visualizer-script"));
678
  elem.removeAttribute("data-visualizer-script");
679
+ setTimeout( function() {
680
+ jQuery( '.visualizer-front:not(.visualizer-chart-loaded)' ).resize();
681
+ } );
682
  } );
683
  });
684
  }
classes/Visualizer/Module/Setup.php CHANGED
@@ -53,6 +53,8 @@ class Visualizer_Module_Setup extends Visualizer_Module {
53
  $this->_addFilter( 'visualizer_logger_data', 'getLoggerData' );
54
  $this->_addFilter( 'visualizer_get_chart_counts', 'getUsage', 10, 2 );
55
 
 
 
56
  // only for testing
57
  // $this->_addAction( 'admin_init', 'getUsage' );
58
  }
@@ -405,4 +407,20 @@ class Visualizer_Module_Setup extends Visualizer_Module {
405
  update_option( Visualizer_Plugin::CF_DB_SCHEDULE, $new_schedules );
406
  }
407
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
408
  }
53
  $this->_addFilter( 'visualizer_logger_data', 'getLoggerData' );
54
  $this->_addFilter( 'visualizer_get_chart_counts', 'getUsage', 10, 2 );
55
 
56
+ $this->_addAction( 'init', 'checkIsExistingUser' );
57
+
58
  // only for testing
59
  // $this->_addAction( 'admin_init', 'getUsage' );
60
  }
407
  update_option( Visualizer_Plugin::CF_DB_SCHEDULE, $new_schedules );
408
  }
409
 
410
+ /**
411
+ * Save flag for existing users.
412
+ */
413
+ public function checkIsExistingUser() {
414
+ $chart_exists = get_option( 'visualizer-new-user', '' );
415
+ if ( '' === $chart_exists ) {
416
+ $charts = get_posts(
417
+ array(
418
+ 'post_type' => Visualizer_Plugin::CPT_VISUALIZER,
419
+ 'fields' => 'ids',
420
+ )
421
+ );
422
+ update_option( 'visualizer-new-user', ! empty( $charts ) ? 'no' : 'yes' );
423
+ }
424
+ }
425
+
426
  }
classes/Visualizer/Plugin.php CHANGED
@@ -28,7 +28,7 @@
28
  class Visualizer_Plugin {
29
 
30
  const NAME = 'visualizer';
31
- const VERSION = '3.7.2';
32
 
33
  // custom post types
34
  const CPT_VISUALIZER = 'visualizer';
28
  class Visualizer_Plugin {
29
 
30
  const NAME = 'visualizer';
31
+ const VERSION = '3.7.3';
32
 
33
  // custom post types
34
  const CPT_VISUALIZER = 'visualizer';
classes/Visualizer/Render/Layout.php CHANGED
@@ -960,7 +960,7 @@ class Visualizer_Render_Layout extends Visualizer_Render {
960
  </li>
961
 
962
  <!-- manual -->
963
- <li class="viz-group visualizer_source_manual">
964
  <h2 class="viz-group-title viz-sub-group visualizer-editor-tab" data-current="chart"><?php _e( 'Manual Data', 'visualizer' ); ?>
965
  <span class="dashicons dashicons-lock"></span>
966
  </h2>
@@ -1002,6 +1002,11 @@ class Visualizer_Render_Layout extends Visualizer_Render {
1002
  >
1003
  <p class="viz-group-description viz-info-msg"><?php echo sprintf( __( 'Please make sure you click \'Show Chart\' before you save the chart.', 'visualizer' ) ); ?></p>
1004
  <?php } ?>
 
 
 
 
 
1005
  </form>
1006
  </div>
1007
  </li>
960
  </li>
961
 
962
  <!-- manual -->
963
+ <li class="viz-group visualizer_source_manual <?php echo ! Visualizer_Module_Admin::proFeaturesLocked() ? apply_filters( 'visualizer_pro_upsell_class', 'only-pro-feature', 'db-query' ) : ''; ?>">
964
  <h2 class="viz-group-title viz-sub-group visualizer-editor-tab" data-current="chart"><?php _e( 'Manual Data', 'visualizer' ); ?>
965
  <span class="dashicons dashicons-lock"></span>
966
  </h2>
1002
  >
1003
  <p class="viz-group-description viz-info-msg"><?php echo sprintf( __( 'Please make sure you click \'Show Chart\' before you save the chart.', 'visualizer' ) ); ?></p>
1004
  <?php } ?>
1005
+ <?php
1006
+ if ( ! Visualizer_Module_Admin::proFeaturesLocked() ) {
1007
+ echo apply_filters( 'visualizer_pro_upsell', '', 'db-query' );
1008
+ }
1009
+ ?>
1010
  </form>
1011
  </div>
1012
  </li>
classes/Visualizer/Render/Library.php CHANGED
@@ -359,7 +359,15 @@ class Visualizer_Render_Library extends Visualizer_Render {
359
  echo '<li>' . __( 'Frontend editor', 'visualizer' ) . '</li>';
360
  echo '<li>' . __( 'Private charts', 'visualizer' ) . '</li>';
361
  echo '<li>' . __( 'Auto-sync with online files', 'visualizer' ) . '</li>';
362
- echo '<li>' . __( '6 more chart types', 'visualizer' ) . '</li></ul>';
 
 
 
 
 
 
 
 
363
  echo '<p><a href="' . Visualizer_Plugin::PRO_TEASER_URL . '" target="_blank" class="button button-primary">' . __( 'View more features', 'visualizer' ) . '</a></p>';
364
  echo '<p style="background-color: #0073aac7; color: #ffffff; padding: 2px; font-weight: bold;">' . __( 'We offer a 30-day no-questions-asked money back guarantee!', 'visualizer' ) . '</p>';
365
  echo '<p><a href="' . VISUALIZER_SURVEY . '" target="_blank" class="">' . __( 'Don\'t see the features you need? Help us improve!', 'visualizer' ) . '</a></p>';
359
  echo '<li>' . __( 'Frontend editor', 'visualizer' ) . '</li>';
360
  echo '<li>' . __( 'Private charts', 'visualizer' ) . '</li>';
361
  echo '<li>' . __( 'Auto-sync with online files', 'visualizer' ) . '</li>';
362
+ if ( Visualizer_Module_Admin::proFeaturesLocked() ) {
363
+ echo '<li>' . __( '6 more chart types', 'visualizer' ) . '</ul>';
364
+ } else {
365
+ echo '<li>' . __( '11 more chart types', 'visualizer' ) . '</li>';
366
+ echo '<li>' . __( 'Manual Data Editor', 'visualizer' ) . '</li>';
367
+ echo '<li>' . __( 'ChartJS Charts', 'visualizer' ) . '</li>';
368
+ echo '<li>' . __( 'Table Google chart', 'visualizer' ) . '</li>';
369
+ echo '<li>' . __( 'Frontend Actions(Print Chart, Export to CSV, Export to Excel, Copy, Download Chart Image)', 'visualizer' ) . '</li></ul>';
370
+ }
371
  echo '<p><a href="' . Visualizer_Plugin::PRO_TEASER_URL . '" target="_blank" class="button button-primary">' . __( 'View more features', 'visualizer' ) . '</a></p>';
372
  echo '<p style="background-color: #0073aac7; color: #ffffff; padding: 2px; font-weight: bold;">' . __( 'We offer a 30-day no-questions-asked money back guarantee!', 'visualizer' ) . '</p>';
373
  echo '<p><a href="' . VISUALIZER_SURVEY . '" target="_blank" class="">' . __( 'Don\'t see the features you need? Help us improve!', 'visualizer' ) . '</a></p>';
classes/Visualizer/Render/Page/Types.php CHANGED
@@ -120,7 +120,7 @@ class Visualizer_Render_Page_Types extends Visualizer_Render_Page {
120
 
121
  if ( ! empty( $libraries ) ) {
122
  ?>
123
- <select name="chart-library" class="viz-select-library" data-type-vs-library="<?php echo esc_attr( json_encode( $type_vs_library ) ); ?>">
124
  <option value=""><?php esc_html_e( 'Use Library', 'visualizer' ); ?></option>
125
  <?php
126
  foreach ( $libraries as $library ) {
120
 
121
  if ( ! empty( $libraries ) ) {
122
  ?>
123
+ <select name="chart-library" class="viz-select-library<?php echo ! Visualizer_Module_Admin::proFeaturesLocked() && ! defined( 'TI_CYPRESS_TESTING' ) ? ' viz-hide-libary' : ''; ?>" data-type-vs-library="<?php echo esc_attr( json_encode( $type_vs_library ) ); ?>">
124
  <option value=""><?php esc_html_e( 'Use Library', 'visualizer' ); ?></option>
125
  <?php
126
  foreach ( $libraries as $library ) {
classes/Visualizer/Render/Sidebar.php CHANGED
@@ -151,12 +151,21 @@ abstract class Visualizer_Render_Sidebar extends Visualizer_Render {
151
  * @access protected
152
  */
153
  protected function _renderAdvancedSettings() {
154
- self::_renderGroupStart( esc_html__( 'Frontend Actions', 'visualizer' ) );
 
 
 
 
 
155
  self::_renderSectionStart();
156
  self::_renderSectionDescription( esc_html__( 'Configure frontend actions that need to be shown.', 'visualizer' ) );
157
  self::_renderSectionEnd();
158
 
159
  $this->_renderActionSettings();
 
 
 
 
160
  self::_renderGroupEnd();
161
 
162
  self::_renderGroupStart( esc_html__( 'Manual Configuration', 'visualizer' ) );
151
  * @access protected
152
  */
153
  protected function _renderAdvancedSettings() {
154
+ if ( Visualizer_Module_Admin::proFeaturesLocked() ) {
155
+ self::_renderGroupStart( esc_html__( 'Frontend Actions', 'visualizer' ) );
156
+ } else {
157
+ self::_renderGroupStart( esc_html__( 'Frontend Actions', 'visualizer' ) . '<span class="dashicons dashicons-lock"></span>', '', apply_filters( 'visualizer_pro_upsell_class', 'only-pro-feature', 'chart-frontend-actions' ), 'vz-frontend-actions' );
158
+ echo '<div style="position: relative">';
159
+ }
160
  self::_renderSectionStart();
161
  self::_renderSectionDescription( esc_html__( 'Configure frontend actions that need to be shown.', 'visualizer' ) );
162
  self::_renderSectionEnd();
163
 
164
  $this->_renderActionSettings();
165
+ if ( ! Visualizer_Module_Admin::proFeaturesLocked() ) {
166
+ echo apply_filters( 'visualizer_pro_upsell', '', 'chart-permissions' );
167
+ echo '</div>';
168
+ }
169
  self::_renderGroupEnd();
170
 
171
  self::_renderGroupStart( esc_html__( 'Manual Configuration', 'visualizer' ) );
css/frame.css CHANGED
@@ -806,6 +806,9 @@ button#editor-chart-button {
806
  .viz-select-library {
807
  color: #0085ba;
808
  }
 
 
 
809
 
810
  .viz-select-library option:first-child {
811
  font-weight: bold;
@@ -1521,3 +1524,10 @@ button#viz-text-editor-button {
1521
  canvas.chartjs-render-monitor {
1522
  height: 500px !important;
1523
  }
 
 
 
 
 
 
 
806
  .viz-select-library {
807
  color: #0085ba;
808
  }
809
+ .viz-select-library.viz-hide-libary {
810
+ display: none;
811
+ }
812
 
813
  .viz-select-library option:first-child {
814
  font-weight: bold;
1524
  canvas.chartjs-render-monitor {
1525
  height: 500px !important;
1526
  }
1527
+
1528
+ /******************************************************************************/
1529
+ /******************************** Frontend Actions ***********************************/
1530
+ /******************************************************************************/
1531
+ #vz-frontend-actions .only-pro-inner {
1532
+ text-align: center;
1533
+ }
css/media.css CHANGED
@@ -1,5 +1,5 @@
1
  /*
2
- Version: 3.7.2
3
  */
4
  #visualizer-library-view {
5
  padding: 30px 10px 10px 30px;
1
  /*
2
+ Version: 3.7.3
3
  */
4
  #visualizer-library-view {
5
  padding: 30px 10px 10px 30px;
index.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Visualizer: Tables and Charts for WordPress
4
  Plugin URI: https://themeisle.com/plugins/visualizer-charts-and-graphs-lite/
5
  Description: A simple, easy to use and quite powerful tool to create, manage and embed interactive charts into your WordPress posts and pages. The plugin uses Google Visualization API to render charts, which supports cross-browser compatibility (adopting VML for older IE versions) and cross-platform portability to iOS and new Android releases.
6
- Version: 3.7.2
7
  Author: Themeisle
8
  Author URI: http://themeisle.com
9
  Requires at least: 3.5
3
  Plugin Name: Visualizer: Tables and Charts for WordPress
4
  Plugin URI: https://themeisle.com/plugins/visualizer-charts-and-graphs-lite/
5
  Description: A simple, easy to use and quite powerful tool to create, manage and embed interactive charts into your WordPress posts and pages. The plugin uses Google Visualization API to render charts, which supports cross-browser compatibility (adopting VML for older IE versions) and cross-platform portability to iOS and new Android releases.
6
+ Version: 3.7.3
7
  Author: Themeisle
8
  Author URI: http://themeisle.com
9
  Requires at least: 3.5
readme.md CHANGED
@@ -16,8 +16,8 @@ A simple and powerful WordPress chart plugin to create responsive charts & table
16
 
17
  The plugin uses Google Visualization API, DataTables.net and ChartJS to add responsive & animated charts, graphs and tables, which support cross-browser compatibility and display perfectly on mobile devices. You can greatly customize all aspects of the charts and tables, and import the data from Excel, CSV, Google Sheets and more!
18
 
19
- ### 9 Chart types + 6 more in the pro version ###
20
- This WordPress graph plugin provides a variety of charts that are optimized to address your WordPress data visualization needs. In the free version, it has line charts, area charts, bar charts, column charts, pie charts, geo charts, table charts, bubble charts, scatter charts. These charts are based on pure HTML5/SVG technology (adopting VML for old IE versions), so no extra plugins are required. Adding these charts to your page can be done in a few simple steps.
21
 
22
  ### One of the best table plugin for wordpress ###
23
  On top of our responsive charts and graphs, you can also add our responsive tables to your posts and pages, and customize them however you like. Not only can you customize the design of the tables, you can add sorting capabilities, pagination, search and more. You can view a few examples of what can be done <a href="https://demo.themeisle.com/visualizer/table-chart/">here</a>, but many more things can be done, including pricing tables and product tables.
@@ -37,7 +37,7 @@ Charts are rendered using HTML5/SVG technology to provide cross-browser compatib
37
  >
38
  > * Import data from other charts, graphs and tables
39
  > * Easily edit the data using a excel-like data editor
40
- > * Gain access to 6 more chart types ( Combo, Timeline, Candlestick, Gauge, Radar/Spider, Polar Area )
41
  > * Import data from any database
42
  > * Synchronize your data periodically
43
  > * Create private charts (customizable permissions system)
16
 
17
  The plugin uses Google Visualization API, DataTables.net and ChartJS to add responsive & animated charts, graphs and tables, which support cross-browser compatibility and display perfectly on mobile devices. You can greatly customize all aspects of the charts and tables, and import the data from Excel, CSV, Google Sheets and more!
18
 
19
+ ### 4 Chart types + 11 more in the pro version ###
20
+ This WordPress graph plugin provides a variety of charts that are optimized to address your WordPress data visualization needs. In the free version, it has line charts, bar charts, pie charts, table charts. These charts are based on pure HTML5/SVG technology (adopting VML for old IE versions), so no extra plugins are required. Adding these charts to your page can be done in a few simple steps.
21
 
22
  ### One of the best table plugin for wordpress ###
23
  On top of our responsive charts and graphs, you can also add our responsive tables to your posts and pages, and customize them however you like. Not only can you customize the design of the tables, you can add sorting capabilities, pagination, search and more. You can view a few examples of what can be done <a href="https://demo.themeisle.com/visualizer/table-chart/">here</a>, but many more things can be done, including pricing tables and product tables.
37
  >
38
  > * Import data from other charts, graphs and tables
39
  > * Easily edit the data using a excel-like data editor
40
+ > * Gain access to 11 more chart types ( Area, Geo, Column, Bubble, Scatter, Combo, Timeline, Candlestick, Gauge, Radar/Spider, Polar Area )
41
  > * Import data from any database
42
  > * Synchronize your data periodically
43
  > * Create private charts (customizable permissions system)
readme.txt CHANGED
@@ -16,8 +16,8 @@ A simple and powerful WordPress chart plugin to create responsive charts & table
16
 
17
  The plugin uses Google Visualization API, DataTables.net and ChartJS to add responsive & animated charts, graphs and tables, which support cross-browser compatibility and display perfectly on mobile devices. You can greatly customize all aspects of the charts and tables, and import the data from Excel, CSV, Google Sheets and more!
18
 
19
- ### 9 Chart types + 6 more in the pro version ###
20
- This WordPress graph plugin provides a variety of charts that are optimized to address your WordPress data visualization needs. In the free version, it has line charts, area charts, bar charts, column charts, pie charts, geo charts, table charts, bubble charts, scatter charts. These charts are based on pure HTML5/SVG technology (adopting VML for old IE versions), so no extra plugins are required. Adding these charts to your page can be done in a few simple steps.
21
 
22
  ### One of the best table plugin for wordpress ###
23
  On top of our responsive charts and graphs, you can also add our responsive tables to your posts and pages, and customize them however you like. Not only can you customize the design of the tables, you can add sorting capabilities, pagination, search and more. You can view a few examples of what can be done <a href="https://demo.themeisle.com/visualizer/table-chart/">here</a>, but many more things can be done, including pricing tables and product tables.
@@ -37,7 +37,7 @@ Charts are rendered using HTML5/SVG technology to provide cross-browser compatib
37
  >
38
  > * Import data from other charts, graphs and tables
39
  > * Easily edit the data using a excel-like data editor
40
- > * Gain access to 6 more chart types ( Combo, Timeline, Candlestick, Gauge, Radar/Spider, Polar Area )
41
  > * Import data from any database
42
  > * Synchronize your data periodically
43
  > * Create private charts (customizable permissions system)
@@ -163,6 +163,16 @@ Pay attention that to turn your shortcodes into graphs, your theme has to have `
163
 
164
  == Changelog ==
165
 
 
 
 
 
 
 
 
 
 
 
166
  ##### [Version 3.7.2](https://github.com/Codeinwp/visualizer/compare/v3.7.1...v3.7.2) (2021-12-20)
167
 
168
  - Add latest chartJS library support in the bar chart
16
 
17
  The plugin uses Google Visualization API, DataTables.net and ChartJS to add responsive & animated charts, graphs and tables, which support cross-browser compatibility and display perfectly on mobile devices. You can greatly customize all aspects of the charts and tables, and import the data from Excel, CSV, Google Sheets and more!
18
 
19
+ ### 4 Chart types + 11 more in the pro version ###
20
+ This WordPress graph plugin provides a variety of charts that are optimized to address your WordPress data visualization needs. In the free version, it has line charts, bar charts, pie charts, table charts. These charts are based on pure HTML5/SVG technology (adopting VML for old IE versions), so no extra plugins are required. Adding these charts to your page can be done in a few simple steps.
21
 
22
  ### One of the best table plugin for wordpress ###
23
  On top of our responsive charts and graphs, you can also add our responsive tables to your posts and pages, and customize them however you like. Not only can you customize the design of the tables, you can add sorting capabilities, pagination, search and more. You can view a few examples of what can be done <a href="https://demo.themeisle.com/visualizer/table-chart/">here</a>, but many more things can be done, including pricing tables and product tables.
37
  >
38
  > * Import data from other charts, graphs and tables
39
  > * Easily edit the data using a excel-like data editor
40
+ > * Gain access to 11 more chart types ( Area, Geo, Column, Bubble, Scatter, Combo, Timeline, Candlestick, Gauge, Radar/Spider, Polar Area )
41
  > * Import data from any database
42
  > * Synchronize your data periodically
43
  > * Create private charts (customizable permissions system)
163
 
164
  == Changelog ==
165
 
166
+ ##### [Version 3.7.3](https://github.com/Codeinwp/visualizer/compare/v3.7.2...v3.7.3) (2022-01-19)
167
+
168
+ - Fix multiple charts lazy rendering issue
169
+ - Upgrade jQuery UI core library CDN
170
+ - Fix console error when rendering multiple charts
171
+ - Keep only Line / Pie / bar / Table charts in free version
172
+
173
+
174
+
175
+
176
  ##### [Version 3.7.2](https://github.com/Codeinwp/visualizer/compare/v3.7.1...v3.7.2) (2021-12-20)
177
 
178
  - Add latest chartJS library support in the bar chart
templates/more.php CHANGED
@@ -5,7 +5,7 @@ if ( ! Visualizer_Module::is_pro() ) {
5
  <div class="pro-feature-inner">
6
  <div class="pro-feature-features">
7
  <h2>More charts!</h2>
8
- <p>Gain access to 6 more charts right away, and more in the future. So far these include the gauge, candlestick, timeline, combo, polar area and radar charts.</p>
9
  <p>Of course, these are fully customizable!</p>
10
  </div>
11
  <div class="pro-feature-image"><img src="<?php echo VISUALIZER_ABSURL; ?>/images/pro/more_charts.png"></div>
5
  <div class="pro-feature-inner">
6
  <div class="pro-feature-features">
7
  <h2>More charts!</h2>
8
+ <p>Gain access to 11 more charts right away, and more in the future. So far these include the area, geo, column, bubble, scatter, gauge, candlestick, timeline, combo, polar area and radar/spider charts.</p>
9
  <p>Of course, these are fully customizable!</p>
10
  </div>
11
  <div class="pro-feature-image"><img src="<?php echo VISUALIZER_ABSURL; ?>/images/pro/more_charts.png"></div>
vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
- return ComposerAutoloaderInit63c36cc06fbf3a1a8a3437781015b86d::getLoader();
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInit411f4947a8556dc7692d18ddb0ac0a76::getLoader();
vendor/composer/ClassLoader.php CHANGED
@@ -149,7 +149,7 @@ class ClassLoader
149
 
150
  /**
151
  * @return string[] Array of classname => path
152
- * @psalm-var array<string, string>
153
  */
154
  public function getClassMap()
155
  {
149
 
150
  /**
151
  * @return string[] Array of classname => path
152
+ * @psalm-return array<string, string>
153
  */
154
  public function getClassMap()
155
  {
vendor/composer/autoload_files.php CHANGED
@@ -6,6 +6,22 @@ $vendorDir = dirname(dirname(__FILE__));
6
  $baseDir = dirname($vendorDir);
7
 
8
  return array(
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
  'abede361264e2ae69ec1eee813a101af' => $vendorDir . '/markbaker/complex/classes/src/functions/abs.php',
10
  '21a5860fbef5be28db5ddfbc3cca67c4' => $vendorDir . '/markbaker/complex/classes/src/functions/acos.php',
11
  '1546e3f9d127f2a9bb2d1b6c31c26ef1' => $vendorDir . '/markbaker/complex/classes/src/functions/acosh.php',
@@ -48,22 +64,6 @@ return array(
48
  '883af48563631547925fa4c3b48ead07' => $vendorDir . '/markbaker/complex/classes/src/operations/multiply.php',
49
  'f190e3308e6ca23234a2875edc985c03' => $vendorDir . '/markbaker/complex/classes/src/operations/divideby.php',
50
  'ac9e33ce6841aa5bf5d16d465a2f03a7' => $vendorDir . '/markbaker/complex/classes/src/operations/divideinto.php',
51
- '3af723442581d6c310bf44543f9f5c60' => $vendorDir . '/markbaker/matrix/classes/src/Functions/adjoint.php',
52
- 'd803221834c8b57fec95debb5406a797' => $vendorDir . '/markbaker/matrix/classes/src/Functions/antidiagonal.php',
53
- '4714cafbd3be4c72c274a25eae9396bb' => $vendorDir . '/markbaker/matrix/classes/src/Functions/cofactors.php',
54
- '89719dc7c77436609d1c1c31f0797b8f' => $vendorDir . '/markbaker/matrix/classes/src/Functions/determinant.php',
55
- 'c28af79ec7730859d83f2d4310b8dd0b' => $vendorDir . '/markbaker/matrix/classes/src/Functions/diagonal.php',
56
- 'c5d82bf1ac485e445f911e55789ab4e6' => $vendorDir . '/markbaker/matrix/classes/src/Functions/identity.php',
57
- '0d2d594de24a247f7a33499e933aa21e' => $vendorDir . '/markbaker/matrix/classes/src/Functions/inverse.php',
58
- 'f37c25880804a014ef40c8bffbab1b10' => $vendorDir . '/markbaker/matrix/classes/src/Functions/minors.php',
59
- 'd6e4e42171df0dbea253b3067fefda38' => $vendorDir . '/markbaker/matrix/classes/src/Functions/trace.php',
60
- '2c9b19fa954fd3e6fcc7e7a1383caddd' => $vendorDir . '/markbaker/matrix/classes/src/Functions/transpose.php',
61
- '0a538fc9b897450ec362480ebbebe94f' => $vendorDir . '/markbaker/matrix/classes/src/Operations/add.php',
62
- 'f0843f7f4089ec2343c7445544356385' => $vendorDir . '/markbaker/matrix/classes/src/Operations/directsum.php',
63
- 'ad3e8c29aa16d134661a414265677b61' => $vendorDir . '/markbaker/matrix/classes/src/Operations/subtract.php',
64
- '8d37dad4703fab45bfec9dd0bbf3278e' => $vendorDir . '/markbaker/matrix/classes/src/Operations/multiply.php',
65
- '4888a6f58c08148ebe17682f9ce9b2a8' => $vendorDir . '/markbaker/matrix/classes/src/Operations/divideby.php',
66
- 'eef6fa3879d3efa347cd24d5eb348f85' => $vendorDir . '/markbaker/matrix/classes/src/Operations/divideinto.php',
67
  '546a0158460e038361bb95e23e62fb24' => $vendorDir . '/codeinwp/themeisle-sdk/load.php',
68
  'bac2fbb5843340437cc43704be908cf9' => $vendorDir . '/phpoffice/phpspreadsheet/src/Bootstrap.php',
69
  );
6
  $baseDir = dirname($vendorDir);
7
 
8
  return array(
9
+ '3af723442581d6c310bf44543f9f5c60' => $vendorDir . '/markbaker/matrix/classes/src/Functions/adjoint.php',
10
+ 'd803221834c8b57fec95debb5406a797' => $vendorDir . '/markbaker/matrix/classes/src/Functions/antidiagonal.php',
11
+ '4714cafbd3be4c72c274a25eae9396bb' => $vendorDir . '/markbaker/matrix/classes/src/Functions/cofactors.php',
12
+ '89719dc7c77436609d1c1c31f0797b8f' => $vendorDir . '/markbaker/matrix/classes/src/Functions/determinant.php',
13
+ 'c28af79ec7730859d83f2d4310b8dd0b' => $vendorDir . '/markbaker/matrix/classes/src/Functions/diagonal.php',
14
+ 'c5d82bf1ac485e445f911e55789ab4e6' => $vendorDir . '/markbaker/matrix/classes/src/Functions/identity.php',
15
+ '0d2d594de24a247f7a33499e933aa21e' => $vendorDir . '/markbaker/matrix/classes/src/Functions/inverse.php',
16
+ 'f37c25880804a014ef40c8bffbab1b10' => $vendorDir . '/markbaker/matrix/classes/src/Functions/minors.php',
17
+ 'd6e4e42171df0dbea253b3067fefda38' => $vendorDir . '/markbaker/matrix/classes/src/Functions/trace.php',
18
+ '2c9b19fa954fd3e6fcc7e7a1383caddd' => $vendorDir . '/markbaker/matrix/classes/src/Functions/transpose.php',
19
+ '0a538fc9b897450ec362480ebbebe94f' => $vendorDir . '/markbaker/matrix/classes/src/Operations/add.php',
20
+ 'f0843f7f4089ec2343c7445544356385' => $vendorDir . '/markbaker/matrix/classes/src/Operations/directsum.php',
21
+ 'ad3e8c29aa16d134661a414265677b61' => $vendorDir . '/markbaker/matrix/classes/src/Operations/subtract.php',
22
+ '8d37dad4703fab45bfec9dd0bbf3278e' => $vendorDir . '/markbaker/matrix/classes/src/Operations/multiply.php',
23
+ '4888a6f58c08148ebe17682f9ce9b2a8' => $vendorDir . '/markbaker/matrix/classes/src/Operations/divideby.php',
24
+ 'eef6fa3879d3efa347cd24d5eb348f85' => $vendorDir . '/markbaker/matrix/classes/src/Operations/divideinto.php',
25
  'abede361264e2ae69ec1eee813a101af' => $vendorDir . '/markbaker/complex/classes/src/functions/abs.php',
26
  '21a5860fbef5be28db5ddfbc3cca67c4' => $vendorDir . '/markbaker/complex/classes/src/functions/acos.php',
27
  '1546e3f9d127f2a9bb2d1b6c31c26ef1' => $vendorDir . '/markbaker/complex/classes/src/functions/acosh.php',
64
  '883af48563631547925fa4c3b48ead07' => $vendorDir . '/markbaker/complex/classes/src/operations/multiply.php',
65
  'f190e3308e6ca23234a2875edc985c03' => $vendorDir . '/markbaker/complex/classes/src/operations/divideby.php',
66
  'ac9e33ce6841aa5bf5d16d465a2f03a7' => $vendorDir . '/markbaker/complex/classes/src/operations/divideinto.php',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
67
  '546a0158460e038361bb95e23e62fb24' => $vendorDir . '/codeinwp/themeisle-sdk/load.php',
68
  'bac2fbb5843340437cc43704be908cf9' => $vendorDir . '/phpoffice/phpspreadsheet/src/Bootstrap.php',
69
  );
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInit63c36cc06fbf3a1a8a3437781015b86d
6
  {
7
  private static $loader;
8
 
@@ -24,15 +24,15 @@ class ComposerAutoloaderInit63c36cc06fbf3a1a8a3437781015b86d
24
 
25
  require __DIR__ . '/platform_check.php';
26
 
27
- spl_autoload_register(array('ComposerAutoloaderInit63c36cc06fbf3a1a8a3437781015b86d', 'loadClassLoader'), true, true);
28
  self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
29
- spl_autoload_unregister(array('ComposerAutoloaderInit63c36cc06fbf3a1a8a3437781015b86d', 'loadClassLoader'));
30
 
31
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
32
  if ($useStaticLoader) {
33
  require __DIR__ . '/autoload_static.php';
34
 
35
- call_user_func(\Composer\Autoload\ComposerStaticInit63c36cc06fbf3a1a8a3437781015b86d::getInitializer($loader));
36
  } else {
37
  $map = require __DIR__ . '/autoload_namespaces.php';
38
  foreach ($map as $namespace => $path) {
@@ -53,23 +53,28 @@ class ComposerAutoloaderInit63c36cc06fbf3a1a8a3437781015b86d
53
  $loader->register(true);
54
 
55
  if ($useStaticLoader) {
56
- $includeFiles = Composer\Autoload\ComposerStaticInit63c36cc06fbf3a1a8a3437781015b86d::$files;
57
  } else {
58
  $includeFiles = require __DIR__ . '/autoload_files.php';
59
  }
60
  foreach ($includeFiles as $fileIdentifier => $file) {
61
- composerRequire63c36cc06fbf3a1a8a3437781015b86d($fileIdentifier, $file);
62
  }
63
 
64
  return $loader;
65
  }
66
  }
67
 
68
- function composerRequire63c36cc06fbf3a1a8a3437781015b86d($fileIdentifier, $file)
 
 
 
 
 
69
  {
70
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
71
- require $file;
72
-
73
  $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
 
 
74
  }
75
  }
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderInit411f4947a8556dc7692d18ddb0ac0a76
6
  {
7
  private static $loader;
8
 
24
 
25
  require __DIR__ . '/platform_check.php';
26
 
27
+ spl_autoload_register(array('ComposerAutoloaderInit411f4947a8556dc7692d18ddb0ac0a76', 'loadClassLoader'), true, true);
28
  self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
29
+ spl_autoload_unregister(array('ComposerAutoloaderInit411f4947a8556dc7692d18ddb0ac0a76', 'loadClassLoader'));
30
 
31
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
32
  if ($useStaticLoader) {
33
  require __DIR__ . '/autoload_static.php';
34
 
35
+ call_user_func(\Composer\Autoload\ComposerStaticInit411f4947a8556dc7692d18ddb0ac0a76::getInitializer($loader));
36
  } else {
37
  $map = require __DIR__ . '/autoload_namespaces.php';
38
  foreach ($map as $namespace => $path) {
53
  $loader->register(true);
54
 
55
  if ($useStaticLoader) {
56
+ $includeFiles = Composer\Autoload\ComposerStaticInit411f4947a8556dc7692d18ddb0ac0a76::$files;
57
  } else {
58
  $includeFiles = require __DIR__ . '/autoload_files.php';
59
  }
60
  foreach ($includeFiles as $fileIdentifier => $file) {
61
+ composerRequire411f4947a8556dc7692d18ddb0ac0a76($fileIdentifier, $file);
62
  }
63
 
64
  return $loader;
65
  }
66
  }
67
 
68
+ /**
69
+ * @param string $fileIdentifier
70
+ * @param string $file
71
+ * @return void
72
+ */
73
+ function composerRequire411f4947a8556dc7692d18ddb0ac0a76($fileIdentifier, $file)
74
  {
75
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
 
 
76
  $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
77
+
78
+ require $file;
79
  }
80
  }
vendor/composer/autoload_static.php CHANGED
@@ -4,9 +4,25 @@
4
 
5
  namespace Composer\Autoload;
6
 
7
- class ComposerStaticInit63c36cc06fbf3a1a8a3437781015b86d
8
  {
9
  public static $files = array (
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  'abede361264e2ae69ec1eee813a101af' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/abs.php',
11
  '21a5860fbef5be28db5ddfbc3cca67c4' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/acos.php',
12
  '1546e3f9d127f2a9bb2d1b6c31c26ef1' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/acosh.php',
@@ -49,22 +65,6 @@ class ComposerStaticInit63c36cc06fbf3a1a8a3437781015b86d
49
  '883af48563631547925fa4c3b48ead07' => __DIR__ . '/..' . '/markbaker/complex/classes/src/operations/multiply.php',
50
  'f190e3308e6ca23234a2875edc985c03' => __DIR__ . '/..' . '/markbaker/complex/classes/src/operations/divideby.php',
51
  'ac9e33ce6841aa5bf5d16d465a2f03a7' => __DIR__ . '/..' . '/markbaker/complex/classes/src/operations/divideinto.php',
52
- '3af723442581d6c310bf44543f9f5c60' => __DIR__ . '/..' . '/markbaker/matrix/classes/src/Functions/adjoint.php',
53
- 'd803221834c8b57fec95debb5406a797' => __DIR__ . '/..' . '/markbaker/matrix/classes/src/Functions/antidiagonal.php',
54
- '4714cafbd3be4c72c274a25eae9396bb' => __DIR__ . '/..' . '/markbaker/matrix/classes/src/Functions/cofactors.php',
55
- '89719dc7c77436609d1c1c31f0797b8f' => __DIR__ . '/..' . '/markbaker/matrix/classes/src/Functions/determinant.php',
56
- 'c28af79ec7730859d83f2d4310b8dd0b' => __DIR__ . '/..' . '/markbaker/matrix/classes/src/Functions/diagonal.php',
57
- 'c5d82bf1ac485e445f911e55789ab4e6' => __DIR__ . '/..' . '/markbaker/matrix/classes/src/Functions/identity.php',
58
- '0d2d594de24a247f7a33499e933aa21e' => __DIR__ . '/..' . '/markbaker/matrix/classes/src/Functions/inverse.php',
59
- 'f37c25880804a014ef40c8bffbab1b10' => __DIR__ . '/..' . '/markbaker/matrix/classes/src/Functions/minors.php',
60
- 'd6e4e42171df0dbea253b3067fefda38' => __DIR__ . '/..' . '/markbaker/matrix/classes/src/Functions/trace.php',
61
- '2c9b19fa954fd3e6fcc7e7a1383caddd' => __DIR__ . '/..' . '/markbaker/matrix/classes/src/Functions/transpose.php',
62
- '0a538fc9b897450ec362480ebbebe94f' => __DIR__ . '/..' . '/markbaker/matrix/classes/src/Operations/add.php',
63
- 'f0843f7f4089ec2343c7445544356385' => __DIR__ . '/..' . '/markbaker/matrix/classes/src/Operations/directsum.php',
64
- 'ad3e8c29aa16d134661a414265677b61' => __DIR__ . '/..' . '/markbaker/matrix/classes/src/Operations/subtract.php',
65
- '8d37dad4703fab45bfec9dd0bbf3278e' => __DIR__ . '/..' . '/markbaker/matrix/classes/src/Operations/multiply.php',
66
- '4888a6f58c08148ebe17682f9ce9b2a8' => __DIR__ . '/..' . '/markbaker/matrix/classes/src/Operations/divideby.php',
67
- 'eef6fa3879d3efa347cd24d5eb348f85' => __DIR__ . '/..' . '/markbaker/matrix/classes/src/Operations/divideinto.php',
68
  '546a0158460e038361bb95e23e62fb24' => __DIR__ . '/..' . '/codeinwp/themeisle-sdk/load.php',
69
  'bac2fbb5843340437cc43704be908cf9' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/Bootstrap.php',
70
  );
@@ -356,10 +356,10 @@ class ComposerStaticInit63c36cc06fbf3a1a8a3437781015b86d
356
  public static function getInitializer(ClassLoader $loader)
357
  {
358
  return \Closure::bind(function () use ($loader) {
359
- $loader->prefixLengthsPsr4 = ComposerStaticInit63c36cc06fbf3a1a8a3437781015b86d::$prefixLengthsPsr4;
360
- $loader->prefixDirsPsr4 = ComposerStaticInit63c36cc06fbf3a1a8a3437781015b86d::$prefixDirsPsr4;
361
- $loader->prefixesPsr0 = ComposerStaticInit63c36cc06fbf3a1a8a3437781015b86d::$prefixesPsr0;
362
- $loader->classMap = ComposerStaticInit63c36cc06fbf3a1a8a3437781015b86d::$classMap;
363
 
364
  }, null, ClassLoader::class);
365
  }
4
 
5
  namespace Composer\Autoload;
6
 
7
+ class ComposerStaticInit411f4947a8556dc7692d18ddb0ac0a76
8
  {
9
  public static $files = array (
10
+ '3af723442581d6c310bf44543f9f5c60' => __DIR__ . '/..' . '/markbaker/matrix/classes/src/Functions/adjoint.php',
11
+ 'd803221834c8b57fec95debb5406a797' => __DIR__ . '/..' . '/markbaker/matrix/classes/src/Functions/antidiagonal.php',
12
+ '4714cafbd3be4c72c274a25eae9396bb' => __DIR__ . '/..' . '/markbaker/matrix/classes/src/Functions/cofactors.php',
13
+ '89719dc7c77436609d1c1c31f0797b8f' => __DIR__ . '/..' . '/markbaker/matrix/classes/src/Functions/determinant.php',
14
+ 'c28af79ec7730859d83f2d4310b8dd0b' => __DIR__ . '/..' . '/markbaker/matrix/classes/src/Functions/diagonal.php',
15
+ 'c5d82bf1ac485e445f911e55789ab4e6' => __DIR__ . '/..' . '/markbaker/matrix/classes/src/Functions/identity.php',
16
+ '0d2d594de24a247f7a33499e933aa21e' => __DIR__ . '/..' . '/markbaker/matrix/classes/src/Functions/inverse.php',
17
+ 'f37c25880804a014ef40c8bffbab1b10' => __DIR__ . '/..' . '/markbaker/matrix/classes/src/Functions/minors.php',
18
+ 'd6e4e42171df0dbea253b3067fefda38' => __DIR__ . '/..' . '/markbaker/matrix/classes/src/Functions/trace.php',
19
+ '2c9b19fa954fd3e6fcc7e7a1383caddd' => __DIR__ . '/..' . '/markbaker/matrix/classes/src/Functions/transpose.php',
20
+ '0a538fc9b897450ec362480ebbebe94f' => __DIR__ . '/..' . '/markbaker/matrix/classes/src/Operations/add.php',
21
+ 'f0843f7f4089ec2343c7445544356385' => __DIR__ . '/..' . '/markbaker/matrix/classes/src/Operations/directsum.php',
22
+ 'ad3e8c29aa16d134661a414265677b61' => __DIR__ . '/..' . '/markbaker/matrix/classes/src/Operations/subtract.php',
23
+ '8d37dad4703fab45bfec9dd0bbf3278e' => __DIR__ . '/..' . '/markbaker/matrix/classes/src/Operations/multiply.php',
24
+ '4888a6f58c08148ebe17682f9ce9b2a8' => __DIR__ . '/..' . '/markbaker/matrix/classes/src/Operations/divideby.php',
25
+ 'eef6fa3879d3efa347cd24d5eb348f85' => __DIR__ . '/..' . '/markbaker/matrix/classes/src/Operations/divideinto.php',
26
  'abede361264e2ae69ec1eee813a101af' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/abs.php',
27
  '21a5860fbef5be28db5ddfbc3cca67c4' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/acos.php',
28
  '1546e3f9d127f2a9bb2d1b6c31c26ef1' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/acosh.php',
65
  '883af48563631547925fa4c3b48ead07' => __DIR__ . '/..' . '/markbaker/complex/classes/src/operations/multiply.php',
66
  'f190e3308e6ca23234a2875edc985c03' => __DIR__ . '/..' . '/markbaker/complex/classes/src/operations/divideby.php',
67
  'ac9e33ce6841aa5bf5d16d465a2f03a7' => __DIR__ . '/..' . '/markbaker/complex/classes/src/operations/divideinto.php',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
68
  '546a0158460e038361bb95e23e62fb24' => __DIR__ . '/..' . '/codeinwp/themeisle-sdk/load.php',
69
  'bac2fbb5843340437cc43704be908cf9' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/Bootstrap.php',
70
  );
356
  public static function getInitializer(ClassLoader $loader)
357
  {
358
  return \Closure::bind(function () use ($loader) {
359
+ $loader->prefixLengthsPsr4 = ComposerStaticInit411f4947a8556dc7692d18ddb0ac0a76::$prefixLengthsPsr4;
360
+ $loader->prefixDirsPsr4 = ComposerStaticInit411f4947a8556dc7692d18ddb0ac0a76::$prefixDirsPsr4;
361
+ $loader->prefixesPsr0 = ComposerStaticInit411f4947a8556dc7692d18ddb0ac0a76::$prefixesPsr0;
362
+ $loader->classMap = ComposerStaticInit411f4947a8556dc7692d18ddb0ac0a76::$classMap;
363
 
364
  }, null, ClassLoader::class);
365
  }
vendor/composer/installed.php CHANGED
@@ -1,11 +1,11 @@
1
  <?php return array(
2
  'root' => array(
3
- 'pretty_version' => 'v3.7.2',
4
- 'version' => '3.7.2.0',
5
  'type' => 'wordpress-plugin',
6
  'install_path' => __DIR__ . '/../../',
7
  'aliases' => array(),
8
- 'reference' => '3f5a59ede4b44a5e93fce01458a0e9af9fa92965',
9
  'name' => 'codeinwp/visualizer',
10
  'dev' => false,
11
  ),
@@ -20,12 +20,12 @@
20
  'dev_requirement' => false,
21
  ),
22
  'codeinwp/visualizer' => array(
23
- 'pretty_version' => 'v3.7.2',
24
- 'version' => '3.7.2.0',
25
  'type' => 'wordpress-plugin',
26
  'install_path' => __DIR__ . '/../../',
27
  'aliases' => array(),
28
- 'reference' => '3f5a59ede4b44a5e93fce01458a0e9af9fa92965',
29
  'dev_requirement' => false,
30
  ),
31
  'markbaker/complex' => array(
1
  <?php return array(
2
  'root' => array(
3
+ 'pretty_version' => 'v3.7.3',
4
+ 'version' => '3.7.3.0',
5
  'type' => 'wordpress-plugin',
6
  'install_path' => __DIR__ . '/../../',
7
  'aliases' => array(),
8
+ 'reference' => 'c81ac9fbbb0a1b0cd9dad8986011890bb9a0ee37',
9
  'name' => 'codeinwp/visualizer',
10
  'dev' => false,
11
  ),
20
  'dev_requirement' => false,
21
  ),
22
  'codeinwp/visualizer' => array(
23
+ 'pretty_version' => 'v3.7.3',
24
+ 'version' => '3.7.3.0',
25
  'type' => 'wordpress-plugin',
26
  'install_path' => __DIR__ . '/../../',
27
  'aliases' => array(),
28
+ 'reference' => 'c81ac9fbbb0a1b0cd9dad8986011890bb9a0ee37',
29
  'dev_requirement' => false,
30
  ),
31
  'markbaker/complex' => array(