import{a7 as d,a3 as l,ad as A}from"./index-6Jqoo2rk.js";import{b as u,d as p,D as h}from"./browser-BlRx6CLO.js";function U(n,t,o){const r=(e,a)=>{n.attachListenPort(e),a&&n.attachSendPort(a),t?.(e)};n.setOnPortDisconnect(o),typeof SharedWorkerGlobalScope<"u"?d.addEventListener("connect",e=>r(e.source,e.source)):typeof ServiceWorkerGlobalScope<"u"?r(d,null):r(d,d)}const I=u(Number.MAX_SAFE_INTEGER),g=u(u[2]).pow(64),m=g.divide(u[2]);function v(n,t=256){return u.fromArray(n instanceof Uint8Array?[...n]:n,t)}function B(n){return new Uint8Array(n.toArray(256).value)}function D(n){return n.greater(m)?n.minus(g):n}function y(n){return n.isNegative()?g.add(n):n}function S(n,t,o){let r;if(o===void 0)r=p(new Uint8Array(n));else{const e=[];let a=0,i=!1;if(new h(f=>{if(!i){if(a+=f.length,a>o){i=!0;return}e.push(f)}}).push(new Uint8Array(n),!0),i)throw new Error("GZIP_MAX_SIZE_EXCEEDED");r=new Uint8Array(a);let c=0;for(const f of e)r.set(f,c),c+=f.length}return t?new TextDecoder().decode(r):r}function T(n,t=16,o,r=!1,e=!1){const a=n.byteLength||n.length,i=r?t-a:t-a%t;if(i>0&&i<t){const s=new Uint8Array(i);if(o)for(let c=0;c<i;++c)s[c]=0;else A(s);return n instanceof ArrayBuffer?(e?l(s,n):l(n,s)).buffer:n instanceof Uint8Array?e?l(s,n):l(n,s):e?[...s].concat(n):n.concat([...s])}return n}function _(n,t){const o=n.length,r=new Uint8Array(o);for(let e=0;e<o;++e)r[e]=n[e]^t[e];return r}export{B as a,v as b,D as c,T as d,_ as e,y as f,S as g,U as l,I as s};
//# sourceMappingURL=bytesXor-DbHnTao0.js.map
