import{__require as t}from"./global-this.mjs";import{__require as e}from"./function-uncurry-this.mjs";import{__require as r}from"./descriptors.mjs";import{__require as n}from"./array-buffer-basic-detection.mjs";import{__require as i}from"./function-name.mjs";import{__require as o}from"./create-non-enumerable-property.mjs";import{__require as s}from"./define-built-in-accessor.mjs";import{__require as f}from"./define-built-ins.mjs";import{__require as u}from"./fails.mjs";import{__require as a}from"./an-instance.mjs";import{__require as m}from"./to-integer-or-infinity.mjs";import{__require as h}from"./to-length.mjs";import{__require as c}from"./to-index.mjs";import{__require as _}from"./math-fround.mjs";import{__require as g}from"./ieee754.mjs";import{__require as p}from"./object-get-prototype-of.mjs";import{__require as y}from"./object-set-prototype-of.mjs";import{__require as b}from"./array-fill.mjs";import{__require as l}from"./array-slice.mjs";import{__require as j}from"./inherit-if-required.mjs";import{__require as q}from"./copy-constructor-properties.mjs";import{__require as w}from"./set-to-string-tag.mjs";import{__require as v}from"./internal-state.mjs";var I,d;function L(){if(d)return I;d=1;var L=t(),O=e(),U=r(),F=n(),A=i(),R=o(),x=s(),B=f(),E=u(),N=a(),W=m(),k=h(),D=c(),P=_(),V=g(),C=p(),G=y(),z=b(),H=l(),J=j(),K=q(),M=w(),Q=v(),S=A.PROPER,T=A.CONFIGURABLE,X="ArrayBuffer",Y="DataView",Z="prototype",$="Wrong index",tt=Q.getterFor(X),et=Q.getterFor(Y),rt=Q.set,nt=L[X],it=nt,ot=it&&it[Z],st=L[Y],ft=st&&st[Z],ut=Object.prototype,at=L.Array,mt=L.RangeError,ht=O(z),ct=O([].reverse),_t=V.pack,gt=V.unpack,pt=function(t){return[255&t]},yt=function(t){return[255&t,t>>8&255]},bt=function(t){return[255&t,t>>8&255,t>>16&255,t>>24&255]},lt=function(t){return t[3]<<24|t[2]<<16|t[1]<<8|t[0]},jt=function(t){return _t(P(t),23,4)},qt=function(t){return _t(t,52,8)},wt=function(t,e,r){x(t[Z],e,{configurable:!0,get:function(){return r(this)[e]}})},vt=function(t,e,r,n){var i=et(t),o=D(r),s=!!n;if(o+e>i.byteLength)throw new mt($);var f=i.bytes,u=o+i.byteOffset,a=H(f,u,u+e);return s?a:ct(a)},It=function(t,e,r,n,i,o){var s=et(t),f=D(r),u=n(+i),a=!!o;if(f+e>s.byteLength)throw new mt($);for(var m=s.bytes,h=f+s.byteOffset,c=0;c<e;c++)m[h+c]=u[a?c:e-c-1]};if(F){var dt=S&&nt.name!==X;E(function(){nt(1)})&&E(function(){new nt(-1)})&&!E(function(){return new nt,new nt(1.5),new nt(NaN),1!==nt.length||dt&&!T})?dt&&T&&R(nt,"name",X):((it=function(t){return N(this,ot),J(new nt(D(t)),this,it)})[Z]=ot,ot.constructor=it,K(it,nt)),G&&C(ft)!==ut&&G(ft,ut);var Lt=new st(new it(2)),Ot=O(ft.setInt8);Lt.setInt8(0,2147483648),Lt.setInt8(1,2147483649),!Lt.getInt8(0)&&Lt.getInt8(1)||B(ft,{setInt8:function(t,e){Ot(this,t,e<<24>>24)},setUint8:function(t,e){Ot(this,t,e<<24>>24)}},{unsafe:!0})}else ot=(it=function(t){N(this,ot);var e=D(t);rt(this,{type:X,bytes:ht(at(e),0),byteLength:e}),U||(this.byteLength=e,this.detached=!1)})[Z],ft=(st=function(t,e,r){N(this,ft),N(t,ot);var n=tt(t),i=n.byteLength,o=W(e);if(o<0||o>i)throw new mt("Wrong offset");if(o+(r=void 0===r?i-o:k(r))>i)throw new mt("Wrong length");rt(this,{type:Y,buffer:t,byteLength:r,byteOffset:o,bytes:n.bytes}),U||(this.buffer=t,this.byteLength=r,this.byteOffset=o)})[Z],U&&(wt(it,"byteLength",tt),wt(st,"buffer",et),wt(st,"byteLength",et),wt(st,"byteOffset",et)),B(ft,{getInt8:function(t){return vt(this,1,t)[0]<<24>>24},getUint8:function(t){return vt(this,1,t)[0]},getInt16:function(t){var e=vt(this,2,t,arguments.length>1&&arguments[1]);return(e[1]<<8|e[0])<<16>>16},getUint16:function(t){var e=vt(this,2,t,arguments.length>1&&arguments[1]);return e[1]<<8|e[0]},getInt32:function(t){return lt(vt(this,4,t,arguments.length>1&&arguments[1]))},getUint32:function(t){return lt(vt(this,4,t,arguments.length>1&&arguments[1]))>>>0},getFloat32:function(t){return gt(vt(this,4,t,arguments.length>1&&arguments[1]),23)},getFloat64:function(t){return gt(vt(this,8,t,arguments.length>1&&arguments[1]),52)},setInt8:function(t,e){It(this,1,t,pt,e)},setUint8:function(t,e){It(this,1,t,pt,e)},setInt16:function(t,e){It(this,2,t,yt,e,arguments.length>2&&arguments[2])},setUint16:function(t,e){It(this,2,t,yt,e,arguments.length>2&&arguments[2])},setInt32:function(t,e){It(this,4,t,bt,e,arguments.length>2&&arguments[2])},setUint32:function(t,e){It(this,4,t,bt,e,arguments.length>2&&arguments[2])},setFloat32:function(t,e){It(this,4,t,jt,e,arguments.length>2&&arguments[2])},setFloat64:function(t,e){It(this,8,t,qt,e,arguments.length>2&&arguments[2])}});return M(it,X),M(st,Y),I={ArrayBuffer:it,DataView:st}}export{L as __require};