// 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;e0&&(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,m,"$1."),n=h.call(n,y,"$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;e127)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,m=n.padRight,y=void 0,(y=p-c.length)<0?c:c=m?c+d(y):d(y)+c)),f+=n.arg||"",l+=1}return f}var V=/%(?:([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=V.exec(r);n;)(e=r.slice(i,V.lastIndex-n[0].length)).length&&t.push(e),t.push(j(n)),i=V.lastIndex,n=V.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;te?e:r}function P(r,e){var t=e+1;return r<0?((r+=t)<0&&0!=(r%=t)&&(r+=t),r):r>e?((r-=t)>e&&(r%=t),r):r}function Y(r,e){return r<0?(r+=e+1)<0?-1:r:r>e?-1:r}var W="function";function $(r){return typeof r.get===W&&typeof r.set===W}var G={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 z(r){var e=G[r];return"function"==typeof e?e:G.default}var Z={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 J(r){var e=Z[r];return"function"==typeof e?e:Z.default}var X="function"==typeof Symbol&&"symbol"==typeof Symbol("foo");function q(){return X&&"symbol"==typeof Symbol.toStringTag}var D=Object.prototype.toString,H=Object.prototype.hasOwnProperty;function K(r,e){return null!=r&&H.call(r,e)}var Q="function"==typeof Symbol?Symbol:void 0,rr="function"==typeof Q?Q.toStringTag:"",er=q()?function(r){var e,t,n;if(null==r)return D.call(r);t=r[rr],e=K(r,rr);try{r[rr]=void 0}catch(e){return D.call(r)}return n=D.call(r),e?r[rr]=t:delete r[rr],n}:function(r){return D.call(r)},tr=Array.isArray?Array.isArray:function(r){return"[object Array]"===er(r)};function nr(r){return null!==r&&"object"==typeof r}function ir(r){return nr(r)&&(r._isBuffer||r.constructor&&"function"==typeof r.constructor.isBuffer&&r.constructor.isBuffer(r))}function or(){return/^\s*function\s*([^(]*)/i}U(nr,"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(!tr(e))return!1;if(0===(t=e.length))return!1;for(n=0;nKr&&re(r)}function te(r){return Zr(r)&&ee(r)}function ne(r){return Dr(r)&&ee(r.valueOf())}function ie(r){return te(r)||ne(r)}function oe(r){return te(r)&&r>=0}function ae(r){return ne(r)&&r.valueOf()>=0}function ue(r){return oe(r)||ae(r)}U(ie,"isPrimitive",te),U(ie,"isObject",ne),U(ue,"isPrimitive",oe),U(ue,"isObject",ae);var fe=4294967295;function le(r){return"object"==typeof r&&null!==r&&"number"==typeof r.length&&re(r.length)&&r.length>=0&&r.length<=fe}var se=9007199254740991;function he(r){return"object"==typeof r&&null!==r&&"number"==typeof r.length&&re(r.length)&&r.length>=0&&r.length<=se}var ce="function"==typeof ArrayBuffer;function pe(r){return ce&&r instanceof ArrayBuffer||"[object ArrayBuffer]"===er(r)}function me(r){return"object"==typeof r&&null!==r&&!tr(r)}function ye(r){return"string"==typeof r}var ge=String.prototype.valueOf,we=q();function be(r){return"object"==typeof r&&(r instanceof String||(we?function(r){try{return ge.call(r),!0}catch(r){return!1}}(r):"[object String]"===er(r)))}function ve(r){return ye(r)||be(r)}U(ve,"isPrimitive",ye),U(ve,"isObject",be);var de=/./;function Ee(r){return"boolean"==typeof r}var Te=Boolean,_e=Boolean.prototype.toString,xe=q();function Ae(r){return"object"==typeof r&&(r instanceof Te||(xe?function(r){try{return _e.call(r),!0}catch(r){return!1}}(r):"[object Boolean]"===er(r)))}function Ve(r){return Ee(r)||Ae(r)}U(Ve,"isPrimitive",Ee),U(Ve,"isObject",Ae);var je="object"==typeof self?self:null,Se="object"==typeof window?window:null,Fe="object"==typeof globalThis?globalThis:null,ke=function(r){if(arguments.length){if(!Ee(r))throw new TypeError(F("invalid argument. Must provide a boolean. Value: `%s`.",r));if(r)return new Function("return this;")()}if(Fe)return Fe;if(je)return je;if(Se)return Se;throw new Error("unexpected error. Unable to resolve global object.")}(),Re=ke.document&&ke.document.childNodes,Le=Int8Array,Ie="function"==typeof de||"object"==typeof Le||"function"==typeof Re?function(r){return ur(r).toLowerCase()}:function(r){var e;return null===r?"null":"object"==(e=typeof r)?ur(r).toLowerCase():e};function Be(r){return"function"===Ie(r)}function Oe(r,e){if(!(this instanceof Oe))throw new TypeError("invalid invocation. Constructor must be called with the `new` keyword.");if(!Zr(r))throw new TypeError(F("invalid argument. Real component must be a number. Value: `%s`.",r));if(!Zr(e))throw new TypeError(F("invalid argument. Imaginary component must be a number. Value: `%s`.",e));return M(this,"re",{configurable:!1,enumerable:!0,writable:!1,value:r}),M(this,"im",{configurable:!1,enumerable:!0,writable:!1,value:e}),this}U(Oe,"BYTES_PER_ELEMENT",8),U(Oe.prototype,"BYTES_PER_ELEMENT",8),U(Oe.prototype,"byteLength",16),U(Oe.prototype,"toString",(function(){var r=""+this.re;return this.im<0?r+=" - "+-this.im:r+=" + "+this.im,r+="i"})),U(Oe.prototype,"toJSON",(function(){var r={type:"Complex128"};return r.re=this.re,r.im=this.im,r}));var Ce="function"==typeof Math.fround?Math.fround:null,Me=new wr(1),Ue="function"==typeof Ce?Ce:function(r){return Me[0]=r,Me[0]};function Ne(r,e){if(!(this instanceof Ne))throw new TypeError("invalid invocation. Constructor must be called with the `new` keyword.");if(!Zr(r))throw new TypeError(F("invalid argument. Real component must be a number. Value: `%s`.",r));if(!Zr(e))throw new TypeError(F("invalid argument. Imaginary component must be a number. Value: `%s`.",e));return M(this,"re",{configurable:!1,enumerable:!0,writable:!1,value:Ue(r)}),M(this,"im",{configurable:!1,enumerable:!0,writable:!1,value:Ue(e)}),this}function Pe(r){return r instanceof Oe||r instanceof Ne||"object"==typeof r&&null!==r&&"number"==typeof r.re&&"number"==typeof r.im}function Ye(r){return re(r/2)}U(Ne,"BYTES_PER_ELEMENT",4),U(Ne.prototype,"BYTES_PER_ELEMENT",4),U(Ne.prototype,"byteLength",8),U(Ne.prototype,"toString",(function(){var r=""+this.re;return this.im<0?r+=" - "+-this.im:r+=" + "+this.im,r+="i"})),U(Ne.prototype,"toJSON",(function(){var r={type:"Complex64"};return r.re=this.re,r.im=this.im,r}));var We=8;function $e(r){return"object"==typeof r&&null!==r&&"Complex64Array"===r.constructor.name&&r.BYTES_PER_ELEMENT===We}var Ge=16;function ze(r){return"object"==typeof r&&null!==r&&"Complex128Array"===r.constructor.name&&r.BYTES_PER_ELEMENT===Ge}function Ze(){return"function"==typeof Q&&"symbol"==typeof Q("foo")&&K(Q,"iterator")&&"symbol"==typeof Q.iterator}var Je=Ze()?Symbol.iterator:null;function Xe(r,e,t){M(r,e,{configurable:!1,enumerable:!1,get:t})}function qe(r,e){if(!(this instanceof qe))throw new TypeError("invalid invocation. Constructor must be called with the `new` keyword.");if(!Zr(r))throw new TypeError(F("invalid argument. Real component must be a number. Value: `%s`.",r));if(!Zr(e))throw new TypeError(F("invalid argument. Imaginary component must be a number. Value: `%s`.",e));return M(this,"re",{configurable:!1,enumerable:!0,writable:!1,value:Ue(r)}),M(this,"im",{configurable:!1,enumerable:!0,writable:!1,value:Ue(e)}),this}function De(r){return r.re}function He(r){return r.im}function Ke(r,e){return new wr(r.buffer,r.byteOffset+r.BYTES_PER_ELEMENT*e,2*(r.length-e))}function Qe(r,e){return new cr(r.buffer,r.byteOffset+r.BYTES_PER_ELEMENT*e,2*(r.length-e))}function rt(r){var e,t,n;for(e=[];!(t=r.next()).done;)if(le(n=t.value)&&n.length>=2)e.push(n[0],n[1]);else{if(!Pe(n))return new TypeError(F("invalid argument. An iterator must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",n));e.push(De(n),He(n))}return e}U(qe,"BYTES_PER_ELEMENT",4),U(qe.prototype,"BYTES_PER_ELEMENT",4),U(qe.prototype,"byteLength",8),U(qe.prototype,"toString",(function(){var r=""+this.re;return this.im<0?r+=" - "+-this.im:r+=" + "+this.im,r+="i"})),U(qe.prototype,"toJSON",(function(){var r={type:"Complex64"};return r.re=this.re,r.im=this.im,r}));var et=2*wr.BYTES_PER_ELEMENT,tt=Ze();function nt(r){return r instanceof at||"object"==typeof r&&null!==r&&("Complex64Array"===r.constructor.name||"Complex128Array"===r.constructor.name)&&"number"==typeof r._length&&"object"==typeof r._buffer}function it(r){return r===at||"Complex128Array"===r.name}function ot(r,e){return new qe(r[e*=2],r[e+1])}function at(){var r,e,t,n;if(e=arguments.length,!(this instanceof at))return 0===e?new at:1===e?new at(arguments[0]):2===e?new at(arguments[0],arguments[1]):new at(arguments[0],arguments[1],arguments[2]);if(0===e)t=new wr(0);else if(1===e)if(oe(arguments[0]))t=new wr(2*arguments[0]);else if(he(arguments[0]))if((n=(t=arguments[0]).length)&&tr(t)&&Pe(t[0])){if(t=function(r,e){var t,n,i,o;for(t=e.length,o=0,i=0;it.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*et));t=new wr(t,r,2*n)}}return U(this,"_buffer",t),U(this,"_length",t.length/2),this}function ut(r,e){if(!(this instanceof ut))throw new TypeError("invalid invocation. Constructor must be called with the `new` keyword.");if(!Zr(r))throw new TypeError(F("invalid argument. Real component must be a number. Value: `%s`.",r));if(!Zr(e))throw new TypeError(F("invalid argument. Imaginary component must be a number. Value: `%s`.",e));return M(this,"re",{configurable:!1,enumerable:!0,writable:!1,value:r}),M(this,"im",{configurable:!1,enumerable:!0,writable:!1,value:e}),this}function ft(r){return r.re}function lt(r){return r.im}function st(r){var e,t,n;for(e=[];!(t=r.next()).done;)if(le(n=t.value)&&n.length>=2)e.push(n[0],n[1]);else{if(!Pe(n))return new TypeError(F("invalid argument. An iterator must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",n));e.push(ft(n),lt(n))}return e}U(at,"BYTES_PER_ELEMENT",et),U(at,"name","Complex64Array"),U(at,"from",(function(r){var e,t,n,i,o,a,u,f,l,s,h,c;if(!Be(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!it(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if((t=arguments.length)>1){if(!Be(n=arguments[1]))throw new TypeError(F("invalid argument. Second argument must be a function. Value: `%s`.",n));t>2&&(e=arguments[2])}if(nt(r)){if(f=r.length,n){for(o=(i=new this(f))._buffer,c=0,h=0;h=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(he(r)){if(n){for(f=r.length,u=r.get&&r.set?z("default"):J("default"),h=0;h=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(me(r)&&tt&&Be(r[Je])){if(!Be((o=r[Je]()).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,le(o=e.call(t,i.value,a))&&o.length>=2)n.push(o[0],o[1]);else{if(!Pe(o))return new TypeError(F("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",o));n.push(De(o),He(o))}return n}(o,n,e):rt(o),a instanceof Error)throw a;for(o=(i=new this(f=a.length/2))._buffer,h=0;h=this._length))return ot(this._buffer,r)})),Xe(at.prototype,"buffer",(function(){return this._buffer.buffer})),Xe(at.prototype,"byteLength",(function(){return this._buffer.byteLength})),Xe(at.prototype,"byteOffset",(function(){return this._buffer.byteOffset})),U(at.prototype,"BYTES_PER_ELEMENT",at.BYTES_PER_ELEMENT),U(at.prototype,"copyWithin",(function(r,e){if(!nt(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})),U(at.prototype,"entries",(function(){var r,e,t,n,i,o,a;if(!nt(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,U(t={},"next",(function(){var e;return o+=1,i||o>=n?{done:!0}:(e=new qe(r[a+=2],r[a+1]),{value:[o,e],done:!1})})),U(t,"return",(function(r){return i=!0,arguments.length?{value:r,done:!0}:{done:!0}})),Je&&U(t,Je,(function(){return e.entries()})),t})),U(at.prototype,"every",(function(r,e){var t,n;if(!nt(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Be(r))throw new TypeError(F("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,n=0;n1){if(!re(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(!re(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=De(r),u=He(r),f=e;f=0;n--)if(i=ot(t,n),r.call(e,i,n,this))return i})),U(at.prototype,"findLastIndex",(function(r,e){var t,n,i;if(!nt(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Be(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=ot(t,n),r.call(e,i,n,this))return n;return-1})),U(at.prototype,"forEach",(function(r,e){var t,n,i;if(!nt(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Be(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))return ot(this._buffer,r)})),U(at.prototype,"includes",(function(r,e){var t,n,i,o,a;if(!nt(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Pe(r))throw new TypeError(F("invalid argument. First argument must be a complex number. Value: `%s`.",r));if(arguments.length>1){if(!re(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=De(r),o=He(r),t=this._buffer,a=e;a1){if(!re(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=De(r),o=He(r),t=this._buffer,a=e;a1){if(!re(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=De(r),o=He(r),t=this._buffer,a=e;a>=0;a--)if(i===t[n=2*a]&&o===t[n+1])return a;return-1})),Xe(at.prototype,"length",(function(){return this._length})),U(at.prototype,"map",(function(r,e){var t,n,i,o,a;if(!nt(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Be(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;o1)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=ot(t,0),o=1}for(;o1){if(!oe(t=arguments[1]))throw new TypeError(F("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",t))}else t=0;if(Pe(r)){if(t>=this._length)throw new RangeError(F("invalid argument. Index argument is out-of-bounds. Value: `%u`.",t));return n[t*=2]=De(r),void(n[t+1]=He(r))}if(nt(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*et,e.buffer===n.buffer&&e.byteOffsetl){for(i=new wr(e.length),f=0;fthis._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(e=r,l=n.byteOffset+t*et,e.buffer===n.buffer&&e.byteOffsetl){for(i=new wr(a),f=0;fthis._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");for(t*=2,f=0;fu&&(e=u)}}for(t=ri&&(e=i)}}return r>=i?(i=0,t=n.byteLength):r>=e?(i=0,t=n.byteOffset+r*et):(i=e-r,t=n.byteOffset+r*et),new this.constructor(n.buffer,t,i<0?0:i)})),U(at.prototype,"toReversed",(function(){var r,e,t,n,i,o;if(!nt(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=i)throw new RangeError(F("invalid argument. Index argument is out-of-bounds. Value: `%s`.",r));if(!Pe(e))throw new TypeError(F("invalid argument. Second argument must be a complex number. Value: `%s`.",e));return(t=(n=new this.constructor(this._buffer))._buffer)[2*r]=De(e),t[2*r+1]=He(e),n})),U(ut,"BYTES_PER_ELEMENT",8),U(ut.prototype,"BYTES_PER_ELEMENT",8),U(ut.prototype,"byteLength",16),U(ut.prototype,"toString",(function(){var r=""+this.re;return this.im<0?r+=" - "+-this.im:r+=" + "+this.im,r+="i"})),U(ut.prototype,"toJSON",(function(){var r={type:"Complex128"};return r.re=this.re,r.im=this.im,r}));var ht=2*cr.BYTES_PER_ELEMENT,ct=Ze();function pt(r){return r instanceof gt||"object"==typeof r&&null!==r&&("Complex64Array"===r.constructor.name||"Complex128Array"===r.constructor.name)&&"number"==typeof r._length&&"object"==typeof r._buffer}function mt(r){return r===gt||"Complex64Array"===r.name}function yt(r,e){return new ut(r[e*=2],r[e+1])}function gt(){var r,e,t,n;if(e=arguments.length,!(this instanceof gt))return 0===e?new gt:1===e?new gt(arguments[0]):2===e?new gt(arguments[0],arguments[1]):new gt(arguments[0],arguments[1],arguments[2]);if(0===e)t=new cr(0);else if(1===e)if(oe(arguments[0]))t=new cr(2*arguments[0]);else if(he(arguments[0]))if((n=(t=arguments[0]).length)&&tr(t)&&Pe(t[0])){if(t=function(r,e){var t,n,i,o;for(t=e.length,o=0,i=0;it.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*ht));t=new cr(t,r,2*n)}}return U(this,"_buffer",t),U(this,"_length",t.length/2),this}U(gt,"BYTES_PER_ELEMENT",ht),U(gt,"name","Complex128Array"),U(gt,"from",(function(r){var e,t,n,i,o,a,u,f,l,s,h,c;if(!Be(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!mt(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if((t=arguments.length)>1){if(!Be(n=arguments[1]))throw new TypeError(F("invalid argument. Second argument must be a function. Value: `%s`.",n));t>2&&(e=arguments[2])}if(pt(r)){if(f=r.length,n){for(o=(i=new this(f))._buffer,c=0,h=0;h=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(he(r)){if(n){for(f=r.length,u=r.get&&r.set?z("default"):J("default"),h=0;h=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(me(r)&&ct&&Be(r[Je])){if(!Be((o=r[Je]()).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,le(o=e.call(t,i.value,a))&&o.length>=2)n.push(o[0],o[1]);else{if(!Pe(o))return new TypeError(F("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",o));n.push(ft(o),lt(o))}return n}(o,n,e):st(o),a instanceof Error)throw a;for(o=(i=new this(f=a.length/2))._buffer,h=0;h=this._length))return yt(this._buffer,r)})),Xe(gt.prototype,"buffer",(function(){return this._buffer.buffer})),Xe(gt.prototype,"byteLength",(function(){return this._buffer.byteLength})),Xe(gt.prototype,"byteOffset",(function(){return this._buffer.byteOffset})),U(gt.prototype,"BYTES_PER_ELEMENT",gt.BYTES_PER_ELEMENT),U(gt.prototype,"copyWithin",(function(r,e){if(!pt(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})),U(gt.prototype,"entries",(function(){var r,e,t,n,i,o,a;if(!pt(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,U(t={},"next",(function(){var e;return o+=1,i||o>=n?{done:!0}:(e=new ut(r[a+=2],r[a+1]),{value:[o,e],done:!1})})),U(t,"return",(function(r){return i=!0,arguments.length?{value:r,done:!0}:{done:!0}})),Je&&U(t,Je,(function(){return e.entries()})),t})),U(gt.prototype,"every",(function(r,e){var t,n;if(!pt(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Be(r))throw new TypeError(F("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,n=0;n1){if(!re(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(!re(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=ft(r),u=lt(r),f=e;f=0;n--)if(i=yt(t,n),r.call(e,i,n,this))return i})),U(gt.prototype,"findLastIndex",(function(r,e){var t,n,i;if(!pt(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Be(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=yt(t,n),r.call(e,i,n,this))return n;return-1})),U(gt.prototype,"forEach",(function(r,e){var t,n,i;if(!pt(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Be(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))return yt(this._buffer,r)})),Xe(gt.prototype,"length",(function(){return this._length})),U(gt.prototype,"includes",(function(r,e){var t,n,i,o,a;if(!pt(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Pe(r))throw new TypeError(F("invalid argument. First argument must be a complex number. Value: `%s`.",r));if(arguments.length>1){if(!re(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=ft(r),o=lt(r),t=this._buffer,a=e;a1){if(!re(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=ft(r),o=lt(r),t=this._buffer,a=e;a1){if(!re(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=ft(r),o=lt(r),t=this._buffer,a=e;a>=0;a--)if(i===t[n=2*a]&&o===t[n+1])return a;return-1})),U(gt.prototype,"map",(function(r,e){var t,n,i,o,a;if(!pt(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Be(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;o1)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=yt(t,0),o=1}for(;o1){if(!oe(t=arguments[1]))throw new TypeError(F("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",t))}else t=0;if(Pe(r)){if(t>=this._length)throw new RangeError(F("invalid argument. Index argument is out-of-bounds. Value: `%u`.",t));return n[t*=2]=ft(r),void(n[t+1]=lt(r))}if(pt(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*ht,e.buffer===n.buffer&&e.byteOffsetl){for(i=new cr(e.length),f=0;fthis._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(e=r,l=n.byteOffset+t*ht,e.buffer===n.buffer&&e.byteOffsetl){for(i=new cr(a),f=0;fthis._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");for(t*=2,f=0;fu&&(e=u)}}for(t=ri&&(e=i)}}return r>=i?(i=0,t=n.byteLength):r>=e?(i=0,t=n.byteOffset+r*ht):(i=e-r,t=n.byteOffset+r*ht),new this.constructor(n.buffer,t,i<0?0:i)})),U(gt.prototype,"toReversed",(function(){var r,e,t,n,i,o;if(!pt(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=i)throw new RangeError(F("invalid argument. Index argument is out-of-bounds. Value: `%s`.",r));if(!Pe(e))throw new TypeError(F("invalid argument. Second argument must be a complex number. Value: `%s`.",e));return(t=(n=new this.constructor(this._buffer))._buffer)[2*r]=ft(e),t[2*r+1]=lt(e),n}));var wt=[cr,wr,Ar,Er,Ir,Fr,zr,Mr,Yr,at,gt],bt=["float64","float32","int32","uint32","int16","uint16","int8","uint8","uint8c","complex64","complex128"],vt=bt.length;function dt(r){var e;if(tr(r))return"generic";if(ir(r))return null;for(e=0;ee)throw new RangeError(At("0ilFB",e,r));return t},throw:function(r,e){if(r<0||r>e)throw new RangeError(At("0ilFB",e,r));return r}};function jt(r,e,t){var n;if("clamp"===t)return N(r,e);if("wrap"===t)return P(r,e);if(n=r,"normalize"===t&&(n=Y(n,e)),n<0||n>e)throw new RangeError(At("0ilFB",e,r));return n}return U(jt,"factory",(function(r){if(!xt(r))throw new TypeError(At("0ilFC",r));return Vt[r]})),jt},"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(r="undefined"!=typeof globalThis?globalThis:r||self).ind=e(); //# sourceMappingURL=browser.js.map