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