jsonata
Version:
JSON query and transformation language
1 lines • 109 kB
JavaScript
var runtime=function(e){"use strict";var t,r=Object.prototype,n=r.hasOwnProperty,a=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,r){return e[t]=r}}function f(e,r,n,i){var o=r&&r.prototype instanceof b?r:b,s=Object.create(o.prototype),u=new P(i||[]);return a(s,"_invoke",{value:function(e,r,n){var a=l;return function(i,o){if(a===d)throw new Error("Generator is already running");if(a===v){if("throw"===i)throw o;return{value:t,done:!0}}for(n.method=i,n.arg=o;;){var s=n.delegate;if(s){var u=T(s,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(a===l)throw a=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);a=d;var c=p(e,r,n);if("normal"===c.type){if(a=n.done?v:h,c.arg===g)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(a=v,n.method="throw",n.arg=c.arg)}}}(e,n,u)}),s}function p(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=f;var l="suspendedStart",h="suspendedYield",d="executing",v="completed",g={};function b(){}function y(){}function m(){}var k={};c(k,o,function(){return this});var w=Object.getPrototypeOf,x=w&&w(w(j([])));x&&x!==r&&n.call(x,o)&&(k=x);var E=m.prototype=b.prototype=Object.create(k);function A(e){["next","throw","return"].forEach(function(t){c(e,t,function(e){return this._invoke(t,e)})})}function S(e,t){var r;a(this,"_invoke",{value:function(a,i){function o(){return new t(function(r,o){!function r(a,i,o,s){var u=p(e[a],e,i);if("throw"!==u.type){var c=u.arg,f=c.value;return f&&"object"==typeof f&&n.call(f,"__await")?t.resolve(f.__await).then(function(e){r("next",e,o,s)},function(e){r("throw",e,o,s)}):t.resolve(f).then(function(e){c.value=e,o(c)},function(e){return r("throw",e,o,s)})}s(u.arg)}(a,i,r,o)})}return r=r?r.then(o,o):o()}})}function T(e,r){var n=r.method,a=e.iterator[n];if(a===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,T(e,r),"throw"===r.method)?g:("return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g);var i=p(a,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,g;var o=i.arg;return o?o.done?(r[e.resultName]=o.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function O(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function D(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function P(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function j(e){if(null!=e){var r=e[o];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var a=-1,i=function r(){for(;++a<e.length;)if(n.call(e,a))return r.value=e[a],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(typeof e+" is not iterable")}return y.prototype=m,a(E,"constructor",{value:m,configurable:!0}),a(m,"constructor",{value:y,configurable:!0}),y.displayName=c(m,u,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===y||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,m):(e.__proto__=m,c(e,u,"GeneratorFunction")),e.prototype=Object.create(E),e},e.awrap=function(e){return{__await:e}},A(S.prototype),c(S.prototype,s,function(){return this}),e.AsyncIterator=S,e.async=function(t,r,n,a,i){void 0===i&&(i=Promise);var o=new S(f(t,r,n,a),i);return e.isGeneratorFunction(r)?o:o.next().then(function(e){return e.done?e.value:o.next()})},A(E),c(E,u,"Generator"),c(E,o,function(){return this}),c(E,"toString",function(){return"[object Generator]"}),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=j,P.prototype={constructor:P,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(D),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function a(n,a){return s.type="throw",s.arg=e,r.next=n,a&&(r.method="next",r.arg=t),!!a}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],s=o.completion;if("root"===o.tryLoc)return a("end");if(o.tryLoc<=this.prev){var u=n.call(o,"catchLoc"),c=n.call(o,"finallyLoc");if(u&&c){if(this.prev<o.catchLoc)return a(o.catchLoc,!0);if(this.prev<o.finallyLoc)return a(o.finallyLoc)}else if(u){if(this.prev<o.catchLoc)return a(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return a(o.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&n.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var i=a;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=e,o.arg=t,i?(this.method="next",this.next=i.finallyLoc,g):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),g},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),D(r),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;D(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:j(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}("object"==typeof module?module.exports:{});try{regeneratorRuntime=runtime}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=runtime:Function("r","regeneratorRuntime = r")(runtime)}Number.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},String.fromCodePoint||function(e){var t=function(t){for(var r=[],n=0,a="",i=0,o=arguments.length;i!==o;++i){var s=+arguments[i];if(!(s<1114111&&s>>>0===s))throw RangeError("Invalid code point: "+s);s<=65535?n=r.push(s):(s-=65536,n=r.push(55296+(s>>10),s%1024+56320)),n>=16383&&(a+=e.apply(null,r),r.length=0)}return a+e.apply(null,r)};try{Object.defineProperty(String,"fromCodePoint",{value:t,configurable:!0,writable:!0})}catch(e){String.fromCodePoint=t}}(String.fromCharCode),Object.is||(Object.is=function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}),String.prototype.codePointAt||function(){"use strict";var e=function(){try{var e={},t=Object.defineProperty,r=t(e,e,e)&&t}catch(e){}return r}(),t=function(e){if(null==this)throw TypeError();var t=String(this),r=t.length,n=e?Number(e):0;if(n!=n&&(n=0),!(n<0||n>=r)){var a,i=t.charCodeAt(n);return i>=55296&&i<=56319&&r>n+1&&(a=t.charCodeAt(n+1))>=56320&&a<=57343?1024*(i-55296)+a-56320+65536:i}};e?e(String.prototype,"codePointAt",{value:t,configurable:!0,writable:!0}):String.prototype.codePointAt=t}(),Math.log10=Math.log10||function(e){return Math.log(e)*Math.LOG10E},function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).jsonata=e()}}(function(){return function(){return function e(t,r,n){function a(o,s){if(!r[o]){if(!t[o]){var u="function"==typeof require&&require;if(!s&&u)return u(o,!0);if(i)return i(o,!0);var c=new Error("Cannot find module '"+o+"'");throw c.code="MODULE_NOT_FOUND",c}var f=r[o]={exports:{}};t[o][0].call(f.exports,function(e){return a(t[o][1][e]||e)},f,f.exports,e,t,r,n)}return r[o].exports}for(var i="function"==typeof require&&require,o=0;o<n.length;o++)a(n[o]);return a}}()({1:[function(e,t,r){"use strict";var n=e("./utils"),a=function(){var e=n.stringToArray,t=["Zero","One","Two","Three","Four","Five","Six","Seven","Eight","Nine","Ten","Eleven","Twelve","Thirteen","Fourteen","Fifteen","Sixteen","Seventeen","Eighteen","Nineteen"],r=["Zeroth","First","Second","Third","Fourth","Fifth","Sixth","Seventh","Eighth","Ninth","Tenth","Eleventh","Twelfth","Thirteenth","Fourteenth","Fifteenth","Sixteenth","Seventeenth","Eighteenth","Nineteenth"],a=["Twenty","Thirty","Forty","Fifty","Sixty","Seventy","Eighty","Ninety","Hundred"],i=["Thousand","Million","Billion","Trillion"];var o={};t.forEach(function(e,t){o[e.toLowerCase()]=t}),r.forEach(function(e,t){o[e.toLowerCase()]=t}),a.forEach(function(e,t){var r=e.toLowerCase();o[r]=10*(t+2),o[r.substring(0,e.length-1)+"ieth"]=o[r]}),o.hundredth=100,i.forEach(function(e,t){var r=e.toLowerCase(),n=Math.pow(10,3*(t+1));o[r]=n,o[r+"th"]=n});var s=[[1e3,"m"],[900,"cm"],[500,"d"],[400,"cd"],[100,"c"],[90,"xc"],[50,"l"],[40,"xl"],[10,"x"],[9,"ix"],[5,"v"],[4,"iv"],[1,"i"]],u={M:1e3,D:500,C:100,L:50,X:10,V:5,I:1};function c(e,t){if(void 0!==e)return l(e=Math.floor(e),d(t))}var f={DECIMAL:"decimal",LETTERS:"letters",ROMAN:"roman",WORDS:"words",SEQUENCE:"sequence"},p={UPPER:"upper",LOWER:"lower",TITLE:"title"};function l(n,o){var u,c=n<0;switch(n=Math.abs(n),o.primary){case f.LETTERS:u=function(e,t){for(var r=[],n=t.charCodeAt(0);e>0;)r.unshift(String.fromCharCode((e-1)%26+n)),e=Math.floor((e-1)/26);return r.join("")}(n,o.case===p.UPPER?"A":"a");break;case f.ROMAN:u=function e(t){for(var r=0;r<s.length;r++){var n=s[r];if(t>=n[0])return n[1]+e(t-n[0])}return""}(n),o.case===p.UPPER&&(u=u.toUpperCase());break;case f.WORDS:u=function(e,n){var o=function(e,n,s){var u="";if(e<=19)u=(n?" and ":"")+(s?r[e]:t[e]);else if(e<100){var c=Math.floor(e/10),f=e%10;u=(n?" and ":"")+a[c-2],f>0?u+="-"+o(f,!1,s):s&&(u=u.substring(0,u.length-1)+"ieth")}else if(e<1e3){var p=Math.floor(e/100),l=e%100;u=(n?", ":"")+t[p]+" Hundred",l>0?u+=o(l,!0,s):s&&(u+="th")}else{var h=Math.floor(Math.log10(e)/3);h>i.length&&(h=i.length);var d=Math.pow(10,3*h),v=Math.floor(e/d),g=e-v*d;u=(n?", ":"")+o(v,!1,!1)+" "+i[h-1],g>0?u+=o(g,!0,s):s&&(u+="th")}return u};return o(e,!1,n)}(n,o.ordinal),o.case===p.UPPER?u=u.toUpperCase():o.case===p.LOWER&&(u=u.toLowerCase());break;case f.DECIMAL:u=""+n;var l=o.mandatoryDigits-u.length;if(l>0){var h=new Array(l+1).join("0");u=h+u}if(48!==o.zeroCode&&(u=e(u).map(function(e){return String.fromCodePoint(e.codePointAt(0)+o.zeroCode-48)}).join("")),o.regular)for(var d=Math.floor((u.length-1)/o.groupingSeparators.position);d>0;d--){var v=u.length-d*o.groupingSeparators.position;u=u.substr(0,v)+o.groupingSeparators.character+u.substr(v)}else o.groupingSeparators.reverse().forEach(function(e){var t=u.length-e.position;u=u.substr(0,t)+e.character+u.substr(t)});if(o.ordinal){var g={1:"st",2:"nd",3:"rd"}[u[u.length-1]];(!g||u.length>1&&"1"===u[u.length-2])&&(g="th"),u+=g}break;case f.SEQUENCE:throw{code:"D3130",value:o.token}}return c&&(u="-"+u),u}var h=[48,1632,1776,1984,2406,2534,2662,2790,2918,3046,3174,3302,3430,3558,3664,3792,3872,4160,4240,6112,6160,6470,6608,6784,6800,6992,7088,7232,7248,42528,43216,43264,43472,43504,43600,44016,65296];function d(t){var r,n={type:"integer",primary:f.DECIMAL,case:p.LOWER,ordinal:!1},a=t.lastIndexOf(";");switch(-1===a?r=t:(r=t.substring(0,a),"o"===t.substring(a+1)[0]&&(n.ordinal=!0)),r){case"A":n.case=p.UPPER;case"a":n.primary=f.LETTERS;break;case"I":n.case=p.UPPER;case"i":n.primary=f.ROMAN;break;case"W":n.case=p.UPPER,n.primary=f.WORDS;break;case"Ww":n.case=p.TITLE,n.primary=f.WORDS;break;case"w":n.primary=f.WORDS;break;default:var i=null,o=0,s=0,u=[],c=0;if(e(r).map(function(e){return e.codePointAt(0)}).reverse().forEach(function(e){for(var t=!1,r=0;r<h.length;r++){var n=h[r];if(e>=n&&e<=n+9){if(t=!0,o++,c++,null===i)i=n;else if(n!==i)throw{code:"D3131"};break}}t||(35===e?(c++,s++):u.push({position:c,character:String.fromCodePoint(e)}))}),o>0){n.primary=f.DECIMAL,n.zeroCode=i,n.mandatoryDigits=o,n.optionalDigits=s;var l=function(e){if(0===e.length)return 0;for(var t=e[0].character,r=1;r<e.length;r++)if(e[r].character!==t)return 0;for(var n=e.map(function(e){return e.position}),a=function(e,t){return 0===t?e:a(t,e%t)},i=n.reduce(a),o=1;o<=n.length;o++)if(-1===n.indexOf(o*i))return 0;return i}(u);l>0?(n.regular=!0,n.groupingSeparators={position:l,character:u[0].character}):(n.regular=!1,n.groupingSeparators=u)}else n.primary=f.SEQUENCE,n.token=r}return n}var v={Y:"1",M:"1",D:"1",d:"1",F:"n",W:"1",w:"1",X:"1",x:"1",H:"1",h:"1",P:"n",m:"01",s:"01",f:"1",Z:"01:01",z:"01:01",C:"n",E:"n"};function g(e){for(var t=[],r={type:"datetime",parts:t},n=function(r,n){if(n>r){var a=e.substring(r,n);a=a.split("]]").join("]"),t.push({type:"literal",value:a})}},a=0,i=0;i<e.length;){if("["===e.charAt(i)){if("["===e.charAt(i+1)){n(a,i),t.push({type:"literal",value:"["}),a=i+=2;continue}if(n(a,i),a=i,-1===(i=e.indexOf("]",a)))throw{code:"D3135"};var o,s=e.substring(a+1,i),u={type:"marker",component:(s=s.split(/\s+/).join("")).charAt(0)},c=s.lastIndexOf(",");if(-1!==c){var f=s.substring(c+1),l=f.indexOf("-"),h=void 0,g=void 0,b=function(e){return void 0===e||"*"===e?void 0:parseInt(e)};-1===l?h=f:(h=f.substring(0,l),g=f.substring(l+1));var y={min:b(h),max:b(g)};u.width=y,o=s.substring(1,c)}else o=s.substring(1);if(1===o.length)u.presentation1=o;else if(o.length>1){var m=o.charAt(o.length-1);-1!=="atco".indexOf(m)?(u.presentation2=m,"o"===m&&(u.ordinal=!0),u.presentation1=o.substring(0,o.length-1)):u.presentation1=o}else u.presentation1=v[u.component];if(void 0===u.presentation1)throw{code:"D3132",value:u.component};if("n"===u.presentation1[0])u.names=p.LOWER;else if("N"===u.presentation1[0])"n"===u.presentation1[1]?u.names=p.TITLE:u.names=p.UPPER;else if(-1!=="YMDdFWwXxHhmsf".indexOf(u.component)){var k=u.presentation1;if(u.presentation2&&(k+=";"+u.presentation2),u.integerFormat=d(k),u.width&&void 0!==u.width.min&&u.integerFormat.mandatoryDigits<u.width.min&&(u.integerFormat.mandatoryDigits=u.width.min),"Y"===u.component)if(u.n=-1,u.width&&void 0!==u.width.max)u.n=u.width.max,u.integerFormat.mandatoryDigits=u.n;else{var w=u.integerFormat.mandatoryDigits+u.integerFormat.optionalDigits;w>=2&&(u.n=w)}var x=t[t.length-1];x&&x.integerFormat&&(x.integerFormat.parseWidth=x.integerFormat.mandatoryDigits)}"Z"!==u.component&&"z"!==u.component||(u.integerFormat=d(u.presentation1)),t.push(u),a=i+1}i++}return n(a,i),r}var b=["","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],y=["January","February","March","April","May","June","July","August","September","October","November","December"],m=function(e){var t=Date.UTC(e.year,e.month),r=new Date(t).getUTCDay();return 0===r&&(r=7),r>4?t+864e5*(8-r):t-864e5*(r-1)},k=function(e,t){return{year:e,month:t,nextMonth:function(){return 11===t?k(e+1,0):k(e,t+1)},previousMonth:function(){return 0===t?k(e-1,11):k(e,t-1)},nextYear:function(){return k(e+1,t)},previousYear:function(){return k(e-1,t)}}},w=function(e,t){return(t-e)/6048e5+1},x=function(e,t){var r;switch(t){case"Y":r=e.getUTCFullYear();break;case"M":r=e.getUTCMonth()+1;break;case"D":r=e.getUTCDate();break;case"d":r=(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate())-Date.UTC(e.getUTCFullYear(),0))/864e5+1;break;case"F":0===(r=e.getUTCDay())&&(r=7);break;case"W":var n=k(e.getUTCFullYear(),0),a=m(n),i=Date.UTC(n.year,e.getUTCMonth(),e.getUTCDate()),o=w(a,i);if(o>52)i>=m(n.nextYear())&&(o=1);else if(o<1){var s=m(n.previousYear());o=w(s,i)}r=Math.floor(o);break;case"w":var u=k(e.getUTCFullYear(),e.getUTCMonth()),c=m(u),f=Date.UTC(u.year,u.month,e.getUTCDate()),p=w(c,f);if(p>4)f>=m(u.nextMonth())&&(p=1);else if(p<1){var l=m(u.previousMonth());p=w(l,f)}r=Math.floor(p);break;case"X":var h=k(e.getUTCFullYear(),0),d=m(h),v=m(h.nextYear()),g=e.getTime();r=g<d?h.year-1:g>=v?h.year+1:h.year;break;case"x":var b=k(e.getUTCFullYear(),e.getUTCMonth()),y=m(b),x=b.nextMonth(),E=m(x),A=e.getTime();r=A<y?b.previousMonth().month+1:A>=E?x.month+1:b.month+1;break;case"H":r=e.getUTCHours();break;case"h":r=e.getUTCHours(),0===(r%=12)&&(r=12);break;case"P":r=e.getUTCHours()>=12?"pm":"am";break;case"m":r=e.getUTCMinutes();break;case"s":r=e.getUTCSeconds();break;case"f":r=e.getUTCMilliseconds();break;case"Z":case"z":break;case"C":case"E":r="ISO"}return r},E=null;function A(e,t,r){var n=0,a=0;if(void 0!==r){var i=parseInt(r);n=Math.floor(i/100),a=i%100}var o;void 0===t?(null===E&&(E=g("[Y0001]-[M01]-[D01]T[H01]:[m01]:[s01].[f001][Z01:01t]")),o=E):o=g(t);var s=new Date(e+60*(60*n+a)*1e3),u="";return o.parts.forEach(function(e){"literal"===e.type?u+=e.value:u+=function(e,t){var r=x(e,t.component);if(-1!=="YMDdFWwXxHhms".indexOf(t.component))if("Y"===t.component&&-1!==t.n&&(r%=Math.pow(10,t.n)),t.names){if("M"===t.component||"x"===t.component)r=y[r-1];else{if("F"!==t.component)throw{code:"D3133",value:t.component};r=b[r]}t.names===p.UPPER?r=r.toUpperCase():t.names===p.LOWER&&(r=r.toLowerCase()),t.width&&r.length>t.width.max&&(r=r.substring(0,t.width.max))}else r=l(r,t.integerFormat);else if("f"===t.component)r=l(r,t.integerFormat);else if("Z"===t.component||"z"===t.component){var i=100*n+a;if(t.integerFormat.regular)r=l(i,t.integerFormat);else{var o=t.integerFormat.mandatoryDigits;if(1===o||2===o)r=l(n,t.integerFormat),0!==a&&(r+=":"+c(a,"00"));else{if(3!==o&&4!==o)throw{code:"D3134",value:o};r=l(i,t.integerFormat)}}i>=0&&(r="+"+r),"z"===t.component&&(r="GMT"+r),0===i&&"t"===t.presentation2&&(r="Z")}else"P"===t.component&&t.names===p.UPPER&&(r=r.toUpperCase());return r}(s,e)}),u}function S(e){var t={};if("datetime"===e.type)t.type="datetime",t.parts=e.parts.map(function(e){var t={};if("literal"===e.type)t.regex=e.value.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");else if("Z"===e.component||"z"===e.component){var r;Array.isArray(e.integerFormat.groupingSeparators)||(r=e.integerFormat.groupingSeparators),t.regex="","z"===e.component&&(t.regex="GMT"),t.regex+="[-+][0-9]+",r&&(t.regex+=r.character+"[0-9]+"),t.parse=function(t){"z"===e.component&&(t=t.substring(3));var n=0,a=0;r?(n=Number.parseInt(t.substring(0,t.indexOf(r.character))),a=Number.parseInt(t.substring(t.indexOf(r.character)+1))):t.length-1<=2?n=Number.parseInt(t):(n=Number.parseInt(t.substring(0,3)),a=Number.parseInt(t.substring(3)));return 60*n+a}}else if(e.integerFormat)t=S(e.integerFormat);else{t.regex="[a-zA-Z]+";var n={};if("M"===e.component||"x"===e.component)y.forEach(function(t,r){e.width&&e.width.max?n[t.substring(0,e.width.max)]=r+1:n[t]=r+1});else if("F"===e.component)b.forEach(function(t,r){r>0&&(e.width&&e.width.max?n[t.substring(0,e.width.max)]=r:n[t]=r)});else{if("P"!==e.component)throw{code:"D3133",value:e.component};n={am:0,AM:0,pm:1,PM:1}}t.parse=function(e){return n[e]}}return t.component=e.component,t});else{t.type="integer";var r=e.case===p.UPPER;switch(e.primary){case f.LETTERS:t.regex=r?"[A-Z]+":"[a-z]+",t.parse=function(e){return function(e,t){for(var r=t.charCodeAt(0),n=0,a=0;a<e.length;a++)n+=(e.charCodeAt(e.length-a-1)-r+1)*Math.pow(26,a);return n}(e,r?"A":"a")};break;case f.ROMAN:t.regex=r?"[MDCLXVI]+":"[mdclxvi]+",t.parse=function(e){return function(e){for(var t=0,r=1,n=e.length-1;n>=0;n--){var a=e[n],i=u[a];i<r?t-=i:(r=i,t+=i)}return t}(r?e:e.toUpperCase())};break;case f.WORDS:t.regex="(?:"+Object.keys(o).concat("and","[\\-, ]").join("|")+")+",t.parse=function(e){return t=e.toLowerCase(),r=t.split(/,\s|\sand\s|[\s\\-]/).map(function(e){return o[e]}),n=[0],r.forEach(function(e){if(e<100){var t=n.pop();t>=1e3&&(n.push(t),t=0),n.push(t+e)}else n.push(n.pop()*e)}),n.reduce(function(e,t){return e+t},0);var t,r,n};break;case f.DECIMAL:t.regex="[0-9]",e.parseWidth?t.regex+="{".concat(e.parseWidth,"}"):t.regex+="+",e.ordinal&&(t.regex+="(?:th|st|nd|rd)"),t.parse=function(t){var r=t;return e.ordinal&&(r=t.substring(0,t.length-2)),e.regular?r=r.split(",").join(""):e.groupingSeparators.forEach(function(e){r=r.split(e.character).join("")}),48!==e.zeroCode&&(r=r.split("").map(function(t){return String.fromCodePoint(t.codePointAt(0)-e.zeroCode+48)}).join("")),parseInt(r)};break;case f.SEQUENCE:throw{code:"D3130",value:e.token}}}return t}var T=new RegExp("^\\d{4}(-[01]\\d)*(-[0-3]\\d)*(T[0-2]\\d:[0-5]\\d:[0-5]\\d)*(\\.\\d+)?([+-][0-2]\\d:?[0-5]\\d|Z)?$");return{formatInteger:c,parseInteger:function(e,t){if(void 0!==e)return S(d(t)).parse(e)},fromMillis:function(e,t,r){if(void 0!==e)return A.call(this,e,t,r)},toMillis:function(e,t){if(void 0!==e){if(void 0===t){if(!T.test(e))throw{stack:(new Error).stack,code:"D3110",value:e};return Date.parse(e)}return function(e,t){var r=S(g(t)),n="^"+r.parts.map(function(e){return"("+e.regex+")"}).join("")+"$",a=new RegExp(n,"i").exec(e);if(null!==a){for(var i={},o=1;o<a.length;o++){var s=r.parts[o-1];s.parse&&(i[s.component]=s.parse(a[o]))}if(0===Object.getOwnPropertyNames(i).length)return;var u=0,c=function(e){u<<=1,u+=e?1:0},f=function(e){return!(~e&u||!(e&u))};"YXMxWwdD".split("").forEach(function(e){return c(i[e])});var p=!f(161)&&f(130),l=f(84),h=!l&&f(72);u=0,"PHhmsf".split("").forEach(function(e){return c(i[e])});var d=!f(23)&&f(47),v=(p?"YD":l?"XxwF":h?"XWF":"YMD")+(d?"Phmsf":"Hmsf"),b=this.environment.timestamp,y=!1,m=!1;if(v.split("").forEach(function(e){if(void 0===i[e])y?(i[e]=-1!=="MDd".indexOf(e)?1:0,m=!0):i[e]=x(b,e);else if(y=!0,m)throw{code:"D3136"}}),i.M>0?i.M-=1:i.M=0,p){var k=Date.UTC(i.Y,0),w=1e3*(i.d-1)*60*60*24,E=new Date(k+w);i.M=E.getUTCMonth(),i.D=E.getUTCDate()}if(l)throw{code:"D3136"};if(h)throw{code:"D3136"};d&&(i.H=12===i.h?0:i.h,1===i.P&&(i.H+=12));var A=Date.UTC(i.Y,i.M,i.D,i.H,i.m,i.s,i.f);return(i.Z||i.z)&&(A-=60*(i.Z||i.z)*1e3),A}}.call(this,e,t)}}}}();t.exports=a},{"./utils":6}],2:[function(e,t,r){(function(r){(function(){"use strict";function n(e){var t=Object(e),r=[];for(var n in t)r.unshift(n);return function e(){for(;r.length;)if((n=r.pop())in t)return e.value=n,e.done=!1,e;return e.done=!0,e}}function a(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function s(r,n,a,o){var s=n&&n.prototype instanceof c?n:c,f=Object.create(s.prototype);return i(f,"_invoke",function(r,n,a){var i,o,s,c=0,f=a||[],p=!1,l={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,r){return i=t,o=0,s=e,l.n=r,u}};function h(r,n){for(o=r,s=n,t=0;!p&&c&&!a&&t<f.length;t++){var a,i=f[t],h=l.p,d=i[2];r>3?(a=d===n)&&(s=i[(o=i[4])?5:(o=3,3)],i[4]=i[5]=e):i[0]<=h&&((a=r<2&&h<i[1])?(o=0,l.v=n,l.n=i[1]):h<d&&(a=r<3||i[0]>n||n>d)&&(i[4]=r,i[5]=n,l.n=d,o=0))}if(a||r>1)return u;throw p=!0,n}return function(a,f,d){if(c>1)throw TypeError("Generator is already running");for(p&&1===f&&h(f,d),o=f,s=d;(t=o<2?e:s)||!p;){i||(o?o<3?(o>1&&(l.n=-1),h(o,s)):l.n=s:l.v=s);try{if(c=2,i){if(o||(a="next"),t=i[a]){if(!(t=t.call(i,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,o<2&&(o=0)}else 1===o&&(t=i.return)&&t.call(i),o<2&&(s=TypeError("The iterator does not provide a '"+a+"' method"),o=1);i=e}else if((t=(p=l.n<0)?s:r.call(n,l))!==u)break}catch(t){i=e,o=1,s=t}finally{c=1}}return{value:t,done:p}}}(r,a,o),!0),f}var u={};function c(){}function f(){}function p(){}t=Object.getPrototypeOf;var l=[][n]?t(t([][n]())):(i(t={},n,function(){return this}),t),h=p.prototype=c.prototype=Object.create(l);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,i(e,o,"GeneratorFunction")),e.prototype=Object.create(h),e}return f.prototype=p,i(h,"constructor",p),i(p,"constructor",f),f.displayName="GeneratorFunction",i(p,o,"GeneratorFunction"),i(h),i(h,o,"Generator"),i(h,n,function(){return this}),i(h,"toString",function(){return"[object Generator]"}),(a=function(){return{w:s,m:d}})()}function i(e,t,r,n){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}(i=function(e,t,r,n){function o(t,r){i(e,t,function(e){return this._invoke(t,r,e)})}t?a?a(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(o("next",0),o("throw",1),o("return",2))})(e,t,r,n)}function o(e){"@babel/helpers - typeof";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 s(e,t,r,n,a,i,o){try{var s=e[i](o),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,a)}function u(e){return function(){var t=this,r=arguments;return new Promise(function(n,a){var i=e.apply(t,r);function o(e){s(i,n,a,o,u,"next",e)}function u(e){s(i,n,a,o,u,"throw",e)}o(void 0)})}}var c=e("./utils"),f=function(){var e=c.isNumeric,t=c.isArrayOfStrings,i=c.isArrayOfNumbers,s=c.createSequence,f=c.isSequence,p=c.isFunction,l=c.isLambda,h=c.isPromise,d=c.getFunctionArity,v=c.isDeepEqual,g=c.stringToArray;function b(e,t,r){if(void 0!==e){var n=g(e),a=n.length;if(a+t<0&&(t=0),void 0!==r){if(r<=0)return"";var i=t>=0?t+r:a+t+r;return n.slice(t,i).join("")}return n.slice(t).join("")}}function y(e){if(void 0!==e)return g(e).length}function m(e,t){return k.apply(this,arguments)}function k(){return(k=u(a().m(function e(t,r){var n;return a().w(function(e){for(;;)switch(e.n){case 0:if(n=t.apply(this,[r]),!h(n)){e.n=2;break}return e.n=1,n;case 1:n=e.v;case 2:if(!n||"number"==typeof n.start||"number"===n.end||Array.isArray(n.groups)||p(n.next)){e.n=3;break}throw{code:"T1010",stack:(new Error).stack};case 3:return e.a(2,n)}},e,this)}))).apply(this,arguments)}function w(){return(w=u(a().m(function e(t,r){var n,i;return a().w(function(e){for(;;)switch(e.n){case 0:if(void 0!==t){e.n=1;break}return e.a(2,void 0);case 1:if("string"!=typeof r){e.n=2;break}n=-1!==t.indexOf(r),e.n=4;break;case 2:return e.n=3,m(r,t);case 3:i=e.v,n=void 0!==i;case 4:return e.a(2,n)}},e)}))).apply(this,arguments)}function x(){return(x=u(a().m(function e(t,r,n){var i,o,u;return a().w(function(e){for(;;)switch(e.n){case 0:if(void 0!==t){e.n=1;break}return e.a(2,void 0);case 1:if(!(n<0)){e.n=2;break}throw{stack:(new Error).stack,value:n,code:"D3040",index:3};case 2:if(i=s(),!(void 0===n||n>0)){e.n=6;break}return o=0,e.n=3,m(r,t);case 3:if(void 0===(u=e.v)){e.n=6;break}case 4:if(void 0===u||!(void 0===n||o<n)){e.n=6;break}return i.push({match:u.match,index:u.start,groups:u.groups}),e.n=5,m(u.next);case 5:u=e.v,o++,e.n=4;break;case 6:return e.a(2,i)}},e)}))).apply(this,arguments)}function E(){return(E=u(a().m(function e(t,r,n,i){var o,s,u,c,f,p,l,d;return a().w(function(e){for(;;)switch(e.n){case 0:if(void 0!==t){e.n=1;break}return e.a(2,void 0);case 1:if(o=this,""!==r){e.n=2;break}throw{code:"D3010",stack:(new Error).stack,value:r,index:2};case 2:if(!(i<0)){e.n=3;break}throw{code:"D3011",stack:(new Error).stack,value:i,index:4};case 3:if(s="string"==typeof n?function(e){for(var t="",r=0,a=n.indexOf("$",r);-1!==a&&r<n.length;){t+=n.substring(r,a),r=a+1;var i=n.charAt(r);if("$"===i)t+="$",r++;else if("0"===i)t+=e.match,r++;else{var o;if(o=0===e.groups.length?1:Math.floor(Math.log(e.groups.length)*Math.LOG10E)+1,a=parseInt(n.substring(r,r+o),10),o>1&&a>e.groups.length&&(a=parseInt(n.substring(r,r+o-1),10)),isNaN(a))t+="$";else{if(e.groups.length>0){var s=e.groups[a-1];void 0!==s&&(t+=s)}r+=a.toString().length}}a=n.indexOf("$",r)}return t+=n.substring(r)}:n,u="",c=0,!(void 0===i||i>0)){e.n=15;break}if(f=0,"string"!=typeof r){e.n=4;break}for(p=t.indexOf(r,c);-1!==p&&(void 0===i||f<i);)u+=t.substring(c,p),u+=n,c=p+r.length,f++,p=t.indexOf(r,c);u+=t.substring(c),e.n=14;break;case 4:return e.n=5,m(r,t);case 5:if(void 0===(l=e.v)){e.n=13;break}case 6:if(void 0===l||!(void 0===i||f<i)){e.n=12;break}if(u+=t.substring(c,l.start),d=s.apply(o,[l]),!h(d)){e.n=8;break}return e.n=7,d;case 7:d=e.v;case 8:if("string"!=typeof d){e.n=9;break}u+=d,e.n=10;break;case 9:throw{code:"D3012",stack:(new Error).stack,value:d};case 10:return c=l.start+l.match.length,f++,e.n=11,m(l.next);case 11:l=e.v,e.n=6;break;case 12:u+=t.substring(c),e.n=14;break;case 13:u=t;case 14:e.n=16;break;case 15:u=t;case 16:return e.a(2,u)}},e,this)}))).apply(this,arguments)}function A(){return(A=u(a().m(function e(t,r,n){var i,o,s,u;return a().w(function(e){for(;;)switch(e.n){case 0:if(void 0!==t){e.n=1;break}return e.a(2,void 0);case 1:if(!(n<0)){e.n=2;break}throw{code:"D3020",stack:(new Error).stack,value:n,index:3};case 2:if(i=[],!(void 0===n||n>0)){e.n=9;break}if("string"!=typeof r){e.n=3;break}i=t.split(r,n),e.n=9;break;case 3:return o=0,e.n=4,m(r,t);case 4:if(void 0===(s=e.v)){e.n=8;break}u=0;case 5:if(void 0===s||!(void 0===n||o<n)){e.n=7;break}return i.push(t.substring(u,s.start)),u=s.end,e.n=6,m(s.next);case 6:s=e.v,o++,e.n=5;break;case 7:(void 0===n||o<n)&&i.push(t.substring(u)),e.n=9;break;case 8:i.push(t);case 9:return e.a(2,i)}},e)}))).apply(this,arguments)}function S(e,t){var r;if(void 0!==e){if(t){var n=e.toString().split("e");e=+(n[0]+"e"+(n[1]?+n[1]+t:t))}var a=(r=Math.round(e))-e;return.5===Math.abs(a)&&1===Math.abs(r%2)&&(r-=1),t&&(r=+((n=r.toString().split("e"))[0]+"e"+(n[1]?+n[1]-t:-t))),Object.is(r,-0)&&(r=0),r}}function T(t){if(void 0!==t){var r=!1;if(Array.isArray(t)){if(1===t.length)r=T(t[0]);else if(t.length>1){r=t.filter(function(e){return T(e)}).length>0}}else"string"==typeof t?t.length>0&&(r=!0):e(t)?0!==t&&(r=!0):null===t||"object"!==o(t)||p(t)?"boolean"==typeof t&&!0===t&&(r=!0):Object.keys(t).length>0&&(r=!0);return r}}function O(e,t,r,n){var a=[t],i=d(e);return i>=2&&a.push(r),i>=3&&a.push(n),a}function D(){return(D=u(a().m(function e(t,r){var n,i,o,u;return a().w(function(e){for(;;)switch(e.n){case 0:if(void 0!==t){e.n=1;break}return e.a(2,void 0);case 1:n=s(),i=0;case 2:if(!(i<t.length)){e.n=5;break}return o=O(r,t[i],i,t),e.n=3,r.apply(this,o);case 3:void 0!==(u=e.v)&&n.push(u);case 4:i++,e.n=2;break;case 5:return e.a(2,n)}},e,this)}))).apply(this,arguments)}function P(){return(P=u(a().m(function e(t,r){var n,i,o,u;return a().w(function(e){for(;;)switch(e.n){case 0:if(void 0!==t){e.n=1;break}return e.a(2,void 0);case 1:n=s(),i=0;case 2:if(!(i<t.length)){e.n=5;break}return o=t[i],u=O(r,o,i,t),e.n=3,r.apply(this,u);case 3:T(e.v)&&n.push(o);case 4:i++,e.n=2;break;case 5:return e.a(2,n)}},e,this)}))).apply(this,arguments)}function j(){return(j=u(a().m(function e(t,r){var n,i,o,s,u,c,f;return a().w(function(e){for(;;)switch(e.n){case 0:if(void 0!==t){e.n=1;break}return e.a(2,void 0);case 1:n=!1,o=0;case 2:if(!(o<t.length)){e.n=7;break}if(s=t[o],u=!0,void 0===r){e.n=4;break}return c=O(r,s,o,t),e.n=3,r.apply(this,c);case 3:f=e.v,u=T(f);case 4:if(!u){e.n=6;break}if(n){e.n=5;break}i=s,n=!0,e.n=6;break;case 5:throw{stack:(new Error).stack,code:"D3138",index:o};case 6:o++,e.n=2;break;case 7:if(n){e.n=8;break}throw{stack:(new Error).stack,code:"D3139"};case 8:return e.a(2,i)}},e,this)}))).apply(this,arguments)}function M(){return(M=u(a().m(function e(t,r,n){var i,o,s,u;return a().w(function(e){for(;;)switch(e.n){case 0:if(void 0!==t){e.n=1;break}return e.a(2,void 0);case 1:if(!((o=d(r))<2)){e.n=2;break}throw{stack:(new Error).stack,code:"D3050",index:1};case 2:void 0===n&&t.length>0?(i=t[0],s=1):(i=n,s=0);case 3:if(!(s<t.length)){e.n=5;break}return u=[i,t[s]],o>=3&&u.push(s),o>=4&&u.push(t),e.n=4,r.apply(this,u);case 4:i=e.v,s++,e.n=3;break;case 5:return e.a(2,i)}},e,this)}))).apply(this,arguments)}function C(e,t){return void 0===e?t:void 0===t?e:(Array.isArray(e)||(e=s(e)),Array.isArray(t)||(t=[t]),e.concat(t))}function F(){return(F=u(a().m(function e(t,r){var i,o,u,c,f,p;return a().w(function(e){for(;;)switch(e.n){case 0:i=s(),f=n(t);case 1:if((p=f()).done){e.n=3;break}return o=p.value,u=O(r,t[o],o,t),e.n=2,r.apply(this,u);case 2:void 0!==(c=e.v)&&i.push(c),e.n=1;break;case 3:return e.a(2,i)}},e,this)}))).apply(this,arguments)}function U(){return(U=u(a().m(function e(r,n){var o,s,c,f;return a().w(function(e){for(;;)switch(e.n){case 0:if(void 0!==r){e.n=1;break}return e.a(2,void 0);case 1:if(!(r.length<=1)){e.n=2;break}return e.a(2,r);case 2:if(void 0!==n){e.n=4;break}if(i(r)||t(r)){e.n=3;break}throw{stack:(new Error).stack,code:"D3070",index:1};case 3:o=function(){var e=u(a().m(function e(t,r){return a().w(function(e){for(;;)switch(e.n){case 0:return e.a(2,t>r)}},e)}));return function(t,r){return e.apply(this,arguments)}}(),e.n=5;break;case 4:o=n;case 5:return s=function(){var e=u(a().m(function e(t,r){var n,i;return a().w(function(e){for(;;)switch(e.n){case 0:return n=function(){var e=u(a().m(function e(t,r,i){return a().w(function(e){for(;;)switch(e.n){case 0:if(0!==r.length){e.n=1;break}Array.prototype.push.apply(t,i),e.n=6;break;case 1:if(0!==i.length){e.n=2;break}Array.prototype.push.apply(t,r),e.n=6;break;case 2:return e.n=3,o(r[0],i[0]);case 3:if(!e.v){e.n=5;break}return t.push(i[0]),e.n=4,n(t,r,i.slice(1));case 4:e.n=6;break;case 5:return t.push(r[0]),e.n=6,n(t,r.slice(1),i);case 6:return e.a(2)}},e)}));return function(t,r,n){return e.apply(this,arguments)}}(),i=[],e.n=1,n(i,t,r);case 1:return e.a(2,i)}},e)}));return function(t,r){return e.apply(this,arguments)}}(),c=function(){var e=u(a().m(function e(t){var r,n,i;return a().w(function(e){for(;;)switch(e.n){case 0:if(Array.isArray(t)&&!(t.length<=1)){e.n=1;break}return e.a(2,t);case 1:return r=Math.floor(t.length/2),n=t.slice(0,r),i=t.slice(r),e.n=2,c(n);case 2:return n=e.v,e.n=3,c(i);case 3:return i=e.v,e.n=4,s(n,i);case 4:return e.a(2,e.v);case 5:return e.a(2)}},e)}));return function(t){return e.apply(this,arguments)}}(),e.n=6,c(r);case 6:return f=e.v,e.a(2,f)}},e)}))).apply(this,arguments)}function N(){return(N=u(a().m(function e(t,r){var i,o,s,u,c,f;return a().w(function(e){for(;;)switch(e.n){case 0:i={},c=n(t);case 1:if((f=c()).done){e.n=3;break}return o=f.value,s=t[o],u=O(r,s,o,t),e.n=2,r.apply(this,u);case 2:T(e.v)&&(i[o]=s),e.n=1;break;case 3:return 0===Object.keys(i).length&&(i=void 0),e.a(2,i)}},e,this)}))).apply(this,arguments)}return{sum:function(e){if(void 0!==e){var t=0;return e.forEach(function(e){t+=e}),t}},count:function(e){return void 0===e?0:e.length},max:function(e){if(void 0!==e&&0!==e.length)return Math.max.apply(Math,e)},min:function(e){if(void 0!==e&&0!==e.length)return Math.min.apply(Math,e)},average:function(e){if(void 0!==e&&0!==e.length){var t=0;return e.forEach(function(e){t+=e}),t/e.length}},string:function(t){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(void 0!==t){var n;if("string"==typeof t)n=t;else if(p(t))n="";else{if("number"==typeof t&&!isFinite(t))throw{code:"D3001",value:t,stack:(new Error).stack};var a=r?2:0;Array.isArray(t)&&t.outerWrapper&&(t=t[0]),n=JSON.stringify(t,function(t,r){return null!=r&&r.toPrecision&&e(r)?Number(r.toPrecision(15)):r&&p(r)?"":r},a)}return n}},substring:b,substringBefore:function(e,t){if(void 0!==e){var r=e.indexOf(t);return r>-1?e.substr(0,r):e}},substringAfter:function(e,t){if(void 0!==e){var r=e.indexOf(t);return r>-1?e.substr(r+t.length):e}},lowercase:function(e){if(void 0!==e)return e.toLowerCase()},uppercase:function(e){if(void 0!==e)return e.toUpperCase()},length:y,trim:function(e){if(void 0!==e){var t=e.replace(/[ \t\n\r]+/gm," ");return" "===t.charAt(0)&&(t=t.substring(1))," "===t.charAt(t.length-1)&&(t=t.substring(0,t.length-1)),t}},pad:function(e,t,r){if(void 0!==e){var n;void 0!==r&&0!==r.length||(r=" "),t=Math.trunc(t);var a=Math.abs(t)-y(e);if(a>0){var i=new Array(a+1).join(r);r.length>1&&(i=b(i,0,a)),n=t>0?e+i:i+e}else n=e;return n}},match:function(e,t,r){return x.apply(this,arguments)},contains:function(e,t){return w.apply(this,arguments)},replace:function(e,t,r,n){return E.apply(this,arguments)},split:function(e,t,r){return A.apply(this,arguments)},join:function(e,t){if(void 0!==e)return void 0===t&&(t=""),e.join(t)},formatNumber:function(e,t,r){if(void 0!==e){var n={"decimal-separator":".","grouping-separator":",","exponent-separator":"e",infinity:"Infinity","minus-sign":"-",NaN:"NaN",percent:"%","per-mille":"‰","zero-digit":"0",digit:"#","pattern-separator":";"};void 0!==r&&Object.keys(r).forEach(function(e){n[e]=r[e]});for(var a=[],i=n["zero-digit"].charCodeAt(0),o=i;o<i+10;o++)a.push(String.fromCharCode(o));var s=a.concat([n["decimal-separator"],n["exponent-separator"],n["grouping-separator"],n.digit,n["pattern-separator"]]),u=t.split(n["pattern-separator"]);if(u.length>2)throw{code:"D3080",stack:(new Error).stack};var c=u.map(function(e){var t,r,a,i,o=function(){for(var t,r=0;r<e.length;r++)if(t=e.charAt(r),-1!==s.indexOf(t)&&t!==n["exponent-separator"])return e.substring(0,r)}(),u=function(){for(var t,r=e.length-1;r>=0;r--)if(t=e.charAt(r),-1!==s.indexOf(t)&&t!==n["exponent-separator"])return e.substring(r+1)}(),c=e.substring(o.length,e.length-u.length),f=e.indexOf(n["exponent-separator"],o.length);-1===f||f>e.length-u.length?(t=c,r=void 0):(t=c.substring(0,f),r=c.substring(f+1));var p=t.indexOf(n["decimal-separator"]);return-1===p?(a=t,i=u):(a=t.substring(0,p),i=t.substring(p+1)),{prefix:o,suffix:u,activePart:c,mantissaPart:t,exponentPart:r,integerPart:a,fractionalPart:i,subpicture:e}});c.forEach(function(e){var t,r,i=e.subpicture,o=i.indexOf(n["decimal-separator"]);o!==i.lastIndexOf(n["decimal-separator"])&&(t="D3081"),i.indexOf(n.percent)!==i.lastIndexOf(n.percent)&&(t="D3082"),i.indexOf(n["per-mille"])!==i.lastIndexOf(n["per-mille"])&&(t="D3083"),-1!==i.indexOf(n.percent)&&-1!==i.indexOf(n["per-mille"])&&(t="D3084");var u=!1;for(r=0;r<e.mantissaPart.length;r++){var c=e.mantissaPart.charAt(r);if(-1!==a.indexOf(c)||c===n.digit){u=!0;break}}u||(t="D3085"),-1!==e.activePart.split("").map(function(e){return-1===s.indexOf(e)?"p":"a"}).join("").indexOf("p")&&(t="D3086"),-1!==o?i.charAt(o-1)!==n["grouping-separator"]&&i.charAt(o+1)!==n["grouping-separator"]||(t="D3087"):e.integerPart.charAt(e.integerPart.length-1)===n["grouping-separator"]&&(t="D3088"),-1!==i.indexOf(n["grouping-separator"]+n["grouping-separator"])&&(t="D3089");var f=e.integerPart.indexOf(n.digit);-1!==f&&e.integerPart.substring(0,f).split("").filter(function(e){return a.indexOf(e)>-1}).length>0&&(t="D3090"),-1!==(f=e.fractionalPart.lastIndexOf(n.digit))&&e.fractionalPart.substring(f).split("").filter(function(e){return a.indexOf(e)>-1}).length>0&&(t="D3091");var p="string"==typeof e.exponentPart;if(p&&e.exponentPart.length>0&&(-1!==i.indexOf(n.percent)||-1!==i.indexOf(n["per-mille"]))&&(t="D3092"),p&&(0===e.exponentPart.length||e.exponentPart.split("").filter(function(e){return-1===a.indexOf(e)}).length>0)&&(t="D3093"),t)throw{code:t,stack:(new Error).stack}});var f,p,l,h,d=c.map(function(e){var t=function(t,r){for(var i=[],o=t.indexOf(n["grouping-separator"]);-1!==o;){var s=(r?t.substring(0,o):t.substring(o)).split("").filter(function(e){return-1!==a.indexOf(e)||e===n.digit}).length;i.push(s),o=e.integerPart.indexOf(n["grouping-separator"],o+1)}return i},r=t(e.integerPart),i=function(e){if(0===e.length)return 0;for(var t=function(e,r){return 0===r?e:t(r,e%r)},r=e.reduce(t),n=1;n<=e.length;n++)if(-1===e.indexOf(n*r))return 0;return r}(r),o=t(e.fractionalPart,!0),s=e.integerPart.split("").filter(function(e){return-1!==a.indexOf(e)}).length,u=s,c=e.fractionalPart.split(""),f=c.filter(function(e){return-1!==a.indexOf(e)}).length,p=c.filter(function(e){return-1!==a.indexOf(e)||e===n.digit}).length,l="string"==typeof e.exponentPart;0===s&&0===p&&(l?(f=1,p=1):s=1),l&&0===s&&-1!==e.integerPart.indexOf(n.digit)&&(s=1),0===s&&0===f&&(f=1);var h=0;return l&&(h=e.exponentPart.split("").filter(function(e){return-1!==a.indexOf(e)}).length),{integerPartGroupingPositions:r,regularGrouping:i,minimumIntegerPartSize:s,scalingFactor:u,prefix:e.prefix,fractionalPartGroupingPositions:o,minimumFactionalPartSize:f,maximumFactionalPartSize:p,minimumExponentSize:h,suffix:e.suffix,picture:e.subpicture}}),v=n["minus-sign"],g=n["zero-digit"],b=n["decimal-separator"],y=n["grouping-separator"];if(1===d.length&&(d.push(JSON.parse(JSON.stringify(d[0]))),d[1].prefix=v+d[1].prefix),p=-1!==(f=e>=0?d[0]:d[1]).picture.indexOf(n.percent)?100*e:-1!==f.picture.indexOf(n["per-mille"])?1e3*e:e,0===f.minimumExponentSize)l=p;else{var m=Math.pow(10,f.scalingFactor),k=Math.pow(10,f.scalingFactor-1);for(l=p,h=0;l<k;)l*=10,h-=1;for(;l>m;)l/=10,h+=1}var w=function(e,t){var r=Math.abs(e).toFixed(t);return"0"!==g&&(r=r.split("").map(function(e){return e>="0"&&e<="9"?a[e.charCodeAt(0)-48]:e}).join("")),r},x=w(S(l,f.maximumFactionalPartSize),f.maximumFactionalPartSize),E=x.indexOf(".");for(-1===E?x+=b:x=x.replace(".",b);x.charAt(0)===g;)x=x.substring(1);for(;x.charAt(x.length-1)===g;)x=x.substring(0,x.length-1);E=x.indexOf(b);var A=f.minimumIntegerPartSize-E,T=f.minimumFactionalPartSize-(x.length-E-1);if(x=(A>0?new Array(A+1).join(g):"")+x,x+=T>0?new Array(T+1).join(g):"",E=x.indexOf(b),f.regularGrouping>0)for(var O=Math.floor((E-1)/f.regularGrouping),D=1;D<=O;D++)x=[x.slice(0,E-D*f.regularGrouping),y,x.slice(E-D*f.regularGrouping)].join("");else f.integerPartGroupingPositions.forEach(function(e){x=[x.slice(0,E-e),y,x.slice(E-e)].join(""),E++});if(E=x.indexOf(b),f.fractionalPartGroupingPositions.forEach(function(e){x=[x.slice(0,e+E+1),y,x.slice(e+E+1)].join("")}),E=x.indexOf(b),-1!==f.picture.indexOf(b)&&E!==x.length-1||(x=x.substring(0,x.length-1)),void 0!==h){var P=w(h,0);(A=f.minimumExponentSize-P.length)>0&&(P=new Array(A+1).join(g)+P),x=x+n["exponent-separator"]+(h<0?v:"")+P}return x=f.prefix+x+f.suffix}},formatBase:function(e,t){if(void 0!==e){if(e=S(e),(t=void 0===t?10:S(t))<2||t>36)throw{code:"D3100",stack:(new Error).stack,value:t};return e.toString(t)}},number:function(e){var t;if(void 0!==e){if("number"==typeof e)t=e;else if("string"==typeof e&&/^-?[0-9]+(\.[0-9]+)?([Ee][-+]?[0-9]+)?$/.test(e)&&!isNaN(parseFloat(e))&&isFinite(e))t=parseFloat(e);else if("string"==typeof e&&/^(0[xX][0-9A-Fa-f]+)|(0[oO][0-7]+)|(0[bB][0-1]+)$/.test(e))t=Number(e);else if(!0===e)t=1;else{if(!1!==e)throw{code:"D3030",value:e,stack:(new Error).stack,index:1};t=0}return t}},floor:function(e){if(void 0!==e)return Math.floor(e)},ceil:function(e){if(void 0!==e)return Math.ceil(e)},round:S,abs:function(e){if(void 0!==e)return Math.abs(e)},sqrt:function(e){if(void 0!==e){if(e<0)throw{stack:(new Error).stack,code:"D3060",index:1,value:e};return Math.sqrt(e)}},power:function(e,t){var r;if(void 0!==e){if(r=Math.pow(e,t),!isFinite(r))throw{stack:(new Error).stack,code:"D3061",index:1,value:e,exp:t};return r}},random:function(){return Math.random()},boolean:T,not:function(e){if(void 0!==e)return!T(e)},map:function(e,t){return D.apply(this,arguments)},zip:function(){for(var e=[],t=Array.prototype.slice.call(arguments),r=Math.min.apply(Math,t.map(function(e){return Array.isArray(e)?e.length:0})),n=0;n<r;n++){var a=t.map(function(e){return e[n]});e.push(a)}return e},filter:function(e,t){return P.apply(this,arguments)},single:function(e,t){return j.apply(this,arguments)},foldLeft:function(e,t,r){return M.apply(this,arguments)},sift:function(e,t){return N.apply(this,arguments)},keys:function e(t){var r=s();if(Array.isArray(t)){var n={};t.forEach(function(t){e(t).forEach(function(e){n[e]=!0})}),r=e(n)}else null===t||"object"!==o(t)||p(t)||Object.keys(t).forEach(function(e){return r.push(e)});return r},lookup:function e(t,r){var n;if(Array.isArray(t)){n=s();for(var a=0;a<t.length;a++){var i=e(t[a],r);void 0!==i&&(Array.isArray(i)?i.forEach(function(e){return n.push(e)}):n.push(i))}}else null===t||"object"!==o(t)||p(t)||(n=t[r]);return n},append:C,exists:function(e){return void 0!==e},spread:function e(t){var r=s();if(Array.isArray(t))t.forEach(function(t){r=C(r,e(t))});else if(null===t||"object"!==o(t)||l(t))r=t;else for(var n in t){var a={};a[n]=t[n],r.push(a)}return r},merge:function(e){if(void 0!==e){var t={};return e.forEach(function(e){for(var r in e)t[r]=e[r]}),t}},reverse:function(e){if(void 0!==e){if(e.length<=1)return e;for(var t=e.length,r=new Array(t),n=0;n<t;n++)r[t-n-1]=e[n];return r}},each:function(e,t){return F.apply(this,arguments)},error:function(e){throw{code:"D3137",stack:(new Error).stack,message:e||"$error() function evaluated"}},assert:function(e,t){if(!e)throw{code:"D3141",stack:(new Error).stack,message:t||"$assert() statement failed"}},type:function(t){if(void 0!==t)return null===t?"null":e(t)?"number":"string"==typeof t?"string":"boolean"==typeof t?"boolean":Array.isArray(t)?"array":p(t)?"function":"object"},sort:function(e,t){return U.apply(this,arguments)},shuffle:function(e){if(void 0!==e){if(e.length<=1)return e;for(var t=new Array(e.length),r=0;r<e.length;r++){var n=Math.floor(Math.random()*(r+1));r!==n&&(t[r]=t[n]),t[n]=e[r]}return t}},distinct:function(e){if(void 0!==e){if(!Array.isArray(e)||e.length<=1)return e;for(var t=f(e)?s():[],r=0;r<e.length;r++){for(var n=e[r],a=!1,i=0;i<t.length;i++)if(v(n,t[i])){a=!0;break}a||t.push(n)}return t}},base64encode:function(e){if(void 0!==e)return("undefined"!=typeof window?window.btoa:function(e){return new r.Buffer.from(e,"binary").toString("base64")})(e)},base64decode:function(e){if(void 0!==e)return("undefined"!=typeof window?window.atob:function(e){return new r.Buffer.from(e,"base64").toString("binary")})(e)},encodeUrlComponent:function(e){if(void 0!==e){var t;try{t=encodeURIComponent(e)}catch(t){throw{code:"D3140",stack:(new Error).stack,value:e,functionName:"encodeUrlComponent"}}return t}},encodeUrl:function(e){if(void 0!==e){var t;try{t=encodeURI(e)}catch(t){throw{code:"D3140",stack:(new Error).stack,value:e,functionName:"encodeUrl"}}return t}},decodeUrlComponent:function(e){if(void 0!==e){var t;try{t=decodeURIComponent(e)}catch(t){throw{code:"D3140",stack:(new Error).stack,value:e,functionName:"decodeUrlComponent"}}return t}},decodeUrl:function(e){if(void 0!==e){var t;try{t=decodeURI(e)}catch(t){throw{code:"D3140",stack:(new Error).stack,value:e,functionName:"decodeUrl"}}return t}}}}();t.exports=f}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./utils":6}],3:[function(e,t,r){"use strict";function n(e){if(null!=e){var t=e["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],r=0;if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}}}throw new TypeError(f(e)+" is not iterable")}function a(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,i,o,s=[],u=!0,c=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){c=!0,a=e}finally{try{if(!u&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw a}}return s}}(e,t)||o(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=o(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,a=function(){};return{s:a,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,u=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return s=e.done,e},e:function(e){u=!0,i=e},f:function(){try{s||null==r.return||r.return()}finally{if(u)throw i}}}}function o(e,t){if(e){if("string"==typeof e)return s(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?s(e,t):void 0}}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function u(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",a=r.toStringTag||"@@toStringTag";function i(r,n,a,i){var u=n&&n.prototype instanceof s?n:s,f=Object.create(u.prototype);return c(f,"_invoke",function(r,n,a){var i,s,u,c=0,f=a||[],p=!1,l={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,r){return i=t,s=0,u=e,l.n=r,o}};function h(r,n){for(s=r,u=n,t=0;!p&&c&&!a&&t<f.length;t++){var a,i=f[t],h=l.p,d=i[2];r>3?(a=d===n)&&(u=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=h&&((a=r<2&&h<i[1])?(s=0,l.v=n,l.n=i[1]):h<d&&(a=r<3||i[0]>n||n>d)&&(i[4]=r,i[5]=n,l.n=d,s=0))}if(a||r>1)return o;throw p=!0,n}return function(a,f,d){if(c>1)throw TypeError("Generator is already running");for(p&&1===f&&h(f,d),s=f,u=d;(t=s<2?e:u)||!p;){i||(s?s<3?(s>1&&(l.n=-1),h(s,u)):l.n=u:l.v=u);try{if(c=2,i){if(s||(a="next"),t=i[a]){if(!(t=t.call(i,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(u=TypeError("The iterator does not provide a '"+a+"' method"),s=1);i=e}else if((t=(p=l.n<0)?u:r.call(n,l))!==o)break}catch(t){i=e,s=1,u=t}finally{c=1}}return{value:t,done:p}}}(r,a,i),!0),f}var o={};function s(){}function f(){}function p(){}t=Object.getPrototypeOf;var l=[][n]?t(t([][n]())):(c(t={},n,function(){return this}),t),h=p.prototype=s.prototype=Object.create(l);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,c(e,a,"GeneratorFunction")),e.prototype=Object.create(h),e}return f.prototype=p,c(h,"constructor",p),c(p,"construct