-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbrowser.js
3 lines (3 loc) · 63.8 KB
/
browser.js
1
2
3
// Copyright (c) 2025 The Stdlib Authors. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0
var r,e;r=this,e=function(){"use strict";var r="function"==typeof Object.defineProperty?Object.defineProperty:null,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/,b=/(\..*[^0])0*e/;function v(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,b,"$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("string"==typeof(n=r[s]))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=v(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,G=Object.prototype.hasOwnProperty;function Z(r,e){return null!=r&&G.call(r,e)}var J="function"==typeof Symbol?Symbol:void 0,X="function"==typeof J?J.toStringTag:"",z=W()?function(r){var e,t,n;if(null==r)return $.call(r);t=r[X],e=Z(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)},q=Boolean,D=Boolean.prototype.toString,H=W();function K(r){return"object"==typeof r&&(r instanceof q||(H?function(r){try{return D.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 globalThis?globalThis:null,nr=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(tr)return tr;if(rr)return rr;if(er)return er;throw new Error("unexpected error. Unable to resolve global object.")}(),ir=nr.document&&nr.document.childNodes,or=Int8Array;function ar(){return/^\s*function\s*([^(]*)/i}var ur=/^\s*function\s*([^(]*)/i;N(ar,"REGEXP",ur);var fr=Array.isArray?Array.isArray:function(r){return"[object Array]"===z(r)};function lr(r){return null!==r&&"object"==typeof r}function sr(r){return lr(r)&&(r._isBuffer||r.constructor&&"function"==typeof r.constructor.isBuffer&&r.constructor.isBuffer(r))}function hr(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=ur.exec(n.toString()))return e[1]}return sr(r)?"Buffer":t}N(lr,"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(!fr(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}}(lr));var cr="function"==typeof P||"object"==typeof or||"function"==typeof ir?function(r){return hr(r).toLowerCase()}:function(r){var e;return null===r?"null":"object"==(e=typeof r)?hr(r).toLowerCase():e};function pr(r){return"function"===cr(r)}var yr=Math.floor;function mr(r){return yr(r)===r}var gr=9007199254740991;function wr(r){return"object"==typeof r&&null!==r&&"number"==typeof r.length&&mr(r.length)&&r.length>=0&&r.length<=gr}function br(r){return"number"==typeof r}var vr=Number,dr=vr.prototype.toString,Er=W();function Tr(r){return"object"==typeof r&&(r instanceof vr||(Er?function(r){try{return dr.call(r),!0}catch(r){return!1}}(r):"[object Number]"===z(r)))}function _r(r){return br(r)||Tr(r)}N(_r,"isPrimitive",br),N(_r,"isObject",Tr);var xr=Number.POSITIVE_INFINITY,Vr=vr.NEGATIVE_INFINITY;function Ar(r){return r<xr&&r>Vr&&mr(r)}function jr(r){return br(r)&&Ar(r)}function Sr(r){return Tr(r)&&Ar(r.valueOf())}function Fr(r){return jr(r)||Sr(r)}N(Fr,"isPrimitive",jr),N(Fr,"isObject",Sr);var Lr="function";function kr(){return"function"==typeof J&&"symbol"==typeof J("foo")&&Z(J,"iterator")&&"symbol"==typeof J.iterator}var Rr=kr()?Symbol.iterator:null,Br={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 Ir(r){var e=Br[r];return"function"==typeof e?e:Br.default}var Or={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 Mr(r){var e=Or[r];return"function"==typeof e?e:Or.default}var Cr={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"},Nr="function"==typeof Float64Array,Pr="function"==typeof Float64Array?Float64Array:null,Ur="function"==typeof Float64Array?Float64Array:void 0,Yr=function(){var r,e,t;if("function"!=typeof Pr)return!1;try{e=new Pr([1,3.14,-3.14,NaN]),t=e,r=(Nr&&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}()?Ur:function(){throw new Error("not implemented")},Wr="function"==typeof Float32Array,$r="function"==typeof Float32Array?Float32Array:null,Gr="function"==typeof Float32Array?Float32Array:void 0,Zr=function(){var r,e,t;if("function"!=typeof $r)return!1;try{e=new $r([1,3.14,-3.14,5e40]),t=e,r=(Wr&&t instanceof Float32Array||"[object Float32Array]"===z(t))&&1===e[0]&&3.140000104904175===e[1]&&-3.140000104904175===e[2]&&e[3]===xr}catch(e){r=!1}return r}()?Gr:function(){throw new Error("not implemented")},Jr="function"==typeof Uint32Array,Xr="function"==typeof Uint32Array?Uint32Array:null,zr="function"==typeof Uint32Array?Uint32Array:void 0,qr=function(){var r,e,t;if("function"!=typeof Xr)return!1;try{e=new Xr(e=[1,3.14,-3.14,4294967296,4294967297]),t=e,r=(Jr&&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}()?zr:function(){throw new Error("not implemented")},Dr="function"==typeof Int32Array,Hr="function"==typeof Int32Array?Int32Array:null,Kr="function"==typeof Int32Array?Int32Array:void 0,Qr=function(){var r,e,t;if("function"!=typeof Hr)return!1;try{e=new Hr([1,3.14,-3.14,2147483648]),t=e,r=(Dr&&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}()?Kr:function(){throw new Error("not implemented")},re="function"==typeof Uint16Array,ee="function"==typeof Uint16Array?Uint16Array:null,te="function"==typeof Uint16Array?Uint16Array:void 0,ne=function(){var r,e,t;if("function"!=typeof ee)return!1;try{e=new ee(e=[1,3.14,-3.14,65536,65537]),t=e,r=(re&&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}()?te:function(){throw new Error("not implemented")},ie="function"==typeof Int16Array,oe="function"==typeof Int16Array?Int16Array:null,ae="function"==typeof Int16Array?Int16Array:void 0,ue=function(){var r,e,t;if("function"!=typeof oe)return!1;try{e=new oe([1,3.14,-3.14,32768]),t=e,r=(ie&&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}()?ae:function(){throw new Error("not implemented")},fe="function"==typeof Uint8Array,le="function"==typeof Uint8Array?Uint8Array:null,se="function"==typeof Uint8Array?Uint8Array:void 0,he=function(){var r,e,t;if("function"!=typeof le)return!1;try{e=new le(e=[1,3.14,-3.14,256,257]),t=e,r=(fe&&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}()?se:function(){throw new Error("not implemented")},ce="function"==typeof Uint8ClampedArray,pe="function"==typeof Uint8ClampedArray?Uint8ClampedArray:null,ye="function"==typeof Uint8ClampedArray?Uint8ClampedArray:void 0,me=function(){var r,e,t;if("function"!=typeof pe)return!1;try{e=new pe([-1,0,1,3.14,4.99,255,256]),t=e,r=(ce&&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}()?ye:function(){throw new Error("not implemented")},ge="function"==typeof Int8Array,we="function"==typeof Int8Array?Int8Array:null,be="function"==typeof Int8Array?Int8Array:void 0,ve=function(){var r,e,t;if("function"!=typeof we)return!1;try{e=new we([1,3.14,-3.14,128]),t=e,r=(ge&&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}()?be:function(){throw new Error("not implemented")};function de(r){return jr(r)&&r>=0}function Ee(r){return Sr(r)&&r.valueOf()>=0}function Te(r){return de(r)||Ee(r)}N(Te,"isPrimitive",de),N(Te,"isObject",Ee);var _e=4294967295;function xe(r){return"object"==typeof r&&null!==r&&"number"==typeof r.length&&mr(r.length)&&r.length>=0&&r.length<=_e}var Ve="function"==typeof ArrayBuffer;function Ae(r){return Ve&&r instanceof ArrayBuffer||"[object ArrayBuffer]"===z(r)}function je(r){return"object"==typeof r&&null!==r&&!fr(r)}function Se(r){return"string"==typeof r}var Fe=String.prototype.valueOf,Le=W();function ke(r){return"object"==typeof r&&(r instanceof String||(Le?function(r){try{return Fe.call(r),!0}catch(r){return!1}}(r):"[object String]"===z(r)))}function Re(r){return Se(r)||ke(r)}function Be(r,e){if(!(this instanceof Be))throw new TypeError("invalid invocation. Constructor must be called with the `new` keyword.");if(!br(r))throw new TypeError(F("invalid argument. Real component must be a number. Value: `%s`.",r));if(!br(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(Re,"isPrimitive",Se),N(Re,"isObject",ke),N(Be,"BYTES_PER_ELEMENT",8),N(Be.prototype,"BYTES_PER_ELEMENT",8),N(Be.prototype,"byteLength",16),N(Be.prototype,"toString",(function(){var r=""+this.re;return this.im<0?r+=" - "+-this.im:r+=" + "+this.im,r+="i"})),N(Be.prototype,"toJSON",(function(){var r={type:"Complex128"};return r.re=this.re,r.im=this.im,r}));var Ie="function"==typeof Math.fround?Math.fround:null,Oe=new Zr(1),Me="function"==typeof Ie?Ie:function(r){return Oe[0]=r,Oe[0]};function Ce(r,e){if(!(this instanceof Ce))throw new TypeError("invalid invocation. Constructor must be called with the `new` keyword.");if(!br(r))throw new TypeError(F("invalid argument. Real component must be a number. Value: `%s`.",r));if(!br(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:Me(r)}),C(this,"im",{configurable:!1,enumerable:!0,writable:!1,value:Me(e)}),this}function Ne(r){return r instanceof Be||r instanceof Ce||"object"==typeof r&&null!==r&&"number"==typeof r.re&&"number"==typeof r.im}function Pe(r){return mr(r/2)}N(Ce,"BYTES_PER_ELEMENT",4),N(Ce.prototype,"BYTES_PER_ELEMENT",4),N(Ce.prototype,"byteLength",8),N(Ce.prototype,"toString",(function(){var r=""+this.re;return this.im<0?r+=" - "+-this.im:r+=" + "+this.im,r+="i"})),N(Ce.prototype,"toJSON",(function(){var r={type:"Complex64"};return r.re=this.re,r.im=this.im,r}));var Ue=8;function Ye(r){return"object"==typeof r&&null!==r&&"Complex64Array"===r.constructor.name&&r.BYTES_PER_ELEMENT===Ue}var We=16;function $e(r){return"object"==typeof r&&null!==r&&"Complex128Array"===r.constructor.name&&r.BYTES_PER_ELEMENT===We}function Ge(r,e,t){C(r,e,{configurable:!1,enumerable:!1,get:t})}function Ze(r,e){if(!(this instanceof Ze))throw new TypeError("invalid invocation. Constructor must be called with the `new` keyword.");if(!br(r))throw new TypeError(F("invalid argument. Real component must be a number. Value: `%s`.",r));if(!br(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:Me(r)}),C(this,"im",{configurable:!1,enumerable:!0,writable:!1,value:Me(e)}),this}function Je(r){return r.re}function Xe(r){return r.im}function ze(r,e){return new Zr(r.buffer,r.byteOffset+r.BYTES_PER_ELEMENT*e,2*(r.length-e))}function qe(r,e){return new Yr(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(xe(n=t.value)&&n.length>=2)e.push(n[0],n[1]);else{if(!Ne(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(Je(n),Xe(n))}return e}N(Ze,"BYTES_PER_ELEMENT",4),N(Ze.prototype,"BYTES_PER_ELEMENT",4),N(Ze.prototype,"byteLength",8),N(Ze.prototype,"toString",(function(){var r=""+this.re;return this.im<0?r+=" - "+-this.im:r+=" + "+this.im,r+="i"})),N(Ze.prototype,"toJSON",(function(){var r={type:"Complex64"};return r.re=this.re,r.im=this.im,r}));var He=2*Zr.BYTES_PER_ELEMENT,Ke=kr();function Qe(r){return r instanceof tt||"object"==typeof r&&null!==r&&("Complex64Array"===r.constructor.name||"Complex128Array"===r.constructor.name)&&"number"==typeof r._length&&"object"==typeof r._buffer}function rt(r){return r===tt||"Complex128Array"===r.name}function et(r,e){return new Ze(r[e*=2],r[e+1])}function tt(){var r,e,t,n;if(e=arguments.length,!(this instanceof tt))return 0===e?new tt:1===e?new tt(arguments[0]):2===e?new tt(arguments[0],arguments[1]):new tt(arguments[0],arguments[1],arguments[2]);if(0===e)t=new Zr(0);else if(1===e)if(de(arguments[0]))t=new Zr(2*arguments[0]);else if(wr(arguments[0]))if((n=(t=arguments[0]).length)&&fr(t)&&Ne(t[0])){if(t=function(r,e){var t,n,i,o;for(t=e.length,o=0,i=0;i<t;i++){if(!Ne(n=e[i]))return null;r[o]=Je(n),r[o+1]=Xe(n),o+=2}return r}(new Zr(2*n),t),null===t){if(!Pe(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 Zr(arguments[0])}}else{if(Ye(t))t=ze(t,0);else if($e(t))t=qe(t,0);else if(!Pe(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 Zr(t)}else if(Ae(arguments[0])){if(!mr((t=arguments[0]).byteLength/He))throw new RangeError(F("invalid argument. ArrayBuffer byte length must be a multiple of %u. Byte length: `%u`.",He,t.byteLength));t=new Zr(t)}else{if(!je(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===Ke)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(!pr(t[Rr]))throw new TypeError(F("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",t));if(!pr((t=t[Rr]()).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 Zr(t)}else{if(!Ae(t=arguments[0]))throw new TypeError(F("invalid argument. First argument must be an ArrayBuffer. Value: `%s`.",t));if(!de(r=arguments[1]))throw new TypeError(F("invalid argument. Byte offset must be a nonnegative integer. Value: `%s`.",r));if(!mr(r/He))throw new RangeError(F("invalid argument. Byte offset must be a multiple of %u. Value: `%u`.",He,r));if(2===e){if(!mr((n=t.byteLength-r)/He))throw new RangeError(F("invalid arguments. ArrayBuffer view byte length must be a multiple of %u. View byte length: `%u`.",He,n));t=new Zr(t,r)}else{if(!de(n=arguments[2]))throw new TypeError(F("invalid argument. Length must be a nonnegative integer. Value: `%s`.",n));if(n*He>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*He));t=new Zr(t,r,2*n)}}return N(this,"_buffer",t),N(this,"_length",t.length/2),this}function nt(r,e){if(!(this instanceof nt))throw new TypeError("invalid invocation. Constructor must be called with the `new` keyword.");if(!br(r))throw new TypeError(F("invalid argument. Real component must be a number. Value: `%s`.",r));if(!br(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 it(r){return r.re}function ot(r){return r.im}function at(r){var e,t,n;for(e=[];!(t=r.next()).done;)if(xe(n=t.value)&&n.length>=2)e.push(n[0],n[1]);else{if(!Ne(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(it(n),ot(n))}return e}N(tt,"BYTES_PER_ELEMENT",He),N(tt,"name","Complex64Array"),N(tt,"from",(function(r){var e,t,n,i,o,a,u,f,l,s,h,c;if(!pr(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!rt(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if((t=arguments.length)>1){if(!pr(n=arguments[1]))throw new TypeError(F("invalid argument. Second argument must be a function. Value: `%s`.",n));t>2&&(e=arguments[2])}if(Qe(r)){if(f=r.length,n){for(o=(i=new this(f))._buffer,c=0,h=0;h<f;h++){if(Ne(s=n.call(e,r.get(h),h)))o[c]=Je(s),o[c+1]=Xe(s);else{if(!(xe(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(wr(r)){if(n){for(f=r.length,u=r.get&&r.set?Ir("default"):Mr("default"),h=0;h<f;h++)if(!Ne(u(r,h))){l=!0;break}if(l){if(!Pe(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(Ne(s=n.call(e,u(r,h),h)))o[c]=Je(s),o[c+1]=Xe(s);else{if(!(xe(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(je(r)&&Ke&&pr(r[Rr])){if(!pr((o=r[Rr]()).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,xe(o=e.call(t,i.value,a))&&o.length>=2)n.push(o[0],o[1]);else{if(!Ne(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(Je(o),Xe(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(tt,"of",(function(){var r,e;if(!pr(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!rt(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(tt.prototype,"at",(function(r){if(!Qe(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!mr(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 et(this._buffer,r)})),Ge(tt.prototype,"buffer",(function(){return this._buffer.buffer})),Ge(tt.prototype,"byteLength",(function(){return this._buffer.byteLength})),Ge(tt.prototype,"byteOffset",(function(){return this._buffer.byteOffset})),N(tt.prototype,"BYTES_PER_ELEMENT",tt.BYTES_PER_ELEMENT),N(tt.prototype,"copyWithin",(function(r,e){if(!Qe(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(tt.prototype,"entries",(function(){var r,e,t,n,i,o,a;if(!Qe(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;return o+=1,i||o>=n?{done:!0}:(e=new Ze(r[a+=2],r[a+1]),{value:[o,e],done:!1})})),N(t,"return",(function(r){return i=!0,arguments.length?{value:r,done:!0}:{done:!0}})),Rr&&N(t,Rr,(function(){return e.entries()})),t})),N(tt.prototype,"every",(function(r,e){var t,n;if(!Qe(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!pr(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,et(t,n),n,this))return!1;return!0})),N(tt.prototype,"fill",(function(r,e,t){var n,i,o,a,u,f;if(!Qe(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Ne(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(!mr(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(!mr(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=Je(r),u=Xe(r),f=e;f<t;f++)n[o=2*f]=a,n[o+1]=u;return this})),N(tt.prototype,"filter",(function(r,e){var t,n,i,o;if(!Qe(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!pr(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=et(t,i),r.call(e,o,i,this)&&n.push(o);return new this.constructor(n)})),N(tt.prototype,"find",(function(r,e){var t,n,i;if(!Qe(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!pr(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=et(t,n),r.call(e,i,n,this))return i})),N(tt.prototype,"findIndex",(function(r,e){var t,n,i;if(!Qe(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!pr(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=et(t,n),r.call(e,i,n,this))return n;return-1})),N(tt.prototype,"findLast",(function(r,e){var t,n,i;if(!Qe(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!pr(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=et(t,n),r.call(e,i,n,this))return i})),N(tt.prototype,"findLastIndex",(function(r,e){var t,n,i;if(!Qe(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!pr(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=et(t,n),r.call(e,i,n,this))return n;return-1})),N(tt.prototype,"forEach",(function(r,e){var t,n,i;if(!Qe(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!pr(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=et(t,n),r.call(e,i,n,this)})),N(tt.prototype,"get",(function(r){if(!Qe(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!de(r))throw new TypeError(F("invalid argument. Must provide a nonnegative integer. Value: `%s`.",r));if(!(r>=this._length))return et(this._buffer,r)})),N(tt.prototype,"includes",(function(r,e){var t,n,i,o,a;if(!Qe(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Ne(r))throw new TypeError(F("invalid argument. First argument must be a complex number. Value: `%s`.",r));if(arguments.length>1){if(!mr(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=Je(r),o=Xe(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(tt.prototype,"indexOf",(function(r,e){var t,n,i,o,a;if(!Qe(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Ne(r))throw new TypeError(F("invalid argument. First argument must be a complex number. Value: `%s`.",r));if(arguments.length>1){if(!mr(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=Je(r),o=Xe(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(tt.prototype,"join",(function(r){var e,t,n,i;if(!Qe(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(0===arguments.length)n=",";else{if(!Se(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(et(t,i).toString());return e.join(n)})),N(tt.prototype,"lastIndexOf",(function(r,e){var t,n,i,o,a;if(!Qe(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Ne(r))throw new TypeError(F("invalid argument. First argument must be a complex number. Value: `%s`.",r));if(arguments.length>1){if(!mr(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=Je(r),o=Xe(r),t=this._buffer,a=e;a>=0;a--)if(i===t[n=2*a]&&o===t[n+1])return a;return-1})),Ge(tt.prototype,"length",(function(){return this._length})),N(tt.prototype,"map",(function(r,e){var t,n,i,o,a;if(!Qe(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!pr(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(Ne(a=r.call(e,et(n,o),o,this)))t[2*o]=Je(a),t[2*o+1]=Xe(a);else{if(!xe(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(tt.prototype,"reduce",(function(r,e){var t,n,i,o;if(!Qe(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!pr(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=et(t,0),o=1}for(;o<i;o++)n=r(n,et(t,o),o,this);return n})),N(tt.prototype,"reverse",(function(){var r,e,t,n,i,o;if(!Qe(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(t=this._length,r=this._buffer,n=yr(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(tt.prototype,"set",(function(r){var e,t,n,i,o,a,u,f,l;if(!Qe(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(n=this._buffer,arguments.length>1){if(!de(t=arguments[1]))throw new TypeError(F("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",t))}else t=0;if(Ne(r)){if(t>=this._length)throw new RangeError(F("invalid argument. Index argument is out-of-bounds. Value: `%u`.",t));return n[t*=2]=Je(r),void(n[t+1]=Xe(r))}if(Qe(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*He,e.buffer===n.buffer&&e.byteOffset<l&&e.byteOffset+e.byteLength>l){for(i=new Zr(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(!wr(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(!Ne(r[f])){o=!0;break}if(o){if(!Pe(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*He,e.buffer===n.buffer&&e.byteOffset<l&&e.byteOffset+e.byteLength>l){for(i=new Zr(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]=Je(u),n[t+1]=Xe(u),t+=2}})),N(tt.prototype,"slice",(function(r,e){var t,n,i,o,a,u,f;if(!Qe(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(!mr(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(!mr(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(tt.prototype,"some",(function(r,e){var t,n;if(!Qe(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!pr(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,et(t,n),n,this))return!0;return!1})),N(tt.prototype,"subarray",(function(r,e){var t,n,i;if(!Qe(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(!mr(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(!mr(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*He):(i=e-r,t=n.byteOffset+r*He),new this.constructor(n.buffer,t,i<0?0:i)})),N(tt.prototype,"toReversed",(function(){var r,e,t,n,i,o;if(!Qe(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(tt.prototype,"toString",(function(){var r,e,t;if(!Qe(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(et(e,t).toString());return r.join(",")})),N(tt.prototype,"with",(function(r,e){var t,n,i;if(!Qe(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!mr(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(!Ne(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]=Je(e),t[2*r+1]=Xe(e),n})),N(nt,"BYTES_PER_ELEMENT",8),N(nt.prototype,"BYTES_PER_ELEMENT",8),N(nt.prototype,"byteLength",16),N(nt.prototype,"toString",(function(){var r=""+this.re;return this.im<0?r+=" - "+-this.im:r+=" + "+this.im,r+="i"})),N(nt.prototype,"toJSON",(function(){var r={type:"Complex128"};return r.re=this.re,r.im=this.im,r}));var ut=2*Yr.BYTES_PER_ELEMENT,ft=kr();function lt(r){return r instanceof ct||"object"==typeof r&&null!==r&&("Complex64Array"===r.constructor.name||"Complex128Array"===r.constructor.name)&&"number"==typeof r._length&&"object"==typeof r._buffer}function st(r){return r===ct||"Complex64Array"===r.name}function ht(r,e){return new nt(r[e*=2],r[e+1])}function ct(){var r,e,t,n;if(e=arguments.length,!(this instanceof ct))return 0===e?new ct:1===e?new ct(arguments[0]):2===e?new ct(arguments[0],arguments[1]):new ct(arguments[0],arguments[1],arguments[2]);if(0===e)t=new Yr(0);else if(1===e)if(de(arguments[0]))t=new Yr(2*arguments[0]);else if(wr(arguments[0]))if((n=(t=arguments[0]).length)&&fr(t)&&Ne(t[0])){if(t=function(r,e){var t,n,i,o;for(t=e.length,o=0,i=0;i<t;i++){if(!Ne(n=e[i]))return null;r[o]=it(n),r[o+1]=ot(n),o+=2}return r}(new Yr(2*n),t),null===t){if(!Pe(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 Yr(arguments[0])}}else{if(Ye(t))t=ze(t,0);else if($e(t))t=qe(t,0);else if(!Pe(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 Yr(t)}else if(Ae(arguments[0])){if(!mr((t=arguments[0]).byteLength/ut))throw new RangeError(F("invalid argument. ArrayBuffer byte length must be a multiple of %u. Byte length: `%u`.",ut,t.byteLength));t=new Yr(t)}else{if(!je(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===ft)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(!pr(t[Rr]))throw new TypeError(F("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",t));if(!pr((t=t[Rr]()).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=at(t))instanceof Error)throw t;t=new Yr(t)}else{if(!Ae(t=arguments[0]))throw new TypeError(F("invalid argument. First argument must be an ArrayBuffer. Value: `%s`.",t));if(!de(r=arguments[1]))throw new TypeError(F("invalid argument. Byte offset must be a nonnegative integer. Value: `%s`.",r));if(!mr(r/ut))throw new RangeError(F("invalid argument. Byte offset must be a multiple of %u. Value: `%u`.",ut,r));if(2===e){if(!mr((n=t.byteLength-r)/ut))throw new RangeError(F("invalid arguments. ArrayBuffer view byte length must be a multiple of %u. View byte length: `%u`.",ut,n));t=new Yr(t,r)}else{if(!de(n=arguments[2]))throw new TypeError(F("invalid argument. Length must be a nonnegative integer. Value: `%s`.",n));if(n*ut>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*ut));t=new Yr(t,r,2*n)}}return N(this,"_buffer",t),N(this,"_length",t.length/2),this}function pt(r){var e,t;for(e=[];!(t=r.next()).done;)e.push(q(t.value));return e}N(ct,"BYTES_PER_ELEMENT",ut),N(ct,"name","Complex128Array"),N(ct,"from",(function(r){var e,t,n,i,o,a,u,f,l,s,h,c;if(!pr(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!st(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if((t=arguments.length)>1){if(!pr(n=arguments[1]))throw new TypeError(F("invalid argument. Second argument must be a function. Value: `%s`.",n));t>2&&(e=arguments[2])}if(lt(r)){if(f=r.length,n){for(o=(i=new this(f))._buffer,c=0,h=0;h<f;h++){if(Ne(s=n.call(e,r.get(h),h)))o[c]=it(s),o[c+1]=ot(s);else{if(!(xe(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(wr(r)){if(n){for(f=r.length,u=r.get&&r.set?Ir("default"):Mr("default"),h=0;h<f;h++)if(!Ne(u(r,h))){l=!0;break}if(l){if(!Pe(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(Ne(s=n.call(e,u(r,h),h)))o[c]=it(s),o[c+1]=ot(s);else{if(!(xe(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(je(r)&&ft&&pr(r[Rr])){if(!pr((o=r[Rr]()).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,xe(o=e.call(t,i.value,a))&&o.length>=2)n.push(o[0],o[1]);else{if(!Ne(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(it(o),ot(o))}return n}(o,n,e):at(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(ct,"of",(function(){var r,e;if(!pr(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!st(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(ct.prototype,"at",(function(r){if(!lt(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!mr(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 ht(this._buffer,r)})),Ge(ct.prototype,"buffer",(function(){return this._buffer.buffer})),Ge(ct.prototype,"byteLength",(function(){return this._buffer.byteLength})),Ge(ct.prototype,"byteOffset",(function(){return this._buffer.byteOffset})),N(ct.prototype,"BYTES_PER_ELEMENT",ct.BYTES_PER_ELEMENT),N(ct.prototype,"copyWithin",(function(r,e){if(!lt(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(ct.prototype,"entries",(function(){var r,e,t,n,i,o,a;if(!lt(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;return o+=1,i||o>=n?{done:!0}:(e=new nt(r[a+=2],r[a+1]),{value:[o,e],done:!1})})),N(t,"return",(function(r){return i=!0,arguments.length?{value:r,done:!0}:{done:!0}})),Rr&&N(t,Rr,(function(){return e.entries()})),t})),N(ct.prototype,"every",(function(r,e){var t,n;if(!lt(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!pr(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,ht(t,n),n,this))return!1;return!0})),N(ct.prototype,"fill",(function(r,e,t){var n,i,o,a,u,f;if(!lt(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Ne(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(!mr(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(!mr(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=it(r),u=ot(r),f=e;f<t;f++)n[o=2*f]=a,n[o+1]=u;return this})),N(ct.prototype,"filter",(function(r,e){var t,n,i,o;if(!lt(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!pr(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=ht(t,i),r.call(e,o,i,this)&&n.push(o);return new this.constructor(n)})),N(ct.prototype,"find",(function(r,e){var t,n,i;if(!lt(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!pr(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=ht(t,n),r.call(e,i,n,this))return i})),N(ct.prototype,"findIndex",(function(r,e){var t,n,i;if(!lt(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!pr(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=ht(t,n),r.call(e,i,n,this))return n;return-1})),N(ct.prototype,"findLast",(function(r,e){var t,n,i;if(!lt(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!pr(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=ht(t,n),r.call(e,i,n,this))return i})),N(ct.prototype,"findLastIndex",(function(r,e){var t,n,i;if(!lt(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!pr(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=ht(t,n),r.call(e,i,n,this))return n;return-1})),N(ct.prototype,"forEach",(function(r,e){var t,n,i;if(!lt(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!pr(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=ht(t,n),r.call(e,i,n,this)})),N(ct.prototype,"get",(function(r){if(!lt(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!de(r))throw new TypeError(F("invalid argument. Must provide a nonnegative integer. Value: `%s`.",r));if(!(r>=this._length))return ht(this._buffer,r)})),Ge(ct.prototype,"length",(function(){return this._length})),N(ct.prototype,"includes",(function(r,e){var t,n,i,o,a;if(!lt(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Ne(r))throw new TypeError(F("invalid argument. First argument must be a complex number. Value: `%s`.",r));if(arguments.length>1){if(!mr(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=it(r),o=ot(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(ct.prototype,"indexOf",(function(r,e){var t,n,i,o,a;if(!lt(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Ne(r))throw new TypeError(F("invalid argument. First argument must be a complex number. Value: `%s`.",r));if(arguments.length>1){if(!mr(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=it(r),o=ot(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(ct.prototype,"join",(function(r){var e,t,n,i;if(!lt(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(0===arguments.length)n=",";else{if(!Re(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(ht(t,i).toString());return e.join(n)})),N(ct.prototype,"lastIndexOf",(function(r,e){var t,n,i,o,a;if(!lt(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Ne(r))throw new TypeError(F("invalid argument. First argument must be a complex number. Value: `%s`.",r));if(arguments.length>1){if(!mr(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=it(r),o=ot(r),t=this._buffer,a=e;a>=0;a--)if(i===t[n=2*a]&&o===t[n+1])return a;return-1})),N(ct.prototype,"map",(function(r,e){var t,n,i,o,a;if(!lt(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!pr(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(Ne(a=r.call(e,ht(n,o),o,this)))t[2*o]=it(a),t[2*o+1]=ot(a);else{if(!xe(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(ct.prototype,"reduce",(function(r,e){var t,n,i,o;if(!lt(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!pr(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=ht(t,0),o=1}for(;o<i;o++)n=r(n,ht(t,o),o,this);return n})),N(ct.prototype,"reverse",(function(){var r,e,t,n,i,o;if(!lt(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(t=this._length,r=this._buffer,n=yr(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(ct.prototype,"set",(function(r){var e,t,n,i,o,a,u,f,l;if(!lt(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(n=this._buffer,arguments.length>1){if(!de(t=arguments[1]))throw new TypeError(F("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",t))}else t=0;if(Ne(r)){if(t>=this._length)throw new RangeError(F("invalid argument. Index argument is out-of-bounds. Value: `%u`.",t));return n[t*=2]=it(r),void(n[t+1]=ot(r))}if(lt(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*ut,e.buffer===n.buffer&&e.byteOffset<l&&e.byteOffset+e.byteLength>l){for(i=new Yr(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(!wr(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(!Ne(r[f])){o=!0;break}if(o){if(!Pe(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*ut,e.buffer===n.buffer&&e.byteOffset<l&&e.byteOffset+e.byteLength>l){for(i=new Yr(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]=it(u),n[t+1]=ot(u),t+=2}})),N(ct.prototype,"slice",(function(r,e){var t,n,i,o,a,u,f;if(!lt(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(!mr(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(!mr(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(ct.prototype,"some",(function(r,e){var t,n;if(!lt(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!pr(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,ht(t,n),n,this))return!0;return!1})),N(ct.prototype,"subarray",(function(r,e){var t,n,i;if(!lt(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(!mr(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(!mr(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*ut):(i=e-r,t=n.byteOffset+r*ut),new this.constructor(n.buffer,t,i<0?0:i)})),N(ct.prototype,"toReversed",(function(){var r,e,t,n,i,o;if(!lt(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(ct.prototype,"toString",(function(){var r,e,t;if(!lt(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(ht(e,t).toString());return r.join(",")})),N(ct.prototype,"with",(function(r,e){var t,n,i;if(!lt(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!mr(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(!Ne(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]=it(e),t[2*r+1]=ot(e),n}));var yt=he.BYTES_PER_ELEMENT,mt=kr();function gt(r){return"object"==typeof r&&null!==r&&"BooleanArray"===r.constructor.name&&r.BYTES_PER_ELEMENT===yt}function wt(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 he(0);else if(1===e)if(de(i=arguments[0]))t=new he(i);else if(wr(i))t=function(r,e){var t,n;for(t=e.length,n=0;n<t;n++)r[n]=q(e[n]);return r}(new he(i.length),i);else if(Ae(i))t=new he(i);else{if(!je(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===mt)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(!pr(i[Rr]))throw new TypeError(F("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",i));if(!pr((t=i[Rr]()).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 he(pt(t))}else{if(!Ae(t=arguments[0]))throw new TypeError(F("invalid argument. First argument must be an ArrayBuffer. Value: `%s`.",t));if(!de(r=arguments[1]))throw new TypeError(F("invalid argument. Byte offset must be a nonnegative integer. Value: `%s`.",r));if(2===e)t=new he(t,r);else{if(!de(n=arguments[2]))throw new TypeError(F("invalid argument. Length must be a nonnegative integer. Value: `%s`.",n));if(n*yt>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*yt));t=new he(t,r,n)}}return N(this,"_buffer",t),N(this,"_length",t.length),this}N(bt,"BYTES_PER_ELEMENT",yt),N(bt,"name","BooleanArray"),N(bt,"from",(function(r){var e,t,n,i,o,a,u,f,l;if(!pr(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!wt(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if((t=arguments.length)>1){if(!pr(n=arguments[1]))throw new TypeError(F("invalid argument. Second argument must be a function. Value: `%s`.",n));t>2&&(e=arguments[2])}if(wr(r)){if(n){for(f=r.length,u=r.get&&r.set?Ir("default"):Mr("default"),o=(i=new this(f))._buffer,l=0;l<f;l++)o[l]=q(n.call(e,u(r,l),l));return i}return new this(r)}if(je(r)&&mt&&pr(r[Rr])){if(!pr((o=r[Rr]()).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(q(e.call(t,i.value,o)));return n}(o,n,e):pt(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(!pr(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!wt(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(!gt(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!pr(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=q(t[i]),r.call(e,n,i,this))return n})),N(bt.prototype,"findIndex",(function(r,e){var t,n,i;if(!gt(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!pr(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=q(t[i]),r.call(e,n,i,this))return i;return-1})),N(bt.prototype,"findLast",(function(r,e){var t,n,i;if(!gt(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!pr(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=q(t[i]),r.call(e,n,i,this))return n})),N(bt.prototype,"findLastIndex",(function(r,e){var t,n,i;if(!gt(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!pr(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=q(t[i]),r.call(e,n,i,this))return i;return-1})),N(bt.prototype,"get",(function(r){if(!gt(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!de(r))throw new TypeError(F("invalid argument. Must provide a nonnegative integer. Value: `%s`.",r));if(!(r>=this._length))return q(this._buffer[r])})),Ge(bt.prototype,"length",(function(){return this._length})),N(bt.prototype,"map",(function(r,e){var t,n,i,o;if(!gt(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!pr(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]=q(r.call(e,q(i[o]),o,this));return n})),N(bt.prototype,"reverse",(function(){var r,e,t,n,i,o;if(!gt(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");for(r=this._buffer,t=this._length,n=yr(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(!gt(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(n=this._buffer,arguments.length>1){if(!de(t=arguments[1]))throw new TypeError(F("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",t))}else t=0;if(wr(r)){if(t+(o=r.length)>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(e=gt(r)?r._buffer:r,u=n.byteOffset+t*yt,e.buffer===n.buffer&&e.byteOffset<u&&e.byteOffset+e.byteLength>u){for(i=new he(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(!gt(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(e=this._buffer,0===arguments.length)return e.sort(),this;if(!pr(r))throw new TypeError(F("invalid argument. First argument must be a function. Value: `%s`.",r));return e.sort((function(e,t){return r(q(e),q(t))})),this})),N(bt.prototype,"toReversed",(function(){var r,e,t,n,i;if(!gt(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 vt=[Yr,Zr,Qr,qr,ue,ne,ve,he,me,tt,ct,bt],dt=["float64","float32","int32","uint32","int16","uint16","int8","uint8","uint8c","complex64","complex128","bool"],Et=dt.length;function Tt(){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,s,h,c;if(!wr(e))throw new TypeError(Tt("01j2O",e));if(1===(i=arguments.length))n=0,f=e.length;else if(2===i)pr(arguments[1])?(n=0,u=arguments[1]):n=arguments[1],f=e.length;else if(3===i)pr(arguments[1])?(n=0,f=e.length,u=arguments[1],t=arguments[2]):pr(arguments[2])?(n=arguments[1],f=e.length,u=arguments[2]):(n=arguments[1],f=arguments[2]);else{if(n=arguments[1],f=arguments[2],!pr(u=arguments[3]))throw new TypeError(Tt("01j32",u));t=arguments[4]}if(!jr(n))throw new TypeError(Tt("01jEE",n));if(!jr(f))throw new TypeError(Tt("01jEF",f));return f<0?(f=e.length+f)<0&&(f=0):f>e.length&&(f=e.length),n<0&&(n=e.length+n)<0&&(n=0),h=f,N(o={},"next",u?function(){return h-=1,a||h<n?{done:!0}:{value:u.call(t,l(e,h),h,f-h-1,e),done:!1}}:function(){return h-=1,a||h<n?{done:!0}:{value:l(e,h),done:!1}}),N(o,"return",(function(r){return a=!0,arguments.length?{value:r,done:!0}:{done:!0}})),Rr&&N(o,Rr,(function(){return u?r(e,n,f,u,t):r(e,n,f)})),s=function(r){var e;if(fr(r))return"generic";if(sr(r))return null;for(e=0;e<Et;e++)if(r instanceof vt[e])return dt[e];return Cr[hr(r)]||null}(e),l=typeof(c=e).get===Lr&&typeof c.set===Lr?Ir(s):Mr(s),o}},"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(r="undefined"!=typeof globalThis?globalThis:r||self).arrayview2iteratorRight=e();
//# sourceMappingURL=browser.js.map