PageSourceSearch

https://www.palloliitto.fi/_next/static/chunks/1852-e902ebb0f1bc8a5f.js

js palloliitto.fi collected 2026-10-02 07:26:41 UTC 7,541 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1852],{44139:(e,t,s)=>{"use strict";s.d(t,{SiteSearch:()=>P});var l=s(11832),i=s(99033),r=s(35649),a=s(30600),n=s(7577),c=s(41229),o=s(49866),h=s(37543),d=s(68394),g=s(80295),p=s(44306),u=s(99721),m=s(44613),f=s(48656),b=s(57812),v=s(3813),x=s(47678),y=s(37413),_=s(26846),j=s(95211);function k(e){let{preTag:t,postTag:s,highlightedValue:l}=e,i=l.split(t),r=i.shift(),a=""===r?[]:[{value:r,isHighlighted:!1}];if(s===t){let e=!0;i.forEach(t=>{a.push({value:t,isHighlighted:e}),e=!e})}else i.forEach(e=>{let t=e.split(s);a.push({value:t[0],isHighlighted:!0}),""!==t[1]&&a.push({value:t[1],isHighlighted:!1})});return a}function w(e){let t,{collection:s,hit:i,label:r}=e,a=function(e){let{preTag:t="<mark>",postTag:s="</mark>",hit:l}=e;return l.highlights.map(e=>e.snippet?k({preTag:t,postTag:s,highlightedValue:e.snippet}):e.snippets?e.snippets.flatMap(e=>k({preTag:t,postTag:s,highlightedValue:e})):void 0)}({hit:i}),n="",o="",h="grey",d="";switch(s){case"html_pages":{let{hero_title:e,page_path:s,pageType:l,firstPublishedAt:r}=i.document;"string"==typeof e&&(n=e);let{theme:a,label:c}=(0,j.e)(l);h=a,d=c,o=s,t=r&&(0,_.S)(r);break}case"gatsbypages":{let{hero_title:e,page_path:s,pageType:l,firstPublishedAt:r}=i.document;"string"==typeof e&&(n=e);let{theme:a,label:c}=(0,j.e)(l);h=a,d=c,o=s,t=r&&(0,_.S)(r);break}case"newsarchive":{let{title:e,slug:s,created_ts:l}=i.document;"string"==typeof e&&(n=e),d=r,o="https://uutisarkisto.palloliitto.fi/".concat(s),t=l;let a=new Date(1e3*l);t=(0,_.S)(a.toISOString(),!1)}}let g=0,p=!1,u=a.reduce((e,t)=>{if(!t||g>360&&p)return e;for(let s of t){if(s.isHighlighted&&(p=!0),"string"!=typeof s.value)continue;let t={isHighlighted:s.isHighlighted,value:s.value};g<=360&&e.push(t),g+=s.value.length}return e},[]);return(0,l.jsx)("div",{className:"flex flex-col gap-2 border-b border-grey-500 py-4",children:(0,l.jsxs)(y.LinkWrapper,{className:"grid-breakable gap-y-4 py-8",href:o,children:[(0,l.jsx)("p",{className:"font-display font-bold md:text-d-lg text-blue-500",children:n}),(0,l.jsx)("p",{className:"text-sm",children:t}),(0,l.jsx)("p",{children:u.map((e,t)=>{let s=e.value+t;return(0,l.jsx)("span",{className:(0,f.A)(e.isHighlighted&&"bg-gr-blue-200 p-1 font-bold "),children:e.value},s)})}),(0,l.jsx)("div",{children:(0,l.jsx)(c.Pill,{label:d,theme:h,size:"xs"})})]})},i.document.id)}let P=e=>{let{serverContext:t,searchPageData:s,siteSearchIcons:i,siteSearchMicrocopy:r,archiveInfo:a}=e;return(0,l.jsx)(d.SearchBarProvider,{children:(0,l.jsx)(C,{searchPageData:s,serverContext:t,siteSearchIcons:i,siteSearchMicrocopy:r,archiveInfo:a})})},S=["all","news","pages","archive"],N={all:"html_pages",news:"html_pages",pages:"html_pages",archive:"newsarchive"},C=e=>{let{searchPageData:t,serverContext:s,siteSearchMicrocopy:y,siteSearchIcons:_,archiveInfo:j}=e,{delayedSearchTerm:k,setDelayedSearchTerm:P,setSearchTerm:C,hasFocus:E,searchTerm:T}=(0,d.V)(),{width:q}=(0,g.l)(),{siteSearchCategoryAll:H,siteSearchCategoryNews:O,siteSearchCategoryPages:R,siteSearchCategoryArchive:I,siteSearchInputPlaceholder:M,siteSearchLoadingResults:A,siteSearchNoResults:z,siteSearchNoResultsReset:F}=y,{datoIconInfo:V,datoLoadingIcon:D}=_,[J,K]=(0,b.useState)(S[0]),[Y,B]=(0,b.useState)(1),[L,U]=(0,b.useState)(!1),W=(0,b.useRef)(null),X=function(e){let{body:t,block:s}=e,{NEXT_PUBLIC_TYPESENSE_PROTOCOL:l,NEXT_PUBLIC_TYPESENSE_HOST:i,NEXT_PUBLIC_TYPESENSE_API_KEY_READ_ONLY:r}=(0,v.o)();return(0,x.s)({url:"".concat(l,"://").concat(i,"/multi_search"),options:{method:"POST",headers:{"X-TYPESENSE-API-KEY":r},body:JSON.stringify(t)},block:s})}({body:(0,b.useMemo)(()=>{if(k)switch(J){case"all":case"news":case"pages":{let e="locale:=['".concat(s.locale,"']");switch(J){case"pages":e+="&& pageType:!=['article']";break;case"news":e+="&& pageType:=['article']"}return{searches:[{query_by:"hero_title,seo_title,seo_description,h2,h3,h4,h5,h6,text",filter_by:e,facet_by:"locale,pageType",highlight_full_fields:"hero_title,seo_title,seo_description,h2,h3,h4,h5,h6,text",collection:"html_pages",q:k,page:Y,per_page:6,sort_by:"firstPublishedAt:desc,_text_match:desc"}]}}case"archive":return{searches:[{query_by:"title, ingress, body",query_by_weights:"3,1,2",sort_by:"created_ts:desc,_text_match:desc",highlight_affix_num_tokens:10,highlight_full_fields:"title, ingress, body",collection:"newsarchive",q:k,facet_by:"",page:Y,per_page:6}]}}},[k,J,Y,s.locale]),block:"string"!=typeof k||0===k.length}),G=null==X?void 0:X.results[0],Q=(null==G?void 0:G.hits.length)===0&&!L,Z=null==G?void 0:G.found,$=G&&!L,ee=Z&&Z/6>1&&$,et="number"==typeof q&&q>p.m.sm||!T&&!E;return(0,b.useEffect)(()=>{let e=(0,u.k)("category"),t=(0,u.k)("q");"string"==typeof e&&S.includes(e)&&K(e),t&&(C(t),P(t))},[]),(0,b.useEffect)(()=>{k&&(0,m.M)({params:[["q",k]]}),B(1)},[k]),(0,b.useEffect)(()=>{!k||X||L||U(!0),L&&X&&setTimeout(()=>{U(!1)},1e3)},[k,X,L]),(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(i.FilterRow,{children:[(0,l.jsx)("div",{className:"w-full flex flex-wrap gap-2 justify-center mt-2",children:S.map(e=>{let t="searchType".concat(e),s="";switch(e){case"all":s=H;break;case"news":s=O;break;case"pages":s=R;break;case"archive":s=I}return(0,l.jsx)(c.Pill,{size:"md",theme:"gr-green",label:s,selected:J===e,onClick:()=>{K(e),(0,m.M)({params:[["category",e]]}),B(1)}},t)})}),"archive"===J&&(0,l.jsx)("div",{className:"mt-2 text-center",children:j})]}),(0,l.jsx)(i.FilterRow,{children:(0,l.jsx)(h.I,{placeholder:M,onReset:()=>(0,m.M)({params:[["q"]]})})}),et&&(0,l.jsx)(i.FilterRow,{children:(0,l.jsx)("div",{className:"w-full flex flex-wrap gap-2 justify-center mt-2",children:t.recommendations.map(e=>{let{term:t}=e,s="searchPageRecommendationPill".concat(t);return(0,l.jsx)(c.Pill,{size:"md",theme:"gr-blue-200",label:e.term,selected:!0,onClick:()=>{C(t),P(t)}},s)})})}),(0,l.jsxs)("div",{ref:W,className:(0,f.A)(ee&&"pb-8"),children:[L&&(0,l.jsx)("div",{className:"grid-breakable py-6",children:(0,l.jsx)(r.w,{infoText:A,icon:D,spinIcon:!0})}),Q&&(0,l.jsx)("div",{className:"grid-breakable py-6",children:(0,l.jsx)(r.w,{infoText:z,icon:V,children:(0,l.jsx)(a.x,{body:F})})}),$&&(null==G?void 0:G.hits.map(e=>{let t=N[J];return(0,l.jsx)(w,{collection:t,hit:e,label:I},e.document.id)})),ee&&(0,l.jsx)("div",{className:"flex justify-center w-full mt-8",children:(0,l.jsx)(o.ScrollContainerProvider,{children:(0,l.jsx)(n.d,{pageSize:6,currentPage:Y,totalCount:Z,onClick:B,scrollToOnClickRef:W})})})]})]})}},91852:(e,t,s)=>{Promise.resolve().then(s.bind(s,66410)),Promise.resolve().then(s.bind(s,56749)),Promise.resolve().then(s.bind(s,65733)),Promise.resolve().then(s.bind(s,64425)),Promise.resolve().then(s.bind(s,44139)),Promise.resolve().then(s.bind(s,78904)),Promise.resolve().then(s.bind(s,70307)),Promise.resolve().then(s.bind(s,36825)),Promise.resolve().then(s.bind(s,35917)),Promise.resolve().then(s.bind(s,37413)),Promise.resolve().then(s.bind(s,95705)),Promise.resolve().then(s.bind(s,41292)),Promise.resolve().then(s.bind(s,71323)),Promise.resolve().then(s.bind(s,80647))},95211:(e,t,s)=>{"use strict";s.d(t,{e:()=>r});let l={article:"Artikkeli",campaign:"Kampanja",match:"Ottelu",news:"Uutinen",page:"Sivu",pageOrCampaign:"Sivu",player:"Pelaaja",series:"Sarja",smo:"S\xe4\xe4nn\xf6t",team:"Joukkue",event:"Tapahtuma"},i={article:"gold",campaign:"gr-blue-500",match:"gr-pink",news:"grey",page:"gr-hotpink",pageOrCampaign:"gr-hotpink",player:"gold",series:"gr-blue-200",smo:"blue",team:"gr-green",event:"gr-yellow"};function r(e){let t=l[e];return{theme:i[e],label: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.