-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmod.js
4 lines (4 loc) · 93.8 KB
/
mod.js
1
2
3
4
// Copyright (c) 2023 The Stdlib Authors. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0
/// <reference types="./mod.d.ts" />
var t=Object.prototype.hasOwnProperty;function e(e,r){return null!=e&&t.call(e,r)}var r="function"==typeof Symbol&&"symbol"==typeof Symbol("foo");function n(){return r&&"symbol"==typeof Symbol.toStringTag}var i=Object.prototype.toString;var o="function"==typeof Symbol?Symbol.toStringTag:"";var a=n()?function(t){var r,n,a;if(null==t)return i.call(t);n=t[o],r=e(t,o);try{t[o]=void 0}catch(e){return i.call(t)}return a=i.call(t),r?t[o]=n:delete t[o],a}:function(t){return i.call(t)};var u=Array.isArray?Array.isArray:function(t){return"[object Array]"===a(t)};function f(t){return"object"==typeof t&&null!==t&&!u(t)}var s=/./,l="function"==typeof Object.defineProperty?Object.defineProperty:null;var c,h=Object.defineProperty,p=Object.prototype,g=p.toString,y=p.__defineGetter__,m=p.__defineSetter__,d=p.__lookupGetter__,w=p.__lookupSetter__;c=function(){try{return l({},"x",{}),!0}catch(t){return!1}}()?h:function(t,e,r){var n,i,o,a;if("object"!=typeof t||null===t||"[object Array]"===g.call(t))throw new TypeError("invalid argument. First argument must be an object. Value: `"+t+"`.");if("object"!=typeof r||null===r||"[object Array]"===g.call(r))throw new TypeError("invalid argument. Property descriptor must be an object. Value: `"+r+"`.");if((i="value"in r)&&(d.call(t,e)||w.call(t,e)?(n=t.__proto__,t.__proto__=p,delete t[e],t[e]=r.value,t.__proto__=n):t[e]=r.value),o="get"in r,a="set"in r,i&&(o||a))throw new Error("invalid argument. Cannot specify one or more accessors and a value or writable attribute in the property descriptor.");return o&&y&&y.call(t,e,r.get),a&&m&&m.call(t,e,r.set),t};var b=c;function v(t,e,r){b(t,e,{configurable:!1,enumerable:!1,writable:!1,value:r})}function _(t){return"boolean"==typeof t}var E=Boolean.prototype.toString;var A=n();function T(t){return"object"==typeof t&&(t instanceof Boolean||(A?function(t){try{return E.call(t),!0}catch(t){return!1}}(t):"[object Boolean]"===a(t)))}function x(t){return _(t)||T(t)}function R(){return new Function("return this;")()}v(x,"isPrimitive",_),v(x,"isObject",T);var O="object"==typeof self?self:null,j="object"==typeof window?window:null,I="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},S="object"==typeof I?I:null;function U(t){if(arguments.length){if(!_(t))throw new TypeError("invalid argument. Must provide a boolean primitive. Value: `"+t+"`.");if(t)return R()}if(O)return O;if(j)return j;if(S)return S;throw new Error("unexpected error. Unable to resolve global object.")}var L=U(),B=L.document&&L.document.childNodes,P=Int8Array;function V(){return/^\s*function\s*([^(]*)/i}var C=/^\s*function\s*([^(]*)/i;function M(t){return null!==t&&"object"==typeof t}v(V,"REGEXP",C);var k=function(t){if("function"!=typeof t)throw new TypeError("invalid argument. Must provide a function. Value: `"+t+"`.");return function(e){var r,n;if(!u(e))return!1;if(0===(r=e.length))return!1;for(n=0;n<r;n++)if(!1===t(e[n]))return!1;return!0}}(M);function N(t){return M(t)&&(t._isBuffer||t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t))}function Y(t){var e,r,n;if(("Object"===(r=a(t).slice(8,-1))||"Error"===r)&&t.constructor){if("string"==typeof(n=t.constructor).name)return n.name;if(e=C.exec(n.toString()))return e[1]}return N(t)?"Buffer":r}v(M,"isObjectLikeArray",k);var F="function"==typeof s||"object"==typeof P||"function"==typeof B?function(t){return Y(t).toLowerCase()}:function(t){var e;return null===t?"null":"object"===(e=typeof t)?Y(t).toLowerCase():e};function D(t){return"function"===F(t)}var W,G=Object.getPrototypeOf;W=D(Object.getPrototypeOf)?G:function(t){var e=function(t){return t.__proto__}(t);return e||null===e?e:"[object Function]"===a(t.constructor)?t.constructor.prototype:t instanceof Object?Object.prototype:null};var z=W;var J=Object.prototype;function $(t){var r;return!!f(t)&&(r=function(t){return null==t?null:(t=Object(t),z(t))}(t),!r||!e(t,"constructor")&&e(r,"constructor")&&D(r.constructor)&&"[object Function]"===a(r.constructor)&&e(r,"isPrototypeOf")&&D(r.isPrototypeOf)&&(r===J||function(t){var r;for(r in t)if(!e(t,r))return!1;return!0}(t)))}function X(t){return"number"==typeof t}var q=Number,Z=q.prototype.toString;var H=n();function K(t){return"object"==typeof t&&(t instanceof q||(H?function(t){try{return Z.call(t),!0}catch(t){return!1}}(t):"[object Number]"===a(t)))}function Q(t){return X(t)||K(t)}v(Q,"isPrimitive",X),v(Q,"isObject",K);var tt=Number.POSITIVE_INFINITY,et=q.NEGATIVE_INFINITY,rt=Math.floor;function nt(t){return rt(t)===t}function it(t){return t<tt&&t>et&&nt(t)}function ot(t){return X(t)&&it(t)}function at(t){return K(t)&&it(t.valueOf())}function ut(t){return ot(t)||at(t)}function ft(t){return ot(t)&&t>=0}function st(t){return at(t)&&t.valueOf()>=0}function lt(t){return ft(t)||st(t)}v(ut,"isPrimitive",ot),v(ut,"isObject",at),v(lt,"isPrimitive",ft),v(lt,"isObject",st);var ct=U();function ht(t,e,r){b(t,e,{configurable:!1,enumerable:!1,get:r})}var pt={binary:1,bool:1,complex64:8,complex128:16,float16:2,bfloat16:2,float32:4,float64:8,float128:16,generic:null,int8:1,int16:2,int32:4,int64:8,int128:16,int256:32,uint8:1,uint8c:1,uint16:2,uint32:4,uint64:8,uint128:16,uint256:32};function gt(t){return Math.abs(t)}function yt(t){var e,r,n,i,o,a;if(0===(r=t.length))return 0;for(e=!0,n=!0,i=gt(t[0]),a=1;a<r;a++){if(o=gt(t[a]),e&&o<i?e=!1:n&&o>i&&(n=!1),!n&&!e)return 0;i=o}return n&&e?3:n?1:2}function mt(t,e){return e&&(2===t||3===t)}function dt(t,e){return e&&(1===t||3===t)}function wt(t,e,r){var n,i,o,a,u;for(n=t.length,i=r,o=r,u=0;u<n;u++){if(0===t[u])return[r,r];(a=e[u])>0?o+=a*(t[u]-1):a<0&&(i+=a*(t[u]-1))}return[i,o]}function bt(t){return t.re}function vt(t){return t.im}function _t(t){return"string"==typeof t}v(wt,"assign",(function(t,e,r,n){var i,o,a,u,f;for(i=t.length,o=r,a=r,f=0;f<i;f++){if(0===t[f])return n[0]=r,n[1]=r,n;(u=e[f])>0?a+=u*(t[f]-1):u<0&&(o+=u*(t[f]-1))}return n[0]=o,n[1]=a,n}));var Et=String.prototype.valueOf;var At=n();function Tt(t){return"object"==typeof t&&(t instanceof String||(At?function(t){try{return Et.call(t),!0}catch(t){return!1}}(t):"[object String]"===a(t)))}function xt(t){return _t(t)||Tt(t)}function Rt(t){return"number"==typeof t}function Ot(t){var e,r="";for(e=0;e<t;e++)r+="0";return r}function jt(t,e,r){var n=!1,i=e-t.length;return i<0||(function(t){return"-"===t[0]}(t)&&(n=!0,t=t.substr(1)),t=r?t+Ot(i):Ot(i)+t,n&&(t="-"+t)),t}v(xt,"isPrimitive",_t),v(xt,"isObject",Tt);var It=String.prototype.toLowerCase,St=String.prototype.toUpperCase;function Ut(t){var e,r,n;switch(t.specifier){case"b":e=2;break;case"o":e=8;break;case"x":case"X":e=16;break;default:e=10}if(r=t.arg,n=parseInt(r,10),!isFinite(n)){if(!Rt(r))throw new Error("invalid integer. Value: "+r);n=0}return n<0&&("u"===t.specifier||10!==e)&&(n=4294967295+n+1),n<0?(r=(-n).toString(e),t.precision&&(r=jt(r,t.precision,t.padRight)),r="-"+r):(r=n.toString(e),n||t.precision?t.precision&&(r=jt(r,t.precision,t.padRight)):r="",t.sign&&(r=t.sign+r)),16===e&&(t.alternate&&(r="0x"+r),r=t.specifier===St.call(t.specifier)?St.call(r):It.call(r)),8===e&&t.alternate&&"0"!==r.charAt(0)&&(r="0"+r),r}function Lt(t){return"string"==typeof t}var Bt=Math.abs,Pt=String.prototype.toLowerCase,Vt=String.prototype.toUpperCase,Ct=String.prototype.replace,Mt=/e\+(\d)$/,kt=/e-(\d)$/,Nt=/^(\d+)$/,Yt=/^(\d+)e/,Ft=/\.0$/,Dt=/\.0*e/,Wt=/(\..*[^0])0*e/;function Gt(t){var e,r,n=parseFloat(t.arg);if(!isFinite(n)){if(!Rt(t.arg))throw new Error("invalid floating-point number. Value: "+r);n=t.arg}switch(t.specifier){case"e":case"E":r=n.toExponential(t.precision);break;case"f":case"F":r=n.toFixed(t.precision);break;case"g":case"G":Bt(n)<1e-4?((e=t.precision)>0&&(e-=1),r=n.toExponential(e)):r=n.toPrecision(t.precision),t.alternate||(r=Ct.call(r,Wt,"$1e"),r=Ct.call(r,Dt,"e"),r=Ct.call(r,Ft,""));break;default:throw new Error("invalid double notation. Value: "+t.specifier)}return r=Ct.call(r,Mt,"e+0$1"),r=Ct.call(r,kt,"e-0$1"),t.alternate&&(r=Ct.call(r,Nt,"$1."),r=Ct.call(r,Yt,"$1.e")),n>=0&&t.sign&&(r=t.sign+r),r=t.specifier===Vt.call(t.specifier)?Vt.call(r):Pt.call(r)}function zt(t){var e,r="";for(e=0;e<t;e++)r+=" ";return r}function Jt(t,e,r){var n=e-t.length;return n<0?t:t=r?t+zt(n):zt(n)+t}var $t=String.fromCharCode,Xt=isNaN,qt=Array.isArray;function Zt(t){var e={};return e.specifier=t.specifier,e.precision=void 0===t.precision?1:t.precision,e.width=t.width,e.flags=t.flags||"",e.mapping=t.mapping,e}function Ht(t){var e,r,n,i,o,a,u,f,s;if(!qt(t))throw new TypeError("invalid argument. First argument must be an array. Value: `"+t+"`.");for(a="",u=1,f=0;f<t.length;f++)if(Lt(n=t[f]))a+=n;else{if(e=void 0!==n.precision,!(n=Zt(n)).specifier)throw new TypeError("invalid argument. Token is missing `specifier` property. Index: `"+f+"`. Value: `"+n+"`.");for(n.mapping&&(u=n.mapping),r=n.flags,s=0;s<r.length;s++)switch(i=r.charAt(s)){case" ":n.sign=" ";break;case"+":n.sign="+";break;case"-":n.padRight=!0,n.padZeros=!1;break;case"0":n.padZeros=r.indexOf("-")<0;break;case"#":n.alternate=!0;break;default:throw new Error("invalid flag: "+i)}if("*"===n.width){if(n.width=parseInt(arguments[u],10),u+=1,Xt(n.width))throw new TypeError("the argument for * width at position "+u+" is not a number. Value: `"+n.width+"`.");n.width<0&&(n.padRight=!0,n.width=-n.width)}if(e&&"*"===n.precision){if(n.precision=parseInt(arguments[u],10),u+=1,Xt(n.precision))throw new TypeError("the argument for * precision at position "+u+" is not a number. Value: `"+n.precision+"`.");n.precision<0&&(n.precision=1,e=!1)}switch(n.arg=arguments[u],n.specifier){case"b":case"o":case"x":case"X":case"d":case"i":case"u":e&&(n.padZeros=!1),n.arg=Ut(n);break;case"s":n.maxWidth=e?n.precision:-1;break;case"c":if(!Xt(n.arg)){if((o=parseInt(n.arg,10))<0||o>127)throw new Error("invalid character code. Value: "+n.arg);n.arg=Xt(o)?String(n.arg):$t(o)}break;case"e":case"E":case"f":case"F":case"g":case"G":e||(n.precision=6),n.arg=Gt(n);break;default:throw new Error("invalid specifier: "+n.specifier)}n.maxWidth>=0&&n.arg.length>n.maxWidth&&(n.arg=n.arg.substring(0,n.maxWidth)),n.padZeros?n.arg=jt(n.arg,n.width||n.precision,n.padRight):n.width&&(n.arg=Jt(n.arg,n.width,n.padRight)),a+=n.arg||"",u+=1}return a}var Kt=/%(?:([1-9]\d*)\$)?([0 +\-#]*)(\*|\d+)?(?:(\.)(\*|\d+)?)?[hlL]?([%A-Za-z])/g;function Qt(t){var e={mapping:t[1]?parseInt(t[1],10):void 0,flags:t[2],width:t[3],precision:t[5],specifier:t[6]};return"."===t[4]&&void 0===t[5]&&(e.precision="1"),e}function te(t){var e,r,n,i;for(r=[],i=0,n=Kt.exec(t);n;)(e=t.slice(i,Kt.lastIndex-n[0].length)).length&&r.push(e),r.push(Qt(n)),i=Kt.lastIndex,n=Kt.exec(t);return(e=t.slice(i)).length&&r.push(e),r}function ee(t){return"string"==typeof t}function re(t){var e,r,n;if(!ee(t))throw new TypeError(re("invalid argument. First argument must be a string. Value: `%s`.",t));for(e=te(t),(r=new Array(arguments.length))[0]=e,n=1;n<r.length;n++)r[n]=arguments[n];return Ht.apply(null,r)}var ne=/[-\/\\^$*+?.()|[\]{}]/g;var ie=RegExp.prototype.exec;var oe=n();function ae(t){return"object"==typeof t&&(t instanceof RegExp||(oe?function(t){try{return ie.call(t),!0}catch(t){return!1}}(t):"[object RegExp]"===a(t)))}function ue(t,e,r){if(!_t(t))throw new TypeError(re("invalid argument. First argument must be a string. Value: `%s`.",t));if(_t(e))e=function(t){var e,r;if(!_t(t))throw new TypeError(re("invalid argument. Must provide a regular expression string. Value: `%s`.",t));if("/"===t[0])for(r=t.length-1;r>=0&&"/"!==t[r];r--);return void 0===r||r<=0?t.replace(ne,"\\$&"):(e=(e=t.substring(1,r)).replace(ne,"\\$&"),t=t[0]+e+t.substring(r))}(e),e=new RegExp(e,"g");else if(!ae(e))throw new TypeError(re("invalid argument. Second argument must be a string or regular expression. Value: `%s`.",e));if(!_t(r)&&!D(r))throw new TypeError(re("invalid argument. Third argument must be a string or replacement function. Value: `%s`.",r));return t.replace(e,r)}var fe={int8:"new Int8Array( [ {{data}} ] )",uint8:"new Uint8Array( [ {{data}} ] )",uint8c:"new Uint8ClampedArray( [ {{data}} ] )",int16:"new Int16Array( [ {{data}} ] )",uint16:"new Uint16Array( [ {{data}} ] )",int32:"new Int32Array( [ {{data}} ] )",uint32:"new Uint32Array( [ {{data}} ] )",float32:"new Float32Array( [ {{data}} ] )",float64:"new Float64Array( [ {{data}} ] )",generic:"[ {{data}} ]",binary:"new Buffer( [ {{data}} ] )",complex64:"new Complex64Array( [ {{data}} ] )",complex128:"new Complex128Array( [ {{data}} ] )"};var se="function"==typeof Uint8Array;var le="function"==typeof Uint8Array?Uint8Array:null;var ce,he="function"==typeof Uint8Array?Uint8Array:void 0;ce=function(){var t,e,r;if("function"!=typeof le)return!1;try{e=new le(e=[1,3.14,-3.14,256,257]),r=e,t=(se&&r instanceof Uint8Array||"[object Uint8Array]"===a(r))&&1===e[0]&&3===e[1]&&253===e[2]&&0===e[3]&&1===e[4]}catch(e){t=!1}return t}()?he:function(){throw new Error("not implemented")};var pe=ce,ge="function"==typeof Uint16Array;var ye="function"==typeof Uint16Array?Uint16Array:null;var me,de="function"==typeof Uint16Array?Uint16Array:void 0;me=function(){var t,e,r;if("function"!=typeof ye)return!1;try{e=new ye(e=[1,3.14,-3.14,65536,65537]),r=e,t=(ge&&r instanceof Uint16Array||"[object Uint16Array]"===a(r))&&1===e[0]&&3===e[1]&&65533===e[2]&&0===e[3]&&1===e[4]}catch(e){t=!1}return t}()?de:function(){throw new Error("not implemented")};var we,be=me,ve={uint16:be,uint8:pe};(we=new ve.uint16(1))[0]=4660;var _e=52===new ve.uint8(we.buffer)[0],Ee="function"==typeof ArrayBuffer;function Ae(t){return Ee&&t instanceof ArrayBuffer||"[object ArrayBuffer]"===a(t)}var Te="function"==typeof Float64Array;var xe="function"==typeof Float64Array?Float64Array:null;var Re,Oe="function"==typeof Float64Array?Float64Array:void 0;Re=function(){var t,e,r;if("function"!=typeof xe)return!1;try{e=new xe([1,3.14,-3.14,NaN]),r=e,t=(Te&&r instanceof Float64Array||"[object Float64Array]"===a(r))&&1===e[0]&&3.14===e[1]&&-3.14===e[2]&&e[3]!=e[3]}catch(e){t=!1}return t}()?Oe:function(){throw new Error("not implemented")};var je=Re,Ie="function"==typeof ArrayBuffer?ArrayBuffer:null;var Se,Ue="function"==typeof ArrayBuffer?ArrayBuffer:void 0;Se=function(){var t,e,r;if("function"!=typeof Ie)return!1;try{(t=Ae(r=new Ie(16))&&"function"==typeof Ie.isView)&&((e=new je(r))[0]=-3.14,e[1]=NaN,t=t&&Ie.isView(e)&&16===r.byteLength&&-3.14===e[0]&&e[1]!=e[1])}catch(e){t=!1}return t}()?Ue:function(){throw new Error("not implemented")};var Le=Se,Be="function"==typeof DataView;var Pe="function"==typeof DataView?DataView:null;var Ve,Ce="function"==typeof DataView?DataView:void 0;Ve=function(){var t,e,r,n;if("function"!=typeof Pe)return!1;try{r=new Le(24),e=new Pe(r,8),n=e,(t=(Be&&n instanceof DataView||"[object DataView]"===a(n))&&"function"==typeof e.getFloat64&&"function"==typeof e.setFloat64)&&(e.setFloat64(0,-3.14),e.setFloat64(8,NaN),t=t&&e.buffer===r&&16===e.byteLength&&8===e.byteOffset&&-3.14===e.getFloat64(0)&&e.getFloat64(8)!=e.getFloat64(8))}catch(e){t=!1}return t}()?Ce:function(){throw new Error("not implemented")};var Me=Ve,ke="function"==typeof BigInt?BigInt:void 0,Ne=["binary","complex64","complex128","float32","float64","generic","int16","int32","int8","uint16","uint32","uint8","uint8c"];function Ye(){return Ne.slice()}function Fe(){return{bool:0,int8:1,uint8:2,uint8c:3,int16:4,uint16:5,int32:6,uint32:7,int64:8,uint64:9,float32:10,float64:11,complex64:12,complex128:13,binary:14,generic:15,notype:17,userdefined_type:256}}function De(t,e,r){b(t,e,{configurable:!1,enumerable:!0,writable:!1,value:r})}function We(t){return Object.keys(Object(t))}var Ge=void 0!==Object.keys;function ze(t){return"[object Arguments]"===a(t)}var Je=function(){return ze(arguments)}();function $e(t){return t!=t}function Xe(t){return X(t)&&$e(t)}function qe(t){return K(t)&&$e(t.valueOf())}function Ze(t){return Xe(t)||qe(t)}v(Ze,"isPrimitive",Xe),v(Ze,"isObject",qe);var He=Object.prototype.propertyIsEnumerable;var Ke=!He.call("beep","0");function Qe(t,e){var r;return null!=t&&(!(r=He.call(t,e))&&Ke&&xt(t)?!Xe(e=+e)&&ot(e)&&e>=0&&e<t.length:r)}var tr=Je?ze:function(t){return null!==t&&"object"==typeof t&&!u(t)&&"number"==typeof t.length&&nt(t.length)&&t.length>=0&&t.length<=4294967295&&e(t,"callee")&&!Qe(t,"callee")},er=Array.prototype.slice;var rr=Qe((function(){}),"prototype"),nr=!Qe({toString:null},"toString");function ir(t){return"object"==typeof t&&null!==t&&"number"==typeof t.length&&nt(t.length)&&t.length>=0&&t.length<=9007199254740991}function or(t,e,r){var n,i;if(!ir(t)&&!_t(t))throw new TypeError("invalid argument. First argument must be an array-like object. Value: `"+t+"`.");if(0===(n=t.length))return-1;if(3===arguments.length){if(!ot(r))throw new TypeError("invalid argument. `fromIndex` must be an integer. Value: `"+r+"`.");if(r>=0){if(r>=n)return-1;i=r}else(i=n+r)<0&&(i=0)}else i=0;if(Ze(e)){for(;i<n;i++)if(Ze(t[i]))return i}else for(;i<n;i++)if(t[i]===e)return i;return-1}function ar(t){return t.constructor&&t.constructor.prototype===t}var ur=["console","external","frame","frameElement","frames","innerHeight","innerWidth","outerHeight","outerWidth","pageXOffset","pageYOffset","parent","scrollLeft","scrollTop","scrollX","scrollY","self","webkitIndexedDB","webkitStorageInfo","window"],fr="undefined"==typeof window?void 0:window;var sr=function(){var t;if("undefined"===F(fr))return!1;for(t in fr)try{-1===or(ur,t)&&e(fr,t)&&null!==fr[t]&&"object"===F(fr[t])&&ar(fr[t])}catch(t){return!0}return!1}(),lr="undefined"!=typeof window;var cr=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"];var hr=Ge?function(){return 2!==(We(arguments)||"").length}(1,2)?function(t){return tr(t)?We(er.call(t)):We(t)}:We:function(t){var r,n,i,o,a,u,f;if(o=[],tr(t)){for(f=0;f<t.length;f++)o.push(f.toString());return o}if("string"==typeof t){if(t.length>0&&!e(t,"0"))for(f=0;f<t.length;f++)o.push(f.toString())}else{if(!1==(i="function"==typeof t)&&!M(t))return o;n=rr&&i}for(a in t)n&&"prototype"===a||!e(t,a)||o.push(String(a));if(nr)for(r=function(t){if(!1===lr&&!sr)return ar(t);try{return ar(t)}catch(t){return!1}}(t),f=0;f<cr.length;f++)u=cr[f],r&&"constructor"===u||!e(t,u)||o.push(String(u));return o};v(Ye,"enum",Fe),function(t,e){var r,n,i;for(r=hr(e),i=0;i<r.length;i++)De(t,n=r[i],e[n])}(Ye,{bool:0,int8:1,uint8:2,uint8c:3,int16:4,uint16:5,int32:6,uint32:7,int64:8,uint64:9,float32:10,float64:11,complex64:12,complex128:13,binary:14,generic:15,notype:17,userdefined_type:256});var pr=["row-major","column-major"];function gr(){return pr.slice()}function yr(){return{"row-major":1,"column-major":2}}v(gr,"enum",yr);var mr=["throw","clamp","wrap"];function dr(){return mr.slice()}function wr(){return{throw:1,clamp:2,wrap:3}}v(dr,"enum",wr);var br={bool:0,int8:1,uint8:2,uint8c:3,int16:4,uint16:5,int32:6,uint32:7,int64:8,uint64:9,float32:10,float64:11,complex64:12,complex128:13,binary:14,generic:15,notype:17,userdefined_type:256},vr={"row-major":1,"column-major":2},_r={throw:1,clamp:2,wrap:3};var Er=new pe(8),Ar=new Me(Er.buffer);function Tr(t,e,r,n){var i,o,a;if(0===t){for(a=0;a<Er.length;a++)e[n]=0,n+=r;return e}for(o=(4294967295&t)>>>0,i=rt(t/4294967296),_e?(Ar.setUint32(0,o,_e),Ar.setUint32(4,i,_e)):(Ar.setUint32(0,i,_e),Ar.setUint32(4,o,_e)),a=0;a<Er.length;a++)e[n]=Er[a],n+=r;return e}v((function(t){var e,r,n,i;return e=new pe(8),0===t||(i=(4294967295&t)>>>0,n=rt(t/4294967296),r=new Me(e.buffer),_e?(r.setUint32(0,i,_e),r.setUint32(4,n,_e)):(r.setUint32(0,n,_e),r.setUint32(4,i,_e))),e}),"assign",Tr);var xr={bool:0,int8:1,uint8:2,uint8c:3,int16:4,uint16:5,int32:6,uint32:7,int64:8,uint64:9,float32:10,float64:11,complex64:12,complex128:13,binary:14,generic:15,notype:17,userdefined_type:256},Rr={"row-major":1,"column-major":2},Or={throw:1,clamp:2,wrap:3};function jr(t,e,r,n,i,o){var a,u,f,s,l;if(!(this instanceof jr))return new jr(t,e,r,n,i,o);for(s=1,l=0;l<r.length;l++)s*=r[l];return u=e.BYTES_PER_ELEMENT?e.BYTES_PER_ELEMENT*s:null,this._byteLength=u,this._bytesPerElement=function(t){return pt[t]||null}(t),this._buffer=e,this._dtype=t,this._length=s,this._ndims=r.length,this._offset=i,this._order=o,this._shape=r,this._strides=n,this._accessors=Boolean(e.get&&e.set),this._iterationOrder=function(t){var e,r;for(e=0,r=0;r<t.length;r++)t[r]<0&&(e+=1);return 0===e?1:e===t.length?-1:0}(n),a=function(t,e,r,n,i){var o;return 0!==t&&0!==i&&t===(o=wt(e,r,n))[1]-o[0]+1}(s,r,n,i,this._iterationOrder),f=yt(n),this._flags={ROW_MAJOR_CONTIGUOUS:dt(f,a),COLUMN_MAJOR_CONTIGUOUS:mt(f,a),READONLY:!1},this.__meta_dataview__=null,this}function Ir(t){return t instanceof jr||null!==t&&"object"==typeof t&&"object"==typeof t.data&&"object"==typeof t.shape&&"object"==typeof t.strides&&"number"==typeof t.offset&&"string"==typeof t.order&&"number"==typeof t.ndims&&"string"==typeof t.dtype&&"number"==typeof t.length&&"object"==typeof t.flags&&"function"==typeof t.get&&"function"==typeof t.set}function Sr(t,e){return"column-major"===e?function(t){var e,r,n;for(e=[],r=1,n=0;n<t.length;n++)e.push(r),r*=t[n];return e}(t):function(t){var e,r,n,i;for(e=t.length,r=[],i=0;i<e;i++)r.push(0);for(n=1,i=e-1;i>=0;i--)r[i]=n,n*=t[i];return r}(t)}function Ur(t,e){var r,n,i;for(n=t.length,r=0,i=0;i<n;i++)e[i]<0&&(r-=e[i]*(t[i]-1));return r}function Lr(t){var e,r,n;if(0===(e=t.length))return 0;for(r=1,n=0;n<e;n++)r*=t[n];return r}v(jr,"name","ndarray"),ht(jr.prototype,"byteLength",(function(){return this._byteLength})),ht(jr.prototype,"BYTES_PER_ELEMENT",(function(){return this._bytesPerElement})),ht(jr.prototype,"data",(function(){return this._buffer})),ht(jr.prototype,"dtype",(function(){return this._dtype})),ht(jr.prototype,"flags",(function(){return{ROW_MAJOR_CONTIGUOUS:(t=this._flags).ROW_MAJOR_CONTIGUOUS,COLUMN_MAJOR_CONTIGUOUS:t.COLUMN_MAJOR_CONTIGUOUS,READONLY:t.READONLY};var t})),ht(jr.prototype,"length",(function(){return this._length})),ht(jr.prototype,"ndims",(function(){return this._ndims})),ht(jr.prototype,"offset",(function(){return this._offset})),ht(jr.prototype,"order",(function(){return this._order})),ht(jr.prototype,"shape",(function(){return this._shape.slice()})),ht(jr.prototype,"strides",(function(){return this._strides.slice()})),v(jr.prototype,"get",(function(){var t,e;for(t=this._offset,e=0;e<arguments.length;e++)t+=this._strides[e]*arguments[e];return this._accessors?this._buffer.get(t):this._buffer[t]})),v(jr.prototype,"iget",(function(t){var e,r,n,i,o,a;if(0===(n=this._ndims))return this._accessors?this._buffer.get(this._offset):this._buffer[this._offset];if(this._flags.ROW_MAJOR_CONTIGUOUS||this._flags.COLUMN_MAJOR_CONTIGUOUS){if(1===this._iterationOrder)return this._accessors?this._buffer.get(this._offset+t):this._buffer[this._offset+t];if(-1===this._iterationOrder)return this._accessors?this._buffer.get(this.offset-t):this._buffer[this._offset-t]}if(r=this._shape,e=this._strides,i=this._offset,"column-major"===this._order){for(a=0;a<n;a++)t-=o=t%r[a],t/=r[a],i+=o*e[a];return this._accessors?this._buffer.get(i):this._buffer[i]}for(a=n-1;a>=0;a--)t-=o=t%r[a],t/=r[a],i+=o*e[a];return this._accessors?this._buffer.get(i):this._buffer[i]})),v(jr.prototype,"set",(function(){var t,e;for(t=this._offset,e=0;e<arguments.length-1;e++)t+=this._strides[e]*arguments[e];return this._accessors?this._buffer.set(arguments[e],t):this._buffer[t]=arguments[e],this})),v(jr.prototype,"iset",(function(t,e){var r,n,i,o,a,u;if(0===(i=this._ndims))return this._accessors?this._buffer.set(t,this._offset):this._buffer[this._offset]=t,this;if(this._flags.ROW_MAJOR_CONTIGUOUS||this._flags.COLUMN_MAJOR_CONTIGUOUS){if(1===this._iterationOrder)return this._accessors?this._buffer.set(e,this._offset+t):this._buffer[this._offset+t]=e,this;if(-1===this._iterationOrder)return this._accessors?this._buffer.set(e,this._offset-t):this._buffer[this._offset-t]=e,this}if(n=this._shape,r=this._strides,o=this._offset,"column-major"===this._order){for(u=0;u<i;u++)t-=a=t%n[u],t/=n[u],o+=a*r[u];return this._accessors?this._buffer.set(e,o):this._buffer[o]=e,this}for(u=i-1;u>=0;u--)t-=a=t%n[u],t/=n[u],o+=a*r[u];return this._accessors?this._buffer.set(e,o):this._buffer[o]=e,this})),v(jr.prototype,"toString",(function(){var t,e,r,n,i,o;if(e=this._shape.length,r="ndarray( '"+(n=this._dtype)+"', ",t="",this._length<=100)if("complex64"===n||"complex128"===n)for(o=0;o<this._length;o++)t+=bt(i=this.iget(o))+", "+vt(i),o<this._length-1&&(t+=", ");else for(o=0;o<this._length;o++)t+=this.iget(o),o<this._length-1&&(t+=", ");else{if("complex64"===n||"complex128"===n)for(o=0;o<3;o++)t+=bt(i=this.iget(o))+", "+vt(i),o<2&&(t+=", ");else for(o=0;o<3;o++)t+=this.iget(o),o<2&&(t+=", ");if(t+=", ..., ","complex64"===n||"complex128"===n)for(o=2;o>=0;o--)t+=bt(i=this.iget(this._length-1-o))+", "+vt(i),o>0&&(t+=", ");else for(o=2;o>=0;o--)t+=this.iget(this._length-1-o),o>0&&(t+=", ")}if(r+=ue(fe[this.dtype],"{{data}}",t),r+=", ",r+=0===e?"[]":"[ "+this._shape.join(", ")+" ]",r+=", ",r+="[ ",0===e)r+="0";else for(o=0;o<e;o++)this._strides[o]<0?r+=-this._strides[o]:r+=this._strides[o],o<e-1&&(r+=", ");return r+=" ]",r+=", ",r+="0",r+=", ",r+="'"+this._order+"'",r+=" )"})),v(jr.prototype,"toJSON",(function(){var t,e,r,n;for(e=this._length,(t={}).type="ndarray",t.dtype=this.dtype,t.flags={READONLY:this._flags.READONLY},t.order=this._order,t.shape=this._shape.slice(),t.strides=this._strides.slice(),n=0;n<e;n++)t.strides[n]<0&&(t.strides[n]*=-1);if(t.data=[],"complex64"===t.dtype||"complex128"===t.dtype)for(n=0;n<e;n++)r=this.iget(n),t.data.push(bt(r),vt(r));else for(n=0;n<e;n++)t.data.push(this.iget(n));return t})),v(jr.prototype,"__array_meta_dataview__","function"==typeof ct.BigInt&&"function"==typeof BigInt&&"bigint"==typeof ct.BigInt("1")&&"bigint"==typeof BigInt("1")?function(){var t,e,r,n,i,o,a,u,f,s,l,c,h,p;if(f=this._mode||"throw",a=this._submode||[f],r=33+16*(c=this._ndims)+(h=a.length),(u=this.__meta_dataview__)&&u.byteLength===r)return u;for(u=new Me(new Le(r)),i=this._shape,o=this._strides,n=this._dtype,t=this._bytesPerElement,s=0,u.setInt8(s,_e?1:0),s+=1,u.setInt16(s,br[n],_e),s+=2,u.setBigInt64(s,ke(c),_e),l=8*c,s+=8,p=0;p<c;p++)u.setBigInt64(s,ke(i[p]),_e),u.setBigInt64(s+l,ke(o[p]*t),_e),s+=8;for(s+=l,u.setBigInt64(s,ke(this._offset*t),_e),s+=8,u.setInt8(s,vr[this._order]),s+=1,u.setInt8(s,_r[f]),s+=1,u.setBigInt64(s,ke(h),_e),s+=8,p=0;p<h;p++)u.setInt8(s,_r[a[p]]),s+=1;return e=0,e|=this._flags.READONLY?4:0,u.setInt32(s,e,_e),this.__meta_dataview__=u,u}:function(){var t,e,r,n,i,o,a,u,f,s,l,c,h,p,g;if(s=this._mode||"throw",u=this._submode||[s],n=33+16*(h=this._ndims)+(p=u.length),(f=this.__meta_dataview__)&&f.byteLength===n)return f;for(f=new Me(new Le(n)),e=new pe(f.buffer),o=this._shape,a=this._strides,i=this._dtype,t=this._bytesPerElement,l=0,f.setInt8(l,_e?1:0),l+=1,f.setInt16(l,xr[i],_e),Tr(h,e,1,l+=2),c=8*h,l+=8,g=0;g<h;g++)Tr(o[g],e,1,l),Tr(a[g]*t,e,1,l+c),l+=8;for(l+=c,Tr(this._offset*t,e,1,l),l+=8,f.setInt8(l,Rr[this._order]),l+=1,f.setInt8(l,Or[s]),Tr(p,e,1,l+=1),l+=8,g=0;g<p;g++)f.setInt8(l,Or[u[g]]),l+=1;return r=0,r|=this._flags.READONLY?4:0,f.setInt32(l,r,_e),this.__meta_dataview__=f,f}),v(Sr,"assign",(function(t,e,r){return"column-major"===e?function(t,e){var r,n;for(r=1,n=0;n<t.length;n++)e[n]=r,r*=t[n];return e}(t,r):function(t,e){var r,n;for(r=1,n=t.length-1;n>=0;n--)e[n]=r,r*=t[n];return e}(t,r)}));function Br(t){if("function"!=typeof t)throw new TypeError("invalid argument. Must provide a function. Value: `"+t+"`.");return function(e){var r,n;if(!function(t){return null!=t&&"function"!=typeof t&&"number"==typeof t.length&&nt(t.length)&&t.length>=0&&t.length<=4294967295}(e))return!1;if(0===(r=e.length))return!1;for(n=0;n<r;n++)if(!1===t(e[n]))return!1;return!0}}var Pr=Br(lt.isPrimitive),Vr=Br(lt.isObject),Cr=Br(lt);v(Cr,"primitives",Pr),v(Cr,"objects",Vr);var Mr=Br(ut.isPrimitive),kr=Br(ut.isObject),Nr=Br(ut);v(Nr,"primitives",Mr),v(Nr,"objects",kr);var Yr=gr(),Fr=Yr.length;function Dr(t){var e;for(e=0;e<Fr;e++)if(t===Yr[e])return!0;return!1}var Wr=Ye(),Gr=Wr.length;function zr(t){var e;for(e=0;e<Gr;e++)if(t===Wr[e])return!0;return!1}function Jr(t,e,r,n){var i=wt(e,r,n);return i[0]>=0&&i[1]<t}function $r(t){var e=typeof t;return null===t||"object"!==e&&"function"!==e?new TypeError("invalid argument. A provided constructor must be either an object (except null) or a function. Value: `"+t+"`."):null}var Xr=Object.create;function qr(){}var Zr="function"==typeof Xr?Xr:function(t){return qr.prototype=t,new qr};var Hr="throw",Kr=!1;function Qr(t,e,r){if("clamp"===r)return function(t,e){return t<0?0:t>e?e:t}(t,e);if("wrap"===r)return function(t,e){var r=e+1;return t<0?((t+=r)<0&&0!=(t%=r)&&(t+=r),t):t>e?((t-=r)>e&&(t%=r),t):t}(t,e);if(t<0||t>e)throw new RangeError("invalid argument. Index must be on the interval: [0,"+e+"]. Value: `"+t+"`.");return t}var tn=jr.prototype.iget;var en=jr.prototype.iset;function rn(t,e){var r,n;for(r=[],n=0;n<e;n++)r.push(t[n]);return r}var nn=dr(),on=nn.length;function an(t){var e;for(e=0;e<on;e++)if(t===nn[e])return!0;return!1}function un(t,r){var n;if(!$(r))return new TypeError("invalid argument. Options must be an object. Value: `"+r+"`.");if(e(r,"mode")&&(t.mode=r.mode,!an(t.mode)))return new TypeError("invalid option. `mode` option must be a recognized mode. Option: `"+t.mode+"`.");if(e(r,"submode")){if(t.submode=r.submode,!u(t.submode))return new TypeError("invalid option. `submode` option must be an array containing recognized modes. Option: `"+t.submode+"`.");if(0===t.submode.length)return new TypeError("invalid option. `submode` option must be an array containing recognized modes. Option: `"+t.submode.join(",")+"`.");for(n=0;n<t.submode.length;n++)if(!an(t.submode[n]))return new TypeError("invalid option. Each `submode` must be a recognized modes. Option: `"+t.submode[n]+"`.");t.submode=t.submode.slice()}return e(r,"readonly")&&(t.readonly=r.readonly,!_(t.readonly))?new TypeError("invalid option. `readonly` option must be a boolean. Option: `"+t.readonly+"`."):null}function fn(t,e,r,n,i,o,a){var u,f,s,l,c;if(!(this instanceof fn))return arguments.length<7?new fn(t,e,r,n,i,o):new fn(t,e,r,n,i,o,a);if(!zr(t))throw new TypeError("invalid argument. `dtype` argument must be a supported ndarray data type. Value: `"+t+"`.");if(!ir(e))throw new TypeError("invalid argument. `buffer` argument must be an array-like object, typed-array-like, or a Buffer. Value: `"+e+"`.");if(e.get&&e.set&&(!D(e.get)||!D(e.set)))throw new TypeError("invalid argument. `buffer` argument `get` and `set` properties must be functions. Value: `"+e+"`.");if(!Pr(r)&&(!ir(r)||r.length>0))throw new TypeError("invalid argument. `shape` argument must be an array-like object containing nonnegative integers. Value: `"+r+"`.");if((u=r.length)>32767)throw new RangeError("invalid argument. Number of dimensions must not exceed 32767 due to stack limits. Value: `"+u+"`.");if(!Mr(n))throw new TypeError("invalid argument. `strides` argument must be an array-like object containing integers. Value: `"+n+"`.");if(u>0){if(n.length!==u)throw new RangeError("invalid argument. `strides` argument length must match the number of dimensions. Expected number of dimensions: "+u+". Strides length: "+n.length+".")}else{if(1!==n.length)throw new RangeError("invalid argument. `strides` length must be equal to 1 when creating a zero-dimensional ndarray.");if(0!==n[0])throw new RangeError("invalid argument. `strides` argument must contain a single element equal to `0`. Value: `"+n[0]+"`.")}if(!ft(i))throw new TypeError("invalid argument. `offset` argument must be a nonnegative integer. Value: `"+i+"`.");if(!Dr(o))throw new TypeError("invalid argument. `order` argument must be a supported order. Value: `"+o+"`.");if(u>0&&!Jr(e.length,r,n,i)&&Lr(r)>0)throw new Error("invalid arguments. The input buffer is incompatible with the specified meta data. Ensure that the offset is valid with regard to the strides array and that the buffer has enough elements to satisfy the desired array shape.");if((f={}).mode=Hr,f.readonly=Kr,arguments.length>6&&(s=un(f,a)))throw s;return this._mode=f.mode,void 0===f.submode&&(f.submode=[this._mode]),this._submode=f.submode,l=rn(r,u),c=rn(n,u||1),jr.call(this,t,e,l,c,i,o),this._flags.READONLY=f.readonly,this}!function(t,e){var r=$r(t);if(r)throw r;if(r=$r(e))throw r;if(void 0===e.prototype)throw new TypeError("invalid argument. Second argument must have a prototype from which another object can inherit. Value: `"+e.prototype+"`.");t.prototype=Zr(e.prototype),b(t.prototype,"constructor",{configurable:!0,enumerable:!1,writable:!0,value:t})}(fn,jr),v(fn,"name","ndarray"),v(fn.prototype,"get",(function(){var t,e,r,n;if(arguments.length!==this._ndims)throw new RangeError("invalid arguments. Number of indices must match the number of dimensions. ndims: "+this._ndims+". nargs: "+arguments.length+".");for(t=this._offset,r=this._submode.length,n=0;n<arguments.length;n++){if(!ot(arguments[n]))throw new TypeError("invalid argument. Indices must be integer valued. Argument: "+n+". Value: `"+arguments[n]+"`.");e=Qr(arguments[n],this._shape[n]-1,this._submode[n%r]),t+=this._strides[n]*e}return this._accessors?this._buffer.get(t):this._buffer[t]})),v(fn.prototype,"iget",(function(t){if(this._ndims>0){if(!ot(t))throw new TypeError("invalid argument. Index must be an integer value. Value: `"+t+"`.");return t=Qr(t,this._length-1,this._mode),tn.call(this,t)}return tn.call(this)})),v(fn.prototype,"set",(function(){var t,e,r,n;if(this._flags.READONLY)throw new Error("invalid invocation. Cannot write to a read-only array.");if(arguments.length!==this._ndims+1)throw new RangeError("invalid arguments. Number of indices must match the number of dimensions. ndims: "+this._ndims+". nargs: "+arguments.length+".");for(t=this._offset,r=this._submode.length,n=0;n<arguments.length-1;n++){if(!ot(arguments[n]))throw new TypeError("invalid argument. Indices must be integer valued. Argument: "+n+". Value: `"+arguments[n]+"`.");e=Qr(arguments[n],this._shape[n]-1,this._submode[n%r]),t+=this._strides[n]*e}return this._accessors?this._buffer.set(arguments[n],t):this._buffer[t]=arguments[n],this})),v(fn.prototype,"iset",(function(t,e){if(this._flags.READONLY)throw new Error("invalid invocation. Cannot write to a read-only array.");if(this._ndims>0){if(!ot(t))throw new TypeError("invalid argument. Index must be an integer value. Value: `"+t+"`.");t=Qr(t,this._length-1,this._mode),en.call(this,t,e)}else en.call(this,t);return this}));var sn=["none","equiv","safe","same-kind","unsafe"];function ln(){return sn.slice()}v(ln,"enum",(function(){return{none:0,equiv:1,safe:2,"same-kind":3,unsafe:4}}));var cn=ln(),hn=cn.length;function pn(t){var e;for(e=0;e<hn;e++)if(t===cn[e])return!0;return!1}var gn=["binary","complex64","complex128","float32","float64","generic","int16","int32","int8","uint16","uint32","uint8","uint8c"];function yn(){return gn.slice()}var mn={bool:0,int8:1,uint8:2,uint8c:3,int16:4,uint16:5,int32:6,uint32:7,int64:8,uint64:9,float32:10,float64:11,complex64:12,complex128:13,binary:14,generic:15,notype:17,userdefined_type:256};function dn(){return{bool:mn.bool,int8:mn.int8,uint8:mn.uint8,uint8c:mn.uint8c,int16:mn.int16,uint16:mn.uint16,int32:mn.int32,uint32:mn.uint32,int64:mn.int64,uint64:mn.uint64,float32:mn.float32,float64:mn.float64,complex64:mn.complex64,complex128:mn.complex128,binary:mn.binary,generic:mn.generic,notype:mn.notype,userdefined_type:mn.userdefined_type}}v(yn,"enum",dn),function(t,e){var r,n,i;for(r=hr(e),i=0;i<r.length;i++)De(t,n=r[i],e[n])}(yn,dn());var wn=function(t,r){var n,i,o,a,f,s,l,c=!0;if(!M(t))throw new TypeError("invalid argument. First argument must be object-like. Value: `"+t+"`.");if(arguments.length>1){if(!$(r))throw new TypeError("invalid argument. Options arguments must be an object. Value: `"+r+"`.");if(e(r,"duplicates")&&!_(c=r.duplicates))throw new TypeError("invalid argument. `duplicates` option must be a boolean primitive. Option: `"+c+"`.")}if(i=(n=hr(t)).length,f={},c)for(l=0;l<i;l++)e(f,a=t[o=n[l]])?(s=f[a],u(s)?f[a].push(o):f[a]=[s,o]):f[a]=o;else for(l=0;l<i;l++)f[t[o=n[l]]]=o;return f}(dn(),{duplicates:!1});var bn={bool:0,int8:1,uint8:2,uint8c:3,int16:4,uint16:5,int32:6,uint32:7,int64:8,uint64:9,float32:10,float64:11,complex64:12,complex128:13,binary:14,generic:15,notype:17,userdefined_type:256};function vn(t){var e=typeof t;return"string"===e?null===function(t){var e=bn[t];return"number"==typeof e?e:null}(t)?null:t:"number"===e?function(t){var e=wn[t];return"string"==typeof e?e:null}(t):null}var _n,En={float64:{float64:1,float32:0,int32:0,int16:0,int8:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:1,complex64:0,binary:0,generic:1},float32:{float64:1,float32:1,int32:0,int16:0,int8:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:1,complex64:1,binary:0,generic:1},int32:{float64:1,float32:0,int32:1,int16:0,int8:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:1,complex64:0,binary:0,generic:1},int16:{float64:1,float32:1,int32:1,int16:1,int8:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:1,complex64:1,binary:0,generic:1},int8:{float64:1,float32:1,int32:1,int16:1,int8:1,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:1,complex64:1,binary:0,generic:1},uint32:{float64:1,float32:0,int32:0,int16:0,int8:0,uint32:1,uint16:0,uint8:0,uint8c:0,complex128:1,complex64:0,binary:0,generic:1},uint16:{float64:1,float32:1,int32:1,int16:0,int8:0,uint32:1,uint16:1,uint8:0,uint8c:0,complex128:1,complex64:1,binary:0,generic:1},uint8:{float64:1,float32:1,int32:1,int16:1,int8:0,uint32:1,uint16:1,uint8:1,uint8c:1,complex128:1,complex64:1,binary:0,generic:1},uint8c:{float64:1,float32:1,int32:1,int16:1,int8:0,uint32:1,uint16:1,uint8:1,uint8c:1,complex128:1,complex64:1,binary:0,generic:1},complex128:{float64:0,float32:0,int32:0,int16:0,int8:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:1,complex64:0,binary:0,generic:1},complex64:{float64:0,float32:0,int32:0,int16:0,int8:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:1,complex64:1,binary:0,generic:1},generic:{float64:0,float32:0,int32:0,int16:0,int8:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:0,complex64:0,binary:0,generic:1},binary:{float64:0,float32:0,int32:0,int16:0,int8:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:0,complex64:0,binary:1,generic:0}};function An(){var t,e,r,n,i,o,a,u,f;for(r={},e=(t=hr(En)).length,f=0;f<e;f++){for(i=t[f],a=En[i],n={},u=0;u<e;u++)n[o=t[u]]=a[o];r[i]=n}return r}function Tn(){var t,e,r,n,i,o,a,u,f;for(r={},e=(t=hr(En)).length,f=0;f<e;f++){for(i=t[f],a=En[i],n=[],u=0;u<e;u++)1===a[o=t[u]]&&n.push(o);r[i]=n}return r}var xn=function(t){return 0===arguments.length?An():(void 0===_n&&(_n=Tn()),t=vn(t),e(_n,t)?_n[t].slice():null)}();var Rn,On={float64:{float64:1,float32:1,int32:0,int16:0,int8:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:1,complex64:0,binary:0,generic:1},float32:{float64:1,float32:1,int32:0,int16:0,int8:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:1,complex64:1,binary:0,generic:1},int32:{float64:1,float32:0,int32:1,int16:1,int8:1,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:1,complex64:0,binary:0,generic:1},int16:{float64:1,float32:1,int32:1,int16:1,int8:1,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:1,complex64:1,binary:0,generic:1},int8:{float64:1,float32:1,int32:1,int16:1,int8:1,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:1,complex64:1,binary:0,generic:1},uint32:{float64:1,float32:0,int32:0,int16:0,int8:0,uint32:1,uint16:1,uint8:1,uint8c:1,complex128:1,complex64:0,binary:0,generic:1},uint16:{float64:1,float32:1,int32:1,int16:0,int8:0,uint32:1,uint16:1,uint8:1,uint8c:1,complex128:1,complex64:1,binary:0,generic:1},uint8:{float64:1,float32:1,int32:1,int16:1,int8:0,uint32:1,uint16:1,uint8:1,uint8c:1,complex128:1,complex64:1,binary:0,generic:1},uint8c:{float64:1,float32:1,int32:1,int16:1,int8:0,uint32:1,uint16:1,uint8:1,uint8c:1,complex128:1,complex64:1,binary:0,generic:1},complex128:{float64:0,float32:0,int32:0,int16:0,int8:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:1,complex64:1,binary:0,generic:0},complex64:{float64:0,float32:0,int32:0,int16:0,int8:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:1,complex64:1,binary:0,generic:0},generic:{float64:0,float32:0,int32:0,int16:0,int8:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:0,complex64:0,binary:0,generic:1},binary:{float64:0,float32:0,int32:0,int16:0,int8:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:0,complex64:0,binary:1,generic:0}};function jn(){var t,e,r,n,i,o,a,u,f;for(r={},e=(t=hr(On)).length,f=0;f<e;f++){for(i=t[f],a=On[i],n={},u=0;u<e;u++)n[o=t[u]]=a[o];r[i]=n}return r}function In(){var t,e,r,n,i,o,a,u,f;for(r={},e=(t=hr(On)).length,f=0;f<e;f++){for(i=t[f],a=On[i],n=[],u=0;u<e;u++)1===a[o=t[u]]&&n.push(o);r[i]=n}return r}var Sn=function(t){return 0===arguments.length?jn():(void 0===Rn&&(Rn=In()),t=vn(t),e(Rn,t)?Rn[t].slice():null)}();function Un(t,e,r){return"unsafe"===r||(t===e||"none"!==r&&"equiv"!==r&&("safe"===r?function(t,e){return t===e||xn[t][e]>0}(t,e):function(t,e){return t===e||Sn[t][e]>0}(t,e)))}var Ln=[],Bn=[],Pn="undefined"!=typeof Uint8Array?Uint8Array:Array,Vn=!1;function Cn(){Vn=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=0,r=t.length;e<r;++e)Ln[e]=t[e],Bn[t.charCodeAt(e)]=e;Bn["-".charCodeAt(0)]=62,Bn["_".charCodeAt(0)]=63}function Mn(t,e,r){for(var n,i,o=[],a=e;a<r;a+=3)n=(t[a]<<16)+(t[a+1]<<8)+t[a+2],o.push(Ln[(i=n)>>18&63]+Ln[i>>12&63]+Ln[i>>6&63]+Ln[63&i]);return o.join("")}function kn(t){var e;Vn||Cn();for(var r=t.length,n=r%3,i="",o=[],a=16383,u=0,f=r-n;u<f;u+=a)o.push(Mn(t,u,u+a>f?f:u+a));return 1===n?(e=t[r-1],i+=Ln[e>>2],i+=Ln[e<<4&63],i+="=="):2===n&&(e=(t[r-2]<<8)+t[r-1],i+=Ln[e>>10],i+=Ln[e>>4&63],i+=Ln[e<<2&63],i+="="),o.push(i),o.join("")}function Nn(t,e,r,n,i){var o,a,u=8*i-n-1,f=(1<<u)-1,s=f>>1,l=-7,c=r?i-1:0,h=r?-1:1,p=t[e+c];for(c+=h,o=p&(1<<-l)-1,p>>=-l,l+=u;l>0;o=256*o+t[e+c],c+=h,l-=8);for(a=o&(1<<-l)-1,o>>=-l,l+=n;l>0;a=256*a+t[e+c],c+=h,l-=8);if(0===o)o=1-s;else{if(o===f)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,n),o-=s}return(p?-1:1)*a*Math.pow(2,o-n)}function Yn(t,e,r,n,i,o){var a,u,f,s=8*o-i-1,l=(1<<s)-1,c=l>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,g=n?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(u=isNaN(e)?1:0,a=l):(a=Math.floor(Math.log(e)/Math.LN2),e*(f=Math.pow(2,-a))<1&&(a--,f*=2),(e+=a+c>=1?h/f:h*Math.pow(2,1-c))*f>=2&&(a++,f/=2),a+c>=l?(u=0,a=l):a+c>=1?(u=(e*f-1)*Math.pow(2,i),a+=c):(u=e*Math.pow(2,c-1)*Math.pow(2,i),a=0));i>=8;t[r+p]=255&u,p+=g,u/=256,i-=8);for(a=a<<i|u,s+=i;s>0;t[r+p]=255&a,p+=g,a/=256,s-=8);t[r+p-g]|=128*y}var Fn={}.toString,Dn=Array.isArray||function(t){return"[object Array]"==Fn.call(t)};Jn.TYPED_ARRAY_SUPPORT=void 0===I.TYPED_ARRAY_SUPPORT||I.TYPED_ARRAY_SUPPORT;var Wn=Gn();function Gn(){return Jn.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function zn(t,e){if(Gn()<e)throw new RangeError("Invalid typed array length");return Jn.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=Jn.prototype:(null===t&&(t=new Jn(e)),t.length=e),t}function Jn(t,e,r){if(!(Jn.TYPED_ARRAY_SUPPORT||this instanceof Jn))return new Jn(t,e,r);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return qn(this,t)}return $n(this,t,e,r)}function $n(t,e,r,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,r,n){if(e.byteLength,r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");e=void 0===r&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,r):new Uint8Array(e,r,n);Jn.TYPED_ARRAY_SUPPORT?(t=e).__proto__=Jn.prototype:t=Zn(t,e);return t}(t,e,r,n):"string"==typeof e?function(t,e,r){"string"==typeof r&&""!==r||(r="utf8");if(!Jn.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|Qn(e,r),i=(t=zn(t,n)).write(e,r);i!==n&&(t=t.slice(0,i));return t}(t,e,r):function(t,e){if(Kn(e)){var r=0|Hn(e.length);return 0===(t=zn(t,r)).length||e.copy(t,0,0,r),t}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(n=e.length)!=n?zn(t,0):Zn(t,e);if("Buffer"===e.type&&Dn(e.data))return Zn(t,e.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function Xn(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function qn(t,e){if(Xn(e),t=zn(t,e<0?0:0|Hn(e)),!Jn.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}function Zn(t,e){var r=e.length<0?0:0|Hn(e.length);t=zn(t,r);for(var n=0;n<r;n+=1)t[n]=255&e[n];return t}function Hn(t){if(t>=Gn())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Gn().toString(16)+" bytes");return 0|t}function Kn(t){return!(null==t||!t._isBuffer)}function Qn(t,e){if(Kn(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return xi(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return Ri(t).length;default:if(n)return xi(t).length;e=(""+e).toLowerCase(),n=!0}}function ti(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return gi(this,e,r);case"utf8":case"utf-8":return ci(this,e,r);case"ascii":return hi(this,e,r);case"latin1":case"binary":return pi(this,e,r);case"base64":return li(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return yi(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function ei(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function ri(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=Jn.from(e,n)),Kn(e))return 0===e.length?-1:ni(t,e,r,n,i);if("number"==typeof e)return e&=255,Jn.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):ni(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function ni(t,e,r,n,i){var o,a=1,u=t.length,f=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;a=2,u/=2,f/=2,r/=2}function s(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(i){var l=-1;for(o=r;o<u;o++)if(s(t,o)===s(e,-1===l?0:o-l)){if(-1===l&&(l=o),o-l+1===f)return l*a}else-1!==l&&(o-=o-l),l=-1}else for(r+f>u&&(r=u-f),o=r;o>=0;o--){for(var c=!0,h=0;h<f;h++)if(s(t,o+h)!==s(e,h)){c=!1;break}if(c)return o}return-1}function ii(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;a<n;++a){var u=parseInt(e.substr(2*a,2),16);if(isNaN(u))return a;t[r+a]=u}return a}function oi(t,e,r,n){return Oi(xi(e,t.length-r),t,r,n)}function ai(t,e,r,n){return Oi(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function ui(t,e,r,n){return ai(t,e,r,n)}function fi(t,e,r,n){return Oi(Ri(e),t,r,n)}function si(t,e,r,n){return Oi(function(t,e){for(var r,n,i,o=[],a=0;a<t.length&&!((e-=2)<0);++a)n=(r=t.charCodeAt(a))>>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function li(t,e,r){return 0===e&&r===t.length?kn(t):kn(t.slice(e,r))}function ci(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i<r;){var o,a,u,f,s=t[i],l=null,c=s>239?4:s>223?3:s>191?2:1;if(i+c<=r)switch(c){case 1:s<128&&(l=s);break;case 2:128==(192&(o=t[i+1]))&&(f=(31&s)<<6|63&o)>127&&(l=f);break;case 3:o=t[i+1],a=t[i+2],128==(192&o)&&128==(192&a)&&(f=(15&s)<<12|(63&o)<<6|63&a)>2047&&(f<55296||f>57343)&&(l=f);break;case 4:o=t[i+1],a=t[i+2],u=t[i+3],128==(192&o)&&128==(192&a)&&128==(192&u)&&(f=(15&s)<<18|(63&o)<<12|(63&a)<<6|63&u)>65535&&f<1114112&&(l=f)}null===l?(l=65533,c=1):l>65535&&(l-=65536,n.push(l>>>10&1023|55296),l=56320|1023&l),n.push(l),i+=c}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);var r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=4096));return r}(n)}Jn.poolSize=8192,Jn._augment=function(t){return t.__proto__=Jn.prototype,t},Jn.from=function(t,e,r){return $n(null,t,e,r)},Jn.TYPED_ARRAY_SUPPORT&&(Jn.prototype.__proto__=Uint8Array.prototype,Jn.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&Jn[Symbol.species]),Jn.alloc=function(t,e,r){return function(t,e,r,n){return Xn(e),e<=0?zn(t,e):void 0!==r?"string"==typeof n?zn(t,e).fill(r,n):zn(t,e).fill(r):zn(t,e)}(null,t,e,r)},Jn.allocUnsafe=function(t){return qn(null,t)},Jn.allocUnsafeSlow=function(t){return qn(null,t)},Jn.isBuffer=ji,Jn.compare=function(t,e){if(!Kn(t)||!Kn(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);i<o;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0},Jn.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},Jn.concat=function(t,e){if(!Dn(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return Jn.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=Jn.allocUnsafe(e),i=0;for(r=0;r<t.length;++r){var o=t[r];if(!Kn(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,i),i+=o.length}return n},Jn.byteLength=Qn,Jn.prototype._isBuffer=!0,Jn.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)ei(this,e,e+1);return this},Jn.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)ei(this,e,e+3),ei(this,e+1,e+2);return this},Jn.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)ei(this,e,e+7),ei(this,e+1,e+6),ei(this,e+2,e+5),ei(this,e+3,e+4);return this},Jn.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?ci(this,0,t):ti.apply(this,arguments)},Jn.prototype.equals=function(t){if(!Kn(t))throw new TypeError("Argument must be a Buffer");return this===t||0===Jn.compare(this,t)},Jn.prototype.inspect=function(){var t="";return this.length>0&&(t=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(t+=" ... ")),"<Buffer "+t+">"},Jn.prototype.compare=function(t,e,r,n,i){if(!Kn(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(n>>>=0),a=(r>>>=0)-(e>>>=0),u=Math.min(o,a),f=this.slice(n,i),s=t.slice(e,r),l=0;l<u;++l)if(f[l]!==s[l]){o=f[l],a=s[l];break}return o<a?-1:a<o?1:0},Jn.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},Jn.prototype.indexOf=function(t,e,r){return ri(this,t,e,r,!0)},Jn.prototype.lastIndexOf=function(t,e,r){return ri(this,t,e,r,!1)},Jn.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return ii(this,t,e,r);case"utf8":case"utf-8":return oi(this,t,e,r);case"ascii":return ai(this,t,e,r);case"latin1":case"binary":return ui(this,t,e,r);case"base64":return fi(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return si(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},Jn.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function hi(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(127&t[i]);return n}function pi(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function gi(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=e;o<r;++o)i+=Ti(t[o]);return i}function yi(t,e,r){for(var n=t.slice(e,r),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function mi(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function di(t,e,r,n,i,o){if(!Kn(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function wi(t,e,r,n){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-r,2);i<o;++i)t[r+i]=(e&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function bi(t,e,r,n){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-r,4);i<o;++i)t[r+i]=e>>>8*(n?i:3-i)&255}function vi(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function _i(t,e,r,n,i){return i||vi(t,0,r,4),Yn(t,e,r,n,23,4),r+4}function Ei(t,e,r,n,i){return i||vi(t,0,r,8),Yn(t,e,r,n,52,8),r+8}Jn.prototype.slice=function(t,e){var r,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e<t&&(e=t),Jn.TYPED_ARRAY_SUPPORT)(r=this.subarray(t,e)).__proto__=Jn.prototype;else{var i=e-t;r=new Jn(i,void 0);for(var o=0;o<i;++o)r[o]=this[o+t]}return r},Jn.prototype.readUIntLE=function(t,e,r){t|=0,e|=0,r||mi(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return n},Jn.prototype.readUIntBE=function(t,e,r){t|=0,e|=0,r||mi(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},Jn.prototype.readUInt8=function(t,e){return e||mi(t,1,this.length),this[t]},Jn.prototype.readUInt16LE=function(t,e){return e||mi(t,2,this.length),this[t]|this[t+1]<<8},Jn.prototype.readUInt16BE=function(t,e){return e||mi(t,2,this.length),this[t]<<8|this[t+1]},Jn.prototype.readUInt32LE=function(t,e){return e||mi(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},Jn.prototype.readUInt32BE=function(t,e){return e||mi(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},Jn.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||mi(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*e)),n},Jn.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||mi(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},Jn.prototype.readInt8=function(t,e){return e||mi(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},Jn.prototype.readInt16LE=function(t,e){e||mi(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},Jn.prototype.readInt16BE=function(t,e){e||mi(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},Jn.prototype.readInt32LE=function(t,e){return e||mi(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},Jn.prototype.readInt32BE=function(t,e){return e||mi(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},Jn.prototype.readFloatLE=function(t,e){return e||mi(t,4,this.length),Nn(this,t,!0,23,4)},Jn.prototype.readFloatBE=function(t,e){return e||mi(t,4,this.length),Nn(this,t,!1,23,4)},Jn.prototype.readDoubleLE=function(t,e){return e||mi(t,8,this.length),Nn(this,t,!0,52,8)},Jn.prototype.readDoubleBE=function(t,e){return e||mi(t,8,this.length),Nn(this,t,!1,52,8)},Jn.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e|=0,r|=0,n)||di(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[e]=255&t;++o<r&&(i*=256);)this[e+o]=t/i&255;return e+r},Jn.prototype.writeUIntBE=function(t,e,r,n){(t=+t,e|=0,r|=0,n)||di(this,t,e,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+r},Jn.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||di(this,t,e,1,255,0),Jn.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},Jn.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||di(this,t,e,2,65535,0),Jn.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):wi(this,t,e,!0),e+2},Jn.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||di(this,t,e,2,65535,0),Jn.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):wi(this,t,e,!1),e+2},Jn.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||di(this,t,e,4,4294967295,0),Jn.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):bi(this,t,e,!0),e+4},Jn.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||di(this,t,e,4,4294967295,0),Jn.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):bi(this,t,e,!1),e+4},Jn.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);di(this,t,e,r,i-1,-i)}var o=0,a=1,u=0;for(this[e]=255&t;++o<r&&(a*=256);)t<0&&0===u&&0!==this[e+o-1]&&(u=1),this[e+o]=(t/a>>0)-u&255;return e+r},Jn.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);di(this,t,e,r,i-1,-i)}var o=r-1,a=1,u=0;for(this[e+o]=255&t;--o>=0&&(a*=256);)t<0&&0===u&&0!==this[e+o+1]&&(u=1),this[e+o]=(t/a>>0)-u&255;return e+r},Jn.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||di(this,t,e,1,127,-128),Jn.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},Jn.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||di(this,t,e,2,32767,-32768),Jn.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):wi(this,t,e,!0),e+2},Jn.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||di(this,t,e,2,32767,-32768),Jn.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):wi(this,t,e,!1),e+2},Jn.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||di(this,t,e,4,2147483647,-2147483648),Jn.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):bi(this,t,e,!0),e+4},Jn.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||di(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),Jn.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):bi(this,t,e,!1),e+4},Jn.prototype.writeFloatLE=function(t,e,r){return _i(this,t,e,!0,r)},Jn.prototype.writeFloatBE=function(t,e,r){return _i(this,t,e,!1,r)},Jn.prototype.writeDoubleLE=function(t,e,r){return Ei(this,t,e,!0,r)},Jn.prototype.writeDoubleBE=function(t,e,r){return Ei(this,t,e,!1,r)},Jn.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var i,o=n-r;if(this===t&&r<e&&e<n)for(i=o-1;i>=0;--i)t[i+e]=this[i+r];else if(o<1e3||!Jn.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)t[i+e]=this[i+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+o),e);return o},Jn.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===t.length){var i=t.charCodeAt(0);i<256&&(t=i)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!Jn.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var o;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o<r;++o)this[o]=t;else{var a=Kn(t)?t:xi(new Jn(t,n).toString()),u=a.length;for(o=0;o<r-e;++o)this[o+e]=a[o%u]}return this};var Ai=/[^+\/0-9A-Za-z-_]/g;function Ti(t){return t<16?"0"+t.toString(16):t.toString(16)}function xi(t,e){var r;e=e||1/0;for(var n=t.length,i=null,o=[],a=0;a<n;++a){if((r=t.charCodeAt(a))>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function Ri(t){return function(t){var e,r,n,i,o,a;Vn||Cn();var u=t.length;if(u%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o="="===t[u-2]?2:"="===t[u-1]?1:0,a=new Pn(3*u/4-o),n=o>0?u-4:u;var f=0;for(e=0,r=0;e<n;e+=4,r+=3)i=Bn[t.charCodeAt(e)]<<18|Bn[t.charCodeAt(e+1)]<<12|Bn[t.charCodeAt(e+2)]<<6|Bn[t.charCodeAt(e+3)],a[f++]=i>>16&255,a[f++]=i>>8&255,a[f++]=255&i;return 2===o?(i=Bn[t.charCodeAt(e)]<<2|Bn[t.charCodeAt(e+1)]>>4,a[f++]=255&i):1===o&&(i=Bn[t.charCodeAt(e)]<<10|Bn[t.charCodeAt(e+1)]<<4|Bn[t.charCodeAt(e+2)]>>2,a[f++]=i>>8&255,a[f++]=255&i),a}(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(Ai,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function Oi(t,e,r,n){for(var i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function ji(t){return null!=t&&(!!t._isBuffer||Ii(t)||function(t){return"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&Ii(t.slice(0,0))}(t))}function Ii(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}var Si=Object.freeze({__proto__:null,Buffer:Jn,INSPECT_MAX_BYTES:50,SlowBuffer:function(t){return+t!=t&&(t=0),Jn.alloc(+t)},isBuffer:ji,kMaxLength:Wn}),Ui=Jn;function Li(t){if(t.__esModule)return t;var e=t.default;if("function"==typeof e){var r=function t(){if(this instanceof t){var r=[null];r.push.apply(r,arguments);var n=Function.bind.apply(e,r);return new n}return e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach((function(e){var n=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(r,e,n.get?n:{enumerable:!0,get:function(){return t[e]}})})),r}var Bi,Pi=Li(Si).Buffer;Bi=function(){var t,e;if("function"!=typeof Ui)return!1;try{t=N(e="function"==typeof Ui.from?Ui.from([1,2,3,4]):new Ui([1,2,3,4]))&&1===e[0]&&2===e[1]&&3===e[2]&&4===e[3]}catch(e){t=!1}return t}()?Pi:function(){throw new Error("not implemented")};var Vi=Bi,Ci="function"==typeof Float32Array;var Mi="function"==typeof Float32Array?Float32Array:null;var ki,Ni="function"==typeof Float32Array?Float32Array:void 0;ki=function(){var t,e,r;if("function"!=typeof Mi)return!1;try{e=new Mi([1,3.14,-3.14,5e40]),r=e,t=(Ci&&r instanceof Float32Array||"[object Float32Array]"===a(r))&&1===e[0]&&3.140000104904175===e[1]&&-3.140000104904175===e[2]&&e[3]===tt}catch(e){t=!1}return t}()?Ni:function(){throw new Error("not implemented")};var Yi=ki,Fi="function"==typeof Int16Array;var Di="function"==typeof Int16Array?Int16Array:null;var Wi,Gi="function"==typeof Int16Array?Int16Array:void 0;Wi=function(){var t,e,r;if("function"!=typeof Di)return!1;try{e=new Di([1,3.14,-3.14,32768]),r=e,t=(Fi&&r instanceof Int16Array||"[object Int16Array]"===a(r))&&1===e[0]&&3===e[1]&&-3===e[2]&&-32768===e[3]}catch(e){t=!1}return t}()?Gi:function(){throw new Error("not implemented")};var zi=Wi,Ji="function"==typeof Int32Array;var $i="function"==typeof Int32Array?Int32Array:null;var Xi,qi="function"==typeof Int32Array?Int32Array:void 0;Xi=function(){var t,e,r;if("function"!=typeof $i)return!1;try{e=new $i([1,3.14,-3.14,2147483648]),r=e,t=(Ji&&r instanceof Int32Array||"[object Int32Array]"===a(r))&&1===e[0]&&3===e[1]&&-3===e[2]&&-2147483648===e[3]}catch(e){t=!1}return t}()?qi:function(){throw new Error("not implemented")};var Zi=Xi,Hi="function"==typeof Int8Array;var Ki="function"==typeof Int8Array?Int8Array:null;var Qi,to="function"==typeof Int8Array?Int8Array:void 0;Qi=function(){var t,e,r;if("function"!=typeof Ki)return!1;try{e=new Ki([1,3.14,-3.14,128]),r=e,t=(Hi&&r instanceof Int8Array||"[object Int8Array]"===a(r))&&1===e[0]&&3===e[1]&&-3===e[2]&&-128===e[3]}catch(e){t=!1}return t}()?to:function(){throw new Error("not implemented")};var eo=Qi,ro="function"==typeof Uint32Array;var no="function"==typeof Uint32Array?Uint32Array:null;var io,oo="function"==typeof Uint32Array?Uint32Array:void 0;io=function(){var t,e,r;if("function"!=typeof no)return!1;try{e=new no(e=[1,3.14,-3.14,4294967296,4294967297]),r=e,t=(ro&&r instanceof Uint32Array||"[object Uint32Array]"===a(r))&&1===e[0]&&3===e[1]&&4294967293===e[2]&&0===e[3]&&1===e[4]}catch(e){t=!1}return t}()?oo:function(){throw new Error("not implemented")};var ao=io,uo="function"==typeof Uint8ClampedArray;var fo="function"==typeof Uint8ClampedArray?Uint8ClampedArray:null;var so,lo="function"==typeof Uint8ClampedArray?Uint8ClampedArray:void 0;so=function(){var t,e,r;if("function"!=typeof fo)return!1;try{e=new fo([-1,0,1,3.14,4.99,255,256]),r=e,t=(uo&&r instanceof Uint8ClampedArray||"[object Uint8ClampedArray]"===a(r))&&0===e[0]&&0===e[1]&&1===e[2]&&3===e[3]&&5===e[4]&&255===e[5]&&255===e[6]}catch(e){t=!1}return t}()?lo:function(){throw new Error("not implemented")};var co=so;function ho(t){return"object"==typeof t&&null!==t&&"number"==typeof t.length&&nt(t.length)&&t.length>=0&&t.length<=4294967295}function po(t,e){if(!(this instanceof po))throw new TypeError("invalid invocation. Constructor must be called with the `new` keyword.");if(!X(t))throw new TypeError("invalid argument. Real component must be a number primitive. Value: `"+t+"`.");if(!X(e))throw new TypeError("invalid argument. Imaginary component must be a number primitive. Value: `"+e+"`.");return b(this,"re",{configurable:!1,enumerable:!0,writable:!1,value:t}),b(this,"im",{configurable:!1,enumerable:!0,writable:!1,value:e}),this}v(po,"BYTES_PER_ELEMENT",8),v(po.prototype,"BYTES_PER_ELEMENT",8),v(po.prototype,"byteLength",16),v(po.prototype,"toString",(function(){var t=""+this.re;return this.im<0?t+=" - "+-this.im:t+=" + "+this.im,t+="i"})),v(po.prototype,"toJSON",(function(){var t={type:"Complex128"};return t.re=this.re,t.im=this.im,t}));var go="function"==typeof Math.fround?Math.fround:null,yo=new Yi(1);var mo="function"==typeof go?go:function(t){return yo[0]=t,yo[0]};function wo(t,e){if(!(this instanceof wo))throw new TypeError("invalid invocation. Constructor must be called with the `new` keyword.");if(!X(t))throw new TypeError("invalid argument. Real component must be a number primitive. Value: `"+t+"`.");if(!X(e))throw new TypeError("invalid argument. Imaginary component must be a number primitive. Value: `"+e+"`.");return b(this,"re",{configurable:!1,enumerable:!0,writable:!1,value:mo(t)}),b(this,"im",{configurable:!1,enumerable:!0,writable:!1,value:mo(e)}),this}function bo(t){return t instanceof po||t instanceof wo||"object"==typeof t&&null!==t&&"number"==typeof t.re&&"number"==typeof t.im}function vo(t){return nt(t/2)}function _o(){return"function"==typeof Symbol&&"symbol"==typeof Symbol("foo")&&e(Symbol,"iterator")&&"symbol"==typeof Symbol.iterator}v(wo,"BYTES_PER_ELEMENT",4),v(wo.prototype,"BYTES_PER_ELEMENT",4),v(wo.prototype,"byteLength",8),v(wo.prototype,"toString",(function(){var t=""+this.re;return this.im<0?t+=" - "+-this.im:t+=" + "+this.im,t+="i"})),v(wo.prototype,"toJSON",(function(){var t={type:"Complex64"};return t.re=this.re,t.im=this.im,t}));var Eo=_o()?Symbol.iterator:null;function Ao(t){return t.re}function To(t){return t.im}function xo(t,e){return new Yi(t.buffer,t.byteOffset+t.BYTES_PER_ELEMENT*e,2*(t.length-e))}function Ro(t,e){return new je(t.buffer,t.byteOffset+t.BYTES_PER_ELEMENT*e,2*(t.length-e))}function Oo(t,e){return t[e]}function jo(t,e){return t.get(e)}function Io(t,e,r){t[e]=r}function So(t,e,r){t.set(r,e)}function Uo(t){var e=Boolean(t.get&&t.set);return{data:t,accessors:e,getter:e?jo:Oo,setter:e?So:Io}}function Lo(t){var e,r,n;for(e=[];!(r=t.next()).done;)if(ho(n=r.value)&&n.length>=2)e.push(n[0],n[1]);else{if(!bo(n))return new TypeError("invalid argument. An iterator must return either a two-element array containing real and imaginary components or a complex number. Value: `"+n+"`.");e.push(Ao(n),To(n))}return e}function Bo(t,e,r){var n,i,o,a;for(n=[],a=-1;!(i=t.next()).done;)if(a+=1,ho(o=e.call(r,i.value,a))&&o.length>=2)n.push(o[0],o[1]);else{if(!bo(o))return new TypeError("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `"+o+"`.");n.push(Ao(o),To(o))}return n}function Po(t,e){var r,n,i,o;for(r=e.length,o=0,i=0;i<r;i++){if(!bo(n=e[i]))return null;t[o]=Ao(n),t[o+1]=To(n),o+=2}return t}var Vo=2*Yi.BYTES_PER_ELEMENT,Co=_o();function Mo(t){return t instanceof Fo||"object"==typeof t&&null!==t&&("Complex64Array"===t.constructor.name||"Complex128Array"===t.constructor.name)&&"number"==typeof t._length&&"object"==typeof t._buffer}function ko(t){return t===Fo||"Complex128Array"===t.name}function No(t){return"object"==typeof t&&null!==t&&"Complex64Array"===t.constructor.name&&t.BYTES_PER_ELEMENT===Vo}function Yo(t){return"object"==typeof t&&null!==t&&"Complex128Array"===t.constructor.name&&t.BYTES_PER_ELEMENT===2*Vo}function Fo(){var t,e,r,n;if(e=arguments.length,!(this instanceof Fo))return 0===e?new Fo:1===e?new Fo(arguments[0]):2===e?new Fo(arguments[0],arguments[1]):new Fo(arguments[0],arguments[1],arguments[2]);if(0===e)r=new Yi(0);else if(1===e)if(ft(arguments[0]))r=new Yi(2*arguments[0]);else if(ir(arguments[0]))if((n=(r=arguments[0]).length)&&u(r)&&bo(r[0])){if(null===(r=Po(new Yi(2*n),r))){if(!vo(n))throw new RangeError("invalid argument. Array-like object input arguments must have a length which is a multiple of two. Length: `"+n+"`.");r=new Yi(arguments[0])}}else{if(No(r))r=xo(r,0);else if(Yo(r))r=Ro(r,0);else if(!vo(n))throw new RangeError("invalid argument. Array-like object and typed array input arguments must have a length which is a multiple of two. Length: `"+n+"`.");r=new Yi(r)}else if(Ae(arguments[0])){if(!nt((r=arguments[0]).byteLength/Vo))throw new RangeError("invalid argument. ArrayBuffer byte length must be a multiple of "+Vo+". Byte length: `"+r.byteLength+"`.");r=new Yi(r)}else{if(!f(arguments[0]))throw new TypeError("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `"+arguments[0]+"`.");if(r=arguments[0],!1===Co)throw new TypeError("invalid argument. Environment lacks Symbol.iterator support. Must provide a length, ArrayBuffer, typed array, or array-like object. Value: `"+r+"`.");if(!D(r[Eo]))throw new TypeError("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `"+r+"`.");if(!D((r=r[Eo]()).next))throw new TypeError("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable.");if((r=Lo(r))instanceof Error)throw r;r=new Yi(r)}else{if(!Ae(r=arguments[0]))throw new TypeError("invalid argument. First argument must be an array buffer. Value: `"+r+"`.");if(!ft(t=arguments[1]))throw new TypeError("invalid argument. Byte offset must be a nonnegative integer. Value: `"+t+"`.");if(!nt(t/Vo))throw new RangeError("invalid argument. Byte offset must be a multiple of "+Vo+". Value: `"+t+"`.");if(2===e){if(!nt((n=r.byteLength-t)/Vo))throw new RangeError("invalid arguments. ArrayBuffer view byte length must be a multiple of "+Vo+". View byte length: `"+n+"`.");r=new Yi(r,t)}else{if(!ft(n=arguments[2]))throw new TypeError("invalid argument. Length must be a nonnegative integer. Value: `"+n+"`.");if(n*Vo>r.byteLength-t)throw new RangeError("invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `"+n*Vo+"`.");r=new Yi(r,t,2*n)}}return v(this,"_buffer",r),v(this,"_length",r.length/2),this}function Do(t){var e,r,n;for(e=[];!(r=t.next()).done;)if(ho(n=r.value)&&n.length>=2)e.push(n[0],n[1]);else{if(!bo(n))return new TypeError("invalid argument. An iterator must return either a two-element array containing real and imaginary components or a complex number. Value: `"+n+"`.");e.push(bt(n),vt(n))}return e}function Wo(t,e,r){var n,i,o,a;for(n=[],a=-1;!(i=t.next()).done;)if(a+=1,ho(o=e.call(r,i.value,a))&&o.length>=2)n.push(o[0],o[1]);else{if(!bo(o))return new TypeError("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `"+o+"`.");n.push(bt(o),vt(o))}return n}function Go(t,e){var r,n,i,o;for(r=e.length,o=0,i=0;i<r;i++){if(!bo(n=e[i]))return null;t[o]=bt(n),t[o+1]=vt(n),o+=2}return t}v(Fo,"BYTES_PER_ELEMENT",Vo),v(Fo,"name","Complex64Array"),v(Fo,"from",(function(t){var e,r,n,i,o,a,u,s,l,c,h;if(!D(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!ko(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if((r=arguments.length)>1){if(!D(n=arguments[1]))throw new TypeError("invalid argument. Second argument must be a function. Value: `"+n+"`.");r>2&&(e=arguments[2])}if(Mo(t)){if(u=t.length,n){for(o=(i=new this(u))._buffer,h=0,c=0;c<u;c++){if(bo(l=n.call(e,t.get(c),c)))o[h]=Ao(l),o[h+1]=To(l);else{if(!(ho(l)&&l.length>=2))throw new TypeError("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `"+l+"`.");o[h]=l[0],o[h+1]=l[1]}h+=2}return i}return new this(t)}if(ir(t)){if(n){for(u=t.length,a=Uo(t),c=0;c<u;c++)if(!bo(a.getter(t,c))){s=!0;break}if(s){if(!vo(u))throw new RangeError("invalid argument. First argument must have a length which is a multiple of two. Length: `"+u+"`.");for(o=(i=new this(u/2))._buffer,c=0;c<u;c++)o[c]=n.call(e,a.getter(t,c),c);return i}for(o=(i=new this(u))._buffer,h=0,c=0;c<u;c++){if(bo(l=n.call(e,a.getter(t,c),c)))o[h]=Ao(l),o[h+1]=To(l);else{if(!(ho(l)&&l.length>=2))throw new TypeError("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `"+l+"`.");o[h]=l[0],o[h+1]=l[1]}h+=2}return i}return new this(t)}if(f(t)&&Co&&D(t[Eo])){if(!D((o=t[Eo]()).next))throw new TypeError("invalid argument. First argument must be an array-like object or an iterable.");if((a=n?Bo(o,n,e):Lo(o))instanceof Error)throw a;for(o=(i=new this(u=a.length/2))._buffer,c=0;c<u;c++)o[c]=a[c];return i}throw new TypeError("invalid argument. First argument must be an array-like object or an iterable. Value: `"+t+"`.")})),v(Fo,"of",(function(){var t,e;if(!D(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!ko(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(t=[],e=0;e<arguments.length;e++)t.push(arguments[e]);return new this(t)})),ht(Fo.prototype,"buffer",(function(){return this._buffer.buffer})),ht(Fo.prototype,"byteLength",(function(){return this._buffer.byteLength})),ht(Fo.prototype,"byteOffset",(function(){return this._buffer.byteOffset})),v(Fo.prototype,"BYTES_PER_ELEMENT",Fo.BYTES_PER_ELEMENT),v(Fo.prototype,"copyWithin",(function(t,e){if(!Mo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return 2===arguments.length?this._buffer.copyWithin(2*t,2*e):this._buffer.copyWithin(2*t,2*e,2*arguments[2]),this})),v(Fo.prototype,"entries",(function(){var t,e,r,n,i,o,a;if(!Mo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return e=this,t=this._buffer,n=this._length,o=-1,a=-2,v(r={},"next",(function(){var e;if(o+=1,i||o>=n)return{done:!0};return e=new wo(t[a+=2],t[a+1]),{value:[o,e],done:!1}})),v(r,"return",(function(t){if(i=!0,arguments.length)return{value:t,done:!0};return{done:!0}})),Eo&&v(r,Eo,(function(){return e.entries()})),r})),v(Fo.prototype,"get",(function(t){var e;if(!Mo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!ft(t))throw new TypeError("invalid argument. Must provide a nonnegative integer. Value: `"+t+"`.");if(!(t>=this._length))return new wo((e=this._buffer)[t*=2],e[t+1])})),ht(Fo.prototype,"length",(function(){return this._length})),v(Fo.prototype,"set",(function(t){var e,r,n,i,o,a,u,f,s;if(!Mo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(n=this._buffer,arguments.length>1){if(!ft(r=arguments[1]))throw new TypeError("invalid argument. Index argument must be a nonnegative integer. Value: `"+r+"`.")}else r=0;if(bo(t)){if(r>=this._length)throw new RangeError("invalid argument. Index argument is out-of-bounds. Value: `"+r+"`.");return n[r*=2]=Ao(t),void(n[r+1]=To(t))}if(Mo(t)){if(r+(a=t._length)>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(e=t._buffer,s=n.byteOffset+r*Vo,e.buffer===n.buffer&&e.byteOffset<s&&e.byteOffset+e.byteLength>s){for(i=new Yi(e.length),f=0;f<e.length;f++)i[f]=e[f];e=i}for(r*=2,s=0,f=0;f<a;f++)n[r]=e[s],n[r+1]=e[s+1],r+=2,s+=2}else{if(!ir(t))throw new TypeError("invalid argument. First argument must be either a complex number, an array-like object, or a complex number array. Value: `"+t+"`.");for(a=t.length,f=0;f<a;f++)if(!bo(t[f])){o=!0;break}if(o){if(!vo(a))throw new RangeError("invalid argument. Array-like object arguments must have a length which is a multiple of two. Length: `"+a+"`.");if(r+a/2>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(e=t,s=n.byteOffset+r*Vo,e.buffer===n.buffer&&e.byteOffset<s&&e.byteOffset+e.byteLength>s){for(i=new Yi(a),f=0;f<a;f++)i[f]=e[f];e=i}for(r*=2,a/=2,s=0,f=0;f<a;f++)n[r]=e[s],n[r+1]=e[s+1],r+=2,s+=2;return}if(r+a>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");for(r*=2,f=0;f<a;f++)u=t[f],n[r]=Ao(u),n[r+1]=To(u),r+=2}}));var zo=2*je.BYTES_PER_ELEMENT,Jo=_o();function $o(t){return t instanceof Ho||"object"==typeof t&&null!==t&&("Complex64Array"===t.constructor.name||"Complex128Array"===t.constructor.name)&&"number"==typeof t._length&&"object"==typeof t._buffer}function Xo(t){return t===Ho||"Complex64Array"===t.name}function qo(t){return"object"==typeof t&&null!==t&&"Complex64Array"===t.constructor.name&&t.BYTES_PER_ELEMENT===zo/2}function Zo(t){return"object"==typeof t&&null!==t&&"Complex128Array"===t.constructor.name&&t.BYTES_PER_ELEMENT===zo}function Ho(){var t,e,r,n;if(e=arguments.length,!(this instanceof Ho))return 0===e?new Ho:1===e?new Ho(arguments[0]):2===e?new Ho(arguments[0],arguments[1]):new Ho(arguments[0],arguments[1],arguments[2]);if(0===e)r=new je(0);else if(1===e)if(ft(arguments[0]))r=new je(2*arguments[0]);else if(ir(arguments[0]))if((n=(r=arguments[0]).length)&&u(r)&&bo(r[0])){if(null===(r=Go(new je(2*n),r))){if(!vo(n))throw new RangeError("invalid argument. Array-like object input arguments must have a length which is a multiple of two. Length: `"+n+"`.");r=new je(arguments[0])}}else{if(qo(r))r=xo(r,0);else if(Zo(r))r=Ro(r,0);else if(!vo(n))throw new RangeError("invalid argument. Array-like object and typed array input arguments must have a length which is a multiple of two. Length: `"+n+"`.");r=new je(r)}else if(Ae(arguments[0])){if(!nt((r=arguments[0]).byteLength/zo))throw new RangeError("invalid argument. ArrayBuffer byte length must be a multiple of "+zo+". Byte length: `"+r.byteLength+"`.");r=new je(r)}else{if(!f(arguments[0]))throw new TypeError("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `"+arguments[0]+"`.");if(r=arguments[0],!1===Jo)throw new TypeError("invalid argument. Environment lacks Symbol.iterator support. Must provide a length, ArrayBuffer, typed array, or array-like object. Value: `"+r+"`.");if(!D(r[Eo]))throw new TypeError("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `"+r+"`.");if(!D((r=r[Eo]()).next))throw new TypeError("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable.");if((r=Do(r))instanceof Error)throw r;r=new je(r)}else{if(!Ae(r=arguments[0]))throw new TypeError("invalid argument. First argument must be an array buffer. Value: `"+r+"`.");if(!ft(t=arguments[1]))throw new TypeError("invalid argument. Byte offset must be a nonnegative integer. Value: `"+t+"`.");if(!nt(t/zo))throw new RangeError("invalid argument. Byte offset must be a multiple of "+zo+". Value: `"+t+"`.");if(2===e){if(!nt((n=r.byteLength-t)/zo))throw new RangeError("invalid arguments. ArrayBuffer view byte length must be a multiple of "+zo+". View byte length: `"+n+"`.");r=new je(r,t)}else{if(!ft(n=arguments[2]))throw new TypeError("invalid argument. Length must be a nonnegative integer. Value: `"+n+"`.");if(n*zo>r.byteLength-t)throw new RangeError("invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `"+n*zo+"`.");r=new je(r,t,2*n)}}return v(this,"_buffer",r),v(this,"_length",r.length/2),this}v(Ho,"BYTES_PER_ELEMENT",zo),v(Ho,"name","Complex128Array"),v(Ho,"from",(function(t){var e,r,n,i,o,a,u,s,l,c,h;if(!D(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!Xo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if((r=arguments.length)>1){if(!D(n=arguments[1]))throw new TypeError("invalid argument. Second argument must be a function. Value: `"+n+"`.");r>2&&(e=arguments[2])}if($o(t)){if(u=t.length,n){for(o=(i=new this(u))._buffer,h=0,c=0;c<u;c++){if(bo(l=n.call(e,t.get(c),c)))o[h]=bt(l),o[h+1]=vt(l);else{if(!(ho(l)&&l.length>=2))throw new TypeError("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `"+l+"`.");o[h]=l[0],o[h+1]=l[1]}h+=2}return i}return new this(t)}if(ir(t)){if(n){for(u=t.length,a=Uo(t),c=0;c<u;c++)if(!bo(a.getter(t,c))){s=!0;break}if(s){if(!vo(u))throw new RangeError("invalid argument. First argument must have a length which is a multiple of two. Length: `"+u+"`.");for(o=(i=new this(u/2))._buffer,c=0;c<u;c++)o[c]=n.call(e,a.getter(t,c),c);return i}for(o=(i=new this(u))._buffer,h=0,c=0;c<u;c++){if(bo(l=n.call(e,a.getter(t,c),c)))o[h]=bt(l),o[h+1]=vt(l);else{if(!(ho(l)&&l.length>=2))throw new TypeError("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `"+l+"`.");o[h]=l[0],o[h+1]=l[1]}h+=2}return i}return new this(t)}if(f(t)&&Jo&&D(t[Eo])){if(!D((o=t[Eo]()).next))throw new TypeError("invalid argument. First argument must be an array-like object or an iterable.");if((a=n?Wo(o,n,e):Do(o))instanceof Error)throw a;for(o=(i=new this(u=a.length/2))._buffer,c=0;c<u;c++)o[c]=a[c];return i}throw new TypeError("invalid argument. First argument must be an array-like object or an iterable. Value: `"+t+"`.")})),v(Ho,"of",(function(){var t,e;if(!D(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!Xo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(t=[],e=0;e<arguments.length;e++)t.push(arguments[e]);return new this(t)})),ht(Ho.prototype,"buffer",(function(){return this._buffer.buffer})),ht(Ho.prototype,"byteLength",(function(){return this._buffer.byteLength})),ht(Ho.prototype,"byteOffset",(function(){return this._buffer.byteOffset})),v(Ho.prototype,"BYTES_PER_ELEMENT",Ho.BYTES_PER_ELEMENT),v(Ho.prototype,"copyWithin",(function(t,e){if(!$o(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return 2===arguments.length?this._buffer.copyWithin(2*t,2*e):this._buffer.copyWithin(2*t,2*e,2*arguments[2]),this})),v(Ho.prototype,"entries",(function(){var t,e,r,n,i,o,a;if(!$o(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return e=this,t=this._buffer,n=this._length,o=-1,a=-2,v(r={},"next",(function(){var e;if(o+=1,i||o>=n)return{done:!0};return e=new po(t[a+=2],t[a+1]),{value:[o,e],done:!1}})),v(r,"return",(function(t){if(i=!0,arguments.length)return{value:t,done:!0};return{done:!0}})),Eo&&v(r,Eo,(function(){return e.entries()})),r})),v(Ho.prototype,"get",(function(t){var e;if(!$o(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!ft(t))throw new TypeError("invalid argument. Must provide a nonnegative integer. Value: `"+t+"`.");if(!(t>=this._length))return new po((e=this._buffer)[t*=2],e[t+1])})),ht(Ho.prototype,"length",(function(){return this._length})),v(Ho.prototype,"set",(function(t){var e,r,n,i,o,a,u,f,s;if(!$o(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(n=this._buffer,arguments.length>1){if(!ft(r=arguments[1]))throw new TypeError("invalid argument. Index argument must be a nonnegative integer. Value: `"+r+"`.")}else r=0;if(bo(t)){if(r>=this._length)throw new RangeError("invalid argument. Index argument is out-of-bounds. Value: `"+r+"`.");return n[r*=2]=bt(t),void(n[r+1]=vt(t))}if($o(t)){if(r+(a=t._length)>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(e=t._buffer,s=n.byteOffset+r*zo,e.buffer===n.buffer&&e.byteOffset<s&&e.byteOffset+e.byteLength>s){for(i=new je(e.length),f=0;f<e.length;f++)i[f]=e[f];e=i}for(r*=2,s=0,f=0;f<a;f++)n[r]=e[s],n[r+1]=e[s+1],r+=2,s+=2}else{if(!ir(t))throw new TypeError("invalid argument. First argument must be either a complex number, an array-like object, or a complex number array. Value: `"+t+"`.");for(a=t.length,f=0;f<a;f++)if(!bo(t[f])){o=!0;break}if(o){if(!vo(a))throw new RangeError("invalid argument. Array-like object arguments must have a length which is a multiple of two. Length: `"+a+"`.");if(r+a/2>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(e=t,s=n.byteOffset+r*zo,e.buffer===n.buffer&&e.byteOffset<s&&e.byteOffset+e.byteLength>s){for(i=new je(a),f=0;f<a;f++)i[f]=e[f];e=i}for(r*=2,a/=2,s=0,f=0;f<a;f++)n[r]=e[s],n[r+1]=e[s+1],r+=2,s+=2;return}if(r+a>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");for(r*=2,f=0;f<a;f++)u=t[f],n[r]=bt(u),n[r+1]=vt(u),r+=2}}));var Ko={binary:Vi,float64:je,float32:Yi,generic:Array,int16:zi,int32:Zi,int8:eo,uint16:be,uint32:ao,uint8:pe,uint8c:co,complex64:Fo,complex128:Ho};function Qo(t){return Ko[t]||null}var ta=D(Vi.allocUnsafe)?function(t){if(!lt(t))throw new TypeError("invalid argument. Must provide a nonnegative integer. Value: `"+t+"`");return Vi.allocUnsafe(t)}:function(t){if(!lt(t))throw new TypeError("invalid argument. Must provide a nonnegative integer. Value: `"+t+"`");return new Vi(t)};function ea(t,e){return"generic"===t?function(t){var e,r;for(e=[],r=0;r<t;r++)e.push(0);return e}(e):"binary"===t?function(t){return function(t){var e;for(e=0;e<t.length;e++)t[e]=0;return t}(ta(t))}(e):function(t,e){var r=Qo(t);return r?new r(e):null}(t,e)}var ra={Buffer:"binary",Float32Array:"float32",Float64Array:"float64",Array:"generic",Int16Array:"int16",Int32Array:"int32",Int8Array:"int8",Object:"generic",Uint16Array:"uint16",Uint32Array:"uint32",Uint8Array:"uint8",Uint8ClampedArray:"uint8c",Complex64Array:"complex64",Complex128Array:"complex128"},na=[je,Yi,Zi,ao,zi,be,eo,pe,co,Fo,Ho],ia=["float64","float32","int32","uint32","int16","uint16","int8","uint8","uint8c","complex64","complex128"],oa=ia.length;function aa(t){var e;if(u(t))return"generic";if(N(t))return"binary";for(e=0;e<oa;e++)if(t instanceof na[e])return ia[e];return ra[Y(t)]||null}function ua(t,e){var r=e[0];return ho(r)&&(t.push(r.length),ua(t,r)),t}function fa(t,e,r,n,i){var o,a,u;for(o=e[r],u=0;u<n.length;u++){if(!ho(a=n[u])||a.length!==o)return r;if(i&&(a=fa(t,e,r+1,a,r+1<t-1))<t)return a}return t}function sa(t){var e,r;if(!ho(t))throw new TypeError("invalid argument. Must provide an array-like object. Value: `"+t+"`.");return ua(e=[t.length],t),(r=e.length)>1&&(e.length=fa(r,e,1,t,r>2)),e}function la(t,e,r,n,i,o){var a,u,f,s,l;for(a=t.length,u=1,l=0;l<a;l++)u*=t[l];if("clamp"===o)i<0?i=0:i>=u&&(i=u-1);else if("wrap"===o)i<0?(i+=u)<0&&0!==(i%=u)&&(i+=u):i>=u&&(i-=u)>=u&&(i%=u);else if(i<0||i>=u)throw new RangeError("invalid argument. Linear index must not exceed array dimensions. Number of array elements: "+u+". Value: `"+i+"`.");if(f=r,"column-major"===n){for(l=0;l<a;l++)i-=s=i%t[l],i/=t[l],f+=s*e[l];return f}for(l=a-1;l>=0;l--)i-=s=i%t[l],i/=t[l],f+=s*e[l];return f}function ca(t,e,r,n){var i,o,a,u,f,s,l,c;for(i=e.data,o=e.setter,a=e.getter,l=rt(t/2),s=(f=n)+(t-1)*r,c=0;c<l;c++)u=a(i,f),o(i,f,a(i,s)),o(i,s,u),f+=r,s-=r;return e}function ha(t,e,r){var n,i,o,a,u,f,s;if(t<=0)return e;if((a=Uo(e)).accessors)return ca(t,a,r,i=r<0?(1-t)*r:0),a.data;if(f=rt(t/2),1===r){if(o=t-1,(u=f%3)>0)for(i=0;i<u;i++)n=e[i],e[i]=e[o],e[o]=n,o-=1;if(f<3)return e;for(i=u;i<f;i+=3)n=e[i],e[i]=e[o],e[o]=n,n=e[i+1],e[i+1]=e[o-1],e[o-1]=n,n=e[i+2],e[i+2]=e[o-2],e[o-2]=n,o-=3;return e}for(o=(i=r<0?(1-t)*r:0)+(t-1)*r,s=0;s<f;s++)n=e[i],e[i]=e[o],e[o]=n,i+=r,o-=r;return e}v(ha,"ndarray",(function(t,e,r,n){var i,o,a,u,f,s,l;if(t<=0)return e;if((u=Uo(e)).accessors)return ca(t,u,r,n),u.data;if(s=rt(t/2),o=n,1===r){if(a=o+t-1,(f=s%3)>0)for(l=0;l<f;l++)i=e[o],e[o]=e[a],e[a]=i,o+=r,a-=r;if(s<3)return e;for(l=f;l<s;l+=3)i=e[o],e[o]=e[a],e[a]=i,i=e[o+1],e[o+1]=e[a-1],e[a-1]=i,i=e[o+2],e[o+2]=e[a-2],e[a-2]=i,o+=3,a-=3;return e}for(a=o+(t-1)*r,l=0;l<s;l++)i=e[o],e[o]=e[a],e[a]=i,o+=r,a-=r;return e}));function pa(t,e,r){var n;for(n=0;n<r;n++)t.push(e[n]);return t}function ga(t,e,r,n,i){var o,a,u,f;for(o=(u=i+1)===r,a=n[i],f=0;f<a;f++)o?t.push(e[f]):ga(t,e[f],r,n,u);return t}function ya(t,e,r){var n,i;return i=[],0===(n=e.length)?i:1===n?pa(i,t,e[0]):r?function(t,e,r,n){var i,o,a,u,f,s,l;for(o=ga([],e,r,n,0),i=Lr(n),f=Sr(n,a="row-major"),ha(r,u=pa([],n,r),1),ha(r,f,1),l=0;l<i;l++)s=la(u,f,0,a,l,"throw"),t.push(o[s]);return t}(i,t,n,e):ga(i,t,n,e,0)}function ma(){var t,e=arguments,r=e[0],n="https://stdlib.io/e/"+r+"?";for(t=1;t<e.length;t++)n+="&arg[]="+encodeURIComponent(e[t]);return n}function da(t){return"object"==typeof t&&null!==t&&"number"==typeof t.length&&nt(t.length)&&t.length>=0&&t.length<tt}function wa(){return{dtypes:{default:"float64",numeric:"float64",real:"float64",floating_point:"float64",real_floating_point:"float64",complex_floating_point:"complex128",integer:"int32",signed_integer:"int32",unsigned_integer:"uint32"},order:"row-major",casting:"safe",index_mode:"throw"}}var ba={dtypes:{default:"float64",numeric:"float64",real:"float64",floating_point:"float64",real_floating_point:"float64",complex_floating_point:"complex128",integer:"int32",signed_integer:"int32",unsigned_integer:"uint32"},order:"row-major",casting:"safe",index_mode:"throw"},va={"dtypes.default":ba.dtypes.default,"dtypes.numeric":ba.dtypes.numeric,"dtypes.real":ba.dtypes.real,"dtypes.floating_point":ba.dtypes.floating_point,"dtypes.real_floating_point":ba.dtypes.real_floating_point,"dtypes.complex_floating_point":ba.dtypes.complex_floating_point,"dtypes.integer":ba.dtypes.integer,"dtypes.signed_integer":ba.dtypes.signed_integer,"dtypes.unsigned_integer":ba.dtypes.unsigned_integer,order:ba.order,casting:ba.casting,index_mode:ba.index_mode};function _a(t,e,r){var n,i,o;if(n=Qo(r),"generic"===r)for(i=[],o=0;o<e;o++)i.push(t[o]);else if("binary"===r)for(i=ta(e),o=0;o<e;o++)i[o]=t[o];else for(i=new n(e),o=0;o<e;o++)i[o]=t[o];return i}function Ea(t,e){return"generic"===e?function(t){var e,r,n;for(e=t.length,r=[],n=0;n<e;n++)r.push(t.get(n));return r}(t):"binary"===e?function(t){var e,r,n;for(e=t.length,r=ta(e),n=0;n<e;n++)r[n]=t.get(n);return r}(t):function(t,e){var r,n,i;for(n=new(Qo(e))(r=t.length),i=0;i<r;i++)n[i]=t.get(i);return n}(t,e)}function Aa(t,e,r){var n,i;for(n=[],i=0;i<r-t;i++)n.push(1);for(i=0;i<t;i++)n.push(e[i]);return n}function Ta(t,e,r,n){var i,o,a,u,f;if(f=t-(o=r.length),i=[],"row-major"===n){for(a=gt(r[0])*e[f],u=0;u<f;u++)i.push(a);for(u=0;u<o;u++)i.push(r[u])}else{for(u=0;u<f;u++)i.push(1);for(u=0;u<o;u++)i.push(r[u])}return i}v(wa,"get",(function(t){var e=va[t];return void 0===e?null:e}));var xa={casting:wa.get("casting"),copy:!1,dtype:wa.get("dtypes.default"),flatten:!0,mode:wa.get("index_mode"),ndmin:0,order:wa.get("order"),readonly:!1};function Ra(){var t,r,n,i,o,a,f,s,l,c,h,p,g,y;if(1===arguments.length)if(da(arguments[0]))n=arguments[0],t={};else{if(!$(t=arguments[0]))throw new TypeError(ma("0Le5K",t));if(e(t,"buffer")&&!da(n=t.buffer))throw new TypeError(ma("0Le5L","buffer",n))}else{if(!da(n=arguments[0]))throw new TypeError(ma("0Le5M",n));if(!$(t=arguments[1]))throw new TypeError(ma("0Le2h",t))}if(n&&(Ir(n)?(f=n.dtype,y=!0):(f=aa(n),y=!1)),c={},h={},e(t,"casting")){if(h.casting=t.casting,!pn(h.casting))throw new TypeError(ma("0Le5N","casting",h.casting))}else h.casting=xa.casting;if(e(t,"flatten")){if(h.flatten=t.flatten,!_(h.flatten))throw new TypeError(ma("0Le30","flatten",h.flatten))}else h.flatten=xa.flatten;if(e(t,"ndmin")){if(h.ndmin=t.ndmin,!ft(h.ndmin))throw new TypeError(ma("0Le35","ndmin",h.ndmin))}else h.ndmin=xa.ndmin;if(e(t,"dtype")){if(!zr(a=t.dtype))throw new TypeError(ma("0Le5O","dtype",a));if(f&&!Un(f,a,h.casting))throw new Error(ma("0Le5P",h.casting,f,a))}else a=f&&(y||"generic"!==f)?f:xa.dtype;if(e(t,"order")){if("any"===(o=t.order)||"same"===o)y?"any"===o?o=3===yt(n.strides)?xa.order:n.order:"same"===o&&(o=n.order):o=xa.order;else if(!Dr(o))throw new TypeError(ma("0Le5Q","order",o))}else o=xa.order;if(e(t,"mode")?c.mode=t.mode:c.mode=xa.mode,e(t,"submode")?c.submode=t.submode:c.submode=[c.mode],e(t,"readonly")?c.readonly=t.readonly:c.readonly=xa.readonly,e(t,"copy")){if(h.copy=t.copy,!_(h.copy))throw new TypeError(ma("0Le30","copy",h.copy))}else h.copy=xa.copy;if(e(t,"shape")){if(!da(s=t.shape))throw new TypeError(ma("0Le5R","shape",s));l=s.length,g=Lr(s)}else{if(!n)throw new Error(ma("0Le0X"));y?(s=n.shape,l=n.ndims,g=n.length):h.flatten&&u(n)?(p=s=sa(n),l=s.length,g=Lr(s)):(l=1,s=[g=n.length])}if(l<h.ndmin&&(s=Aa(l,s,h.ndmin),l=h.ndmin),y){if(n.length!==g)throw new RangeError(ma("0Le0Y"));f!==a||h.copy?n=Ea(n,a):(r=n.strides,i=n.offset,n=n.data,r.length<l&&(r=Ta(l,s,r,o)))}else if(n){if("generic"===f&&h.flatten&&(n=ya(n,p||sa(n),!1)),n.length!==g)throw new RangeError(ma("0Le0Y"));(f!==a||h.copy)&&(n=_a(n,g,a))}else n=ea(a,g);return void 0===r&&(i=Ur(s,r=Sr(s,o))),new fn(a,n,s,r,i,o,c)}export{Ra as default};
//# sourceMappingURL=mod.js.map