1import{ft as e,pt as t}from"./BV8iRfWI.js";var n=400,r=t(!1),i=t(!1),a=t(null),o=t(0),s=null,c=0,l=new Map,u=new Map,d=null;function f(){return s||(s=new Worker(new URL(new URL(`search.worker-BMUmL_r6.js`,import.meta.url).href,``+import.meta.url),{type:`module`}),s.onmessage=e=>{let{id:t,result:n,error:r}=e.data||{},i=l.get(t);i&&(l.delete(t),r?i.reject(Error(r)):i.resolve(n))},s.onerror=e=>{console.error(`Search worker error`,e)}),s}function p(e,t){let n=f();if(!n)return Promise.resolve(null);let r=c++;return new Promise((i,a)=>{l.set(r,{resolve:i,reject:a}),n.postMessage({id:r,op:e,payload:t})})}var m=()=>{async function t(e){e&&(a.value===e&&r.value||(d&&await d,!(a.value===e&&r.value)&&(d=(async()=>{i.value=!0;try{a.value&&a.value!==e&&(await p(`destroy`),r.value=!1),await p(`init`,{businessid:e}),a.value=e,r.value=!0}catch(e){console.error(e),r.value=!1}finally{i.value=!1}})(),await d,d=null)))}function s(e){r.value&&(clearTimeout(u.get(e)),u.set(e,setTimeout(()=>{u.delete(e),p(`reindex`,{type:e}).then(()=>{o.value++}).catch(e=>console.error(e))},n)))}function c(){if(!r.value)return;let e=`__context__`;clearTimeout(u.get(e)),u.set(e,setTimeout(()=>{u.delete(e),p(`reindex-context`).then(()=>{o.value++}).catch(e=>console.error(e))},n))}async function l(e,{types:t,limit:n=30}={}){if(!r.value)return[];try{return await p(`query`,{businessid:a.value,query:e,types:t,limit:n})}catch(e){return console.error(e),[]}}async function f(){u.forEach(e=>clearTimeout(e)),u.clear();try{await p(`destroy`)}catch(e){console.error(e)}a.value=null,r.value=!1}return{ready:e(r),indexing:e(i),boundBusinessId:e(a),version:e(o),ensureIndex:t,reindex:s,reindexAccounts:c,search:l,teardown:f}},h={"application/pdf":`file-bundled`,"text/csv":`file-data`,"application/vnd.ms-excel":`file-data`,"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":`file-data`,"application/vnd.oasis.opendocument.spreadsheet":`file-data`,"image/png":`file-image`,"image/jpeg":`file-image`,"image/gif":`file-image`,"image/svg+xml":`file-image`,"image/webp":`file-image`,"image/bmp":`file-image`,"text/plain":`file-text`,"text/markdown":`file-text`,"text/html":`file-text`,"application/rtf":`file-text`};function g(e){return e?h[e]?h[e]:e.startsWith(`image/`)?`file-image`:e.startsWith(`text/`)?`file-text`:`file`:`file`}function _(e){return e<1024?e+` B`:e<1048576?(e/1024).toFixed()+` KB`:(e/1048576).toFixed()+` MB`}export{g as n,m as r,_ as t};
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.