cloudevents
Version:
CloudEvents SDK for JavaScript
1 lines • 113 kB
JavaScript
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("cloudevents",[],t):"object"==typeof exports?exports.cloudevents=t():e.cloudevents=t()}(self,(()=>(()=>{var e={41:(e,t,r)=>{"use strict";var n=r(3036),o=r(8068),i=r(9675),a=r(5795);e.exports=function(e,t,r){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new i("`obj` must be an object or a function`");if("string"!=typeof t&&"symbol"!=typeof t)throw new i("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new i("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new i("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new i("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new i("`loose`, if provided, must be a boolean");var s=arguments.length>3?arguments[3]:null,u=arguments.length>4?arguments[4]:null,f=arguments.length>5?arguments[5]:null,c=arguments.length>6&&arguments[6],l=!!a&&a(e,t);if(n)n(e,t,{configurable:null===f&&l?l.configurable:!f,enumerable:null===s&&l?l.enumerable:!s,value:r,writable:null===u&&l?l.writable:!u});else{if(!c&&(s||u||f))throw new o("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");e[t]=r}}},76:e=>{"use strict";e.exports=Function.prototype.call},414:e=>{"use strict";e.exports=Math.round},453:(e,t,r)=>{"use strict";var n,o=r(9612),i=r(9383),a=r(1237),s=r(9290),u=r(9538),f=r(8068),c=r(9675),l=r(5345),p=r(1514),d=r(8968),y=r(6188),h=r(8002),E=r(5880),T=r(414),g=r(3093),v=Function,m=function(e){try{return v('"use strict"; return ('+e+").constructor;")()}catch(e){}},A=r(5795),b=r(3036),S=function(){throw new c},_=A?function(){try{return S}catch(e){try{return A(arguments,"callee").get}catch(e){return S}}}():S,O=r(4039)(),w=r(3628),C=r(1064),N=r(8648),R=r(1002),P=r(76),I={},j="undefined"!=typeof Uint8Array&&w?w(Uint8Array):n,U={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":O&&w?w([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":I,"%AsyncGenerator%":I,"%AsyncGeneratorFunction%":I,"%AsyncIteratorPrototype%":I,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?n:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?n:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":i,"%eval%":eval,"%EvalError%":a,"%Float16Array%":"undefined"==typeof Float16Array?n:Float16Array,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":v,"%GeneratorFunction%":I,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":O&&w?w(w([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&O&&w?w((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":o,"%Object.getOwnPropertyDescriptor%":A,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":s,"%ReferenceError%":u,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&O&&w?w((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":O&&w?w(""[Symbol.iterator]()):n,"%Symbol%":O?Symbol:n,"%SyntaxError%":f,"%ThrowTypeError%":_,"%TypedArray%":j,"%TypeError%":c,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":l,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet,"%Function.prototype.call%":P,"%Function.prototype.apply%":R,"%Object.defineProperty%":b,"%Object.getPrototypeOf%":C,"%Math.abs%":p,"%Math.floor%":d,"%Math.max%":y,"%Math.min%":h,"%Math.pow%":E,"%Math.round%":T,"%Math.sign%":g,"%Reflect.getPrototypeOf%":N};if(w)try{null.error}catch(e){var D=w(w(e));U["%Error.prototype%"]=D}var B=function e(t){var r;if("%AsyncFunction%"===t)r=m("async function () {}");else if("%GeneratorFunction%"===t)r=m("function* () {}");else if("%AsyncGeneratorFunction%"===t)r=m("async function* () {}");else if("%AsyncGenerator%"===t){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===t){var o=e("%AsyncGenerator%");o&&w&&(r=w(o.prototype))}return U[t]=r,r},M={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},x=r(6743),F=r(9957),H=x.call(P,Array.prototype.concat),L=x.call(R,Array.prototype.splice),k=x.call(P,String.prototype.replace),z=x.call(P,String.prototype.slice),$=x.call(P,RegExp.prototype.exec),V=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Y=/\\(\\)?/g,J=function(e,t){var r,n=e;if(F(M,n)&&(n="%"+(r=M[n])[0]+"%"),F(U,n)){var o=U[n];if(o===I&&(o=B(n)),void 0===o&&!t)throw new c("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:o}}throw new f("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new c("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new c('"allowMissing" argument must be a boolean');if(null===$(/^%?[^%]*%?$/,e))throw new f("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(e){var t=z(e,0,1),r=z(e,-1);if("%"===t&&"%"!==r)throw new f("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==t)throw new f("invalid intrinsic syntax, expected opening `%`");var n=[];return k(e,V,(function(e,t,r,o){n[n.length]=r?k(o,Y,"$1"):t||e})),n}(e),n=r.length>0?r[0]:"",o=J("%"+n+"%",t),i=o.name,a=o.value,s=!1,u=o.alias;u&&(n=u[0],L(r,H([0,1],u)));for(var l=1,p=!0;l<r.length;l+=1){var d=r[l],y=z(d,0,1),h=z(d,-1);if(('"'===y||"'"===y||"`"===y||'"'===h||"'"===h||"`"===h)&&y!==h)throw new f("property names with quotes must have matching quotes");if("constructor"!==d&&p||(s=!0),F(U,i="%"+(n+="."+d)+"%"))a=U[i];else if(null!=a){if(!(d in a)){if(!t)throw new c("base intrinsic for "+e+" exists, but the property is not available.");return}if(A&&l+1>=r.length){var E=A(a,d);a=(p=!!E)&&"get"in E&&!("originalValue"in E.get)?E.get:a[d]}else p=F(a,d),a=a[d];p&&!s&&(U[i]=a)}}return a}},487:(e,t,r)=>{"use strict";var n=r(6897),o=r(3036),i=r(3126),a=r(2205);e.exports=function(e){var t=i(arguments),r=e.length-(arguments.length-1);return n(t,1+(r>0?r:0),!0)},o?o(e.exports,"apply",{value:a}):e.exports.apply=a},537:(e,t,r)=>{var n=r(5606),o=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),r={},n=0;n<t.length;n++)r[t[n]]=Object.getOwnPropertyDescriptor(e,t[n]);return r},i=/%[sdj%]/g;t.format=function(e){if(!v(e)){for(var t=[],r=0;r<arguments.length;r++)t.push(f(arguments[r]));return t.join(" ")}r=1;for(var n=arguments,o=n.length,a=String(e).replace(i,(function(e){if("%%"===e)return"%";if(r>=o)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}})),s=n[r];r<o;s=n[++r])T(s)||!b(s)?a+=" "+s:a+=" "+f(s);return a},t.deprecate=function(e,r){if(void 0!==n&&!0===n.noDeprecation)return e;if(void 0===n)return function(){return t.deprecate(e,r).apply(this,arguments)};var o=!1;return function(){if(!o){if(n.throwDeprecation)throw new Error(r);n.traceDeprecation?console.trace(r):console.error(r),o=!0}return e.apply(this,arguments)}};var a={},s=/^$/;if(n.env.NODE_DEBUG){var u=n.env.NODE_DEBUG;u=u.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),s=new RegExp("^"+u+"$","i")}function f(e,r){var n={seen:[],stylize:l};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),E(r)?n.showHidden=r:r&&t._extend(n,r),m(n.showHidden)&&(n.showHidden=!1),m(n.depth)&&(n.depth=2),m(n.colors)&&(n.colors=!1),m(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=c),p(n,e,n.depth)}function c(e,t){var r=f.styles[t];return r?"["+f.colors[r][0]+"m"+e+"["+f.colors[r][1]+"m":e}function l(e,t){return e}function p(e,r,n){if(e.customInspect&&r&&O(r.inspect)&&r.inspect!==t.inspect&&(!r.constructor||r.constructor.prototype!==r)){var o=r.inspect(n,e);return v(o)||(o=p(e,o,n)),o}var i=function(e,t){if(m(t))return e.stylize("undefined","undefined");if(v(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}return g(t)?e.stylize(""+t,"number"):E(t)?e.stylize(""+t,"boolean"):T(t)?e.stylize("null","null"):void 0}(e,r);if(i)return i;var a=Object.keys(r),s=function(e){var t={};return e.forEach((function(e,r){t[e]=!0})),t}(a);if(e.showHidden&&(a=Object.getOwnPropertyNames(r)),_(r)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return d(r);if(0===a.length){if(O(r)){var u=r.name?": "+r.name:"";return e.stylize("[Function"+u+"]","special")}if(A(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(S(r))return e.stylize(Date.prototype.toString.call(r),"date");if(_(r))return d(r)}var f,c="",l=!1,b=["{","}"];return h(r)&&(l=!0,b=["[","]"]),O(r)&&(c=" [Function"+(r.name?": "+r.name:"")+"]"),A(r)&&(c=" "+RegExp.prototype.toString.call(r)),S(r)&&(c=" "+Date.prototype.toUTCString.call(r)),_(r)&&(c=" "+d(r)),0!==a.length||l&&0!=r.length?n<0?A(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),f=l?function(e,t,r,n,o){for(var i=[],a=0,s=t.length;a<s;++a)R(t,String(a))?i.push(y(e,t,r,n,String(a),!0)):i.push("");return o.forEach((function(o){o.match(/^\d+$/)||i.push(y(e,t,r,n,o,!0))})),i}(e,r,n,s,a):a.map((function(t){return y(e,r,n,s,t,l)})),e.seen.pop(),function(e,t,r){return e.reduce((function(e,t){return t.indexOf("\n"),e+t.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60?r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]}(f,c,b)):b[0]+c+b[1]}function d(e){return"["+Error.prototype.toString.call(e)+"]"}function y(e,t,r,n,o,i){var a,s,u;if((u=Object.getOwnPropertyDescriptor(t,o)||{value:t[o]}).get?s=u.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):u.set&&(s=e.stylize("[Setter]","special")),R(n,o)||(a="["+o+"]"),s||(e.seen.indexOf(u.value)<0?(s=T(r)?p(e,u.value,null):p(e,u.value,r-1)).indexOf("\n")>-1&&(s=i?s.split("\n").map((function(e){return" "+e})).join("\n").slice(2):"\n"+s.split("\n").map((function(e){return" "+e})).join("\n")):s=e.stylize("[Circular]","special")),m(a)){if(i&&o.match(/^\d+$/))return s;(a=JSON.stringify(""+o)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.slice(1,-1),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+s}function h(e){return Array.isArray(e)}function E(e){return"boolean"==typeof e}function T(e){return null===e}function g(e){return"number"==typeof e}function v(e){return"string"==typeof e}function m(e){return void 0===e}function A(e){return b(e)&&"[object RegExp]"===w(e)}function b(e){return"object"==typeof e&&null!==e}function S(e){return b(e)&&"[object Date]"===w(e)}function _(e){return b(e)&&("[object Error]"===w(e)||e instanceof Error)}function O(e){return"function"==typeof e}function w(e){return Object.prototype.toString.call(e)}function C(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(e){if(e=e.toUpperCase(),!a[e])if(s.test(e)){var r=n.pid;a[e]=function(){var n=t.format.apply(t,arguments);console.error("%s %d: %s",e,r,n)}}else a[e]=function(){};return a[e]},t.inspect=f,f.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},f.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.types=r(9032),t.isArray=h,t.isBoolean=E,t.isNull=T,t.isNullOrUndefined=function(e){return null==e},t.isNumber=g,t.isString=v,t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=m,t.isRegExp=A,t.types.isRegExp=A,t.isObject=b,t.isDate=S,t.types.isDate=S,t.isError=_,t.types.isNativeError=_,t.isFunction=O,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=r(1135);var N=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function R(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){var e,r;console.log("%s - %s",(r=[C((e=new Date).getHours()),C(e.getMinutes()),C(e.getSeconds())].join(":"),[e.getDate(),N[e.getMonth()],r].join(" ")),t.format.apply(t,arguments))},t.inherits=r(6698),t._extend=function(e,t){if(!t||!b(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e};var P="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function I(e,t){if(!e){var r=new Error("Promise was rejected with a falsy value");r.reason=e,e=r}return t(e)}t.promisify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(P&&e[P]){var t;if("function"!=typeof(t=e[P]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,P,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,r,n=new Promise((function(e,n){t=e,r=n})),o=[],i=0;i<arguments.length;i++)o.push(arguments[i]);o.push((function(e,n){e?r(e):t(n)}));try{e.apply(this,o)}catch(e){r(e)}return n}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),P&&Object.defineProperty(t,P,{value:t,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(t,o(e))},t.promisify.custom=P,t.callbackify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');function t(){for(var t=[],r=0;r<arguments.length;r++)t.push(arguments[r]);var o=t.pop();if("function"!=typeof o)throw new TypeError("The last argument must be of type Function");var i=this,a=function(){return o.apply(i,arguments)};e.apply(this,t).then((function(e){n.nextTick(a.bind(null,null,e))}),(function(e){n.nextTick(I.bind(null,e,a))}))}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),Object.defineProperties(t,o(e)),t}},592:(e,t,r)=>{"use strict";var n=r(3036),o=function(){return!!n};o.hasArrayLengthDefineBug=function(){if(!n)return null;try{return 1!==n([],"length",{value:1}).length}catch(e){return!0}},e.exports=o},611:(e,t,r)=>{"use strict";var n;r.r(t),r.d(t,{NIL:()=>P,parse:()=>E,stringify:()=>c,v1:()=>h,v3:()=>O,v4:()=>w,v5:()=>R,validate:()=>s,version:()=>I});var o=new Uint8Array(16);function i(){if(!n&&!(n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return n(o)}const a=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,s=function(e){return"string"==typeof e&&a.test(e)};for(var u=[],f=0;f<256;++f)u.push((f+256).toString(16).substr(1));const c=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=(u[e[t+0]]+u[e[t+1]]+u[e[t+2]]+u[e[t+3]]+"-"+u[e[t+4]]+u[e[t+5]]+"-"+u[e[t+6]]+u[e[t+7]]+"-"+u[e[t+8]]+u[e[t+9]]+"-"+u[e[t+10]]+u[e[t+11]]+u[e[t+12]]+u[e[t+13]]+u[e[t+14]]+u[e[t+15]]).toLowerCase();if(!s(r))throw TypeError("Stringified UUID is invalid");return r};var l,p,d=0,y=0;const h=function(e,t,r){var n=t&&r||0,o=t||new Array(16),a=(e=e||{}).node||l,s=void 0!==e.clockseq?e.clockseq:p;if(null==a||null==s){var u=e.random||(e.rng||i)();null==a&&(a=l=[1|u[0],u[1],u[2],u[3],u[4],u[5]]),null==s&&(s=p=16383&(u[6]<<8|u[7]))}var f=void 0!==e.msecs?e.msecs:Date.now(),h=void 0!==e.nsecs?e.nsecs:y+1,E=f-d+(h-y)/1e4;if(E<0&&void 0===e.clockseq&&(s=s+1&16383),(E<0||f>d)&&void 0===e.nsecs&&(h=0),h>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");d=f,y=h,p=s;var T=(1e4*(268435455&(f+=122192928e5))+h)%4294967296;o[n++]=T>>>24&255,o[n++]=T>>>16&255,o[n++]=T>>>8&255,o[n++]=255&T;var g=f/4294967296*1e4&268435455;o[n++]=g>>>8&255,o[n++]=255&g,o[n++]=g>>>24&15|16,o[n++]=g>>>16&255,o[n++]=s>>>8|128,o[n++]=255&s;for(var v=0;v<6;++v)o[n+v]=a[v];return t||c(o)},E=function(e){if(!s(e))throw TypeError("Invalid UUID");var t,r=new Uint8Array(16);return r[0]=(t=parseInt(e.slice(0,8),16))>>>24,r[1]=t>>>16&255,r[2]=t>>>8&255,r[3]=255&t,r[4]=(t=parseInt(e.slice(9,13),16))>>>8,r[5]=255&t,r[6]=(t=parseInt(e.slice(14,18),16))>>>8,r[7]=255&t,r[8]=(t=parseInt(e.slice(19,23),16))>>>8,r[9]=255&t,r[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,r[11]=t/4294967296&255,r[12]=t>>>24&255,r[13]=t>>>16&255,r[14]=t>>>8&255,r[15]=255&t,r};function T(e,t,r){function n(e,n,o,i){if("string"==typeof e&&(e=function(e){e=unescape(encodeURIComponent(e));for(var t=[],r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}(e)),"string"==typeof n&&(n=E(n)),16!==n.length)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");var a=new Uint8Array(16+e.length);if(a.set(n),a.set(e,n.length),(a=r(a))[6]=15&a[6]|t,a[8]=63&a[8]|128,o){i=i||0;for(var s=0;s<16;++s)o[i+s]=a[s];return o}return c(a)}try{n.name=e}catch(e){}return n.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",n.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",n}function g(e){return 14+(e+64>>>9<<4)+1}function v(e,t){var r=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(r>>16)<<16|65535&r}function m(e,t,r,n,o,i){return v((a=v(v(t,e),v(n,i)))<<(s=o)|a>>>32-s,r);var a,s}function A(e,t,r,n,o,i,a){return m(t&r|~t&n,e,t,o,i,a)}function b(e,t,r,n,o,i,a){return m(t&n|r&~n,e,t,o,i,a)}function S(e,t,r,n,o,i,a){return m(t^r^n,e,t,o,i,a)}function _(e,t,r,n,o,i,a){return m(r^(t|~n),e,t,o,i,a)}const O=T("v3",48,(function(e){if("string"==typeof e){var t=unescape(encodeURIComponent(e));e=new Uint8Array(t.length);for(var r=0;r<t.length;++r)e[r]=t.charCodeAt(r)}return function(e){for(var t=[],r=32*e.length,n="0123456789abcdef",o=0;o<r;o+=8){var i=e[o>>5]>>>o%32&255,a=parseInt(n.charAt(i>>>4&15)+n.charAt(15&i),16);t.push(a)}return t}(function(e,t){e[t>>5]|=128<<t%32,e[g(t)-1]=t;for(var r=1732584193,n=-271733879,o=-1732584194,i=271733878,a=0;a<e.length;a+=16){var s=r,u=n,f=o,c=i;r=A(r,n,o,i,e[a],7,-680876936),i=A(i,r,n,o,e[a+1],12,-389564586),o=A(o,i,r,n,e[a+2],17,606105819),n=A(n,o,i,r,e[a+3],22,-1044525330),r=A(r,n,o,i,e[a+4],7,-176418897),i=A(i,r,n,o,e[a+5],12,1200080426),o=A(o,i,r,n,e[a+6],17,-1473231341),n=A(n,o,i,r,e[a+7],22,-45705983),r=A(r,n,o,i,e[a+8],7,1770035416),i=A(i,r,n,o,e[a+9],12,-1958414417),o=A(o,i,r,n,e[a+10],17,-42063),n=A(n,o,i,r,e[a+11],22,-1990404162),r=A(r,n,o,i,e[a+12],7,1804603682),i=A(i,r,n,o,e[a+13],12,-40341101),o=A(o,i,r,n,e[a+14],17,-1502002290),r=b(r,n=A(n,o,i,r,e[a+15],22,1236535329),o,i,e[a+1],5,-165796510),i=b(i,r,n,o,e[a+6],9,-1069501632),o=b(o,i,r,n,e[a+11],14,643717713),n=b(n,o,i,r,e[a],20,-373897302),r=b(r,n,o,i,e[a+5],5,-701558691),i=b(i,r,n,o,e[a+10],9,38016083),o=b(o,i,r,n,e[a+15],14,-660478335),n=b(n,o,i,r,e[a+4],20,-405537848),r=b(r,n,o,i,e[a+9],5,568446438),i=b(i,r,n,o,e[a+14],9,-1019803690),o=b(o,i,r,n,e[a+3],14,-187363961),n=b(n,o,i,r,e[a+8],20,1163531501),r=b(r,n,o,i,e[a+13],5,-1444681467),i=b(i,r,n,o,e[a+2],9,-51403784),o=b(o,i,r,n,e[a+7],14,1735328473),r=S(r,n=b(n,o,i,r,e[a+12],20,-1926607734),o,i,e[a+5],4,-378558),i=S(i,r,n,o,e[a+8],11,-2022574463),o=S(o,i,r,n,e[a+11],16,1839030562),n=S(n,o,i,r,e[a+14],23,-35309556),r=S(r,n,o,i,e[a+1],4,-1530992060),i=S(i,r,n,o,e[a+4],11,1272893353),o=S(o,i,r,n,e[a+7],16,-155497632),n=S(n,o,i,r,e[a+10],23,-1094730640),r=S(r,n,o,i,e[a+13],4,681279174),i=S(i,r,n,o,e[a],11,-358537222),o=S(o,i,r,n,e[a+3],16,-722521979),n=S(n,o,i,r,e[a+6],23,76029189),r=S(r,n,o,i,e[a+9],4,-640364487),i=S(i,r,n,o,e[a+12],11,-421815835),o=S(o,i,r,n,e[a+15],16,530742520),r=_(r,n=S(n,o,i,r,e[a+2],23,-995338651),o,i,e[a],6,-198630844),i=_(i,r,n,o,e[a+7],10,1126891415),o=_(o,i,r,n,e[a+14],15,-1416354905),n=_(n,o,i,r,e[a+5],21,-57434055),r=_(r,n,o,i,e[a+12],6,1700485571),i=_(i,r,n,o,e[a+3],10,-1894986606),o=_(o,i,r,n,e[a+10],15,-1051523),n=_(n,o,i,r,e[a+1],21,-2054922799),r=_(r,n,o,i,e[a+8],6,1873313359),i=_(i,r,n,o,e[a+15],10,-30611744),o=_(o,i,r,n,e[a+6],15,-1560198380),n=_(n,o,i,r,e[a+13],21,1309151649),r=_(r,n,o,i,e[a+4],6,-145523070),i=_(i,r,n,o,e[a+11],10,-1120210379),o=_(o,i,r,n,e[a+2],15,718787259),n=_(n,o,i,r,e[a+9],21,-343485551),r=v(r,s),n=v(n,u),o=v(o,f),i=v(i,c)}return[r,n,o,i]}(function(e){if(0===e.length)return[];for(var t=8*e.length,r=new Uint32Array(g(t)),n=0;n<t;n+=8)r[n>>5]|=(255&e[n/8])<<n%32;return r}(e),8*e.length))})),w=function(e,t,r){var n=(e=e||{}).random||(e.rng||i)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){r=r||0;for(var o=0;o<16;++o)t[r+o]=n[o];return t}return c(n)};function C(e,t,r,n){switch(e){case 0:return t&r^~t&n;case 1:case 3:return t^r^n;case 2:return t&r^t&n^r&n}}function N(e,t){return e<<t|e>>>32-t}const R=T("v5",80,(function(e){var t=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof e){var n=unescape(encodeURIComponent(e));e=[];for(var o=0;o<n.length;++o)e.push(n.charCodeAt(o))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);for(var i=e.length/4+2,a=Math.ceil(i/16),s=new Array(a),u=0;u<a;++u){for(var f=new Uint32Array(16),c=0;c<16;++c)f[c]=e[64*u+4*c]<<24|e[64*u+4*c+1]<<16|e[64*u+4*c+2]<<8|e[64*u+4*c+3];s[u]=f}s[a-1][14]=8*(e.length-1)/Math.pow(2,32),s[a-1][14]=Math.floor(s[a-1][14]),s[a-1][15]=8*(e.length-1)&4294967295;for(var l=0;l<a;++l){for(var p=new Uint32Array(80),d=0;d<16;++d)p[d]=s[l][d];for(var y=16;y<80;++y)p[y]=N(p[y-3]^p[y-8]^p[y-14]^p[y-16],1);for(var h=r[0],E=r[1],T=r[2],g=r[3],v=r[4],m=0;m<80;++m){var A=Math.floor(m/20),b=N(h,5)+C(A,E,T,g)+v+t[A]+p[m]>>>0;v=g,g=T,T=N(E,30)>>>0,E=h,h=b}r[0]=r[0]+h>>>0,r[1]=r[1]+E>>>0,r[2]=r[2]+T>>>0,r[3]=r[3]+g>>>0,r[4]=r[4]+v>>>0}return[r[0]>>24&255,r[0]>>16&255,r[0]>>8&255,255&r[0],r[1]>>24&255,r[1]>>16&255,r[1]>>8&255,255&r[1],r[2]>>24&255,r[2]>>16&255,r[2]>>8&255,255&r[2],r[3]>>24&255,r[3]>>16&255,r[3]>>8&255,255&r[3],r[4]>>24&255,r[4]>>16&255,r[4]>>8&255,255&r[4]]})),P="00000000-0000-0000-0000-000000000000",I=function(e){if(!s(e))throw TypeError("Invalid UUID");return parseInt(e.substr(14,1),16)}},655:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HTTP=void 0;const n=r(537),o=r(5054),i=r(5649),a=r(2302),s=r(7802);function u(e){const t=(0,i.sanitize)(e.headers),r=function(e){const t=e[o.CONSTANTS.HEADER_CONTENT_TYPE];if(t){if(t.startsWith(o.CONSTANTS.MIME_CE_BATCH))return o.Mode.BATCH;if(t.startsWith(o.CONSTANTS.MIME_CE))return o.Mode.STRUCTURED}if(e[o.CONSTANTS.CE_HEADERS.ID])return o.Mode.BINARY;throw new a.ValidationError("no cloud event detected")}(t),n=function(e,t,r){if(e!==o.Mode.BINARY)return"string"==typeof r?JSON.parse(r).specversion:r.specversion;{const e=t[o.CONSTANTS.CE_HEADERS.SPEC_VERSION];if(e)return e}return o.V1}(r,t,e.body);switch(r){case o.Mode.BINARY:return function(e,t){const r=Object.assign({},e.headers);let n=e.body;if(!r)throw new a.ValidationError("headers is null or undefined");const u=(0,i.sanitize)(r),f={},c=t===o.V03?i.v03binaryParsers:i.v1binaryParsers;for(const e in c)if(u[e]){const t=c[e];f[t.name]=t.parser.parse(u[e]),delete u[e],delete r[e]}for(const e in r)e.startsWith(o.CONSTANTS.EXTENSIONS_PREFIX)&&(f[e.substring(o.CONSTANTS.EXTENSIONS_PREFIX.length)]=r[e]);const l=s.parserByContentType[f.datacontenttype];return l&&n&&(n=l.parse(n)),f.datacontenttype===o.CONSTANTS.MIME_JSON&&f.datacontentencoding===o.CONSTANTS.ENCODING_BASE64&&delete f.datacontentencoding,new o.CloudEvent(Object.assign(Object.assign({},f),{data:n}),!1)}(e,n);case o.Mode.STRUCTURED:return function(e,t){const r=e.body,n=e.headers;if(!r)throw new a.ValidationError("payload is null or undefined");if(!n)throw new a.ValidationError("headers is null or undefined");(0,a.isStringOrObjectOrThrow)(r,new a.ValidationError("payload must be an object or a string"));const u=(0,i.sanitize)(n),f=u[o.CONSTANTS.HEADER_CONTENT_TYPE],c=f?s.parserByContentType[f]:new s.JSONParser;if(!c)throw new a.ValidationError(`invalid content type ${u[o.CONSTANTS.HEADER_CONTENT_TYPE]}`);const l=Object.assign({},c.parse(r)),p={},d=t===o.V03?i.v03structuredParsers:i.v1structuredParsers;for(const e in d){const t=l[e];if(t){const r=d[e];p[r.name]=r.parser.parse(t)}delete l[e]}for(const e in l)p[e]=l[e];if(p.data_base64||p.datacontentencoding===o.CONSTANTS.ENCODING_BASE64){const e=p.data_base64||p.data;p.data=new Uint32Array(Buffer.from(e,"base64")),delete p.data_base64,delete p.datacontentencoding}return new o.CloudEvent(p,!1)}(e,n);case o.Mode.BATCH:return function(e){const t=[];return JSON.parse(e.body).forEach((e=>{t.push(new o.CloudEvent(e))})),t}(e);default:throw new a.ValidationError("Unknown Message mode")}}t.HTTP={binary:function(e){const t={[o.CONSTANTS.HEADER_CONTENT_TYPE]:o.CONSTANTS.DEFAULT_CONTENT_TYPE},r=Object.assign(Object.assign({},t),(0,i.headersFor)(e));let a=e.data;return"object"!=typeof e.data||n.types.isTypedArray(e.data)||(a=JSON.stringify(e.data)),{headers:r,body:a}},structured:function(e){return e.data_base64&&(e=e.cloneWith({data:void 0})),{headers:{[o.CONSTANTS.HEADER_CONTENT_TYPE]:o.CONSTANTS.DEFAULT_CE_CONTENT_TYPE},body:e.toString()}},toEvent:u,isEvent:function(e){try{return u(e),!0}catch(e){return!1}}}},1002:e=>{"use strict";e.exports=Function.prototype.apply},1013:(e,t,r)=>{var n=r(7372).stringify,o=r(8146);e.exports=function(e){return{parse:o(e),stringify:n}},e.exports.parse=o(),e.exports.stringify=n},1026:()=>{},1064:(e,t,r)=>{"use strict";var n=r(9612);e.exports=n.getPrototypeOf||null},1135:e=>{e.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},1237:e=>{"use strict";e.exports=EvalError},1301:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.headersFor=t.HEADER_MAP=t.KAFKA_CE_HEADERS=void 0;const n=r(5054);t.KAFKA_CE_HEADERS=Object.freeze({ID:"ce_id",TYPE:"ce_type",SOURCE:"ce_source",SPEC_VERSION:"ce_specversion",TIME:"ce_time",SUBJECT:"ce_subject",DATACONTENTTYPE:"ce_datacontenttype",DATASCHEMA:"ce_dataschema"}),t.HEADER_MAP={[t.KAFKA_CE_HEADERS.ID]:"id",[t.KAFKA_CE_HEADERS.TYPE]:"type",[t.KAFKA_CE_HEADERS.SOURCE]:"source",[t.KAFKA_CE_HEADERS.SPEC_VERSION]:"specversion",[t.KAFKA_CE_HEADERS.TIME]:"time",[t.KAFKA_CE_HEADERS.SUBJECT]:"subject",[t.KAFKA_CE_HEADERS.DATACONTENTTYPE]:"datacontenttype",[t.KAFKA_CE_HEADERS.DATASCHEMA]:"dataschema"},t.headersFor=function(e){const t={};return Object.getOwnPropertyNames(e).forEach((r=>{r!=n.CONSTANTS.CE_ATTRIBUTES.DATA&&r!=n.CONSTANTS.STRUCTURED_ATTRS_1.DATA_BASE64&&(t[`ce_${r}`]=e[r])})),t}},1333:e=>{"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),r=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(var n in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var o=Object.getOwnPropertySymbols(e);if(1!==o.length||o[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(e,t);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},1514:e=>{"use strict";e.exports=Math.abs},1594:function(e,t,r){var n;!function(){"use strict";var o,i=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,a=Math.ceil,s=Math.floor,u="[BigNumber Error] ",f=u+"Number primitive has more than 15 significant digits: ",c=1e14,l=14,p=9007199254740991,d=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],y=1e7,h=1e9;function E(e){var t=0|e;return e>0||e===t?t:t-1}function T(e){for(var t,r,n=1,o=e.length,i=e[0]+"";n<o;){for(t=e[n++]+"",r=l-t.length;r--;t="0"+t);i+=t}for(o=i.length;48===i.charCodeAt(--o););return i.slice(0,o+1||1)}function g(e,t){var r,n,o=e.c,i=t.c,a=e.s,s=t.s,u=e.e,f=t.e;if(!a||!s)return null;if(r=o&&!o[0],n=i&&!i[0],r||n)return r?n?0:-s:a;if(a!=s)return a;if(r=a<0,n=u==f,!o||!i)return n?0:!o^r?1:-1;if(!n)return u>f^r?1:-1;for(s=(u=o.length)<(f=i.length)?u:f,a=0;a<s;a++)if(o[a]!=i[a])return o[a]>i[a]^r?1:-1;return u==f?0:u>f^r?1:-1}function v(e,t,r,n){if(e<t||e>r||e!==s(e))throw Error(u+(n||"Argument")+("number"==typeof e?e<t||e>r?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function m(e){var t=e.c.length-1;return E(e.e/l)==t&&e.c[t]%2!=0}function A(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function b(e,t,r){var n,o;if(t<0){for(o=r+".";++t;o+=r);e=o+e}else if(++t>(n=e.length)){for(o=r,t-=n;--t;o+=r);e+=o}else t<n&&(e=e.slice(0,t)+"."+e.slice(t));return e}o=function e(t){var r,n,o,S,_,O,w,C,N,R,P=V.prototype={constructor:V,toString:null,valueOf:null},I=new V(1),j=20,U=4,D=-7,B=21,M=-1e7,x=1e7,F=!1,H=1,L=0,k={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},z="0123456789abcdefghijklmnopqrstuvwxyz",$=!0;function V(e,t){var r,a,u,c,d,y,h,E,T=this;if(!(T instanceof V))return new V(e,t);if(null==t){if(e&&!0===e._isBigNumber)return T.s=e.s,void(!e.c||e.e>x?T.c=T.e=null:e.e<M?T.c=[T.e=0]:(T.e=e.e,T.c=e.c.slice()));if((y="number"==typeof e)&&0*e==0){if(T.s=1/e<0?(e=-e,-1):1,e===~~e){for(c=0,d=e;d>=10;d/=10,c++);return void(c>x?T.c=T.e=null:(T.e=c,T.c=[e]))}E=String(e)}else{if(!i.test(E=String(e)))return o(T,E,y);T.s=45==E.charCodeAt(0)?(E=E.slice(1),-1):1}(c=E.indexOf("."))>-1&&(E=E.replace(".","")),(d=E.search(/e/i))>0?(c<0&&(c=d),c+=+E.slice(d+1),E=E.substring(0,d)):c<0&&(c=E.length)}else{if(v(t,2,z.length,"Base"),10==t&&$)return W(T=new V(e),j+T.e+1,U);if(E=String(e),y="number"==typeof e){if(0*e!=0)return o(T,E,y,t);if(T.s=1/e<0?(E=E.slice(1),-1):1,V.DEBUG&&E.replace(/^0\.0*|\./,"").length>15)throw Error(f+e)}else T.s=45===E.charCodeAt(0)?(E=E.slice(1),-1):1;for(r=z.slice(0,t),c=d=0,h=E.length;d<h;d++)if(r.indexOf(a=E.charAt(d))<0){if("."==a){if(d>c){c=h;continue}}else if(!u&&(E==E.toUpperCase()&&(E=E.toLowerCase())||E==E.toLowerCase()&&(E=E.toUpperCase()))){u=!0,d=-1,c=0;continue}return o(T,String(e),y,t)}y=!1,(c=(E=n(E,t,10,T.s)).indexOf("."))>-1?E=E.replace(".",""):c=E.length}for(d=0;48===E.charCodeAt(d);d++);for(h=E.length;48===E.charCodeAt(--h););if(E=E.slice(d,++h)){if(h-=d,y&&V.DEBUG&&h>15&&(e>p||e!==s(e)))throw Error(f+T.s*e);if((c=c-d-1)>x)T.c=T.e=null;else if(c<M)T.c=[T.e=0];else{if(T.e=c,T.c=[],d=(c+1)%l,c<0&&(d+=l),d<h){for(d&&T.c.push(+E.slice(0,d)),h-=l;d<h;)T.c.push(+E.slice(d,d+=l));d=l-(E=E.slice(d)).length}else d-=h;for(;d--;E+="0");T.c.push(+E)}}else T.c=[T.e=0]}function Y(e,t,r,n){var o,i,a,s,u;if(null==r?r=U:v(r,0,8),!e.c)return e.toString();if(o=e.c[0],a=e.e,null==t)u=T(e.c),u=1==n||2==n&&(a<=D||a>=B)?A(u,a):b(u,a,"0");else if(i=(e=W(new V(e),t,r)).e,s=(u=T(e.c)).length,1==n||2==n&&(t<=i||i<=D)){for(;s<t;u+="0",s++);u=A(u,i)}else if(t-=a,u=b(u,i,"0"),i+1>s){if(--t>0)for(u+=".";t--;u+="0");}else if((t+=i-s)>0)for(i+1==s&&(u+=".");t--;u+="0");return e.s<0&&o?"-"+u:u}function J(e,t){for(var r,n,o=1,i=new V(e[0]);o<e.length;o++)(!(n=new V(e[o])).s||(r=g(i,n))===t||0===r&&i.s===t)&&(i=n);return i}function G(e,t,r){for(var n=1,o=t.length;!t[--o];t.pop());for(o=t[0];o>=10;o/=10,n++);return(r=n+r*l-1)>x?e.c=e.e=null:r<M?e.c=[e.e=0]:(e.e=r,e.c=t),e}function W(e,t,r,n){var o,i,u,f,p,y,h,E=e.c,T=d;if(E){e:{for(o=1,f=E[0];f>=10;f/=10,o++);if((i=t-o)<0)i+=l,u=t,p=E[y=0],h=s(p/T[o-u-1]%10);else if((y=a((i+1)/l))>=E.length){if(!n)break e;for(;E.length<=y;E.push(0));p=h=0,o=1,u=(i%=l)-l+1}else{for(p=f=E[y],o=1;f>=10;f/=10,o++);h=(u=(i%=l)-l+o)<0?0:s(p/T[o-u-1]%10)}if(n=n||t<0||null!=E[y+1]||(u<0?p:p%T[o-u-1]),n=r<4?(h||n)&&(0==r||r==(e.s<0?3:2)):h>5||5==h&&(4==r||n||6==r&&(i>0?u>0?p/T[o-u]:0:E[y-1])%10&1||r==(e.s<0?8:7)),t<1||!E[0])return E.length=0,n?(t-=e.e+1,E[0]=T[(l-t%l)%l],e.e=-t||0):E[0]=e.e=0,e;if(0==i?(E.length=y,f=1,y--):(E.length=y+1,f=T[l-i],E[y]=u>0?s(p/T[o-u]%T[u])*f:0),n)for(;;){if(0==y){for(i=1,u=E[0];u>=10;u/=10,i++);for(u=E[0]+=f,f=1;u>=10;u/=10,f++);i!=f&&(e.e++,E[0]==c&&(E[0]=1));break}if(E[y]+=f,E[y]!=c)break;E[y--]=0,f=1}for(i=E.length;0===E[--i];E.pop());}e.e>x?e.c=e.e=null:e.e<M&&(e.c=[e.e=0])}return e}function K(e){var t,r=e.e;return null===r?e.toString():(t=T(e.c),t=r<=D||r>=B?A(t,r):b(t,r,"0"),e.s<0?"-"+t:t)}return V.clone=e,V.ROUND_UP=0,V.ROUND_DOWN=1,V.ROUND_CEIL=2,V.ROUND_FLOOR=3,V.ROUND_HALF_UP=4,V.ROUND_HALF_DOWN=5,V.ROUND_HALF_EVEN=6,V.ROUND_HALF_CEIL=7,V.ROUND_HALF_FLOOR=8,V.EUCLID=9,V.config=V.set=function(e){var t,r;if(null!=e){if("object"!=typeof e)throw Error(u+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(v(r=e[t],0,h,t),j=r),e.hasOwnProperty(t="ROUNDING_MODE")&&(v(r=e[t],0,8,t),U=r),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((r=e[t])&&r.pop?(v(r[0],-h,0,t),v(r[1],0,h,t),D=r[0],B=r[1]):(v(r,-h,h,t),D=-(B=r<0?-r:r))),e.hasOwnProperty(t="RANGE"))if((r=e[t])&&r.pop)v(r[0],-h,-1,t),v(r[1],1,h,t),M=r[0],x=r[1];else{if(v(r,-h,h,t),!r)throw Error(u+t+" cannot be zero: "+r);M=-(x=r<0?-r:r)}if(e.hasOwnProperty(t="CRYPTO")){if((r=e[t])!==!!r)throw Error(u+t+" not true or false: "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw F=!r,Error(u+"crypto unavailable");F=r}else F=r}if(e.hasOwnProperty(t="MODULO_MODE")&&(v(r=e[t],0,9,t),H=r),e.hasOwnProperty(t="POW_PRECISION")&&(v(r=e[t],0,h,t),L=r),e.hasOwnProperty(t="FORMAT")){if("object"!=typeof(r=e[t]))throw Error(u+t+" not an object: "+r);k=r}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(r=e[t])||/^.?$|[+\-.\s]|(.).*\1/.test(r))throw Error(u+t+" invalid: "+r);$="0123456789"==r.slice(0,10),z=r}}return{DECIMAL_PLACES:j,ROUNDING_MODE:U,EXPONENTIAL_AT:[D,B],RANGE:[M,x],CRYPTO:F,MODULO_MODE:H,POW_PRECISION:L,FORMAT:k,ALPHABET:z}},V.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!V.DEBUG)return!0;var t,r,n=e.c,o=e.e,i=e.s;e:if("[object Array]"=={}.toString.call(n)){if((1===i||-1===i)&&o>=-h&&o<=h&&o===s(o)){if(0===n[0]){if(0===o&&1===n.length)return!0;break e}if((t=(o+1)%l)<1&&(t+=l),String(n[0]).length==t){for(t=0;t<n.length;t++)if((r=n[t])<0||r>=c||r!==s(r))break e;if(0!==r)return!0}}}else if(null===n&&null===o&&(null===i||1===i||-1===i))return!0;throw Error(u+"Invalid BigNumber: "+e)},V.maximum=V.max=function(){return J(arguments,-1)},V.minimum=V.min=function(){return J(arguments,1)},V.random=(S=9007199254740992,_=Math.random()*S&2097151?function(){return s(Math.random()*S)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,r,n,o,i,f=0,c=[],p=new V(I);if(null==e?e=j:v(e,0,h),o=a(e/l),F)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(o*=2));f<o;)(i=131072*t[f]+(t[f+1]>>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),t[f]=r[0],t[f+1]=r[1]):(c.push(i%1e14),f+=2);f=o/2}else{if(!crypto.randomBytes)throw F=!1,Error(u+"crypto unavailable");for(t=crypto.randomBytes(o*=7);f<o;)(i=281474976710656*(31&t[f])+1099511627776*t[f+1]+4294967296*t[f+2]+16777216*t[f+3]+(t[f+4]<<16)+(t[f+5]<<8)+t[f+6])>=9e15?crypto.randomBytes(7).copy(t,f):(c.push(i%1e14),f+=7);f=o/7}if(!F)for(;f<o;)(i=_())<9e15&&(c[f++]=i%1e14);for(o=c[--f],e%=l,o&&e&&(i=d[l-e],c[f]=s(o/i)*i);0===c[f];c.pop(),f--);if(f<0)c=[n=0];else{for(n=-1;0===c[0];c.splice(0,1),n-=l);for(f=1,i=c[0];i>=10;i/=10,f++);f<l&&(n-=l-f)}return p.e=n,p.c=c,p}),V.sum=function(){for(var e=1,t=arguments,r=new V(t[0]);e<t.length;)r=r.plus(t[e++]);return r},n=function(){var e="0123456789";function t(e,t,r,n){for(var o,i,a=[0],s=0,u=e.length;s<u;){for(i=a.length;i--;a[i]*=t);for(a[0]+=n.indexOf(e.charAt(s++)),o=0;o<a.length;o++)a[o]>r-1&&(null==a[o+1]&&(a[o+1]=0),a[o+1]+=a[o]/r|0,a[o]%=r)}return a.reverse()}return function(n,o,i,a,s){var u,f,c,l,p,d,y,h,E=n.indexOf("."),g=j,v=U;for(E>=0&&(l=L,L=0,n=n.replace(".",""),d=(h=new V(o)).pow(n.length-E),L=l,h.c=t(b(T(d.c),d.e,"0"),10,i,e),h.e=h.c.length),c=l=(y=t(n,o,i,s?(u=z,e):(u=e,z))).length;0==y[--l];y.pop());if(!y[0])return u.charAt(0);if(E<0?--c:(d.c=y,d.e=c,d.s=a,y=(d=r(d,h,g,v,i)).c,p=d.r,c=d.e),E=y[f=c+g+1],l=i/2,p=p||f<0||null!=y[f+1],p=v<4?(null!=E||p)&&(0==v||v==(d.s<0?3:2)):E>l||E==l&&(4==v||p||6==v&&1&y[f-1]||v==(d.s<0?8:7)),f<1||!y[0])n=p?b(u.charAt(1),-g,u.charAt(0)):u.charAt(0);else{if(y.length=f,p)for(--i;++y[--f]>i;)y[f]=0,f||(++c,y=[1].concat(y));for(l=y.length;!y[--l];);for(E=0,n="";E<=l;n+=u.charAt(y[E++]));n=b(n,c,u.charAt(0))}return n}}(),r=function(){function e(e,t,r){var n,o,i,a,s=0,u=e.length,f=t%y,c=t/y|0;for(e=e.slice();u--;)s=((o=f*(i=e[u]%y)+(n=c*i+(a=e[u]/y|0)*f)%y*y+s)/r|0)+(n/y|0)+c*a,e[u]=o%r;return s&&(e=[s].concat(e)),e}function t(e,t,r,n){var o,i;if(r!=n)i=r>n?1:-1;else for(o=i=0;o<r;o++)if(e[o]!=t[o]){i=e[o]>t[o]?1:-1;break}return i}function r(e,t,r,n){for(var o=0;r--;)e[r]-=o,o=e[r]<t[r]?1:0,e[r]=o*n+e[r]-t[r];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(n,o,i,a,u){var f,p,d,y,h,T,g,v,m,A,b,S,_,O,w,C,N,R=n.s==o.s?1:-1,P=n.c,I=o.c;if(!(P&&P[0]&&I&&I[0]))return new V(n.s&&o.s&&(P?!I||P[0]!=I[0]:I)?P&&0==P[0]||!I?0*R:R/0:NaN);for(m=(v=new V(R)).c=[],R=i+(p=n.e-o.e)+1,u||(u=c,p=E(n.e/l)-E(o.e/l),R=R/l|0),d=0;I[d]==(P[d]||0);d++);if(I[d]>(P[d]||0)&&p--,R<0)m.push(1),y=!0;else{for(O=P.length,C=I.length,d=0,R+=2,(h=s(u/(I[0]+1)))>1&&(I=e(I,h,u),P=e(P,h,u),C=I.length,O=P.length),_=C,b=(A=P.slice(0,C)).length;b<C;A[b++]=0);N=I.slice(),N=[0].concat(N),w=I[0],I[1]>=u/2&&w++;do{if(h=0,(f=t(I,A,C,b))<0){if(S=A[0],C!=b&&(S=S*u+(A[1]||0)),(h=s(S/w))>1)for(h>=u&&(h=u-1),g=(T=e(I,h,u)).length,b=A.length;1==t(T,A,g,b);)h--,r(T,C<g?N:I,g,u),g=T.length,f=1;else 0==h&&(f=h=1),g=(T=I.slice()).length;if(g<b&&(T=[0].concat(T)),r(A,T,b,u),b=A.length,-1==f)for(;t(I,A,C,b)<1;)h++,r(A,C<b?N:I,b,u),b=A.length}else 0===f&&(h++,A=[0]);m[d++]=h,A[0]?A[b++]=P[_]||0:(A=[P[_]],b=1)}while((_++<O||null!=A[0])&&R--);y=null!=A[0],m[0]||m.splice(0,1)}if(u==c){for(d=1,R=m[0];R>=10;R/=10,d++);W(v,i+(v.e=d+p*l-1)+1,a,y)}else v.e=p,v.r=+y;return v}}(),O=/^(-?)0([xbo])(?=\w[\w.]*$)/i,w=/^([^.]+)\.$/,C=/^\.([^.]+)$/,N=/^-?(Infinity|NaN)$/,R=/^\s*\+(?=[\w.])|^\s+|\s+$/g,o=function(e,t,r,n){var o,i=r?t:t.replace(R,"");if(N.test(i))e.s=isNaN(i)?null:i<0?-1:1;else{if(!r&&(i=i.replace(O,(function(e,t,r){return o="x"==(r=r.toLowerCase())?16:"b"==r?2:8,n&&n!=o?e:t})),n&&(o=n,i=i.replace(w,"$1").replace(C,"0.$1")),t!=i))return new V(i,o);if(V.DEBUG)throw Error(u+"Not a"+(n?" base "+n:"")+" number: "+t);e.s=null}e.c=e.e=null},P.absoluteValue=P.abs=function(){var e=new V(this);return e.s<0&&(e.s=1),e},P.comparedTo=function(e,t){return g(this,new V(e,t))},P.decimalPlaces=P.dp=function(e,t){var r,n,o,i=this;if(null!=e)return v(e,0,h),null==t?t=U:v(t,0,8),W(new V(i),e+i.e+1,t);if(!(r=i.c))return null;if(n=((o=r.length-1)-E(this.e/l))*l,o=r[o])for(;o%10==0;o/=10,n--);return n<0&&(n=0),n},P.dividedBy=P.div=function(e,t){return r(this,new V(e,t),j,U)},P.dividedToIntegerBy=P.idiv=function(e,t){return r(this,new V(e,t),0,1)},P.exponentiatedBy=P.pow=function(e,t){var r,n,o,i,f,c,p,d,y=this;if((e=new V(e)).c&&!e.isInteger())throw Error(u+"Exponent not an integer: "+K(e));if(null!=t&&(t=new V(t)),f=e.e>14,!y.c||!y.c[0]||1==y.c[0]&&!y.e&&1==y.c.length||!e.c||!e.c[0])return d=new V(Math.pow(+K(y),f?e.s*(2-m(e)):+K(e))),t?d.mod(t):d;if(c=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new V(NaN);(n=!c&&y.isInteger()&&t.isInteger())&&(y=y.mod(t))}else{if(e.e>9&&(y.e>0||y.e<-1||(0==y.e?y.c[0]>1||f&&y.c[1]>=24e7:y.c[0]<8e13||f&&y.c[0]<=9999975e7)))return i=y.s<0&&m(e)?-0:0,y.e>-1&&(i=1/i),new V(c?1/i:i);L&&(i=a(L/l+2))}for(f?(r=new V(.5),c&&(e.s=1),p=m(e)):p=(o=Math.abs(+K(e)))%2,d=new V(I);;){if(p){if(!(d=d.times(y)).c)break;i?d.c.length>i&&(d.c.length=i):n&&(d=d.mod(t))}if(o){if(0===(o=s(o/2)))break;p=o%2}else if(W(e=e.times(r),e.e+1,1),e.e>14)p=m(e);else{if(0===(o=+K(e)))break;p=o%2}y=y.times(y),i?y.c&&y.c.length>i&&(y.c.length=i):n&&(y=y.mod(t))}return n?d:(c&&(d=I.div(d)),t?d.mod(t):i?W(d,L,U,void 0):d)},P.integerValue=function(e){var t=new V(this);return null==e?e=U:v(e,0,8),W(t,t.e+1,e)},P.isEqualTo=P.eq=function(e,t){return 0===g(this,new V(e,t))},P.isFinite=function(){return!!this.c},P.isGreaterThan=P.gt=function(e,t){return g(this,new V(e,t))>0},P.isGreaterThanOrEqualTo=P.gte=function(e,t){return 1===(t=g(this,new V(e,t)))||0===t},P.isInteger=function(){return!!this.c&&E(this.e/l)>this.c.length-2},P.isLessThan=P.lt=function(e,t){return g(this,new V(e,t))<0},P.isLessThanOrEqualTo=P.lte=function(e,t){return-1===(t=g(this,new V(e,t)))||0===t},P.isNaN=function(){return!this.s},P.isNegative=function(){return this.s<0},P.isPositive=function(){return this.s>0},P.isZero=function(){return!!this.c&&0==this.c[0]},P.minus=function(e,t){var r,n,o,i,a=this,s=a.s;if(t=(e=new V(e,t)).s,!s||!t)return new V(NaN);if(s!=t)return e.s=-t,a.plus(e);var u=a.e/l,f=e.e/l,p=a.c,d=e.c;if(!u||!f){if(!p||!d)return p?(e.s=-t,e):new V(d?a:NaN);if(!p[0]||!d[0])return d[0]?(e.s=-t,e):new V(p[0]?a:3==U?-0:0)}if(u=E(u),f=E(f),p=p.slice(),s=u-f){for((i=s<0)?(s=-s,o=p):(f=u,o=d),o.reverse(),t=s;t--;o.push(0));o.reverse()}else for(n=(i=(s=p.length)<(t=d.length))?s:t,s=t=0;t<n;t++)if(p[t]!=d[t]){i=p[t]<d[t];break}if(i&&(o=p,p=d,d=o,e.s=-e.s),(t=(n=d.length)-(r=p.length))>0)for(;t--;p[r++]=0);for(t=c-1;n>s;){if(p[--n]<d[n]){for(r=n;r&&!p[--r];p[r]=t);--p[r],p[n]+=c}p[n]-=d[n]}for(;0==p[0];p.splice(0,1),--f);return p[0]?G(e,p,f):(e.s=3==U?-1:1,e.c=[e.e=0],e)},P.modulo=P.mod=function(e,t){var n,o,i=this;return e=new V(e,t),!i.c||!e.s||e.c&&!e.c[0]?new V(NaN):!e.c||i.c&&!i.c[0]?new V(i):(9==H?(o=e.s,e.s=1,n=r(i,e,0,3),e.s=o,n.s*=o):n=r(i,e,0,H),(e=i.minus(n.times(e))).c[0]||1!=H||(e.s=i.s),e)},P.multipliedBy=P.times=function(e,t){var r,n,o,i,a,s,u,f,p,d,h,T,g,v,m,A=this,b=A.c,S=(e=new V(e,t)).c;if(!(b&&S&&b[0]&&S[0]))return!A.s||!e.s||b&&!b[0]&&!S||S&&!S[0]&&!b?e.c=e.e=e.s=null:(e.s*=A.s,b&&S?(e.c=[0],e.e=0):e.c=e.e=null),e;for(n=E(A.e/l)+E(e.e/l),e.s*=A.s,(u=b.length)<(d=S.length)&&(g=b,b=S,S=g,o=u,u=d,d=o),o=u+d,g=[];o--;g.push(0));for(v=c,m=y,o=d;--o>=0;){for(r=0,h=S[o]%m,T=S[o]/m|0,i=o+(a=u);i>o;)r=((f=h*(f=b[--a]%m)+(s=T*f+(p=b[a]/m|0)*h)%m*m+g[i]+r)/v|0)+(s/m|0)+T*p,g[i--]=f%v;g[i]=r}return r?++n:g.splice(0,1),G(e,g,n)},P.negated=function(){var e=new V(this);return e.s=-e.s||null,e},P.plus=function(e,t){var r,n=this,o=n.s;if(t=(e=new V(e,t)).s,!o||!t)return new V(NaN);if(o!=t)return e.s=-t,n.minus(e);var i=n.e/l,a=e.e/l,s=n.c,u=e.c;if(!i||!a){if(!s||!u)return new V(o/0);if(!s[0]||!u[0])return u[0]?e:new V(s[0]?n:0*o)}if(i=E(i),a=E(a),s=s.slice(),o=i-a){for(o>0?(a=i,r=u):(o=-o,r=s),r.reverse();o--;r.push(0));r.reverse()}for((o=s.length)-(t=u.length)<0&&(r=u,u=s,s=r,t=o),o=0;t;)o=(s[--t]=s[t]+u[t]+o)/c|0,s[t]=c===s[t]?0:s[t]%c;return o&&(s=[o].concat(s),++a),G(e,s,a)},P.precision=P.sd=function(e,t){var r,n,o,i=this;if(null!=e&&e!==!!e)return v(e,1,h),null==t?t=U:v(t,0,8),W(new V(i),e,t);if(!(r=i.c))return null;if(n=(o=r.length-1)*l+1,o=r[o]){for(;o%10==0;o/=10,n--);for(o=r[0];o>=10;o/=10,n++);}return e&&i.e+1>n&&(n=i.e+1),n},P.shiftedBy=function(e){return v(e,-9007199254740991,p),this.times("1e"+e)},P.squareRoot=P.sqrt=function(){var e,t,n,o,i,a=this,s=a.c,u=a.s,f=a.e,c=j+4,l=new V("0.5");if(1!==u||!s||!s[0])return new V(!u||u<0&&(!s||s[0])?NaN:s?a:1/0);if(0==(u=Math.sqrt(+K(a)))||u==1/0?(((t=T(s)).length+f)%2==0&&(t+="0"),u=Math.sqrt(+t),f=E((f+1)/2)-(f<0||f%2),n=new V(t=u==1/0?"5e"+f:(t=u.toExponential()).slice(0,t.indexOf("e")+1)+f)):n=new V(u+""),n.c[0])for((u=(f=n.e)+c)<3&&(u=0);;)if(i=n,n=l.times(i.plus(r(a,i,c,1))),T(i.c).slice(0,u)===(t=T(n.c)).slice(0,u)){if(n.e<f&&--u,"9999"!=(t=t.slice(u-3,u+1))&&(o||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(W(n,n.e+j+2,1),e=!n.times(n).eq(a));break}if(!o&&(W(i,i.e+j+2,0),i.times(i).eq(a))){n=i;break}c+=4,u+=4,o=1}return W(n,n.e+j+1,U,e)},P.toExponential=function(e,t){return null!=e&&(v(e,0,h),e++),Y(this,e,t,1)},P.toFixed=function(e,t){return null!=e&&(v(e,0,h),e=e+this.e+1),Y(this,e,t)},P.toFormat=function(e,t,r){var n,o=this;if(null==r)null!=e&&t&&"object"==typeof t?(r=t,t=null):e&&"object"==typeof e?(r=e,e=t=null):r=k;else if("object"!=typeof r)throw Error(u+"Argument not an object: "+r);if(n=o.toFixed(e,t),o.c){var i,a=n.split("."),s=+r.groupSize,f=+r.secondaryGroupSize,c=r.groupSeparator||"",l=a[0],p=a[1],d=o.s<0,y=d?l.slice(1):l,h=y.length;if(f&&(i=s,s=f,f=i,h-=i),s>0&&h>0){for(i=h%s||s,l=y.substr(0,i);i<h;i+=s)l+=c+y.substr(i,s);f>0&&(l+=c+y.slice(i)),d&&(l="-"+l)}n=p?l+(r.decimalSeparator||"")+((f=+r.fractionGroupSize)?p.replace(new RegExp("\\d{"+f+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):p):l}return(r.prefix||"")+n+(r.suffix||"")},P.toFraction=function(e){var t,n,o,i,a,s,f,c,p,y,h,E,g=this,v=g.c;if(null!=e&&(!(f=new V(e)).isInteger()&&(f.c||1!==f.s)||f.lt(I)))throw Error(u+"Argument "+(f.isInteger()?"out of range: ":"not an integer: ")+K(f));if(!v)return new V(g);for(t=new V(I),p=n=new V(I),o=c=new V(I),E=T(v),a=t.e=E.length-g.e-1,t.c[0]=d[(s=a%l)<0?l+s:s],e=!e||f.comparedTo(t)>0?a>0?t:p:f,s=x,x=1/0,f=new V(E),c.c[0]=0;y=r(f,t,0,1),1!=(i=n.plus(y.times(o))).comparedTo(e);)n=o,o=i,p=c.plus(y.times(i=p)),c=i,t=f.minus(y.times(i=t)),f=i;return i=r(e.minus(n),o,0,1),c=c.plus(i.times(p)),n=n.plus(i.times(o)),c.s=p.s=g.s,h=r(p,o,a*=2,U).minus(g).abs().comparedTo(r(c,n,a,U).minus(g).abs())<1?[p,o]:[c,n],x=s,h},P.toNumber=function(){return+K(this)},P.toPrecision=function(e,t){return null!=e&&v(e,1,h),Y(this,e,t,2)},P.toString=function(e){var t,r=this,o=r.s,i=r.e;return null===i?o?(t="Infinity",o<0&&(t="-"+t)):t="NaN":(null==e?t=i<=D||i>=B?A(T(r.c),i):b(T(r.c),i,"0"):10===e&&$?t=b(T((r=W(new V(r),j+i+1,U)).c),r.e,"0"):(v(e,2,z.length,"Base"),t=n(b(T(r.c),i,"0"),10,e,o,!0)),o<0&&r.c[0]&&(t="-"+t)),t},P.valueOf=P.toJSON=function(){return K(this)},P._isBigNumber=!0,n