UNPKG

skymel-adk-js-beta

Version:

Skymel Agent Development Kit using Javascript - A JavaScript SDK for creating and managing intelligent agents

9 lines 12.8 kB
/** * Minified by jsDelivr using Terser v5.19.2. * Original file: /npm/@petamoriken/float16@3.9.0/browser/float16.js * * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files */ /*! @petamoriken/float16 v3.9.0 | MIT License - https://github.com/petamoriken/float16 */ var float16=function(t){"use strict";const n="This constructor is not a subclass of Float16Array",r="The constructor property value is not an object",e="Attempting to access detached ArrayBuffer",o="Cannot convert undefined or null to object",i="Cannot mix BigInt and other types, use explicit conversions",s="@@iterator property is not callable",u="Reduce of empty array with no initial value",c="Offset is out of bounds";function f(t){return(n,...r)=>l(t,n,r)}function h(t,n){return f(p(t,n).get)}const{apply:l,construct:a,defineProperty:w,get:y,getOwnPropertyDescriptor:p,getPrototypeOf:d,has:g,ownKeys:v,set:b,setPrototypeOf:A}=Reflect,_=Proxy,{EPSILON:E,MAX_SAFE_INTEGER:T,isFinite:x,isNaN:S}=Number,{iterator:m,species:O,toStringTag:P,for:j}=Symbol,F=Object,{create:B,defineProperty:L,freeze:R,is:I}=F,N=F.prototype,U=N.__lookupGetter__?f(N.__lookupGetter__):(t,n)=>{if(null==t)throw Bt(o);let r=F(t);do{const t=p(r,n);if(void 0!==t)return k(t,"get")?t.get:void 0}while(null!==(r=d(r)))},k=F.hasOwn||f(N.hasOwnProperty),M=Array,D=M.isArray,W=M.prototype,G=f(W.join),C=f(W.push),V=f(W.toLocaleString),Y=W[m],z=f(Y),{abs:K,trunc:X}=Math,q=ArrayBuffer,H=q.isView,J=q.prototype,Q=f(J.slice),Z=h(J,"byteLength"),$="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:null,tt=$&&h($.prototype,"byteLength"),nt=d(Uint8Array),rt=nt.from,et=nt.prototype,ot=et[m],it=f(et.keys),st=f(et.values),ut=f(et.entries),ct=f(et.set),ft=f(et.reverse),ht=f(et.fill),lt=f(et.copyWithin),at=f(et.sort),wt=f(et.slice),yt=f(et.subarray),pt=h(et,"buffer"),dt=h(et,"byteOffset"),gt=h(et,"length"),vt=h(et,P),bt=Uint8Array,At=Uint16Array,_t=(...t)=>l(rt,At,t),Et=Uint32Array,Tt=Float32Array,xt=d([][m]()),St=f(xt.next),mt=f(function*(){}().next),Ot=d(xt),Pt=DataView.prototype,jt=f(Pt.getUint16),Ft=f(Pt.setUint16),Bt=TypeError,Lt=RangeError,Rt=WeakSet,It=Rt.prototype,Nt=f(It.add),Ut=f(It.has),kt=WeakMap,Mt=kt.prototype,Dt=f(Mt.get),Wt=f(Mt.has),Gt=f(Mt.set),Ct=new kt,Vt=B(null,{next:{value:function(){const t=Dt(Ct,this);return St(t)}},[m]:{value:function(){return this}}});function Yt(t){if(t[m]===Y&&xt.next===St)return t;const n=B(Vt);return Gt(Ct,n,z(t)),n}const zt=new kt,Kt=B(Ot,{next:{value:function(){const t=Dt(zt,this);return mt(t)},writable:!0,configurable:!0}});for(const t of v(xt))"next"!==t&&L(Kt,t,p(xt,t));function Xt(t){const n=B(Kt);return Gt(zt,n,t),n}function qt(t){return null!==t&&"object"==typeof t||"function"==typeof t}function Ht(t){return null!==t&&"object"==typeof t}function Jt(t){return void 0!==vt(t)}function Qt(t){const n=vt(t);return"BigInt64Array"===n||"BigUint64Array"===n}function Zt(t){if(null===$)return!1;try{return tt(t),!0}catch(t){return!1}}function $t(t){return function(t){try{return!D(t)&&(Z(t),!0)}catch(t){return!1}}(t)||Zt(t)}function tn(t){return!!D(t)&&(t[m]===Y&&xt.next===St)}function nn(t){if("string"!=typeof t)return!1;const n=+t;return t===n+""&&(!!x(n)&&n===X(n))}const rn=j("__Float16Array__");const en=1/E;const on=6103515625e-14,sn=65504,un=.0009765625,cn=un*on,fn=un*en;function hn(t){const n=+t;if(!x(n)||0===n)return n;const r=n>0?1:-1,e=K(n);if(e<on)return r*function(t){return t+en-en}(e/cn)*cn;const o=(1+fn)*e,i=o-(o-e);return i>sn||S(i)?r*(1/0):r*i}const ln=new q(4),an=new Tt(ln),wn=new Et(ln),yn=new At(512),pn=new bt(512);for(let t=0;t<256;++t){const n=t-127;n<-24?(yn[t]=0,yn[256|t]=32768,pn[t]=24,pn[256|t]=24):n<-14?(yn[t]=1024>>-n-14,yn[256|t]=1024>>-n-14|32768,pn[t]=-n-1,pn[256|t]=-n-1):n<=15?(yn[t]=n+15<<10,yn[256|t]=n+15<<10|32768,pn[t]=13,pn[256|t]=13):n<128?(yn[t]=31744,yn[256|t]=64512,pn[t]=24,pn[256|t]=24):(yn[t]=31744,yn[256|t]=64512,pn[t]=13,pn[256|t]=13)}function dn(t){an[0]=hn(t);const n=wn[0],r=n>>23&511;return yn[r]+((8388607&n)>>pn[r])}const gn=new Et(2048);for(let t=1;t<1024;++t){let n=t<<13,r=0;for(;0==(8388608&n);)n<<=1,r-=8388608;n&=-8388609,r+=947912704,gn[t]=n|r}for(let t=1024;t<2048;++t)gn[t]=939524096+(t-1024<<13);const vn=new Et(64);for(let t=1;t<31;++t)vn[t]=t<<23;vn[31]=1199570944,vn[32]=2147483648;for(let t=33;t<63;++t)vn[t]=2147483648+(t-32<<23);vn[63]=3347054592;const bn=new At(64);for(let t=1;t<64;++t)32!==t&&(bn[t]=1024);function An(t){const n=t>>10;return wn[0]=gn[bn[n]+(1023&t)]+vn[n],an[0]}function _n(t){const n=+t;return S(n)||0===n?0:X(n)}function En(t){const n=_n(t);return n<0?0:n<T?n:T}function Tn(t,n){if(!qt(t))throw Bt("This is not an object");const e=t.constructor;if(void 0===e)return n;if(!qt(e))throw Bt(r);const o=e[O];return null==o?n:o}function xn(t){if(Zt(t))return!1;try{return Q(t,0,0),!1}catch(t){}return!0}function Sn(t,n){const r=S(t),e=S(n);if(r&&e)return 0;if(r)return 1;if(e)return-1;if(t<n)return-1;if(t>n)return 1;if(0===t&&0===n){const r=I(t,0),e=I(n,0);if(!r&&e)return-1;if(r&&!e)return 1}return 0}const mn=new kt;function On(t){return Wt(mn,t)||!H(t)&&function(t){if(!Ht(t))return!1;const n=d(t);if(!Ht(n))return!1;const e=n.constructor;if(void 0===e)return!1;if(!qt(e))throw Bt(r);return g(e,rn)}(t)}function Pn(t){if(!On(t))throw Bt("This is not a Float16Array object")}function jn(t,n){const r=On(t),e=Jt(t);if(!r&&!e)throw Bt("Species constructor didn't return TypedArray object");if("number"==typeof n){let e;if(r){const n=Fn(t);e=gt(n)}else e=gt(t);if(e<n)throw Bt("Derived constructor created TypedArray object which was too small length")}if(Qt(t))throw Bt(i)}function Fn(t){const n=Dt(mn,t);if(void 0!==n){if(xn(pt(n)))throw Bt(e);return n}const r=t.buffer;if(xn(r))throw Bt(e);const o=a(In,[r,t.byteOffset,t.length],t.constructor);return Dt(mn,o)}function Bn(t){const n=gt(t),r=[];for(let e=0;e<n;++e)r[e]=An(t[e]);return r}const Ln=new Rt;for(const t of v(et)){if(t===P)continue;const n=p(et,t);k(n,"get")&&"function"==typeof n.get&&Nt(Ln,n.get)}const Rn=R({get:(t,n,r)=>nn(n)&&k(t,n)?An(y(t,n)):Ut(Ln,U(t,n))?y(t,n):y(t,n,r),set:(t,n,r,e)=>nn(n)&&k(t,n)?b(t,n,dn(r)):b(t,n,r,e),getOwnPropertyDescriptor(t,n){if(nn(n)&&k(t,n)){const r=p(t,n);return r.value=An(r.value),r}return p(t,n)},defineProperty:(t,n,r)=>nn(n)&&k(t,n)&&k(r,"value")?(r.value=dn(r.value),w(t,n,r)):w(t,n,r)});class In{constructor(t,n,r){let o;if(On(t))o=a(At,[Fn(t)],new.target);else if(qt(t)&&!$t(t)){let n,r;if(Jt(t)){n=t,r=gt(t);if(xn(pt(t)))throw Bt(e);if(Qt(t))throw Bt(i);const s=new q(2*r);o=a(At,[s],new.target)}else{const e=t[m];if(null!=e&&"function"!=typeof e)throw Bt(s);null!=e?tn(t)?(n=t,r=t.length):(n=[...t],r=n.length):(n=t,r=En(n.length)),o=a(At,[r],new.target)}for(let t=0;t<r;++t)o[t]=dn(n[t])}else o=a(At,arguments,new.target);const u=new _(o,Rn);return Gt(mn,u,o),u}static from(t,...r){const e=this;if(!g(e,rn))throw Bt(n);if(e===In){if(On(t)&&0===r.length){const n=Fn(t),r=new At(pt(n),dt(n),gt(n));return new In(pt(wt(r)))}if(0===r.length)return new In(pt(_t(t,dn)));const n=r[0],e=r[1];return new In(pt(_t(t,(function(t,...r){return dn(l(n,this,[t,...Yt(r)]))}),e)))}let i,u;const c=t[m];if(null!=c&&"function"!=typeof c)throw Bt(s);if(null!=c)tn(t)?(i=t,u=t.length):Jt(f=t)&&f[m]===ot&&xt.next===St?(i=t,u=gt(t)):(i=[...t],u=i.length);else{if(null==t)throw Bt(o);i=F(t),u=En(i.length)}var f;const h=new e(u);if(0===r.length)for(let t=0;t<u;++t)h[t]=i[t];else{const t=r[0],n=r[1];for(let r=0;r<u;++r)h[r]=l(t,n,[i[r],r])}return h}static of(...t){const r=this;if(!g(r,rn))throw Bt(n);const e=t.length;if(r===In){const n=new In(e),r=Fn(n);for(let n=0;n<e;++n)r[n]=dn(t[n]);return n}const o=new r(e);for(let n=0;n<e;++n)o[n]=t[n];return o}keys(){Pn(this);const t=Fn(this);return it(t)}values(){Pn(this);const t=Fn(this);return Xt(function*(){for(const n of st(t))yield An(n)}())}entries(){Pn(this);const t=Fn(this);return Xt(function*(){for(const[n,r]of ut(t))yield[n,An(r)]}())}at(t){Pn(this);const n=Fn(this),r=gt(n),e=_n(t),o=e>=0?e:r+e;if(!(o<0||o>=r))return An(n[o])}with(t,n){Pn(this);const r=Fn(this),e=gt(r),o=_n(t),i=o>=0?o:e+o,s=+n;if(i<0||i>=e)throw Lt(c);const u=new At(pt(r),dt(r),gt(r)),f=new In(pt(wt(u)));return Fn(f)[i]=dn(s),f}map(t,...n){Pn(this);const r=Fn(this),e=gt(r),o=n[0],i=Tn(r,In);if(i===In){const n=new In(e),i=Fn(n);for(let n=0;n<e;++n){const e=An(r[n]);i[n]=dn(l(t,o,[e,n,this]))}return n}const s=new i(e);jn(s,e);for(let n=0;n<e;++n){const e=An(r[n]);s[n]=l(t,o,[e,n,this])}return s}filter(t,...n){Pn(this);const r=Fn(this),e=gt(r),o=n[0],i=[];for(let n=0;n<e;++n){const e=An(r[n]);l(t,o,[e,n,this])&&C(i,e)}const s=new(Tn(r,In))(i);return jn(s),s}reduce(t,...n){Pn(this);const r=Fn(this),e=gt(r);if(0===e&&0===n.length)throw Bt(u);let o,i;0===n.length?(o=An(r[0]),i=1):(o=n[0],i=0);for(let n=i;n<e;++n)o=t(o,An(r[n]),n,this);return o}reduceRight(t,...n){Pn(this);const r=Fn(this),e=gt(r);if(0===e&&0===n.length)throw Bt(u);let o,i;0===n.length?(o=An(r[e-1]),i=e-2):(o=n[0],i=e-1);for(let n=i;n>=0;--n)o=t(o,An(r[n]),n,this);return o}forEach(t,...n){Pn(this);const r=Fn(this),e=gt(r),o=n[0];for(let n=0;n<e;++n)l(t,o,[An(r[n]),n,this])}find(t,...n){Pn(this);const r=Fn(this),e=gt(r),o=n[0];for(let n=0;n<e;++n){const e=An(r[n]);if(l(t,o,[e,n,this]))return e}}findIndex(t,...n){Pn(this);const r=Fn(this),e=gt(r),o=n[0];for(let n=0;n<e;++n){const e=An(r[n]);if(l(t,o,[e,n,this]))return n}return-1}findLast(t,...n){Pn(this);const r=Fn(this),e=gt(r),o=n[0];for(let n=e-1;n>=0;--n){const e=An(r[n]);if(l(t,o,[e,n,this]))return e}}findLastIndex(t,...n){Pn(this);const r=Fn(this),e=gt(r),o=n[0];for(let n=e-1;n>=0;--n){const e=An(r[n]);if(l(t,o,[e,n,this]))return n}return-1}every(t,...n){Pn(this);const r=Fn(this),e=gt(r),o=n[0];for(let n=0;n<e;++n)if(!l(t,o,[An(r[n]),n,this]))return!1;return!0}some(t,...n){Pn(this);const r=Fn(this),e=gt(r),o=n[0];for(let n=0;n<e;++n)if(l(t,o,[An(r[n]),n,this]))return!0;return!1}set(t,...n){Pn(this);const r=Fn(this),s=_n(n[0]);if(s<0)throw Lt(c);if(null==t)throw Bt(o);if(Qt(t))throw Bt(i);if(On(t))return ct(Fn(this),Fn(t),s);if(Jt(t)){if(xn(pt(t)))throw Bt(e)}const u=gt(r),f=F(t),h=En(f.length);if(s===1/0||h+s>u)throw Lt(c);for(let t=0;t<h;++t)r[t+s]=dn(f[t])}reverse(){Pn(this);const t=Fn(this);return ft(t),this}toReversed(){Pn(this);const t=Fn(this),n=new At(pt(t),dt(t),gt(t)),r=new In(pt(wt(n))),e=Fn(r);return ft(e),r}fill(t,...n){Pn(this);const r=Fn(this);return ht(r,dn(t),...Yt(n)),this}copyWithin(t,n,...r){Pn(this);const e=Fn(this);return lt(e,t,n,...Yt(r)),this}sort(t){Pn(this);const n=Fn(this),r=void 0!==t?t:Sn;return at(n,((t,n)=>r(An(t),An(n)))),this}toSorted(t){Pn(this);const n=Fn(this);if(void 0!==t&&"function"!=typeof t)throw new Bt("The comparison function must be either a function or undefined");const r=void 0!==t?t:Sn,e=new At(pt(n),dt(n),gt(n)),o=new In(pt(wt(e))),i=Fn(o);return at(i,((t,n)=>r(An(t),An(n)))),o}slice(t,n){Pn(this);const r=Fn(this),o=Tn(r,In);if(o===In){const e=new At(pt(r),dt(r),gt(r));return new In(pt(wt(e,t,n)))}const i=gt(r),s=_n(t),u=void 0===n?i:_n(n);let c,f;c=s===-1/0?0:s<0?i+s>0?i+s:0:i<s?i:s,f=u===-1/0?0:u<0?i+u>0?i+u:0:i<u?i:u;const h=f-c>0?f-c:0,l=new o(h);if(jn(l,h),0===h)return l;if(xn(pt(r)))throw Bt(e);let a=0;for(;c<f;)l[a]=An(r[c]),++c,++a;return l}subarray(t,n){Pn(this);const r=Fn(this),e=Tn(r,In),o=new At(pt(r),dt(r),gt(r)),i=yt(o,t,n),s=new e(pt(i),dt(i),gt(i));return jn(s),s}indexOf(t,...n){Pn(this);const r=Fn(this),e=gt(r);let o=_n(n[0]);if(o===1/0)return-1;o<0&&(o+=e,o<0&&(o=0));for(let n=o;n<e;++n)if(k(r,n)&&An(r[n])===t)return n;return-1}lastIndexOf(t,...n){Pn(this);const r=Fn(this),e=gt(r);let o=n.length>=1?_n(n[0]):e-1;if(o===-1/0)return-1;o>=0?o=o<e-1?o:e-1:o+=e;for(let n=o;n>=0;--n)if(k(r,n)&&An(r[n])===t)return n;return-1}includes(t,...n){Pn(this);const r=Fn(this),e=gt(r);let o=_n(n[0]);if(o===1/0)return!1;o<0&&(o+=e,o<0&&(o=0));const i=S(t);for(let n=o;n<e;++n){const e=An(r[n]);if(i&&S(e))return!0;if(e===t)return!0}return!1}join(t){Pn(this);const n=Bn(Fn(this));return G(n,t)}toLocaleString(...t){Pn(this);const n=Bn(Fn(this));return V(n,...Yt(t))}get[P](){if(On(this))return"Float16Array"}}L(In,"BYTES_PER_ELEMENT",{value:2}),L(In,rn,{}),A(In,nt);const Nn=In.prototype;function Un(t){return hn(t)}return L(Nn,"BYTES_PER_ELEMENT",{value:2}),L(Nn,m,{value:Nn.values,writable:!0,configurable:!0}),A(Nn,et),t.Float16Array=In,t.f16round=Un,t.getFloat16=function(t,n,...r){return An(jt(t,n,...Yt(r)))},t.hfround=Un,t.isFloat16Array=On,t.isTypedArray=function(t){return Jt(t)||On(t)},t.setFloat16=function(t,n,r,...e){return Ft(t,n,dn(r),...Yt(e))},Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),t}({}); //# sourceMappingURL=/sm/7a7d5421f6bb83cd5a3b4cd8b02b44c0ea24bc2bccbf1d757cf7ba0b04582ad3.map