PageSourceSearch

https://polyblink.com/build/assets/OrderSpotlightSearch-CbSLpL4k.js

js polyblink.com collected 2026-10-02 01:41:25 UTC 4,741 bytes, 1 lines download raw bytes

1import{u as A,aw as I,V as K,U as N,Z as n,j as O,b as x,aA as B,l,aE as P,q as j,i as e,aB as F,at as G,ai as d,F as M,a2 as D,P as z,aa as v,k,a1 as _,g as L,O as H}from"./vendor-vue-DO5-hTFl.js";import{u as W}from"./useEventSearch-B_cezGjC.js";import{_ as Z}from"./_plugin-vue_export-helper-DlAUqK2U.js";const J={class:"spot__card",role:"dialog","aria-label":"Search"},Q={class:"spot__input-row"},X={class:"spot__body"},Y={key:0,class:"spot__status"},ee={key:1,class:"spot__status"},te={key:2,class:"spot__group"},oe=["onMouseenter","onClick"],se={class:"spot__item-icon"},ne=["src"],le={key:1,width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},ae={class:"spot__item-text"},ie={key:3,class:"spot__status"},re={key:4,class:"spot__group"},ue={class:"spot__chips"},pe=["onClick"],ce=A({__name:"OrderSpotlightSearch",setup(de){const c=_(!1),i=_(""),a=_(0),w=_(null),{results:T,loading:R,errored:U,retry:y,reset:h}=W(i,{limit:8}),V=[{key:"politics",label:"Politics"},{key:"crypto",label:"Crypto"},{key:"sports",label:"Sports"},{key:"tech",label:"Tech"},{key:"world",label:"World"},{key:"culture",label:"Culture"}],p=L(()=>i.value.trim()===""),r=L(()=>T.value);I(r,()=>{a.value=0});function g(){c.value=!0,i.value="",a.value=0,h(),H(()=>w.value?.focus())}function u(){c.value=!1,i.value="",h()}function m(o){u(),typeof window<"u"&&window.location.assign(`/event/${o}`)}function $(o){u(),typeof window<"u"&&window.location.assign(`/markets?cat=${o}`)}function b(){const o=i.value.trim();if(o&&(u(),typeof window<"u")){const t=new URL("/markets",window.location.origin);t.searchParams.set("q",o),window.location.assign(t.toString())}}function C(o){if(c.value){if(o.key==="Escape"){o.preventDefault(),u();return}if(!p.value&&r.value.length>0){if(o.key==="ArrowDown")o.preventDefault(),a.value=(a.value+1)%r.value.length;else if(o.key==="ArrowUp")o.preventDefault(),a.value=(a.value-1+r.value.length)%r.value.length;else if(o.key==="Enter"){o.preventDefault();const t=r.value[a.value];t?m(t.slug):b()}}else o.key==="Enter"&&(o.preventDefault(),b())}}function E(o){(o.metaKey||o.ctrlKey)&&o.key.toLowerCase()==="k"&&(o.preventDefault(),c.value?u():g())}function S(){g()}return K(()=>{window.addEventListener("keydown",E),window.addEventListener("pm:search:open",S)}),N(()=>{window.removeEventListener("keydown",E),window.removeEventListener("pm:search:open",S)}),(o,t)=>(n(),O(x,{name:"spot-fade"},{default:B(()=>[c.value?(n(),l("div",{key:0,class:"spot",onClick:P(u,["self"]),onKeydown:C},[j(x,{name:"spot-pop",appear:""},{default:B(()=>[e("div",J,[e("div",Q,[t[2]||(t[2]=e("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e("circle",{cx:"11",cy:"11",r:"7"}),e("path",{d:"m21 21-4.35-4.35"})],-1)),F(e("input",{ref_key:"inputRef",ref:w,"onUpdate:modelValue":t[0]||(t[0]=s=>i.value=s),type:"text",class:"spot__input",placeholder:"Search markets, events, tags...",autocomplete:"off",spellcheck:"false",onKeydown:C},null,544),[[G,i.value]]),e("button",{type:"button",class:"spot__esc",onClick:u},"Esc")]),e("div",X,[!p.value&&d(R)?(n(),l("div",Y,[...t[3]||(t[3]=[e("span",{class:"spot__spinner","aria-hidden":"true"},null,-1),e("p",null,"Searching…",-1)])])):!p.value&&d(U)?(n(),l("div",ee,[t[4]||(t[4]=e("p",null,"Something went wrong.",-1)),e("button",{type:"button",class:"spot__retry",onClick:t[1]||(t[1]=(...s)=>d(y)&&d(y)(...s))},"Retry")])):!p.value&&r.value.length>0?(n(),l("div",te,[t[7]||(t[7]=e("div",{class:"spot__group-title"},"Matches",-1)),(n(!0),l(M,null,D(r.value,(s,f)=>(n(),l("button",{key:s.slug,type:"button",class:z(["spot__item",{"spot__item--active":f===a.value}]),onMouseenter:q=>a.value=f,onClick:q=>m(s.slug)},[e("span",se,[s.icon||s.image?(n(),l("img",{key:0,src:s.icon||s.image,alt:""},null,8,ne)):(n(),l("svg",le,[...t[5]||(t[5]=[e("path",{d:"M3 3v18h18"},null,-1),e("path",{d:"m19 9-5 5-4-4-3 3"},null,-1)])]))]),e("span",ae,[e("strong",null,v(s.title),1),e("span",null,v(s.category),1)]),t[6]||(t[6]=e("svg",{class:"spot__item-arrow",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"},[e("path",{d:"M7 17 17 7M17 7H8M17 7v9"})],-1))],42,oe))),128))])):p.value?k("",!0):(n(),l("div",ie,[e("p",null,'No results for "'+v(i.value.trim())+'"',1)])),p.value?(n(),l("div",re,[t[8]||(t[8]=e("div",{class:"spot__group-title"},"Browse categories",-1)),e("div",ue,[(n(),l(M,null,D(V,s=>e("button",{key:s.key,type:"button",class:"spot__chip",onClick:f=>$(s.key)},v(s.label),9,pe)),64))])])):k("",!0)])])]),_:1})],32)):k("",!0)]),_:1}))}}),ke=Z(ce,[["__scopeId","data-v-299e48fe"]]);export{ke as default};

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.