1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["js/mobilenet_v2_98TC9zP.js","js/chunkReloadRecoveryrjuMb-b8.js","js/vue-runtimeBHGad_ZB.js","js/cjs-helpersC4iS2aBk.js","js/bootstrap-vue-nextDXY4qsO1.js","assets/bootstrap-vue-nexthA7rx8St.css","js/dexie2jmnBxhj.js","assets/chunkReloadRecoveryUbLNi8xK.css","js/mobilenet_v2_midDJ7FCF3k.js","js/inception_v3kr-VsC1u.js"])))=>i.map(i=>d[i]); 2import{am as v}from"./chunkReloadRecoveryrjuMb-b8.js";import{t as Pt,z as Ot,l as $t,a as vt,f as Jt,i as Wt,m as Vt}from"./indexDxjtBBUo.js";import{t as ct,T as jt,s as zt}from"./Unique_implDFaNoOJ5.js";import"./vue-runtimeBHGad_ZB.js";import"./cjs-helpersC4iS2aBk.js";import"./bootstrap-vue-nextDXY4qsO1.js";import"./dexie2jmnBxhj.js";import"./__vite-browser-externalBhtWQ3xB.js";var pt={},j={};j.byteLength=Ht;j.toByteArray=Xt;j.fromByteArray=Qt;var C=[],T=[],Gt=typeof Uint8Array<"u"?Uint8Array:Array,q="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var $=0,Yt=q.length;$<Yt;++$)C[$]=q[$],T[q.charCodeAt($)]=$;T[45]=62;T[95]=63;function dt(p){var s=p.length;if(s%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var f=p.indexOf("=");f===-1&&(f=s);var c=f===s?0:4-f%4;return[f,c]}function Ht(p){var s=dt(p),f=s[0],c=s[1];return(f+c)*3/4-c}function qt(p,s,f){return(s+f)*3/4-f}function Xt(p){var s,f=dt(p),c=f[0],d=f[1],h=new Gt(qt(p,c,d)),l=0,i=d>0?c-4:c,w;for(w=0;w<i;w+=4)s=T[p.charCodeAt(w)]<<18|T[p.charCodeAt(w+1)]<<12|T[p.charCodeAt(w+2)]<<6|T[p.charCodeAt(w+3)],h[l++]=s>>16&255,h[l++]=s>>8&255,h[l++]=s&255;return d===2&&(s=T[p.charCodeAt(w)]<<2|T[p.charCodeAt(w+1)]>>4,h[l++]=s&255),d===1&&(s=T[p.charCodeAt(w)]<<10|T[p.charCodeAt(w+1)]<<4|T[p.charCodeAt(w+2)]>>2,h[l++]=s>>8&255,h[l++]=s&255),h}function Zt(p){return C[p>>18&63]+C[p>
vendor: 22,676 bytes, lines 2-7
2>12&63]+C[p>>6&63]+C[p&63]}function Kt(p,s,f){for(var c,d=[],h=s;h<f;h+=3)c=(p[h]<<16&16711680)+(p[h+1]<<8&65280)+(p[h+2]&255),d.push(Zt(c));return d.join("")}function Qt(p){for(var s,f=p.length,c=f%3,d=[],h=16383,l=0,i=f-c;l<i;l+=h)d.push(Kt(p,l,l+h>i?i:l+h));return c===1?(s=p[f-1],d.push(C[s>>2]+C[s<<4&63]+"==")):c===2&&(s=(p[f-2]<<8)+p[f-1],d.push(C[s>>10]+C[s>>4&63]+C[s<<2&63]+"=")),d.join("")}var X={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */X.read=function(p,s,f,c,d){var h,l,i=d*8-c-1,w=(1<<i)-1,y=w>>1,g=-7,B=f?d-1:0,_=f?-1:1,A=p[s+B];for(B+=_,h=A&(1<<-g)-1,A>>=-g,g+=i;g>0;h=h*256+p[s+B],B+=_,g-=8);for(l=h&(1<<-g)-1,h>>=-g,g+=c;g>0;l=l*256+p[s+B],B+=_,g-=8);if(h===0)h=1-y;else{if(h===w)return l?NaN:(A?-1:1)*(1/0);l=l+Math.pow(2,c),h=h-y}return(A?-1:1)*l*Math.pow(2,h-c)};X.write=function(p,s,f,c,d,h){var l,i,w,y=h*8-d-1,g=(1<<y)-1,B=g>>1,_=d===23?Math.pow(2,-24)-Math.pow(2,-77):0,A=c?0:h-1,R=c?1:-1,k=s<0||s===0&&1/s<0?1:0;for(s=Math.abs(s),isNaN(s)||s===1/0?(i=isNaN(s)?1:0,l=g):(l=Math.floor(Math.log(s)/Math.LN2),s*(w=Math.pow(2,-l))<1&&(l--,w*=2),l+B>=1?s+=_/w:s+=_*Math.pow(2,1-B),s*w>=2&&(l++,w/=2),l+B>=g?(i=0,l=g):l+B>=1?(i=(s*w-1)*Math.pow(2,d),l=l+B):(i=s*Math.pow(2,B-1)*Math.pow(2,d),l=0));d>=8;p[f+A]=i&255,A+=R,i/=256,d-=8);for(l=l<<d|i,y+=d;y>0;p[f+A]=l&255,A+=R,l/=256,y-=8);p[f+A-R]|=k*128};/*! 3 * The buffer module from node.js, for the browser. 4 * 5 * @author Feross Aboukhadijeh <https://feross.org> 6 * @license MIT 7 */(function(p){const s=j,f=X,c=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;p.Buffer=i,p.SlowBuffer=gt,p.INSPECT_MAX_BYTES=50;const d=2147483647;p.kMaxLength=d,i.TYPED_ARRAY_SUPPORT=h(),!i.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function h(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),e.foo()===42}catch{return!1}}Object.defineProperty(i.prototype,"parent",{enumerable:!0,get:function(){if(i.isBuffer(this))return this.buffer}}),Object.defineProperty(i.prototype,"offset",{enumerable:!0,get:function(){if(i.isBuffer(this))return this.byteOffset}});function l(e){if(e>d)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,i.prototype),t}function i(e,t,r){if(typeof e=="number"){if(typeof t=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return B(e)}return w(e,t,r)}i.poolSize=8192;function w(e,t,r){if(typeof e=="string")return _(e,t);if(ArrayBuffer.isView(e))return R(e);if(e==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(S(e,ArrayBuffer)||e&&S(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(S(e,SharedArrayBuffer)||e&&S(e.buffer,SharedArrayBuffer)))return k(e,t,r);if(typeof e=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(n!=null&&n!==e)return i.from(n,t,r);const o=z(e);if(o)return o;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]=="function")return i.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}i.from=function(e,t,r){return w(e,t,r)},Object.setPrototypeOf(i.prototype,Uint8Array.prototype),Object.setPrototypeOf(i,Uint8Array);function y(e){if(typeof e!="number")throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function g(e,t,r){return y(e),e<=0?l(e):t!==void 0?typeof r=="string"?l(e).fill(t,r):l(e).fill(t):l(e)}i.alloc=function(e,t,r){return g(e,t,r)};function B(e){return y(e),l(e<0?0:J(e)|0)}i.allocUnsafe=function(e){return B(e)},i.allocUnsafeSlow=function(e){return B(e)};function _(e,t){if((typeof t!="string"||t==="")&&(t="utf8"),!i.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=K(e,t)|0;let n=l(r);const o=n.write(e,t);return o!==r&&(n=n.slice(0,o)),n}function A(e){const t=e.length<0?0:J(e.length)|0,r=l(t);for(let n=0;n<t;n+=1)r[n]=e[n]&255;return r}function R(e){if(S(e,Uint8Array)){const t=new Uint8Array(e);return k(t.buffer,t.byteOffset,t.byteLength)}return A(e)}function k(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return t===void 0&&r===void 0?n=new Uint8Array(e):r===void 0?n=new Uint8Array(e,t):n=new Uint8Array(e,t,r),Object.setPrototypeOf(n,i.prototype),n}function z(e){if(i.isBuffer(e)){const t=J(e.length)|0,r=l(t);return r.length===0||e.copy(r,0,0,t),r}if(e.length!==void 0)return typeof e.length!="number"||H(e.length)?l(0):A(e);if(e.type==="Buffer"&&Array.isArray(e.data))return A(e.data)}function J(e){if(e>=d)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+d.toString(16)+" bytes");return e|0}function gt(e){return+e!=e&&(e=0),i.alloc(+e)}i.isBuffer=function(t){return t!=null&&t._isBuffer===!0&&t!==i.prototype},i.compare=function(t,r){if(S(t,Uint8Array)&&(t=i.from(t,t.offset,t.byteLength)),S(r,Uint8Array)&&(r=i.from(r,r.offset,r.byteLength)),!i.isBuffer(t)||!i.isBuffer(r))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===r)return 0;let n=t.length,o=r.length;for(let u=0,a=Math.min(n,o);u<a;++u)if(t[u]!==r[u]){n=t[u],o=r[u];break}return n<o?-1:o<n?1:0},i.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},i.concat=function(t,r){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(t.length===0)return i.alloc(0);let n;if(r===void 0)for(r=0,n=0;n<t.length;++n)r+=t[n].length;const o=i.allocUnsafe(r);let u=0;for(n=0;n<t.length;++n){let a=t[n];if(S(a,Uint8Array))u+a.length>o.length?(i.isBuffer(a)||(a=i.from(a)),a.copy(o,u)):Uint8Array.prototype.set.call(o,a,u);else if(i.isBuffer(a))a.copy(o,u);else throw new TypeError('"list" argument must be an Array of Buffers');u+=a.length}return o};function K(e,t){if(i.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||S(e,ArrayBuffer))return e.byteLength;if(typeof e!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&r===0)return 0;let o=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return Y(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return ht(e).length;default:if(o)return n?-1:Y(e).length;t=(""+t).toLowerCase(),o=!0}}i.byteLength=K;function xt(e,t,r){let n=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,t>>>=0,r<=t))return"";for(e||(e="utf8");;)switch(e){case"hex":return Tt(this,t,r);case"utf8":case"utf-8":return rt(this,t,r);case"ascii":return Ut(this,t,r);case"latin1":case"binary":return _t(this,t,r);case"base64":return At(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Rt(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}i.prototype._isBuffer=!0;function N(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}i.prototype.swap16=function(){const t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let r=0;r<t;r+=2)N(this,r,r+1);return this},i.prototype.swap32=function(){const t=this.length;if(t%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let r=0;r<t;r+=4)N(this,r,r+3),N(this,r+1,r+2);return this},i.prototype.swap64=function(){const t=this.length;if(t%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let r=0;r<t;r+=8)N(this,r,r+7),N(this,r+1,r+6),N(this,r+2,r+5),N(this,r+3,r+4);return this},i.prototype.toString=function(){const t=this.length;return t===0?"":arguments.length===0?rt(this,0,t):xt.apply(this,arguments)},i.prototype.toLocaleString=i.prototype.toString,i.prototype.equals=function(t){if(!i.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:i.compare(this,t)===0},i.prototype.inspect=function(){let t="";const r=p.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"},c&&(i.prototype[c]=i.prototype.inspect),i.prototype.compare=function(t,r,n,o,u){if(S(t,Uint8Array)&&(t=i.from(t,t.offset,t.byteLength)),!i.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(r===void 0&&(r=0),n===void 0&&(n=t?t.length:0),o===void 0&&(o=0),u===void 0&&(u=this.length),r<0||n>t.length||o<0||u>this.length)throw new RangeError("out of range index");if(o>=u&&r>=n)return 0;if(o>=u)return-1;if(r>=n)return 1;if(r>>>=0,n>>>=0,o>>>=0,u>>>=0,this===t)return 0;let a=u-o,x=n-r;const I=Math.min(a,x),E=this.slice(o,u),F=t.slice(r,n);for(let m=0;m<I;++m)if(E[m]!==F[m]){a=E[m],x=F[m];break}return a<x?-1:x<a?1:0};function Q(e,t,r,n,o){if(e.length===0)return-1;if(typeof r=="string"?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,H(r)&&(r=o?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(o)return-1;r=e.length-1}else if(r<0)if(o)r=0;else return-1;if(typeof t=="string"&&(t=i.from(t,n)),i.isBuffer(t))return t.length===0?-1:tt(e,t,r,n,o);if(typeof t=="number")return t=t&255,typeof Uint8Array.prototype.indexOf=="function"?o?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):tt(e,[t],r,n,o);throw new TypeError("val must be string, number or Buffer")}function tt(e,t,r,n,o){let u=1,a=e.length,x=t.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(e.length<2||t.length<2)return-1;u=2,a/=2,x/=2,r/=2}function I(F,m){return u===1?F[m]:F.readUInt16BE(m*u)}let E;if(o){let F=-1;for(E=r;E<a;E++)if(I(e,E)===I(t,F===-1?0:E-F)){if(F===-1&&(F=E),E-F+1===x)return F*u}else F!==-1&&(E-=E-F),F=-1}else for(r+x>a&&(r=a-x),E=r;E>=0;E--){let F=!0;for(let m=0;m<x;m++)if(I(e,E+m)!==I(t,m)){F=!1;break}if(F)return E}return-1}i.prototype.includes=function(t,r,n){return this.indexOf(t,r,n)!==-1},i.prototype.indexOf=function(t,r,n){return Q(this,t,r,n,!0)},i.prototype.lastIndexOf=function(t,r,n){return Q(this,t,r,n,!1)};function Bt(e,t,r,n){r=Number(r)||0;const o=e.length-r;n?(n=Number(n),n>o&&(n=o)):n=o;const u=t.length;n>u/2&&(n=u/2);let a;for(a=0;a<n;++a){const x=parseInt(t.substr(a*2,2),16);if(H(x))return a;e[r+a]=x}return a}function mt(e,t,r,n){return V(Y(t,e.length-r),e,r,n)}function Et(e,t,r,n){return V(Dt(t),e,r,n)}function It(e,t,r,n){return V(ht(t),e,r,n)}function Ft(e,t,r,n){return V(Lt(t,e.length-r),e,r,n)}i.prototype.write=function(t,r,n,o){if(r===void 0)o="utf8",n=this.length,r=0;else if(n===void 0&&typeof r=="string")o=r,n=this.length,r=0;else if(isFinite(r))r=r>>>0,isFinite(n)?(n=n>>>0,o===void 0&&(o="utf8")):(o=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const u=this.length-r;if((n===void 0||n>u)&&(n=u),t.length>0&&(n<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");o||(o="utf8");let a=!1;for(;;)switch(o){case"hex":return Bt(this,t,r,n);case"utf8":case"utf-8":return mt(this,t,r,n);case"ascii":case"latin1":case"binary":return Et(this,t,r,n);case"base64":return It(this,t,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ft(this,t,r,n);default:if(a)throw new TypeError("Unknown encoding: "+o);o=(""+o).toLowerCase(),a=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function At(e,t,r){return t===0&&r===e.length?s.fromByteArray(e):s.fromByteArray(e.slice(t,r))}function rt(e,t,r){r=Math.min(e.length,r);const n=[];let o=t;for(;o<r;){const u=e[o];let a=null,x=u>239?4:u>223?3:u>191?2:1;if(o+x<=r){let I,E,F,m;switch(x){case 1:u<128&&(a=u);break;case 2:I=e[o+1],(I&192)===128&&(m=(u&31)<<6|I&63,m>127&&(a=m));break;case 3:I=e[o+1],E=e[o+2],(I&192)===128&&(E&192)===128&&(m=(u&15)<<12|(I&63)<<6|E&63,m>2047&&(m<55296||m>57343)&&(a=m));break;case 4:I=e[o+1],E=e[o+2],F=e[o+3],(I&192)===128&&(E&192)===128&&(F&192)===128&&(m=(u&15)<<18|(I&63)<<12|(E&63)<<6|F&63,m>65535&&m<1114112&&(a=m))}}a===null?(a=65533,x=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|a&1023),n.push(a),o+=x}return bt(n)}const et=4096;function bt(e){const t=e.length;if(t<=et)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=et));return r}function Ut(e,t,r){let n="";r=Math.min(e.length,r);for(let o=t;o<r;++o)n+=String.fromCharCode(e[o]&127);return n}function _t(e,t,r){let n="";r=Math.min(e.length,r);for(let o=t;o<r;++o)n+=String.fromCharCode(e[o]);return n}function Tt(e,t,r){const n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let o="";for(let u=t;u<r;++u)o+=Nt[e[u]];return o}function Rt(e,t,r){const n=e.slice(t,r);let o="";for(let u=0;u<n.length-1;u+=2)o+=String.fromCharCode(n[u]+n[u+1]*256);return o}i.prototype.slice=function(t,r){const n=this.length;t=~~t,r=r===void 0?n:~~r,t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),r<t&&(r=t);const o=this.subarray(t,r);return Object.setPrototypeOf(o,i.prototype),o};function b(e,t,r){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}i.prototype.readUintLE=i.prototype.readUIntLE=function(t,r,n){t=t>>>0,r=r>>>0,n||b(t,r,this.length);let o=this[t],u=1,a=0;for(;++a<r&&(u*=256);)o+=this[t+a]*u;return o},i.prototype.readUintBE=i.prototype.readUIntBE=function(t,r,n){t=t>>>0,r=r>>>0,n||b(t,r,this.length);let o=this[t+--r],u=1;for(;r>0&&(u*=256);)o+=this[t+--r]*u;return o},i.prototype.readUint8=i.prototype.readUInt8=function(t,r){return t=t>>>0,r||b(t,1,this.length),this[t]},i.prototype.readUint16LE=i.prototype.readUInt16LE=function(t,r){return t=t>>>0,r||b(t,2,this.length),this[t]|this[t+1]<<8},i.prototype.readUint16BE=i.prototype.readUInt16BE=function(t,r){return t=t>>>0,r||b(t,2,this.length),this[t]<<8|this[t+1]},i.prototype.readUint32LE=i.prototype.readUInt32LE=function(t,r){return t=t>>>0,r||b(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216},i.prototype.readUint32BE=i.prototype.readUInt32BE=function(t,r){return t=t>>>0,r||b(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])},i.prototype.readBigUInt64LE=L(function(t){t=t>>>0,O(t,"offset");const r=this[t],n=this[t+7];(r===void 0||n===void 0)&&W(t,this.length-8);const o=r+this[++t]*2**8+this[++t]*2**16+this[++t]*2**24,u=this[++t]+this[++t]*2**8+this[++t]*2**16+n*2**24;return BigInt(o)+(BigInt(u)<<BigInt(32))}),i.prototype.readBigUInt64BE=L(function(t){t=t>>>0,O(t,"offset");const r=this[t],n=this[t+7];(r===void 0||n===void 0)&&W(t,this.length-8);const o=r*2**24+this[++t]*2**16+this[++t]*2**8+this[++t],u=this[++t]*2**24+this[++t]*2**16+this[++t]*2**8+n;return(BigInt(o)<<BigInt(32))+BigInt(u)}),i.prototype.readIntLE=function(t,r,n){t=t>>>0,r=r>>>0,n||b(t,r,this.length);let o=this[t],u=1,a=0;for(;++a<r&&(u*=256);)o+=this[t+a]*u;return u*=128,o>=u&&(o-=Math.pow(2,8*r)),o},i.prototype.readIntBE=function(t,r,n){t=t>>>0,r=r>>>0,n||b(t,r,this.length);let o=r,u=1,a=this[t+--o];for(;o>0&&(u*=256);)a+=this[t+--o]*u;return u*=128,a>=u&&(a-=Math.pow(2,8*r)),a},i.prototype.readInt8=function(t,r){return t=t>>>0,r||b(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]},i.prototype.readInt16LE=function(t,r){t=t>>>0,r||b(t,2,this.length);const n=this[t]|this[t+1]<<8;return n&32768?n|4294901760:n},i.prototype.readInt16BE=function(t,r){t=t>>>0,r||b(t,2,this.length);const n=this[t+1]|this[t]<<8;return n&32768?n|4294901760:n},i.prototype.readInt32LE=function(t,r){return t=t>>>0,r||b(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},i.prototype.readInt32BE=function(t,r){return t=t>>>0,r||b(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},i.prototype.readBigInt64LE=L(function(t){t=t>>>0,O(t,"offset");const r=this[t],n=this[t+7];(r===void 0||n===void 0)&&W(t,this.length-8);const o=this[t+4]+this[t+5]*2**8+this[t+6]*2**16+(n<<24);return(BigInt(o)<<BigInt(32))+BigInt(r+this[++t]*2**8+this[++t]*2**16+this[++t]*2**24)}),i.prototype.readBigInt64BE=L(function(t){t=t>>>0,O(t,"offset");const r=this[t],n=this[t+7];(r===void 0||n===void 0)&&W(t,this.length-8);const o=(r<<24)+this[++t]*2**16+this[++t]*2**8+this[++t];return(BigInt(o)<<BigInt(32))+BigInt(this[++t]*2**24+this[++t]*2**16+this[++t]*2**8+n)}),i.prototype.readFloatLE=function(t,r){return t=t>>>0,r||b(t,4,this.length),f.read(this,t,!0,23,4)},i.prototype.readFloatBE=function(t,r){return t=t>>>0,r||b(t,4,this.length),f.read(this,t,!1,23,4)},i.prototype.readDoubleLE=function(t,r){return t=t>>>0,r||b(t,8,this.length),f.read(this,t,!0,52,8)},i.prototype.readDoubleBE=function(t,r){return t=t>>>0,r||b(t,8,this.length),f.read(this,t,!1,52,8)};function U(e,t,r,n,o,u){if(!i.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||t<u)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}i.prototype.writeUintLE=i.prototype.writeUIntLE=function(t,r,n,o){if(t=+t,r=r>>>0,n=n>>>0,!o){const x=Math.pow(2,8*n)-1;U(this,t,r,n,x,0)}let u=1,a=0;for(this[r]=t&255;++a<n&&(u*=256);)this[r+a]=t/u&255;return r+n},i.prototype.writeUintBE=i.prototype.writeUIntBE=function(t,r,n,o){if(t=+t,r=r>>>0,n=n>>>0,!o){const x=Math.pow(2,8*n)-1;U(this,t,r,n,x,0)}let u=n-1,a=1;for(this[r+u]=t&255;--u>=0&&(a*=256);)this[r+u]=t/a&255;return r+n},i.prototype.writeUint8=i.prototype.writeUInt8=function(t,r,n){return t=+t,r=r>>>0,n||U(this,t,r,1,255,0),this[r]=t&255,r+1},i.prototype.writeUint16LE=i.prototype.writeUInt16LE=function(t,r,n){return t=+t,r=r>>>0,n||U(this,t,r,2,65535,0),this[r]=t&255,this[r+1]=t>>>8,r+2},i.prototype.writeUint16BE=i.prototype.writeUInt16BE=function(t,r,n){return t=+t,r=r>>>0,n||U(this,t,r,2,65535,0),this[r]=t>>>8,this[r+1]=t&255,r+2},i.prototype.writeUint32LE=i.prototype.writeUInt32LE=function(t,r,n){return t=+t,r=r>>>0,n||U(this,t,r,4,4294967295,0),this[r+3]=t>>>24,this[r+2]=t>>>16,this[r+1]=t>>>8,this[r]=t&255,r+4},i.prototype.writeUint32BE=i.prototype.writeUInt32BE=function(t,r,n){return t=+t,r=r>>>0,n||U(this,t,r,4,4294967295,0),this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=t&255,r+4};function nt(e,t,r,n,o){at(t,n,o,e,r,7);let u=Number(t&BigInt(4294967295));e[r++]=u,u=u>>8,e[r++]=u,u=u>>8,e[r++]=u,u=u>>8,e[r++]=u;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=a,a=a>>8,e[r++]=a,a=a>>8,e[r++]=a,a=a>>8,e[r++]=a,r}function it(e,t,r,n,o){at(t,n,o,e,r,7);let u=Number(t&BigInt(4294967295));e[r+7]=u,u=u>>8,e[r+6]=u,u=u>>8,e[r+5]=u,u=u>>8,e[r+4]=u;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=a,a=a>>8,e[r+2]=a,a=a>>8,e[r+1]=a,a=a>>8,e[r]=a,r+8}i.prototype.writeBigUInt64LE=L(function(t,r=0){return nt(this,t,r,BigInt(0),BigInt("0xffffffffffffffff"))}),i.prototype.writeBigUInt64BE=L(function(t,r=0){return it(this,t,r,BigInt(0),BigInt("0xffffffffffffffff"))}),i.prototype.writeIntLE=function(t,r,n,o){if(t=+t,r=r>>>0,!o){const I=Math.pow(2,8*n-1);U(this,t,r,n,I-1,-I)}let u=0,a=1,x=0;for(this[r]=t&255;++u<n&&(a*=256);)t<0&&x===0&&this[r+u-1]!==0&&(x=1),this[r+u]=(t/a>>0)-x&255;return r+n},i.prototype.writeIntBE=function(t,r,n,o){if(t=+t,r=r>>>0,!o){const I=Math.pow(2,8*n-1);U(this,t,r,n,I-1,-I)}let u=n-1,a=1,x=0;for(this[r+u]=t&255;--u>=0&&(a*=256);)t<0&&x===0&&this[r+u+1]!==0&&(x=1),this[r+u]=(t/a>>0)-x&255;return r+n},i.prototype.writeInt8=function(t,r,n){return t=+t,r=r>>>0,n||U(this,t,r,1,127,-128),t<0&&(t=255+t+1),this[r]=t&255,r+1},i.prototype.writeInt16LE=function(t,r,n){return t=+t,r=r>>>0,n||U(this,t,r,2,32767,-32768),this[r]=t&255,this[r+1]=t>>>8,r+2},i.prototype.writeInt16BE=function(t,r,n){return t=+t,r=r>>>0,n||U(this,t,r,2,32767,-32768),this[r]=t>>>8,this[r+1]=t&255,r+2},i.prototype.writeInt32LE=function(t,r,n){return t=+t,r=r>>>0,n||U(this,t,r,4,2147483647,-2147483648),this[r]=t&255,this[r+1]=t>>>8,this[r+2]=t>>>16,this[r+3]=t>>>24,r+4},i.prototype.writeInt32BE=function(t,r,n){return t=+t,r=r>>>0,n||U(this,t,r,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=t&255,r+4},i.prototype.writeBigInt64LE=L(function(t,r=0){return nt(this,t,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),i.prototype.writeBigInt64BE=L(function(t,r=0){return it(this,t,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function ot(e,t,r,n,o,u){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function ut(e,t,r,n,o){return t=+t,r=r>>>0,o||ot(e,t,r,4),f.write(e,t,r,n,23,4),r+4}i.prototype.writeFloatLE=function(t,r,n){return ut(this,t,r,!0,n)},i.prototype.writeFloatBE=function(t,r,n){return ut(this,t,r,!1,n)};function st(e,t,r,n,o){return t=+t,r=r>>>0,o||ot(e,t,r,8),f.write(e,t,r,n,52,8),r+8}i.prototype.writeDoubleLE=function(t,r,n){return st(this,t,r,!0,n)},i.prototype.writeDoubleBE=function(t,r,n){return st(this,t,r,!1,n)},i.prototype.copy=function(t,r,n,o){if(!i.isBuffer(t))throw new TypeError("argument should be a Buffer");if(n||(n=0),!o&&o!==0&&(o=this.length),r>=t.length&&(r=t.length),r||(r=0),o>0&&o<n&&(o=n),o===n||t.length===0||this.length===0)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(o<0)throw new RangeError("sourceEnd out of bounds");o>this.length&&(o=this.length),t.length-r<o-n&&(o=t.length-r+n);const u=o-n;return this===t&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(r,n,o):Uint8Array.prototype.set.call(t,this.subarray(n,o),r),u},i.prototype.fill=function(t,r,n,o){if(typeof t=="string"){if(typeof r=="string"?(o=r,r=0,n=this.length):typeof n=="string"&&(o=n,n=this.length),o!==void 0&&typeof o!="string")throw new TypeError("encoding must be a string");
vendor: 4,196 bytes, line 7
7if(typeof o=="string"&&!i.isEncoding(o))throw new TypeError("Unknown encoding: "+o);if(t.length===1){const a=t.charCodeAt(0);(o==="utf8"&&a<128||o==="latin1")&&(t=a)}}else typeof t=="number"?t=t&255:typeof t=="boolean"&&(t=Number(t));if(r<0||this.length<r||this.length<n)throw new RangeError("Out of range index");if(n<=r)return this;r=r>>>0,n=n===void 0?this.length:n>>>0,t||(t=0);let u;if(typeof t=="number")for(u=r;u<n;++u)this[u]=t;else{const a=i.isBuffer(t)?t:i.from(t,o),x=a.length;if(x===0)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(u=0;u<n-r;++u)this[u+r]=a[u%x]}return this};const P={};function G(e,t,r){P[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(o){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:o,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}G("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),G("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),G("ERR_OUT_OF_RANGE",function(e,t,r){let n=`The value of "${e}" is out of range.`,o=r;return Number.isInteger(r)&&Math.abs(r)>2**32?o=ft(String(r)):typeof r=="bigint"&&(o=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(o=ft(o)),o+="n"),n+=` It must be ${t}. Received ${o}`,n},RangeError);function ft(e){let t="",r=e.length;const n=e[0]==="-"?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function St(e,t,r){O(t,"offset"),(e[t]===void 0||e[t+r]===void 0)&&W(t,e.length-(r+1))}function at(e,t,r,n,o,u){if(e>r||e<t){const a=typeof t=="bigint"?"n":"";let x;throw t===0||t===BigInt(0)?x=`>= 0${a} and < 2${a} ** ${(u+1)*8}${a}`:x=`>= -(2${a} ** ${(u+1)*8-1}${a}) and < 2 ** ${(u+1)*8-1}${a}`,new P.ERR_OUT_OF_RANGE("value",x,e)}St(n,o,u)}function O(e,t){if(typeof e!="number")throw new P.ERR_INVALID_ARG_TYPE(t,"number",e)}function W(e,t,r){throw Math.floor(e)!==e?(O(e,r),new P.ERR_OUT_OF_RANGE("offset","an integer",e)):t<0?new P.ERR_BUFFER_OUT_OF_BOUNDS:new P.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${t}`,e)}const Ct=/[^+/0-9A-Za-z-_]/g;function Mt(e){if(e=e.split("=")[0],e=e.trim().replace(Ct,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function Y(e,t){t=t||1/0;let r;const n=e.length;let o=null;const u=[];for(let a=0;a<n;++a){if(r=e.charCodeAt(a),r>55295&&r<57344){if(!o){if(r>56319){(t-=3)>-1&&u.push(239,191,189);continue}else if(a+1===n){(t-=3)>-1&&u.push(239,191,189);continue}o=r;continue}if(r<56320){(t-=3)>-1&&u.push(239,191,189),o=r;continue}r=(o-55296<<10|r-56320)+65536}else o&&(t-=3)>-1&&u.push(239,191,189);if(o=null,r<128){if((t-=1)<0)break;u.push(r)}else if(r<2048){if((t-=2)<0)break;u.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;u.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((t-=4)<0)break;u.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return u}function Dt(e){const t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r)&255);return t}function Lt(e,t){let r,n,o;const u=[];for(let a=0;a<e.length&&!((t-=2)<0);++a)r=e.charCodeAt(a),n=r>>8,o=r%256,u.push(o),u.push(n);return u}function ht(e){return s.toByteArray(Mt(e))}function V(e,t,r,n){let o;for(o=0;o<n&&!(o+r>=t.length||o>=e.length);++o)t[o+r]=e[o];return o}function S(e,t){return e instanceof t||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===t.name}function H(e){return e!==e}const Nt=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=r*16;for(let o=0;o<16;++o)t[n+o]=e[r]+e[o]}return t}();function L(e){return typeof BigInt>"u"?kt:e}function kt(){throw new Error("BigInt not supported")}})(pt);var tr={0:"Drawing",1:"Hentai",2:"Neutral",3:"Porn",4:"Sexy"},M=function(p,s,f,c){function d(h){return h instanceof f?h:new f(function(l){l(h)})}return new(f||(f=Promise))(function(h,l){function i(g){try{y(c.next(g))}
7catch(B){l(B)}}function w(g){try{y(c.throw(g))}catch(B){l(B)}}function y(g){g.done?h(g.value):d(g.value).then(i,w)}y((c=c.apply(p,s||[])).next())})},D=function(p,s){var f={label:0,sent:function(){if(h[0]&1)throw h[1];return h[1]},trys:[],ops:[]},c,d,h,l=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return l.next=i(0),l.throw=i(1),l.return=i(2),typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function i(y){return function(g){return w([y,g])}}function w(y){if(c)throw new TypeError("Generator is already executing.");for(;l&&(l=0,y[0]&&(f=0)),f;)try{if(c=1,d&&(h=y[0]&2?d.return:y[0]?d.throw||((h=d.return)&&h.call(d),0):d.next)&&!(h=h.call(d,y[1])).done)return h;switch(d=0,h&&(y=[y[0]&2,h.value]),y[0]){case 0:case 1:h=y;break;case 4:return f.label++,{value:y[1],done:!1};case 5:f.label++,d=y[1],y=[0];continue;case 7:y=f.ops.pop(),f.trys.pop();continue;default:if(h=f.trys,!(h=h.length>0&&h[h.length-1])&&(y[0]===6||y[0]===2)){f=0;continue}if(y[0]===3&&(!h||y[1]>h[0]&&y[1]<h[3])){f.label=y[1];break}if(y[0]===6&&f.label<h[1]){f.label=h[1],h=y;break}if(h&&f.label<h[2]){f.label=h[2],f.ops.push(y);break}h[2]&&f.ops.pop(),f.trys.pop();continue}y=s.call(p,f)}catch(g){y=[6,g],d=0}finally{c=h=0}if(y[0]&5)throw y[1];return{value:y[0]?y[1]:void 0,done:!0}}},rr=function(p,s,f){if(f||arguments.length===2)for(var c=0,d=s.length,h;c<d;c++)(h||!(c in s))&&(h||(h=Array.prototype.slice.call(s,0,c)),h[c]=s[c]);return p.concat(h||Array.prototype.slice.call(s))},Z={MobileNetV2:{numOfWeightBundles:1},MobileNetV2Mid:{numOfWeightBundles:2,options:{type:"graph"}},InceptionV3:{numOfWeightBundles:6,options:{size:299}}},er="MobileNetV2",lt=224,yt=function(){if(typeof globalThis<"u")return globalThis;if(typeof global<"u")return global;if(typeof window<"u")return window;if(typeof self<"u")return self;throw new Error("Unable to locate global object")};function wt(p){return!!p&&p in Z}var nr=function(p){return M(void 0,void 0,void 0,function(){var s,f;return D(this,function(c){switch(c.label){case 0:return s=yt().model,s?[2,s]:p!=="MobileNetV2"?[3,2]:[4,v(()=>import("./mobilenet_v2_98TC9zP.js"),__vite__mapDeps([0,1,2,3,4,5,6,7]))];case 1:return f=c.sent().modelJson,[3,6];case 2:return p!=="MobileNetV2Mid"?[3,4]:[4,v(()=>import("./mobilenet_v2_midDJ7FCF3k.js"),__vite__mapDeps([8,1,2,3,4,5,6,7]))];case 3:return f=c.sent().modelJson,[3,6];case 4:return p!=="InceptionV3"?[3,6]:[4,v(()=>import("./inception_v3kr-VsC1u.js"),__vite__mapDeps([9,1,2,3,4,5,6,7]))];case 5:f=c.sent().modelJson,c.label=6;case 6:return[4,f()];case 7:return[2,c.sent().default]}})})},ir=function(p){return M(void 0,void 0,void 0,function(){var s,f,c,d,h,l,i,w,y,g;return D(this,function(B){switch(B.label){case 0:s=Z[p].numOfWeightBundles,f=[],c=0,B.label=1;case 1:return c<s?(d="group1-shard".concat(c+1,"of").concat(s),h=d.replace(/-/g,"_"),l=yt()[h],l?(f.push((y={},y[d]=l,y)),[3,10]):[3,2]):[3,11];case 2:return i=void 0,p!=="MobileNetV2"?[3,4]:[4,v(()=>import("./mobilenet_v2_98TC9zP.js"),__vite__mapDeps([0,1,2,3,4,5,6,7]))];case 3:return i=B.sent().weightBundles,[3,8];case 4:return p!=="MobileNetV2Mid"?[3,6]:[4,v(()=>import("./mobilenet_v2_midDJ7FCF3k.js"),__vite__mapDeps([8,1,2,3,4,5,6,7]))];case 5:return i=B.sent().weightBundles,[3,8];case 6:return p!=="InceptionV3"?[3,8]:[4,v(()=>import("./inception_v3kr-VsC1u.js"),__vite__mapDeps([9,1,2,3,4,5,6,7]))];case 7:i=B.sent().weightBundles,B.label=8;case 8:return[4,i[c]()];case 9:w=B.sent().default,f.push((g={},g[d]=w,g)),B.label=10;case 10:return c++,[3,1];case 11:return[2,Object.assign.apply(Object,rr([{}],f,!1))]}})})};function or(p){return M(this,void 0,void 0,function(){var s;return D(this,function(f){switch(f.label){case 0:return f.trys.push([0,2,,3]),[4,ir(p)];case 1:return s=f.sent(),[2,s];case 2:throw f.sent(),new Error("Could not load the weight data. Make sure you are importing the correct shard files from the models directory. Ref: https://github.com/infinitered/nsfwjs?tab=readme-ov-file#browserify");case 3:return[2]}})})}function ur(p){return M(this,void 0,void 0,function(){var s,f,c;return D(this,function(d){switch(d.label){case 0:if(!wt(p))return[2,p];d.label=1;case 1:return d.trys.push([1,4,,5]),[4,nr(p)];
7case 2:return s=d.sent(),[4,or(p)];case 3:return f=d.sent(),c=new sr(s,f),[2,c];case 4:throw d.sent(),new Error("Could not load the model. Make sure you are importing the model.min.js bundle. Ref: https://github.com/infinitered/nsfwjs?tab=readme-ov-file#browserify");case 5:return[2]}})})}function Br(p){return M(this,arguments,void 0,function(s,f){var c,d,h;return f===void 0&&(f={size:lt}),D(this,function(l){switch(l.label){case 0:if(Pt==null)throw new Error("Cannot find TensorFlow.js. If you are using a <script> tag, please also include @tensorflow/tfjs on the page before using this model.");return s===void 0?(s=er,"%cBy not specifying 'modelOrUrl' parameter, you're using the default model: '".concat(s,"'. See NSFWJS docs for instructions on hosting your own model (https://github.com/infinitered/nsfwjs?tab=readme-ov-file#host-your-own-model).")):wt(s)&&("%cYou're using the model: '".concat(s,"'. See NSFWJS docs for instructions on hosting your own model (https://github.com/infinitered/nsfwjs?tab=readme-ov-file#host-your-own-model)."),f=(h=Z[s].options)!==null&&h!==void 0?h:f),f.size=(f==null?void 0:f.size)||lt,[4,ur(s)];case 1:return c=l.sent(),d=new fr(c,f),[4,d.load()];case 2:return l.sent(),[2,d]}})})}var sr=function(){function p(s,f){this.modelJson=s,this.weightDataBase64=f}return p.prototype.arrayBufferFromBase64=function(s){for(var f=pt.Buffer.from(s,"base64").toString("binary"),c=f.length,d=new Uint8Array(c),h=0;h<c;h++)d[h]=f.charCodeAt(h);return d.buffer},p.prototype.load=function(){return M(this,void 0,void 0,function(){var s,f,c,d,h,l,i,w,y,g,B,_,A,R;return D(this,function(k){if(s={modelTopology:this.modelJson.modelTopology,format:this.modelJson.format,generatedBy:this.modelJson.generatedBy,convertedBy:this.modelJson.convertedBy},this.modelJson.weightsManifest!=null){for(f=[],c=[],d=0,h=this.modelJson.weightsManifest;d<h.length;d++){for(l=h[d],i=0,w=l.paths;i<w.length;i++){if(y=w[i],g=this.weightDataBase64[y],!g)throw new Error("Could not find the weight data. Make sure you are importing the correct weight bundle for the model: ".concat(y,".min.js."));B=this.arrayBufferFromBase64(g),c.push(new Uint8Array(B))}f.push.apply(f,l.weights)}for(s.weightSpecs=f,_=new Uint8Array(c.reduce(function(z,J){return z+J.length},0)),A=0,R=0;R<c.length;R++)_.set(c[R],A),A+=c[R].byteLength;s.weightData=_.buffer}return this.modelJson.trainingConfig!=null&&(s.trainingConfig=this.modelJson.trainingConfig),this.modelJson.userDefinedMetadata!=null&&(s.userDefinedMetadata=this.modelJson.userDefinedMetadata),[2,s]})})},p}(),fr=function(){function p(s,f){this.intermediateModels={},this.options=f,this.normalizationOffset=zt(255),this.urlOrIOHandler=s,typeof s=="string"&&!s.startsWith("indexeddb://")&&!s.startsWith("localstorage://")&&!s.endsWith("model.json")?this.urlOrIOHandler="".concat(s,"model.json"):this.urlOrIOHandler=s}return p.prototype.load=function(){return M(this,void 0,void 0,function(){var s,f,c,d,h,l,i=this;return D(this,function(w){switch(w.label){case 0:return s=this.options,f=s.size,c=s.type,c!=="graph"?[3,2]:(d=this,[4,vt(this.urlOrIOHandler)]);case 1:return d.model=w.sent(),[3,4];case 2:return h=this,[4,$t(this.urlOrIOHandler)];case 3:h.model=w.sent(),this.endpoints=this.model.layers.map(function(y){return y.name}),w.label=4;case 4:return l=ct(function(){return i.model.predict(Ot([1,f,f,3]))}),[4,l.data()];case 5:return w.sent(),l.dispose(),[2]}})})},p.prototype.infer=function(s,f){var c=this;if(f!=null&&this.endpoints.indexOf(f)===-1)throw new Error("Unknown endpoint ".concat(f,". Available endpoints: ").concat(this.endpoints,"."));return ct(function(){s instanceof jt||(s=Jt(s));var d=s.toFloat().div(c.normalizationOffset),h=d,l=c.options.size;if(s.shape[0]!==l||s.shape[1]!==l){var i=!0;h=Wt.resizeBilinear(d,[l,l],i)}var w=h.reshape([1,l,l,3]),y;if(f==null)y=c.model;else{if(c.model.hasOwnProperty("layers")&&c.intermediateModels[f]==null){var g=c.model.layers.find(function(B){return B.name===f});c.intermediateModels[f]=Vt({inputs:c.model.inputs,outputs:g.output})}y=c.intermediateModels[f]}return y.predict(w)})},p.prototype.classify=function(s){return M(this,arguments,void 0,function(f,c){var d,h;return c===void 0&&(c=5),D(this,function(l){switch(l.label){case 0:return d=this.infer(f),[4,ar(d,c)];case 1:return h=l.sent(),d.dispose(),[2,h]}})})},p}();function ar(p,s){return M(this,void 0,void 0,function(){var f,c,i,d,h,i,l,i;return D(this,function(w){switch(w.label){case 0:return[4,p.data()];case 1:for(f=w.sent(),c=[],i=0;i<f.length;i++)c.push({value:f[i],index:i});for(c.sort(function(y,g){return g.value-y.value}),d=new Float32Array(s),h=new Int32Array(s),i=0;i<s;i++)d[i]=c[i].value,h[i]=c[i].index;for(l=[],i=0;i<h.length;
7i++)l.push({className:tr[h[i]],probability:d[i]});return[2,l]}})})}export{fr as NSFWJS,Br as load};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.