text: (function(e,t){'object'==typeof exports&&'undefined'!=typeof module?module.exports=t():'function'==typeof define&&define.amd?define(t):e.Dinero=t()})(this,function(){'use strict';function e(e,t){return t={exports:{}},e(t,t.exports),t.exports}function t(e){var t,n;this.promise=new e(function(e,r){if(t!==void 0||n!==void 0)throw TypeError('Bad Promise constructor');t=e,n=r}),this.resolve=Q(t),this.reject=Q(n)}function n(e){return!isNaN(parseInt(e))&&isFinite(e)}function r(e){return n(e)&&100>=e&&0<=e}function o(e){return 0<e.length&&e.every(function(e){return 0<e})}function a(e){return 0==e%2}function s(e){return n(e)&&!E(e)}function l(){var e=0<arguments.length&&arguments[0]!==void 0?arguments[0]:0,t=e.toString().split('.')[1];return t?t.length:0}function c(e){return .5==T(e)%1}function u(e){var t=1<arguments.length&&arguments[1]!==void 0?arguments[1]:{};return new Promise(function(n,r){var o=Object.assign(new XMLHttpRequest,{onreadystatechange:function(){4===o.readyState&&(200<=o.status&&400>o.status?n(JSON.parse(o.responseText)):r(new Error(o.statusText)))},onerror:function(){r(new Error('Network error'))}});o.open('GET',e,!0),d(o,t.headers),o.send()})}function d(e){var t=1<arguments.length&&arguments[1]!==void 0?arguments[1]:{};for(var n in t)e.setRequestHeader(n,t[n]);return e}function g(e){return'undefined'==typeof e}function m(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:'.',n={};return Object.entries(e).forEach(function(e){if('object'===Kn(e[1])){var r=m(e[1]);Object.entries(r).forEach(function(r){n[e[0]+t+r[0]]=r[1]})}else n[e[0]]=e[1]}),n}function p(){var e=Math.round,t=function(t,n){var r=function(e){return v(10,l(e))},o=R(r(t),r(n));return e(t*o)*e(n*o)/(o*o)},n={HALF_ODD:function(t){var n=e(t);return c(t)?a(n)?n-1:n:n},HALF_EVEN:function(t){var n=e(t);return c(t)?a(n)?n:n-1:n},HALF_UP:function(t){return e(t)},HALF_DOWN:function(t){return c(t)?k(t):e(t)},HALF_TOWARDS_ZERO:function(t){return c(t)?O(t)*k(T(t)):e(t)},HALF_AWAY_FROM_ZERO:function(t){return c(t)?O(t)*L(T(t)):e(t)}};return{add:function(e,t){return e+t},subtract:function(e,t){return e-t},multiply:function(e,n){return s(e)||s(n)?t(e,n):e*n},divide:function(e,t){return e/t},modulo:function(e,t){return e%t},round:function(e){var t=1<arguments.length&&arguments[1]!==void 0?arguments[1]:'HALF_EVEN';return n[t](e)}}}function y(e){var t=/^(?:(\$|USD)?0(?:(,)0)?(\.)?(0+)?|0(?:(,)0)?(\.)?(0+)?\s?(dollar)?)$/gm.exec(e);return{getMatches:function(){return null===t?[]:t.slice(1).filter(function(e){return!g(e)})},getMinimumFractionDigits:function(){var e=function(e){return'.'===e};return g(this.getMatches().find(e))?0:this.getMatches()[Zn.add(this.getMatches().findIndex(e),1)].split('').length},getCurrencyDisplay:function(){return{USD:'code',dollar:'name',$:'symbol'}[this.getMatches().find(function(e){return'USD'===e||'dollar'===e||'$'===e})]},getStyle:function(){return g(this.getCurrencyDisplay(this.getMatches()))?'decimal':'currency'},getUseGrouping:function(){return!g(this.getMatches().find(function(e){return','===e}))}}}function h(e){var t=function(){var e=0<arguments.length&&arguments[0]!==void 0?arguments[0]:'',t=arguments[1];for(var n in t)e=e.replace('{{'+n+'}}',t[n]);return e};return{getExchangeRate:function(n,r){return u(t(e.endpoint,{from:n,to:r}),{headers:e.headers}).then(function(o){return m(o)[t(e.propertyPath,{from:n,to:r})]})}}}function A(e){var t=1<arguments.length&&arguments[1]!==void 0?arguments[1]:new Error;if(!e)throw t}function S(e){A(r(e),new RangeError('You must provide a numeric value between 0 and 100.'))}function _(e){A(o(e),new TypeError('You must provide a non-empty array of numeric values greater than 0.'))}function P(e){A(E(e),new TypeError('You must provide an integer.'))}var v=Math.pow,T=Math.abs,E=Number.isInteger,O=Math.sign,R=Math.max,b=Math.min,k=Math.floor,L=Math.ceil,x=e(function(e){var t=e.exports='undefined'!=typeof window&&window.Math==Math?window:'undefined'!=typeof self&&self.Math==Math?self:Function('return this')();'number'==typeof __g&&(__g=t)}),M=e(function(e){var t=e.exports={version:'2.5.5'};'number'==typeof __e&&(__e=t)}),I=M.version,F=function(e){return'object'==typeof e?null!==e:'function'==typeof e},j=function(e){if(!F(e))throw TypeError(e+' is not an object!');return e},C=function(e){try{return!!e()}catch(t){return!0}},D=!C(function(){return 7!=Object.defineProperty({},'a',{get:function(){return 7}}).a}),N=x.document,U=F(N)&&F(N.createElement),w=function(e){return U?N.createElement(e):{}},G=!D&&!C(function(){return 7!=Object.defineProperty(w('div'),'a',{get:function(){return 7}}).a}),$=function(e,t){if(!F(e))return e;var n,r;if(t&&'function'==typeof(n=e.toString)&&!F(r=n.call(e)))return r;if('function'==typeof(n=e.valueOf)&&!F(r=n.call(e)))return r;if(!t&&'function'==typeof(n=e.toString)&&!F(r=n.call(e)))return r;throw TypeError('Can\'t convert object to primitive value')},H=Object.defineProperty,Y=D?Object.defineProperty:function(e,t,n){if(j(e),t=$(t,!0),j(n),G)try{return H(e,t,n)}catch(t){}if('get'in n||'set'in n)throw TypeError('Accessors not supported!');return'value'in n&&(e[t]=n.value),e},z={f:Y},V=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},W=D?function(e,t,n){return z.f(e,t,V(1,n))}:function(e,t,n){return e[t]=n,e},B={}.hasOwnProperty,q=function(e,t){return B.call(e,t)},K=0,Z=Math.random(),X=function(e){return'Symbol('.concat(void 0===e?'':e,')_',(++K+Z).toString(36))},J=e(function(e){var t=X('src'),n='toString',r=Function[n],o=(''+r).split(n);M.inspectSource=function(e){return r.call(e)},(e.exports=function(e,n,r,i){var a='function'==typeof r;a&&(q(r,'name')||W(r,'name',n)),e[n]===r||(a&&(q(r,t)||W(r,t,e[n]?''+e[n]:o.join(n+''))),e===x?e[n]=r:i?e[n]?e[n]=r:W(e,n,r):(delete e[n],W(e,n,r)))})(Function.prototype,n,function(){return'function'==typeof this&&this[t]||r.call(this)})}),Q=function(e){if('function'!=typeof e)throw TypeError(e+' is not a function!');return e},ee=function(e,t,n){return(Q(e),void 0===t)?e:1===n?function(n){return e.call(t,n)}:2===n?function(n,r){return e.call(t,n,r)}:3===n?function(n,r,o){return e.call(t,n,r,o)}:function(){return e.apply(t,arguments)}},te='prototype',ne=function(e,t,n){var r,o,i,a,s=e&ne.F,l=e&ne.G,c=e&ne.S,u=e&ne.P,d=e&ne.B,g=l?x:c?x[t]||(x[t]={}):(x[t]||{})[te],m=l?M:M[t]||(M[t]={}),p=m[te]||(m[te]={});for(r in l&&(n=t),n)o=!s&&g&&void 0!==g[r],i=(o?g:n)[r],a=d&&o?ee(i,x):u&&'function'==typeof i?ee(Function.call,i):i,g&&J(g,r,i,e&ne.U),m[r]!=i&&W(m,r,a),u&&p[r]!=i&&(p[r]=i)};x.core=M,ne.F=1,ne.G=2,ne.S=4,ne.P=8,ne.B=16,ne.W=32,ne.U=64,ne.R=128;var re=ne,oe={}.toString,ie=function(e){return oe.call(e).slice(8,-1)},ae=Object('z').propertyIsEnumerable(0)?Object:function(e){return'String'==ie(e)?e.split(''):Object(e)},se=function(e){if(e==void 0)throw TypeError('Can\'t call method on  '+e);return e},le=function(e){return Object(se(e))},ce=function(e){return isNaN(e=+e)?0:(0<e?k:L)(e)},ue=function(e){return 0<e?b(ce(e),9007199254740991):0},de=Array.isArray||function(e){return'Array'==ie(e)},ge='__core-js_shared__',me=x[ge]||(x[ge]={}),pe=function(e){return me[e]||(me[e]={})},ye=e(function(e){var t=pe('wks'),n=x.Symbol,r='function'==typeof n,o=e.exports=function(e){return t[e]||(t[e]=r&&n[e]||(r?n:X)('Symbol.'+e))};o.store=t}),he=ye('species'),fe=function(e){var t;return de(e)&&(t=e.constructor,'function'==typeof t&&(t===Array||de(t.prototype))&&(t=void 0),F(t)&&(t=t[he],null===t&&(t=void 0))),void 0===t?Array:t},Ae=function(e,t){return new(fe(e))(t)},Se=function(e,t){var n=1==e,r=4==e,o=6==e,i=t||Ae;return function(t,a,s){for(var l,c,u=le(t),d=ae(u),g=ee(a,s,3),m=ue(d.length),p=0,y=n?i(t,m):2==e?i(t,0):void 0;m>p;p++)if((5==e||o||p in d)&&(l=d[p],c=g(l,p,u),e))if(n)y[p]=c;else if(c)switch(e){case 3:return!0;case 5:return l;case 6:return p;case 2:y.push(l);}else if(r)return!1;return o?-1:3==e||r?r:y}},_e=Se(4);re(re.P+re.F*!function(e,t){return!!e&&C(function(){t?e.call(null,function(){},1):e.call(null)})}([].every,!0),'Array',{every:function(e){return _e(this,e,arguments[1])}});var Pe=M.Array.every,ve=ye('unscopables'),Te=Array.prototype;Te[ve]==void 0&&W(Te,ve,{});var Ee=function(e){Te[ve][e]=!0},Oe=Se(6),Re='findIndex',be=!0;Re in[]&&[,][Re](function(){be=!1}),re(re.P+re.F*be,'Array',{findIndex:function(e){return Oe(this,e,1<arguments.length?arguments[1]:void 0)}}),Ee(Re);var ke=M.Array.findIndex,Le=Se(5),xe='find',Me=!0;xe in[]&&[,][xe](function(){Me=!1}),re(re.P+re.F*Me,'Array',{find:function(e){return Le(this,e,1<arguments.length?arguments[1]:void 0)}}),Ee(xe);var Ie=M.Array.find,Fe=function(e,t){return{value:t,done:!!e}},Ce={},je=function(e){return ae(se(e))},De=function(e,t){return e=ce(e),0>e?R(e+t,0):b(e,t)},Ne=pe('keys'),Ue=function(e){return Ne[e]||(Ne[e]=X(e))},we=function(e){return function(t,n,r){var o,i=je(t),a=ue(i.length),s=De(r,a);if(e&&n!=n){for(;a>s;)if(o=i[s++],o!=o)return!0;}else for(;a>s;s++)if((e||s in i)&&i[s]===n)return e||s||0;return!e&&-1}}(!1),Ge=Ue('IE_PROTO'),$e=function(e,t){var n,r=je(e),o=0,i=[];for(n in r)n!=Ge&&q(r,n)&&i.push(n);for(;t.length>o;)q(r,n=t[o++])&&(~we(i,n)||i.push(n));return i},He=['constructor','hasOwnProperty','isPrototypeOf','propertyIsEnumerable','toLocaleString','toString','valueOf'],Ye=Object.keys||function(e){return $e(e,He)},ze=D?Object.defineProperties:function(e,t){j(e);for(var n,r=Ye(t),o=r.length,a=0;o>a;)z.f(e,n=r[a++],t[n]);return e},Ve=x.document,We=Ve&&Ve.documentElement,Be=Ue('IE_PROTO'),qe=function(){},Ke='prototype',Ze=function(){var e,t=w('iframe'),n=He.length,r='<',o='>';for(t.style.display='none',We.appendChild(t),t.src='javascript:',e=t.contentWindow.document,e.open(),e.write(r+'script'+o+'document.F=Object'+r+'/script'+o),e.close(),Ze=e.F;n--;)delete Ze[Ke][He[n]];return Ze()},Xe=Object.create||function(e,t){var n;return null===e?n=Ze():(qe[Ke]=j(e),n=new qe,qe[Ke]=null,n[Be]=e),void 0===t?n:ze(n,t)},Je=z.f,Qe=ye('toStringTag'),et=function(e,t,n){e&&!q(e=n?e:e.prototype,Qe)&&Je(e,Qe,{configurable:!0,value:t})},tt={};W(tt,ye('iterator'),function(){return this});var nt=function(e,t,n){e.prototype=Xe(tt,{next:V(1,n)}),et(e,t+' Iterator')},rt=Ue('IE_PROTO'),ot=Object.prototype,it=Object.getPrototypeOf||function(e){return e=le(e),q(e,rt)?e[rt]:'function'==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?ot:null},at=ye('iterator'),st=!([].keys&&'next'in[].keys()),lt='keys',ct='values',ut=function(){return this},dt=function(e,t,n,r,o,i,a){nt(n,t,r);var s,l,c,u=function(e){return!st&&e in p?p[e]:e===lt?function(){return new n(this,e)}:e===ct?function(){return new n(this,e)}:function(){return new n(this,e)}},d=t+' Iterator',g=o==ct,m=!1,p=e.prototype,y=p[at]||p['@@iterator']||o&&p[o],h=y||u(o),f=o?g?u('entries'):h:void 0,A='Array'==t?p.entries||y:y;if(A&&(c=it(A.call(new e)),c!==Object.prototype&&c.next&&(et(c,d,!0),'function'!=typeof c[at]&&W(c,at,ut))),g&&y&&y.name!==ct&&(m=!0,h=function(){return y.call(this)}),(st||m||!p[at])&&W(p,at,h),Ce[t]=h,Ce[d]=ut,o)if(s={values:g?h:u(ct),keys:i?h:u(lt),entries:f},a)for(l in s)l in p||J(p,l,s[l]);else re(re.P+re.F*(st||m),t,s);return s},gt=dt(Array,'Array',function(e,t){this._t=je(e),this._i=0,this._k=t},function(){var e=this._t,t=this._k,n=this._i++;return!e||n>=e.length?(this._t=void 0,Fe(1)):'keys'==t?Fe(0,n):'values'==t?Fe(0,e[n]):Fe(0,[n,e[n]])},'values');Ce.Arguments=Ce.Array,Ee('keys'),Ee('values'),Ee('entries');var mt=M.Array.keys,pt=Object.getOwnPropertySymbols,yt={f:pt},ht={}.propertyIsEnumerable,ft={f:ht},At=Object.assign,St=!At||C(function(){var e={},t={},n=Symbol(),r='abcdefghijklmnopqrst';return e[n]=7,r.split('').forEach(function(e){t[e]=e}),7!=At({},e)[n]||Object.keys(At({},t)).join('')!=r})?function(e){for(var t=le(e),n=arguments.length,r=1,o=yt.f,i=ft.f;n>r;)for(var a,s=ae(arguments[r++]),l=o?Ye(s).concat(o(s)):Ye(s),c=l.length,u=0;c>u;)i.call(s,a=l[u++])&&(t[a]=s[a]);return t}:At;re(re.S+re.F,'Object',{assign:St});var _t=M.Object.assign,Pt=ft.f,vt=function(e){return function(t){for(var n,r=je(t),o=Ye(r),a=o.length,s=0,i=[];a>s;)Pt.call(r,n=o[s++])&&i.push(e?[n,r[n]]:r[n]);return i}}(!0);re(re.S,'Object',{entries:function(e){return vt(e)}});var Tt=M.Object.entries;re(re.S,'Number',{isInteger:function(e){return!F(e)&&isFinite(e)&&k(e)===e}});var Et=M.Number.isInteger;re(re.S,'Math',{sign:O||function(e){return 0==(e=+e)||e!=e?e:0>e?-1:1}});var Ot=M.Math.sign,Rt=ye('toStringTag'),bt='Arguments'==ie(function(){return arguments}()),kt=function(e,t){try{return e[t]}catch(t){}},Lt=function(e){var t,n,r;return e===void 0?'Undefined':null===e?'Null':'string'==typeof(n=kt(t=Object(e),Rt))?n:bt?ie(t):'Object'==(r=ie(t))&&'function'==typeof t.callee?'Arguments':r};({})[ye('toStringTag')]='z',J(Object.prototype,'toString',function(){return'[object '+Lt(this)+']'},!0);var xt=function(e){return function(t,n){var r,o,a=se(t)+'',s=ce(n),i=a.length;return 0>s||s>=i?e?'':void 0:(r=a.charCodeAt(s),55296>r||56319<r||s+1===i||56320>(o=a.charCodeAt(s+1))||57343<o?e?a.charAt(s):r:e?a.slice(s,s+2):(r-55296<<10)+(o-56320)+65536)}}(!0);dt(String,'String',function(e){this._t=e+'',this._i=0},function(){var e,t=this._t,n=this._i;return n>=t.length?{value:void 0,done:!0}:(e=xt(t,n),this._i+=e.length,{value:e,done:!1})});for(var Mt=ye('iterator'),It=ye('toStringTag'),Ft=Ce.Array,Ct={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},jt=Ye(Ct),Dt=0;Dt<jt.length;Dt++){var i,Nt=jt[Dt],Ut=Ct[Nt],wt=x[Nt],Gt=wt&&wt.prototype;if(Gt&&(Gt[Mt]||W(Gt,Mt,Ft),Gt[It]||W(Gt,It,Nt),Ce[Nt]=Ft,Ut))for(i in gt)Gt[i]||J(Gt,i,gt[i],!0)}var $t,Ht,Yt,zt=function(e,t,n,r){if(!(e instanceof t)||r!==void 0&&r in e)throw TypeError(n+': incorrect invocation!');return e},Vt=function(t,e,n,r){try{return r?e(j(n)[0],n[1]):e(n)}catch(n){var o=t['return'];throw void 0!==o&&j(o.call(t)),n}},Wt=ye('iterator'),Bt=Array.prototype,qt=function(e){return e!==void 0&&(Ce.Array===e||Bt[Wt]===e)},Kt=ye('iterator'),Zt=M.getIteratorMethod=function(e){if(e!=void 0)return e[Kt]||e['@@iterator']||Ce[Lt(e)]},Xt=e(function(e){var t={},n={},r=e.exports=function(e,r,o,i,a){var s,l,c,u,d=a?function(){return e}:Zt(e),g=ee(o,i,r?2:1),m=0;if('function'!=typeof d)throw TypeError(e+' is not iterable!');if(qt(d)){for(s=ue(e.length);s>m;m++)if(u=r?g(j(l=e[m])[0],l[1]):g(e[m]),u===t||u===n)return u;}else for(c=d.call(e);!(l=c.next()).done;)if(u=Vt(c,g,l.value,r),u===t||u===n)return u};r.BREAK=t,r.RETURN=n}),Jt=ye('species'),Qt=function(e,t){var n,r=j(e).constructor;return r===void 0||(n=j(r)[Jt])==void 0?t:Q(n)},en=function(e,t,n){var r=n===void 0;switch(t.length){case 0:return r?e():e.call(n);case 1:return r?e(t[0]):e.call(n,t[0]);case 2:return r?e(t[0],t[1]):e.call(n,t[0],t[1]);case 3:return r?e(t[0],t[1],t[2]):e.call(n,t[0],t[1],t[2]);case 4:return r?e(t[0],t[1],t[2],t[3]):e.call(n,t[0],t[1],t[2],t[3]);}return e.apply(n,t)},tn=x.process,nn=x.setImmediate,rn=x.clearImmediate,on=x.MessageChannel,an=x.Dispatch,sn=0,ln={},cn='onreadystatechange',un=function(){var e=+this;if(ln.hasOwnProperty(e)){var t=ln[e];delete ln[e],t()}},dn=function(e){un.call(e.data)};nn&&rn||(nn=function(e){for(var t=[],n=1;arguments.length>n;)t.push(arguments[n++]);return ln[++sn]=function(){en('function'==typeof e?e:Function(e),t)},$t(sn),sn},rn=function(e){delete ln[e]},'process'==ie(tn)?$t=function(e){tn.nextTick(ee(un,e,1))}:an&&an.now?$t=function(e){an.now(ee(un,e,1))}:on?(Ht=new on,Yt=Ht.port2,Ht.port1.onmessage=dn,$t=ee(Yt.postMessage,Yt,1)):x.addEventListener&&'function'==typeof postMessage&&!x.importScripts?($t=function(e){x.postMessage(e+'','*')},x.addEventListener('message',dn,!1)):cn in w('script')?$t=function(e){We.appendChild(w('script'))[cn]=function(){We.removeChild(this),un.call(e)}}:$t=function(e){setTimeout(ee(un,e,1),0)});var gn={set:nn,clear:rn},mn=gn.set,pn=x.MutationObserver||x.WebKitMutationObserver,yn=x.process,hn=x.Promise,An='process'==ie(yn),fn={f:function(e){return new t(e)}},Sn=function(e){try{return{e:!1,v:e()}}catch(t){return{e:!0,v:t}}},_n=function(e,t){if(j(e),F(t)&&t.constructor===e)return t;var n=fn.f(e),r=n.resolve;return r(t),n.promise},Pn=function(e,t,n){for(var r in t)J(e,r,t[r],n);return e},vn=ye('species'),Tn=ye('iterator'),En=!1;try{var On=[7][Tn]();On['return']=function(){En=!0}}catch(t){}var Rn,bn,kn,Ln,xn=function(e,t){if(!t&&!En)return!1;var n=!1;try{var r=[7],o=r[Tn]();o.next=function(){return{done:n=!0}},r[Tn]=function(){return o},e(r)}catch(t){}return n},Mn=gn.set,In=function(){var t,n,r,e=function(){var e,o;for(An&&(e=yn.domain)&&e.exit();t;){o=t.fn,t=t.next;try{o()}catch(o){throw t?r():n=void 0,o}}n=void 0,e&&e.enter()};if(An)r=function(){yn.nextTick(e)};else if(pn&&!(x.navigator&&x.navigator.standalone)){var o=!0,i=document.createTextNode('');new pn(e).observe(i,{characterData:!0}),r=function(){i.data=o=!o}}else if(hn&&hn.resolve){var a=hn.resolve();r=function(){a.then(e)}}else r=function(){mn.call(x,e)};return function(e){var o={fn:e,next:void 0};n&&(n.next=o),t||(t=o,r()),n=o}}(),Fn='Promise',Cn=x.TypeError,jn=x.process,Dn=x[Fn],Nn='process'==Lt(jn),Un=function(){},wn=bn=fn.f,Gn=!!function(){try{var e=Dn.resolve(1),t=(e.constructor={})[ye('species')]=function(e){e(Un,Un)};return(Nn||'function'==typeof PromiseRejectionEvent)&&e.then(Un)instanceof t}catch(t){}}(),$n=function(e){var t;return!!(F(e)&&'function'==typeof(t=e.then))&&t},Hn=function(e,t){if(!e._n){e._n=!0;var n=e._c;In(function(){for(var r=e._v,o=1==e._s,a=0,i=function(t){var n,i,a,s=o?t.ok:t.fail,l=t.resolve,c=t.reject,u=t.domain;try{s?(!o&&(2==e._h&&Vn(e),e._h=1),!0===s?n=r:(u&&u.enter(),n=s(r),u&&(u.exit(),a=!0)),n===t.promise?c(Cn('Promise-chain cycle')):(i=$n(n))?i.call(n,l,c):l(n)):c(r)}catch(t){u&&!a&&u.exit(),c(t)}};n.length>a;)i(n[a++]);e._c=[],e._n=!1,t&&!e._h&&Yn(e)})}},Yn=function(e){Mn.call(x,function(){var t,n,r,o=e._v,i=zn(e);if(i&&(t=Sn(function(){Nn?jn.emit('unhandledRejection',o,e):(n=x.onunhandledrejection)?n({promise:e,reason:o}):(r=x.console)&&r.error&&r.error('Unhandled promise rejection',o)}),e._h=Nn||zn(e)?2:1),e._a=void 0,i&&t.e)throw t.v})},zn=function(e){return 1!==e._h&&0===(e._a||e._c).length},Vn=function(e){Mn.call(x,function(){var t;Nn?jn.emit('rejectionHandled',e):(t=x.onrejectionhandled)&&t({promise:e,reason:e._v})})},Wn=function(e){var t=this;t._d||(t._d=!0,t=t._w||t,t._v=e,t._s=2,!t._a&&(t._a=t._c.slice()),Hn(t,!0))},Bn=function(e){var t,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===e)throw Cn('Promise can\'t be resolved itself');(t=$n(e))?In(function(){var r={_w:n,_d:!1};try{t.call(e,ee(Bn,r,1),ee(Wn,r,1))}catch(t){Wn.call(r,t)}}):(n._v=e,n._s=1,Hn(n,!1))}catch(t){Wn.call({_w:n,_d:!1},t)}}};Gn||(Dn=function(e){zt(this,Dn,Fn,'_h'),Q(e),Rn.call(this);try{e(ee(Bn,this,1),ee(Wn,this,1))}catch(e){Wn.call(this,e)}},Rn=function(){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},Rn.prototype=Pn(Dn.prototype,{then:function(e,t){var n=wn(Qt(this,Dn));return n.ok='function'!=typeof e||e,n.fail='function'==typeof t&&t,n.domain=Nn?jn.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&Hn(this,!1),n.promise},catch:function(e){return this.then(void 0,e)}}),kn=function(){var e=new Rn;this.promise=e,this.resolve=ee(Bn,e,1),this.reject=ee(Wn,e,1)},fn.f=wn=function(e){return e===Dn||e===Ln?new kn(e):bn(e)}),re(re.G+re.W+re.F*!Gn,{Promise:Dn}),et(Dn,Fn),function(e){var t=x[e];D&&t&&!t[vn]&&z.f(t,vn,{configurable:!0,get:function(){return this}})}(Fn),Ln=M[Fn],re(re.S+re.F*!Gn,Fn,{reject:function(e){var t=wn(this),n=t.reject;return n(e),t.promise}}),re(re.S+re.F*!Gn,Fn,{resolve:function(e){return _n(this,e)}}),re(re.S+re.F*!(Gn&&xn(function(e){Dn.all(e)['catch'](Un)})),Fn,{all:function(e){var t=this,n=wn(t),r=n.resolve,o=n.reject,i=Sn(function(){var n=[],i=0,a=1;Xt(e,!1,function(e){var s=i++,l=!1;n.push(void 0),a++,t.resolve(e).then(function(e){l||(l=!0,n[s]=e,--a||r(n))},o)}),--a||r(n)});return i.e&&o(i.v),n.promise},race:function(e){var t=this,n=wn(t),r=n.reject,o=Sn(function(){Xt(e,!1,function(e){t.resolve(e).then(n.resolve,r)})});return o.e&&r(o.v),n.promise}}),re(re.P+re.R,'Promise',{finally:function(t){var n=Qt(this,M.Promise||x.Promise),e='function'==typeof t;return this.then(e?function(e){return _n(n,t()).then(function(){return e})}:t,e?function(r){return _n(n,t()).then(function(){throw r})}:t)}}),re(re.S,'Promise',{try:function(e){var t=fn.f(this),n=Sn(e);return(n.e?t.reject:t.resolve)(n.v),t.promise}});var qn=M.Promise,Kn='function'==typeof Symbol&&'symbol'==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&'function'==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?'symbol':typeof e},Zn=p(),Xn=p(),Jn=Object.assign(function e(t){var n=Object.assign({},{amount:e.defaultAmount,currency:e.defaultCurrency,precision:e.defaultPrecision},t),r=n.amount,o=n.currency,i=n.precision;P(r),P(i);var a=e.globalLocale,s=e.globalFormat,l=e.globalRoundingMode,c=e.globalFormatRoundingMode,u=Object.assign({},e.globalExchangeRatesApi),d=function(t){var n=Object.assign({},Object.assign({},{amount:r,currency:o,precision:i},t),Object.assign({},{locale:this.locale},t));return Object.assign(e({amount:n.amount,currency:n.currency,precision:n.precision}),{locale:n.locale})},m=function(e){A(this.hasSameCurrency(e),new TypeError('You must provide a Dinero instance with the same currency.'))};return{getAmount:function(){return r},getCurrency:function(){return o},getLocale:function(){return this.locale||a},setLocale:function(e){return d.call(this,{locale:e})},getPrecision:function(){return i},convertPrecision:function(e){return P(e),d.call(this,{amount:Xn.multiply(this.getAmount(),v(10,Xn.subtract(e,this.getPrecision()))),precision:e})},add:function(t){m.call(this,t);var n=e.normalizePrecision([this,t]);return d.call(this,{amount:Xn.add(n[0].getAmount(),n[1].getAmount()),precision:n[0].getPrecision()})},subtract:function(t){m.call(this,t);var n=e.normalizePrecision([this,t]);return d.call(this,{amount:Xn.subtract(n[0].getAmount(),n[1].getAmount()),precision:n[0].getPrecision()})},multiply:function(e){var t=1<arguments.length&&arguments[1]!==void 0?arguments[1]:l;return d.call(this,{amount:Xn.round(Xn.multiply(this.getAmount(),e),t)})},divide:function(e){var t=1<arguments.length&&arguments[1]!==void 0?arguments[1]:l;return d.call(this,{amount:Xn.round(Xn.divide(this.getAmount(),e),t)})},percentage:function(e){return S(e),this.multiply(Xn.divide(e,100))},allocate:function(e){var t=this;_(e);for(var n=e.reduce(function(e,t){return Xn.add(e,t)}),r=this.getAmount(),o=e.map(function(e){var o=k(Xn.divide(Xn.multiply(t.getAmount(),e),n));return r=Xn.subtract(r,o),d.call(t,{amount:o})}),a=0;0<r;a++)o[a]=o[a].add(d.call(this,{amount:1})),r=Xn.subtract(r,1);return o},convert:function(e,t){var n=this;return t=Object.assign({},u,t),h(t).getExchangeRate(this.getCurrency(),e).then(function(r){return A(!g(r),new TypeError('No rate was found for the destination currency "'+e+'".')),d.call(n,{amount:Xn.round(Xn.multiply(n.getAmount(),parseFloat(r)),t.roundingMode),currency:e})})},equalsTo:function(e){return this.hasSameAmount(e)&&this.hasSameCurrency(e)},lessThan:function(t){m.call(this,t);var n=e.normalizePrecision([this,t]);return n[0].getAmount()<n[1].getAmount()},lessThanOrEqual:function(t){m.call(this,t);var n=e.normalizePrecision([this,t]);return n[0].getAmount()<=n[1].getAmount()},greaterThan:function(t){m.call(this,t);var n=e.normalizePrecision([this,t]);return n[0].getAmount()>n[1].getAmount()},greaterThanOrEqual:function(t){m.call(this,t);var n=e.normalizePrecision([this,t]);return n[0].getAmount()>=n[1].getAmount()},isZero:function(){return 0===this.getAmount()},isPositive:function(){return 0<=this.getAmount()},isNegative:function(){return 0>this.getAmount()},hasSubUnits:function(){return 0!==Xn.modulo(this.getAmount(),v(10,i))},hasCents:function(){return 0!==Xn.modulo(this.getAmount(),v(10,i))},hasSameCurrency:function(e){return this.getCurrency()===e.getCurrency()},hasSameAmount:function(t){var n=e.normalizePrecision([this,t]);return n[0].getAmount()===n[1].getAmount()},toFormat:function(){var e=0<arguments.length&&arguments[0]!==void 0?arguments[0]:s,t=1<arguments.length&&arguments[1]!==void 0?arguments[1]:c,n=y(e);return this.toRoundedUnit(n.getMinimumFractionDigits(),t).toLocaleString(this.getLocale(),{currencyDisplay:n.getCurrencyDisplay(),useGrouping:n.getUseGrouping(),minimumFractionDigits:n.getMinimumFractionDigits(),style:n.getStyle(),currency:this.getCurrency()})},toUnit:function(){return Xn.divide(this.getAmount(),v(10,i))},toRoundedUnit:function(e){var t=1<arguments.length&&arguments[1]!==void 0?arguments[1]:c,n=v(10,e);return Xn.divide(Xn.round(Xn.multiply(this.toUnit(),n),t),n)},toObject:function(){return{amount:r,currency:o,precision:i}}}},{defaultAmount:0,defaultCurrency:'USD',defaultPrecision:2},{globalLocale:'en-US',globalFormat:'$0,0.00',globalRoundingMode:'HALF_EVEN',globalFormatRoundingMode:'HALF_AWAY_FROM_ZERO',globalExchangeRatesApi:{endpoint:void 0,headers:void 0,propertyPath:void 0}},{normalizePrecision:function(e){var t=e.reduce(function(e,t){return R(e.getPrecision(),t.getPrecision())});return e.map(function(e){return e.getPrecision()===t?e:e.convertPrecision(t)})}});return Jn});
  