1function f(t){if(t>=0)return 1/(1+Math.exp(-t));const n=Math.exp(t);return n/(1+n)}function u(t,n){let s=0;const r=Math.min(t.length,n.length);for(let e=0;e<r;e++)s+=t[e]*n[e];return s}function m(t,n){return f(u(t.weights,n)+t.bias)}function d(t,n){const s=t.classes.map((a,o)=>u(t.weights[o],n)+t.biases[o]),r=Math.max(...s);let e=0;const c=s.map(a=>{const o=Math.exp(a-r);return e+=o,o}),i={};return t.classes.forEach((a,o)=>{i[a]=e>0?c[o]/e:0}),i}function S(t){let n=null,s=-1/0;for(const[r,e]of Object.entries(t))e>s&&(s=e,n=r);return{label:n,score:Number.isFinite(s)?s:0}}const h=["search","feed","direct","link"],l=["intent_learn","intent_create","intent_play","intent_socialize","intent_relax","intent_news","intent_task","intent_doomscroll"],p=["article","video-detail","product","reference","tool","feed"],b=[...h.map(t=>`nav:${t}`),...l.map(t=>`intent:${t}`),"sessionIntentConfidence","socialLevel","behavior:rapid-context-switch","behavior:short-burst-loop",...p.map(t=>`primary:${t}`)];function _(t){var a;const n=t||{},s=((a=n.navSource)==null?void 0:a.origin)||"",r=n.sessionIntent||n.intent||"",e=new Set(Array.isArray(n.behaviorSignals)?n.behaviorSignals:[]),c=n.primaryContentKind||"",i=[];for(const o of h)i.push(s===o?1:0);for(const o of l)i.push(r===o?1:0);i.push(typeof n.sessionIntentConfidence=="number"?Math.max(0,Math.min(1,n.sessionIntentConfidence)):0),i.push(typeof n.socialLevel=="number"?Math.max(0,Math.min(3,n.socialLevel))/3:0),i.push(e.has("rapid-context-switch")?1:0),i.push(e.has("short-burst-loop")?1:0);for(const o of p)i.push(c===o?1:0);return i}b.length;export{b as S,S as a,_ as b,m as c,u as d,d as p,f as s};
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.