PageSourceSearch

https://www.hn.se/_next/static/chunks/8806-46d0abcb007d56fc.js

js hn.se collected 2026-10-01 11:36:00 UTC 14,853 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8806],{1967:(e,t,i)=>{i.d(t,{A:()=>w});var r=i(94513),n=i(94285),o=i(48655),l=i(54745),a=i(43672),s=i(54020),c=i(11730),d=i(66633);let m=(0,n.forwardRef)(({items:e,defaultVisibleItems:t=4,showMoreNumberOfItems:i=8,timeoutTime:o=300,showMoreCallback:s,initialSize:c,showMore:m,hasMore:h,dataStatus:w,style:y={},parentName:x},v)=>{let[b,I]=(0,n.useState)(t),[A,j]=(0,n.useState)(!0),[C,S]=(0,n.useState)(!1),k=(0,n.useRef)(null),E=(0,n.useRef)(null),N=(0,n.useRef)(null),[T,F]=(0,n.useState)(0),[,M]=(0,n.useState)(!1),[W,B]=(0,n.useState)(!1),L=function(e,t){window.requestAnimationFrame(function(){let i=e-window.scrollY,r=k.current;if(r){let e=r.clientHeight-i/1.2;e>t&&i>=0?r.style.height=`${e}px`:r.style.height=`${t}px`}})},R=(0,n.useCallback)(()=>{if(!k.current)return;let e=Array.prototype.slice.call(k.current?.children??[]),i=0,r=e.reduce((e,r,n)=>(n<t&&(i+=r.getBoundingClientRect().height+Number(window.getComputedStyle(r).marginBottom.split("px")[0])+Number(window.getComputedStyle(r).marginTop.split("px")[0])),e+r.getBoundingClientRect().height+Number(window.getComputedStyle(r).marginBottom.split("px")[0])+Number(window.getComputedStyle(r).marginTop.split("px")[0])),0);return k.current.style.height=`${r}px`,i},[k,t]);return(0,n.useEffect)(()=>{let e=e=>{x===e&&I(t)};return(0,d.sD)("resetVisibleItems",e),()=>{(0,d.kN)("resetVisibleItems",e)}},[t,x]),(0,n.useEffect)(()=>{let i=!h&&e.length<t,r=b>=e.length,n=b<e.length;i||r?j(!1):n&&j(!0)},[b,t,e.length,h]),(0,n.useEffect)(()=>{b===t?S(!1):S(!0)},[b,t]),(0,n.useEffect)(()=>{R()&&(N.current.style.display="flex",B(!0)),M(e=>!e)},[k,b,T,R]),(0,n.useEffect)(()=>{let e=()=>{F(R()??0)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[k,t,R]),(0,n.useEffect)(()=>{F(R()??0),c&&e.length<=c*t&&!m&&"RESOLVED"!==w&&(I(t),S(!1))},[e,t,c,m,w,R]),(0,r.jsxs)(f,{hide:0===e.length,timeoutTime:o,children:[(0,r.jsx)(p,{timeoutTime:o,ref:k,style:W?y:{},children:e.slice(0,Math.min(b,e.length))}),(0,r.jsxs)(u,{showStyles:W,ref:N,children:[C&&(0,r.jsx)(g,{ref:E,onClick:()=>{if(j(!0),"function"==typeof v||!v?.current||!k.current)return;let e=window.scrollY;function i(){L(e,T)}v&&(window.addEventListener("scroll",i),"function"!=typeof v&&v.current&&window.scrollTo({top:v.current.offsetTop-8,behavior:"instant"}));let r=()=>{k.current.style.height=`${T}px`,E.current.style.display="none",window.removeEventListener("scroll",i),document.removeEventListener("scrollend",r),document.removeEventListener("scroll",n),setTimeout(()=>{I(t)},o)},n=()=>{clearTimeout(window.scrollEndTimer),window.scrollEndTimer=setTimeout(r,100)};"onscrollend"in window?document.addEventListener("scrollend",r):document.addEventListener("scroll",n)},disabled:!!w&&"PENDING"===w,role:"button",children:"Visa f\xe4rre"}),A&&(0,r.jsx)(g,{onClick:()=>{if(s&&s(),!h&&b+i>=e.length?j(!1):S(!0),k.current){let e=k.current?.clientHeight;k.current.style.height=`${e??T}px`}I(b+i)},disabled:!!w&&"PENDING"===w,role:"button",children:"Se fler artiklar"})]}),(C||A)&&(0,r.jsx)(l.h,{value:a.B.Spacing16})]})}),h=(0,c.i7)(["0%{opacity:0;}100%{opacity:1;}"]),f=c.Ay.div.withConfig({componentId:"sc-823b802-0"})(["opacity:0;",";position:relative;animation:"," ","s forwards ease-in-out;"],e=>e.hide&&"display: none",h,e=>e.timeoutTime/300),u=c.Ay.div.withConfig({componentId:"sc-823b802-1"})(["display:flex;width:100%;transition:all 0.5s ease-in,opacity 1s ease-in,height 1.5s ease-in;overflow:hidden;height:",";opacity:",";",";"],e=>e.showStyles?"auto":0,e=>+!!e.showStyles,e=>e.showStyles&&(0,s.xe)({px:3,py:2,mt:2})),g=(0,c.Ay)(o.$n).withConfig({componentId:"sc-823b802-2"})(["flex:1;-webkit-tap-highlight-color:transparent;color:var(--corp-color-darken);&:active,&:focus,&:hover{background-color:transparent;border:0;}"]),p=c.Ay.ul.withConfig({componentId:"sc-823b802-3"})(["list-style:none;",";overflow:hidden;height:auto;transition:all ","s ease-in,height ","s ease-in-out;"],(0,s.xe)({my:0,pl:0}),e=>e.timeoutTime/3e3,e=>e.timeoutTime/1e3),w=m},21650:(e,t,i)=>{i.d(t,{u:()=>l});var r=i(92252),n=i(28324);let o=async e=>{let t=await fetch(e);if(!t.ok)throw Error("An error occurred while fetching the data.");return t.json()},l=({limit:e,initialSize:t=1,followsFilterIds:i=[]})=>{let{data:l,error:a,mutate:s,isValidating:c,size:d,setSize:m}=(0,r.Ay)((t,r)=>{let o="/api/customer/news-feed",l=(0,n.bU)({limit:e,followsFilterIds:i.join(",")});if(0===t)return`${o}?${l.toString()}`;let a=r?.articlesWithFollowItems;if(!a?.length)return null;let s=a[a.length-1].article?.publishDate;s&&l.append("fromPublishDate",s);let c=a.flatMap(e=>e.article.uuid).join(",")??"";return l.append("excludeUuids",c),`${o}?${l.toString()}`},o,{revalidateFirstPage:!1,initialSize:t,revalidateOnMount:!0}),h=l??[];return{articlesWithFollowItems:h?.flatMap(e=>e.articlesWithFollowItems)??[],loadMore:()=>m(d+1),hasMore:h[h.length-1]?.hasMore??!1,mutate:s,status:c?"PENDING":l?"RESOLVED":a?"REJECTED":"PENDING",setSize:m}}},34531:(e,t,i)=>{i.d(t,{J:()=>M,A:()=>W});var r=i(94513),n=i(94285),o=i(98794),l=i(54745),a=i(43672),s=i(54020),c=i(6093
10),d=i(20545),m=i(83117),h=i(46681),f=i(56131),u=i.n(f),g=i(11730),p=i(81879),w=i(46920);let y=({numberOfBoxes:e})=>Array.from(Array(e).keys()).map(e=>(0,r.jsx)(I,{children:(0,r.jsxs)(o.WA,{children:[(0,r.jsx)(A,{children:(0,r.jsx)(o.Vq,{})}),(0,r.jsx)(o.rB,{width:"26.96%",height:"1rem"}),(0,r.jsx)(o.rB,{width:"100%",height:"3.5rem"}),(0,r.jsx)(o.rB,{width:"100%",height:"3rem"})]})},`follow-loading-box-large-${e}`)),x=({articleWithFollowItems:e,isQuickViewActive:t})=>{let i=(0,p.Je)(e.article.uuid,e.article.teaserImage),n=(0,p.wj)(e.article.teaserImageInfo);return(0,r.jsx)(m.A,{href:e.article.canonical??"",children:(0,r.jsxs)(r.Fragment,{children:[!t&&(0,r.jsx)(v,{article:e.article,followsItems:e.followsItems,teaserImageSource:i,imageInfo:n}),(0,r.jsx)(b,{article:e.article,followsItems:e.followsItems,teaserImageSource:i,imageInfo:n,isQuickViewActive:t})]})})},v=({article:e,followsItems:t,teaserImageSource:i,imageInfo:n})=>{let o=n.cnpTeaserImageId,l=!!(o||i?.regular),a=(o?(0,w.T0)({id:o,width:400,height:200,aspectRatio:2,fit:"crop"}):void 0)||i?.regular||"";return l?(0,r.jsxs)(A,{children:[(0,r.jsx)(j,{width:345,height:164,src:a,alt:e.teaserTitle}),(0,r.jsxs)(C,{position:"absolute",children:[(0,r.jsx)(d.A.Star,{}),(0,r.jsx)(S,{children:t.length>1?t.length:t[0].tagName})]})]}):null},b=({article:e,followsItems:t,teaserImageSource:i,imageInfo:n,isQuickViewActive:o})=>{let l="chronicle"===e.type,a=!!(n.cnpTeaserImageId||i?.regular);return(0,r.jsxs)(k,{children:[(0,r.jsxs)(T,{children:[!o&&(0,r.jsx)(h.NR,{mb:0,children:e.mainCategoryName}),!a||o?(0,r.jsxs)(C,{position:"relative",children:[(0,r.jsx)(d.A.Star,{}),(0,r.jsx)(S,{children:t.length>1?t.length:t[0].tagName})]}):null]}),(0,r.jsx)(E,{fontStyle:l?"italic":"normal",fontWeight:l?400:700,px:+!!l,isQuickViewActive:o,children:e.teaserTitle}),!o&&(0,r.jsx)(N,{dangerouslySetInnerHTML:{__html:e.teaserLead??""}})]})},I=g.Ay.li.withConfig({componentId:"sc-abc74367-0"})(["border-top:1px solid rgba(0,0,0,0.15);&:first-child{",";border-top:unset;}"],(0,s.xe)({pt:0})),A=g.Ay.div.withConfig({componentId:"sc-abc74367-1"})(["background-color:var(--bg-color-gray-light);border-radius:0.25rem;position:relative;aspect-ratio:3.45/1.64;overflow:hidden;",";> figure{height:100%;margin:0;}"],(0,s.xe)({mb:"1rem"})),j=(0,g.Ay)(u()).withConfig({componentId:"sc-abc74367-2"})(["width:100%;height:100%;object-fit:cover;"]),C=g.Ay.div.withConfig({componentId:"sc-abc74367-3"})(["",";top:",";left:",";border-radius:4px;background:var(--corp-background-color-lighten);position:",";display:flex;gap:0.25rem;svg{margin:auto;}width:fit-content;"],(0,s.xe)({py:"0.25rem",px:"0.5rem"}),e=>"relative"===e.position?0:"0.5rem",e=>"relative"===e.position?0:"0.5rem",e=>e.position),S=g.Ay.span.withConfig({componentId:"sc-abc74367-4"})(["",";color:var(--corp-color-primary);"],(0,c.I)({fontStyle:"normal",fontWeight:500,lineHeight:"1rem",fontFamily:"var(--font-family-sans-serif)",fontSize:"0.75rem"})),k=g.Ay.div.withConfig({componentId:"sc-abc74367-5"})(["display:flex;flex-direction:column;gap:0.5rem;"]),E=g.Ay.h2.withConfig({componentId:"sc-abc74367-6"})(["color:var(--gray-800);",";",";"," ",""],({isQuickViewActive:e})=>(0,c.I)({lineHeight:"1.75rem",fontFamily:"var(--font-family-serif)",fontSize:e?"1.25rem":"1.5rem"}),(0,s.xe)({m:0}),c.I,s.xe),N=g.Ay.h3.withConfig({componentId:"sc-abc74367-7"})(["color:var(--gray-800);",";",";"],(0,c.I)({fontStyle:"normal",fontWeight:300,lineHeight:"1.5rem",fontFamily:"var(--font-family-sans-serif)",fontSize:"1rem"}),(0,s.xe)({m:0})),T=g.Ay.div.withConfig({componentId:"sc-abc74367-8"})(["display:flex;gap:1rem;"]);var F=i(1967);let M=(e,t)=>e.length===t.length&&e.every((e,i)=>e===t[i]),W=(0,n.memo)(({defaultVisibleItems:e,articlesWithFollowItems:t,loading:i,listRef:o,hasMore:s,loadMore:c,initialSize:d,status:m,isQuickViewActive:h,parentName:f})=>{let[u,g]=(0,n.useState)(!1),p=(0,n.useMemo)(()=>y({numberOfBoxes:e}),[e]),w=i&&!u?p:(({articlesWithFollowItems:e,showMore:t,defaultVisibleItems:i,loading:o,isQuickViewActive:s})=>[...e.map(e=>(0,r.jsxs)(n.Fragment,{children:[(0,r.jsxs)(I,{children:[(0,r.jsx)(l.h,{value:a.B.Spacing24}),(0,r.jsx)(x,{articleWithFollowItems:e,isQuickViewActive:s})]}),(0,r.jsx)(l.h,{value:a.B.Spacing24})]},e.article.uuid)),...t&&o?y({numberOfBoxes:i}):[]])({articlesWithFollowItems:t,defaultVisibleItems:e,showMore:u,loading:i,isQuickViewActive:h}),v=(0,n.useCallback)(()=>
1{if(s){g(!0);try{c()}catch(e){g(!1)}}},[s,c]);return(0,n.useEffect)(()=>{"PENDING"!==m&&g(!1)},[m]),(0,r.jsx)(B,{"data-testid":"app-startpage-follow-feed",children:(0,r.jsx)(F.A,{items:w,defaultVisibleItems:e,showMoreNumberOfItems:e,ref:o,timeoutTime:500,initialSize:d,showMoreCallback:v,showMore:u,hasMore:s,dataStatus:m,parentName:f})})},(e,t)=>{let i=M(e.articlesWithFollowItems.map(e=>e.article.uuid),t.articlesWithFollowItems.map(e=>e.article.uuid)),r=e.status===t.status,n=e.loading===t.loading,o=e.hasMore===t.hasMore,l=e.listRef.current===t.listRef.current,a=e.isQuickViewActive===t.isQuickViewActive;return i&&r&&n&&o&&l&&a}),B=g.Ay.div.withConfig({componentId:"sc-3dab97c4-0"})(["border-radius:0.5rem;"])},46681:(e,t,i)=>{i.d(t,{NR:()=>c,aP:()=>a,nA:()=>l,w:()=>s});var r=i(54020),n=i(60930),o=i(11730);let l=o.Ay.section.withConfig({componentId:"sc-580227b9-0"})(["background-color:var(--white);border-radius:8px;overflow:hidden;"," ",""],(0,r.xe)({px:"0.75rem",pt:"1rem",pb:"0.5rem",mx:"0.75rem",mb:"1.5rem"}),r.xe),a=o.Ay.div.withConfig({componentId:"sc-580227b9-1"})(["",""],(0,r.xe)({mb:"1.5rem",mx:"0.75rem"})),s=o.Ay.h3.withConfig({componentId:"sc-580227b9-2"})([""," ",";",""],(0,n.I)({fontSize:"1.5rem",fontWeight:"bold",lineHeight:"1.75rem",fontFamily:"var(--font-family-sans-serif)"}),(0,r.xe)({py:"0.625rem",mb:"0.5rem"}),r.xe),c=o.Ay.h4.withConfig({componentId:"sc-580227b9-3"})(["color:var(--corp-color-darken);"," align-content:center;",";",""],(0,n.I)({fontSize:"0.875rem",fontStyle:"normal",fontWeight:700,lineHeight:"1rem",fontFamily:"var(--font-family-sans-serif)"}),(0,r.xe)({mb:"0.75rem"}),r.xe)},66633:(e,t,i)=>{i.d(t,{kN:()=>l,sD:()=>o,y$:()=>n});let r=(0,i(87124).A)(),n=r.emit,o=(e,t)=>r.on(e,t),l=(e,t)=>r.off(e,t)},84773:(e,t,i)=>{i.d(t,{A:()=>A});var r=i(94513),n=i(94285),o=i(41090),l=i(23602),a=i(68599),s=i(20545),c=i(34531),d=i(54020),m=i(60930),h=i(11730);let f=h.Ay.div.withConfig({componentId:"sc-73dd2f89-0"})([""]),u=h.Ay.div.withConfig({componentId:"sc-73dd2f89-1"})(["border-radius:0.5rem;"," background:var(--theme-app-background-secondary);"],(0,d.xe)({p:"0.875rem 0.75rem 0.75rem",mt:"1.5rem"})),g=h.Ay.div.withConfig({componentId:"sc-73dd2f89-2"})(["",";display:flex;justify-content:right;"],(0,d.xe)({mb:"1.125rem"})),p=h.Ay.h5.withConfig({componentId:"sc-73dd2f89-3"})(["color:var(--gray-800);"," ",";align-content:center;flex:1;"],(0,m.I)({fontSize:"1rem",fontStyle:"normal",fontWeight:500,lineHeight:"1.5rem",fontFamily:"var(--font-family-sans-serif)"}),(0,d.xe)({m:0})),w=h.Ay.button.withConfig({componentId:"sc-73dd2f89-4"})(["background:none;color:inherit;border:none;",";"],(0,d.xe)({p:0})),y=h.Ay.ul.withConfig({componentId:"sc-73dd2f89-5"})(["display:flex;gap:0.75rem;list-style:none;",";flex-wrap:wrap;"],(0,d.xe)({m:0,p:0})),x=h.Ay.li.withConfig({componentId:"sc-73dd2f89-6"})([""]),v=h.Ay.h4.withConfig({componentId:"sc-73dd2f89-7"})(["color:var(--gray-600);",""],(0,m.I)({fontSize:"1rem",fontStyle:"normal",fontWeight:500,lineHeight:"1.2rem",fontFamily:"var(--font-family-sans-serif)"}));var b=i(50272),I=i(58522);let A=(0,n.memo)(({onTagChangeStart:e=()=>{},onTagChangeEnd:t=()=>{},updateFollows:i,closable:c=!1,tags:d=[],title:m,subHeading:h,follows:A=[],filterItems:j=[],setFilterItems:C})=>{let[S,k]=(0,n.useState)(()=>A?A.map(e=>e.tagId):[]),[E,N]=(0,n.useState)(!1),[T]=(0,l.DB)(),F=(0,a.UO)(),[M,W]=(0,n.useState)(!1),B=async i=>{if(!T)return void(0,I.u1)({name:"showLogin",payload:void 0});let r={tagName:i.name,tagType:i.type,tagSite:F,tagId:i.uuid};e(),W(!0),S.includes(i.uuid)?await R(r):await L(r),C&&j.includes(i.uuid)&&C(e=>e.filter(e=>e!==i.uuid)),W(!1),t()},L=async e=>{k([...S,e.tagId]);try{await i.followTag(e);let t={event:"follow",eventInfo:{category:"engagement",action:"follow",label:e.tagName.toLowerCase()}};(0,b.KA)("followToggled",t)}catch(t){k(S.filter(t=>t!==e.tagId))}},R=async e=>{k(S.filter(t=>t!==e.tagId));try{await i.unfollowTag(e)}catch(t){k([...S,e.tagId])}};return((0,n.useEffect)(()=>{k(A.map(e=>e.tagId))},[A,k]),E)?null:(0,r.jsxs)(f,{"data-testid":"app-startpage-tag-list",children:[h?(0,r.jsx)(v,{children:h}):null,d.length>0&&(0,r.jsxs)(u,{children:[m||c?(0,r.jsxs)(g,{children:[m?(0,r.jsx)(p,{children:m}):null,c?(0,r.jsx)(w,{onClick:()=>N(!0),style:{visibility:S.length?"visible":"hidden"},disabled:!S.length,children:(0,r.jsx)(s.A.Close,{})}):null]}):null,(0,r.jsx)(y,{children:d.map(e=>{let t=S.includes(e.uuid);return(0,r.jsx)(x,{children:(0,r.jsx)(o.a,{onClick:()=>B(e),disabled:M,text:e.name,variant:"input",isActive:t},e.uuid)},`follow-tag-${e.uuid}`)})})]})]})},(e,t)=>{let i=e.follows?.map(e=>e.tagId)||[],r=t.follows?.map(e=>e.tagId)||[];return(0,c.J)(i,r)})},98794:(e,t,i)=>{i.d(t,{Vq:()=>n,WA:()=>a,rB:()=>o});var r=i(11730);let n=r.Ay.div.withConfig({componentId:"sc-7e30e5e5-0"})(["width:100%;height:100%;background:var(--gray-300);"]),o=r.Ay.div.withConfig({componentId:"sc-7e30e5e5-1"})(["width:",";height:",";background:var(--gray-300);border-radius:0.25rem;margin-bottom:0.5rem;"],e=>e.width,e=>e.height),l=(0,r.i7)(["100%{mask-position:left}"]),a=r.Ay.div.withConfig({componentId:"sc-7e30e5e5-2"})(["width:100%;height:100%;mask:linear-gradient(135deg,#000 30%,#0008,#000 75%) right/500% 100%;background-repeat:no-repeat;animation:"," 0.7s ease infinite forwards;"],l)}}]);

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.