PageSourceSearch

https://dealerhub.360rain.com/assets/InlineKnowledgeSearch-D6i2QuXA.js

js 360rain.com collected 2026-10-02 15:00:28 UTC 3,978 bytes, 1 lines download raw bytes

1(function(){try{var e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`ebe00ad9-f8a8-40db-ae57-22b8a47f645b`,e._sentryDebugIdIdentifier=`sentry-dbid-ebe00ad9-f8a8-40db-ae57-22b8a47f645b`)}catch{}})();import{a as e}from"./rolldown-runtime-eil0g4P7.js";import{Af as t,Bf as n,Bo as r,Br as i,Is as a,Ml as o,Oc as s,Yp as c,ml as l,or as u}from"./icons-DpkGVEtF.js";import{At as d,Pt as f,at as p,n as m,nt as h,p as g}from"./login-shell-shared-B1ZmoKZI.js";import{t as _}from"./badge-BpDlzPjV.js";var v=e(c(),1),y=f(),b={event_code:`bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-300`,article:`bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-300`,media_asset:`bg-sky-100 text-sky-800 dark:bg-sky-900 dark:text-sky-300`,diagnostic_tree:`bg-amber-100 text-amber-800 dark:bg-amber-900 dark:text-amber-300`,exploded_view:`bg-pink-100 text-pink-800 dark:bg-pink-900 dark:text-pink-300`,order_guide:`bg-lime-100 text-lime-800 dark:bg-lime-900 dark:text-lime-300`,schematic:`bg-teal-100 text-teal-800 dark:bg-teal-900 dark:text-teal-300`,service_kit:`bg-emerald-100 text-emerald-800 dark:bg-emerald-900 dark:text-emerald-300`,update_kit:`bg-cyan-100 text-cyan-800 dark:bg-cyan-900 dark:text-cyan-300`},x={event_code:l,article:n,media_asset:l,diagnostic_tree:s,exploded_view:a,order_guide:r,schematic:o,service_kit:t,update_kit:i};function S(e){return e.split(`_`).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `)}function C({onSelect:e,filterTypes:t,excludeIds:n=[],placeholder:r=`Search by title...`,className:i}){let[a,o]=(0,v.useState)(``),[s,c]=(0,v.useState)(!1),f=(0,v.useRef)(null),{data:C=[],isLoading:w}=d({queryKey:[`/api/knowledge`,`inline-search`,a,t,n],queryFn:async()=>{let e=`/api/knowledge?limit=10`;return a&&(e+=`&search=${encodeURIComponent(a)}`),t&&t.length>0&&(e+=`&type=${t.join(`,`)}`),n.length&&(e+=`&exclude_ids=${n.join(`,`)}`),g.get(e)},enabled:a.length>0,staleTime:3e4}),T=(0,v.useMemo)(()=>C.filter(e=>!n.includes(e.id)),[C,n]);return(0,v.useEffect)(()=>{let e=e=>{f.current&&!f.current.contains(e.target)&&c(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[]),(0,y.jsxs)(`div`,{ref:f,className:p(`relative w-full`,i),children:[(0,y.jsxs)(`div`,{className:`relative`,children:[(0,y.jsx)(u,{className:`absolute top-2.5 left-2.5 h-4 w-4 text-muted-foreground`}),(0,y.jsx)(m,{value:a,onChange:e=>{o(e.target.value),c(!0)},onFocus:()=>c(!0),placeholder:r,className:`pl-9`,"data-testid":`inline-knowledge-search-input`})]}),s&&a.length>0&&(0,y.jsx)(`div`,{className:`absolute z-floating mt-1 w-full rounded-md border bg-popover text-popover-foreground shadow-md outline-hidden animate-in fade-in-0 zoom-in-95`,children:(0,y.jsx)(`div`,{className:`max-h-[300px] overflow-y-auto p-1`,children:w?(0,y.jsx)(`div`,{className:`flex items-center justify-center py-6`,children:(0,y.jsx)(h,{className:`h-5 w-5 text-muted-foreground`})}):T.length===0?(0,y.jsx)(`div`,{className:`py-6 text-center text-sm text-muted-foreground`,children:`No objects found.`}):(0,y.jsx)(`div`,{className:`space-y-1`,children:T.map(t=>{let n=x[t.object_type]||l;return(0,y.jsxs)(`button`,{onClick:()=>{e(t.id),o(``),c(!1)},className:`flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-left text-sm transition-colors hover:bg-accent hover:text-accent-foreground`,children:[(0,y.jsx)(n,{className:`h-4 w-4 shrink-0 text-muted-foreground`}),(0,y.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,y.jsx)(`p`,{className:`truncate font-medium`,children:t.title}),(0,y.jsxs)(`div`,{className:`mt-0.5 flex items-center gap-2`,children:[(0,y.jsx)(_,{className:p(`h-3.5 px-1 text-[9px]`,b[t.object_type]),children:S(t.object_type)}),(0,y.jsx)(`span`,{className:`label-mono text-[10px] text-muted-foreground`,children:t.status})]})]})]},t.id)})})})})]})}export{C 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.