-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmod.js
4 lines (4 loc) · 95.4 KB
/
mod.js
1
2
3
4
// Copyright (c) 2022 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 E(t){return"boolean"==typeof t}var _=Boolean.prototype.toString;var A=n();function T(t){return"object"==typeof t&&(t instanceof Boolean||(A?function(t){try{return _.call(t),!0}catch(t){return!1}}(t):"[object Boolean]"===a(t)))}function x(t){return E(t)||T(t)}function O(){return new Function("return this;")()}v(x,"isPrimitive",E),v(x,"isObject",T);var R="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(!E(t))throw new TypeError("invalid argument. Must provide a boolean primitive. Value: `"+t+"`.");if(t)return O()}if(R)return R;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 M=/^\s*function\s*([^(]*)/i;function k(t){return null!==t&&"object"==typeof t}v(V,"REGEXP",M);var C=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}}(k);function N(t){return k(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=M.exec(n.toString()))return e[1]}return N(t)?"Buffer":r}v(k,"isObjectLikeArray",C);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 z,G=Object.getPrototypeOf;z=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 W=z;function $(t){return null==t?null:(t=Object(t),W(t))}var J=Object.prototype;function X(t){var r;return!!f(t)&&(!(r=$(t))||!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 q(t){return"number"==typeof t}var Z=Number,H=Z.prototype.toString;var K=n();function Q(t){return"object"==typeof t&&(t instanceof Z||(K?function(t){try{return H.call(t),!0}catch(t){return!1}}(t):"[object Number]"===a(t)))}function tt(t){return q(t)||Q(t)}v(tt,"isPrimitive",q),v(tt,"isObject",Q);var et=Number.POSITIVE_INFINITY,rt=Z.NEGATIVE_INFINITY,nt=Math.floor;function it(t){return nt(t)===t}function ot(t){return t<et&&t>rt&&it(t)}function at(t){return q(t)&&ot(t)}function ut(t){return Q(t)&&ot(t.valueOf())}function ft(t){return at(t)||ut(t)}function st(t){return at(t)&&t>=0}function lt(t){return ut(t)&&t.valueOf()>=0}function ct(t){return st(t)||lt(t)}v(ft,"isPrimitive",at),v(ft,"isObject",ut),v(ct,"isPrimitive",st),v(ct,"isObject",lt);var ht=U();function pt(t,e,r){b(t,e,{configurable:!1,enumerable:!1,get:r})}var gt={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 yt(t){return Math.abs(t)}function mt(t){var e,r,n,i,o,a;if(0===(r=t.length))return 0;for(e=!0,n=!0,i=yt(t[0]),a=1;a<r;a++){if(o=yt(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 dt(t,e){return e&&(2===t||3===t)}function wt(t,e){return e&&(1===t||3===t)}function bt(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 vt(t){return t.re}function Et(t){return t.im}function _t(t){return"string"==typeof t}v(bt,"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 At=String.prototype.valueOf;var Tt=n();function xt(t){return"object"==typeof t&&(t instanceof String||(Tt?function(t){try{return At.call(t),!0}catch(t){return!1}}(t):"[object String]"===a(t)))}function Ot(t){return _t(t)||xt(t)}function Rt(t){return"number"==typeof t}function jt(t){var e,r="";for(e=0;e<t;e++)r+="0";return r}function It(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+jt(i):jt(i)+t,n&&(t="-"+t)),t}v(Ot,"isPrimitive",_t),v(Ot,"isObject",xt);var St=String.prototype.toLowerCase,Ut=String.prototype.toUpperCase;function Lt(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=It(r,t.precision,t.padRight)),r="-"+r):(r=n.toString(e),n||t.precision?t.precision&&(r=It(r,t.precision,t.padRight)):r="",t.sign&&(r=t.sign+r)),16===e&&(t.alternate&&(r="0x"+r),r=t.specifier===Ut.call(t.specifier)?Ut.call(r):St.call(r)),8===e&&t.alternate&&"0"!==r.charAt(0)&&(r="0"+r),r}function Bt(t){return"string"==typeof t}var Pt=Math.abs,Vt=String.prototype.toLowerCase,Mt=String.prototype.toUpperCase,kt=String.prototype.replace,Ct=/e\+(\d)$/,Nt=/e-(\d)$/,Yt=/^(\d+)$/,Ft=/^(\d+)e/,Dt=/\.0$/,zt=/\.0*e/,Gt=/(\..*[^0])0*e/;function Wt(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":Pt(n)<1e-4?((e=t.precision)>0&&(e-=1),r=n.toExponential(e)):r=n.toPrecision(t.precision),t.alternate||(r=kt.call(r,Gt,"$1e"),r=kt.call(r,zt,"e"),r=kt.call(r,Dt,""));break;default:throw new Error("invalid double notation. Value: "+t.specifier)}return r=kt.call(r,Ct,"e+0$1"),r=kt.call(r,Nt,"e-0$1"),t.alternate&&(r=kt.call(r,Yt,"$1."),r=kt.call(r,Ft,"$1.e")),n>=0&&t.sign&&(r=t.sign+r),r=t.specifier===Mt.call(t.specifier)?Mt.call(r):Vt.call(r)}function $t(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+$t(n):$t(n)+t}var Xt=String.fromCharCode,qt=isNaN,Zt=Array.isArray;function Ht(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 Kt(t){var e,r,n,i,o,a,u,f,s;if(!Zt(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(Bt(n=t[f]))a+=n;else{if(e=void 0!==n.precision,!(n=Ht(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,qt(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,qt(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=Lt(n);break;case"s":n.maxWidth=e?n.precision:-1;break;case"c":if(!qt(n.arg)){if((o=parseInt(n.arg,10))<0||o>127)throw new Error("invalid character code. Value: "+n.arg);n.arg=qt(o)?String(n.arg):Xt(o)}break;case"e":case"E":case"f":case"F":case"g":case"G":e||(n.precision=6),n.arg=Wt(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=It(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 Qt=/%(?:([1-9]\d*)\$)?([0 +\-#]*)(\*|\d+)?(?:(\.)(\*|\d+)?)?[hlL]?([%A-Za-z])/g;function te(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 ee(t){var e,r,n,i;for(r=[],i=0,n=Qt.exec(t);n;)(e=t.slice(i,Qt.lastIndex-n[0].length)).length&&r.push(e),r.push(te(n)),i=Qt.lastIndex,n=Qt.exec(t);return(e=t.slice(i)).length&&r.push(e),r}function re(t){return"string"==typeof t}function ne(t){var e,r,n;if(!re(t))throw new TypeError(ne("invalid argument. First argument must be a string. Value: `%s`.",t));for(e=ee(t),(r=new Array(arguments.length))[0]=e,n=1;n<r.length;n++)r[n]=arguments[n];return Kt.apply(null,r)}var ie=/[-\/\\^$*+?.()|[\]{}]/g;var oe=RegExp.prototype.exec;var ae=n();function ue(t){return"object"==typeof t&&(t instanceof RegExp||(ae?function(t){try{return oe.call(t),!0}catch(t){return!1}}(t):"[object RegExp]"===a(t)))}function fe(t,e,r){if(!_t(t))throw new TypeError(ne("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(ne("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(ie,"\\$&"):(e=(e=t.substring(1,r)).replace(ie,"\\$&"),t=t[0]+e+t.substring(r))}(e),e=new RegExp(e,"g");else if(!ue(e))throw new TypeError(ne("invalid argument. Second argument must be a string or regular expression. Value: `%s`.",e));if(!_t(r)&&!D(r))throw new TypeError(ne("invalid argument. Third argument must be a string or replacement function. Value: `%s`.",r));return t.replace(e,r)}var se={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 le="function"==typeof Uint8Array;var ce="function"==typeof Uint8Array?Uint8Array:null;var he,pe="function"==typeof Uint8Array?Uint8Array:void 0;he=function(){var t,e,r;if("function"!=typeof ce)return!1;try{e=new ce(e=[1,3.14,-3.14,256,257]),r=e,t=(le&&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}()?pe:function(){throw new Error("not implemented")};var ge=he,ye="function"==typeof Uint16Array;var me="function"==typeof Uint16Array?Uint16Array:null;var de,we="function"==typeof Uint16Array?Uint16Array:void 0;de=function(){var t,e,r;if("function"!=typeof me)return!1;try{e=new me(e=[1,3.14,-3.14,65536,65537]),r=e,t=(ye&&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}()?we:function(){throw new Error("not implemented")};var be,ve=de,Ee={uint16:ve,uint8:ge};(be=new Ee.uint16(1))[0]=4660;var _e=52===new Ee.uint8(be.buffer)[0],Ae="function"==typeof ArrayBuffer;function Te(t){return Ae&&t instanceof ArrayBuffer||"[object ArrayBuffer]"===a(t)}var xe="function"==typeof Float64Array;var Oe="function"==typeof Float64Array?Float64Array:null;var Re,je="function"==typeof Float64Array?Float64Array:void 0;Re=function(){var t,e,r;if("function"!=typeof Oe)return!1;try{e=new Oe([1,3.14,-3.14,NaN]),r=e,t=(xe&&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}()?je:function(){throw new Error("not implemented")};var Ie=Re,Se="function"==typeof ArrayBuffer?ArrayBuffer:null;var Ue,Le="function"==typeof ArrayBuffer?ArrayBuffer:void 0;Ue=function(){var t,e,r;if("function"!=typeof Se)return!1;try{(t=Te(r=new Se(16))&&"function"==typeof Se.isView)&&((e=new Ie(r))[0]=-3.14,e[1]=NaN,t=t&&Se.isView(e)&&16===r.byteLength&&-3.14===e[0]&&e[1]!=e[1])}catch(e){t=!1}return t}()?Le:function(){throw new Error("not implemented")};var Be=Ue,Pe="function"==typeof DataView;var Ve="function"==typeof DataView?DataView:null;var Me,ke="function"==typeof DataView?DataView:void 0;Me=function(){var t,e,r,n;if("function"!=typeof Ve)return!1;try{r=new Be(24),e=new Ve(r,8),n=e,(t=(Pe&&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}()?ke:function(){throw new Error("not implemented")};var Ce=Me,Ne="function"==typeof BigInt?BigInt:void 0,Ye=["binary","complex64","complex128","float32","float64","generic","int16","int32","int8","uint16","uint32","uint8","uint8c"];function Fe(){return Ye.slice()}function De(){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 ze(t,e,r){b(t,e,{configurable:!1,enumerable:!0,writable:!1,value:r})}function Ge(t){return Object.keys(Object(t))}var We=void 0!==Object.keys;function $e(t){return"[object Arguments]"===a(t)}var Je=function(){return $e(arguments)}();function Xe(t){return t!=t}function qe(t){return q(t)&&Xe(t)}function Ze(t){return Q(t)&&Xe(t.valueOf())}function He(t){return qe(t)||Ze(t)}v(He,"isPrimitive",qe),v(He,"isObject",Ze);var Ke=Object.prototype.propertyIsEnumerable;var Qe=!Ke.call("beep","0");function tr(t,e){var r;return null!=t&&(!(r=Ke.call(t,e))&&Qe&&Ot(t)?!qe(e=+e)&&at(e)&&e>=0&&e<t.length:r)}var er=Je?$e:function(t){return null!==t&&"object"==typeof t&&!u(t)&&"number"==typeof t.length&&it(t.length)&&t.length>=0&&t.length<=4294967295&&e(t,"callee")&&!tr(t,"callee")},rr=Array.prototype.slice;var nr=tr((function(){}),"prototype"),ir=!tr({toString:null},"toString");function or(t){return"object"==typeof t&&null!==t&&"number"==typeof t.length&&it(t.length)&&t.length>=0&&t.length<=9007199254740991}function ar(t,e,r){var n,i;if(!or(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(!at(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(He(e)){for(;i<n;i++)if(He(t[i]))return i}else for(;i<n;i++)if(t[i]===e)return i;return-1}function ur(t){return t.constructor&&t.constructor.prototype===t}var fr=["console","external","frame","frameElement","frames","innerHeight","innerWidth","outerHeight","outerWidth","pageXOffset","pageYOffset","parent","scrollLeft","scrollTop","scrollX","scrollY","self","webkitIndexedDB","webkitStorageInfo","window"],sr="undefined"==typeof window?void 0:window;var lr=function(){var t;if("undefined"===F(sr))return!1;for(t in sr)try{-1===ar(fr,t)&&e(sr,t)&&null!==sr[t]&&"object"===F(sr[t])&&ur(sr[t])}catch(t){return!0}return!1}(),cr="undefined"!=typeof window;var hr=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"];var pr=We?function(){return 2!==(Ge(arguments)||"").length}(1,2)?function(t){return er(t)?Ge(rr.call(t)):Ge(t)}:Ge:function(t){var r,n,i,o,a,u,f;if(o=[],er(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)&&!k(t))return o;n=nr&&i}for(a in t)n&&"prototype"===a||!e(t,a)||o.push(String(a));if(ir)for(r=function(t){if(!1===cr&&!lr)return ur(t);try{return ur(t)}catch(t){return!1}}(t),f=0;f<hr.length;f++)u=hr[f],r&&"constructor"===u||!e(t,u)||o.push(String(u));return o};v(Fe,"enum",De),function(t,e){var r,n,i;for(r=pr(e),i=0;i<r.length;i++)ze(t,n=r[i],e[n])}(Fe,{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 gr=["row-major","column-major"];function yr(){return gr.slice()}function mr(){return{"row-major":1,"column-major":2}}v(yr,"enum",mr);var dr=["throw","clamp","wrap"];function wr(){return dr.slice()}function br(){return{throw:1,clamp:2,wrap:3}}v(wr,"enum",br);var vr={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},Er={"row-major":1,"column-major":2},_r={throw:1,clamp:2,wrap:3};var Ar=new ge(8),Tr=new Ce(Ar.buffer);function xr(t,e,r,n){var i,o,a;if(0===t){for(a=0;a<Ar.length;a++)e[n]=0,n+=r;return e}for(o=(4294967295&t)>>>0,i=nt(t/4294967296),_e?(Tr.setUint32(0,o,_e),Tr.setUint32(4,i,_e)):(Tr.setUint32(0,i,_e),Tr.setUint32(4,o,_e)),a=0;a<Ar.length;a++)e[n]=Ar[a],n+=r;return e}v((function(t){var e,r,n,i;return e=new ge(8),0===t||(i=(4294967295&t)>>>0,n=nt(t/4294967296),r=new Ce(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",xr);var Or={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},jr={throw:1,clamp:2,wrap:3};function Ir(t,e,r,n,i,o){var a,u,f,s,l;if(!(this instanceof Ir))return new Ir(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 gt[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=bt(e,r,n))[1]-o[0]+1}(s,r,n,i,this._iterationOrder),f=mt(n),this._flags={ROW_MAJOR_CONTIGUOUS:wt(f,a),COLUMN_MAJOR_CONTIGUOUS:dt(f,a),READONLY:!1},this.__meta_dataview__=null,this}function Sr(t){return t instanceof Ir||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 Ur(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 Lr(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 Br(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(Ir,"name","ndarray"),pt(Ir.prototype,"byteLength",(function(){return this._byteLength})),pt(Ir.prototype,"BYTES_PER_ELEMENT",(function(){return this._bytesPerElement})),pt(Ir.prototype,"data",(function(){return this._buffer})),pt(Ir.prototype,"dtype",(function(){return this._dtype})),pt(Ir.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})),pt(Ir.prototype,"length",(function(){return this._length})),pt(Ir.prototype,"ndims",(function(){return this._ndims})),pt(Ir.prototype,"offset",(function(){return this._offset})),pt(Ir.prototype,"order",(function(){return this._order})),pt(Ir.prototype,"shape",(function(){return this._shape.slice()})),pt(Ir.prototype,"strides",(function(){return this._strides.slice()})),v(Ir.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(Ir.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(Ir.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(Ir.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(Ir.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+=vt(i=this.iget(o))+", "+Et(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+=vt(i=this.iget(o))+", "+Et(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+=vt(i=this.iget(this._length-1-o))+", "+Et(i),o>0&&(t+=", ");else for(o=2;o>=0;o--)t+=this.iget(this._length-1-o),o>0&&(t+=", ")}if(r+=fe(se[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(Ir.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(vt(r),Et(r));else for(n=0;n<e;n++)t.data.push(this.iget(n));return t})),v(Ir.prototype,"__array_meta_dataview__","function"==typeof ht.BigInt&&"function"==typeof BigInt&&"bigint"==typeof ht.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 Ce(new Be(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,vr[n],_e),s+=2,u.setBigInt64(s,Ne(c),_e),l=8*c,s+=8,p=0;p<c;p++)u.setBigInt64(s,Ne(i[p]),_e),u.setBigInt64(s+l,Ne(o[p]*t),_e),s+=8;for(s+=l,u.setBigInt64(s,Ne(this._offset*t),_e),s+=8,u.setInt8(s,Er[this._order]),s+=1,u.setInt8(s,_r[f]),s+=1,u.setBigInt64(s,Ne(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 Ce(new Be(n)),e=new ge(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,Or[i],_e),xr(h,e,1,l+=2),c=8*h,l+=8,g=0;g<h;g++)xr(o[g],e,1,l),xr(a[g]*t,e,1,l+c),l+=8;for(l+=c,xr(this._offset*t,e,1,l),l+=8,f.setInt8(l,Rr[this._order]),l+=1,f.setInt8(l,jr[s]),xr(p,e,1,l+=1),l+=8,g=0;g<p;g++)f.setInt8(l,jr[u[g]]),l+=1;return r=0,r|=this._flags.READONLY?4:0,f.setInt32(l,r,_e),this.__meta_dataview__=f,f}),v(Ur,"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 Pr(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&&it(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 Vr=Pr(ct.isPrimitive),Mr=Pr(ct.isObject),kr=Pr(ct);v(kr,"primitives",Vr),v(kr,"objects",Mr);var Cr=Pr(ft.isPrimitive),Nr=Pr(ft.isObject),Yr=Pr(ft);v(Yr,"primitives",Cr),v(Yr,"objects",Nr);var Fr=yr(),Dr=Fr.length;function zr(t){var e;for(e=0;e<Dr;e++)if(t===Fr[e])return!0;return!1}var Gr=Fe(),Wr=Gr.length;function $r(t){var e;for(e=0;e<Wr;e++)if(t===Gr[e])return!0;return!1}function Jr(t,e,r,n){var i=bt(e,r,n);return i[0]>=0&&i[1]<t}function Xr(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 qr=Object.create;function Zr(){}var Hr="function"==typeof qr?qr:function(t){return Zr.prototype=t,new Zr};var Kr="throw",Qr=!1;function tn(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 en=Ir.prototype.iget;var rn=Ir.prototype.iset;function nn(t,e){var r,n;for(r=[],n=0;n<e;n++)r.push(t[n]);return r}var on=wr(),an=on.length;function un(t){var e;for(e=0;e<an;e++)if(t===on[e])return!0;return!1}function fn(t,r){var n;if(!X(r))return new TypeError("invalid argument. Options must be an object. Value: `"+r+"`.");if(e(r,"mode")&&(t.mode=r.mode,!un(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(!un(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,!E(t.readonly))?new TypeError("invalid option. `readonly` option must be a boolean. Option: `"+t.readonly+"`."):null}function sn(t,e,r,n,i,o,a){var u,f,s,l,c;if(!(this instanceof sn))return arguments.length<7?new sn(t,e,r,n,i,o):new sn(t,e,r,n,i,o,a);if(!$r(t))throw new TypeError("invalid argument. `dtype` argument must be a supported ndarray data type. Value: `"+t+"`.");if(!or(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(!Vr(r)&&(!or(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(!Cr(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(!st(i))throw new TypeError("invalid argument. `offset` argument must be a nonnegative integer. Value: `"+i+"`.");if(!zr(o))throw new TypeError("invalid argument. `order` argument must be a supported order. Value: `"+o+"`.");if(u>0&&!Jr(e.length,r,n,i)&&Br(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=Kr,f.readonly=Qr,arguments.length>6&&(s=fn(f,a)))throw s;return this._mode=f.mode,void 0===f.submode&&(f.submode=[this._mode]),this._submode=f.submode,l=nn(r,u),c=nn(n,u||1),Ir.call(this,t,e,l,c,i,o),this._flags.READONLY=f.readonly,this}!function(t,e){var r=Xr(t);if(r)throw r;if(r=Xr(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=Hr(e.prototype),b(t.prototype,"constructor",{configurable:!0,enumerable:!1,writable:!0,value:t})}(sn,Ir),v(sn,"name","ndarray"),v(sn.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(!at(arguments[n]))throw new TypeError("invalid argument. Indices must be integer valued. Argument: "+n+". Value: `"+arguments[n]+"`.");e=tn(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(sn.prototype,"iget",(function(t){if(this._ndims>0){if(!at(t))throw new TypeError("invalid argument. Index must be an integer value. Value: `"+t+"`.");return t=tn(t,this._length-1,this._mode),en.call(this,t)}return en.call(this)})),v(sn.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(!at(arguments[n]))throw new TypeError("invalid argument. Indices must be integer valued. Argument: "+n+". Value: `"+arguments[n]+"`.");e=tn(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(sn.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(!at(t))throw new TypeError("invalid argument. Index must be an integer value. Value: `"+t+"`.");t=tn(t,this._length-1,this._mode),rn.call(this,t,e)}else rn.call(this,t);return this}));var ln=["none","equiv","safe","same-kind","unsafe"];function cn(){return ln.slice()}v(cn,"enum",(function(){return{none:0,equiv:1,safe:2,"same-kind":3,unsafe:4}}));var hn=cn(),pn=hn.length;function gn(t){var e;for(e=0;e<pn;e++)if(t===hn[e])return!0;return!1}var yn=["binary","complex64","complex128","float32","float64","generic","int16","int32","int8","uint16","uint32","uint8","uint8c"];function mn(){return yn.slice()}var dn={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 wn(){return{bool:dn.bool,int8:dn.int8,uint8:dn.uint8,uint8c:dn.uint8c,int16:dn.int16,uint16:dn.uint16,int32:dn.int32,uint32:dn.uint32,int64:dn.int64,uint64:dn.uint64,float32:dn.float32,float64:dn.float64,complex64:dn.complex64,complex128:dn.complex128,binary:dn.binary,generic:dn.generic,notype:dn.notype,userdefined_type:dn.userdefined_type}}v(mn,"enum",wn),function(t,e){var r,n,i;for(r=pr(e),i=0;i<r.length;i++)ze(t,n=r[i],e[n])}(mn,wn());var bn=function(t,r){var n,i,o,a,f,s,l,c=!0;if(!k(t))throw new TypeError("invalid argument. First argument must be object-like. Value: `"+t+"`.");if(arguments.length>1){if(!X(r))throw new TypeError("invalid argument. Options arguments must be an object. Value: `"+r+"`.");if(e(r,"duplicates")&&!E(c=r.duplicates))throw new TypeError("invalid argument. `duplicates` option must be a boolean primitive. Option: `"+c+"`.")}if(i=(n=pr(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}(wn(),{duplicates:!1});var vn={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 En(t){var e=typeof t;return"string"===e?null===function(t){var e=vn[t];return"number"==typeof e?e:null}(t)?null:t:"number"===e?function(t){var e=bn[t];return"string"==typeof e?e:null}(t):null}var _n,An={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 Tn(){var t,e,r,n,i,o,a,u,f;for(r={},e=(t=pr(An)).length,f=0;f<e;f++){for(i=t[f],a=An[i],n={},u=0;u<e;u++)n[o=t[u]]=a[o];r[i]=n}return r}function xn(){var t,e,r,n,i,o,a,u,f;for(r={},e=(t=pr(An)).length,f=0;f<e;f++){for(i=t[f],a=An[i],n=[],u=0;u<e;u++)1===a[o=t[u]]&&n.push(o);r[i]=n}return r}var On=function(t){return 0===arguments.length?Tn():(void 0===_n&&(_n=xn()),t=En(t),e(_n,t)?_n[t].slice():null)}();var Rn,jn={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 In(){var t,e,r,n,i,o,a,u,f;for(r={},e=(t=pr(jn)).length,f=0;f<e;f++){for(i=t[f],a=jn[i],n={},u=0;u<e;u++)n[o=t[u]]=a[o];r[i]=n}return r}function Sn(){var t,e,r,n,i,o,a,u,f;for(r={},e=(t=pr(jn)).length,f=0;f<e;f++){for(i=t[f],a=jn[i],n=[],u=0;u<e;u++)1===a[o=t[u]]&&n.push(o);r[i]=n}return r}var Un=function(t){return 0===arguments.length?In():(void 0===Rn&&(Rn=Sn()),t=En(t),e(Rn,t)?Rn[t].slice():null)}();function Ln(t,e,r){return"unsafe"===r||(t===e||"none"!==r&&"equiv"!==r&&("safe"===r?function(t,e){return t===e||On[t][e]>0}(t,e):function(t,e){return t===e||Un[t][e]>0}(t,e)))}var Bn=[],Pn=[],Vn="undefined"!=typeof Uint8Array?Uint8Array:Array,Mn=!1;function kn(){Mn=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=0,r=t.length;e<r;++e)Bn[e]=t[e],Pn[t.charCodeAt(e)]=e;Pn["-".charCodeAt(0)]=62,Pn["_".charCodeAt(0)]=63}function Cn(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(Bn[(i=n)>>18&63]+Bn[i>>12&63]+Bn[i>>6&63]+Bn[63&i]);return o.join("")}function Nn(t){var e;Mn||kn();for(var r=t.length,n=r%3,i="",o=[],a=16383,u=0,f=r-n;u<f;u+=a)o.push(Cn(t,u,u+a>f?f:u+a));return 1===n?(e=t[r-1],i+=Bn[e>>2],i+=Bn[e<<4&63],i+="=="):2===n&&(e=(t[r-2]<<8)+t[r-1],i+=Bn[e>>10],i+=Bn[e>>4&63],i+=Bn[e<<2&63],i+="="),o.push(i),o.join("")}function Yn(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 Fn(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 Dn={}.toString,zn=Array.isArray||function(t){return"[object Array]"==Dn.call(t)};function Gn(){return $n.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function Wn(t,e){if(Gn()<e)throw new RangeError("Invalid typed array length");return $n.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=$n.prototype:(null===t&&(t=new $n(e)),t.length=e),t}function $n(t,e,r){if(!($n.TYPED_ARRAY_SUPPORT||this instanceof $n))return new $n(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 Jn(this,t,e,r)}function Jn(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);$n.TYPED_ARRAY_SUPPORT?(t=e).__proto__=$n.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(!$n.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|Qn(e,r),i=(t=Wn(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=Wn(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?Wn(t,0):Zn(t,e);if("Buffer"===e.type&&zn(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=Wn(t,e<0?0:0|Hn(e)),!$n.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=Wn(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 Oi(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=$n.from(e,n)),Kn(e))return 0===e.length?-1:ni(t,e,r,n,i);if("number"==typeof e)return e&=255,$n.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 Ri(xi(e,t.length-r),t,r,n)}function ai(t,e,r,n){return Ri(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 Ri(Oi(e),t,r,n)}function si(t,e,r,n){return Ri(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?Nn(t):Nn(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)}$n.TYPED_ARRAY_SUPPORT=void 0===I.TYPED_ARRAY_SUPPORT||I.TYPED_ARRAY_SUPPORT,Gn(),$n.poolSize=8192,$n._augment=function(t){return t.__proto__=$n.prototype,t},$n.from=function(t,e,r){return Jn(null,t,e,r)},$n.TYPED_ARRAY_SUPPORT&&($n.prototype.__proto__=Uint8Array.prototype,$n.__proto__=Uint8Array),$n.alloc=function(t,e,r){return function(t,e,r,n){return Xn(e),e<=0?Wn(t,e):void 0!==r?"string"==typeof n?Wn(t,e).fill(r,n):Wn(t,e).fill(r):Wn(t,e)}(null,t,e,r)},$n.allocUnsafe=function(t){return qn(null,t)},$n.allocUnsafeSlow=function(t){return qn(null,t)},$n.isBuffer=function(t){return null!=t&&(!!t._isBuffer||ji(t)||function(t){return"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&ji(t.slice(0,0))}(t))},$n.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},$n.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}},$n.concat=function(t,e){if(!zn(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return $n.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=$n.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},$n.byteLength=Qn,$n.prototype._isBuffer=!0,$n.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},$n.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},$n.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},$n.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?ci(this,0,t):ti.apply(this,arguments)},$n.prototype.equals=function(t){if(!Kn(t))throw new TypeError("Argument must be a Buffer");return this===t||0===$n.compare(this,t)},$n.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+">"},$n.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},$n.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},$n.prototype.indexOf=function(t,e,r){return ri(this,t,e,r,!0)},$n.prototype.lastIndexOf=function(t,e,r){return ri(this,t,e,r,!1)},$n.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}},$n.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 Ei(t,e,r,n,i){return i||vi(t,0,r,4),Fn(t,e,r,n,23,4),r+4}function _i(t,e,r,n,i){return i||vi(t,0,r,8),Fn(t,e,r,n,52,8),r+8}$n.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),$n.TYPED_ARRAY_SUPPORT)(r=this.subarray(t,e)).__proto__=$n.prototype;else{var i=e-t;r=new $n(i,void 0);for(var o=0;o<i;++o)r[o]=this[o+t]}return r},$n.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},$n.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},$n.prototype.readUInt8=function(t,e){return e||mi(t,1,this.length),this[t]},$n.prototype.readUInt16LE=function(t,e){return e||mi(t,2,this.length),this[t]|this[t+1]<<8},$n.prototype.readUInt16BE=function(t,e){return e||mi(t,2,this.length),this[t]<<8|this[t+1]},$n.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]},$n.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])},$n.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},$n.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},$n.prototype.readInt8=function(t,e){return e||mi(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},$n.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},$n.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},$n.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},$n.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]},$n.prototype.readFloatLE=function(t,e){return e||mi(t,4,this.length),Yn(this,t,!0,23,4)},$n.prototype.readFloatBE=function(t,e){return e||mi(t,4,this.length),Yn(this,t,!1,23,4)},$n.prototype.readDoubleLE=function(t,e){return e||mi(t,8,this.length),Yn(this,t,!0,52,8)},$n.prototype.readDoubleBE=function(t,e){return e||mi(t,8,this.length),Yn(this,t,!1,52,8)},$n.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},$n.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},$n.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||di(this,t,e,1,255,0),$n.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},$n.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||di(this,t,e,2,65535,0),$n.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):wi(this,t,e,!0),e+2},$n.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||di(this,t,e,2,65535,0),$n.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):wi(this,t,e,!1),e+2},$n.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||di(this,t,e,4,4294967295,0),$n.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},$n.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||di(this,t,e,4,4294967295,0),$n.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},$n.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},$n.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},$n.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||di(this,t,e,1,127,-128),$n.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},$n.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||di(this,t,e,2,32767,-32768),$n.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):wi(this,t,e,!0),e+2},$n.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||di(this,t,e,2,32767,-32768),$n.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):wi(this,t,e,!1),e+2},$n.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||di(this,t,e,4,2147483647,-2147483648),$n.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},$n.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),$n.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},$n.prototype.writeFloatLE=function(t,e,r){return Ei(this,t,e,!0,r)},$n.prototype.writeFloatBE=function(t,e,r){return Ei(this,t,e,!1,r)},$n.prototype.writeDoubleLE=function(t,e,r){return _i(this,t,e,!0,r)},$n.prototype.writeDoubleBE=function(t,e,r){return _i(this,t,e,!1,r)},$n.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||!$n.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},$n.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&&!$n.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 $n(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 Oi(t){return function(t){var e,r,n,i,o,a;Mn||kn();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 Vn(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=Pn[t.charCodeAt(e)]<<18|Pn[t.charCodeAt(e+1)]<<12|Pn[t.charCodeAt(e+2)]<<6|Pn[t.charCodeAt(e+3)],a[f++]=i>>16&255,a[f++]=i>>8&255,a[f++]=255&i;return 2===o?(i=Pn[t.charCodeAt(e)]<<2|Pn[t.charCodeAt(e+1)]>>4,a[f++]=255&i):1===o&&(i=Pn[t.charCodeAt(e)]<<10|Pn[t.charCodeAt(e+1)]<<4|Pn[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 Ri(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!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}var Ii,Si=$n;Ii=function(){var t,e;if("function"!=typeof Si)return!1;try{t=N(e="function"==typeof Si.from?Si.from([1,2,3,4]):new Si([1,2,3,4]))&&1===e[0]&&2===e[1]&&3===e[2]&&4===e[3]}catch(e){t=!1}return t}()?$n:function(){throw new Error("not implemented")};var Ui=Ii,Li="function"==typeof Float32Array;var Bi="function"==typeof Float32Array?Float32Array:null;var Pi,Vi="function"==typeof Float32Array?Float32Array:void 0;Pi=function(){var t,e,r;if("function"!=typeof Bi)return!1;try{e=new Bi([1,3.14,-3.14,5e40]),r=e,t=(Li&&r instanceof Float32Array||"[object Float32Array]"===a(r))&&1===e[0]&&3.140000104904175===e[1]&&-3.140000104904175===e[2]&&e[3]===et}catch(e){t=!1}return t}()?Vi:function(){throw new Error("not implemented")};var Mi=Pi,ki="function"==typeof Int16Array;var Ci="function"==typeof Int16Array?Int16Array:null;var Ni,Yi="function"==typeof Int16Array?Int16Array:void 0;Ni=function(){var t,e,r;if("function"!=typeof Ci)return!1;try{e=new Ci([1,3.14,-3.14,32768]),r=e,t=(ki&&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}()?Yi:function(){throw new Error("not implemented")};var Fi=Ni,Di="function"==typeof Int32Array;var zi="function"==typeof Int32Array?Int32Array:null;var Gi,Wi="function"==typeof Int32Array?Int32Array:void 0;Gi=function(){var t,e,r;if("function"!=typeof zi)return!1;try{e=new zi([1,3.14,-3.14,2147483648]),r=e,t=(Di&&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}()?Wi:function(){throw new Error("not implemented")};var $i=Gi,Ji="function"==typeof Int8Array;var Xi="function"==typeof Int8Array?Int8Array:null;var qi,Zi="function"==typeof Int8Array?Int8Array:void 0;qi=function(){var t,e,r;if("function"!=typeof Xi)return!1;try{e=new Xi([1,3.14,-3.14,128]),r=e,t=(Ji&&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}()?Zi:function(){throw new Error("not implemented")};var Hi=qi,Ki="function"==typeof Uint32Array;var Qi="function"==typeof Uint32Array?Uint32Array:null;var to,eo="function"==typeof Uint32Array?Uint32Array:void 0;to=function(){var t,e,r;if("function"!=typeof Qi)return!1;try{e=new Qi(e=[1,3.14,-3.14,4294967296,4294967297]),r=e,t=(Ki&&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}()?eo:function(){throw new Error("not implemented")};var ro=to,no="function"==typeof Uint8ClampedArray;var io="function"==typeof Uint8ClampedArray?Uint8ClampedArray:null;var oo,ao="function"==typeof Uint8ClampedArray?Uint8ClampedArray:void 0;oo=function(){var t,e,r;if("function"!=typeof io)return!1;try{e=new io([-1,0,1,3.14,4.99,255,256]),r=e,t=(no&&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}()?ao:function(){throw new Error("not implemented")};var uo=oo;function fo(t){return"object"==typeof t&&null!==t&&"number"==typeof t.length&&it(t.length)&&t.length>=0&&t.length<=4294967295}function so(t,e){if(!(this instanceof so))throw new TypeError("invalid invocation. Constructor must be called with the `new` keyword.");if(!q(t))throw new TypeError("invalid argument. Real component must be a number primitive. Value: `"+t+"`.");if(!q(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(so,"BYTES_PER_ELEMENT",8),v(so.prototype,"BYTES_PER_ELEMENT",8),v(so.prototype,"byteLength",16),v(so.prototype,"toString",(function(){var t=""+this.re;return this.im<0?t+=" - "+-this.im:t+=" + "+this.im,t+="i"})),v(so.prototype,"toJSON",(function(){var t={type:"Complex128"};return t.re=this.re,t.im=this.im,t}));var lo="function"==typeof Math.fround?Math.fround:null,co=new Mi(1);var ho="function"==typeof lo?lo:function(t){return co[0]=t,co[0]};function po(t,e){if(!(this instanceof po))throw new TypeError("invalid invocation. Constructor must be called with the `new` keyword.");if(!q(t))throw new TypeError("invalid argument. Real component must be a number primitive. Value: `"+t+"`.");if(!q(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:ho(t)}),b(this,"im",{configurable:!1,enumerable:!0,writable:!1,value:ho(e)}),this}function go(t){return t instanceof so||t instanceof po||"object"==typeof t&&null!==t&&"number"==typeof t.re&&"number"==typeof t.im}function yo(t){return it(t/2)}function mo(){return"function"==typeof Symbol&&"symbol"==typeof Symbol("foo")&&e(Symbol,"iterator")&&"symbol"==typeof Symbol.iterator}v(po,"BYTES_PER_ELEMENT",4),v(po.prototype,"BYTES_PER_ELEMENT",4),v(po.prototype,"byteLength",8),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:"Complex64"};return t.re=this.re,t.im=this.im,t}));var wo=mo()?Symbol.iterator:null;function bo(t){return t.re}function vo(t){return t.im}function Eo(t,e){return new Mi(t.buffer,t.byteOffset+t.BYTES_PER_ELEMENT*e,2*(t.length-e))}function _o(t,e){return new Ie(t.buffer,t.byteOffset+t.BYTES_PER_ELEMENT*e,2*(t.length-e))}function Ao(t,e){return t[e]}function To(t,e){return t.get(e)}function xo(t,e,r){t[e]=r}function Oo(t,e,r){t.set(r,e)}function Ro(t){var e=Boolean(t.get&&t.set);return{data:t,accessors:e,getter:e?To:Ao,setter:e?Oo:xo}}function jo(t){var e,r,n;for(e=[];!(r=t.next()).done;)if(fo(n=r.value)&&n.length>=2)e.push(n[0],n[1]);else{if(!go(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(bo(n),vo(n))}return e}function Io(t,e,r){var n,i,o,a;for(n=[],a=-1;!(i=t.next()).done;)if(a+=1,fo(o=e.call(r,i.value,a))&&o.length>=2)n.push(o[0],o[1]);else{if(!go(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(bo(o),vo(o))}return n}function So(t,e){var r,n,i,o;for(r=e.length,o=0,i=0;i<r;i++){if(!go(n=e[i]))return null;t[o]=bo(n),t[o+1]=vo(n),o+=2}return t}var Uo=2*Mi.BYTES_PER_ELEMENT,Lo=mo();function Bo(t){return t instanceof ko||"object"==typeof t&&null!==t&&("Complex64Array"===t.constructor.name||"Complex128Array"===t.constructor.name)&&"number"==typeof t._length&&"object"==typeof t._buffer}function Po(t){return t===ko||"Complex128Array"===t.name}function Vo(t){return"object"==typeof t&&null!==t&&"Complex64Array"===t.constructor.name&&t.BYTES_PER_ELEMENT===Uo}function Mo(t){return"object"==typeof t&&null!==t&&"Complex128Array"===t.constructor.name&&t.BYTES_PER_ELEMENT===2*Uo}function ko(){var t,e,r,n;if(e=arguments.length,!(this instanceof ko))return 0===e?new ko:1===e?new ko(arguments[0]):2===e?new ko(arguments[0],arguments[1]):new ko(arguments[0],arguments[1],arguments[2]);if(0===e)r=new Mi(0);else if(1===e)if(st(arguments[0]))r=new Mi(2*arguments[0]);else if(or(arguments[0]))if((n=(r=arguments[0]).length)&&u(r)&&go(r[0])){if(null===(r=So(new Mi(2*n),r))){if(!yo(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 Mi(arguments[0])}}else{if(Vo(r))r=Eo(r,0);else if(Mo(r))r=_o(r,0);else if(!yo(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 Mi(r)}else if(Te(arguments[0])){if(!it((r=arguments[0]).byteLength/Uo))throw new RangeError("invalid argument. ArrayBuffer byte length must be a multiple of "+Uo+". Byte length: `"+r.byteLength+"`.");r=new Mi(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===Lo)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[wo]))throw new TypeError("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `"+r+"`.");if(!D((r=r[wo]()).next))throw new TypeError("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable.");if((r=jo(r))instanceof Error)throw r;r=new Mi(r)}else{if(!Te(r=arguments[0]))throw new TypeError("invalid argument. First argument must be an array buffer. Value: `"+r+"`.");if(!st(t=arguments[1]))throw new TypeError("invalid argument. Byte offset must be a nonnegative integer. Value: `"+t+"`.");if(!it(t/Uo))throw new RangeError("invalid argument. Byte offset must be a multiple of "+Uo+". Value: `"+t+"`.");if(2===e){if(!it((n=r.byteLength-t)/Uo))throw new RangeError("invalid arguments. ArrayBuffer view byte length must be a multiple of "+Uo+". View byte length: `"+n+"`.");r=new Mi(r,t)}else{if(!st(n=arguments[2]))throw new TypeError("invalid argument. Length must be a nonnegative integer. Value: `"+n+"`.");if(n*Uo>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*Uo+"`.");r=new Mi(r,t,2*n)}}return v(this,"_buffer",r),v(this,"_length",r.length/2),this}function Co(t){var e,r,n;for(e=[];!(r=t.next()).done;)if(fo(n=r.value)&&n.length>=2)e.push(n[0],n[1]);else{if(!go(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(vt(n),Et(n))}return e}function No(t,e,r){var n,i,o,a;for(n=[],a=-1;!(i=t.next()).done;)if(a+=1,fo(o=e.call(r,i.value,a))&&o.length>=2)n.push(o[0],o[1]);else{if(!go(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(vt(o),Et(o))}return n}function Yo(t,e){var r,n,i,o;for(r=e.length,o=0,i=0;i<r;i++){if(!go(n=e[i]))return null;t[o]=vt(n),t[o+1]=Et(n),o+=2}return t}v(ko,"BYTES_PER_ELEMENT",Uo),v(ko,"name","Complex64Array"),v(ko,"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(!Po(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(Bo(t)){if(u=t.length,n){for(o=(i=new this(u))._buffer,h=0,c=0;c<u;c++){if(go(l=n.call(e,t.get(c),c)))o[h]=bo(l),o[h+1]=vo(l);else{if(!(fo(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(or(t)){if(n){for(u=t.length,a=Ro(t),c=0;c<u;c++)if(!go(a.getter(t,c))){s=!0;break}if(s){if(!yo(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(go(l=n.call(e,a.getter(t,c),c)))o[h]=bo(l),o[h+1]=vo(l);else{if(!(fo(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)&&Lo&&D(t[wo])){if(!D((o=t[wo]()).next))throw new TypeError("invalid argument. First argument must be an array-like object or an iterable.");if((a=n?Io(o,n,e):jo(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(ko,"of",(function(){var t,e;if(!D(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!Po(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)})),pt(ko.prototype,"buffer",(function(){return this._buffer.buffer})),pt(ko.prototype,"byteLength",(function(){return this._buffer.byteLength})),pt(ko.prototype,"byteOffset",(function(){return this._buffer.byteOffset})),v(ko.prototype,"BYTES_PER_ELEMENT",ko.BYTES_PER_ELEMENT),v(ko.prototype,"copyWithin",(function(t,e){if(!Bo(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(ko.prototype,"entries",(function(){var t,e,r,n,i,o,a;if(!Bo(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}})),wo&&v(r,wo,(function(){return e.entries()})),r})),v(ko.prototype,"get",(function(t){var e;if(!Bo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!st(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])})),pt(ko.prototype,"length",(function(){return this._length})),v(ko.prototype,"set",(function(t){var e,r,n,i,o,a,u,f,s;if(!Bo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(n=this._buffer,arguments.length>1){if(!st(r=arguments[1]))throw new TypeError("invalid argument. Index argument must be a nonnegative integer. Value: `"+r+"`.")}else r=0;if(go(t)){if(r>=this._length)throw new RangeError("invalid argument. Index argument is out-of-bounds. Value: `"+r+"`.");return n[r*=2]=bo(t),void(n[r+1]=vo(t))}if(Bo(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*Uo,e.buffer===n.buffer&&e.byteOffset<s&&e.byteOffset+e.byteLength>s){for(i=new Mi(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(!or(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(!go(t[f])){o=!0;break}if(o){if(!yo(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*Uo,e.buffer===n.buffer&&e.byteOffset<s&&e.byteOffset+e.byteLength>s){for(i=new Mi(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]=bo(u),n[r+1]=vo(u),r+=2}}));var Fo=2*Ie.BYTES_PER_ELEMENT,Do=mo();function zo(t){return t instanceof Jo||"object"==typeof t&&null!==t&&("Complex64Array"===t.constructor.name||"Complex128Array"===t.constructor.name)&&"number"==typeof t._length&&"object"==typeof t._buffer}function Go(t){return t===Jo||"Complex64Array"===t.name}function Wo(t){return"object"==typeof t&&null!==t&&"Complex64Array"===t.constructor.name&&t.BYTES_PER_ELEMENT===Fo/2}function $o(t){return"object"==typeof t&&null!==t&&"Complex128Array"===t.constructor.name&&t.BYTES_PER_ELEMENT===Fo}function Jo(){var t,e,r,n;if(e=arguments.length,!(this instanceof Jo))return 0===e?new Jo:1===e?new Jo(arguments[0]):2===e?new Jo(arguments[0],arguments[1]):new Jo(arguments[0],arguments[1],arguments[2]);if(0===e)r=new Ie(0);else if(1===e)if(st(arguments[0]))r=new Ie(2*arguments[0]);else if(or(arguments[0]))if((n=(r=arguments[0]).length)&&u(r)&&go(r[0])){if(null===(r=Yo(new Ie(2*n),r))){if(!yo(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 Ie(arguments[0])}}else{if(Wo(r))r=Eo(r,0);else if($o(r))r=_o(r,0);else if(!yo(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 Ie(r)}else if(Te(arguments[0])){if(!it((r=arguments[0]).byteLength/Fo))throw new RangeError("invalid argument. ArrayBuffer byte length must be a multiple of "+Fo+". Byte length: `"+r.byteLength+"`.");r=new Ie(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===Do)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[wo]))throw new TypeError("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `"+r+"`.");if(!D((r=r[wo]()).next))throw new TypeError("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable.");if((r=Co(r))instanceof Error)throw r;r=new Ie(r)}else{if(!Te(r=arguments[0]))throw new TypeError("invalid argument. First argument must be an array buffer. Value: `"+r+"`.");if(!st(t=arguments[1]))throw new TypeError("invalid argument. Byte offset must be a nonnegative integer. Value: `"+t+"`.");if(!it(t/Fo))throw new RangeError("invalid argument. Byte offset must be a multiple of "+Fo+". Value: `"+t+"`.");if(2===e){if(!it((n=r.byteLength-t)/Fo))throw new RangeError("invalid arguments. ArrayBuffer view byte length must be a multiple of "+Fo+". View byte length: `"+n+"`.");r=new Ie(r,t)}else{if(!st(n=arguments[2]))throw new TypeError("invalid argument. Length must be a nonnegative integer. Value: `"+n+"`.");if(n*Fo>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*Fo+"`.");r=new Ie(r,t,2*n)}}return v(this,"_buffer",r),v(this,"_length",r.length/2),this}v(Jo,"BYTES_PER_ELEMENT",Fo),v(Jo,"name","Complex128Array"),v(Jo,"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(!Go(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(zo(t)){if(u=t.length,n){for(o=(i=new this(u))._buffer,h=0,c=0;c<u;c++){if(go(l=n.call(e,t.get(c),c)))o[h]=vt(l),o[h+1]=Et(l);else{if(!(fo(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(or(t)){if(n){for(u=t.length,a=Ro(t),c=0;c<u;c++)if(!go(a.getter(t,c))){s=!0;break}if(s){if(!yo(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(go(l=n.call(e,a.getter(t,c),c)))o[h]=vt(l),o[h+1]=Et(l);else{if(!(fo(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)&&Do&&D(t[wo])){if(!D((o=t[wo]()).next))throw new TypeError("invalid argument. First argument must be an array-like object or an iterable.");if((a=n?No(o,n,e):Co(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(Jo,"of",(function(){var t,e;if(!D(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!Go(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)})),pt(Jo.prototype,"buffer",(function(){return this._buffer.buffer})),pt(Jo.prototype,"byteLength",(function(){return this._buffer.byteLength})),pt(Jo.prototype,"byteOffset",(function(){return this._buffer.byteOffset})),v(Jo.prototype,"BYTES_PER_ELEMENT",Jo.BYTES_PER_ELEMENT),v(Jo.prototype,"copyWithin",(function(t,e){if(!zo(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(Jo.prototype,"entries",(function(){var t,e,r,n,i,o,a;if(!zo(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 so(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}})),wo&&v(r,wo,(function(){return e.entries()})),r})),v(Jo.prototype,"get",(function(t){var e;if(!zo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!st(t))throw new TypeError("invalid argument. Must provide a nonnegative integer. Value: `"+t+"`.");if(!(t>=this._length))return new so((e=this._buffer)[t*=2],e[t+1])})),pt(Jo.prototype,"length",(function(){return this._length})),v(Jo.prototype,"set",(function(t){var e,r,n,i,o,a,u,f,s;if(!zo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(n=this._buffer,arguments.length>1){if(!st(r=arguments[1]))throw new TypeError("invalid argument. Index argument must be a nonnegative integer. Value: `"+r+"`.")}else r=0;if(go(t)){if(r>=this._length)throw new RangeError("invalid argument. Index argument is out-of-bounds. Value: `"+r+"`.");return n[r*=2]=vt(t),void(n[r+1]=Et(t))}if(zo(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*Fo,e.buffer===n.buffer&&e.byteOffset<s&&e.byteOffset+e.byteLength>s){for(i=new Ie(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(!or(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(!go(t[f])){o=!0;break}if(o){if(!yo(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*Fo,e.buffer===n.buffer&&e.byteOffset<s&&e.byteOffset+e.byteLength>s){for(i=new Ie(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]=vt(u),n[r+1]=Et(u),r+=2}}));var Xo={binary:Ui,float64:Ie,float32:Mi,generic:Array,int16:Fi,int32:$i,int8:Hi,uint16:ve,uint32:ro,uint8:ge,uint8c:uo,complex64:ko,complex128:Jo};function qo(t){return Xo[t]||null}var Zo=D(Ui.allocUnsafe)?function(t){if(!ct(t))throw new TypeError("invalid argument. Must provide a nonnegative integer. Value: `"+t+"`");return Ui.allocUnsafe(t)}:function(t){if(!ct(t))throw new TypeError("invalid argument. Must provide a nonnegative integer. Value: `"+t+"`");return new Ui(t)};function Ho(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}(Zo(t))}(e):function(t,e){var r=qo(t);return r?new r(e):null}(t,e)}var Ko={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"},Qo=[Ie,Mi,$i,ro,Fi,ve,Hi,ge,uo,ko,Jo],ta=["float64","float32","int32","uint32","int16","uint16","int8","uint8","uint8c","complex64","complex128"],ea=ta.length;function ra(t){var e;if(u(t))return"generic";if(N(t))return"binary";for(e=0;e<ea;e++)if(t instanceof Qo[e])return ta[e];return Ko[Y(t)]||null}function na(t,e){var r=e[0];return fo(r)&&(t.push(r.length),na(t,r)),t}function ia(t,e,r,n,i){var o,a,u;for(o=e[r],u=0;u<n.length;u++){if(!fo(a=n[u])||a.length!==o)return r;if(i&&(a=ia(t,e,r+1,a,r+1<t-1))<t)return a}return t}function oa(t){var e,r;if(!fo(t))throw new TypeError("invalid argument. Must provide an array-like object. Value: `"+t+"`.");return na(e=[t.length],t),(r=e.length)>1&&(e.length=ia(r,e,1,t,r>2)),e}function aa(){return/^\/((?:\\\/|[^\/])+)\/([imgy]*)$/}v(aa,"REGEXP",/^\/((?:\\\/|[^\/])+)\/([imgy]*)$/);var ua=void 0!==Object.getOwnPropertyNames,fa=Object.getOwnPropertyNames;var sa=ua?function(t){return fa(Object(t))}:function(t){return pr(Object(t))},la=void 0!==Object.getOwnPropertyDescriptor,ca=Object.getOwnPropertyDescriptor;var ha,pa=la?function(t,e){var r;return null==t||void 0===(r=ca(t,e))?null:r}:function(t,r){return e(t,r)?{configurable:!0,enumerable:!0,writable:!0,value:t[r]}:null};ha=D(Ui.from)?function(t){if(!N(t))throw new TypeError("invalid argument. Must provide a Buffer. Value: `"+t+"`");return Ui.from(t)}:function(t){if(!N(t))throw new TypeError("invalid argument. Must provide a Buffer. Value: `"+t+"`");return new Ui(t)};var ga=ha;function ya(t){return new Hi(t)}function ma(t){return new ge(t)}function da(t){return new uo(t)}function wa(t){return new Fi(t)}function ba(t){return new ve(t)}function va(t){return new $i(t)}function Ea(t){return new ro(t)}function _a(t){return new Mi(t)}function Aa(t){return new Ie(t)}var Ta={int8array:ya,uint8array:ma,uint8clampedarray:da,int16array:wa,uint16array:ba,int32array:va,uint32array:Ea,float32array:_a,float64array:Aa};function xa(t,r,n,i,o){var f,s,l,c,h,p,g,y,m,d;if(o-=1,"object"!=typeof t||null===t)return t;if(N(t))return ga(t);if(function(t){if("object"!=typeof t||null===t)return!1;if(t instanceof Error)return!0;for(;t;){if("[object Error]"===a(t))return!0;t=$(t)}return!1}(t))return function(t){var r,n,i,o,a,f,s=[],l=[];for(a=new t.constructor(t.message),s.push(t),l.push(a),t.stack&&(a.stack=t.stack),t.code&&(a.code=t.code),t.errno&&(a.errno=t.errno),t.syscall&&(a.syscall=t.syscall),r=pr(t),f=0;f<r.length;f++)o=r[f],e(n=pa(t,o),"value")&&(i=u(t[o])?[]:{},n.value=xa(t[o],i,s,l,-1)),b(a,o,n);return a}(t);if("date"===(l=F(t)))return new Date(+t);if("regexp"===l)return function(t){if(!_t(t))throw new TypeError(ne("invalid argument. Must provide a regular expression string. Value: `%s`.",t));return(t=/^\/((?:\\\/|[^\/])+)\/([imgy]*)$/.exec(t))?new RegExp(t[1],t[2]):null}(t.toString());if("set"===l)return new Set(t);if("map"===l)return new Map(t);if("string"===l||"boolean"===l||"number"===l)return t.valueOf();if(h=Ta[l])return h(t);if("array"!==l&&"object"!==l)return"function"==typeof Object.freeze?function(t){var r,n,i,o,a,f,s,l;for(r=[],o=[],s=Object.create($(t)),r.push(t),o.push(s),n=sa(t),l=0;l<n.length;l++)i=n[l],e(a=pa(t,i),"value")&&(f=u(t[i])?[]:{},a.value=xa(t[i],f,r,o,-1)),b(s,i,a);return Object.isExtensible(t)||Object.preventExtensions(s),Object.isSealed(t)&&Object.seal(s),Object.isFrozen(t)&&Object.freeze(s),s}(t):{};if(s=pr(t),o>0)for(f=l,d=0;d<s.length;d++)y=t[p=s[d]],l=F(y),"object"!=typeof y||null===y||"array"!==l&&"object"!==l||N(y)?"object"===f?(e(c=pa(t,p),"value")&&(c.value=xa(y)),b(r,p,c)):r[p]=xa(y):-1===(m=ar(n,y))?(g=u(y)?new Array(y.length):{},n.push(y),i.push(g),"array"===f?r[p]=xa(y,g,n,i,o):(e(c=pa(t,p),"value")&&(c.value=xa(y,g,n,i,o)),b(r,p,c))):r[p]=i[m];else if("array"===l)for(d=0;d<s.length;d++)r[p=s[d]]=t[p];else for(d=0;d<s.length;d++)p=s[d],c=pa(t,p),b(r,p,c);return Object.isExtensible(t)||Object.preventExtensions(r),Object.isSealed(t)&&Object.seal(r),Object.isFrozen(t)&&Object.freeze(r),r}function Oa(t,e){var r;if(arguments.length>1){if(!st(e))throw new TypeError("invalid argument. `level` must be a nonnegative integer. Value: `"+e+"`.");if(0===e)return t}else e=et;return xa(t,r=u(t)?new Array(t.length):{},[t],[r],e)}var Ra=!1,ja=17976931348623157e292;function Ia(t,r){return X(r)?e(r,"depth")&&(t.depth=r.depth,!st(t.depth))?new TypeError("invalid option. `depth` option must be a nonnegative integer. Option: `"+t.depth+"`."):e(r,"copy")&&(t.copy=r.copy,!E(t.copy))?new TypeError("invalid option. `copy` option must be a boolean primitive. Option: `"+t.copy+"`."):null:new TypeError("invalid argument. Options argument must be an object. Value: `"+r+"`.")}function Sa(t,e,r){var n,i;for(i=0;i<e.length;i++)n=e[i],r&&fo(n)?Sa(t,n,r-1):t.push(n);return t}function Ua(t,e){var r,n,i;if(!fo(t))throw new TypeError("invalid argument. First argument must be an array-like object. Value: `"+t+"`.");if(r={copy:Ra,depth:ja},arguments.length>1&&(n=Ia(r,e)))throw n;return i=0===r.depth?t:Sa([],t,r.depth),r.copy?Oa(i):i}function La(t){return at(t)&&t>0}function Ba(t){return ut(t)&&t.valueOf()>0}function Pa(t){return La(t)||Ba(t)}v(Pa,"isPrimitive",La),v(Pa,"isObject",Ba);var Va=Pr(Pa.isPrimitive),Ma=Pr(Pa.isObject),ka=Pr(Pa);function Ca(t){var e,r,n,i;for(n="return function flattenArray(x){",r=(e=t.length)-1,n+="var o=[];var ",i=0;i<e;i++)n+="i"+i,n+=i<r?",":";";for(i=0;i<e;i++)n+="for(i"+i+"=0;i"+i+"<"+t[i]+";i"+i+"++){";for(n+="o.push(x",i=0;i<e;i++)n+="[i"+i+"]";for(n+=");",i=0;i<e;i++)n+="}";return n+="return o;",n+="}",n+="//# sourceURL=flatten_array.gen_fcn.js",new Function(n)()}function Na(t){return function(e){if(!fo(e))throw new TypeError("invalid argument. Must provide an array-like object. Value: `"+e+"`.");return t(e)}}function Ya(t){return function(e){if(!fo(e))throw new TypeError("invalid argument. Must provide an array-like object. Value: `"+e+"`.");return Oa(t(e))}}function Fa(){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&&it(t.length)&&t.length>=0&&t.length<et}v(ka,"primitives",Va),v(ka,"objects",Ma),v(Ua,"factory",(function(t,r){var n,i;if(!Va(t))throw new TypeError("invalid argument. First argument must be an array of positive integers. Value: `"+t+"`.");if(n=Ra,arguments.length>1){if(!X(r))throw new TypeError("invalid argument. Options argument must be an object. Value: `"+r+"`.");if(e(r,"copy")&&!E(n=r.copy))throw new TypeError("invalid option. `copy` option must be a boolean primitive. Option: `"+n+"`.")}return i=Ca(t),n?Ya(i):Na(i)}));var za="safe",Ga=!1,Wa="float64",$a=!0,Ja="throw",Xa=0,qa="row-major",Za=!1;function Ha(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=Zo(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 Ka(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=Zo(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 Qa(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 tu(t,e,r,n){var i,o,a,u,f;if(f=t-(o=r.length),i=[],"row-major"===n){for(a=yt(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}function eu(){var t,r,n,i,o,a,f,s,l,c,h,p,g;if(1===arguments.length)if(Da(arguments[0]))n=arguments[0],t={};else{if(!X(t=arguments[0]))throw new TypeError(Fa("0Le5K",t));if(e(t,"buffer")&&!Da(n=t.buffer))throw new TypeError(Fa("0Le5L","buffer",n))}else{if(!Da(n=arguments[0]))throw new TypeError(Fa("0Le5M",n));if(!X(t=arguments[1]))throw new TypeError(Fa("0Le2h",t))}if(n&&(Sr(n)?(f=n.dtype,g=!0):(f=ra(n),g=!1)),c={},h={},e(t,"casting")){if(h.casting=t.casting,!gn(h.casting))throw new TypeError(Fa("0Le5N","casting",h.casting))}else h.casting=za;if(e(t,"flatten")){if(h.flatten=t.flatten,!E(h.flatten))throw new TypeError(Fa("0Le30","flatten",h.flatten))}else h.flatten=$a;if(e(t,"ndmin")){if(h.ndmin=t.ndmin,!st(h.ndmin))throw new TypeError(Fa("0Le35","ndmin",h.ndmin))}else h.ndmin=Xa;if(e(t,"dtype")){if(!$r(a=t.dtype))throw new TypeError(Fa("0Le5O","dtype",a));if(f&&!Ln(f,a,h.casting))throw new Error(Fa("0Le5P",h.casting,f,a))}else a=f&&(g||"generic"!==f)?f:Wa;if(e(t,"order")){if("any"===(o=t.order)||"same"===o)g?"any"===o?o=3===mt(n.strides)?qa:n.order:"same"===o&&(o=n.order):o=qa;else if(!zr(o))throw new TypeError(Fa("0Le5Q","order",o))}else o=qa;if(e(t,"mode")?c.mode=t.mode:c.mode=Ja,e(t,"submode")?c.submode=t.submode:c.submode=[c.mode],e(t,"readonly")?c.readonly=t.readonly:c.readonly=Za,e(t,"copy")){if(h.copy=t.copy,!E(h.copy))throw new TypeError(Fa("0Le30","copy",h.copy))}else h.copy=Ga;if(e(t,"shape")){if(!Da(s=t.shape))throw new TypeError(Fa("0Le5R","shape",s));l=s.length,p=Br(s)}else{if(!n)throw new Error(Fa("0Le0X"));g?(s=n.shape,l=n.ndims,p=n.length):h.flatten&&u(n)?(l=(s=oa(n)).length,p=Br(s)):(l=1,s=[p=n.length])}if(l<h.ndmin&&(s=Qa(l,s,h.ndmin),l=h.ndmin),g){if(n.length!==p)throw new RangeError(Fa("0Le0Y"));f!==a||h.copy?n=Ka(n,a):(r=n.strides,i=n.offset,n=n.data,r.length<l&&(r=tu(l,s,r,o)))}else if(n){if("generic"===f&&h.flatten&&(n=Ua(n)),n.length!==p)throw new RangeError(Fa("0Le0Y"));(f!==a||h.copy)&&(n=Ha(n,p,a))}else n=Ho(a,p);return void 0===r&&(i=Lr(s,r=Ur(s,o))),new sn(a,n,s,r,i,o,c)}export{eu as default};
//# sourceMappingURL=mod.js.map