!function(){var t,e,n,r,o,i,a,s,c={495:function(){},7147:function(){},1418:function(){},3380:function(){},319:function(){},8386:function(){},3342:function(){},4549:function(t,e,n){"use strict";var r=n(552);async function o(t){let e;try{e=await caches.open("image-database");let n=await e.match(t);if(n)return await n.arrayBuffer()}catch(t){console.warn("Unable to open cache",t)}let n=await fetch(t),r=await n.arrayBuffer();if(e)try{await e.put(t,new Response(r,{headers:n.headers}))}catch(t){console.warn("Unable to cache file",t)}return r}async function i(t){let e=await o(t);return JSON.parse(new TextDecoder("utf-8").decode(e))}r.OBj.allowLocalModels=!1;class a{static async getInstance(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return null===this.tokenizer&&(this.tokenizer=r.t25.from_pretrained(this.model_id,{progress_callback:t})),null===this.text_model&&(this.text_model=r.v3$.from_pretrained(this.model_id,{progress_callback:t})),null===this.metadata&&(this.metadata=i(this.BASE_URL+"image-embeddings.json")),null===this.embeddings&&(this.embeddings=new Promise((t,e)=>{o(this.BASE_URL+"image-embeddings_25k-512-32bit.bin").then(e=>{t(new Float32Array(e))}).catch(e)})),Promise.all([this.tokenizer,this.text_model,this.metadata,this.embeddings])}}a.model_id="Xenova/clip-vit-base-patch16",a.BASE_URL="https://huggingface.co/datasets/Xenova/semantic-image-search-assets/resolve/main/",a.tokenizer=null,a.text_model=null,a.metadata=null,a.embeddings=null,self.addEventListener("message",async t=>{let[e,n,r,o]=await a.getInstance(self.postMessage);self.postMessage({status:"ready"});let i=e(t.data.text,{padding:!0,truncation:!0}),{text_embeds:s}=await n(i),c=function(t,e){let n=e.length/512,r=Array(n);for(let o=0;oe.score-t.score),u=u.slice(0,100),self.postMessage({status:"complete",output:u})})}},u={};function l(t){var e=u[t];if(void 0!==e)return e.exports;var n=u[t]={exports:{}},r=!0;try{c[t](n,n.exports,l),r=!1}finally{r&&delete u[t]}return n.exports}l.m=c,l.x=function(){var t=l.O(void 0,[15,990],function(){return l(4549)});return l.O(t)},t=[],l.O=function(e,n,r,o){if(n){o=o||0;for(var i=t.length;i>0&&t[i-1][2]>o;i--)t[i]=t[i-1];t[i]=[n,r,o];return}for(var a=1/0,i=0;i=o&&Object.keys(l.O).every(function(t){return l.O[t](n[c])})?n.splice(c--,1):(s=!1,o