1import{r as b}from"./item-name.utilsBH3paGZr.js";function g(t){return t.replace(/\s+/g," ").replace(/\n+/g,` 2`).trim()}function T(t){const n=[];return t.title&&n.push(t.title),t.description&&n.push(t.description),t.notes&&n.push(t.notes),t.tags&&t.tags.length>0&&n.push(t.tags.join(" ")),g(n.join(` 3`))}function C(t){return T({title:b({name:t.name,meta:t.meta,info:t.info})||void 0,description:t.description??void 0,tags:t.tags??void 0})}function j(t){const n=[];if(t.title&&n.push(t.title),t.description&&n.push(t.description),t.keywords&&t.keywords.length>0){const e=t.keywords.filter(r=>typeof r=="string"&&r.trim().length>0).join(" ");e&&n.push(e)}return t.url&&n.push(t.url),g(n.join(` 4`))}async function A(t){const n=new TextEncoder().encode(t),e=await crypto.subtle.digest("SHA-256",n);return Array.from(new Uint8Array(e)).map(r=>r.toString(16).padStart(2,"0")).join("")}function I(t,n){if(t.length!==n.length||t.length===0)return 0;let e=0,r=0,o=0;for(let s=0;s<t.length;s++)e+=t[s]*n[s],r+=t[s]*t[s],o+=n[s]*n[s];const i=Math.sqrt(r)*Math.sqrt(o);return i===0?0:e/i}function y(t){const n=Math.sqrt(t.reduce((e,r)=>e+r*r,0));return n===0?t:t.map(e=>e/n)}function M(t){if(t.length===0)return[];const n=t[0].length,e=new Array(n).fill(0);for(const r of t)for(let o=0;o<n;o++)e[o]+=r[o];return e.map(r=>r/t.length)}function P(t,n=512,e=50){const o=Number.isFinite(n)?Math.max(1,Math.floor(n)):512,i=Number.isFinite(e)?Math.max(0,Math.floor(e)):0,s=o*4,m=Math.min(i*4,Math.max(0,s-1));if(t.length<=s)return[t];const l=[];let h=0,c=0;for(;h<t.length;){if(c++,c>1e4){console.warn("chunkText: aborted after too many chunks; check maxTokens/overlap settings");break}const f=Math.min(h+s,t.length);let a=t.substring(h,f);if(f<t.length){const k=a.lastIndexOf("."),x=a.lastIndexOf(` 5`),d=Math.max(k,x);d>s*.7&&(a=a.substring(0,d+1))}const u=a.trim();u.length>0&&l.push(u);const p=Math.max(1,a.length-m);h+=p}return l}function E(t){return y(M(t))}function O(t){let n=5381;for(let e=0;e<t.length;e++)n=(n<<5)+n+t.charCodeAt(e),n=n&n;return n.toString(36)}function S(t,n){const e=[];for(let r=0;r<t.length;r+=n)e.push(t.slice(r,r+n));return e}export{A as a,C as b,I as c,g as d,T as e,P as f,E as g,O as h,S as i,j,M as m};
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.