PageSourceSearch

https://www.levandehistoria.se/_next/static/chunks/pages/sok-d1bb840e6fc35870.js

js levandehistoria.se collected 2026-10-02 04:26:29 UTC 10,730 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[138],{5440:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/sok",function(){return n(1402)}])},1402:function(e,t,n){"use strict";n.r(t),n.d(t,{__N_SSP:function(){return F},default:function(){return L}});var r=n(5893),a=n(9008),i=n.n(a),c=n(5099),s=n(7294),l=n(5821),o=n(6010),u=n(9451),_=n(3754),d=n(8103),h=n(3115),f=n.n(h),m=n(8568),g=n(9671),p=n(2916),x=n(9633),v=n(5526),j=n(963),b=n(4),k=n(8261),S=n.n(k),Z=e=>{let{title:t,description:n,categories:a,link:i}=e;return(0,r.jsx)(b.Z,{context:"standard",className:S().searchResultItem,children:(0,r.jsxs)(x.Z,{className:S().link,href:i,underline:"none",children:[(0,r.jsx)(m.Z,{className:S().heading,level:3,content:t}),(0,r.jsx)(v.Z,{className:S().description,content:function(e){let t=e.charAt(0),n=e.charAt(e.length-1);return t.match(/[A-ZÅÄÖ]/)||(e="…"+e),n.match(/[?!.]/)||(e+="…"),e}(n)}),(null==a?void 0:a.length)?(0,r.jsx)("div",{className:S().categories,children:null==a?void 0:a.map((e,t)=>(0,r.jsx)(j.Z,{content:e,colorTheme:"color_theme_white"},t))}):null]})})},N=n(4999),P=n(2905),T=n(5903),B=n(564),w=n(4764);let y=e=>{let[t,n]=(0,s.useState)(!1);return(0,s.useEffect)(()=>{let t=function(e){try{return window.matchMedia(e)}catch(e){return null}}(e);if(t){let e=()=>{n(!!(null==t?void 0:t.matches))};return e(),t.addEventListener("change",e),()=>{t.removeEventListener("change",e)}}},[e]),t};var R=e=>{let{result:t,search:n}
1=e,a=(0,l.$)(),i=y("(max-width: 768px)"),[c,h]=(0,s.useState)(null==t?void 0:t.hits),[x,v]=(0,s.useState)("success"),[j,b]=(0,s.useState)(null==t?void 0:t.meta),[k,S]=(0,s.useState)(""),[R,C]=(0,s.useState)(n),[I,F]=(0,s.useState)(null==t?void 0:t.pagination),[L,W]=(0,s.useState)(!1),E=(0,s.useMemo)(()=>null==j?void 0:j.reduce((e,t)=>e+Number(t.found)||0,0),[j]),M=e=>{S(e),X(R,e)},X=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;(0,_.y)({query:e,postType:t,page:n,perPage:20}).then(t=>{if(!e){v("idle"),b([]),h([]);return}h(t.data.result.hits),b(t.data.result.meta),F(t.data.result.pagination),v("success")}).catch(()=>{v("failed")})};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(m.Z,{visuallyHidden:!0,children:a("search.heading")}),(0,r.jsx)(N.Z,{enableSuggestions:!1,input:R,onValueChange:e=>{C(e),e||v("idle"),v("pending"),(0,u.D)(()=>{X(e,k)})}}),(0,r.jsx)(g.Z,{withTopMargin:!0,children:(0,r.jsxs)(p.ZP,{width:"narrow",children:[(0,r.jsx)(m.Z,{level:1,content:"S\xf6kresultat"}),(0,r.jsxs)("div",{className:f().filterResultText,children:["Visar resultat f\xf6r ",(0,r.jsxs)("strong",{children:["”",R,"”"]}),(0,r.jsxs)("span",{hidden:"pending"==x||!E,children:[",",(0,r.jsx)("span",{className:f().hits,children:E})," tr\xe4ffar totalt"]})]}),(0,r.jsxs)("div",{className:(0,o.Z)(f().filters,L?f().filters_active:""),children:[(0,r.jsxs)("button",{className:f().filterResult,onClick:()=>{W(!L)},"aria-expanded":L||!i,children:["Filtrera resultatet",(0,r.jsx)(w.Z,{name:w.U.arrowCaretDown,className:(0,o.Z)(f().caretIcon,{[f().caretIcon_reverse]:L})})]}),(0,r.jsx)("div",{className:f().filterButtons,children:(0,r.jsxs)("div",{className:f().filterButtonsContent,children:[(0,r.jsx)("button",{disabled:i&&!L,className:(0,o.Z)(f().filterButton,{[f().filterButton_selected]:""===k}),onClick:()=>M(""),children:"Visa alla"}),null==j?void 0:j.map(e=>(0,r.jsxs)("button",{disabled:i&&!L,className:(0,o.Z)(f().filterButton,{[f().filterButton_selected]:k===e.postType}),onClick:()=>M(e.postType),children:[(0,d.l7)(e.postType)," (",e.found,")"]},e.postType))]})})]})]})}),(0,r.jsxs)(T.H,{children:[(0,r.jsx)(g.Z,{paddingType:"focus-section",children:(0,r.jsxs)(p.ZP,{width:"narrow",children:[(0,r.jsx)(B.Z,{hidden:"pending"!==x}),null==c?void 0:c.map(e=>(0,r.jsx)(Z,{title:e.title,image:null,link:e.url,description:e.highlights,categories:[(0,d.l7)(e.type)]},e.title+e.url))]})}),I?(0,r.jsx)(P.Z,{colorTheme:"color_theme_light",onClick:function(e){window.scrollTo({top:0,behavior:"instant"}),X(R,k,e)},currentPage:I.currentPage,totalPages:I.totalPages}):null]})]})},C=n(9274),I=n(4993),F=!0,L=e=>{let{result:t,search:n,mainMenu:a,criticalMessage:s}=e;return(0,r.jsx)(C.g3,{children:(0,r.jsx)(I.Ho,{children:(0,r.jsxs)(c.Z,{mainMenuContent:a,criticalMessage:s,children:[(0,r.jsx)(i(),{children:(0,r.jsx)("title",{children:"S\xf6k - Forum f\xf6r levande historia"})}),(0,r.jsx)(R,{result:t,search:n})]})})})}},5903:function(e,t,n){"use strict";n.d(t,{H:function(){return _}});var r=n(5893),a=n(6010),i=n(7294),c=n(9448),s=n(2938),l=n.n(s),o=n(9671),u=n(2916);let _=e=>{let{children:t,anchor:n,disableFocus:s,backgroundImageUrl:_}=e,d=(0,i.useRef)(),{intersecting:h}=(0,c.S)(d,0,"-300px");return(0,r.jsxs)(o.Z,{id:n,forwardRef:d,paddingType:"none",className:(0,a.Z)(l().container,{[l().container_focused]:h&&!s}),children:[_&&(0,r.jsx)("div",{style:{backgroundImage:"url(".concat(_,")")},className:l().backgroundImage}),(0,r.jsx)(u.ZP,{width:"fullwidth",className:l().contentWrapper,children:t})]})}},5526:function(e,t,n){"use strict";var r=n(5893),a=n(6010),i=n(3431),c=n.n(i);t.Z=e=>{let{className:t,content:n,children:i}=e;return n?(0,r.jsx)("div",{className:(0,a.Z)(c().bodyText,t),dangerouslySetInnerHTML:{__html:n}}):i?(0,r.jsx)("div",{className:(0,a.Z)(c().bodyText,t),children:i}):null}},963:function(e,t,n){"use strict";var r=n(5893),a=n(6010),i=n(4864),c=n(429),s=n.n(c);t.Z=e=>{let{content:t,colorTheme:n="color_theme_black"}=e;return(0,r.jsx)("div",{className:(0,a.Z)(s().label,s()[(0,i.Sl)(n)]),children:t})}},4:function(e,t,n){"use strict";var r=n(5893),a=n(6010),i=n(4864),c=n(3258),s=n.n(c);t.Z=e=>{let{context:t,children:n,className:c}=e;return(0,r.jsx)("div",{className:(0,a.Z)(s().coreBlockBase,s()[(0,i.Nz)(t)],c),children:n})}},2905:function(e,t,n){"use strict";var r=n(5893),a=n(6010),i=n(7294),c=n(4764),s=n(4864),l=n(9388),o=n.n(l);t.Z=e=>{let{colorTheme:t,currentPage:n,totalPages:l,onClick:_,toLink:d}=e,[h,f]=(0,i.useState)([]);return((0,i.useEffect)(()=>{f(Array.from({length:l},(e,t)=>t+1))},[l]),!l||l<2)?null:(0,r.jsxs)("div",{className:(0,a.Z)(o().pagination,o()["pagination_".concat((0,s.Sl)(t))]),children:[(0,r.jsx)(u,{active:!1,toLink:d,onClick:_,page:n-1,className:o().button_left,disabled:n<=1,label:"F\xf6reg\xe5ende",children:(0,r.jsx)(c.Z,{name:c.U.arrowButtonRight})}),h.map(e=>(0,r.jsx)(u,{active:n===e,toLink:d,onClick:_,page:e,disabled:n===e,children:e},e)),(0,r.jsx)(u,{active:!1,toLink:d,onClick:_,page:n+1,className:o().button_right,label:"N\xe4sta",disabled:n>=l,children:(0,r.jsx)(c.Z,{name:c.U.arrowButtonRight})})]})};let u=e=>{let{page:t,active:n,toLink:i,onClick:c,children:s,className:l="",disabled:u=!1,label:_=""}=e;return i?(0,r.jsx)("a",{className:(0,a.Z)(o().item,{[o().item_active]:n},l),href:u?null:i(t),children:s},t):c?(0,r.jsx)("button",{"aria-label":_,className:(0,a.Z)(o().item,{[o().item_active]:n},l),type:"button",onClick:()=>c(t),disabled:u,children:s},t):(0,r.jsx)("span",{className:(0,a.Z)(o().item,{[o().item_active]:n},l),children:s},t)}},8103:function(e,t,n){"use strict";function r(e){return e&&({"#f2f2f2":"alpha","#b2dff1":"beta","#bfe1da":"gamma","#e6cfe6":"delta","#f7c0c3":"epsilon","#2f2984":"zeta","#3c6a81":"eta","#b50d7d":"theta","#995623":"iota"})[e.toLowerCase()]||null}function a(e){return["zeta","eta","theta","iota"].includes(e)}function i(e){return a(e)?"color_theme_dark":"color_theme_light"}function c(e){let t="";for(;e-- >0;)t+="    ";return t}function s(e){let t=[["arnombudsmannen","arnombuds\xadmannen"]],n=t.map((t,n)=>-1!==e.indexOf(t[0])&&n).filter(e=>!1!==e);
1return(null==n?void 0:n.length)&&n.forEach(n=>{e=e.replace(t[n][0],t[n][1])}),e}function l(e){switch(e){case"page":return"\xd6vrigt";case"classroom_material":return"Undervisningsmaterial";case"education":return"F\xf6r skola";case"event":return"Kalendarium";case"event_series":return"H\xe4ndelseserie";case"exhibition":return"Utst\xe4llningar";case"fact":return"Fakta";case"material":return"Rapporter och b\xf6cker";case"resource":return"Resurser";case"user-event":return"Anv\xe4ndarh\xe4ndelse";case"video":return"Forum Play"}}function o(e,t,n){return n?[]:(null==t?void 0:t.length)?t.flatMap(e=>e):e.flatMap(e=>e)}n.d(t,{bR:function(){return o},kk:function(){return function e(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if("number"==typeof t)return t;if(Array.isArray(t)){let r=t.map(t=>"".concat(e(t,n+1))).join(", ");return"[\n".concat(c(n),"    ").concat(r,"\n").concat(c(n),"]")}if("object"==typeof t){let r=Object.keys(t).map(r=>"".concat(c(n+1)).concat(r,": ").concat(e(t[r],n+1))).join("\n");return"{\n".concat(r,"\n").concat(c(n),"}")}return JSON.stringify(t)}},l7:function(){return l},pG:function(){return i},tW:function(){return r},tZ:function(){return a},uX:function(){return s}})},2938:function(e){e.exports={container:"FocusSection_container__mVRlc",container_focused:"FocusSection_container_focused__P_KXS",backgroundImage:"FocusSection_backgroundImage__kWXDM",contentWrapper:"FocusSection_contentWrapper__oxMUR",content:"FocusSection_content__UJggW"}},3431:function(e){e.exports={bodyText:"BodyText_bodyText__o_bXc"}},429:function(e){e.exports={label:"Label_label__Iy5tF",colorThemeLight:"Label_colorThemeLight__fh1T6",colorThemeBlack:"Label_colorThemeBlack__j0ueP"}},3258:function(e){e.exports={coreBlockBase:"CoreBlockBase_coreBlockBase__VJISL",contextFocusSection:"CoreBlockBase_contextFocusSection__N_nWo"}},3115:function(e){e.exports={filterResultText:"SearchPage_filterResultText__HL1bC",hits:"SearchPage_hits__wdyDp",filters:"SearchPage_filters__mZZTe",filters_active:"SearchPage_filters_active__dWk95",filterButtons:"SearchPage_filterButtons__mv4OB",filterResult:"SearchPage_filterResult__NmJTm",caretIcon:"SearchPage_caretIcon__7X5tD",caretIcon_reverse:"SearchPage_caretIcon_reverse__hl1it",filterButtonsContent:"SearchPage_filterButtonsContent__PkhGG",filterButton:"SearchPage_filterButton__lGPY_",filterButton_selected:"SearchPage_filterButton_selected__Fr3w_"}},8261:function(e){e.exports={searchResultItem:"SearchResultItem_searchResultItem__f_8R8",link:"SearchResultItem_link__1nR8i",description:"SearchResultItem_description__F0PfZ",categories:"SearchResultItem_categories__3y6_r"}},9388:function(e){e.exports={item:"Pagination_item__TwYOz",item_active:"Pagination_item_active__p6ZcD",pagination:"Pagination_pagination__zU93g",pagination_colorThemeWhite:"Pagination_pagination_colorThemeWhite__1KBYm",pagination_colorThemeLight:"Pagination_pagination_colorThemeLight__Hi_rz",button_left:"Pagination_button_left__8X4TX",button_right:"Pagination_button_right__VWOg6"}}},function(e){e.O(0,[461,334,99,888,774,179],function(){return e(e.s=5440)}),_N_E=e.O()}]);

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.