WordPress Charts and Graphs Lite - Version 3.4.5

Version Description

  • 2020-07-08
Download this release

Release Info

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

Code changes from version 3.4.4 to 3.4.5

Files changed (46) hide show
  1. CHANGELOG.md +10 -0
  2. classes/Visualizer/Gutenberg/Block.php +40 -7
  3. classes/Visualizer/Gutenberg/build/block.js +5 -5
  4. classes/Visualizer/Gutenberg/src/Components/ChartRender.js +8 -4
  5. classes/Visualizer/Gutenberg/src/Components/ChartSelect.js +9 -5
  6. classes/Visualizer/Gutenberg/src/Components/Charts.js +9 -5
  7. classes/Visualizer/Gutenberg/src/Components/DataTable.js +25 -29
  8. classes/Visualizer/Gutenberg/src/Components/Sidebar.js +15 -7
  9. classes/Visualizer/Gutenberg/src/Components/Sidebar/ColumnSettings.js +17 -2
  10. classes/Visualizer/Gutenberg/src/Components/Sidebar/GeneralSettings.js +20 -15
  11. classes/Visualizer/Gutenberg/src/Components/Sidebar/InstanceSettings.js +58 -0
  12. classes/Visualizer/Gutenberg/src/Components/Sidebar/ManualConfiguration.js +1 -1
  13. classes/Visualizer/Gutenberg/src/Components/Sidebar/RowCellSettings.js +2 -1
  14. classes/Visualizer/Gutenberg/src/Components/Sidebar/SeriesSettings.js +4 -4
  15. classes/Visualizer/Gutenberg/src/Components/Sidebar/TableSettings.js +2 -1
  16. classes/Visualizer/Gutenberg/src/Editor.js +3 -1
  17. classes/Visualizer/Gutenberg/src/index.js +4 -0
  18. classes/Visualizer/Gutenberg/src/utils.js +6 -0
  19. classes/Visualizer/Module.php +4 -1
  20. classes/Visualizer/Module/Admin.php +7 -29
  21. classes/Visualizer/Module/Frontend.php +45 -20
  22. classes/Visualizer/Module/Setup.php +3 -0
  23. classes/Visualizer/Module/Upgrade.php +76 -0
  24. classes/Visualizer/Plugin.php +1 -1
  25. classes/Visualizer/Render/Layout.php +1 -1
  26. classes/Visualizer/Render/Library.php +4 -6
  27. classes/Visualizer/Render/Page/Types.php +6 -1
  28. classes/Visualizer/Render/Sidebar/Type/DataTable/DataTable.php +5 -1
  29. classes/Visualizer/Render/Sidebar/Type/DataTable/Tabular.php +485 -0
  30. classes/Visualizer/Render/Sidebar/Type/GoogleCharts/Tabular.php +386 -0
  31. css/frame.css +3 -5
  32. css/library.css +10 -0
  33. css/media.css +1 -1
  34. index.php +1 -1
  35. js/render-chartjs.js +6 -1
  36. js/render-datatables.js +7 -2
  37. js/render-facade.js +65 -1
  38. js/render-google.js +13 -1
  39. readme.md +9 -1
  40. readme.txt +9 -1
  41. samples/{dataTable.csv → tabular.csv} +0 -0
  42. themeisle-hash.json +1 -1
  43. vendor/autoload.php +1 -1
  44. vendor/autoload_52.php +1 -1
  45. vendor/composer/autoload_real.php +5 -5
  46. vendor/composer/autoload_real_52.php +3 -3
CHANGELOG.md CHANGED
@@ -1,4 +1,14 @@
1
 
 
 
 
 
 
 
 
 
 
 
2
  ### v3.4.4 - 2020-06-16
3
  **Changes:**
4
  * [Feat] Option to download charts as .png images
1
 
2
+ ### v3.4.5 - 2020-07-21
3
+ **Changes:**
4
+
5
+ ### v3.4.5 - 2020-07-08
6
+ **Changes:**
7
+ * [Feat] New Google Table Charts
8
+ * [Feat] Option for lazy loading Google Charts
9
+ * [Feat] Option to easily copy chart shortcode code
10
+ * [Fix] Remove Inside the Chart option for the legend position for Google Pie charts
11
+
12
  ### v3.4.4 - 2020-06-16
13
  **Changes:**
14
  * [Feat] Option to download charts as .png images
classes/Visualizer/Gutenberg/Block.php CHANGED
@@ -139,6 +139,9 @@ class Visualizer_Gutenberg_Block {
139
  'id' => array(
140
  'type' => 'number',
141
  ),
 
 
 
142
  ),
143
  )
144
  );
@@ -147,14 +150,44 @@ class Visualizer_Gutenberg_Block {
147
  /**
148
  * Gutenberg Block Callback Function
149
  */
150
- public function gutenberg_block_callback( $attr ) {
151
- if ( isset( $attr['id'] ) ) {
152
- $id = $attr['id'];
153
- if ( empty( $id ) || $id === 'none' ) {
154
- return ''; // no id = no fun
155
- }
156
- return '[visualizer id="' . $id . '"]';
 
 
 
 
 
 
 
 
 
 
 
 
157
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
158
  }
159
 
160
  /**
139
  'id' => array(
140
  'type' => 'number',
141
  ),
142
+ 'lazy' => array(
143
+ 'type' => 'string',
144
+ ),
145
  ),
146
  )
147
  );
150
  /**
151
  * Gutenberg Block Callback Function
152
  */
153
+ public function gutenberg_block_callback( $atts ) {
154
+ // no id, no fun.
155
+ if ( ! isset( $atts['id'] ) ) {
156
+ return '';
157
+ }
158
+
159
+ $atts = shortcode_atts(
160
+ array(
161
+ 'id' => false,
162
+ 'lazy' => apply_filters( 'visualizer_lazy_by_default', false, $atts['id'] ),
163
+ // we are deliberating excluding the class attribute from here
164
+ // as this will be handled by the custom class in Gutenberg
165
+ ),
166
+ $atts
167
+ );
168
+
169
+ // no id, no fun.
170
+ if ( ! $atts['id'] ) {
171
+ return '';
172
  }
173
+
174
+ // phpcs:ignore WordPress.PHP.StrictComparisons.LooseComparison
175
+ if ( $atts['lazy'] == -1 || $atts['lazy'] == false ) {
176
+ $atts['lazy'] = 'no';
177
+ }
178
+
179
+ // we don't want the chart in the editor lazy-loading.
180
+ if ( is_admin() ) {
181
+ unset( $atts['lazy'] );
182
+ }
183
+
184
+ $shortcode = '[visualizer';
185
+ foreach ( $atts as $name => $value ) {
186
+ $shortcode .= sprintf( ' %s="%s"', $name, $value );
187
+ }
188
+ $shortcode .= ']';
189
+
190
+ return $shortcode;
191
  }
192
 
193
  /**
classes/Visualizer/Gutenberg/build/block.js CHANGED
@@ -1,4 +1,4 @@
1
- !function(e){function t(t){for(var r,o,s=t[0],l=t[1],u=t[2],d=0,m=[];d<s.length;d++)o=s[d],Object.prototype.hasOwnProperty.call(a,o)&&a[o]&&m.push(a[o][0]),a[o]=0;for(r in l)Object.prototype.hasOwnProperty.call(l,r)&&(e[r]=l[r]);for(c&&c(t);m.length;)m.shift()();return i.push.apply(i,u||[]),n()}function n(){for(var e,t=0;t<i.length;t++){for(var n=i[t],r=!0,s=1;s<n.length;s++){var l=n[s];0!==a[l]&&(r=!1)}r&&(i.splice(t--,1),e=o(o.s=n[0]))}return e}var r={},a={1:0},i=[];function o(t){if(r[t])return r[t].exports;var n=r[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,o),n.l=!0,n.exports}o.m=e,o.c=r,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)o.d(n,r,function(t){return e[t]}.bind(null,r));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="";var s=window.webpackJsonp=window.webpackJsonp||[],l=s.push.bind(s);s.push=t,s=s.slice();for(var u=0;u<s.length;u++)t(s[u]);var c=l;i.push([154,0]),n()}([function(e,t,n){(function(e){e.exports=function(){"use strict";var t,r;function a(){return t.apply(null,arguments)}function i(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function o(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function s(e){return void 0===e}function l(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function u(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function c(e,t){var n,r=[];for(n=0;n<e.length;++n)r.push(t(e[n],n));return r}function d(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function m(e,t){for(var n in t)d(t,n)&&(e[n]=t[n]);return d(t,"toString")&&(e.toString=t.toString),d(t,"valueOf")&&(e.valueOf=t.valueOf),e}function p(e,t,n,r){return Et(e,t,n,r,!0).utc()}function h(e){return null==e._pf&&(e._pf={empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],meridiem:null,rfc2822:!1,weekdayMismatch:!1}),e._pf}function f(e){if(null==e._isValid){var t=h(e),n=r.call(t.parsedDateParts,(function(e){return null!=e})),a=!isNaN(e._d.getTime())&&t.overflow<0&&!t.empty&&!t.invalidMonth&&!t.invalidWeekday&&!t.weekdayMismatch&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&n);if(e._strict&&(a=a&&0===t.charsLeftOver&&0===t.unusedTokens.length&&void 0===t.bigHour),null!=Object.isFrozen&&Object.isFrozen(e))return a;e._isValid=a}return e._isValid}function _(e){var t=p(NaN);return null!=e?m(h(t),e):h(t).userInvalidated=!0,t}r=Array.prototype.some?Array.prototype.some:function(e){for(var t=Object(this),n=t.length>>>0,r=0;r<n;r++)if(r in t&&e.call(this,t[r],r,t))return!0;return!1};var y=a.momentProperties=[];function g(e,t){var n,r,a;if(s(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),s(t._i)||(e._i=t._i),s(t._f)||(e._f=t._f),s(t._l)||(e._l=t._l),s(t._strict)||(e._strict=t._strict),s(t._tzm)||(e._tzm=t._tzm),s(t._isUTC)||(e._isUTC=t._isUTC),s(t._offset)||(e._offset=t._offset),s(t._pf)||(e._pf=h(t)),s(t._locale)||(e._locale=t._locale),y.length>0)for(n=0;n<y.length;n++)s(a=t[r=y[n]])||(e[r]=a);return e}var b=!1;function v(e){g(this,e),this._d=new Date(null!=e._d?e._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),!1===b&&(b=!0,a.updateOffset(this),b=!1)}function w(e){return e instanceof v||null!=e&&null!=e._isAMomentObject}function M(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function k(e){var t=+e,n=0;return 0!==t&&isFinite(t)&&(n=M(t)),n}function L(e,t,n){var r,a=Math.min(e.length,t.length),i=Math.abs(e.length-t.length),o=0;for(r=0;r<a;r++)(n&&e[r]!==t[r]||!n&&k(e[r])!==k(t[r]))&&o++;return o+i}function Y(e){!1===a.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+e)}function T(e,t){var n=!0;return m((function(){if(null!=a.deprecationHandler&&a.deprecationHandler(null,e),n){for(var r,i=[],o=0;o<arguments.length;o++){if(r="","object"==typeof arguments[o]){for(var s in r+="\n["+o+"] ",arguments[0])r+=s+": "+arguments[0][s]+", ";r=r.slice(0,-2)}else r=arguments[o];i.push(r)}Y(e+"\nArguments: "+Array.prototype.slice.call(i).join("")+"\n"+(new Error).stack),n=!1}return t.apply(this,arguments)}),t)}var D,S={};function O(e,t){null!=a.deprecationHandler&&a.deprecationHandler(e,t),S[e]||(Y(t),S[e]=!0)}function j(e){return e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}function x(e,t){var n,r=m({},e);for(n in t)d(t,n)&&(o(e[n])&&o(t[n])?(r[n]={},m(r[n],e[n]),m(r[n],t[n])):null!=t[n]?r[n]=t[n]:delete r[n]);for(n in e)d(e,n)&&!d(t,n)&&o(e[n])&&(r[n]=m({},r[n]));return r}function E(e){null!=e&&this.set(e)}a.suppressDeprecationWarnings=!1,a.deprecationHandler=null,D=Object.keys?Object.keys:function(e){var t,n=[];for(t in e)d(e,t)&&n.push(t);return n};var C={};function P(e,t){var n=e.toLowerCase();C[n]=C[n+"s"]=C[t]=e}function H(e){return"string"==typeof e?C[e]||C[e.toLowerCase()]:void 0}function z(e){var t,n,r={};for(n in e)d(e,n)&&(t=H(n))&&(r[t]=e[n]);return r}var A={};function N(e,t){A[e]=t}function F(e,t,n){var r=""+Math.abs(e),a=t-r.length;return(e>=0?n?"+":"":"-")+Math.pow(10,Math.max(0,a)).toString().substr(1)+r}var R=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,W=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,I={},B={};function J(e,t,n,r){var a=r;"string"==typeof r&&(a=function(){return this[r]()}),e&&(B[e]=a),t&&(B[t[0]]=function(){return F(a.apply(this,arguments),t[1],t[2])}),n&&(B[n]=function(){return this.localeData().ordinal(a.apply(this,arguments),e)})}function U(e,t){return e.isValid()?(t=q(t,e.localeData()),I[t]=I[t]||function(e){var t,n,r,a=e.match(R);for(t=0,n=a.length;t<n;t++)B[a[t]]?a[t]=B[a[t]]:a[t]=(r=a[t]).match(/\[[\s\S]/)?r.replace(/^\[|\]$/g,""):r.replace(/\\/g,"");return function(t){var r,i="";for(r=0;r<n;r++)i+=j(a[r])?a[r].call(t,e):a[r];return i}}(t),I[t](e)):e.localeData().invalidDate()}function q(e,t){var n=5;function r(e){return t.longDateFormat(e)||e}for(W.lastIndex=0;n>=0&&W.test(e);)e=e.replace(W,r),W.lastIndex=0,n-=1;return e}var V=/\d/,G=/\d\d/,$=/\d{3}/,K=/\d{4}/,Z=/[+-]?\d{6}/,Q=/\d\d?/,X=/\d\d\d\d?/,ee=/\d\d\d\d\d\d?/,te=/\d{1,3}/,ne=/\d{1,4}/,re=/[+-]?\d{1,6}/,ae=/\d+/,ie=/[+-]?\d+/,oe=/Z|[+-]\d\d:?\d\d/gi,se=/Z|[+-]\d\d(?::?\d\d)?/gi,le=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,ue={};function ce(e,t,n){ue[e]=j(t)?t:function(e,r){return e&&n?n:t}}function de(e,t){return d(ue,e)?ue[e](t._strict,t._locale):new RegExp(me(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,(function(e,t,n,r,a){return t||n||r||a}))))}function me(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}var pe={};function he(e,t){var n,r=t;for("string"==typeof e&&(e=[e]),l(t)&&(r=function(e,n){n[t]=k(e)}),n=0;n<e.length;n++)pe[e[n]]=r}function fe(e,t){he(e,(function(e,n,r,a){r._w=r._w||{},t(e,r._w,r,a)}))}function _e(e,t,n){null!=t&&d(pe,e)&&pe[e](t,n._a,n,e)}var ye=0,ge=1,be=2,ve=3,we=4,Me=5,ke=6,Le=7,Ye=8;function Te(e){return De(e)?366:365}function De(e){return e%4==0&&e%100!=0||e%400==0}J("Y",0,0,(function(){var e=this.year();return e<=9999?""+e:"+"+e})),J(0,["YY",2],0,(function(){return this.year()%100})),J(0,["YYYY",4],0,"year"),J(0,["YYYYY",5],0,"year"),J(0,["YYYYYY",6,!0],0,"year"),P("year","y"),N("year",1),ce("Y",ie),ce("YY",Q,G),ce("YYYY",ne,K),ce("YYYYY",re,Z),ce("YYYYYY",re,Z),he(["YYYYY","YYYYYY"],ye),he("YYYY",(function(e,t){t[ye]=2===e.length?a.parseTwoDigitYear(e):k(e)})),he("YY",(function(e,t){t[ye]=a.parseTwoDigitYear(e)})),he("Y",(function(e,t){t[ye]=parseInt(e,10)})),a.parseTwoDigitYear=function(e){return k(e)+(k(e)>68?1900:2e3)};var Se,Oe=je("FullYear",!0);function je(e,t){return function(n){return null!=n?(Ee(this,e,n),a.updateOffset(this,t),this):xe(this,e)}}function xe(e,t){return e.isValid()?e._d["get"+(e._isUTC?"UTC":"")+t]():NaN}function Ee(e,t,n){e.isValid()&&!isNaN(n)&&("FullYear"===t&&De(e.year())&&1===e.month()&&29===e.date()?e._d["set"+(e._isUTC?"UTC":"")+t](n,e.month(),Ce(n,e.month())):e._d["set"+(e._isUTC?"UTC":"")+t](n))}function Ce(e,t){if(isNaN(e)||isNaN(t))return NaN;var n,r=(t%(n=12)+n)%n;return e+=(t-r)/12,1===r?De(e)?29:28:31-r%7%2}Se=Array.prototype.indexOf?Array.prototype.indexOf:function(e){var t;for(t=0;t<this.length;++t)if(this[t]===e)return t;return-1},J("M",["MM",2],"Mo",(function(){return this.month()+1})),J("MMM",0,0,(function(e){return this.localeData().monthsShort(this,e)})),J("MMMM",0,0,(function(e){return this.localeData().months(this,e)})),P("month","M"),N("month",8),ce("M",Q),ce("MM",Q,G),ce("MMM",(function(e,t){return t.monthsShortRegex(e)})),ce("MMMM",(function(e,t){return t.monthsRegex(e)})),he(["M","MM"],(function(e,t){t[ge]=k(e)-1})),he(["MMM","MMMM"],(function(e,t,n,r){var a=n._locale.monthsParse(e,r,n._strict);null!=a?t[ge]=a:h(n).invalidMonth=e}));var Pe=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,He="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ze="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_");function Ae(e,t,n){var r,a,i,o=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],r=0;r<12;++r)i=p([2e3,r]),this._shortMonthsParse[r]=this.monthsShort(i,"").toLocaleLowerCase(),this._longMonthsParse[r]=this.months(i,"").toLocaleLowerCase();return n?"MMM"===t?-1!==(a=Se.call(this._shortMonthsParse,o))?a:null:-1!==(a=Se.call(this._longMonthsParse,o))?a:null:"MMM"===t?-1!==(a=Se.call(this._shortMonthsParse,o))?a:-1!==(a=Se.call(this._longMonthsParse,o))?a:null:-1!==(a=Se.call(this._longMonthsParse,o))?a:-1!==(a=Se.call(this._shortMonthsParse,o))?a:null}function Ne(e,t){var n;if(!e.isValid())return e;if("string"==typeof t)if(/^\d+$/.test(t))t=k(t);else if(!l(t=e.localeData().monthsParse(t)))return e;return n=Math.min(e.date(),Ce(e.year(),t)),e._d["set"+(e._isUTC?"UTC":"")+"Month"](t,n),e}function Fe(e){return null!=e?(Ne(this,e),a.updateOffset(this,!0),this):xe(this,"Month")}var Re=le,We=le;function Ie(){function e(e,t){return t.length-e.length}var t,n,r=[],a=[],i=[];for(t=0;t<12;t++)n=p([2e3,t]),r.push(this.monthsShort(n,"")),a.push(this.months(n,"")),i.push(this.months(n,"")),i.push(this.monthsShort(n,""));for(r.sort(e),a.sort(e),i.sort(e),t=0;t<12;t++)r[t]=me(r[t]),a[t]=me(a[t]);for(t=0;t<24;t++)i[t]=me(i[t]);this._monthsRegex=new RegExp("^("+i.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+a.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+r.join("|")+")","i")}function Be(e,t,n,r,a,i,o){var s=new Date(e,t,n,r,a,i,o);return e<100&&e>=0&&isFinite(s.getFullYear())&&s.setFullYear(e),s}function Je(e){var t=new Date(Date.UTC.apply(null,arguments));return e<100&&e>=0&&isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e),t}function Ue(e,t,n){var r=7+t-n;return-(7+Je(e,0,r).getUTCDay()-t)%7+r-1}function qe(e,t,n,r,a){var i,o,s=1+7*(t-1)+(7+n-r)%7+Ue(e,r,a);return s<=0?o=Te(i=e-1)+s:s>Te(e)?(i=e+1,o=s-Te(e)):(i=e,o=s),{year:i,dayOfYear:o}}function Ve(e,t,n){var r,a,i=Ue(e.year(),t,n),o=Math.floor((e.dayOfYear()-i-1)/7)+1;return o<1?r=o+Ge(a=e.year()-1,t,n):o>Ge(e.year(),t,n)?(r=o-Ge(e.year(),t,n),a=e.year()+1):(a=e.year(),r=o),{week:r,year:a}}function Ge(e,t,n){var r=Ue(e,t,n),a=Ue(e+1,t,n);return(Te(e)-r+a)/7}J("w",["ww",2],"wo","week"),J("W",["WW",2],"Wo","isoWeek"),P("week","w"),P("isoWeek","W"),N("week",5),N("isoWeek",5),ce("w",Q),ce("ww",Q,G),ce("W",Q),ce("WW",Q,G),fe(["w","ww","W","WW"],(function(e,t,n,r){t[r.substr(0,1)]=k(e)})),J("d",0,"do","day"),J("dd",0,0,(function(e){return this.localeData().weekdaysMin(this,e)})),J("ddd",0,0,(function(e){return this.localeData().weekdaysShort(this,e)})),J("dddd",0,0,(function(e){return this.localeData().weekdays(this,e)})),J("e",0,0,"weekday"),J("E",0,0,"isoWeekday"),P("day","d"),P("weekday","e"),P("isoWeekday","E"),N("day",11),N("weekday",11),N("isoWeekday",11),ce("d",Q),ce("e",Q),ce("E",Q),ce("dd",(function(e,t){return t.weekdaysMinRegex(e)})),ce("ddd",(function(e,t){return t.weekdaysShortRegex(e)})),ce("dddd",(function(e,t){return t.weekdaysRegex(e)})),fe(["dd","ddd","dddd"],(function(e,t,n,r){var a=n._locale.weekdaysParse(e,r,n._strict);null!=a?t.d=a:h(n).invalidWeekday=e})),fe(["d","e","E"],(function(e,t,n,r){t[r]=k(e)}));var $e="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Ke="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Ze="Su_Mo_Tu_We_Th_Fr_Sa".split("_");function Qe(e,t,n){var r,a,i,o=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],r=0;r<7;++r)i=p([2e3,1]).day(r),this._minWeekdaysParse[r]=this.weekdaysMin(i,"").toLocaleLowerCase(),this._shortWeekdaysParse[r]=this.weekdaysShort(i,"").toLocaleLowerCase(),this._weekdaysParse[r]=this.weekdays(i,"").toLocaleLowerCase();return n?"dddd"===t?-1!==(a=Se.call(this._weekdaysParse,o))?a:null:"ddd"===t?-1!==(a=Se.call(this._shortWeekdaysParse,o))?a:null:-1!==(a=Se.call(this._minWeekdaysParse,o))?a:null:"dddd"===t?-1!==(a=Se.call(this._weekdaysParse,o))?a:-1!==(a=Se.call(this._shortWeekdaysParse,o))?a:-1!==(a=Se.call(this._minWeekdaysParse,o))?a:null:"ddd"===t?-1!==(a=Se.call(this._shortWeekdaysParse,o))?a:-1!==(a=Se.call(this._weekdaysParse,o))?a:-1!==(a=Se.call(this._minWeekdaysParse,o))?a:null:-1!==(a=Se.call(this._minWeekdaysParse,o))?a:-1!==(a=Se.call(this._weekdaysParse,o))?a:-1!==(a=Se.call(this._shortWeekdaysParse,o))?a:null}var Xe=le,et=le,tt=le;function nt(){function e(e,t){return t.length-e.length}var t,n,r,a,i,o=[],s=[],l=[],u=[];for(t=0;t<7;t++)n=p([2e3,1]).day(t),r=this.weekdaysMin(n,""),a=this.weekdaysShort(n,""),i=this.weekdays(n,""),o.push(r),s.push(a),l.push(i),u.push(r),u.push(a),u.push(i);for(o.sort(e),s.sort(e),l.sort(e),u.sort(e),t=0;t<7;t++)s[t]=me(s[t]),l[t]=me(l[t]),u[t]=me(u[t]);this._weekdaysRegex=new RegExp("^("+u.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+o.join("|")+")","i")}function rt(){return this.hours()%12||12}function at(e,t){J(e,0,0,(function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)}))}function it(e,t){return t._meridiemParse}J("H",["HH",2],0,"hour"),J("h",["hh",2],0,rt),J("k",["kk",2],0,(function(){return this.hours()||24})),J("hmm",0,0,(function(){return""+rt.apply(this)+F(this.minutes(),2)})),J("hmmss",0,0,(function(){return""+rt.apply(this)+F(this.minutes(),2)+F(this.seconds(),2)})),J("Hmm",0,0,(function(){return""+this.hours()+F(this.minutes(),2)})),J("Hmmss",0,0,(function(){return""+this.hours()+F(this.minutes(),2)+F(this.seconds(),2)})),at("a",!0),at("A",!1),P("hour","h"),N("hour",13),ce("a",it),ce("A",it),ce("H",Q),ce("h",Q),ce("k",Q),ce("HH",Q,G),ce("hh",Q,G),ce("kk",Q,G),ce("hmm",X),ce("hmmss",ee),ce("Hmm",X),ce("Hmmss",ee),he(["H","HH"],ve),he(["k","kk"],(function(e,t,n){var r=k(e);t[ve]=24===r?0:r})),he(["a","A"],(function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e})),he(["h","hh"],(function(e,t,n){t[ve]=k(e),h(n).bigHour=!0})),he("hmm",(function(e,t,n){var r=e.length-2;t[ve]=k(e.substr(0,r)),t[we]=k(e.substr(r)),h(n).bigHour=!0})),he("hmmss",(function(e,t,n){var r=e.length-4,a=e.length-2;t[ve]=k(e.substr(0,r)),t[we]=k(e.substr(r,2)),t[Me]=k(e.substr(a)),h(n).bigHour=!0})),he("Hmm",(function(e,t,n){var r=e.length-2;t[ve]=k(e.substr(0,r)),t[we]=k(e.substr(r))})),he("Hmmss",(function(e,t,n){var r=e.length-4,a=e.length-2;t[ve]=k(e.substr(0,r)),t[we]=k(e.substr(r,2)),t[Me]=k(e.substr(a))}));var ot,st=je("Hours",!0),lt={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:He,monthsShort:ze,week:{dow:0,doy:6},weekdays:$e,weekdaysMin:Ze,weekdaysShort:Ke,meridiemParse:/[ap]\.?m?\.?/i},ut={},ct={};function dt(e){return e?e.toLowerCase().replace("_","-"):e}function mt(t){var r=null;if(!ut[t]&&void 0!==e&&e&&e.exports)try{r=ot._abbr,n(149)("./"+t),pt(r)}catch(e){}return ut[t]}function pt(e,t){var n;return e&&(n=s(t)?ft(e):ht(e,t))&&(ot=n),ot._abbr}function ht(e,t){if(null!==t){var n=lt;if(t.abbr=e,null!=ut[e])O("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),n=ut[e]._config;else if(null!=t.parentLocale){if(null==ut[t.parentLocale])return ct[t.parentLocale]||(ct[t.parentLocale]=[]),ct[t.parentLocale].push({name:e,config:t}),null;n=ut[t.parentLocale]._config}return ut[e]=new E(x(n,t)),ct[e]&&ct[e].forEach((function(e){ht(e.name,e.config)})),pt(e),ut[e]}return delete ut[e],null}function ft(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return ot;if(!i(e)){if(t=mt(e))return t;e=[e]}return function(e){for(var t,n,r,a,i=0;i<e.length;){for(t=(a=dt(e[i]).split("-")).length,n=(n=dt(e[i+1]))?n.split("-"):null;t>0;){if(r=mt(a.slice(0,t).join("-")))return r;if(n&&n.length>=t&&L(a,n,!0)>=t-1)break;t--}i++}return null}(e)}function _t(e){var t,n=e._a;return n&&-2===h(e).overflow&&(t=n[ge]<0||n[ge]>11?ge:n[be]<1||n[be]>Ce(n[ye],n[ge])?be:n[ve]<0||n[ve]>24||24===n[ve]&&(0!==n[we]||0!==n[Me]||0!==n[ke])?ve:n[we]<0||n[we]>59?we:n[Me]<0||n[Me]>59?Me:n[ke]<0||n[ke]>999?ke:-1,h(e)._overflowDayOfYear&&(t<ye||t>be)&&(t=be),h(e)._overflowWeeks&&-1===t&&(t=Le),h(e)._overflowWeekday&&-1===t&&(t=Ye),h(e).overflow=t),e}function yt(e,t,n){return null!=e?e:null!=t?t:n}function gt(e){var t,n,r,i,o,s=[];if(!e._d){for(r=function(e){var t=new Date(a.now());return e._useUTC?[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()]:[t.getFullYear(),t.getMonth(),t.getDate()]}(e),e._w&&null==e._a[be]&&null==e._a[ge]&&function(e){var t,n,r,a,i,o,s,l;if(null!=(t=e._w).GG||null!=t.W||null!=t.E)i=1,o=4,n=yt(t.GG,e._a[ye],Ve(Ct(),1,4).year),r=yt(t.W,1),((a=yt(t.E,1))<1||a>7)&&(l=!0);else{i=e._locale._week.dow,o=e._locale._week.doy;var u=Ve(Ct(),i,o);n=yt(t.gg,e._a[ye],u.year),r=yt(t.w,u.week),null!=t.d?((a=t.d)<0||a>6)&&(l=!0):null!=t.e?(a=t.e+i,(t.e<0||t.e>6)&&(l=!0)):a=i}r<1||r>Ge(n,i,o)?h(e)._overflowWeeks=!0:null!=l?h(e)._overflowWeekday=!0:(s=qe(n,r,a,i,o),e._a[ye]=s.year,e._dayOfYear=s.dayOfYear)}(e),null!=e._dayOfYear&&(o=yt(e._a[ye],r[ye]),(e._dayOfYear>Te(o)||0===e._dayOfYear)&&(h(e)._overflowDayOfYear=!0),n=Je(o,0,e._dayOfYear),e._a[ge]=n.getUTCMonth(),e._a[be]=n.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=s[t]=r[t];for(;t<7;t++)e._a[t]=s[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[ve]&&0===e._a[we]&&0===e._a[Me]&&0===e._a[ke]&&(e._nextDay=!0,e._a[ve]=0),e._d=(e._useUTC?Je:Be).apply(null,s),i=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[ve]=24),e._w&&void 0!==e._w.d&&e._w.d!==i&&(h(e).weekdayMismatch=!0)}}var bt=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,vt=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,wt=/Z|[+-]\d\d(?::?\d\d)?/,Mt=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],kt=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Lt=/^\/?Date\((\-?\d+)/i;function Yt(e){var t,n,r,a,i,o,s=e._i,l=bt.exec(s)||vt.exec(s);if(l){for(h(e).iso=!0,t=0,n=Mt.length;t<n;t++)if(Mt[t][1].exec(l[1])){a=Mt[t][0],r=!1!==Mt[t][2];break}if(null==a)return void(e._isValid=!1);if(l[3]){for(t=0,n=kt.length;t<n;t++)if(kt[t][1].exec(l[3])){i=(l[2]||" ")+kt[t][0];break}if(null==i)return void(e._isValid=!1)}if(!r&&null!=i)return void(e._isValid=!1);if(l[4]){if(!wt.exec(l[4]))return void(e._isValid=!1);o="Z"}e._f=a+(i||"")+(o||""),jt(e)}else e._isValid=!1}var Tt=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/;function Dt(e){var t=parseInt(e,10);return t<=49?2e3+t:t<=999?1900+t:t}var St={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Ot(e){var t,n,r,a,i,o,s,l=Tt.exec(e._i.replace(/\([^)]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim());if(l){var u=(t=l[4],n=l[3],r=l[2],a=l[5],i=l[6],o=l[7],s=[Dt(t),ze.indexOf(n),parseInt(r,10),parseInt(a,10),parseInt(i,10)],o&&s.push(parseInt(o,10)),s);if(!function(e,t,n){return!e||Ke.indexOf(e)===new Date(t[0],t[1],t[2]).getDay()||(h(n).weekdayMismatch=!0,n._isValid=!1,!1)}(l[1],u,e))return;e._a=u,e._tzm=function(e,t,n){if(e)return St[e];if(t)return 0;var r=parseInt(n,10),a=r%100;return(r-a)/100*60+a}(l[8],l[9],l[10]),e._d=Je.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),h(e).rfc2822=!0}else e._isValid=!1}function jt(e){if(e._f!==a.ISO_8601)if(e._f!==a.RFC_2822){e._a=[],h(e).empty=!0;var t,n,r,i,o,s=""+e._i,l=s.length,u=0;for(r=q(e._f,e._locale).match(R)||[],t=0;t<r.length;t++)i=r[t],(n=(s.match(de(i,e))||[])[0])&&((o=s.substr(0,s.indexOf(n))).length>0&&h(e).unusedInput.push(o),s=s.slice(s.indexOf(n)+n.length),u+=n.length),B[i]?(n?h(e).empty=!1:h(e).unusedTokens.push(i),_e(i,n,e)):e._strict&&!n&&h(e).unusedTokens.push(i);h(e).charsLeftOver=l-u,s.length>0&&h(e).unusedInput.push(s),e._a[ve]<=12&&!0===h(e).bigHour&&e._a[ve]>0&&(h(e).bigHour=void 0),h(e).parsedDateParts=e._a.slice(0),h(e).meridiem=e._meridiem,e._a[ve]=function(e,t,n){var r;return null==n?t:null!=e.meridiemHour?e.meridiemHour(t,n):null!=e.isPM?((r=e.isPM(n))&&t<12&&(t+=12),r||12!==t||(t=0),t):t}(e._locale,e._a[ve],e._meridiem),gt(e),_t(e)}else Ot(e);else Yt(e)}function xt(e){var t=e._i,n=e._f;return e._locale=e._locale||ft(e._l),null===t||void 0===n&&""===t?_({nullInput:!0}):("string"==typeof t&&(e._i=t=e._locale.preparse(t)),w(t)?new v(_t(t)):(u(t)?e._d=t:i(n)?function(e){var t,n,r,a,i;if(0===e._f.length)return h(e).invalidFormat=!0,void(e._d=new Date(NaN));for(a=0;a<e._f.length;a++)i=0,t=g({},e),null!=e._useUTC&&(t._useUTC=e._useUTC),t._f=e._f[a],jt(t),f(t)&&(i+=h(t).charsLeftOver,i+=10*h(t).unusedTokens.length,h(t).score=i,(null==r||i<r)&&(r=i,n=t));m(e,n||t)}(e):n?jt(e):function(e){var t=e._i;s(t)?e._d=new Date(a.now()):u(t)?e._d=new Date(t.valueOf()):"string"==typeof t?function(e){var t=Lt.exec(e._i);null===t?(Yt(e),!1===e._isValid&&(delete e._isValid,Ot(e),!1===e._isValid&&(delete e._isValid,a.createFromInputFallback(e)))):e._d=new Date(+t[1])}(e):i(t)?(e._a=c(t.slice(0),(function(e){return parseInt(e,10)})),gt(e)):o(t)?function(e){if(!e._d){var t=z(e._i);e._a=c([t.year,t.month,t.day||t.date,t.hour,t.minute,t.second,t.millisecond],(function(e){return e&&parseInt(e,10)})),gt(e)}}(e):l(t)?e._d=new Date(t):a.createFromInputFallback(e)}(e),f(e)||(e._d=null),e))}function Et(e,t,n,r,a){var s,l={};return!0!==n&&!1!==n||(r=n,n=void 0),(o(e)&&function(e){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(e).length;var t;for(t in e)if(e.hasOwnProperty(t))return!1;return!0}(e)||i(e)&&0===e.length)&&(e=void 0),l._isAMomentObject=!0,l._useUTC=l._isUTC=a,l._l=n,l._i=e,l._f=t,l._strict=r,(s=new v(_t(xt(l))))._nextDay&&(s.add(1,"d"),s._nextDay=void 0),s}function Ct(e,t,n,r){return Et(e,t,n,r,!1)}a.createFromInputFallback=T("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged and will be removed in an upcoming major release. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",(function(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))})),a.ISO_8601=function(){},a.RFC_2822=function(){};var Pt=T("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",(function(){var e=Ct.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:_()})),Ht=T("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",(function(){var e=Ct.apply(null,arguments);return this.isValid()&&e.isValid()?e>this?this:e:_()}));function zt(e,t){var n,r;if(1===t.length&&i(t[0])&&(t=t[0]),!t.length)return Ct();for(n=t[0],r=1;r<t.length;++r)t[r].isValid()&&!t[r][e](n)||(n=t[r]);return n}var At=["year","quarter","month","week","day","hour","minute","second","millisecond"];function Nt(e){var t=z(e),n=t.year||0,r=t.quarter||0,a=t.month||0,i=t.week||0,o=t.day||0,s=t.hour||0,l=t.minute||0,u=t.second||0,c=t.millisecond||0;this._isValid=function(e){for(var t in e)if(-1===Se.call(At,t)||null!=e[t]&&isNaN(e[t]))return!1;for(var n=!1,r=0;r<At.length;++r)if(e[At[r]]){if(n)return!1;parseFloat(e[At[r]])!==k(e[At[r]])&&(n=!0)}return!0}(t),this._milliseconds=+c+1e3*u+6e4*l+1e3*s*60*60,this._days=+o+7*i,this._months=+a+3*r+12*n,this._data={},this._locale=ft(),this._bubble()}function Ft(e){return e instanceof Nt}function Rt(e){return e<0?-1*Math.round(-1*e):Math.round(e)}function Wt(e,t){J(e,0,0,(function(){var e=this.utcOffset(),n="+";return e<0&&(e=-e,n="-"),n+F(~~(e/60),2)+t+F(~~e%60,2)}))}Wt("Z",":"),Wt("ZZ",""),ce("Z",se),ce("ZZ",se),he(["Z","ZZ"],(function(e,t,n){n._useUTC=!0,n._tzm=Bt(se,e)}));var It=/([\+\-]|\d\d)/gi;function Bt(e,t){var n=(t||"").match(e);if(null===n)return null;var r=((n[n.length-1]||[])+"").match(It)||["-",0,0],a=60*r[1]+k(r[2]);return 0===a?0:"+"===r[0]?a:-a}function Jt(e,t){var n,r;return t._isUTC?(n=t.clone(),r=(w(e)||u(e)?e.valueOf():Ct(e).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+r),a.updateOffset(n,!1),n):Ct(e).local()}function Ut(e){return 15*-Math.round(e._d.getTimezoneOffset()/15)}function qt(){return!!this.isValid()&&this._isUTC&&0===this._offset}a.updateOffset=function(){};var Vt=/^(\-|\+)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/,Gt=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function $t(e,t){var n,r,a,i,o,s,u=e,c=null;return Ft(e)?u={ms:e._milliseconds,d:e._days,M:e._months}:l(e)?(u={},t?u[t]=e:u.milliseconds=e):(c=Vt.exec(e))?(n="-"===c[1]?-1:1,u={y:0,d:k(c[be])*n,h:k(c[ve])*n,m:k(c[we])*n,s:k(c[Me])*n,ms:k(Rt(1e3*c[ke]))*n}):(c=Gt.exec(e))?(n="-"===c[1]?-1:(c[1],1),u={y:Kt(c[2],n),M:Kt(c[3],n),w:Kt(c[4],n),d:Kt(c[5],n),h:Kt(c[6],n),m:Kt(c[7],n),s:Kt(c[8],n)}):null==u?u={}:"object"==typeof u&&("from"in u||"to"in u)&&(i=Ct(u.from),o=Ct(u.to),a=i.isValid()&&o.isValid()?(o=Jt(o,i),i.isBefore(o)?s=Zt(i,o):((s=Zt(o,i)).milliseconds=-s.milliseconds,s.months=-s.months),s):{milliseconds:0,months:0},(u={}).ms=a.milliseconds,u.M=a.months),r=new Nt(u),Ft(e)&&d(e,"_locale")&&(r._locale=e._locale),r}function Kt(e,t){var n=e&&parseFloat(e.replace(",","."));return(isNaN(n)?0:n)*t}function Zt(e,t){var n={milliseconds:0,months:0};return n.months=t.month()-e.month()+12*(t.year()-e.year()),e.clone().add(n.months,"M").isAfter(t)&&--n.months,n.milliseconds=+t-+e.clone().add(n.months,"M"),n}function Qt(e,t){return function(n,r){var a;return null===r||isNaN(+r)||(O(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),a=n,n=r,r=a),Xt(this,$t(n="string"==typeof n?+n:n,r),e),this}}function Xt(e,t,n,r){var i=t._milliseconds,o=Rt(t._days),s=Rt(t._months);e.isValid()&&(r=null==r||r,s&&Ne(e,xe(e,"Month")+s*n),o&&Ee(e,"Date",xe(e,"Date")+o*n),i&&e._d.setTime(e._d.valueOf()+i*n),r&&a.updateOffset(e,o||s))}$t.fn=Nt.prototype,$t.invalid=function(){return $t(NaN)};var en=Qt(1,"add"),tn=Qt(-1,"subtract");function nn(e,t){var n=12*(t.year()-e.year())+(t.month()-e.month()),r=e.clone().add(n,"months");return-(n+(t-r<0?(t-r)/(r-e.clone().add(n-1,"months")):(t-r)/(e.clone().add(n+1,"months")-r)))||0}function rn(e){var t;return void 0===e?this._locale._abbr:(null!=(t=ft(e))&&(this._locale=t),this)}a.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",a.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var an=T("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",(function(e){return void 0===e?this.localeData():this.locale(e)}));function on(){return this._locale}function sn(e,t){J(0,[e,e.length],0,t)}function ln(e,t,n,r,a){var i;return null==e?Ve(this,r,a).year:(t>(i=Ge(e,r,a))&&(t=i),un.call(this,e,t,n,r,a))}function un(e,t,n,r,a){var i=qe(e,t,n,r,a),o=Je(i.year,0,i.dayOfYear);return this.year(o.getUTCFullYear()),this.month(o.getUTCMonth()),this.date(o.getUTCDate()),this}J(0,["gg",2],0,(function(){return this.weekYear()%100})),J(0,["GG",2],0,(function(){return this.isoWeekYear()%100})),sn("gggg","weekYear"),sn("ggggg","weekYear"),sn("GGGG","isoWeekYear"),sn("GGGGG","isoWeekYear"),P("weekYear","gg"),P("isoWeekYear","GG"),N("weekYear",1),N("isoWeekYear",1),ce("G",ie),ce("g",ie),ce("GG",Q,G),ce("gg",Q,G),ce("GGGG",ne,K),ce("gggg",ne,K),ce("GGGGG",re,Z),ce("ggggg",re,Z),fe(["gggg","ggggg","GGGG","GGGGG"],(function(e,t,n,r){t[r.substr(0,2)]=k(e)})),fe(["gg","GG"],(function(e,t,n,r){t[r]=a.parseTwoDigitYear(e)})),J("Q",0,"Qo","quarter"),P("quarter","Q"),N("quarter",7),ce("Q",V),he("Q",(function(e,t){t[ge]=3*(k(e)-1)})),J("D",["DD",2],"Do","date"),P("date","D"),N("date",9),ce("D",Q),ce("DD",Q,G),ce("Do",(function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient})),he(["D","DD"],be),he("Do",(function(e,t){t[be]=k(e.match(Q)[0])}));var cn=je("Date",!0);J("DDD",["DDDD",3],"DDDo","dayOfYear"),P("dayOfYear","DDD"),N("dayOfYear",4),ce("DDD",te),ce("DDDD",$),he(["DDD","DDDD"],(function(e,t,n){n._dayOfYear=k(e)})),J("m",["mm",2],0,"minute"),P("minute","m"),N("minute",14),ce("m",Q),ce("mm",Q,G),he(["m","mm"],we);var dn=je("Minutes",!1);J("s",["ss",2],0,"second"),P("second","s"),N("second",15),ce("s",Q),ce("ss",Q,G),he(["s","ss"],Me);var mn,pn=je("Seconds",!1);for(J("S",0,0,(function(){return~~(this.millisecond()/100)})),J(0,["SS",2],0,(function(){return~~(this.millisecond()/10)})),J(0,["SSS",3],0,"millisecond"),J(0,["SSSS",4],0,(function(){return 10*this.millisecond()})),J(0,["SSSSS",5],0,(function(){return 100*this.millisecond()})),J(0,["SSSSSS",6],0,(function(){return 1e3*this.millisecond()})),J(0,["SSSSSSS",7],0,(function(){return 1e4*this.millisecond()})),J(0,["SSSSSSSS",8],0,(function(){return 1e5*this.millisecond()})),J(0,["SSSSSSSSS",9],0,(function(){return 1e6*this.millisecond()})),P("millisecond","ms"),N("millisecond",16),ce("S",te,V),ce("SS",te,G),ce("SSS",te,$),mn="SSSS";mn.length<=9;mn+="S")ce(mn,ae);function hn(e,t){t[ke]=k(1e3*("0."+e))}for(mn="S";mn.length<=9;mn+="S")he(mn,hn);var fn=je("Milliseconds",!1);J("z",0,0,"zoneAbbr"),J("zz",0,0,"zoneName");var _n=v.prototype;function yn(e){return e}_n.add=en,_n.calendar=function(e,t){var n=e||Ct(),r=Jt(n,this).startOf("day"),i=a.calendarFormat(this,r)||"sameElse",o=t&&(j(t[i])?t[i].call(this,n):t[i]);return this.format(o||this.localeData().calendar(i,this,Ct(n)))},_n.clone=function(){return new v(this)},_n.diff=function(e,t,n){var r,a,i;if(!this.isValid())return NaN;if(!(r=Jt(e,this)).isValid())return NaN;switch(a=6e4*(r.utcOffset()-this.utcOffset()),t=H(t)){case"year":i=nn(this,r)/12;break;case"month":i=nn(this,r);break;case"quarter":i=nn(this,r)/3;break;case"second":i=(this-r)/1e3;break;case"minute":i=(this-r)/6e4;break;case"hour":i=(this-r)/36e5;break;case"day":i=(this-r-a)/864e5;break;case"week":i=(this-r-a)/6048e5;break;default:i=this-r}return n?i:M(i)},_n.endOf=function(e){return void 0===(e=H(e))||"millisecond"===e?this:("date"===e&&(e="day"),this.startOf(e).add(1,"isoWeek"===e?"week":e).subtract(1,"ms"))},_n.format=function(e){e||(e=this.isUtc()?a.defaultFormatUtc:a.defaultFormat);var t=U(this,e);return this.localeData().postformat(t)},_n.from=function(e,t){return this.isValid()&&(w(e)&&e.isValid()||Ct(e).isValid())?$t({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},_n.fromNow=function(e){return this.from(Ct(),e)},_n.to=function(e,t){return this.isValid()&&(w(e)&&e.isValid()||Ct(e).isValid())?$t({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},_n.toNow=function(e){return this.to(Ct(),e)},_n.get=function(e){return j(this[e=H(e)])?this[e]():this},_n.invalidAt=function(){return h(this).overflow},_n.isAfter=function(e,t){var n=w(e)?e:Ct(e);return!(!this.isValid()||!n.isValid())&&("millisecond"===(t=H(s(t)?"millisecond":t))?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(t).valueOf())},_n.isBefore=function(e,t){var n=w(e)?e:Ct(e);return!(!this.isValid()||!n.isValid())&&("millisecond"===(t=H(s(t)?"millisecond":t))?this.valueOf()<n.valueOf():this.clone().endOf(t).valueOf()<n.valueOf())},_n.isBetween=function(e,t,n,r){return("("===(r=r||"()")[0]?this.isAfter(e,n):!this.isBefore(e,n))&&(")"===r[1]?this.isBefore(t,n):!this.isAfter(t,n))},_n.isSame=function(e,t){var n,r=w(e)?e:Ct(e);return!(!this.isValid()||!r.isValid())&&("millisecond"===(t=H(t||"millisecond"))?this.valueOf()===r.valueOf():(n=r.valueOf(),this.clone().startOf(t).valueOf()<=n&&n<=this.clone().endOf(t).valueOf()))},_n.isSameOrAfter=function(e,t){return this.isSame(e,t)||this.isAfter(e,t)},_n.isSameOrBefore=function(e,t){return this.isSame(e,t)||this.isBefore(e,t)},_n.isValid=function(){return f(this)},_n.lang=an,_n.locale=rn,_n.localeData=on,_n.max=Ht,_n.min=Pt,_n.parsingFlags=function(){return m({},h(this))},_n.set=function(e,t){if("object"==typeof e)for(var n=function(e){var t=[];for(var n in e)t.push({unit:n,priority:A[n]});return t.sort((function(e,t){return e.priority-t.priority})),t}(e=z(e)),r=0;r<n.length;r++)this[n[r].unit](e[n[r].unit]);else if(j(this[e=H(e)]))return this[e](t);return this},_n.startOf=function(e){switch(e=H(e)){case"year":this.month(0);case"quarter":case"month":this.date(1);case"week":case"isoWeek":case"day":case"date":this.hours(0);case"hour":this.minutes(0);case"minute":this.seconds(0);case"second":this.milliseconds(0)}return"week"===e&&this.weekday(0),"isoWeek"===e&&this.isoWeekday(1),"quarter"===e&&this.month(3*Math.floor(this.month()/3)),this},_n.subtract=tn,_n.toArray=function(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]},_n.toObject=function(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}},_n.toDate=function(){return new Date(this.valueOf())},_n.toISOString=function(e){if(!this.isValid())return null;var t=!0!==e,n=t?this.clone().utc():this;return n.year()<0||n.year()>9999?U(n,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):j(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this._d.valueOf()).toISOString().replace("Z",U(n,"Z")):U(n,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")},_n.inspect=function(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e="moment",t="";this.isLocal()||(e=0===this.utcOffset()?"moment.utc":"moment.parseZone",t="Z");var n="["+e+'("]',r=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",a=t+'[")]';return this.format(n+r+"-MM-DD[T]HH:mm:ss.SSS"+a)},_n.toJSON=function(){return this.isValid()?this.toISOString():null},_n.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},_n.unix=function(){return Math.floor(this.valueOf()/1e3)},_n.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},_n.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},_n.year=Oe,_n.isLeapYear=function(){return De(this.year())},_n.weekYear=function(e){return ln.call(this,e,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)},_n.isoWeekYear=function(e){return ln.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)},_n.quarter=_n.quarters=function(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)},_n.month=Fe,_n.daysInMonth=function(){return Ce(this.year(),this.month())},_n.week=_n.weeks=function(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")},_n.isoWeek=_n.isoWeeks=function(e){var t=Ve(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")},_n.weeksInYear=function(){var e=this.localeData()._week;return Ge(this.year(),e.dow,e.doy)},_n.isoWeeksInYear=function(){return Ge(this.year(),1,4)},_n.date=cn,_n.day=_n.days=function(e){if(!this.isValid())return null!=e?this:NaN;var t=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=e?(e=function(e,t){return"string"!=typeof e?e:isNaN(e)?"number"==typeof(e=t.weekdaysParse(e))?e:null:parseInt(e,10)}(e,this.localeData()),this.add(e-t,"d")):t},_n.weekday=function(e){if(!this.isValid())return null!=e?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return null==e?t:this.add(e-t,"d")},_n.isoWeekday=function(e){if(!this.isValid())return null!=e?this:NaN;if(null!=e){var t=function(e,t){return"string"==typeof e?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}(e,this.localeData());return this.day(this.day()%7?t:t-7)}return this.day()||7},_n.dayOfYear=function(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")},_n.hour=_n.hours=st,_n.minute=_n.minutes=dn,_n.second=_n.seconds=pn,_n.millisecond=_n.milliseconds=fn,_n.utcOffset=function(e,t,n){var r,i=this._offset||0;if(!this.isValid())return null!=e?this:NaN;if(null!=e){if("string"==typeof e){if(null===(e=Bt(se,e)))return this}else Math.abs(e)<16&&!n&&(e*=60);return!this._isUTC&&t&&(r=Ut(this)),this._offset=e,this._isUTC=!0,null!=r&&this.add(r,"m"),i!==e&&(!t||this._changeInProgress?Xt(this,$t(e-i,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,a.updateOffset(this,!0),this._changeInProgress=null)),this}return this._isUTC?i:Ut(this)},_n.utc=function(e){return this.utcOffset(0,e)},_n.local=function(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(Ut(this),"m")),this},_n.parseZone=function(){if(null!=this._tzm)this.utcOffset(this._tzm,!1,!0);else if("string"==typeof this._i){var e=Bt(oe,this._i);null!=e?this.utcOffset(e):this.utcOffset(0,!0)}return this},_n.hasAlignedHourOffset=function(e){return!!this.isValid()&&(e=e?Ct(e).utcOffset():0,(this.utcOffset()-e)%60==0)},_n.isDST=function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},_n.isLocal=function(){return!!this.isValid()&&!this._isUTC},_n.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},_n.isUtc=qt,_n.isUTC=qt,_n.zoneAbbr=function(){return this._isUTC?"UTC":""},_n.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},_n.dates=T("dates accessor is deprecated. Use date instead.",cn),_n.months=T("months accessor is deprecated. Use month instead",Fe),_n.years=T("years accessor is deprecated. Use year instead",Oe),_n.zone=T("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",(function(e,t){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()})),_n.isDSTShifted=T("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",(function(){if(!s(this._isDSTShifted))return this._isDSTShifted;var e={};if(g(e,this),(e=xt(e))._a){var t=e._isUTC?p(e._a):Ct(e._a);this._isDSTShifted=this.isValid()&&L(e._a,t.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}));var gn=E.prototype;function bn(e,t,n,r){var a=ft(),i=p().set(r,t);return a[n](i,e)}function vn(e,t,n){if(l(e)&&(t=e,e=void 0),e=e||"",null!=t)return bn(e,t,n,"month");var r,a=[];for(r=0;r<12;r++)a[r]=bn(e,r,n,"month");return a}function wn(e,t,n,r){"boolean"==typeof e?(l(t)&&(n=t,t=void 0),t=t||""):(n=t=e,e=!1,l(t)&&(n=t,t=void 0),t=t||"");var a,i=ft(),o=e?i._week.dow:0;if(null!=n)return bn(t,(n+o)%7,r,"day");var s=[];for(a=0;a<7;a++)s[a]=bn(t,(a+o)%7,r,"day");return s}gn.calendar=function(e,t,n){var r=this._calendar[e]||this._calendar.sameElse;return j(r)?r.call(t,n):r},gn.longDateFormat=function(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.replace(/MMMM|MM|DD|dddd/g,(function(e){return e.slice(1)})),this._longDateFormat[e])},gn.invalidDate=function(){return this._invalidDate},gn.ordinal=function(e){return this._ordinal.replace("%d",e)},gn.preparse=yn,gn.postformat=yn,gn.relativeTime=function(e,t,n,r){var a=this._relativeTime[n];return j(a)?a(e,t,n,r):a.replace(/%d/i,e)},gn.pastFuture=function(e,t){var n=this._relativeTime[e>0?"future":"past"];return j(n)?n(t):n.replace(/%s/i,t)},gn.set=function(e){var t,n;for(n in e)j(t=e[n])?this[n]=t:this["_"+n]=t;this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)},gn.months=function(e,t){return e?i(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||Pe).test(t)?"format":"standalone"][e.month()]:i(this._months)?this._months:this._months.standalone},gn.monthsShort=function(e,t){return e?i(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[Pe.test(t)?"format":"standalone"][e.month()]:i(this._monthsShort)?this._monthsShort:this._monthsShort.standalone},gn.monthsParse=function(e,t,n){var r,a,i;if(this._monthsParseExact)return Ae.call(this,e,t,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),r=0;r<12;r++){if(a=p([2e3,r]),n&&!this._longMonthsParse[r]&&(this._longMonthsParse[r]=new RegExp("^"+this.months(a,"").replace(".","")+"$","i"),this._shortMonthsParse[r]=new RegExp("^"+this.monthsShort(a,"").replace(".","")+"$","i")),n||this._monthsParse[r]||(i="^"+this.months(a,"")+"|^"+this.monthsShort(a,""),this._monthsParse[r]=new RegExp(i.replace(".",""),"i")),n&&"MMMM"===t&&this._longMonthsParse[r].test(e))return r;if(n&&"MMM"===t&&this._shortMonthsParse[r].test(e))return r;if(!n&&this._monthsParse[r].test(e))return r}},gn.monthsRegex=function(e){return this._monthsParseExact?(d(this,"_monthsRegex")||Ie.call(this),e?this._monthsStrictRegex:this._monthsRegex):(d(this,"_monthsRegex")||(this._monthsRegex=We),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)},gn.monthsShortRegex=function(e){return this._monthsParseExact?(d(this,"_monthsRegex")||Ie.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(d(this,"_monthsShortRegex")||(this._monthsShortRegex=Re),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)},gn.week=function(e){return Ve(e,this._week.dow,this._week.doy).week},gn.firstDayOfYear=function(){return this._week.doy},gn.firstDayOfWeek=function(){return this._week.dow},gn.weekdays=function(e,t){return e?i(this._weekdays)?this._weekdays[e.day()]:this._weekdays[this._weekdays.isFormat.test(t)?"format":"standalone"][e.day()]:i(this._weekdays)?this._weekdays:this._weekdays.standalone},gn.weekdaysMin=function(e){return e?this._weekdaysMin[e.day()]:this._weekdaysMin},gn.weekdaysShort=function(e){return e?this._weekdaysShort[e.day()]:this._weekdaysShort},gn.weekdaysParse=function(e,t,n){var r,a,i;if(this._weekdaysParseExact)return Qe.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),r=0;r<7;r++){if(a=p([2e3,1]).day(r),n&&!this._fullWeekdaysParse[r]&&(this._fullWeekdaysParse[r]=new RegExp("^"+this.weekdays(a,"").replace(".",".?")+"$","i"),this._shortWeekdaysParse[r]=new RegExp("^"+this.weekdaysShort(a,"").replace(".",".?")+"$","i"),this._minWeekdaysParse[r]=new RegExp("^"+this.weekdaysMin(a,"").replace(".",".?")+"$","i")),this._weekdaysParse[r]||(i="^"+this.weekdays(a,"")+"|^"+this.weekdaysShort(a,"")+"|^"+this.weekdaysMin(a,""),this._weekdaysParse[r]=new RegExp(i.replace(".",""),"i")),n&&"dddd"===t&&this._fullWeekdaysParse[r].test(e))return r;if(n&&"ddd"===t&&this._shortWeekdaysParse[r].test(e))return r;if(n&&"dd"===t&&this._minWeekdaysParse[r].test(e))return r;if(!n&&this._weekdaysParse[r].test(e))return r}},gn.weekdaysRegex=function(e){return this._weekdaysParseExact?(d(this,"_weekdaysRegex")||nt.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(d(this,"_weekdaysRegex")||(this._weekdaysRegex=Xe),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)},gn.weekdaysShortRegex=function(e){return this._weekdaysParseExact?(d(this,"_weekdaysRegex")||nt.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(d(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=et),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},gn.weekdaysMinRegex=function(e){return this._weekdaysParseExact?(d(this,"_weekdaysRegex")||nt.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(d(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=tt),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},gn.isPM=function(e){return"p"===(e+"").toLowerCase().charAt(0)},gn.meridiem=function(e,t,n){return e>11?n?"pm":"PM":n?"am":"AM"},pt("en",{dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(1===k(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}}),a.lang=T("moment.lang is deprecated. Use moment.locale instead.",pt),a.langData=T("moment.langData is deprecated. Use moment.localeData instead.",ft);var Mn=Math.abs;function kn(e,t,n,r){var a=$t(t,n);return e._milliseconds+=r*a._milliseconds,e._days+=r*a._days,e._months+=r*a._months,e._bubble()}function Ln(e){return e<0?Math.floor(e):Math.ceil(e)}function Yn(e){return 4800*e/146097}function Tn(e){return 146097*e/4800}function Dn(e){return function(){return this.as(e)}}var Sn=Dn("ms"),On=Dn("s"),jn=Dn("m"),xn=Dn("h"),En=Dn("d"),Cn=Dn("w"),Pn=Dn("M"),Hn=Dn("y");function zn(e){return function(){return this.isValid()?this._data[e]:NaN}}var An=zn("milliseconds"),Nn=zn("seconds"),Fn=zn("minutes"),Rn=zn("hours"),Wn=zn("days"),In=zn("months"),Bn=zn("years"),Jn=Math.round,Un={ss:44,s:45,m:45,h:22,d:26,M:11};function qn(e,t,n,r,a){return a.relativeTime(t||1,!!n,e,r)}var Vn=Math.abs;function Gn(e){return(e>0)-(e<0)||+e}function $n(){if(!this.isValid())return this.localeData().invalidDate();var e,t,n=Vn(this._milliseconds)/1e3,r=Vn(this._days),a=Vn(this._months);e=M(n/60),t=M(e/60),n%=60,e%=60;var i=M(a/12),o=a%=12,s=r,l=t,u=e,c=n?n.toFixed(3).replace(/\.?0+$/,""):"",d=this.asSeconds();if(!d)return"P0D";var m=d<0?"-":"",p=Gn(this._months)!==Gn(d)?"-":"",h=Gn(this._days)!==Gn(d)?"-":"",f=Gn(this._milliseconds)!==Gn(d)?"-":"";return m+"P"+(i?p+i+"Y":"")+(o?p+o+"M":"")+(s?h+s+"D":"")+(l||u||c?"T":"")+(l?f+l+"H":"")+(u?f+u+"M":"")+(c?f+c+"S":"")}var Kn=Nt.prototype;return Kn.isValid=function(){return this._isValid},Kn.abs=function(){var e=this._data;return this._milliseconds=Mn(this._milliseconds),this._days=Mn(this._days),this._months=Mn(this._months),e.milliseconds=Mn(e.milliseconds),e.seconds=Mn(e.seconds),e.minutes=Mn(e.minutes),e.hours=Mn(e.hours),e.months=Mn(e.months),e.years=Mn(e.years),this},Kn.add=function(e,t){return kn(this,e,t,1)},Kn.subtract=function(e,t){return kn(this,e,t,-1)},Kn.as=function(e){if(!this.isValid())return NaN;var t,n,r=this._milliseconds;if("month"===(e=H(e))||"year"===e)return t=this._days+r/864e5,n=this._months+Yn(t),"month"===e?n:n/12;switch(t=this._days+Math.round(Tn(this._months)),e){case"week":return t/7+r/6048e5;case"day":return t+r/864e5;case"hour":return 24*t+r/36e5;case"minute":return 1440*t+r/6e4;case"second":return 86400*t+r/1e3;case"millisecond":return Math.floor(864e5*t)+r;default:throw new Error("Unknown unit "+e)}},Kn.asMilliseconds=Sn,Kn.asSeconds=On,Kn.asMinutes=jn,Kn.asHours=xn,Kn.asDays=En,Kn.asWeeks=Cn,Kn.asMonths=Pn,Kn.asYears=Hn,Kn.valueOf=function(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*k(this._months/12):NaN},Kn._bubble=function(){var e,t,n,r,a,i=this._milliseconds,o=this._days,s=this._months,l=this._data;return i>=0&&o>=0&&s>=0||i<=0&&o<=0&&s<=0||(i+=864e5*Ln(Tn(s)+o),o=0,s=0),l.milliseconds=i%1e3,e=M(i/1e3),l.seconds=e%60,t=M(e/60),l.minutes=t%60,n=M(t/60),l.hours=n%24,o+=M(n/24),a=M(Yn(o)),s+=a,o-=Ln(Tn(a)),r=M(s/12),s%=12,l.days=o,l.months=s,l.years=r,this},Kn.clone=function(){return $t(this)},Kn.get=function(e){return e=H(e),this.isValid()?this[e+"s"]():NaN},Kn.milliseconds=An,Kn.seconds=Nn,Kn.minutes=Fn,Kn.hours=Rn,Kn.days=Wn,Kn.weeks=function(){return M(this.days()/7)},Kn.months=In,Kn.years=Bn,Kn.humanize=function(e){if(!this.isValid())return this.localeData().invalidDate();var t=this.localeData(),n=function(e,t,n){var r=$t(e).abs(),a=Jn(r.as("s")),i=Jn(r.as("m")),o=Jn(r.as("h")),s=Jn(r.as("d")),l=Jn(r.as("M")),u=Jn(r.as("y")),c=a<=Un.ss&&["s",a]||a<Un.s&&["ss",a]||i<=1&&["m"]||i<Un.m&&["mm",i]||o<=1&&["h"]||o<Un.h&&["hh",o]||s<=1&&["d"]||s<Un.d&&["dd",s]||l<=1&&["M"]||l<Un.M&&["MM",l]||u<=1&&["y"]||["yy",u];return c[2]=t,c[3]=+e>0,c[4]=n,qn.apply(null,c)}(this,!e,t);return e&&(n=t.pastFuture(+this,n)),t.postformat(n)},Kn.toISOString=$n,Kn.toString=$n,Kn.toJSON=$n,Kn.locale=rn,Kn.localeData=on,Kn.toIsoString=T("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",$n),Kn.lang=an,J("X",0,0,"unix"),J("x",0,0,"valueOf"),ce("x",ie),ce("X",/[+-]?\d+(\.\d{1,3})?/),he("X",(function(e,t,n){n._d=new Date(1e3*parseFloat(e,10))})),he("x",(function(e,t,n){n._d=new Date(k(e))})),a.version="2.20.1",t=Ct,a.fn=_n,a.min=function(){return zt("isBefore",[].slice.call(arguments,0))},a.max=function(){return zt("isAfter",[].slice.call(arguments,0))},a.now=function(){return Date.now?Date.now():+new Date},a.utc=p,a.unix=function(e){return Ct(1e3*e)},a.months=function(e,t){return vn(e,t,"months")},a.isDate=u,a.locale=pt,a.invalid=_,a.duration=$t,a.isMoment=w,a.weekdays=function(e,t,n){return wn(e,t,n,"weekdays")},a.parseZone=function(){return Ct.apply(null,arguments).parseZone()},a.localeData=ft,a.isDuration=Ft,a.monthsShort=function(e,t){return vn(e,t,"monthsShort")},a.weekdaysMin=function(e,t,n){return wn(e,t,n,"weekdaysMin")},a.defineLocale=ht,a.updateLocale=function(e,t){if(null!=t){var n,r,a=lt;null!=(r=mt(e))&&(a=r._config),t=x(a,t),(n=new E(t)).parentLocale=ut[e],ut[e]=n,pt(e)}else null!=ut[e]&&(null!=ut[e].parentLocale?ut[e]=ut[e].parentLocale:null!=ut[e]&&delete ut[e]);return ut[e]},a.locales=function(){return D(ut)},a.weekdaysShort=function(e,t,n){return wn(e,t,n,"weekdaysShort")},a.normalizeUnits=H,a.relativeTimeRounding=function(e){return void 0===e?Jn:"function"==typeof e&&(Jn=e,!0)},a.relativeTimeThreshold=function(e,t){return void 0!==Un[e]&&(void 0===t?Un[e]:(Un[e]=t,"s"===e&&(Un.ss=t-1),!0))},a.calendarFormat=function(e,t){var n=e.diff(t,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"},a.prototype=_n,a.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"YYYY-[W]WW",MONTH:"YYYY-MM"},a}()}).call(this,n(9)(e))},function(e,t,n){"use strict";e.exports=n(135)},function(e,t){function n(e,t=null,n=null){var r=[];function a(e,t,n,i=0){let o;if(null!==n&&i<n)y(e)&&(o=Object.keys(e)).forEach(r=>{a(e[r],t,n,i+1)});else{if(null!==n&&i==n)return 0==n?void(r=a(e,t,null,i)):void(y(e)&&r.push(a(e,t,n,i+1)));switch(w(e)){case"array":var s=[];if(o=Object.keys(e),null===t||i<t)for(var l=0,u=o.length;l<u;l++){const r=o[l],u=e[r];s[r]=a(u,t,n,i+1)}return s;case"object":var c={};if(o=Object.keys(e),null===t||i<t)for(l=0,u=o.length;l<u;l++){const r=o[l],s=e[r];c[r]=a(s,t,n,i+1)}return c;case"string":return""+e;case"number":return 0+e;case"boolean":return!!e;case"null":return null;case"undefined":return}}}return null===n?a(e,t,n,0):(a(e,t,n,0),r)}function r(e,t,n=null){if("string"===w(t)&&""!==t){var r=[];return function e(t,n,a="",i="",o=null,s=0){if(a===n&&(r[r.length]=i),null!==o&&s>=o)return!1;if(y(t))for(var l=0,u=Object.keys(t),c=u.length;l<c;l++){const r=u[l];e(t[r],n,r,(""===i?i:i+".")+r,o,s+1)}}(e,t,"","",n),0!==(r=r.map(e=>"boolean"===w(e)?e:""===e?e:((e=e.split(".")).pop(),e=e.join(".")))).length&&r}}function a(e,t,n=null){if("string"===w(t)&&""!==t){var r=function e(t,n,r="",a,i=0){if(r===n)return r;var o=!1;if(null!==a&&i>=a)return o;if(y(t))for(var s=0,l=Object.keys(t),u=l.length;s<u;s++){const u=l[s],c=e(t[u],n,u,a,i+1);if(c){o=(r=""===r?r:r+".")+c;break}}return o}(e,t,"",n,0);return"boolean"===w(r)?r:""===r?r:((r=r.split(".")).pop(),r=r.join("."))}}function i(e,t,n=null){if(!u(t=s(t)))return function e(t,n,r,a=0){if(_(t,[n]))return u(t[n]);if(null!==r&&a>=r)return!1;if(y(t))for(var i=0,o=Object.keys(t),s=o.length;i<s;i++){if(e(t[o[i]],n,r,a+1))return!0}return!1}(e,t,n)}function o(e,t,n=null){if(!u(t=s(t)))return function e(t,n,r,a=0){if(_(t,[n]))return l(t[n]);if(null!==r&&a>=r)return!1;if(y(t))for(var i=0,o=Object.keys(t),s=o.length;i<s;i++){if(e(t[o[i]],n,r,a+1))return!0}return!1}(e,t,n,0)}function s(e){const t=c(e);return!(t>1)&&(1===t?Object.keys(e)[0]:0===t&&["string","number"].indexOf(w(e))>-1&&e)}function l(e){return!u(e)}function u(e){return!1===function(e){return y(e)?e:!(["null","undefined"].indexOf(w(e))>-1)&&(!(["",0,!1].indexOf(e)>-1)&&e)}(e)}function c(e){return-1===["array","object"].indexOf(w(e))?0:Object.keys(e).length}function d(e,t,n=null,r=0){if(g(e,t))return!0;if(y(t)&&v(e,t)&&_(e,Object.keys(t))){if(g(f(e,Object.keys(t)),t))return!0}if((null===n||r<n)&&y(e))for(var a=0,i=Object.keys(e),o=i.length;a<o;a++){if(d(e[i[a]],t,n,r+1))return!0}return!1}function m(e,t,n=null){var r=p(e,t,n);if(!1===r)return;return r.map(n=>{if(""===n)return e;n=n.split("."),-1===["array","object"].indexOf(w(t))&&n.splice(-1,1);var r=e;return Array.isArray(n)?(n.forEach(e=>{r=r[e]}),r):r[n]})}function p(e,t,n=null){var r=[];return function e(t,n,a="",i,o){if(y(n)&&v(t,n)&&_(t,Object.keys(n))){g(f(t,Object.keys(n)),n)&&(r[r.length]=a)}if(g(t,n)&&(r[r.length]=a),null!==i&&o>=i)return!1;if(y(t))for(var s=0,l=Object.keys(t),u=l.length;s<u;s++){const r=l[s];e(t[r],n,(""===a?a:a+".")+r,i,o+1)}}(e,t,"",n,0),0!==r.length&&r}function h(e,t,n=null){return function e(t,n,r="",a,i){if(y(n)&&v(t,n)&&_(t,Object.keys(n))){if(g(f(t,Object.keys(n)),n))return r}if(g(t,n))return r;var o=!1;if(null!==a&&i>=a)return o;if(y(t))for(var s=0,l=Object.keys(t),u=l.length;s<u;s++){const u=l[s],c=e(t[u],n,u,a,i+1);if(c){o=(r=""===r?r:r+".")+c;break}}return o}(e,t,"",n,0)}function f(e,t){const n=w(e);if(-1!==["array","object"].indexOf(n)&&0!==t.length){var r;switch(n){case"object":r={},t.forEach(t=>{t in e&&(r[t]=e[t])});break;case"array":r=[],t.forEach(t=>{t in e&&r.push(e[t])})}return r}}function _(e,t){const n=t.length;if(0===n||!y(e))return!1;const r=Object.keys(e);for(var a=!0,i=0;i<n;i++){const e=""+t[i];if(-1===r.indexOf(e)){a=!1;break}}return a}function y(e){return-1!==["array","object"].indexOf(w(e))&&0!==Object.keys(e).length}function g(e,t){const n=b(e,t);if(!1===n)return n;if(-1===["array","object"].indexOf(n))return e===t;const r=Object.keys(e),a=r.length;for(var i=!0,o=0;o<a;o++){const n=r[o],a=g(e[n],t[n]);if(!1===a){i=a;break}}return i}function b(e,t){const n=v(e,t);if(!1===n)return!1;if(["array","object"].indexOf(n)>-1){const n=Object.keys(e),a=Object.keys(t),i=n.length;if(i!==a.length)return!1;if(0===i)return!0;for(var r=0;r<i;r++)if(n[r]!==a[r])return!1}return n}function v(e,t){const n=w(e);return n===w(t)&&n}function w(e){if(null===e)return"null";const t=typeof e;return"object"===t&&Array.isArray(e)?"array":t}var M={getType:function(e){return w(e)},sameType:function(e,t){return v(e,t)},sameStructure:function(e,t){return b(e,t)},identical:function(e,t){return g(e,t)},isIterable:function(e){return y(e)},containsKeys:function(e,t){return _(e,t)},trim:function(e,t){return f(e,t)},locate:function(e,t,n){return h(e,t,n)},deepGet:function(e,t,n){return function(e,t,n=null){var r=h(e,t,n);if(!1!==r){if(""===r)return e;r=r.split("."),-1===["array","object"].indexOf(w(t))&&r.splice(-1,1);var a=e;return Array.isArray(r)?(r.forEach(e=>{a=a[e]}),a):a[r]}}(e,t,n)},locateAll:function(e,t,n){return p(e,t,n)},deepFilter:function(e,t,n){return m(e,t,n)},exists:function(e,t,n){return d(e,t,n)},onlyExisting:function(e,t,n){return function(e,t,n=null){if("array"===w(t)){let r=[];return t.forEach(t=>{d(e,t,n)&&r.push(t)}),r}if("object"===w(t)){let r={};return Object.keys(t).forEach(a=>{let i=t[a];d(e,i,n)&&(r[a]=i)}),r}if(d(e,t,n))return t}(e,t,n)},onlyMissing:function(e,t,n){return function(e,t,n=null){if("array"===w(t)){let r=[];return t.forEach(t=>{d(e,t,n)||r.push(t)}),r}if("object"===w(t)){let r={};return Object.keys(t).forEach(a=>{let i=t[a];d(e,i,n)||(r[a]=i)}),r}if(!d(e,t,n))return t}(e,t,n)},length:function(e){return c(e)},isFalsy:function(e){return u(e)},isTruthy:function(e){return l(e)},foundTruthy:function(e,t,n){return o(e,t,n)},onlyTruthy:function(e,t,n,r){return function(e,t,n,r=null){if("array"===w(t)){let a=[];return t.forEach(t=>{const i=m(e,t);l(i)&&o(i,n,r)&&a.push(t)}),a}if("object"===w(t)){let a={};return Object.keys(t).forEach(i=>{const s=t[i],u=m(e,s);l(u)&&o(u,n,r)&&(a[i]=s)}),a}if(o(e,n,r))return t}(e,t,n,r)},foundFalsy:function(e,t,n){return i(e,t,n)},onlyFalsy:function(e,t,n,r){return function(e,t,n,r=null){if("array"===w(t)){let a=[];return t.forEach(t=>{const o=m(e,t);l(o)&&i(o,n,r)&&a.push(t)}),a}if("object"===w(t)){let a={};return Object.keys(t).forEach(o=>{const s=t[o],u=m(e,s);l(u)&&i(u,n,r)&&(a[o]=s)}),a}if(i(e,n,r))return t}(e,t,n,r)},countMatches:function(e,t,n,r){return function(e,t,n=null,r=null){var a=null===n,i=null===r,o=p(e,t,a&&i?null:a||i?n||r:n<r?n:r);if(!1===o)return 0;if(null===n)return o.length;if("number"===w(n)){let e=0;return o.forEach(t=>{(t=t.split(".")).length===n&&e++}),e}}(e,t,n,r)},matchDepth:function(e,t,n){return function(e,t,n=null){var r=h(e,t,n);return!1!==r&&(""===r?0:(r=r.split(".")).length)}(e,t,n)},maxDepth:function(e,t){return function(e,t=null){let n=0;return function e(t,r,a=0){n<a&&(n=a),null!==r&&a>=r||y(t)&&Object.keys(t).forEach(n=>{e(t[n],r,a+1)})}(e,t),n}(e,t)},locate_Key:function(e,t,n){return a(e,t,n)},deepGet_Key:function(e,t,n){return function(e,t,n=null){if("string"===w(t)&&""!==t){var r=a(e,t,n);if(!1!==r){""===r?r=t:r+="."+t,r=r.split(".");var i=e;return Array.isArray(r)?(r.forEach(e=>{i=i[e]}),i):i[r]}}}(e,t,n)},locateAll_Key:function(e,t,n){return r(e,t,n)},deepFilter_Key:function(e,t,n){return function(e,t,n=null){if("string"!==w(t))return;if(""===t)return;var a=r(e,t,n);if(!1===a)return;return a.map(n=>{if(!1!==n){""===n?n=t:n+="."+t,n=n.split(".");var r=e;return Array.isArray(n)?(n.forEach(e=>{r=r[e]}),r):r[n]}})}(e,t,n)},deepClone:function(e,t,r){return n(e,t,r)},renameKey:function(e,t,n,r){return function(e,t,n,r=null){if("string"===w(t)&&"string"===w(n)&&""!==t&&""!==n){var a=!1;return function e(t,n,r,i,o=0){let s;switch(w(t)){case"array":for(var l=[],u=0,c=(s=Object.keys(t)).length;u<c;u++){let a=s[u],c=t[a];l[a]=e(c,n,r,i,o+1)}return l;case"object":var d={};for(u=0,c=(s=Object.keys(t)).length;u<c;u++){let l=s[u],c=t[l];(null===i||o<i)&&(a||l===n&&(l=r,a=!0)),d[l]=e(c,n,r,i,o+1)}return d;case"string":return""+t;case"number":return 0+t;case"boolean":return!!t;case"null":return null;case"undefined":return}}(e,t,n,r,0)}}(e,t,n,r)},renameKeys:function(e,t,n,r){return function(e,t,n,r=null){if("string"===w(t)&&"string"===w(n)&&""!==t&&""!==n)return function e(t,n,r,a,i=0){let o;switch(w(t)){case"array":for(var s=[],l=0,u=(o=Object.keys(t)).length;l<u;l++){let u=o[l],c=t[u];s[u]=e(c,n,r,a,i+1)}return s;case"object":var c={};for(l=0,u=(o=Object.keys(t)).length;l<u;l++){let s=o[l],u=t[s];(null===a||i<a)&&s===n&&(s=r),c[s]=e(u,n,r,a,i+1)}return c;case"string":return""+t;case"number":return 0+t;case"boolean":return!!t;case"null":return null;case"undefined":return}}(e,t,n,r,0)}(e,t,n,r)},deepRemove_Key:function(e,t,r){return function(e,t,r){if("string"!==w(t))return;if(""===t)return;let i=n(e);var o=a(i,t,r);if(!1===o)return i;""===o?o=t:o+="."+t,o=o.split(".");var s=i;return Array.isArray(o)||delete s[o],o.forEach((e,t)=>{t<o.length-1?s=s[e]:delete s[e]}),i}(e,t,r)},deepRemoveAll_Key:function(e,t,a){return function(e,t,a){if("string"!==w(t))return;if(""===t)return;let i=n(e);var o=r(i,t,a);return o===[]||!1===o?i:(o.forEach(e=>{""===e?e=t:e+="."+t,e=e.split(".");var n=i;Array.isArray(e)||delete n[e];for(var r=0;r<e.length;r++){var a=e[r];if(!(a in n))break;r<e.length-1?n=n[a]:delete n[a]}}),i)}(e,t,a)}};e.exports=M},function(e,t,n){(function(e){!function(t){var n=function(e){return a(!0===e,!1,arguments)};function r(e,t){if("object"!==i(e))return t;for(var n in t)"object"===i(e[n])&&"object"===i(t[n])?e[n]=r(e[n],t[n]):e[n]=t[n];return e}function a(e,t,a){var o=a[0],s=a.length;(e||"object"!==i(o))&&(o={});for(var l=0;l<s;++l){var u=a[l];if("object"===i(u))for(var c in u)if("__proto__"!==c){var d=e?n.clone(u[c]):u[c];o[c]=t?r(o[c],d):d}}return o}function i(e){return{}.toString.call(e).slice(8,-1).toLowerCase()}n.recursive=function(e){return a(!0===e,!0,arguments)},n.clone=function(e){var t,r,a=e,o=i(e);if("array"===o)for(a=[],r=e.length,t=0;t<r;++t)a[t]=n.clone(e[t]);else if("object"===o)for(t in a={},e)a[t]=n.clone(e[t]);return a},t?e.exports=n:window.merge=n}(e&&"object"==typeof e.exports&&e.exports)}).call(this,n(9)(e))},function(e,t,n){"use strict";
2
  /*!
3
  * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
4
  *
@@ -44,7 +44,7 @@
44
  *
45
  * This source code is licensed under the MIT license found in the
46
  * LICENSE file in the root directory of this source tree.
47
- */var r=n(136),a=n(137),i=n(138),o=n(139),s="function"==typeof Symbol&&Symbol.for,l=s?Symbol.for("react.element"):60103,u=s?Symbol.for("react.portal"):60106,c=s?Symbol.for("react.fragment"):60107,d=s?Symbol.for("react.strict_mode"):60108,m=s?Symbol.for("react.profiler"):60114,p=s?Symbol.for("react.provider"):60109,h=s?Symbol.for("react.context"):60110,f=s?Symbol.for("react.async_mode"):60111,_=s?Symbol.for("react.forward_ref"):60112;s&&Symbol.for("react.timeout");var y="function"==typeof Symbol&&Symbol.iterator;function g(e){for(var t=arguments.length-1,n="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=0;r<t;r++)n+="&args[]="+encodeURIComponent(arguments[r+1]);a(!1,"Minified React error #"+e+"; visit %s for the full message or use the non-minified dev environment for full errors and additional helpful warnings. ",n)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}};function v(e,t,n){this.props=e,this.context=t,this.refs=i,this.updater=n||b}function w(){}function M(e,t,n){this.props=e,this.context=t,this.refs=i,this.updater=n||b}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){"object"!=typeof e&&"function"!=typeof e&&null!=e&&g("85"),this.updater.enqueueSetState(this,e,t,"setState")},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},w.prototype=v.prototype;var k=M.prototype=new w;k.constructor=M,r(k,v.prototype),k.isPureReactComponent=!0;var L={current:null},Y=Object.prototype.hasOwnProperty,T={key:!0,ref:!0,__self:!0,__source:!0};function D(e,t,n){var r=void 0,a={},i=null,o=null;if(null!=t)for(r in void 0!==t.ref&&(o=t.ref),void 0!==t.key&&(i=""+t.key),t)Y.call(t,r)&&!T.hasOwnProperty(r)&&(a[r]=t[r]);var s=arguments.length-2;if(1===s)a.children=n;else if(1<s){for(var u=Array(s),c=0;c<s;c++)u[c]=arguments[c+2];a.children=u}if(e&&e.defaultProps)for(r in s=e.defaultProps)void 0===a[r]&&(a[r]=s[r]);return{$$typeof:l,type:e,key:i,ref:o,props:a,_owner:L.current}}function S(e){return"object"==typeof e&&null!==e&&e.$$typeof===l}var O=/\/+/g,j=[];function x(e,t,n,r){if(j.length){var a=j.pop();return a.result=e,a.keyPrefix=t,a.func=n,a.context=r,a.count=0,a}return{result:e,keyPrefix:t,func:n,context:r,count:0}}function E(e){e.result=null,e.keyPrefix=null,e.func=null,e.context=null,e.count=0,10>j.length&&j.push(e)}function C(e,t,n,r){var a=typeof e;"undefined"!==a&&"boolean"!==a||(e=null);var i=!1;if(null===e)i=!0;else switch(a){case"string":case"number":i=!0;break;case"object":switch(e.$$typeof){case l:case u:i=!0}}if(i)return n(r,e,""===t?"."+P(e,0):t),1;if(i=0,t=""===t?".":t+":",Array.isArray(e))for(var o=0;o<e.length;o++){var s=t+P(a=e[o],o);i+=C(a,s,n,r)}else if(null==e?s=null:s="function"==typeof(s=y&&e[y]||e["@@iterator"])?s:null,"function"==typeof s)for(e=s.call(e),o=0;!(a=e.next()).done;)i+=C(a=a.value,s=t+P(a,o++),n,r);else"object"===a&&g("31","[object Object]"===(n=""+e)?"object with keys {"+Object.keys(e).join(", ")+"}":n,"");return i}function P(e,t){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+(""+e).replace(/[=:]/g,(function(e){return t[e]}))}(e.key):t.toString(36)}function H(e,t){e.func.call(e.context,t,e.count++)}function z(e,t,n){var r=e.result,a=e.keyPrefix;e=e.func.call(e.context,t,e.count++),Array.isArray(e)?A(e,r,n,o.thatReturnsArgument):null!=e&&(S(e)&&(t=a+(!e.key||t&&t.key===e.key?"":(""+e.key).replace(O,"$&/")+"/")+n,e={$$typeof:l,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}),r.push(e))}function A(e,t,n,r,a){var i="";null!=n&&(i=(""+n).replace(O,"$&/")+"/"),t=x(t,i,r,a),null==e||C(e,"",z,t),E(t)}var N={Children:{map:function(e,t,n){if(null==e)return e;var r=[];return A(e,r,null,t,n),r},forEach:function(e,t,n){if(null==e)return e;t=x(null,null,t,n),null==e||C(e,"",H,t),E(t)},count:function(e){return null==e?0:C(e,"",o.thatReturnsNull,null)},toArray:function(e){var t=[];return A(e,t,null,o.thatReturnsArgument),t},only:function(e){return S(e)||g("143"),e}},createRef:function(){return{current:null}},Component:v,PureComponent:M,createContext:function(e,t){return void 0===t&&(t=null),(e={$$typeof:h,_calculateChangedBits:t,_defaultValue:e,_currentValue:e,_currentValue2:e,_changedBits:0,_changedBits2:0,Provider:null,Consumer:null}).Provider={$$typeof:p,_context:e},e.Consumer=e},forwardRef:function(e){return{$$typeof:_,render:e}},Fragment:c,StrictMode:d,unstable_AsyncMode:f,unstable_Profiler:m,createElement:D,cloneElement:function(e,t,n){null==e&&g("267",e);var a=void 0,i=r({},e.props),o=e.key,s=e.ref,u=e._owner;if(null!=t){void 0!==t.ref&&(s=t.ref,u=L.current),void 0!==t.key&&(o=""+t.key);var c=void 0;for(a in e.type&&e.type.defaultProps&&(c=e.type.defaultProps),t)Y.call(t,a)&&!T.hasOwnProperty(a)&&(i[a]=void 0===t[a]&&void 0!==c?c[a]:t[a])}if(1===(a=arguments.length-2))i.children=n;else if(1<a){c=Array(a);for(var d=0;d<a;d++)c[d]=arguments[d+2];i.children=c}return{$$typeof:l,type:e.type,key:o,ref:s,props:i,_owner:u}},createFactory:function(e){var t=D.bind(null,e);return t.type=e,t},isValidElement:S,version:"16.4.1",__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{ReactCurrentOwner:L,assign:r}},F={default:N},R=F&&N||F;e.exports=R.default?R.default:R},function(e,t,n){"use strict";
48
  /*
49
  object-assign
50
  (c) Sindre Sorhus
@@ -55,15 +55,15 @@ object-assign
55
  *
56
  * Copyright (c) 2014-2017, Jon Schlinkert.
57
  * Released under the MIT License.
58
- */e.exports=function(e){return null!=e&&"object"==typeof e&&!1===Array.isArray(e)}},,function(e,t,n){(function(e,t){!function(e,n){"use strict";if(!e.setImmediate){var r,a,i,o,s,l=1,u={},c=!1,d=e.document,m=Object.getPrototypeOf&&Object.getPrototypeOf(e);m=m&&m.setTimeout?m:e,"[object process]"==={}.toString.call(e.process)?r=function(e){t.nextTick((function(){h(e)}))}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?e.MessageChannel?((i=new MessageChannel).port1.onmessage=function(e){h(e.data)},r=function(e){i.port2.postMessage(e)}):d&&"onreadystatechange"in d.createElement("script")?(a=d.documentElement,r=function(e){var t=d.createElement("script");t.onreadystatechange=function(){h(e),t.onreadystatechange=null,a.removeChild(t),t=null},a.appendChild(t)}):r=function(e){setTimeout(h,0,e)}:(o="setImmediate$"+Math.random()+"$",s=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(o)&&h(+t.data.slice(o.length))},e.addEventListener?e.addEventListener("message",s,!1):e.attachEvent("onmessage",s),r=function(t){e.postMessage(o+t,"*")}),m.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n<t.length;n++)t[n]=arguments[n+1];var a={callback:e,args:t};return u[l]=a,r(l),l++},m.clearImmediate=p}function p(e){delete u[e]}function h(e){if(c)setTimeout(h,0,e);else{var t=u[e];if(t){c=!0;try{!function(e){var t=e.callback,r=e.args;switch(r.length){case 0:t();break;case 1:t(r[0]);break;case 2:t(r[0],r[1]);break;case 3:t(r[0],r[1],r[2]);break;default:t.apply(n,r)}}(t)}finally{p(e),c=!1}}}}}("undefined"==typeof self?void 0===e?this:e:self)}).call(this,n(8),n(148))},function(e,t){var n,r,a=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(e){n=i}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(e){r=o}}();var l,u=[],c=!1,d=-1;function m(){c&&l&&(c=!1,l.length?u=l.concat(u):d=-1,u.length&&p())}function p(){if(!c){var e=s(m);c=!0;for(var t=u.length;t;){for(l=u,u=[];++d<t;)l&&l[d].run();d=-1,t=u.length}l=null,c=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===o||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function h(e,t){this.fun=e,this.array=t}function f(){}a.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];u.push(new h(e,t)),1!==u.length||c||s(p)},h.prototype.run=function(){this.fun.apply(null,this.array)},a.title="browser",a.browser=!0,a.env={},a.argv=[],a.version="",a.versions={},a.on=f,a.addListener=f,a.once=f,a.off=f,a.removeListener=f,a.removeAllListeners=f,a.emit=f,a.prependListener=f,a.prependOnceListener=f,a.listeners=function(e){return[]},a.binding=function(e){throw new Error("process.binding is not supported")},a.cwd=function(){return"/"},a.chdir=function(e){throw new Error("process.chdir is not supported")},a.umask=function(){return 0}},function(e,t,n){var r={"./af":10,"./af.js":10,"./ar":11,"./ar-dz":12,"./ar-dz.js":12,"./ar-kw":13,"./ar-kw.js":13,"./ar-ly":14,"./ar-ly.js":14,"./ar-ma":15,"./ar-ma.js":15,"./ar-sa":16,"./ar-sa.js":16,"./ar-tn":17,"./ar-tn.js":17,"./ar.js":11,"./az":18,"./az.js":18,"./be":19,"./be.js":19,"./bg":20,"./bg.js":20,"./bm":21,"./bm.js":21,"./bn":22,"./bn.js":22,"./bo":23,"./bo.js":23,"./br":24,"./br.js":24,"./bs":25,"./bs.js":25,"./ca":26,"./ca.js":26,"./cs":27,"./cs.js":27,"./cv":28,"./cv.js":28,"./cy":29,"./cy.js":29,"./da":30,"./da.js":30,"./de":31,"./de-at":32,"./de-at.js":32,"./de-ch":33,"./de-ch.js":33,"./de.js":31,"./dv":34,"./dv.js":34,"./el":35,"./el.js":35,"./en-au":36,"./en-au.js":36,"./en-ca":37,"./en-ca.js":37,"./en-gb":38,"./en-gb.js":38,"./en-ie":39,"./en-ie.js":39,"./en-nz":40,"./en-nz.js":40,"./eo":41,"./eo.js":41,"./es":42,"./es-do":43,"./es-do.js":43,"./es-us":44,"./es-us.js":44,"./es.js":42,"./et":45,"./et.js":45,"./eu":46,"./eu.js":46,"./fa":47,"./fa.js":47,"./fi":48,"./fi.js":48,"./fo":49,"./fo.js":49,"./fr":50,"./fr-ca":51,"./fr-ca.js":51,"./fr-ch":52,"./fr-ch.js":52,"./fr.js":50,"./fy":53,"./fy.js":53,"./gd":54,"./gd.js":54,"./gl":55,"./gl.js":55,"./gom-latn":56,"./gom-latn.js":56,"./gu":57,"./gu.js":57,"./he":58,"./he.js":58,"./hi":59,"./hi.js":59,"./hr":60,"./hr.js":60,"./hu":61,"./hu.js":61,"./hy-am":62,"./hy-am.js":62,"./id":63,"./id.js":63,"./is":64,"./is.js":64,"./it":65,"./it.js":65,"./ja":66,"./ja.js":66,"./jv":67,"./jv.js":67,"./ka":68,"./ka.js":68,"./kk":69,"./kk.js":69,"./km":70,"./km.js":70,"./kn":71,"./kn.js":71,"./ko":72,"./ko.js":72,"./ky":73,"./ky.js":73,"./lb":74,"./lb.js":74,"./lo":75,"./lo.js":75,"./lt":76,"./lt.js":76,"./lv":77,"./lv.js":77,"./me":78,"./me.js":78,"./mi":79,"./mi.js":79,"./mk":80,"./mk.js":80,"./ml":81,"./ml.js":81,"./mr":82,"./mr.js":82,"./ms":83,"./ms-my":84,"./ms-my.js":84,"./ms.js":83,"./mt":85,"./mt.js":85,"./my":86,"./my.js":86,"./nb":87,"./nb.js":87,"./ne":88,"./ne.js":88,"./nl":89,"./nl-be":90,"./nl-be.js":90,"./nl.js":89,"./nn":91,"./nn.js":91,"./pa-in":92,"./pa-in.js":92,"./pl":93,"./pl.js":93,"./pt":94,"./pt-br":95,"./pt-br.js":95,"./pt.js":94,"./ro":96,"./ro.js":96,"./ru":97,"./ru.js":97,"./sd":98,"./sd.js":98,"./se":99,"./se.js":99,"./si":100,"./si.js":100,"./sk":101,"./sk.js":101,"./sl":102,"./sl.js":102,"./sq":103,"./sq.js":103,"./sr":104,"./sr-cyrl":105,"./sr-cyrl.js":105,"./sr.js":104,"./ss":106,"./ss.js":106,"./sv":107,"./sv.js":107,"./sw":108,"./sw.js":108,"./ta":109,"./ta.js":109,"./te":110,"./te.js":110,"./tet":111,"./tet.js":111,"./th":112,"./th.js":112,"./tl-ph":113,"./tl-ph.js":113,"./tlh":114,"./tlh.js":114,"./tr":115,"./tr.js":115,"./tzl":116,"./tzl.js":116,"./tzm":117,"./tzm-latn":118,"./tzm-latn.js":118,"./tzm.js":117,"./uk":119,"./uk.js":119,"./ur":120,"./ur.js":120,"./uz":121,"./uz-latn":122,"./uz-latn.js":122,"./uz.js":121,"./vi":123,"./vi.js":123,"./x-pseudo":124,"./x-pseudo.js":124,"./yo":125,"./yo.js":125,"./zh-cn":126,"./zh-cn.js":126,"./zh-hk":127,"./zh-hk.js":127,"./zh-tw":128,"./zh-tw.js":128};function a(e){var t=i(e);return n(t)}function i(e){if(!n.o(r,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return r[e]}a.keys=function(){return Object.keys(r)},a.resolve=i,e.exports=a,a.id=149},function(e,t,n){var r;e.exports=function e(t,n,a){function i(s,l){if(!n[s]){if(!t[s]){if(!l&&"function"==typeof r&&r)return r(s,!0);if(o)return o(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var c=n[s]={exports:{}};t[s][0].call(c.exports,(function(e){return i(t[s][1][e]||e)}),c,c.exports,e,t,n,a)}return n[s].exports}for(var o="function"==typeof r&&r,s=0;s<a.length;s++)i(a[s]);return i}({1:[function(e,t,n){!function(e){"use strict";var n,r=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,a=Math.ceil,i=Math.floor,o="[BigNumber Error] ",s=o+"Number primitive has more than 15 significant digits: ",l=1e14,u=14,c=9007199254740991,d=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],m=1e7,p=1e9;function h(e){var t=0|e;return 0<e||e===t?t:t-1}function f(e){for(var t,n,r=1,a=e.length,i=e[0]+"";r<a;){for(t=e[r++]+"",n=u-t.length;n--;t="0"+t);i+=t}for(a=i.length;48===i.charCodeAt(--a););return i.slice(0,a+1||1)}function _(e,t){var n,r,a=e.c,i=t.c,o=e.s,s=t.s,l=e.e,u=t.e;if(!o||!s)return null;if(n=a&&!a[0],r=i&&!i[0],n||r)return n?r?0:-s:o;if(o!=s)return o;if(n=o<0,r=l==u,!a||!i)return r?0:!a^n?1:-1;if(!r)return u<l^n?1:-1;for(s=(l=a.length)<(u=i.length)?l:u,o=0;o<s;o++)if(a[o]!=i[o])return a[o]>i[o]^n?1:-1;return l==u?0:u<l^n?1:-1}function y(e,t,n,r){if(e<t||n<e||e!==(e<0?a(e):i(e)))throw Error(o+(r||"Argument")+("number"==typeof e?e<t||n<e?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function g(e){var t=e.c.length-1;return h(e.e/u)==t&&e.c[t]%2!=0}function b(e,t){return(1<e.length?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function v(e,t,n){var r,a;if(t<0){for(a=n+".";++t;a+=n);e=a+e}else if(++t>(r=e.length)){for(a=n,t-=r;--t;a+=n);e+=a}else t<r&&(e=e.slice(0,t)+"."+e.slice(t));return e}(n=function e(t){var n,w,M,k,L,Y,T,D,S,O,j=B.prototype={constructor:B,toString:null,valueOf:null},x=new B(1),E=20,C=4,P=-7,H=21,z=-1e7,A=1e7,N=!1,F=1,R=0,W={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},I="0123456789abcdefghijklmnopqrstuvwxyz";function B(e,t){var n,a,o,l,d,m,p,h,f=this;if(!(f instanceof B))return new B(e,t);if(null==t){if(e instanceof B)return f.s=e.s,f.e=e.e,void(f.c=(e=e.c)?e.slice():e);if((m="number"==typeof e)&&0*e==0){if(f.s=1/e<0?(e=-e,-1):1,e===~~e){for(l=0,d=e;10<=d;d/=10,l++);return f.e=l,void(f.c=[e])}h=String(e)}else{if(h=String(e),!r.test(h))return M(f,h,m);f.s=45==h.charCodeAt(0)?(h=h.slice(1),-1):1}-1<(l=h.indexOf("."))&&(h=h.replace(".","")),0<(d=h.search(/e/i))?(l<0&&(l=d),l+=+h.slice(d+1),h=h.substring(0,d)):l<0&&(l=h.length)}else{if(y(t,2,I.length,"Base"),h=String(e),10==t)return V(f=new B(e instanceof B?e:h),E+f.e+1,C);if(m="number"==typeof e){if(0*e!=0)return M(f,h,m,t);if(f.s=1/e<0?(h=h.slice(1),-1):1,B.DEBUG&&15<h.replace(/^0\.0*|\./,"").length)throw Error(s+e);m=!1}else f.s=45===h.charCodeAt(0)?(h=h.slice(1),-1):1;for(n=I.slice(0,t),l=d=0,p=h.length;d<p;d++)if(n.indexOf(a=h.charAt(d))<0){if("."==a){if(l<d){l=p;continue}}else if(!o&&(h==h.toUpperCase()&&(h=h.toLowerCase())||h==h.toLowerCase()&&(h=h.toUpperCase()))){o=!0,d=-1,l=0;continue}return M(f,String(e),m,t)}-1<(l=(h=w(h,t,10,f.s)).indexOf("."))?h=h.replace(".",""):l=h.length}for(d=0;48===h.charCodeAt(d);d++);for(p=h.length;48===h.charCodeAt(--p););if(h=h.slice(d,++p)){if(p-=d,m&&B.DEBUG&&15<p&&(c<e||e!==i(e)))throw Error(s+f.s*e);if(A<(l=l-d-1))f.c=f.e=null;else if(l<z)f.c=[f.e=0];else{if(f.e=l,f.c=[],d=(l+1)%u,l<0&&(d+=u),d<p){for(d&&f.c.push(+h.slice(0,d)),p-=u;d<p;)f.c.push(+h.slice(d,d+=u));h=h.slice(d),d=u-h.length}else d-=p;for(;d--;h+="0");f.c.push(+h)}}else f.c=[f.e=0]}function J(e,t,n,r){var a,i,o,s,l;if(null==n?n=C:y(n,0,8),!e.c)return e.toString();if(a=e.c[0],o=e.e,null==t)l=f(e.c),l=1==r||2==r&&(o<=P||H<=o)?b(l,o):v(l,o,"0");else if(i=(e=V(new B(e),t,n)).e,s=(l=f(e.c)).length,1==r||2==r&&(t<=i||i<=P)){for(;s<t;l+="0",s++);l=b(l,i)}else if(t-=o,l=v(l,i,"0"),s<i+1){if(0<--t)for(l+=".";t--;l+="0");}else if(0<(t+=i-s))for(i+1==s&&(l+=".");t--;l+="0");return e.s<0&&a?"-"+l:l}function U(e,t){for(var n,r=1,a=new B(e[0]);r<e.length;r++){if(!(n=new B(e[r])).s){a=n;break}t.call(a,n)&&(a=n)}return a}function q(e,t,n){for(var r=1,a=t.length;!t[--a];t.pop());for(a=t[0];10<=a;a/=10,r++);return(n=r+n*u-1)>A?e.c=e.e=null:e.c=n<z?[e.e=0]:(e.e=n,t),e}function V(e,t,n,r){var o,s,c,m,p,h,f,_=e.c,y=d;if(_){e:{for(o=1,m=_[0];10<=m;m/=10,o++);if((s=t-o)<0)s+=u,c=t,f=(p=_[h=0])/y[o-c-1]%10|0;else if((h=a((s+1)/u))>=_.length){if(!r)break e;for(;_.length<=h;_.push(0));p=f=0,c=(s%=u)-u+(o=1)}else{for(p=m=_[h],o=1;10<=m;m/=10,o++);f=(c=(s%=u)-u+o)<0?0:p/y[o-c-1]%10|0}if(r=r||t<0||null!=_[h+1]||(c<0?p:p%y[o-c-1]),r=n<4?(f||r)&&(0==n||n==(e.s<0?3:2)):5<f||5==f&&(4==n||r||6==n&&(0<s?0<c?p/y[o-c]:0:_[h-1])%10&1||n==(e.s<0?8:7)),t<1||!_[0])return _.length=0,r?(t-=e.e+1,_[0]=y[(u-t%u)%u],e.e=-t||0):_[0]=e.e=0,e;if(0==s?(_.length=h,m=1,h--):(_.length=h+1,m=y[u-s],_[h]=0<c?i(p/y[o-c]%y[c])*m:0),r)for(;;){if(0==h){for(s=1,c=_[0];10<=c;c/=10,s++);for(c=_[0]+=m,m=1;10<=c;c/=10,m++);s!=m&&(e.e++,_[0]==l&&(_[0]=1));break}if(_[h]+=m,_[h]!=l)break;_[h--]=0,m=1}for(s=_.length;0===_[--s];_.pop());}e.e>A?e.c=e.e=null:e.e<z&&(e.c=[e.e=0])}return e}function G(e){var t,n=e.e;return null===n?e.toString():(t=f(e.c),t=n<=P||H<=n?b(t,n):v(t,n,"0"),e.s<0?"-"+t:t)}return B.clone=e,B.ROUND_UP=0,B.ROUND_DOWN=1,B.ROUND_CEIL=2,B.ROUND_FLOOR=3,B.ROUND_HALF_UP=4,B.ROUND_HALF_DOWN=5,B.ROUND_HALF_EVEN=6,B.ROUND_HALF_CEIL=7,B.ROUND_HALF_FLOOR=8,B.EUCLID=9,B.config=B.set=function(e){var t,n;if(null!=e){if("object"!=typeof e)throw Error(o+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(y(n=e[t],0,p,t),E=n),e.hasOwnProperty(t="ROUNDING_MODE")&&(y(n=e[t],0,8,t),C=n),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((n=e[t])&&n.pop?(y(n[0],-p,0,t),y(n[1],0,p,t),P=n[0],H=n[1]):(y(n,-p,p,t),P=-(H=n<0?-n:n))),e.hasOwnProperty(t="RANGE"))if((n=e[t])&&n.pop)y(n[0],-p,-1,t),y(n[1],1,p,t),z=n[0],A=n[1];else{if(y(n,-p,p,t),!n)throw Error(o+t+" cannot be zero: "+n);z=-(A=n<0?-n:n)}if(e.hasOwnProperty(t="CRYPTO")){if((n=e[t])!==!!n)throw Error(o+t+" not true or false: "+n);if(n){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw N=!n,Error(o+"crypto unavailable");N=n}else N=n}if(e.hasOwnProperty(t="MODULO_MODE")&&(y(n=e[t],0,9,t),F=n),e.hasOwnProperty(t="POW_PRECISION")&&(y(n=e[t],0,p,t),R=n),e.hasOwnProperty(t="FORMAT")){if("object"!=typeof(n=e[t]))throw Error(o+t+" not an object: "+n);W=n}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(n=e[t])||/^.$|[+-.\s]|(.).*\1/.test(n))throw Error(o+t+" invalid: "+n);I=n}}return{DECIMAL_PLACES:E,ROUNDING_MODE:C,EXPONENTIAL_AT:[P,H],RANGE:[z,A],CRYPTO:N,MODULO_MODE:F,POW_PRECISION:R,FORMAT:W,ALPHABET:I}},B.isBigNumber=function(e){return e instanceof B||e&&!0===e._isBigNumber||!1},B.maximum=B.max=function(){return U(arguments,j.lt)},B.minimum=B.min=function(){return U(arguments,j.gt)},B.random=(k=9007199254740992,L=Math.random()*k&2097151?function(){return i(Math.random()*k)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,n,r,s,l,c=0,m=[],h=new B(x);if(null==e?e=E:y(e,0,p),s=a(e/u),N)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(s*=2));c<s;)9e15<=(l=131072*t[c]+(t[c+1]>>>11))?(n=crypto.getRandomValues(new Uint32Array(2)),t[c]=n[0],t[c+1]=n[1]):(m.push(l%1e14),c+=2);c=s/2}else{if(!crypto.randomBytes)throw N=!1,Error(o+"crypto unavailable");for(t=crypto.randomBytes(s*=7);c<s;)9e15<=(l=281474976710656*(31&t[c])+1099511627776*t[c+1]+4294967296*t[c+2]+16777216*t[c+3]+(t[c+4]<<16)+(t[c+5]<<8)+t[c+6])?crypto.randomBytes(7).copy(t,c):(m.push(l%1e14),c+=7);c=s/7}if(!N)for(;c<s;)(l=L())<9e15&&(m[c++]=l%1e14);for(s=m[--c],e%=u,s&&e&&(l=d[u-e],m[c]=i(s/l)*l);0===m[c];m.pop(),c--);if(c<0)m=[r=0];else{for(r=-1;0===m[0];m.splice(0,1),r-=u);for(c=1,l=m[0];10<=l;l/=10,c++);c<u&&(r-=u-c)}return h.e=r,h.c=m,h}),B.sum=function(){for(var e=1,t=arguments,n=new B(t[0]);e<t.length;)n=n.plus(t[e++]);return n},w=function(){var e="0123456789";function t(e,t,n,r){for(var a,i,o=[0],s=0,l=e.length;s<l;){for(i=o.length;i--;o[i]*=t);for(o[0]+=r.indexOf(e.charAt(s++)),a=0;a<o.length;a++)o[a]>n-1&&(null==o[a+1]&&(o[a+1]=0),o[a+1]+=o[a]/n|0,o[a]%=n)}return o.reverse()}return function(r,a,i,o,s){var l,u,c,d,m,p,h,_,y=r.indexOf("."),g=E,b=C;for(0<=y&&(d=R,R=0,r=r.replace(".",""),p=(_=new B(a)).pow(r.length-y),R=d,_.c=t(v(f(p.c),p.e,"0"),10,i,e),_.e=_.c.length),c=d=(h=t(r,a,i,s?(l=I,e):(l=e,I))).length;0==h[--d];h.pop());if(!h[0])return l.charAt(0);if(y<0?--c:(p.c=h,p.e=c,p.s=o,h=(p=n(p,_,g,b,i)).c,m=p.r,c=p.e),y=h[u=c+g+1],d=i/2,m=m||u<0||null!=h[u+1],m=b<4?(null!=y||m)&&(0==b||b==(p.s<0?3:2)):d<y||y==d&&(4==b||m||6==b&&1&h[u-1]||b==(p.s<0?8:7)),u<1||!h[0])r=m?v(l.charAt(1),-g,l.charAt(0)):l.charAt(0);else{if(h.length=u,m)for(--i;++h[--u]>i;)h[u]=0,u||(++c,h=[1].concat(h));for(d=h.length;!h[--d];);for(y=0,r="";y<=d;r+=l.charAt(h[y++]));r=v(r,c,l.charAt(0))}return r}}(),n=function(){function e(e,t,n){var r,a,i,o,s=0,l=e.length,u=t%m,c=t/m|0;for(e=e.slice();l--;)s=((a=u*(i=e[l]%m)+(r=c*i+(o=e[l]/m|0)*u)%m*m+s)/n|0)+(r/m|0)+c*o,e[l]=a%n;return s&&(e=[s].concat(e)),e}function t(e,t,n,r){var a,i;if(n!=r)i=r<n?1:-1;else for(a=i=0;a<n;a++)if(e[a]!=t[a]){i=e[a]>t[a]?1:-1;break}return i}function n(e,t,n,r){for(var a=0;n--;)e[n]-=a,a=e[n]<t[n]?1:0,e[n]=a*r+e[n]-t[n];for(;!e[0]&&1<e.length;e.splice(0,1));}return function(r,a,o,s,c){var d,m,p,f,_,y,g,b,v,w,M,k,L,Y,T,D,S,O=r.s==a.s?1:-1,j=r.c,x=a.c;if(!(j&&j[0]&&x&&x[0]))return new B(r.s&&a.s&&(j?!x||j[0]!=x[0]:x)?j&&0==j[0]||!x?0*O:O/0:NaN);for(v=(b=new B(O)).c=[],O=o+(m=r.e-a.e)+1,c||(c=l,m=h(r.e/u)-h(a.e/u),O=O/u|0),p=0;x[p]==(j[p]||0);p++);if(x[p]>(j[p]||0)&&m--,O<0)v.push(1),f=!0;else{for(Y=j.length,D=x.length,O+=2,1<(_=i(c/(x[p=0]+1)))&&(x=e(x,_,c),j=e(j,_,c),D=x.length,Y=j.length),L=D,M=(w=j.slice(0,D)).length;M<D;w[M++]=0);S=x.slice(),S=[0].concat(S),T=x[0],x[1]>=c/2&&T++;do{if(_=0,(d=t(x,w,D,M))<0){if(k=w[0],D!=M&&(k=k*c+(w[1]||0)),1<(_=i(k/T)))for(c<=_&&(_=c-1),g=(y=e(x,_,c)).length,M=w.length;1==t(y,w,g,M);)_--,n(y,D<g?S:x,g,c),g=y.length,d=1;else 0==_&&(d=_=1),g=(y=x.slice()).length;if(g<M&&(y=[0].concat(y)),n(w,y,M,c),M=w.length,-1==d)for(;t(x,w,D,M)<1;)_++,n(w,D<M?S:x,M,c),M=w.length}else 0===d&&(_++,w=[0]);v[p++]=_,w[0]?w[M++]=j[L]||0:(w=[j[L]],M=1)}while((L++<Y||null!=w[0])&&O--);f=null!=w[0],v[0]||v.splice(0,1)}if(c==l){for(p=1,O=v[0];10<=O;O/=10,p++);V(b,o+(b.e=p+m*u-1)+1,s,f)}else b.e=m,b.r=+f;return b}}(),Y=/^(-?)0([xbo])(?=\w[\w.]*$)/i,T=/^([^.]+)\.$/,D=/^\.([^.]+)$/,S=/^-?(Infinity|NaN)$/,O=/^\s*\+(?=[\w.])|^\s+|\s+$/g,M=function(e,t,n,r){var a,i=n?t:t.replace(O,"");if(S.test(i))e.s=isNaN(i)?null:i<0?-1:1,e.c=e.e=null;else{if(!n&&(i=i.replace(Y,(function(e,t,n){return a="x"==(n=n.toLowerCase())?16:"b"==n?2:8,r&&r!=a?e:t})),r&&(a=r,i=i.replace(T,"$1").replace(D,"0.$1")),t!=i))return new B(i,a);if(B.DEBUG)throw Error(o+"Not a"+(r?" base "+r:"")+" number: "+t);e.c=e.e=e.s=null}},j.absoluteValue=j.abs=function(){var e=new B(this);return e.s<0&&(e.s=1),e},j.comparedTo=function(e,t){return _(this,new B(e,t))},j.decimalPlaces=j.dp=function(e,t){var n,r,a;if(null!=e)return y(e,0,p),null==t?t=C:y(t,0,8),V(new B(this),e+this.e+1,t);if(!(n=this.c))return null;if(r=((a=n.length-1)-h(this.e/u))*u,a=n[a])for(;a%10==0;a/=10,r--);return r<0&&(r=0),r},j.dividedBy=j.div=function(e,t){return n(this,new B(e,t),E,C)},j.dividedToIntegerBy=j.idiv=function(e,t){return n(this,new B(e,t),0,1)},j.exponentiatedBy=j.pow=function(e,t){var n,r,s,l,c,d,m,p,h=this;if((e=new B(e)).c&&!e.isInteger())throw Error(o+"Exponent not an integer: "+G(e));if(null!=t&&(t=new B(t)),c=14<e.e,!h.c||!h.c[0]||1==h.c[0]&&!h.e&&1==h.c.length||!e.c||!e.c[0])return p=new B(Math.pow(+G(h),c?2-g(e):+G(e))),t?p.mod(t):p;if(d=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new B(NaN);(r=!d&&h.isInteger()&&t.isInteger())&&(h=h.mod(t))}else{if(9<e.e&&(0<h.e||h.e<-1||(0==h.e?1<h.c[0]||c&&24e7<=h.c[1]:h.c[0]<8e13||c&&h.c[0]<=9999975e7)))return l=h.s<0&&g(e)?-0:0,-1<h.e&&(l=1/l),new B(d?1/l:l);R&&(l=a(R/u+2))}for(m=c?(n=new B(.5),d&&(e.s=1),g(e)):(s=Math.abs(+G(e)))%2,p=new B(x);;){if(m){if(!(p=p.times(h)).c)break;l?p.c.length>l&&(p.c.length=l):r&&(p=p.mod(t))}if(s){if(0===(s=i(s/2)))break;m=s%2}else if(V(e=e.times(n),e.e+1,1),14<e.e)m=g(e);else{if(0==(s=+G(e)))break;m=s%2}h=h.times(h),l?h.c&&h.c.length>l&&(h.c.length=l):r&&(h=h.mod(t))}return r?p:(d&&(p=x.div(p)),t?p.mod(t):l?V(p,R,C,void 0):p)},j.integerValue=function(e){var t=new B(this);return null==e?e=C:y(e,0,8),V(t,t.e+1,e)},j.isEqualTo=j.eq=function(e,t){return 0===_(this,new B(e,t))},j.isFinite=function(){return!!this.c},j.isGreaterThan=j.gt=function(e,t){return 0<_(this,new B(e,t))},j.isGreaterThanOrEqualTo=j.gte=function(e,t){return 1===(t=_(this,new B(e,t)))||0===t},j.isInteger=function(){return!!this.c&&h(this.e/u)>this.c.length-2},j.isLessThan=j.lt=function(e,t){return _(this,new B(e,t))<0},j.isLessThanOrEqualTo=j.lte=function(e,t){return-1===(t=_(this,new B(e,t)))||0===t},j.isNaN=function(){return!this.s},j.isNegative=function(){return this.s<0},j.isPositive=function(){return 0<this.s},j.isZero=function(){return!!this.c&&0==this.c[0]},j.minus=function(e,t){var n,r,a,i,o=this,s=o.s;if(t=(e=new B(e,t)).s,!s||!t)return new B(NaN);if(s!=t)return e.s=-t,o.plus(e);var c=o.e/u,d=e.e/u,m=o.c,p=e.c;if(!c||!d){if(!m||!p)return m?(e.s=-t,e):new B(p?o:NaN);if(!m[0]||!p[0])return p[0]?(e.s=-t,e):new B(m[0]?o:3==C?-0:0)}if(c=h(c),d=h(d),m=m.slice(),s=c-d){for((a=(i=s<0)?(s=-s,m):(d=c,p)).reverse(),t=s;t--;a.push(0));a.reverse()}else for(r=(i=(s=m.length)<(t=p.length))?s:t,s=t=0;t<r;t++)if(m[t]!=p[t]){i=m[t]<p[t];break}if(i&&(a=m,m=p,p=a,e.s=-e.s),0<(t=(r=p.length)-(n=m.length)))for(;t--;m[n++]=0);for(t=l-1;s<r;){if(m[--r]<p[r]){for(n=r;n&&!m[--n];m[n]=t);--m[n],m[r]+=l}m[r]-=p[r]}for(;0==m[0];m.splice(0,1),--d);return m[0]?q(e,m,d):(e.s=3==C?-1:1,e.c=[e.e=0],e)},j.modulo=j.mod=function(e,t){var r,a,i=this;return e=new B(e,t),!i.c||!e.s||e.c&&!e.c[0]?new B(NaN):!e.c||i.c&&!i.c[0]?new B(i):(9==F?(a=e.s,e.s=1,r=n(i,e,0,3),e.s=a,r.s*=a):r=n(i,e,0,F),(e=i.minus(r.times(e))).c[0]||1!=F||(e.s=i.s),e)},j.multipliedBy=j.times=function(e,t){var n,r,a,i,o,s,c,d,p,f,_,y,g,b,v,w=this,M=w.c,k=(e=new B(e,t)).c;if(!(M&&k&&M[0]&&k[0]))return!w.s||!e.s||M&&!M[0]&&!k||k&&!k[0]&&!M?e.c=e.e=e.s=null:(e.s*=w.s,M&&k?(e.c=[0],e.e=0):e.c=e.e=null),e;for(r=h(w.e/u)+h(e.e/u),e.s*=w.s,(c=M.length)<(f=k.length)&&(g=M,M=k,k=g,a=c,c=f,f=a),a=c+f,g=[];a--;g.push(0));for(b=l,v=m,a=f;0<=--a;){for(n=0,_=k[a]%v,y=k[a]/v|0,i=a+(o=c);a<i;)n=((d=_*(d=M[--o]%v)+(s=y*d+(p=M[o]/v|0)*_)%v*v+g[i]+n)/b|0)+(s/v|0)+y*p,g[i--]=d%b;g[i]=n}return n?++r:g.splice(0,1),q(e,g,r)},j.negated=function(){var e=new B(this);return e.s=-e.s||null,e},j.plus=function(e,t){var n,r=this,a=r.s;if(t=(e=new B(e,t)).s,!a||!t)return new B(NaN);if(a!=t)return e.s=-t,r.minus(e);var i=r.e/u,o=e.e/u,s=r.c,c=e.c;if(!i||!o){if(!s||!c)return new B(a/0);if(!s[0]||!c[0])return c[0]?e:new B(s[0]?r:0*a)}if(i=h(i),o=h(o),s=s.slice(),a=i-o){for((n=0<a?(o=i,c):(a=-a,s)).reverse();a--;n.push(0));n.reverse()}for((a=s.length)-(t=c.length)<0&&(n=c,c=s,s=n,t=a),a=0;t;)a=(s[--t]=s[t]+c[t]+a)/l|0,s[t]=l===s[t]?0:s[t]%l;return a&&(s=[a].concat(s),++o),q(e,s,o)},j.precision=j.sd=function(e,t){var n,r,a;if(null!=e&&e!==!!e)return y(e,1,p),null==t?t=C:y(t,0,8),V(new B(this),e,t);if(!(n=this.c))return null;if(r=(a=n.length-1)*u+1,a=n[a]){for(;a%10==0;a/=10,r--);for(a=n[0];10<=a;a/=10,r++);}return e&&this.e+1>r&&(r=this.e+1),r},j.shiftedBy=function(e){return y(e,-c,c),this.times("1e"+e)},j.squareRoot=j.sqrt=function(){var e,t,r,a,i,o=this,s=o.c,l=o.s,u=o.e,c=E+4,d=new B("0.5");if(1!==l||!s||!s[0])return new B(!l||l<0&&(!s||s[0])?NaN:s?o:1/0);if((r=0==(l=Math.sqrt(+G(o)))||l==1/0?(((t=f(s)).length+u)%2==0&&(t+="0"),l=Math.sqrt(+t),u=h((u+1)/2)-(u<0||u%2),new B(t=l==1/0?"1e"+u:(t=l.toExponential()).slice(0,t.indexOf("e")+1)+u)):new B(l+"")).c[0])for((l=(u=r.e)+c)<3&&(l=0);;)if(i=r,r=d.times(i.plus(n(o,i,c,1))),f(i.c).slice(0,l)===(t=f(r.c)).slice(0,l)){if(r.e<u&&--l,"9999"!=(t=t.slice(l-3,l+1))&&(a||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(V(r,r.e+E+2,1),e=!r.times(r).eq(o));break}if(!a&&(V(i,i.e+E+2,0),i.times(i).eq(o))){r=i;break}c+=4,l+=4,a=1}return V(r,r.e+E+1,C,e)},j.toExponential=function(e,t){return null!=e&&(y(e,0,p),e++),J(this,e,t,1)},j.toFixed=function(e,t){return null!=e&&(y(e,0,p),e=e+this.e+1),J(this,e,t)},j.toFormat=function(e,t,n){var r;if(null==n)null!=e&&t&&"object"==typeof t?(n=t,t=null):e&&"object"==typeof e?(n=e,e=t=null):n=W;else if("object"!=typeof n)throw Error(o+"Argument not an object: "+n);if(r=this.toFixed(e,t),this.c){var a,i=r.split("."),s=+n.groupSize,l=+n.secondaryGroupSize,u=n.groupSeparator||"",c=i[0],d=i[1],m=this.s<0,p=m?c.slice(1):c,h=p.length;if(l&&(a=s,s=l,h-=l=a),0<s&&0<h){for(a=h%s||s,c=p.substr(0,a);a<h;a+=s)c+=u+p.substr(a,s);0<l&&(c+=u+p.slice(a)),m&&(c="-"+c)}r=d?c+(n.decimalSeparator||"")+((l=+n.fractionGroupSize)?d.replace(new RegExp("\\d{"+l+"}\\B","g"),"$&"+(n.fractionGroupSeparator||"")):d):c}return(n.prefix||"")+r+(n.suffix||"")},j.toFraction=function(e){var t,r,a,i,s,l,c,m,p,h,_,y,g=this,b=g.c;if(null!=e&&(!(c=new B(e)).isInteger()&&(c.c||1!==c.s)||c.lt(x)))throw Error(o+"Argument "+(c.isInteger()?"out of range: ":"not an integer: ")+G(c));if(!b)return new B(g);for(t=new B(x),p=r=new B(x),a=m=new B(x),y=f(b),s=t.e=y.length-g.e-1,t.c[0]=d[(l=s%u)<0?u+l:l],e=!e||0<c.comparedTo(t)?0<s?t:p:c,l=A,A=1/0,c=new B(y),m.c[0]=0;h=n(c,t,0,1),1!=(i=r.plus(h.times(a))).comparedTo(e);)r=a,a=i,p=m.plus(h.times(i=p)),m=i,t=c.minus(h.times(i=t)),c=i;return i=n(e.minus(r),a,0,1),m=m.plus(i.times(p)),r=r.plus(i.times(a)),m.s=p.s=g.s,_=n(p,a,s*=2,C).minus(g).abs().comparedTo(n(m,r,s,C).minus(g).abs())<1?[p,a]:[m,r],A=l,_},j.toNumber=function(){return+G(this)},j.toPrecision=function(e,t){return null!=e&&y(e,1,p),J(this,e,t,2)},j.toString=function(e){var t,n=this,r=n.s,a=n.e;return null===a?r?(t="Infinity",r<0&&(t="-"+t)):t="NaN":(t=null==e?a<=P||H<=a?b(f(n.c),a):v(f(n.c),a,"0"):10===e?v(f((n=V(new B(n),E+a+1,C)).c),n.e,"0"):(y(e,2,I.length,"Base"),w(v(f(n.c),a,"0"),10,e,r,!0)),r<0&&n.c[0]&&(t="-"+t)),t},j.valueOf=j.toJSON=function(){return G(this)},j._isBigNumber=!0,"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator&&(j[Symbol.toStringTag]="BigNumber",j[Symbol.for("nodejs.util.inspect.custom")]=j.valueOf),null!=t&&B.set(t),B}()).default=n.BigNumber=n,void 0!==t&&t.exports?t.exports=n:(e||(e="undefined"!=typeof self&&self?self:window),e.BigNumber=n)}(this)},{}],2:[function(e,t,n){"use strict";t.exports={languageTag:"en-US",delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},spaceSeparated:!1,ordinal:function(e){var t=e%10;return 1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th"},currency:{symbol:"$",position:"prefix",code:"USD"},currencyFormat:{thousandSeparated:!0,totalLength:4,spaceSeparated:!0},formats:{fourDigits:{totalLength:4,spaceSeparated:!0},fullWithTwoDecimals:{output:"currency",thousandSeparated:!0,mantissa:2},fullWithTwoDecimalsNoCurrency:{thousandSeparated:!0,mantissa:2},fullWithNoDecimals:{output:"currency",thousandSeparated:!0,mantissa:0}}}},{}],3:[function(e,t,n){"use strict";function r(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],r=!0,a=!1,i=void 0;try{for(var o,s=e[Symbol.iterator]();!(r=(o=s.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){a=!0,i=e}finally{try{r||null==s.return||s.return()}finally{if(a)throw i}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var a=e("./globalState"),i=e("./validating"),o=e("./parsing"),s=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],l={general:{scale:1024,suffixes:s,marker:"bd"},binary:{scale:1024,suffixes:["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],marker:"b"},decimal:{scale:1e3,suffixes:s,marker:"d"}},u={totalLength:0,characteristic:0,forceAverage:!1,average:!1,mantissa:-1,optionalMantissa:!0,thousandSeparated:!1,spaceSeparated:!1,negative:"sign",forceSign:!1};function c(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},n=2<arguments.length?arguments[2]:void 0;if("string"==typeof t&&(t=o.parseFormat(t)),!i.validateFormat(t))return"ERROR: invalid format";var r=t.prefix||"",s=t.postfix||"",c=function(e,t,n){switch(t.output){case"currency":return function(e,t,n){var r=n.currentCurrency(),a=Object.assign({},u,t),i=void 0,o="",s=!!a.totalLength||!!a.forceAverage||a.average,l=t.currencyPosition||r.position,c=t.currencySymbol||r.symbol;a.spaceSeparated&&(o=" "),"infix"===l&&(i=o+c+o);var d=h({instance:e,providedFormat:t,state:n,decimalSeparator:i});return"prefix"===l&&(d=e._value<0&&"sign"===a.negative?"-".concat(o).concat(c).concat(d.slice(1)):c+o+d),l&&"postfix"!==l||(d=d+(o=s?"":o)+c),d}(e,t=f(t,a.currentCurrencyDefaultFormat()),a);case"percent":return function(e,t,n,r){var a=t.prefixSymbol,i=h({instance:r(100*e._value),providedFormat:t,state:n}),o=Object.assign({},u,t);return a?"%".concat(o.spaceSeparated?" ":"").concat(i):"".concat(i).concat(o.spaceSeparated?" ":"","%")}(e,t=f(t,a.currentPercentageDefaultFormat()),a,n);case"byte":return t=f(t,a.currentByteDefaultFormat()),v=e,M=a,k=n,L=(w=t).base||"binary",Y=l[L],D=(T=d(v._value,Y.suffixes,Y.scale)).value,S=T.suffix,O=h({instance:k(D),providedFormat:w,state:M,defaults:M.currentByteDefaultFormat()}),j=M.currentAbbreviations(),"".concat(O).concat(j.spaced?" ":"").concat(S);case"time":return t=f(t,a.currentTimeDefaultFormat()),_=e,y=Math.floor(_._value/60/60),g=Math.floor((_._value-60*y*60)/60),b=Math.round(_._value-60*y*60-60*g),"".concat(y,":").concat(g<10?"0":"").concat(g,":").concat(b<10?"0":"").concat(b);case"ordinal":return r=e,i=t=f(t,a.currentOrdinalDefaultFormat()),s=(o=a).currentOrdinal(),c=Object.assign({},u,i),m=h({instance:r,providedFormat:i,state:o}),p=s(r._value),"".concat(m).concat(c.spaceSeparated?" ":"").concat(p);case"number":default:return h({instance:e,providedFormat:t,numbro:n})}var r,i,o,s,c,m,p,_,y,g,b,v,w,M,k,L,Y,T,D,S,O,j}(e,t,n);return(c=r+c)+s}function d(e,t,n){var r=t[0],a=Math.abs(e);if(n<=a){for(var i=1;i<t.length;++i){var o=Math.pow(n,i),s=Math.pow(n,i+1);if(o<=a&&a<s){r=t[i],e/=o;break}}r===t[0]&&(e/=Math.pow(n,t.length-1),r=t[t.length-1])}return{value:e,suffix:r}}function m(e){for(var t="",n=0;n<e;n++)t+="0";return t}function p(e,t){return-1!==e.toString().indexOf("e")?function(e,t){var n=e.toString(),a=r(n.split("e"),2),i=a[0],o=a[1],s=r(i.split("."),2),l=s[0],u=s[1],c=void 0===u?"":u;if(0<+o)n=l+c+m(o-c.length);else{var d=".";d=+l<0?"-0".concat(d):"0".concat(d);var p=(m(-o-1)+Math.abs(l)+c).substr(0,t);p.length<t&&(p+=m(t-p.length)),n=d+p}return 0<+o&&0<t&&(n+=".".concat(m(t))),n}(e,t):(Math.round(+"".concat(e,"e+").concat(t))/Math.pow(10,t)).toFixed(t)}function h(e){var t=e.instance,n=e.providedFormat,i=e.state,o=void 0===i?a:i,s=e.decimalSeparator,l=e.defaults,c=void 0===l?o.currentDefaults():l,d=t._value;if(0===d&&o.hasZeroFormat())return o.getZeroFormat();if(!isFinite(d))return d.toString();var m,h,f,_,y,g,b,v,w=Object.assign({},u,c,n),M=w.totalLength,k=M?0:w.characteristic,L=w.optionalCharacteristic,Y=w.forceAverage,T=!!M||!!Y||w.average,D=M?-1:T&&void 0===n.mantissa?0:w.mantissa,S=!M&&(void 0===n.optionalMantissa?-1===D:w.optionalMantissa),O=w.trimMantissa,j=w.thousandSeparated,x=w.spaceSeparated,E=w.negative,C=w.forceSign,P=w.exponential,H="";if(T){var z=function(e){var t=e.value,n=e.forceAverage,r=e.abbreviations,a=e.spaceSeparated,i=void 0!==a&&a,o=e.totalLength,s=void 0===o?0:o,l="",u=Math.abs(t),c=-1;if(u>=Math.pow(10,12)&&!n||"trillion"===n?(l=r.trillion,t/=Math.pow(10,12)):u<Math.pow(10,12)&&u>=Math.pow(10,9)&&!n||"billion"===n?(l=r.billion,t/=Math.pow(10,9)):u<Math.pow(10,9)&&u>=Math.pow(10,6)&&!n||"million"===n?(l=r.million,t/=Math.pow(10,6)):(u<Math.pow(10,6)&&u>=Math.pow(10,3)&&!n||"thousand"===n)&&(l=r.thousand,t/=Math.pow(10,3)),l&&(l=(i?" ":"")+l),s){var d=t.toString().split(".")[0];c=Math.max(s-d.length,0)}return{value:t,abbreviation:l,mantissaPrecision:c}}({value:d,forceAverage:Y,abbreviations:o.currentAbbreviations(),spaceSeparated:x,totalLength:M});d=z.value,H+=z.abbreviation,M&&(D=z.mantissaPrecision)}if(P){var A=(h=(m={value:d,characteristicPrecision:k}).value,_=void 0===(f=m.characteristicPrecision)?0:f,g=(y=r(h.toExponential().split("e"),2))[0],b=y[1],v=+g,_&&1<_&&(v*=Math.pow(10,_-1),b=0<=(b=+b-(_-1))?"+".concat(b):b),{value:v,abbreviation:"e".concat(b)});d=A.value,H=A.abbreviation+H}var N,F,R,W=function(e,t,n,a,i){if(-1===a)return e;var o=p(t,a),s=r(o.toString().split("."),2),l=s[0],u=s[1],c=void 0===u?"":u;if(c.match(/^0+$/)&&(n||i))return l;var d=c.match(/0+$/);return i&&d?"".concat(l,".").concat(c.toString().slice(0,d.index)):o.toString()}(d.toString(),d,S,D,O);return W=function(e,t,n,r,a){var i=r.currentDelimiters(),o=i.thousands;a=a||i.decimal;var s=i.thousandsSize||3,l=e.toString(),u=l.split(".")[0],c=l.split(".")[1];return n&&(t<0&&(u=u.slice(1)),function(e,t){for(var n=[],r=0,a=e;0<a;a--)r===t&&(n.unshift(a),r=0),r++;return n}(u.length,s).forEach((function(e,t){u=u.slice(0,e+t)+o+u.slice(e+t)})),t<0&&(u="-".concat(u))),c?u+a+c:u}(W=function(e,t,n,a){var i=e,o=r(i.toString().split("."),2),s=o[0],l=o[1];if(s.match(/^-?0$/)&&n)return l?"".concat(s.replace("0",""),".").concat(l):s.replace("0","");if(s.length<a)for(var u=a-s.length,c=0;c<u;c++)i="0".concat(i);return i.toString()}(W,0,L,k),d,j,o,s),(T||P)&&(W+=H),(C||d<0)&&(N=W,R=E,W=0===(F=d)?N:0==+N?N.replace("-",""):0<F?"+".concat(N):"sign"===R?N:"(".concat(N.replace("-",""),")")),W}function f(e,t){if(!e)return t;var n=Object.keys(e);return 1===n.length&&"output"===n[0]?t:e}t.exports=function(e){return{format:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return c.apply(void 0,n.concat([e]))},getByteUnit:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var t=l.general;return d(e._value,t.suffixes,t.scale).suffix}.apply(void 0,n.concat([e]))},getBinaryByteUnit:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var t=l.binary;return d(e._value,t.suffixes,t.scale).suffix}.apply(void 0,n.concat([e]))},getDecimalByteUnit:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var t=l.decimal;return d(e._value,t.suffixes,t.scale).suffix}.apply(void 0,n.concat([e]))},formatOrDefault:f}}},{"./globalState":4,"./parsing":8,"./validating":10}],4:[function(e,t,n){"use strict";var r=e("./en-US"),a=e("./validating"),i=e("./parsing"),o={},s=void 0,l={},u=null,c={};function d(e){s=e}function m(){return l[s]}o.languages=function(){return Object.assign({},l)},o.currentLanguage=function(){return s},o.currentCurrency=function(){return m().currency},o.currentAbbreviations=function(){return m().abbreviations},o.currentDelimiters=function(){return m().delimiters},o.currentOrdinal=function(){return m().ordinal},o.currentDefaults=function(){return Object.assign({},m().defaults,c)},o.currentOrdinalDefaultFormat=function(){return Object.assign({},o.currentDefaults(),m().ordinalFormat)},o.currentByteDefaultFormat=function(){return Object.assign({},o.currentDefaults(),m().byteFormat)},o.currentPercentageDefaultFormat=function(){return Object.assign({},o.currentDefaults(),m().percentageFormat)},o.currentCurrencyDefaultFormat=function(){return Object.assign({},o.currentDefaults(),m().currencyFormat)},o.currentTimeDefaultFormat=function(){return Object.assign({},o.currentDefaults(),m().timeFormat)},o.setDefaults=function(e){e=i.parseFormat(e),a.validateFormat(e)&&(c=e)},o.getZeroFormat=function(){return u},o.setZeroFormat=function(e){return u="string"==typeof e?e:null},o.hasZeroFormat=function(){return null!==u},o.languageData=function(e){if(e){if(l[e])return l[e];throw new Error('Unknown tag "'.concat(e,'"'))}return m()},o.registerLanguage=function(e){var t=1<arguments.length&&void 0!==arguments[1]&&arguments[1];if(!a.validateLanguage(e))throw new Error("Invalid language data");l[e.languageTag]=e,t&&d(e.languageTag)},o.setLanguage=function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:r.languageTag;if(!l[e]){var n=e.split("-")[0],a=Object.keys(l).find((function(e){return e.split("-")[0]===n}));return l[a]?void d(a):void d(t)}d(e)},o.registerLanguage(r),s=r.languageTag,t.exports=o},{"./en-US":2,"./parsing":8,"./validating":10}],5:[function(e,t,n){"use strict";t.exports=function(t){return{loadLanguagesInNode:function(n){return r=t,void n.forEach((function(t){var n=void 0;try{n=e("../languages/".concat(t))}catch(n){console.error('Unable to load "'.concat(t,'". No matching language file found.'))}n&&r.registerLanguage(n)}));var r}}}},{}],6:[function(e,t,n){"use strict";var r=e("bignumber.js");function a(e,t,n){var a=new r(e._value),i=t;return n.isNumbro(t)&&(i=t._value),i=new r(i),e._value=a.minus(i).toNumber(),e}t.exports=function(e){return{add:function(t,n){return i=n,o=e,s=new r((a=t)._value),l=i,o.isNumbro(i)&&(l=i._value),l=new r(l),a._value=s.plus(l).toNumber(),a;var a,i,o,s,l},subtract:function(t,n){return a(t,n,e)},multiply:function(t,n){return i=n,o=e,s=new r((a=t)._value),l=i,o.isNumbro(i)&&(l=i._value),l=new r(l),a._value=s.times(l).toNumber(),a;var a,i,o,s,l},divide:function(t,n){return i=n,o=e,s=new r((a=t)._value),l=i,o.isNumbro(i)&&(l=i._value),l=new r(l),a._value=s.dividedBy(l).toNumber(),a;var a,i,o,s,l},set:function(t,n){return r=t,i=a=n,e.isNumbro(a)&&(i=a._value),r._value=i,r;var r,a,i},difference:function(t,n){return r=n,a(o=(i=e)(t._value),r,i),Math.abs(o._value);var r,i,o}}}},{"bignumber.js":1}],7:[function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var a=e("./globalState"),i=e("./validating"),o=e("./loading")(p),s=e("./unformatting"),l=e("./formatting")(p),u=e("./manipulating")(p),c=e("./parsing"),d=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._value=t}var t,n;return t=e,(n=[{key:"clone",value:function(){return p(this._value)}},{key:"format",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return l.format(this,e)}},{key:"formatCurrency",value:function(e){return"string"==typeof e&&(e=c.parseFormat(e)),(e=l.formatOrDefault(e,a.currentCurrencyDefaultFormat())).output="currency",l.format(this,e)}},{key:"formatTime",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return e.output="time",l.format(this,e)}},{key:"binaryByteUnits",value:function(){return l.getBinaryByteUnit(this)}},{key:"decimalByteUnits",value:function(){return l.getDecimalByteUnit(this)}},{key:"byteUnits",value:function(){return l.getByteUnit(this)}},{key:"difference",value:function(e){return u.difference(this,e)}},{key:"add",value:function(e){return u.add(this,e)}},{key:"subtract",value:function(e){return u.subtract(this,e)}},{key:"multiply",value:function(e){return u.multiply(this,e)}},{key:"divide",value:function(e){return u.divide(this,e)}},{key:"set",value:function(e){return u.set(this,m(e))}},{key:"value",value:function(){return this._value}},{key:"valueOf",value:function(){return this._value}}])&&r(t.prototype,n),e}();function m(e){var t=e;return p.isNumbro(e)?t=e._value:"string"==typeof e?t=p.unformat(e):isNaN(e)&&(t=NaN),t}function p(e){return new d(m(e))}p.version="2.1.2",p.isNumbro=function(e){return e instanceof d},p.language=a.currentLanguage,p.registerLanguage=a.registerLanguage,p.setLanguage=a.setLanguage,p.languages=a.languages,p.languageData=a.languageData,p.zeroFormat=a.setZeroFormat,p.defaultFormat=a.currentDefaults,p.setDefaults=a.setDefaults,p.defaultCurrencyFormat=a.currentCurrencyDefaultFormat,p.validate=i.validate,p.loadLanguagesInNode=o.loadLanguagesInNode,p.unformat=s.unformat,t.exports=p},{"./formatting":3,"./globalState":4,"./loading":5,"./manipulating":6,"./parsing":8,"./unformatting":9,"./validating":10}],8:[function(e,t,n){"use strict";t.exports={parseFormat:function(e){var t,n,r,a,i,o,s,l,u,c,d,m,p,h,f,_,y,g,b,v,w=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return"string"!=typeof e?e:(n=w,i=w,function(e,t){if(-1===e.indexOf("$")){if(-1===e.indexOf("%"))return-1!==e.indexOf("bd")?(t.output="byte",t.base="general"):-1!==e.indexOf("b")?(t.output="byte",t.base="binary"):-1!==e.indexOf("d")?(t.output="byte",t.base="decimal"):-1===e.indexOf(":")?-1!==e.indexOf("o")&&(t.output="ordinal"):t.output="time";t.output="percent"}else t.output="currency"}(e=(o=(a=e=(r=(t=e).match(/^{([^}]*)}/))?(n.prefix=r[1],t.slice(r[0].length)):t).match(/{([^}]*)}$/))?(i.postfix=o[1],a.slice(0,-o[0].length)):a,w),s=w,(l=e.match(/[1-9]+[0-9]*/))&&(s.totalLength=+l[0]),u=w,(c=e.split(".")[0].match(/0+/))&&(u.characteristic=c[0].length),function(e,t){if(-1!==e.indexOf(".")){var n=e.split(".")[0];t.optionalCharacteristic=-1===n.indexOf("0")}}(e,w),d=w,-1!==e.indexOf("a")&&(d.average=!0),p=w,-1!==(m=e).indexOf("K")?p.forceAverage="thousand":-1!==m.indexOf("M")?p.forceAverage="million":-1!==m.indexOf("B")?p.forceAverage="billion":-1!==m.indexOf("T")&&(p.forceAverage="trillion"),function(e,t){var n=e.split(".")[1];if(n){var r=n.match(/0+/);r&&(t.mantissa=r[0].length)}}(e,w),f=w,(h=e).match(/\[\.]/)?f.optionalMantissa=!0:h.match(/\./)&&(f.optionalMantissa=!1),_=w,-1!==e.indexOf(",")&&(_.thousandSeparated=!0),y=w,-1!==e.indexOf(" ")&&(y.spaceSeparated=!0),b=w,(g=e).match(/^\+?\([^)]*\)$/)&&(b.negative="parenthesis"),g.match(/^\+?-/)&&(b.negative="sign"),v=w,e.match(/^\+/)&&(v.forceSign=!0),w)}}},{}],9:[function(e,t,n){"use strict";var r=[{key:"ZiB",factor:Math.pow(1024,7)},{key:"ZB",factor:Math.pow(1e3,7)},{key:"YiB",factor:Math.pow(1024,8)},{key:"YB",factor:Math.pow(1e3,8)},{key:"TiB",factor:Math.pow(1024,4)},{key:"TB",factor:Math.pow(1e3,4)},{key:"PiB",factor:Math.pow(1024,5)},{key:"PB",factor:Math.pow(1e3,5)},{key:"MiB",factor:Math.pow(1024,2)},{key:"MB",factor:Math.pow(1e3,2)},{key:"KiB",factor:Math.pow(1024,1)},{key:"KB",factor:Math.pow(1e3,1)},{key:"GiB",factor:Math.pow(1024,3)},{key:"GB",factor:Math.pow(1e3,3)},{key:"EiB",factor:Math.pow(1024,6)},{key:"EB",factor:Math.pow(1e3,6)},{key:"B",factor:1}];function a(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}t.exports={unformat:function(t,n){var i,o,s,l=e("./globalState"),u=l.currentDelimiters(),c=l.currentCurrency().symbol,d=l.currentOrdinal(),m=l.getZeroFormat(),p=l.currentAbbreviations(),h=void 0;if("string"==typeof t)h=function(e,t){if(!e.indexOf(":")||":"===t.thousands)return!1;var n=e.split(":");if(3!==n.length)return!1;var r=+n[0],a=+n[1],i=+n[2];return!isNaN(r)&&!isNaN(a)&&!isNaN(i)}(t,u)?(o=+(i=t.split(":"))[0],s=+i[1],+i[2]+60*s+3600*o):function(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:"",i=3<arguments.length?arguments[3]:void 0,o=4<arguments.length?arguments[4]:void 0,s=5<arguments.length?arguments[5]:void 0,l=6<arguments.length?arguments[6]:void 0;if(""!==e)return e===o?0:function e(t,n){var i=2<arguments.length&&void 0!==arguments[2]?arguments[2]:"",o=3<arguments.length?arguments[3]:void 0,s=4<arguments.length?arguments[4]:void 0,l=5<arguments.length?arguments[5]:void 0,u=6<arguments.length?arguments[6]:void 0;if(!isNaN(+t))return+t;var c="",d=t.replace(/(^[^(]*)\((.*)\)([^)]*$)/,"$1$2$3");if(d!==t)return-1*e(d,n,i,o,s,l,u);for(var m=0;m<r.length;m++){var p=r[m];if((c=t.replace(p.key,""))!==t)return e(c,n,i,o,s,l,u)*p.factor}if((c=t.replace("%",""))!==t)return e(c,n,i,o,s,l,u)/100;var h=parseFloat(t);if(!isNaN(h)){var f=o(h);if(f&&"."!==f&&(c=t.replace(new RegExp("".concat(a(f),"$")),""))!==t)return e(c,n,i,o,s,l,u);var _={};Object.keys(l).forEach((function(e){_[l[e]]=e}));for(var y=Object.keys(_).sort().reverse(),g=y.length,b=0;b<g;b++){var v=y[b],w=_[v];if((c=t.replace(v,""))!==t){var M=void 0;switch(w){case"thousand":M=Math.pow(10,3);break;case"million":M=Math.pow(10,6);break;case"billion":M=Math.pow(10,9);break;case"trillion":M=Math.pow(10,12)}return e(c,n,i,o,s,l,u)*M}}}}(function(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:"",r=e.replace(n,"");return(r=r.replace(new RegExp("([0-9])".concat(a(t.thousands),"([0-9])"),"g"),"$1$2")).replace(t.decimal,".")}(e,t,n),t,n,i,o,s,l)}(t,u,c,d,m,p,n);else{if("number"!=typeof t)return;h=t}if(void 0!==h)return h}}},{"./globalState":4}],10:[function(e,t,n){"use strict";function r(e){return(r="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)}var a=e("./unformatting"),i=/^[a-z]{2,3}(-[a-zA-Z]{4})?(-([A-Z]{2}|[0-9]{3}))?$/,o={output:{type:"string",validValues:["currency","percent","byte","time","ordinal","number"]},base:{type:"string",validValues:["decimal","binary","general"],restriction:function(e,t){return"byte"===t.output},message:"`base` must be provided only when the output is `byte`",mandatory:function(e){return"byte"===e.output}},characteristic:{type:"number",restriction:function(e){return 0<=e},message:"value must be positive"},prefix:"string",postfix:"string",forceAverage:{type:"string",validValues:["trillion","billion","million","thousand"]},average:"boolean",currencyPosition:{type:"string",validValues:["prefix","infix","postfix"]},currencySymbol:"string",totalLength:{type:"number",restrictions:[{restriction:function(e){return 0<=e},message:"value must be positive"},{restriction:function(e,t){return!t.exponential},message:"`totalLength` is incompatible with `exponential`"}]},mantissa:{type:"number",restriction:function(e){return 0<=e},message:"value must be positive"},optionalMantissa:"boolean",trimMantissa:"boolean",optionalCharacteristic:"boolean",thousandSeparated:"boolean",spaceSeparated:"boolean",abbreviations:{type:"object",children:{thousand:"string",million:"string",billion:"string",trillion:"string"}},negative:{type:"string",validValues:["sign","parenthesis"]},forceSign:"boolean",exponential:{type:"boolean"},prefixSymbol:{type:"boolean",restriction:function(e,t){return"percent"===t.output},message:"`prefixSymbol` can be provided only when the output is `percent`"}},s={languageTag:{type:"string",mandatory:!0,restriction:function(e){return e.match(i)},message:"the language tag must follow the BCP 47 specification (see https://tools.ieft.org/html/bcp47)"},delimiters:{type:"object",children:{thousands:"string",decimal:"string",thousandsSize:"number"},mandatory:!0},abbreviations:{type:"object",children:{thousand:{type:"string",mandatory:!0},million:{type:"string",mandatory:!0},billion:{type:"string",mandatory:!0},trillion:{type:"string",mandatory:!0}},mandatory:!0},spaceSeparated:"boolean",ordinal:{type:"function",mandatory:!0},currency:{type:"object",children:{symbol:"string",position:"string",code:"string"},mandatory:!0},defaults:"format",ordinalFormat:"format",byteFormat:"format",percentageFormat:"format",currencyFormat:"format",timeDefaults:"format",formats:{type:"object",children:{fourDigits:{type:"format",mandatory:!0},fullWithTwoDecimals:{type:"format",mandatory:!0},fullWithTwoDecimalsNoCurrency:{type:"format",mandatory:!0},fullWithNoDecimals:{type:"format",mandatory:!0}}}};function l(e){return!!a.unformat(e)}function u(e,t,n){var a=3<arguments.length&&void 0!==arguments[3]&&arguments[3],i=Object.keys(e).map((function(a){if(!t[a])return console.error("".concat(n," Invalid key: ").concat(a)),!1;var i=e[a],s=t[a];if("string"==typeof s&&(s={type:s}),"format"===s.type){if(!u(i,o,"[Validate ".concat(a,"]"),!0))return!1}else if(r(i)!==s.type)return console.error("".concat(n," ").concat(a,' type mismatched: "').concat(s.type,'" expected, "').concat(r(i),'" provided')),!1;if(s.restrictions&&s.restrictions.length)for(var l=s.restrictions.length,c=0;c<l;c++){var d=s.restrictions[c],m=d.restriction,p=d.message;if(!m(i,e))return console.error("".concat(n," ").concat(a," invalid value: ").concat(p)),!1}return s.restriction&&!s.restriction(i,e)?(console.error("".concat(n," ").concat(a," invalid value: ").concat(s.message)),!1):s.validValues&&-1===s.validValues.indexOf(i)?(console.error("".concat(n," ").concat(a," invalid value: must be among ").concat(JSON.stringify(s.validValues),', "').concat(i,'" provided')),!1):!(s.children&&!u(i,s.children,"[Validate ".concat(a,"]")))}));return a||i.push.apply(i,function(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}(Object.keys(t).map((function(r){var a=t[r];if("string"==typeof a&&(a={type:a}),a.mandatory){var i=a.mandatory;if("function"==typeof i&&(i=i(e)),i&&void 0===e[r])return console.error("".concat(n,' Missing mandatory key "').concat(r,'"')),!1}return!0})))),i.reduce((function(e,t){return e&&t}),!0)}function c(e){return u(e,o,"[Validate format]")}t.exports={validate:function(e,t){var n=l(e),r=c(t);return n&&r},validateFormat:c,validateInput:l,validateLanguage:function(e){return u(e,s,"[Validate language]")}}},{"./unformatting":9}]},{},[7])(7)},function(e,t,n){
59
  /*!
60
  * Pikaday
61
  *
62
  * Copyright © 2014 David Bushell | BSD & MIT license | https://github.com/dbushell/Pikaday
63
  */
64
- !function(t,r){"use strict";var a;try{a=n(0)}catch(e){}e.exports=function(e){var t="function"==typeof e,n=!!window.addEventListener,r=window.document,a=window.setTimeout,i=function(e,t,r,a){n?e.addEventListener(t,r,!!a):e.attachEvent("on"+t,r)},o=function(e,t,r,a){n?e.removeEventListener(t,r,!!a):e.detachEvent("on"+t,r)},s=function(e,t,n){var a;r.createEvent?((a=r.createEvent("HTMLEvents")).initEvent(t,!0,!1),a=_(a,n),e.dispatchEvent(a)):r.createEventObject&&(a=r.createEventObject(),a=_(a,n),e.fireEvent("on"+t,a))},l=function(e,t){return-1!==(" "+e.className+" ").indexOf(" "+t+" ")},u=function(e){return/Array/.test(Object.prototype.toString.call(e))},c=function(e){return/Date/.test(Object.prototype.toString.call(e))&&!isNaN(e.getTime())},d=function(e){var t=e.getDay();return 0===t||6===t},m=function(e){return e%4==0&&e%100!=0||e%400==0},p=function(e,t){return[31,m(e)?29:28,31,30,31,30,31,31,30,31,30,31][t]},h=function(e){c(e)&&e.setHours(0,0,0,0)},f=function(e,t){return e.getTime()===t.getTime()},_=function(e,t,n){var r,a;for(r in t)(a=void 0!==e[r])&&"object"==typeof t[r]&&null!==t[r]&&void 0===t[r].nodeName?c(t[r])?n&&(e[r]=new Date(t[r].getTime())):u(t[r])?n&&(e[r]=t[r].slice(0)):e[r]=_({},t[r],n):!n&&a||(e[r]=t[r]);return e},y=function(e){return e.month<0&&(e.year-=Math.ceil(Math.abs(e.month)/12),e.month+=12),e.month>11&&(e.year+=Math.floor(Math.abs(e.month)/12),e.month-=12),e},g={field:null,bound:void 0,position:"bottom left",reposition:!0,format:"YYYY-MM-DD",defaultDate:null,setDefaultDate:!1,firstDay:0,formatStrict:!1,minDate:null,maxDate:null,yearRange:10,showWeekNumber:!1,minYear:0,maxYear:9999,minMonth:void 0,maxMonth:void 0,startRange:null,endRange:null,isRTL:!1,yearSuffix:"",showMonthAfterYear:!1,showDaysInNextAndPreviousMonths:!1,numberOfMonths:1,mainCalendar:"left",container:void 0,i18n:{previousMonth:"Previous Month",nextMonth:"Next Month",months:["January","February","March","April","May","June","July","August","September","October","November","December"],weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},theme:null,onSelect:null,onOpen:null,onClose:null,onDraw:null},b=function(e,t,n){for(t+=e.firstDay;t>=7;)t-=7;return n?e.i18n.weekdaysShort[t]:e.i18n.weekdays[t]},v=function(e){var t=[],n="false";if(e.isEmpty){if(!e.showDaysInNextAndPreviousMonths)return'<td class="is-empty"></td>';t.push("is-outside-current-month")}return e.isDisabled&&t.push("is-disabled"),e.isToday&&t.push("is-today"),e.isSelected&&(t.push("is-selected"),n="true"),e.isInRange&&t.push("is-inrange"),e.isStartRange&&t.push("is-startrange"),e.isEndRange&&t.push("is-endrange"),'<td data-day="'+e.day+'" class="'+t.join(" ")+'" aria-selected="'+n+'"><button class="pika-button pika-day" type="button" data-pika-year="'+e.year+'" data-pika-month="'+e.month+'" data-pika-day="'+e.day+'">'+e.day+"</button></td>"},w=function(e,t){return"<tr>"+(t?e.reverse():e).join("")+"</tr>"},M=function(e,t,n,r,a,i){var o,s,l,c,d,m=e._o,p=n===m.minYear,h=n===m.maxYear,f='<div id="'+i+'" class="pika-title" role="heading" aria-live="assertive">',_=!0,y=!0;for(l=[],o=0;o<12;o++)l.push('<option value="'+(n===a?o-t:12+o-t)+'"'+(o===r?' selected="selected"':"")+(p&&o<m.minMonth||h&&o>m.maxMonth?'disabled="disabled"':"")+">"+m.i18n.months[o]+"</option>");for(c='<div class="pika-label">'+m.i18n.months[r]+'<select class="pika-select pika-select-month" tabindex="-1">'+l.join("")+"</select></div>",u(m.yearRange)?(o=m.yearRange[0],s=m.yearRange[1]+1):(o=n-m.yearRange,s=1+n+m.yearRange),l=[];o<s&&o<=m.maxYear;o++)o>=m.minYear&&l.push('<option value="'+o+'"'+(o===n?' selected="selected"':"")+">"+o+"</option>");return d='<div class="pika-label">'+n+m.yearSuffix+'<select class="pika-select pika-select-year" tabindex="-1">'+l.join("")+"</select></div>",m.showMonthAfterYear?f+=d+c:f+=c+d,p&&(0===r||m.minMonth>=r)&&(_=!1),h&&(11===r||m.maxMonth<=r)&&(y=!1),0===t&&(f+='<button class="pika-prev'+(_?"":" is-disabled")+'" type="button">'+m.i18n.previousMonth+"</button>"),t===e._o.numberOfMonths-1&&(f+='<button class="pika-next'+(y?"":" is-disabled")+'" type="button">'+m.i18n.nextMonth+"</button>"),f+"</div>"},k=function(o){var s=this,u=s.config(o);s._onMouseDown=function(e){if(s._v){var t=(e=e||window.event).target||e.srcElement;if(t)if(l(t,"is-disabled")||(!l(t,"pika-button")||l(t,"is-empty")||l(t.parentNode,"is-disabled")?l(t,"pika-prev")?s.prevMonth():l(t,"pika-next")&&s.nextMonth():(s.setDate(new Date(t.getAttribute("data-pika-year"),t.getAttribute("data-pika-month"),t.getAttribute("data-pika-day"))),u.bound&&a((function(){s.hide(),u.field&&u.field.blur()}),100))),l(t,"pika-select"))s._c=!0;else{if(!e.preventDefault)return e.returnValue=!1,!1;e.preventDefault()}}},s._onChange=function(e){var t=(e=e||window.event).target||e.srcElement;t&&(l(t,"pika-select-month")?s.gotoMonth(t.value):l(t,"pika-select-year")&&s.gotoYear(t.value))},s._onKeyChange=function(e){if(e=e||window.event,s.isVisible())switch(e.keyCode){case 13:case 27:u.field.blur();break;case 37:e.preventDefault(),s.adjustDate("subtract",1);break;case 38:s.adjustDate("subtract",7);break;case 39:s.adjustDate("add",1);break;case 40:s.adjustDate("add",7)}},s._onInputChange=function(n){var r;n.firedBy!==s&&(r=t?(r=e(u.field.value,u.format,u.formatStrict))&&r.isValid()?r.toDate():null:new Date(Date.parse(u.field.value)),c(r)&&s.setDate(r),s._v||s.show())},s._onInputFocus=function(){s.show()},s._onInputClick=function(){s.show()},s._onInputBlur=function(){var e=r.activeElement;do{if(l(e,"pika-single"))return}while(e=e.parentNode);s._c||(s._b=a((function(){s.hide()}),50)),s._c=!1},s._onClick=function(e){var t=(e=e||window.event).target||e.srcElement,r=t;if(t){!n&&l(t,"pika-select")&&(t.onchange||(t.setAttribute("onchange","return;"),i(t,"change",s._onChange)));do{if(l(r,"pika-single")||r===u.trigger)return}while(r=r.parentNode);s._v&&t!==u.trigger&&r!==u.trigger&&s.hide()}},s.el=r.createElement("div"),s.el.className="pika-single"+(u.isRTL?" is-rtl":"")+(u.theme?" "+u.theme:""),i(s.el,"mousedown",s._onMouseDown,!0),i(s.el,"touchend",s._onMouseDown,!0),i(s.el,"change",s._onChange),i(r,"keydown",s._onKeyChange),u.field&&(u.container?u.container.appendChild(s.el):u.bound?r.body.appendChild(s.el):u.field.parentNode.insertBefore(s.el,u.field.nextSibling),i(u.field,"change",s._onInputChange),u.defaultDate||(t&&u.field.value?u.defaultDate=e(u.field.value,u.format).toDate():u.defaultDate=new Date(Date.parse(u.field.value)),u.setDefaultDate=!0));var d=u.defaultDate;c(d)?u.setDefaultDate?s.setDate(d,!0):s.gotoDate(d):s.gotoDate(new Date),u.bound?(this.hide(),s.el.className+=" is-bound",i(u.trigger,"click",s._onInputClick),i(u.trigger,"focus",s._onInputFocus),i(u.trigger,"blur",s._onInputBlur)):this.show()};return k.prototype={config:function(e){this._o||(this._o=_({},g,!0));var t=_(this._o,e,!0);t.isRTL=!!t.isRTL,t.field=t.field&&t.field.nodeName?t.field:null,t.theme="string"==typeof t.theme&&t.theme?t.theme:null,t.bound=!!(void 0!==t.bound?t.field&&t.bound:t.field),t.trigger=t.trigger&&t.trigger.nodeName?t.trigger:t.field,t.disableWeekends=!!t.disableWeekends,t.disableDayFn="function"==typeof t.disableDayFn?t.disableDayFn:null;var n=parseInt(t.numberOfMonths,10)||1;if(t.numberOfMonths=n>4?4:n,c(t.minDate)||(t.minDate=!1),c(t.maxDate)||(t.maxDate=!1),t.minDate&&t.maxDate&&t.maxDate<t.minDate&&(t.maxDate=t.minDate=!1),t.minDate&&this.setMinDate(t.minDate),t.maxDate&&this.setMaxDate(t.maxDate),u(t.yearRange)){var r=(new Date).getFullYear()-10;t.yearRange[0]=parseInt(t.yearRange[0],10)||r,t.yearRange[1]=parseInt(t.yearRange[1],10)||r}else t.yearRange=Math.abs(parseInt(t.yearRange,10))||g.yearRange,t.yearRange>100&&(t.yearRange=100);return t},toString:function(n){return c(this._d)?t?e(this._d).format(n||this._o.format):this._d.toDateString():""},getMoment:function(){return t?e(this._d):null},setMoment:function(n,r){t&&e.isMoment(n)&&this.setDate(n.toDate(),r)},getDate:function(){return c(this._d)?new Date(this._d.getTime()):new Date},setDate:function(e,t){if(!e)return this._d=null,this._o.field&&(this._o.field.value="",s(this._o.field,"change",{firedBy:this})),this.draw();if("string"==typeof e&&(e=new Date(Date.parse(e))),c(e)){var n=this._o.minDate,r=this._o.maxDate;c(n)&&e<n?e=n:c(r)&&e>r&&(e=r),this._d=new Date(e.getTime()),h(this._d),this.gotoDate(this._d),this._o.field&&(this._o.field.value=this.toString(),s(this._o.field,"change",{firedBy:this})),t||"function"!=typeof this._o.onSelect||this._o.onSelect.call(this,this.getDate())}},gotoDate:function(e){var t=!0;if(c(e)){if(this.calendars){var n=new Date(this.calendars[0].year,this.calendars[0].month,1),r=new Date(this.calendars[this.calendars.length-1].year,this.calendars[this.calendars.length-1].month,1),a=e.getTime();r.setMonth(r.getMonth()+1),r.setDate(r.getDate()-1),t=a<n.getTime()||r.getTime()<a}t&&(this.calendars=[{month:e.getMonth(),year:e.getFullYear()}],"right"===this._o.mainCalendar&&(this.calendars[0].month+=1-this._o.numberOfMonths)),this.adjustCalendars()}},adjustDate:function(n,r){var a,i=this.getDate(),o=24*parseInt(r)*60*60*1e3;"add"===n?a=new Date(i.valueOf()+o):"subtract"===n&&(a=new Date(i.valueOf()-o)),t&&("add"===n?a=e(i).add(r,"days").toDate():"subtract"===n&&(a=e(i).subtract(r,"days").toDate())),this.setDate(a)},adjustCalendars:function(){this.calendars[0]=y(this.calendars[0]);for(var e=1;e<this._o.numberOfMonths;e++)this.calendars[e]=y({month:this.calendars[0].month+e,year:this.calendars[0].year});this.draw()},gotoToday:function(){this.gotoDate(new Date)},gotoMonth:function(e){isNaN(e)||(this.calendars[0].month=parseInt(e,10),this.adjustCalendars())},nextMonth:function(){this.calendars[0].month++,this.adjustCalendars()},prevMonth:function(){this.calendars[0].month--,this.adjustCalendars()},gotoYear:function(e){isNaN(e)||(this.calendars[0].year=parseInt(e,10),this.adjustCalendars())},setMinDate:function(e){e instanceof Date?(h(e),this._o.minDate=e,this._o.minYear=e.getFullYear(),this._o.minMonth=e.getMonth()):(this._o.minDate=g.minDate,this._o.minYear=g.minYear,this._o.minMonth=g.minMonth,this._o.startRange=g.startRange),this.draw()},setMaxDate:function(e){e instanceof Date?(h(e),this._o.maxDate=e,this._o.maxYear=e.getFullYear(),this._o.maxMonth=e.getMonth()):(this._o.maxDate=g.maxDate,this._o.maxYear=g.maxYear,this._o.maxMonth=g.maxMonth,this._o.endRange=g.endRange),this.draw()},setStartRange:function(e){this._o.startRange=e},setEndRange:function(e){this._o.endRange=e},draw:function(e){if(this._v||e){var t,n=this._o,r=n.minYear,i=n.maxYear,o=n.minMonth,s=n.maxMonth,l="";this._y<=r&&(this._y=r,!isNaN(o)&&this._m<o&&(this._m=o)),this._y>=i&&(this._y=i,!isNaN(s)&&this._m>s&&(this._m=s)),t="pika-title-"+Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,2);for(var u=0;u<n.numberOfMonths;u++)l+='<div class="pika-lendar">'+M(this,u,this.calendars[u].year,this.calendars[u].month,this.calendars[0].year,t)+this.render(this.calendars[u].year,this.calendars[u].month,t)+"</div>";this.el.innerHTML=l,n.bound&&"hidden"!==n.field.type&&a((function(){n.trigger.focus()}),1),"function"==typeof this._o.onDraw&&this._o.onDraw(this),n.bound&&n.field.setAttribute("aria-label","Use the arrow keys to pick a date")}},adjustPosition:function(){var e,t,n,a,i,o,s,l,u,c;if(!this._o.container){if(this.el.style.position="absolute",t=e=this._o.trigger,n=this.el.offsetWidth,a=this.el.offsetHeight,i=window.innerWidth||r.documentElement.clientWidth,o=window.innerHeight||r.documentElement.clientHeight,s=window.pageYOffset||r.body.scrollTop||r.documentElement.scrollTop,"function"==typeof e.getBoundingClientRect)l=(c=e.getBoundingClientRect()).left+window.pageXOffset,u=c.bottom+window.pageYOffset;else for(l=t.offsetLeft,u=t.offsetTop+t.offsetHeight;t=t.offsetParent;)l+=t.offsetLeft,u+=t.offsetTop;(this._o.reposition&&l+n>i||this._o.position.indexOf("right")>-1&&l-n+e.offsetWidth>0)&&(l=l-n+e.offsetWidth),(this._o.reposition&&u+a>o+s||this._o.position.indexOf("top")>-1&&u-a-e.offsetHeight>0)&&(u=u-a-e.offsetHeight),this.el.style.left=l+"px",this.el.style.top=u+"px"}},render:function(e,t,n){var r=this._o,a=new Date,i=p(e,t),o=new Date(e,t,1).getDay(),s=[],l=[];h(a),r.firstDay>0&&(o-=r.firstDay)<0&&(o+=7);for(var u,m,_,y,g=0===t?11:t-1,M=11===t?0:t+1,k=0===t?e-1:e,L=11===t?e+1:e,Y=p(k,g),T=i+o,D=T;D>7;)D-=7;T+=7-D;for(var S=0,O=0;S<T;S++){var j=new Date(e,t,S-o+1),x=!!c(this._d)&&f(j,this._d),E=f(j,a),C=S<o||S>=i+o,P=S-o+1,H=t,z=e,A=r.startRange&&f(r.startRange,j),N=r.endRange&&f(r.endRange,j),F=r.startRange&&r.endRange&&r.startRange<j&&j<r.endRange;C&&(S<o?(P=Y+P,H=g,z=k):(P-=i,H=M,z=L));var R={day:P,month:H,year:z,isSelected:x,isToday:E,isDisabled:r.minDate&&j<r.minDate||r.maxDate&&j>r.maxDate||r.disableWeekends&&d(j)||r.disableDayFn&&r.disableDayFn(j),isEmpty:C,isStartRange:A,isEndRange:N,isInRange:F,showDaysInNextAndPreviousMonths:r.showDaysInNextAndPreviousMonths};l.push(v(R)),7==++O&&(r.showWeekNumber&&l.unshift((u=S-o,m=t,_=e,y=void 0,void 0,y=new Date(_,0,1),'<td class="pika-week">'+Math.ceil(((new Date(_,m,u)-y)/864e5+y.getDay()+1)/7)+"</td>")),s.push(w(l,r.isRTL)),l=[],O=0)}return function(e,t,n){return'<table cellpadding="0" cellspacing="0" class="pika-table" role="grid" aria-labelledby="'+n+'">'+function(e){var t,n=[];e.showWeekNumber&&n.push("<th></th>");for(t=0;t<7;t++)n.push('<th scope="col"><abbr title="'+b(e,t)+'">'+b(e,t,!0)+"</abbr></th>");return"<thead><tr>"+(e.isRTL?n.reverse():n).join("")+"</tr></thead>"}(e)+(r=t,"<tbody>"+r.join("")+"</tbody>")+"</table>";var r}(r,s,n)},isVisible:function(){return this._v},show:function(){var e,t,n;this.isVisible()||(e=this.el,t="is-hidden",e.className=(n=(" "+e.className+" ").replace(" "+t+" "," ")).trim?n.trim():n.replace(/^\s+|\s+$/g,""),this._v=!0,this.draw(),this._o.bound&&(i(r,"click",this._onClick),this.adjustPosition()),"function"==typeof this._o.onOpen&&this._o.onOpen.call(this))},hide:function(){var e,t,n=this._v;!1!==n&&(this._o.bound&&o(r,"click",this._onClick),this.el.style.position="static",this.el.style.left="auto",this.el.style.top="auto",e=this.el,l(e,t="is-hidden")||(e.className=""===e.className?t:e.className+" "+t),this._v=!1,void 0!==n&&"function"==typeof this._o.onClose&&this._o.onClose.call(this))},destroy:function(){this.hide(),o(this.el,"mousedown",this._onMouseDown,!0),o(this.el,"touchend",this._onMouseDown,!0),o(this.el,"change",this._onChange),this._o.field&&(o(this._o.field,"change",this._onInputChange),this._o.bound&&(o(this._o.trigger,"click",this._onInputClick),o(this._o.trigger,"focus",this._onInputFocus),o(this._o.trigger,"blur",this._onInputBlur))),this.el.parentNode&&this.el.parentNode.removeChild(this.el)}},k}(a)}()},,function(e,t,n){},function(e,t,n){"use strict";n.r(t);var r=n(1),a=n.n(r),i=n(129),o=n.n(i),s=function(e,t){return(s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function l(e,t){function n(){this.constructor=e}s(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var u=function(){return(u=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e}).apply(this,arguments)};function c(e,t,n,r){return new(n||(n=Promise))((function(a,i){function o(e){try{l(r.next(e))}catch(e){i(e)}}function s(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){e.done?a(e.value):new n((function(t){t(e.value)})).then(o,s)}l((r=r.apply(e,t||[])).next())}))}function d(e,t){var n,r,a,i,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(a=2&i[0]?r.return:i[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,i[1])).done)return a;switch(r=0,a&&(i=[2&i[0],a.value]),i[0]){case 0:case 1:a=i;break;case 4:return o.label++,{value:i[1],done:!1};case 5:o.label++,r=i[1],i=[0];continue;case 7:i=o.ops.pop(),o.trys.pop();continue;default:if(!(a=(a=o.trys).length>0&&a[a.length-1])&&(6===i[0]||2===i[0])){o=0;continue}if(3===i[0]&&(!a||i[1]>a[0]&&i[1]<a[3])){o.label=i[1];break}if(6===i[0]&&o.label<a[1]){o.label=a[1],a=i;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(i);break}a[2]&&o.ops.pop(),o.trys.pop();continue}i=t.call(e,o)}catch(e){i=[6,e],r=0}finally{n=a=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}var m={graph_id:null,legend_toggle:!1,graphID:null,options:{colors:null},data:null,rows:null,columns:null,diffdata:null,chartEvents:null,legendToggle:!1,chartActions:null,getChartWrapper:function(e,t){},getChartEditor:null,className:"",style:{},formatters:null,spreadSheetUrl:null,spreadSheetQueryParameters:{headers:1,gid:1},rootProps:{},chartWrapperParams:{},controls:null,render:null,toolbarItems:null,toolbarID:null},p=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.handleGoogleChartsLoaderScriptLoaded=function(e){var n=t.props,r=n.chartVersion,a=n.chartPackages,i=n.chartLanguage,o=n.mapsApiKey,s=n.onLoad;e.charts.load(r||"current",{packages:a||["corechart","controls"],language:i||"en",mapsApiKey:o}),e.charts.setOnLoadCallback((function(){s(e)}))},t}return l(t,e),t.prototype.shouldComponentUpdate=function(e){return e.chartPackages===this.props.chartPackages},t.prototype.render=function(){var e=this,t=this.props.onError;return Object(r.createElement)(o.a,{url:"https://www.gstatic.com/charts/loader.js",onError:t,onLoad:function(){var t=window;t.google&&e.handleGoogleChartsLoaderScriptLoaded(t.google)}})},t}(r.Component),h=0,f=function(){return"reactgooglegraph-"+(h+=1)},_=["#3366CC","#DC3912","#FF9900","#109618","#990099","#3B3EAC","#0099C6","#DD4477","#66AA00","#B82E2E","#316395","#994499","#22AA99","#AAAA11","#6633CC","#E67300","#8B0707","#329262","#5574A6","#3B3EAC"],y=function(e,t,n){return void 0===n&&(n={}),c(void 0,void 0,void 0,(function(){return d(this,(function(r){return[2,new Promise((function(r,a){var i=n.headers?"headers="+n.headers:"headers=0",o=n.query?"&tq="+encodeURIComponent(n.query):"",s=n.gid?"&gid="+n.gid:"",l=n.sheet?"&sheet="+n.sheet:"",u=n.access_token?"&access_token="+n.access_token:"",c=t+"/gviz/tq?"+(""+i+s+l+o+u);new e.visualization.Query(c).send((function(e){e.isError()?a("Error in query: "+e.getMessage()+" "+e.getDetailedMessage()):r(e.getDataTable())}))}))]}))}))},g=Object(r.createContext)(m),b=g.Provider,v=g.Consumer,w=function(e){var t=e.children,n=e.value;return Object(r.createElement)(b,{value:n},t)},M=function(e){var t=e.render;return Object(r.createElement)(v,null,(function(e){return t(e)}))},k="#CCCCCC",L=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={hiddenColumns:[]},t.listenToLegendToggle=function(){var e=t.props,n=e.google,r=e.googleChartWrapper;n.visualization.events.addListener(r,"select",(function(){var e=r.getChart().getSelection(),n=r.getDataTable();if(0!==e.length&&null===e[0].row&&null!==n){var a=e[0].column,i=t.getColumnID(n,a);t.state.hiddenColumns.includes(i)?t.setState((function(e){return u({},e,{hiddenColumns:e.hiddenColumns.filter((function(e){return e!==i})).slice()})})):t.setState((function(e){return u({},e,{hiddenColumns:e.hiddenColumns.concat([i])})}))}}))},t.applyFormatters=function(e,n){for(var r=t.props.google,a=0,i=n;a<i.length;a++){var o=i[a];switch(o.type){case"ArrowFormat":(s=new r.visualization.ArrowFormat(o.options)).format(e,o.column);break;case"BarFormat":(s=new r.visualization.BarFormat(o.options)).format(e,o.column);break;case"ColorFormat":for(var s=new r.visualization.ColorFormat(o.options),l=0,u=o.ranges;l<u.length;l++){var c=u[l];s.addRange.apply(s,c)}s.format(e,o.column);break;case"DateFormat":(s=new r.visualization.DateFormat(o.options)).format(e,o.column);break;case"NumberFormat":(s=new r.visualization.NumberFormat(o.options)).format(e,o.column);break;case"PatternFormat":(s=new r.visualization.PatternFormat(o.options)).format(e,o.column)}}},t.getColumnID=function(e,t){return e.getColumnId(t)||e.getColumnLabel(t)},t.draw=function(e){var n=e.data,r=e.diffdata,a=e.rows,i=e.columns,o=e.options,s=e.legend_toggle,l=e.legendToggle,u=e.chartType,m=e.formatters,p=e.spreadSheetUrl,h=e.spreadSheetQueryParameters;return c(t,void 0,void 0,(function(){var e,t,c,f,_,g,b,v,w,M,k,L,Y,T;return d(this,(function(d){switch(d.label){case 0:return e=this.props,t=e.google,c=e.googleChartWrapper,_=null,null!==r&&(g=t.visualization.arrayToDataTable(r.old),b=t.visualization.arrayToDataTable(r.new),_=t.visualization[u].prototype.computeDiff(g,b)),null===n?[3,1]:(f=Array.isArray(n)?t.visualization.arrayToDataTable(n):new t.visualization.DataTable(n),[3,5]);case 1:return null===a||null===i?[3,2]:(f=t.visualization.arrayToDataTable([i].concat(a)),[3,5]);case 2:return null===p?[3,4]:[4,y(t,p,h)];case 3:return f=d.sent(),[3,5];case 4:f=t.visualization.arrayToDataTable([]),d.label=5;case 5:for(v=f.getNumberOfColumns(),w=0;w<v;w+=1)M=this.getColumnID(f,w),this.state.hiddenColumns.includes(M)&&(k=f.getColumnLabel(w),L=f.getColumnId(w),Y=f.getColumnType(w),f.removeColumn(w),f.addColumn({label:k,id:L,type:Y}));return T=c.getChart(),"Timeline"===c.getChartType()&&T&&T.clearChart(),c.setChartType(u),c.setOptions(o),c.setDataTable(f),c.draw(),null!==this.props.googleChartDashboard&&this.props.googleChartDashboard.draw(f),null!==_&&(c.setDataTable(_),c.draw()),null!==m&&(this.applyFormatters(f,m),c.setDataTable(f),c.draw()),!0!==l&&!0!==s||this.grayOutHiddenColumns({options:o}),[2]}}))}))},t.grayOutHiddenColumns=function(e){var n=e.options,r=t.props.googleChartWrapper,a=r.getDataTable();if(null!==a){var i=a.getNumberOfColumns();if(!1!==t.state.hiddenColumns.length>0){var o=Array.from({length:i-1}).map((function(e,r){var i=t.getColumnID(a,r+1);return t.state.hiddenColumns.includes(i)?k:void 0!==n.colors&&null!==n.colors?n.colors[r]:_[r]}));r.setOptions(u({},n,{colors:o})),r.draw()}}},t.onResize=function(){t.props.googleChartWrapper.draw()},t}return l(t,e),t.prototype.componentDidMount=function(){this.draw(this.props),window.addEventListener("resize",this.onResize),(this.props.legend_toggle||this.props.legendToggle)&&this.listenToLegendToggle()},t.prototype.componentWillUnmount=function(){var e=this.props,t=e.google,n=e.googleChartWrapper;window.removeEventListener("resize",this.onResize),t.visualization.events.removeAllListeners(n),"Timeline"===n.getChartType()&&n.getChart()&&n.getChart().clearChart()},t.prototype.componentDidUpdate=function(){this.draw(this.props)},t.prototype.render=function(){return null},t}(r.Component),Y=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l(t,e),t.prototype.componentDidMount=function(){},t.prototype.componentWillUnmount=function(){},t.prototype.shouldComponentUpdate=function(){return!1},t.prototype.render=function(){var e=this.props,t=e.google,n=e.googleChartWrapper,a=e.googleChartDashboard;return Object(r.createElement)(M,{render:function(e){return Object(r.createElement)(L,u({},e,{google:t,googleChartWrapper:n,googleChartDashboard:a}))}})},t}(r.Component),T=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l(t,e),t.prototype.shouldComponentUpdate=function(){return!1},t.prototype.listenToEvents=function(e){var t=this,n=e.chartEvents,r=e.google,a=e.googleChartWrapper;if(null!==n){r.visualization.events.removeAllListeners(a);for(var i=function(e){var n=e.eventName,i=e.callback;r.visualization.events.addListener(a,n,(function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];i({chartWrapper:a,props:t.props,google:r,eventArgs:e})}))},o=0,s=n;o<s.length;o++){i(s[o])}}},t.prototype.render=function(){var e=this,t=this.props,n=t.google,a=t.googleChartWrapper;return Object(r.createElement)(M,{render:function(t){return e.listenToEvents({chartEvents:t.chartEvents||null,google:n,googleChartWrapper:a}),null}})},t}(r.Component),D=0,S=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={googleChartWrapper:null,googleChartDashboard:null,googleChartControls:null,googleChartEditor:null,isReady:!1},t.graphID=null,t.dashboard_ref=Object(r.createRef)(),t.toolbar_ref=Object(r.createRef)(),t.getGraphID=function(){var e,n=t.props,r=n.graphID,a=n.graph_id;return e=null===r&&null===a?null===t.graphID?f():t.graphID:null!==r&&null===a?r:null!==a&&null===r?a:r,t.graphID=e,t.graphID},t.getControlID=function(e,t){return D+=1,void 0===e?"googlechart-control-"+t+"-"+D:e},t.addControls=function(e,n){var r=t.props,a=r.google,i=r.controls,o=null===i?null:i.map((function(e,n){var r=e.controlID,i=e.controlType,o=e.options,s=e.controlWrapperParams,l=t.getControlID(r,n);return{controlProp:e,control:new a.visualization.ControlWrapper(u({containerId:l,controlType:i,options:o},s))}}));if(null===o)return null;n.bind(o.map((function(e){return e.control})),e);for(var s=function(n){for(var r=n.control,i=n.controlProp.controlEvents,o=function(n){var i=n.callback,o=n.eventName;a.visualization.events.removeListener(r,o,i),a.visualization.events.addListener(r,o,(function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];i({chartWrapper:e,controlWrapper:r,props:t.props,google:a,eventArgs:n})}))},s=0,l=void 0===i?[]:i;s<l.length;s++){o(l[s])}},l=0,c=o;l<c.length;l++){s(c[l])}return o},t.renderChart=function(){var e=t.props,n=e.width,a=e.height,i=e.options,o=e.style,s=e.className,l=e.rootProps,c=e.google,d=u({height:a||i&&i.height,width:n||i&&i.width},o);return Object(r.createElement)("div",u({id:t.getGraphID(),style:d,className:s},l),t.state.isReady&&null!==t.state.googleChartWrapper?Object(r.createElement)(r.Fragment,null,Object(r.createElement)(Y,{googleChartWrapper:t.state.googleChartWrapper,google:c,googleChartDashboard:t.state.googleChartDashboard}),Object(r.createElement)(T,{googleChartWrapper:t.state.googleChartWrapper,google:c})):null)},t.renderControl=function(e){return void 0===e&&(e=function(e){e.control,e.controlProp;return!0}),t.state.isReady&&null!==t.state.googleChartControls?Object(r.createElement)(r.Fragment,null,t.state.googleChartControls.filter((function(t){var n=t.controlProp,r=t.control;return e({control:r,controlProp:n})})).map((function(e){var t=e.control;e.controlProp;return Object(r.createElement)("div",{key:t.getContainerId(),id:t.getContainerId()})}))):null},t.renderToolBar=function(){return null===t.props.toolbarItems?null:Object(r.createElement)("div",{ref:t.toolbar_ref})},t}return l(t,e),t.prototype.componentDidMount=function(){var e=this.props,t=e.options,n=e.google,r=e.chartType,a=e.chartWrapperParams,i=e.toolbarItems,o=e.getChartEditor,s=e.getChartWrapper,l=u({chartType:r,options:t,containerId:this.getGraphID()},a),c=new n.visualization.ChartWrapper(l);c.setOptions(t),s(c,n);var d=new n.visualization.Dashboard(this.dashboard_ref),m=this.addControls(c,d);null!==i&&n.visualization.drawToolbar(this.toolbar_ref.current,i);var p=null;null!==o&&o({chartEditor:p=new n.visualization.ChartEditor,chartWrapper:c,google:n}),this.setState({googleChartEditor:p,googleChartControls:m,googleChartDashboard:d,googleChartWrapper:c,isReady:!0})},t.prototype.componentDidUpdate=function(){if(null!==this.state.googleChartWrapper&&null!==this.state.googleChartDashboard&&null!==this.state.googleChartControls)for(var e=this.props.controls,t=0;t<e.length;t+=1){var n=e[t],r=n.controlType,a=n.options,i=n.controlWrapperParams;i&&"state"in i&&this.state.googleChartControls[t].control.setState(i.state),this.state.googleChartControls[t].control.setOptions(a),this.state.googleChartControls[t].control.setControlType(r)}},t.prototype.shouldComponentUpdate=function(e,t){return this.state.isReady!==t.isReady||e.controls!==this.props.controls},t.prototype.render=function(){var e=this.props,t=e.width,n=e.height,a=e.options,i=e.style,o=u({height:n||a&&a.height,width:t||a&&a.width},i);return null!==this.props.render?Object(r.createElement)("div",{ref:this.dashboard_ref,style:o},Object(r.createElement)("div",{ref:this.toolbar_ref,id:"toolbar"}),this.props.render({renderChart:this.renderChart,renderControl:this.renderControl,renderToolbar:this.renderToolBar})):Object(r.createElement)("div",{ref:this.dashboard_ref,style:o},this.renderControl((function(e){return"bottom"!==e.controlProp.controlPosition})),this.renderChart(),this.renderControl((function(e){return"bottom"===e.controlProp.controlPosition})),this.renderToolBar())},t}(r.Component),O=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._isMounted=!1,t.state={loadingStatus:"loading",google:null},t.onLoad=function(e){if(t.isFullyLoaded(e))t.onSuccess(e);else var n=setInterval((function(){var e=window.google;t._isMounted?e&&t.isFullyLoaded(e)&&(clearInterval(n),t.onSuccess(e)):clearInterval(n)}),1e3)},t.onSuccess=function(e){t.setState({loadingStatus:"ready",google:e})},t.onError=function(){t.setState({loadingStatus:"errored"})},t}return l(t,e),t.prototype.render=function(){var e=this.props,t=e.chartLanguage,n=e.chartPackages,a=e.chartVersion,i=e.mapsApiKey,o=e.loader,s=e.errorElement;return Object(r.createElement)(w,{value:this.props},"ready"===this.state.loadingStatus&&null!==this.state.google?Object(r.createElement)(S,u({},this.props,{google:this.state.google})):"errored"===this.state.loadingStatus&&s?s:o,Object(r.createElement)(p,u({},{chartLanguage:t,chartPackages:n,chartVersion:a,mapsApiKey:i},{onLoad:this.onLoad,onError:this.onError})))},t.prototype.componentDidMount=function(){this._isMounted=!0},t.prototype.componentWillUnmount=function(){this._isMounted=!1},t.prototype.isFullyLoaded=function(e){var t=this.props,n=t.controls,r=t.toolbarItems,a=t.getChartEditor;return e&&e.visualization&&e.visualization.ChartWrapper&&e.visualization.Dashboard&&(!n||e.visualization.ChartWrapper)&&(!a||e.visualization.ChartEditor)&&(!r||e.visualization.drawToolbar)},t.defaultProps=m,t}(r.Component),j=n(130),x=n.n(j);function E(e){return(E="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function C(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function P(e){return(P=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function H(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function z(e,t){return(z=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var A=wp.element,N=A.Component,F=A.Fragment,R=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t){return!t||"object"!==E(t)&&"function"!=typeof t?H(e):t}(this,P(t).apply(this,arguments))).initDataTable=e.initDataTable.bind(H(e)),e.dataRenderer=e.dataRenderer.bind(H(e)),e.table,e.uniqueId=x()(),e}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&z(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:function(){this.initDataTable(this.props.columns,this.props.rows)}},{key:"componentWillUnmount",value:function(){this.table.destroy()}},{key:"componentDidUpdate",value:function(e){this.props!==e&&(this.props.options.responsive_bool!==e.options.responsive_bool&&"true"===e.options.responsive_bool&&document.getElementById("dataTable-instances-".concat(this.props.id,"-").concat(this.uniqueId)).classList.remove("collapsed"),this.table.destroy(),document.getElementById("dataTable-instances-".concat(this.props.id,"-").concat(this.uniqueId)).innerHTML="",this.initDataTable(this.props.columns,this.props.rows))}},{key:"initDataTable",value:function(e,t){var n=this,r=this.props.options,a=e.map((function(e,t){var r=e.type;switch(e.type){case"number":r="num";break;case"date":case"datetime":case"timeofday":r="date"}return{title:e.label,data:e.label,type:r,render:n.dataRenderer(i,r,t)}})),i=t.map((function(e){var t={};return a.forEach((function(n,r){var a=e[r];void 0===a&&(a=e[n.data]),t[n.data]=a})),t}));this.table=jQuery("#dataTable-instances-".concat(this.props.id,"-").concat(this.uniqueId)).DataTable({destroy:!0,data:i,columns:a,paging:"true"===r.paging_bool,pageLength:r.pageLength_int||10,pagingType:r.pagingType,ordering:"false"!==r.ordering_bool,fixedHeader:"true"===r.fixedHeader_bool,scrollCollapse:!(!this.props.chartsScreen&&"true"!==r.scrollCollapse_bool),scrollY:(this.props.chartsScreen?180:"true"===r.scrollCollapse_bool&&Number(r.scrollY_int))||!1,responsive:!(!this.props.chartsScreen&&"true"!==r.responsive_bool),searching:!1,select:!1,lengthChange:!1,bFilter:!1,bInfo:!1})}},{key:"dataRenderer",value:function(e,t,n){var r,a=this.props.options;if(void 0===a.series[n])return e;switch(t){case"date":case"datetime":case"timeofday":return a.series[n].format&&a.series[n].format.from&&a.series[n].format.to?jQuery.fn.dataTable.render.moment(a.series[n].format.from,a.series[n].format.to):jQuery.fn.dataTable.render.moment("MM-DD-YYYY");case"num":var i=["","","","",""];return a.series[n].format.thousands&&(i[0]=a.series[n].format.thousands),a.series[n].format.decimal&&(i[1]=a.series[n].format.decimal),a.series[n].format.precision&&(i[2]=a.series[n].format.precision),a.series[n].format.prefix&&(i[3]=a.series[n].format.prefix),a.series[n].format.suffix&&(i[4]=a.series[n].format.suffix),(r=jQuery.fn.dataTable.render).number.apply(r,i);case"boolean":return jQuery.fn.dataTable.render.extra=function(e,t,r){return!0!==e&&"true"!==e||void 0===a.series[n].format||""===a.series[n].format.truthy?!1!==e&&"false"!==e||void 0===a.series[n].format||""===a.series[n].format.falsy?e:a.series[n].format.falsy.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,""):a.series[n].format.truthy.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,"")},jQuery.fn.dataTable.render.extra}return e}},{key:"render",value:function(){var e=this.props.options;return wp.element.createElement(F,null,e.customcss&&wp.element.createElement("style",null,e.customcss.oddTableRow&&"#dataTable-instances-".concat(this.props.id,"-").concat(this.uniqueId," tr.odd {\n\t\t\t\t\t\t\t\t").concat(e.customcss.oddTableRow.color?"color: ".concat(e.customcss.oddTableRow.color," !important;"):"","\n\t\t\t\t\t\t\t\t").concat(e.customcss.oddTableRow["background-color"]?"background-color: ".concat(e.customcss.oddTableRow["background-color"]," !important;"):"","\n\t\t\t\t\t\t\t\t").concat(e.customcss.oddTableRow.transform?"transform: rotate( ".concat(e.customcss.oddTableRow.transform,"deg ) !important;"):"","\n\t\t\t\t\t\t\t}"),e.customcss.evenTableRow&&"#dataTable-instances-".concat(this.props.id,"-").concat(this.uniqueId," tr.even {\n\t\t\t\t\t\t\t\t").concat(e.customcss.evenTableRow.color?"color: ".concat(e.customcss.evenTableRow.color," !important;"):"","\n\t\t\t\t\t\t\t\t").concat(e.customcss.evenTableRow["background-color"]?"background-color: ".concat(e.customcss.evenTableRow["background-color"]," !important;"):"","\n\t\t\t\t\t\t\t\t").concat(e.customcss.evenTableRow.transform?"transform: rotate( ".concat(e.customcss.evenTableRow.transform,"deg ) !important;"):"","\n\t\t\t\t\t\t\t}"),e.customcss.tableCell&&"#dataTable-instances-".concat(this.props.id,"-").concat(this.uniqueId," tr td,\n\t\t\t\t\t\t\t#dataTable-instances-").concat(this.props.id,"-").concat(this.uniqueId,"_wrapper tr th {\n\t\t\t\t\t\t\t\t").concat(e.customcss.tableCell.color?"color: ".concat(e.customcss.tableCell.color," !important;"):"","\n\t\t\t\t\t\t\t\t").concat(e.customcss.tableCell["background-color"]?"background-color: ".concat(e.customcss.tableCell["background-color"]," !important;"):"","\n\t\t\t\t\t\t\t\t").concat(e.customcss.tableCell.transform?"transform: rotate( ".concat(e.customcss.tableCell.transform,"deg ) !important;"):"","\n\t\t\t\t\t\t\t}")),wp.element.createElement("table",{id:"dataTable-instances-".concat(this.props.id,"-").concat(this.uniqueId)}))}}])&&C(n.prototype,r),a&&C(n,a),t}(N),W=n(4),I=n.n(W),B=n(131),J=n.n(B),U=function(e){return Object.keys(e["visualizer-series"]).map((function(t){void 0!==e["visualizer-series"][t].type&&"date"===e["visualizer-series"][t].type&&Object.keys(e["visualizer-data"]).map((function(n){return e["visualizer-data"][n][t]=new Date(e["visualizer-data"][n][t])}))})),e},q=function(e){var t;if(Array.isArray(e))return 0<e.length;if(I()(e)){for(t in e)return!0;return!1}return"string"==typeof e?0<e.length:null!=e},V=function(e){return J()(e,q)},G=function(e){return e.width="",e.height="",e.backgroundColor={},e.chartArea={},V(e)},$=function(e){try{JSON.parse(e)}catch(e){return!1}return!0},K=function(e,t){return!0===e[t]||"true"===e[t]||"1"===e[t]||1===e[t]};function Z(e){return(Z="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 Q(e,t,n,r,a,i,o){try{var s=e[i](o),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,a)}function X(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var i=e.apply(t,n);function o(e){Q(i,r,a,o,s,"next",e)}function s(e){Q(i,r,a,o,s,"throw",e)}o(void 0)}))}}function ee(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function te(e){return(te=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ne(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function re(e,t){return(re=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var ae=lodash.startCase,ie=wp.i18n.__,oe=wp.apiFetch,se=wp.element,le=se.Component,ue=se.Fragment,ce=wp.components,de=ce.Button,me=ce.Dashicon,pe=ce.ExternalLink,he=ce.Notice,fe=ce.Placeholder,_e=ce.Spinner,ye=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t){return!t||"object"!==Z(t)&&"function"!=typeof t?ne(e):t}(this,te(t).apply(this,arguments))).loadMoreCharts=e.loadMoreCharts.bind(ne(e)),e.state={charts:null,isBusy:!1,chartsLoaded:!1,perPage:visualizerLocalize.chartsPerPage},e}var n,r,a,i,o;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&re(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:(o=X(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,oe({path:"wp/v2/visualizer/?per_page="+t+"&meta_key=visualizer-chart-library&meta_value=ChartJS"});case 3:n=e.sent,this.setState({charts:n});case 5:case"end":return e.stop()}}),e,this)}))),function(){return o.apply(this,arguments)})},{key:"loadMoreCharts",value:(i=X(regeneratorRuntime.mark((function e(){var t,n,r,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.state.charts.length,n=this.state.chartsLoaded,r=this.state.perPage,this.setState({isBusy:!0}),e.next=6,oe({path:"wp/v2/visualizer/?per_page=".concat(r,"&meta_key=visualizer-chart-library&meta_value=ChartJS&offset=").concat(t)});case 6:a=e.sent,r>a.length&&(n=!0),this.setState({charts:this.state.charts.concat(a),isBusy:!1,chartsLoaded:n});case 9:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"render",value:function(){var e=this,t=this.state,n=t.charts,r=t.isBusy,a=t.chartsLoaded,i=t.perPage;return wp.element.createElement("div",{className:"visualizer-settings__charts"},wp.element.createElement(he,{status:"warning",isDismissible:!1},ie("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(pe,{href:visualizerLocalize.adminPage},ie("Click here to visit Visualizer Charts Library."))),null!==n?1<=n.length?wp.element.createElement(ue,null,wp.element.createElement("div",{className:"visualizer-settings__charts-grid"},Object.keys(n).map((function(t){var r,a,i,o=U(n[t].chart_data);if(r=o["visualizer-settings"].title?o["visualizer-settings"].title:"#".concat(n[t].id),a=0<=["gauge","table","timeline","dataTable"].indexOf(o["visualizer-chart-type"])?"dataTable"===o["visualizer-chart-type"]?o["visualizer-chart-type"]:ae(o["visualizer-chart-type"]):"".concat(ae(o["visualizer-chart-type"]),"Chart"),!o["visualizer-chart-library"]||"ChartJS"!==o["visualizer-chart-library"])return o["visualizer-data-exploded"]&&(i=ie("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",key:"chart-".concat(n[t].id)},wp.element.createElement("div",{className:"visualizer-settings__charts-title"},r),"dataTable"===a?wp.element.createElement(R,{id:n[t].id,rows:o["visualizer-data"],columns:o["visualizer-series"],chartsScreen:!0,options:G(o["visualizer-settings"])}):(o["visualizer-data-exploded"],wp.element.createElement(O,{chartType:a,rows:o["visualizer-data"],columns:o["visualizer-series"],options:G(o["visualizer-settings"])})),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:ie("Insert Chart"),onClick:function(){return e.props.getChart(n[t].id)}},wp.element.createElement(me,{icon:"upload"})))}))),!a&&i-1<n.length&&wp.element.createElement(de,{isPrimary:!0,isLarge:!0,onClick:this.loadMoreCharts,isBusy:r},ie("Load More"))):wp.element.createElement("p",{className:"visualizer-no-charts"},ie("No charts found.")):wp.element.createElement(fe,null,wp.element.createElement(_e,null)))}}])&&ee(n.prototype,r),a&&ee(n,a),t}(le);function ge(e){return(ge="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 be(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ve(e){return(ve=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function we(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Me(e,t){return(Me=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var ke=wp.i18n.__,Le=wp.element.Component,Ye=wp.components,Te=Ye.Button,De=Ye.ExternalLink,Se=Ye.PanelBody,Oe=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t){return!t||"object"!==ge(t)&&"function"!=typeof t?we(e):t}(this,ve(t).apply(this,arguments))).uploadInput=React.createRef(),e.fileUploaded=e.fileUploaded.bind(we(e)),e.uploadImport=e.uploadImport.bind(we(e)),e.state={uploadLabel:ke("Upload")},e}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Me(e,t)}(t,e),n=t,(r=[{key:"fileUploaded",value:function(e){"text/csv"===e.target.files[0].type&&this.setState({uploadLabel:ke("Upload")})}},{key:"uploadImport",value:function(){this.props.readUploadedFile(this.uploadInput),this.setState({uploadLabel:ke("Uploaded")})}},{key:"render",value:function(){return wp.element.createElement(Se,{title:ke("Import data from file"),initialOpen:!1},wp.element.createElement("p",null,ke("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,ke("If you are unsure about how to format your data CSV then please take a look at this sample: "),wp.element.createElement(De,{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(Te,{isPrimary:!0,onClick:this.uploadImport},this.state.uploadLabel))}}])&&be(n.prototype,r),a&&be(n,a),t}(Le);function je(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function xe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?je(n,!0).forEach((function(t){Ee(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):je(n).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ee(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ce(e){return(Ce="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 Pe(e,t,n,r,a,i,o){try{var s=e[i](o),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,a)}function He(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var i=e.apply(t,n);function o(e){Pe(i,r,a,o,s,"next",e)}function s(e){Pe(i,r,a,o,s,"throw",e)}o(void 0)}))}}function ze(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Ae(e){return(Ae=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Ne(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Fe(e,t){return(Fe=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Re=wp.i18n.__,We=wp,Ie=(We.apiFetch,We.apiRequest),Be=wp.element.Component,Je=wp.components,Ue=Je.Button,qe=Je.ExternalLink,Ve=Je.IconButton,Ge=Je.Modal,$e=Je.PanelBody,Ke=Je.SelectControl,Ze=Je.TextControl,Qe=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t){return!t||"object"!==Ce(t)&&"function"!=typeof t?Ne(e):t}(this,Ae(t).apply(this,arguments))).openModal=e.openModal.bind(Ne(e)),e.initTable=e.initTable.bind(Ne(e)),e.onToggle=e.onToggle.bind(Ne(e)),e.toggleHeaders=e.toggleHeaders.bind(Ne(e)),e.getJSONRoot=e.getJSONRoot.bind(Ne(e)),e.getJSONData=e.getJSONData.bind(Ne(e)),e.getTableData=e.getTableData.bind(Ne(e)),e.state={isOpen:!1,isLoading:!1,isFirstStepOpen:!0,isSecondStepOpen:!1,isThirdStepOpen:!1,isFourthStepOpen:!1,isHeaderPanelOpen:!1,endpointRoots:[],endpointPaging:[],table:null,requestHeaders:{method:"GET",username:"",password:"",auth:""}},e}var n,r,a,i,o,s,l,u;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Fe(e,t)}(t,e),n=t,(r=[{key:"openModal",value:(u=He(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.setState({isOpen:!0});case 2:t=document.querySelector("#visualizer-json-query-table"),this.state.isFourthStepOpen&&null!==this.state.table&&(t.innerHTML=this.state.table,this.initTable());case 4:case"end":return e.stop()}}),e,this)}))),function(){return u.apply(this,arguments)})},{key:"initTable",value:function(){jQuery("#visualizer-json-query-table table").DataTable({paging:!1,searching:!1,ordering:!1,select:!1,scrollX:"600px",scrollY:"400px",info:!1,colReorder:{fixedColumnsLeft:1},dom:"Bt",buttons:[{extend:"colvis",columns:":gt(0)",collectionLayout:"four-column"}]})}},{key:"onToggle",value:(l=He(regeneratorRuntime.mark((function e(t){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null===this.state.table&&this.state.endpointRoots&&0<this.state.endpointRoots.length&&("isFirstStepOpen"===t||"isSecondStepOpen"===t)&&this.setState({isFirstStepOpen:"isFirstStepOpen"===t,isSecondStepOpen:"isSecondStepOpen"===t,isThirdStepOpen:!1,isFourthStepOpen:!1}),null===this.state.table){e.next=5;break}return e.next=4,this.setState({isFirstStepOpen:"isFirstStepOpen"===t,isSecondStepOpen:"isSecondStepOpen"===t,isThirdStepOpen:"isThirdStepOpen"===t,isFourthStepOpen:"isFourthStepOpen"===t});case 4:"isFourthStepOpen"===t&&(n=document.querySelector("#visualizer-json-query-table"),this.state.isFourthStepOpen&&(n.innerHTML=this.state.table,this.initTable()));case 5:case"end":return e.stop()}}),e,this)}))),function(e){return l.apply(this,arguments)})},{key:"toggleHeaders",value:function(){this.setState({isHeaderPanelOpen:!this.state.isHeaderPanelOpen})}},{key:"getJSONRoot",value:(s=He(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,Ie({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"===Ce(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"===Ce(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"!==Ce(this.props.chart["visualizer-json-headers"].auth)?this.props.chart["visualizer-json-headers"].auth:this.state.requestHeaders.auth},method:"GET"});case 3:(t=e.sent).success?(n=Object.keys(t.data.roots).map((function(e){return{label:t.data.roots[e].replace(/>/g," ➤ "),value:t.data.roots[e]}})),this.setState({isLoading:!1,isFirstStepOpen:!1,isSecondStepOpen:!0,endpointRoots:n})):(this.setState({isLoading:!1}),alert(t.data.msg));case 5:case"end":return e.stop()}}),e,this)}))),function(){return s.apply(this,arguments)})},{key:"getJSONData",value:(o=He(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,Ie({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"===Ce(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"===Ce(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"!==Ce(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:Re("Don't use pagination"),value:0}],t.data.paging&&"root>next"===t.data.paging[0]&&n.push({label:Re("Get first 5 pages using root ➤ next"),value:"root>next"}),this.setState({isLoading:!1,isSecondStepOpen:!1,isFourthStepOpen:!0,endpointPaging:n,table:t.data.table}),document.querySelector("#visualizer-json-query-table").innerHTML=t.data.table,this.initTable()):(this.setState({isLoading:!1}),alert(t.data.msg));case 5:case"end":return e.stop()}}),e,this)}))),function(){return o.apply(this,arguments)})},{key:"getTableData",value:(i=He(regeneratorRuntime.mark((function e(){var t,n,r,a,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.setState({isLoading:!0}),t=document.querySelectorAll("#visualizer-json-query-table input"),n=document.querySelectorAll("#visualizer-json-query-table select"),r=[],a={},t.forEach((function(e){return r.push(e.value)})),n.forEach((function(e){return a[e.name]=e.value})),e.next=9,Ie({path:"/visualizer/v1/set-json-data",data:xe({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"===Ce(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"===Ce(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"!==Ce(this.props.chart["visualizer-json-headers"].auth)?this.props.chart["visualizer-json-headers"].auth:this.state.requestHeaders.auth,root:this.props.chart["visualizer-json-root"]||this.state.endpointRoots[0].value,paging:this.props.chart["visualizer-json-paging"]||0,header:r},a),method:"GET"});case 9:(i=e.sent).success?(this.props.JSONImportData(i.data.name,JSON.parse(i.data.series),JSON.parse(i.data.data)),this.setState({isOpen:!1,isLoading:!1})):(alert(i.data.msg),this.setState({isLoading:!1}));case 11:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"render",value:function(){var e=this;return wp.element.createElement($e,{title:Re("Import from JSON"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement("p",null,Re("You can choose here to import or synchronize your chart data with a remote JSON source.")),wp.element.createElement("p",null,wp.element.createElement(qe,{href:"https://docs.themeisle.com/article/1052-how-to-generate-charts-from-json-data-rest-endpoints"},Re("For more info check this tutorial."))),wp.element.createElement(Ke,{label:Re("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:Re("One-time"),value:"-1"},{label:Re("Live"),value:"0"},{label:Re("Each hour"),value:"1"},{label:Re("Each 12 hours"),value:"12"},{label:Re("Each day"),value:"24"},{label:Re("Each 3 days"),value:"72"}],onChange:this.props.editSchedule}),wp.element.createElement(Ue,{isPrimary:!0,isLarge:!0,onClick:this.openModal},Re("Modify Parameters")),this.state.isOpen&&wp.element.createElement(Ge,{title:Re("Import from JSON"),className:"visualizer-json-query-modal",shouldCloseOnClickOutside:!1,onRequestClose:function(){e.setState({isOpen:!1,isTableRendered:!1})}},wp.element.createElement($e,{title:Re("Step 1: Specify the JSON endpoint/URL"),opened:this.state.isFirstStepOpen,onToggle:function(){return e.onToggle("isFirstStepOpen")}},wp.element.createElement("p",null,Re("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(qe,{href:"https://docs.themeisle.com/article/1043-visualizer-how-to-extend-rest-endpoints-with-json-response"},Re("How to extend REST endpoints with JSON response"))),wp.element.createElement(Ze,{placeholder:Re("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(Ve,{icon:"arrow-right-alt2",label:Re("Add Headers"),onClick:this.toggleHeaders},Re("Add Headers")),this.state.isHeaderPanelOpen&&wp.element.createElement("div",{className:"visualizer-json-query-modal-headers-panel"},wp.element.createElement(Ke,{label:Re("Request Type"),value:this.props.chart["visualizer-json-headers"]?this.props.chart["visualizer-json-headers"].method:this.state.requestHeaders.method,options:[{value:"GET",label:Re("GET")},{value:"POST",label:Re("POST")}],onChange:function(t){var n=xe({},e.state.requestHeaders),r=e.state.requestHeaders;n.method=t,r=xe({},r,{method:t}),e.setState({requestHeaders:r}),e.props.editJSONHeaders(n)}}),wp.element.createElement("p",null,Re("Credentials")),wp.element.createElement(Ze,{label:Re("Username"),placeholder:Re("Username/Access Key"),value:this.props.chart["visualizer-json-headers"]&&"object"===Ce(this.props.chart["visualizer-json-headers"].auth)?this.props.chart["visualizer-json-headers"].auth.username:this.state.requestHeaders.username,onChange:function(t){var n=xe({},e.state.requestHeaders),r=e.state.requestHeaders;n.auth={username:t,password:e.props.chart["visualizer-json-headers"]&&"object"===Ce(e.props.chart["visualizer-json-headers"].auth)?e.props.chart["visualizer-json-headers"].auth.password:e.state.requestHeaders.password},r=xe({},r,{username:t,password:n.password}),e.setState({requestHeaders:r}),e.props.editJSONHeaders(n)}}),wp.element.createElement("span",{className:"visualizer-json-query-modal-field-separator"},Re("&")),wp.element.createElement(Ze,{label:Re("Password"),placeholder:Re("Password/Secret Key"),type:"password",value:this.props.chart["visualizer-json-headers"]&&"object"===Ce(this.props.chart["visualizer-json-headers"].auth)?this.props.chart["visualizer-json-headers"].auth.password:this.state.requestHeaders.password,onChange:function(t){var n=xe({},e.state.requestHeaders),r=e.state.requestHeaders;n.auth={username:e.props.chart["visualizer-json-headers"]&&"object"===Ce(e.props.chart["visualizer-json-headers"].auth)?e.props.chart["visualizer-json-headers"].auth.username:e.state.requestHeaders.username,password:t},r=xe({},r,{username:n.username,password:t}),e.setState({requestHeaders:r}),e.props.editJSONHeaders(n)}}),wp.element.createElement("p",null,Re("OR")),wp.element.createElement(Ze,{label:Re("Authorization"),placeholder:Re("e.g. SharedKey <AccountName>:<Signature>"),value:this.props.chart["visualizer-json-headers"]&&"object"!==Ce(this.props.chart["visualizer-json-headers"].auth)?this.props.chart["visualizer-json-headers"].auth:this.state.requestHeaders.auth,onChange:function(t){var n=xe({},e.state.requestHeaders),r=e.state.requestHeaders;n.auth=t,r=xe({},r,{auth:t}),e.setState({requestHeaders:r}),e.props.editJSONHeaders(n)}})),wp.element.createElement(Ue,{isPrimary:!0,isLarge:!0,isBusy:this.state.isLoading,disabled:this.state.isLoading,onClick:this.getJSONRoot},Re("Fetch Endpoint"))),wp.element.createElement($e,{title:Re("Step 2: Choose the JSON root"),initialOpen:!1,opened:this.state.isSecondStepOpen,onToggle:function(){return e.onToggle("isSecondStepOpen")}},wp.element.createElement("p",null,Re("If you see Invalid Data, you may have selected the wrong root to fetch data from. Please select an alternative.")),wp.element.createElement(Ke,{value:this.props.chart["visualizer-json-root"],options:this.state.endpointRoots,onChange:this.props.editJSONRoot}),wp.element.createElement(Ue,{isPrimary:!0,isLarge:!0,isBusy:this.state.isLoading,disabled:this.state.isLoading,onClick:this.getJSONData},Re("Parse Endpoint"))),wp.element.createElement($e,{title:Re("Step 3: Specify miscellaneous parameters"),initialOpen:!1,opened:this.state.isThirdStepOpen,onToggle:function(){return e.onToggle("isThirdStepOpen")}},"community"!==visualizerLocalize.isPro?wp.element.createElement(Ke,{value:this.props.chart["visualizer-json-paging"]||0,options:this.state.endpointPaging,onChange:this.props.editJSONPaging}):wp.element.createElement("p",null,Re("Enable this feature in PRO version!"))),wp.element.createElement($e,{title:Re("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,Re("Select whether to include the data in the chart. Each column selected will form one series.")),wp.element.createElement("li",null,Re("If a column is selected to be included, specify its data type.")),wp.element.createElement("li",null,Re("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,Re("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(Ue,{isPrimary:!0,isLarge:!0,isBusy:this.state.isLoading,disabled:this.state.isLoading,onClick:this.getTableData},Re("Save & Show Chart")))))}}])&&ze(n.prototype,r),a&&ze(n,a),t}(Be);function Xe(e){return(Xe="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 et(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function tt(e,t){return!t||"object"!==Xe(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function nt(e){return(nt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function rt(e,t){return(rt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var at=wp.i18n.__,it=wp.element.Component,ot=wp.components,st=ot.Button,lt=ot.ExternalLink,ut=ot.PanelBody,ct=ot.SelectControl,dt=ot.TextControl,mt=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),tt(this,nt(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&rt(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this;return wp.element.createElement(ut,{title:at("Import data from URL"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(ut,{title:at("One Time Import"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement("p",null,at("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,at("If you are unsure about how to format your data CSV then please take a look at this sample: "),wp.element.createElement(lt,{href:"".concat(visualizerLocalize.absurl,"samples/").concat(this.props.chart["visualizer-chart-type"],".csv")},"".concat(this.props.chart["visualizer-chart-type"],".csv"))),wp.element.createElement("p",null,at("You can also import data from Google Spreadsheet.")),wp.element.createElement(dt,{placeholder:at("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(st,{isPrimary:!0,isLarge:!0,isBusy:"uploadData"===this.props.isLoading,disabled:"uploadData"===this.props.isLoading,onClick:function(){return e.props.uploadData(!1)}},at("Import Data"))),"business"===visualizerLocalize.isPro?wp.element.createElement(ut,{title:at("Schedule Import"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement("p",null,at("You can choose here to synchronize your chart data with a remote CSV file. ")),wp.element.createElement("p",null,at("You can also synchronize with your Google Spreadsheet file.")),wp.element.createElement("p",null,at("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(dt,{placeholder:at("Please enter the URL of your CSV file"),value:this.props.chart["visualizer-chart-url"]?this.props.chart["visualizer-chart-url"]:"",onChange:this.props.editURL}),wp.element.createElement(ct,{label:at("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:at("Each hour"),value:"1"},{label:at("Each 12 hours"),value:"12"},{label:at("Each day"),value:"24"},{label:at("Each 3 days"),value:"72"}],onChange:this.props.editSchedule}),wp.element.createElement(st,{isPrimary:!0,isLarge:!0,isBusy:"uploadData"===this.props.isLoading,disabled:"uploadData"===this.props.isLoading,onClick:function(){return e.props.uploadData(!0)}},at("Save Schedule"))):wp.element.createElement(ut,{title:at("Schedule Import"),icon:"lock",className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement("p",null,at("Upgrade your license to at least the DEVELOPER version to activate this feature!")),wp.element.createElement(st,{isPrimary:!0,href:visualizerLocalize.proTeaser,target:"_blank"},at("Buy Now"))),wp.element.createElement(Qe,{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}))}}])&&et(n.prototype,r),a&&et(n,a),t}(it);function pt(e){return(pt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ht(e,t,n,r,a,i,o){try{var s=e[i](o),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,a)}function ft(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function _t(e,t){return!t||"object"!==pt(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function yt(e){return(yt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function gt(e,t){return(gt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var bt=wp.i18n.__,vt=wp.apiFetch,wt=wp.element,Mt=wt.Component,kt=wt.Fragment,Lt=wp.components,Yt=Lt.Button,Tt=Lt.PanelBody,Dt=Lt.Placeholder,St=Lt.SelectControl,Ot=Lt.Spinner,jt=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=_t(this,yt(t).apply(this,arguments))).state={id:"",charts:[]},e}var n,r,a,i,o;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&gt(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:(i=regeneratorRuntime.mark((function e(){var t,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,vt({path:"wp/v2/visualizer/?per_page=100"});case 2:t=(t=e.sent).map((function(e,t){var r=e.chart_data["visualizer-settings"].title?e.chart_data["visualizer-settings"].title:"#".concat(e.id);return 0===t&&(n=e.id),{value:e.id,label:r}})),this.setState({id:n,charts:t});case 5:case"end":return e.stop()}}),e,this)})),o=function(){var e=this,t=arguments;return new Promise((function(n,r){var a=i.apply(e,t);function o(e){ht(a,n,r,o,s,"next",e)}function s(e){ht(a,n,r,o,s,"throw",e)}o(void 0)}))},function(){return o.apply(this,arguments)})},{key:"render",value:function(){var e=this;return"community"!==visualizerLocalize.isPro?wp.element.createElement(Tt,{title:bt("Import from other chart"),initialOpen:!1},1<=this.state.charts.length?wp.element.createElement(kt,null,wp.element.createElement(St,{label:bt("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(Yt,{isPrimary:!0,isLarge:!0,isBusy:"getChartData"===this.props.isLoading,onClick:function(){return e.props.getChartData(e.state.id)}},bt("Import Chart"))):wp.element.createElement(Dt,null,wp.element.createElement(Ot,null))):wp.element.createElement(Tt,{title:bt("Import from other chart"),icon:"lock",initialOpen:!1},wp.element.createElement("p",null,bt("Enable this feature in PRO version!")),wp.element.createElement(Yt,{isPrimary:!0,href:visualizerLocalize.proTeaser,target:"_blank"},bt("Buy Now")))}}])&&ft(n.prototype,r),a&&ft(n,a),t}(Mt);function xt(e){return(xt="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 Et(e,t,n,r,a,i,o){try{var s=e[i](o),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,a)}function Ct(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Pt(e){return(Pt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Ht(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function zt(e,t){return(zt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var At=wp.i18n.__,Nt=wp.apiRequest,Ft=wp.components,Rt=Ft.Button,Wt=Ft.ExternalLink,It=wp.element,Bt=It.Component,Jt=It.Fragment,Ut=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t){return!t||"object"!==xt(t)&&"function"!=typeof t?Ht(e):t}(this,Pt(t).apply(this,arguments))).onSave=e.onSave.bind(Ht(e)),e.state={isLoading:!1,success:!1,query:"",name:"",series:{},data:[]},e}var n,r,a,i,o;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&zt(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:function(){var e=wp.CodeMirror||CodeMirror,t=document.querySelector(".visualizer-db-query"),n=e.fromTextArea(t,{autofocus:!0,mode:"text/x-mysql",lineWrapping:!0,dragDrop:!1,matchBrackets:!0,autoCloseBrackets:!0,extraKeys:{"Ctrl-Space":"autocomplete"},hintOptions:{tables:visualizerLocalize.sqlTable}});n.on("inputRead",(function(){n.save()}))}},{key:"onSave",value:(i=regeneratorRuntime.mark((function e(){var t,n,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=document.querySelector(".visualizer-db-query").value,(n=document.querySelector("#visualizer-db-query-table")).innerHTML="",e.next=5,this.setState({isLoading:!0});case 5:return e.next=7,Nt({path:"/visualizer/v1/get-query-data",data:{query:t},method:"GET"});case 7:return r=e.sent,e.next=10,this.setState({isLoading:!1,success:r.success,query:t,name:r.data.name||"",series:r.data.series||{},data:r.data.data||[]});case 10:n.innerHTML=r.data.table||r.data.msg,this.state.success&&jQuery("#results").DataTable({paging:!1});case 12:case"end":return e.stop()}}),e,this)})),o=function(){var e=this,t=arguments;return new Promise((function(n,r){var a=i.apply(e,t);function o(e){Et(a,n,r,o,s,"next",e)}function s(e){Et(a,n,r,o,s,"throw",e)}o(void 0)}))},function(){return o.apply(this,arguments)})},{key:"render",value:function(){var e=this;return wp.element.createElement(Jt,null,wp.element.createElement("textarea",{className:"visualizer-db-query",placeholder:At("Your query goes here…")},this.props.chart["visualizer-db-query"]),wp.element.createElement("div",{className:"visualizer-db-query-actions"},wp.element.createElement(Rt,{isLarge:!0,isDefault:!0,isBusy:this.state.isLoading,onClick:this.onSave},At("Show Results")),wp.element.createElement(Rt,{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)}},At("Save"))),wp.element.createElement("ul",null,wp.element.createElement("li",null,wp.element.createElement(Wt,{href:"https://docs.themeisle.com/article/970-visualizer-sample-queries-to-generate-charts"},At("Examples of queries and links to resources that you can use with this feature."))),wp.element.createElement("li",null,At("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"}))}}])&&Ct(n.prototype,r),a&&Ct(n,a),t}(Bt);function qt(e){return(qt="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 Vt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Gt(e){return(Gt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function $t(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Kt(e,t){return(Kt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Zt=wp.i18n.__,Qt=wp.element.Component,Xt=wp.components,en=Xt.Button,tn=Xt.Modal,nn=Xt.PanelBody,rn=Xt.SelectControl,an=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t){return!t||"object"!==qt(t)&&"function"!=typeof t?$t(e):t}(this,Gt(t).apply(this,arguments))).save=e.save.bind($t(e)),e.state={isOpen:!1},e}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Kt(e,t)}(t,e),n=t,(r=[{key:"save",value:function(e,t,n,r){this.props.databaseImportData(e,t,n,r),this.setState({isOpen:!1})}},{key:"render",value:function(){var e=this;return"business"!==visualizerLocalize.isPro?wp.element.createElement(nn,{title:Zt("Import data from database"),icon:"lock",initialOpen:!1},wp.element.createElement("p",null,Zt("Upgrade your license to at least the DEVELOPER version to activate this feature!")),wp.element.createElement(en,{isPrimary:!0,href:visualizerLocalize.proTeaser,target:"_blank"},Zt("Buy Now"))):wp.element.createElement(nn,{title:Zt("Import data from database"),initialOpen:!1},wp.element.createElement("p",null,Zt("You can import data from the database here.")),wp.element.createElement("p",null,Zt("How often do you want to refresh the data from the database.")),wp.element.createElement(rn,{label:Zt("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:Zt("Live"),value:"0"},{label:Zt("Each hour"),value:"1"},{label:Zt("Each 12 hours"),value:"12"},{label:Zt("Each day"),value:"24"},{label:Zt("Each 3 days"),value:"72"}],onChange:this.props.editSchedule}),wp.element.createElement(en,{isPrimary:!0,isLarge:!0,onClick:function(){return e.setState({isOpen:!0})}},Zt("Create Query")),this.state.isOpen&&wp.element.createElement(tn,{title:Zt("Import from database"),onRequestClose:function(){return e.setState({isOpen:!1})},className:"visualizer-db-query-modal",shouldCloseOnClickOutside:!1},wp.element.createElement(Ut,{chart:this.props.chart,changeQuery:this.props.changeQuery,save:this.save})))}}])&&Vt(n.prototype,r),a&&Vt(n,a),t}(Qt),on=n(132);n(152);function sn(e){return(sn="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 ln(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function un(e,t){return!t||"object"!==sn(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function cn(e){return(cn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function dn(e,t){return(dn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var mn=wp.i18n.__,pn=wp.element.Component,hn=wp.components,fn=hn.Button,_n=hn.ButtonGroup,yn=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=un(this,cn(t).apply(this,arguments))).data=[],e.dates=[],e.types=["string","number","boolean","date","datetime","timeofday"],e}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&dn(e,t)}(t,e),n=t,(r=[{key:"componentWillMount",value:function(){var e=this;this.data[this.data.length]=[],this.data[this.data.length]=[],this.props.chart["visualizer-series"].map((function(t,n){e.data[0][n]=t.label,e.data[1][n]=t.type,"date"===t.type&&e.dates.push(n)})),this.props.chart["visualizer-data"].map((function(t){e.data[e.data.length]=t}))}},{key:"render",value:function(){var e=this;return wp.element.createElement("div",{className:"visualizer-chart-editor"},wp.element.createElement(on.HotTable,{data:this.data,allowInsertRow:!0,contextMenu:!0,rowHeaders:!0,colHeaders:!0,allowInvalid:!1,className:"htEditor",cells:function(t,n,r){var a;return 1===t&&(a={type:"autocomplete",source:e.types,strict:!1}),0<=e.dates.indexOf(n)&&1<t&&(a={type:"date",dateFormat:"YYYY-MM-DD",correctFormat:!0}),a}}),wp.element.createElement(_n,null,wp.element.createElement(fn,{isDefault:!0,isLarge:!0,onClick:this.props.toggleModal},mn("Close")),wp.element.createElement(fn,{isPrimary:!0,isLarge:!0,onClick:function(t){e.props.toggleModal(),e.props.editChartData(e.data,"Visualizer_Source_Csv")}},mn("Save"))))}}])&&ln(n.prototype,r),a&&ln(n,a),t}(pn);function gn(e){return(gn="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 bn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function vn(e){return(vn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function wn(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Mn(e,t){return(Mn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var kn=wp.i18n.__,Ln=wp.element,Yn=Ln.Component,Tn=Ln.Fragment,Dn=wp.components,Sn=Dn.Button,On=Dn.Modal,jn=Dn.PanelBody,xn=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t){return!t||"object"!==gn(t)&&"function"!=typeof t?wn(e):t}(this,vn(t).apply(this,arguments))).toggleModal=e.toggleModal.bind(wn(e)),e.state={isOpen:!1},e}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Mn(e,t)}(t,e),n=t,(r=[{key:"toggleModal",value:function(){this.setState({isOpen:!this.state.isOpen})}},{key:"render",value:function(){return"community"!==visualizerLocalize.isPro?wp.element.createElement(Tn,null,wp.element.createElement(jn,{title:kn("Manual Data"),initialOpen:!1},wp.element.createElement("p",null,kn("You can manually edit the chart data using a spreadsheet like editor.")),wp.element.createElement(Sn,{isPrimary:!0,isLarge:!0,isBusy:this.state.isOpen,onClick:this.toggleModal},kn("View Editor"))),this.state.isOpen&&wp.element.createElement(On,{title:"Chart Editor",onRequestClose:this.toggleModal,shouldCloseOnClickOutside:!1},wp.element.createElement(yn,{chart:this.props.chart,editChartData:this.props.editChartData,toggleModal:this.toggleModal}))):wp.element.createElement(jn,{title:kn("Manual Data"),icon:"lock",initialOpen:!1},wp.element.createElement("p",null,kn("Enable this feature in PRO version!")),wp.element.createElement(Sn,{isPrimary:!0,href:visualizerLocalize.proTeaser,target:"_blank"},kn("Buy Now")))}}])&&bn(n.prototype,r),a&&bn(n,a),t}(Yn);function En(e){return(En="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 Cn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Pn(e,t){return!t||"object"!==En(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Hn(e){return(Hn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function zn(e,t){return(zn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var An=wp.i18n.__,Nn=wp.element.Component,Fn=(wp.blockEditor||wp.editor).ColorPalette,Rn=wp.components,Wn=Rn.BaseControl,In=Rn.CheckboxControl,Bn=Rn.PanelBody,Jn=Rn.SelectControl,Un=Rn.TextControl,qn=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Pn(this,Hn(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&zn(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-chart-type"],n=this.props.chart["visualizer-settings"],r=[{label:An("The tooltip will be displayed when the user hovers over an element"),value:"focus"}];return-1>=["timeline"].indexOf(t)&&(r[1]={label:An("The tooltip will be displayed when the user selects an element"),value:"selection"}),r[2]={label:An("The tooltip will not be displayed"),value:"none"},wp.element.createElement(Bn,{title:An("General Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(Bn,{title:An("Title"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Un,{label:An("Chart Title"),help:An("Text to display above the chart."),value:n.title,onChange:function(t){n.title=t,e.props.edit(n)}}),-1>=["table","gauge","geo","pie","timeline","dataTable"].indexOf(t)&&wp.element.createElement(Jn,{label:An("Chart Title Position"),help:An("Where to place the chart title, compared to the chart area."),value:n.titlePosition?n.titlePosition:"out",options:[{label:An("Inside the chart"),value:"in"},{label:An("Outside the chart"),value:"out"},{label:An("None"),value:"none"}],onChange:function(t){n.titlePosition=t,e.props.edit(n)}}),-1>=["table","gauge","geo","timeline","dataTable"].indexOf(t)&&wp.element.createElement(Wn,{label:An("Chart Title Color")},wp.element.createElement(Fn,{value:n.titleTextStyle.color,onChange:function(t){n.titleTextStyle.color=t,e.props.edit(n)}})),-1>=["table","gauge","geo","pie","timeline","dataTable"].indexOf(t)&&wp.element.createElement(Jn,{label:An("Axes Titles Position"),help:An("Determines where to place the axis titles, compared to the chart area."),value:n.axisTitlesPosition?n.axisTitlesPosition:"out",options:[{label:An("Inside the chart"),value:"in"},{label:An("Outside the chart"),value:"out"},{label:An("None"),value:"none"}],onChange:function(t){n.axisTitlesPosition=t,e.props.edit(n)}})),-1>=["table","gauge","geo","pie","timeline","dataTable"].indexOf(t)&&wp.element.createElement(Bn,{title:An("Font Styles"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Jn,{label:An("Font Family"),help:An("The default font family for all text in the chart."),value:n.fontName?n.fontName:"Arial",options:[{label:An("Arial"),value:"Arial"},{label:An("Sans Serif"),value:"Sans Serif"},{label:An("Serif"),value:"serif"},{label:An("Arial"),value:"Arial"},{label:An("Wide"),value:"Arial black"},{label:An("Narrow"),value:"Arial Narrow"},{label:An("Comic Sans MS"),value:"Comic Sans MS"},{label:An("Courier New"),value:"Courier New"},{label:An("Garamond"),value:"Garamond"},{label:An("Georgia"),value:"Georgia"},{label:An("Tahoma"),value:"Tahoma"},{label:An("Verdana"),value:"Verdana"}],onChange:function(t){n.fontName=t,e.props.edit(n)}}),wp.element.createElement(Jn,{label:An("Font Size"),help:An("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>=["table","gauge","geo","timeline","dataTable"].indexOf(t)&&wp.element.createElement(Bn,{title:An("Legend"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Jn,{label:An("Position"),help:An("Determines where to place the legend, compared to the chart area."),value:n.legend.position?n.legend.position:"right",options:[{label:An("Left of the chart"),value:"left"},{label:An("Right of the chart"),value:"right"},{label:An("Above the chart"),value:"top"},{label:An("Below the chart"),value:"bottom"},{label:An("Inside the chart"),value:"in"},{label:An("Omit the legend"),value:"none"}],onChange:function(r){if("pie"!==t){var a="left"===r?1:0;Object.keys(n.series).map((function(e){n.series[e].targetAxisIndex=a}))}n.legend.position=r,e.props.edit(n)}}),wp.element.createElement(Jn,{label:An("Alignment"),help:An("Determines the alignment of the legend."),value:n.legend.alignment?n.legend.alignment:"15",options:[{label:An("Aligned to the start of the allocated area"),value:"start"},{label:An("Centered in the allocated area"),value:"center"},{label:An("Aligned to the end of the allocated area"),value:"end"}],onChange:function(t){n.legend.alignment=t,e.props.edit(n)}}),wp.element.createElement(Wn,{label:An("Font Color")},wp.element.createElement(Fn,{value:n.legend.textStyle.color,onChange:function(t){n.legend.textStyle.color=t,e.props.edit(n)}}))),-1>=["table","gauge","geo","dataTable","timeline"].indexOf(t)&&wp.element.createElement(Bn,{title:An("Tooltip"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Jn,{label:An("Trigger"),help:An("Determines the user interaction that causes the tooltip to be displayed."),value:n.tooltip.trigger?n.tooltip.trigger:"focus",options:r,onChange:function(t){n.tooltip.trigger=t,e.props.edit(n)}}),wp.element.createElement(Jn,{label:An("Show Color Code"),help:An("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:An("Yes"),value:"1"},{label:An("No"),value:"0"}],onChange:function(t){n.tooltip.showColorCode=t,e.props.edit(n)}}),0<=["pie"].indexOf(t)&&wp.element.createElement(Jn,{label:An("Text"),help:An("Determines what information to display when the user hovers over a pie slice."),value:n.tooltip.text?n.tooltip.text:"both",options:[{label:An("Display both the absolute value of the slice and the percentage of the whole"),value:"both"},{label:An("Display only the absolute value of the slice"),value:"value"},{label:An("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>=["table","gauge","geo","pie","timeline","dataTable"].indexOf(t)&&wp.element.createElement(Bn,{title:An("Animation"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(In,{label:An("Animate on startup?"),help:An("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(Un,{label:An("Duration"),help:An("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(Jn,{label:An("Easing"),help:An("The easing function applied to the animation."),value:n.animation.easing?n.animation.easing:"linear",options:[{label:An("Constant speed"),value:"linear"},{label:An("Start slow and speed up"),value:"in"},{label:An("Start fast and slow down"),value:"out"},{label:An("Start slow, speed up, then slow down"),value:"inAndOut"}],onChange:function(t){n.animation.easing=t,e.props.edit(n)}})))}}])&&Cn(n.prototype,r),a&&Cn(n,a),t}(Nn);function Vn(e){return(Vn="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 Gn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function $n(e,t){return!t||"object"!==Vn(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Kn(e){return(Kn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Zn(e,t){return(Zn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Qn=wp.i18n.__,Xn=wp.element,er=Xn.Component,tr=Xn.Fragment,nr=(wp.blockEditor||wp.editor).ColorPalette,rr=wp.components,ar=rr.BaseControl,ir=rr.ExternalLink,or=rr.PanelBody,sr=rr.SelectControl,lr=rr.TextControl,ur=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),$n(this,Kn(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Zn(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-chart-type"],n=this.props.chart["visualizer-settings"];return wp.element.createElement(or,{title:Qn("Horizontal Axis Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(or,{title:Qn("General Settings"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(lr,{label:Qn("Axis Title"),help:Qn("The title of the horizontal axis."),value:n.hAxis.title,onChange:function(t){n.hAxis.title=t,e.props.edit(n)}}),wp.element.createElement(sr,{label:Qn("Text Position"),help:Qn("Position of the horizontal axis text, relative to the chart area."),value:n.hAxis.textPosition?n.hAxis.textPosition:"out",options:[{label:Qn("Inside the chart"),value:"in"},{label:Qn("Outside the chart"),value:"out"},{label:Qn("None"),value:"none"}],onChange:function(t){n.hAxis.textPosition=t,e.props.edit(n)}}),wp.element.createElement(sr,{label:Qn("Direction"),help:Qn("The direction in which the values along the horizontal axis grow."),value:n.hAxis.direction?n.hAxis.direction:"1",options:[{label:Qn("Identical Direction"),value:"1"},{label:Qn("Reverse Direction"),value:"-1"}],onChange:function(t){n.hAxis.direction=t,e.props.edit(n)}}),wp.element.createElement(ar,{label:Qn("Base Line Color")},wp.element.createElement(nr,{value:n.hAxis.baselineColor,onChange:function(t){n.hAxis.baselineColor=t,e.props.edit(n)}})),wp.element.createElement(ar,{label:Qn("Axis Text Color")},wp.element.createElement(nr,{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(tr,null,wp.element.createElement(lr,{label:Qn("Number Format"),help:Qn("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,Qn("For number axis labels, this is a subset of the formatting "),wp.element.createElement(ir,{href:"http://icu-project.org/apiref/icu4c/classDecimalFormat.html#_details"},Qn("ICU pattern set.")),Qn(" 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,Qn("For date axis labels, this is a subset of the date formatting "),wp.element.createElement(ir,{href:"http://userguide.icu-project.org/formatparse/datetime#TOC-Date-Time-Format-Syntax"},Qn("ICU date and time format."))))),-1>=["column"].indexOf(t)&&wp.element.createElement(tr,null,wp.element.createElement(or,{title:Qn("Grid Lines"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(lr,{label:Qn("Count"),help:Qn("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(ar,{label:Qn("Color")},wp.element.createElement(nr,{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(or,{title:Qn("Minor Grid Lines"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(lr,{label:Qn("Count"),help:Qn("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(ar,{label:Qn("Color")},wp.element.createElement(nr,{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(or,{title:Qn("View Window"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(lr,{label:Qn("Maximun Value"),help:Qn("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(lr,{label:Qn("Minimum Value"),help:Qn("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)}}))))}}])&&Gn(n.prototype,r),a&&Gn(n,a),t}(er);function cr(e){return(cr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function dr(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function mr(e,t){return!t||"object"!==cr(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function pr(e){return(pr=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function hr(e,t){return(hr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var fr=wp.i18n.__,_r=wp.element,yr=_r.Component,gr=_r.Fragment,br=(wp.blockEditor||wp.editor).ColorPalette,vr=wp.components,wr=vr.BaseControl,Mr=vr.ExternalLink,kr=vr.PanelBody,Lr=vr.SelectControl,Yr=vr.TextControl,Tr=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),mr(this,pr(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&hr(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-chart-type"],n=this.props.chart["visualizer-settings"];return wp.element.createElement(kr,{title:fr("Vertical Axis Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(kr,{title:fr("General Settings"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Yr,{label:fr("Axis Title"),help:fr("The title of the Vertical axis."),value:n.vAxis.title,onChange:function(t){n.vAxis.title=t,e.props.edit(n)}}),wp.element.createElement(Lr,{label:fr("Text Position"),help:fr("Position of the Vertical axis text, relative to the chart area."),value:n.vAxis.textPosition?n.vAxis.textPosition:"out",options:[{label:fr("Inside the chart"),value:"in"},{label:fr("Outside the chart"),value:"out"},{label:fr("None"),value:"none"}],onChange:function(t){n.vAxis.textPosition=t,e.props.edit(n)}}),wp.element.createElement(Lr,{label:fr("Direction"),help:fr("The direction in which the values along the Vertical axis grow."),value:n.vAxis.direction?n.vAxis.direction:"1",options:[{label:fr("Identical Direction"),value:"1"},{label:fr("Reverse Direction"),value:"-1"}],onChange:function(t){n.vAxis.direction=t,e.props.edit(n)}}),wp.element.createElement(wr,{label:fr("Base Line Color")},wp.element.createElement(br,{value:n.vAxis.baselineColor,onChange:function(t){n.vAxis.baselineColor=t,e.props.edit(n)}})),wp.element.createElement(wr,{label:fr("Axis Text Color")},wp.element.createElement(br,{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(gr,null,wp.element.createElement(Yr,{label:fr("Number Format"),help:fr("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,fr("For number axis labels, this is a subset of the formatting "),wp.element.createElement(Mr,{href:"http://icu-project.org/apiref/icu4c/classDecimalFormat.html#_details"},fr("ICU pattern set.")),fr(" 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,fr("For date axis labels, this is a subset of the date formatting "),wp.element.createElement(Mr,{href:"http://userguide.icu-project.org/formatparse/datetime#TOC-Date-Time-Format-Syntax"},fr("ICU date and time format."))))),-1>=["bar"].indexOf(t)&&wp.element.createElement(gr,null,wp.element.createElement(kr,{title:fr("Grid Lines"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Yr,{label:fr("Count"),help:fr("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(wr,{label:fr("Color")},wp.element.createElement(br,{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(kr,{title:fr("Minor Grid Lines"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Yr,{label:fr("Count"),help:fr("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(wr,{label:fr("Color")},wp.element.createElement(br,{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(kr,{title:fr("View Window"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Yr,{label:fr("Maximun Value"),help:fr("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(Yr,{label:fr("Minimum Value"),help:fr("The minimum vertical data value to render."),value:n.vAxis.viewWindow?n.vAxis.viewWindow.min:"",onChange:function(t){n.vAxis.viewWindow||(n.vAxis.viewWindow={}),n.vAxis.viewWindow.min=t,e.props.edit(n)}}))))}}])&&dr(n.prototype,r),a&&dr(n,a),t}(yr);function Dr(e){return(Dr="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 Sr(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Or(e,t){return!t||"object"!==Dr(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function jr(e){return(jr=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function xr(e,t){return(xr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Er=wp.i18n.__,Cr=wp.element,Pr=Cr.Component,Hr=Cr.Fragment,zr=(wp.blockEditor||wp.editor).ColorPalette,Ar=wp.components,Nr=Ar.BaseControl,Fr=Ar.ExternalLink,Rr=Ar.PanelBody,Wr=Ar.SelectControl,Ir=Ar.TextControl,Br=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Or(this,jr(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&xr(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(Rr,{title:Er("Pie Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(Hr,null,wp.element.createElement(Ir,{label:Er("Number Format"),help:Er("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,Er("For number axis labels, this is a subset of the formatting "),wp.element.createElement(Fr,{href:"http://icu-project.org/apiref/icu4c/classDecimalFormat.html#_details"},Er("ICU pattern set.")),Er(" 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,Er("For date axis labels, this is a subset of the date formatting "),wp.element.createElement(Fr,{href:"http://userguide.icu-project.org/formatparse/datetime#TOC-Date-Time-Format-Syntax"},Er("ICU date and time format.")))),wp.element.createElement(Wr,{label:Er("Is 3D"),help:Er("If set to yes, displays a three-dimensional chart."),value:t.is3D?t.is3D:"0",options:[{label:Er("Yes"),value:"1"},{label:Er("No"),value:"0"}],onChange:function(n){t.is3D=n,e.props.edit(t)}}),wp.element.createElement(Wr,{label:Er("Reverse Categories"),help:Er("If set to yes, will draw slices counterclockwise."),value:t.reverseCategories?t.reverseCategories:"0",options:[{label:Er("Yes"),value:"1"},{label:Er("No"),value:"0"}],onChange:function(n){t.reverseCategories=n,e.props.edit(t)}}),wp.element.createElement(Wr,{label:Er("Slice Text"),help:Er("The content of the text displayed on the slice."),value:t.pieSliceText?t.pieSliceText:"percentage",options:[{label:Er("The percentage of the slice size out of the total"),value:"percentage"},{label:Er("The quantitative value of the slice"),value:"value"},{label:Er("The name of the slice"),value:"label"},{label:Er("The quantitative value and percentage of the slice"),value:"value-and-percentage"},{label:Er("No text is displayed"),value:"none"}],onChange:function(n){t.pieSliceText=n,e.props.edit(t)}}),wp.element.createElement(Ir,{label:Er("Pie Hole"),help:Er("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:Er("0.5"),value:t.pieHole,onChange:function(n){t.pieHole=n,e.props.edit(t)}}),wp.element.createElement(Ir,{label:Er("Start Angle"),help:Er("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(Nr,{label:Er("Slice Border Color")},wp.element.createElement(zr,{value:t.pieSliceBorderColor,onChange:function(n){t.pieSliceBorderColor=n,e.props.edit(t)}})))}}])&&Sr(n.prototype,r),a&&Sr(n,a),t}(Pr);function Jr(e){return(Jr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ur(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function qr(e,t){return!t||"object"!==Jr(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Vr(e){return(Vr=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Gr(e,t){return(Gr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var $r=wp.i18n.__,Kr=wp.element.Component,Zr=(wp.blockEditor||wp.editor).ColorPalette,Qr=wp.components,Xr=Qr.BaseControl,ea=Qr.PanelBody,ta=Qr.TextControl,na=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),qr(this,Vr(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Gr(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(ea,{title:$r("Residue Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(ta,{label:$r("Visibility Threshold"),help:$r("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:$r("0.001388889"),value:t.sliceVisibilityThreshold,onChange:function(n){t.sliceVisibilityThreshold=n,e.props.edit(t)}}),wp.element.createElement(ta,{label:$r("Residue Slice Label"),help:$r("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(Xr,{label:$r("Residue Slice Color")},wp.element.createElement(Zr,{value:t.pieResidueSliceColor,onChange:function(n){t.pieResidueSliceColor=n,e.props.edit(t)}})))}}])&&Ur(n.prototype,r),a&&Ur(n,a),t}(Kr);function ra(e){return(ra="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function aa(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ia(e,t){return!t||"object"!==ra(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function oa(e){return(oa=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function sa(e,t){return(sa=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var la=wp.i18n.__,ua=wp.element,ca=ua.Component,da=ua.Fragment,ma=wp.components,pa=ma.PanelBody,ha=ma.SelectControl,fa=ma.TextControl,_a=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),ia(this,oa(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&sa(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-chart-type"],n=this.props.chart["visualizer-settings"];return wp.element.createElement(pa,{title:la("Lines Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(fa,{label:la("Line Width"),help:la("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(fa,{label:la("Point Size"),help:la("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(ha,{label:la("Curve Type"),help:la("Determines whether the series has to be presented in the legend or not."),value:n.curveType?n.curveType:"none",options:[{label:la("Straight line without curve"),value:"none"},{label:la("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(ha,{label:la("Focus Target"),help:la("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:la("Focus on a single data point."),value:"datum"},{label:la("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(ha,{label:la("Selection Mode"),help:la("Determines how many data points an user can select on a chart."),value:n.selectionMode?n.selectionMode:"single",options:[{label:la("Single data point"),value:"single"},{label:la("Multiple data points"),value:"multiple"}],onChange:function(t){n.selectionMode=t,e.props.edit(n)}}),wp.element.createElement(ha,{label:la("Aggregation Target"),help:la("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:la("Group selected data by x-value"),value:"category"},{label:la("Group selected data by series"),value:"series"},{label:la("Group selected data by x-value if all selections have the same x-value, and by series otherwise"),value:"auto"},{label:la("Show only one tooltip per selection"),value:"none"}],onChange:function(t){n.aggregationTarget=t,e.props.edit(n)}}),wp.element.createElement(fa,{label:la("Point Opacity"),help:la("The transparency of data points, with 1.0 being completely opaque and 0.0 fully transparent."),value:n.dataOpacity,onChange:function(t){n.dataOpacity=t,e.props.edit(n)}}),-1>=["scatter","line"].indexOf(t)&&wp.element.createElement(da,null,wp.element.createElement(fa,{label:la("Area Opacity"),help:la("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(ha,{label:la("Is Stacked"),help:la("If set to yes, series elements are stacked."),value:n.isStacked?n.isStacked:"0",options:[{label:la("Yes"),value:"1"},{label:la("No"),value:"0"}],onChange:function(t){n.isStacked=t,e.props.edit(n)}})),-1>=["scatter","area"].indexOf(t)&&wp.element.createElement(ha,{label:la("Interpolate Nulls"),help:la("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:la("Yes"),value:"1"},{label:la("No"),value:"0"}],onChange:function(t){n.interpolateNulls=t,e.props.edit(n)}}))}}])&&aa(n.prototype,r),a&&aa(n,a),t}(ca);function ya(e){return(ya="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 ga(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ba(e,t){return!t||"object"!==ya(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function va(e){return(va=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function wa(e,t){return(wa=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Ma=wp.i18n.__,ka=wp.element.Component,La=wp.components,Ya=La.PanelBody,Ta=La.SelectControl,Da=La.TextControl,Sa=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),ba(this,va(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&wa(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(Ya,{title:Ma("Bars Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(Ta,{label:Ma("Focus Target"),help:Ma("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:Ma("Focus on a single data point."),value:"datum"},{label:Ma("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(Ta,{label:Ma("Is Stacked"),help:Ma("If set to yes, series elements are stacked."),value:t.isStacked?t.isStacked:"0",options:[{label:Ma("Yes"),value:"1"},{label:Ma("No"),value:"0"}],onChange:function(n){t.isStacked=n,e.props.edit(t)}}),wp.element.createElement(Da,{label:Ma("Bars Opacity"),help:Ma("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)}}))}}])&&ga(n.prototype,r),a&&ga(n,a),t}(ka);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 ja(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function xa(e,t){return!t||"object"!==Oa(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Ea(e){return(Ea=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Ca(e,t){return(Ca=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Pa=wp.i18n.__,Ha=wp.element.Component,za=(wp.blockEditor||wp.editor).ColorPalette,Aa=wp.components,Na=Aa.BaseControl,Fa=Aa.PanelBody,Ra=Aa.SelectControl,Wa=Aa.TextControl,Ia=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),xa(this,Ea(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ca(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(Fa,{title:Pa("Candles Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(Fa,{title:Pa("General Settings"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Ra,{label:Pa("Focus Target"),help:Pa("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:Pa("Focus on a single data point."),value:"datum"},{label:Pa("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(Ra,{label:Pa("Selection Mode"),help:Pa("Determines how many data points an user can select on a chart."),value:t.selectionMode?t.selectionMode:"single",options:[{label:Pa("Single data point"),value:"single"},{label:Pa("Multiple data points"),value:"multiple"}],onChange:function(n){t.selectionMode=n,e.props.edit(t)}}),wp.element.createElement(Ra,{label:Pa("Aggregation Target"),help:Pa("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:Pa("Group selected data by x-value"),value:"category"},{label:Pa("Group selected data by series"),value:"series"},{label:Pa("Group selected data by x-value if all selections have the same x-value, and by series otherwise"),value:"auto"},{label:Pa("Show only one tooltip per selection"),value:"none"}],onChange:function(n){t.aggregationTarget=n,e.props.edit(t)}})),wp.element.createElement(Fa,{title:Pa("Failing Candles"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Wa,{label:Pa("Stroke Width"),help:Pa("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(Na,{label:Pa("Stroke Color")},wp.element.createElement(za,{value:t.candlestick.fallingColor.stroke,onChange:function(n){t.candlestick.fallingColor.stroke=n,e.props.edit(t)}})),wp.element.createElement(Na,{label:Pa("Fill Color")},wp.element.createElement(za,{value:t.candlestick.fallingColor.fill,onChange:function(n){t.candlestick.fallingColor.fill=n,e.props.edit(t)}}))),wp.element.createElement(Fa,{title:Pa("Rising Candles"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Wa,{label:Pa("Stroke Width"),help:Pa("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(Na,{label:Pa("Stroke Color")},wp.element.createElement(za,{value:t.candlestick.risingColor.stroke,onChange:function(n){t.candlestick.risingColor.stroke=n,e.props.edit(t)}})),wp.element.createElement(Na,{label:Pa("Fill Color")},wp.element.createElement(za,{value:t.candlestick.risingColor.fill,onChange:function(n){t.candlestick.risingColor.fill=n,e.props.edit(t)}}))))}}])&&ja(n.prototype,r),a&&ja(n,a),t}(Ha);function Ba(e){return(Ba="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 Ja(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Ua(e,t){return!t||"object"!==Ba(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function qa(e){return(qa=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Va(e,t){return(Va=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Ga=wp.i18n.__,$a=wp.element.Component,Ka=wp.components,Za=Ka.ExternalLink,Qa=Ka.PanelBody,Xa=Ka.SelectControl,ei=Ka.TextControl,ti=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Ua(this,qa(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Va(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(Qa,{title:Ga("Map Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(Qa,{title:Ga("API"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(ei,{label:Ga("API Key"),help:Ga("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(Za,{href:"https://developers.google.com/maps/documentation/javascript/get-api-key"},Ga("Get API Keys"))),wp.element.createElement(Qa,{title:Ga("Region"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement("ul",{className:"visualizer-list"},wp.element.createElement("li",null,Ga("A map of the entire world using 'world'.")),wp.element.createElement("li",null,Ga("A continent or a sub-continent, specified by its 3-digit code, e.g., '011' for Western Africa. "),wp.element.createElement(Za,{href:"https://google-developers.appspot.com/chart/interactive/docs/gallery/geochart#Continent_Hierarchy"},Ga("More info here."))),wp.element.createElement("li",null,Ga("A country, specified by its ISO 3166-1 alpha-2 code, e.g., 'AU' for Australia. "),wp.element.createElement(Za,{href:"http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2"},Ga("More info here."))),wp.element.createElement("li",null,Ga("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(Za,{href:"http://en.wikipedia.org/wiki/ISO_3166-2:US"},Ga("More info here.")))),wp.element.createElement(ei,{label:Ga("Reigion"),help:Ga("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(Qa,{title:Ga("Resolution"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement("ul",{className:"visualizer-list"},wp.element.createElement("li",null,Ga("'countries' - Supported for all regions, except for US state regions.")),wp.element.createElement("li",null,Ga("'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,Ga("'metros' - Supported for the US country region and US state regions only."))),wp.element.createElement(Xa,{label:Ga("Resolution"),help:Ga("The resolution of the map borders."),value:t.resolution?t.resolution:"countries",options:[{label:Ga("Countries"),value:"countries"},{label:Ga("Provinces"),value:"provinces"},{label:Ga("Metros"),value:"metros"}],onChange:function(n){t.resolution=n,e.props.edit(t)}})),wp.element.createElement(Qa,{title:Ga("Display Mode"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement("ul",{className:"visualizer-list"},wp.element.createElement("li",null,Ga("'auto' - Choose based on the format of the data.")),wp.element.createElement("li",null,Ga("'regions' - This is a region map.")),wp.element.createElement("li",null,Ga("'markers' - This is a marker map."))),wp.element.createElement(Xa,{label:Ga("Display Mode"),help:Ga("Determines which type of map this is."),value:t.displayMode?t.displayMode:"auto",options:[{label:Ga("Auto"),value:"auto"},{label:Ga("Regions"),value:"regions"},{label:Ga("Markers"),value:"markers"}],onChange:function(n){t.displayMode=n,e.props.edit(t)}})),wp.element.createElement(Qa,{title:Ga("Tooltip"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Xa,{label:Ga("Trigger"),help:Ga("Determines the user interaction that causes the tooltip to be displayed."),value:t.tooltip.trigger?t.tooltip.trigger:"focus",options:[{label:Ga("The tooltip will be displayed when the user hovers over an element"),value:"focus"},{label:Ga("The tooltip will not be displayed"),value:"none"}],onChange:function(n){t.tooltip.trigger=n,e.props.edit(t)}})))}}])&&Ja(n.prototype,r),a&&Ja(n,a),t}($a);function ni(e){return(ni="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ri(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ai(e,t){return!t||"object"!==ni(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function ii(e){return(ii=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function oi(e,t){return(oi=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var si=wp.i18n.__,li=wp.element.Component,ui=(wp.blockEditor||wp.editor).ColorPalette,ci=wp.components,di=ci.BaseControl,mi=ci.PanelBody,pi=ci.TextControl,hi=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),ai(this,ii(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&oi(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(mi,{title:si("Color Axis"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(pi,{label:si("Minimum Values"),help:si("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(pi,{label:si("Maximum Values"),help:si("Determines the maximum values of color axis."),value:t.colorAxis.maxValue,onChange:function(n){t.colorAxis.maxValue=n,e.props.edit(t)}}),wp.element.createElement(di,{label:si("Minimum Value")},wp.element.createElement(ui,{value:t.colorAxis.colors[0],onChange:function(n){t.colorAxis.colors[0]=n,e.props.edit(t)}})),wp.element.createElement(di,{label:si("Intermediate Value")},wp.element.createElement(ui,{value:t.colorAxis.colors[1],onChange:function(n){t.colorAxis.colors[1]=n,e.props.edit(t)}})),wp.element.createElement(di,{label:si("Maximum Value")},wp.element.createElement(ui,{value:t.colorAxis.colors[2],onChange:function(n){t.colorAxis.colors[2]=n,e.props.edit(t)}})),wp.element.createElement(di,{label:si("Dateless Region")},wp.element.createElement(ui,{value:t.datalessRegionColor,onChange:function(n){t.datalessRegionColor=n,e.props.edit(t)}})))}}])&&ri(n.prototype,r),a&&ri(n,a),t}(li);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 _i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function yi(e,t){return!t||"object"!==fi(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function gi(e){return(gi=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function bi(e,t){return(bi=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var vi=wp.i18n.__,wi=wp.element,Mi=wi.Component,ki=wi.Fragment,Li=wp.components,Yi=Li.ExternalLink,Ti=Li.PanelBody,Di=Li.TextControl,Si=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),yi(this,gi(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&bi(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(Ti,{title:vi("Size Axis"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(Di,{label:vi("Minimum Values"),help:vi("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(Di,{label:vi("Maximum Values"),help:vi("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(Di,{label:vi("Minimum Marker Radius"),help:vi("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(Di,{label:vi("Maximum Marker Radius"),help:vi("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(Di,{label:vi("Marker Opacity"),help:vi("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(ki,null,wp.element.createElement(Di,{label:vi("Number Format"),help:vi("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,vi("For number axis labels, this is a subset of the formatting "),wp.element.createElement(Yi,{href:"http://icu-project.org/apiref/icu4c/classDecimalFormat.html#_details"},vi("ICU pattern set.")),vi(" 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."))))}}])&&_i(n.prototype,r),a&&_i(n,a),t}(Mi);function Oi(e){return(Oi="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 ji(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function xi(e,t){return!t||"object"!==Oi(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Ei(e){return(Ei=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Ci(e,t){return(Ci=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Pi=wp.i18n.__,Hi=wp.element.Component,zi=wp.components,Ai=zi.PanelBody,Ni=zi.SelectControl,Fi=zi.TextControl,Ri=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),xi(this,Ei(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ci(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(Ai,{title:Pi("Magnifying Glass"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(Ni,{label:Pi("Enabled"),help:Pi("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:Pi("Yes"),value:"1"},{label:Pi("No"),value:"0"}],onChange:function(n){t.magnifyingGlass.enable=n,e.props.edit(t)}}),wp.element.createElement(Fi,{label:Pi("Zoom Factor"),help:Pi("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)}}))}}])&&ji(n.prototype,r),a&&ji(n,a),t}(Hi);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 Ii(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Bi(e,t){return!t||"object"!==Wi(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Ji(e){return(Ji=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Ui(e,t){return(Ui=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var qi=wp.i18n.__,Vi=wp.element,Gi=Vi.Component,$i=Vi.Fragment,Ki=(wp.blockEditor||wp.editor).ColorPalette,Zi=wp.components,Qi=Zi.BaseControl,Xi=Zi.ExternalLink,eo=Zi.PanelBody,to=Zi.TextControl,no=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Bi(this,Ji(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ui(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(eo,{title:qi("Gauge Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(eo,{title:qi("Tick Settings"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(to,{label:qi("Minimum Values"),help:qi("Determines the minimum values of gauge."),value:t.min,onChange:function(n){t.min=n,e.props.edit(t)}}),wp.element.createElement(to,{label:qi("Maximum Values"),help:qi("Determines the maximum values of gauge."),value:t.max,onChange:function(n){t.max=n,e.props.edit(t)}}),wp.element.createElement(to,{label:qi("Minor Ticks"),help:qi("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($i,null,wp.element.createElement(to,{label:qi("Number Format"),help:qi("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,qi("For number axis labels, this is a subset of the formatting "),wp.element.createElement(Xi,{href:"http://icu-project.org/apiref/icu4c/classDecimalFormat.html#_details"},qi("ICU pattern set.")),qi(" 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(eo,{title:qi("Green Color"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(to,{label:qi("Minimum Range"),help:qi("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(to,{label:qi("Maximum Range"),help:qi("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(Qi,{label:qi("Green Color")},wp.element.createElement(Ki,{value:t.greenColor,onChange:function(n){t.greenColor=n,e.props.edit(t)}}))),wp.element.createElement(eo,{title:qi("Yellow Color"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(to,{label:qi("Minimum Range"),help:qi("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(to,{label:qi("Maximum Range"),help:qi("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(Qi,{label:qi("Yellow Color")},wp.element.createElement(Ki,{value:t.yellowColor,onChange:function(n){t.yellowColor=n,e.props.edit(t)}}))),wp.element.createElement(eo,{title:qi("Red Color"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(to,{label:qi("Minimum Range"),help:qi("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(to,{label:qi("Maximum Range"),help:qi("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(Qi,{label:qi("Red Color")},wp.element.createElement(Ki,{value:t.redColor,onChange:function(n){t.redColor=n,e.props.edit(t)}}))))}}])&&Ii(n.prototype,r),a&&Ii(n,a),t}(Gi);function ro(e){return(ro="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 ao(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function io(e){return(io=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function oo(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function so(e,t){return(so=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var lo=wp.i18n.__,uo=wp.element.Component,co=(wp.blockEditor||wp.editor).ColorPalette,mo=wp.components,po=mo.BaseControl,ho=mo.CheckboxControl,fo=mo.PanelBody,_o=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t){return!t||"object"!==ro(t)&&"function"!=typeof t?oo(e):t}(this,io(t).apply(this,arguments))).mapValues=e.mapValues.bind(oo(e)),e}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&so(e,t)}(t,e),n=t,(r=[{key:"mapValues",value:function(e,t){return void 0===e.timeline?e[t]:e.timeline[t]}},{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return this.mapValues(t,"showRowLabels"),wp.element.createElement(fo,{title:lo("Timeline Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(ho,{label:lo("Show Row Label"),help:lo("If checked, shows the category/row label."),checked:Number(this.mapValues(t,"showRowLabels")),onChange:function(n){void 0===t.timeline&&(t.timeline={}),t.timeline.showRowLabels=!Number(e.mapValues(t,"showRowLabels")),e.props.edit(t)}}),wp.element.createElement(ho,{label:lo("Group by Row Label"),help:lo("If checked, groups the bars on the basis of the category/row label."),checked:Number(this.mapValues(t,"groupByRowLabel")),onChange:function(n){void 0===t.timeline&&(t.timeline={}),t.timeline.groupByRowLabel=!Number(e.mapValues(t,"groupByRowLabel")),e.props.edit(t)}}),wp.element.createElement(ho,{label:lo("Color by Row Label"),help:lo("If checked, colors every bar on the row the same."),checked:Number(this.mapValues(t,"colorByRowLabel")),onChange:function(n){void 0===t.timeline&&(t.timeline={}),t.timeline.colorByRowLabel=!Number(e.mapValues(t,"colorByRowLabel")),e.props.edit(t)}}),wp.element.createElement(po,{label:lo("Single Color")},wp.element.createElement(co,{value:this.mapValues(t,"singleColor"),onChange:function(n){void 0===t.timeline&&(t.timeline={}),t.timeline.singleColor=n,e.props.edit(t)}})))}}])&&ao(n.prototype,r),a&&ao(n,a),t}(uo);function yo(e){return(yo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function go(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function bo(e,t){return!t||"object"!==yo(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function vo(e){return(vo=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function wo(e,t){return(wo=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Mo=wp.i18n.__,ko=wp.element,Lo=ko.Component,Yo=ko.Fragment,To=wp.components,Do=To.CheckboxControl,So=To.PanelBody,Oo=To.SelectControl,jo=To.TextControl,xo=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),bo(this,vo(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&wo(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"],n=this.props.chart["visualizer-chart-type"];return wp.element.createElement(So,{title:Mo("Table Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},"dataTable"===n?wp.element.createElement(Yo,null,wp.element.createElement(Do,{label:Mo("Enable Pagination"),help:Mo("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(jo,{label:Mo("Number of rows per page"),help:Mo("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(Oo,{label:Mo("Pagination type"),help:Mo("Determines what type of pagination options to show."),value:t.pagingType,options:[{label:Mo("Page number buttons only"),value:"numbers"},{label:Mo("'Previous' and 'Next' buttons only"),value:"simple"},{label:Mo("'Previous' and 'Next' buttons, plus page numbers"),value:"simple_numbers"},{label:Mo("'First', 'Previous', 'Next' and 'Last' buttons"),value:"full"},{label:Mo("'First', 'Previous', 'Next' and 'Last' buttons, plus page numbers"),value:"full_numbers"},{label:Mo("'First' and 'Last' buttons, plus page numbers"),value:"first_last_numbers"}],onChange:function(n){t.pagingType=n,e.props.edit(t)}}),wp.element.createElement(Do,{label:Mo("Scroll Collapse"),help:Mo("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(jo,{label:Mo("Vertical Height"),help:Mo("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(Do,{label:Mo("Disable Sort"),help:Mo("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(Do,{label:Mo("Freeze Header/Footer"),help:Mo("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(Do,{label:Mo("Responsive"),help:Mo("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(Yo,null,wp.element.createElement(Oo,{label:Mo("Enable Pagination"),help:Mo("To enable paging through the data."),value:t.page?t.page:"disable",options:[{label:Mo("Enable"),value:"enable"},{label:Mo("Disable"),value:"disable"}],onChange:function(n){t.page=n,e.props.edit(t)}}),wp.element.createElement(jo,{label:Mo("Number of rows per page"),help:Mo("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(Oo,{label:Mo("Disable Sort"),help:Mo("To disable sorting on columns."),value:t.sort?t.sort:"enable",options:[{label:Mo("Enable"),value:"enable"},{label:Mo("Disable"),value:"disable"}],onChange:function(n){t.sort=n,e.props.edit(t)}}),wp.element.createElement(jo,{label:Mo("Freeze Columns"),help:Mo("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(Do,{label:Mo("Allow HTML"),help:Mo("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(Do,{label:Mo("Right to Left table"),help:Mo("Adds basic support for right-to-left languages."),checked:Number(t.rtlTable),onChange:function(n){t.rtlTable=!Number(t.rtlTable),e.props.edit(t)}})))}}])&&go(n.prototype,r),a&&go(n,a),t}(Lo);function Eo(e){return(Eo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Co(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Po(e,t){return!t||"object"!==Eo(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Ho(e){return(Ho=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function zo(e,t){return(zo=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Ao=wp.i18n.__,No=wp.element,Fo=No.Component,Ro=No.Fragment,Wo=(wp.blockEditor||wp.editor).ColorPalette,Io=wp.components,Bo=Io.BaseControl,Jo=Io.PanelBody,Uo=Io.TextControl,qo=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Po(this,Ho(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&zo(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"],n=this.props.chart["visualizer-chart-type"];return wp.element.createElement(Jo,{title:Ao("Row/Cell Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},"dataTable"===n?wp.element.createElement(Ro,null,wp.element.createElement(Jo,{title:Ao("Odd Table Row"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Bo,{label:Ao("Background Color")},wp.element.createElement(Wo,{value:t.customcss.oddTableRow["background-color"],onChange:function(n){t.customcss.oddTableRow["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(Bo,{label:Ao("Color")},wp.element.createElement(Wo,{value:t.customcss.oddTableRow.color,onChange:function(n){t.customcss.oddTableRow.color=n,e.props.edit(t)}})),wp.element.createElement(Uo,{label:Ao("Text Orientation"),help:Ao("In degrees."),type:"number",value:t.customcss.oddTableRow.transform,onChange:function(n){t.customcss.oddTableRow.transform=n,e.props.edit(t)}})),wp.element.createElement(Jo,{title:Ao("Even Table Row"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Bo,{label:Ao("Background Color")},wp.element.createElement(Wo,{value:t.customcss.evenTableRow["background-color"],onChange:function(n){t.customcss.evenTableRow["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(Bo,{label:Ao("Color")},wp.element.createElement(Wo,{value:t.customcss.evenTableRow.color,onChange:function(n){t.customcss.evenTableRow.color=n,e.props.edit(t)}})),wp.element.createElement(Uo,{label:Ao("Text Orientation"),help:Ao("In degrees."),type:"number",value:t.customcss.evenTableRow.transform,onChange:function(n){t.customcss.evenTableRow.transform=n,e.props.edit(t)}})),wp.element.createElement(Jo,{title:Ao("Table Cell"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Bo,{label:Ao("Background Color")},wp.element.createElement(Wo,{value:t.customcss.tableCell["background-color"],onChange:function(n){t.customcss.tableCell["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(Bo,{label:Ao("Color")},wp.element.createElement(Wo,{value:t.customcss.tableCell.color,onChange:function(n){t.customcss.tableCell.color=n,e.props.edit(t)}})),wp.element.createElement(Uo,{label:Ao("Text Orientation"),help:Ao("In degrees."),type:"number",value:t.customcss.tableCell.transform,onChange:function(n){t.customcss.tableCell.transform=n,e.props.edit(t)}}))):wp.element.createElement(Ro,null,wp.element.createElement(Jo,{title:Ao("Header Row"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Bo,{label:Ao("Background Color")},wp.element.createElement(Wo,{value:t.customcss.headerRow["background-color"],onChange:function(n){t.customcss.headerRow["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(Bo,{label:Ao("Color")},wp.element.createElement(Wo,{value:t.customcss.headerRow.color,onChange:function(n){t.customcss.headerRow.color=n,e.props.edit(t)}})),wp.element.createElement(Uo,{label:Ao("Text Orientation"),help:Ao("In degrees."),type:"number",value:t.customcss.headerRow.transform,onChange:function(n){t.customcss.headerRow.transform=n,e.props.edit(t)}})),wp.element.createElement(Jo,{title:Ao("Table Row"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Bo,{label:Ao("Background Color")},wp.element.createElement(Wo,{value:t.customcss.tableRow["background-color"],onChange:function(n){t.customcss.tableRow["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(Bo,{label:Ao("Color")},wp.element.createElement(Wo,{value:t.customcss.tableRow.color,onChange:function(n){t.customcss.tableRow.color=n,e.props.edit(t)}})),wp.element.createElement(Uo,{label:Ao("Text Orientation"),help:Ao("In degrees."),type:"number",value:t.customcss.tableRow.transform,onChange:function(n){t.customcss.tableRow.transform=n,e.props.edit(t)}})),wp.element.createElement(Jo,{title:Ao("Odd Table Row"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Bo,{label:Ao("Background Color")},wp.element.createElement(Wo,{value:t.customcss.oddTableRow["background-color"],onChange:function(n){t.customcss.oddTableRow["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(Bo,{label:Ao("Color")},wp.element.createElement(Wo,{value:t.customcss.oddTableRow.color,onChange:function(n){t.customcss.oddTableRow.color=n,e.props.edit(t)}})),wp.element.createElement(Uo,{label:Ao("Text Orientation"),help:Ao("In degrees."),type:"number",value:t.customcss.oddTableRow.transform,onChange:function(n){t.customcss.oddTableRow.transform=n,e.props.edit(t)}})),wp.element.createElement(Jo,{title:Ao("Selected Table Row"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Bo,{label:Ao("Background Color")},wp.element.createElement(Wo,{value:t.customcss.selectedTableRow["background-color"],onChange:function(n){t.customcss.selectedTableRow["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(Bo,{label:Ao("Color")},wp.element.createElement(Wo,{value:t.customcss.selectedTableRow.color,onChange:function(n){t.customcss.selectedTableRow.color=n,e.props.edit(t)}})),wp.element.createElement(Uo,{label:Ao("Text Orientation"),help:Ao("In degrees."),type:"number",value:t.customcss.selectedTableRow.transform,onChange:function(n){t.customcss.selectedTableRow.transform=n,e.props.edit(t)}})),wp.element.createElement(Jo,{title:Ao("Hover Table Row"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Bo,{label:Ao("Background Color")},wp.element.createElement(Wo,{value:t.customcss.hoverTableRow["background-color"],onChange:function(n){t.customcss.hoverTableRow["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(Bo,{label:Ao("Color")},wp.element.createElement(Wo,{value:t.customcss.hoverTableRow.color,onChange:function(n){t.customcss.hoverTableRow.color=n,e.props.edit(t)}})),wp.element.createElement(Uo,{label:Ao("Text Orientation"),help:Ao("In degrees."),type:"number",value:t.customcss.hoverTableRow.transform,onChange:function(n){t.customcss.hoverTableRow.transform=n,e.props.edit(t)}})),wp.element.createElement(Jo,{title:Ao("Header Cell"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Bo,{label:Ao("Background Color")},wp.element.createElement(Wo,{value:t.customcss.headerCell["background-color"],onChange:function(n){t.customcss.headerCell["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(Bo,{label:Ao("Color")},wp.element.createElement(Wo,{value:t.customcss.headerCell.color,onChange:function(n){t.customcss.headerCell.color=n,e.props.edit(t)}})),wp.element.createElement(Uo,{label:Ao("Text Orientation"),help:Ao("In degrees."),type:"number",value:t.customcss.headerCell.transform,onChange:function(n){t.customcss.headerCell.transform=n,e.props.edit(t)}})),wp.element.createElement(Jo,{title:Ao("Table Cell"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Bo,{label:Ao("Background Color")},wp.element.createElement(Wo,{value:t.customcss.tableCell["background-color"],onChange:function(n){t.customcss.tableCell["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(Bo,{label:Ao("Color")},wp.element.createElement(Wo,{value:t.customcss.tableCell.color,onChange:function(n){t.customcss.tableCell.color=n,e.props.edit(t)}})),wp.element.createElement(Uo,{label:Ao("Text Orientation"),help:Ao("In degrees."),type:"number",value:t.customcss.tableCell.transform,onChange:function(n){t.customcss.tableCell.transform=n,e.props.edit(t)}}))))}}])&&Co(n.prototype,r),a&&Co(n,a),t}(Fo);function Vo(e){return(Vo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Go(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function $o(e,t){return!t||"object"!==Vo(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Ko(e){return(Ko=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Zo(e,t){return(Zo=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Qo=wp.i18n.__,Xo=wp.element.Component,es=wp.components,ts=es.PanelBody,ns=es.SelectControl,rs=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),$o(this,Ko(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Zo(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(ts,{title:Qo("Combo Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(ns,{label:Qo("Chart Type"),help:Qo("Select the default chart type."),value:t.seriesType?t.seriesType:"area",options:[{label:Qo("Area"),value:"area"},{label:Qo("Bar"),value:"bars"},{label:Qo("Candlesticks"),value:"candlesticks"},{label:Qo("Line"),value:"line"},{label:Qo("Stepped Area"),value:"steppedArea"}],onChange:function(n){t.seriesType=n,e.props.edit(t)}}))}}])&&Go(n.prototype,r),a&&Go(n,a),t}(Xo);function as(e){return(as="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 is(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function os(e,t){return!t||"object"!==as(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function ss(e){return(ss=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ls(e,t){return(ls=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var us=wp.i18n.__,cs=wp.element,ds=cs.Component,ms=cs.Fragment,ps=(wp.blockEditor||wp.editor).ColorPalette,hs=wp.components,fs=hs.BaseControl,_s=hs.ExternalLink,ys=hs.PanelBody,gs=hs.SelectControl,bs=hs.TextControl,vs=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),os(this,ss(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ls(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:function(){var e=this.props.chart["visualizer-settings"];Object.keys(e.series).map((function(t){void 0!==e.series[t]&&(e.series[t].temp=1)})),this.props.edit(e)}},{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-chart-type"],n=this.props.chart["visualizer-settings"],r=this.props.chart["visualizer-series"];return wp.element.createElement(ys,{title:us("Series Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},Object.keys(n.series).map((function(a,i){return a++,wp.element.createElement(ys,{title:r[a].label,className:"visualizer-inner-sections",initialOpen:!1},-1>=["table","pie"].indexOf(t)&&wp.element.createElement(gs,{label:us("Visible In Legend"),help:us("Determines whether the series has to be presented in the legend or not."),value:n.series[i].visibleInLegend?n.series[i].visibleInLegend:"1",options:[{label:us("Yes"),value:"1"},{label:us("No"),value:"0"}],onChange:function(t){n.series[i].visibleInLegend=t,e.props.edit(n)}}),-1>=["table","candlestick","combo","column","bar"].indexOf(t)&&wp.element.createElement(ms,null,wp.element.createElement(bs,{label:us("Line Width"),help:us("Overrides the global line width value for this series."),value:n.series[i].lineWidth,onChange:function(t){n.series[i].lineWidth=t,e.props.edit(n)}}),wp.element.createElement(bs,{label:us("Point Size"),help:us("Overrides the global point size value for this series."),value:n.series[i].pointSize,onChange:function(t){n.series[i].pointSize=t,e.props.edit(n)}})),-1>=["candlestick"].indexOf(t)&&"number"===r[a].type?wp.element.createElement(ms,null,wp.element.createElement(bs,{label:us("Format"),help:us("Enter custom format pattern to apply to this series value."),value:n.series[i].format,onChange:function(t){n.series[i].format=t,e.props.edit(n)}}),wp.element.createElement("p",null,us("For number axis labels, this is a subset of the formatting "),wp.element.createElement(_s,{href:"http://icu-project.org/apiref/icu4c/classDecimalFormat.html#_details"},us("ICU pattern set.")),us(" 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."))):"date"===r[a].type&&wp.element.createElement(ms,null,wp.element.createElement(bs,{label:us("Date Format"),help:us("Enter custom format pattern to apply to this series value."),placeholder:"dd LLLL yyyy",value:n.series[i].format,onChange:function(t){n.series[i].format=t,e.props.edit(n)}}),wp.element.createElement("p",null,us("This is a subset of the date formatting "),wp.element.createElement(_s,{href:"http://userguide.icu-project.org/formatparse/datetime#TOC-Date-Time-Format-Syntax"},us("ICU date and time format.")))),0<=["scatter","line"].indexOf(t)&&wp.element.createElement(gs,{label:us("Curve Type"),help:us("Determines whether the series has to be presented in the legend or not."),value:n.series[i].curveType?n.series[i].curveType:"none",options:[{label:us("Straight line without curve"),value:"none"},{label:us("The angles of the line will be smoothed"),value:"function"}],onChange:function(t){n.series[i].curveType=t,e.props.edit(n)}}),0<=["area"].indexOf(t)&&wp.element.createElement(bs,{label:us("Area Opacity"),help:us("The opacity of the colored area, where 0.0 is fully transparent and 1.0 is fully opaque."),value:n.series[i].areaOpacity,onChange:function(t){n.series[i].areaOpacity=t,e.props.edit(n)}}),0<=["combo"].indexOf(t)&&wp.element.createElement(gs,{label:us("Chart Type"),help:us("Select the type of chart to show for this series."),value:n.series[i].type?n.series[i].type:"area",options:[{label:us("Area"),value:"area"},{label:us("Bar"),value:"bars"},{label:us("Candlesticks"),value:"candlesticks"},{label:us("Line"),value:"line"},{label:us("Stepped Area"),value:"steppedArea"}],onChange:function(t){n.series[i].type=t,e.props.edit(n)}}),-1>=["table"].indexOf(t)&&wp.element.createElement(fs,{label:us("Color")},wp.element.createElement(ps,{value:n.series[i].color,onChange:function(t){n.series[i].color=t,e.props.edit(n)}})))})))}}])&&is(n.prototype,r),a&&is(n,a),t}(ds);function ws(e){return(ws="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 Ms(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ks(e,t){return!t||"object"!==ws(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Ls(e){return(Ls=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Ys(e,t){return(Ys=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Ts=wp.i18n.__,Ds=wp.element.Component,Ss=(wp.blockEditor||wp.editor).ColorPalette,Os=wp.components,js=Os.BaseControl,xs=Os.PanelBody,Es=Os.TextControl,Cs=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),ks(this,Ls(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ys(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:function(){var e=this.props.chart["visualizer-settings"];Object.keys(e.slices).map((function(t){void 0!==e.slices[t]&&(e.slices[t].temp=1)})),this.props.edit(e)}},{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"],n=this.props.chart["visualizer-data"];return wp.element.createElement(xs,{title:Ts("Slices Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},Object.keys(t.slices).map((function(r){return wp.element.createElement(xs,{title:n[r][0],className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Es,{label:Ts("Slice Offset"),help:Ts("How far to separate the slice from the rest of the pie, from 0.0 (not at all) to 1.0 (the pie's radius)."),value:t.slices[r].offset,onChange:function(n){t.slices[r].offset=n,e.props.edit(t)}}),wp.element.createElement(js,{label:Ts("Format")},wp.element.createElement(Ss,{value:t.slices[r].color,onChange:function(n){t.slices[r].color=n,e.props.edit(t)}})))})))}}])&&Ms(n.prototype,r),a&&Ms(n,a),t}(Ds);function Ps(e){return(Ps="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 Hs(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function zs(e,t){return!t||"object"!==Ps(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function As(e){return(As=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Ns(e,t){return(Ns=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Fs=wp.i18n.__,Rs=wp.element.Component,Ws=(wp.blockEditor||wp.editor).ColorPalette,Is=wp.components,Bs=Is.CheckboxControl,Js=Is.BaseControl,Us=Is.PanelBody,qs=Is.TextControl,Vs=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),zs(this,As(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ns(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:function(){}},{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(Us,{title:Fs("Bubble Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(qs,{label:Fs("Opacity"),help:Fs("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(Js,{label:Fs("Stroke Color")},wp.element.createElement(Ws,{value:t.bubble.stroke,onChange:function(n){t.bubble||(t.bubble={}),t.bubble.stroke=n,e.props.edit(t)}})),wp.element.createElement(Bs,{label:Fs("Sort Bubbles by Size"),help:Fs("If checked, sorts the bubbles by size so the smaller bubbles appear above the larger bubbles. If unchecked, bubbles are sorted according to their order in the table."),checked:K(t,"sortBubblesBySize"),onChange:function(n){t.sortBubblesBySize=n,e.props.edit(t)}}),wp.element.createElement(qs,{label:Fs("Size (max)"),help:Fs("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(qs,{label:Fs("Size (min)"),help:Fs("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)}}))}}])&&Hs(n.prototype,r),a&&Hs(n,a),t}(Rs);function Gs(e){return(Gs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function $s(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Ks(e,t){return!t||"object"!==Gs(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Zs(e){return(Zs=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Qs(e,t){return(Qs=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Xs=wp.i18n.__,el=wp.element,tl=el.Component,nl=el.Fragment,rl=wp.components,al=rl.ExternalLink,il=rl.PanelBody,ol=rl.TextControl,sl=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Ks(this,Zs(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Qs(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:function(){var e=this.props.chart["visualizer-settings"];Object.keys(e.series).map((function(t){void 0!==e.series[t]&&(e.series[t].temp=1)})),this.props.edit(e)}},{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"],n=this.props.chart["visualizer-series"],r=this.props.chart["visualizer-chart-type"];return wp.element.createElement(il,{title:Xs("Column Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},Object.keys(t.series).map((function(a){return wp.element.createElement(il,{title:n[a].label,className:"visualizer-inner-sections",initialOpen:!1},("date"===n[a].type||"datetime"===n[a].type||"timeofday"===n[a].type)&&wp.element.createElement(nl,null,wp.element.createElement(ol,{label:Xs("Display Date Format"),help:Xs("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(ol,{label:Xs("Source Date Format"),help:Xs("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,Xs("You can find more info on "),wp.element.createElement(al,{href:"https://momentjs.com/docs/#/displaying/"},Xs("date and time formats here.")))),"number"===n[a].type&&wp.element.createElement(nl,null,wp.element.createElement(ol,{label:Xs("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(ol,{label:Xs("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(ol,{label:Xs("Precision"),help:Xs("Round values to how many decimal places?"),value:t.series[a].format?t.series[a].format.precision:"",type:"number",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(ol,{label:Xs("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(ol,{label:Xs("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&&"dataTable"===r&&wp.element.createElement(nl,null,wp.element.createElement(ol,{label:Xs("Truthy value"),help:Xs("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(ol,{label:Xs("Falsy value"),help:Xs("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)}})))})))}}])&&$s(n.prototype,r),a&&$s(n,a),t}(tl);function ll(e){return(ll="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 ul(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function cl(e,t){return!t||"object"!==ll(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function dl(e){return(dl=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ml(e,t){return(ml=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var pl=wp.i18n.__,hl=wp.element,fl=hl.Component,_l=hl.Fragment,yl=(wp.blockEditor||wp.editor).ColorPalette,gl=wp.components,bl=gl.BaseControl,vl=gl.CheckboxControl,wl=gl.PanelBody,Ml=gl.SelectControl,kl=gl.TextControl,Ll=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),cl(this,dl(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ml(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-chart-type"],n=this.props.chart["visualizer-settings"];return wp.element.createElement(wl,{title:pl("Layout And Chart Area"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(wl,{title:pl("Layout"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(kl,{label:pl("Width of Chart"),help:pl("Determines the total width of the chart."),value:n.width,onChange:function(t){n.width=t,e.props.edit(n)}}),wp.element.createElement(kl,{label:pl("Height of Chart"),help:pl("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(Ml,{label:pl("Keep Aspect Ratio"),help:pl("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:pl("Yes"),value:"1"},{label:pl("No"),value:"0"}],onChange:function(t){n.keepAspectRatio=t,e.props.edit(n)}}),-1>=["gauge"].indexOf(t)&&wp.element.createElement(_l,null,wp.element.createElement(kl,{label:pl("Stroke Width"),help:pl("The chart border width in pixels."),value:n.backgroundColor.strokeWidth,onChange:function(t){n.backgroundColor.strokeWidth=t,e.props.edit(n)}}),wp.element.createElement(bl,{label:pl("Stroke Color")},wp.element.createElement(yl,{value:n.backgroundColor.stroke,onChange:function(t){n.backgroundColor.stroke=t,e.props.edit(n)}})),wp.element.createElement(bl,{label:pl("Background Color")},wp.element.createElement(yl,{value:n.backgroundColor.fill,onChange:function(t){n.backgroundColor.fill=t,e.props.edit(n)}})),wp.element.createElement(vl,{label:pl("Transparent Background?"),checked:"transparent"===n.backgroundColor.fill,onChange:function(t){n.backgroundColor.fill="transparent"===n.backgroundColor.fill?"":"transparent",e.props.edit(n)}}))),-1>=["geo","gauge"].indexOf(t)&&wp.element.createElement(wl,{title:pl("Chart Area"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(kl,{label:pl("Left Margin"),help:pl("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(kl,{label:pl("Top Margin"),help:pl("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(kl,{label:pl("Width Of Chart Area"),help:pl("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(kl,{label:pl("Height Of Chart Area"),help:pl("Determines the hight of the chart area."),value:n.chartArea.height,onChange:function(t){n.chartArea.height=t,e.props.edit(n)}})))}}])&&ul(n.prototype,r),a&&ul(n,a),t}(fl);function Yl(e){return(Yl="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 Tl(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Dl(e,t){return!t||"object"!==Yl(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Sl(e){return(Sl=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Ol(e,t){return(Ol=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var jl=wp.i18n.__,xl=wp.element,El=xl.Component,Cl=xl.Fragment,Pl=wp.components,Hl=Pl.CheckboxControl,zl=Pl.PanelBody,Al=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Dl(this,Sl(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ol(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:function(){var e=this.props.chart["visualizer-settings"];void 0===e.actions&&(e.actions=[]),this.props.edit(e)}},{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"],n=this.props.chart["visualizer-chart-type"];return wp.element.createElement(zl,{title:jl("Frontend Actions"),initialOpen:!1,className:"visualizer-advanced-panel"},void 0!==t.actions&&wp.element.createElement(Cl,null,wp.element.createElement(Hl,{label:jl("Print"),help:jl("To enable printing the data."),checked:0<=t.actions.indexOf("print"),onChange:function(n){if(0<=t.actions.indexOf("print")){var r=t.actions.indexOf("print");-1!==r&&t.actions.splice(r,1)}else t.actions.push("print");e.props.edit(t)}}),wp.element.createElement(Hl,{label:jl("CSV"),help:jl("To enable downloading the data as a CSV."),checked:0<=t.actions.indexOf("csv;application/csv"),onChange:function(n){if(0<=t.actions.indexOf("csv;application/csv")){var r=t.actions.indexOf("csv;application/csv");-1!==r&&t.actions.splice(r,1)}else t.actions.push("csv;application/csv");e.props.edit(t)}}),wp.element.createElement(Hl,{label:jl("Excel"),help:jl("To enable downloading the data as an Excel spreadsheet."),checked:0<=t.actions.indexOf("xls;application/vnd.ms-excel"),onChange:function(n){if(0<=t.actions.indexOf("xls;application/vnd.ms-excel")){var r=t.actions.indexOf("xls;application/vnd.ms-excel");-1!==r&&t.actions.splice(r,1)}else t.actions.push("xls;application/vnd.ms-excel");e.props.edit(t)}}),wp.element.createElement(Hl,{label:jl("Copy"),help:jl("To enable copying the data to the clipboard."),checked:0<=t.actions.indexOf("copy"),onChange:function(n){if(0<=t.actions.indexOf("copy")){var r=t.actions.indexOf("copy");-1!==r&&t.actions.splice(r,1)}else t.actions.push("copy");e.props.edit(t)}}),-1>=["dataTable","tabular","gauge","table"].indexOf(n)&&wp.element.createElement(Hl,{label:jl("Download Image"),help:jl("To download the chart as an image."),checked:0<=t.actions.indexOf("image"),onChange:function(n){if(0<=t.actions.indexOf("image")){var r=t.actions.indexOf("image");-1!==r&&t.actions.splice(r,1)}else t.actions.push("image");e.props.edit(t)}})))}}])&&Tl(n.prototype,r),a&&Tl(n,a),t}(El);function Nl(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Fl(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Nl(e,t,n[t])}))}return e}var Rl={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"}},Wl=n(2);const Il={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&&Il.throwError(Il.getCaller(2),e)},isFalsy:(e="<unknown parameter>",t)=>{t||Il.throwError(Il.getCaller(2),e)},isNoneOf:(e="<unknown parameter>",t,n=[])=>{-1===n.indexOf(t)&&Il.throwError(Il.getCaller(2),e,"to be any of"+JSON.stringify(n))},isAnyOf:(e="<unknown parameter>",t,n=[])=>{n.indexOf(t)>-1&&Il.throwError(Il.getCaller(2),e,"not to be any of"+JSON.stringify(n))},isNotType:(e="<unknown parameter>",t,n="")=>{Object(Wl.getType)(t)!==n.toLowerCase()&&Il.throwError(Il.getCaller(2),e,"to be type "+n.toLowerCase())},isAnyTypeOf:(e="<unknown parameter>",t,n=[])=>{n.forEach(n=>{Object(Wl.getType)(t)===n&&Il.throwError(Il.getCaller(2),e,"not to be type of "+n.toLowerCase())})},missingKey:(e="<unknown parameter>",t,n="")=>{Il.isUndefined(e,t),-1===Object.keys(t).indexOf(n)&&Il.throwError(Il.getCaller(2),e,"to contain '"+n+"' key")},missingAnyKeys:(e="<unknown parameter>",t,n=[""])=>{Il.isUndefined(e,t);const r=Object.keys(t);n.forEach(t=>{-1===r.indexOf(t)&&Il.throwError(Il.getCaller(2),e,"to contain '"+t+"' key")})},containsUndefined:(e="<unknown parameter>",t)=>{[void 0,null].forEach(n=>{const r=Object(Wl.locate)(t,n);r&&Il.throwError(Il.getCaller(2),e,"not to contain '"+JSON.stringify(n)+"' at "+r)})},isInvalidPath:(e="<unknown parameter>",t)=>{Il.isUndefined(e,t),Il.isNotType(e,t,"string"),Il.isAnyOf(e,t,["","/"]),".$[]#".split().forEach(n=>{t.indexOf(n)>-1&&Il.throwError(Il.getCaller(2),e,"not to contain invalid character '"+n+"'")}),t.match(/\/{2,}/g)&&Il.throwError(Il.getCaller(2),e,"not to contain consecutive forward slash characters")},isInvalidWriteData:(e="<unknown parameter>",t)=>{Il.isUndefined(e,t),Il.containsUndefined(e,t)}};var Bl=Il;const Jl=(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 Ul={format:"{reason} at line {line}",symbols:{colon:"colon",comma:"comma",semicolon:"semicolon",slash:"slash",backslash:"backslash",brackets:{round:"round brackets",square:"square brackets",curly:"curly brackets",angle:"angle brackets"},period:"period",quotes:{single:"single quote",double:"double quote",grave:"grave accent"},space:"space",ampersand:"ampersand",asterisk:"asterisk",at:"at sign",equals:"equals sign",hash:"hash",percent:"percent",plus:"plus",minus:"minus",dash:"dash",hyphen:"hyphen",tilde:"tilde",underscore:"underscore",bar:"vertical bar"},types:{key:"key",value:"value",number:"number",string:"string",primitive:"primitive",boolean:"boolean",character:"character",integer:"integer",array:"array",float:"float"},invalidToken:{tokenSequence:{prohibited:"'{firstToken}' token cannot be followed by '{secondToken}' token(s)",permitted:"'{firstToken}' token can only be followed by '{secondToken}' token(s)"},termSequence:{prohibited:"A {firstTerm} cannot be followed by a {secondTerm}",permitted:"A {firstTerm} can only be followed by a {secondTerm}"},double:"'{token}' token cannot be followed by another '{token}' token",useInstead:"'{badToken}' token is not accepted. Use '{goodToken}' instead",unexpected:"Unexpected '{token}' token found"},brace:{curly:{missingOpen:"Missing '{' open curly brace",missingClose:"Open '{' curly brace is missing closing '}' curly brace",cannotWrap:"'{token}' token cannot be wrapped in '{}' curly braces"},square:{missingOpen:"Missing '[' open square brace",missingClose:"Open '[' square brace is missing closing ']' square brace",cannotWrap:"'{token}' token cannot be wrapped in '[]' square braces"}},string:{missingOpen:"Missing/invalid opening string '{quote}' token",missingClose:"Missing/invalid closing string '{quote}' token",mustBeWrappedByQuotes:"Strings must be wrapped by quotes",nonAlphanumeric:"Non-alphanumeric token '{token}' is not allowed outside string notation",unexpectedKey:"Unexpected key found at string position"},key:{numberAndLetterMissingQuotes:"Key beginning with number and containing letters must be wrapped by quotes",spaceMissingQuotes:"Key containing space must be wrapped by quotes",unexpectedString:"Unexpected string found at key position"},noTrailingOrLeadingComma:"Trailing or leading commas in arrays and objects are not permitted"};
65
  /** @license react-json-editor-ajrm v2.5.9
66
  *
67
  * This source code is licensed under the MIT license found in the
68
  * LICENSE file in the root directory of this source tree.
69
- */class ql extends r.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=Rl.dark_vscode_tribute;"theme"in this.props&&"string"==typeof this.props.theme&&this.props.theme in Rl&&(n=Rl[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 r=this.props.height||"610px",a=this.props.width||"479px";this.totalHeight=r,this.totalWidth=a,"onKeyPressUpdate"in this.props&&!this.props.onKeyPressUpdate?this.timer&&(clearInterval(this.timer),this.timer=!1):this.timer||(this.timer=setInterval(this.scheduledUpdate,100)),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.state.error,r=this.colors,i=this.style,o=this.confirmGood,s=this.totalHeight,l=this.totalWidth,u=!!n&&"token"in n;return this.renderCount++,a.a.createElement("div",{name:"outer-box",id:e&&e+"-outer-box",style:Fl({display:"block",overflow:"none",height:s,width:l,margin:0,boxSizing:"border-box",position:"relative"},i.outerBox)},o?a.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)"}},a.a.createElement("svg",{height:"30px",width:"30px",viewBox:"0 0 100 100"},a.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,a.a.createElement("div",{name:"container",id:e&&e+"-container",style:Fl({display:"block",height:s,width:l,margin:0,boxSizing:"border-box",overflow:"hidden",fontFamily:"Roboto, sans-serif"},i.container),onClick:this.onClick},a.a.createElement("div",{name:"warning-box",id:e&&e+"-warning-box",style:Fl({display:"block",overflow:"hidden",height:u?"60px":"0px",width:"100%",margin:0,backgroundColor:r.background_warning,transitionDuration:"0.2s",transitionTimingFunction:"cubic-bezier(0, 1, 0.5, 1)"},i.warningBox),onClick:this.onClick},a.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},a.a.createElement("div",{style:{position:"relative",top:0,left:0,height:"60px",width:"60px",margin:0,pointerEvents:"none"},onClick:this.onClick},a.a.createElement("div",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",pointerEvents:"none"},onClick:this.onClick},a.a.createElement("svg",{height:"25px",width:"25px",viewBox:"0 0 100 100"},a.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"}))))),a.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())),a.a.createElement("div",{name:"body",id:e&&e+"-body",style:Fl({display:"flex",overflow:"none",height:u?"calc(100% - 60px)":"100%",width:"",margin:0,resize:"none",fontFamily:"Roboto Mono, Monaco, monospace",fontSize:"11px",backgroundColor:r.background,transitionDuration:"0.2s",transitionTimingFunction:"cubic-bezier(0, 1, 0.5, 1)"},i.body),onClick:this.onClick},a.a.createElement("span",{name:"labels",id:e&&e+"-labels",ref:e=>this.refLabels=e,style:Fl({display:"inline-block",boxSizing:"border-box",verticalAlign:"top",height:"100%",width:"44px",margin:0,padding:"5px 0px 5px 10px",overflow:"hidden",color:"#D4D4D4"},i.labelColumn),onClick:this.onClick},this.renderLabels()),a.a.createElement("span",{id:e,ref:e=>this.refContent=e,contentEditable:!0,style:Fl({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"},i.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||Ul,t=this.state.error,n=this.style;if(t)return a.a.createElement("p",{style:Fl({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)},Jl(e.format,t))}renderLabels(){const e=this.colors,t=this.style,n=this.state.error?this.state.error.line:-1,r=this.state.lines?this.state.lines:1;let i=new Array(r);for(var o=0;o<r-1;o++)i[o]=o+1;return i.map(r=>{const i=r!==n?e.default:"red";return a.a.createElement("div",{key:r,style:Fl({},t.labels,{color:i})},r)})}createMarkup(e){return void 0===e?{__html:""}:{__html:""+e}}newSpan(e,t,n){let r=this.colors,a=t.type,i=t.string,o="";switch(a){case"string":case"number":case"primitive":case"error":o=r[t.type];break;case"key":o=" "===i?r.keys_whiteSpace:r.keys;break;case"symbol":o=":"===i?r.colon:r.default;break;default:o=r.default}return i.length!==i.replace(/</g,"").replace(/>/g,"").length&&(i="<xmp style=display:inline;>"+i+"</xmp>"),'<span type="'+a+'" value="'+i+'" depth="'+n+'" style="color:'+o+'">'+i+"</span>"}getCursorPosition(e){let t,n=window.getSelection(),r=-1,a=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,r=n.focusOffset;t&&t!==this.refContent;)if(t.previousSibling)t=t.previousSibling,e&&"BR"===t.nodeName&&a++,r+=t.textContent.length;else if(null===(t=t.parentNode))break;return r+a}setCursorPosition(e){if([!1,null,void 0].indexOf(e)>-1)return;const t=(e,n,r)=>{if(r||((r=document.createRange()).selectNode(e),r.setStart(e,0)),0===n.count)r.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:(r.setEnd(e,n.count),n.count=0);else for(var a=0;a<e.childNodes.length&&(r=t(e.childNodes[a],n,r),0!==n.count);a++);return r};e>0?(e=>{if(e<0)return;let n=window.getSelection(),r=t(this.refContent,{count:e});r&&(r.collapse(!1),n.removeAllRanges(),n.addRange(r))})(e):this.refContent.focus()}update(e=0,t=!0){const n=this.refContent,r=this.tokenize(n);"onChange"in this.props&&this.props.onChange({plainText:r.indented,markupText:r.markup,json:r.json,jsObject:r.jsObject,lines:r.lines,error:r.error});let a=this.getCursorPosition(r.error)+e;this.setState({plainText:r.indented,markupText:r.markup,json:r.json,jsObject:r.jsObject,lines:r.lines,error:r.error}),this.updateTime=!1,t&&this.setCursorPosition(a)}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("insertHTML",!1,t)}this.update()}onClick(){"viewOnly"in this.props&&this.props.viewOnly}onBlur(){"viewOnly"in this.props&&this.props.viewOnly||this.update(0,!1)}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:r}=this,a=Object(Wl.getType)(e);-1===["object","array"].indexOf(a)&&Bl.throwError("showPlaceholder","placeholder","either an object or an array");let i=!Object(Wl.identical)(e,t);if(i||r&&void 0!==n&&(i=!Object(Wl.identical)(e,n)),!i)return;const o=this.tokenize(e);this.setState({prevPlaceholder:e,plainText:o.indentation,markupText:o.markup,lines:o.lines,error:o.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||Ul,n=this.newSpan;if("nodeType"in e){const M=e.cloneNode(!0);if(!M.hasChildNodes())return"";const k=M.childNodes;let L={tokens_unknown:[],tokens_proto:[],tokens_split:[],tokens_fallback:[],tokens_normalize:[],tokens_merge:[],tokens_plainText:"",indented:"",json:"",jsObject:void 0,markup:""};for(var r=0;r<k.length;r++){let e=k[r],t={};switch(e.nodeName){case"SPAN":t={string:e.textContent,type:e.attributes.type.textContent},L.tokens_unknown.push(t);break;case"DIV":L.tokens_unknown.push({string:e.textContent,type:"unknown"});break;case"BR":""===e.textContent&&L.tokens_unknown.push({string:"\n",type:"unknown"});break;case"#text":L.tokens_unknown.push({string:e.wholeText,type:"unknown"});break;case"FONT":L.tokens_unknown.push({string:e.textContent,type:"unknown"});break;default:console.error("Unrecognized node:",{child:e})}}function a(e,t=""){let n={active:!1,string:"",number:"",symbol:"",space:"",delimiter:"",quarks:[]};function r(e,r){switch(r){case"symbol":case"delimiter":n.active&&n.quarks.push({string:n[n.active],type:t+"-"+n.active}),n[n.active]="",n.active=r,n[n.active]=e;break;default:r!==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=r,n[n.active]=e):n[r]+=e}}for(var a=0;a<e.length;a++){const t=e.charAt(a);switch(t){case'"':case"'":r(t,"delimiter");break;case" ":case" ":r(t,"space");break;case"{":case"}":case"[":case"]":case":":case",":r(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?r(t,"string"):r(t,"number");break;case"-":if(a<e.length-1&&"0123456789".indexOf(e.charAt(a+1))>-1){r(t,"number");break}case".":if(a<e.length-1&&a>0&&"0123456789".indexOf(e.charAt(a+1))>-1&&"0123456789".indexOf(e.charAt(a-1))>-1){r(t,"number");break}default:r(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(r=0;r<L.tokens_unknown.length;r++){let e=L.tokens_unknown[r];L.tokens_proto=L.tokens_proto.concat(a(e.string,"proto"))}function i(e,t){let n="",r="",a=!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),r=e.charAt(e.length-1),-1===(a="'\"".indexOf(n)))return!1;if(n!==r)return!1;for(var i=0;i<e.length;i++)if(i>0&&i<e.length-1&&e.charAt(i)==="'\""[a]&&"\\"!==e.charAt(i-1))return!1;break;case"key":if(0===e.length)return!1;if(n=e.charAt(0),r=e.charAt(e.length-1),(a="'\"".indexOf(n))>-1){if(1===e.length)return!1;if(n!==r)return!1;for(i=0;i<e.length;i++)if(i>0&&i<e.length-1&&e.charAt(i)==="'\""[a]&&"\\"!==e.charAt(i-1))return!1}else{const t="'\"`.,:;{}[]&<>=~*%\\|/-+!?@^  ";for(i=0;i<t.length;i++){const n=t.charAt(i);if(e.indexOf(n)>-1)return!1}}break;case"number":for(i=0;i<e.length;i++)if(-1==="0123456789".indexOf(e.charAt(i)))if(0===i){if("-"!==e.charAt(0))return!1}else if("."!==e.charAt(i))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(r=0;r<L.tokens_proto.length;r++){let e=L.tokens_proto[r];-1===e.type.indexOf("proto")?i(e.string,e.type)?L.tokens_split.push(e):L.tokens_split=L.tokens_split.concat(a(e.string,"split")):L.tokens_split.push(e)}for(r=0;r<L.tokens_split.length;r++){let e=L.tokens_split[r],t=e.type,n=e.string,a=n.length,i=[];t.indexOf("-")>-1&&("string"!==(t=t.slice(t.indexOf("-")+1))&&i.push("string"),i.push("key"),i.push("error"));let o={string:n,length:a,type:t,fallback:i};L.tokens_fallback.push(o)}function o(){const e=L.tokens_normalize.length-1;if(e<1)return!1;for(var t=e;t>=0;t--){const e=L.tokens_normalize[t];switch(e.type){case"space":case"linebreak":break;default:return e}}return!1}let Y={brackets:[],stringOpen:!1,isValue:!1};for(r=0;r<L.tokens_fallback.length;r++){let e=L.tokens_fallback[r];const t=e.type,n=e.string;let a={type:t,string:n};switch(t){case"symbol":case"colon":if(Y.stringOpen){Y.isValue?a.type="string":a.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"===o().type)break;Y.isValue="["===Y.brackets[Y.brackets.length-1];break;case":":a.type="colon",Y.isValue=!0}break;case"delimiter":if(Y.isValue?a.type="string":a.type="key",!Y.stringOpen){Y.stringOpen=n;break}if(r>0){const e=L.tokens_fallback[r-1],t=e.string,n=e.type,a=t.charAt(t.length-1);if("string"===n&&"\\"===a)break}if(Y.stringOpen===n){Y.stringOpen=!1;break}break;case"primitive":case"string":if(["false","true","null","undefined"].indexOf(n)>-1){const e=L.tokens_normalize.length-1;if(e>=0){if("string"!==L.tokens_normalize[e].type){a.type="primitive";break}a.type="string";break}a.type="primitive";break}if("\n"===n&&!Y.stringOpen){a.type="linebreak";break}Y.isValue?a.type="string":a.type="key";break;case"space":case"number":Y.stringOpen&&(Y.isValue?a.type="string":a.type="key")}L.tokens_normalize.push(a)}for(r=0;r<L.tokens_normalize.length;r++){const e=L.tokens_normalize[r];let t={string:e.string,type:e.type,tokens:[r]};if(-1===["symbol","colon"].indexOf(e.type)&&r+1<L.tokens_normalize.length){let n=0;for(var s=r+1;s<L.tokens_normalize.length;s++){const r=L.tokens_normalize[s];if(e.type!==r.type)break;t.string+=r.string,t.tokens.push(s),n++}r+=n}L.tokens_merge.push(t)}const T="'\"",D="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_$";var l=!1,u=L.tokens_merge.length>0?1:0;function c(e,t,n=0){l={token:e,line:u,reason:t},L.tokens_merge[e+n].type="error"}function d(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===L.tokens_merge.length-1)return!1;for(var n=e+1;n<L.tokens_merge.length;n++){const e=L.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=L.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 p(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=L.tokens_merge[t];switch(e.type){case"space":case"linebreak":break;default:return e.type}}return!1}Y={brackets:[],stringOpen:!1,isValue:!1};let S=[];for(r=0;r<L.tokens_merge.length&&!l;r++){let e=L.tokens_merge[r],n=e.string,a=e.type,i=!1;switch(a){case"space":break;case"linebreak":u++;break;case"symbol":switch(n){case"{":case"[":if(i=m(r,["}","]"])){c(r,Jl(t.invalidToken.tokenSequence.prohibited,{firstToken:L.tokens_merge[i].string,secondToken:n}));break}if("["===n&&r>0&&!m(r,[":","[",","])){c(r,Jl(t.invalidToken.tokenSequence.permitted,{firstToken:"[",secondToken:[":","[",","]}));break}if("{"===n&&m(r,["{"])){c(r,Jl(t.invalidToken.double,{token:"{"}));break}Y.brackets.push(n),Y.isValue="["===Y.brackets[Y.brackets.length-1],S.push({i:r,line:u,string:n});break;case"}":case"]":if("}"===n&&"{"!==Y.brackets[Y.brackets.length-1]){c(r,Jl(t.brace.curly.missingOpen));break}if("}"===n&&m(r,[","])){c(r,Jl(t.invalidToken.tokenSequence.prohibited,{firstToken:",",secondToken:"}"}));break}if("]"===n&&"["!==Y.brackets[Y.brackets.length-1]){c(r,Jl(t.brace.square.missingOpen));break}if("]"===n&&m(r,[":"])){c(r,Jl(t.invalidToken.tokenSequence.prohibited,{firstToken:":",secondToken:"]"}));break}Y.brackets.pop(),Y.isValue="["===Y.brackets[Y.brackets.length-1],S.push({i:r,line:u,string:n});break;case",":if(i=m(r,["{"])){if(d(r,["}"])){c(r,Jl(t.brace.curly.cannotWrap,{token:","}));break}c(r,Jl(t.invalidToken.tokenSequence.prohibited,{firstToken:"{",secondToken:","}));break}if(d(r,["}",",","]"])){c(r,Jl(t.noTrailingOrLeadingComma));break}switch(i=p(r)){case"key":case"colon":c(r,Jl(t.invalidToken.termSequence.prohibited,{firstTerm:"key"===i?t.types.key:t.symbols.colon,secondTerm:t.symbols.comma}));break;case"symbol":if(m(r,["{"])){c(r,Jl(t.invalidToken.tokenSequence.prohibited,{firstToken:"{",secondToken:","}));break}}Y.isValue="["===Y.brackets[Y.brackets.length-1]}L.json+=n;break;case"colon":if((i=m(r,["["]))&&d(r,["]"])){c(r,Jl(t.brace.square.cannotWrap,{token:":"}));break}if(i){c(r,Jl(t.invalidToken.tokenSequence.prohibited,{firstToken:"[",secondToken:":"}));break}if("key"!==p(r)){c(r,Jl(t.invalidToken.termSequence.permitted,{firstTerm:t.symbols.colon,secondTerm:t.types.key}));break}if(d(r,["}","]"])){c(r,Jl(t.invalidToken.termSequence.permitted,{firstTerm:t.symbols.colon,secondTerm:t.types.value}));break}Y.isValue=!0,L.json+=n;break;case"key":case"string":let e=n.charAt(0),o=n.charAt(n.length-1);T.indexOf(e);if(-1===T.indexOf(e)&&-1!==T.indexOf(o)){c(r,Jl(t.string.missingOpen,{quote:e}));break}if(-1===T.indexOf(o)&&-1!==T.indexOf(e)){c(r,Jl(t.string.missingClose,{quote:e}));break}if(T.indexOf(e)>-1&&e!==o){c(r,Jl(t.string.missingClose,{quote:e}));break}if("string"===a&&-1===T.indexOf(e)&&-1===T.indexOf(o)){c(r,Jl(t.string.mustBeWrappedByQuotes));break}if("key"===a&&d(r,["}","]"])&&c(r,Jl(t.invalidToken.termSequence.permitted,{firstTerm:t.types.key,secondTerm:t.symbols.colon})),-1===T.indexOf(e)&&-1===T.indexOf(o))for(var h=0;h<n.length&&!l;h++){const e=n.charAt(h);if(-1===D.indexOf(e)){c(r,Jl(t.string.nonAlphanumeric,{token:e}));break}}if("'"===e?n='"'+n.slice(1,-1)+'"':'"'!==e&&(n='"'+n+'"'),"key"===a&&"key"===p(r)){if(r>0&&!isNaN(L.tokens_merge[r-1])){L.tokens_merge[r-1]+=L.tokens_merge[r],c(r,Jl(t.key.numberAndLetterMissingQuotes));break}c(r,Jl(t.key.spaceMissingQuotes));break}if("key"===a&&!m(r,["{",","])){c(r,Jl(t.invalidToken.tokenSequence.permitted,{firstToken:a,secondToken:["{",","]}));break}if("string"===a&&!m(r,["[",":",","])){c(r,Jl(t.invalidToken.tokenSequence.permitted,{firstToken:a,secondToken:["[",":",","]}));break}if("key"===a&&Y.isValue){c(r,Jl(t.string.unexpectedKey));break}if("string"===a&&!Y.isValue){c(r,Jl(t.key.unexpectedString));break}L.json+=n;break;case"number":case"primitive":if(m(r,["{"]))L.tokens_merge[r].type="key",a=L.tokens_merge[r].type,n='"'+n+'"';else if("key"===p(r))L.tokens_merge[r].type="key",a=L.tokens_merge[r].type;else if(!m(r,["[",":",","])){c(r,Jl(t.invalidToken.tokenSequence.permitted,{firstToken:a,secondToken:["[",":",","]}));break}"key"!==a&&(Y.isValue||(L.tokens_merge[r].type="key",a=L.tokens_merge[r].type,n='"'+n+'"')),"primitive"===a&&"undefined"===n&&c(r,Jl(t.invalidToken.useInstead,{badToken:"undefined",goodToken:"null"})),L.json+=n}}let O="";for(r=0;r<L.json.length;r++){let e=L.json.charAt(r),t="";r+1<L.json.length&&(t=L.json.charAt(r+1),"\\"===e&&"'"===t)?(O+=t,r++):O+=e}if(L.json=O,!l){const e=Math.ceil(S.length/2);let n=0,r=!1;function f(e){S.splice(e+1,1),S.splice(e,1),r||(r=!0)}for(;S.length>0;){r=!1;for(var _=0;_<S.length-1;_++){const e=S[_].string+S[_+1].string;["[]","{}"].indexOf(e)>-1&&f(_)}if(n++,!r)break;if(n>=e)break}if(S.length>0){const e=S[0].string,n=S[0].i,r="["===e?"]":"}";u=S[0].line,c(n,Jl(t.brace["]"===r?"square":"curly"].missingClose))}}if(!l&&-1===[void 0,""].indexOf(L.json))try{L.jsObject=JSON.parse(L.json)}catch(e){const n=e.message,r=n.indexOf("position");if(-1===r)throw new Error("Error parsing failed");const a=n.substring(r+9,n.length),i=parseInt(a);let o=0,s=0,d=!1,m=1,p=!1;for(;o<i&&!p&&("linebreak"===(d=L.tokens_merge[s]).type&&m++,-1===["space","linebreak"].indexOf(d.type)&&(o+=d.string.length),!(o>=i));)s++,L.tokens_merge[s+1]||(p=!0);u=m;let h=0;for(let e=0;e<d.string.length;e++){const n=d.string.charAt(e);"\\"===n?h=h>0?h+1:1:(h%2==0&&0!==h||-1==="'\"bfnrt".indexOf(n)&&c(s,Jl(t.invalidToken.unexpected,{token:"\\"})),h=0)}l||c(s,Jl(t.invalidToken.unexpected,{token:d.string}))}let j=1,x=0;function y(){for(var e=[],t=0;t<2*x;t++)e.push("&nbsp;");return e.join("")}function g(e=!1){return j++,x>0||e?"<br>":""}function b(e=!1){return g(e)+y()}if(!l)for(r=0;r<L.tokens_merge.length;r++){const e=L.tokens_merge[r],t=e.string;switch(e.type){case"space":case"linebreak":break;case"string":case"number":case"primitive":case"error":L.markup+=(m(r,[",","["])?b():"")+n(r,e,x);break;case"key":L.markup+=b()+n(r,e,x);break;case"colon":L.markup+=n(r,e,x)+"&nbsp;";break;case"symbol":switch(t){case"[":case"{":L.markup+=(m(r,[":"])?"":b())+n(r,e,x),x++;break;case"]":case"}":x--;const t=r===L.tokens_merge.length-1,a=r>0?["[","{"].indexOf(L.tokens_merge[r-1].string)>-1?"":b(t):"";L.markup+=a+n(r,e,x);break;case",":L.markup+=n(r,e,x)}}}if(l){let e=1;function v(e){let t=0;for(var n=0;n<e.length;n++)["\n","\r"].indexOf(e[n])>-1&&t++;return t}j=1;for(r=0;r<L.tokens_merge.length;r++){const t=L.tokens_merge[r],a=t.type,i=t.string;"linebreak"===a&&j++,L.markup+=n(r,t,x),e+=v(i)}e++,++j<e&&(j=e)}for(r=0;r<L.tokens_merge.length;r++){let e=L.tokens_merge[r];L.indented+=e.string,-1===["space","linebreak"].indexOf(e.type)&&(L.tokens_plainText+=e.string)}if(l){"modifyErrorText"in this.props&&((w=this.props.modifyErrorText)&&"[object Function]"==={}.toString.call(w)&&(l.reason=this.props.modifyErrorText(l.reason)))}return{tokens:L.tokens_merge,noSpaces:L.tokens_plainText,indented:L.indented,json:L.json,jsObject:L.jsObject,markup:L.markup,lines:j,error:l}}var w;if(!("nodeType"in e)){let t={inputText:JSON.stringify(e),position:0,currentChar:"",tokenPrimary:"",tokenSecondary:"",brackets:[],isValue:!1,stringOpen:!1,stringStart:0,tokens:[]};function M(){return"\\"===t.currentChar&&(t.inputText=(e=t.inputText,n=t.position,e.slice(0,n)+e.slice(n+1)),!0);var e,n}function k(){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){return Y(),T(t.inputText.substring(t.stringStart,t.position+1)),t.stringOpen=!1,!0}return!1}function L(){if(-1===":,{}[]".indexOf(t.currentChar))return!1;if(t.stringOpen)return!1;switch(Y(),T(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 T(e){return 0!==e.length&&(t.tokens.push(e),!0)}for(r=0;r<t.inputText.length;r++){t.position=r,t.currentChar=t.inputText.charAt(t.position);const e=L(),n=k(),a=M();e||n||a||t.stringOpen||(t.tokenSecondary+=t.currentChar)}let a={brackets:[],isValue:!1,tokens:[]};a.tokens=t.tokens.map(e=>{let t="",n="",r="";switch(e){case",":t="symbol",n=e,r=e,a.isValue="["===a.brackets[a.brackets.length-1];break;case":":t="symbol",n=e,r=e,a.isValue=!0;break;case"{":case"[":t="symbol",n=e,r=e,a.brackets.push(e),a.isValue="["===a.brackets[a.brackets.length-1];break;case"}":case"]":t="symbol",n=e,r=e,a.brackets.pop(),a.isValue="["===a.brackets[a.brackets.length-1];break;case"undefined":t="primitive",n=e,r=void 0;break;case"null":t="primitive",n=e,r=null;break;case"false":t="primitive",n=e,r=!1;break;case"true":t="primitive",n=e,r=!0;break;default:const o=e.charAt(0);if("'\"".indexOf(o)>-1){if("key"===(t=a.isValue?"string":"key")&&(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 r=e.replace(/\w/g,""),a=(e.replace(/\W+/g,""),((e,t)=>{let n=!1;for(var r=0;r<t.length&&(0!==r||!isNaN(t.charAt(r)));r++)if(isNaN(t.charAt(r))){n=!0;break}return!(e.length>0||n)})(r,e));if((e=>{for(var t=0;t<e.length;t++)if(["'",'"'].indexOf(e.charAt(t))>-1)return!0;return!1})(r)){let t="";const n=e.split("");for(var i=0;i<n.length;i++){let e=n[i];["'",'"'].indexOf(e)>-1&&(e="\\"+e),t+=e}e=t}return a?e:"'"+e+"'"}(e)),"string"===t){n="";const t=e.slice(1,-1).split("");for(var i=0;i<t.length;i++){let e=t[i];"'\"".indexOf(e)>-1&&(e="\\"+e),n+=e}n="'"+n+"'"}r=n;break}if(!isNaN(e)){t="number",n=e,r=Number(e);break}if(e.length>0&&!a.isValue){t="key",(n=e).indexOf(" ")>-1&&(n="'"+n+"'"),r=n;break}}return{type:t,string:n,value:r,depth:a.brackets.length}});let i="";for(r=0;r<a.tokens.length;r++){i+=a.tokens[r].string}function D(e){for(var t=[],n=0;n<2*e;n++)t.push(" ");return(e>0?"\n":"")+t.join("")}let o="";for(r=0;r<a.tokens.length;r++){let e=a.tokens[r];switch(e.string){case"[":case"{":const t=r<a.tokens.length-1-1?a.tokens[r+1]:"";-1==="}]".indexOf(t.string)?o+=e.string+D(e.depth):o+=e.string;break;case"]":case"}":const n=r>0?a.tokens[r-1]:"";-1==="[{".indexOf(n.string)?o+=D(e.depth)+e.string:o+=e.string;break;case":":o+=e.string+" ";break;case",":o+=e.string+D(e.depth);break;default:o+=e.string}}let s=1;function S(e){var t=[];e>0&&s++;for(var n=0;n<2*e;n++)t.push("&nbsp;");return(e>0?"<br>":"")+t.join("")}let l="";const u=a.tokens.length-1;for(r=0;r<a.tokens.length;r++){let e=a.tokens[r],t=n(r,e,e.depth);switch(e.string){case"{":case"[":const n=r<a.tokens.length-1-1?a.tokens[r+1]:"";-1==="}]".indexOf(n.string)?l+=t+S(e.depth):l+=t;break;case"}":case"]":const i=r>0?a.tokens[r-1]:"";-1==="[{".indexOf(i.string)?l+=S(e.depth)+(u===r?"<br>":"")+t:l+=t;break;case":":l+=t+" ";break;case",":l+=t+S(e.depth);break;default:l+=t}}return s+=2,{tokens:a.tokens,noSpaces:i,indented:o,json:JSON.stringify(e),jsObject:e,markup:l,lines:s}}}}var Vl=ql,Gl=n(133),$l=n.n(Gl);function Kl(e){return(Kl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Zl(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Ql(e){return(Ql=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Xl(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function eu(e,t){return(eu=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var tu=wp.i18n.__,nu=wp.element.Component,ru=wp.components,au=ru.ExternalLink,iu=ru.PanelBody,ou=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t){return!t||"object"!==Kl(t)&&"function"!=typeof t?Xl(e):t}(this,Ql(t).apply(this,arguments))).isValidJSON=e.isValidJSON.bind(Xl(e)),e}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&eu(e,t)}(t,e),n=t,(r=[{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","table","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(iu,{title:tu("Manual Configuration"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement("p",null,tu("Configure the graph by providing configuration variables right from the Google Visualization API.")),wp.element.createElement("p",null,wp.element.createElement(au,{href:"https://developers.google.com/chart/interactive/docs/gallery/".concat(e,"#configuration-options")},tu("Google Visualization API"))),wp.element.createElement(Vl,{locale:$l.a,theme:"light_mitsuketa_tribute",placeholder:$(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))}}))}}])&&Zl(n.prototype,r),a&&Zl(n,a),t}(nu);function su(e){return(su="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 lu(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function uu(e,t){return!t||"object"!==su(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function cu(e){return(cu=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function du(e,t){return(du=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var mu=wp.element,pu=mu.Component,hu=mu.Fragment,fu=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),uu(this,cu(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&du(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this.props.chart["visualizer-chart-type"];return wp.element.createElement(hu,null,wp.element.createElement(qn,{chart:this.props.chart,edit:this.props.edit}),-1>=["table","gauge","geo","pie","timeline","dataTable"].indexOf(e)&&wp.element.createElement(ur,{chart:this.props.chart,edit:this.props.edit}),-1>=["table","gauge","geo","pie","timeline","dataTable"].indexOf(e)&&wp.element.createElement(Tr,{chart:this.props.chart,edit:this.props.edit}),0<=["pie"].indexOf(e)&&wp.element.createElement(hu,null,wp.element.createElement(Br,{chart:this.props.chart,edit:this.props.edit}),wp.element.createElement(na,{chart:this.props.chart,edit:this.props.edit})),0<=["area","scatter","line"].indexOf(e)&&wp.element.createElement(_a,{chart:this.props.chart,edit:this.props.edit}),0<=["bar","column"].indexOf(e)&&wp.element.createElement(Sa,{chart:this.props.chart,edit:this.props.edit}),0<=["candlestick"].indexOf(e)&&wp.element.createElement(Ia,{chart:this.props.chart,edit:this.props.edit}),0<=["geo"].indexOf(e)&&wp.element.createElement(hu,null,wp.element.createElement(ti,{chart:this.props.chart,edit:this.props.edit}),wp.element.createElement(hi,{chart:this.props.chart,edit:this.props.edit}),wp.element.createElement(Si,{chart:this.props.chart,edit:this.props.edit}),wp.element.createElement(Ri,{chart:this.props.chart,edit:this.props.edit})),0<=["gauge"].indexOf(e)&&wp.element.createElement(no,{chart:this.props.chart,edit:this.props.edit}),0<=["timeline"].indexOf(e)&&wp.element.createElement(_o,{chart:this.props.chart,edit:this.props.edit}),0<=["table","dataTable"].indexOf(e)&&wp.element.createElement(hu,null,wp.element.createElement(xo,{chart:this.props.chart,edit:this.props.edit}),wp.element.createElement(qo,{chart:this.props.chart,edit:this.props.edit})),0<=["combo"].indexOf(e)&&wp.element.createElement(rs,{chart:this.props.chart,edit:this.props.edit}),-1>=["timeline","bubble","gauge","geo","pie","dataTable"].indexOf(e)&&wp.element.createElement(vs,{chart:this.props.chart,edit:this.props.edit}),0<=["bubble"].indexOf(e)&&wp.element.createElement(Vs,{chart:this.props.chart,edit:this.props.edit}),0<=["pie"].indexOf(e)&&wp.element.createElement(Cs,{chart:this.props.chart,edit:this.props.edit}),0<=["dataTable"].indexOf(e)&&wp.element.createElement(sl,{chart:this.props.chart,edit:this.props.edit}),-1>=["dataTable"].indexOf(e)&&wp.element.createElement(Ll,{chart:this.props.chart,edit:this.props.edit}),wp.element.createElement(Al,{chart:this.props.chart,edit:this.props.edit}),-1>=["dataTable"].indexOf(e)&&wp.element.createElement(ou,{chart:this.props.chart,edit:this.props.edit}))}}])&&lu(n.prototype,r),a&&lu(n,a),t}(pu);function _u(e){return(_u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function yu(e,t,n,r,a,i,o){try{var s=e[i](o),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,a)}function gu(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var i=e.apply(t,n);function o(e){yu(i,r,a,o,s,"next",e)}function s(e){yu(i,r,a,o,s,"throw",e)}o(void 0)}))}}function bu(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function vu(e){return(vu=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function wu(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Mu(e,t){return(Mu=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var ku=wp.i18n.__,Lu=wp.apiFetch,Yu=wp.element,Tu=Yu.Component,Du=Yu.Fragment,Su=wp.components,Ou=Su.Button,ju=Su.PanelBody,xu=Su.SelectControl,Eu=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t){return!t||"object"!==_u(t)&&"function"!=typeof t?wu(e):t}(this,vu(t).apply(this,arguments))).getPermissionData=e.getPermissionData.bind(wu(e)),e.state={users:[],roles:[]},e}var n,r,a,i,o;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Mu(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:(o=gu(regeneratorRuntime.mark((function e(){var t,n,r;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,Lu({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,Lu({path:"/visualizer/v1/get-permission-data?type=roles"});case 12:r=e.sent,this.setState({roles:r});case 14:case"end":return e.stop()}}),e,this)}))),function(){return o.apply(this,arguments)})},{key:"getPermissionData",value:(i=gu(regeneratorRuntime.mark((function e(t){var n,r;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,Lu({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,Lu({path:"/visualizer/v1/get-permission-data?type=".concat(t)});case 9:r=e.sent,this.setState({roles:r});case 11:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"render",value:function(){var e,t=this;return"business"===visualizerLocalize.isPro&&(e=this.props.chart["visualizer-permissions"]),wp.element.createElement(Du,null,"business"===visualizerLocalize.isPro?wp.element.createElement(ju,{title:ku("Who can see this chart?"),initialOpen:!1},wp.element.createElement(xu,{label:ku("Select who can view the chart on the front-end."),value:e.permissions.read,options:[{value:"all",label:"All Users"},{value:"users",label:"Select Users"},{value:"roles",label:"Select Roles"}],onChange:function(n){e.permissions.read=n,t.props.edit(e),"users"!==n&&"roles"!==n||t.getPermissionData(n)}}),("users"===e.permissions.read||"roles"===e.permissions.read)&&wp.element.createElement(xu,{multiple:!0,value:e.permissions["read-specific"],options:"users"===e.permissions.read&&this.state.users||"roles"===e.permissions.read&&this.state.roles,onChange:function(n){e.permissions["read-specific"]=n,t.props.edit(e)}})):wp.element.createElement(ju,{title:ku("Who can see this chart?"),icon:"lock",initialOpen:!1},wp.element.createElement("p",null,ku("Upgrade your license to at least the DEVELOPER version to activate this feature!")),wp.element.createElement(Ou,{isPrimary:!0,href:visualizerLocalize.proTeaser,target:"_blank"},ku("Buy Now"))),"business"===visualizerLocalize.isPro?wp.element.createElement(ju,{title:ku("Who can edit this chart?"),initialOpen:!1},wp.element.createElement(xu,{label:ku("Select who can edit the chart on the front-end."),value:e.permissions.edit,options:[{value:"all",label:"All Users"},{value:"users",label:"Select Users"},{value:"roles",label:"Select Roles"}],onChange:function(n){e.permissions.edit=n,t.props.edit(e),"users"!==n&&"roles"!==n||t.getPermissionData(n)}}),("users"===e.permissions.edit||"roles"===e.permissions.edit)&&wp.element.createElement(xu,{multiple:!0,value:e.permissions["edit-specific"],options:"users"===e.permissions.edit&&this.state.users||"roles"===e.permissions.edit&&this.state.roles,onChange:function(n){e.permissions["edit-specific"]=n,t.props.edit(e)}})):wp.element.createElement(ju,{title:ku("Who can edit this chart?"),icon:"lock",initialOpen:!1},wp.element.createElement("p",null,ku("Upgrade your license to at least the DEVELOPER version to activate this feature!")),wp.element.createElement(Ou,{isPrimary:!0,href:visualizerLocalize.proTeaser,target:"_blank"},ku("Buy Now"))))}}])&&bu(n.prototype,r),a&&bu(n,a),t}(Tu),Cu=n(134),Pu=n.n(Cu),Hu=wp.components,zu=Hu.Button,Au=Hu.Dashicon,Nu=Hu.G,Fu=Hu.Path,Ru=Hu.SVG;var Wu=function(e){var t=e.label,n=e.icon,r=e.className,a=e.isBack,i=e.onClick,o=Pu()("components-panel__body","components-panel__body-button",r,{"visualizer-panel-back":a});return wp.element.createElement("div",{className:o},wp.element.createElement("h2",{className:"components-panel__body-title"},wp.element.createElement(zu,{className:"components-panel__body-toggle",onClick:i},wp.element.createElement(Ru,{className:"components-panel__arrow",width:"24px",height:"24px",viewBox:"-12 -12 48 48",xmlns:"http://www.w3.org/2000/svg"},wp.element.createElement(Nu,null,wp.element.createElement(Fu,{fill:"none",d:"M0,0h24v24H0V0z"})),wp.element.createElement(Nu,null,wp.element.createElement(Fu,{d:"M7.41,8.59L12,13.17l4.59-4.58L18,10l-6,6l-6-6L7.41,8.59z"}))),n&&wp.element.createElement(Au,{icon:n,className:"components-panel__icon"}),t)))},Iu=n(3),Bu=n.n(Iu);function Ju(e){return(Ju="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){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function qu(e,t){return!t||"object"!==Ju(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Vu(e){return(Vu=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Gu(e,t){return(Gu=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var $u=lodash.startCase,Ku=wp.i18n.__,Zu=wp.element,Qu=Zu.Component,Xu=Zu.Fragment,ec=(wp.blockEditor||wp.editor).InspectorControls,tc=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=qu(this,Vu(t).apply(this,arguments))).state={route:"home"},e}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Gu(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e,t,n=this,r=U(JSON.parse(JSON.stringify(this.props.chart)));return e=0<=["gauge","table","timeline","dataTable"].indexOf(this.props.chart["visualizer-chart-type"])?"dataTable"===r["visualizer-chart-type"]?r["visualizer-chart-type"]:$u(this.props.chart["visualizer-chart-type"]):"".concat($u(this.props.chart["visualizer-chart-type"]),"Chart"),r["visualizer-data-exploded"]&&(t=Ku("Annotations in this chart may not display here but they will display in the front end.")),wp.element.createElement(Xu,null,"home"===this.state.route&&wp.element.createElement(ec,null,wp.element.createElement(Oe,{chart:this.props.chart,readUploadedFile:this.props.readUploadedFile}),wp.element.createElement(mt,{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(jt,{getChartData:this.props.getChartData,isLoading:this.props.isLoading}),wp.element.createElement(an,{chart:this.props.chart,editSchedule:this.props.editDatabaseSchedule,databaseImportData:this.props.databaseImportData}),wp.element.createElement(xn,{chart:this.props.chart,editChartData:this.props.editChartData}),wp.element.createElement(Wu,{label:Ku("Advanced Options"),className:"visualizer-advanced-options",icon:"admin-tools",onClick:function(){return n.setState({route:"showAdvanced"})}}),wp.element.createElement(Wu,{label:Ku("Chart Permissions"),icon:"admin-users",onClick:function(){return n.setState({route:"showPermissions"})}})),("showAdvanced"===this.state.route||"showPermissions"===this.state.route)&&wp.element.createElement(ec,null,wp.element.createElement(Wu,{label:Ku("Chart Settings"),onClick:function(){return n.setState({route:"home"})},isBack:!0}),"showAdvanced"===this.state.route&&wp.element.createElement(fu,{chart:this.props.chart,edit:this.props.editSettings}),"showPermissions"===this.state.route&&wp.element.createElement(Eu,{chart:this.props.chart,edit:this.props.editPermissions})),wp.element.createElement("div",{className:"visualizer-settings__chart"},null!==this.props.chart&&"dataTable"===e?wp.element.createElement(R,{id:this.props.id,rows:r["visualizer-data"],columns:r["visualizer-series"],options:r["visualizer-settings"]}):(r["visualizer-data-exploded"],wp.element.createElement(O,{chartType:e,rows:r["visualizer-data"],columns:r["visualizer-series"],options:$(this.props.chart["visualizer-settings"].manual)?Bu()(V(this.props.chart["visualizer-settings"]),JSON.parse(this.props.chart["visualizer-settings"].manual)):V(this.props.chart["visualizer-settings"]),height:"500px"})),wp.element.createElement("div",{className:"visualizer-settings__charts-footer"},wp.element.createElement("sub",null,t))))}}])&&Uu(n.prototype,r),a&&Uu(n,a),t}(Qu);function nc(e){return(nc="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){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ac(e,t){return!t||"object"!==nc(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function ic(e){return(ic=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function oc(e,t){return(oc=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var sc=lodash.startCase,lc=wp.i18n.__,uc=wp.element,cc=uc.Component,dc=uc.Fragment,mc=wp.components,pc=mc.Button,hc=mc.Dashicon,fc=mc.Toolbar,_c=mc.Tooltip,yc=(wp.blockEditor||wp.editor).BlockControls,gc=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),ac(this,ic(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&oc(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e,t,n=U(JSON.parse(JSON.stringify(this.props.chart)));return e=0<=["gauge","table","timeline","dataTable"].indexOf(this.props.chart["visualizer-chart-type"])?"dataTable"===n["visualizer-chart-type"]?n["visualizer-chart-type"]:sc(this.props.chart["visualizer-chart-type"]):"".concat(sc(this.props.chart["visualizer-chart-type"]),"Chart"),n["visualizer-data-exploded"]&&(t=lc("Annotations in this chart may not display here but they will display in the front end.")),wp.element.createElement("div",{className:this.props.className},null!==this.props.chart&&wp.element.createElement(dc,null,wp.element.createElement(yc,{key:"toolbar-controls"},wp.element.createElement(fc,{className:"components-toolbar"},wp.element.createElement(_c,{text:lc("Edit Chart")},wp.element.createElement(pc,{className:"components-icon-button components-toolbar__control edit-pie-chart",onClick:this.props.editChart},wp.element.createElement(hc,{icon:"edit"}))))),"dataTable"===e?wp.element.createElement(R,{id:this.props.id,rows:n["visualizer-data"],columns:n["visualizer-series"],options:n["visualizer-settings"]}):(n["visualizer-data-exploded"],wp.element.createElement(O,{chartType:e,rows:n["visualizer-data"],columns:n["visualizer-series"],options:$(this.props.chart["visualizer-settings"].manual)?Bu()(V(this.props.chart["visualizer-settings"]),JSON.parse(this.props.chart["visualizer-settings"].manual)):V(this.props.chart["visualizer-settings"]),height:"500px"})),wp.element.createElement("div",{className:"visualizer-settings__charts-footer"},wp.element.createElement("sub",null,t))))}}])&&rc(n.prototype,r),a&&rc(n,a),t}(cc);function bc(e){return(bc="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 vc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function wc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?vc(n,!0).forEach((function(t){Mc(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vc(n).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Mc(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kc(e,t,n,r,a,i,o){try{var s=e[i](o),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,a)}function Lc(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var i=e.apply(t,n);function o(e){kc(i,r,a,o,s,"next",e)}function s(e){kc(i,r,a,o,s,"throw",e)}o(void 0)}))}}function Yc(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Tc(e){return(Tc=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Dc(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Sc(e,t){return(Sc=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Oc=wp.i18n.__,jc=wp,xc=jc.apiFetch,Ec=jc.apiRequest,Cc=wp.element,Pc=Cc.Component,Hc=Cc.Fragment,zc=wp.components,Ac=zc.Button,Nc=zc.ButtonGroup,Fc=zc.Dashicon,Rc=zc.Placeholder,Wc=zc.Notice,Ic=zc.Spinner,Bc=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t){return!t||"object"!==bc(t)&&"function"!=typeof t?Dc(e):t}(this,Tc(t).apply(this,arguments))).getChart=e.getChart.bind(Dc(e)),e.editChart=e.editChart.bind(Dc(e)),e.editSettings=e.editSettings.bind(Dc(e)),e.editPermissions=e.editPermissions.bind(Dc(e)),e.readUploadedFile=e.readUploadedFile.bind(Dc(e)),e.editURL=e.editURL.bind(Dc(e)),e.editSchedule=e.editSchedule.bind(Dc(e)),e.editJSONSchedule=e.editJSONSchedule.bind(Dc(e)),e.editJSONURL=e.editJSONURL.bind(Dc(e)),e.editJSONHeaders=e.editJSONHeaders.bind(Dc(e)),e.editJSONRoot=e.editJSONRoot.bind(Dc(e)),e.editJSONPaging=e.editJSONPaging.bind(Dc(e)),e.JSONImportData=e.JSONImportData.bind(Dc(e)),e.editDatabaseSchedule=e.editDatabaseSchedule.bind(Dc(e)),e.databaseImportData=e.databaseImportData.bind(Dc(e)),e.uploadData=e.uploadData.bind(Dc(e)),e.getChartData=e.getChartData.bind(Dc(e)),e.editChartData=e.editChartData.bind(Dc(e)),e.updateChart=e.updateChart.bind(Dc(e)),e.state={route:e.props.attributes.route?e.props.attributes.route:"home",chart:null,isModified:!1,isLoading:!1,isScheduled:!1},e}var n,r,a,i,o,s;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Sc(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:(s=Lc(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,xc({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 s.apply(this,arguments)})},{key:"getChart",value:(o=Lc(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,xc({path:"wp/v2/visualizer/".concat(t)});case 4:n=e.sent,this.setState({route:"chartSelect",chart:n.chart_data,isLoading:!1}),this.props.setAttributes({id:t,route:"chartSelect"});case 7:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:"editChart",value:function(){this.setState({route:"chartSelect"}),this.props.setAttributes({route:"chartSelect"})}},{key:"editSettings",value:function(e){var t=wc({},this.state.chart);t["visualizer-settings"]=e,this.setState({chart:t,isModified:!0})}},{key:"editPermissions",value:function(e){var t=wc({},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],r=new FileReader;r.onload=function(){var e=function(e,t){t=t||",";for(var n=new RegExp("(\\"+t+"|\\r?\\n|\\r|^)(?:'([^']*(?:''[^']*)*)'|([^'\\"+t+"\\r\\n]*))","gi"),r=[[]],a=null;a=n.exec(e);){var i=a[1];i.length&&i!==t&&r.push([]);var o=void 0;o=a[2]?a[2].replace(new RegExp("''","g"),"'"):a[3],r[r.length-1].push(o)}return r}(r.result);t.editChartData(e,"Visualizer_Source_Csv")},r.readAsText(n)}},{key:"editURL",value:function(e){var t=wc({},this.state.chart);t["visualizer-chart-url"]=e,this.setState({chart:t})}},{key:"editSchedule",value:function(e){var t=wc({},this.state.chart);t["visualizer-chart-schedule"]=e,this.setState({chart:t,isModified:!0})}},{key:"editJSONSchedule",value:function(e){var t=wc({},this.state.chart);t["visualizer-json-schedule"]=e,this.setState({chart:t,isModified:!0})}},{key:"editJSONURL",value:function(e){var t=wc({},this.state.chart);t["visualizer-json-url"]=e,this.setState({chart:t})}},{key:"editJSONHeaders",value:function(e){var t=wc({},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=wc({},this.state.chart);t["visualizer-json-root"]=e,this.setState({chart:t})}},{key:"editJSONPaging",value:function(e){var t=wc({},this.state.chart);t["visualizer-json-paging"]=e,this.setState({chart:t})}},{key:"JSONImportData",value:function(e,t,n){var r=wc({},this.state.chart);r["visualizer-source"]=e,r["visualizer-default-data"]=0,r["visualizer-series"]=t,r["visualizer-data"]=n,this.setState({chart:r,isModified:!0})}},{key:"editDatabaseSchedule",value:function(e){var t=wc({},this.state.chart);t["visualizer-db-schedule"]=e,this.setState({chart:t,isModified:!0})}},{key:"databaseImportData",value:function(e,t,n,r){var a=wc({},this.state.chart);a["visualizer-source"]=t,a["visualizer-default-data"]=0,a["visualizer-series"]=n,a["visualizer-data"]=r,a["visualizer-db-query"]=e,this.setState({chart:a,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}),Ec({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=wc({},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 r=n["visualizer-series"],a=n["visualizer-settings"],i=r,o="series";return"pie"===n["visualizer-chart-type"]&&(i=n["visualizer-data"],o="slices"),i.map((function(e,t){if("pie"===n["visualizer-chart-type"]||0!==t){var r="pie"!==n["visualizer-chart-type"]?t-1:t;void 0===a[o][r]&&(a[o][r]={},a[o][r].temp=1)}})),a[o]=a[o].filter((function(e,t){return t<("pie"!==n["visualizer-chart-type"]?i.length-1:i.length)})),n["visualizer-settings"]=a,e.setState({chart:n,isModified:!0,isLoading:!1}),t}e.setState({isLoading:!1})}),(function(t){return e.setState({isLoading:!1}),t}))}},{key:"getChartData",value:(i=Lc(regeneratorRuntime.mark((function e(t){var n,r;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,xc({path:"wp/v2/visualizer/".concat(t)});case 4:n=e.sent,(r=wc({},this.state.chart))["visualizer-source"]="Visualizer_Source_Csv",r["visualizer-default-data"]=0,r["visualizer-series"]=n.chart_data["visualizer-series"],r["visualizer-data"]=n.chart_data["visualizer-data"],this.setState({isLoading:!1,chart:r});case 11:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"editChartData",value:function(e,t){var n=wc({},this.state.chart),r=[],a=wc({},n["visualizer-settings"]),i=n["visualizer-chart-type"];e[0].map((function(t,n){r[n]={label:t,type:e[1][n]}})),e.splice(0,2);var o=r,s="series";"pie"===i&&(o=e,s="slices",e.map((function(e,t){switch(r[1].type){case"number":e[1]=parseFloat(e[1])}}))),o.map((function(e,t){if("pie"===i||0!==t){var n="pie"!==i?t-1:t;void 0===a[s][n]&&(a[s][n]={},a[s][n].temp=1)}})),a[s]=a[s].filter((function(e,t){return t<(-1>=["pie","tabular","dataTable"].indexOf(i)?o.length-1:o.length)})),n["visualizer-source"]=t,n["visualizer-default-data"]=0,n["visualizer-data"]=e,n["visualizer-series"]=r,n["visualizer-settings"]=a,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})),Ec({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(Wc,{status:"error",isDismissible:!1},wp.element.createElement(Fc,{icon:"chart-pie"}),Oc("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(gc,{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(Fc,{icon:"chart-pie"}),Oc("Visualizer")),"home"===this.state.route&&wp.element.createElement("div",{className:"visualizer-settings__content"},wp.element.createElement("div",{className:"visualizer-settings__content-description"},Oc("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"},Oc("Create a new chart")),wp.element.createElement("div",{className:"visualizer-settings__content-option-icon"},wp.element.createElement(Fc,{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"},Oc("Display an existing chart")),wp.element.createElement("div",{className:"visualizer-settings__content-option-icon"},wp.element.createElement(Fc,{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(Rc,null,wp.element.createElement(Ic,null)),"showCharts"===this.state.route&&!1===this.state.isLoading&&wp.element.createElement(ye,{getChart:this.getChart}),"chartSelect"===this.state.route&&null!==this.state.chart&&wp.element.createElement(tc,{id:this.props.attributes.id,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(Nc,null,wp.element.createElement(Ac,{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})}},Oc("Back")),"chartSelect"===this.state.route&&wp.element.createElement(Hc,null,!1===this.state.isModified?wp.element.createElement(Ac,{isDefault:!0,isLarge:!0,className:"visualizer-bttn-done",onClick:function(){e.setState({route:"renderChart"}),e.props.setAttributes({route:"renderChart"})}},Oc("Done")):wp.element.createElement(Ac,{isPrimary:!0,isLarge:!0,className:"visualizer-bttn-save",isBusy:"updateChart"===this.state.isLoading,disabled:"updateChart"===this.state.isLoading,onClick:this.updateChart},Oc("Save"))))))}}])&&Yc(n.prototype,r),a&&Yc(n,a),t}(Pc),Jc=(n(153),wp.i18n.__),Uc=wp.blocks.registerBlockType;t.default=Uc("visualizer/chart",{title:Jc("Visualizer Chart"),description:Jc("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:[Jc("Visualizer"),Jc("Chart"),Jc("Google Charts")],attributes:{id:{type:"number"},route:{type:"string"}},supports:{customClassName:!1},edit:Bc,save:function(){return null}})}]);
1
+ !function(e){function t(t){for(var r,o,s=t[0],l=t[1],u=t[2],d=0,m=[];d<s.length;d++)o=s[d],Object.prototype.hasOwnProperty.call(a,o)&&a[o]&&m.push(a[o][0]),a[o]=0;for(r in l)Object.prototype.hasOwnProperty.call(l,r)&&(e[r]=l[r]);for(c&&c(t);m.length;)m.shift()();return i.push.apply(i,u||[]),n()}function n(){for(var e,t=0;t<i.length;t++){for(var n=i[t],r=!0,s=1;s<n.length;s++){var l=n[s];0!==a[l]&&(r=!1)}r&&(i.splice(t--,1),e=o(o.s=n[0]))}return e}var r={},a={1:0},i=[];function o(t){if(r[t])return r[t].exports;var n=r[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,o),n.l=!0,n.exports}o.m=e,o.c=r,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)o.d(n,r,function(t){return e[t]}.bind(null,r));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="";var s=window.webpackJsonp=window.webpackJsonp||[],l=s.push.bind(s);s.push=t,s=s.slice();for(var u=0;u<s.length;u++)t(s[u]);var c=l;i.push([154,0]),n()}([function(e,t,n){(function(e){e.exports=function(){"use strict";var t,r;function a(){return t.apply(null,arguments)}function i(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function o(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function s(e){return void 0===e}function l(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function u(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function c(e,t){var n,r=[];for(n=0;n<e.length;++n)r.push(t(e[n],n));return r}function d(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function m(e,t){for(var n in t)d(t,n)&&(e[n]=t[n]);return d(t,"toString")&&(e.toString=t.toString),d(t,"valueOf")&&(e.valueOf=t.valueOf),e}function p(e,t,n,r){return Et(e,t,n,r,!0).utc()}function h(e){return null==e._pf&&(e._pf={empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],meridiem:null,rfc2822:!1,weekdayMismatch:!1}),e._pf}function f(e){if(null==e._isValid){var t=h(e),n=r.call(t.parsedDateParts,(function(e){return null!=e})),a=!isNaN(e._d.getTime())&&t.overflow<0&&!t.empty&&!t.invalidMonth&&!t.invalidWeekday&&!t.weekdayMismatch&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&n);if(e._strict&&(a=a&&0===t.charsLeftOver&&0===t.unusedTokens.length&&void 0===t.bigHour),null!=Object.isFrozen&&Object.isFrozen(e))return a;e._isValid=a}return e._isValid}function _(e){var t=p(NaN);return null!=e?m(h(t),e):h(t).userInvalidated=!0,t}r=Array.prototype.some?Array.prototype.some:function(e){for(var t=Object(this),n=t.length>>>0,r=0;r<n;r++)if(r in t&&e.call(this,t[r],r,t))return!0;return!1};var y=a.momentProperties=[];function g(e,t){var n,r,a;if(s(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),s(t._i)||(e._i=t._i),s(t._f)||(e._f=t._f),s(t._l)||(e._l=t._l),s(t._strict)||(e._strict=t._strict),s(t._tzm)||(e._tzm=t._tzm),s(t._isUTC)||(e._isUTC=t._isUTC),s(t._offset)||(e._offset=t._offset),s(t._pf)||(e._pf=h(t)),s(t._locale)||(e._locale=t._locale),y.length>0)for(n=0;n<y.length;n++)s(a=t[r=y[n]])||(e[r]=a);return e}var b=!1;function v(e){g(this,e),this._d=new Date(null!=e._d?e._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),!1===b&&(b=!0,a.updateOffset(this),b=!1)}function w(e){return e instanceof v||null!=e&&null!=e._isAMomentObject}function M(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function k(e){var t=+e,n=0;return 0!==t&&isFinite(t)&&(n=M(t)),n}function L(e,t,n){var r,a=Math.min(e.length,t.length),i=Math.abs(e.length-t.length),o=0;for(r=0;r<a;r++)(n&&e[r]!==t[r]||!n&&k(e[r])!==k(t[r]))&&o++;return o+i}function Y(e){!1===a.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+e)}function D(e,t){var n=!0;return m((function(){if(null!=a.deprecationHandler&&a.deprecationHandler(null,e),n){for(var r,i=[],o=0;o<arguments.length;o++){if(r="","object"==typeof arguments[o]){for(var s in r+="\n["+o+"] ",arguments[0])r+=s+": "+arguments[0][s]+", ";r=r.slice(0,-2)}else r=arguments[o];i.push(r)}Y(e+"\nArguments: "+Array.prototype.slice.call(i).join("")+"\n"+(new Error).stack),n=!1}return t.apply(this,arguments)}),t)}var T,S={};function O(e,t){null!=a.deprecationHandler&&a.deprecationHandler(e,t),S[e]||(Y(t),S[e]=!0)}function j(e){return e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}function x(e,t){var n,r=m({},e);for(n in t)d(t,n)&&(o(e[n])&&o(t[n])?(r[n]={},m(r[n],e[n]),m(r[n],t[n])):null!=t[n]?r[n]=t[n]:delete r[n]);for(n in e)d(e,n)&&!d(t,n)&&o(e[n])&&(r[n]=m({},r[n]));return r}function E(e){null!=e&&this.set(e)}a.suppressDeprecationWarnings=!1,a.deprecationHandler=null,T=Object.keys?Object.keys:function(e){var t,n=[];for(t in e)d(e,t)&&n.push(t);return n};var C={};function P(e,t){var n=e.toLowerCase();C[n]=C[n+"s"]=C[t]=e}function H(e){return"string"==typeof e?C[e]||C[e.toLowerCase()]:void 0}function z(e){var t,n,r={};for(n in e)d(e,n)&&(t=H(n))&&(r[t]=e[n]);return r}var A={};function N(e,t){A[e]=t}function F(e,t,n){var r=""+Math.abs(e),a=t-r.length;return(e>=0?n?"+":"":"-")+Math.pow(10,Math.max(0,a)).toString().substr(1)+r}var R=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,W=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,I={},B={};function J(e,t,n,r){var a=r;"string"==typeof r&&(a=function(){return this[r]()}),e&&(B[e]=a),t&&(B[t[0]]=function(){return F(a.apply(this,arguments),t[1],t[2])}),n&&(B[n]=function(){return this.localeData().ordinal(a.apply(this,arguments),e)})}function U(e,t){return e.isValid()?(t=q(t,e.localeData()),I[t]=I[t]||function(e){var t,n,r,a=e.match(R);for(t=0,n=a.length;t<n;t++)B[a[t]]?a[t]=B[a[t]]:a[t]=(r=a[t]).match(/\[[\s\S]/)?r.replace(/^\[|\]$/g,""):r.replace(/\\/g,"");return function(t){var r,i="";for(r=0;r<n;r++)i+=j(a[r])?a[r].call(t,e):a[r];return i}}(t),I[t](e)):e.localeData().invalidDate()}function q(e,t){var n=5;function r(e){return t.longDateFormat(e)||e}for(W.lastIndex=0;n>=0&&W.test(e);)e=e.replace(W,r),W.lastIndex=0,n-=1;return e}var V=/\d/,G=/\d\d/,$=/\d{3}/,K=/\d{4}/,Z=/[+-]?\d{6}/,Q=/\d\d?/,X=/\d\d\d\d?/,ee=/\d\d\d\d\d\d?/,te=/\d{1,3}/,ne=/\d{1,4}/,re=/[+-]?\d{1,6}/,ae=/\d+/,ie=/[+-]?\d+/,oe=/Z|[+-]\d\d:?\d\d/gi,se=/Z|[+-]\d\d(?::?\d\d)?/gi,le=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,ue={};function ce(e,t,n){ue[e]=j(t)?t:function(e,r){return e&&n?n:t}}function de(e,t){return d(ue,e)?ue[e](t._strict,t._locale):new RegExp(me(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,(function(e,t,n,r,a){return t||n||r||a}))))}function me(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}var pe={};function he(e,t){var n,r=t;for("string"==typeof e&&(e=[e]),l(t)&&(r=function(e,n){n[t]=k(e)}),n=0;n<e.length;n++)pe[e[n]]=r}function fe(e,t){he(e,(function(e,n,r,a){r._w=r._w||{},t(e,r._w,r,a)}))}function _e(e,t,n){null!=t&&d(pe,e)&&pe[e](t,n._a,n,e)}var ye=0,ge=1,be=2,ve=3,we=4,Me=5,ke=6,Le=7,Ye=8;function De(e){return Te(e)?366:365}function Te(e){return e%4==0&&e%100!=0||e%400==0}J("Y",0,0,(function(){var e=this.year();return e<=9999?""+e:"+"+e})),J(0,["YY",2],0,(function(){return this.year()%100})),J(0,["YYYY",4],0,"year"),J(0,["YYYYY",5],0,"year"),J(0,["YYYYYY",6,!0],0,"year"),P("year","y"),N("year",1),ce("Y",ie),ce("YY",Q,G),ce("YYYY",ne,K),ce("YYYYY",re,Z),ce("YYYYYY",re,Z),he(["YYYYY","YYYYYY"],ye),he("YYYY",(function(e,t){t[ye]=2===e.length?a.parseTwoDigitYear(e):k(e)})),he("YY",(function(e,t){t[ye]=a.parseTwoDigitYear(e)})),he("Y",(function(e,t){t[ye]=parseInt(e,10)})),a.parseTwoDigitYear=function(e){return k(e)+(k(e)>68?1900:2e3)};var Se,Oe=je("FullYear",!0);function je(e,t){return function(n){return null!=n?(Ee(this,e,n),a.updateOffset(this,t),this):xe(this,e)}}function xe(e,t){return e.isValid()?e._d["get"+(e._isUTC?"UTC":"")+t]():NaN}function Ee(e,t,n){e.isValid()&&!isNaN(n)&&("FullYear"===t&&Te(e.year())&&1===e.month()&&29===e.date()?e._d["set"+(e._isUTC?"UTC":"")+t](n,e.month(),Ce(n,e.month())):e._d["set"+(e._isUTC?"UTC":"")+t](n))}function Ce(e,t){if(isNaN(e)||isNaN(t))return NaN;var n,r=(t%(n=12)+n)%n;return e+=(t-r)/12,1===r?Te(e)?29:28:31-r%7%2}Se=Array.prototype.indexOf?Array.prototype.indexOf:function(e){var t;for(t=0;t<this.length;++t)if(this[t]===e)return t;return-1},J("M",["MM",2],"Mo",(function(){return this.month()+1})),J("MMM",0,0,(function(e){return this.localeData().monthsShort(this,e)})),J("MMMM",0,0,(function(e){return this.localeData().months(this,e)})),P("month","M"),N("month",8),ce("M",Q),ce("MM",Q,G),ce("MMM",(function(e,t){return t.monthsShortRegex(e)})),ce("MMMM",(function(e,t){return t.monthsRegex(e)})),he(["M","MM"],(function(e,t){t[ge]=k(e)-1})),he(["MMM","MMMM"],(function(e,t,n,r){var a=n._locale.monthsParse(e,r,n._strict);null!=a?t[ge]=a:h(n).invalidMonth=e}));var Pe=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,He="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ze="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_");function Ae(e,t,n){var r,a,i,o=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],r=0;r<12;++r)i=p([2e3,r]),this._shortMonthsParse[r]=this.monthsShort(i,"").toLocaleLowerCase(),this._longMonthsParse[r]=this.months(i,"").toLocaleLowerCase();return n?"MMM"===t?-1!==(a=Se.call(this._shortMonthsParse,o))?a:null:-1!==(a=Se.call(this._longMonthsParse,o))?a:null:"MMM"===t?-1!==(a=Se.call(this._shortMonthsParse,o))?a:-1!==(a=Se.call(this._longMonthsParse,o))?a:null:-1!==(a=Se.call(this._longMonthsParse,o))?a:-1!==(a=Se.call(this._shortMonthsParse,o))?a:null}function Ne(e,t){var n;if(!e.isValid())return e;if("string"==typeof t)if(/^\d+$/.test(t))t=k(t);else if(!l(t=e.localeData().monthsParse(t)))return e;return n=Math.min(e.date(),Ce(e.year(),t)),e._d["set"+(e._isUTC?"UTC":"")+"Month"](t,n),e}function Fe(e){return null!=e?(Ne(this,e),a.updateOffset(this,!0),this):xe(this,"Month")}var Re=le,We=le;function Ie(){function e(e,t){return t.length-e.length}var t,n,r=[],a=[],i=[];for(t=0;t<12;t++)n=p([2e3,t]),r.push(this.monthsShort(n,"")),a.push(this.months(n,"")),i.push(this.months(n,"")),i.push(this.monthsShort(n,""));for(r.sort(e),a.sort(e),i.sort(e),t=0;t<12;t++)r[t]=me(r[t]),a[t]=me(a[t]);for(t=0;t<24;t++)i[t]=me(i[t]);this._monthsRegex=new RegExp("^("+i.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+a.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+r.join("|")+")","i")}function Be(e,t,n,r,a,i,o){var s=new Date(e,t,n,r,a,i,o);return e<100&&e>=0&&isFinite(s.getFullYear())&&s.setFullYear(e),s}function Je(e){var t=new Date(Date.UTC.apply(null,arguments));return e<100&&e>=0&&isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e),t}function Ue(e,t,n){var r=7+t-n;return-(7+Je(e,0,r).getUTCDay()-t)%7+r-1}function qe(e,t,n,r,a){var i,o,s=1+7*(t-1)+(7+n-r)%7+Ue(e,r,a);return s<=0?o=De(i=e-1)+s:s>De(e)?(i=e+1,o=s-De(e)):(i=e,o=s),{year:i,dayOfYear:o}}function Ve(e,t,n){var r,a,i=Ue(e.year(),t,n),o=Math.floor((e.dayOfYear()-i-1)/7)+1;return o<1?r=o+Ge(a=e.year()-1,t,n):o>Ge(e.year(),t,n)?(r=o-Ge(e.year(),t,n),a=e.year()+1):(a=e.year(),r=o),{week:r,year:a}}function Ge(e,t,n){var r=Ue(e,t,n),a=Ue(e+1,t,n);return(De(e)-r+a)/7}J("w",["ww",2],"wo","week"),J("W",["WW",2],"Wo","isoWeek"),P("week","w"),P("isoWeek","W"),N("week",5),N("isoWeek",5),ce("w",Q),ce("ww",Q,G),ce("W",Q),ce("WW",Q,G),fe(["w","ww","W","WW"],(function(e,t,n,r){t[r.substr(0,1)]=k(e)})),J("d",0,"do","day"),J("dd",0,0,(function(e){return this.localeData().weekdaysMin(this,e)})),J("ddd",0,0,(function(e){return this.localeData().weekdaysShort(this,e)})),J("dddd",0,0,(function(e){return this.localeData().weekdays(this,e)})),J("e",0,0,"weekday"),J("E",0,0,"isoWeekday"),P("day","d"),P("weekday","e"),P("isoWeekday","E"),N("day",11),N("weekday",11),N("isoWeekday",11),ce("d",Q),ce("e",Q),ce("E",Q),ce("dd",(function(e,t){return t.weekdaysMinRegex(e)})),ce("ddd",(function(e,t){return t.weekdaysShortRegex(e)})),ce("dddd",(function(e,t){return t.weekdaysRegex(e)})),fe(["dd","ddd","dddd"],(function(e,t,n,r){var a=n._locale.weekdaysParse(e,r,n._strict);null!=a?t.d=a:h(n).invalidWeekday=e})),fe(["d","e","E"],(function(e,t,n,r){t[r]=k(e)}));var $e="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Ke="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Ze="Su_Mo_Tu_We_Th_Fr_Sa".split("_");function Qe(e,t,n){var r,a,i,o=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],r=0;r<7;++r)i=p([2e3,1]).day(r),this._minWeekdaysParse[r]=this.weekdaysMin(i,"").toLocaleLowerCase(),this._shortWeekdaysParse[r]=this.weekdaysShort(i,"").toLocaleLowerCase(),this._weekdaysParse[r]=this.weekdays(i,"").toLocaleLowerCase();return n?"dddd"===t?-1!==(a=Se.call(this._weekdaysParse,o))?a:null:"ddd"===t?-1!==(a=Se.call(this._shortWeekdaysParse,o))?a:null:-1!==(a=Se.call(this._minWeekdaysParse,o))?a:null:"dddd"===t?-1!==(a=Se.call(this._weekdaysParse,o))?a:-1!==(a=Se.call(this._shortWeekdaysParse,o))?a:-1!==(a=Se.call(this._minWeekdaysParse,o))?a:null:"ddd"===t?-1!==(a=Se.call(this._shortWeekdaysParse,o))?a:-1!==(a=Se.call(this._weekdaysParse,o))?a:-1!==(a=Se.call(this._minWeekdaysParse,o))?a:null:-1!==(a=Se.call(this._minWeekdaysParse,o))?a:-1!==(a=Se.call(this._weekdaysParse,o))?a:-1!==(a=Se.call(this._shortWeekdaysParse,o))?a:null}var Xe=le,et=le,tt=le;function nt(){function e(e,t){return t.length-e.length}var t,n,r,a,i,o=[],s=[],l=[],u=[];for(t=0;t<7;t++)n=p([2e3,1]).day(t),r=this.weekdaysMin(n,""),a=this.weekdaysShort(n,""),i=this.weekdays(n,""),o.push(r),s.push(a),l.push(i),u.push(r),u.push(a),u.push(i);for(o.sort(e),s.sort(e),l.sort(e),u.sort(e),t=0;t<7;t++)s[t]=me(s[t]),l[t]=me(l[t]),u[t]=me(u[t]);this._weekdaysRegex=new RegExp("^("+u.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+o.join("|")+")","i")}function rt(){return this.hours()%12||12}function at(e,t){J(e,0,0,(function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)}))}function it(e,t){return t._meridiemParse}J("H",["HH",2],0,"hour"),J("h",["hh",2],0,rt),J("k",["kk",2],0,(function(){return this.hours()||24})),J("hmm",0,0,(function(){return""+rt.apply(this)+F(this.minutes(),2)})),J("hmmss",0,0,(function(){return""+rt.apply(this)+F(this.minutes(),2)+F(this.seconds(),2)})),J("Hmm",0,0,(function(){return""+this.hours()+F(this.minutes(),2)})),J("Hmmss",0,0,(function(){return""+this.hours()+F(this.minutes(),2)+F(this.seconds(),2)})),at("a",!0),at("A",!1),P("hour","h"),N("hour",13),ce("a",it),ce("A",it),ce("H",Q),ce("h",Q),ce("k",Q),ce("HH",Q,G),ce("hh",Q,G),ce("kk",Q,G),ce("hmm",X),ce("hmmss",ee),ce("Hmm",X),ce("Hmmss",ee),he(["H","HH"],ve),he(["k","kk"],(function(e,t,n){var r=k(e);t[ve]=24===r?0:r})),he(["a","A"],(function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e})),he(["h","hh"],(function(e,t,n){t[ve]=k(e),h(n).bigHour=!0})),he("hmm",(function(e,t,n){var r=e.length-2;t[ve]=k(e.substr(0,r)),t[we]=k(e.substr(r)),h(n).bigHour=!0})),he("hmmss",(function(e,t,n){var r=e.length-4,a=e.length-2;t[ve]=k(e.substr(0,r)),t[we]=k(e.substr(r,2)),t[Me]=k(e.substr(a)),h(n).bigHour=!0})),he("Hmm",(function(e,t,n){var r=e.length-2;t[ve]=k(e.substr(0,r)),t[we]=k(e.substr(r))})),he("Hmmss",(function(e,t,n){var r=e.length-4,a=e.length-2;t[ve]=k(e.substr(0,r)),t[we]=k(e.substr(r,2)),t[Me]=k(e.substr(a))}));var ot,st=je("Hours",!0),lt={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:He,monthsShort:ze,week:{dow:0,doy:6},weekdays:$e,weekdaysMin:Ze,weekdaysShort:Ke,meridiemParse:/[ap]\.?m?\.?/i},ut={},ct={};function dt(e){return e?e.toLowerCase().replace("_","-"):e}function mt(t){var r=null;if(!ut[t]&&void 0!==e&&e&&e.exports)try{r=ot._abbr,n(149)("./"+t),pt(r)}catch(e){}return ut[t]}function pt(e,t){var n;return e&&(n=s(t)?ft(e):ht(e,t))&&(ot=n),ot._abbr}function ht(e,t){if(null!==t){var n=lt;if(t.abbr=e,null!=ut[e])O("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),n=ut[e]._config;else if(null!=t.parentLocale){if(null==ut[t.parentLocale])return ct[t.parentLocale]||(ct[t.parentLocale]=[]),ct[t.parentLocale].push({name:e,config:t}),null;n=ut[t.parentLocale]._config}return ut[e]=new E(x(n,t)),ct[e]&&ct[e].forEach((function(e){ht(e.name,e.config)})),pt(e),ut[e]}return delete ut[e],null}function ft(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return ot;if(!i(e)){if(t=mt(e))return t;e=[e]}return function(e){for(var t,n,r,a,i=0;i<e.length;){for(t=(a=dt(e[i]).split("-")).length,n=(n=dt(e[i+1]))?n.split("-"):null;t>0;){if(r=mt(a.slice(0,t).join("-")))return r;if(n&&n.length>=t&&L(a,n,!0)>=t-1)break;t--}i++}return null}(e)}function _t(e){var t,n=e._a;return n&&-2===h(e).overflow&&(t=n[ge]<0||n[ge]>11?ge:n[be]<1||n[be]>Ce(n[ye],n[ge])?be:n[ve]<0||n[ve]>24||24===n[ve]&&(0!==n[we]||0!==n[Me]||0!==n[ke])?ve:n[we]<0||n[we]>59?we:n[Me]<0||n[Me]>59?Me:n[ke]<0||n[ke]>999?ke:-1,h(e)._overflowDayOfYear&&(t<ye||t>be)&&(t=be),h(e)._overflowWeeks&&-1===t&&(t=Le),h(e)._overflowWeekday&&-1===t&&(t=Ye),h(e).overflow=t),e}function yt(e,t,n){return null!=e?e:null!=t?t:n}function gt(e){var t,n,r,i,o,s=[];if(!e._d){for(r=function(e){var t=new Date(a.now());return e._useUTC?[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()]:[t.getFullYear(),t.getMonth(),t.getDate()]}(e),e._w&&null==e._a[be]&&null==e._a[ge]&&function(e){var t,n,r,a,i,o,s,l;if(null!=(t=e._w).GG||null!=t.W||null!=t.E)i=1,o=4,n=yt(t.GG,e._a[ye],Ve(Ct(),1,4).year),r=yt(t.W,1),((a=yt(t.E,1))<1||a>7)&&(l=!0);else{i=e._locale._week.dow,o=e._locale._week.doy;var u=Ve(Ct(),i,o);n=yt(t.gg,e._a[ye],u.year),r=yt(t.w,u.week),null!=t.d?((a=t.d)<0||a>6)&&(l=!0):null!=t.e?(a=t.e+i,(t.e<0||t.e>6)&&(l=!0)):a=i}r<1||r>Ge(n,i,o)?h(e)._overflowWeeks=!0:null!=l?h(e)._overflowWeekday=!0:(s=qe(n,r,a,i,o),e._a[ye]=s.year,e._dayOfYear=s.dayOfYear)}(e),null!=e._dayOfYear&&(o=yt(e._a[ye],r[ye]),(e._dayOfYear>De(o)||0===e._dayOfYear)&&(h(e)._overflowDayOfYear=!0),n=Je(o,0,e._dayOfYear),e._a[ge]=n.getUTCMonth(),e._a[be]=n.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=s[t]=r[t];for(;t<7;t++)e._a[t]=s[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[ve]&&0===e._a[we]&&0===e._a[Me]&&0===e._a[ke]&&(e._nextDay=!0,e._a[ve]=0),e._d=(e._useUTC?Je:Be).apply(null,s),i=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[ve]=24),e._w&&void 0!==e._w.d&&e._w.d!==i&&(h(e).weekdayMismatch=!0)}}var bt=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,vt=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,wt=/Z|[+-]\d\d(?::?\d\d)?/,Mt=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],kt=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Lt=/^\/?Date\((\-?\d+)/i;function Yt(e){var t,n,r,a,i,o,s=e._i,l=bt.exec(s)||vt.exec(s);if(l){for(h(e).iso=!0,t=0,n=Mt.length;t<n;t++)if(Mt[t][1].exec(l[1])){a=Mt[t][0],r=!1!==Mt[t][2];break}if(null==a)return void(e._isValid=!1);if(l[3]){for(t=0,n=kt.length;t<n;t++)if(kt[t][1].exec(l[3])){i=(l[2]||" ")+kt[t][0];break}if(null==i)return void(e._isValid=!1)}if(!r&&null!=i)return void(e._isValid=!1);if(l[4]){if(!wt.exec(l[4]))return void(e._isValid=!1);o="Z"}e._f=a+(i||"")+(o||""),jt(e)}else e._isValid=!1}var Dt=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/;function Tt(e){var t=parseInt(e,10);return t<=49?2e3+t:t<=999?1900+t:t}var St={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Ot(e){var t,n,r,a,i,o,s,l=Dt.exec(e._i.replace(/\([^)]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim());if(l){var u=(t=l[4],n=l[3],r=l[2],a=l[5],i=l[6],o=l[7],s=[Tt(t),ze.indexOf(n),parseInt(r,10),parseInt(a,10),parseInt(i,10)],o&&s.push(parseInt(o,10)),s);if(!function(e,t,n){return!e||Ke.indexOf(e)===new Date(t[0],t[1],t[2]).getDay()||(h(n).weekdayMismatch=!0,n._isValid=!1,!1)}(l[1],u,e))return;e._a=u,e._tzm=function(e,t,n){if(e)return St[e];if(t)return 0;var r=parseInt(n,10),a=r%100;return(r-a)/100*60+a}(l[8],l[9],l[10]),e._d=Je.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),h(e).rfc2822=!0}else e._isValid=!1}function jt(e){if(e._f!==a.ISO_8601)if(e._f!==a.RFC_2822){e._a=[],h(e).empty=!0;var t,n,r,i,o,s=""+e._i,l=s.length,u=0;for(r=q(e._f,e._locale).match(R)||[],t=0;t<r.length;t++)i=r[t],(n=(s.match(de(i,e))||[])[0])&&((o=s.substr(0,s.indexOf(n))).length>0&&h(e).unusedInput.push(o),s=s.slice(s.indexOf(n)+n.length),u+=n.length),B[i]?(n?h(e).empty=!1:h(e).unusedTokens.push(i),_e(i,n,e)):e._strict&&!n&&h(e).unusedTokens.push(i);h(e).charsLeftOver=l-u,s.length>0&&h(e).unusedInput.push(s),e._a[ve]<=12&&!0===h(e).bigHour&&e._a[ve]>0&&(h(e).bigHour=void 0),h(e).parsedDateParts=e._a.slice(0),h(e).meridiem=e._meridiem,e._a[ve]=function(e,t,n){var r;return null==n?t:null!=e.meridiemHour?e.meridiemHour(t,n):null!=e.isPM?((r=e.isPM(n))&&t<12&&(t+=12),r||12!==t||(t=0),t):t}(e._locale,e._a[ve],e._meridiem),gt(e),_t(e)}else Ot(e);else Yt(e)}function xt(e){var t=e._i,n=e._f;return e._locale=e._locale||ft(e._l),null===t||void 0===n&&""===t?_({nullInput:!0}):("string"==typeof t&&(e._i=t=e._locale.preparse(t)),w(t)?new v(_t(t)):(u(t)?e._d=t:i(n)?function(e){var t,n,r,a,i;if(0===e._f.length)return h(e).invalidFormat=!0,void(e._d=new Date(NaN));for(a=0;a<e._f.length;a++)i=0,t=g({},e),null!=e._useUTC&&(t._useUTC=e._useUTC),t._f=e._f[a],jt(t),f(t)&&(i+=h(t).charsLeftOver,i+=10*h(t).unusedTokens.length,h(t).score=i,(null==r||i<r)&&(r=i,n=t));m(e,n||t)}(e):n?jt(e):function(e){var t=e._i;s(t)?e._d=new Date(a.now()):u(t)?e._d=new Date(t.valueOf()):"string"==typeof t?function(e){var t=Lt.exec(e._i);null===t?(Yt(e),!1===e._isValid&&(delete e._isValid,Ot(e),!1===e._isValid&&(delete e._isValid,a.createFromInputFallback(e)))):e._d=new Date(+t[1])}(e):i(t)?(e._a=c(t.slice(0),(function(e){return parseInt(e,10)})),gt(e)):o(t)?function(e){if(!e._d){var t=z(e._i);e._a=c([t.year,t.month,t.day||t.date,t.hour,t.minute,t.second,t.millisecond],(function(e){return e&&parseInt(e,10)})),gt(e)}}(e):l(t)?e._d=new Date(t):a.createFromInputFallback(e)}(e),f(e)||(e._d=null),e))}function Et(e,t,n,r,a){var s,l={};return!0!==n&&!1!==n||(r=n,n=void 0),(o(e)&&function(e){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(e).length;var t;for(t in e)if(e.hasOwnProperty(t))return!1;return!0}(e)||i(e)&&0===e.length)&&(e=void 0),l._isAMomentObject=!0,l._useUTC=l._isUTC=a,l._l=n,l._i=e,l._f=t,l._strict=r,(s=new v(_t(xt(l))))._nextDay&&(s.add(1,"d"),s._nextDay=void 0),s}function Ct(e,t,n,r){return Et(e,t,n,r,!1)}a.createFromInputFallback=D("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged and will be removed in an upcoming major release. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",(function(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))})),a.ISO_8601=function(){},a.RFC_2822=function(){};var Pt=D("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",(function(){var e=Ct.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:_()})),Ht=D("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",(function(){var e=Ct.apply(null,arguments);return this.isValid()&&e.isValid()?e>this?this:e:_()}));function zt(e,t){var n,r;if(1===t.length&&i(t[0])&&(t=t[0]),!t.length)return Ct();for(n=t[0],r=1;r<t.length;++r)t[r].isValid()&&!t[r][e](n)||(n=t[r]);return n}var At=["year","quarter","month","week","day","hour","minute","second","millisecond"];function Nt(e){var t=z(e),n=t.year||0,r=t.quarter||0,a=t.month||0,i=t.week||0,o=t.day||0,s=t.hour||0,l=t.minute||0,u=t.second||0,c=t.millisecond||0;this._isValid=function(e){for(var t in e)if(-1===Se.call(At,t)||null!=e[t]&&isNaN(e[t]))return!1;for(var n=!1,r=0;r<At.length;++r)if(e[At[r]]){if(n)return!1;parseFloat(e[At[r]])!==k(e[At[r]])&&(n=!0)}return!0}(t),this._milliseconds=+c+1e3*u+6e4*l+1e3*s*60*60,this._days=+o+7*i,this._months=+a+3*r+12*n,this._data={},this._locale=ft(),this._bubble()}function Ft(e){return e instanceof Nt}function Rt(e){return e<0?-1*Math.round(-1*e):Math.round(e)}function Wt(e,t){J(e,0,0,(function(){var e=this.utcOffset(),n="+";return e<0&&(e=-e,n="-"),n+F(~~(e/60),2)+t+F(~~e%60,2)}))}Wt("Z",":"),Wt("ZZ",""),ce("Z",se),ce("ZZ",se),he(["Z","ZZ"],(function(e,t,n){n._useUTC=!0,n._tzm=Bt(se,e)}));var It=/([\+\-]|\d\d)/gi;function Bt(e,t){var n=(t||"").match(e);if(null===n)return null;var r=((n[n.length-1]||[])+"").match(It)||["-",0,0],a=60*r[1]+k(r[2]);return 0===a?0:"+"===r[0]?a:-a}function Jt(e,t){var n,r;return t._isUTC?(n=t.clone(),r=(w(e)||u(e)?e.valueOf():Ct(e).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+r),a.updateOffset(n,!1),n):Ct(e).local()}function Ut(e){return 15*-Math.round(e._d.getTimezoneOffset()/15)}function qt(){return!!this.isValid()&&this._isUTC&&0===this._offset}a.updateOffset=function(){};var Vt=/^(\-|\+)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/,Gt=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function $t(e,t){var n,r,a,i,o,s,u=e,c=null;return Ft(e)?u={ms:e._milliseconds,d:e._days,M:e._months}:l(e)?(u={},t?u[t]=e:u.milliseconds=e):(c=Vt.exec(e))?(n="-"===c[1]?-1:1,u={y:0,d:k(c[be])*n,h:k(c[ve])*n,m:k(c[we])*n,s:k(c[Me])*n,ms:k(Rt(1e3*c[ke]))*n}):(c=Gt.exec(e))?(n="-"===c[1]?-1:(c[1],1),u={y:Kt(c[2],n),M:Kt(c[3],n),w:Kt(c[4],n),d:Kt(c[5],n),h:Kt(c[6],n),m:Kt(c[7],n),s:Kt(c[8],n)}):null==u?u={}:"object"==typeof u&&("from"in u||"to"in u)&&(i=Ct(u.from),o=Ct(u.to),a=i.isValid()&&o.isValid()?(o=Jt(o,i),i.isBefore(o)?s=Zt(i,o):((s=Zt(o,i)).milliseconds=-s.milliseconds,s.months=-s.months),s):{milliseconds:0,months:0},(u={}).ms=a.milliseconds,u.M=a.months),r=new Nt(u),Ft(e)&&d(e,"_locale")&&(r._locale=e._locale),r}function Kt(e,t){var n=e&&parseFloat(e.replace(",","."));return(isNaN(n)?0:n)*t}function Zt(e,t){var n={milliseconds:0,months:0};return n.months=t.month()-e.month()+12*(t.year()-e.year()),e.clone().add(n.months,"M").isAfter(t)&&--n.months,n.milliseconds=+t-+e.clone().add(n.months,"M"),n}function Qt(e,t){return function(n,r){var a;return null===r||isNaN(+r)||(O(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),a=n,n=r,r=a),Xt(this,$t(n="string"==typeof n?+n:n,r),e),this}}function Xt(e,t,n,r){var i=t._milliseconds,o=Rt(t._days),s=Rt(t._months);e.isValid()&&(r=null==r||r,s&&Ne(e,xe(e,"Month")+s*n),o&&Ee(e,"Date",xe(e,"Date")+o*n),i&&e._d.setTime(e._d.valueOf()+i*n),r&&a.updateOffset(e,o||s))}$t.fn=Nt.prototype,$t.invalid=function(){return $t(NaN)};var en=Qt(1,"add"),tn=Qt(-1,"subtract");function nn(e,t){var n=12*(t.year()-e.year())+(t.month()-e.month()),r=e.clone().add(n,"months");return-(n+(t-r<0?(t-r)/(r-e.clone().add(n-1,"months")):(t-r)/(e.clone().add(n+1,"months")-r)))||0}function rn(e){var t;return void 0===e?this._locale._abbr:(null!=(t=ft(e))&&(this._locale=t),this)}a.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",a.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var an=D("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",(function(e){return void 0===e?this.localeData():this.locale(e)}));function on(){return this._locale}function sn(e,t){J(0,[e,e.length],0,t)}function ln(e,t,n,r,a){var i;return null==e?Ve(this,r,a).year:(t>(i=Ge(e,r,a))&&(t=i),un.call(this,e,t,n,r,a))}function un(e,t,n,r,a){var i=qe(e,t,n,r,a),o=Je(i.year,0,i.dayOfYear);return this.year(o.getUTCFullYear()),this.month(o.getUTCMonth()),this.date(o.getUTCDate()),this}J(0,["gg",2],0,(function(){return this.weekYear()%100})),J(0,["GG",2],0,(function(){return this.isoWeekYear()%100})),sn("gggg","weekYear"),sn("ggggg","weekYear"),sn("GGGG","isoWeekYear"),sn("GGGGG","isoWeekYear"),P("weekYear","gg"),P("isoWeekYear","GG"),N("weekYear",1),N("isoWeekYear",1),ce("G",ie),ce("g",ie),ce("GG",Q,G),ce("gg",Q,G),ce("GGGG",ne,K),ce("gggg",ne,K),ce("GGGGG",re,Z),ce("ggggg",re,Z),fe(["gggg","ggggg","GGGG","GGGGG"],(function(e,t,n,r){t[r.substr(0,2)]=k(e)})),fe(["gg","GG"],(function(e,t,n,r){t[r]=a.parseTwoDigitYear(e)})),J("Q",0,"Qo","quarter"),P("quarter","Q"),N("quarter",7),ce("Q",V),he("Q",(function(e,t){t[ge]=3*(k(e)-1)})),J("D",["DD",2],"Do","date"),P("date","D"),N("date",9),ce("D",Q),ce("DD",Q,G),ce("Do",(function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient})),he(["D","DD"],be),he("Do",(function(e,t){t[be]=k(e.match(Q)[0])}));var cn=je("Date",!0);J("DDD",["DDDD",3],"DDDo","dayOfYear"),P("dayOfYear","DDD"),N("dayOfYear",4),ce("DDD",te),ce("DDDD",$),he(["DDD","DDDD"],(function(e,t,n){n._dayOfYear=k(e)})),J("m",["mm",2],0,"minute"),P("minute","m"),N("minute",14),ce("m",Q),ce("mm",Q,G),he(["m","mm"],we);var dn=je("Minutes",!1);J("s",["ss",2],0,"second"),P("second","s"),N("second",15),ce("s",Q),ce("ss",Q,G),he(["s","ss"],Me);var mn,pn=je("Seconds",!1);for(J("S",0,0,(function(){return~~(this.millisecond()/100)})),J(0,["SS",2],0,(function(){return~~(this.millisecond()/10)})),J(0,["SSS",3],0,"millisecond"),J(0,["SSSS",4],0,(function(){return 10*this.millisecond()})),J(0,["SSSSS",5],0,(function(){return 100*this.millisecond()})),J(0,["SSSSSS",6],0,(function(){return 1e3*this.millisecond()})),J(0,["SSSSSSS",7],0,(function(){return 1e4*this.millisecond()})),J(0,["SSSSSSSS",8],0,(function(){return 1e5*this.millisecond()})),J(0,["SSSSSSSSS",9],0,(function(){return 1e6*this.millisecond()})),P("millisecond","ms"),N("millisecond",16),ce("S",te,V),ce("SS",te,G),ce("SSS",te,$),mn="SSSS";mn.length<=9;mn+="S")ce(mn,ae);function hn(e,t){t[ke]=k(1e3*("0."+e))}for(mn="S";mn.length<=9;mn+="S")he(mn,hn);var fn=je("Milliseconds",!1);J("z",0,0,"zoneAbbr"),J("zz",0,0,"zoneName");var _n=v.prototype;function yn(e){return e}_n.add=en,_n.calendar=function(e,t){var n=e||Ct(),r=Jt(n,this).startOf("day"),i=a.calendarFormat(this,r)||"sameElse",o=t&&(j(t[i])?t[i].call(this,n):t[i]);return this.format(o||this.localeData().calendar(i,this,Ct(n)))},_n.clone=function(){return new v(this)},_n.diff=function(e,t,n){var r,a,i;if(!this.isValid())return NaN;if(!(r=Jt(e,this)).isValid())return NaN;switch(a=6e4*(r.utcOffset()-this.utcOffset()),t=H(t)){case"year":i=nn(this,r)/12;break;case"month":i=nn(this,r);break;case"quarter":i=nn(this,r)/3;break;case"second":i=(this-r)/1e3;break;case"minute":i=(this-r)/6e4;break;case"hour":i=(this-r)/36e5;break;case"day":i=(this-r-a)/864e5;break;case"week":i=(this-r-a)/6048e5;break;default:i=this-r}return n?i:M(i)},_n.endOf=function(e){return void 0===(e=H(e))||"millisecond"===e?this:("date"===e&&(e="day"),this.startOf(e).add(1,"isoWeek"===e?"week":e).subtract(1,"ms"))},_n.format=function(e){e||(e=this.isUtc()?a.defaultFormatUtc:a.defaultFormat);var t=U(this,e);return this.localeData().postformat(t)},_n.from=function(e,t){return this.isValid()&&(w(e)&&e.isValid()||Ct(e).isValid())?$t({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},_n.fromNow=function(e){return this.from(Ct(),e)},_n.to=function(e,t){return this.isValid()&&(w(e)&&e.isValid()||Ct(e).isValid())?$t({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},_n.toNow=function(e){return this.to(Ct(),e)},_n.get=function(e){return j(this[e=H(e)])?this[e]():this},_n.invalidAt=function(){return h(this).overflow},_n.isAfter=function(e,t){var n=w(e)?e:Ct(e);return!(!this.isValid()||!n.isValid())&&("millisecond"===(t=H(s(t)?"millisecond":t))?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(t).valueOf())},_n.isBefore=function(e,t){var n=w(e)?e:Ct(e);return!(!this.isValid()||!n.isValid())&&("millisecond"===(t=H(s(t)?"millisecond":t))?this.valueOf()<n.valueOf():this.clone().endOf(t).valueOf()<n.valueOf())},_n.isBetween=function(e,t,n,r){return("("===(r=r||"()")[0]?this.isAfter(e,n):!this.isBefore(e,n))&&(")"===r[1]?this.isBefore(t,n):!this.isAfter(t,n))},_n.isSame=function(e,t){var n,r=w(e)?e:Ct(e);return!(!this.isValid()||!r.isValid())&&("millisecond"===(t=H(t||"millisecond"))?this.valueOf()===r.valueOf():(n=r.valueOf(),this.clone().startOf(t).valueOf()<=n&&n<=this.clone().endOf(t).valueOf()))},_n.isSameOrAfter=function(e,t){return this.isSame(e,t)||this.isAfter(e,t)},_n.isSameOrBefore=function(e,t){return this.isSame(e,t)||this.isBefore(e,t)},_n.isValid=function(){return f(this)},_n.lang=an,_n.locale=rn,_n.localeData=on,_n.max=Ht,_n.min=Pt,_n.parsingFlags=function(){return m({},h(this))},_n.set=function(e,t){if("object"==typeof e)for(var n=function(e){var t=[];for(var n in e)t.push({unit:n,priority:A[n]});return t.sort((function(e,t){return e.priority-t.priority})),t}(e=z(e)),r=0;r<n.length;r++)this[n[r].unit](e[n[r].unit]);else if(j(this[e=H(e)]))return this[e](t);return this},_n.startOf=function(e){switch(e=H(e)){case"year":this.month(0);case"quarter":case"month":this.date(1);case"week":case"isoWeek":case"day":case"date":this.hours(0);case"hour":this.minutes(0);case"minute":this.seconds(0);case"second":this.milliseconds(0)}return"week"===e&&this.weekday(0),"isoWeek"===e&&this.isoWeekday(1),"quarter"===e&&this.month(3*Math.floor(this.month()/3)),this},_n.subtract=tn,_n.toArray=function(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]},_n.toObject=function(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}},_n.toDate=function(){return new Date(this.valueOf())},_n.toISOString=function(e){if(!this.isValid())return null;var t=!0!==e,n=t?this.clone().utc():this;return n.year()<0||n.year()>9999?U(n,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):j(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this._d.valueOf()).toISOString().replace("Z",U(n,"Z")):U(n,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")},_n.inspect=function(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e="moment",t="";this.isLocal()||(e=0===this.utcOffset()?"moment.utc":"moment.parseZone",t="Z");var n="["+e+'("]',r=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",a=t+'[")]';return this.format(n+r+"-MM-DD[T]HH:mm:ss.SSS"+a)},_n.toJSON=function(){return this.isValid()?this.toISOString():null},_n.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},_n.unix=function(){return Math.floor(this.valueOf()/1e3)},_n.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},_n.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},_n.year=Oe,_n.isLeapYear=function(){return Te(this.year())},_n.weekYear=function(e){return ln.call(this,e,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)},_n.isoWeekYear=function(e){return ln.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)},_n.quarter=_n.quarters=function(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)},_n.month=Fe,_n.daysInMonth=function(){return Ce(this.year(),this.month())},_n.week=_n.weeks=function(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")},_n.isoWeek=_n.isoWeeks=function(e){var t=Ve(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")},_n.weeksInYear=function(){var e=this.localeData()._week;return Ge(this.year(),e.dow,e.doy)},_n.isoWeeksInYear=function(){return Ge(this.year(),1,4)},_n.date=cn,_n.day=_n.days=function(e){if(!this.isValid())return null!=e?this:NaN;var t=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=e?(e=function(e,t){return"string"!=typeof e?e:isNaN(e)?"number"==typeof(e=t.weekdaysParse(e))?e:null:parseInt(e,10)}(e,this.localeData()),this.add(e-t,"d")):t},_n.weekday=function(e){if(!this.isValid())return null!=e?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return null==e?t:this.add(e-t,"d")},_n.isoWeekday=function(e){if(!this.isValid())return null!=e?this:NaN;if(null!=e){var t=function(e,t){return"string"==typeof e?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}(e,this.localeData());return this.day(this.day()%7?t:t-7)}return this.day()||7},_n.dayOfYear=function(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")},_n.hour=_n.hours=st,_n.minute=_n.minutes=dn,_n.second=_n.seconds=pn,_n.millisecond=_n.milliseconds=fn,_n.utcOffset=function(e,t,n){var r,i=this._offset||0;if(!this.isValid())return null!=e?this:NaN;if(null!=e){if("string"==typeof e){if(null===(e=Bt(se,e)))return this}else Math.abs(e)<16&&!n&&(e*=60);return!this._isUTC&&t&&(r=Ut(this)),this._offset=e,this._isUTC=!0,null!=r&&this.add(r,"m"),i!==e&&(!t||this._changeInProgress?Xt(this,$t(e-i,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,a.updateOffset(this,!0),this._changeInProgress=null)),this}return this._isUTC?i:Ut(this)},_n.utc=function(e){return this.utcOffset(0,e)},_n.local=function(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(Ut(this),"m")),this},_n.parseZone=function(){if(null!=this._tzm)this.utcOffset(this._tzm,!1,!0);else if("string"==typeof this._i){var e=Bt(oe,this._i);null!=e?this.utcOffset(e):this.utcOffset(0,!0)}return this},_n.hasAlignedHourOffset=function(e){return!!this.isValid()&&(e=e?Ct(e).utcOffset():0,(this.utcOffset()-e)%60==0)},_n.isDST=function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},_n.isLocal=function(){return!!this.isValid()&&!this._isUTC},_n.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},_n.isUtc=qt,_n.isUTC=qt,_n.zoneAbbr=function(){return this._isUTC?"UTC":""},_n.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},_n.dates=D("dates accessor is deprecated. Use date instead.",cn),_n.months=D("months accessor is deprecated. Use month instead",Fe),_n.years=D("years accessor is deprecated. Use year instead",Oe),_n.zone=D("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",(function(e,t){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()})),_n.isDSTShifted=D("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",(function(){if(!s(this._isDSTShifted))return this._isDSTShifted;var e={};if(g(e,this),(e=xt(e))._a){var t=e._isUTC?p(e._a):Ct(e._a);this._isDSTShifted=this.isValid()&&L(e._a,t.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}));var gn=E.prototype;function bn(e,t,n,r){var a=ft(),i=p().set(r,t);return a[n](i,e)}function vn(e,t,n){if(l(e)&&(t=e,e=void 0),e=e||"",null!=t)return bn(e,t,n,"month");var r,a=[];for(r=0;r<12;r++)a[r]=bn(e,r,n,"month");return a}function wn(e,t,n,r){"boolean"==typeof e?(l(t)&&(n=t,t=void 0),t=t||""):(n=t=e,e=!1,l(t)&&(n=t,t=void 0),t=t||"");var a,i=ft(),o=e?i._week.dow:0;if(null!=n)return bn(t,(n+o)%7,r,"day");var s=[];for(a=0;a<7;a++)s[a]=bn(t,(a+o)%7,r,"day");return s}gn.calendar=function(e,t,n){var r=this._calendar[e]||this._calendar.sameElse;return j(r)?r.call(t,n):r},gn.longDateFormat=function(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.replace(/MMMM|MM|DD|dddd/g,(function(e){return e.slice(1)})),this._longDateFormat[e])},gn.invalidDate=function(){return this._invalidDate},gn.ordinal=function(e){return this._ordinal.replace("%d",e)},gn.preparse=yn,gn.postformat=yn,gn.relativeTime=function(e,t,n,r){var a=this._relativeTime[n];return j(a)?a(e,t,n,r):a.replace(/%d/i,e)},gn.pastFuture=function(e,t){var n=this._relativeTime[e>0?"future":"past"];return j(n)?n(t):n.replace(/%s/i,t)},gn.set=function(e){var t,n;for(n in e)j(t=e[n])?this[n]=t:this["_"+n]=t;this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)},gn.months=function(e,t){return e?i(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||Pe).test(t)?"format":"standalone"][e.month()]:i(this._months)?this._months:this._months.standalone},gn.monthsShort=function(e,t){return e?i(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[Pe.test(t)?"format":"standalone"][e.month()]:i(this._monthsShort)?this._monthsShort:this._monthsShort.standalone},gn.monthsParse=function(e,t,n){var r,a,i;if(this._monthsParseExact)return Ae.call(this,e,t,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),r=0;r<12;r++){if(a=p([2e3,r]),n&&!this._longMonthsParse[r]&&(this._longMonthsParse[r]=new RegExp("^"+this.months(a,"").replace(".","")+"$","i"),this._shortMonthsParse[r]=new RegExp("^"+this.monthsShort(a,"").replace(".","")+"$","i")),n||this._monthsParse[r]||(i="^"+this.months(a,"")+"|^"+this.monthsShort(a,""),this._monthsParse[r]=new RegExp(i.replace(".",""),"i")),n&&"MMMM"===t&&this._longMonthsParse[r].test(e))return r;if(n&&"MMM"===t&&this._shortMonthsParse[r].test(e))return r;if(!n&&this._monthsParse[r].test(e))return r}},gn.monthsRegex=function(e){return this._monthsParseExact?(d(this,"_monthsRegex")||Ie.call(this),e?this._monthsStrictRegex:this._monthsRegex):(d(this,"_monthsRegex")||(this._monthsRegex=We),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)},gn.monthsShortRegex=function(e){return this._monthsParseExact?(d(this,"_monthsRegex")||Ie.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(d(this,"_monthsShortRegex")||(this._monthsShortRegex=Re),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)},gn.week=function(e){return Ve(e,this._week.dow,this._week.doy).week},gn.firstDayOfYear=function(){return this._week.doy},gn.firstDayOfWeek=function(){return this._week.dow},gn.weekdays=function(e,t){return e?i(this._weekdays)?this._weekdays[e.day()]:this._weekdays[this._weekdays.isFormat.test(t)?"format":"standalone"][e.day()]:i(this._weekdays)?this._weekdays:this._weekdays.standalone},gn.weekdaysMin=function(e){return e?this._weekdaysMin[e.day()]:this._weekdaysMin},gn.weekdaysShort=function(e){return e?this._weekdaysShort[e.day()]:this._weekdaysShort},gn.weekdaysParse=function(e,t,n){var r,a,i;if(this._weekdaysParseExact)return Qe.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),r=0;r<7;r++){if(a=p([2e3,1]).day(r),n&&!this._fullWeekdaysParse[r]&&(this._fullWeekdaysParse[r]=new RegExp("^"+this.weekdays(a,"").replace(".",".?")+"$","i"),this._shortWeekdaysParse[r]=new RegExp("^"+this.weekdaysShort(a,"").replace(".",".?")+"$","i"),this._minWeekdaysParse[r]=new RegExp("^"+this.weekdaysMin(a,"").replace(".",".?")+"$","i")),this._weekdaysParse[r]||(i="^"+this.weekdays(a,"")+"|^"+this.weekdaysShort(a,"")+"|^"+this.weekdaysMin(a,""),this._weekdaysParse[r]=new RegExp(i.replace(".",""),"i")),n&&"dddd"===t&&this._fullWeekdaysParse[r].test(e))return r;if(n&&"ddd"===t&&this._shortWeekdaysParse[r].test(e))return r;if(n&&"dd"===t&&this._minWeekdaysParse[r].test(e))return r;if(!n&&this._weekdaysParse[r].test(e))return r}},gn.weekdaysRegex=function(e){return this._weekdaysParseExact?(d(this,"_weekdaysRegex")||nt.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(d(this,"_weekdaysRegex")||(this._weekdaysRegex=Xe),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)},gn.weekdaysShortRegex=function(e){return this._weekdaysParseExact?(d(this,"_weekdaysRegex")||nt.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(d(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=et),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},gn.weekdaysMinRegex=function(e){return this._weekdaysParseExact?(d(this,"_weekdaysRegex")||nt.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(d(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=tt),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},gn.isPM=function(e){return"p"===(e+"").toLowerCase().charAt(0)},gn.meridiem=function(e,t,n){return e>11?n?"pm":"PM":n?"am":"AM"},pt("en",{dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(1===k(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}}),a.lang=D("moment.lang is deprecated. Use moment.locale instead.",pt),a.langData=D("moment.langData is deprecated. Use moment.localeData instead.",ft);var Mn=Math.abs;function kn(e,t,n,r){var a=$t(t,n);return e._milliseconds+=r*a._milliseconds,e._days+=r*a._days,e._months+=r*a._months,e._bubble()}function Ln(e){return e<0?Math.floor(e):Math.ceil(e)}function Yn(e){return 4800*e/146097}function Dn(e){return 146097*e/4800}function Tn(e){return function(){return this.as(e)}}var Sn=Tn("ms"),On=Tn("s"),jn=Tn("m"),xn=Tn("h"),En=Tn("d"),Cn=Tn("w"),Pn=Tn("M"),Hn=Tn("y");function zn(e){return function(){return this.isValid()?this._data[e]:NaN}}var An=zn("milliseconds"),Nn=zn("seconds"),Fn=zn("minutes"),Rn=zn("hours"),Wn=zn("days"),In=zn("months"),Bn=zn("years"),Jn=Math.round,Un={ss:44,s:45,m:45,h:22,d:26,M:11};function qn(e,t,n,r,a){return a.relativeTime(t||1,!!n,e,r)}var Vn=Math.abs;function Gn(e){return(e>0)-(e<0)||+e}function $n(){if(!this.isValid())return this.localeData().invalidDate();var e,t,n=Vn(this._milliseconds)/1e3,r=Vn(this._days),a=Vn(this._months);e=M(n/60),t=M(e/60),n%=60,e%=60;var i=M(a/12),o=a%=12,s=r,l=t,u=e,c=n?n.toFixed(3).replace(/\.?0+$/,""):"",d=this.asSeconds();if(!d)return"P0D";var m=d<0?"-":"",p=Gn(this._months)!==Gn(d)?"-":"",h=Gn(this._days)!==Gn(d)?"-":"",f=Gn(this._milliseconds)!==Gn(d)?"-":"";return m+"P"+(i?p+i+"Y":"")+(o?p+o+"M":"")+(s?h+s+"D":"")+(l||u||c?"T":"")+(l?f+l+"H":"")+(u?f+u+"M":"")+(c?f+c+"S":"")}var Kn=Nt.prototype;return Kn.isValid=function(){return this._isValid},Kn.abs=function(){var e=this._data;return this._milliseconds=Mn(this._milliseconds),this._days=Mn(this._days),this._months=Mn(this._months),e.milliseconds=Mn(e.milliseconds),e.seconds=Mn(e.seconds),e.minutes=Mn(e.minutes),e.hours=Mn(e.hours),e.months=Mn(e.months),e.years=Mn(e.years),this},Kn.add=function(e,t){return kn(this,e,t,1)},Kn.subtract=function(e,t){return kn(this,e,t,-1)},Kn.as=function(e){if(!this.isValid())return NaN;var t,n,r=this._milliseconds;if("month"===(e=H(e))||"year"===e)return t=this._days+r/864e5,n=this._months+Yn(t),"month"===e?n:n/12;switch(t=this._days+Math.round(Dn(this._months)),e){case"week":return t/7+r/6048e5;case"day":return t+r/864e5;case"hour":return 24*t+r/36e5;case"minute":return 1440*t+r/6e4;case"second":return 86400*t+r/1e3;case"millisecond":return Math.floor(864e5*t)+r;default:throw new Error("Unknown unit "+e)}},Kn.asMilliseconds=Sn,Kn.asSeconds=On,Kn.asMinutes=jn,Kn.asHours=xn,Kn.asDays=En,Kn.asWeeks=Cn,Kn.asMonths=Pn,Kn.asYears=Hn,Kn.valueOf=function(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*k(this._months/12):NaN},Kn._bubble=function(){var e,t,n,r,a,i=this._milliseconds,o=this._days,s=this._months,l=this._data;return i>=0&&o>=0&&s>=0||i<=0&&o<=0&&s<=0||(i+=864e5*Ln(Dn(s)+o),o=0,s=0),l.milliseconds=i%1e3,e=M(i/1e3),l.seconds=e%60,t=M(e/60),l.minutes=t%60,n=M(t/60),l.hours=n%24,o+=M(n/24),a=M(Yn(o)),s+=a,o-=Ln(Dn(a)),r=M(s/12),s%=12,l.days=o,l.months=s,l.years=r,this},Kn.clone=function(){return $t(this)},Kn.get=function(e){return e=H(e),this.isValid()?this[e+"s"]():NaN},Kn.milliseconds=An,Kn.seconds=Nn,Kn.minutes=Fn,Kn.hours=Rn,Kn.days=Wn,Kn.weeks=function(){return M(this.days()/7)},Kn.months=In,Kn.years=Bn,Kn.humanize=function(e){if(!this.isValid())return this.localeData().invalidDate();var t=this.localeData(),n=function(e,t,n){var r=$t(e).abs(),a=Jn(r.as("s")),i=Jn(r.as("m")),o=Jn(r.as("h")),s=Jn(r.as("d")),l=Jn(r.as("M")),u=Jn(r.as("y")),c=a<=Un.ss&&["s",a]||a<Un.s&&["ss",a]||i<=1&&["m"]||i<Un.m&&["mm",i]||o<=1&&["h"]||o<Un.h&&["hh",o]||s<=1&&["d"]||s<Un.d&&["dd",s]||l<=1&&["M"]||l<Un.M&&["MM",l]||u<=1&&["y"]||["yy",u];return c[2]=t,c[3]=+e>0,c[4]=n,qn.apply(null,c)}(this,!e,t);return e&&(n=t.pastFuture(+this,n)),t.postformat(n)},Kn.toISOString=$n,Kn.toString=$n,Kn.toJSON=$n,Kn.locale=rn,Kn.localeData=on,Kn.toIsoString=D("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",$n),Kn.lang=an,J("X",0,0,"unix"),J("x",0,0,"valueOf"),ce("x",ie),ce("X",/[+-]?\d+(\.\d{1,3})?/),he("X",(function(e,t,n){n._d=new Date(1e3*parseFloat(e,10))})),he("x",(function(e,t,n){n._d=new Date(k(e))})),a.version="2.20.1",t=Ct,a.fn=_n,a.min=function(){return zt("isBefore",[].slice.call(arguments,0))},a.max=function(){return zt("isAfter",[].slice.call(arguments,0))},a.now=function(){return Date.now?Date.now():+new Date},a.utc=p,a.unix=function(e){return Ct(1e3*e)},a.months=function(e,t){return vn(e,t,"months")},a.isDate=u,a.locale=pt,a.invalid=_,a.duration=$t,a.isMoment=w,a.weekdays=function(e,t,n){return wn(e,t,n,"weekdays")},a.parseZone=function(){return Ct.apply(null,arguments).parseZone()},a.localeData=ft,a.isDuration=Ft,a.monthsShort=function(e,t){return vn(e,t,"monthsShort")},a.weekdaysMin=function(e,t,n){return wn(e,t,n,"weekdaysMin")},a.defineLocale=ht,a.updateLocale=function(e,t){if(null!=t){var n,r,a=lt;null!=(r=mt(e))&&(a=r._config),t=x(a,t),(n=new E(t)).parentLocale=ut[e],ut[e]=n,pt(e)}else null!=ut[e]&&(null!=ut[e].parentLocale?ut[e]=ut[e].parentLocale:null!=ut[e]&&delete ut[e]);return ut[e]},a.locales=function(){return T(ut)},a.weekdaysShort=function(e,t,n){return wn(e,t,n,"weekdaysShort")},a.normalizeUnits=H,a.relativeTimeRounding=function(e){return void 0===e?Jn:"function"==typeof e&&(Jn=e,!0)},a.relativeTimeThreshold=function(e,t){return void 0!==Un[e]&&(void 0===t?Un[e]:(Un[e]=t,"s"===e&&(Un.ss=t-1),!0))},a.calendarFormat=function(e,t){var n=e.diff(t,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"},a.prototype=_n,a.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"YYYY-[W]WW",MONTH:"YYYY-MM"},a}()}).call(this,n(9)(e))},function(e,t,n){"use strict";e.exports=n(135)},function(e,t){function n(e,t=null,n=null){var r=[];function a(e,t,n,i=0){let o;if(null!==n&&i<n)y(e)&&(o=Object.keys(e)).forEach(r=>{a(e[r],t,n,i+1)});else{if(null!==n&&i==n)return 0==n?void(r=a(e,t,null,i)):void(y(e)&&r.push(a(e,t,n,i+1)));switch(w(e)){case"array":var s=[];if(o=Object.keys(e),null===t||i<t)for(var l=0,u=o.length;l<u;l++){const r=o[l],u=e[r];s[r]=a(u,t,n,i+1)}return s;case"object":var c={};if(o=Object.keys(e),null===t||i<t)for(l=0,u=o.length;l<u;l++){const r=o[l],s=e[r];c[r]=a(s,t,n,i+1)}return c;case"string":return""+e;case"number":return 0+e;case"boolean":return!!e;case"null":return null;case"undefined":return}}}return null===n?a(e,t,n,0):(a(e,t,n,0),r)}function r(e,t,n=null){if("string"===w(t)&&""!==t){var r=[];return function e(t,n,a="",i="",o=null,s=0){if(a===n&&(r[r.length]=i),null!==o&&s>=o)return!1;if(y(t))for(var l=0,u=Object.keys(t),c=u.length;l<c;l++){const r=u[l];e(t[r],n,r,(""===i?i:i+".")+r,o,s+1)}}(e,t,"","",n),0!==(r=r.map(e=>"boolean"===w(e)?e:""===e?e:((e=e.split(".")).pop(),e=e.join(".")))).length&&r}}function a(e,t,n=null){if("string"===w(t)&&""!==t){var r=function e(t,n,r="",a,i=0){if(r===n)return r;var o=!1;if(null!==a&&i>=a)return o;if(y(t))for(var s=0,l=Object.keys(t),u=l.length;s<u;s++){const u=l[s],c=e(t[u],n,u,a,i+1);if(c){o=(r=""===r?r:r+".")+c;break}}return o}(e,t,"",n,0);return"boolean"===w(r)?r:""===r?r:((r=r.split(".")).pop(),r=r.join("."))}}function i(e,t,n=null){if(!u(t=s(t)))return function e(t,n,r,a=0){if(_(t,[n]))return u(t[n]);if(null!==r&&a>=r)return!1;if(y(t))for(var i=0,o=Object.keys(t),s=o.length;i<s;i++){if(e(t[o[i]],n,r,a+1))return!0}return!1}(e,t,n)}function o(e,t,n=null){if(!u(t=s(t)))return function e(t,n,r,a=0){if(_(t,[n]))return l(t[n]);if(null!==r&&a>=r)return!1;if(y(t))for(var i=0,o=Object.keys(t),s=o.length;i<s;i++){if(e(t[o[i]],n,r,a+1))return!0}return!1}(e,t,n,0)}function s(e){const t=c(e);return!(t>1)&&(1===t?Object.keys(e)[0]:0===t&&["string","number"].indexOf(w(e))>-1&&e)}function l(e){return!u(e)}function u(e){return!1===function(e){return y(e)?e:!(["null","undefined"].indexOf(w(e))>-1)&&(!(["",0,!1].indexOf(e)>-1)&&e)}(e)}function c(e){return-1===["array","object"].indexOf(w(e))?0:Object.keys(e).length}function d(e,t,n=null,r=0){if(g(e,t))return!0;if(y(t)&&v(e,t)&&_(e,Object.keys(t))){if(g(f(e,Object.keys(t)),t))return!0}if((null===n||r<n)&&y(e))for(var a=0,i=Object.keys(e),o=i.length;a<o;a++){if(d(e[i[a]],t,n,r+1))return!0}return!1}function m(e,t,n=null){var r=p(e,t,n);if(!1===r)return;return r.map(n=>{if(""===n)return e;n=n.split("."),-1===["array","object"].indexOf(w(t))&&n.splice(-1,1);var r=e;return Array.isArray(n)?(n.forEach(e=>{r=r[e]}),r):r[n]})}function p(e,t,n=null){var r=[];return function e(t,n,a="",i,o){if(y(n)&&v(t,n)&&_(t,Object.keys(n))){g(f(t,Object.keys(n)),n)&&(r[r.length]=a)}if(g(t,n)&&(r[r.length]=a),null!==i&&o>=i)return!1;if(y(t))for(var s=0,l=Object.keys(t),u=l.length;s<u;s++){const r=l[s];e(t[r],n,(""===a?a:a+".")+r,i,o+1)}}(e,t,"",n,0),0!==r.length&&r}function h(e,t,n=null){return function e(t,n,r="",a,i){if(y(n)&&v(t,n)&&_(t,Object.keys(n))){if(g(f(t,Object.keys(n)),n))return r}if(g(t,n))return r;var o=!1;if(null!==a&&i>=a)return o;if(y(t))for(var s=0,l=Object.keys(t),u=l.length;s<u;s++){const u=l[s],c=e(t[u],n,u,a,i+1);if(c){o=(r=""===r?r:r+".")+c;break}}return o}(e,t,"",n,0)}function f(e,t){const n=w(e);if(-1!==["array","object"].indexOf(n)&&0!==t.length){var r;switch(n){case"object":r={},t.forEach(t=>{t in e&&(r[t]=e[t])});break;case"array":r=[],t.forEach(t=>{t in e&&r.push(e[t])})}return r}}function _(e,t){const n=t.length;if(0===n||!y(e))return!1;const r=Object.keys(e);for(var a=!0,i=0;i<n;i++){const e=""+t[i];if(-1===r.indexOf(e)){a=!1;break}}return a}function y(e){return-1!==["array","object"].indexOf(w(e))&&0!==Object.keys(e).length}function g(e,t){const n=b(e,t);if(!1===n)return n;if(-1===["array","object"].indexOf(n))return e===t;const r=Object.keys(e),a=r.length;for(var i=!0,o=0;o<a;o++){const n=r[o],a=g(e[n],t[n]);if(!1===a){i=a;break}}return i}function b(e,t){const n=v(e,t);if(!1===n)return!1;if(["array","object"].indexOf(n)>-1){const n=Object.keys(e),a=Object.keys(t),i=n.length;if(i!==a.length)return!1;if(0===i)return!0;for(var r=0;r<i;r++)if(n[r]!==a[r])return!1}return n}function v(e,t){const n=w(e);return n===w(t)&&n}function w(e){if(null===e)return"null";const t=typeof e;return"object"===t&&Array.isArray(e)?"array":t}var M={getType:function(e){return w(e)},sameType:function(e,t){return v(e,t)},sameStructure:function(e,t){return b(e,t)},identical:function(e,t){return g(e,t)},isIterable:function(e){return y(e)},containsKeys:function(e,t){return _(e,t)},trim:function(e,t){return f(e,t)},locate:function(e,t,n){return h(e,t,n)},deepGet:function(e,t,n){return function(e,t,n=null){var r=h(e,t,n);if(!1!==r){if(""===r)return e;r=r.split("."),-1===["array","object"].indexOf(w(t))&&r.splice(-1,1);var a=e;return Array.isArray(r)?(r.forEach(e=>{a=a[e]}),a):a[r]}}(e,t,n)},locateAll:function(e,t,n){return p(e,t,n)},deepFilter:function(e,t,n){return m(e,t,n)},exists:function(e,t,n){return d(e,t,n)},onlyExisting:function(e,t,n){return function(e,t,n=null){if("array"===w(t)){let r=[];return t.forEach(t=>{d(e,t,n)&&r.push(t)}),r}if("object"===w(t)){let r={};return Object.keys(t).forEach(a=>{let i=t[a];d(e,i,n)&&(r[a]=i)}),r}if(d(e,t,n))return t}(e,t,n)},onlyMissing:function(e,t,n){return function(e,t,n=null){if("array"===w(t)){let r=[];return t.forEach(t=>{d(e,t,n)||r.push(t)}),r}if("object"===w(t)){let r={};return Object.keys(t).forEach(a=>{let i=t[a];d(e,i,n)||(r[a]=i)}),r}if(!d(e,t,n))return t}(e,t,n)},length:function(e){return c(e)},isFalsy:function(e){return u(e)},isTruthy:function(e){return l(e)},foundTruthy:function(e,t,n){return o(e,t,n)},onlyTruthy:function(e,t,n,r){return function(e,t,n,r=null){if("array"===w(t)){let a=[];return t.forEach(t=>{const i=m(e,t);l(i)&&o(i,n,r)&&a.push(t)}),a}if("object"===w(t)){let a={};return Object.keys(t).forEach(i=>{const s=t[i],u=m(e,s);l(u)&&o(u,n,r)&&(a[i]=s)}),a}if(o(e,n,r))return t}(e,t,n,r)},foundFalsy:function(e,t,n){return i(e,t,n)},onlyFalsy:function(e,t,n,r){return function(e,t,n,r=null){if("array"===w(t)){let a=[];return t.forEach(t=>{const o=m(e,t);l(o)&&i(o,n,r)&&a.push(t)}),a}if("object"===w(t)){let a={};return Object.keys(t).forEach(o=>{const s=t[o],u=m(e,s);l(u)&&i(u,n,r)&&(a[o]=s)}),a}if(i(e,n,r))return t}(e,t,n,r)},countMatches:function(e,t,n,r){return function(e,t,n=null,r=null){var a=null===n,i=null===r,o=p(e,t,a&&i?null:a||i?n||r:n<r?n:r);if(!1===o)return 0;if(null===n)return o.length;if("number"===w(n)){let e=0;return o.forEach(t=>{(t=t.split(".")).length===n&&e++}),e}}(e,t,n,r)},matchDepth:function(e,t,n){return function(e,t,n=null){var r=h(e,t,n);return!1!==r&&(""===r?0:(r=r.split(".")).length)}(e,t,n)},maxDepth:function(e,t){return function(e,t=null){let n=0;return function e(t,r,a=0){n<a&&(n=a),null!==r&&a>=r||y(t)&&Object.keys(t).forEach(n=>{e(t[n],r,a+1)})}(e,t),n}(e,t)},locate_Key:function(e,t,n){return a(e,t,n)},deepGet_Key:function(e,t,n){return function(e,t,n=null){if("string"===w(t)&&""!==t){var r=a(e,t,n);if(!1!==r){""===r?r=t:r+="."+t,r=r.split(".");var i=e;return Array.isArray(r)?(r.forEach(e=>{i=i[e]}),i):i[r]}}}(e,t,n)},locateAll_Key:function(e,t,n){return r(e,t,n)},deepFilter_Key:function(e,t,n){return function(e,t,n=null){if("string"!==w(t))return;if(""===t)return;var a=r(e,t,n);if(!1===a)return;return a.map(n=>{if(!1!==n){""===n?n=t:n+="."+t,n=n.split(".");var r=e;return Array.isArray(n)?(n.forEach(e=>{r=r[e]}),r):r[n]}})}(e,t,n)},deepClone:function(e,t,r){return n(e,t,r)},renameKey:function(e,t,n,r){return function(e,t,n,r=null){if("string"===w(t)&&"string"===w(n)&&""!==t&&""!==n){var a=!1;return function e(t,n,r,i,o=0){let s;switch(w(t)){case"array":for(var l=[],u=0,c=(s=Object.keys(t)).length;u<c;u++){let a=s[u],c=t[a];l[a]=e(c,n,r,i,o+1)}return l;case"object":var d={};for(u=0,c=(s=Object.keys(t)).length;u<c;u++){let l=s[u],c=t[l];(null===i||o<i)&&(a||l===n&&(l=r,a=!0)),d[l]=e(c,n,r,i,o+1)}return d;case"string":return""+t;case"number":return 0+t;case"boolean":return!!t;case"null":return null;case"undefined":return}}(e,t,n,r,0)}}(e,t,n,r)},renameKeys:function(e,t,n,r){return function(e,t,n,r=null){if("string"===w(t)&&"string"===w(n)&&""!==t&&""!==n)return function e(t,n,r,a,i=0){let o;switch(w(t)){case"array":for(var s=[],l=0,u=(o=Object.keys(t)).length;l<u;l++){let u=o[l],c=t[u];s[u]=e(c,n,r,a,i+1)}return s;case"object":var c={};for(l=0,u=(o=Object.keys(t)).length;l<u;l++){let s=o[l],u=t[s];(null===a||i<a)&&s===n&&(s=r),c[s]=e(u,n,r,a,i+1)}return c;case"string":return""+t;case"number":return 0+t;case"boolean":return!!t;case"null":return null;case"undefined":return}}(e,t,n,r,0)}(e,t,n,r)},deepRemove_Key:function(e,t,r){return function(e,t,r){if("string"!==w(t))return;if(""===t)return;let i=n(e);var o=a(i,t,r);if(!1===o)return i;""===o?o=t:o+="."+t,o=o.split(".");var s=i;return Array.isArray(o)||delete s[o],o.forEach((e,t)=>{t<o.length-1?s=s[e]:delete s[e]}),i}(e,t,r)},deepRemoveAll_Key:function(e,t,a){return function(e,t,a){if("string"!==w(t))return;if(""===t)return;let i=n(e);var o=r(i,t,a);return o===[]||!1===o?i:(o.forEach(e=>{""===e?e=t:e+="."+t,e=e.split(".");var n=i;Array.isArray(e)||delete n[e];for(var r=0;r<e.length;r++){var a=e[r];if(!(a in n))break;r<e.length-1?n=n[a]:delete n[a]}}),i)}(e,t,a)}};e.exports=M},function(e,t,n){(function(e){!function(t){var n=function(e){return a(!0===e,!1,arguments)};function r(e,t){if("object"!==i(e))return t;for(var n in t)"object"===i(e[n])&&"object"===i(t[n])?e[n]=r(e[n],t[n]):e[n]=t[n];return e}function a(e,t,a){var o=a[0],s=a.length;(e||"object"!==i(o))&&(o={});for(var l=0;l<s;++l){var u=a[l];if("object"===i(u))for(var c in u)if("__proto__"!==c){var d=e?n.clone(u[c]):u[c];o[c]=t?r(o[c],d):d}}return o}function i(e){return{}.toString.call(e).slice(8,-1).toLowerCase()}n.recursive=function(e){return a(!0===e,!0,arguments)},n.clone=function(e){var t,r,a=e,o=i(e);if("array"===o)for(a=[],r=e.length,t=0;t<r;++t)a[t]=n.clone(e[t]);else if("object"===o)for(t in a={},e)a[t]=n.clone(e[t]);return a},t?e.exports=n:window.merge=n}(e&&"object"==typeof e.exports&&e.exports)}).call(this,n(9)(e))},function(e,t,n){"use strict";
2
  /*!
3
  * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
4
  *
44
  *
45
  * This source code is licensed under the MIT license found in the
46
  * LICENSE file in the root directory of this source tree.
47
+ */var r=n(136),a=n(137),i=n(138),o=n(139),s="function"==typeof Symbol&&Symbol.for,l=s?Symbol.for("react.element"):60103,u=s?Symbol.for("react.portal"):60106,c=s?Symbol.for("react.fragment"):60107,d=s?Symbol.for("react.strict_mode"):60108,m=s?Symbol.for("react.profiler"):60114,p=s?Symbol.for("react.provider"):60109,h=s?Symbol.for("react.context"):60110,f=s?Symbol.for("react.async_mode"):60111,_=s?Symbol.for("react.forward_ref"):60112;s&&Symbol.for("react.timeout");var y="function"==typeof Symbol&&Symbol.iterator;function g(e){for(var t=arguments.length-1,n="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=0;r<t;r++)n+="&args[]="+encodeURIComponent(arguments[r+1]);a(!1,"Minified React error #"+e+"; visit %s for the full message or use the non-minified dev environment for full errors and additional helpful warnings. ",n)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}};function v(e,t,n){this.props=e,this.context=t,this.refs=i,this.updater=n||b}function w(){}function M(e,t,n){this.props=e,this.context=t,this.refs=i,this.updater=n||b}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){"object"!=typeof e&&"function"!=typeof e&&null!=e&&g("85"),this.updater.enqueueSetState(this,e,t,"setState")},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},w.prototype=v.prototype;var k=M.prototype=new w;k.constructor=M,r(k,v.prototype),k.isPureReactComponent=!0;var L={current:null},Y=Object.prototype.hasOwnProperty,D={key:!0,ref:!0,__self:!0,__source:!0};function T(e,t,n){var r=void 0,a={},i=null,o=null;if(null!=t)for(r in void 0!==t.ref&&(o=t.ref),void 0!==t.key&&(i=""+t.key),t)Y.call(t,r)&&!D.hasOwnProperty(r)&&(a[r]=t[r]);var s=arguments.length-2;if(1===s)a.children=n;else if(1<s){for(var u=Array(s),c=0;c<s;c++)u[c]=arguments[c+2];a.children=u}if(e&&e.defaultProps)for(r in s=e.defaultProps)void 0===a[r]&&(a[r]=s[r]);return{$$typeof:l,type:e,key:i,ref:o,props:a,_owner:L.current}}function S(e){return"object"==typeof e&&null!==e&&e.$$typeof===l}var O=/\/+/g,j=[];function x(e,t,n,r){if(j.length){var a=j.pop();return a.result=e,a.keyPrefix=t,a.func=n,a.context=r,a.count=0,a}return{result:e,keyPrefix:t,func:n,context:r,count:0}}function E(e){e.result=null,e.keyPrefix=null,e.func=null,e.context=null,e.count=0,10>j.length&&j.push(e)}function C(e,t,n,r){var a=typeof e;"undefined"!==a&&"boolean"!==a||(e=null);var i=!1;if(null===e)i=!0;else switch(a){case"string":case"number":i=!0;break;case"object":switch(e.$$typeof){case l:case u:i=!0}}if(i)return n(r,e,""===t?"."+P(e,0):t),1;if(i=0,t=""===t?".":t+":",Array.isArray(e))for(var o=0;o<e.length;o++){var s=t+P(a=e[o],o);i+=C(a,s,n,r)}else if(null==e?s=null:s="function"==typeof(s=y&&e[y]||e["@@iterator"])?s:null,"function"==typeof s)for(e=s.call(e),o=0;!(a=e.next()).done;)i+=C(a=a.value,s=t+P(a,o++),n,r);else"object"===a&&g("31","[object Object]"===(n=""+e)?"object with keys {"+Object.keys(e).join(", ")+"}":n,"");return i}function P(e,t){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+(""+e).replace(/[=:]/g,(function(e){return t[e]}))}(e.key):t.toString(36)}function H(e,t){e.func.call(e.context,t,e.count++)}function z(e,t,n){var r=e.result,a=e.keyPrefix;e=e.func.call(e.context,t,e.count++),Array.isArray(e)?A(e,r,n,o.thatReturnsArgument):null!=e&&(S(e)&&(t=a+(!e.key||t&&t.key===e.key?"":(""+e.key).replace(O,"$&/")+"/")+n,e={$$typeof:l,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}),r.push(e))}function A(e,t,n,r,a){var i="";null!=n&&(i=(""+n).replace(O,"$&/")+"/"),t=x(t,i,r,a),null==e||C(e,"",z,t),E(t)}var N={Children:{map:function(e,t,n){if(null==e)return e;var r=[];return A(e,r,null,t,n),r},forEach:function(e,t,n){if(null==e)return e;t=x(null,null,t,n),null==e||C(e,"",H,t),E(t)},count:function(e){return null==e?0:C(e,"",o.thatReturnsNull,null)},toArray:function(e){var t=[];return A(e,t,null,o.thatReturnsArgument),t},only:function(e){return S(e)||g("143"),e}},createRef:function(){return{current:null}},Component:v,PureComponent:M,createContext:function(e,t){return void 0===t&&(t=null),(e={$$typeof:h,_calculateChangedBits:t,_defaultValue:e,_currentValue:e,_currentValue2:e,_changedBits:0,_changedBits2:0,Provider:null,Consumer:null}).Provider={$$typeof:p,_context:e},e.Consumer=e},forwardRef:function(e){return{$$typeof:_,render:e}},Fragment:c,StrictMode:d,unstable_AsyncMode:f,unstable_Profiler:m,createElement:T,cloneElement:function(e,t,n){null==e&&g("267",e);var a=void 0,i=r({},e.props),o=e.key,s=e.ref,u=e._owner;if(null!=t){void 0!==t.ref&&(s=t.ref,u=L.current),void 0!==t.key&&(o=""+t.key);var c=void 0;for(a in e.type&&e.type.defaultProps&&(c=e.type.defaultProps),t)Y.call(t,a)&&!D.hasOwnProperty(a)&&(i[a]=void 0===t[a]&&void 0!==c?c[a]:t[a])}if(1===(a=arguments.length-2))i.children=n;else if(1<a){c=Array(a);for(var d=0;d<a;d++)c[d]=arguments[d+2];i.children=c}return{$$typeof:l,type:e.type,key:o,ref:s,props:i,_owner:u}},createFactory:function(e){var t=T.bind(null,e);return t.type=e,t},isValidElement:S,version:"16.4.1",__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{ReactCurrentOwner:L,assign:r}},F={default:N},R=F&&N||F;e.exports=R.default?R.default:R},function(e,t,n){"use strict";
48
  /*
49
  object-assign
50
  (c) Sindre Sorhus
55
  *
56
  * Copyright (c) 2014-2017, Jon Schlinkert.
57
  * Released under the MIT License.
58
+ */e.exports=function(e){return null!=e&&"object"==typeof e&&!1===Array.isArray(e)}},,function(e,t,n){(function(e,t){!function(e,n){"use strict";if(!e.setImmediate){var r,a,i,o,s,l=1,u={},c=!1,d=e.document,m=Object.getPrototypeOf&&Object.getPrototypeOf(e);m=m&&m.setTimeout?m:e,"[object process]"==={}.toString.call(e.process)?r=function(e){t.nextTick((function(){h(e)}))}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?e.MessageChannel?((i=new MessageChannel).port1.onmessage=function(e){h(e.data)},r=function(e){i.port2.postMessage(e)}):d&&"onreadystatechange"in d.createElement("script")?(a=d.documentElement,r=function(e){var t=d.createElement("script");t.onreadystatechange=function(){h(e),t.onreadystatechange=null,a.removeChild(t),t=null},a.appendChild(t)}):r=function(e){setTimeout(h,0,e)}:(o="setImmediate$"+Math.random()+"$",s=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(o)&&h(+t.data.slice(o.length))},e.addEventListener?e.addEventListener("message",s,!1):e.attachEvent("onmessage",s),r=function(t){e.postMessage(o+t,"*")}),m.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n<t.length;n++)t[n]=arguments[n+1];var a={callback:e,args:t};return u[l]=a,r(l),l++},m.clearImmediate=p}function p(e){delete u[e]}function h(e){if(c)setTimeout(h,0,e);else{var t=u[e];if(t){c=!0;try{!function(e){var t=e.callback,r=e.args;switch(r.length){case 0:t();break;case 1:t(r[0]);break;case 2:t(r[0],r[1]);break;case 3:t(r[0],r[1],r[2]);break;default:t.apply(n,r)}}(t)}finally{p(e),c=!1}}}}}("undefined"==typeof self?void 0===e?this:e:self)}).call(this,n(8),n(148))},function(e,t){var n,r,a=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(e){n=i}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(e){r=o}}();var l,u=[],c=!1,d=-1;function m(){c&&l&&(c=!1,l.length?u=l.concat(u):d=-1,u.length&&p())}function p(){if(!c){var e=s(m);c=!0;for(var t=u.length;t;){for(l=u,u=[];++d<t;)l&&l[d].run();d=-1,t=u.length}l=null,c=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===o||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function h(e,t){this.fun=e,this.array=t}function f(){}a.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];u.push(new h(e,t)),1!==u.length||c||s(p)},h.prototype.run=function(){this.fun.apply(null,this.array)},a.title="browser",a.browser=!0,a.env={},a.argv=[],a.version="",a.versions={},a.on=f,a.addListener=f,a.once=f,a.off=f,a.removeListener=f,a.removeAllListeners=f,a.emit=f,a.prependListener=f,a.prependOnceListener=f,a.listeners=function(e){return[]},a.binding=function(e){throw new Error("process.binding is not supported")},a.cwd=function(){return"/"},a.chdir=function(e){throw new Error("process.chdir is not supported")},a.umask=function(){return 0}},function(e,t,n){var r={"./af":10,"./af.js":10,"./ar":11,"./ar-dz":12,"./ar-dz.js":12,"./ar-kw":13,"./ar-kw.js":13,"./ar-ly":14,"./ar-ly.js":14,"./ar-ma":15,"./ar-ma.js":15,"./ar-sa":16,"./ar-sa.js":16,"./ar-tn":17,"./ar-tn.js":17,"./ar.js":11,"./az":18,"./az.js":18,"./be":19,"./be.js":19,"./bg":20,"./bg.js":20,"./bm":21,"./bm.js":21,"./bn":22,"./bn.js":22,"./bo":23,"./bo.js":23,"./br":24,"./br.js":24,"./bs":25,"./bs.js":25,"./ca":26,"./ca.js":26,"./cs":27,"./cs.js":27,"./cv":28,"./cv.js":28,"./cy":29,"./cy.js":29,"./da":30,"./da.js":30,"./de":31,"./de-at":32,"./de-at.js":32,"./de-ch":33,"./de-ch.js":33,"./de.js":31,"./dv":34,"./dv.js":34,"./el":35,"./el.js":35,"./en-au":36,"./en-au.js":36,"./en-ca":37,"./en-ca.js":37,"./en-gb":38,"./en-gb.js":38,"./en-ie":39,"./en-ie.js":39,"./en-nz":40,"./en-nz.js":40,"./eo":41,"./eo.js":41,"./es":42,"./es-do":43,"./es-do.js":43,"./es-us":44,"./es-us.js":44,"./es.js":42,"./et":45,"./et.js":45,"./eu":46,"./eu.js":46,"./fa":47,"./fa.js":47,"./fi":48,"./fi.js":48,"./fo":49,"./fo.js":49,"./fr":50,"./fr-ca":51,"./fr-ca.js":51,"./fr-ch":52,"./fr-ch.js":52,"./fr.js":50,"./fy":53,"./fy.js":53,"./gd":54,"./gd.js":54,"./gl":55,"./gl.js":55,"./gom-latn":56,"./gom-latn.js":56,"./gu":57,"./gu.js":57,"./he":58,"./he.js":58,"./hi":59,"./hi.js":59,"./hr":60,"./hr.js":60,"./hu":61,"./hu.js":61,"./hy-am":62,"./hy-am.js":62,"./id":63,"./id.js":63,"./is":64,"./is.js":64,"./it":65,"./it.js":65,"./ja":66,"./ja.js":66,"./jv":67,"./jv.js":67,"./ka":68,"./ka.js":68,"./kk":69,"./kk.js":69,"./km":70,"./km.js":70,"./kn":71,"./kn.js":71,"./ko":72,"./ko.js":72,"./ky":73,"./ky.js":73,"./lb":74,"./lb.js":74,"./lo":75,"./lo.js":75,"./lt":76,"./lt.js":76,"./lv":77,"./lv.js":77,"./me":78,"./me.js":78,"./mi":79,"./mi.js":79,"./mk":80,"./mk.js":80,"./ml":81,"./ml.js":81,"./mr":82,"./mr.js":82,"./ms":83,"./ms-my":84,"./ms-my.js":84,"./ms.js":83,"./mt":85,"./mt.js":85,"./my":86,"./my.js":86,"./nb":87,"./nb.js":87,"./ne":88,"./ne.js":88,"./nl":89,"./nl-be":90,"./nl-be.js":90,"./nl.js":89,"./nn":91,"./nn.js":91,"./pa-in":92,"./pa-in.js":92,"./pl":93,"./pl.js":93,"./pt":94,"./pt-br":95,"./pt-br.js":95,"./pt.js":94,"./ro":96,"./ro.js":96,"./ru":97,"./ru.js":97,"./sd":98,"./sd.js":98,"./se":99,"./se.js":99,"./si":100,"./si.js":100,"./sk":101,"./sk.js":101,"./sl":102,"./sl.js":102,"./sq":103,"./sq.js":103,"./sr":104,"./sr-cyrl":105,"./sr-cyrl.js":105,"./sr.js":104,"./ss":106,"./ss.js":106,"./sv":107,"./sv.js":107,"./sw":108,"./sw.js":108,"./ta":109,"./ta.js":109,"./te":110,"./te.js":110,"./tet":111,"./tet.js":111,"./th":112,"./th.js":112,"./tl-ph":113,"./tl-ph.js":113,"./tlh":114,"./tlh.js":114,"./tr":115,"./tr.js":115,"./tzl":116,"./tzl.js":116,"./tzm":117,"./tzm-latn":118,"./tzm-latn.js":118,"./tzm.js":117,"./uk":119,"./uk.js":119,"./ur":120,"./ur.js":120,"./uz":121,"./uz-latn":122,"./uz-latn.js":122,"./uz.js":121,"./vi":123,"./vi.js":123,"./x-pseudo":124,"./x-pseudo.js":124,"./yo":125,"./yo.js":125,"./zh-cn":126,"./zh-cn.js":126,"./zh-hk":127,"./zh-hk.js":127,"./zh-tw":128,"./zh-tw.js":128};function a(e){var t=i(e);return n(t)}function i(e){if(!n.o(r,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return r[e]}a.keys=function(){return Object.keys(r)},a.resolve=i,e.exports=a,a.id=149},function(e,t,n){var r;e.exports=function e(t,n,a){function i(s,l){if(!n[s]){if(!t[s]){if(!l&&"function"==typeof r&&r)return r(s,!0);if(o)return o(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var c=n[s]={exports:{}};t[s][0].call(c.exports,(function(e){return i(t[s][1][e]||e)}),c,c.exports,e,t,n,a)}return n[s].exports}for(var o="function"==typeof r&&r,s=0;s<a.length;s++)i(a[s]);return i}({1:[function(e,t,n){!function(e){"use strict";var n,r=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,a=Math.ceil,i=Math.floor,o="[BigNumber Error] ",s=o+"Number primitive has more than 15 significant digits: ",l=1e14,u=14,c=9007199254740991,d=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],m=1e7,p=1e9;function h(e){var t=0|e;return 0<e||e===t?t:t-1}function f(e){for(var t,n,r=1,a=e.length,i=e[0]+"";r<a;){for(t=e[r++]+"",n=u-t.length;n--;t="0"+t);i+=t}for(a=i.length;48===i.charCodeAt(--a););return i.slice(0,a+1||1)}function _(e,t){var n,r,a=e.c,i=t.c,o=e.s,s=t.s,l=e.e,u=t.e;if(!o||!s)return null;if(n=a&&!a[0],r=i&&!i[0],n||r)return n?r?0:-s:o;if(o!=s)return o;if(n=o<0,r=l==u,!a||!i)return r?0:!a^n?1:-1;if(!r)return u<l^n?1:-1;for(s=(l=a.length)<(u=i.length)?l:u,o=0;o<s;o++)if(a[o]!=i[o])return a[o]>i[o]^n?1:-1;return l==u?0:u<l^n?1:-1}function y(e,t,n,r){if(e<t||n<e||e!==(e<0?a(e):i(e)))throw Error(o+(r||"Argument")+("number"==typeof e?e<t||n<e?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function g(e){var t=e.c.length-1;return h(e.e/u)==t&&e.c[t]%2!=0}function b(e,t){return(1<e.length?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function v(e,t,n){var r,a;if(t<0){for(a=n+".";++t;a+=n);e=a+e}else if(++t>(r=e.length)){for(a=n,t-=r;--t;a+=n);e+=a}else t<r&&(e=e.slice(0,t)+"."+e.slice(t));return e}(n=function e(t){var n,w,M,k,L,Y,D,T,S,O,j=B.prototype={constructor:B,toString:null,valueOf:null},x=new B(1),E=20,C=4,P=-7,H=21,z=-1e7,A=1e7,N=!1,F=1,R=0,W={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},I="0123456789abcdefghijklmnopqrstuvwxyz";function B(e,t){var n,a,o,l,d,m,p,h,f=this;if(!(f instanceof B))return new B(e,t);if(null==t){if(e instanceof B)return f.s=e.s,f.e=e.e,void(f.c=(e=e.c)?e.slice():e);if((m="number"==typeof e)&&0*e==0){if(f.s=1/e<0?(e=-e,-1):1,e===~~e){for(l=0,d=e;10<=d;d/=10,l++);return f.e=l,void(f.c=[e])}h=String(e)}else{if(h=String(e),!r.test(h))return M(f,h,m);f.s=45==h.charCodeAt(0)?(h=h.slice(1),-1):1}-1<(l=h.indexOf("."))&&(h=h.replace(".","")),0<(d=h.search(/e/i))?(l<0&&(l=d),l+=+h.slice(d+1),h=h.substring(0,d)):l<0&&(l=h.length)}else{if(y(t,2,I.length,"Base"),h=String(e),10==t)return V(f=new B(e instanceof B?e:h),E+f.e+1,C);if(m="number"==typeof e){if(0*e!=0)return M(f,h,m,t);if(f.s=1/e<0?(h=h.slice(1),-1):1,B.DEBUG&&15<h.replace(/^0\.0*|\./,"").length)throw Error(s+e);m=!1}else f.s=45===h.charCodeAt(0)?(h=h.slice(1),-1):1;for(n=I.slice(0,t),l=d=0,p=h.length;d<p;d++)if(n.indexOf(a=h.charAt(d))<0){if("."==a){if(l<d){l=p;continue}}else if(!o&&(h==h.toUpperCase()&&(h=h.toLowerCase())||h==h.toLowerCase()&&(h=h.toUpperCase()))){o=!0,d=-1,l=0;continue}return M(f,String(e),m,t)}-1<(l=(h=w(h,t,10,f.s)).indexOf("."))?h=h.replace(".",""):l=h.length}for(d=0;48===h.charCodeAt(d);d++);for(p=h.length;48===h.charCodeAt(--p););if(h=h.slice(d,++p)){if(p-=d,m&&B.DEBUG&&15<p&&(c<e||e!==i(e)))throw Error(s+f.s*e);if(A<(l=l-d-1))f.c=f.e=null;else if(l<z)f.c=[f.e=0];else{if(f.e=l,f.c=[],d=(l+1)%u,l<0&&(d+=u),d<p){for(d&&f.c.push(+h.slice(0,d)),p-=u;d<p;)f.c.push(+h.slice(d,d+=u));h=h.slice(d),d=u-h.length}else d-=p;for(;d--;h+="0");f.c.push(+h)}}else f.c=[f.e=0]}function J(e,t,n,r){var a,i,o,s,l;if(null==n?n=C:y(n,0,8),!e.c)return e.toString();if(a=e.c[0],o=e.e,null==t)l=f(e.c),l=1==r||2==r&&(o<=P||H<=o)?b(l,o):v(l,o,"0");else if(i=(e=V(new B(e),t,n)).e,s=(l=f(e.c)).length,1==r||2==r&&(t<=i||i<=P)){for(;s<t;l+="0",s++);l=b(l,i)}else if(t-=o,l=v(l,i,"0"),s<i+1){if(0<--t)for(l+=".";t--;l+="0");}else if(0<(t+=i-s))for(i+1==s&&(l+=".");t--;l+="0");return e.s<0&&a?"-"+l:l}function U(e,t){for(var n,r=1,a=new B(e[0]);r<e.length;r++){if(!(n=new B(e[r])).s){a=n;break}t.call(a,n)&&(a=n)}return a}function q(e,t,n){for(var r=1,a=t.length;!t[--a];t.pop());for(a=t[0];10<=a;a/=10,r++);return(n=r+n*u-1)>A?e.c=e.e=null:e.c=n<z?[e.e=0]:(e.e=n,t),e}function V(e,t,n,r){var o,s,c,m,p,h,f,_=e.c,y=d;if(_){e:{for(o=1,m=_[0];10<=m;m/=10,o++);if((s=t-o)<0)s+=u,c=t,f=(p=_[h=0])/y[o-c-1]%10|0;else if((h=a((s+1)/u))>=_.length){if(!r)break e;for(;_.length<=h;_.push(0));p=f=0,c=(s%=u)-u+(o=1)}else{for(p=m=_[h],o=1;10<=m;m/=10,o++);f=(c=(s%=u)-u+o)<0?0:p/y[o-c-1]%10|0}if(r=r||t<0||null!=_[h+1]||(c<0?p:p%y[o-c-1]),r=n<4?(f||r)&&(0==n||n==(e.s<0?3:2)):5<f||5==f&&(4==n||r||6==n&&(0<s?0<c?p/y[o-c]:0:_[h-1])%10&1||n==(e.s<0?8:7)),t<1||!_[0])return _.length=0,r?(t-=e.e+1,_[0]=y[(u-t%u)%u],e.e=-t||0):_[0]=e.e=0,e;if(0==s?(_.length=h,m=1,h--):(_.length=h+1,m=y[u-s],_[h]=0<c?i(p/y[o-c]%y[c])*m:0),r)for(;;){if(0==h){for(s=1,c=_[0];10<=c;c/=10,s++);for(c=_[0]+=m,m=1;10<=c;c/=10,m++);s!=m&&(e.e++,_[0]==l&&(_[0]=1));break}if(_[h]+=m,_[h]!=l)break;_[h--]=0,m=1}for(s=_.length;0===_[--s];_.pop());}e.e>A?e.c=e.e=null:e.e<z&&(e.c=[e.e=0])}return e}function G(e){var t,n=e.e;return null===n?e.toString():(t=f(e.c),t=n<=P||H<=n?b(t,n):v(t,n,"0"),e.s<0?"-"+t:t)}return B.clone=e,B.ROUND_UP=0,B.ROUND_DOWN=1,B.ROUND_CEIL=2,B.ROUND_FLOOR=3,B.ROUND_HALF_UP=4,B.ROUND_HALF_DOWN=5,B.ROUND_HALF_EVEN=6,B.ROUND_HALF_CEIL=7,B.ROUND_HALF_FLOOR=8,B.EUCLID=9,B.config=B.set=function(e){var t,n;if(null!=e){if("object"!=typeof e)throw Error(o+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(y(n=e[t],0,p,t),E=n),e.hasOwnProperty(t="ROUNDING_MODE")&&(y(n=e[t],0,8,t),C=n),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((n=e[t])&&n.pop?(y(n[0],-p,0,t),y(n[1],0,p,t),P=n[0],H=n[1]):(y(n,-p,p,t),P=-(H=n<0?-n:n))),e.hasOwnProperty(t="RANGE"))if((n=e[t])&&n.pop)y(n[0],-p,-1,t),y(n[1],1,p,t),z=n[0],A=n[1];else{if(y(n,-p,p,t),!n)throw Error(o+t+" cannot be zero: "+n);z=-(A=n<0?-n:n)}if(e.hasOwnProperty(t="CRYPTO")){if((n=e[t])!==!!n)throw Error(o+t+" not true or false: "+n);if(n){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw N=!n,Error(o+"crypto unavailable");N=n}else N=n}if(e.hasOwnProperty(t="MODULO_MODE")&&(y(n=e[t],0,9,t),F=n),e.hasOwnProperty(t="POW_PRECISION")&&(y(n=e[t],0,p,t),R=n),e.hasOwnProperty(t="FORMAT")){if("object"!=typeof(n=e[t]))throw Error(o+t+" not an object: "+n);W=n}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(n=e[t])||/^.$|[+-.\s]|(.).*\1/.test(n))throw Error(o+t+" invalid: "+n);I=n}}return{DECIMAL_PLACES:E,ROUNDING_MODE:C,EXPONENTIAL_AT:[P,H],RANGE:[z,A],CRYPTO:N,MODULO_MODE:F,POW_PRECISION:R,FORMAT:W,ALPHABET:I}},B.isBigNumber=function(e){return e instanceof B||e&&!0===e._isBigNumber||!1},B.maximum=B.max=function(){return U(arguments,j.lt)},B.minimum=B.min=function(){return U(arguments,j.gt)},B.random=(k=9007199254740992,L=Math.random()*k&2097151?function(){return i(Math.random()*k)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,n,r,s,l,c=0,m=[],h=new B(x);if(null==e?e=E:y(e,0,p),s=a(e/u),N)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(s*=2));c<s;)9e15<=(l=131072*t[c]+(t[c+1]>>>11))?(n=crypto.getRandomValues(new Uint32Array(2)),t[c]=n[0],t[c+1]=n[1]):(m.push(l%1e14),c+=2);c=s/2}else{if(!crypto.randomBytes)throw N=!1,Error(o+"crypto unavailable");for(t=crypto.randomBytes(s*=7);c<s;)9e15<=(l=281474976710656*(31&t[c])+1099511627776*t[c+1]+4294967296*t[c+2]+16777216*t[c+3]+(t[c+4]<<16)+(t[c+5]<<8)+t[c+6])?crypto.randomBytes(7).copy(t,c):(m.push(l%1e14),c+=7);c=s/7}if(!N)for(;c<s;)(l=L())<9e15&&(m[c++]=l%1e14);for(s=m[--c],e%=u,s&&e&&(l=d[u-e],m[c]=i(s/l)*l);0===m[c];m.pop(),c--);if(c<0)m=[r=0];else{for(r=-1;0===m[0];m.splice(0,1),r-=u);for(c=1,l=m[0];10<=l;l/=10,c++);c<u&&(r-=u-c)}return h.e=r,h.c=m,h}),B.sum=function(){for(var e=1,t=arguments,n=new B(t[0]);e<t.length;)n=n.plus(t[e++]);return n},w=function(){var e="0123456789";function t(e,t,n,r){for(var a,i,o=[0],s=0,l=e.length;s<l;){for(i=o.length;i--;o[i]*=t);for(o[0]+=r.indexOf(e.charAt(s++)),a=0;a<o.length;a++)o[a]>n-1&&(null==o[a+1]&&(o[a+1]=0),o[a+1]+=o[a]/n|0,o[a]%=n)}return o.reverse()}return function(r,a,i,o,s){var l,u,c,d,m,p,h,_,y=r.indexOf("."),g=E,b=C;for(0<=y&&(d=R,R=0,r=r.replace(".",""),p=(_=new B(a)).pow(r.length-y),R=d,_.c=t(v(f(p.c),p.e,"0"),10,i,e),_.e=_.c.length),c=d=(h=t(r,a,i,s?(l=I,e):(l=e,I))).length;0==h[--d];h.pop());if(!h[0])return l.charAt(0);if(y<0?--c:(p.c=h,p.e=c,p.s=o,h=(p=n(p,_,g,b,i)).c,m=p.r,c=p.e),y=h[u=c+g+1],d=i/2,m=m||u<0||null!=h[u+1],m=b<4?(null!=y||m)&&(0==b||b==(p.s<0?3:2)):d<y||y==d&&(4==b||m||6==b&&1&h[u-1]||b==(p.s<0?8:7)),u<1||!h[0])r=m?v(l.charAt(1),-g,l.charAt(0)):l.charAt(0);else{if(h.length=u,m)for(--i;++h[--u]>i;)h[u]=0,u||(++c,h=[1].concat(h));for(d=h.length;!h[--d];);for(y=0,r="";y<=d;r+=l.charAt(h[y++]));r=v(r,c,l.charAt(0))}return r}}(),n=function(){function e(e,t,n){var r,a,i,o,s=0,l=e.length,u=t%m,c=t/m|0;for(e=e.slice();l--;)s=((a=u*(i=e[l]%m)+(r=c*i+(o=e[l]/m|0)*u)%m*m+s)/n|0)+(r/m|0)+c*o,e[l]=a%n;return s&&(e=[s].concat(e)),e}function t(e,t,n,r){var a,i;if(n!=r)i=r<n?1:-1;else for(a=i=0;a<n;a++)if(e[a]!=t[a]){i=e[a]>t[a]?1:-1;break}return i}function n(e,t,n,r){for(var a=0;n--;)e[n]-=a,a=e[n]<t[n]?1:0,e[n]=a*r+e[n]-t[n];for(;!e[0]&&1<e.length;e.splice(0,1));}return function(r,a,o,s,c){var d,m,p,f,_,y,g,b,v,w,M,k,L,Y,D,T,S,O=r.s==a.s?1:-1,j=r.c,x=a.c;if(!(j&&j[0]&&x&&x[0]))return new B(r.s&&a.s&&(j?!x||j[0]!=x[0]:x)?j&&0==j[0]||!x?0*O:O/0:NaN);for(v=(b=new B(O)).c=[],O=o+(m=r.e-a.e)+1,c||(c=l,m=h(r.e/u)-h(a.e/u),O=O/u|0),p=0;x[p]==(j[p]||0);p++);if(x[p]>(j[p]||0)&&m--,O<0)v.push(1),f=!0;else{for(Y=j.length,T=x.length,O+=2,1<(_=i(c/(x[p=0]+1)))&&(x=e(x,_,c),j=e(j,_,c),T=x.length,Y=j.length),L=T,M=(w=j.slice(0,T)).length;M<T;w[M++]=0);S=x.slice(),S=[0].concat(S),D=x[0],x[1]>=c/2&&D++;do{if(_=0,(d=t(x,w,T,M))<0){if(k=w[0],T!=M&&(k=k*c+(w[1]||0)),1<(_=i(k/D)))for(c<=_&&(_=c-1),g=(y=e(x,_,c)).length,M=w.length;1==t(y,w,g,M);)_--,n(y,T<g?S:x,g,c),g=y.length,d=1;else 0==_&&(d=_=1),g=(y=x.slice()).length;if(g<M&&(y=[0].concat(y)),n(w,y,M,c),M=w.length,-1==d)for(;t(x,w,T,M)<1;)_++,n(w,T<M?S:x,M,c),M=w.length}else 0===d&&(_++,w=[0]);v[p++]=_,w[0]?w[M++]=j[L]||0:(w=[j[L]],M=1)}while((L++<Y||null!=w[0])&&O--);f=null!=w[0],v[0]||v.splice(0,1)}if(c==l){for(p=1,O=v[0];10<=O;O/=10,p++);V(b,o+(b.e=p+m*u-1)+1,s,f)}else b.e=m,b.r=+f;return b}}(),Y=/^(-?)0([xbo])(?=\w[\w.]*$)/i,D=/^([^.]+)\.$/,T=/^\.([^.]+)$/,S=/^-?(Infinity|NaN)$/,O=/^\s*\+(?=[\w.])|^\s+|\s+$/g,M=function(e,t,n,r){var a,i=n?t:t.replace(O,"");if(S.test(i))e.s=isNaN(i)?null:i<0?-1:1,e.c=e.e=null;else{if(!n&&(i=i.replace(Y,(function(e,t,n){return a="x"==(n=n.toLowerCase())?16:"b"==n?2:8,r&&r!=a?e:t})),r&&(a=r,i=i.replace(D,"$1").replace(T,"0.$1")),t!=i))return new B(i,a);if(B.DEBUG)throw Error(o+"Not a"+(r?" base "+r:"")+" number: "+t);e.c=e.e=e.s=null}},j.absoluteValue=j.abs=function(){var e=new B(this);return e.s<0&&(e.s=1),e},j.comparedTo=function(e,t){return _(this,new B(e,t))},j.decimalPlaces=j.dp=function(e,t){var n,r,a;if(null!=e)return y(e,0,p),null==t?t=C:y(t,0,8),V(new B(this),e+this.e+1,t);if(!(n=this.c))return null;if(r=((a=n.length-1)-h(this.e/u))*u,a=n[a])for(;a%10==0;a/=10,r--);return r<0&&(r=0),r},j.dividedBy=j.div=function(e,t){return n(this,new B(e,t),E,C)},j.dividedToIntegerBy=j.idiv=function(e,t){return n(this,new B(e,t),0,1)},j.exponentiatedBy=j.pow=function(e,t){var n,r,s,l,c,d,m,p,h=this;if((e=new B(e)).c&&!e.isInteger())throw Error(o+"Exponent not an integer: "+G(e));if(null!=t&&(t=new B(t)),c=14<e.e,!h.c||!h.c[0]||1==h.c[0]&&!h.e&&1==h.c.length||!e.c||!e.c[0])return p=new B(Math.pow(+G(h),c?2-g(e):+G(e))),t?p.mod(t):p;if(d=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new B(NaN);(r=!d&&h.isInteger()&&t.isInteger())&&(h=h.mod(t))}else{if(9<e.e&&(0<h.e||h.e<-1||(0==h.e?1<h.c[0]||c&&24e7<=h.c[1]:h.c[0]<8e13||c&&h.c[0]<=9999975e7)))return l=h.s<0&&g(e)?-0:0,-1<h.e&&(l=1/l),new B(d?1/l:l);R&&(l=a(R/u+2))}for(m=c?(n=new B(.5),d&&(e.s=1),g(e)):(s=Math.abs(+G(e)))%2,p=new B(x);;){if(m){if(!(p=p.times(h)).c)break;l?p.c.length>l&&(p.c.length=l):r&&(p=p.mod(t))}if(s){if(0===(s=i(s/2)))break;m=s%2}else if(V(e=e.times(n),e.e+1,1),14<e.e)m=g(e);else{if(0==(s=+G(e)))break;m=s%2}h=h.times(h),l?h.c&&h.c.length>l&&(h.c.length=l):r&&(h=h.mod(t))}return r?p:(d&&(p=x.div(p)),t?p.mod(t):l?V(p,R,C,void 0):p)},j.integerValue=function(e){var t=new B(this);return null==e?e=C:y(e,0,8),V(t,t.e+1,e)},j.isEqualTo=j.eq=function(e,t){return 0===_(this,new B(e,t))},j.isFinite=function(){return!!this.c},j.isGreaterThan=j.gt=function(e,t){return 0<_(this,new B(e,t))},j.isGreaterThanOrEqualTo=j.gte=function(e,t){return 1===(t=_(this,new B(e,t)))||0===t},j.isInteger=function(){return!!this.c&&h(this.e/u)>this.c.length-2},j.isLessThan=j.lt=function(e,t){return _(this,new B(e,t))<0},j.isLessThanOrEqualTo=j.lte=function(e,t){return-1===(t=_(this,new B(e,t)))||0===t},j.isNaN=function(){return!this.s},j.isNegative=function(){return this.s<0},j.isPositive=function(){return 0<this.s},j.isZero=function(){return!!this.c&&0==this.c[0]},j.minus=function(e,t){var n,r,a,i,o=this,s=o.s;if(t=(e=new B(e,t)).s,!s||!t)return new B(NaN);if(s!=t)return e.s=-t,o.plus(e);var c=o.e/u,d=e.e/u,m=o.c,p=e.c;if(!c||!d){if(!m||!p)return m?(e.s=-t,e):new B(p?o:NaN);if(!m[0]||!p[0])return p[0]?(e.s=-t,e):new B(m[0]?o:3==C?-0:0)}if(c=h(c),d=h(d),m=m.slice(),s=c-d){for((a=(i=s<0)?(s=-s,m):(d=c,p)).reverse(),t=s;t--;a.push(0));a.reverse()}else for(r=(i=(s=m.length)<(t=p.length))?s:t,s=t=0;t<r;t++)if(m[t]!=p[t]){i=m[t]<p[t];break}if(i&&(a=m,m=p,p=a,e.s=-e.s),0<(t=(r=p.length)-(n=m.length)))for(;t--;m[n++]=0);for(t=l-1;s<r;){if(m[--r]<p[r]){for(n=r;n&&!m[--n];m[n]=t);--m[n],m[r]+=l}m[r]-=p[r]}for(;0==m[0];m.splice(0,1),--d);return m[0]?q(e,m,d):(e.s=3==C?-1:1,e.c=[e.e=0],e)},j.modulo=j.mod=function(e,t){var r,a,i=this;return e=new B(e,t),!i.c||!e.s||e.c&&!e.c[0]?new B(NaN):!e.c||i.c&&!i.c[0]?new B(i):(9==F?(a=e.s,e.s=1,r=n(i,e,0,3),e.s=a,r.s*=a):r=n(i,e,0,F),(e=i.minus(r.times(e))).c[0]||1!=F||(e.s=i.s),e)},j.multipliedBy=j.times=function(e,t){var n,r,a,i,o,s,c,d,p,f,_,y,g,b,v,w=this,M=w.c,k=(e=new B(e,t)).c;if(!(M&&k&&M[0]&&k[0]))return!w.s||!e.s||M&&!M[0]&&!k||k&&!k[0]&&!M?e.c=e.e=e.s=null:(e.s*=w.s,M&&k?(e.c=[0],e.e=0):e.c=e.e=null),e;for(r=h(w.e/u)+h(e.e/u),e.s*=w.s,(c=M.length)<(f=k.length)&&(g=M,M=k,k=g,a=c,c=f,f=a),a=c+f,g=[];a--;g.push(0));for(b=l,v=m,a=f;0<=--a;){for(n=0,_=k[a]%v,y=k[a]/v|0,i=a+(o=c);a<i;)n=((d=_*(d=M[--o]%v)+(s=y*d+(p=M[o]/v|0)*_)%v*v+g[i]+n)/b|0)+(s/v|0)+y*p,g[i--]=d%b;g[i]=n}return n?++r:g.splice(0,1),q(e,g,r)},j.negated=function(){var e=new B(this);return e.s=-e.s||null,e},j.plus=function(e,t){var n,r=this,a=r.s;if(t=(e=new B(e,t)).s,!a||!t)return new B(NaN);if(a!=t)return e.s=-t,r.minus(e);var i=r.e/u,o=e.e/u,s=r.c,c=e.c;if(!i||!o){if(!s||!c)return new B(a/0);if(!s[0]||!c[0])return c[0]?e:new B(s[0]?r:0*a)}if(i=h(i),o=h(o),s=s.slice(),a=i-o){for((n=0<a?(o=i,c):(a=-a,s)).reverse();a--;n.push(0));n.reverse()}for((a=s.length)-(t=c.length)<0&&(n=c,c=s,s=n,t=a),a=0;t;)a=(s[--t]=s[t]+c[t]+a)/l|0,s[t]=l===s[t]?0:s[t]%l;return a&&(s=[a].concat(s),++o),q(e,s,o)},j.precision=j.sd=function(e,t){var n,r,a;if(null!=e&&e!==!!e)return y(e,1,p),null==t?t=C:y(t,0,8),V(new B(this),e,t);if(!(n=this.c))return null;if(r=(a=n.length-1)*u+1,a=n[a]){for(;a%10==0;a/=10,r--);for(a=n[0];10<=a;a/=10,r++);}return e&&this.e+1>r&&(r=this.e+1),r},j.shiftedBy=function(e){return y(e,-c,c),this.times("1e"+e)},j.squareRoot=j.sqrt=function(){var e,t,r,a,i,o=this,s=o.c,l=o.s,u=o.e,c=E+4,d=new B("0.5");if(1!==l||!s||!s[0])return new B(!l||l<0&&(!s||s[0])?NaN:s?o:1/0);if((r=0==(l=Math.sqrt(+G(o)))||l==1/0?(((t=f(s)).length+u)%2==0&&(t+="0"),l=Math.sqrt(+t),u=h((u+1)/2)-(u<0||u%2),new B(t=l==1/0?"1e"+u:(t=l.toExponential()).slice(0,t.indexOf("e")+1)+u)):new B(l+"")).c[0])for((l=(u=r.e)+c)<3&&(l=0);;)if(i=r,r=d.times(i.plus(n(o,i,c,1))),f(i.c).slice(0,l)===(t=f(r.c)).slice(0,l)){if(r.e<u&&--l,"9999"!=(t=t.slice(l-3,l+1))&&(a||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(V(r,r.e+E+2,1),e=!r.times(r).eq(o));break}if(!a&&(V(i,i.e+E+2,0),i.times(i).eq(o))){r=i;break}c+=4,l+=4,a=1}return V(r,r.e+E+1,C,e)},j.toExponential=function(e,t){return null!=e&&(y(e,0,p),e++),J(this,e,t,1)},j.toFixed=function(e,t){return null!=e&&(y(e,0,p),e=e+this.e+1),J(this,e,t)},j.toFormat=function(e,t,n){var r;if(null==n)null!=e&&t&&"object"==typeof t?(n=t,t=null):e&&"object"==typeof e?(n=e,e=t=null):n=W;else if("object"!=typeof n)throw Error(o+"Argument not an object: "+n);if(r=this.toFixed(e,t),this.c){var a,i=r.split("."),s=+n.groupSize,l=+n.secondaryGroupSize,u=n.groupSeparator||"",c=i[0],d=i[1],m=this.s<0,p=m?c.slice(1):c,h=p.length;if(l&&(a=s,s=l,h-=l=a),0<s&&0<h){for(a=h%s||s,c=p.substr(0,a);a<h;a+=s)c+=u+p.substr(a,s);0<l&&(c+=u+p.slice(a)),m&&(c="-"+c)}r=d?c+(n.decimalSeparator||"")+((l=+n.fractionGroupSize)?d.replace(new RegExp("\\d{"+l+"}\\B","g"),"$&"+(n.fractionGroupSeparator||"")):d):c}return(n.prefix||"")+r+(n.suffix||"")},j.toFraction=function(e){var t,r,a,i,s,l,c,m,p,h,_,y,g=this,b=g.c;if(null!=e&&(!(c=new B(e)).isInteger()&&(c.c||1!==c.s)||c.lt(x)))throw Error(o+"Argument "+(c.isInteger()?"out of range: ":"not an integer: ")+G(c));if(!b)return new B(g);for(t=new B(x),p=r=new B(x),a=m=new B(x),y=f(b),s=t.e=y.length-g.e-1,t.c[0]=d[(l=s%u)<0?u+l:l],e=!e||0<c.comparedTo(t)?0<s?t:p:c,l=A,A=1/0,c=new B(y),m.c[0]=0;h=n(c,t,0,1),1!=(i=r.plus(h.times(a))).comparedTo(e);)r=a,a=i,p=m.plus(h.times(i=p)),m=i,t=c.minus(h.times(i=t)),c=i;return i=n(e.minus(r),a,0,1),m=m.plus(i.times(p)),r=r.plus(i.times(a)),m.s=p.s=g.s,_=n(p,a,s*=2,C).minus(g).abs().comparedTo(n(m,r,s,C).minus(g).abs())<1?[p,a]:[m,r],A=l,_},j.toNumber=function(){return+G(this)},j.toPrecision=function(e,t){return null!=e&&y(e,1,p),J(this,e,t,2)},j.toString=function(e){var t,n=this,r=n.s,a=n.e;return null===a?r?(t="Infinity",r<0&&(t="-"+t)):t="NaN":(t=null==e?a<=P||H<=a?b(f(n.c),a):v(f(n.c),a,"0"):10===e?v(f((n=V(new B(n),E+a+1,C)).c),n.e,"0"):(y(e,2,I.length,"Base"),w(v(f(n.c),a,"0"),10,e,r,!0)),r<0&&n.c[0]&&(t="-"+t)),t},j.valueOf=j.toJSON=function(){return G(this)},j._isBigNumber=!0,"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator&&(j[Symbol.toStringTag]="BigNumber",j[Symbol.for("nodejs.util.inspect.custom")]=j.valueOf),null!=t&&B.set(t),B}()).default=n.BigNumber=n,void 0!==t&&t.exports?t.exports=n:(e||(e="undefined"!=typeof self&&self?self:window),e.BigNumber=n)}(this)},{}],2:[function(e,t,n){"use strict";t.exports={languageTag:"en-US",delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},spaceSeparated:!1,ordinal:function(e){var t=e%10;return 1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th"},currency:{symbol:"$",position:"prefix",code:"USD"},currencyFormat:{thousandSeparated:!0,totalLength:4,spaceSeparated:!0},formats:{fourDigits:{totalLength:4,spaceSeparated:!0},fullWithTwoDecimals:{output:"currency",thousandSeparated:!0,mantissa:2},fullWithTwoDecimalsNoCurrency:{thousandSeparated:!0,mantissa:2},fullWithNoDecimals:{output:"currency",thousandSeparated:!0,mantissa:0}}}},{}],3:[function(e,t,n){"use strict";function r(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],r=!0,a=!1,i=void 0;try{for(var o,s=e[Symbol.iterator]();!(r=(o=s.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){a=!0,i=e}finally{try{r||null==s.return||s.return()}finally{if(a)throw i}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var a=e("./globalState"),i=e("./validating"),o=e("./parsing"),s=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],l={general:{scale:1024,suffixes:s,marker:"bd"},binary:{scale:1024,suffixes:["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],marker:"b"},decimal:{scale:1e3,suffixes:s,marker:"d"}},u={totalLength:0,characteristic:0,forceAverage:!1,average:!1,mantissa:-1,optionalMantissa:!0,thousandSeparated:!1,spaceSeparated:!1,negative:"sign",forceSign:!1};function c(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},n=2<arguments.length?arguments[2]:void 0;if("string"==typeof t&&(t=o.parseFormat(t)),!i.validateFormat(t))return"ERROR: invalid format";var r=t.prefix||"",s=t.postfix||"",c=function(e,t,n){switch(t.output){case"currency":return function(e,t,n){var r=n.currentCurrency(),a=Object.assign({},u,t),i=void 0,o="",s=!!a.totalLength||!!a.forceAverage||a.average,l=t.currencyPosition||r.position,c=t.currencySymbol||r.symbol;a.spaceSeparated&&(o=" "),"infix"===l&&(i=o+c+o);var d=h({instance:e,providedFormat:t,state:n,decimalSeparator:i});return"prefix"===l&&(d=e._value<0&&"sign"===a.negative?"-".concat(o).concat(c).concat(d.slice(1)):c+o+d),l&&"postfix"!==l||(d=d+(o=s?"":o)+c),d}(e,t=f(t,a.currentCurrencyDefaultFormat()),a);case"percent":return function(e,t,n,r){var a=t.prefixSymbol,i=h({instance:r(100*e._value),providedFormat:t,state:n}),o=Object.assign({},u,t);return a?"%".concat(o.spaceSeparated?" ":"").concat(i):"".concat(i).concat(o.spaceSeparated?" ":"","%")}(e,t=f(t,a.currentPercentageDefaultFormat()),a,n);case"byte":return t=f(t,a.currentByteDefaultFormat()),v=e,M=a,k=n,L=(w=t).base||"binary",Y=l[L],T=(D=d(v._value,Y.suffixes,Y.scale)).value,S=D.suffix,O=h({instance:k(T),providedFormat:w,state:M,defaults:M.currentByteDefaultFormat()}),j=M.currentAbbreviations(),"".concat(O).concat(j.spaced?" ":"").concat(S);case"time":return t=f(t,a.currentTimeDefaultFormat()),_=e,y=Math.floor(_._value/60/60),g=Math.floor((_._value-60*y*60)/60),b=Math.round(_._value-60*y*60-60*g),"".concat(y,":").concat(g<10?"0":"").concat(g,":").concat(b<10?"0":"").concat(b);case"ordinal":return r=e,i=t=f(t,a.currentOrdinalDefaultFormat()),s=(o=a).currentOrdinal(),c=Object.assign({},u,i),m=h({instance:r,providedFormat:i,state:o}),p=s(r._value),"".concat(m).concat(c.spaceSeparated?" ":"").concat(p);case"number":default:return h({instance:e,providedFormat:t,numbro:n})}var r,i,o,s,c,m,p,_,y,g,b,v,w,M,k,L,Y,D,T,S,O,j}(e,t,n);return(c=r+c)+s}function d(e,t,n){var r=t[0],a=Math.abs(e);if(n<=a){for(var i=1;i<t.length;++i){var o=Math.pow(n,i),s=Math.pow(n,i+1);if(o<=a&&a<s){r=t[i],e/=o;break}}r===t[0]&&(e/=Math.pow(n,t.length-1),r=t[t.length-1])}return{value:e,suffix:r}}function m(e){for(var t="",n=0;n<e;n++)t+="0";return t}function p(e,t){return-1!==e.toString().indexOf("e")?function(e,t){var n=e.toString(),a=r(n.split("e"),2),i=a[0],o=a[1],s=r(i.split("."),2),l=s[0],u=s[1],c=void 0===u?"":u;if(0<+o)n=l+c+m(o-c.length);else{var d=".";d=+l<0?"-0".concat(d):"0".concat(d);var p=(m(-o-1)+Math.abs(l)+c).substr(0,t);p.length<t&&(p+=m(t-p.length)),n=d+p}return 0<+o&&0<t&&(n+=".".concat(m(t))),n}(e,t):(Math.round(+"".concat(e,"e+").concat(t))/Math.pow(10,t)).toFixed(t)}function h(e){var t=e.instance,n=e.providedFormat,i=e.state,o=void 0===i?a:i,s=e.decimalSeparator,l=e.defaults,c=void 0===l?o.currentDefaults():l,d=t._value;if(0===d&&o.hasZeroFormat())return o.getZeroFormat();if(!isFinite(d))return d.toString();var m,h,f,_,y,g,b,v,w=Object.assign({},u,c,n),M=w.totalLength,k=M?0:w.characteristic,L=w.optionalCharacteristic,Y=w.forceAverage,D=!!M||!!Y||w.average,T=M?-1:D&&void 0===n.mantissa?0:w.mantissa,S=!M&&(void 0===n.optionalMantissa?-1===T:w.optionalMantissa),O=w.trimMantissa,j=w.thousandSeparated,x=w.spaceSeparated,E=w.negative,C=w.forceSign,P=w.exponential,H="";if(D){var z=function(e){var t=e.value,n=e.forceAverage,r=e.abbreviations,a=e.spaceSeparated,i=void 0!==a&&a,o=e.totalLength,s=void 0===o?0:o,l="",u=Math.abs(t),c=-1;if(u>=Math.pow(10,12)&&!n||"trillion"===n?(l=r.trillion,t/=Math.pow(10,12)):u<Math.pow(10,12)&&u>=Math.pow(10,9)&&!n||"billion"===n?(l=r.billion,t/=Math.pow(10,9)):u<Math.pow(10,9)&&u>=Math.pow(10,6)&&!n||"million"===n?(l=r.million,t/=Math.pow(10,6)):(u<Math.pow(10,6)&&u>=Math.pow(10,3)&&!n||"thousand"===n)&&(l=r.thousand,t/=Math.pow(10,3)),l&&(l=(i?" ":"")+l),s){var d=t.toString().split(".")[0];c=Math.max(s-d.length,0)}return{value:t,abbreviation:l,mantissaPrecision:c}}({value:d,forceAverage:Y,abbreviations:o.currentAbbreviations(),spaceSeparated:x,totalLength:M});d=z.value,H+=z.abbreviation,M&&(T=z.mantissaPrecision)}if(P){var A=(h=(m={value:d,characteristicPrecision:k}).value,_=void 0===(f=m.characteristicPrecision)?0:f,g=(y=r(h.toExponential().split("e"),2))[0],b=y[1],v=+g,_&&1<_&&(v*=Math.pow(10,_-1),b=0<=(b=+b-(_-1))?"+".concat(b):b),{value:v,abbreviation:"e".concat(b)});d=A.value,H=A.abbreviation+H}var N,F,R,W=function(e,t,n,a,i){if(-1===a)return e;var o=p(t,a),s=r(o.toString().split("."),2),l=s[0],u=s[1],c=void 0===u?"":u;if(c.match(/^0+$/)&&(n||i))return l;var d=c.match(/0+$/);return i&&d?"".concat(l,".").concat(c.toString().slice(0,d.index)):o.toString()}(d.toString(),d,S,T,O);return W=function(e,t,n,r,a){var i=r.currentDelimiters(),o=i.thousands;a=a||i.decimal;var s=i.thousandsSize||3,l=e.toString(),u=l.split(".")[0],c=l.split(".")[1];return n&&(t<0&&(u=u.slice(1)),function(e,t){for(var n=[],r=0,a=e;0<a;a--)r===t&&(n.unshift(a),r=0),r++;return n}(u.length,s).forEach((function(e,t){u=u.slice(0,e+t)+o+u.slice(e+t)})),t<0&&(u="-".concat(u))),c?u+a+c:u}(W=function(e,t,n,a){var i=e,o=r(i.toString().split("."),2),s=o[0],l=o[1];if(s.match(/^-?0$/)&&n)return l?"".concat(s.replace("0",""),".").concat(l):s.replace("0","");if(s.length<a)for(var u=a-s.length,c=0;c<u;c++)i="0".concat(i);return i.toString()}(W,0,L,k),d,j,o,s),(D||P)&&(W+=H),(C||d<0)&&(N=W,R=E,W=0===(F=d)?N:0==+N?N.replace("-",""):0<F?"+".concat(N):"sign"===R?N:"(".concat(N.replace("-",""),")")),W}function f(e,t){if(!e)return t;var n=Object.keys(e);return 1===n.length&&"output"===n[0]?t:e}t.exports=function(e){return{format:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return c.apply(void 0,n.concat([e]))},getByteUnit:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var t=l.general;return d(e._value,t.suffixes,t.scale).suffix}.apply(void 0,n.concat([e]))},getBinaryByteUnit:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var t=l.binary;return d(e._value,t.suffixes,t.scale).suffix}.apply(void 0,n.concat([e]))},getDecimalByteUnit:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var t=l.decimal;return d(e._value,t.suffixes,t.scale).suffix}.apply(void 0,n.concat([e]))},formatOrDefault:f}}},{"./globalState":4,"./parsing":8,"./validating":10}],4:[function(e,t,n){"use strict";var r=e("./en-US"),a=e("./validating"),i=e("./parsing"),o={},s=void 0,l={},u=null,c={};function d(e){s=e}function m(){return l[s]}o.languages=function(){return Object.assign({},l)},o.currentLanguage=function(){return s},o.currentCurrency=function(){return m().currency},o.currentAbbreviations=function(){return m().abbreviations},o.currentDelimiters=function(){return m().delimiters},o.currentOrdinal=function(){return m().ordinal},o.currentDefaults=function(){return Object.assign({},m().defaults,c)},o.currentOrdinalDefaultFormat=function(){return Object.assign({},o.currentDefaults(),m().ordinalFormat)},o.currentByteDefaultFormat=function(){return Object.assign({},o.currentDefaults(),m().byteFormat)},o.currentPercentageDefaultFormat=function(){return Object.assign({},o.currentDefaults(),m().percentageFormat)},o.currentCurrencyDefaultFormat=function(){return Object.assign({},o.currentDefaults(),m().currencyFormat)},o.currentTimeDefaultFormat=function(){return Object.assign({},o.currentDefaults(),m().timeFormat)},o.setDefaults=function(e){e=i.parseFormat(e),a.validateFormat(e)&&(c=e)},o.getZeroFormat=function(){return u},o.setZeroFormat=function(e){return u="string"==typeof e?e:null},o.hasZeroFormat=function(){return null!==u},o.languageData=function(e){if(e){if(l[e])return l[e];throw new Error('Unknown tag "'.concat(e,'"'))}return m()},o.registerLanguage=function(e){var t=1<arguments.length&&void 0!==arguments[1]&&arguments[1];if(!a.validateLanguage(e))throw new Error("Invalid language data");l[e.languageTag]=e,t&&d(e.languageTag)},o.setLanguage=function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:r.languageTag;if(!l[e]){var n=e.split("-")[0],a=Object.keys(l).find((function(e){return e.split("-")[0]===n}));return l[a]?void d(a):void d(t)}d(e)},o.registerLanguage(r),s=r.languageTag,t.exports=o},{"./en-US":2,"./parsing":8,"./validating":10}],5:[function(e,t,n){"use strict";t.exports=function(t){return{loadLanguagesInNode:function(n){return r=t,void n.forEach((function(t){var n=void 0;try{n=e("../languages/".concat(t))}catch(n){console.error('Unable to load "'.concat(t,'". No matching language file found.'))}n&&r.registerLanguage(n)}));var r}}}},{}],6:[function(e,t,n){"use strict";var r=e("bignumber.js");function a(e,t,n){var a=new r(e._value),i=t;return n.isNumbro(t)&&(i=t._value),i=new r(i),e._value=a.minus(i).toNumber(),e}t.exports=function(e){return{add:function(t,n){return i=n,o=e,s=new r((a=t)._value),l=i,o.isNumbro(i)&&(l=i._value),l=new r(l),a._value=s.plus(l).toNumber(),a;var a,i,o,s,l},subtract:function(t,n){return a(t,n,e)},multiply:function(t,n){return i=n,o=e,s=new r((a=t)._value),l=i,o.isNumbro(i)&&(l=i._value),l=new r(l),a._value=s.times(l).toNumber(),a;var a,i,o,s,l},divide:function(t,n){return i=n,o=e,s=new r((a=t)._value),l=i,o.isNumbro(i)&&(l=i._value),l=new r(l),a._value=s.dividedBy(l).toNumber(),a;var a,i,o,s,l},set:function(t,n){return r=t,i=a=n,e.isNumbro(a)&&(i=a._value),r._value=i,r;var r,a,i},difference:function(t,n){return r=n,a(o=(i=e)(t._value),r,i),Math.abs(o._value);var r,i,o}}}},{"bignumber.js":1}],7:[function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var a=e("./globalState"),i=e("./validating"),o=e("./loading")(p),s=e("./unformatting"),l=e("./formatting")(p),u=e("./manipulating")(p),c=e("./parsing"),d=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._value=t}var t,n;return t=e,(n=[{key:"clone",value:function(){return p(this._value)}},{key:"format",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return l.format(this,e)}},{key:"formatCurrency",value:function(e){return"string"==typeof e&&(e=c.parseFormat(e)),(e=l.formatOrDefault(e,a.currentCurrencyDefaultFormat())).output="currency",l.format(this,e)}},{key:"formatTime",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return e.output="time",l.format(this,e)}},{key:"binaryByteUnits",value:function(){return l.getBinaryByteUnit(this)}},{key:"decimalByteUnits",value:function(){return l.getDecimalByteUnit(this)}},{key:"byteUnits",value:function(){return l.getByteUnit(this)}},{key:"difference",value:function(e){return u.difference(this,e)}},{key:"add",value:function(e){return u.add(this,e)}},{key:"subtract",value:function(e){return u.subtract(this,e)}},{key:"multiply",value:function(e){return u.multiply(this,e)}},{key:"divide",value:function(e){return u.divide(this,e)}},{key:"set",value:function(e){return u.set(this,m(e))}},{key:"value",value:function(){return this._value}},{key:"valueOf",value:function(){return this._value}}])&&r(t.prototype,n),e}();function m(e){var t=e;return p.isNumbro(e)?t=e._value:"string"==typeof e?t=p.unformat(e):isNaN(e)&&(t=NaN),t}function p(e){return new d(m(e))}p.version="2.1.2",p.isNumbro=function(e){return e instanceof d},p.language=a.currentLanguage,p.registerLanguage=a.registerLanguage,p.setLanguage=a.setLanguage,p.languages=a.languages,p.languageData=a.languageData,p.zeroFormat=a.setZeroFormat,p.defaultFormat=a.currentDefaults,p.setDefaults=a.setDefaults,p.defaultCurrencyFormat=a.currentCurrencyDefaultFormat,p.validate=i.validate,p.loadLanguagesInNode=o.loadLanguagesInNode,p.unformat=s.unformat,t.exports=p},{"./formatting":3,"./globalState":4,"./loading":5,"./manipulating":6,"./parsing":8,"./unformatting":9,"./validating":10}],8:[function(e,t,n){"use strict";t.exports={parseFormat:function(e){var t,n,r,a,i,o,s,l,u,c,d,m,p,h,f,_,y,g,b,v,w=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return"string"!=typeof e?e:(n=w,i=w,function(e,t){if(-1===e.indexOf("$")){if(-1===e.indexOf("%"))return-1!==e.indexOf("bd")?(t.output="byte",t.base="general"):-1!==e.indexOf("b")?(t.output="byte",t.base="binary"):-1!==e.indexOf("d")?(t.output="byte",t.base="decimal"):-1===e.indexOf(":")?-1!==e.indexOf("o")&&(t.output="ordinal"):t.output="time";t.output="percent"}else t.output="currency"}(e=(o=(a=e=(r=(t=e).match(/^{([^}]*)}/))?(n.prefix=r[1],t.slice(r[0].length)):t).match(/{([^}]*)}$/))?(i.postfix=o[1],a.slice(0,-o[0].length)):a,w),s=w,(l=e.match(/[1-9]+[0-9]*/))&&(s.totalLength=+l[0]),u=w,(c=e.split(".")[0].match(/0+/))&&(u.characteristic=c[0].length),function(e,t){if(-1!==e.indexOf(".")){var n=e.split(".")[0];t.optionalCharacteristic=-1===n.indexOf("0")}}(e,w),d=w,-1!==e.indexOf("a")&&(d.average=!0),p=w,-1!==(m=e).indexOf("K")?p.forceAverage="thousand":-1!==m.indexOf("M")?p.forceAverage="million":-1!==m.indexOf("B")?p.forceAverage="billion":-1!==m.indexOf("T")&&(p.forceAverage="trillion"),function(e,t){var n=e.split(".")[1];if(n){var r=n.match(/0+/);r&&(t.mantissa=r[0].length)}}(e,w),f=w,(h=e).match(/\[\.]/)?f.optionalMantissa=!0:h.match(/\./)&&(f.optionalMantissa=!1),_=w,-1!==e.indexOf(",")&&(_.thousandSeparated=!0),y=w,-1!==e.indexOf(" ")&&(y.spaceSeparated=!0),b=w,(g=e).match(/^\+?\([^)]*\)$/)&&(b.negative="parenthesis"),g.match(/^\+?-/)&&(b.negative="sign"),v=w,e.match(/^\+/)&&(v.forceSign=!0),w)}}},{}],9:[function(e,t,n){"use strict";var r=[{key:"ZiB",factor:Math.pow(1024,7)},{key:"ZB",factor:Math.pow(1e3,7)},{key:"YiB",factor:Math.pow(1024,8)},{key:"YB",factor:Math.pow(1e3,8)},{key:"TiB",factor:Math.pow(1024,4)},{key:"TB",factor:Math.pow(1e3,4)},{key:"PiB",factor:Math.pow(1024,5)},{key:"PB",factor:Math.pow(1e3,5)},{key:"MiB",factor:Math.pow(1024,2)},{key:"MB",factor:Math.pow(1e3,2)},{key:"KiB",factor:Math.pow(1024,1)},{key:"KB",factor:Math.pow(1e3,1)},{key:"GiB",factor:Math.pow(1024,3)},{key:"GB",factor:Math.pow(1e3,3)},{key:"EiB",factor:Math.pow(1024,6)},{key:"EB",factor:Math.pow(1e3,6)},{key:"B",factor:1}];function a(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}t.exports={unformat:function(t,n){var i,o,s,l=e("./globalState"),u=l.currentDelimiters(),c=l.currentCurrency().symbol,d=l.currentOrdinal(),m=l.getZeroFormat(),p=l.currentAbbreviations(),h=void 0;if("string"==typeof t)h=function(e,t){if(!e.indexOf(":")||":"===t.thousands)return!1;var n=e.split(":");if(3!==n.length)return!1;var r=+n[0],a=+n[1],i=+n[2];return!isNaN(r)&&!isNaN(a)&&!isNaN(i)}(t,u)?(o=+(i=t.split(":"))[0],s=+i[1],+i[2]+60*s+3600*o):function(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:"",i=3<arguments.length?arguments[3]:void 0,o=4<arguments.length?arguments[4]:void 0,s=5<arguments.length?arguments[5]:void 0,l=6<arguments.length?arguments[6]:void 0;if(""!==e)return e===o?0:function e(t,n){var i=2<arguments.length&&void 0!==arguments[2]?arguments[2]:"",o=3<arguments.length?arguments[3]:void 0,s=4<arguments.length?arguments[4]:void 0,l=5<arguments.length?arguments[5]:void 0,u=6<arguments.length?arguments[6]:void 0;if(!isNaN(+t))return+t;var c="",d=t.replace(/(^[^(]*)\((.*)\)([^)]*$)/,"$1$2$3");if(d!==t)return-1*e(d,n,i,o,s,l,u);for(var m=0;m<r.length;m++){var p=r[m];if((c=t.replace(p.key,""))!==t)return e(c,n,i,o,s,l,u)*p.factor}if((c=t.replace("%",""))!==t)return e(c,n,i,o,s,l,u)/100;var h=parseFloat(t);if(!isNaN(h)){var f=o(h);if(f&&"."!==f&&(c=t.replace(new RegExp("".concat(a(f),"$")),""))!==t)return e(c,n,i,o,s,l,u);var _={};Object.keys(l).forEach((function(e){_[l[e]]=e}));for(var y=Object.keys(_).sort().reverse(),g=y.length,b=0;b<g;b++){var v=y[b],w=_[v];if((c=t.replace(v,""))!==t){var M=void 0;switch(w){case"thousand":M=Math.pow(10,3);break;case"million":M=Math.pow(10,6);break;case"billion":M=Math.pow(10,9);break;case"trillion":M=Math.pow(10,12)}return e(c,n,i,o,s,l,u)*M}}}}(function(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:"",r=e.replace(n,"");return(r=r.replace(new RegExp("([0-9])".concat(a(t.thousands),"([0-9])"),"g"),"$1$2")).replace(t.decimal,".")}(e,t,n),t,n,i,o,s,l)}(t,u,c,d,m,p,n);else{if("number"!=typeof t)return;h=t}if(void 0!==h)return h}}},{"./globalState":4}],10:[function(e,t,n){"use strict";function r(e){return(r="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)}var a=e("./unformatting"),i=/^[a-z]{2,3}(-[a-zA-Z]{4})?(-([A-Z]{2}|[0-9]{3}))?$/,o={output:{type:"string",validValues:["currency","percent","byte","time","ordinal","number"]},base:{type:"string",validValues:["decimal","binary","general"],restriction:function(e,t){return"byte"===t.output},message:"`base` must be provided only when the output is `byte`",mandatory:function(e){return"byte"===e.output}},characteristic:{type:"number",restriction:function(e){return 0<=e},message:"value must be positive"},prefix:"string",postfix:"string",forceAverage:{type:"string",validValues:["trillion","billion","million","thousand"]},average:"boolean",currencyPosition:{type:"string",validValues:["prefix","infix","postfix"]},currencySymbol:"string",totalLength:{type:"number",restrictions:[{restriction:function(e){return 0<=e},message:"value must be positive"},{restriction:function(e,t){return!t.exponential},message:"`totalLength` is incompatible with `exponential`"}]},mantissa:{type:"number",restriction:function(e){return 0<=e},message:"value must be positive"},optionalMantissa:"boolean",trimMantissa:"boolean",optionalCharacteristic:"boolean",thousandSeparated:"boolean",spaceSeparated:"boolean",abbreviations:{type:"object",children:{thousand:"string",million:"string",billion:"string",trillion:"string"}},negative:{type:"string",validValues:["sign","parenthesis"]},forceSign:"boolean",exponential:{type:"boolean"},prefixSymbol:{type:"boolean",restriction:function(e,t){return"percent"===t.output},message:"`prefixSymbol` can be provided only when the output is `percent`"}},s={languageTag:{type:"string",mandatory:!0,restriction:function(e){return e.match(i)},message:"the language tag must follow the BCP 47 specification (see https://tools.ieft.org/html/bcp47)"},delimiters:{type:"object",children:{thousands:"string",decimal:"string",thousandsSize:"number"},mandatory:!0},abbreviations:{type:"object",children:{thousand:{type:"string",mandatory:!0},million:{type:"string",mandatory:!0},billion:{type:"string",mandatory:!0},trillion:{type:"string",mandatory:!0}},mandatory:!0},spaceSeparated:"boolean",ordinal:{type:"function",mandatory:!0},currency:{type:"object",children:{symbol:"string",position:"string",code:"string"},mandatory:!0},defaults:"format",ordinalFormat:"format",byteFormat:"format",percentageFormat:"format",currencyFormat:"format",timeDefaults:"format",formats:{type:"object",children:{fourDigits:{type:"format",mandatory:!0},fullWithTwoDecimals:{type:"format",mandatory:!0},fullWithTwoDecimalsNoCurrency:{type:"format",mandatory:!0},fullWithNoDecimals:{type:"format",mandatory:!0}}}};function l(e){return!!a.unformat(e)}function u(e,t,n){var a=3<arguments.length&&void 0!==arguments[3]&&arguments[3],i=Object.keys(e).map((function(a){if(!t[a])return console.error("".concat(n," Invalid key: ").concat(a)),!1;var i=e[a],s=t[a];if("string"==typeof s&&(s={type:s}),"format"===s.type){if(!u(i,o,"[Validate ".concat(a,"]"),!0))return!1}else if(r(i)!==s.type)return console.error("".concat(n," ").concat(a,' type mismatched: "').concat(s.type,'" expected, "').concat(r(i),'" provided')),!1;if(s.restrictions&&s.restrictions.length)for(var l=s.restrictions.length,c=0;c<l;c++){var d=s.restrictions[c],m=d.restriction,p=d.message;if(!m(i,e))return console.error("".concat(n," ").concat(a," invalid value: ").concat(p)),!1}return s.restriction&&!s.restriction(i,e)?(console.error("".concat(n," ").concat(a," invalid value: ").concat(s.message)),!1):s.validValues&&-1===s.validValues.indexOf(i)?(console.error("".concat(n," ").concat(a," invalid value: must be among ").concat(JSON.stringify(s.validValues),', "').concat(i,'" provided')),!1):!(s.children&&!u(i,s.children,"[Validate ".concat(a,"]")))}));return a||i.push.apply(i,function(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}(Object.keys(t).map((function(r){var a=t[r];if("string"==typeof a&&(a={type:a}),a.mandatory){var i=a.mandatory;if("function"==typeof i&&(i=i(e)),i&&void 0===e[r])return console.error("".concat(n,' Missing mandatory key "').concat(r,'"')),!1}return!0})))),i.reduce((function(e,t){return e&&t}),!0)}function c(e){return u(e,o,"[Validate format]")}t.exports={validate:function(e,t){var n=l(e),r=c(t);return n&&r},validateFormat:c,validateInput:l,validateLanguage:function(e){return u(e,s,"[Validate language]")}}},{"./unformatting":9}]},{},[7])(7)},function(e,t,n){
59
  /*!
60
  * Pikaday
61
  *
62
  * Copyright © 2014 David Bushell | BSD & MIT license | https://github.com/dbushell/Pikaday
63
  */
64
+ !function(t,r){"use strict";var a;try{a=n(0)}catch(e){}e.exports=function(e){var t="function"==typeof e,n=!!window.addEventListener,r=window.document,a=window.setTimeout,i=function(e,t,r,a){n?e.addEventListener(t,r,!!a):e.attachEvent("on"+t,r)},o=function(e,t,r,a){n?e.removeEventListener(t,r,!!a):e.detachEvent("on"+t,r)},s=function(e,t,n){var a;r.createEvent?((a=r.createEvent("HTMLEvents")).initEvent(t,!0,!1),a=_(a,n),e.dispatchEvent(a)):r.createEventObject&&(a=r.createEventObject(),a=_(a,n),e.fireEvent("on"+t,a))},l=function(e,t){return-1!==(" "+e.className+" ").indexOf(" "+t+" ")},u=function(e){return/Array/.test(Object.prototype.toString.call(e))},c=function(e){return/Date/.test(Object.prototype.toString.call(e))&&!isNaN(e.getTime())},d=function(e){var t=e.getDay();return 0===t||6===t},m=function(e){return e%4==0&&e%100!=0||e%400==0},p=function(e,t){return[31,m(e)?29:28,31,30,31,30,31,31,30,31,30,31][t]},h=function(e){c(e)&&e.setHours(0,0,0,0)},f=function(e,t){return e.getTime()===t.getTime()},_=function(e,t,n){var r,a;for(r in t)(a=void 0!==e[r])&&"object"==typeof t[r]&&null!==t[r]&&void 0===t[r].nodeName?c(t[r])?n&&(e[r]=new Date(t[r].getTime())):u(t[r])?n&&(e[r]=t[r].slice(0)):e[r]=_({},t[r],n):!n&&a||(e[r]=t[r]);return e},y=function(e){return e.month<0&&(e.year-=Math.ceil(Math.abs(e.month)/12),e.month+=12),e.month>11&&(e.year+=Math.floor(Math.abs(e.month)/12),e.month-=12),e},g={field:null,bound:void 0,position:"bottom left",reposition:!0,format:"YYYY-MM-DD",defaultDate:null,setDefaultDate:!1,firstDay:0,formatStrict:!1,minDate:null,maxDate:null,yearRange:10,showWeekNumber:!1,minYear:0,maxYear:9999,minMonth:void 0,maxMonth:void 0,startRange:null,endRange:null,isRTL:!1,yearSuffix:"",showMonthAfterYear:!1,showDaysInNextAndPreviousMonths:!1,numberOfMonths:1,mainCalendar:"left",container:void 0,i18n:{previousMonth:"Previous Month",nextMonth:"Next Month",months:["January","February","March","April","May","June","July","August","September","October","November","December"],weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},theme:null,onSelect:null,onOpen:null,onClose:null,onDraw:null},b=function(e,t,n){for(t+=e.firstDay;t>=7;)t-=7;return n?e.i18n.weekdaysShort[t]:e.i18n.weekdays[t]},v=function(e){var t=[],n="false";if(e.isEmpty){if(!e.showDaysInNextAndPreviousMonths)return'<td class="is-empty"></td>';t.push("is-outside-current-month")}return e.isDisabled&&t.push("is-disabled"),e.isToday&&t.push("is-today"),e.isSelected&&(t.push("is-selected"),n="true"),e.isInRange&&t.push("is-inrange"),e.isStartRange&&t.push("is-startrange"),e.isEndRange&&t.push("is-endrange"),'<td data-day="'+e.day+'" class="'+t.join(" ")+'" aria-selected="'+n+'"><button class="pika-button pika-day" type="button" data-pika-year="'+e.year+'" data-pika-month="'+e.month+'" data-pika-day="'+e.day+'">'+e.day+"</button></td>"},w=function(e,t){return"<tr>"+(t?e.reverse():e).join("")+"</tr>"},M=function(e,t,n,r,a,i){var o,s,l,c,d,m=e._o,p=n===m.minYear,h=n===m.maxYear,f='<div id="'+i+'" class="pika-title" role="heading" aria-live="assertive">',_=!0,y=!0;for(l=[],o=0;o<12;o++)l.push('<option value="'+(n===a?o-t:12+o-t)+'"'+(o===r?' selected="selected"':"")+(p&&o<m.minMonth||h&&o>m.maxMonth?'disabled="disabled"':"")+">"+m.i18n.months[o]+"</option>");for(c='<div class="pika-label">'+m.i18n.months[r]+'<select class="pika-select pika-select-month" tabindex="-1">'+l.join("")+"</select></div>",u(m.yearRange)?(o=m.yearRange[0],s=m.yearRange[1]+1):(o=n-m.yearRange,s=1+n+m.yearRange),l=[];o<s&&o<=m.maxYear;o++)o>=m.minYear&&l.push('<option value="'+o+'"'+(o===n?' selected="selected"':"")+">"+o+"</option>");return d='<div class="pika-label">'+n+m.yearSuffix+'<select class="pika-select pika-select-year" tabindex="-1">'+l.join("")+"</select></div>",m.showMonthAfterYear?f+=d+c:f+=c+d,p&&(0===r||m.minMonth>=r)&&(_=!1),h&&(11===r||m.maxMonth<=r)&&(y=!1),0===t&&(f+='<button class="pika-prev'+(_?"":" is-disabled")+'" type="button">'+m.i18n.previousMonth+"</button>"),t===e._o.numberOfMonths-1&&(f+='<button class="pika-next'+(y?"":" is-disabled")+'" type="button">'+m.i18n.nextMonth+"</button>"),f+"</div>"},k=function(o){var s=this,u=s.config(o);s._onMouseDown=function(e){if(s._v){var t=(e=e||window.event).target||e.srcElement;if(t)if(l(t,"is-disabled")||(!l(t,"pika-button")||l(t,"is-empty")||l(t.parentNode,"is-disabled")?l(t,"pika-prev")?s.prevMonth():l(t,"pika-next")&&s.nextMonth():(s.setDate(new Date(t.getAttribute("data-pika-year"),t.getAttribute("data-pika-month"),t.getAttribute("data-pika-day"))),u.bound&&a((function(){s.hide(),u.field&&u.field.blur()}),100))),l(t,"pika-select"))s._c=!0;else{if(!e.preventDefault)return e.returnValue=!1,!1;e.preventDefault()}}},s._onChange=function(e){var t=(e=e||window.event).target||e.srcElement;t&&(l(t,"pika-select-month")?s.gotoMonth(t.value):l(t,"pika-select-year")&&s.gotoYear(t.value))},s._onKeyChange=function(e){if(e=e||window.event,s.isVisible())switch(e.keyCode){case 13:case 27:u.field.blur();break;case 37:e.preventDefault(),s.adjustDate("subtract",1);break;case 38:s.adjustDate("subtract",7);break;case 39:s.adjustDate("add",1);break;case 40:s.adjustDate("add",7)}},s._onInputChange=function(n){var r;n.firedBy!==s&&(r=t?(r=e(u.field.value,u.format,u.formatStrict))&&r.isValid()?r.toDate():null:new Date(Date.parse(u.field.value)),c(r)&&s.setDate(r),s._v||s.show())},s._onInputFocus=function(){s.show()},s._onInputClick=function(){s.show()},s._onInputBlur=function(){var e=r.activeElement;do{if(l(e,"pika-single"))return}while(e=e.parentNode);s._c||(s._b=a((function(){s.hide()}),50)),s._c=!1},s._onClick=function(e){var t=(e=e||window.event).target||e.srcElement,r=t;if(t){!n&&l(t,"pika-select")&&(t.onchange||(t.setAttribute("onchange","return;"),i(t,"change",s._onChange)));do{if(l(r,"pika-single")||r===u.trigger)return}while(r=r.parentNode);s._v&&t!==u.trigger&&r!==u.trigger&&s.hide()}},s.el=r.createElement("div"),s.el.className="pika-single"+(u.isRTL?" is-rtl":"")+(u.theme?" "+u.theme:""),i(s.el,"mousedown",s._onMouseDown,!0),i(s.el,"touchend",s._onMouseDown,!0),i(s.el,"change",s._onChange),i(r,"keydown",s._onKeyChange),u.field&&(u.container?u.container.appendChild(s.el):u.bound?r.body.appendChild(s.el):u.field.parentNode.insertBefore(s.el,u.field.nextSibling),i(u.field,"change",s._onInputChange),u.defaultDate||(t&&u.field.value?u.defaultDate=e(u.field.value,u.format).toDate():u.defaultDate=new Date(Date.parse(u.field.value)),u.setDefaultDate=!0));var d=u.defaultDate;c(d)?u.setDefaultDate?s.setDate(d,!0):s.gotoDate(d):s.gotoDate(new Date),u.bound?(this.hide(),s.el.className+=" is-bound",i(u.trigger,"click",s._onInputClick),i(u.trigger,"focus",s._onInputFocus),i(u.trigger,"blur",s._onInputBlur)):this.show()};return k.prototype={config:function(e){this._o||(this._o=_({},g,!0));var t=_(this._o,e,!0);t.isRTL=!!t.isRTL,t.field=t.field&&t.field.nodeName?t.field:null,t.theme="string"==typeof t.theme&&t.theme?t.theme:null,t.bound=!!(void 0!==t.bound?t.field&&t.bound:t.field),t.trigger=t.trigger&&t.trigger.nodeName?t.trigger:t.field,t.disableWeekends=!!t.disableWeekends,t.disableDayFn="function"==typeof t.disableDayFn?t.disableDayFn:null;var n=parseInt(t.numberOfMonths,10)||1;if(t.numberOfMonths=n>4?4:n,c(t.minDate)||(t.minDate=!1),c(t.maxDate)||(t.maxDate=!1),t.minDate&&t.maxDate&&t.maxDate<t.minDate&&(t.maxDate=t.minDate=!1),t.minDate&&this.setMinDate(t.minDate),t.maxDate&&this.setMaxDate(t.maxDate),u(t.yearRange)){var r=(new Date).getFullYear()-10;t.yearRange[0]=parseInt(t.yearRange[0],10)||r,t.yearRange[1]=parseInt(t.yearRange[1],10)||r}else t.yearRange=Math.abs(parseInt(t.yearRange,10))||g.yearRange,t.yearRange>100&&(t.yearRange=100);return t},toString:function(n){return c(this._d)?t?e(this._d).format(n||this._o.format):this._d.toDateString():""},getMoment:function(){return t?e(this._d):null},setMoment:function(n,r){t&&e.isMoment(n)&&this.setDate(n.toDate(),r)},getDate:function(){return c(this._d)?new Date(this._d.getTime()):new Date},setDate:function(e,t){if(!e)return this._d=null,this._o.field&&(this._o.field.value="",s(this._o.field,"change",{firedBy:this})),this.draw();if("string"==typeof e&&(e=new Date(Date.parse(e))),c(e)){var n=this._o.minDate,r=this._o.maxDate;c(n)&&e<n?e=n:c(r)&&e>r&&(e=r),this._d=new Date(e.getTime()),h(this._d),this.gotoDate(this._d),this._o.field&&(this._o.field.value=this.toString(),s(this._o.field,"change",{firedBy:this})),t||"function"!=typeof this._o.onSelect||this._o.onSelect.call(this,this.getDate())}},gotoDate:function(e){var t=!0;if(c(e)){if(this.calendars){var n=new Date(this.calendars[0].year,this.calendars[0].month,1),r=new Date(this.calendars[this.calendars.length-1].year,this.calendars[this.calendars.length-1].month,1),a=e.getTime();r.setMonth(r.getMonth()+1),r.setDate(r.getDate()-1),t=a<n.getTime()||r.getTime()<a}t&&(this.calendars=[{month:e.getMonth(),year:e.getFullYear()}],"right"===this._o.mainCalendar&&(this.calendars[0].month+=1-this._o.numberOfMonths)),this.adjustCalendars()}},adjustDate:function(n,r){var a,i=this.getDate(),o=24*parseInt(r)*60*60*1e3;"add"===n?a=new Date(i.valueOf()+o):"subtract"===n&&(a=new Date(i.valueOf()-o)),t&&("add"===n?a=e(i).add(r,"days").toDate():"subtract"===n&&(a=e(i).subtract(r,"days").toDate())),this.setDate(a)},adjustCalendars:function(){this.calendars[0]=y(this.calendars[0]);for(var e=1;e<this._o.numberOfMonths;e++)this.calendars[e]=y({month:this.calendars[0].month+e,year:this.calendars[0].year});this.draw()},gotoToday:function(){this.gotoDate(new Date)},gotoMonth:function(e){isNaN(e)||(this.calendars[0].month=parseInt(e,10),this.adjustCalendars())},nextMonth:function(){this.calendars[0].month++,this.adjustCalendars()},prevMonth:function(){this.calendars[0].month--,this.adjustCalendars()},gotoYear:function(e){isNaN(e)||(this.calendars[0].year=parseInt(e,10),this.adjustCalendars())},setMinDate:function(e){e instanceof Date?(h(e),this._o.minDate=e,this._o.minYear=e.getFullYear(),this._o.minMonth=e.getMonth()):(this._o.minDate=g.minDate,this._o.minYear=g.minYear,this._o.minMonth=g.minMonth,this._o.startRange=g.startRange),this.draw()},setMaxDate:function(e){e instanceof Date?(h(e),this._o.maxDate=e,this._o.maxYear=e.getFullYear(),this._o.maxMonth=e.getMonth()):(this._o.maxDate=g.maxDate,this._o.maxYear=g.maxYear,this._o.maxMonth=g.maxMonth,this._o.endRange=g.endRange),this.draw()},setStartRange:function(e){this._o.startRange=e},setEndRange:function(e){this._o.endRange=e},draw:function(e){if(this._v||e){var t,n=this._o,r=n.minYear,i=n.maxYear,o=n.minMonth,s=n.maxMonth,l="";this._y<=r&&(this._y=r,!isNaN(o)&&this._m<o&&(this._m=o)),this._y>=i&&(this._y=i,!isNaN(s)&&this._m>s&&(this._m=s)),t="pika-title-"+Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,2);for(var u=0;u<n.numberOfMonths;u++)l+='<div class="pika-lendar">'+M(this,u,this.calendars[u].year,this.calendars[u].month,this.calendars[0].year,t)+this.render(this.calendars[u].year,this.calendars[u].month,t)+"</div>";this.el.innerHTML=l,n.bound&&"hidden"!==n.field.type&&a((function(){n.trigger.focus()}),1),"function"==typeof this._o.onDraw&&this._o.onDraw(this),n.bound&&n.field.setAttribute("aria-label","Use the arrow keys to pick a date")}},adjustPosition:function(){var e,t,n,a,i,o,s,l,u,c;if(!this._o.container){if(this.el.style.position="absolute",t=e=this._o.trigger,n=this.el.offsetWidth,a=this.el.offsetHeight,i=window.innerWidth||r.documentElement.clientWidth,o=window.innerHeight||r.documentElement.clientHeight,s=window.pageYOffset||r.body.scrollTop||r.documentElement.scrollTop,"function"==typeof e.getBoundingClientRect)l=(c=e.getBoundingClientRect()).left+window.pageXOffset,u=c.bottom+window.pageYOffset;else for(l=t.offsetLeft,u=t.offsetTop+t.offsetHeight;t=t.offsetParent;)l+=t.offsetLeft,u+=t.offsetTop;(this._o.reposition&&l+n>i||this._o.position.indexOf("right")>-1&&l-n+e.offsetWidth>0)&&(l=l-n+e.offsetWidth),(this._o.reposition&&u+a>o+s||this._o.position.indexOf("top")>-1&&u-a-e.offsetHeight>0)&&(u=u-a-e.offsetHeight),this.el.style.left=l+"px",this.el.style.top=u+"px"}},render:function(e,t,n){var r=this._o,a=new Date,i=p(e,t),o=new Date(e,t,1).getDay(),s=[],l=[];h(a),r.firstDay>0&&(o-=r.firstDay)<0&&(o+=7);for(var u,m,_,y,g=0===t?11:t-1,M=11===t?0:t+1,k=0===t?e-1:e,L=11===t?e+1:e,Y=p(k,g),D=i+o,T=D;T>7;)T-=7;D+=7-T;for(var S=0,O=0;S<D;S++){var j=new Date(e,t,S-o+1),x=!!c(this._d)&&f(j,this._d),E=f(j,a),C=S<o||S>=i+o,P=S-o+1,H=t,z=e,A=r.startRange&&f(r.startRange,j),N=r.endRange&&f(r.endRange,j),F=r.startRange&&r.endRange&&r.startRange<j&&j<r.endRange;C&&(S<o?(P=Y+P,H=g,z=k):(P-=i,H=M,z=L));var R={day:P,month:H,year:z,isSelected:x,isToday:E,isDisabled:r.minDate&&j<r.minDate||r.maxDate&&j>r.maxDate||r.disableWeekends&&d(j)||r.disableDayFn&&r.disableDayFn(j),isEmpty:C,isStartRange:A,isEndRange:N,isInRange:F,showDaysInNextAndPreviousMonths:r.showDaysInNextAndPreviousMonths};l.push(v(R)),7==++O&&(r.showWeekNumber&&l.unshift((u=S-o,m=t,_=e,y=void 0,void 0,y=new Date(_,0,1),'<td class="pika-week">'+Math.ceil(((new Date(_,m,u)-y)/864e5+y.getDay()+1)/7)+"</td>")),s.push(w(l,r.isRTL)),l=[],O=0)}return function(e,t,n){return'<table cellpadding="0" cellspacing="0" class="pika-table" role="grid" aria-labelledby="'+n+'">'+function(e){var t,n=[];e.showWeekNumber&&n.push("<th></th>");for(t=0;t<7;t++)n.push('<th scope="col"><abbr title="'+b(e,t)+'">'+b(e,t,!0)+"</abbr></th>");return"<thead><tr>"+(e.isRTL?n.reverse():n).join("")+"</tr></thead>"}(e)+(r=t,"<tbody>"+r.join("")+"</tbody>")+"</table>";var r}(r,s,n)},isVisible:function(){return this._v},show:function(){var e,t,n;this.isVisible()||(e=this.el,t="is-hidden",e.className=(n=(" "+e.className+" ").replace(" "+t+" "," ")).trim?n.trim():n.replace(/^\s+|\s+$/g,""),this._v=!0,this.draw(),this._o.bound&&(i(r,"click",this._onClick),this.adjustPosition()),"function"==typeof this._o.onOpen&&this._o.onOpen.call(this))},hide:function(){var e,t,n=this._v;!1!==n&&(this._o.bound&&o(r,"click",this._onClick),this.el.style.position="static",this.el.style.left="auto",this.el.style.top="auto",e=this.el,l(e,t="is-hidden")||(e.className=""===e.className?t:e.className+" "+t),this._v=!1,void 0!==n&&"function"==typeof this._o.onClose&&this._o.onClose.call(this))},destroy:function(){this.hide(),o(this.el,"mousedown",this._onMouseDown,!0),o(this.el,"touchend",this._onMouseDown,!0),o(this.el,"change",this._onChange),this._o.field&&(o(this._o.field,"change",this._onInputChange),this._o.bound&&(o(this._o.trigger,"click",this._onInputClick),o(this._o.trigger,"focus",this._onInputFocus),o(this._o.trigger,"blur",this._onInputBlur))),this.el.parentNode&&this.el.parentNode.removeChild(this.el)}},k}(a)}()},,function(e,t,n){},function(e,t,n){"use strict";n.r(t);var r=n(1),a=n.n(r),i=n(129),o=n.n(i),s=function(e,t){return(s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function l(e,t){function n(){this.constructor=e}s(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var u=function(){return(u=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e}).apply(this,arguments)};function c(e,t,n,r){return new(n||(n=Promise))((function(a,i){function o(e){try{l(r.next(e))}catch(e){i(e)}}function s(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){e.done?a(e.value):new n((function(t){t(e.value)})).then(o,s)}l((r=r.apply(e,t||[])).next())}))}function d(e,t){var n,r,a,i,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(a=2&i[0]?r.return:i[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,i[1])).done)return a;switch(r=0,a&&(i=[2&i[0],a.value]),i[0]){case 0:case 1:a=i;break;case 4:return o.label++,{value:i[1],done:!1};case 5:o.label++,r=i[1],i=[0];continue;case 7:i=o.ops.pop(),o.trys.pop();continue;default:if(!(a=(a=o.trys).length>0&&a[a.length-1])&&(6===i[0]||2===i[0])){o=0;continue}if(3===i[0]&&(!a||i[1]>a[0]&&i[1]<a[3])){o.label=i[1];break}if(6===i[0]&&o.label<a[1]){o.label=a[1],a=i;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(i);break}a[2]&&o.ops.pop(),o.trys.pop();continue}i=t.call(e,o)}catch(e){i=[6,e],r=0}finally{n=a=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}var m={graph_id:null,legend_toggle:!1,graphID:null,options:{colors:null},data:null,rows:null,columns:null,diffdata:null,chartEvents:null,legendToggle:!1,chartActions:null,getChartWrapper:function(e,t){},getChartEditor:null,className:"",style:{},formatters:null,spreadSheetUrl:null,spreadSheetQueryParameters:{headers:1,gid:1},rootProps:{},chartWrapperParams:{},controls:null,render:null,toolbarItems:null,toolbarID:null},p=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.handleGoogleChartsLoaderScriptLoaded=function(e){var n=t.props,r=n.chartVersion,a=n.chartPackages,i=n.chartLanguage,o=n.mapsApiKey,s=n.onLoad;e.charts.load(r||"current",{packages:a||["corechart","controls"],language:i||"en",mapsApiKey:o}),e.charts.setOnLoadCallback((function(){s(e)}))},t}return l(t,e),t.prototype.shouldComponentUpdate=function(e){return e.chartPackages===this.props.chartPackages},t.prototype.render=function(){var e=this,t=this.props.onError;return Object(r.createElement)(o.a,{url:"https://www.gstatic.com/charts/loader.js",onError:t,onLoad:function(){var t=window;t.google&&e.handleGoogleChartsLoaderScriptLoaded(t.google)}})},t}(r.Component),h=0,f=function(){return"reactgooglegraph-"+(h+=1)},_=["#3366CC","#DC3912","#FF9900","#109618","#990099","#3B3EAC","#0099C6","#DD4477","#66AA00","#B82E2E","#316395","#994499","#22AA99","#AAAA11","#6633CC","#E67300","#8B0707","#329262","#5574A6","#3B3EAC"],y=function(e,t,n){return void 0===n&&(n={}),c(void 0,void 0,void 0,(function(){return d(this,(function(r){return[2,new Promise((function(r,a){var i=n.headers?"headers="+n.headers:"headers=0",o=n.query?"&tq="+encodeURIComponent(n.query):"",s=n.gid?"&gid="+n.gid:"",l=n.sheet?"&sheet="+n.sheet:"",u=n.access_token?"&access_token="+n.access_token:"",c=t+"/gviz/tq?"+(""+i+s+l+o+u);new e.visualization.Query(c).send((function(e){e.isError()?a("Error in query: "+e.getMessage()+" "+e.getDetailedMessage()):r(e.getDataTable())}))}))]}))}))},g=Object(r.createContext)(m),b=g.Provider,v=g.Consumer,w=function(e){var t=e.children,n=e.value;return Object(r.createElement)(b,{value:n},t)},M=function(e){var t=e.render;return Object(r.createElement)(v,null,(function(e){return t(e)}))},k="#CCCCCC",L=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={hiddenColumns:[]},t.listenToLegendToggle=function(){var e=t.props,n=e.google,r=e.googleChartWrapper;n.visualization.events.addListener(r,"select",(function(){var e=r.getChart().getSelection(),n=r.getDataTable();if(0!==e.length&&null===e[0].row&&null!==n){var a=e[0].column,i=t.getColumnID(n,a);t.state.hiddenColumns.includes(i)?t.setState((function(e){return u({},e,{hiddenColumns:e.hiddenColumns.filter((function(e){return e!==i})).slice()})})):t.setState((function(e){return u({},e,{hiddenColumns:e.hiddenColumns.concat([i])})}))}}))},t.applyFormatters=function(e,n){for(var r=t.props.google,a=0,i=n;a<i.length;a++){var o=i[a];switch(o.type){case"ArrowFormat":(s=new r.visualization.ArrowFormat(o.options)).format(e,o.column);break;case"BarFormat":(s=new r.visualization.BarFormat(o.options)).format(e,o.column);break;case"ColorFormat":for(var s=new r.visualization.ColorFormat(o.options),l=0,u=o.ranges;l<u.length;l++){var c=u[l];s.addRange.apply(s,c)}s.format(e,o.column);break;case"DateFormat":(s=new r.visualization.DateFormat(o.options)).format(e,o.column);break;case"NumberFormat":(s=new r.visualization.NumberFormat(o.options)).format(e,o.column);break;case"PatternFormat":(s=new r.visualization.PatternFormat(o.options)).format(e,o.column)}}},t.getColumnID=function(e,t){return e.getColumnId(t)||e.getColumnLabel(t)},t.draw=function(e){var n=e.data,r=e.diffdata,a=e.rows,i=e.columns,o=e.options,s=e.legend_toggle,l=e.legendToggle,u=e.chartType,m=e.formatters,p=e.spreadSheetUrl,h=e.spreadSheetQueryParameters;return c(t,void 0,void 0,(function(){var e,t,c,f,_,g,b,v,w,M,k,L,Y,D;return d(this,(function(d){switch(d.label){case 0:return e=this.props,t=e.google,c=e.googleChartWrapper,_=null,null!==r&&(g=t.visualization.arrayToDataTable(r.old),b=t.visualization.arrayToDataTable(r.new),_=t.visualization[u].prototype.computeDiff(g,b)),null===n?[3,1]:(f=Array.isArray(n)?t.visualization.arrayToDataTable(n):new t.visualization.DataTable(n),[3,5]);case 1:return null===a||null===i?[3,2]:(f=t.visualization.arrayToDataTable([i].concat(a)),[3,5]);case 2:return null===p?[3,4]:[4,y(t,p,h)];case 3:return f=d.sent(),[3,5];case 4:f=t.visualization.arrayToDataTable([]),d.label=5;case 5:for(v=f.getNumberOfColumns(),w=0;w<v;w+=1)M=this.getColumnID(f,w),this.state.hiddenColumns.includes(M)&&(k=f.getColumnLabel(w),L=f.getColumnId(w),Y=f.getColumnType(w),f.removeColumn(w),f.addColumn({label:k,id:L,type:Y}));return D=c.getChart(),"Timeline"===c.getChartType()&&D&&D.clearChart(),c.setChartType(u),c.setOptions(o),c.setDataTable(f),c.draw(),null!==this.props.googleChartDashboard&&this.props.googleChartDashboard.draw(f),null!==_&&(c.setDataTable(_),c.draw()),null!==m&&(this.applyFormatters(f,m),c.setDataTable(f),c.draw()),!0!==l&&!0!==s||this.grayOutHiddenColumns({options:o}),[2]}}))}))},t.grayOutHiddenColumns=function(e){var n=e.options,r=t.props.googleChartWrapper,a=r.getDataTable();if(null!==a){var i=a.getNumberOfColumns();if(!1!==t.state.hiddenColumns.length>0){var o=Array.from({length:i-1}).map((function(e,r){var i=t.getColumnID(a,r+1);return t.state.hiddenColumns.includes(i)?k:void 0!==n.colors&&null!==n.colors?n.colors[r]:_[r]}));r.setOptions(u({},n,{colors:o})),r.draw()}}},t.onResize=function(){t.props.googleChartWrapper.draw()},t}return l(t,e),t.prototype.componentDidMount=function(){this.draw(this.props),window.addEventListener("resize",this.onResize),(this.props.legend_toggle||this.props.legendToggle)&&this.listenToLegendToggle()},t.prototype.componentWillUnmount=function(){var e=this.props,t=e.google,n=e.googleChartWrapper;window.removeEventListener("resize",this.onResize),t.visualization.events.removeAllListeners(n),"Timeline"===n.getChartType()&&n.getChart()&&n.getChart().clearChart()},t.prototype.componentDidUpdate=function(){this.draw(this.props)},t.prototype.render=function(){return null},t}(r.Component),Y=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l(t,e),t.prototype.componentDidMount=function(){},t.prototype.componentWillUnmount=function(){},t.prototype.shouldComponentUpdate=function(){return!1},t.prototype.render=function(){var e=this.props,t=e.google,n=e.googleChartWrapper,a=e.googleChartDashboard;return Object(r.createElement)(M,{render:function(e){return Object(r.createElement)(L,u({},e,{google:t,googleChartWrapper:n,googleChartDashboard:a}))}})},t}(r.Component),D=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l(t,e),t.prototype.shouldComponentUpdate=function(){return!1},t.prototype.listenToEvents=function(e){var t=this,n=e.chartEvents,r=e.google,a=e.googleChartWrapper;if(null!==n){r.visualization.events.removeAllListeners(a);for(var i=function(e){var n=e.eventName,i=e.callback;r.visualization.events.addListener(a,n,(function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];i({chartWrapper:a,props:t.props,google:r,eventArgs:e})}))},o=0,s=n;o<s.length;o++){i(s[o])}}},t.prototype.render=function(){var e=this,t=this.props,n=t.google,a=t.googleChartWrapper;return Object(r.createElement)(M,{render:function(t){return e.listenToEvents({chartEvents:t.chartEvents||null,google:n,googleChartWrapper:a}),null}})},t}(r.Component),T=0,S=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={googleChartWrapper:null,googleChartDashboard:null,googleChartControls:null,googleChartEditor:null,isReady:!1},t.graphID=null,t.dashboard_ref=Object(r.createRef)(),t.toolbar_ref=Object(r.createRef)(),t.getGraphID=function(){var e,n=t.props,r=n.graphID,a=n.graph_id;return e=null===r&&null===a?null===t.graphID?f():t.graphID:null!==r&&null===a?r:null!==a&&null===r?a:r,t.graphID=e,t.graphID},t.getControlID=function(e,t){return T+=1,void 0===e?"googlechart-control-"+t+"-"+T:e},t.addControls=function(e,n){var r=t.props,a=r.google,i=r.controls,o=null===i?null:i.map((function(e,n){var r=e.controlID,i=e.controlType,o=e.options,s=e.controlWrapperParams,l=t.getControlID(r,n);return{controlProp:e,control:new a.visualization.ControlWrapper(u({containerId:l,controlType:i,options:o},s))}}));if(null===o)return null;n.bind(o.map((function(e){return e.control})),e);for(var s=function(n){for(var r=n.control,i=n.controlProp.controlEvents,o=function(n){var i=n.callback,o=n.eventName;a.visualization.events.removeListener(r,o,i),a.visualization.events.addListener(r,o,(function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];i({chartWrapper:e,controlWrapper:r,props:t.props,google:a,eventArgs:n})}))},s=0,l=void 0===i?[]:i;s<l.length;s++){o(l[s])}},l=0,c=o;l<c.length;l++){s(c[l])}return o},t.renderChart=function(){var e=t.props,n=e.width,a=e.height,i=e.options,o=e.style,s=e.className,l=e.rootProps,c=e.google,d=u({height:a||i&&i.height,width:n||i&&i.width},o);return Object(r.createElement)("div",u({id:t.getGraphID(),style:d,className:s},l),t.state.isReady&&null!==t.state.googleChartWrapper?Object(r.createElement)(r.Fragment,null,Object(r.createElement)(Y,{googleChartWrapper:t.state.googleChartWrapper,google:c,googleChartDashboard:t.state.googleChartDashboard}),Object(r.createElement)(D,{googleChartWrapper:t.state.googleChartWrapper,google:c})):null)},t.renderControl=function(e){return void 0===e&&(e=function(e){e.control,e.controlProp;return!0}),t.state.isReady&&null!==t.state.googleChartControls?Object(r.createElement)(r.Fragment,null,t.state.googleChartControls.filter((function(t){var n=t.controlProp,r=t.control;return e({control:r,controlProp:n})})).map((function(e){var t=e.control;e.controlProp;return Object(r.createElement)("div",{key:t.getContainerId(),id:t.getContainerId()})}))):null},t.renderToolBar=function(){return null===t.props.toolbarItems?null:Object(r.createElement)("div",{ref:t.toolbar_ref})},t}return l(t,e),t.prototype.componentDidMount=function(){var e=this.props,t=e.options,n=e.google,r=e.chartType,a=e.chartWrapperParams,i=e.toolbarItems,o=e.getChartEditor,s=e.getChartWrapper,l=u({chartType:r,options:t,containerId:this.getGraphID()},a),c=new n.visualization.ChartWrapper(l);c.setOptions(t),s(c,n);var d=new n.visualization.Dashboard(this.dashboard_ref),m=this.addControls(c,d);null!==i&&n.visualization.drawToolbar(this.toolbar_ref.current,i);var p=null;null!==o&&o({chartEditor:p=new n.visualization.ChartEditor,chartWrapper:c,google:n}),this.setState({googleChartEditor:p,googleChartControls:m,googleChartDashboard:d,googleChartWrapper:c,isReady:!0})},t.prototype.componentDidUpdate=function(){if(null!==this.state.googleChartWrapper&&null!==this.state.googleChartDashboard&&null!==this.state.googleChartControls)for(var e=this.props.controls,t=0;t<e.length;t+=1){var n=e[t],r=n.controlType,a=n.options,i=n.controlWrapperParams;i&&"state"in i&&this.state.googleChartControls[t].control.setState(i.state),this.state.googleChartControls[t].control.setOptions(a),this.state.googleChartControls[t].control.setControlType(r)}},t.prototype.shouldComponentUpdate=function(e,t){return this.state.isReady!==t.isReady||e.controls!==this.props.controls},t.prototype.render=function(){var e=this.props,t=e.width,n=e.height,a=e.options,i=e.style,o=u({height:n||a&&a.height,width:t||a&&a.width},i);return null!==this.props.render?Object(r.createElement)("div",{ref:this.dashboard_ref,style:o},Object(r.createElement)("div",{ref:this.toolbar_ref,id:"toolbar"}),this.props.render({renderChart:this.renderChart,renderControl:this.renderControl,renderToolbar:this.renderToolBar})):Object(r.createElement)("div",{ref:this.dashboard_ref,style:o},this.renderControl((function(e){return"bottom"!==e.controlProp.controlPosition})),this.renderChart(),this.renderControl((function(e){return"bottom"===e.controlProp.controlPosition})),this.renderToolBar())},t}(r.Component),O=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._isMounted=!1,t.state={loadingStatus:"loading",google:null},t.onLoad=function(e){if(t.isFullyLoaded(e))t.onSuccess(e);else var n=setInterval((function(){var e=window.google;t._isMounted?e&&t.isFullyLoaded(e)&&(clearInterval(n),t.onSuccess(e)):clearInterval(n)}),1e3)},t.onSuccess=function(e){t.setState({loadingStatus:"ready",google:e})},t.onError=function(){t.setState({loadingStatus:"errored"})},t}return l(t,e),t.prototype.render=function(){var e=this.props,t=e.chartLanguage,n=e.chartPackages,a=e.chartVersion,i=e.mapsApiKey,o=e.loader,s=e.errorElement;return Object(r.createElement)(w,{value:this.props},"ready"===this.state.loadingStatus&&null!==this.state.google?Object(r.createElement)(S,u({},this.props,{google:this.state.google})):"errored"===this.state.loadingStatus&&s?s:o,Object(r.createElement)(p,u({},{chartLanguage:t,chartPackages:n,chartVersion:a,mapsApiKey:i},{onLoad:this.onLoad,onError:this.onError})))},t.prototype.componentDidMount=function(){this._isMounted=!0},t.prototype.componentWillUnmount=function(){this._isMounted=!1},t.prototype.isFullyLoaded=function(e){var t=this.props,n=t.controls,r=t.toolbarItems,a=t.getChartEditor;return e&&e.visualization&&e.visualization.ChartWrapper&&e.visualization.Dashboard&&(!n||e.visualization.ChartWrapper)&&(!a||e.visualization.ChartEditor)&&(!r||e.visualization.drawToolbar)},t.defaultProps=m,t}(r.Component),j=n(130),x=n.n(j);function E(e){return(E="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function C(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function P(e){return(P=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function H(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function z(e,t){return(z=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var A=wp.element,N=A.Component,F=A.Fragment,R=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t){return!t||"object"!==E(t)&&"function"!=typeof t?H(e):t}(this,P(t).apply(this,arguments))).initDataTable=e.initDataTable.bind(H(e)),e.dataRenderer=e.dataRenderer.bind(H(e)),e.table,e.uniqueId=x()(),e}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&z(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:function(){this.initDataTable(this.props.columns,this.props.rows)}},{key:"componentWillUnmount",value:function(){this.table.destroy()}},{key:"componentDidUpdate",value:function(e){this.props!==e&&(this.props.options.responsive_bool!==e.options.responsive_bool&&"true"===e.options.responsive_bool&&document.getElementById("dataTable-instances-".concat(this.props.id,"-").concat(this.uniqueId)).classList.remove("collapsed"),this.table.destroy(),document.getElementById("dataTable-instances-".concat(this.props.id,"-").concat(this.uniqueId)).innerHTML="",this.initDataTable(this.props.columns,this.props.rows))}},{key:"initDataTable",value:function(e,t){var n=this,r=this.props.options,a=e.map((function(e,t){var r=e.type;switch(e.type){case"number":r="num";break;case"date":case"datetime":case"timeofday":r="date"}return{title:e.label,data:e.label,type:r,render:n.dataRenderer(r,t)}})),i=t.map((function(e){var t={};return a.forEach((function(n,r){var a=e[r];void 0===a&&(a=e[n.data]),t[n.data]=a})),t}));this.table=jQuery("#dataTable-instances-".concat(this.props.id,"-").concat(this.uniqueId)).DataTable({destroy:!0,data:i,columns:a,paging:"true"===r.paging_bool,pageLength:r.pageLength_int||10,pagingType:r.pagingType,ordering:"false"!==r.ordering_bool,fixedHeader:"true"===r.fixedHeader_bool,scrollCollapse:!(!this.props.chartsScreen&&"true"!==r.scrollCollapse_bool),scrollY:(this.props.chartsScreen?180:"true"===r.scrollCollapse_bool&&Number(r.scrollY_int))||!1,responsive:!(!this.props.chartsScreen&&"true"!==r.responsive_bool),searching:!1,select:!1,lengthChange:!1,bFilter:!1,bInfo:!1})}},{key:"dataRenderer",value:function(e,t){var n,r=this.props.options,a=null;if(void 0===r.series||void 0===r.series[t]||void 0===r.series[t].format)return a;switch(e){case"date":case"datetime":case"timeofday":a=r.series[t].format&&r.series[t].format.from&&r.series[t].format.to?jQuery.fn.dataTable.render.moment(r.series[t].format.from,r.series[t].format.to):jQuery.fn.dataTable.render.moment("MM-DD-YYYY");break;case"num":var i=["","","","",""];r.series[t].format.thousands&&(i[0]=r.series[t].format.thousands),r.series[t].format.decimal&&(i[1]=r.series[t].format.decimal),r.series[t].format.precision&&0<parseInt(r.series[t].format.precision)&&(i[2]=r.series[t].format.precision),r.series[t].format.prefix&&(i[3]=r.series[t].format.prefix),r.series[t].format.suffix&&(i[4]=r.series[t].format.suffix),a=(n=jQuery.fn.dataTable.render).number.apply(n,i);break;case"boolean":jQuery.fn.dataTable.render.extra=function(e,n,a){return!0!==e&&"true"!==e||""===r.series[t].format.truthy?!1!==e&&"false"!==e||""===r.series[t].format.falsy?e:r.series[t].format.falsy.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,""):r.series[t].format.truthy.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,"")},a=jQuery.fn.dataTable.render.extra}return a}},{key:"render",value:function(){var e=this.props.options;return wp.element.createElement(F,null,e.customcss&&wp.element.createElement("style",null,e.customcss.oddTableRow&&"#dataTable-instances-".concat(this.props.id,"-").concat(this.uniqueId," tr.odd {\n\t\t\t\t\t\t\t\t").concat(e.customcss.oddTableRow.color?"color: ".concat(e.customcss.oddTableRow.color," !important;"):"","\n\t\t\t\t\t\t\t\t").concat(e.customcss.oddTableRow["background-color"]?"background-color: ".concat(e.customcss.oddTableRow["background-color"]," !important;"):"","\n\t\t\t\t\t\t\t\t").concat(e.customcss.oddTableRow.transform?"transform: rotate( ".concat(e.customcss.oddTableRow.transform,"deg ) !important;"):"","\n\t\t\t\t\t\t\t}"),e.customcss.evenTableRow&&"#dataTable-instances-".concat(this.props.id,"-").concat(this.uniqueId," tr.even {\n\t\t\t\t\t\t\t\t").concat(e.customcss.evenTableRow.color?"color: ".concat(e.customcss.evenTableRow.color," !important;"):"","\n\t\t\t\t\t\t\t\t").concat(e.customcss.evenTableRow["background-color"]?"background-color: ".concat(e.customcss.evenTableRow["background-color"]," !important;"):"","\n\t\t\t\t\t\t\t\t").concat(e.customcss.evenTableRow.transform?"transform: rotate( ".concat(e.customcss.evenTableRow.transform,"deg ) !important;"):"","\n\t\t\t\t\t\t\t}"),e.customcss.tableCell&&"#dataTable-instances-".concat(this.props.id,"-").concat(this.uniqueId," tr td,\n\t\t\t\t\t\t\t#dataTable-instances-").concat(this.props.id,"-").concat(this.uniqueId,"_wrapper tr th {\n\t\t\t\t\t\t\t\t").concat(e.customcss.tableCell.color?"color: ".concat(e.customcss.tableCell.color," !important;"):"","\n\t\t\t\t\t\t\t\t").concat(e.customcss.tableCell["background-color"]?"background-color: ".concat(e.customcss.tableCell["background-color"]," !important;"):"","\n\t\t\t\t\t\t\t\t").concat(e.customcss.tableCell.transform?"transform: rotate( ".concat(e.customcss.tableCell.transform,"deg ) !important;"):"","\n\t\t\t\t\t\t\t}")),wp.element.createElement("table",{id:"dataTable-instances-".concat(this.props.id,"-").concat(this.uniqueId)}))}}])&&C(n.prototype,r),a&&C(n,a),t}(N),W=n(4),I=n.n(W),B=n(131),J=n.n(B),U=function(e){return Object.keys(e["visualizer-series"]).map((function(t){void 0!==e["visualizer-series"][t].type&&"date"===e["visualizer-series"][t].type&&Object.keys(e["visualizer-data"]).map((function(n){return e["visualizer-data"][n][t]=new Date(e["visualizer-data"][n][t])}))})),e},q=function(e){var t;if(Array.isArray(e))return 0<e.length;if(I()(e)){for(t in e)return!0;return!1}return"string"==typeof e?0<e.length:null!=e},V=function(e){return J()(e,q)},G=function(e){return e.width="",e.height="",e.backgroundColor={},e.chartArea={},V(e)},$=function(e){try{JSON.parse(e)}catch(e){return!1}return!0},K=function(e,t){return!0===e[t]||"true"===e[t]||"1"===e[t]||1===e[t]};function Z(e){return(Z="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 Q(e,t,n,r,a,i,o){try{var s=e[i](o),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,a)}function X(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var i=e.apply(t,n);function o(e){Q(i,r,a,o,s,"next",e)}function s(e){Q(i,r,a,o,s,"throw",e)}o(void 0)}))}}function ee(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function te(e){return(te=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ne(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function re(e,t){return(re=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var ae=lodash.startCase,ie=wp.i18n.__,oe=wp.apiFetch,se=wp.element,le=se.Component,ue=se.Fragment,ce=wp.components,de=ce.Button,me=ce.Dashicon,pe=ce.ExternalLink,he=ce.Notice,fe=ce.Placeholder,_e=ce.Spinner,ye=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t){return!t||"object"!==Z(t)&&"function"!=typeof t?ne(e):t}(this,te(t).apply(this,arguments))).loadMoreCharts=e.loadMoreCharts.bind(ne(e)),e.state={charts:null,isBusy:!1,chartsLoaded:!1,perPage:visualizerLocalize.chartsPerPage},e}var n,r,a,i,o;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&re(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:(o=X(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,oe({path:"wp/v2/visualizer/?per_page="+t+"&meta_key=visualizer-chart-library&meta_value=ChartJS"});case 3:n=e.sent,this.setState({charts:n});case 5:case"end":return e.stop()}}),e,this)}))),function(){return o.apply(this,arguments)})},{key:"loadMoreCharts",value:(i=X(regeneratorRuntime.mark((function e(){var t,n,r,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.state.charts.length,n=this.state.chartsLoaded,r=this.state.perPage,this.setState({isBusy:!0}),e.next=6,oe({path:"wp/v2/visualizer/?per_page=".concat(r,"&meta_key=visualizer-chart-library&meta_value=ChartJS&offset=").concat(t)});case 6:a=e.sent,r>a.length&&(n=!0),this.setState({charts:this.state.charts.concat(a),isBusy:!1,chartsLoaded:n});case 9:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"render",value:function(){var e=this,t=this.state,n=t.charts,r=t.isBusy,a=t.chartsLoaded,i=t.perPage;return wp.element.createElement("div",{className:"visualizer-settings__charts"},wp.element.createElement(he,{status:"warning",isDismissible:!1},ie("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(pe,{href:visualizerLocalize.adminPage},ie("Click here to visit Visualizer Charts Library."))),null!==n?1<=n.length?wp.element.createElement(ue,null,wp.element.createElement("div",{className:"visualizer-settings__charts-grid"},Object.keys(n).map((function(t){var r,a,i,o=U(n[t].chart_data);if(r=o["visualizer-settings"].title?o["visualizer-settings"].title:"#".concat(n[t].id),0<=["gauge","tabular","timeline"].indexOf(o["visualizer-chart-type"])?"DataTable"===o["visualizer-chart-library"]?a=o["visualizer-chart-type"]:("tabular"===(a=o["visualizer-chart-type"])&&(a="table"),a=ae(a)):a="".concat(ae(o["visualizer-chart-type"]),"Chart"),!o["visualizer-chart-library"]||"ChartJS"!==o["visualizer-chart-library"])return o["visualizer-data-exploded"]&&(i=ie("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",key:"chart-".concat(n[t].id)},wp.element.createElement("div",{className:"visualizer-settings__charts-title"},r),"DataTable"===o["visualizer-chart-library"]?wp.element.createElement(R,{id:n[t].id,rows:o["visualizer-data"],columns:o["visualizer-series"],chartsScreen:!0,options:o["visualizer-settings"]}):(o["visualizer-data-exploded"],wp.element.createElement(O,{chartType:a,rows:o["visualizer-data"],columns:o["visualizer-series"],options:G(o["visualizer-settings"])})),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:ie("Insert Chart"),onClick:function(){return e.props.getChart(n[t].id)}},wp.element.createElement(me,{icon:"upload"})))}))),!a&&i-1<n.length&&wp.element.createElement(de,{isPrimary:!0,isLarge:!0,onClick:this.loadMoreCharts,isBusy:r},ie("Load More"))):wp.element.createElement("p",{className:"visualizer-no-charts"},ie("No charts found.")):wp.element.createElement(fe,null,wp.element.createElement(_e,null)))}}])&&ee(n.prototype,r),a&&ee(n,a),t}(le);function ge(e){return(ge="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 be(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ve(e){return(ve=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function we(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Me(e,t){return(Me=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var ke=wp.i18n.__,Le=wp.element.Component,Ye=wp.components,De=Ye.Button,Te=Ye.ExternalLink,Se=Ye.PanelBody,Oe=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t){return!t||"object"!==ge(t)&&"function"!=typeof t?we(e):t}(this,ve(t).apply(this,arguments))).uploadInput=React.createRef(),e.fileUploaded=e.fileUploaded.bind(we(e)),e.uploadImport=e.uploadImport.bind(we(e)),e.state={uploadLabel:ke("Upload")},e}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Me(e,t)}(t,e),n=t,(r=[{key:"fileUploaded",value:function(e){"text/csv"===e.target.files[0].type&&this.setState({uploadLabel:ke("Upload")})}},{key:"uploadImport",value:function(){this.props.readUploadedFile(this.uploadInput),this.setState({uploadLabel:ke("Uploaded")})}},{key:"render",value:function(){return wp.element.createElement(Se,{title:ke("Import data from file"),initialOpen:!1},wp.element.createElement("p",null,ke("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,ke("If you are unsure about how to format your data CSV then please take a look at this sample: "),wp.element.createElement(Te,{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(De,{isPrimary:!0,onClick:this.uploadImport},this.state.uploadLabel))}}])&&be(n.prototype,r),a&&be(n,a),t}(Le);function je(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function xe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?je(n,!0).forEach((function(t){Ee(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):je(n).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ee(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ce(e){return(Ce="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 Pe(e,t,n,r,a,i,o){try{var s=e[i](o),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,a)}function He(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var i=e.apply(t,n);function o(e){Pe(i,r,a,o,s,"next",e)}function s(e){Pe(i,r,a,o,s,"throw",e)}o(void 0)}))}}function ze(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Ae(e){return(Ae=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Ne(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Fe(e,t){return(Fe=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Re=wp.i18n.__,We=wp,Ie=(We.apiFetch,We.apiRequest),Be=wp.element.Component,Je=wp.components,Ue=Je.Button,qe=Je.ExternalLink,Ve=Je.IconButton,Ge=Je.Modal,$e=Je.PanelBody,Ke=Je.SelectControl,Ze=Je.TextControl,Qe=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t){return!t||"object"!==Ce(t)&&"function"!=typeof t?Ne(e):t}(this,Ae(t).apply(this,arguments))).openModal=e.openModal.bind(Ne(e)),e.initTable=e.initTable.bind(Ne(e)),e.onToggle=e.onToggle.bind(Ne(e)),e.toggleHeaders=e.toggleHeaders.bind(Ne(e)),e.getJSONRoot=e.getJSONRoot.bind(Ne(e)),e.getJSONData=e.getJSONData.bind(Ne(e)),e.getTableData=e.getTableData.bind(Ne(e)),e.state={isOpen:!1,isLoading:!1,isFirstStepOpen:!0,isSecondStepOpen:!1,isThirdStepOpen:!1,isFourthStepOpen:!1,isHeaderPanelOpen:!1,endpointRoots:[],endpointPaging:[],table:null,requestHeaders:{method:"GET",username:"",password:"",auth:""}},e}var n,r,a,i,o,s,l,u;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Fe(e,t)}(t,e),n=t,(r=[{key:"openModal",value:(u=He(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.setState({isOpen:!0});case 2:t=document.querySelector("#visualizer-json-query-table"),this.state.isFourthStepOpen&&null!==this.state.table&&(t.innerHTML=this.state.table,this.initTable());case 4:case"end":return e.stop()}}),e,this)}))),function(){return u.apply(this,arguments)})},{key:"initTable",value:function(){jQuery("#visualizer-json-query-table table").DataTable({paging:!1,searching:!1,ordering:!1,select:!1,scrollX:"600px",scrollY:"400px",info:!1,colReorder:{fixedColumnsLeft:1},dom:"Bt",buttons:[{extend:"colvis",columns:":gt(0)",collectionLayout:"four-column"}]})}},{key:"onToggle",value:(l=He(regeneratorRuntime.mark((function e(t){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null===this.state.table&&this.state.endpointRoots&&0<this.state.endpointRoots.length&&("isFirstStepOpen"===t||"isSecondStepOpen"===t)&&this.setState({isFirstStepOpen:"isFirstStepOpen"===t,isSecondStepOpen:"isSecondStepOpen"===t,isThirdStepOpen:!1,isFourthStepOpen:!1}),null===this.state.table){e.next=5;break}return e.next=4,this.setState({isFirstStepOpen:"isFirstStepOpen"===t,isSecondStepOpen:"isSecondStepOpen"===t,isThirdStepOpen:"isThirdStepOpen"===t,isFourthStepOpen:"isFourthStepOpen"===t});case 4:"isFourthStepOpen"===t&&(n=document.querySelector("#visualizer-json-query-table"),this.state.isFourthStepOpen&&(n.innerHTML=this.state.table,this.initTable()));case 5:case"end":return e.stop()}}),e,this)}))),function(e){return l.apply(this,arguments)})},{key:"toggleHeaders",value:function(){this.setState({isHeaderPanelOpen:!this.state.isHeaderPanelOpen})}},{key:"getJSONRoot",value:(s=He(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,Ie({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"===Ce(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"===Ce(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"!==Ce(this.props.chart["visualizer-json-headers"].auth)?this.props.chart["visualizer-json-headers"].auth:this.state.requestHeaders.auth},method:"GET"});case 3:(t=e.sent).success?(n=Object.keys(t.data.roots).map((function(e){return{label:t.data.roots[e].replace(/>/g," ➤ "),value:t.data.roots[e]}})),this.setState({isLoading:!1,isFirstStepOpen:!1,isSecondStepOpen:!0,endpointRoots:n})):(this.setState({isLoading:!1}),alert(t.data.msg));case 5:case"end":return e.stop()}}),e,this)}))),function(){return s.apply(this,arguments)})},{key:"getJSONData",value:(o=He(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,Ie({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"===Ce(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"===Ce(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"!==Ce(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:Re("Don't use pagination"),value:0}],t.data.paging&&"root>next"===t.data.paging[0]&&n.push({label:Re("Get first 5 pages using root ➤ next"),value:"root>next"}),this.setState({isLoading:!1,isSecondStepOpen:!1,isFourthStepOpen:!0,endpointPaging:n,table:t.data.table}),document.querySelector("#visualizer-json-query-table").innerHTML=t.data.table,this.initTable()):(this.setState({isLoading:!1}),alert(t.data.msg));case 5:case"end":return e.stop()}}),e,this)}))),function(){return o.apply(this,arguments)})},{key:"getTableData",value:(i=He(regeneratorRuntime.mark((function e(){var t,n,r,a,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.setState({isLoading:!0}),t=document.querySelectorAll("#visualizer-json-query-table input"),n=document.querySelectorAll("#visualizer-json-query-table select"),r=[],a={},t.forEach((function(e){return r.push(e.value)})),n.forEach((function(e){return a[e.name]=e.value})),e.next=9,Ie({path:"/visualizer/v1/set-json-data",data:xe({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"===Ce(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"===Ce(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"!==Ce(this.props.chart["visualizer-json-headers"].auth)?this.props.chart["visualizer-json-headers"].auth:this.state.requestHeaders.auth,root:this.props.chart["visualizer-json-root"]||this.state.endpointRoots[0].value,paging:this.props.chart["visualizer-json-paging"]||0,header:r},a),method:"GET"});case 9:(i=e.sent).success?(this.props.JSONImportData(i.data.name,JSON.parse(i.data.series),JSON.parse(i.data.data)),this.setState({isOpen:!1,isLoading:!1})):(alert(i.data.msg),this.setState({isLoading:!1}));case 11:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"render",value:function(){var e=this;return wp.element.createElement($e,{title:Re("Import from JSON"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement("p",null,Re("You can choose here to import or synchronize your chart data with a remote JSON source.")),wp.element.createElement("p",null,wp.element.createElement(qe,{href:"https://docs.themeisle.com/article/1052-how-to-generate-charts-from-json-data-rest-endpoints"},Re("For more info check this tutorial."))),wp.element.createElement(Ke,{label:Re("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:Re("One-time"),value:"-1"},{label:Re("Live"),value:"0"},{label:Re("Each hour"),value:"1"},{label:Re("Each 12 hours"),value:"12"},{label:Re("Each day"),value:"24"},{label:Re("Each 3 days"),value:"72"}],onChange:this.props.editSchedule}),wp.element.createElement(Ue,{isPrimary:!0,isLarge:!0,onClick:this.openModal},Re("Modify Parameters")),this.state.isOpen&&wp.element.createElement(Ge,{title:Re("Import from JSON"),className:"visualizer-json-query-modal",shouldCloseOnClickOutside:!1,onRequestClose:function(){e.setState({isOpen:!1,isTableRendered:!1})}},wp.element.createElement($e,{title:Re("Step 1: Specify the JSON endpoint/URL"),opened:this.state.isFirstStepOpen,onToggle:function(){return e.onToggle("isFirstStepOpen")}},wp.element.createElement("p",null,Re("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(qe,{href:"https://docs.themeisle.com/article/1043-visualizer-how-to-extend-rest-endpoints-with-json-response"},Re("How to extend REST endpoints with JSON response"))),wp.element.createElement(Ze,{placeholder:Re("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(Ve,{icon:"arrow-right-alt2",label:Re("Add Headers"),onClick:this.toggleHeaders},Re("Add Headers")),this.state.isHeaderPanelOpen&&wp.element.createElement("div",{className:"visualizer-json-query-modal-headers-panel"},wp.element.createElement(Ke,{label:Re("Request Type"),value:this.props.chart["visualizer-json-headers"]?this.props.chart["visualizer-json-headers"].method:this.state.requestHeaders.method,options:[{value:"GET",label:Re("GET")},{value:"POST",label:Re("POST")}],onChange:function(t){var n=xe({},e.state.requestHeaders),r=e.state.requestHeaders;n.method=t,r=xe({},r,{method:t}),e.setState({requestHeaders:r}),e.props.editJSONHeaders(n)}}),wp.element.createElement("p",null,Re("Credentials")),wp.element.createElement(Ze,{label:Re("Username"),placeholder:Re("Username/Access Key"),value:this.props.chart["visualizer-json-headers"]&&"object"===Ce(this.props.chart["visualizer-json-headers"].auth)?this.props.chart["visualizer-json-headers"].auth.username:this.state.requestHeaders.username,onChange:function(t){var n=xe({},e.state.requestHeaders),r=e.state.requestHeaders;n.auth={username:t,password:e.props.chart["visualizer-json-headers"]&&"object"===Ce(e.props.chart["visualizer-json-headers"].auth)?e.props.chart["visualizer-json-headers"].auth.password:e.state.requestHeaders.password},r=xe({},r,{username:t,password:n.password}),e.setState({requestHeaders:r}),e.props.editJSONHeaders(n)}}),wp.element.createElement("span",{className:"visualizer-json-query-modal-field-separator"},Re("&")),wp.element.createElement(Ze,{label:Re("Password"),placeholder:Re("Password/Secret Key"),type:"password",value:this.props.chart["visualizer-json-headers"]&&"object"===Ce(this.props.chart["visualizer-json-headers"].auth)?this.props.chart["visualizer-json-headers"].auth.password:this.state.requestHeaders.password,onChange:function(t){var n=xe({},e.state.requestHeaders),r=e.state.requestHeaders;n.auth={username:e.props.chart["visualizer-json-headers"]&&"object"===Ce(e.props.chart["visualizer-json-headers"].auth)?e.props.chart["visualizer-json-headers"].auth.username:e.state.requestHeaders.username,password:t},r=xe({},r,{username:n.username,password:t}),e.setState({requestHeaders:r}),e.props.editJSONHeaders(n)}}),wp.element.createElement("p",null,Re("OR")),wp.element.createElement(Ze,{label:Re("Authorization"),placeholder:Re("e.g. SharedKey <AccountName>:<Signature>"),value:this.props.chart["visualizer-json-headers"]&&"object"!==Ce(this.props.chart["visualizer-json-headers"].auth)?this.props.chart["visualizer-json-headers"].auth:this.state.requestHeaders.auth,onChange:function(t){var n=xe({},e.state.requestHeaders),r=e.state.requestHeaders;n.auth=t,r=xe({},r,{auth:t}),e.setState({requestHeaders:r}),e.props.editJSONHeaders(n)}})),wp.element.createElement(Ue,{isPrimary:!0,isLarge:!0,isBusy:this.state.isLoading,disabled:this.state.isLoading,onClick:this.getJSONRoot},Re("Fetch Endpoint"))),wp.element.createElement($e,{title:Re("Step 2: Choose the JSON root"),initialOpen:!1,opened:this.state.isSecondStepOpen,onToggle:function(){return e.onToggle("isSecondStepOpen")}},wp.element.createElement("p",null,Re("If you see Invalid Data, you may have selected the wrong root to fetch data from. Please select an alternative.")),wp.element.createElement(Ke,{value:this.props.chart["visualizer-json-root"],options:this.state.endpointRoots,onChange:this.props.editJSONRoot}),wp.element.createElement(Ue,{isPrimary:!0,isLarge:!0,isBusy:this.state.isLoading,disabled:this.state.isLoading,onClick:this.getJSONData},Re("Parse Endpoint"))),wp.element.createElement($e,{title:Re("Step 3: Specify miscellaneous parameters"),initialOpen:!1,opened:this.state.isThirdStepOpen,onToggle:function(){return e.onToggle("isThirdStepOpen")}},"community"!==visualizerLocalize.isPro?wp.element.createElement(Ke,{value:this.props.chart["visualizer-json-paging"]||0,options:this.state.endpointPaging,onChange:this.props.editJSONPaging}):wp.element.createElement("p",null,Re("Enable this feature in PRO version!"))),wp.element.createElement($e,{title:Re("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,Re("Select whether to include the data in the chart. Each column selected will form one series.")),wp.element.createElement("li",null,Re("If a column is selected to be included, specify its data type.")),wp.element.createElement("li",null,Re("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,Re("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(Ue,{isPrimary:!0,isLarge:!0,isBusy:this.state.isLoading,disabled:this.state.isLoading,onClick:this.getTableData},Re("Save & Show Chart")))))}}])&&ze(n.prototype,r),a&&ze(n,a),t}(Be);function Xe(e){return(Xe="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 et(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function tt(e,t){return!t||"object"!==Xe(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function nt(e){return(nt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function rt(e,t){return(rt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var at=wp.i18n.__,it=wp.element.Component,ot=wp.components,st=ot.Button,lt=ot.ExternalLink,ut=ot.PanelBody,ct=ot.SelectControl,dt=ot.TextControl,mt=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),tt(this,nt(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&rt(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this;return wp.element.createElement(ut,{title:at("Import data from URL"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(ut,{title:at("One Time Import"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement("p",null,at("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,at("If you are unsure about how to format your data CSV then please take a look at this sample: "),wp.element.createElement(lt,{href:"".concat(visualizerLocalize.absurl,"samples/").concat(this.props.chart["visualizer-chart-type"],".csv")},"".concat(this.props.chart["visualizer-chart-type"],".csv"))),wp.element.createElement("p",null,at("You can also import data from Google Spreadsheet.")),wp.element.createElement(dt,{placeholder:at("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(st,{isPrimary:!0,isLarge:!0,isBusy:"uploadData"===this.props.isLoading,disabled:"uploadData"===this.props.isLoading,onClick:function(){return e.props.uploadData(!1)}},at("Import Data"))),"business"===visualizerLocalize.isPro?wp.element.createElement(ut,{title:at("Schedule Import"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement("p",null,at("You can choose here to synchronize your chart data with a remote CSV file. ")),wp.element.createElement("p",null,at("You can also synchronize with your Google Spreadsheet file.")),wp.element.createElement("p",null,at("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(dt,{placeholder:at("Please enter the URL of your CSV file"),value:this.props.chart["visualizer-chart-url"]?this.props.chart["visualizer-chart-url"]:"",onChange:this.props.editURL}),wp.element.createElement(ct,{label:at("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:at("Each hour"),value:"1"},{label:at("Each 12 hours"),value:"12"},{label:at("Each day"),value:"24"},{label:at("Each 3 days"),value:"72"}],onChange:this.props.editSchedule}),wp.element.createElement(st,{isPrimary:!0,isLarge:!0,isBusy:"uploadData"===this.props.isLoading,disabled:"uploadData"===this.props.isLoading,onClick:function(){return e.props.uploadData(!0)}},at("Save Schedule"))):wp.element.createElement(ut,{title:at("Schedule Import"),icon:"lock",className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement("p",null,at("Upgrade your license to at least the DEVELOPER version to activate this feature!")),wp.element.createElement(st,{isPrimary:!0,href:visualizerLocalize.proTeaser,target:"_blank"},at("Buy Now"))),wp.element.createElement(Qe,{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}))}}])&&et(n.prototype,r),a&&et(n,a),t}(it);function pt(e){return(pt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ht(e,t,n,r,a,i,o){try{var s=e[i](o),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,a)}function ft(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function _t(e,t){return!t||"object"!==pt(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function yt(e){return(yt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function gt(e,t){return(gt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var bt=wp.i18n.__,vt=wp.apiFetch,wt=wp.element,Mt=wt.Component,kt=wt.Fragment,Lt=wp.components,Yt=Lt.Button,Dt=Lt.PanelBody,Tt=Lt.Placeholder,St=Lt.SelectControl,Ot=Lt.Spinner,jt=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=_t(this,yt(t).apply(this,arguments))).state={id:"",charts:[]},e}var n,r,a,i,o;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&gt(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:(i=regeneratorRuntime.mark((function e(){var t,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,vt({path:"wp/v2/visualizer/?per_page=100"});case 2:t=(t=e.sent).map((function(e,t){var r=e.chart_data["visualizer-settings"].title?e.chart_data["visualizer-settings"].title:"#".concat(e.id);return 0===t&&(n=e.id),{value:e.id,label:r}})),this.setState({id:n,charts:t});case 5:case"end":return e.stop()}}),e,this)})),o=function(){var e=this,t=arguments;return new Promise((function(n,r){var a=i.apply(e,t);function o(e){ht(a,n,r,o,s,"next",e)}function s(e){ht(a,n,r,o,s,"throw",e)}o(void 0)}))},function(){return o.apply(this,arguments)})},{key:"render",value:function(){var e=this;return"community"!==visualizerLocalize.isPro?wp.element.createElement(Dt,{title:bt("Import from other chart"),initialOpen:!1},1<=this.state.charts.length?wp.element.createElement(kt,null,wp.element.createElement(St,{label:bt("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(Yt,{isPrimary:!0,isLarge:!0,isBusy:"getChartData"===this.props.isLoading,onClick:function(){return e.props.getChartData(e.state.id)}},bt("Import Chart"))):wp.element.createElement(Tt,null,wp.element.createElement(Ot,null))):wp.element.createElement(Dt,{title:bt("Import from other chart"),icon:"lock",initialOpen:!1},wp.element.createElement("p",null,bt("Enable this feature in PRO version!")),wp.element.createElement(Yt,{isPrimary:!0,href:visualizerLocalize.proTeaser,target:"_blank"},bt("Buy Now")))}}])&&ft(n.prototype,r),a&&ft(n,a),t}(Mt);function xt(e){return(xt="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 Et(e,t,n,r,a,i,o){try{var s=e[i](o),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,a)}function Ct(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Pt(e){return(Pt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Ht(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function zt(e,t){return(zt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var At=wp.i18n.__,Nt=wp.apiRequest,Ft=wp.components,Rt=Ft.Button,Wt=Ft.ExternalLink,It=wp.element,Bt=It.Component,Jt=It.Fragment,Ut=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t){return!t||"object"!==xt(t)&&"function"!=typeof t?Ht(e):t}(this,Pt(t).apply(this,arguments))).onSave=e.onSave.bind(Ht(e)),e.state={isLoading:!1,success:!1,query:"",name:"",series:{},data:[]},e}var n,r,a,i,o;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&zt(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:function(){var e=wp.CodeMirror||CodeMirror,t=document.querySelector(".visualizer-db-query"),n=e.fromTextArea(t,{autofocus:!0,mode:"text/x-mysql",lineWrapping:!0,dragDrop:!1,matchBrackets:!0,autoCloseBrackets:!0,extraKeys:{"Ctrl-Space":"autocomplete"},hintOptions:{tables:visualizerLocalize.sqlTable}});n.on("inputRead",(function(){n.save()}))}},{key:"onSave",value:(i=regeneratorRuntime.mark((function e(){var t,n,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=document.querySelector(".visualizer-db-query").value,(n=document.querySelector("#visualizer-db-query-table")).innerHTML="",e.next=5,this.setState({isLoading:!0});case 5:return e.next=7,Nt({path:"/visualizer/v1/get-query-data",data:{query:t},method:"GET"});case 7:return r=e.sent,e.next=10,this.setState({isLoading:!1,success:r.success,query:t,name:r.data.name||"",series:r.data.series||{},data:r.data.data||[]});case 10:n.innerHTML=r.data.table||r.data.msg,this.state.success&&jQuery("#results").DataTable({paging:!1});case 12:case"end":return e.stop()}}),e,this)})),o=function(){var e=this,t=arguments;return new Promise((function(n,r){var a=i.apply(e,t);function o(e){Et(a,n,r,o,s,"next",e)}function s(e){Et(a,n,r,o,s,"throw",e)}o(void 0)}))},function(){return o.apply(this,arguments)})},{key:"render",value:function(){var e=this;return wp.element.createElement(Jt,null,wp.element.createElement("textarea",{className:"visualizer-db-query",placeholder:At("Your query goes here…")},this.props.chart["visualizer-db-query"]),wp.element.createElement("div",{className:"visualizer-db-query-actions"},wp.element.createElement(Rt,{isLarge:!0,isDefault:!0,isBusy:this.state.isLoading,onClick:this.onSave},At("Show Results")),wp.element.createElement(Rt,{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)}},At("Save"))),wp.element.createElement("ul",null,wp.element.createElement("li",null,wp.element.createElement(Wt,{href:"https://docs.themeisle.com/article/970-visualizer-sample-queries-to-generate-charts"},At("Examples of queries and links to resources that you can use with this feature."))),wp.element.createElement("li",null,At("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"}))}}])&&Ct(n.prototype,r),a&&Ct(n,a),t}(Bt);function qt(e){return(qt="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 Vt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Gt(e){return(Gt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function $t(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Kt(e,t){return(Kt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Zt=wp.i18n.__,Qt=wp.element.Component,Xt=wp.components,en=Xt.Button,tn=Xt.Modal,nn=Xt.PanelBody,rn=Xt.SelectControl,an=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t){return!t||"object"!==qt(t)&&"function"!=typeof t?$t(e):t}(this,Gt(t).apply(this,arguments))).save=e.save.bind($t(e)),e.state={isOpen:!1},e}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Kt(e,t)}(t,e),n=t,(r=[{key:"save",value:function(e,t,n,r){this.props.databaseImportData(e,t,n,r),this.setState({isOpen:!1})}},{key:"render",value:function(){var e=this;return"business"!==visualizerLocalize.isPro?wp.element.createElement(nn,{title:Zt("Import data from database"),icon:"lock",initialOpen:!1},wp.element.createElement("p",null,Zt("Upgrade your license to at least the DEVELOPER version to activate this feature!")),wp.element.createElement(en,{isPrimary:!0,href:visualizerLocalize.proTeaser,target:"_blank"},Zt("Buy Now"))):wp.element.createElement(nn,{title:Zt("Import data from database"),initialOpen:!1},wp.element.createElement("p",null,Zt("You can import data from the database here.")),wp.element.createElement("p",null,Zt("How often do you want to refresh the data from the database.")),wp.element.createElement(rn,{label:Zt("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:Zt("Live"),value:"0"},{label:Zt("Each hour"),value:"1"},{label:Zt("Each 12 hours"),value:"12"},{label:Zt("Each day"),value:"24"},{label:Zt("Each 3 days"),value:"72"}],onChange:this.props.editSchedule}),wp.element.createElement(en,{isPrimary:!0,isLarge:!0,onClick:function(){return e.setState({isOpen:!0})}},Zt("Create Query")),this.state.isOpen&&wp.element.createElement(tn,{title:Zt("Import from database"),onRequestClose:function(){return e.setState({isOpen:!1})},className:"visualizer-db-query-modal",shouldCloseOnClickOutside:!1},wp.element.createElement(Ut,{chart:this.props.chart,changeQuery:this.props.changeQuery,save:this.save})))}}])&&Vt(n.prototype,r),a&&Vt(n,a),t}(Qt),on=n(132);n(152);function sn(e){return(sn="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 ln(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function un(e,t){return!t||"object"!==sn(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function cn(e){return(cn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function dn(e,t){return(dn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var mn=wp.i18n.__,pn=wp.element.Component,hn=wp.components,fn=hn.Button,_n=hn.ButtonGroup,yn=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=un(this,cn(t).apply(this,arguments))).data=[],e.dates=[],e.types=["string","number","boolean","date","datetime","timeofday"],e}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&dn(e,t)}(t,e),n=t,(r=[{key:"componentWillMount",value:function(){var e=this;this.data[this.data.length]=[],this.data[this.data.length]=[],this.props.chart["visualizer-series"].map((function(t,n){e.data[0][n]=t.label,e.data[1][n]=t.type,"date"===t.type&&e.dates.push(n)})),this.props.chart["visualizer-data"].map((function(t){e.data[e.data.length]=t}))}},{key:"render",value:function(){var e=this;return wp.element.createElement("div",{className:"visualizer-chart-editor"},wp.element.createElement(on.HotTable,{data:this.data,allowInsertRow:!0,contextMenu:!0,rowHeaders:!0,colHeaders:!0,allowInvalid:!1,className:"htEditor",cells:function(t,n,r){var a;return 1===t&&(a={type:"autocomplete",source:e.types,strict:!1}),0<=e.dates.indexOf(n)&&1<t&&(a={type:"date",dateFormat:"YYYY-MM-DD",correctFormat:!0}),a}}),wp.element.createElement(_n,null,wp.element.createElement(fn,{isDefault:!0,isLarge:!0,onClick:this.props.toggleModal},mn("Close")),wp.element.createElement(fn,{isPrimary:!0,isLarge:!0,onClick:function(t){e.props.toggleModal(),e.props.editChartData(e.data,"Visualizer_Source_Csv")}},mn("Save"))))}}])&&ln(n.prototype,r),a&&ln(n,a),t}(pn);function gn(e){return(gn="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 bn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function vn(e){return(vn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function wn(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Mn(e,t){return(Mn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var kn=wp.i18n.__,Ln=wp.element,Yn=Ln.Component,Dn=Ln.Fragment,Tn=wp.components,Sn=Tn.Button,On=Tn.Modal,jn=Tn.PanelBody,xn=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t){return!t||"object"!==gn(t)&&"function"!=typeof t?wn(e):t}(this,vn(t).apply(this,arguments))).toggleModal=e.toggleModal.bind(wn(e)),e.state={isOpen:!1},e}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Mn(e,t)}(t,e),n=t,(r=[{key:"toggleModal",value:function(){this.setState({isOpen:!this.state.isOpen})}},{key:"render",value:function(){return"community"!==visualizerLocalize.isPro?wp.element.createElement(Dn,null,wp.element.createElement(jn,{title:kn("Manual Data"),initialOpen:!1},wp.element.createElement("p",null,kn("You can manually edit the chart data using a spreadsheet like editor.")),wp.element.createElement(Sn,{isPrimary:!0,isLarge:!0,isBusy:this.state.isOpen,onClick:this.toggleModal},kn("View Editor"))),this.state.isOpen&&wp.element.createElement(On,{title:"Chart Editor",onRequestClose:this.toggleModal,shouldCloseOnClickOutside:!1},wp.element.createElement(yn,{chart:this.props.chart,editChartData:this.props.editChartData,toggleModal:this.toggleModal}))):wp.element.createElement(jn,{title:kn("Manual Data"),icon:"lock",initialOpen:!1},wp.element.createElement("p",null,kn("Enable this feature in PRO version!")),wp.element.createElement(Sn,{isPrimary:!0,href:visualizerLocalize.proTeaser,target:"_blank"},kn("Buy Now")))}}])&&bn(n.prototype,r),a&&bn(n,a),t}(Yn);function En(e){return(En="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 Cn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Pn(e,t){return!t||"object"!==En(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Hn(e){return(Hn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function zn(e,t){return(zn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var An=wp.i18n.__,Nn=wp.element.Component,Fn=(wp.blockEditor||wp.editor).ColorPalette,Rn=wp.components,Wn=Rn.BaseControl,In=Rn.CheckboxControl,Bn=Rn.PanelBody,Jn=Rn.SelectControl,Un=Rn.TextControl,qn=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Pn(this,Hn(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&zn(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-chart-type"],n=this.props.chart["visualizer-settings"],r=[{label:An("The tooltip will be displayed when the user hovers over an element"),value:"focus"}];-1>=["timeline"].indexOf(t)&&(r[1]={label:An("The tooltip will be displayed when the user selects an element"),value:"selection"}),r[2]={label:An("The tooltip will not be displayed"),value:"none"};var a=[{label:An("Left of the chart"),value:"left"},{label:An("Right of the chart"),value:"right"},{label:An("Above the chart"),value:"top"},{label:An("Below the chart"),value:"bottom"},{label:An("Omit the legend"),value:"none"}];return"pie"!==t&&a.push({label:An("Inside the chart"),value:"in"}),wp.element.createElement(Bn,{title:An("General Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(Bn,{title:An("Title"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Un,{label:An("Chart Title"),help:An("Text to display above the chart."),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(Jn,{label:An("Chart Title Position"),help:An("Where to place the chart title, compared to the chart area."),value:n.titlePosition?n.titlePosition:"out",options:[{label:An("Inside the chart"),value:"in"},{label:An("Outside the chart"),value:"out"},{label:An("None"),value:"none"}],onChange:function(t){n.titlePosition=t,e.props.edit(n)}}),-1>=["tabular","dataTable","gauge","geo","timeline"].indexOf(t)&&wp.element.createElement(Wn,{label:An("Chart Title Color")},wp.element.createElement(Fn,{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(Jn,{label:An("Axes Titles Position"),help:An("Determines where to place the axis titles, compared to the chart area."),value:n.axisTitlesPosition?n.axisTitlesPosition:"out",options:[{label:An("Inside the chart"),value:"in"},{label:An("Outside the chart"),value:"out"},{label:An("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(Bn,{title:An("Font Styles"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Jn,{label:An("Font Family"),help:An("The default font family for all text in the chart."),value:n.fontName?n.fontName:"Arial",options:[{label:An("Arial"),value:"Arial"},{label:An("Sans Serif"),value:"Sans Serif"},{label:An("Serif"),value:"serif"},{label:An("Arial"),value:"Arial"},{label:An("Wide"),value:"Arial black"},{label:An("Narrow"),value:"Arial Narrow"},{label:An("Comic Sans MS"),value:"Comic Sans MS"},{label:An("Courier New"),value:"Courier New"},{label:An("Garamond"),value:"Garamond"},{label:An("Georgia"),value:"Georgia"},{label:An("Tahoma"),value:"Tahoma"},{label:An("Verdana"),value:"Verdana"}],onChange:function(t){n.fontName=t,e.props.edit(n)}}),wp.element.createElement(Jn,{label:An("Font Size"),help:An("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(Bn,{title:An("Legend"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Jn,{label:An("Position"),help:An("Determines where to place the legend, compared to the chart area."),value:n.legend.position?n.legend.position:"right",options:a,onChange:function(r){if("pie"!==t){var a="left"===r?1:0;Object.keys(n.series).map((function(e){n.series[e].targetAxisIndex=a}))}n.legend.position=r,e.props.edit(n)}}),wp.element.createElement(Jn,{label:An("Alignment"),help:An("Determines the alignment of the legend."),value:n.legend.alignment?n.legend.alignment:"15",options:[{label:An("Aligned to the start of the allocated area"),value:"start"},{label:An("Centered in the allocated area"),value:"center"},{label:An("Aligned to the end of the allocated area"),value:"end"}],onChange:function(t){n.legend.alignment=t,e.props.edit(n)}}),wp.element.createElement(Wn,{label:An("Font Color")},wp.element.createElement(Fn,{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(Bn,{title:An("Tooltip"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Jn,{label:An("Trigger"),help:An("Determines the user interaction that causes the tooltip to be displayed."),value:n.tooltip.trigger?n.tooltip.trigger:"focus",options:r,onChange:function(t){n.tooltip.trigger=t,e.props.edit(n)}}),wp.element.createElement(Jn,{label:An("Show Color Code"),help:An("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:An("Yes"),value:"1"},{label:An("No"),value:"0"}],onChange:function(t){n.tooltip.showColorCode=t,e.props.edit(n)}}),0<=["pie"].indexOf(t)&&wp.element.createElement(Jn,{label:An("Text"),help:An("Determines what information to display when the user hovers over a pie slice."),value:n.tooltip.text?n.tooltip.text:"both",options:[{label:An("Display both the absolute value of the slice and the percentage of the whole"),value:"both"},{label:An("Display only the absolute value of the slice"),value:"value"},{label:An("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(Bn,{title:An("Animation"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(In,{label:An("Animate on startup?"),help:An("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(Un,{label:An("Duration"),help:An("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(Jn,{label:An("Easing"),help:An("The easing function applied to the animation."),value:n.animation.easing?n.animation.easing:"linear",options:[{label:An("Constant speed"),value:"linear"},{label:An("Start slow and speed up"),value:"in"},{label:An("Start fast and slow down"),value:"out"},{label:An("Start slow, speed up, then slow down"),value:"inAndOut"}],onChange:function(t){n.animation.easing=t,e.props.edit(n)}})))}}])&&Cn(n.prototype,r),a&&Cn(n,a),t}(Nn);function Vn(e){return(Vn="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 Gn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function $n(e,t){return!t||"object"!==Vn(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Kn(e){return(Kn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Zn(e,t){return(Zn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Qn=wp.i18n.__,Xn=wp.element.Component,er=wp.components,tr=er.PanelBody,nr=er.Notice,rr=er.TextControl,ar=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),$n(this,Kn(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Zn(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(tr,{title:Qn("Instance Settings"),initialOpen:!0,className:"visualizer-instance-panel"},wp.element.createElement(nr,{status:"info",isDismissible:!1},wp.element.createElement("p",null,Qn("These settings are valid only for this instance of the chart.")),wp.element.createElement("p",null,Qn("This means that if you insert this chart again elsewhere, these values will not persist."))),wp.element.createElement(rr,{label:Qn("Should this instance lazy Load?"),help:Qn("-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)}}))}}])&&Gn(n.prototype,r),a&&Gn(n,a),t}(Xn);function ir(e){return(ir="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function or(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function sr(e,t){return!t||"object"!==ir(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function lr(e){return(lr=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ur(e,t){return(ur=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var cr=wp.i18n.__,dr=wp.element,mr=dr.Component,pr=dr.Fragment,hr=(wp.blockEditor||wp.editor).ColorPalette,fr=wp.components,_r=fr.BaseControl,yr=fr.ExternalLink,gr=fr.PanelBody,br=fr.SelectControl,vr=fr.TextControl,wr=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),sr(this,lr(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ur(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-chart-type"],n=this.props.chart["visualizer-settings"];return wp.element.createElement(gr,{title:cr("Horizontal Axis Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(gr,{title:cr("General Settings"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(vr,{label:cr("Axis Title"),help:cr("The title of the horizontal axis."),value:n.hAxis.title,onChange:function(t){n.hAxis.title=t,e.props.edit(n)}}),wp.element.createElement(br,{label:cr("Text Position"),help:cr("Position of the horizontal axis text, relative to the chart area."),value:n.hAxis.textPosition?n.hAxis.textPosition:"out",options:[{label:cr("Inside the chart"),value:"in"},{label:cr("Outside the chart"),value:"out"},{label:cr("None"),value:"none"}],onChange:function(t){n.hAxis.textPosition=t,e.props.edit(n)}}),wp.element.createElement(br,{label:cr("Direction"),help:cr("The direction in which the values along the horizontal axis grow."),value:n.hAxis.direction?n.hAxis.direction:"1",options:[{label:cr("Identical Direction"),value:"1"},{label:cr("Reverse Direction"),value:"-1"}],onChange:function(t){n.hAxis.direction=t,e.props.edit(n)}}),wp.element.createElement(_r,{label:cr("Base Line Color")},wp.element.createElement(hr,{value:n.hAxis.baselineColor,onChange:function(t){n.hAxis.baselineColor=t,e.props.edit(n)}})),wp.element.createElement(_r,{label:cr("Axis Text Color")},wp.element.createElement(hr,{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(pr,null,wp.element.createElement(vr,{label:cr("Number Format"),help:cr("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,cr("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"},cr("ICU pattern set.")),cr(" 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,cr("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"},cr("ICU date and time format."))))),-1>=["column"].indexOf(t)&&wp.element.createElement(pr,null,wp.element.createElement(gr,{title:cr("Grid Lines"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(vr,{label:cr("Count"),help:cr("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(_r,{label:cr("Color")},wp.element.createElement(hr,{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(gr,{title:cr("Minor Grid Lines"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(vr,{label:cr("Count"),help:cr("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(_r,{label:cr("Color")},wp.element.createElement(hr,{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(gr,{title:cr("View Window"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(vr,{label:cr("Maximun Value"),help:cr("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(vr,{label:cr("Minimum Value"),help:cr("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)}}))))}}])&&or(n.prototype,r),a&&or(n,a),t}(mr);function Mr(e){return(Mr="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 kr(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Lr(e,t){return!t||"object"!==Mr(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Yr(e){return(Yr=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Dr(e,t){return(Dr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Tr=wp.i18n.__,Sr=wp.element,Or=Sr.Component,jr=Sr.Fragment,xr=(wp.blockEditor||wp.editor).ColorPalette,Er=wp.components,Cr=Er.BaseControl,Pr=Er.ExternalLink,Hr=Er.PanelBody,zr=Er.SelectControl,Ar=Er.TextControl,Nr=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Lr(this,Yr(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Dr(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-chart-type"],n=this.props.chart["visualizer-settings"];return wp.element.createElement(Hr,{title:Tr("Vertical Axis Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(Hr,{title:Tr("General Settings"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Ar,{label:Tr("Axis Title"),help:Tr("The title of the Vertical axis."),value:n.vAxis.title,onChange:function(t){n.vAxis.title=t,e.props.edit(n)}}),wp.element.createElement(zr,{label:Tr("Text Position"),help:Tr("Position of the Vertical axis text, relative to the chart area."),value:n.vAxis.textPosition?n.vAxis.textPosition:"out",options:[{label:Tr("Inside the chart"),value:"in"},{label:Tr("Outside the chart"),value:"out"},{label:Tr("None"),value:"none"}],onChange:function(t){n.vAxis.textPosition=t,e.props.edit(n)}}),wp.element.createElement(zr,{label:Tr("Direction"),help:Tr("The direction in which the values along the Vertical axis grow."),value:n.vAxis.direction?n.vAxis.direction:"1",options:[{label:Tr("Identical Direction"),value:"1"},{label:Tr("Reverse Direction"),value:"-1"}],onChange:function(t){n.vAxis.direction=t,e.props.edit(n)}}),wp.element.createElement(Cr,{label:Tr("Base Line Color")},wp.element.createElement(xr,{value:n.vAxis.baselineColor,onChange:function(t){n.vAxis.baselineColor=t,e.props.edit(n)}})),wp.element.createElement(Cr,{label:Tr("Axis Text Color")},wp.element.createElement(xr,{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(jr,null,wp.element.createElement(Ar,{label:Tr("Number Format"),help:Tr("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,Tr("For number axis labels, this is a subset of the formatting "),wp.element.createElement(Pr,{href:"http://icu-project.org/apiref/icu4c/classDecimalFormat.html#_details"},Tr("ICU pattern set.")),Tr(" 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,Tr("For date axis labels, this is a subset of the date formatting "),wp.element.createElement(Pr,{href:"http://userguide.icu-project.org/formatparse/datetime#TOC-Date-Time-Format-Syntax"},Tr("ICU date and time format."))))),-1>=["bar"].indexOf(t)&&wp.element.createElement(jr,null,wp.element.createElement(Hr,{title:Tr("Grid Lines"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Ar,{label:Tr("Count"),help:Tr("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(Cr,{label:Tr("Color")},wp.element.createElement(xr,{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(Hr,{title:Tr("Minor Grid Lines"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Ar,{label:Tr("Count"),help:Tr("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(Cr,{label:Tr("Color")},wp.element.createElement(xr,{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(Hr,{title:Tr("View Window"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Ar,{label:Tr("Maximun Value"),help:Tr("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(Ar,{label:Tr("Minimum Value"),help:Tr("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)}}))))}}])&&kr(n.prototype,r),a&&kr(n,a),t}(Or);function Fr(e){return(Fr="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){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Wr(e,t){return!t||"object"!==Fr(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Ir(e){return(Ir=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Br(e,t){return(Br=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Jr=wp.i18n.__,Ur=wp.element,qr=Ur.Component,Vr=Ur.Fragment,Gr=(wp.blockEditor||wp.editor).ColorPalette,$r=wp.components,Kr=$r.BaseControl,Zr=$r.ExternalLink,Qr=$r.PanelBody,Xr=$r.SelectControl,ea=$r.TextControl,ta=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Wr(this,Ir(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Br(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(Qr,{title:Jr("Pie Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(Vr,null,wp.element.createElement(ea,{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(Xr,{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(Xr,{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(Xr,{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(ea,{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(ea,{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(Kr,{label:Jr("Slice Border Color")},wp.element.createElement(Gr,{value:t.pieSliceBorderColor,onChange:function(n){t.pieSliceBorderColor=n,e.props.edit(t)}})))}}])&&Rr(n.prototype,r),a&&Rr(n,a),t}(qr);function na(e){return(na="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){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function aa(e,t){return!t||"object"!==na(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function ia(e){return(ia=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function oa(e,t){return(oa=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var sa=wp.i18n.__,la=wp.element.Component,ua=(wp.blockEditor||wp.editor).ColorPalette,ca=wp.components,da=ca.BaseControl,ma=ca.PanelBody,pa=ca.TextControl,ha=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),aa(this,ia(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&oa(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(ma,{title:sa("Residue Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(pa,{label:sa("Visibility Threshold"),help:sa("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:sa("0.001388889"),value:t.sliceVisibilityThreshold,onChange:function(n){t.sliceVisibilityThreshold=n,e.props.edit(t)}}),wp.element.createElement(pa,{label:sa("Residue Slice Label"),help:sa("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(da,{label:sa("Residue Slice Color")},wp.element.createElement(ua,{value:t.pieResidueSliceColor,onChange:function(n){t.pieResidueSliceColor=n,e.props.edit(t)}})))}}])&&ra(n.prototype,r),a&&ra(n,a),t}(la);function fa(e){return(fa="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 _a(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ya(e,t){return!t||"object"!==fa(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function ga(e){return(ga=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ba(e,t){return(ba=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var va=wp.i18n.__,wa=wp.element,Ma=wa.Component,ka=wa.Fragment,La=wp.components,Ya=La.PanelBody,Da=La.SelectControl,Ta=La.TextControl,Sa=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),ya(this,ga(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ba(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-chart-type"],n=this.props.chart["visualizer-settings"];return wp.element.createElement(Ya,{title:va("Lines Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(Ta,{label:va("Line Width"),help:va("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(Ta,{label:va("Point Size"),help:va("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(Da,{label:va("Curve Type"),help:va("Determines whether the series has to be presented in the legend or not."),value:n.curveType?n.curveType:"none",options:[{label:va("Straight line without curve"),value:"none"},{label:va("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(Da,{label:va("Focus Target"),help:va("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:va("Focus on a single data point."),value:"datum"},{label:va("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(Da,{label:va("Selection Mode"),help:va("Determines how many data points an user can select on a chart."),value:n.selectionMode?n.selectionMode:"single",options:[{label:va("Single data point"),value:"single"},{label:va("Multiple data points"),value:"multiple"}],onChange:function(t){n.selectionMode=t,e.props.edit(n)}}),wp.element.createElement(Da,{label:va("Aggregation Target"),help:va("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:va("Group selected data by x-value"),value:"category"},{label:va("Group selected data by series"),value:"series"},{label:va("Group selected data by x-value if all selections have the same x-value, and by series otherwise"),value:"auto"},{label:va("Show only one tooltip per selection"),value:"none"}],onChange:function(t){n.aggregationTarget=t,e.props.edit(n)}}),wp.element.createElement(Ta,{label:va("Point Opacity"),help:va("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(ka,null,wp.element.createElement(Ta,{label:va("Area Opacity"),help:va("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(Da,{label:va("Is Stacked"),help:va("If set to yes, series elements are stacked."),value:n.isStacked?n.isStacked:"0",options:[{label:va("Yes"),value:"1"},{label:va("No"),value:"0"}],onChange:function(t){n.isStacked=t,e.props.edit(n)}})),-1>=["scatter","area"].indexOf(t)&&wp.element.createElement(Da,{label:va("Interpolate Nulls"),help:va("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:va("Yes"),value:"1"},{label:va("No"),value:"0"}],onChange:function(t){n.interpolateNulls=t,e.props.edit(n)}}))}}])&&_a(n.prototype,r),a&&_a(n,a),t}(Ma);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 ja(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function xa(e,t){return!t||"object"!==Oa(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Ea(e){return(Ea=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Ca(e,t){return(Ca=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Pa=wp.i18n.__,Ha=wp.element.Component,za=wp.components,Aa=za.PanelBody,Na=za.SelectControl,Fa=za.TextControl,Ra=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),xa(this,Ea(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ca(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(Aa,{title:Pa("Bars Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(Na,{label:Pa("Focus Target"),help:Pa("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:Pa("Focus on a single data point."),value:"datum"},{label:Pa("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(Na,{label:Pa("Is Stacked"),help:Pa("If set to yes, series elements are stacked."),value:t.isStacked?t.isStacked:"0",options:[{label:Pa("Yes"),value:"1"},{label:Pa("No"),value:"0"}],onChange:function(n){t.isStacked=n,e.props.edit(t)}}),wp.element.createElement(Fa,{label:Pa("Bars Opacity"),help:Pa("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)}}))}}])&&ja(n.prototype,r),a&&ja(n,a),t}(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 Ia(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Ba(e,t){return!t||"object"!==Wa(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Ja(e){return(Ja=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Ua(e,t){return(Ua=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var qa=wp.i18n.__,Va=wp.element.Component,Ga=(wp.blockEditor||wp.editor).ColorPalette,$a=wp.components,Ka=$a.BaseControl,Za=$a.PanelBody,Qa=$a.SelectControl,Xa=$a.TextControl,ei=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Ba(this,Ja(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ua(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(Za,{title:qa("Candles Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(Za,{title:qa("General Settings"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Qa,{label:qa("Focus Target"),help:qa("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:qa("Focus on a single data point."),value:"datum"},{label:qa("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(Qa,{label:qa("Selection Mode"),help:qa("Determines how many data points an user can select on a chart."),value:t.selectionMode?t.selectionMode:"single",options:[{label:qa("Single data point"),value:"single"},{label:qa("Multiple data points"),value:"multiple"}],onChange:function(n){t.selectionMode=n,e.props.edit(t)}}),wp.element.createElement(Qa,{label:qa("Aggregation Target"),help:qa("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:qa("Group selected data by x-value"),value:"category"},{label:qa("Group selected data by series"),value:"series"},{label:qa("Group selected data by x-value if all selections have the same x-value, and by series otherwise"),value:"auto"},{label:qa("Show only one tooltip per selection"),value:"none"}],onChange:function(n){t.aggregationTarget=n,e.props.edit(t)}})),wp.element.createElement(Za,{title:qa("Failing Candles"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Xa,{label:qa("Stroke Width"),help:qa("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(Ka,{label:qa("Stroke Color")},wp.element.createElement(Ga,{value:t.candlestick.fallingColor.stroke,onChange:function(n){t.candlestick.fallingColor.stroke=n,e.props.edit(t)}})),wp.element.createElement(Ka,{label:qa("Fill Color")},wp.element.createElement(Ga,{value:t.candlestick.fallingColor.fill,onChange:function(n){t.candlestick.fallingColor.fill=n,e.props.edit(t)}}))),wp.element.createElement(Za,{title:qa("Rising Candles"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Xa,{label:qa("Stroke Width"),help:qa("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(Ka,{label:qa("Stroke Color")},wp.element.createElement(Ga,{value:t.candlestick.risingColor.stroke,onChange:function(n){t.candlestick.risingColor.stroke=n,e.props.edit(t)}})),wp.element.createElement(Ka,{label:qa("Fill Color")},wp.element.createElement(Ga,{value:t.candlestick.risingColor.fill,onChange:function(n){t.candlestick.risingColor.fill=n,e.props.edit(t)}}))))}}])&&Ia(n.prototype,r),a&&Ia(n,a),t}(Va);function ti(e){return(ti="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){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ri(e,t){return!t||"object"!==ti(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function ai(e){return(ai=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ii(e,t){return(ii=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var oi=wp.i18n.__,si=wp.element.Component,li=wp.components,ui=li.ExternalLink,ci=li.PanelBody,di=li.SelectControl,mi=li.TextControl,pi=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),ri(this,ai(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ii(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(ci,{title:oi("Map Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(ci,{title:oi("API"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(mi,{label:oi("API Key"),help:oi("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(ui,{href:"https://developers.google.com/maps/documentation/javascript/get-api-key"},oi("Get API Keys"))),wp.element.createElement(ci,{title:oi("Region"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement("ul",{className:"visualizer-list"},wp.element.createElement("li",null,oi("A map of the entire world using 'world'.")),wp.element.createElement("li",null,oi("A continent or a sub-continent, specified by its 3-digit code, e.g., '011' for Western Africa. "),wp.element.createElement(ui,{href:"https://google-developers.appspot.com/chart/interactive/docs/gallery/geochart#Continent_Hierarchy"},oi("More info here."))),wp.element.createElement("li",null,oi("A country, specified by its ISO 3166-1 alpha-2 code, e.g., 'AU' for Australia. "),wp.element.createElement(ui,{href:"http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2"},oi("More info here."))),wp.element.createElement("li",null,oi("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(ui,{href:"http://en.wikipedia.org/wiki/ISO_3166-2:US"},oi("More info here.")))),wp.element.createElement(mi,{label:oi("Reigion"),help:oi("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(ci,{title:oi("Resolution"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement("ul",{className:"visualizer-list"},wp.element.createElement("li",null,oi("'countries' - Supported for all regions, except for US state regions.")),wp.element.createElement("li",null,oi("'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,oi("'metros' - Supported for the US country region and US state regions only."))),wp.element.createElement(di,{label:oi("Resolution"),help:oi("The resolution of the map borders."),value:t.resolution?t.resolution:"countries",options:[{label:oi("Countries"),value:"countries"},{label:oi("Provinces"),value:"provinces"},{label:oi("Metros"),value:"metros"}],onChange:function(n){t.resolution=n,e.props.edit(t)}})),wp.element.createElement(ci,{title:oi("Display Mode"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement("ul",{className:"visualizer-list"},wp.element.createElement("li",null,oi("'auto' - Choose based on the format of the data.")),wp.element.createElement("li",null,oi("'regions' - This is a region map.")),wp.element.createElement("li",null,oi("'markers' - This is a marker map."))),wp.element.createElement(di,{label:oi("Display Mode"),help:oi("Determines which type of map this is."),value:t.displayMode?t.displayMode:"auto",options:[{label:oi("Auto"),value:"auto"},{label:oi("Regions"),value:"regions"},{label:oi("Markers"),value:"markers"}],onChange:function(n){t.displayMode=n,e.props.edit(t)}})),wp.element.createElement(ci,{title:oi("Tooltip"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(di,{label:oi("Trigger"),help:oi("Determines the user interaction that causes the tooltip to be displayed."),value:t.tooltip.trigger?t.tooltip.trigger:"focus",options:[{label:oi("The tooltip will be displayed when the user hovers over an element"),value:"focus"},{label:oi("The tooltip will not be displayed"),value:"none"}],onChange:function(n){t.tooltip.trigger=n,e.props.edit(t)}})))}}])&&ni(n.prototype,r),a&&ni(n,a),t}(si);function hi(e){return(hi="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 fi(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function _i(e,t){return!t||"object"!==hi(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function yi(e){return(yi=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function gi(e,t){return(gi=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var bi=wp.i18n.__,vi=wp.element.Component,wi=(wp.blockEditor||wp.editor).ColorPalette,Mi=wp.components,ki=Mi.BaseControl,Li=Mi.PanelBody,Yi=Mi.TextControl,Di=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),_i(this,yi(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&gi(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(Li,{title:bi("Color Axis"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(Yi,{label:bi("Minimum Values"),help:bi("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(Yi,{label:bi("Maximum Values"),help:bi("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(ki,{label:bi("Minimum Value")},wp.element.createElement(wi,{value:t.colorAxis.colors[0],onChange:function(n){t.colorAxis.colors[0]=n,e.props.edit(t)}})),wp.element.createElement(ki,{label:bi("Intermediate Value")},wp.element.createElement(wi,{value:t.colorAxis.colors[1],onChange:function(n){t.colorAxis.colors[1]=n,e.props.edit(t)}})),wp.element.createElement(ki,{label:bi("Maximum Value")},wp.element.createElement(wi,{value:t.colorAxis.colors[2],onChange:function(n){t.colorAxis.colors[2]=n,e.props.edit(t)}})),wp.element.createElement(ki,{label:bi("Dateless Region")},wp.element.createElement(wi,{value:t.datalessRegionColor,onChange:function(n){t.datalessRegionColor=n,e.props.edit(t)}})))}}])&&fi(n.prototype,r),a&&fi(n,a),t}(vi);function Ti(e){return(Ti="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 Si(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Oi(e,t){return!t||"object"!==Ti(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function ji(e){return(ji=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function xi(e,t){return(xi=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Ei=wp.i18n.__,Ci=wp.element,Pi=Ci.Component,Hi=Ci.Fragment,zi=wp.components,Ai=zi.ExternalLink,Ni=zi.PanelBody,Fi=zi.TextControl,Ri=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Oi(this,ji(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&xi(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(Ni,{title:Ei("Size Axis"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(Fi,{label:Ei("Minimum Values"),help:Ei("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(Fi,{label:Ei("Maximum Values"),help:Ei("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(Fi,{label:Ei("Minimum Marker Radius"),help:Ei("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(Fi,{label:Ei("Maximum Marker Radius"),help:Ei("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(Fi,{label:Ei("Marker Opacity"),help:Ei("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(Hi,null,wp.element.createElement(Fi,{label:Ei("Number Format"),help:Ei("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,Ei("For number axis labels, this is a subset of the formatting "),wp.element.createElement(Ai,{href:"http://icu-project.org/apiref/icu4c/classDecimalFormat.html#_details"},Ei("ICU pattern set.")),Ei(" 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."))))}}])&&Si(n.prototype,r),a&&Si(n,a),t}(Pi);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 Ii(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Bi(e,t){return!t||"object"!==Wi(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Ji(e){return(Ji=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Ui(e,t){return(Ui=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var qi=wp.i18n.__,Vi=wp.element.Component,Gi=wp.components,$i=Gi.PanelBody,Ki=Gi.SelectControl,Zi=Gi.TextControl,Qi=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Bi(this,Ji(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ui(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement($i,{title:qi("Magnifying Glass"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(Ki,{label:qi("Enabled"),help:qi("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:qi("Yes"),value:"1"},{label:qi("No"),value:"0"}],onChange:function(n){t.magnifyingGlass.enable=n,e.props.edit(t)}}),wp.element.createElement(Zi,{label:qi("Zoom Factor"),help:qi("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(n.prototype,r),a&&Ii(n,a),t}(Vi);function Xi(e){return(Xi="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 eo(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function to(e,t){return!t||"object"!==Xi(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function no(e){return(no=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ro(e,t){return(ro=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var ao=wp.i18n.__,io=wp.element,oo=io.Component,so=io.Fragment,lo=(wp.blockEditor||wp.editor).ColorPalette,uo=wp.components,co=uo.BaseControl,mo=uo.ExternalLink,po=uo.PanelBody,ho=uo.TextControl,fo=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),to(this,no(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ro(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(po,{title:ao("Gauge Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(po,{title:ao("Tick Settings"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(ho,{label:ao("Minimum Values"),help:ao("Determines the minimum values of gauge."),value:t.min,onChange:function(n){t.min=n,e.props.edit(t)}}),wp.element.createElement(ho,{label:ao("Maximum Values"),help:ao("Determines the maximum values of gauge."),value:t.max,onChange:function(n){t.max=n,e.props.edit(t)}}),wp.element.createElement(ho,{label:ao("Minor Ticks"),help:ao("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(so,null,wp.element.createElement(ho,{label:ao("Number Format"),help:ao("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,ao("For number axis labels, this is a subset of the formatting "),wp.element.createElement(mo,{href:"http://icu-project.org/apiref/icu4c/classDecimalFormat.html#_details"},ao("ICU pattern set.")),ao(" 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(po,{title:ao("Green Color"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(ho,{label:ao("Minimum Range"),help:ao("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(ho,{label:ao("Maximum Range"),help:ao("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(co,{label:ao("Green Color")},wp.element.createElement(lo,{value:t.greenColor,onChange:function(n){t.greenColor=n,e.props.edit(t)}}))),wp.element.createElement(po,{title:ao("Yellow Color"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(ho,{label:ao("Minimum Range"),help:ao("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(ho,{label:ao("Maximum Range"),help:ao("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(co,{label:ao("Yellow Color")},wp.element.createElement(lo,{value:t.yellowColor,onChange:function(n){t.yellowColor=n,e.props.edit(t)}}))),wp.element.createElement(po,{title:ao("Red Color"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(ho,{label:ao("Minimum Range"),help:ao("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(ho,{label:ao("Maximum Range"),help:ao("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(co,{label:ao("Red Color")},wp.element.createElement(lo,{value:t.redColor,onChange:function(n){t.redColor=n,e.props.edit(t)}}))))}}])&&eo(n.prototype,r),a&&eo(n,a),t}(oo);function _o(e){return(_o="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 yo(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function go(e){return(go=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function bo(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function vo(e,t){return(vo=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var wo=wp.i18n.__,Mo=wp.element.Component,ko=(wp.blockEditor||wp.editor).ColorPalette,Lo=wp.components,Yo=Lo.BaseControl,Do=Lo.CheckboxControl,To=Lo.PanelBody,So=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t){return!t||"object"!==_o(t)&&"function"!=typeof t?bo(e):t}(this,go(t).apply(this,arguments))).mapValues=e.mapValues.bind(bo(e)),e}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&vo(e,t)}(t,e),n=t,(r=[{key:"mapValues",value:function(e,t){return void 0===e.timeline?e[t]:e.timeline[t]}},{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return this.mapValues(t,"showRowLabels"),wp.element.createElement(To,{title:wo("Timeline Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(Do,{label:wo("Show Row Label"),help:wo("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(Do,{label:wo("Group by Row Label"),help:wo("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(Do,{label:wo("Color by Row Label"),help:wo("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(Yo,{label:wo("Single Color")},wp.element.createElement(ko,{value:this.mapValues(t,"singleColor"),onChange:function(n){void 0===t.timeline&&(t.timeline={}),t.timeline.singleColor=n,e.props.edit(t)}})))}}])&&yo(n.prototype,r),a&&yo(n,a),t}(Mo);function Oo(e){return(Oo="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 jo(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function xo(e,t){return!t||"object"!==Oo(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Eo(e){return(Eo=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Co(e,t){return(Co=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Po=wp.i18n.__,Ho=wp.element,zo=Ho.Component,Ao=Ho.Fragment,No=wp.components,Fo=No.CheckboxControl,Ro=No.PanelBody,Wo=No.SelectControl,Io=No.TextControl,Bo=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),xo(this,Eo(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Co(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"],n=(this.props.chart["visualizer-chart-type"],this.props.chart["visualizer-chart-library"]);return wp.element.createElement(Ro,{title:Po("Table Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},"DataTable"===n?wp.element.createElement(Ao,null,wp.element.createElement(Fo,{label:Po("Enable Pagination"),help:Po("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(Io,{label:Po("Number of rows per page"),help:Po("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(Wo,{label:Po("Pagination type"),help:Po("Determines what type of pagination options to show."),value:t.pagingType,options:[{label:Po("Page number buttons only"),value:"numbers"},{label:Po("'Previous' and 'Next' buttons only"),value:"simple"},{label:Po("'Previous' and 'Next' buttons, plus page numbers"),value:"simple_numbers"},{label:Po("'First', 'Previous', 'Next' and 'Last' buttons"),value:"full"},{label:Po("'First', 'Previous', 'Next' and 'Last' buttons, plus page numbers"),value:"full_numbers"},{label:Po("'First' and 'Last' buttons, plus page numbers"),value:"first_last_numbers"}],onChange:function(n){t.pagingType=n,e.props.edit(t)}}),wp.element.createElement(Fo,{label:Po("Scroll Collapse"),help:Po("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(Io,{label:Po("Vertical Height"),help:Po("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(Fo,{label:Po("Disable Sort"),help:Po("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(Fo,{label:Po("Freeze Header/Footer"),help:Po("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(Fo,{label:Po("Responsive"),help:Po("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(Ao,null,wp.element.createElement(Wo,{label:Po("Enable Pagination"),help:Po("To enable paging through the data."),value:t.page?t.page:"disable",options:[{label:Po("Enable"),value:"enable"},{label:Po("Disable"),value:"disable"}],onChange:function(n){t.page=n,e.props.edit(t)}}),wp.element.createElement(Io,{label:Po("Number of rows per page"),help:Po("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(Wo,{label:Po("Disable Sort"),help:Po("To disable sorting on columns."),value:t.sort?t.sort:"enable",options:[{label:Po("Enable"),value:"enable"},{label:Po("Disable"),value:"disable"}],onChange:function(n){t.sort=n,e.props.edit(t)}}),wp.element.createElement(Io,{label:Po("Freeze Columns"),help:Po("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(Fo,{label:Po("Allow HTML"),help:Po("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(Fo,{label:Po("Right to Left table"),help:Po("Adds basic support for right-to-left languages."),checked:Number(t.rtlTable),onChange:function(n){t.rtlTable=!Number(t.rtlTable),e.props.edit(t)}})))}}])&&jo(n.prototype,r),a&&jo(n,a),t}(zo);function Jo(e){return(Jo="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 Uo(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function qo(e,t){return!t||"object"!==Jo(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Vo(e){return(Vo=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Go(e,t){return(Go=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var $o=wp.i18n.__,Ko=wp.element,Zo=Ko.Component,Qo=Ko.Fragment,Xo=(wp.blockEditor||wp.editor).ColorPalette,es=wp.components,ts=es.BaseControl,ns=es.PanelBody,rs=es.TextControl,as=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),qo(this,Vo(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Go(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"],n=(this.props.chart["visualizer-chart-type"],this.props.chart["visualizer-chart-library"]);return wp.element.createElement(ns,{title:$o("Row/Cell Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},"DataTable"===n?wp.element.createElement(Qo,null,wp.element.createElement(ns,{title:$o("Odd Table Row"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(ts,{label:$o("Background Color")},wp.element.createElement(Xo,{value:t.customcss.oddTableRow["background-color"],onChange:function(n){t.customcss.oddTableRow["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(ts,{label:$o("Color")},wp.element.createElement(Xo,{value:t.customcss.oddTableRow.color,onChange:function(n){t.customcss.oddTableRow.color=n,e.props.edit(t)}})),wp.element.createElement(rs,{label:$o("Text Orientation"),help:$o("In degrees."),type:"number",value:t.customcss.oddTableRow.transform,onChange:function(n){t.customcss.oddTableRow.transform=n,e.props.edit(t)}})),wp.element.createElement(ns,{title:$o("Even Table Row"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(ts,{label:$o("Background Color")},wp.element.createElement(Xo,{value:t.customcss.evenTableRow["background-color"],onChange:function(n){t.customcss.evenTableRow["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(ts,{label:$o("Color")},wp.element.createElement(Xo,{value:t.customcss.evenTableRow.color,onChange:function(n){t.customcss.evenTableRow.color=n,e.props.edit(t)}})),wp.element.createElement(rs,{label:$o("Text Orientation"),help:$o("In degrees."),type:"number",value:t.customcss.evenTableRow.transform,onChange:function(n){t.customcss.evenTableRow.transform=n,e.props.edit(t)}})),wp.element.createElement(ns,{title:$o("Table Cell"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(ts,{label:$o("Background Color")},wp.element.createElement(Xo,{value:t.customcss.tableCell["background-color"],onChange:function(n){t.customcss.tableCell["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(ts,{label:$o("Color")},wp.element.createElement(Xo,{value:t.customcss.tableCell.color,onChange:function(n){t.customcss.tableCell.color=n,e.props.edit(t)}})),wp.element.createElement(rs,{label:$o("Text Orientation"),help:$o("In degrees."),type:"number",value:t.customcss.tableCell.transform,onChange:function(n){t.customcss.tableCell.transform=n,e.props.edit(t)}}))):wp.element.createElement(Qo,null,wp.element.createElement(ns,{title:$o("Header Row"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(ts,{label:$o("Background Color")},wp.element.createElement(Xo,{value:t.customcss.headerRow["background-color"],onChange:function(n){t.customcss.headerRow["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(ts,{label:$o("Color")},wp.element.createElement(Xo,{value:t.customcss.headerRow.color,onChange:function(n){t.customcss.headerRow.color=n,e.props.edit(t)}})),wp.element.createElement(rs,{label:$o("Text Orientation"),help:$o("In degrees."),type:"number",value:t.customcss.headerRow.transform,onChange:function(n){t.customcss.headerRow.transform=n,e.props.edit(t)}})),wp.element.createElement(ns,{title:$o("Table Row"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(ts,{label:$o("Background Color")},wp.element.createElement(Xo,{value:t.customcss.tableRow["background-color"],onChange:function(n){t.customcss.tableRow["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(ts,{label:$o("Color")},wp.element.createElement(Xo,{value:t.customcss.tableRow.color,onChange:function(n){t.customcss.tableRow.color=n,e.props.edit(t)}})),wp.element.createElement(rs,{label:$o("Text Orientation"),help:$o("In degrees."),type:"number",value:t.customcss.tableRow.transform,onChange:function(n){t.customcss.tableRow.transform=n,e.props.edit(t)}})),wp.element.createElement(ns,{title:$o("Odd Table Row"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(ts,{label:$o("Background Color")},wp.element.createElement(Xo,{value:t.customcss.oddTableRow["background-color"],onChange:function(n){t.customcss.oddTableRow["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(ts,{label:$o("Color")},wp.element.createElement(Xo,{value:t.customcss.oddTableRow.color,onChange:function(n){t.customcss.oddTableRow.color=n,e.props.edit(t)}})),wp.element.createElement(rs,{label:$o("Text Orientation"),help:$o("In degrees."),type:"number",value:t.customcss.oddTableRow.transform,onChange:function(n){t.customcss.oddTableRow.transform=n,e.props.edit(t)}})),wp.element.createElement(ns,{title:$o("Selected Table Row"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(ts,{label:$o("Background Color")},wp.element.createElement(Xo,{value:t.customcss.selectedTableRow["background-color"],onChange:function(n){t.customcss.selectedTableRow["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(ts,{label:$o("Color")},wp.element.createElement(Xo,{value:t.customcss.selectedTableRow.color,onChange:function(n){t.customcss.selectedTableRow.color=n,e.props.edit(t)}})),wp.element.createElement(rs,{label:$o("Text Orientation"),help:$o("In degrees."),type:"number",value:t.customcss.selectedTableRow.transform,onChange:function(n){t.customcss.selectedTableRow.transform=n,e.props.edit(t)}})),wp.element.createElement(ns,{title:$o("Hover Table Row"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(ts,{label:$o("Background Color")},wp.element.createElement(Xo,{value:t.customcss.hoverTableRow["background-color"],onChange:function(n){t.customcss.hoverTableRow["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(ts,{label:$o("Color")},wp.element.createElement(Xo,{value:t.customcss.hoverTableRow.color,onChange:function(n){t.customcss.hoverTableRow.color=n,e.props.edit(t)}})),wp.element.createElement(rs,{label:$o("Text Orientation"),help:$o("In degrees."),type:"number",value:t.customcss.hoverTableRow.transform,onChange:function(n){t.customcss.hoverTableRow.transform=n,e.props.edit(t)}})),wp.element.createElement(ns,{title:$o("Header Cell"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(ts,{label:$o("Background Color")},wp.element.createElement(Xo,{value:t.customcss.headerCell["background-color"],onChange:function(n){t.customcss.headerCell["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(ts,{label:$o("Color")},wp.element.createElement(Xo,{value:t.customcss.headerCell.color,onChange:function(n){t.customcss.headerCell.color=n,e.props.edit(t)}})),wp.element.createElement(rs,{label:$o("Text Orientation"),help:$o("In degrees."),type:"number",value:t.customcss.headerCell.transform,onChange:function(n){t.customcss.headerCell.transform=n,e.props.edit(t)}})),wp.element.createElement(ns,{title:$o("Table Cell"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(ts,{label:$o("Background Color")},wp.element.createElement(Xo,{value:t.customcss.tableCell["background-color"],onChange:function(n){t.customcss.tableCell["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(ts,{label:$o("Color")},wp.element.createElement(Xo,{value:t.customcss.tableCell.color,onChange:function(n){t.customcss.tableCell.color=n,e.props.edit(t)}})),wp.element.createElement(rs,{label:$o("Text Orientation"),help:$o("In degrees."),type:"number",value:t.customcss.tableCell.transform,onChange:function(n){t.customcss.tableCell.transform=n,e.props.edit(t)}}))))}}])&&Uo(n.prototype,r),a&&Uo(n,a),t}(Zo);function is(e){return(is="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 os(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ss(e,t){return!t||"object"!==is(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function ls(e){return(ls=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function us(e,t){return(us=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var cs=wp.i18n.__,ds=wp.element.Component,ms=wp.components,ps=ms.PanelBody,hs=ms.SelectControl,fs=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),ss(this,ls(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&us(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(ps,{title:cs("Combo Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(hs,{label:cs("Chart Type"),help:cs("Select the default chart type."),value:t.seriesType?t.seriesType:"area",options:[{label:cs("Area"),value:"area"},{label:cs("Bar"),value:"bars"},{label:cs("Candlesticks"),value:"candlesticks"},{label:cs("Line"),value:"line"},{label:cs("Stepped Area"),value:"steppedArea"}],onChange:function(n){t.seriesType=n,e.props.edit(t)}}))}}])&&os(n.prototype,r),a&&os(n,a),t}(ds);function _s(e){return(_s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ys(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function gs(e,t){return!t||"object"!==_s(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function bs(e){return(bs=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function vs(e,t){return(vs=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var ws=wp.i18n.__,Ms=wp.element,ks=Ms.Component,Ls=Ms.Fragment,Ys=(wp.blockEditor||wp.editor).ColorPalette,Ds=wp.components,Ts=Ds.BaseControl,Ss=Ds.ExternalLink,Os=Ds.PanelBody,js=Ds.SelectControl,xs=Ds.TextControl,Es=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),gs(this,bs(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&vs(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:function(){var e=this.props.chart["visualizer-settings"];Object.keys(e.series).map((function(t){void 0!==e.series[t]&&(e.series[t].temp=1)})),this.props.edit(e)}},{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-chart-type"],n=this.props.chart["visualizer-settings"],r=this.props.chart["visualizer-series"];return wp.element.createElement(Os,{title:ws("Series Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},Object.keys(n.series).map((function(a,i){return a++,wp.element.createElement(Os,{title:r[a].label,className:"visualizer-inner-sections",initialOpen:!1},-1>=["tabular","pie"].indexOf(t)&&wp.element.createElement(js,{label:ws("Visible In Legend"),help:ws("Determines whether the series has to be presented in the legend or not."),value:n.series[i].visibleInLegend?n.series[i].visibleInLegend:"1",options:[{label:ws("Yes"),value:"1"},{label:ws("No"),value:"0"}],onChange:function(t){n.series[i].visibleInLegend=t,e.props.edit(n)}}),-1>=["tabular","candlestick","combo","column","bar"].indexOf(t)&&wp.element.createElement(Ls,null,wp.element.createElement(xs,{label:ws("Line Width"),help:ws("Overrides the global line width value for this series."),value:n.series[i].lineWidth,onChange:function(t){n.series[i].lineWidth=t,e.props.edit(n)}}),wp.element.createElement(xs,{label:ws("Point Size"),help:ws("Overrides the global point size value for this series."),value:n.series[i].pointSize,onChange:function(t){n.series[i].pointSize=t,e.props.edit(n)}})),-1>=["candlestick"].indexOf(t)&&"number"===r[a].type?wp.element.createElement(Ls,null,wp.element.createElement(xs,{label:ws("Format"),help:ws("Enter custom format pattern to apply to this series value."),value:n.series[i].format,onChange:function(t){n.series[i].format=t,e.props.edit(n)}}),wp.element.createElement("p",null,ws("For number axis labels, this is a subset of the formatting "),wp.element.createElement(Ss,{href:"http://icu-project.org/apiref/icu4c/classDecimalFormat.html#_details"},ws("ICU pattern set.")),ws(" For instance, $#,###.## will display values $1,234.56 for value 1234.56. Pay attention that if you use #%% percentage format then your values will be multiplied by 100."))):0<=["date","datetime","timeofday"].indexOf(r[a].type)&&wp.element.createElement(Ls,null,wp.element.createElement(xs,{label:ws("Date Format"),help:ws("Enter custom format pattern to apply to this series value."),placeholder:"dd LLLL yyyy",value:n.series[i].format,onChange:function(t){n.series[i].format=t,e.props.edit(n)}}),wp.element.createElement("p",null,ws("This is a subset of the date formatting "),wp.element.createElement(Ss,{href:"http://userguide.icu-project.org/formatparse/datetime#TOC-Date-Time-Format-Syntax"},ws("ICU date and time format.")))),0<=["scatter","line"].indexOf(t)&&wp.element.createElement(js,{label:ws("Curve Type"),help:ws("Determines whether the series has to be presented in the legend or not."),value:n.series[i].curveType?n.series[i].curveType:"none",options:[{label:ws("Straight line without curve"),value:"none"},{label:ws("The angles of the line will be smoothed"),value:"function"}],onChange:function(t){n.series[i].curveType=t,e.props.edit(n)}}),0<=["area"].indexOf(t)&&wp.element.createElement(xs,{label:ws("Area Opacity"),help:ws("The opacity of the colored area, where 0.0 is fully transparent and 1.0 is fully opaque."),value:n.series[i].areaOpacity,onChange:function(t){n.series[i].areaOpacity=t,e.props.edit(n)}}),0<=["combo"].indexOf(t)&&wp.element.createElement(js,{label:ws("Chart Type"),help:ws("Select the type of chart to show for this series."),value:n.series[i].type?n.series[i].type:"area",options:[{label:ws("Area"),value:"area"},{label:ws("Bar"),value:"bars"},{label:ws("Candlesticks"),value:"candlesticks"},{label:ws("Line"),value:"line"},{label:ws("Stepped Area"),value:"steppedArea"}],onChange:function(t){n.series[i].type=t,e.props.edit(n)}}),-1>=["tabular"].indexOf(t)&&wp.element.createElement(Ts,{label:ws("Color")},wp.element.createElement(Ys,{value:n.series[i].color,onChange:function(t){n.series[i].color=t,e.props.edit(n)}})))})))}}])&&ys(n.prototype,r),a&&ys(n,a),t}(ks);function Cs(e){return(Cs="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 Ps(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Hs(e,t){return!t||"object"!==Cs(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function zs(e){return(zs=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function As(e,t){return(As=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Ns=wp.i18n.__,Fs=wp.element.Component,Rs=(wp.blockEditor||wp.editor).ColorPalette,Ws=wp.components,Is=Ws.BaseControl,Bs=Ws.PanelBody,Js=Ws.TextControl,Us=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Hs(this,zs(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&As(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:function(){var e=this.props.chart["visualizer-settings"];Object.keys(e.slices).map((function(t){void 0!==e.slices[t]&&(e.slices[t].temp=1)})),this.props.edit(e)}},{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"],n=this.props.chart["visualizer-data"];return wp.element.createElement(Bs,{title:Ns("Slices Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},Object.keys(t.slices).map((function(r){return wp.element.createElement(Bs,{title:n[r][0],className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Js,{label:Ns("Slice Offset"),help:Ns("How far to separate the slice from the rest of the pie, from 0.0 (not at all) to 1.0 (the pie's radius)."),value:t.slices[r].offset,onChange:function(n){t.slices[r].offset=n,e.props.edit(t)}}),wp.element.createElement(Is,{label:Ns("Format")},wp.element.createElement(Rs,{value:t.slices[r].color,onChange:function(n){t.slices[r].color=n,e.props.edit(t)}})))})))}}])&&Ps(n.prototype,r),a&&Ps(n,a),t}(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 Vs(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Gs(e,t){return!t||"object"!==qs(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function $s(e){return($s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Ks(e,t){return(Ks=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Zs=wp.i18n.__,Qs=wp.element.Component,Xs=(wp.blockEditor||wp.editor).ColorPalette,el=wp.components,tl=el.CheckboxControl,nl=el.BaseControl,rl=el.PanelBody,al=el.TextControl,il=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Gs(this,$s(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ks(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:function(){}},{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(rl,{title:Zs("Bubble Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(al,{label:Zs("Opacity"),help:Zs("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(nl,{label:Zs("Stroke Color")},wp.element.createElement(Xs,{value:t.bubble.stroke,onChange:function(n){t.bubble||(t.bubble={}),t.bubble.stroke=n,e.props.edit(t)}})),wp.element.createElement(tl,{label:Zs("Sort Bubbles by Size"),help:Zs("If checked, sorts the bubbles by size so the smaller bubbles appear above the larger bubbles. If unchecked, bubbles are sorted according to their order in the table."),checked:K(t,"sortBubblesBySize"),onChange:function(n){t.sortBubblesBySize=n,e.props.edit(t)}}),wp.element.createElement(al,{label:Zs("Size (max)"),help:Zs("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(al,{label:Zs("Size (min)"),help:Zs("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)}}))}}])&&Vs(n.prototype,r),a&&Vs(n,a),t}(Qs);function ol(e){return(ol="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 sl(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ll(e,t){return!t||"object"!==ol(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function ul(e){return(ul=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function cl(e,t){return(cl=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var dl=wp.i18n.__,ml=wp.element,pl=ml.Component,hl=ml.Fragment,fl=wp.components,_l=fl.ExternalLink,yl=fl.PanelBody,gl=fl.TextControl,bl=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),ll(this,ul(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&cl(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:function(){var e=this.props.chart["visualizer-settings"];e.series&&(Object.keys(e.series).map((function(t){void 0!==e.series[t]&&(e.series[t].temp=1)})),this.props.edit(e))}},{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"],n=this.props.chart["visualizer-series"];return this.props.chart["visualizer-chart-type"],t.series?wp.element.createElement(yl,{title:dl("Column Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},Object.keys(t.series).map((function(r){return"string"===n[r].type?null:wp.element.createElement(yl,{title:n[r].label,className:"visualizer-inner-sections",initialOpen:!1},0<=["date","datetime","timeofday"].indexOf(n[r].type)&&wp.element.createElement(hl,null,wp.element.createElement(gl,{label:dl("Display Date Format"),help:dl("Enter custom format pattern to apply to this series value."),value:t.series[r].format?t.series[r].format.to:"",onChange:function(n){t.series[r].format||(t.series[r].format={}),t.series[r].format.to=n,e.props.edit(t)}}),wp.element.createElement(gl,{label:dl("Source Date Format"),help:dl("What format is the source date in?"),value:t.series[r].format?t.series[r].format.from:"",onChange:function(n){t.series[r].format||(t.series[r].format={}),t.series[r].format.from=n,e.props.edit(t)}}),wp.element.createElement("p",null,dl("You can find more info on "),wp.element.createElement(_l,{href:"https://momentjs.com/docs/#/displaying/"},dl("date and time formats here.")))),"number"===n[r].type&&wp.element.createElement(hl,null,wp.element.createElement(gl,{label:dl("Thousands Separator"),value:t.series[r].format?t.series[r].format.thousands:"",onChange:function(n){t.series[r].format||(t.series[r].format={}),t.series[r].format.thousands=n,e.props.edit(t)}}),wp.element.createElement(gl,{label:dl("Decimal Separator"),value:t.series[r].format?t.series[r].format.decimal:"",onChange:function(n){t.series[r].format||(t.series[r].format={}),t.series[r].format.decimal=n,e.props.edit(t)}}),wp.element.createElement(gl,{label:dl("Precision"),help:dl("Round values to how many decimal places?"),value:t.series[r].format?t.series[r].format.precision:"",type:"number",min:"0",onChange:function(n){100<n||(t.series[r].format||(t.series[r].format={}),t.series[r].format.precision=n,e.props.edit(t))}}),wp.element.createElement(gl,{label:dl("Prefix"),value:t.series[r].format?t.series[r].format.prefix:"",onChange:function(n){t.series[r].format||(t.series[r].format={}),t.series[r].format.prefix=n,e.props.edit(t)}}),wp.element.createElement(gl,{label:dl("Suffix"),value:t.series[r].format?t.series[r].format.suffix:"",onChange:function(n){t.series[r].format||(t.series[r].format={}),t.series[r].format.suffix=n,e.props.edit(t)}})),"boolean"===n[r].type&&wp.element.createElement(hl,null,wp.element.createElement(gl,{label:dl("Truthy value"),help:dl("Provide the HTML entity code for the value the table should display when the value of the column is true. e.g. tick mark (Code: &#10004;) instead of true"),value:t.series[r].format?t.series[r].format.truthy:"",onChange:function(n){t.series[r].truthy||(t.series[r].truthy={}),t.series[r].format.truthy=n,e.props.edit(t)}}),wp.element.createElement(gl,{label:dl("Falsy value"),help:dl("Provide the HTML entity code for the value the table should display when the value of the column is false. e.g. cross mark (Code: &#10006;) instead of false"),value:t.series[r].format?t.series[r].format.falsy:"",onChange:function(n){t.series[r].falsy||(t.series[r].falsy={}),t.series[r].format.falsy=n,e.props.edit(t)}})))}))):null}}])&&sl(n.prototype,r),a&&sl(n,a),t}(pl);function vl(e){return(vl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function wl(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Ml(e,t){return!t||"object"!==vl(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function kl(e){return(kl=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Ll(e,t){return(Ll=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Yl=wp.i18n.__,Dl=wp.element,Tl=Dl.Component,Sl=Dl.Fragment,Ol=(wp.blockEditor||wp.editor).ColorPalette,jl=wp.components,xl=jl.BaseControl,El=jl.CheckboxControl,Cl=jl.PanelBody,Pl=jl.SelectControl,Hl=jl.TextControl,zl=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Ml(this,kl(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ll(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-chart-type"],n=this.props.chart["visualizer-settings"];return wp.element.createElement(Cl,{title:Yl("Layout And Chart Area"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(Cl,{title:Yl("Layout"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Hl,{label:Yl("Width of Chart"),help:Yl("Determines the total width of the chart."),value:n.width,onChange:function(t){n.width=t,e.props.edit(n)}}),wp.element.createElement(Hl,{label:Yl("Height of Chart"),help:Yl("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(Pl,{label:Yl("Keep Aspect Ratio"),help:Yl("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:Yl("Yes"),value:"1"},{label:Yl("No"),value:"0"}],onChange:function(t){n.keepAspectRatio=t,e.props.edit(n)}}),-1>=["gauge"].indexOf(t)&&wp.element.createElement(Sl,null,wp.element.createElement(Hl,{label:Yl("Stroke Width"),help:Yl("The chart border width in pixels."),value:n.backgroundColor.strokeWidth,onChange:function(t){n.backgroundColor.strokeWidth=t,e.props.edit(n)}}),wp.element.createElement(xl,{label:Yl("Stroke Color")},wp.element.createElement(Ol,{value:n.backgroundColor.stroke,onChange:function(t){n.backgroundColor.stroke=t,e.props.edit(n)}})),wp.element.createElement(xl,{label:Yl("Background Color")},wp.element.createElement(Ol,{value:n.backgroundColor.fill,onChange:function(t){n.backgroundColor.fill=t,e.props.edit(n)}})),wp.element.createElement(El,{label:Yl("Transparent Background?"),checked:"transparent"===n.backgroundColor.fill,onChange:function(t){n.backgroundColor.fill="transparent"===n.backgroundColor.fill?"":"transparent",e.props.edit(n)}}))),-1>=["geo","gauge"].indexOf(t)&&wp.element.createElement(Cl,{title:Yl("Chart Area"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Hl,{label:Yl("Left Margin"),help:Yl("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(Hl,{label:Yl("Top Margin"),help:Yl("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(Hl,{label:Yl("Width Of Chart Area"),help:Yl("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(Hl,{label:Yl("Height Of Chart Area"),help:Yl("Determines the hight of the chart area."),value:n.chartArea.height,onChange:function(t){n.chartArea.height=t,e.props.edit(n)}})))}}])&&wl(n.prototype,r),a&&wl(n,a),t}(Tl);function Al(e){return(Al="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 Nl(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Fl(e,t){return!t||"object"!==Al(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Rl(e){return(Rl=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Wl(e,t){return(Wl=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Il=wp.i18n.__,Bl=wp.element,Jl=Bl.Component,Ul=Bl.Fragment,ql=wp.components,Vl=ql.CheckboxControl,Gl=ql.PanelBody,$l=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Fl(this,Rl(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Wl(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:function(){var e=this.props.chart["visualizer-settings"];void 0===e.actions&&(e.actions=[]),this.props.edit(e)}},{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"],n=this.props.chart["visualizer-chart-type"];return wp.element.createElement(Gl,{title:Il("Frontend Actions"),initialOpen:!1,className:"visualizer-advanced-panel"},void 0!==t.actions&&wp.element.createElement(Ul,null,wp.element.createElement(Vl,{label:Il("Print"),help:Il("To enable printing the data."),checked:0<=t.actions.indexOf("print"),onChange:function(n){if(0<=t.actions.indexOf("print")){var r=t.actions.indexOf("print");-1!==r&&t.actions.splice(r,1)}else t.actions.push("print");e.props.edit(t)}}),wp.element.createElement(Vl,{label:Il("CSV"),help:Il("To enable downloading the data as a CSV."),checked:0<=t.actions.indexOf("csv;application/csv"),onChange:function(n){if(0<=t.actions.indexOf("csv;application/csv")){var r=t.actions.indexOf("csv;application/csv");-1!==r&&t.actions.splice(r,1)}else t.actions.push("csv;application/csv");e.props.edit(t)}}),wp.element.createElement(Vl,{label:Il("Excel"),help:Il("To enable downloading the data as an Excel spreadsheet."),checked:0<=t.actions.indexOf("xls;application/vnd.ms-excel"),onChange:function(n){if(0<=t.actions.indexOf("xls;application/vnd.ms-excel")){var r=t.actions.indexOf("xls;application/vnd.ms-excel");-1!==r&&t.actions.splice(r,1)}else t.actions.push("xls;application/vnd.ms-excel");e.props.edit(t)}}),wp.element.createElement(Vl,{label:Il("Copy"),help:Il("To enable copying the data to the clipboard."),checked:0<=t.actions.indexOf("copy"),onChange:function(n){if(0<=t.actions.indexOf("copy")){var r=t.actions.indexOf("copy");-1!==r&&t.actions.splice(r,1)}else t.actions.push("copy");e.props.edit(t)}}),-1>=["dataTable","tabular","gauge","table"].indexOf(n)&&wp.element.createElement(Vl,{label:Il("Download Image"),help:Il("To download the chart as an image."),checked:0<=t.actions.indexOf("image"),onChange:function(n){if(0<=t.actions.indexOf("image")){var r=t.actions.indexOf("image");-1!==r&&t.actions.splice(r,1)}else t.actions.push("image");e.props.edit(t)}})))}}])&&Nl(n.prototype,r),a&&Nl(n,a),t}(Jl);function Kl(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Zl(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Kl(e,t,n[t])}))}return e}var Ql={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"}},Xl=n(2);const eu={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&&eu.throwError(eu.getCaller(2),e)},isFalsy:(e="<unknown parameter>",t)=>{t||eu.throwError(eu.getCaller(2),e)},isNoneOf:(e="<unknown parameter>",t,n=[])=>{-1===n.indexOf(t)&&eu.throwError(eu.getCaller(2),e,"to be any of"+JSON.stringify(n))},isAnyOf:(e="<unknown parameter>",t,n=[])=>{n.indexOf(t)>-1&&eu.throwError(eu.getCaller(2),e,"not to be any of"+JSON.stringify(n))},isNotType:(e="<unknown parameter>",t,n="")=>{Object(Xl.getType)(t)!==n.toLowerCase()&&eu.throwError(eu.getCaller(2),e,"to be type "+n.toLowerCase())},isAnyTypeOf:(e="<unknown parameter>",t,n=[])=>{n.forEach(n=>{Object(Xl.getType)(t)===n&&eu.throwError(eu.getCaller(2),e,"not to be type of "+n.toLowerCase())})},missingKey:(e="<unknown parameter>",t,n="")=>{eu.isUndefined(e,t),-1===Object.keys(t).indexOf(n)&&eu.throwError(eu.getCaller(2),e,"to contain '"+n+"' key")},missingAnyKeys:(e="<unknown parameter>",t,n=[""])=>{eu.isUndefined(e,t);const r=Object.keys(t);n.forEach(t=>{-1===r.indexOf(t)&&eu.throwError(eu.getCaller(2),e,"to contain '"+t+"' key")})},containsUndefined:(e="<unknown parameter>",t)=>{[void 0,null].forEach(n=>{const r=Object(Xl.locate)(t,n);r&&eu.throwError(eu.getCaller(2),e,"not to contain '"+JSON.stringify(n)+"' at "+r)})},isInvalidPath:(e="<unknown parameter>",t)=>{eu.isUndefined(e,t),eu.isNotType(e,t,"string"),eu.isAnyOf(e,t,["","/"]),".$[]#".split().forEach(n=>{t.indexOf(n)>-1&&eu.throwError(eu.getCaller(2),e,"not to contain invalid character '"+n+"'")}),t.match(/\/{2,}/g)&&eu.throwError(eu.getCaller(2),e,"not to contain consecutive forward slash characters")},isInvalidWriteData:(e="<unknown parameter>",t)=>{eu.isUndefined(e,t),eu.containsUndefined(e,t)}};var tu=eu;const nu=(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 ru={format:"{reason} at line {line}",symbols:{colon:"colon",comma:"comma",semicolon:"semicolon",slash:"slash",backslash:"backslash",brackets:{round:"round brackets",square:"square brackets",curly:"curly brackets",angle:"angle brackets"},period:"period",quotes:{single:"single quote",double:"double quote",grave:"grave accent"},space:"space",ampersand:"ampersand",asterisk:"asterisk",at:"at sign",equals:"equals sign",hash:"hash",percent:"percent",plus:"plus",minus:"minus",dash:"dash",hyphen:"hyphen",tilde:"tilde",underscore:"underscore",bar:"vertical bar"},types:{key:"key",value:"value",number:"number",string:"string",primitive:"primitive",boolean:"boolean",character:"character",integer:"integer",array:"array",float:"float"},invalidToken:{tokenSequence:{prohibited:"'{firstToken}' token cannot be followed by '{secondToken}' token(s)",permitted:"'{firstToken}' token can only be followed by '{secondToken}' token(s)"},termSequence:{prohibited:"A {firstTerm} cannot be followed by a {secondTerm}",permitted:"A {firstTerm} can only be followed by a {secondTerm}"},double:"'{token}' token cannot be followed by another '{token}' token",useInstead:"'{badToken}' token is not accepted. Use '{goodToken}' instead",unexpected:"Unexpected '{token}' token found"},brace:{curly:{missingOpen:"Missing '{' open curly brace",missingClose:"Open '{' curly brace is missing closing '}' curly brace",cannotWrap:"'{token}' token cannot be wrapped in '{}' curly braces"},square:{missingOpen:"Missing '[' open square brace",missingClose:"Open '[' square brace is missing closing ']' square brace",cannotWrap:"'{token}' token cannot be wrapped in '[]' square braces"}},string:{missingOpen:"Missing/invalid opening string '{quote}' token",missingClose:"Missing/invalid closing string '{quote}' token",mustBeWrappedByQuotes:"Strings must be wrapped by quotes",nonAlphanumeric:"Non-alphanumeric token '{token}' is not allowed outside string notation",unexpectedKey:"Unexpected key found at string position"},key:{numberAndLetterMissingQuotes:"Key beginning with number and containing letters must be wrapped by quotes",spaceMissingQuotes:"Key containing space must be wrapped by quotes",unexpectedString:"Unexpected string found at key position"},noTrailingOrLeadingComma:"Trailing or leading commas in arrays and objects are not permitted"};
65
  /** @license react-json-editor-ajrm v2.5.9
66
  *
67
  * This source code is licensed under the MIT license found in the
68
  * LICENSE file in the root directory of this source tree.
69
+ */class au extends r.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=Ql.dark_vscode_tribute;"theme"in this.props&&"string"==typeof this.props.theme&&this.props.theme in Ql&&(n=Ql[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 r=this.props.height||"610px",a=this.props.width||"479px";this.totalHeight=r,this.totalWidth=a,"onKeyPressUpdate"in this.props&&!this.props.onKeyPressUpdate?this.timer&&(clearInterval(this.timer),this.timer=!1):this.timer||(this.timer=setInterval(this.scheduledUpdate,100)),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.state.error,r=this.colors,i=this.style,o=this.confirmGood,s=this.totalHeight,l=this.totalWidth,u=!!n&&"token"in n;return this.renderCount++,a.a.createElement("div",{name:"outer-box",id:e&&e+"-outer-box",style:Zl({display:"block",overflow:"none",height:s,width:l,margin:0,boxSizing:"border-box",position:"relative"},i.outerBox)},o?a.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)"}},a.a.createElement("svg",{height:"30px",width:"30px",viewBox:"0 0 100 100"},a.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,a.a.createElement("div",{name:"container",id:e&&e+"-container",style:Zl({display:"block",height:s,width:l,margin:0,boxSizing:"border-box",overflow:"hidden",fontFamily:"Roboto, sans-serif"},i.container),onClick:this.onClick},a.a.createElement("div",{name:"warning-box",id:e&&e+"-warning-box",style:Zl({display:"block",overflow:"hidden",height:u?"60px":"0px",width:"100%",margin:0,backgroundColor:r.background_warning,transitionDuration:"0.2s",transitionTimingFunction:"cubic-bezier(0, 1, 0.5, 1)"},i.warningBox),onClick:this.onClick},a.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},a.a.createElement("div",{style:{position:"relative",top:0,left:0,height:"60px",width:"60px",margin:0,pointerEvents:"none"},onClick:this.onClick},a.a.createElement("div",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",pointerEvents:"none"},onClick:this.onClick},a.a.createElement("svg",{height:"25px",width:"25px",viewBox:"0 0 100 100"},a.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"}))))),a.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())),a.a.createElement("div",{name:"body",id:e&&e+"-body",style:Zl({display:"flex",overflow:"none",height:u?"calc(100% - 60px)":"100%",width:"",margin:0,resize:"none",fontFamily:"Roboto Mono, Monaco, monospace",fontSize:"11px",backgroundColor:r.background,transitionDuration:"0.2s",transitionTimingFunction:"cubic-bezier(0, 1, 0.5, 1)"},i.body),onClick:this.onClick},a.a.createElement("span",{name:"labels",id:e&&e+"-labels",ref:e=>this.refLabels=e,style:Zl({display:"inline-block",boxSizing:"border-box",verticalAlign:"top",height:"100%",width:"44px",margin:0,padding:"5px 0px 5px 10px",overflow:"hidden",color:"#D4D4D4"},i.labelColumn),onClick:this.onClick},this.renderLabels()),a.a.createElement("span",{id:e,ref:e=>this.refContent=e,contentEditable:!0,style:Zl({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"},i.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||ru,t=this.state.error,n=this.style;if(t)return a.a.createElement("p",{style:Zl({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)},nu(e.format,t))}renderLabels(){const e=this.colors,t=this.style,n=this.state.error?this.state.error.line:-1,r=this.state.lines?this.state.lines:1;let i=new Array(r);for(var o=0;o<r-1;o++)i[o]=o+1;return i.map(r=>{const i=r!==n?e.default:"red";return a.a.createElement("div",{key:r,style:Zl({},t.labels,{color:i})},r)})}createMarkup(e){return void 0===e?{__html:""}:{__html:""+e}}newSpan(e,t,n){let r=this.colors,a=t.type,i=t.string,o="";switch(a){case"string":case"number":case"primitive":case"error":o=r[t.type];break;case"key":o=" "===i?r.keys_whiteSpace:r.keys;break;case"symbol":o=":"===i?r.colon:r.default;break;default:o=r.default}return i.length!==i.replace(/</g,"").replace(/>/g,"").length&&(i="<xmp style=display:inline;>"+i+"</xmp>"),'<span type="'+a+'" value="'+i+'" depth="'+n+'" style="color:'+o+'">'+i+"</span>"}getCursorPosition(e){let t,n=window.getSelection(),r=-1,a=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,r=n.focusOffset;t&&t!==this.refContent;)if(t.previousSibling)t=t.previousSibling,e&&"BR"===t.nodeName&&a++,r+=t.textContent.length;else if(null===(t=t.parentNode))break;return r+a}setCursorPosition(e){if([!1,null,void 0].indexOf(e)>-1)return;const t=(e,n,r)=>{if(r||((r=document.createRange()).selectNode(e),r.setStart(e,0)),0===n.count)r.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:(r.setEnd(e,n.count),n.count=0);else for(var a=0;a<e.childNodes.length&&(r=t(e.childNodes[a],n,r),0!==n.count);a++);return r};e>0?(e=>{if(e<0)return;let n=window.getSelection(),r=t(this.refContent,{count:e});r&&(r.collapse(!1),n.removeAllRanges(),n.addRange(r))})(e):this.refContent.focus()}update(e=0,t=!0){const n=this.refContent,r=this.tokenize(n);"onChange"in this.props&&this.props.onChange({plainText:r.indented,markupText:r.markup,json:r.json,jsObject:r.jsObject,lines:r.lines,error:r.error});let a=this.getCursorPosition(r.error)+e;this.setState({plainText:r.indented,markupText:r.markup,json:r.json,jsObject:r.jsObject,lines:r.lines,error:r.error}),this.updateTime=!1,t&&this.setCursorPosition(a)}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("insertHTML",!1,t)}this.update()}onClick(){"viewOnly"in this.props&&this.props.viewOnly}onBlur(){"viewOnly"in this.props&&this.props.viewOnly||this.update(0,!1)}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:r}=this,a=Object(Xl.getType)(e);-1===["object","array"].indexOf(a)&&tu.throwError("showPlaceholder","placeholder","either an object or an array");let i=!Object(Xl.identical)(e,t);if(i||r&&void 0!==n&&(i=!Object(Xl.identical)(e,n)),!i)return;const o=this.tokenize(e);this.setState({prevPlaceholder:e,plainText:o.indentation,markupText:o.markup,lines:o.lines,error:o.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||ru,n=this.newSpan;if("nodeType"in e){const M=e.cloneNode(!0);if(!M.hasChildNodes())return"";const k=M.childNodes;let L={tokens_unknown:[],tokens_proto:[],tokens_split:[],tokens_fallback:[],tokens_normalize:[],tokens_merge:[],tokens_plainText:"",indented:"",json:"",jsObject:void 0,markup:""};for(var r=0;r<k.length;r++){let e=k[r],t={};switch(e.nodeName){case"SPAN":t={string:e.textContent,type:e.attributes.type.textContent},L.tokens_unknown.push(t);break;case"DIV":L.tokens_unknown.push({string:e.textContent,type:"unknown"});break;case"BR":""===e.textContent&&L.tokens_unknown.push({string:"\n",type:"unknown"});break;case"#text":L.tokens_unknown.push({string:e.wholeText,type:"unknown"});break;case"FONT":L.tokens_unknown.push({string:e.textContent,type:"unknown"});break;default:console.error("Unrecognized node:",{child:e})}}function a(e,t=""){let n={active:!1,string:"",number:"",symbol:"",space:"",delimiter:"",quarks:[]};function r(e,r){switch(r){case"symbol":case"delimiter":n.active&&n.quarks.push({string:n[n.active],type:t+"-"+n.active}),n[n.active]="",n.active=r,n[n.active]=e;break;default:r!==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=r,n[n.active]=e):n[r]+=e}}for(var a=0;a<e.length;a++){const t=e.charAt(a);switch(t){case'"':case"'":r(t,"delimiter");break;case" ":case" ":r(t,"space");break;case"{":case"}":case"[":case"]":case":":case",":r(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?r(t,"string"):r(t,"number");break;case"-":if(a<e.length-1&&"0123456789".indexOf(e.charAt(a+1))>-1){r(t,"number");break}case".":if(a<e.length-1&&a>0&&"0123456789".indexOf(e.charAt(a+1))>-1&&"0123456789".indexOf(e.charAt(a-1))>-1){r(t,"number");break}default:r(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(r=0;r<L.tokens_unknown.length;r++){let e=L.tokens_unknown[r];L.tokens_proto=L.tokens_proto.concat(a(e.string,"proto"))}function i(e,t){let n="",r="",a=!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),r=e.charAt(e.length-1),-1===(a="'\"".indexOf(n)))return!1;if(n!==r)return!1;for(var i=0;i<e.length;i++)if(i>0&&i<e.length-1&&e.charAt(i)==="'\""[a]&&"\\"!==e.charAt(i-1))return!1;break;case"key":if(0===e.length)return!1;if(n=e.charAt(0),r=e.charAt(e.length-1),(a="'\"".indexOf(n))>-1){if(1===e.length)return!1;if(n!==r)return!1;for(i=0;i<e.length;i++)if(i>0&&i<e.length-1&&e.charAt(i)==="'\""[a]&&"\\"!==e.charAt(i-1))return!1}else{const t="'\"`.,:;{}[]&<>=~*%\\|/-+!?@^  ";for(i=0;i<t.length;i++){const n=t.charAt(i);if(e.indexOf(n)>-1)return!1}}break;case"number":for(i=0;i<e.length;i++)if(-1==="0123456789".indexOf(e.charAt(i)))if(0===i){if("-"!==e.charAt(0))return!1}else if("."!==e.charAt(i))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(r=0;r<L.tokens_proto.length;r++){let e=L.tokens_proto[r];-1===e.type.indexOf("proto")?i(e.string,e.type)?L.tokens_split.push(e):L.tokens_split=L.tokens_split.concat(a(e.string,"split")):L.tokens_split.push(e)}for(r=0;r<L.tokens_split.length;r++){let e=L.tokens_split[r],t=e.type,n=e.string,a=n.length,i=[];t.indexOf("-")>-1&&("string"!==(t=t.slice(t.indexOf("-")+1))&&i.push("string"),i.push("key"),i.push("error"));let o={string:n,length:a,type:t,fallback:i};L.tokens_fallback.push(o)}function o(){const e=L.tokens_normalize.length-1;if(e<1)return!1;for(var t=e;t>=0;t--){const e=L.tokens_normalize[t];switch(e.type){case"space":case"linebreak":break;default:return e}}return!1}let Y={brackets:[],stringOpen:!1,isValue:!1};for(r=0;r<L.tokens_fallback.length;r++){let e=L.tokens_fallback[r];const t=e.type,n=e.string;let a={type:t,string:n};switch(t){case"symbol":case"colon":if(Y.stringOpen){Y.isValue?a.type="string":a.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"===o().type)break;Y.isValue="["===Y.brackets[Y.brackets.length-1];break;case":":a.type="colon",Y.isValue=!0}break;case"delimiter":if(Y.isValue?a.type="string":a.type="key",!Y.stringOpen){Y.stringOpen=n;break}if(r>0){const e=L.tokens_fallback[r-1],t=e.string,n=e.type,a=t.charAt(t.length-1);if("string"===n&&"\\"===a)break}if(Y.stringOpen===n){Y.stringOpen=!1;break}break;case"primitive":case"string":if(["false","true","null","undefined"].indexOf(n)>-1){const e=L.tokens_normalize.length-1;if(e>=0){if("string"!==L.tokens_normalize[e].type){a.type="primitive";break}a.type="string";break}a.type="primitive";break}if("\n"===n&&!Y.stringOpen){a.type="linebreak";break}Y.isValue?a.type="string":a.type="key";break;case"space":case"number":Y.stringOpen&&(Y.isValue?a.type="string":a.type="key")}L.tokens_normalize.push(a)}for(r=0;r<L.tokens_normalize.length;r++){const e=L.tokens_normalize[r];let t={string:e.string,type:e.type,tokens:[r]};if(-1===["symbol","colon"].indexOf(e.type)&&r+1<L.tokens_normalize.length){let n=0;for(var s=r+1;s<L.tokens_normalize.length;s++){const r=L.tokens_normalize[s];if(e.type!==r.type)break;t.string+=r.string,t.tokens.push(s),n++}r+=n}L.tokens_merge.push(t)}const D="'\"",T="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_$";var l=!1,u=L.tokens_merge.length>0?1:0;function c(e,t,n=0){l={token:e,line:u,reason:t},L.tokens_merge[e+n].type="error"}function d(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===L.tokens_merge.length-1)return!1;for(var n=e+1;n<L.tokens_merge.length;n++){const e=L.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=L.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 p(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=L.tokens_merge[t];switch(e.type){case"space":case"linebreak":break;default:return e.type}}return!1}Y={brackets:[],stringOpen:!1,isValue:!1};let S=[];for(r=0;r<L.tokens_merge.length&&!l;r++){let e=L.tokens_merge[r],n=e.string,a=e.type,i=!1;switch(a){case"space":break;case"linebreak":u++;break;case"symbol":switch(n){case"{":case"[":if(i=m(r,["}","]"])){c(r,nu(t.invalidToken.tokenSequence.prohibited,{firstToken:L.tokens_merge[i].string,secondToken:n}));break}if("["===n&&r>0&&!m(r,[":","[",","])){c(r,nu(t.invalidToken.tokenSequence.permitted,{firstToken:"[",secondToken:[":","[",","]}));break}if("{"===n&&m(r,["{"])){c(r,nu(t.invalidToken.double,{token:"{"}));break}Y.brackets.push(n),Y.isValue="["===Y.brackets[Y.brackets.length-1],S.push({i:r,line:u,string:n});break;case"}":case"]":if("}"===n&&"{"!==Y.brackets[Y.brackets.length-1]){c(r,nu(t.brace.curly.missingOpen));break}if("}"===n&&m(r,[","])){c(r,nu(t.invalidToken.tokenSequence.prohibited,{firstToken:",",secondToken:"}"}));break}if("]"===n&&"["!==Y.brackets[Y.brackets.length-1]){c(r,nu(t.brace.square.missingOpen));break}if("]"===n&&m(r,[":"])){c(r,nu(t.invalidToken.tokenSequence.prohibited,{firstToken:":",secondToken:"]"}));break}Y.brackets.pop(),Y.isValue="["===Y.brackets[Y.brackets.length-1],S.push({i:r,line:u,string:n});break;case",":if(i=m(r,["{"])){if(d(r,["}"])){c(r,nu(t.brace.curly.cannotWrap,{token:","}));break}c(r,nu(t.invalidToken.tokenSequence.prohibited,{firstToken:"{",secondToken:","}));break}if(d(r,["}",",","]"])){c(r,nu(t.noTrailingOrLeadingComma));break}switch(i=p(r)){case"key":case"colon":c(r,nu(t.invalidToken.termSequence.prohibited,{firstTerm:"key"===i?t.types.key:t.symbols.colon,secondTerm:t.symbols.comma}));break;case"symbol":if(m(r,["{"])){c(r,nu(t.invalidToken.tokenSequence.prohibited,{firstToken:"{",secondToken:","}));break}}Y.isValue="["===Y.brackets[Y.brackets.length-1]}L.json+=n;break;case"colon":if((i=m(r,["["]))&&d(r,["]"])){c(r,nu(t.brace.square.cannotWrap,{token:":"}));break}if(i){c(r,nu(t.invalidToken.tokenSequence.prohibited,{firstToken:"[",secondToken:":"}));break}if("key"!==p(r)){c(r,nu(t.invalidToken.termSequence.permitted,{firstTerm:t.symbols.colon,secondTerm:t.types.key}));break}if(d(r,["}","]"])){c(r,nu(t.invalidToken.termSequence.permitted,{firstTerm:t.symbols.colon,secondTerm:t.types.value}));break}Y.isValue=!0,L.json+=n;break;case"key":case"string":let e=n.charAt(0),o=n.charAt(n.length-1);D.indexOf(e);if(-1===D.indexOf(e)&&-1!==D.indexOf(o)){c(r,nu(t.string.missingOpen,{quote:e}));break}if(-1===D.indexOf(o)&&-1!==D.indexOf(e)){c(r,nu(t.string.missingClose,{quote:e}));break}if(D.indexOf(e)>-1&&e!==o){c(r,nu(t.string.missingClose,{quote:e}));break}if("string"===a&&-1===D.indexOf(e)&&-1===D.indexOf(o)){c(r,nu(t.string.mustBeWrappedByQuotes));break}if("key"===a&&d(r,["}","]"])&&c(r,nu(t.invalidToken.termSequence.permitted,{firstTerm:t.types.key,secondTerm:t.symbols.colon})),-1===D.indexOf(e)&&-1===D.indexOf(o))for(var h=0;h<n.length&&!l;h++){const e=n.charAt(h);if(-1===T.indexOf(e)){c(r,nu(t.string.nonAlphanumeric,{token:e}));break}}if("'"===e?n='"'+n.slice(1,-1)+'"':'"'!==e&&(n='"'+n+'"'),"key"===a&&"key"===p(r)){if(r>0&&!isNaN(L.tokens_merge[r-1])){L.tokens_merge[r-1]+=L.tokens_merge[r],c(r,nu(t.key.numberAndLetterMissingQuotes));break}c(r,nu(t.key.spaceMissingQuotes));break}if("key"===a&&!m(r,["{",","])){c(r,nu(t.invalidToken.tokenSequence.permitted,{firstToken:a,secondToken:["{",","]}));break}if("string"===a&&!m(r,["[",":",","])){c(r,nu(t.invalidToken.tokenSequence.permitted,{firstToken:a,secondToken:["[",":",","]}));break}if("key"===a&&Y.isValue){c(r,nu(t.string.unexpectedKey));break}if("string"===a&&!Y.isValue){c(r,nu(t.key.unexpectedString));break}L.json+=n;break;case"number":case"primitive":if(m(r,["{"]))L.tokens_merge[r].type="key",a=L.tokens_merge[r].type,n='"'+n+'"';else if("key"===p(r))L.tokens_merge[r].type="key",a=L.tokens_merge[r].type;else if(!m(r,["[",":",","])){c(r,nu(t.invalidToken.tokenSequence.permitted,{firstToken:a,secondToken:["[",":",","]}));break}"key"!==a&&(Y.isValue||(L.tokens_merge[r].type="key",a=L.tokens_merge[r].type,n='"'+n+'"')),"primitive"===a&&"undefined"===n&&c(r,nu(t.invalidToken.useInstead,{badToken:"undefined",goodToken:"null"})),L.json+=n}}let O="";for(r=0;r<L.json.length;r++){let e=L.json.charAt(r),t="";r+1<L.json.length&&(t=L.json.charAt(r+1),"\\"===e&&"'"===t)?(O+=t,r++):O+=e}if(L.json=O,!l){const e=Math.ceil(S.length/2);let n=0,r=!1;function f(e){S.splice(e+1,1),S.splice(e,1),r||(r=!0)}for(;S.length>0;){r=!1;for(var _=0;_<S.length-1;_++){const e=S[_].string+S[_+1].string;["[]","{}"].indexOf(e)>-1&&f(_)}if(n++,!r)break;if(n>=e)break}if(S.length>0){const e=S[0].string,n=S[0].i,r="["===e?"]":"}";u=S[0].line,c(n,nu(t.brace["]"===r?"square":"curly"].missingClose))}}if(!l&&-1===[void 0,""].indexOf(L.json))try{L.jsObject=JSON.parse(L.json)}catch(e){const n=e.message,r=n.indexOf("position");if(-1===r)throw new Error("Error parsing failed");const a=n.substring(r+9,n.length),i=parseInt(a);let o=0,s=0,d=!1,m=1,p=!1;for(;o<i&&!p&&("linebreak"===(d=L.tokens_merge[s]).type&&m++,-1===["space","linebreak"].indexOf(d.type)&&(o+=d.string.length),!(o>=i));)s++,L.tokens_merge[s+1]||(p=!0);u=m;let h=0;for(let e=0;e<d.string.length;e++){const n=d.string.charAt(e);"\\"===n?h=h>0?h+1:1:(h%2==0&&0!==h||-1==="'\"bfnrt".indexOf(n)&&c(s,nu(t.invalidToken.unexpected,{token:"\\"})),h=0)}l||c(s,nu(t.invalidToken.unexpected,{token:d.string}))}let j=1,x=0;function y(){for(var e=[],t=0;t<2*x;t++)e.push("&nbsp;");return e.join("")}function g(e=!1){return j++,x>0||e?"<br>":""}function b(e=!1){return g(e)+y()}if(!l)for(r=0;r<L.tokens_merge.length;r++){const e=L.tokens_merge[r],t=e.string;switch(e.type){case"space":case"linebreak":break;case"string":case"number":case"primitive":case"error":L.markup+=(m(r,[",","["])?b():"")+n(r,e,x);break;case"key":L.markup+=b()+n(r,e,x);break;case"colon":L.markup+=n(r,e,x)+"&nbsp;";break;case"symbol":switch(t){case"[":case"{":L.markup+=(m(r,[":"])?"":b())+n(r,e,x),x++;break;case"]":case"}":x--;const t=r===L.tokens_merge.length-1,a=r>0?["[","{"].indexOf(L.tokens_merge[r-1].string)>-1?"":b(t):"";L.markup+=a+n(r,e,x);break;case",":L.markup+=n(r,e,x)}}}if(l){let e=1;function v(e){let t=0;for(var n=0;n<e.length;n++)["\n","\r"].indexOf(e[n])>-1&&t++;return t}j=1;for(r=0;r<L.tokens_merge.length;r++){const t=L.tokens_merge[r],a=t.type,i=t.string;"linebreak"===a&&j++,L.markup+=n(r,t,x),e+=v(i)}e++,++j<e&&(j=e)}for(r=0;r<L.tokens_merge.length;r++){let e=L.tokens_merge[r];L.indented+=e.string,-1===["space","linebreak"].indexOf(e.type)&&(L.tokens_plainText+=e.string)}if(l){"modifyErrorText"in this.props&&((w=this.props.modifyErrorText)&&"[object Function]"==={}.toString.call(w)&&(l.reason=this.props.modifyErrorText(l.reason)))}return{tokens:L.tokens_merge,noSpaces:L.tokens_plainText,indented:L.indented,json:L.json,jsObject:L.jsObject,markup:L.markup,lines:j,error:l}}var w;if(!("nodeType"in e)){let t={inputText:JSON.stringify(e),position:0,currentChar:"",tokenPrimary:"",tokenSecondary:"",brackets:[],isValue:!1,stringOpen:!1,stringStart:0,tokens:[]};function M(){return"\\"===t.currentChar&&(t.inputText=(e=t.inputText,n=t.position,e.slice(0,n)+e.slice(n+1)),!0);var e,n}function k(){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){return Y(),D(t.inputText.substring(t.stringStart,t.position+1)),t.stringOpen=!1,!0}return!1}function L(){if(-1===":,{}[]".indexOf(t.currentChar))return!1;if(t.stringOpen)return!1;switch(Y(),D(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 D(e){return 0!==e.length&&(t.tokens.push(e),!0)}for(r=0;r<t.inputText.length;r++){t.position=r,t.currentChar=t.inputText.charAt(t.position);const e=L(),n=k(),a=M();e||n||a||t.stringOpen||(t.tokenSecondary+=t.currentChar)}let a={brackets:[],isValue:!1,tokens:[]};a.tokens=t.tokens.map(e=>{let t="",n="",r="";switch(e){case",":t="symbol",n=e,r=e,a.isValue="["===a.brackets[a.brackets.length-1];break;case":":t="symbol",n=e,r=e,a.isValue=!0;break;case"{":case"[":t="symbol",n=e,r=e,a.brackets.push(e),a.isValue="["===a.brackets[a.brackets.length-1];break;case"}":case"]":t="symbol",n=e,r=e,a.brackets.pop(),a.isValue="["===a.brackets[a.brackets.length-1];break;case"undefined":t="primitive",n=e,r=void 0;break;case"null":t="primitive",n=e,r=null;break;case"false":t="primitive",n=e,r=!1;break;case"true":t="primitive",n=e,r=!0;break;default:const o=e.charAt(0);if("'\"".indexOf(o)>-1){if("key"===(t=a.isValue?"string":"key")&&(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 r=e.replace(/\w/g,""),a=(e.replace(/\W+/g,""),((e,t)=>{let n=!1;for(var r=0;r<t.length&&(0!==r||!isNaN(t.charAt(r)));r++)if(isNaN(t.charAt(r))){n=!0;break}return!(e.length>0||n)})(r,e));if((e=>{for(var t=0;t<e.length;t++)if(["'",'"'].indexOf(e.charAt(t))>-1)return!0;return!1})(r)){let t="";const n=e.split("");for(var i=0;i<n.length;i++){let e=n[i];["'",'"'].indexOf(e)>-1&&(e="\\"+e),t+=e}e=t}return a?e:"'"+e+"'"}(e)),"string"===t){n="";const t=e.slice(1,-1).split("");for(var i=0;i<t.length;i++){let e=t[i];"'\"".indexOf(e)>-1&&(e="\\"+e),n+=e}n="'"+n+"'"}r=n;break}if(!isNaN(e)){t="number",n=e,r=Number(e);break}if(e.length>0&&!a.isValue){t="key",(n=e).indexOf(" ")>-1&&(n="'"+n+"'"),r=n;break}}return{type:t,string:n,value:r,depth:a.brackets.length}});let i="";for(r=0;r<a.tokens.length;r++){i+=a.tokens[r].string}function T(e){for(var t=[],n=0;n<2*e;n++)t.push(" ");return(e>0?"\n":"")+t.join("")}let o="";for(r=0;r<a.tokens.length;r++){let e=a.tokens[r];switch(e.string){case"[":case"{":const t=r<a.tokens.length-1-1?a.tokens[r+1]:"";-1==="}]".indexOf(t.string)?o+=e.string+T(e.depth):o+=e.string;break;case"]":case"}":const n=r>0?a.tokens[r-1]:"";-1==="[{".indexOf(n.string)?o+=T(e.depth)+e.string:o+=e.string;break;case":":o+=e.string+" ";break;case",":o+=e.string+T(e.depth);break;default:o+=e.string}}let s=1;function S(e){var t=[];e>0&&s++;for(var n=0;n<2*e;n++)t.push("&nbsp;");return(e>0?"<br>":"")+t.join("")}let l="";const u=a.tokens.length-1;for(r=0;r<a.tokens.length;r++){let e=a.tokens[r],t=n(r,e,e.depth);switch(e.string){case"{":case"[":const n=r<a.tokens.length-1-1?a.tokens[r+1]:"";-1==="}]".indexOf(n.string)?l+=t+S(e.depth):l+=t;break;case"}":case"]":const i=r>0?a.tokens[r-1]:"";-1==="[{".indexOf(i.string)?l+=S(e.depth)+(u===r?"<br>":"")+t:l+=t;break;case":":l+=t+" ";break;case",":l+=t+S(e.depth);break;default:l+=t}}return s+=2,{tokens:a.tokens,noSpaces:i,indented:o,json:JSON.stringify(e),jsObject:e,markup:l,lines:s}}}}var iu=au,ou=n(133),su=n.n(ou);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){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function cu(e){return(cu=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function du(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function mu(e,t){return(mu=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var pu=wp.i18n.__,hu=wp.element.Component,fu=wp.components,_u=fu.ExternalLink,yu=fu.PanelBody,gu=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t){return!t||"object"!==lu(t)&&"function"!=typeof t?du(e):t}(this,cu(t).apply(this,arguments))).isValidJSON=e.isValidJSON.bind(du(e)),e}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&mu(e,t)}(t,e),n=t,(r=[{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(yu,{title:pu("Manual Configuration"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement("p",null,pu("Configure the graph by providing configuration variables right from the Google Visualization API.")),wp.element.createElement("p",null,wp.element.createElement(_u,{href:"https://developers.google.com/chart/interactive/docs/gallery/".concat(e,"#configuration-options")},pu("Google Visualization API"))),wp.element.createElement(iu,{locale:su.a,theme:"light_mitsuketa_tribute",placeholder:$(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))}}))}}])&&uu(n.prototype,r),a&&uu(n,a),t}(hu);function bu(e){return(bu="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 vu(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function wu(e,t){return!t||"object"!==bu(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Mu(e){return(Mu=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ku(e,t){return(ku=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Lu=wp.element,Yu=Lu.Component,Du=Lu.Fragment,Tu=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),wu(this,Mu(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ku(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this.props.chart["visualizer-chart-type"],t=this.props.chart["visualizer-chart-library"];return wp.element.createElement(Du,null,wp.element.createElement(ar,{chart:this.props.chart,attributes:this.props.attributes,edit:this.props.edit}),wp.element.createElement(qn,{chart:this.props.chart,edit:this.props.edit}),-1>=["tabular","dataTable","gauge","geo","pie","timeline"].indexOf(e)&&wp.element.createElement(wr,{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}),0<=["pie"].indexOf(e)&&wp.element.createElement(Du,null,wp.element.createElement(ta,{chart:this.props.chart,edit:this.props.edit}),wp.element.createElement(ha,{chart:this.props.chart,edit:this.props.edit})),0<=["area","scatter","line"].indexOf(e)&&wp.element.createElement(Sa,{chart:this.props.chart,edit:this.props.edit}),0<=["bar","column"].indexOf(e)&&wp.element.createElement(Ra,{chart:this.props.chart,edit:this.props.edit}),0<=["candlestick"].indexOf(e)&&wp.element.createElement(ei,{chart:this.props.chart,edit:this.props.edit}),0<=["geo"].indexOf(e)&&wp.element.createElement(Du,null,wp.element.createElement(pi,{chart:this.props.chart,edit:this.props.edit}),wp.element.createElement(Di,{chart:this.props.chart,edit:this.props.edit}),wp.element.createElement(Ri,{chart:this.props.chart,edit:this.props.edit}),wp.element.createElement(Qi,{chart:this.props.chart,edit:this.props.edit})),0<=["gauge"].indexOf(e)&&wp.element.createElement(fo,{chart:this.props.chart,edit:this.props.edit}),0<=["timeline"].indexOf(e)&&wp.element.createElement(So,{chart:this.props.chart,edit:this.props.edit}),0<=["tabular","dataTable"].indexOf(e)&&wp.element.createElement(Du,null,wp.element.createElement(Bo,{chart:this.props.chart,edit:this.props.edit}),wp.element.createElement(as,{chart:this.props.chart,edit:this.props.edit})),0<=["combo"].indexOf(e)&&wp.element.createElement(fs,{chart:this.props.chart,edit:this.props.edit}),-1>=["timeline","bubble","gauge","geo","pie","tabular","dataTable"].indexOf(e)&&wp.element.createElement(Es,{chart:this.props.chart,edit:this.props.edit}),"tabular"===e&&"GoogleCharts"===t&&wp.element.createElement(Es,{chart:this.props.chart,edit:this.props.edit}),0<=["bubble"].indexOf(e)&&wp.element.createElement(il,{chart:this.props.chart,edit:this.props.edit}),0<=["pie"].indexOf(e)&&wp.element.createElement(Us,{chart:this.props.chart,edit:this.props.edit}),"DataTable"===t&&wp.element.createElement(bl,{chart:this.props.chart,edit:this.props.edit}),"DataTable"!==t&&wp.element.createElement(zl,{chart:this.props.chart,edit:this.props.edit}),wp.element.createElement($l,{chart:this.props.chart,edit:this.props.edit}),"DataTable"!==t&&wp.element.createElement(gu,{chart:this.props.chart,edit:this.props.edit}))}}])&&vu(n.prototype,r),a&&vu(n,a),t}(Yu);function Su(e){return(Su="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 Ou(e,t,n,r,a,i,o){try{var s=e[i](o),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,a)}function ju(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var i=e.apply(t,n);function o(e){Ou(i,r,a,o,s,"next",e)}function s(e){Ou(i,r,a,o,s,"throw",e)}o(void 0)}))}}function xu(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Eu(e){return(Eu=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Cu(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Pu(e,t){return(Pu=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Hu=wp.i18n.__,zu=wp.apiFetch,Au=wp.element,Nu=Au.Component,Fu=Au.Fragment,Ru=wp.components,Wu=Ru.Button,Iu=Ru.PanelBody,Bu=Ru.SelectControl,Ju=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t){return!t||"object"!==Su(t)&&"function"!=typeof t?Cu(e):t}(this,Eu(t).apply(this,arguments))).getPermissionData=e.getPermissionData.bind(Cu(e)),e.state={users:[],roles:[]},e}var n,r,a,i,o;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Pu(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:(o=ju(regeneratorRuntime.mark((function e(){var t,n,r;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,zu({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,zu({path:"/visualizer/v1/get-permission-data?type=roles"});case 12:r=e.sent,this.setState({roles:r});case 14:case"end":return e.stop()}}),e,this)}))),function(){return o.apply(this,arguments)})},{key:"getPermissionData",value:(i=ju(regeneratorRuntime.mark((function e(t){var n,r;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,zu({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,zu({path:"/visualizer/v1/get-permission-data?type=".concat(t)});case 9:r=e.sent,this.setState({roles:r});case 11:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"render",value:function(){var e,t=this;return"business"===visualizerLocalize.isPro&&(e=this.props.chart["visualizer-permissions"]),wp.element.createElement(Fu,null,"business"===visualizerLocalize.isPro?wp.element.createElement(Iu,{title:Hu("Who can see this chart?"),initialOpen:!1},wp.element.createElement(Bu,{label:Hu("Select who can view the chart on the front-end."),value:e.permissions.read,options:[{value:"all",label:"All Users"},{value:"users",label:"Select Users"},{value:"roles",label:"Select Roles"}],onChange:function(n){e.permissions.read=n,t.props.edit(e),"users"!==n&&"roles"!==n||t.getPermissionData(n)}}),("users"===e.permissions.read||"roles"===e.permissions.read)&&wp.element.createElement(Bu,{multiple:!0,value:e.permissions["read-specific"],options:"users"===e.permissions.read&&this.state.users||"roles"===e.permissions.read&&this.state.roles,onChange:function(n){e.permissions["read-specific"]=n,t.props.edit(e)}})):wp.element.createElement(Iu,{title:Hu("Who can see this chart?"),icon:"lock",initialOpen:!1},wp.element.createElement("p",null,Hu("Upgrade your license to at least the DEVELOPER version to activate this feature!")),wp.element.createElement(Wu,{isPrimary:!0,href:visualizerLocalize.proTeaser,target:"_blank"},Hu("Buy Now"))),"business"===visualizerLocalize.isPro?wp.element.createElement(Iu,{title:Hu("Who can edit this chart?"),initialOpen:!1},wp.element.createElement(Bu,{label:Hu("Select who can edit the chart on the front-end."),value:e.permissions.edit,options:[{value:"all",label:"All Users"},{value:"users",label:"Select Users"},{value:"roles",label:"Select Roles"}],onChange:function(n){e.permissions.edit=n,t.props.edit(e),"users"!==n&&"roles"!==n||t.getPermissionData(n)}}),("users"===e.permissions.edit||"roles"===e.permissions.edit)&&wp.element.createElement(Bu,{multiple:!0,value:e.permissions["edit-specific"],options:"users"===e.permissions.edit&&this.state.users||"roles"===e.permissions.edit&&this.state.roles,onChange:function(n){e.permissions["edit-specific"]=n,t.props.edit(e)}})):wp.element.createElement(Iu,{title:Hu("Who can edit this chart?"),icon:"lock",initialOpen:!1},wp.element.createElement("p",null,Hu("Upgrade your license to at least the DEVELOPER version to activate this feature!")),wp.element.createElement(Wu,{isPrimary:!0,href:visualizerLocalize.proTeaser,target:"_blank"},Hu("Buy Now"))))}}])&&xu(n.prototype,r),a&&xu(n,a),t}(Nu),Uu=n(134),qu=n.n(Uu),Vu=wp.components,Gu=Vu.Button,$u=Vu.Dashicon,Ku=Vu.G,Zu=Vu.Path,Qu=Vu.SVG;var Xu=function(e){var t=e.label,n=e.icon,r=e.className,a=e.isBack,i=e.onClick,o=qu()("components-panel__body","components-panel__body-button",r,{"visualizer-panel-back":a});return wp.element.createElement("div",{className:o},wp.element.createElement("h2",{className:"components-panel__body-title"},wp.element.createElement(Gu,{className:"components-panel__body-toggle",onClick:i},wp.element.createElement(Qu,{className:"components-panel__arrow",width:"24px",height:"24px",viewBox:"-12 -12 48 48",xmlns:"http://www.w3.org/2000/svg"},wp.element.createElement(Ku,null,wp.element.createElement(Zu,{fill:"none",d:"M0,0h24v24H0V0z"})),wp.element.createElement(Ku,null,wp.element.createElement(Zu,{d:"M7.41,8.59L12,13.17l4.59-4.58L18,10l-6,6l-6-6L7.41,8.59z"}))),n&&wp.element.createElement($u,{icon:n,className:"components-panel__icon"}),t)))},ec=n(3),tc=n.n(ec);function nc(e){return(nc="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){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ac(e,t){return!t||"object"!==nc(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function ic(e){return(ic=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function oc(e,t){return(oc=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var sc=lodash.startCase,lc=wp.i18n.__,uc=wp.element,cc=uc.Component,dc=uc.Fragment,mc=(wp.blockEditor||wp.editor).InspectorControls,pc=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=ac(this,ic(t).apply(this,arguments))).state={route:"home"},e}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&oc(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e,t,n=this,r=U(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=sc(e)):e="".concat(sc(this.props.chart["visualizer-chart-type"]),"Chart"),r["visualizer-data-exploded"]&&(t=lc("Annotations in this chart may not display here but they will display in the front end.")),wp.element.createElement(dc,null,"home"===this.state.route&&wp.element.createElement(mc,null,wp.element.createElement(Oe,{chart:this.props.chart,readUploadedFile:this.props.readUploadedFile}),wp.element.createElement(mt,{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(jt,{getChartData:this.props.getChartData,isLoading:this.props.isLoading}),wp.element.createElement(an,{chart:this.props.chart,editSchedule:this.props.editDatabaseSchedule,databaseImportData:this.props.databaseImportData}),wp.element.createElement(xn,{chart:this.props.chart,editChartData:this.props.editChartData}),wp.element.createElement(Xu,{label:lc("Advanced Options"),className:"visualizer-advanced-options",icon:"admin-tools",onClick:function(){return n.setState({route:"showAdvanced"})}}),wp.element.createElement(Xu,{label:lc("Chart Permissions"),icon:"admin-users",onClick:function(){return n.setState({route:"showPermissions"})}})),("showAdvanced"===this.state.route||"showPermissions"===this.state.route)&&wp.element.createElement(mc,null,wp.element.createElement(Xu,{label:lc("Chart Settings"),onClick:function(){return n.setState({route:"home"})},isBack:!0}),"showAdvanced"===this.state.route&&wp.element.createElement(Tu,{chart:this.props.chart,attributes:this.props.attributes,edit:this.props.editSettings}),"showPermissions"===this.state.route&&wp.element.createElement(Ju,{chart:this.props.chart,edit:this.props.editPermissions})),wp.element.createElement("div",{className:"visualizer-settings__chart"},null!==this.props.chart&&"DataTable"===r["visualizer-chart-library"]?wp.element.createElement(R,{id:this.props.id,rows:r["visualizer-data"],columns:r["visualizer-series"],options:r["visualizer-settings"]}):(r["visualizer-data-exploded"],wp.element.createElement(O,{chartType:e,rows:r["visualizer-data"],columns:r["visualizer-series"],options:$(this.props.chart["visualizer-settings"].manual)?tc()(V(this.props.chart["visualizer-settings"]),JSON.parse(this.props.chart["visualizer-settings"].manual)):V(this.props.chart["visualizer-settings"]),height:"500px"})),wp.element.createElement("div",{className:"visualizer-settings__charts-footer"},wp.element.createElement("sub",null,t))))}}])&&rc(n.prototype,r),a&&rc(n,a),t}(cc);function hc(e){return(hc="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 fc(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function _c(e,t){return!t||"object"!==hc(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function yc(e){return(yc=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function gc(e,t){return(gc=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var bc=lodash.startCase,vc=wp.i18n.__,wc=wp.element,Mc=wc.Component,kc=wc.Fragment,Lc=wp.components,Yc=Lc.Button,Dc=Lc.Dashicon,Tc=Lc.Toolbar,Sc=Lc.Tooltip,Oc=(wp.blockEditor||wp.editor).BlockControls,jc=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),_c(this,yc(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&gc(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e,t,n=U(JSON.parse(JSON.stringify(this.props.chart)));return 0<=["gauge","tabular","timeline"].indexOf(this.props.chart["visualizer-chart-type"])?"DataTable"===n["visualizer-chart-library"]?e=n["visualizer-chart-type"]:("tabular"===(e=this.props.chart["visualizer-chart-type"])&&(e="table"),e=bc(e)):e="".concat(bc(this.props.chart["visualizer-chart-type"]),"Chart"),n["visualizer-data-exploded"]&&(t=vc("Annotations in this chart may not display here but they will display in the front end.")),wp.element.createElement("div",{className:this.props.className},null!==this.props.chart&&wp.element.createElement(kc,null,wp.element.createElement(Oc,{key:"toolbar-controls"},wp.element.createElement(Tc,{className:"components-toolbar"},wp.element.createElement(Sc,{text:vc("Edit Chart")},wp.element.createElement(Yc,{className:"components-icon-button components-toolbar__control edit-pie-chart",onClick:this.props.editChart},wp.element.createElement(Dc,{icon:"edit"}))))),"DataTable"===n["visualizer-chart-library"]?wp.element.createElement(R,{id:this.props.id,rows:n["visualizer-data"],columns:n["visualizer-series"],options:n["visualizer-settings"]}):(n["visualizer-data-exploded"],wp.element.createElement(O,{chartType:e,rows:n["visualizer-data"],columns:n["visualizer-series"],options:$(this.props.chart["visualizer-settings"].manual)?tc()(V(this.props.chart["visualizer-settings"]),JSON.parse(this.props.chart["visualizer-settings"].manual)):V(this.props.chart["visualizer-settings"]),height:"500px"})),wp.element.createElement("div",{className:"visualizer-settings__charts-footer"},wp.element.createElement("sub",null,t))))}}])&&fc(n.prototype,r),a&&fc(n,a),t}(Mc);function xc(e){return(xc="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 Ec(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Cc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ec(n,!0).forEach((function(t){Pc(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ec(n).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Pc(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Hc(e,t,n,r,a,i,o){try{var s=e[i](o),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,a)}function zc(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var i=e.apply(t,n);function o(e){Hc(i,r,a,o,s,"next",e)}function s(e){Hc(i,r,a,o,s,"throw",e)}o(void 0)}))}}function Ac(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Nc(e){return(Nc=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Fc(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Rc(e,t){return(Rc=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Wc=wp.i18n.__,Ic=wp,Bc=Ic.apiFetch,Jc=Ic.apiRequest,Uc=wp.element,qc=Uc.Component,Vc=Uc.Fragment,Gc=wp.components,$c=Gc.Button,Kc=Gc.ButtonGroup,Zc=Gc.Dashicon,Qc=Gc.Placeholder,Xc=Gc.Notice,ed=Gc.Spinner,td=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t){return!t||"object"!==xc(t)&&"function"!=typeof t?Fc(e):t}(this,Nc(t).apply(this,arguments))).getChart=e.getChart.bind(Fc(e)),e.editChart=e.editChart.bind(Fc(e)),e.editSettings=e.editSettings.bind(Fc(e)),e.editPermissions=e.editPermissions.bind(Fc(e)),e.readUploadedFile=e.readUploadedFile.bind(Fc(e)),e.editURL=e.editURL.bind(Fc(e)),e.editSchedule=e.editSchedule.bind(Fc(e)),e.editJSONSchedule=e.editJSONSchedule.bind(Fc(e)),e.editJSONURL=e.editJSONURL.bind(Fc(e)),e.editJSONHeaders=e.editJSONHeaders.bind(Fc(e)),e.editJSONRoot=e.editJSONRoot.bind(Fc(e)),e.editJSONPaging=e.editJSONPaging.bind(Fc(e)),e.JSONImportData=e.JSONImportData.bind(Fc(e)),e.editDatabaseSchedule=e.editDatabaseSchedule.bind(Fc(e)),e.databaseImportData=e.databaseImportData.bind(Fc(e)),e.uploadData=e.uploadData.bind(Fc(e)),e.getChartData=e.getChartData.bind(Fc(e)),e.editChartData=e.editChartData.bind(Fc(e)),e.updateChart=e.updateChart.bind(Fc(e)),e.state={route:e.props.attributes.route?e.props.attributes.route:"home",chart:null,isModified:!1,isLoading:!1,isScheduled:!1},e}var n,r,a,i,o,s;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Rc(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:(s=zc(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,Bc({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 s.apply(this,arguments)})},{key:"getChart",value:(o=zc(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,Bc({path:"wp/v2/visualizer/".concat(t)});case 4:n=e.sent,this.setState({route:"chartSelect",chart:n.chart_data,isLoading:!1}),this.props.setAttributes({id:t,route:"chartSelect",lazy:-1});case 7:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:"editChart",value:function(){this.setState({route:"chartSelect"}),this.props.setAttributes({route:"chartSelect"})}},{key:"editSettings",value:function(e){var t=Cc({},this.state.chart);t["visualizer-settings"]=e,this.setState({chart:t,isModified:!0})}},{key:"editPermissions",value:function(e){var t=Cc({},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],r=new FileReader;r.onload=function(){var e=function(e,t){t=t||",";for(var n=new RegExp("(\\"+t+"|\\r?\\n|\\r|^)(?:'([^']*(?:''[^']*)*)'|([^'\\"+t+"\\r\\n]*))","gi"),r=[[]],a=null;a=n.exec(e);){var i=a[1];i.length&&i!==t&&r.push([]);var o=void 0;o=a[2]?a[2].replace(new RegExp("''","g"),"'"):a[3],r[r.length-1].push(o)}return r}(r.result);t.editChartData(e,"Visualizer_Source_Csv")},r.readAsText(n)}},{key:"editURL",value:function(e){var t=Cc({},this.state.chart);t["visualizer-chart-url"]=e,this.setState({chart:t})}},{key:"editSchedule",value:function(e){var t=Cc({},this.state.chart);t["visualizer-chart-schedule"]=e,this.setState({chart:t,isModified:!0})}},{key:"editJSONSchedule",value:function(e){var t=Cc({},this.state.chart);t["visualizer-json-schedule"]=e,this.setState({chart:t,isModified:!0})}},{key:"editJSONURL",value:function(e){var t=Cc({},this.state.chart);t["visualizer-json-url"]=e,this.setState({chart:t})}},{key:"editJSONHeaders",value:function(e){var t=Cc({},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=Cc({},this.state.chart);t["visualizer-json-root"]=e,this.setState({chart:t})}},{key:"editJSONPaging",value:function(e){var t=Cc({},this.state.chart);t["visualizer-json-paging"]=e,this.setState({chart:t})}},{key:"JSONImportData",value:function(e,t,n){var r=Cc({},this.state.chart);r["visualizer-source"]=e,r["visualizer-default-data"]=0,r["visualizer-series"]=t,r["visualizer-data"]=n,this.setState({chart:r,isModified:!0})}},{key:"editDatabaseSchedule",value:function(e){var t=Cc({},this.state.chart);t["visualizer-db-schedule"]=e,this.setState({chart:t,isModified:!0})}},{key:"databaseImportData",value:function(e,t,n,r){var a=Cc({},this.state.chart);a["visualizer-source"]=t,a["visualizer-default-data"]=0,a["visualizer-series"]=n,a["visualizer-data"]=r,a["visualizer-db-query"]=e,this.setState({chart:a,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}),Jc({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=Cc({},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 r=n["visualizer-series"],a=n["visualizer-settings"],i=r,o="series";return"pie"===n["visualizer-chart-type"]&&(i=n["visualizer-data"],o="slices"),i.map((function(e,t){if("pie"===n["visualizer-chart-type"]||0!==t){var r="pie"!==n["visualizer-chart-type"]?t-1:t;void 0===a[o][r]&&(a[o][r]={},a[o][r].temp=1)}})),a[o]=a[o].filter((function(e,t){return t<("pie"!==n["visualizer-chart-type"]?i.length-1:i.length)})),n["visualizer-settings"]=a,e.setState({chart:n,isModified:!0,isLoading:!1}),t}e.setState({isLoading:!1})}),(function(t){return e.setState({isLoading:!1}),t}))}},{key:"getChartData",value:(i=zc(regeneratorRuntime.mark((function e(t){var n,r;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,Bc({path:"wp/v2/visualizer/".concat(t)});case 4:n=e.sent,(r=Cc({},this.state.chart))["visualizer-source"]="Visualizer_Source_Csv",r["visualizer-default-data"]=0,r["visualizer-series"]=n.chart_data["visualizer-series"],r["visualizer-data"]=n.chart_data["visualizer-data"],this.setState({isLoading:!1,chart:r});case 11:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"editChartData",value:function(e,t){var n=Cc({},this.state.chart),r=[],a=Cc({},n["visualizer-settings"]),i=n["visualizer-chart-type"];e[0].map((function(t,n){r[n]={label:t,type:e[1][n]}})),e.splice(0,2);var o=r,s="series";"pie"===i&&(o=e,s="slices",e.map((function(e,t){switch(r[1].type){case"number":e[1]=parseFloat(e[1])}}))),o.map((function(e,t){if("pie"===i||0!==t){var n="pie"!==i?t-1:t;void 0===a[s][n]&&(a[s][n]={},a[s][n].temp=1)}})),a[s]=a[s].filter((function(e,t){return t<(-1>=["pie","tabular","dataTable"].indexOf(i)?o.length-1:o.length)})),n["visualizer-source"]=t,n["visualizer-default-data"]=0,n["visualizer-data"]=e,n["visualizer-series"]=r,n["visualizer-settings"]=a,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})),Jc({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(Xc,{status:"error",isDismissible:!1},wp.element.createElement(Zc,{icon:"chart-pie"}),Wc("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(jc,{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(Zc,{icon:"chart-pie"}),Wc("Visualizer")),"home"===this.state.route&&wp.element.createElement("div",{className:"visualizer-settings__content"},wp.element.createElement("div",{className:"visualizer-settings__content-description"},Wc("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"},Wc("Create a new chart")),wp.element.createElement("div",{className:"visualizer-settings__content-option-icon"},wp.element.createElement(Zc,{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"},Wc("Display an existing chart")),wp.element.createElement("div",{className:"visualizer-settings__content-option-icon"},wp.element.createElement(Zc,{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(Qc,null,wp.element.createElement(ed,null)),"showCharts"===this.state.route&&!1===this.state.isLoading&&wp.element.createElement(ye,{getChart:this.getChart}),"chartSelect"===this.state.route&&null!==this.state.chart&&wp.element.createElement(pc,{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(Kc,null,wp.element.createElement($c,{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})}},Wc("Back")),"chartSelect"===this.state.route&&wp.element.createElement(Vc,null,!1===this.state.isModified?wp.element.createElement($c,{isDefault:!0,isLarge:!0,className:"visualizer-bttn-done",onClick:function(){e.setState({route:"renderChart"}),e.props.setAttributes({route:"renderChart"})}},Wc("Done")):wp.element.createElement($c,{isPrimary:!0,isLarge:!0,className:"visualizer-bttn-save",isBusy:"updateChart"===this.state.isLoading,disabled:"updateChart"===this.state.isLoading,onClick:this.updateChart},Wc("Save"))))))}}])&&Ac(n.prototype,r),a&&Ac(n,a),t}(qc),nd=(n(153),wp.i18n.__),rd=wp.blocks.registerBlockType;t.default=rd("visualizer/chart",{title:nd("Visualizer Chart"),description:nd("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:[nd("Visualizer"),nd("Chart"),nd("Google Charts")],attributes:{id:{type:"number"},lazy:{default:"-1",type:"string"},route:{type:"string"}},supports:{customClassName:!1},edit:td,save:function(){return null}})}]);
classes/Visualizer/Gutenberg/src/Components/ChartRender.js CHANGED
@@ -40,11 +40,15 @@ class ChartRender extends Component {
40
 
41
  let data = formatDate( JSON.parse( JSON.stringify( this.props.chart ) ) );
42
 
43
- if ( 0 <= [ 'gauge', 'table', 'timeline', 'dataTable' ].indexOf( this.props.chart['visualizer-chart-type']) ) {
44
- if ( 'dataTable' === data['visualizer-chart-type']) {
45
  chart = data['visualizer-chart-type'];
46
  } else {
47
- chart = startCase( this.props.chart['visualizer-chart-type']);
 
 
 
 
48
  }
49
  } else {
50
  chart = `${ startCase( this.props.chart['visualizer-chart-type']) }Chart`;
@@ -75,7 +79,7 @@ class ChartRender extends Component {
75
  </Toolbar>
76
  </BlockControls>
77
 
78
- { ( 'dataTable' === chart ) ? (
79
  <DataTable
80
  id={ this.props.id }
81
  rows={ data['visualizer-data'] }
40
 
41
  let data = formatDate( JSON.parse( JSON.stringify( this.props.chart ) ) );
42
 
43
+ if ( 0 <= [ 'gauge', 'tabular', 'timeline' ].indexOf( this.props.chart['visualizer-chart-type']) ) {
44
+ if ( 'DataTable' === data['visualizer-chart-library']) {
45
  chart = data['visualizer-chart-type'];
46
  } else {
47
+ chart = this.props.chart['visualizer-chart-type'];
48
+ if ( 'tabular' === chart ) {
49
+ chart = 'table';
50
+ }
51
+ chart = startCase( chart );
52
  }
53
  } else {
54
  chart = `${ startCase( this.props.chart['visualizer-chart-type']) }Chart`;
79
  </Toolbar>
80
  </BlockControls>
81
 
82
+ { ( 'DataTable' === data['visualizer-chart-library']) ? (
83
  <DataTable
84
  id={ this.props.id }
85
  rows={ data['visualizer-data'] }
classes/Visualizer/Gutenberg/src/Components/ChartSelect.js CHANGED
@@ -61,11 +61,15 @@ class ChartSelect extends Component {
61
 
62
  let data = formatDate( JSON.parse( JSON.stringify( this.props.chart ) ) );
63
 
64
- if ( 0 <= [ 'gauge', 'table', 'timeline', 'dataTable' ].indexOf( this.props.chart['visualizer-chart-type']) ) {
65
- if ( 'dataTable' === data['visualizer-chart-type']) {
66
  chart = data['visualizer-chart-type'];
67
  } else {
68
- chart = startCase( this.props.chart['visualizer-chart-type']);
 
 
 
 
69
  }
70
  } else {
71
  chart = `${ startCase( this.props.chart['visualizer-chart-type']) }Chart`;
@@ -134,7 +138,7 @@ class ChartSelect extends Component {
134
  />
135
 
136
  { 'showAdvanced' === this.state.route &&
137
- <Sidebar chart={ this.props.chart } edit={ this.props.editSettings } />
138
  }
139
 
140
  { 'showPermissions' === this.state.route &&
@@ -147,7 +151,7 @@ class ChartSelect extends Component {
147
 
148
  { ( null !== this.props.chart ) &&
149
 
150
- ( 'dataTable' === chart ) ? (
151
  <DataTable
152
  id={ this.props.id }
153
  rows={ data['visualizer-data'] }
61
 
62
  let data = formatDate( JSON.parse( JSON.stringify( this.props.chart ) ) );
63
 
64
+ if ( 0 <= [ 'gauge', 'tabular', 'timeline' ].indexOf( this.props.chart['visualizer-chart-type']) ) {
65
+ if ( 'DataTable' === data['visualizer-chart-library']) {
66
  chart = data['visualizer-chart-type'];
67
  } else {
68
+ chart = this.props.chart['visualizer-chart-type'];
69
+ if ( 'tabular' === chart ) {
70
+ chart = 'table';
71
+ }
72
+ chart = startCase( chart );
73
  }
74
  } else {
75
  chart = `${ startCase( this.props.chart['visualizer-chart-type']) }Chart`;
138
  />
139
 
140
  { 'showAdvanced' === this.state.route &&
141
+ <Sidebar chart={ this.props.chart } attributes={ this.props.attributes } edit={ this.props.editSettings } />
142
  }
143
 
144
  { 'showPermissions' === this.state.route &&
151
 
152
  { ( null !== this.props.chart ) &&
153
 
154
+ ( 'DataTable' === data['visualizer-chart-library']) ? (
155
  <DataTable
156
  id={ this.props.id }
157
  rows={ data['visualizer-data'] }
classes/Visualizer/Gutenberg/src/Components/Charts.js CHANGED
@@ -107,11 +107,15 @@ class Charts extends Component {
107
  title = `#${charts[i].id}`;
108
  }
109
 
110
- if ( 0 <= [ 'gauge', 'table', 'timeline', 'dataTable' ].indexOf( data['visualizer-chart-type']) ) {
111
- if ( 'dataTable' === data['visualizer-chart-type']) {
112
  chart = data['visualizer-chart-type'];
113
  } else {
114
- chart = startCase( data['visualizer-chart-type']);
 
 
 
 
115
  }
116
  } else {
117
  chart = `${ startCase( data['visualizer-chart-type']) }Chart`;
@@ -134,13 +138,13 @@ class Charts extends Component {
134
  { title }
135
  </div>
136
 
137
- { ( 'dataTable' === chart ) ? (
138
  <DataTable
139
  id={ charts[i].id }
140
  rows={ data['visualizer-data'] }
141
  columns={ data['visualizer-series'] }
142
  chartsScreen={ true }
143
- options={ filterCharts( data['visualizer-settings']) }
144
  />
145
  ) : ( '' !== data['visualizer-data-exploded'] ? (
146
  <Chart
107
  title = `#${charts[i].id}`;
108
  }
109
 
110
+ if ( 0 <= [ 'gauge', 'tabular', 'timeline' ].indexOf( data['visualizer-chart-type']) ) {
111
+ if ( 'DataTable' === data['visualizer-chart-library']) {
112
  chart = data['visualizer-chart-type'];
113
  } else {
114
+ chart = data['visualizer-chart-type'];
115
+ if ( 'tabular' === chart ) {
116
+ chart = 'table';
117
+ }
118
+ chart = startCase( chart );
119
  }
120
  } else {
121
  chart = `${ startCase( data['visualizer-chart-type']) }Chart`;
138
  { title }
139
  </div>
140
 
141
+ { ( 'DataTable' === data['visualizer-chart-library']) ? (
142
  <DataTable
143
  id={ charts[i].id }
144
  rows={ data['visualizer-data'] }
145
  columns={ data['visualizer-series'] }
146
  chartsScreen={ true }
147
+ options={ data['visualizer-settings'] }
148
  />
149
  ) : ( '' !== data['visualizer-data-exploded'] ? (
150
  <Chart
classes/Visualizer/Gutenberg/src/Components/DataTable.js CHANGED
@@ -46,26 +46,25 @@ class DataTables extends Component {
46
 
47
  initDataTable( tableColumns, tableRow ) {
48
  const settings = this.props.options;
49
-
50
  const columns = tableColumns.map( ( i, index ) => {
51
  let type = i.type;
52
 
53
  switch ( i.type ) {
54
- case 'number':
55
- type = 'num';
56
- break;
57
- case 'date':
58
- case 'datetime':
59
- case 'timeofday':
60
- type = 'date';
61
- break;
62
  }
63
 
64
  return {
65
  title: i.label,
66
  data: i.label,
67
  type: type,
68
- render: this.dataRenderer( data, type, index )
69
  };
70
  });
71
 
@@ -94,9 +93,9 @@ class DataTables extends Component {
94
  pagingType: settings.pagingType,
95
  ordering: 'false' === settings.ordering_bool ? false : true,
96
  fixedHeader: 'true' === settings.fixedHeader_bool ? true : false,
97
- scrollCollapse: this.props.chartsScreen && true || 'true' === settings.scrollCollapse_bool ? true : false,
98
  scrollY: this.props.chartsScreen && 180 || ( 'true' === settings.scrollCollapse_bool && Number( settings.scrollY_int ) || false ),
99
- responsive: this.props.chartsScreen && true || 'true' === settings.responsive_bool ? true : false,
100
  searching: false,
101
  select: false,
102
  lengthChange: false,
@@ -105,61 +104,58 @@ class DataTables extends Component {
105
  });
106
  }
107
 
108
- dataRenderer( data, type, index ) {
109
  const settings = this.props.options;
110
 
111
- if ( undefined === settings.series[index]) {
112
- return data;
113
- }
 
114
 
115
  switch ( type ) {
116
  case 'date':
117
  case 'datetime':
118
  case 'timeofday':
119
  if ( settings.series[index].format && settings.series[index].format.from && settings.series[index].format.to ) {
120
- return jQuery.fn.dataTable.render.moment( settings.series[index].format.from, settings.series[index].format.to );
 
 
121
  }
122
- return jQuery.fn.dataTable.render.moment( 'MM-DD-YYYY' );
123
  break;
124
  case 'num':
125
  const parts = [ '', '', '', '', '' ];
126
-
127
  if ( settings.series[index].format.thousands ) {
128
  parts[0] = settings.series[index].format.thousands;
129
  }
130
-
131
  if ( settings.series[index].format.decimal ) {
132
  parts[1] = settings.series[index].format.decimal;
133
  }
134
-
135
- if ( settings.series[index].format.precision ) {
136
  parts[2] = settings.series[index].format.precision;
137
  }
138
-
139
  if ( settings.series[index].format.prefix ) {
140
  parts[3] = settings.series[index].format.prefix;
141
  }
142
-
143
  if ( settings.series[index].format.suffix ) {
144
  parts[4] = settings.series[index].format.suffix;
145
  }
146
- return jQuery.fn.dataTable.render.number( ...parts );
147
  break;
148
  case 'boolean':
149
  jQuery.fn.dataTable.render.extra = function( data, type, row ) {
150
- if ( ( true === data || 'true' === data ) && 'undefined' !== typeof settings.series[index].format && '' !== settings.series[index].format.truthy ) {
151
  return settings.series[index].format.truthy.replace( /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, '' );
152
  }
153
- if ( ( false === data || 'false' === data ) && 'undefined' !== typeof settings.series[index].format && '' !== settings.series[index].format.falsy ) {
154
  return settings.series[index].format.falsy.replace( /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, '' );
155
  }
156
  return data;
157
  };
158
- return jQuery.fn.dataTable.render.extra;
159
  break;
160
  }
161
 
162
- return data;
163
  }
164
 
165
  render() {
46
 
47
  initDataTable( tableColumns, tableRow ) {
48
  const settings = this.props.options;
 
49
  const columns = tableColumns.map( ( i, index ) => {
50
  let type = i.type;
51
 
52
  switch ( i.type ) {
53
+ case 'number':
54
+ type = 'num';
55
+ break;
56
+ case 'date':
57
+ case 'datetime':
58
+ case 'timeofday':
59
+ type = 'date';
60
+ break;
61
  }
62
 
63
  return {
64
  title: i.label,
65
  data: i.label,
66
  type: type,
67
+ render: this.dataRenderer( type, index )
68
  };
69
  });
70
 
93
  pagingType: settings.pagingType,
94
  ordering: 'false' === settings.ordering_bool ? false : true,
95
  fixedHeader: 'true' === settings.fixedHeader_bool ? true : false,
96
+ scrollCollapse: !! this.props.chartsScreen || 'true' === settings.scrollCollapse_bool ? true : false,
97
  scrollY: this.props.chartsScreen && 180 || ( 'true' === settings.scrollCollapse_bool && Number( settings.scrollY_int ) || false ),
98
+ responsive: !! this.props.chartsScreen || 'true' === settings.responsive_bool ? true : false,
99
  searching: false,
100
  select: false,
101
  lengthChange: false,
104
  });
105
  }
106
 
107
+ dataRenderer( type, index ) {
108
  const settings = this.props.options;
109
 
110
+ let renderer = null;
111
+ if ( 'undefined' === typeof settings.series || 'undefined' === typeof settings.series[index] || 'undefined' === typeof settings.series[index].format ) {
112
+ return renderer;
113
+ }
114
 
115
  switch ( type ) {
116
  case 'date':
117
  case 'datetime':
118
  case 'timeofday':
119
  if ( settings.series[index].format && settings.series[index].format.from && settings.series[index].format.to ) {
120
+ renderer = jQuery.fn.dataTable.render.moment( settings.series[index].format.from, settings.series[index].format.to );
121
+ } else {
122
+ renderer = jQuery.fn.dataTable.render.moment( 'MM-DD-YYYY' );
123
  }
 
124
  break;
125
  case 'num':
126
  const parts = [ '', '', '', '', '' ];
 
127
  if ( settings.series[index].format.thousands ) {
128
  parts[0] = settings.series[index].format.thousands;
129
  }
 
130
  if ( settings.series[index].format.decimal ) {
131
  parts[1] = settings.series[index].format.decimal;
132
  }
133
+ if ( settings.series[index].format.precision && 0 < parseInt( settings.series[index].format.precision ) ) {
 
134
  parts[2] = settings.series[index].format.precision;
135
  }
 
136
  if ( settings.series[index].format.prefix ) {
137
  parts[3] = settings.series[index].format.prefix;
138
  }
 
139
  if ( settings.series[index].format.suffix ) {
140
  parts[4] = settings.series[index].format.suffix;
141
  }
142
+ renderer = jQuery.fn.dataTable.render.number( ...parts );
143
  break;
144
  case 'boolean':
145
  jQuery.fn.dataTable.render.extra = function( data, type, row ) {
146
+ if ( ( true === data || 'true' === data ) && '' !== settings.series[index].format.truthy ) {
147
  return settings.series[index].format.truthy.replace( /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, '' );
148
  }
149
+ if ( ( false === data || 'false' === data ) && '' !== settings.series[index].format.falsy ) {
150
  return settings.series[index].format.falsy.replace( /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, '' );
151
  }
152
  return data;
153
  };
154
+ renderer = jQuery.fn.dataTable.render.extra;
155
  break;
156
  }
157
 
158
+ return renderer;
159
  }
160
 
161
  render() {
classes/Visualizer/Gutenberg/src/Components/Sidebar.js CHANGED
@@ -2,6 +2,7 @@
2
  * External dependencies
3
  */
4
  import GeneralSettings from './Sidebar/GeneralSettings.js';
 
5
  import HorizontalAxisSettings from './Sidebar/HorizontalAxisSettings.js';
6
  import VerticalAxisSettings from './Sidebar/VerticalAxisSettings.js';
7
  import PieSettings from './Sidebar/PieSettings.js';
@@ -42,17 +43,20 @@ class Sidebar extends Component {
42
  render() {
43
 
44
  const type = this.props.chart['visualizer-chart-type'];
 
45
 
46
  return (
47
  <Fragment>
48
 
 
 
49
  <GeneralSettings chart={ this.props.chart } edit={ this.props.edit } />
50
 
51
- { ( -1 >= [ 'table', 'gauge', 'geo', 'pie', 'timeline', 'dataTable' ].indexOf( type ) ) && (
52
  <HorizontalAxisSettings chart={ this.props.chart } edit={ this.props.edit } />
53
  ) }
54
 
55
- { ( -1 >= [ 'table', 'gauge', 'geo', 'pie', 'timeline', 'dataTable' ].indexOf( type ) ) && (
56
  <VerticalAxisSettings chart={ this.props.chart } edit={ this.props.edit } />
57
  ) }
58
 
@@ -100,7 +104,7 @@ class Sidebar extends Component {
100
  <TimelineSettings chart={ this.props.chart } edit={ this.props.edit } />
101
  ) }
102
 
103
- { ( 0 <= [ 'table', 'dataTable' ].indexOf( type ) ) && (
104
  <Fragment>
105
 
106
  <TableSettings chart={ this.props.chart } edit={ this.props.edit } />
@@ -114,7 +118,11 @@ class Sidebar extends Component {
114
  <ComboSettings chart={ this.props.chart } edit={ this.props.edit } />
115
  ) }
116
 
117
- { ( -1 >= [ 'timeline', 'bubble', 'gauge', 'geo', 'pie', 'dataTable' ].indexOf( type ) ) && (
 
 
 
 
118
  <SeriesSettings chart={ this.props.chart } edit={ this.props.edit } />
119
  ) }
120
 
@@ -127,17 +135,17 @@ class Sidebar extends Component {
127
  <SlicesSettings chart={ this.props.chart } edit={ this.props.edit } />
128
  ) }
129
 
130
- { ( 0 <= [ 'dataTable' ].indexOf( type ) ) && (
131
  <ColumnSettings chart={ this.props.chart } edit={ this.props.edit } />
132
  ) }
133
 
134
- { ( -1 >= [ 'dataTable' ].indexOf( type ) ) && (
135
  <LayoutAndChartArea chart={ this.props.chart } edit={ this.props.edit } />
136
  ) }
137
 
138
  <FrontendActions chart={ this.props.chart } edit={ this.props.edit } />
139
 
140
- { ( -1 >= [ 'dataTable' ].indexOf( type ) ) && (
141
  <ManualConfiguration chart={ this.props.chart } edit={ this.props.edit } />
142
  ) }
143
  </Fragment>
2
  * External dependencies
3
  */
4
  import GeneralSettings from './Sidebar/GeneralSettings.js';
5
+ import InstanceSettings from './Sidebar/InstanceSettings.js';
6
  import HorizontalAxisSettings from './Sidebar/HorizontalAxisSettings.js';
7
  import VerticalAxisSettings from './Sidebar/VerticalAxisSettings.js';
8
  import PieSettings from './Sidebar/PieSettings.js';
43
  render() {
44
 
45
  const type = this.props.chart['visualizer-chart-type'];
46
+ const library = this.props.chart['visualizer-chart-library'];
47
 
48
  return (
49
  <Fragment>
50
 
51
+ <InstanceSettings chart={ this.props.chart } attributes={ this.props.attributes } edit={ this.props.edit } />
52
+
53
  <GeneralSettings chart={ this.props.chart } edit={ this.props.edit } />
54
 
55
+ { ( -1 >= [ 'tabular', 'dataTable', 'gauge', 'geo', 'pie', 'timeline' ].indexOf( type ) ) && (
56
  <HorizontalAxisSettings chart={ this.props.chart } edit={ this.props.edit } />
57
  ) }
58
 
59
+ { ( -1 >= [ 'tabular', 'dataTable', 'gauge', 'geo', 'pie', 'timeline' ].indexOf( type ) ) && (
60
  <VerticalAxisSettings chart={ this.props.chart } edit={ this.props.edit } />
61
  ) }
62
 
104
  <TimelineSettings chart={ this.props.chart } edit={ this.props.edit } />
105
  ) }
106
 
107
+ { ( 0 <= [ 'tabular', 'dataTable' ].indexOf( type ) ) && (
108
  <Fragment>
109
 
110
  <TableSettings chart={ this.props.chart } edit={ this.props.edit } />
118
  <ComboSettings chart={ this.props.chart } edit={ this.props.edit } />
119
  ) }
120
 
121
+ { ( -1 >= [ 'timeline', 'bubble', 'gauge', 'geo', 'pie', 'tabular', 'dataTable' ].indexOf( type ) ) && (
122
+ <SeriesSettings chart={ this.props.chart } edit={ this.props.edit } />
123
+ ) }
124
+
125
+ { ( 'tabular' === type && 'GoogleCharts' === library ) && (
126
  <SeriesSettings chart={ this.props.chart } edit={ this.props.edit } />
127
  ) }
128
 
135
  <SlicesSettings chart={ this.props.chart } edit={ this.props.edit } />
136
  ) }
137
 
138
+ { ( 'DataTable' === library ) && (
139
  <ColumnSettings chart={ this.props.chart } edit={ this.props.edit } />
140
  ) }
141
 
142
+ { ( 'DataTable' !== library ) && (
143
  <LayoutAndChartArea chart={ this.props.chart } edit={ this.props.edit } />
144
  ) }
145
 
146
  <FrontendActions chart={ this.props.chart } edit={ this.props.edit } />
147
 
148
+ { ( 'DataTable' !== library ) && (
149
  <ManualConfiguration chart={ this.props.chart } edit={ this.props.edit } />
150
  ) }
151
  </Fragment>
classes/Visualizer/Gutenberg/src/Components/Sidebar/ColumnSettings.js CHANGED
@@ -28,6 +28,10 @@ class ColumnSettings extends Component {
28
  */
29
  const settings = this.props.chart['visualizer-settings'];
30
 
 
 
 
 
31
  Object.keys( settings.series )
32
  .map( i => {
33
  if ( settings.series[i] !== undefined ) {
@@ -47,6 +51,10 @@ class ColumnSettings extends Component {
47
 
48
  const type = this.props.chart['visualizer-chart-type'];
49
 
 
 
 
 
50
  return (
51
  <PanelBody
52
  title={ __( 'Column Settings' ) }
@@ -56,6 +64,12 @@ class ColumnSettings extends Component {
56
 
57
  { Object.keys( settings.series )
58
  .map( ( i ) => {
 
 
 
 
 
 
59
  return (
60
  <PanelBody
61
  title={ series[i].label }
@@ -63,7 +77,7 @@ class ColumnSettings extends Component {
63
  initialOpen={ false }
64
  >
65
 
66
- { ( 'date' === series[i].type || 'datetime' === series[i].type || 'timeofday' === series[i].type ) && (
67
  <Fragment>
68
  <TextControl
69
  label={ __( 'Display Date Format' ) }
@@ -131,6 +145,7 @@ class ColumnSettings extends Component {
131
  help={ __( 'Round values to how many decimal places?' ) }
132
  value={ settings.series[i].format ? settings.series[i].format.precision : '' }
133
  type="number"
 
134
  onChange={ e => {
135
  if ( 100 < e ) {
136
  return;
@@ -170,7 +185,7 @@ class ColumnSettings extends Component {
170
  </Fragment>
171
  ) }
172
 
173
- { ( 'boolean' === series[i].type ) && ( 'dataTable' === type ) && (
174
  <Fragment>
175
  <TextControl
176
  label={ __( 'Truthy value' ) }
28
  */
29
  const settings = this.props.chart['visualizer-settings'];
30
 
31
+ if ( ! settings.series ) {
32
+ return;
33
+ }
34
+
35
  Object.keys( settings.series )
36
  .map( i => {
37
  if ( settings.series[i] !== undefined ) {
51
 
52
  const type = this.props.chart['visualizer-chart-type'];
53
 
54
+ if ( ! settings.series ) {
55
+ return null;
56
+ }
57
+
58
  return (
59
  <PanelBody
60
  title={ __( 'Column Settings' ) }
64
 
65
  { Object.keys( settings.series )
66
  .map( ( i ) => {
67
+
68
+ // don't show string columns.
69
+ if ( 'string' === series[i].type ) {
70
+ return null;
71
+ }
72
+
73
  return (
74
  <PanelBody
75
  title={ series[i].label }
77
  initialOpen={ false }
78
  >
79
 
80
+ { 0 <= [ 'date', 'datetime', 'timeofday' ].indexOf( series[i].type ) && (
81
  <Fragment>
82
  <TextControl
83
  label={ __( 'Display Date Format' ) }
145
  help={ __( 'Round values to how many decimal places?' ) }
146
  value={ settings.series[i].format ? settings.series[i].format.precision : '' }
147
  type="number"
148
+ min="0"
149
  onChange={ e => {
150
  if ( 100 < e ) {
151
  return;
185
  </Fragment>
186
  ) }
187
 
188
+ { ( 'boolean' === series[i].type ) && (
189
  <Fragment>
190
  <TextControl
191
  label={ __( 'Truthy value' ) }
classes/Visualizer/Gutenberg/src/Components/Sidebar/GeneralSettings.js CHANGED
@@ -34,6 +34,18 @@ class GeneralSettings extends Component {
34
 
35
  tooltipTriggers[2] = { label: __( 'The tooltip will not be displayed' ), value: 'none' };
36
 
 
 
 
 
 
 
 
 
 
 
 
 
37
  return (
38
  <PanelBody
39
  title={ __( 'General Settings' ) }
@@ -57,7 +69,7 @@ class GeneralSettings extends Component {
57
  } }
58
  />
59
 
60
- { ( -1 >= [ 'table', 'gauge', 'geo', 'pie', 'timeline', 'dataTable' ].indexOf( type ) ) && (
61
  <SelectControl
62
  label={ __( 'Chart Title Position' ) }
63
  help={ __( 'Where to place the chart title, compared to the chart area.' ) }
@@ -74,7 +86,7 @@ class GeneralSettings extends Component {
74
  />
75
  ) }
76
 
77
- { ( -1 >= [ 'table', 'gauge', 'geo', 'timeline', 'dataTable' ].indexOf( type ) ) && (
78
  <BaseControl
79
  label={ __( 'Chart Title Color' ) }
80
  >
@@ -88,7 +100,7 @@ class GeneralSettings extends Component {
88
  </BaseControl>
89
  ) }
90
 
91
- { ( -1 >= [ 'table', 'gauge', 'geo', 'pie', 'timeline', 'dataTable' ].indexOf( type ) ) && (
92
  <SelectControl
93
  label={ __( 'Axes Titles Position' ) }
94
  help={ __( 'Determines where to place the axis titles, compared to the chart area.' ) }
@@ -107,7 +119,7 @@ class GeneralSettings extends Component {
107
 
108
  </PanelBody>
109
 
110
- { ( -1 >= [ 'table', 'gauge', 'geo', 'pie', 'timeline', 'dataTable' ].indexOf( type ) ) && (
111
  <PanelBody
112
  title={ __( 'Font Styles' ) }
113
  className="visualizer-inner-sections"
@@ -167,7 +179,7 @@ class GeneralSettings extends Component {
167
  </PanelBody>
168
  ) }
169
 
170
- { ( -1 >= [ 'table', 'gauge', 'geo', 'timeline', 'dataTable' ].indexOf( type ) ) && (
171
  <PanelBody
172
  title={ __( 'Legend' ) }
173
  className="visualizer-inner-sections"
@@ -178,14 +190,7 @@ class GeneralSettings extends Component {
178
  label={ __( 'Position' ) }
179
  help={ __( 'Determines where to place the legend, compared to the chart area.' ) }
180
  value={ settings.legend.position ? settings.legend.position : 'right' }
181
- options={ [
182
- { label: __( 'Left of the chart' ), value: 'left' },
183
- { label: __( 'Right of the chart' ), value: 'right' },
184
- { label: __( 'Above the chart' ), value: 'top' },
185
- { label: __( 'Below the chart' ), value: 'bottom' },
186
- { label: __( 'Inside the chart' ), value: 'in' },
187
- { label: __( 'Omit the legend' ), value: 'none' }
188
- ] }
189
  onChange={ e => {
190
  if ( 'pie' !== type ) {
191
  let axis = 'left' === e ? 1 : 0;
@@ -230,7 +235,7 @@ class GeneralSettings extends Component {
230
  </PanelBody>
231
  ) }
232
 
233
- { ( -1 >= [ 'table', 'gauge', 'geo', 'dataTable', 'timeline' ].indexOf( type ) ) && (
234
  <PanelBody
235
  title={ __( 'Tooltip' ) }
236
  className="visualizer-inner-sections"
@@ -282,7 +287,7 @@ class GeneralSettings extends Component {
282
  </PanelBody>
283
  ) }
284
 
285
- { ( -1 >= [ 'table', 'gauge', 'geo', 'pie', 'timeline', 'dataTable' ].indexOf( type ) ) && (
286
  <PanelBody
287
  title={ __( 'Animation' ) }
288
  className="visualizer-inner-sections"
34
 
35
  tooltipTriggers[2] = { label: __( 'The tooltip will not be displayed' ), value: 'none' };
36
 
37
+ let positions = [
38
+ { label: __( 'Left of the chart' ), value: 'left' },
39
+ { label: __( 'Right of the chart' ), value: 'right' },
40
+ { label: __( 'Above the chart' ), value: 'top' },
41
+ { label: __( 'Below the chart' ), value: 'bottom' },
42
+ { label: __( 'Omit the legend' ), value: 'none' }
43
+ ];
44
+
45
+ if ( 'pie' !== type ) {
46
+ positions.push({ label: __( 'Inside the chart' ), value: 'in' });
47
+ }
48
+
49
  return (
50
  <PanelBody
51
  title={ __( 'General Settings' ) }
69
  } }
70
  />
71
 
72
+ { ( -1 >= [ 'tabular', 'dataTable', 'gauge', 'geo', 'pie', 'timeline' ].indexOf( type ) ) && (
73
  <SelectControl
74
  label={ __( 'Chart Title Position' ) }
75
  help={ __( 'Where to place the chart title, compared to the chart area.' ) }
86
  />
87
  ) }
88
 
89
+ { ( -1 >= [ 'tabular', 'dataTable', 'gauge', 'geo', 'timeline' ].indexOf( type ) ) && (
90
  <BaseControl
91
  label={ __( 'Chart Title Color' ) }
92
  >
100
  </BaseControl>
101
  ) }
102
 
103
+ { ( -1 >= [ 'tabular', 'dataTable', 'gauge', 'geo', 'pie', 'timeline' ].indexOf( type ) ) && (
104
  <SelectControl
105
  label={ __( 'Axes Titles Position' ) }
106
  help={ __( 'Determines where to place the axis titles, compared to the chart area.' ) }
119
 
120
  </PanelBody>
121
 
122
+ { ( -1 >= [ 'tabular', 'dataTable', 'gauge', 'geo', 'pie', 'timeline' ].indexOf( type ) ) && (
123
  <PanelBody
124
  title={ __( 'Font Styles' ) }
125
  className="visualizer-inner-sections"
179
  </PanelBody>
180
  ) }
181
 
182
+ { ( -1 >= [ 'tabular', 'dataTable', 'gauge', 'geo', 'timeline' ].indexOf( type ) ) && (
183
  <PanelBody
184
  title={ __( 'Legend' ) }
185
  className="visualizer-inner-sections"
190
  label={ __( 'Position' ) }
191
  help={ __( 'Determines where to place the legend, compared to the chart area.' ) }
192
  value={ settings.legend.position ? settings.legend.position : 'right' }
193
+ options={ positions }
 
 
 
 
 
 
 
194
  onChange={ e => {
195
  if ( 'pie' !== type ) {
196
  let axis = 'left' === e ? 1 : 0;
235
  </PanelBody>
236
  ) }
237
 
238
+ { ( -1 >= [ 'tabular', 'gauge', 'geo', 'dataTable', 'timeline' ].indexOf( type ) ) && (
239
  <PanelBody
240
  title={ __( 'Tooltip' ) }
241
  className="visualizer-inner-sections"
287
  </PanelBody>
288
  ) }
289
 
290
+ { ( -1 >= [ 'tabular', 'dataTable', 'gauge', 'geo', 'pie', 'timeline' ].indexOf( type ) ) && (
291
  <PanelBody
292
  title={ __( 'Animation' ) }
293
  className="visualizer-inner-sections"
classes/Visualizer/Gutenberg/src/Components/Sidebar/InstanceSettings.js ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ const { __ } = wp.i18n;
5
+
6
+ const { Component } = wp.element;
7
+
8
+ const {
9
+ PanelBody,
10
+ Notice,
11
+ TextControl
12
+ } = wp.components;
13
+
14
+ class InstanceSettings extends Component {
15
+ constructor() {
16
+ super( ...arguments );
17
+ }
18
+
19
+ render() {
20
+
21
+ const settings = this.props.chart['visualizer-settings'];
22
+
23
+ return (
24
+ <PanelBody
25
+ title={ __( 'Instance Settings' ) }
26
+ initialOpen={ true }
27
+ className="visualizer-instance-panel"
28
+ >
29
+
30
+ <Notice status="info" isDismissible={ false } >
31
+ <p>
32
+ { __( 'These settings are valid only for this instance of the chart.' ) }
33
+ </p>
34
+ <p>
35
+ { __( 'This means that if you insert this chart again elsewhere, these values will not persist.' ) }
36
+ </p>
37
+ </Notice>
38
+
39
+ <TextControl
40
+ label={ __( 'Should this instance lazy Load?' ) }
41
+ help={ __( '-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' ) }
42
+ value={ this.props.attributes.lazy ? Number( this.props.attributes.lazy ) : -1 }
43
+ type="number"
44
+ min="-1"
45
+ max="1000"
46
+ step="1"
47
+ onChange={ e => {
48
+ this.props.attributes.lazy = e;
49
+ this.props.edit( settings );
50
+ } }
51
+ />
52
+
53
+ </PanelBody>
54
+ );
55
+ }
56
+ }
57
+
58
+ export default InstanceSettings;
classes/Visualizer/Gutenberg/src/Components/Sidebar/ManualConfiguration.js CHANGED
@@ -41,7 +41,7 @@ class ManualConfiguration extends Component {
41
 
42
  const settings = this.props.chart['visualizer-settings'];
43
 
44
- if ( 0 <= [ 'gauge', 'table', 'timeline' ].indexOf( this.props.chart['visualizer-chart-type']) ) {
45
  chart = this.props.chart['visualizer-chart-type'];
46
  } else {
47
  chart = `${ this.props.chart['visualizer-chart-type'] }chart`;
41
 
42
  const settings = this.props.chart['visualizer-settings'];
43
 
44
+ if ( 0 <= [ 'gauge', 'tabular', 'timeline' ].indexOf( this.props.chart['visualizer-chart-type']) ) {
45
  chart = this.props.chart['visualizer-chart-type'];
46
  } else {
47
  chart = `${ this.props.chart['visualizer-chart-type'] }chart`;
classes/Visualizer/Gutenberg/src/Components/Sidebar/RowCellSettings.js CHANGED
@@ -26,6 +26,7 @@ class RowCellSettings extends Component {
26
  const settings = this.props.chart['visualizer-settings'];
27
 
28
  const type = this.props.chart['visualizer-chart-type'];
 
29
 
30
  return (
31
  <PanelBody
@@ -34,7 +35,7 @@ class RowCellSettings extends Component {
34
  className="visualizer-advanced-panel"
35
  >
36
 
37
- { ( 'dataTable' === type ) ? (
38
  <Fragment>
39
 
40
  <PanelBody
26
  const settings = this.props.chart['visualizer-settings'];
27
 
28
  const type = this.props.chart['visualizer-chart-type'];
29
+ const library = this.props.chart['visualizer-chart-library'];
30
 
31
  return (
32
  <PanelBody
35
  className="visualizer-advanced-panel"
36
  >
37
 
38
+ { ( 'DataTable' === library ) ? (
39
  <Fragment>
40
 
41
  <PanelBody
classes/Visualizer/Gutenberg/src/Components/Sidebar/SeriesSettings.js CHANGED
@@ -68,7 +68,7 @@ class SeriesSettings extends Component {
68
  initialOpen={ false }
69
  >
70
 
71
- { ( -1 >= [ 'table', 'pie' ].indexOf( type ) ) && (
72
  <SelectControl
73
  label={ __( 'Visible In Legend' ) }
74
  help={ __( 'Determines whether the series has to be presented in the legend or not.' ) }
@@ -84,7 +84,7 @@ class SeriesSettings extends Component {
84
  />
85
  ) }
86
 
87
- { ( -1 >= [ 'table', 'candlestick', 'combo', 'column', 'bar' ].indexOf( type ) ) && (
88
 
89
  <Fragment>
90
 
@@ -140,7 +140,7 @@ class SeriesSettings extends Component {
140
 
141
  ) :
142
 
143
- ( 'date' === series[i].type ) && (
144
 
145
  <Fragment>
146
 
@@ -221,7 +221,7 @@ class SeriesSettings extends Component {
221
 
222
  ) }
223
 
224
- { ( -1 >= [ 'table' ].indexOf( type ) ) && (
225
 
226
  <BaseControl
227
  label={ __( 'Color' ) }
68
  initialOpen={ false }
69
  >
70
 
71
+ { ( -1 >= [ 'tabular', 'pie' ].indexOf( type ) ) && (
72
  <SelectControl
73
  label={ __( 'Visible In Legend' ) }
74
  help={ __( 'Determines whether the series has to be presented in the legend or not.' ) }
84
  />
85
  ) }
86
 
87
+ { ( -1 >= [ 'tabular', 'candlestick', 'combo', 'column', 'bar' ].indexOf( type ) ) && (
88
 
89
  <Fragment>
90
 
140
 
141
  ) :
142
 
143
+ ( 0 <= [ 'date', 'datetime', 'timeofday' ].indexOf( series[i].type ) ) && (
144
 
145
  <Fragment>
146
 
221
 
222
  ) }
223
 
224
+ { ( -1 >= [ 'tabular' ].indexOf( type ) ) && (
225
 
226
  <BaseControl
227
  label={ __( 'Color' ) }
classes/Visualizer/Gutenberg/src/Components/Sidebar/TableSettings.js CHANGED
@@ -25,6 +25,7 @@ class TableSettings extends Component {
25
  const settings = this.props.chart['visualizer-settings'];
26
 
27
  const type = this.props.chart['visualizer-chart-type'];
 
28
 
29
  return (
30
  <PanelBody
@@ -33,7 +34,7 @@ class TableSettings extends Component {
33
  className="visualizer-advanced-panel"
34
  >
35
 
36
- { ( 'dataTable' === type ) ? (
37
  <Fragment>
38
  <CheckboxControl
39
  label={ __( 'Enable Pagination' ) }
25
  const settings = this.props.chart['visualizer-settings'];
26
 
27
  const type = this.props.chart['visualizer-chart-type'];
28
+ const library = this.props.chart['visualizer-chart-library'];
29
 
30
  return (
31
  <PanelBody
34
  className="visualizer-advanced-panel"
35
  >
36
 
37
+ { ( 'DataTable' === library ) ? (
38
  <Fragment>
39
  <CheckboxControl
40
  label={ __( 'Enable Pagination' ) }
classes/Visualizer/Gutenberg/src/Editor.js CHANGED
@@ -111,7 +111,8 @@ class Editor extends Component {
111
 
112
  this.props.setAttributes({
113
  id,
114
- route: 'chartSelect'
 
115
  });
116
  }
117
 
@@ -520,6 +521,7 @@ class Editor extends Component {
520
  { ( 'chartSelect' === this.state.route && null !== this.state.chart ) &&
521
  <ChartSelect
522
  id={ this.props.attributes.id }
 
523
  chart={ this.state.chart }
524
  editSettings={ this.editSettings }
525
  editPermissions={ this.editPermissions }
111
 
112
  this.props.setAttributes({
113
  id,
114
+ route: 'chartSelect',
115
+ lazy: -1
116
  });
117
  }
118
 
521
  { ( 'chartSelect' === this.state.route && null !== this.state.chart ) &&
522
  <ChartSelect
523
  id={ this.props.attributes.id }
524
+ attributes={ this.props.attributes }
525
  chart={ this.state.chart }
526
  editSettings={ this.editSettings }
527
  editPermissions={ this.editPermissions }
classes/Visualizer/Gutenberg/src/index.js CHANGED
@@ -39,6 +39,10 @@ export default registerBlockType( 'visualizer/chart', {
39
  id: {
40
  type: 'number'
41
  },
 
 
 
 
42
  route: {
43
  type: 'string'
44
  }
39
  id: {
40
  type: 'number'
41
  },
42
+ lazy: {
43
+ default: '-1',
44
+ type: 'string'
45
+ },
46
  route: {
47
  type: 'string'
48
  }
classes/Visualizer/Gutenberg/src/utils.js CHANGED
@@ -15,6 +15,12 @@ export const formatDate = ( data ) => {
15
  };
16
 
17
  // A fork of deep-compact package as it had some issues
 
 
 
 
 
 
18
  const notEmpty = value => {
19
  let key;
20
 
15
  };
16
 
17
  // A fork of deep-compact package as it had some issues
18
+ // NOTE: This method is likely to create problems.
19
+ // Problem Scenario #1:
20
+ // - A table has 5 columns (series). Say the 1st column is Date and others are Numbers.
21
+ // - If the 1st columns format (series.format) is provided, DataTable.js gets 6 (0-5) series.
22
+ // - BUT if the 1st columns format (series.format) is empty, DataTable.js gets 5 (1-4) series.
23
+ // That is why when sending options to DataTable.js, filterChart method has not been used.
24
  const notEmpty = value => {
25
  let key;
26
 
classes/Visualizer/Module.php CHANGED
@@ -80,7 +80,7 @@ class Visualizer_Module {
80
  */
81
  public function onShutdown() {
82
  $error = error_get_last();
83
- if ( $error['type'] === E_ERROR && false !== strpos( $error['file'], 'Visualizer/' ) ) {
84
  do_action( 'themeisle_log_event', Visualizer_Plugin::NAME, sprintf( 'Critical error %s', print_r( $error, true ) ), 'error', __FILE__, __LINE__ );
85
  }
86
  }
@@ -546,6 +546,9 @@ class Visualizer_Module {
546
  $name = $this->load_chart_class_name( $chart_id );
547
  $class = null;
548
  if ( class_exists( $name ) || true === apply_filters( 'visualizer_load_chart', false, $name ) ) {
 
 
 
549
  $class = new $name;
550
  }
551
 
80
  */
81
  public function onShutdown() {
82
  $error = error_get_last();
83
+ if ( $error && $error['type'] === E_ERROR && false !== strpos( $error['file'], 'Visualizer/' ) ) {
84
  do_action( 'themeisle_log_event', Visualizer_Plugin::NAME, sprintf( 'Critical error %s', print_r( $error, true ) ), 'error', __FILE__, __LINE__ );
85
  }
86
  }
546
  $name = $this->load_chart_class_name( $chart_id );
547
  $class = null;
548
  if ( class_exists( $name ) || true === apply_filters( 'visualizer_load_chart', false, $name ) ) {
549
+ if ( 'Visualizer_Render_Sidebar_Type_DataTable_DataTable' === $name ) {
550
+ $name = 'Visualizer_Render_Sidebar_Type_DataTable_Tabular';
551
+ }
552
  $class = new $name;
553
  }
554
 
classes/Visualizer/Module/Admin.php CHANGED
@@ -314,7 +314,7 @@ class Visualizer_Module_Admin extends Visualizer_Module {
314
  // Load all the assets for the different libraries we support.
315
  $deps = array(
316
  Visualizer_Render_Sidebar_Google::enqueue_assets( array( 'media-editor' ) ),
317
- Visualizer_Render_Sidebar_Type_DataTable_DataTable::enqueue_assets( array( 'media-editor' ) ),
318
  );
319
 
320
  wp_enqueue_script( 'visualizer-media-model', VISUALIZER_ABSURL . 'js/media/model.js', $deps, Visualizer_Plugin::VERSION, true );
@@ -392,10 +392,10 @@ class Visualizer_Module_Admin extends Visualizer_Module {
392
  $types = array_merge(
393
  $additional,
394
  array(
395
- 'dataTable' => array(
396
  'name' => esc_html__( 'Table', 'visualizer' ),
397
  'enabled' => true,
398
- 'supports' => array( 'DataTable' ),
399
  ),
400
  'pie' => array(
401
  'name' => esc_html__( 'Pie/Donut', 'visualizer' ),
@@ -450,11 +450,6 @@ class Visualizer_Module_Admin extends Visualizer_Module {
450
  'supports' => array( 'Google Charts' ),
451
  ),
452
  // pro types
453
- 'table' => array(
454
- 'name' => esc_html__( 'Table (Deprecated)', 'visualizer' ),
455
- 'enabled' => false,
456
- 'supports' => array( 'Google Charts' ),
457
- ),
458
  'timeline' => array(
459
  'name' => esc_html__( 'Timeline', 'visualizer' ),
460
  'enabled' => false,
@@ -525,16 +520,6 @@ class Visualizer_Module_Admin extends Visualizer_Module {
525
  case 'types':
526
  // fall-through
527
  case 'library':
528
- // if the user has a Google Table chart, show it as deprecated otherwise remove the option from the library.
529
- if ( ! self::hasChartType( 'table' ) ) {
530
- $deprecated[] = 'table';
531
- if ( $get2Darray ) {
532
- $types['dataTable'] = esc_html__( 'Table', 'visualizer' );
533
- } else {
534
- $types['dataTable']['name'] = esc_html__( 'Table', 'visualizer' );
535
- }
536
- }
537
-
538
  // if a user has a Gauge/Candlestick chart, then let them keep using it.
539
  if ( ! Visualizer_Module::is_pro() ) {
540
  if ( ! self::hasChartType( 'gauge' ) ) {
@@ -554,16 +539,6 @@ class Visualizer_Module_Admin extends Visualizer_Module {
554
  }
555
  break;
556
  default:
557
- // remove the option to create a Google Table chart.
558
- $deprecated[] = 'table';
559
-
560
- // rename the new table chart type.
561
- if ( $get2Darray ) {
562
- $types['dataTable'] = esc_html__( 'Table', 'visualizer' );
563
- } else {
564
- $types['dataTable']['name'] = esc_html__( 'Table', 'visualizer' );
565
- }
566
-
567
  // if a user has a Gauge/Candlestick chart, then let them keep using it.
568
  if ( ! Visualizer_Module::is_pro() ) {
569
  if ( ! self::hasChartType( 'gauge' ) ) {
@@ -623,6 +598,7 @@ class Visualizer_Module_Admin extends Visualizer_Module {
623
  */
624
  public function enqueueLibraryScripts( $suffix ) {
625
  if ( $suffix === $this->_libraryPage ) {
 
626
  wp_enqueue_style( 'visualizer-library', VISUALIZER_ABSURL . 'css/library.css', array(), Visualizer_Plugin::VERSION );
627
  $this->_addFilter( 'media_upload_tabs', 'setupVisualizerTab' );
628
  wp_enqueue_media();
@@ -632,6 +608,7 @@ class Visualizer_Module_Admin extends Visualizer_Module {
632
  array(
633
  'jquery',
634
  'media-views',
 
635
  ),
636
  Visualizer_Plugin::VERSION,
637
  true
@@ -978,7 +955,8 @@ class Visualizer_Module_Admin extends Visualizer_Module {
978
  ),
979
  'page_type' => 'library',
980
  'is_front' => false,
981
- 'i10n' => array(
 
982
  'conflict' => __( 'We have detected a potential conflict with another component that prevents Visualizer from functioning properly. Please disable any of the following components if they are activated on your instance: Modern Events Calendar plugin, Acronix plugin. In case the aforementioned components are not activated or you continue to see this error message, please disable all other plugins and enable them one by one to find out the component that is causing the conflict.', 'visualizer' ),
983
  ),
984
  )
314
  // Load all the assets for the different libraries we support.
315
  $deps = array(
316
  Visualizer_Render_Sidebar_Google::enqueue_assets( array( 'media-editor' ) ),
317
+ Visualizer_Render_Sidebar_Type_DataTable_Tabular::enqueue_assets( array( 'media-editor' ) ),
318
  );
319
 
320
  wp_enqueue_script( 'visualizer-media-model', VISUALIZER_ABSURL . 'js/media/model.js', $deps, Visualizer_Plugin::VERSION, true );
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' ),
450
  'supports' => array( 'Google Charts' ),
451
  ),
452
  // pro types
 
 
 
 
 
453
  'timeline' => array(
454
  'name' => esc_html__( 'Timeline', 'visualizer' ),
455
  'enabled' => false,
520
  case 'types':
521
  // fall-through
522
  case 'library':
 
 
 
 
 
 
 
 
 
 
523
  // if a user has a Gauge/Candlestick chart, then let them keep using it.
524
  if ( ! Visualizer_Module::is_pro() ) {
525
  if ( ! self::hasChartType( 'gauge' ) ) {
539
  }
540
  break;
541
  default:
 
 
 
 
 
 
 
 
 
 
542
  // if a user has a Gauge/Candlestick chart, then let them keep using it.
543
  if ( ! Visualizer_Module::is_pro() ) {
544
  if ( ! self::hasChartType( 'gauge' ) ) {
598
  */
599
  public function enqueueLibraryScripts( $suffix ) {
600
  if ( $suffix === $this->_libraryPage ) {
601
+ wp_register_script( 'visualizer-clipboardjs', VISUALIZER_ABSURL . 'js/lib/clipboardjs/clipboard.min.js', array( 'jquery' ), Visualizer_Plugin::VERSION, true );
602
  wp_enqueue_style( 'visualizer-library', VISUALIZER_ABSURL . 'css/library.css', array(), Visualizer_Plugin::VERSION );
603
  $this->_addFilter( 'media_upload_tabs', 'setupVisualizerTab' );
604
  wp_enqueue_media();
608
  array(
609
  'jquery',
610
  'media-views',
611
+ 'visualizer-clipboardjs',
612
  ),
613
  Visualizer_Plugin::VERSION,
614
  true
955
  ),
956
  'page_type' => 'library',
957
  'is_front' => false,
958
+ 'i10n' => array(
959
+ 'copied' => __( 'The shortcode has been copied to your clipboard. Hit Ctrl-V/Cmd-V to paste it.', 'visualizer' ),
960
  'conflict' => __( 'We have detected a potential conflict with another component that prevents Visualizer from functioning properly. Please disable any of the following components if they are activated on your instance: Modern Events Calendar plugin, Acronix plugin. In case the aforementioned components are not activated or you continue to see this error message, please disable all other plugins and enable them one by one to find out the component that is causing the conflict.', 'visualizer' ),
961
  ),
962
  )
classes/Visualizer/Module/Frontend.php CHANGED
@@ -241,11 +241,14 @@ class Visualizer_Module_Frontend extends Visualizer_Module {
241
  global $wp_version;
242
  $atts = shortcode_atts(
243
  array(
244
- 'id' => false, // chart id
245
- 'class' => false, // chart class
246
- 'series' => false, // series filter hook
247
- 'data' => false, // data filter hook
248
- 'settings' => false, // data filter hook
 
 
 
249
  ),
250
  $atts
251
  );
@@ -255,6 +258,7 @@ class Visualizer_Module_Frontend extends Visualizer_Module {
255
  return '';
256
  }
257
 
 
258
  if ( ! apply_filters( 'visualizer_pro_show_chart', true, $atts['id'] ) ) {
259
  return '';
260
  }
@@ -268,8 +272,18 @@ class Visualizer_Module_Frontend extends Visualizer_Module {
268
  $id = 'visualizer-' . $atts['id'];
269
  $defaultClass = 'visualizer-front';
270
  $class = apply_filters( Visualizer_Plugin::FILTER_CHART_WRAPPER_CLASS, $atts['class'], $atts['id'] );
271
- $class = $defaultClass . ' ' . $class . ' ' . 'visualizer-front-' . $atts['id'];
272
- $class = ! empty( $class ) ? ' class="' . trim( $class ) . '"' : '';
 
 
 
 
 
 
 
 
 
 
273
 
274
  $type = get_post_meta( $chart->ID, Visualizer_Plugin::CF_CHART_TYPE, true );
275
 
@@ -283,20 +297,12 @@ class Visualizer_Module_Frontend extends Visualizer_Module {
283
 
284
  // handle series filter hooks
285
  $series = apply_filters( Visualizer_Plugin::FILTER_GET_CHART_SERIES, get_post_meta( $chart->ID, Visualizer_Plugin::CF_SERIES, true ), $chart->ID, $type );
286
- if ( ! empty( $atts['series'] ) ) {
287
- $series = apply_filters( $atts['series'], $series, $chart->ID, $type );
288
- }
289
  // handle settings filter hooks
290
  $settings = apply_filters( Visualizer_Plugin::FILTER_GET_CHART_SETTINGS, $settings, $chart->ID, $type );
291
- if ( ! empty( $atts['settings'] ) ) {
292
- $settings = apply_filters( $atts['settings'], $settings, $chart->ID, $type );
293
- }
294
 
295
  // handle data filter hooks
296
  $data = self::get_chart_data( $chart, $type );
297
- if ( ! empty( $atts['data'] ) ) {
298
- $data = apply_filters( $atts['data'], $data, $chart->ID, $type );
299
- }
300
 
301
  $css = '';
302
  $arguments = $this->get_inline_custom_css( $id, $settings );
@@ -311,7 +317,7 @@ class Visualizer_Module_Frontend extends Visualizer_Module {
311
 
312
  $amp = Visualizer_Plugin::instance()->getModule( Visualizer_Module_AMP::NAME );
313
  if ( $amp && $amp->is_amp() ) {
314
- return '<div id="' . $id . '"' . $class . '>' . $amp->get_chart( $chart, $data, $series, $settings ) . '</div>';
315
  }
316
 
317
  // add chart to the array
@@ -355,8 +361,8 @@ class Visualizer_Module_Frontend extends Visualizer_Module {
355
 
356
  $actions_div .= $css;
357
 
358
- foreach ( $this->_charts as $id => $attributes ) {
359
- $library = $attributes['library'];
360
  wp_register_script(
361
  "visualizer-render-$library",
362
  VISUALIZER_ABSURL . 'js/render-facade.js',
@@ -385,7 +391,26 @@ class Visualizer_Module_Frontend extends Visualizer_Module {
385
  }
386
 
387
  // return placeholder div
388
- return $actions_div . '<div id="' . $id . '"' . $class . '></div>' . $this->addSchema( $chart->ID );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
389
  }
390
 
391
  /**
241
  global $wp_version;
242
  $atts = shortcode_atts(
243
  array(
244
+ // chart id
245
+ 'id' => false,
246
+ // chart class
247
+ 'class' => false,
248
+ // for lazy load
249
+ // set 'yes' to use the default intersection limit (300px)
250
+ // OR set a number (e.g. 700) to use 700px as the intersection limit
251
+ 'lazy' => apply_filters( 'visualizer_lazy_by_default', false, $atts['id'] ),
252
  ),
253
  $atts
254
  );
258
  return '';
259
  }
260
 
261
+ // do not show the chart?
262
  if ( ! apply_filters( 'visualizer_pro_show_chart', true, $atts['id'] ) ) {
263
  return '';
264
  }
272
  $id = 'visualizer-' . $atts['id'];
273
  $defaultClass = 'visualizer-front';
274
  $class = apply_filters( Visualizer_Plugin::FILTER_CHART_WRAPPER_CLASS, $atts['class'], $atts['id'] );
275
+
276
+ $lazyClass = $atts['lazy'] === 'yes' || ctype_digit( $atts['lazy'] ) ? 'visualizer-lazy' : '';
277
+
278
+ $class = sprintf( '%s %s %s %s', $defaultClass, $class, 'visualizer-front-' . $atts['id'], $lazyClass );
279
+ $attributes = array();
280
+ if ( ! empty( $class ) ) {
281
+ $attributes['class'] = trim( $class );
282
+ }
283
+
284
+ if ( ctype_digit( $atts['lazy'] ) ) {
285
+ $attributes['data-lazy-limit'] = $atts['lazy'];
286
+ }
287
 
288
  $type = get_post_meta( $chart->ID, Visualizer_Plugin::CF_CHART_TYPE, true );
289
 
297
 
298
  // handle series filter hooks
299
  $series = apply_filters( Visualizer_Plugin::FILTER_GET_CHART_SERIES, get_post_meta( $chart->ID, Visualizer_Plugin::CF_SERIES, true ), $chart->ID, $type );
300
+
 
 
301
  // handle settings filter hooks
302
  $settings = apply_filters( Visualizer_Plugin::FILTER_GET_CHART_SETTINGS, $settings, $chart->ID, $type );
 
 
 
303
 
304
  // handle data filter hooks
305
  $data = self::get_chart_data( $chart, $type );
 
 
 
306
 
307
  $css = '';
308
  $arguments = $this->get_inline_custom_css( $id, $settings );
317
 
318
  $amp = Visualizer_Plugin::instance()->getModule( Visualizer_Module_AMP::NAME );
319
  if ( $amp && $amp->is_amp() ) {
320
+ return '<div id="' . $id . '"' . $this->getHtmlAttributes( $attributes ) . '>' . $amp->get_chart( $chart, $data, $series, $settings ) . '</div>';
321
  }
322
 
323
  // add chart to the array
361
 
362
  $actions_div .= $css;
363
 
364
+ foreach ( $this->_charts as $id => $array ) {
365
+ $library = $array['library'];
366
  wp_register_script(
367
  "visualizer-render-$library",
368
  VISUALIZER_ABSURL . 'js/render-facade.js',
391
  }
392
 
393
  // return placeholder div
394
+ return $actions_div . '<div id="' . $id . '"' . $this->getHtmlAttributes( $attributes ) . '></div>' . $this->addSchema( $chart->ID );
395
+ }
396
+
397
+ /**
398
+ * Converts the array of attributes to a string of HTML attributes.
399
+ *
400
+ * @since ?
401
+ *
402
+ * @access private
403
+ */
404
+ private function getHtmlAttributes( $attributes ) {
405
+ $string = '';
406
+ if ( ! $attributes ) {
407
+ return $string;
408
+ }
409
+
410
+ foreach ( $attributes as $name => $value ) {
411
+ $string .= sprintf( '%s="%s"', esc_attr( $name ), esc_attr( $value ) );
412
+ }
413
+ return $string;
414
  }
415
 
416
  /**
classes/Visualizer/Module/Setup.php CHANGED
@@ -204,6 +204,9 @@ class Visualizer_Module_Setup extends Visualizer_Module {
204
  return;
205
  }
206
 
 
 
 
207
  if ( get_option( 'visualizer-activated' ) ) {
208
  delete_option( 'visualizer-activated' );
209
  if ( ! headers_sent() ) {
204
  return;
205
  }
206
 
207
+ // fire any upgrades necessary.
208
+ Visualizer_Module_Upgrade::upgrade();
209
+
210
  if ( get_option( 'visualizer-activated' ) ) {
211
  delete_option( 'visualizer-activated' );
212
  if ( ! headers_sent() ) {
classes/Visualizer/Module/Upgrade.php ADDED
@@ -0,0 +1,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * General module to upgrade configuration/charts.
5
+ *
6
+ * @category Visualizer
7
+ * @package Module
8
+ *
9
+ * @since 3.4.3
10
+ */
11
+ class Visualizer_Module_Upgrade extends Visualizer_Module {
12
+
13
+ const NAME = __CLASS__;
14
+
15
+ /**
16
+ * Upgrades the configuration of charts, if required.
17
+ */
18
+ public static function upgrade() {
19
+ $last_version = get_option( 'visualizer-upgraded', '0.0.0' );
20
+
21
+ switch ( $last_version ) {
22
+ case '0.0.0':
23
+ self::makeAllTableChartsTabular();
24
+ break;
25
+ default:
26
+ return;
27
+ }
28
+
29
+ update_option( 'visualizer-upgraded', Visualizer_Plugin::VERSION );
30
+
31
+ // this will help in debugging to know which version this was upgraded from.
32
+ update_option( 'visualizer-upgraded-from', $last_version );
33
+ }
34
+
35
+ /**
36
+ * All 'dataTable' and 'table' charts to become 'tabular'.
37
+ * All charts that do not have a library, to get the default library.
38
+ */
39
+ private static function makeAllTableChartsTabular() {
40
+ global $wpdb;
41
+
42
+ // old table charts may not specify the library.
43
+ $args = array(
44
+ 'post_type' => Visualizer_Plugin::CPT_VISUALIZER,
45
+ 'fields' => 'ids',
46
+ 'post_status' => 'publish',
47
+ 'meta_query' => array(
48
+ array(
49
+ 'key' => Visualizer_Plugin::CF_CHART_LIBRARY,
50
+ 'compare' => 'NOT EXISTS',
51
+ ),
52
+ array(
53
+ 'key' => Visualizer_Plugin::CF_CHART_TYPE,
54
+ 'value' => 'table',
55
+ ),
56
+ ),
57
+ );
58
+ $query = new WP_Query( $args );
59
+ while ( $query->have_posts() ) {
60
+ $id = $query->next_post();
61
+ add_post_meta( $id, Visualizer_Plugin::CF_CHART_LIBRARY, 'GoogleCharts' );
62
+ }
63
+
64
+ // make all dataTable and table chart types into tabular.
65
+ // phpcs:disable WordPress.DB.PreparedSQL.NotPrepared
66
+ $wpdb->query(
67
+ "UPDATE $wpdb->postmeta pm, $wpdb->posts p SET pm.meta_value = 'tabular'
68
+ WHERE p.post_type = '" . Visualizer_Plugin::CPT_VISUALIZER . "'
69
+ AND p.id = pm.post_id
70
+ AND pm.meta_key = '" . Visualizer_Plugin::CF_CHART_TYPE . "'
71
+ AND pm.meta_value IN ( 'dataTable', 'table' )"
72
+ );
73
+ // phpcs:enable WordPress.DB.PreparedSQL.NotPrepared
74
+
75
+ }
76
+ }
classes/Visualizer/Plugin.php CHANGED
@@ -28,7 +28,7 @@
28
  class Visualizer_Plugin {
29
 
30
  const NAME = 'visualizer';
31
- const VERSION = '3.4.4';
32
 
33
  // custom post types
34
  const CPT_VISUALIZER = 'visualizer';
28
  class Visualizer_Plugin {
29
 
30
  const NAME = 'visualizer';
31
+ const VERSION = '3.4.5';
32
 
33
  // custom post types
34
  const CPT_VISUALIZER = 'visualizer';
classes/Visualizer/Render/Layout.php CHANGED
@@ -599,7 +599,7 @@ class Visualizer_Render_Layout extends Visualizer_Render {
599
  $chart_id = $args[1];
600
  $type = get_post_meta( $chart_id, Visualizer_Plugin::CF_CHART_TYPE, true );
601
  switch ( $type ) {
602
- case 'dataTable':
603
  $type = 'table';
604
  break;
605
  case 'polarArea':
599
  $chart_id = $args[1];
600
  $type = get_post_meta( $chart_id, Visualizer_Plugin::CF_CHART_TYPE, true );
601
  switch ( $type ) {
602
+ case 'tabular':
603
  $type = 'table';
604
  break;
605
  case 'polarArea':
classes/Visualizer/Render/Library.php CHANGED
@@ -252,9 +252,7 @@ class Visualizer_Render_Library extends Visualizer_Render {
252
  echo '<span class="visualizer-chart-action visualizer-nochart-clone"></span>';
253
  echo '<span class="visualizer-chart-action visualizer-nochart-edit"></span>';
254
  echo '<span class="visualizer-chart-action visualizer-nochart-export"></span>';
255
- echo '<span class="visualizer-chart-shortcode">';
256
- echo '&nbsp;[visualizer]&nbsp;';
257
- echo '</span>';
258
  echo '</div>';
259
  echo '</div>';
260
  $this->_renderSidebar();
@@ -327,6 +325,7 @@ class Visualizer_Render_Library extends Visualizer_Render {
327
  $chart_status['title'] = __( 'Click to view the error', 'visualizer' );
328
  }
329
 
 
330
  echo '<div class="visualizer-chart"><div class="visualizer-chart-title">', esc_html( $title ), '</div>';
331
  echo '<div id="', $placeholder_id, '" class="visualizer-chart-canvas">';
332
  echo '<img src="', VISUALIZER_ABSURL, 'images/ajax-loader.gif" class="loader">';
@@ -339,9 +338,8 @@ class Visualizer_Render_Library extends Visualizer_Render {
339
  if ( $this->can_chart_have_action( 'image', $chart_id ) ) {
340
  echo '<a class="visualizer-chart-action visualizer-chart-image" href="javascript:;" title="', esc_attr__( 'Download as image', 'visualizer' ), '" data-chart="visualizer-', $chart_id, '" data-chart-title="', $title, '"></a>';
341
  }
342
- echo '<span class="visualizer-chart-shortcode" title="', esc_attr__( 'Click to select', 'visualizer' ), '">';
343
- echo '&nbsp;[visualizer id=&quot;', $chart_id, '&quot;]&nbsp;';
344
- echo '</span>';
345
  echo '<hr><div class="visualizer-chart-status"><span class="visualizer-date" title="' . __( 'Last Updated', 'visualizer' ) . '">' . $chart_status['date'] . '</span><span class="visualizer-error"><i class="dashicons ' . $chart_status['icon'] . '" data-viz-error="' . esc_attr( str_replace( '"', "'", $chart_status['error'] ) ) . '" title="' . esc_attr( $chart_status['title'] ) . '"></i></span></div>';
346
  echo '</div>';
347
  echo '</div>';
252
  echo '<span class="visualizer-chart-action visualizer-nochart-clone"></span>';
253
  echo '<span class="visualizer-chart-action visualizer-nochart-edit"></span>';
254
  echo '<span class="visualizer-chart-action visualizer-nochart-export"></span>';
255
+ echo '<span class="visualizer-chart-action visualizer-nochart-shortcode"></span>';
 
 
256
  echo '</div>';
257
  echo '</div>';
258
  $this->_renderSidebar();
325
  $chart_status['title'] = __( 'Click to view the error', 'visualizer' );
326
  }
327
 
328
+ $shortcode = sprintf( '[visualizer id="%s" lazy="no" class=""]', $chart_id );
329
  echo '<div class="visualizer-chart"><div class="visualizer-chart-title">', esc_html( $title ), '</div>';
330
  echo '<div id="', $placeholder_id, '" class="visualizer-chart-canvas">';
331
  echo '<img src="', VISUALIZER_ABSURL, 'images/ajax-loader.gif" class="loader">';
338
  if ( $this->can_chart_have_action( 'image', $chart_id ) ) {
339
  echo '<a class="visualizer-chart-action visualizer-chart-image" href="javascript:;" title="', esc_attr__( 'Download as image', 'visualizer' ), '" data-chart="visualizer-', $chart_id, '" data-chart-title="', $title, '"></a>';
340
  }
341
+ echo '<a class="visualizer-chart-action visualizer-chart-shortcode" href="javascript:;" title="', esc_attr__( 'Click to copy shortcode', 'visualizer' ), '" data-clipboard-text="', esc_attr( $shortcode ), '"></a>';
342
+ echo '<span>&nbsp;</span>';
 
343
  echo '<hr><div class="visualizer-chart-status"><span class="visualizer-date" title="' . __( 'Last Updated', 'visualizer' ) . '">' . $chart_status['date'] . '</span><span class="visualizer-error"><i class="dashicons ' . $chart_status['icon'] . '" data-viz-error="' . esc_attr( str_replace( '"', "'", $chart_status['error'] ) ) . '" title="' . esc_attr( $chart_status['title'] ) . '"></i></span></div>';
344
  echo '</div>';
345
  echo '</div>';
classes/Visualizer/Render/Page/Types.php CHANGED
@@ -54,7 +54,12 @@ class Visualizer_Render_Page_Types extends Visualizer_Render_Page {
54
  protected function _renderContent() {
55
  echo '<div id="type-picker">';
56
  foreach ( $this->types as $type => $array ) {
57
- echo '<div class="type-box type-box-', $type, '">';
 
 
 
 
 
58
  if ( ! $array['enabled'] ) {
59
  echo "<a class='pro-upsell' href='" . Visualizer_Plugin::PRO_TEASER_URL . "' target='_blank'>";
60
  echo "<span class='visualizder-pro-label'>" . __( 'PREMIUM', 'visualizer' ) . '</span>';
54
  protected function _renderContent() {
55
  echo '<div id="type-picker">';
56
  foreach ( $this->types as $type => $array ) {
57
+ // add classes to each box that identifies the libraries this chart type supports.
58
+ $lib_classes = '';
59
+ foreach ( $array['supports'] as $lib ) {
60
+ $lib_classes .= ' type-lib-' . str_replace( ' ', '', $lib );
61
+ }
62
+ echo '<div class="type-box type-box-', $type, $lib_classes, '">';
63
  if ( ! $array['enabled'] ) {
64
  echo "<a class='pro-upsell' href='" . Visualizer_Plugin::PRO_TEASER_URL . "' target='_blank'>";
65
  echo "<span class='visualizder-pro-label'>" . __( 'PREMIUM', 'visualizer' ) . '</span>';
classes/Visualizer/Render/Sidebar/Type/DataTable/DataTable.php CHANGED
@@ -22,6 +22,8 @@
22
  /**
23
  * Class for datatables.net table chart sidebar settings.
24
  *
 
 
25
  * @since 1.0.0
26
  */
27
  class Visualizer_Render_Sidebar_Type_DataTable_DataTable extends Visualizer_Render_Sidebar {
@@ -442,7 +444,9 @@ class Visualizer_Render_Sidebar_Type_DataTable_DataTable extends Visualizer_Rend
442
  'series[' . $index . '][format][precision]',
443
  isset( $this->series[ $index ]['format']['precision'] ) ? $this->series[ $index ]['format']['precision'] : '',
444
  esc_html__( 'Round values to how many decimal places?', 'visualizer' ),
445
- ''
 
 
446
  );
447
  self::_renderTextItem(
448
  esc_html__( 'Prefix', 'visualizer' ),
22
  /**
23
  * Class for datatables.net table chart sidebar settings.
24
  *
25
+ * THIS IS ONLY FOR BACKWARD COMPATIBILITY ON DEV SYSTEMS. CAN BE REMOVED IN A FUTURE RELEASE.
26
+ *
27
  * @since 1.0.0
28
  */
29
  class Visualizer_Render_Sidebar_Type_DataTable_DataTable extends Visualizer_Render_Sidebar {
444
  'series[' . $index . '][format][precision]',
445
  isset( $this->series[ $index ]['format']['precision'] ) ? $this->series[ $index ]['format']['precision'] : '',
446
  esc_html__( 'Round values to how many decimal places?', 'visualizer' ),
447
+ '',
448
+ 'number',
449
+ array( 'min' => 0 )
450
  );
451
  self::_renderTextItem(
452
  esc_html__( 'Prefix', 'visualizer' ),
classes/Visualizer/Render/Sidebar/Type/DataTable/Tabular.php ADDED
@@ -0,0 +1,485 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // +----------------------------------------------------------------------+
4
+ // | Copyright 2013 Madpixels (email : visualizer@madpixels.net) |
5
+ // +----------------------------------------------------------------------+
6
+ // | This program is free software; you can redistribute it and/or modify |
7
+ // | it under the terms of the GNU General Public License, version 2, as |
8
+ // | published by the Free Software Foundation. |
9
+ // | |
10
+ // | This program is distributed in the hope that it will be useful, |
11
+ // | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12
+ // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13
+ // | GNU General Public License for more details. |
14
+ // | |
15
+ // | You should have received a copy of the GNU General Public License |
16
+ // | along with this program; if not, write to the Free Software |
17
+ // | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, |
18
+ // | MA 02110-1301 USA |
19
+ // +----------------------------------------------------------------------+
20
+ // | Author: Eugene Manuilov <eugene@manuilov.org> |
21
+ // +----------------------------------------------------------------------+
22
+ /**
23
+ * Class for datatables.net table chart sidebar settings.
24
+ *
25
+ * @since 1.0.0
26
+ */
27
+ class Visualizer_Render_Sidebar_Type_DataTable_Tabular extends Visualizer_Render_Sidebar {
28
+
29
+
30
+ /**
31
+ * Constructor.
32
+ *
33
+ * @since 1.0.0
34
+ *
35
+ * @access public
36
+ * @param array $data The data what has to be associated with this render.
37
+ */
38
+ public function __construct( $data = array() ) {
39
+ $this->_library = 'datatables';
40
+ $this->_includeCurveTypes = false;
41
+
42
+ parent::__construct( $data );
43
+ }
44
+
45
+ /**
46
+ * Registers additional hooks.
47
+ *
48
+ * @access protected
49
+ */
50
+ protected function hooks() {
51
+ if ( $this->_library === 'datatables' ) {
52
+ add_filter( 'visualizer_assets_render', array( $this, 'load_assets' ), 10, 2 );
53
+ }
54
+ }
55
+
56
+ /**
57
+ * Registers assets.
58
+ *
59
+ * @access public
60
+ */
61
+ function load_assets( $deps, $is_frontend ) {
62
+ $this->load_dependent_assets( array( 'moment' ) );
63
+
64
+ wp_register_script( 'visualizer-datatables', VISUALIZER_ABSURL . 'js/lib/datatables.min.js', array( 'jquery-ui-core', 'moment' ), Visualizer_Plugin::VERSION );
65
+ wp_enqueue_style( 'visualizer-datatables', VISUALIZER_ABSURL . 'css/lib/datatables.min.css', array(), Visualizer_Plugin::VERSION );
66
+
67
+ wp_register_script(
68
+ 'visualizer-render-datatables-lib',
69
+ VISUALIZER_ABSURL . 'js/render-datatables.js',
70
+ array(
71
+ 'visualizer-datatables',
72
+ ),
73
+ Visualizer_Plugin::VERSION,
74
+ true
75
+ );
76
+
77
+ return array_merge(
78
+ $deps,
79
+ array( 'visualizer-render-datatables-lib' )
80
+ );
81
+ }
82
+
83
+ /**
84
+ * Enqueue assets.
85
+ */
86
+ public static function enqueue_assets( $deps = array() ) {
87
+ wp_enqueue_style( 'visualizer-datatables', VISUALIZER_ABSURL . 'css/lib/datatables.min.css', array(), Visualizer_Plugin::VERSION );
88
+ wp_enqueue_script( 'visualizer-datatables', VISUALIZER_ABSURL . 'js/lib/datatables.min.js', array( 'jquery-ui-core' ), Visualizer_Plugin::VERSION );
89
+ wp_enqueue_script( 'visualizer-render-datatables-lib', VISUALIZER_ABSURL . 'js/render-datatables.js', array_merge( $deps, array( 'jquery-ui-core', 'visualizer-datatables' ) ), Visualizer_Plugin::VERSION, true );
90
+ return 'visualizer-render-datatables-lib';
91
+ }
92
+
93
+ /**
94
+ * Renders template.
95
+ *
96
+ * @since 1.0.0
97
+ *
98
+ * @access protected
99
+ */
100
+ protected function _toHTML() {
101
+ $this->_supportsAnimation = false;
102
+ $this->_renderGeneralSettings();
103
+ $this->_renderTableSettings();
104
+ $this->_renderColumnSettings();
105
+ $this->_renderAdvancedSettings();
106
+ }
107
+
108
+ /**
109
+ * Renders chart advanced settings group.
110
+ *
111
+ * @access protected
112
+ */
113
+ protected function _renderAdvancedSettings() {
114
+ self::_renderGroupStart( esc_html__( 'Frontend Actions', 'visualizer' ) );
115
+ self::_renderSectionStart();
116
+ self::_renderSectionDescription( esc_html__( 'Configure frontend actions that need to be shown.', 'visualizer' ) );
117
+ self::_renderSectionEnd();
118
+
119
+ $this->_renderActionSettings();
120
+ self::_renderGroupEnd();
121
+ }
122
+
123
+ /**
124
+ * Renders general settings group.
125
+ *
126
+ * @since 1.0.0
127
+ *
128
+ * @access protected
129
+ */
130
+ protected function _renderGeneralSettings() {
131
+ self::_renderGroupStart( esc_html__( 'General Settings', 'visualizer' ) );
132
+ self::_renderSectionStart( esc_html__( 'Title', 'visualizer' ), true );
133
+ self::_renderTextItem(
134
+ esc_html__( 'Chart Title', 'visualizer' ),
135
+ 'title',
136
+ $this->title,
137
+ esc_html__( 'Text to display in the back-end admin area.', 'visualizer' )
138
+ );
139
+
140
+ echo '<div class="viz-section-delimiter"></div>';
141
+
142
+ self::_renderTextAreaItem(
143
+ esc_html__( 'Chart Description', 'visualizer' ),
144
+ 'description',
145
+ $this->description,
146
+ sprintf( esc_html__( 'Description to display in the structured data schema as explained %1$shere%2$s', 'visualizer' ), '<a href="https://developers.google.com/search/docs/data-types/dataset#dataset" target="_blank">', '</a>' )
147
+ );
148
+
149
+ self::_renderSectionEnd();
150
+ self::_renderGroupEnd();
151
+ }
152
+
153
+ /**
154
+ * Renders line settings items.
155
+ *
156
+ * @since 1.0.0
157
+ *
158
+ * @access protected
159
+ */
160
+ protected function _renderTableSettings() {
161
+ self::_renderGroupStart( esc_html__( 'Table Settings', 'visualizer' ) );
162
+ self::_renderSectionStart();
163
+
164
+ self::_renderCheckboxItem(
165
+ esc_html__( 'Enable Pagination', 'visualizer' ),
166
+ 'paging_bool',
167
+ $this->paging_bool,
168
+ 'true',
169
+ esc_html__( 'To enable paging through the data.', 'visualizer' )
170
+ );
171
+
172
+ echo '<div class="viz-section-delimiter section-delimiter"></div>';
173
+
174
+ self::_renderTextItem(
175
+ esc_html__( 'Number of rows per page', 'visualizer' ),
176
+ 'pageLength_int',
177
+ $this->pageLength_int,
178
+ esc_html__( 'The number of rows in each page, when paging is enabled.', 'visualizer' ),
179
+ 10,
180
+ 'number',
181
+ array( 'min' => 1 )
182
+ );
183
+
184
+ echo '<div class="viz-section-delimiter section-delimiter"></div>';
185
+
186
+ self::_renderSelectItem(
187
+ esc_html__( 'Pagination type', 'visualizer' ),
188
+ 'pagingType',
189
+ $this->pagingType,
190
+ array(
191
+ 'numbers' => esc_html__( 'Page number buttons only', 'visualizer' ),
192
+ 'simple' => esc_html__( '\'Previous\' and \'Next\' buttons only', 'visualizer' ),
193
+ 'simple_numbers' => esc_html__( '\'Previous\' and \'Next\' buttons, plus page numbers', 'visualizer' ),
194
+ 'full' => esc_html__( '\'First\', \'Previous\', \'Next\' and \'Last\' buttons', 'visualizer' ),
195
+ 'full_numbers' => esc_html__( '\'First\', \'Previous\', \'Next\' and \'Last\' buttons, plus page numbers', 'visualizer' ),
196
+ 'first_last_numbers' => esc_html__( '\'First\' and \'Last\' buttons, plus page numbers', 'visualizer' ),
197
+ ),
198
+ esc_html__( 'Determines what type of pagination options to show.', 'visualizer' )
199
+ );
200
+
201
+ do_action( 'visualizer_chart_settings', __CLASS__, $this->_data, 'pagination' );
202
+
203
+ echo '<div class="viz-section-delimiter section-delimiter"></div>';
204
+
205
+ self::_renderTextItem(
206
+ esc_html__( 'Table Height', 'visualizer' ),
207
+ 'scrollY_int',
208
+ isset( $this->scrollY_int ) ? $this->scrollY_int : '',
209
+ esc_html__( 'Height of the table in pixels (the table will show a scrollbar).', 'visualizer' ),
210
+ '',
211
+ 'number',
212
+ array(
213
+ 'min' => 0,
214
+ )
215
+ );
216
+
217
+ self::_renderCheckboxItem(
218
+ esc_html__( 'Enable Horizontal Scrolling', 'visualizer' ),
219
+ 'scrollX',
220
+ $this->scrollX,
221
+ 'true',
222
+ esc_html__( 'To disable wrapping of columns and enabling horizontal scrolling.', 'visualizer' )
223
+ );
224
+
225
+ echo '<div class="viz-section-delimiter section-delimiter"></div>';
226
+
227
+ self::_renderCheckboxItem(
228
+ esc_html__( 'Disable Sort', 'visualizer' ),
229
+ 'ordering_bool',
230
+ $this->ordering_bool,
231
+ 'false',
232
+ esc_html__( 'To disable sorting on columns.', 'visualizer' )
233
+ );
234
+
235
+ echo '<div class="viz-section-delimiter section-delimiter"></div>';
236
+
237
+ self::_renderCheckboxItem(
238
+ esc_html__( 'Freeze Header/Footer', 'visualizer' ),
239
+ 'fixedHeader_bool',
240
+ $this->fixedHeader_bool,
241
+ 'true',
242
+ esc_html__( 'Freeze the header and footer.', 'visualizer' )
243
+ );
244
+
245
+ echo '<div class="viz-section-delimiter section-delimiter"></div>';
246
+
247
+ self::_renderCheckboxItem(
248
+ esc_html__( 'Responsive table?', 'visualizer' ),
249
+ 'responsive_bool',
250
+ $this->responsive_bool,
251
+ 'true',
252
+ esc_html__( 'Enable the table to be responsive.', 'visualizer' )
253
+ );
254
+
255
+ do_action( 'visualizer_chart_settings', __CLASS__, $this->_data, 'table' );
256
+
257
+ self::_renderSectionEnd();
258
+ self::_renderGroupEnd();
259
+
260
+ self::_renderGroupStart( esc_html__( 'Row/Cell Settings', 'visualizer' ) );
261
+
262
+ self::_renderSectionStart( esc_html__( 'Header Row', 'visualizer' ) );
263
+
264
+ self::_renderSectionDescription( esc_html__( 'These values may not reflect on preview and will be applied once you save and reload the chart. ', 'visualizer' ), 'viz-info-msg' );
265
+
266
+ self::_renderColorPickerItem(
267
+ esc_html__( 'Background Color', 'visualizer' ),
268
+ 'customcss[headerRow][background-color]',
269
+ isset( $this->customcss['headerRow']['background-color'] ) ? $this->customcss['headerRow']['background-color'] : null,
270
+ null
271
+ );
272
+
273
+ self::_renderColorPickerItem(
274
+ esc_html__( 'Color', 'visualizer' ),
275
+ 'customcss[headerRow][color]',
276
+ isset( $this->customcss['headerRow']['color'] ) ? $this->customcss['headerRow']['color'] : null,
277
+ null
278
+ );
279
+
280
+ self::_renderTextItem(
281
+ esc_html__( 'Text Orientation', 'visualizer' ),
282
+ 'customcss[headerRow][transform]',
283
+ isset( $this->customcss['headerRow']['transform'] ) ? $this->customcss['headerRow']['transform'] : null,
284
+ esc_html__( 'In degrees.', 'visualizer' ),
285
+ '',
286
+ 'number',
287
+ array(
288
+ 'min' => -180,
289
+ 'max' => 180,
290
+ )
291
+ );
292
+ self::_renderSectionEnd();
293
+
294
+ self::_renderSectionStart( esc_html__( 'Odd Table Row', 'visualizer' ) );
295
+
296
+ self::_renderSectionDescription( esc_html__( 'These values may not reflect on preview and will be applied once you save and reload the chart. ', 'visualizer' ), 'viz-info-msg' );
297
+
298
+ self::_renderColorPickerItem(
299
+ esc_html__( 'Background Color', 'visualizer' ),
300
+ 'customcss[oddTableRow][background-color]',
301
+ isset( $this->customcss['oddTableRow']['background-color'] ) ? $this->customcss['oddTableRow']['background-color'] : null,
302
+ null
303
+ );
304
+
305
+ self::_renderColorPickerItem(
306
+ esc_html__( 'Color', 'visualizer' ),
307
+ 'customcss[oddTableRow][color]',
308
+ isset( $this->customcss['oddTableRow']['color'] ) ? $this->customcss['oddTableRow']['color'] : null,
309
+ null
310
+ );
311
+
312
+ self::_renderTextItem(
313
+ esc_html__( 'Text Orientation', 'visualizer' ),
314
+ 'customcss[oddTableRow][transform]',
315
+ isset( $this->customcss['oddTableRow']['transform'] ) ? $this->customcss['oddTableRow']['transform'] : null,
316
+ esc_html__( 'In degrees.', 'visualizer' ),
317
+ '',
318
+ 'number',
319
+ array(
320
+ 'min' => -180,
321
+ 'max' => 180,
322
+ )
323
+ );
324
+ self::_renderSectionEnd();
325
+
326
+ self::_renderSectionStart( esc_html__( 'Even Table Row', 'visualizer' ) );
327
+
328
+ self::_renderSectionDescription( esc_html__( 'These values may not reflect on preview and will be applied once you save and reload the chart. ', 'visualizer' ), 'viz-info-msg' );
329
+
330
+ self::_renderColorPickerItem(
331
+ esc_html__( 'Background Color', 'visualizer' ),
332
+ 'customcss[evenTableRow][background-color]',
333
+ isset( $this->customcss['evenTableRow']['background-color'] ) ? $this->customcss['evenTableRow']['background-color'] : null,
334
+ null
335
+ );
336
+
337
+ self::_renderColorPickerItem(
338
+ esc_html__( 'Color', 'visualizer' ),
339
+ 'customcss[evenTableRow][color]',
340
+ isset( $this->customcss['evenTableRow']['color'] ) ? $this->customcss['evenTableRow']['color'] : null,
341
+ null
342
+ );
343
+
344
+ self::_renderTextItem(
345
+ esc_html__( 'Text Orientation', 'visualizer' ),
346
+ 'customcss[evenTableRow][transform]',
347
+ isset( $this->customcss['evenTableRow']['transform'] ) ? $this->customcss['evenTableRow']['transform'] : null,
348
+ esc_html__( 'In degrees.', 'visualizer' ),
349
+ '',
350
+ 'number',
351
+ array(
352
+ 'min' => -180,
353
+ 'max' => 180,
354
+ )
355
+ );
356
+ self::_renderSectionEnd();
357
+
358
+ self::_renderSectionStart( esc_html__( 'Table Cell', 'visualizer' ) );
359
+
360
+ self::_renderSectionDescription( esc_html__( 'These values may not reflect on preview and will be applied once you save and reload the chart. ', 'visualizer' ), 'viz-info-msg' );
361
+
362
+ self::_renderColorPickerItem(
363
+ esc_html__( 'Background Color', 'visualizer' ),
364
+ 'customcss[tableCell][background-color]',
365
+ isset( $this->customcss['tableCell']['background-color'] ) ? $this->customcss['tableCell']['background-color'] : null,
366
+ null
367
+ );
368
+
369
+ self::_renderColorPickerItem(
370
+ esc_html__( 'Color', 'visualizer' ),
371
+ 'customcss[tableCell][color]',
372
+ isset( $this->customcss['tableCell']['color'] ) ? $this->customcss['tableCell']['color'] : null,
373
+ null
374
+ );
375
+
376
+ self::_renderTextItem(
377
+ esc_html__( 'Text Orientation', 'visualizer' ),
378
+ 'customcss[tableCell][transform]',
379
+ isset( $this->customcss['tableCell']['transform'] ) ? $this->customcss['tableCell']['transform'] : null,
380
+ esc_html__( 'In degrees.', 'visualizer' ),
381
+ '',
382
+ 'number',
383
+ array(
384
+ 'min' => -180,
385
+ 'max' => 180,
386
+ )
387
+ );
388
+ self::_renderSectionEnd();
389
+
390
+ do_action( 'visualizer_chart_settings', __CLASS__, $this->_data, 'style' );
391
+
392
+ self::_renderGroupEnd();
393
+ }
394
+
395
+
396
+ /**
397
+ * Renders combo series settings
398
+ *
399
+ * @since 1.0.0
400
+ *
401
+ * @access protected
402
+ */
403
+ protected function _renderColumnSettings() {
404
+ self::_renderGroupStart( esc_html__( 'Column Settings', 'visualizer' ) );
405
+ for ( $i = 0, $cnt = count( $this->__series ); $i < $cnt; $i++ ) {
406
+ if ( ! empty( $this->__series[ $i ]['label'] ) ) {
407
+ self::_renderSectionStart( esc_html( $this->__series[ $i ]['label'] ), false );
408
+ $this->_renderFormatField( $i );
409
+ self::_renderSectionEnd();
410
+ }
411
+ }
412
+ self::_renderGroupEnd();
413
+ }
414
+
415
+ /**
416
+ * Renders format field according to series type.
417
+ *
418
+ * @since 1.3.0
419
+ *
420
+ * @access protected
421
+ * @param int $index The index of the series.
422
+ */
423
+ protected function _renderFormatField( $index = 0 ) {
424
+ switch ( $this->__series[ $index ]['type'] ) {
425
+ case 'number':
426
+ self::_renderTextItem(
427
+ esc_html__( 'Thousands Separator', 'visualizer' ),
428
+ 'series[' . $index . '][format][thousands]',
429
+ isset( $this->series[ $index ]['format']['thousands'] ) ? $this->series[ $index ]['format']['thousands'] : ',',
430
+ null,
431
+ ','
432
+ );
433
+ self::_renderTextItem(
434
+ esc_html__( 'Decimal Separator', 'visualizer' ),
435
+ 'series[' . $index . '][format][decimal]',
436
+ isset( $this->series[ $index ]['format']['decimal'] ) ? $this->series[ $index ]['format']['decimal'] : '.',
437
+ null,
438
+ '.'
439
+ );
440
+ self::_renderTextItem(
441
+ esc_html__( 'Precision', 'visualizer' ),
442
+ 'series[' . $index . '][format][precision]',
443
+ isset( $this->series[ $index ]['format']['precision'] ) ? $this->series[ $index ]['format']['precision'] : '',
444
+ esc_html__( 'Round values to how many decimal places?', 'visualizer' ),
445
+ '',
446
+ 'number',
447
+ array( 'min' => 0 )
448
+ );
449
+ self::_renderTextItem(
450
+ esc_html__( 'Prefix', 'visualizer' ),
451
+ 'series[' . $index . '][format][prefix]',
452
+ isset( $this->series[ $index ]['format']['prefix'] ) ? $this->series[ $index ]['format']['prefix'] : '',
453
+ null,
454
+ ''
455
+ );
456
+ self::_renderTextItem(
457
+ esc_html__( 'Suffix', 'visualizer' ),
458
+ 'series[' . $index . '][format][suffix]',
459
+ isset( $this->series[ $index ]['format']['suffix'] ) ? $this->series[ $index ]['format']['suffix'] : '',
460
+ null,
461
+ ''
462
+ );
463
+ break;
464
+ case 'date':
465
+ case 'datetime':
466
+ case 'timeofday':
467
+ self::_renderTextItem(
468
+ esc_html__( 'Display Date Format', 'visualizer' ),
469
+ 'series[' . $index . '][format][to]',
470
+ isset( $this->series[ $index ]['format']['to'] ) ? $this->series[ $index ]['format']['to'] : '',
471
+ sprintf( esc_html__( 'Enter custom format pattern to apply to this series value, similar to the %1$sdate and time formats here%2$s.', 'visualizer' ), '<a href="https://momentjs.com/docs/#/displaying/" target="_blank">', '</a>' ),
472
+ 'Do MMM YYYY'
473
+ );
474
+ self::_renderTextItem(
475
+ esc_html__( 'Source Date Format', 'visualizer' ),
476
+ 'series[' . $index . '][format][from]',
477
+ isset( $this->series[ $index ]['format']['from'] ) ? $this->series[ $index ]['format']['from'] : '',
478
+ sprintf( esc_html__( 'What format is the source date in? Similar to the %1$sdate and time formats here%2$s.', 'visualizer' ), '<a href="https://momentjs.com/docs/#/displaying/" target="_blank">', '</a>' ),
479
+ 'YYYY-MM-DD'
480
+ );
481
+ break;
482
+ }
483
+ }
484
+
485
+ }
classes/Visualizer/Render/Sidebar/Type/GoogleCharts/Tabular.php ADDED
@@ -0,0 +1,386 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // +----------------------------------------------------------------------+
4
+ // | Copyright 2013 Madpixels (email : visualizer@madpixels.net) |
5
+ // +----------------------------------------------------------------------+
6
+ // | This program is free software; you can redistribute it and/or modify |
7
+ // | it under the terms of the GNU General Public License, version 2, as |
8
+ // | published by the Free Software Foundation. |
9
+ // | |
10
+ // | This program is distributed in the hope that it will be useful, |
11
+ // | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12
+ // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13
+ // | GNU General Public License for more details. |
14
+ // | |
15
+ // | You should have received a copy of the GNU General Public License |
16
+ // | along with this program; if not, write to the Free Software |
17
+ // | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, |
18
+ // | MA 02110-1301 USA |
19
+ // +----------------------------------------------------------------------+
20
+ // | Author: Eugene Manuilov <eugene@manuilov.org> |
21
+ // +----------------------------------------------------------------------+
22
+ /**
23
+ * Class for table chart sidebar settings.
24
+ *
25
+ * @since 1.0.0
26
+ */
27
+ class Visualizer_Render_Sidebar_Type_GoogleCharts_Tabular extends Visualizer_Render_Sidebar_Columnar {
28
+
29
+ /**
30
+ * Constructor.
31
+ *
32
+ * @since 1.0.0
33
+ *
34
+ * @access public
35
+ * @param array $data The data what has to be associated with this render.
36
+ */
37
+ public function __construct( $data = array() ) {
38
+ parent::__construct( $data );
39
+ // @codingStandardsIgnoreLine WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
40
+ $this->_includeCurveTypes = false;
41
+ }
42
+
43
+ /**
44
+ * Renders template.
45
+ *
46
+ * @since 1.0.0
47
+ *
48
+ * @access protected
49
+ */
50
+ protected function _toHTML() {
51
+ // @codingStandardsIgnoreLine WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
52
+ $this->_supportsAnimation = false;
53
+ $this->_renderGeneralSettings();
54
+ $this->_renderColumnarSettings();
55
+ $this->_renderSeriesSettings();
56
+ $this->_renderViewSettings();
57
+ $this->_renderAdvancedSettings();
58
+ }
59
+
60
+ /**
61
+ * Renders general settings group.
62
+ *
63
+ * @since 1.0.0
64
+ *
65
+ * @access protected
66
+ */
67
+ protected function _renderGeneralSettings() {
68
+ self::_renderGroupStart( esc_html__( 'General Settings', 'visualizer' ) );
69
+ self::_renderSectionStart( esc_html__( 'Title', 'visualizer' ), false );
70
+ self::_renderTextItem(
71
+ esc_html__( 'Chart Title', 'visualizer' ),
72
+ 'title',
73
+ $this->title,
74
+ esc_html__( 'Text to display in the back-end admin area.', 'visualizer' )
75
+ );
76
+ self::_renderSectionEnd();
77
+ self::_renderGroupEnd();
78
+ }
79
+
80
+ /**
81
+ * Renders line settings items.
82
+ *
83
+ * @since 1.0.0
84
+ *
85
+ * @access protected
86
+ */
87
+ protected function _renderColumnarSettings() {
88
+ self::_renderGroupStart( esc_html__( 'Table Settings', 'visualizer' ) );
89
+ self::_renderSectionStart();
90
+
91
+ self::_renderCheckboxItem(
92
+ esc_html__( 'Enable Pagination', 'visualizer' ),
93
+ 'pagination',
94
+ $this->pagination,
95
+ 1,
96
+ esc_html__( 'To enable paging through the data.', 'visualizer' )
97
+ );
98
+
99
+ echo '<div class="viz-section-delimiter section-delimiter"></div>';
100
+
101
+ self::_renderTextItem(
102
+ esc_html__( 'Number of rows per page', 'visualizer' ),
103
+ 'pageSize',
104
+ $this->pageSize, // @codingStandardsIgnoreLine WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
105
+ esc_html__( 'The number of rows in each page, when paging is enabled.', 'visualizer' ),
106
+ '10'
107
+ );
108
+
109
+ echo '<div class="viz-section-delimiter section-delimiter"></div>';
110
+
111
+ self::_renderCheckboxItem(
112
+ esc_html__( 'Disable Sort', 'visualizer' ),
113
+ 'sort',
114
+ $this->sort,
115
+ 'disable',
116
+ esc_html__( 'To disable sorting on columns.', 'visualizer' )
117
+ );
118
+
119
+ echo '<div class="viz-section-delimiter section-delimiter"></div>';
120
+
121
+ self::_renderTextItem(
122
+ esc_html__( 'Freeze Columns', 'visualizer' ),
123
+ 'frozenColumns',
124
+ $this->frozenColumns, // @codingStandardsIgnoreLine WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
125
+ esc_html__( 'The number of columns from the left that will be frozen.', 'visualizer' ),
126
+ '',
127
+ 'number',
128
+ array(
129
+ 'min' => 0,
130
+ )
131
+ );
132
+
133
+ echo '<div class="viz-section-delimiter section-delimiter"></div>';
134
+
135
+ self::_renderCheckboxItem(
136
+ esc_html__( 'Allow HTML', 'visualizer' ),
137
+ 'allowHtml',
138
+ $this->allowHtml, // @codingStandardsIgnoreLine WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
139
+ 1,
140
+ esc_html__( 'If enabled, formatted values of cells that include HTML tags will be rendered as HTML.', 'visualizer' )
141
+ );
142
+
143
+ echo '<div class="viz-section-delimiter section-delimiter"></div>';
144
+
145
+ self::_renderCheckboxItem(
146
+ esc_html__( 'Right to Left table', 'visualizer' ),
147
+ 'rtlTable',
148
+ $this->rtlTable, // @codingStandardsIgnoreLine WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
149
+ 1,
150
+ esc_html__( 'Adds basic support for right-to-left languages.', 'visualizer' )
151
+ );
152
+
153
+ self::_renderSectionEnd();
154
+ self::_renderGroupEnd();
155
+
156
+ self::_renderGroupStart( esc_html__( 'Row/Cell Settings', 'visualizer' ) );
157
+ self::_renderSectionStart( esc_html__( 'Header Row', 'visualizer' ) );
158
+ self::_renderColorPickerItem(
159
+ esc_html__( 'Background Color', 'visualizer' ),
160
+ 'customcss[headerRow][background-color]',
161
+ isset( $this->customcss['headerRow']['background-color'] ) ? $this->customcss['headerRow']['background-color'] : null,
162
+ null
163
+ );
164
+
165
+ self::_renderColorPickerItem(
166
+ esc_html__( 'Color', 'visualizer' ),
167
+ 'customcss[headerRow][color]',
168
+ isset( $this->customcss['headerRow']['color'] ) ? $this->customcss['headerRow']['color'] : null,
169
+ null
170
+ );
171
+
172
+ self::_renderTextItem(
173
+ esc_html__( 'Text Orientation', 'visualizer' ),
174
+ 'customcss[headerRow][transform]',
175
+ isset( $this->customcss['headerRow']['transform'] ) ? $this->customcss['headerRow']['transform'] : null,
176
+ esc_html__( 'In degrees.', 'visualizer' ),
177
+ '',
178
+ 'number',
179
+ array(
180
+ 'min' => -180,
181
+ 'max' => 180,
182
+ )
183
+ );
184
+ self::_renderSectionEnd();
185
+
186
+ self::_renderSectionStart( esc_html__( 'Table Row', 'visualizer' ) );
187
+ self::_renderColorPickerItem(
188
+ esc_html__( 'Background Color', 'visualizer' ),
189
+ 'customcss[tableRow][background-color]',
190
+ isset( $this->customcss['tableRow']['background-color'] ) ? $this->customcss['tableRow']['background-color'] : null,
191
+ null
192
+ );
193
+
194
+ self::_renderColorPickerItem(
195
+ esc_html__( 'Color', 'visualizer' ),
196
+ 'customcss[tableRow][color]',
197
+ isset( $this->customcss['tableRow']['color'] ) ? $this->customcss['tableRow']['color'] : null,
198
+ null
199
+ );
200
+
201
+ self::_renderTextItem(
202
+ esc_html__( 'Text Orientation', 'visualizer' ),
203
+ 'customcss[tableRow][transform]',
204
+ isset( $this->customcss['tableRow']['transform'] ) ? $this->customcss['tableRow']['transform'] : null,
205
+ esc_html__( 'In degrees.', 'visualizer' ),
206
+ '',
207
+ 'number',
208
+ array(
209
+ 'min' => -180,
210
+ 'max' => 180,
211
+ )
212
+ );
213
+ self::_renderSectionEnd();
214
+
215
+ self::_renderSectionStart( esc_html__( 'Odd Table Row', 'visualizer' ) );
216
+ self::_renderColorPickerItem(
217
+ esc_html__( 'Background Color', 'visualizer' ),
218
+ 'customcss[oddTableRow][background-color]',
219
+ isset( $this->customcss['oddTableRow']['background-color'] ) ? $this->customcss['oddTableRow']['background-color'] : null,
220
+ null
221
+ );
222
+
223
+ self::_renderColorPickerItem(
224
+ esc_html__( 'Color', 'visualizer' ),
225
+ 'customcss[oddTableRow][color]',
226
+ isset( $this->customcss['oddTableRow']['color'] ) ? $this->customcss['oddTableRow']['color'] : null,
227
+ null
228
+ );
229
+
230
+ self::_renderTextItem(
231
+ esc_html__( 'Text Orientation', 'visualizer' ),
232
+ 'customcss[oddTableRow][transform]',
233
+ isset( $this->customcss['oddTableRow']['transform'] ) ? $this->customcss['oddTableRow']['transform'] : null,
234
+ esc_html__( 'In degrees.', 'visualizer' ),
235
+ '',
236
+ 'number',
237
+ array(
238
+ 'min' => -180,
239
+ 'max' => 180,
240
+ )
241
+ );
242
+ self::_renderSectionEnd();
243
+
244
+ self::_renderSectionStart( esc_html__( 'Selected Table Row', 'visualizer' ) );
245
+ self::_renderColorPickerItem(
246
+ esc_html__( 'Background Color', 'visualizer' ),
247
+ 'customcss[selectedTableRow][background-color]',
248
+ isset( $this->customcss['selectedTableRow']['background-color'] ) ? $this->customcss['selectedTableRow']['background-color'] : null,
249
+ null
250
+ );
251
+
252
+ self::_renderColorPickerItem(
253
+ esc_html__( 'Color', 'visualizer' ),
254
+ 'customcss[selectedTableRow][color]',
255
+ isset( $this->customcss['selectedTableRow']['color'] ) ? $this->customcss['selectedTableRow']['color'] : null,
256
+ null
257
+ );
258
+
259
+ self::_renderTextItem(
260
+ esc_html__( 'Text Orientation', 'visualizer' ),
261
+ 'customcss[selectedTableRow][transform]',
262
+ isset( $this->customcss['selectedTableRow']['transform'] ) ? $this->customcss['selectedTableRow']['transform'] : null,
263
+ esc_html__( 'In degrees.', 'visualizer' ),
264
+ '',
265
+ 'number',
266
+ array(
267
+ 'min' => -180,
268
+ 'max' => 180,
269
+ )
270
+ );
271
+ self::_renderSectionEnd();
272
+
273
+ self::_renderSectionStart( esc_html__( 'Hover Table Row', 'visualizer' ) );
274
+ self::_renderColorPickerItem(
275
+ esc_html__( 'Background Color', 'visualizer' ),
276
+ 'customcss[hoverTableRow][background-color]',
277
+ isset( $this->customcss['hoverTableRow']['background-color'] ) ? $this->customcss['hoverTableRow']['background-color'] : null,
278
+ null
279
+ );
280
+
281
+ self::_renderColorPickerItem(
282
+ esc_html__( 'Color', 'visualizer' ),
283
+ 'customcss[hoverTableRow][color]',
284
+ isset( $this->customcss['hoverTableRow']['color'] ) ? $this->customcss['hoverTableRow']['color'] : null,
285
+ null
286
+ );
287
+
288
+ self::_renderTextItem(
289
+ esc_html__( 'Text Orientation', 'visualizer' ),
290
+ 'customcss[hoverTableRow][transform]',
291
+ isset( $this->customcss['hoverTableRow']['transform'] ) ? $this->customcss['hoverTableRow']['transform'] : null,
292
+ esc_html__( 'In degrees.', 'visualizer' ),
293
+ '',
294
+ 'number',
295
+ array(
296
+ 'min' => -180,
297
+ 'max' => 180,
298
+ )
299
+ );
300
+ self::_renderSectionEnd();
301
+
302
+ self::_renderSectionStart( esc_html__( 'Header Cell', 'visualizer' ) );
303
+ self::_renderColorPickerItem(
304
+ esc_html__( 'Background Color', 'visualizer' ),
305
+ 'customcss[headerCell][background-color]',
306
+ isset( $this->customcss['headerCell']['background-color'] ) ? $this->customcss['headerCell']['background-color'] : null,
307
+ null
308
+ );
309
+
310
+ self::_renderColorPickerItem(
311
+ esc_html__( 'Color', 'visualizer' ),
312
+ 'customcss[headerCell][color]',
313
+ isset( $this->customcss['headerCell']['color'] ) ? $this->customcss['headerCell']['color'] : null,
314
+ null
315
+ );
316
+
317
+ self::_renderTextItem(
318
+ esc_html__( 'Text Orientation', 'visualizer' ),
319
+ 'customcss[headerCell][transform]',
320
+ isset( $this->customcss['headerCell']['transform'] ) ? $this->customcss['headerCell']['transform'] : null,
321
+ esc_html__( 'In degrees.', 'visualizer' ),
322
+ '',
323
+ 'number',
324
+ array(
325
+ 'min' => -180,
326
+ 'max' => 180,
327
+ )
328
+ );
329
+ self::_renderSectionEnd();
330
+
331
+ self::_renderSectionStart( esc_html__( 'Table Cell', 'visualizer' ) );
332
+ self::_renderColorPickerItem(
333
+ esc_html__( 'Background Color', 'visualizer' ),
334
+ 'customcss[tableCell][background-color]',
335
+ isset( $this->customcss['tableCell']['background-color'] ) ? $this->customcss['tableCell']['background-color'] : null,
336
+ null
337
+ );
338
+
339
+ self::_renderColorPickerItem(
340
+ esc_html__( 'Color', 'visualizer' ),
341
+ 'customcss[tableCell][color]',
342
+ isset( $this->customcss['tableCell']['color'] ) ? $this->customcss['tableCell']['color'] : null,
343
+ null
344
+ );
345
+
346
+ self::_renderTextItem(
347
+ esc_html__( 'Text Orientation', 'visualizer' ),
348
+ 'customcss[tableCell][transform]',
349
+ isset( $this->customcss['tableCell']['transform'] ) ? $this->customcss['tableCell']['transform'] : null,
350
+ esc_html__( 'In degrees.', 'visualizer' ),
351
+ '',
352
+ 'number',
353
+ array(
354
+ 'min' => -180,
355
+ 'max' => 180,
356
+ )
357
+ );
358
+ self::_renderSectionEnd();
359
+
360
+ self::_renderGroupEnd();
361
+ }
362
+
363
+ /**
364
+ * Renders concreate series settings.
365
+ *
366
+ * @since 1.4.0
367
+ *
368
+ * @access protected
369
+ * @param int $index The series index.
370
+ */
371
+ protected function _renderSeries( $index ) {
372
+ $this->_renderFormatField( $index );
373
+ }
374
+
375
+ /**
376
+ * Renders combo series settings
377
+ *
378
+ * @since 1.0.0
379
+ *
380
+ * @access protected
381
+ */
382
+ protected function _renderSeriesSettings() {
383
+ parent::_renderSeriesSettings();
384
+ }
385
+
386
+ }
css/frame.css CHANGED
@@ -519,11 +519,9 @@ div.viz-group-content .viz-group-description {
519
  background-position: -600px -225px;
520
  }
521
 
522
- .type-box-dataTable .type-label {
523
- background-position: -301px -670px;
524
- }
525
-
526
- .type-box-table .type-label {
527
  background-position: -301px -670px;
528
  }
529
 
519
  background-position: -600px -225px;
520
  }
521
 
522
+ .type-box-dataTable .type-label,
523
+ .type-box-table .type-label,
524
+ .type-box-tabular .type-label {
 
 
525
  background-position: -301px -670px;
526
  }
527
 
css/library.css CHANGED
@@ -107,12 +107,22 @@
107
  background-position: -46px -64px;
108
  }
109
 
 
 
 
 
 
 
 
110
  .visualizer-chart-image {
111
  background-position: -206px -129px;
112
  }
113
 
114
  .visualizer-nochart-clone,
115
  .visualizer-nochart-delete,
 
 
 
116
  .visualizer-nochart-edit {
117
  opacity: 0.5;
118
 
107
  background-position: -46px -64px;
108
  }
109
 
110
+ .visualizer-nochart-shortcode,
111
+ .visualizer-chart-shortcode {
112
+ background-position: -143px -126px;
113
+ float: left;
114
+ }
115
+
116
+ .visualizer-nochart-image,
117
  .visualizer-chart-image {
118
  background-position: -206px -129px;
119
  }
120
 
121
  .visualizer-nochart-clone,
122
  .visualizer-nochart-delete,
123
+ .visualizer-nochart-shortcode,
124
+ .visualizer-nochart-export,
125
+ .visualizer-nochart-image,
126
  .visualizer-nochart-edit {
127
  opacity: 0.5;
128
 
css/media.css CHANGED
@@ -1,5 +1,5 @@
1
  /*
2
- Version: 3.4.4
3
  */
4
  #visualizer-library-view {
5
  padding: 30px 10px 10px 30px;
1
  /*
2
+ Version: 3.4.5
3
  */
4
  #visualizer-library-view {
5
  padding: 30px 10px 10px 30px;
index.php CHANGED
@@ -4,7 +4,7 @@
4
  Plugin Name: Visualizer: Tables and Charts for WordPress
5
  Plugin URI: https://themeisle.com/plugins/visualizer-charts-and-graphs-lite/
6
  Description: A simple, easy to use and quite powerful tool to create, manage and embed interactive charts into your WordPress posts and pages. The plugin uses Google Visualization API to render charts, which supports cross-browser compatibility (adopting VML for older IE versions) and cross-platform portability to iOS and new Android releases.
7
- Version: 3.4.4
8
  Author: Themeisle
9
  Author URI: http://themeisle.com
10
  License: GPL v2.0 or later
4
  Plugin Name: Visualizer: Tables and Charts for WordPress
5
  Plugin URI: https://themeisle.com/plugins/visualizer-charts-and-graphs-lite/
6
  Description: A simple, easy to use and quite powerful tool to create, manage and embed interactive charts into your WordPress posts and pages. The plugin uses Google Visualization API to render charts, which supports cross-browser compatibility (adopting VML for older IE versions) and cross-platform portability to iOS and new Android releases.
7
+ Version: 3.4.5
8
  Author: Themeisle
9
  Author URI: http://themeisle.com
10
  License: GPL v2.0 or later
js/render-chartjs.js CHANGED
@@ -395,7 +395,12 @@
395
 
396
  $('body').on('visualizer:render:chart:start', function(event, v){
397
  all_charts = v.charts;
398
- render(v);
 
 
 
 
 
399
 
400
  // for some reason this needs to be introduced here for dynamic preview updates to work.
401
  v.update = function(){
395
 
396
  $('body').on('visualizer:render:chart:start', function(event, v){
397
  all_charts = v.charts;
398
+
399
+ if(v.is_front == true && typeof v.id !== 'undefined'){ // jshint ignore:line
400
+ renderChart(v.id, v);
401
+ } else {
402
+ render(v);
403
+ }
404
 
405
  // for some reason this needs to be introduced here for dynamic preview updates to work.
406
  v.update = function(){
js/render-datatables.js CHANGED
@@ -248,7 +248,7 @@
248
  if(typeof series.format.decimal !== ''){
249
  parts[1] = series.format.decimal;
250
  }
251
- if(typeof series.format.precision !== ''){
252
  parts[2] = series.format.precision;
253
  }
254
  if(typeof series.format.prefix !== ''){
@@ -290,7 +290,12 @@
290
 
291
  $('body').on('visualizer:render:chart:start', function(event, v){
292
  all_charts = v.charts;
293
- render(v);
 
 
 
 
 
294
  });
295
 
296
  $('body').on('visualizer:render:specificchart:start', function(event, v){
248
  if(typeof series.format.decimal !== ''){
249
  parts[1] = series.format.decimal;
250
  }
251
+ if(typeof series.format.precision !== '' && parseInt(series.format.precision) > 0){
252
  parts[2] = series.format.precision;
253
  }
254
  if(typeof series.format.prefix !== ''){
290
 
291
  $('body').on('visualizer:render:chart:start', function(event, v){
292
  all_charts = v.charts;
293
+
294
+ if(v.is_front == true && typeof v.id !== 'undefined'){ // jshint ignore:line
295
+ renderChart(v.id, v);
296
+ } else {
297
+ render(v);
298
+ }
299
  });
300
 
301
  $('body').on('visualizer:render:specificchart:start', function(event, v){
js/render-facade.js CHANGED
@@ -5,6 +5,13 @@
5
  (function($, visualizer){
6
 
7
  function initActionsButtons(v) {
 
 
 
 
 
 
 
8
  if($('a.visualizer-action[data-visualizer-type=copy]').length > 0) {
9
  $('a.visualizer-action[data-visualizer-type=copy]').on('click', function(e) {
10
  e.preventDefault();
@@ -108,11 +115,68 @@
108
  localStorage.removeItem( 'viz-facade-loaded' );
109
  }, 2000);
110
 
111
- $('body').trigger('visualizer:render:chart:start', visualizer);
112
  initActionsButtons(visualizer);
113
  registerDefaultActions();
114
  });
115
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
116
  function registerDefaultActions(){
117
  $('body').off('visualizer:action:specificchart:defaultprint').on('visualizer:action:specificchart:defaultprint', function(event, v){
118
  var iframe = $('<iframe>').attr("name", "print-visualization").attr("id", "print-visualization").css("position", "absolute");
5
  (function($, visualizer){
6
 
7
  function initActionsButtons(v) {
8
+ if($('a.visualizer-chart-shortcode').length > 0) {
9
+ var clipboard1 = new Clipboard('a.visualizer-chart-shortcode'); // jshint ignore:line
10
+ clipboard1.on('success', function(e) {
11
+ window.alert(v.i10n['copied']);
12
+ });
13
+ }
14
+
15
  if($('a.visualizer-action[data-visualizer-type=copy]').length > 0) {
16
  $('a.visualizer-action[data-visualizer-type=copy]').on('click', function(e) {
17
  e.preventDefault();
115
  localStorage.removeItem( 'viz-facade-loaded' );
116
  }, 2000);
117
 
118
+ initChartDisplay();
119
  initActionsButtons(visualizer);
120
  registerDefaultActions();
121
  });
122
 
123
+ function initChartDisplay() {
124
+ if(visualizer.is_front == true){ // jshint ignore:line
125
+ displayChartsOnFrontEnd();
126
+ }else{
127
+ showChart();
128
+ }
129
+ }
130
+
131
+ /**
132
+ * If an `id` is provided, that particular chart will load.
133
+ */
134
+ function showChart(id) {
135
+ // clone the visualizer object so that the original object is not affected.
136
+ var viz = Object.assign({}, visualizer);
137
+ if(id){
138
+ viz.id = id;
139
+ }
140
+ $('body').trigger('visualizer:render:chart:start', viz);
141
+ }
142
+
143
+ function displayChartsOnFrontEnd() {
144
+ // display all charts that are NOT to be lazy-loaded.
145
+ $('div.visualizer-front:not(.visualizer-lazy)').each(function(index, element){
146
+ var id = $(element).attr('id');
147
+ showChart(id);
148
+ });
149
+
150
+ // interate through all charts that are to be lazy-loaded and observe each one.
151
+ $('div.visualizer-front.visualizer-lazy').each(function(index, element){
152
+ var id = $(element).attr('id');
153
+ var limit = $(element).attr('data-lazy-limit');
154
+ if(!limit){
155
+ limit = 300;
156
+ }
157
+ var target = document.querySelector('#' + id);
158
+
159
+ // configure the intersection observer instance
160
+ var intersectionObserverOptions = {
161
+ root: null,
162
+ rootMargin: limit + 'px',
163
+ threshold: 0
164
+ };
165
+
166
+ var observer = new IntersectionObserver(function(entries) {
167
+ entries.forEach(function(entry) {
168
+ if (entry.isIntersecting) {
169
+ observer.unobserve(target);
170
+ showChart($(entry.target).attr('id'));
171
+ }
172
+ });
173
+ }, intersectionObserverOptions);
174
+
175
+ // start observing.
176
+ observer.observe(target);
177
+ });
178
+ }
179
+
180
  function registerDefaultActions(){
181
  $('body').off('visualizer:action:specificchart:defaultprint').on('visualizer:action:specificchart:defaultprint', function(event, v){
182
  var iframe = $('<iframe>').attr("name", "print-visualization").attr("id", "print-visualization").css("position", "absolute");
js/render-google.js CHANGED
@@ -46,6 +46,9 @@ var __visualizer_chart_images = [];
46
  render = objects[id] || null;
47
  if (!render) {
48
  switch (chart.type) {
 
 
 
49
  case "gauge":
50
  case "table":
51
  case "timeline":
@@ -134,6 +137,7 @@ var __visualizer_chart_images = [];
134
  }
135
  break;
136
  case 'table':
 
137
  if (parseInt(settings['pagination']) !== 1)
138
  {
139
  delete settings['pageSize'];
@@ -410,6 +414,10 @@ var __visualizer_chart_images = [];
410
  case 'geo':
411
  $type = 'geochart';
412
  break;
 
 
 
 
413
  case 'dataTable':
414
  case 'polarArea':
415
  case 'radar':
@@ -427,7 +435,11 @@ var __visualizer_chart_images = [];
427
  google.charts.setOnLoadCallback(function() {
428
  gv = google.visualization;
429
  all_charts = v.charts;
430
- render();
 
 
 
 
431
  });
432
  });
433
 
46
  render = objects[id] || null;
47
  if (!render) {
48
  switch (chart.type) {
49
+ case "tabular":
50
+ render = "Table";
51
+ break;
52
  case "gauge":
53
  case "table":
54
  case "timeline":
137
  }
138
  break;
139
  case 'table':
140
+ case 'tabular':
141
  if (parseInt(settings['pagination']) !== 1)
142
  {
143
  delete settings['pageSize'];
414
  case 'geo':
415
  $type = 'geochart';
416
  break;
417
+ case 'tabular':
418
+ case 'table':
419
+ $type = 'table';
420
+ break;
421
  case 'dataTable':
422
  case 'polarArea':
423
  case 'radar':
435
  google.charts.setOnLoadCallback(function() {
436
  gv = google.visualization;
437
  all_charts = v.charts;
438
+ if(v.is_front == true && typeof v.id !== 'undefined'){ // jshint ignore:line
439
+ renderChart(v.id);
440
+ } else {
441
+ render();
442
+ }
443
  });
444
  });
445
 
readme.md CHANGED
@@ -48,7 +48,7 @@ Charts are rendered using HTML5/SVG technology to provide cross-browser compatib
48
  >
49
  > **[Learn more about Visualizer PRO](http://themeisle.com/plugins/visualizer-charts-and-graphs/)**
50
 
51
- The plugins works perfectly with the all <a href="http://justfreethemes.com" rel="nofollow">free</a> or <a href="http://www.codeinwp.com/blog/best-wordpress-themes/" rel="nofollow">premium WordPress themes</a>
52
 
53
 
54
  = See how Visualizer can integrate with your website =
@@ -162,6 +162,14 @@ Pay attention that to turn your shortcodes into graphs, your theme has to have `
162
  13. Bar chart
163
 
164
  ## Changelog ##
 
 
 
 
 
 
 
 
165
  ### 3.4.4 - 2020-06-16 ###
166
 
167
  * [Feat] Option to download charts as .png images
48
  >
49
  > **[Learn more about Visualizer PRO](http://themeisle.com/plugins/visualizer-charts-and-graphs/)**
50
 
51
+ The plugins works perfectly with the all <a href="https://justfreethemes.com/" rel="nofollow">free</a> or <a href="https://www.codeinwp.com/blog/best-wordpress-themes/" rel="nofollow">premium WordPress themes</a>
52
 
53
 
54
  = See how Visualizer can integrate with your website =
162
  13. Bar chart
163
 
164
  ## Changelog ##
165
+ ### 3.4.5 - 2020-07-08 ###
166
+
167
+ * [Feat] New Google Table Charts
168
+ * [Feat] Option for lazy loading Google Charts
169
+ * [Feat] Option to easily copy chart shortcode code
170
+ * [Fix] Remove Inside the Chart option for the legend position for Google Pie charts
171
+
172
+
173
  ### 3.4.4 - 2020-06-16 ###
174
 
175
  * [Feat] Option to download charts as .png images
readme.txt CHANGED
@@ -48,7 +48,7 @@ Charts are rendered using HTML5/SVG technology to provide cross-browser compatib
48
  >
49
  > **[Learn more about Visualizer PRO](http://themeisle.com/plugins/visualizer-charts-and-graphs/)**
50
 
51
- The plugins works perfectly with the all <a href="http://justfreethemes.com" rel="nofollow">free</a> or <a href="http://www.codeinwp.com/blog/best-wordpress-themes/" rel="nofollow">premium WordPress themes</a>
52
 
53
 
54
  = See how Visualizer can integrate with your website =
@@ -162,6 +162,14 @@ Pay attention that to turn your shortcodes into graphs, your theme has to have `
162
  13. Bar chart
163
 
164
  == Changelog ==
 
 
 
 
 
 
 
 
165
  = 3.4.4 - 2020-06-16 =
166
 
167
  * [Feat] Option to download charts as .png images
48
  >
49
  > **[Learn more about Visualizer PRO](http://themeisle.com/plugins/visualizer-charts-and-graphs/)**
50
 
51
+ The plugins works perfectly with the all <a href="https://justfreethemes.com/" rel="nofollow">free</a> or <a href="https://www.codeinwp.com/blog/best-wordpress-themes/" rel="nofollow">premium WordPress themes</a>
52
 
53
 
54
  = See how Visualizer can integrate with your website =
162
  13. Bar chart
163
 
164
  == Changelog ==
165
+ = 3.4.5 - 2020-07-08 =
166
+
167
+ * [Feat] New Google Table Charts
168
+ * [Feat] Option for lazy loading Google Charts
169
+ * [Feat] Option to easily copy chart shortcode code
170
+ * [Fix] Remove Inside the Chart option for the legend position for Google Pie charts
171
+
172
+
173
  = 3.4.4 - 2020-06-16 =
174
 
175
  * [Feat] Option to download charts as .png images
samples/{dataTable.csv → tabular.csv} RENAMED
File without changes
themeisle-hash.json CHANGED
@@ -1 +1 @@
1
- {"index.php":"4f756be0ba6c520ec5cd9546fe643ba8"}
1
+ {"index.php":"64e4974dec6e9116afa64bc621e1fd7a"}
vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer' . '/autoload_real.php';
6
 
7
- return ComposerAutoloaderInitb11c4727328a8692ebac41e48739fbca::getLoader();
4
 
5
  require_once __DIR__ . '/composer' . '/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInit9c2f489713ee3c270bae3f731d01fae5::getLoader();
vendor/autoload_52.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once dirname(__FILE__) . '/composer'.'/autoload_real_52.php';
6
 
7
- return ComposerAutoloaderInitf80d07c0530b306c03d9cd523ad7ef06::getLoader();
4
 
5
  require_once dirname(__FILE__) . '/composer'.'/autoload_real_52.php';
6
 
7
+ return ComposerAutoloaderInit55f9c9963512f748825aed25c3b622df::getLoader();
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInitb11c4727328a8692ebac41e48739fbca
6
  {
7
  private static $loader;
8
 
@@ -19,9 +19,9 @@ class ComposerAutoloaderInitb11c4727328a8692ebac41e48739fbca
19
  return self::$loader;
20
  }
21
 
22
- spl_autoload_register(array('ComposerAutoloaderInitb11c4727328a8692ebac41e48739fbca', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
- spl_autoload_unregister(array('ComposerAutoloaderInitb11c4727328a8692ebac41e48739fbca', 'loadClassLoader'));
25
 
26
  $map = require __DIR__ . '/autoload_namespaces.php';
27
  foreach ($map as $namespace => $path) {
@@ -42,14 +42,14 @@ class ComposerAutoloaderInitb11c4727328a8692ebac41e48739fbca
42
 
43
  $includeFiles = require __DIR__ . '/autoload_files.php';
44
  foreach ($includeFiles as $fileIdentifier => $file) {
45
- composerRequireb11c4727328a8692ebac41e48739fbca($fileIdentifier, $file);
46
  }
47
 
48
  return $loader;
49
  }
50
  }
51
 
52
- function composerRequireb11c4727328a8692ebac41e48739fbca($fileIdentifier, $file)
53
  {
54
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
55
  require $file;
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderInit9c2f489713ee3c270bae3f731d01fae5
6
  {
7
  private static $loader;
8
 
19
  return self::$loader;
20
  }
21
 
22
+ spl_autoload_register(array('ComposerAutoloaderInit9c2f489713ee3c270bae3f731d01fae5', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
+ spl_autoload_unregister(array('ComposerAutoloaderInit9c2f489713ee3c270bae3f731d01fae5', 'loadClassLoader'));
25
 
26
  $map = require __DIR__ . '/autoload_namespaces.php';
27
  foreach ($map as $namespace => $path) {
42
 
43
  $includeFiles = require __DIR__ . '/autoload_files.php';
44
  foreach ($includeFiles as $fileIdentifier => $file) {
45
+ composerRequire9c2f489713ee3c270bae3f731d01fae5($fileIdentifier, $file);
46
  }
47
 
48
  return $loader;
49
  }
50
  }
51
 
52
+ function composerRequire9c2f489713ee3c270bae3f731d01fae5($fileIdentifier, $file)
53
  {
54
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
55
  require $file;
vendor/composer/autoload_real_52.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real_52.php generated by xrstf/composer-php52
4
 
5
- class ComposerAutoloaderInitf80d07c0530b306c03d9cd523ad7ef06 {
6
  private static $loader;
7
 
8
  public static function loadClassLoader($class) {
@@ -19,9 +19,9 @@ class ComposerAutoloaderInitf80d07c0530b306c03d9cd523ad7ef06 {
19
  return self::$loader;
20
  }
21
 
22
- spl_autoload_register(array('ComposerAutoloaderInitf80d07c0530b306c03d9cd523ad7ef06', 'loadClassLoader'), true /*, true */);
23
  self::$loader = $loader = new xrstf_Composer52_ClassLoader();
24
- spl_autoload_unregister(array('ComposerAutoloaderInitf80d07c0530b306c03d9cd523ad7ef06', 'loadClassLoader'));
25
 
26
  $vendorDir = dirname(dirname(__FILE__));
27
  $baseDir = dirname($vendorDir);
2
 
3
  // autoload_real_52.php generated by xrstf/composer-php52
4
 
5
+ class ComposerAutoloaderInit55f9c9963512f748825aed25c3b622df {
6
  private static $loader;
7
 
8
  public static function loadClassLoader($class) {
19
  return self::$loader;
20
  }
21
 
22
+ spl_autoload_register(array('ComposerAutoloaderInit55f9c9963512f748825aed25c3b622df', 'loadClassLoader'), true /*, true */);
23
  self::$loader = $loader = new xrstf_Composer52_ClassLoader();
24
+ spl_autoload_unregister(array('ComposerAutoloaderInit55f9c9963512f748825aed25c3b622df', 'loadClassLoader'));
25
 
26
  $vendorDir = dirname(dirname(__FILE__));
27
  $baseDir = dirname($vendorDir);