PageSourceSearch

https://kindredly.ai/js/search-provider.utilsBiOzVtNa.js

js kindredly.ai collected 2026-10-02 01:14:05 UTC 3,756 bytes, 1 lines download raw bytes

1import{R as m,S as h}from"./OperationQueueKzEpmh-u.js";const o=[{id:"google",displayName:"Google",matchesHostname:e=>/(^|\.)google\.[a-z.]{2,}$/.test(e),matchesLookupHostname:e=>/^(www\.)?google\.[a-z.]{2,}$/.test(e),getPageState:(e,a)=>{const r=(e.pathname||"").toLowerCase();return(r==="/"||r==="/webhp")&&!a?"homepage":r==="/search"||a&&r==="/"?"results":"other"},queryParamNames:["q"],searchPath:"/search?q={q}",homepageUrl:"https://www.google.com",iconName:"globe"},{id:"duckduckgo",displayName:"DuckDuckGo",matchesHostname:e=>e==="duckduckgo.com"||e==="www.duckduckgo.com"||e==="ddg.gg",getPageState:(e,a)=>{const r=(e.pathname||"").toLowerCase();return(r==="/"||r==="")&&!a?"homepage":a?"results":"other"},queryParamNames:["q"],searchPath:"/?q={q}",homepageUrl:"https://duckduckgo.com",iconName:"shield"},{id:"bing",displayName:"Bing",matchesHostname:e=>e==="bing.com"||e==="www.bing.com",getPageState:(e,a)=>{const r=(e.pathname||"").toLowerCase();return(r==="/"||r==="")&&!a?"homepage":r==="/search"||a?"results":"other"},queryParamNames:["q"],searchPath:"/search?q={q}",homepageUrl:"https://www.bing.com",iconName:"search"},{id:"brave",displayName:"Brave",matchesHostname:e=>e==="search.brave.com",getPageState:(e,a)=>{const r=(e.pathname||"").toLowerCase();return(r==="/"||r==="")&&!a?"homepage":r==="/search"||a?"results":"other"},queryParamNames:["q"],searchPath:"/search?q={q}",homepageUrl:"https://search.brave.com",iconName:"shield-shaded"},{id:"ecosia",displayName:"Ecosia",matchesHostname:e=>e==="ecosia.org"||e==="www.ecosia.org",getPageState:(e,a)=>{const r=(e.pathname||"").toLowerCase();return(r==="/"||r==="")&&!a?"homepage":r==="/search"||a?"results":"other"},queryParamNames:["q"],searchPath:"/search?q={q}",homepageUrl:"https://www.ecosia.org",iconName:"tree"}];function l(e,a){for(const r of a){const t=(e.searchParams.get(r)||"").trim();if(t)return t}return null}function N(e){if(!e)return null;let a;try{a=new URL(e)}catch{return null}const r=a.hostname.toLowerCase(),t=o.find(c=>c.matchesHostname(r));if(!t)return null;const n=l(a,t.queryParamNames);return{id:t.id,displayName:t.displayName,hostname:r,pageState:t.getPageState(a,n),query:n}}function i(e){return o.find(a=>a.id===e)||null}function U(e){const a=i(e);return a?`${a.homepageUrl}${a.searchPath}`:""}function k(e,a){const r=i(e);return r?p(r.homepageUrl,r.searchPath,a):""}function I(){return o.map(e=>({id:e.id,displayName:e.displayName,iconName:e.iconName,homepageUrl:e.homepageUrl}))}const u={id:"wikipedia",role:"reference",displayName:"Wikipedia",iconName:"book",homepageUrl:"https://en.wikipedia.org",kindId:m,matchesHostname:e=>/(^|\.)wikipedia\.org$/.test(e),searchPath:"/w/index.php?search={q}"},s=[...o.map(e=>({id:e.id,role:"engine",displayName:e.displayName,iconName:e.iconName,homepageUrl:e.homepageUrl,kindId:h,matchesHostname:e.matchesLookupHostname||e.matchesHostname,searchPath:e.searchPath})),u];function y(){return s}function g(e){return s.find(a=>a.id===e)||null}function L(){return[h,m]}function q(e){if(!e)return null;let a;try{a=new URL(e)}catch{return null}if(a.protocol!=="http:"&&a.protocol!=="https:")return null;const r=a.hostname.toLowerCase();return s.find(t=>t.matchesHostname(r))||null}function d(e,a,r={}){const t=g(e);return t?p(P(t,r.origin),t.searchPath,a):""}function P(e,a){if(!a)return e.homepageUrl;try{const r=new URL(a);return r.protocol!=="http:"&&r.protocol!=="https:"||!e.matchesHostname(r.hostname.toLowerCase())?e.homepageUrl:r.origin}catch{return e.homepageUrl}}function p(e,a,r){return`${e}${a.replace("{q}",encodeURIComponent(r||""))}`}const w=`${u.homepageUrl}/`;function S(e,a={}){const r=(e||"").trim();return r?d("wikipedia",r,a):w}export{y as a,k as b,L as c,N as d,d as e,i as f,U as g,S as h,I as l,q 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.