-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
3 lines (3 loc) · 63.6 KB
/
index.js
1
2
3
// Copyright (c) 2024 The Stdlib Authors. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0
!function(r,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(r="undefined"!=typeof globalThis?globalThis:r||self).array2iterator=e()}(this,(function(){"use strict";var r="function"==typeof Object.defineProperty?Object.defineProperty:null;var e=Object.defineProperty;function t(r){return"number"==typeof r}function n(r){var e,t="";for(e=0;e<r;e++)t+="0";return t}function i(r,e,t){var i=!1,o=e-r.length;return o<0||(function(r){return"-"===r[0]}(r)&&(i=!0,r=r.substr(1)),r=t?r+n(o):n(o)+r,i&&(r="-"+r)),r}var o=String.prototype.toLowerCase,a=String.prototype.toUpperCase;function u(r){var e,n,u;switch(r.specifier){case"b":e=2;break;case"o":e=8;break;case"x":case"X":e=16;break;default:e=10}if(n=r.arg,u=parseInt(n,10),!isFinite(u)){if(!t(n))throw new Error("invalid integer. Value: "+n);u=0}return u<0&&("u"===r.specifier||10!==e)&&(u=4294967295+u+1),u<0?(n=(-u).toString(e),r.precision&&(n=i(n,r.precision,r.padRight)),n="-"+n):(n=u.toString(e),u||r.precision?r.precision&&(n=i(n,r.precision,r.padRight)):n="",r.sign&&(n=r.sign+n)),16===e&&(r.alternate&&(n="0x"+n),n=r.specifier===a.call(r.specifier)?a.call(n):o.call(n)),8===e&&r.alternate&&"0"!==n.charAt(0)&&(n="0"+n),n}var f=Math.abs,l=String.prototype.toLowerCase,s=String.prototype.toUpperCase,h=String.prototype.replace,c=/e\+(\d)$/,p=/e-(\d)$/,y=/^(\d+)$/,m=/^(\d+)e/,g=/\.0$/,w=/\.0*e/,v=/(\..*[^0])0*e/;function b(r){var e,n,i=parseFloat(r.arg);if(!isFinite(i)){if(!t(r.arg))throw new Error("invalid floating-point number. Value: "+n);i=r.arg}switch(r.specifier){case"e":case"E":n=i.toExponential(r.precision);break;case"f":case"F":n=i.toFixed(r.precision);break;case"g":case"G":f(i)<1e-4?((e=r.precision)>0&&(e-=1),n=i.toExponential(e)):n=i.toPrecision(r.precision),r.alternate||(n=h.call(n,v,"$1e"),n=h.call(n,w,"e"),n=h.call(n,g,""));break;default:throw new Error("invalid double notation. Value: "+r.specifier)}return n=h.call(n,c,"e+0$1"),n=h.call(n,p,"e-0$1"),r.alternate&&(n=h.call(n,y,"$1."),n=h.call(n,m,"$1.e")),i>=0&&r.sign&&(n=r.sign+n),n=r.specifier===s.call(r.specifier)?s.call(n):l.call(n)}function d(r){var e,t="";for(e=0;e<r;e++)t+=" ";return t}var E=String.fromCharCode,T=Array.isArray;function _(r){return r!=r}function x(r){var e={};return e.specifier=r.specifier,e.precision=void 0===r.precision?1:r.precision,e.width=r.width,e.flags=r.flags||"",e.mapping=r.mapping,e}function V(r){var e,t,n,o,a,f,l,s,h,c,p,y,m;if(!T(r))throw new TypeError("invalid argument. First argument must be an array. Value: `"+r+"`.");for(f="",l=1,s=0;s<r.length;s++)if(n=r[s],"string"==typeof n)f+=n;else{if(e=void 0!==n.precision,!(n=x(n)).specifier)throw new TypeError("invalid argument. Token is missing `specifier` property. Index: `"+s+"`. Value: `"+n+"`.");for(n.mapping&&(l=n.mapping),t=n.flags,h=0;h<t.length;h++)switch(o=t.charAt(h)){case" ":n.sign=" ";break;case"+":n.sign="+";break;case"-":n.padRight=!0,n.padZeros=!1;break;case"0":n.padZeros=t.indexOf("-")<0;break;case"#":n.alternate=!0;break;default:throw new Error("invalid flag: "+o)}if("*"===n.width){if(n.width=parseInt(arguments[l],10),l+=1,_(n.width))throw new TypeError("the argument for * width at position "+l+" 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[l],10),l+=1,_(n.precision))throw new TypeError("the argument for * precision at position "+l+" is not a number. Value: `"+n.precision+"`.");n.precision<0&&(n.precision=1,e=!1)}switch(n.arg=arguments[l],n.specifier){case"b":case"o":case"x":case"X":case"d":case"i":case"u":e&&(n.padZeros=!1),n.arg=u(n);break;case"s":n.maxWidth=e?n.precision:-1,n.arg=String(n.arg);break;case"c":if(!_(n.arg)){if((a=parseInt(n.arg,10))<0||a>127)throw new Error("invalid character code. Value: "+n.arg);n.arg=_(a)?String(n.arg):E(a)}break;case"e":case"E":case"f":case"F":case"g":case"G":e||(n.precision=6),n.arg=b(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=i(n.arg,n.width||n.precision,n.padRight):n.width&&(n.arg=(c=n.arg,p=n.width,y=n.padRight,m=void 0,(m=p-c.length)<0?c:c=y?c+d(m):d(m)+c)),f+=n.arg||"",l+=1}return f}var A=/%(?:([1-9]\d*)\$)?([0 +\-#]*)(\*|\d+)?(?:(\.)(\*|\d+)?)?[hlL]?([%A-Za-z])/g;function j(r){var e={mapping:r[1]?parseInt(r[1],10):void 0,flags:r[2],width:r[3],precision:r[5],specifier:r[6]};return"."===r[4]&&void 0===r[5]&&(e.precision="1"),e}function S(r){var e,t,n,i;for(t=[],i=0,n=A.exec(r);n;)(e=r.slice(i,A.lastIndex-n[0].length)).length&&t.push(e),t.push(j(n)),i=A.lastIndex,n=A.exec(r);return(e=r.slice(i)).length&&t.push(e),t}function F(r){var e,t;if("string"!=typeof r)throw new TypeError(F("invalid argument. First argument must be a string. Value: `%s`.",r));for(e=[S(r)],t=1;t<arguments.length;t++)e.push(arguments[t]);return V.apply(null,e)}var L,k=Object.prototype,R=k.toString,B=k.__defineGetter__,I=k.__defineSetter__,O=k.__lookupGetter__,M=k.__lookupSetter__;L=function(){try{return r({},"x",{}),!0}catch(r){return!1}}()?e:function(r,e,t){var n,i,o,a;if("object"!=typeof r||null===r||"[object Array]"===R.call(r))throw new TypeError(F("invalid argument. First argument must be an object. Value: `%s`.",r));if("object"!=typeof t||null===t||"[object Array]"===R.call(t))throw new TypeError(F("invalid argument. Property descriptor must be an object. Value: `%s`.",t));if((i="value"in t)&&(O.call(r,e)||M.call(r,e)?(n=r.__proto__,r.__proto__=k,delete r[e],r[e]=t.value,r.__proto__=n):r[e]=t.value),o="get"in t,a="set"in t,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&&B&&B.call(r,e,t.get),a&&I&&I.call(r,e,t.set),r};var C=L;function N(r,e,t){C(r,e,{configurable:!1,enumerable:!1,writable:!1,value:t})}var P=/./;function U(r){return"boolean"==typeof r}var Y="function"==typeof Symbol&&"symbol"==typeof Symbol("foo");function W(){return Y&&"symbol"==typeof Symbol.toStringTag}var $=Object.prototype.toString;var Z=Object.prototype.hasOwnProperty;function G(r,e){return null!=r&&Z.call(r,e)}var J="function"==typeof Symbol?Symbol:void 0,X="function"==typeof J?J.toStringTag:"";var z=W()?function(r){var e,t,n;if(null==r)return $.call(r);t=r[X],e=G(r,X);try{r[X]=void 0}catch(e){return $.call(r)}return n=$.call(r),e?r[X]=t:delete r[X],n}:function(r){return $.call(r)},H=Boolean,q=Boolean.prototype.toString;var D=W();function K(r){return"object"==typeof r&&(r instanceof H||(D?function(r){try{return q.call(r),!0}catch(r){return!1}}(r):"[object Boolean]"===z(r)))}function Q(r){return U(r)||K(r)}N(Q,"isPrimitive",U),N(Q,"isObject",K);var rr="object"==typeof self?self:null,er="object"==typeof window?window:null,tr="object"==typeof global?global:null,nr="object"==typeof globalThis?globalThis:null;var ir=function(r){if(arguments.length){if(!U(r))throw new TypeError(F("invalid argument. Must provide a boolean. Value: `%s`.",r));if(r)return new Function("return this;")()}if(nr)return nr;if(rr)return rr;if(er)return er;if(tr)return tr;throw new Error("unexpected error. Unable to resolve global object.")}(),or=ir.document&&ir.document.childNodes,ar=Int8Array;function ur(){return/^\s*function\s*([^(]*)/i}var fr=/^\s*function\s*([^(]*)/i;N(ur,"REGEXP",fr);var lr=Array.isArray?Array.isArray:function(r){return"[object Array]"===z(r)};function sr(r){return null!==r&&"object"==typeof r}function hr(r){return sr(r)&&(r._isBuffer||r.constructor&&"function"==typeof r.constructor.isBuffer&&r.constructor.isBuffer(r))}function cr(r){var e,t,n;if(("Object"===(t=z(r).slice(8,-1))||"Error"===t)&&r.constructor){if("string"==typeof(n=r.constructor).name)return n.name;if(e=fr.exec(n.toString()))return e[1]}return hr(r)?"Buffer":t}N(sr,"isObjectLikeArray",function(r){if("function"!=typeof r)throw new TypeError(F("invalid argument. Must provide a function. Value: `%s`.",r));return function(e){var t,n;if(!lr(e))return!1;if(0===(t=e.length))return!1;for(n=0;n<t;n++)if(!1===r(e[n]))return!1;return!0}}(sr));var pr="function"==typeof P||"object"==typeof ar||"function"==typeof or?function(r){return cr(r).toLowerCase()}:function(r){var e;return null===r?"null":"object"===(e=typeof r)?cr(r).toLowerCase():e};function yr(r){return"function"===pr(r)}var mr=Math.floor;function gr(r){return mr(r)===r}var wr=9007199254740991;function vr(r){return"object"==typeof r&&null!==r&&"number"==typeof r.length&&gr(r.length)&&r.length>=0&&r.length<=wr}var br="function";function dr(){return"function"==typeof J&&"symbol"==typeof J("foo")&&G(J,"iterator")&&"symbol"==typeof J.iterator}var Er=dr()?Symbol.iterator:null,Tr={complex128:function(r,e){return r.get(e)},complex64:function(r,e){return r.get(e)},default:function(r,e){return r.get(e)}};function _r(r){var e=Tr[r];return"function"==typeof e?e:Tr.default}var xr={float64:function(r,e){return r[e]},float32:function(r,e){return r[e]},int32:function(r,e){return r[e]},int16:function(r,e){return r[e]},int8:function(r,e){return r[e]},uint32:function(r,e){return r[e]},uint16:function(r,e){return r[e]},uint8:function(r,e){return r[e]},uint8c:function(r,e){return r[e]},generic:function(r,e){return r[e]},default:function(r,e){return r[e]}};function Vr(r){var e=xr[r];return"function"==typeof e?e:xr.default}var Ar={Float32Array:"float32",Float64Array:"float64",Array:"generic",Int16Array:"int16",Int32Array:"int32",Int8Array:"int8",Uint16Array:"uint16",Uint32Array:"uint32",Uint8Array:"uint8",Uint8ClampedArray:"uint8c",Complex64Array:"complex64",Complex128Array:"complex128",BooleanArray:"bool"},jr="function"==typeof Float64Array;var Sr="function"==typeof Float64Array?Float64Array:null;var Fr="function"==typeof Float64Array?Float64Array:void 0;var Lr=function(){var r,e,t;if("function"!=typeof Sr)return!1;try{e=new Sr([1,3.14,-3.14,NaN]),t=e,r=(jr&&t instanceof Float64Array||"[object Float64Array]"===z(t))&&1===e[0]&&3.14===e[1]&&-3.14===e[2]&&e[3]!=e[3]}catch(e){r=!1}return r}()?Fr:function(){throw new Error("not implemented")},kr="function"==typeof Float32Array;var Rr=Number.POSITIVE_INFINITY,Br="function"==typeof Float32Array?Float32Array:null;var Ir="function"==typeof Float32Array?Float32Array:void 0;var Or=function(){var r,e,t;if("function"!=typeof Br)return!1;try{e=new Br([1,3.14,-3.14,5e40]),t=e,r=(kr&&t instanceof Float32Array||"[object Float32Array]"===z(t))&&1===e[0]&&3.140000104904175===e[1]&&-3.140000104904175===e[2]&&e[3]===Rr}catch(e){r=!1}return r}()?Ir:function(){throw new Error("not implemented")},Mr="function"==typeof Uint32Array;var Cr="function"==typeof Uint32Array?Uint32Array:null;var Nr="function"==typeof Uint32Array?Uint32Array:void 0;var Pr=function(){var r,e,t;if("function"!=typeof Cr)return!1;try{e=new Cr(e=[1,3.14,-3.14,4294967296,4294967297]),t=e,r=(Mr&&t instanceof Uint32Array||"[object Uint32Array]"===z(t))&&1===e[0]&&3===e[1]&&4294967293===e[2]&&0===e[3]&&1===e[4]}catch(e){r=!1}return r}()?Nr:function(){throw new Error("not implemented")},Ur="function"==typeof Int32Array;var Yr="function"==typeof Int32Array?Int32Array:null;var Wr="function"==typeof Int32Array?Int32Array:void 0;var $r=function(){var r,e,t;if("function"!=typeof Yr)return!1;try{e=new Yr([1,3.14,-3.14,2147483648]),t=e,r=(Ur&&t instanceof Int32Array||"[object Int32Array]"===z(t))&&1===e[0]&&3===e[1]&&-3===e[2]&&-2147483648===e[3]}catch(e){r=!1}return r}()?Wr:function(){throw new Error("not implemented")},Zr="function"==typeof Uint16Array;var Gr="function"==typeof Uint16Array?Uint16Array:null;var Jr="function"==typeof Uint16Array?Uint16Array:void 0;var Xr=function(){var r,e,t;if("function"!=typeof Gr)return!1;try{e=new Gr(e=[1,3.14,-3.14,65536,65537]),t=e,r=(Zr&&t instanceof Uint16Array||"[object Uint16Array]"===z(t))&&1===e[0]&&3===e[1]&&65533===e[2]&&0===e[3]&&1===e[4]}catch(e){r=!1}return r}()?Jr:function(){throw new Error("not implemented")},zr="function"==typeof Int16Array;var Hr="function"==typeof Int16Array?Int16Array:null;var qr="function"==typeof Int16Array?Int16Array:void 0;var Dr=function(){var r,e,t;if("function"!=typeof Hr)return!1;try{e=new Hr([1,3.14,-3.14,32768]),t=e,r=(zr&&t instanceof Int16Array||"[object Int16Array]"===z(t))&&1===e[0]&&3===e[1]&&-3===e[2]&&-32768===e[3]}catch(e){r=!1}return r}()?qr:function(){throw new Error("not implemented")},Kr="function"==typeof Uint8Array;var Qr="function"==typeof Uint8Array?Uint8Array:null;var re="function"==typeof Uint8Array?Uint8Array:void 0;var ee=function(){var r,e,t;if("function"!=typeof Qr)return!1;try{e=new Qr(e=[1,3.14,-3.14,256,257]),t=e,r=(Kr&&t instanceof Uint8Array||"[object Uint8Array]"===z(t))&&1===e[0]&&3===e[1]&&253===e[2]&&0===e[3]&&1===e[4]}catch(e){r=!1}return r}()?re:function(){throw new Error("not implemented")},te="function"==typeof Uint8ClampedArray;var ne="function"==typeof Uint8ClampedArray?Uint8ClampedArray:null;var ie="function"==typeof Uint8ClampedArray?Uint8ClampedArray:void 0;var oe=function(){var r,e,t;if("function"!=typeof ne)return!1;try{e=new ne([-1,0,1,3.14,4.99,255,256]),t=e,r=(te&&t instanceof Uint8ClampedArray||"[object Uint8ClampedArray]"===z(t))&&0===e[0]&&0===e[1]&&1===e[2]&&3===e[3]&&5===e[4]&&255===e[5]&&255===e[6]}catch(e){r=!1}return r}()?ie:function(){throw new Error("not implemented")},ae="function"==typeof Int8Array;var ue="function"==typeof Int8Array?Int8Array:null;var fe="function"==typeof Int8Array?Int8Array:void 0;var le=function(){var r,e,t;if("function"!=typeof ue)return!1;try{e=new ue([1,3.14,-3.14,128]),t=e,r=(ae&&t instanceof Int8Array||"[object Int8Array]"===z(t))&&1===e[0]&&3===e[1]&&-3===e[2]&&-128===e[3]}catch(e){r=!1}return r}()?fe:function(){throw new Error("not implemented")};function se(r){return"number"==typeof r}var he=Number,ce=he.prototype.toString;var pe=W();function ye(r){return"object"==typeof r&&(r instanceof he||(pe?function(r){try{return ce.call(r),!0}catch(r){return!1}}(r):"[object Number]"===z(r)))}function me(r){return se(r)||ye(r)}N(me,"isPrimitive",se),N(me,"isObject",ye);var ge=he.NEGATIVE_INFINITY;function we(r){return r<Rr&&r>ge&&gr(r)}function ve(r){return se(r)&&we(r)}function be(r){return ye(r)&&we(r.valueOf())}function de(r){return ve(r)||be(r)}function Ee(r){return ve(r)&&r>=0}function Te(r){return be(r)&&r.valueOf()>=0}function _e(r){return Ee(r)||Te(r)}N(de,"isPrimitive",ve),N(de,"isObject",be),N(_e,"isPrimitive",Ee),N(_e,"isObject",Te);var xe=4294967295;function Ve(r){return"object"==typeof r&&null!==r&&"number"==typeof r.length&&gr(r.length)&&r.length>=0&&r.length<=xe}var Ae="function"==typeof ArrayBuffer;function je(r){return Ae&&r instanceof ArrayBuffer||"[object ArrayBuffer]"===z(r)}function Se(r){return"object"==typeof r&&null!==r&&!lr(r)}function Fe(r){return"string"==typeof r}var Le=String.prototype.valueOf;var ke=W();function Re(r){return"object"==typeof r&&(r instanceof String||(ke?function(r){try{return Le.call(r),!0}catch(r){return!1}}(r):"[object String]"===z(r)))}function Be(r){return Fe(r)||Re(r)}function Ie(r,e){if(!(this instanceof Ie))throw new TypeError("invalid invocation. Constructor must be called with the `new` keyword.");if(!se(r))throw new TypeError(F("invalid argument. Real component must be a number. Value: `%s`.",r));if(!se(e))throw new TypeError(F("invalid argument. Imaginary component must be a number. Value: `%s`.",e));return C(this,"re",{configurable:!1,enumerable:!0,writable:!1,value:r}),C(this,"im",{configurable:!1,enumerable:!0,writable:!1,value:e}),this}N(Be,"isPrimitive",Fe),N(Be,"isObject",Re),N(Ie,"BYTES_PER_ELEMENT",8),N(Ie.prototype,"BYTES_PER_ELEMENT",8),N(Ie.prototype,"byteLength",16),N(Ie.prototype,"toString",(function(){var r=""+this.re;return this.im<0?r+=" - "+-this.im:r+=" + "+this.im,r+="i"})),N(Ie.prototype,"toJSON",(function(){var r={type:"Complex128"};return r.re=this.re,r.im=this.im,r}));var Oe="function"==typeof Math.fround?Math.fround:null,Me=new Or(1);var Ce="function"==typeof Oe?Oe:function(r){return Me[0]=r,Me[0]};function Ne(r,e){if(!(this instanceof Ne))throw new TypeError("invalid invocation. Constructor must be called with the `new` keyword.");if(!se(r))throw new TypeError(F("invalid argument. Real component must be a number. Value: `%s`.",r));if(!se(e))throw new TypeError(F("invalid argument. Imaginary component must be a number. Value: `%s`.",e));return C(this,"re",{configurable:!1,enumerable:!0,writable:!1,value:Ce(r)}),C(this,"im",{configurable:!1,enumerable:!0,writable:!1,value:Ce(e)}),this}function Pe(r){return r instanceof Ie||r instanceof Ne||"object"==typeof r&&null!==r&&"number"==typeof r.re&&"number"==typeof r.im}function Ue(r){return gr(r/2)}N(Ne,"BYTES_PER_ELEMENT",4),N(Ne.prototype,"BYTES_PER_ELEMENT",4),N(Ne.prototype,"byteLength",8),N(Ne.prototype,"toString",(function(){var r=""+this.re;return this.im<0?r+=" - "+-this.im:r+=" + "+this.im,r+="i"})),N(Ne.prototype,"toJSON",(function(){var r={type:"Complex64"};return r.re=this.re,r.im=this.im,r}));var Ye=8;function We(r){return"object"==typeof r&&null!==r&&"Complex64Array"===r.constructor.name&&r.BYTES_PER_ELEMENT===Ye}var $e=16;function Ze(r){return"object"==typeof r&&null!==r&&"Complex128Array"===r.constructor.name&&r.BYTES_PER_ELEMENT===$e}function Ge(r,e,t){C(r,e,{configurable:!1,enumerable:!1,get:t})}function Je(r,e){if(!(this instanceof Je))throw new TypeError("invalid invocation. Constructor must be called with the `new` keyword.");if(!se(r))throw new TypeError(F("invalid argument. Real component must be a number. Value: `%s`.",r));if(!se(e))throw new TypeError(F("invalid argument. Imaginary component must be a number. Value: `%s`.",e));return C(this,"re",{configurable:!1,enumerable:!0,writable:!1,value:Ce(r)}),C(this,"im",{configurable:!1,enumerable:!0,writable:!1,value:Ce(e)}),this}function Xe(r){return r.re}function ze(r){return r.im}function He(r,e){return new Or(r.buffer,r.byteOffset+r.BYTES_PER_ELEMENT*e,2*(r.length-e))}function qe(r,e){return new Lr(r.buffer,r.byteOffset+r.BYTES_PER_ELEMENT*e,2*(r.length-e))}function De(r){var e,t,n;for(e=[];!(t=r.next()).done;)if(Ve(n=t.value)&&n.length>=2)e.push(n[0],n[1]);else{if(!Pe(n))return new TypeError(F("invalid argument. An iterator must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",n));e.push(Xe(n),ze(n))}return e}N(Je,"BYTES_PER_ELEMENT",4),N(Je.prototype,"BYTES_PER_ELEMENT",4),N(Je.prototype,"byteLength",8),N(Je.prototype,"toString",(function(){var r=""+this.re;return this.im<0?r+=" - "+-this.im:r+=" + "+this.im,r+="i"})),N(Je.prototype,"toJSON",(function(){var r={type:"Complex64"};return r.re=this.re,r.im=this.im,r}));var Ke=2*Or.BYTES_PER_ELEMENT,Qe=dr();function rt(r){return r instanceof nt||"object"==typeof r&&null!==r&&("Complex64Array"===r.constructor.name||"Complex128Array"===r.constructor.name)&&"number"==typeof r._length&&"object"==typeof r._buffer}function et(r){return r===nt||"Complex128Array"===r.name}function tt(r,e){return new Je(r[e*=2],r[e+1])}function nt(){var r,e,t,n;if(e=arguments.length,!(this instanceof nt))return 0===e?new nt:1===e?new nt(arguments[0]):2===e?new nt(arguments[0],arguments[1]):new nt(arguments[0],arguments[1],arguments[2]);if(0===e)t=new Or(0);else if(1===e)if(Ee(arguments[0]))t=new Or(2*arguments[0]);else if(vr(arguments[0]))if((n=(t=arguments[0]).length)&&lr(t)&&Pe(t[0])){if(t=function(r,e){var t,n,i,o;for(t=e.length,o=0,i=0;i<t;i++){if(!Pe(n=e[i]))return null;r[o]=Xe(n),r[o+1]=ze(n),o+=2}return r}(new Or(2*n),t),null===t){if(!Ue(n))throw new RangeError(F("invalid argument. Array-like object arguments must have a length which is a multiple of two. Length: `%u`.",n));t=new Or(arguments[0])}}else{if(We(t))t=He(t,0);else if(Ze(t))t=qe(t,0);else if(!Ue(n))throw new RangeError(F("invalid argument. Array-like object and typed array arguments must have a length which is a multiple of two. Length: `%u`.",n));t=new Or(t)}else if(je(arguments[0])){if(!gr((t=arguments[0]).byteLength/Ke))throw new RangeError(F("invalid argument. ArrayBuffer byte length must be a multiple of %u. Byte length: `%u`.",Ke,t.byteLength));t=new Or(t)}else{if(!Se(arguments[0]))throw new TypeError(F("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",arguments[0]));if(t=arguments[0],!1===Qe)throw new TypeError(F("invalid argument. Environment lacks Symbol.iterator support. Must provide a length, ArrayBuffer, typed array, or array-like object. Value: `%s`.",t));if(!yr(t[Er]))throw new TypeError(F("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",t));if(!yr((t=t[Er]()).next))throw new TypeError(F("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",t));if((t=De(t))instanceof Error)throw t;t=new Or(t)}else{if(!je(t=arguments[0]))throw new TypeError(F("invalid argument. First argument must be an ArrayBuffer. Value: `%s`.",t));if(!Ee(r=arguments[1]))throw new TypeError(F("invalid argument. Byte offset must be a nonnegative integer. Value: `%s`.",r));if(!gr(r/Ke))throw new RangeError(F("invalid argument. Byte offset must be a multiple of %u. Value: `%u`.",Ke,r));if(2===e){if(!gr((n=t.byteLength-r)/Ke))throw new RangeError(F("invalid arguments. ArrayBuffer view byte length must be a multiple of %u. View byte length: `%u`.",Ke,n));t=new Or(t,r)}else{if(!Ee(n=arguments[2]))throw new TypeError(F("invalid argument. Length must be a nonnegative integer. Value: `%s`.",n));if(n*Ke>t.byteLength-r)throw new RangeError(F("invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.",n*Ke));t=new Or(t,r,2*n)}}return N(this,"_buffer",t),N(this,"_length",t.length/2),this}function it(r,e){if(!(this instanceof it))throw new TypeError("invalid invocation. Constructor must be called with the `new` keyword.");if(!se(r))throw new TypeError(F("invalid argument. Real component must be a number. Value: `%s`.",r));if(!se(e))throw new TypeError(F("invalid argument. Imaginary component must be a number. Value: `%s`.",e));return C(this,"re",{configurable:!1,enumerable:!0,writable:!1,value:r}),C(this,"im",{configurable:!1,enumerable:!0,writable:!1,value:e}),this}function ot(r){return r.re}function at(r){return r.im}function ut(r){var e,t,n;for(e=[];!(t=r.next()).done;)if(Ve(n=t.value)&&n.length>=2)e.push(n[0],n[1]);else{if(!Pe(n))return new TypeError(F("invalid argument. An iterator must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",n));e.push(ot(n),at(n))}return e}N(nt,"BYTES_PER_ELEMENT",Ke),N(nt,"name","Complex64Array"),N(nt,"from",(function(r){var e,t,n,i,o,a,u,f,l,s,h,c;if(!yr(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!et(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if((t=arguments.length)>1){if(!yr(n=arguments[1]))throw new TypeError(F("invalid argument. Second argument must be a function. Value: `%s`.",n));t>2&&(e=arguments[2])}if(rt(r)){if(f=r.length,n){for(o=(i=new this(f))._buffer,c=0,h=0;h<f;h++){if(Pe(s=n.call(e,r.get(h),h)))o[c]=Xe(s),o[c+1]=ze(s);else{if(!(Ve(s)&&s.length>=2))throw new TypeError(F("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",s));o[c]=s[0],o[c+1]=s[1]}c+=2}return i}return new this(r)}if(vr(r)){if(n){for(f=r.length,u=r.get&&r.set?_r("default"):Vr("default"),h=0;h<f;h++)if(!Pe(u(r,h))){l=!0;break}if(l){if(!Ue(f))throw new RangeError(F("invalid argument. First argument must have a length which is a multiple of %u. Length: `%u`.",2,f));for(o=(i=new this(f/2))._buffer,h=0;h<f;h++)o[h]=n.call(e,u(r,h),h);return i}for(o=(i=new this(f))._buffer,c=0,h=0;h<f;h++){if(Pe(s=n.call(e,u(r,h),h)))o[c]=Xe(s),o[c+1]=ze(s);else{if(!(Ve(s)&&s.length>=2))throw new TypeError(F("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",s));o[c]=s[0],o[c+1]=s[1]}c+=2}return i}return new this(r)}if(Se(r)&&Qe&&yr(r[Er])){if(!yr((o=r[Er]()).next))throw new TypeError(F("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",r));if(a=n?function(r,e,t){var n,i,o,a;for(n=[],a=-1;!(i=r.next()).done;)if(a+=1,Ve(o=e.call(t,i.value,a))&&o.length>=2)n.push(o[0],o[1]);else{if(!Pe(o))return new TypeError(F("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",o));n.push(Xe(o),ze(o))}return n}(o,n,e):De(o),a instanceof Error)throw a;for(o=(i=new this(f=a.length/2))._buffer,h=0;h<f;h++)o[h]=a[h];return i}throw new TypeError(F("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",r))})),N(nt,"of",(function(){var r,e;if(!yr(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!et(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(r=[],e=0;e<arguments.length;e++)r.push(arguments[e]);return new this(r)})),N(nt.prototype,"at",(function(r){if(!rt(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!gr(r))throw new TypeError(F("invalid argument. Must provide an integer. Value: `%s`.",r));if(r<0&&(r+=this._length),!(r<0||r>=this._length))return tt(this._buffer,r)})),Ge(nt.prototype,"buffer",(function(){return this._buffer.buffer})),Ge(nt.prototype,"byteLength",(function(){return this._buffer.byteLength})),Ge(nt.prototype,"byteOffset",(function(){return this._buffer.byteOffset})),N(nt.prototype,"BYTES_PER_ELEMENT",nt.BYTES_PER_ELEMENT),N(nt.prototype,"copyWithin",(function(r,e){if(!rt(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return 2===arguments.length?this._buffer.copyWithin(2*r,2*e):this._buffer.copyWithin(2*r,2*e,2*arguments[2]),this})),N(nt.prototype,"entries",(function(){var r,e,t,n,i,o,a;if(!rt(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return e=this,r=this._buffer,n=this._length,o=-1,a=-2,N(t={},"next",(function(){var e;if(o+=1,i||o>=n)return{done:!0};return e=new Je(r[a+=2],r[a+1]),{value:[o,e],done:!1}})),N(t,"return",(function(r){if(i=!0,arguments.length)return{value:r,done:!0};return{done:!0}})),Er&&N(t,Er,(function(){return e.entries()})),t})),N(nt.prototype,"every",(function(r,e){var t,n;if(!rt(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!yr(r))throw new TypeError(F("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,n=0;n<this._length;n++)if(!r.call(e,tt(t,n),n,this))return!1;return!0})),N(nt.prototype,"fill",(function(r,e,t){var n,i,o,a,u,f;if(!rt(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Pe(r))throw new TypeError(F("invalid argument. First argument must be a complex number. Value: `%s`.",r));if(n=this._buffer,i=this._length,arguments.length>1){if(!gr(e))throw new TypeError(F("invalid argument. Second argument must be an integer. Value: `%s`.",e));if(e<0&&(e+=i)<0&&(e=0),arguments.length>2){if(!gr(t))throw new TypeError(F("invalid argument. Third argument must be an integer. Value: `%s`.",t));t<0&&(t+=i)<0&&(t=0),t>i&&(t=i)}else t=i}else e=0,t=i;for(a=Xe(r),u=ze(r),f=e;f<t;f++)n[o=2*f]=a,n[o+1]=u;return this})),N(nt.prototype,"filter",(function(r,e){var t,n,i,o;if(!rt(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!yr(r))throw new TypeError(F("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,n=[],i=0;i<this._length;i++)o=tt(t,i),r.call(e,o,i,this)&&n.push(o);return new this.constructor(n)})),N(nt.prototype,"find",(function(r,e){var t,n,i;if(!rt(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!yr(r))throw new TypeError(F("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,n=0;n<this._length;n++)if(i=tt(t,n),r.call(e,i,n,this))return i})),N(nt.prototype,"findIndex",(function(r,e){var t,n,i;if(!rt(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!yr(r))throw new TypeError(F("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,n=0;n<this._length;n++)if(i=tt(t,n),r.call(e,i,n,this))return n;return-1})),N(nt.prototype,"findLast",(function(r,e){var t,n,i;if(!rt(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!yr(r))throw new TypeError(F("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,n=this._length-1;n>=0;n--)if(i=tt(t,n),r.call(e,i,n,this))return i})),N(nt.prototype,"findLastIndex",(function(r,e){var t,n,i;if(!rt(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!yr(r))throw new TypeError(F("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,n=this._length-1;n>=0;n--)if(i=tt(t,n),r.call(e,i,n,this))return n;return-1})),N(nt.prototype,"forEach",(function(r,e){var t,n,i;if(!rt(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!yr(r))throw new TypeError(F("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,n=0;n<this._length;n++)i=tt(t,n),r.call(e,i,n,this)})),N(nt.prototype,"get",(function(r){if(!rt(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Ee(r))throw new TypeError(F("invalid argument. Must provide a nonnegative integer. Value: `%s`.",r));if(!(r>=this._length))return tt(this._buffer,r)})),N(nt.prototype,"includes",(function(r,e){var t,n,i,o,a;if(!rt(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Pe(r))throw new TypeError(F("invalid argument. First argument must be a complex number. Value: `%s`.",r));if(arguments.length>1){if(!gr(e))throw new TypeError(F("invalid argument. Second argument must be an integer. Value: `%s`.",e));e<0&&(e+=this._length)<0&&(e=0)}else e=0;for(i=Xe(r),o=ze(r),t=this._buffer,a=e;a<this._length;a++)if(i===t[n=2*a]&&o===t[n+1])return!0;return!1})),N(nt.prototype,"indexOf",(function(r,e){var t,n,i,o,a;if(!rt(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Pe(r))throw new TypeError(F("invalid argument. First argument must be a complex number. Value: `%s`.",r));if(arguments.length>1){if(!gr(e))throw new TypeError(F("invalid argument. Second argument must be an integer. Value: `%s`.",e));e<0&&(e+=this._length)<0&&(e=0)}else e=0;for(i=Xe(r),o=ze(r),t=this._buffer,a=e;a<this._length;a++)if(i===t[n=2*a]&&o===t[n+1])return a;return-1})),N(nt.prototype,"join",(function(r){var e,t,n,i;if(!rt(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(0===arguments.length)n=",";else{if(!Fe(r))throw new TypeError(F("invalid argument. First argument must be a string. Value: `%s`.",r));n=r}for(e=[],t=this._buffer,i=0;i<this._length;i++)e.push(tt(t,i).toString());return e.join(n)})),N(nt.prototype,"lastIndexOf",(function(r,e){var t,n,i,o,a;if(!rt(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Pe(r))throw new TypeError(F("invalid argument. First argument must be a complex number. Value: `%s`.",r));if(arguments.length>1){if(!gr(e))throw new TypeError(F("invalid argument. Second argument must be an integer. Value: `%s`.",e));e>=this._length?e=this._length-1:e<0&&(e+=this._length)}else e=this._length-1;for(i=Xe(r),o=ze(r),t=this._buffer,a=e;a>=0;a--)if(i===t[n=2*a]&&o===t[n+1])return a;return-1})),Ge(nt.prototype,"length",(function(){return this._length})),N(nt.prototype,"map",(function(r,e){var t,n,i,o,a;if(!rt(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!yr(r))throw new TypeError(F("invalid argument. First argument must be a function. Value: `%s`.",r));for(n=this._buffer,t=(i=new this.constructor(this._length))._buffer,o=0;o<this._length;o++)if(Pe(a=r.call(e,tt(n,o),o,this)))t[2*o]=Xe(a),t[2*o+1]=ze(a);else{if(!Ve(a)||2!==a.length)throw new TypeError(F("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",a));t[2*o]=a[0],t[2*o+1]=a[1]}return i})),N(nt.prototype,"reduce",(function(r,e){var t,n,i,o;if(!rt(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!yr(r))throw new TypeError(F("invalid argument. First argument must be a function. Value: `%s`.",r));if(t=this._buffer,i=this._length,arguments.length>1)n=e,o=0;else{if(0===i)throw new Error("invalid operation. If not provided an initial value, an array must contain at least one element.");n=tt(t,0),o=1}for(;o<i;o++)n=r(n,tt(t,o),o,this);return n})),N(nt.prototype,"reverse",(function(){var r,e,t,n,i,o;if(!rt(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(t=this._length,r=this._buffer,n=mr(t/2),i=0;i<n;i++)o=t-i-1,e=r[2*i],r[2*i]=r[2*o],r[2*o]=e,e=r[2*i+1],r[2*i+1]=r[2*o+1],r[2*o+1]=e;return this})),N(nt.prototype,"set",(function(r){var e,t,n,i,o,a,u,f,l;if(!rt(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(n=this._buffer,arguments.length>1){if(!Ee(t=arguments[1]))throw new TypeError(F("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",t))}else t=0;if(Pe(r)){if(t>=this._length)throw new RangeError(F("invalid argument. Index argument is out-of-bounds. Value: `%u`.",t));return n[t*=2]=Xe(r),void(n[t+1]=ze(r))}if(rt(r)){if(t+(a=r._length)>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(e=r._buffer,l=n.byteOffset+t*Ke,e.buffer===n.buffer&&e.byteOffset<l&&e.byteOffset+e.byteLength>l){for(i=new Or(e.length),f=0;f<e.length;f++)i[f]=e[f];e=i}for(t*=2,l=0,f=0;f<a;f++)n[t]=e[l],n[t+1]=e[l+1],t+=2,l+=2}else{if(!vr(r))throw new TypeError(F("invalid argument. First argument must be either a complex number, an array-like object, or a complex number array. Value: `%s`.",r));for(a=r.length,f=0;f<a;f++)if(!Pe(r[f])){o=!0;break}if(o){if(!Ue(a))throw new RangeError(F("invalid argument. Array-like object arguments must have a length which is a multiple of two. Length: `%u`.",a));if(t+a/2>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(e=r,l=n.byteOffset+t*Ke,e.buffer===n.buffer&&e.byteOffset<l&&e.byteOffset+e.byteLength>l){for(i=new Or(a),f=0;f<a;f++)i[f]=e[f];e=i}for(t*=2,a/=2,l=0,f=0;f<a;f++)n[t]=e[l],n[t+1]=e[l+1],t+=2,l+=2;return}if(t+a>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");for(t*=2,f=0;f<a;f++)u=r[f],n[t]=Xe(u),n[t+1]=ze(u),t+=2}})),N(nt.prototype,"slice",(function(r,e){var t,n,i,o,a,u,f;if(!rt(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(a=this._buffer,u=this._length,0===arguments.length)r=0,e=u;else{if(!gr(r))throw new TypeError(F("invalid argument. First argument must be an integer. Value: `%s`.",r));if(r<0&&(r+=u)<0&&(r=0),1===arguments.length)e=u;else{if(!gr(e))throw new TypeError(F("invalid argument. Second argument must be an integer. Value: `%s`.",e));e<0?(e+=u)<0&&(e=0):e>u&&(e=u)}}for(t=r<e?e-r:0,n=(i=new this.constructor(t))._buffer,f=0;f<t;f++)o=2*(f+r),n[2*f]=a[o],n[2*f+1]=a[o+1];return i})),N(nt.prototype,"some",(function(r,e){var t,n;if(!rt(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!yr(r))throw new TypeError(F("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,n=0;n<this._length;n++)if(r.call(e,tt(t,n),n,this))return!0;return!1})),N(nt.prototype,"subarray",(function(r,e){var t,n,i;if(!rt(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(n=this._buffer,i=this._length,0===arguments.length)r=0,e=i;else{if(!gr(r))throw new TypeError(F("invalid argument. First argument must be an integer. Value: `%s`.",r));if(r<0&&(r+=i)<0&&(r=0),1===arguments.length)e=i;else{if(!gr(e))throw new TypeError(F("invalid argument. Second argument must be an integer. Value: `%s`.",e));e<0?(e+=i)<0&&(e=0):e>i&&(e=i)}}return r>=i?(i=0,t=n.byteLength):r>=e?(i=0,t=n.byteOffset+r*Ke):(i=e-r,t=n.byteOffset+r*Ke),new this.constructor(n.buffer,t,i<0?0:i)})),N(nt.prototype,"toReversed",(function(){var r,e,t,n,i,o;if(!rt(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(t=this._length,e=new this.constructor(t),n=this._buffer,r=e._buffer,i=0;i<t;i++)o=t-i-1,r[2*i]=n[2*o],r[2*i+1]=n[2*o+1];return e})),N(nt.prototype,"toString",(function(){var r,e,t;if(!rt(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(r=[],e=this._buffer,t=0;t<this._length;t++)r.push(tt(e,t).toString());return r.join(",")})),N(nt.prototype,"with",(function(r,e){var t,n,i;if(!rt(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!gr(r))throw new TypeError(F("invalid argument. First argument must be an integer. Value: `%s`.",r));if(i=this._length,r<0&&(r+=i),r<0||r>=i)throw new RangeError(F("invalid argument. Index argument is out-of-bounds. Value: `%s`.",r));if(!Pe(e))throw new TypeError(F("invalid argument. Second argument must be a complex number. Value: `%s`.",e));return(t=(n=new this.constructor(this._buffer))._buffer)[2*r]=Xe(e),t[2*r+1]=ze(e),n})),N(it,"BYTES_PER_ELEMENT",8),N(it.prototype,"BYTES_PER_ELEMENT",8),N(it.prototype,"byteLength",16),N(it.prototype,"toString",(function(){var r=""+this.re;return this.im<0?r+=" - "+-this.im:r+=" + "+this.im,r+="i"})),N(it.prototype,"toJSON",(function(){var r={type:"Complex128"};return r.re=this.re,r.im=this.im,r}));var ft=2*Lr.BYTES_PER_ELEMENT,lt=dr();function st(r){return r instanceof pt||"object"==typeof r&&null!==r&&("Complex64Array"===r.constructor.name||"Complex128Array"===r.constructor.name)&&"number"==typeof r._length&&"object"==typeof r._buffer}function ht(r){return r===pt||"Complex64Array"===r.name}function ct(r,e){return new it(r[e*=2],r[e+1])}function pt(){var r,e,t,n;if(e=arguments.length,!(this instanceof pt))return 0===e?new pt:1===e?new pt(arguments[0]):2===e?new pt(arguments[0],arguments[1]):new pt(arguments[0],arguments[1],arguments[2]);if(0===e)t=new Lr(0);else if(1===e)if(Ee(arguments[0]))t=new Lr(2*arguments[0]);else if(vr(arguments[0]))if((n=(t=arguments[0]).length)&&lr(t)&&Pe(t[0])){if(t=function(r,e){var t,n,i,o;for(t=e.length,o=0,i=0;i<t;i++){if(!Pe(n=e[i]))return null;r[o]=ot(n),r[o+1]=at(n),o+=2}return r}(new Lr(2*n),t),null===t){if(!Ue(n))throw new RangeError(F("invalid argument. Array-like object arguments must have a length which is a multiple of two. Length: `%u`.",n));t=new Lr(arguments[0])}}else{if(We(t))t=He(t,0);else if(Ze(t))t=qe(t,0);else if(!Ue(n))throw new RangeError(F("invalid argument. Array-like object and typed array arguments must have a length which is a multiple of two. Length: `%u`.",n));t=new Lr(t)}else if(je(arguments[0])){if(!gr((t=arguments[0]).byteLength/ft))throw new RangeError(F("invalid argument. ArrayBuffer byte length must be a multiple of %u. Byte length: `%u`.",ft,t.byteLength));t=new Lr(t)}else{if(!Se(arguments[0]))throw new TypeError(F("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",arguments[0]));if(t=arguments[0],!1===lt)throw new TypeError(F("invalid argument. Environment lacks Symbol.iterator support. Must provide a length, ArrayBuffer, typed array, or array-like object. Value: `%s`.",t));if(!yr(t[Er]))throw new TypeError(F("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",t));if(!yr((t=t[Er]()).next))throw new TypeError(F("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",t));if((t=ut(t))instanceof Error)throw t;t=new Lr(t)}else{if(!je(t=arguments[0]))throw new TypeError(F("invalid argument. First argument must be an ArrayBuffer. Value: `%s`.",t));if(!Ee(r=arguments[1]))throw new TypeError(F("invalid argument. Byte offset must be a nonnegative integer. Value: `%s`.",r));if(!gr(r/ft))throw new RangeError(F("invalid argument. Byte offset must be a multiple of %u. Value: `%u`.",ft,r));if(2===e){if(!gr((n=t.byteLength-r)/ft))throw new RangeError(F("invalid arguments. ArrayBuffer view byte length must be a multiple of %u. View byte length: `%u`.",ft,n));t=new Lr(t,r)}else{if(!Ee(n=arguments[2]))throw new TypeError(F("invalid argument. Length must be a nonnegative integer. Value: `%s`.",n));if(n*ft>t.byteLength-r)throw new RangeError(F("invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.",n*ft));t=new Lr(t,r,2*n)}}return N(this,"_buffer",t),N(this,"_length",t.length/2),this}function yt(r){var e,t;for(e=[];!(t=r.next()).done;)e.push(H(t.value));return e}N(pt,"BYTES_PER_ELEMENT",ft),N(pt,"name","Complex128Array"),N(pt,"from",(function(r){var e,t,n,i,o,a,u,f,l,s,h,c;if(!yr(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!ht(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if((t=arguments.length)>1){if(!yr(n=arguments[1]))throw new TypeError(F("invalid argument. Second argument must be a function. Value: `%s`.",n));t>2&&(e=arguments[2])}if(st(r)){if(f=r.length,n){for(o=(i=new this(f))._buffer,c=0,h=0;h<f;h++){if(Pe(s=n.call(e,r.get(h),h)))o[c]=ot(s),o[c+1]=at(s);else{if(!(Ve(s)&&s.length>=2))throw new TypeError(F("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",s));o[c]=s[0],o[c+1]=s[1]}c+=2}return i}return new this(r)}if(vr(r)){if(n){for(f=r.length,u=r.get&&r.set?_r("default"):Vr("default"),h=0;h<f;h++)if(!Pe(u(r,h))){l=!0;break}if(l){if(!Ue(f))throw new RangeError(F("invalid argument. First argument must have a length which is a multiple of two. Length: `%u`.",f));for(o=(i=new this(f/2))._buffer,h=0;h<f;h++)o[h]=n.call(e,u(r,h),h);return i}for(o=(i=new this(f))._buffer,c=0,h=0;h<f;h++){if(Pe(s=n.call(e,u(r,h),h)))o[c]=ot(s),o[c+1]=at(s);else{if(!(Ve(s)&&s.length>=2))throw new TypeError(F("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",s));o[c]=s[0],o[c+1]=s[1]}c+=2}return i}return new this(r)}if(Se(r)&<&&yr(r[Er])){if(!yr((o=r[Er]()).next))throw new TypeError(F("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",r));if(a=n?function(r,e,t){var n,i,o,a;for(n=[],a=-1;!(i=r.next()).done;)if(a+=1,Ve(o=e.call(t,i.value,a))&&o.length>=2)n.push(o[0],o[1]);else{if(!Pe(o))return new TypeError(F("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",o));n.push(ot(o),at(o))}return n}(o,n,e):ut(o),a instanceof Error)throw a;for(o=(i=new this(f=a.length/2))._buffer,h=0;h<f;h++)o[h]=a[h];return i}throw new TypeError(F("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",r))})),N(pt,"of",(function(){var r,e;if(!yr(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!ht(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(r=[],e=0;e<arguments.length;e++)r.push(arguments[e]);return new this(r)})),N(pt.prototype,"at",(function(r){if(!st(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!gr(r))throw new TypeError(F("invalid argument. Must provide an integer. Value: `%s`.",r));if(r<0&&(r+=this._length),!(r<0||r>=this._length))return ct(this._buffer,r)})),Ge(pt.prototype,"buffer",(function(){return this._buffer.buffer})),Ge(pt.prototype,"byteLength",(function(){return this._buffer.byteLength})),Ge(pt.prototype,"byteOffset",(function(){return this._buffer.byteOffset})),N(pt.prototype,"BYTES_PER_ELEMENT",pt.BYTES_PER_ELEMENT),N(pt.prototype,"copyWithin",(function(r,e){if(!st(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return 2===arguments.length?this._buffer.copyWithin(2*r,2*e):this._buffer.copyWithin(2*r,2*e,2*arguments[2]),this})),N(pt.prototype,"entries",(function(){var r,e,t,n,i,o,a;if(!st(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return e=this,r=this._buffer,n=this._length,o=-1,a=-2,N(t={},"next",(function(){var e;if(o+=1,i||o>=n)return{done:!0};return e=new it(r[a+=2],r[a+1]),{value:[o,e],done:!1}})),N(t,"return",(function(r){if(i=!0,arguments.length)return{value:r,done:!0};return{done:!0}})),Er&&N(t,Er,(function(){return e.entries()})),t})),N(pt.prototype,"every",(function(r,e){var t,n;if(!st(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!yr(r))throw new TypeError(F("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,n=0;n<this._length;n++)if(!r.call(e,ct(t,n),n,this))return!1;return!0})),N(pt.prototype,"fill",(function(r,e,t){var n,i,o,a,u,f;if(!st(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Pe(r))throw new TypeError(F("invalid argument. First argument must be a complex number. Value: `%s`.",r));if(n=this._buffer,i=this._length,arguments.length>1){if(!gr(e))throw new TypeError(F("invalid argument. Second argument must be an integer. Value: `%s`.",e));if(e<0&&(e+=i)<0&&(e=0),arguments.length>2){if(!gr(t))throw new TypeError(F("invalid argument. Third argument must be an integer. Value: `%s`.",t));t<0&&(t+=i)<0&&(t=0),t>i&&(t=i)}else t=i}else e=0,t=i;for(a=ot(r),u=at(r),f=e;f<t;f++)n[o=2*f]=a,n[o+1]=u;return this})),N(pt.prototype,"filter",(function(r,e){var t,n,i,o;if(!st(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!yr(r))throw new TypeError(F("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,n=[],i=0;i<this._length;i++)o=ct(t,i),r.call(e,o,i,this)&&n.push(o);return new this.constructor(n)})),N(pt.prototype,"find",(function(r,e){var t,n,i;if(!st(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!yr(r))throw new TypeError(F("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,n=0;n<this._length;n++)if(i=ct(t,n),r.call(e,i,n,this))return i})),N(pt.prototype,"findIndex",(function(r,e){var t,n,i;if(!st(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!yr(r))throw new TypeError(F("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,n=0;n<this._length;n++)if(i=ct(t,n),r.call(e,i,n,this))return n;return-1})),N(pt.prototype,"findLast",(function(r,e){var t,n,i;if(!st(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!yr(r))throw new TypeError(F("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,n=this._length-1;n>=0;n--)if(i=ct(t,n),r.call(e,i,n,this))return i})),N(pt.prototype,"findLastIndex",(function(r,e){var t,n,i;if(!st(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!yr(r))throw new TypeError(F("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,n=this._length-1;n>=0;n--)if(i=ct(t,n),r.call(e,i,n,this))return n;return-1})),N(pt.prototype,"forEach",(function(r,e){var t,n,i;if(!st(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!yr(r))throw new TypeError(F("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,n=0;n<this._length;n++)i=ct(t,n),r.call(e,i,n,this)})),N(pt.prototype,"get",(function(r){if(!st(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Ee(r))throw new TypeError(F("invalid argument. Must provide a nonnegative integer. Value: `%s`.",r));if(!(r>=this._length))return ct(this._buffer,r)})),Ge(pt.prototype,"length",(function(){return this._length})),N(pt.prototype,"includes",(function(r,e){var t,n,i,o,a;if(!st(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Pe(r))throw new TypeError(F("invalid argument. First argument must be a complex number. Value: `%s`.",r));if(arguments.length>1){if(!gr(e))throw new TypeError(F("invalid argument. Second argument must be an integer. Value: `%s`.",e));e<0&&(e+=this._length)<0&&(e=0)}else e=0;for(i=ot(r),o=at(r),t=this._buffer,a=e;a<this._length;a++)if(i===t[n=2*a]&&o===t[n+1])return!0;return!1})),N(pt.prototype,"indexOf",(function(r,e){var t,n,i,o,a;if(!st(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Pe(r))throw new TypeError(F("invalid argument. First argument must be a complex number. Value: `%s`.",r));if(arguments.length>1){if(!gr(e))throw new TypeError(F("invalid argument. Second argument must be an integer. Value: `%s`.",e));e<0&&(e+=this._length)<0&&(e=0)}else e=0;for(i=ot(r),o=at(r),t=this._buffer,a=e;a<this._length;a++)if(i===t[n=2*a]&&o===t[n+1])return a;return-1})),N(pt.prototype,"join",(function(r){var e,t,n,i;if(!st(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(0===arguments.length)n=",";else{if(!Be(r))throw new TypeError(F("invalid argument. First argument must be a string. Value: `%s`.",r));n=r}for(e=[],t=this._buffer,i=0;i<this._length;i++)e.push(ct(t,i).toString());return e.join(n)})),N(pt.prototype,"lastIndexOf",(function(r,e){var t,n,i,o,a;if(!st(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Pe(r))throw new TypeError(F("invalid argument. First argument must be a complex number. Value: `%s`.",r));if(arguments.length>1){if(!gr(e))throw new TypeError(F("invalid argument. Second argument must be an integer. Value: `%s`.",e));e>=this._length?e=this._length-1:e<0&&(e+=this._length)}else e=this._length-1;for(i=ot(r),o=at(r),t=this._buffer,a=e;a>=0;a--)if(i===t[n=2*a]&&o===t[n+1])return a;return-1})),N(pt.prototype,"map",(function(r,e){var t,n,i,o,a;if(!st(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!yr(r))throw new TypeError(F("invalid argument. First argument must be a function. Value: `%s`.",r));for(n=this._buffer,t=(i=new this.constructor(this._length))._buffer,o=0;o<this._length;o++)if(Pe(a=r.call(e,ct(n,o),o,this)))t[2*o]=ot(a),t[2*o+1]=at(a);else{if(!Ve(a)||2!==a.length)throw new TypeError(F("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",a));t[2*o]=a[0],t[2*o+1]=a[1]}return i})),N(pt.prototype,"reduce",(function(r,e){var t,n,i,o;if(!st(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!yr(r))throw new TypeError(F("invalid argument. First argument must be a function. Value: `%s`.",r));if(t=this._buffer,i=this._length,arguments.length>1)n=e,o=0;else{if(0===i)throw new Error("invalid operation. If not provided an initial value, an array must contain at least one element.");n=ct(t,0),o=1}for(;o<i;o++)n=r(n,ct(t,o),o,this);return n})),N(pt.prototype,"reverse",(function(){var r,e,t,n,i,o;if(!st(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(t=this._length,r=this._buffer,n=mr(t/2),i=0;i<n;i++)o=t-i-1,e=r[2*i],r[2*i]=r[2*o],r[2*o]=e,e=r[2*i+1],r[2*i+1]=r[2*o+1],r[2*o+1]=e;return this})),N(pt.prototype,"set",(function(r){var e,t,n,i,o,a,u,f,l;if(!st(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(n=this._buffer,arguments.length>1){if(!Ee(t=arguments[1]))throw new TypeError(F("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",t))}else t=0;if(Pe(r)){if(t>=this._length)throw new RangeError(F("invalid argument. Index argument is out-of-bounds. Value: `%u`.",t));return n[t*=2]=ot(r),void(n[t+1]=at(r))}if(st(r)){if(t+(a=r._length)>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(e=r._buffer,l=n.byteOffset+t*ft,e.buffer===n.buffer&&e.byteOffset<l&&e.byteOffset+e.byteLength>l){for(i=new Lr(e.length),f=0;f<e.length;f++)i[f]=e[f];e=i}for(t*=2,l=0,f=0;f<a;f++)n[t]=e[l],n[t+1]=e[l+1],t+=2,l+=2}else{if(!vr(r))throw new TypeError(F("invalid argument. First argument must be either a complex number, an array-like object, or a complex number array. Value: `%s`.",r));for(a=r.length,f=0;f<a;f++)if(!Pe(r[f])){o=!0;break}if(o){if(!Ue(a))throw new RangeError(F("invalid argument. Array-like object arguments must have a length which is a multiple of two. Length: `%u`.",a));if(t+a/2>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(e=r,l=n.byteOffset+t*ft,e.buffer===n.buffer&&e.byteOffset<l&&e.byteOffset+e.byteLength>l){for(i=new Lr(a),f=0;f<a;f++)i[f]=e[f];e=i}for(t*=2,a/=2,l=0,f=0;f<a;f++)n[t]=e[l],n[t+1]=e[l+1],t+=2,l+=2;return}if(t+a>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");for(t*=2,f=0;f<a;f++)u=r[f],n[t]=ot(u),n[t+1]=at(u),t+=2}})),N(pt.prototype,"slice",(function(r,e){var t,n,i,o,a,u,f;if(!st(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(a=this._buffer,u=this._length,0===arguments.length)r=0,e=u;else{if(!gr(r))throw new TypeError(F("invalid argument. First argument must be an integer. Value: `%s`.",r));if(r<0&&(r+=u)<0&&(r=0),1===arguments.length)e=u;else{if(!gr(e))throw new TypeError(F("invalid argument. Second argument must be an integer. Value: `%s`.",e));e<0?(e+=u)<0&&(e=0):e>u&&(e=u)}}for(t=r<e?e-r:0,n=(i=new this.constructor(t))._buffer,f=0;f<t;f++)o=2*(f+r),n[2*f]=a[o],n[2*f+1]=a[o+1];return i})),N(pt.prototype,"some",(function(r,e){var t,n;if(!st(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!yr(r))throw new TypeError(F("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,n=0;n<this._length;n++)if(r.call(e,ct(t,n),n,this))return!0;return!1})),N(pt.prototype,"subarray",(function(r,e){var t,n,i;if(!st(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(n=this._buffer,i=this._length,0===arguments.length)r=0,e=i;else{if(!gr(r))throw new TypeError(F("invalid argument. First argument must be an integer. Value: `%s`.",r));if(r<0&&(r+=i)<0&&(r=0),1===arguments.length)e=i;else{if(!gr(e))throw new TypeError(F("invalid argument. Second argument must be an integer. Value: `%s`.",e));e<0?(e+=i)<0&&(e=0):e>i&&(e=i)}}return r>=i?(i=0,t=n.byteLength):r>=e?(i=0,t=n.byteOffset+r*ft):(i=e-r,t=n.byteOffset+r*ft),new this.constructor(n.buffer,t,i<0?0:i)})),N(pt.prototype,"toReversed",(function(){var r,e,t,n,i,o;if(!st(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(t=this._length,e=new this.constructor(t),n=this._buffer,r=e._buffer,i=0;i<t;i++)o=t-i-1,r[2*i]=n[2*o],r[2*i+1]=n[2*o+1];return e})),N(pt.prototype,"toString",(function(){var r,e,t;if(!st(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(r=[],e=this._buffer,t=0;t<this._length;t++)r.push(ct(e,t).toString());return r.join(",")})),N(pt.prototype,"with",(function(r,e){var t,n,i;if(!st(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!gr(r))throw new TypeError(F("invalid argument. First argument must be an integer. Value: `%s`.",r));if(i=this._length,r<0&&(r+=i),r<0||r>=i)throw new RangeError(F("invalid argument. Index argument is out-of-bounds. Value: `%s`.",r));if(!Pe(e))throw new TypeError(F("invalid argument. Second argument must be a complex number. Value: `%s`.",e));return(t=(n=new this.constructor(this._buffer))._buffer)[2*r]=ot(e),t[2*r+1]=at(e),n}));var mt=ee.BYTES_PER_ELEMENT,gt=dr();function wt(r){return"object"==typeof r&&null!==r&&"BooleanArray"===r.constructor.name&&r.BYTES_PER_ELEMENT===mt}function vt(r){return r===bt}function bt(){var r,e,t,n,i;if(e=arguments.length,!(this instanceof bt))return 0===e?new bt:1===e?new bt(arguments[0]):2===e?new bt(arguments[0],arguments[1]):new bt(arguments[0],arguments[1],arguments[2]);if(0===e)t=new ee(0);else if(1===e)if(Ee(i=arguments[0]))t=new ee(i);else if(vr(i))t=function(r,e){var t,n;for(t=e.length,n=0;n<t;n++)r[n]=H(e[n]);return r}(new ee(i.length),i);else if(je(i))t=new ee(i);else{if(!Se(i))throw new TypeError(F("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",i));if(!1===gt)throw new TypeError(F("invalid argument. Environment lacks Symbol.iterator support. Must provide a length, ArrayBuffer, typed array, or array-like object. Value: `%s`.",i));if(!yr(i[Er]))throw new TypeError(F("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",i));if(!yr((t=i[Er]()).next))throw new TypeError(F("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",i));t=new ee(yt(t))}else{if(!je(t=arguments[0]))throw new TypeError(F("invalid argument. First argument must be an ArrayBuffer. Value: `%s`.",t));if(!Ee(r=arguments[1]))throw new TypeError(F("invalid argument. Byte offset must be a nonnegative integer. Value: `%s`.",r));if(2===e)t=new ee(t,r);else{if(!Ee(n=arguments[2]))throw new TypeError(F("invalid argument. Length must be a nonnegative integer. Value: `%s`.",n));if(n*mt>t.byteLength-r)throw new RangeError(F("invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.",n*mt));t=new ee(t,r,n)}}return N(this,"_buffer",t),N(this,"_length",t.length),this}N(bt,"BYTES_PER_ELEMENT",mt),N(bt,"name","BooleanArray"),N(bt,"from",(function(r){var e,t,n,i,o,a,u,f,l;if(!yr(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!vt(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if((t=arguments.length)>1){if(!yr(n=arguments[1]))throw new TypeError(F("invalid argument. Second argument must be a function. Value: `%s`.",n));t>2&&(e=arguments[2])}if(vr(r)){if(n){for(f=r.length,u=r.get&&r.set?_r("default"):Vr("default"),o=(i=new this(f))._buffer,l=0;l<f;l++)o[l]=H(n.call(e,u(r,l),l));return i}return new this(r)}if(Se(r)&>&&yr(r[Er])){if(!yr((o=r[Er]()).next))throw new TypeError(F("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",r));for(a=n?function(r,e,t){var n,i,o;for(n=[],o=-1;!(i=r.next()).done;)o+=1,n.push(H(e.call(t,i.value,o)));return n}(o,n,e):yt(o),o=(i=new this(f=a.length))._buffer,l=0;l<f;l++)o[l]=a[l];return i}throw new TypeError(F("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",r))})),N(bt,"of",(function(){var r,e;if(!yr(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!vt(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");for(r=[],e=0;e<arguments.length;e++)r.push(arguments[e]);return new this(r)})),Ge(bt.prototype,"buffer",(function(){return this._buffer.buffer})),Ge(bt.prototype,"byteLength",(function(){return this._buffer.byteLength})),Ge(bt.prototype,"byteOffset",(function(){return this._buffer.byteOffset})),N(bt.prototype,"BYTES_PER_ELEMENT",bt.BYTES_PER_ELEMENT),N(bt.prototype,"find",(function(r,e){var t,n,i;if(!wt(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!yr(r))throw new TypeError(F("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,i=0;i<this._length;i++)if(n=H(t[i]),r.call(e,n,i,this))return n})),N(bt.prototype,"findIndex",(function(r,e){var t,n,i;if(!wt(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!yr(r))throw new TypeError(F("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,i=0;i<this._length;i++)if(n=H(t[i]),r.call(e,n,i,this))return i;return-1})),N(bt.prototype,"findLast",(function(r,e){var t,n,i;if(!wt(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!yr(r))throw new TypeError(F("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,i=this._length-1;i>=0;i--)if(n=H(t[i]),r.call(e,n,i,this))return n})),N(bt.prototype,"findLastIndex",(function(r,e){var t,n,i;if(!wt(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!yr(r))throw new TypeError(F("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,i=this._length-1;i>=0;i--)if(n=H(t[i]),r.call(e,n,i,this))return i;return-1})),N(bt.prototype,"get",(function(r){if(!wt(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!Ee(r))throw new TypeError(F("invalid argument. Must provide a nonnegative integer. Value: `%s`.",r));if(!(r>=this._length))return H(this._buffer[r])})),Ge(bt.prototype,"length",(function(){return this._length})),N(bt.prototype,"map",(function(r,e){var t,n,i,o;if(!wt(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!yr(r))throw new TypeError("invalid argument. First argument must be a function. Value: `%s`.",r);for(i=this._buffer,t=(n=new this.constructor(this._length))._buffer,o=0;o<this._length;o++)t[o]=H(r.call(e,H(i[o]),o,this));return n})),N(bt.prototype,"reverse",(function(){var r,e,t,n,i,o;if(!wt(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");for(r=this._buffer,t=this._length,n=mr(t/2),i=0;i<n;i++)o=t-i-1,e=r[i],r[i]=r[o],r[o]=e;return this})),N(bt.prototype,"set",(function(r){var e,t,n,i,o,a,u;if(!wt(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(n=this._buffer,arguments.length>1){if(!Ee(t=arguments[1]))throw new TypeError(F("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",t))}else t=0;if(vr(r)){if(t+(o=r.length)>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(e=wt(r)?r._buffer:r,u=n.byteOffset+t*mt,e.buffer===n.buffer&&e.byteOffset<u&&e.byteOffset+e.byteLength>u){for(i=new ee(e.length),a=0;a<e.length;a++)i[a]=e[a];e=i}for(a=0;a<o;t++,a++)n[t]=e[a]?1:0}else{if(t>=this._length)throw new RangeError(F("invalid argument. Index argument is out-of-bounds. Value: `%u`.",t));n[t]=r?1:0}})),N(bt.prototype,"sort",(function(r){var e;if(!wt(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(e=this._buffer,0===arguments.length)return e.sort(),this;if(!yr(r))throw new TypeError(F("invalid argument. First argument must be a function. Value: `%s`.",r));return e.sort((function(e,t){return r(H(e),H(t))})),this})),N(bt.prototype,"toReversed",(function(){var r,e,t,n,i;if(!wt(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");for(t=this._length,e=new this.constructor(t),n=this._buffer,r=e._buffer,i=0;i<t;i++)r[i]=n[t-i-1];return e}));var dt=[Lr,Or,$r,Pr,Dr,Xr,le,ee,oe,nt,pt,bt],Et=["float64","float32","int32","uint32","int16","uint16","int8","uint8","uint8c","complex64","complex128","bool"],Tt=Et.length;function _t(){var r,e=arguments,t="https://stdlib.io/e/"+e[0]+"?";for(r=1;r<e.length;r++)t+="&arg[]="+encodeURIComponent(e[r]);return t}return function r(e){var t,n,i,o,a,u,f,l;if(!vr(e))throw new TypeError(_t("01Z2O",e));if(arguments.length>1){if(!yr(o=arguments[1]))throw new TypeError(_t("01Z2H",o));t=arguments[2]}return f=-1,N(n={},"next",o?function(){if(f+=1,i||f>=e.length)return{done:!0};return{value:o.call(t,a(e,f),f,e),done:!1}}:function(){if(f+=1,i||f>=e.length)return{done:!0};return{value:a(e,f),done:!1}}),N(n,"return",(function(r){if(i=!0,arguments.length)return{value:r,done:!0};return{done:!0}})),Er&&N(n,Er,(function(){if(o)return r(e,o,t);return r(e)})),u=function(r){var e;if(lr(r))return"generic";if(hr(r))return null;for(e=0;e<Tt;e++)if(r instanceof dt[e])return Et[e];return Ar[cr(r)]||null}(e),a=typeof(l=e).get===br&&typeof l.set===br?_r(u):Vr(u),n}}));
//# sourceMappingURL=index.js.map