import{S as b,D as g,F as x}from"./DesktopLayout.cf829f6b.js";import{A as v}from"./ArticleWidget.1db91f15.js";import{M as y}from"./MediumAdWidget.fea3456f.js";import{d as w,r as l,o as s,c,w as u,a as t,s as k,b as r,t as i,g as o,e as S,v as A,G as F,y as N,F as $}from"./app.f791ceab.js";import{_ as B}from"./_plugin-vue_export-helper.cdc0426e.js";const L=w({name:"ArchivePage",components:{MediumAdWidget:y,SubNavBar:b,DesktopLayout:g,ArticleWidget:v,FontAwesomeIcon:x},props:{articles:Array,archive_title:String,archive_sub_title:String,page_limit:Number,sponsor_title:String,sponsor_link:String,sponsor_image:String,sponsor_bio:String,is_sponsor:Boolean,is_searched:Boolean,showing_results:Number,remaining_results:Number,total_possible_results:Number,meta:{type:Object,default:()=>({title:"Arkiv"})}},data(){return{search:"",searching:!1}},created(){this.search=new URLSearchParams(location.search).get("q")},mounted(){this.$nextTick(()=>this.$refs.search_input.focus()),!(typeof document>"u")&&document.dispatchEvent(new Event("paywall_do_load"))},methods:{debounce_search_submit:_.debounce(function(){this.search_submit()},500),search_submit(){this.searching=!0,this.$inertia.visit(location.pathname,{data:{q:this.search},preserveScroll:!0,onSuccess:()=>{this.searching=!1}})},loadMore(){this.$inertia.visit(location.pathname,{data:{limit:Number.parseInt(this.$page.props.page_limit)+48},preserveScroll:!0,preserveState:!0})}}}),M={class:"bg-primary w-full"},j={class:"container mx-auto"},D={key:0,class:"bg-[#F8F8F8] w-screen flex py-10 z-2"},V={class:"container flex flex-col xl:flex-row justify-between items-center px-3 sm:px-0"},C={class:"flex flex-col items-center xl:items-start"},T=t("h1",{class:"text-[18px] text-black mx-auto sm:mx-0 text-center sm:text-left"}," Sponseret af: ",-1),I={class:"text-[26px] font-bold text-black mb-[15px]"},P=["innerHTML"],W={class:"space-y-4 flex flex-col items-center"},q={class:"h-[70px] w-auto mb-4 xl:mb-0"},E=["href","title"],H=["src"],G=["href"],U={class:"sm:flex bg-[#F6F7F9] hover:bg-primary w-auto h-[50px] px-3 ring-2 ring-primary flex items-center justify-center text-primary hover:text-white whitespace-nowrap"},z={class:"font-medium text-[18px]"},O={class:"container flex mt-[25px] sm:mt-12 mb-6 px-[25px] sm:px-0 sm:mt-10 flex-col sm:flex-row w-full sm:items-center justify-between"},R={class:"text-[26px] font-bold text-black block text-left"},J=t("br",{class:"sm:hidden"},null,-1),K={class:"text-[22px] sm:ml-2 font-[400] block sm:inline"},Q={class:"font-medium text-[20px] mt-2 sm:mt-0"},X={class:"container h-[50px] px-[25px] sm:px-0 flex relative text-gray-400 focus-within:text-primary active-within:text-primary search-themes w-full mb-12"},Y={class:"w-[50px] h-full bg-primary flex justify-center items-center",type:"submit"},Z={class:"lg:container grid archive-grid gap-[25px]"},ee={key:1,class:"container col-span-4 flex justify-center my-12 self-center"};function te(e,a,se,oe,re,ie){var p;const h=l("SubNavBar"),m=l("FontAwesomeIcon"),d=l("ArticleWidget"),f=l("DesktopLayout");return s(),c(f,{class:"",main_class:"",title:(p=e.meta)==null?void 0:p.title},{sub_navbar:u(()=>[t("div",M,[t("div",j,[k(h)])])]),default:u(()=>[e.is_sponsor?(s(),r("div",D,[t("div",V,[t("div",C,[T,t("h1",I,i(e.archive_sub_title),1),e.sponsor_bio?(s(),r("div",{key:0,class:"flex flex-col mb-6 xl:mb-0 lg:w-4/5",innerHTML:e.sponsor_bio},null,8,P)):o("",!0)]),t("div",W,[t("div",q,[t("a",{href:e.sponsor_link,target:"_blank",title:`${e.archive_sub_title} link on Logo image`},[e.sponsor_image?(s(),r("img",{key:0,src:e.sponsor_image,alt:"Sponsor logo",class:"h-full w-auto"},null,8,H)):o("",!0)],8,E)]),e.sponsor_link?(s(),r("a",{key:0,href:e.sponsor_link,target:"_blank"},[t("button",U,[t("p",z,"G\xE5 til "+i(e.archive_sub_title),1)])],8,G)):o("",!0)])])])):o("",!0),t("div",O,[t("h1",R,[S(i(e.archive_title),1),J,t("span",K,i(e.archive_sub_title),1)]),t("h2",Q," Viser "+i(e.articles.length)+" ud af "+i(e.total_possible_results)+" resultater ",1)]),t("form",X,[A(t("input",{class:"border border-primary focus:border-primary focus:ring-primary w-full bottom-0 relative",style:{width:"calc(100% - 50px)"},placeholder:"S\xF8g...",type:"search",autofocus:"",ref:"search_input","onUpdate:modelValue":a[0]||(a[0]=n=>e.search=n),name:"q"},null,512),[[F,e.search]]),t("button",Y,[e.searching?o("",!0):(s(),c(m,{key:0,class:"right-8 bottom-[12px] text-white",icon:"fa-solid fa-magnifying-glass"})),e.searching?(s(),c(m,{key:1,class:"right-8 bottom-[12px] text-white transition duration-1000 animate-spin",icon:"fa-regular fa-spinner-third"})):o("",!0)])]),t("section",Z,[(s(!0),r($,null,N(e.articles,n=>(s(),c(d,{article:n},null,8,["article"]))),256))]),e.remaining_results>e.articles.length?(s(),r("div",ee,[t("button",{id:"load-more",class:"h-12 w-auto px-4 rounded-lg bg-white text-primary border-2 border-primary font-bold",onClick:a[1]||(a[1]=n=>e.loadMore())}," Hent flere artikler ")])):o("",!0)]),_:1},8,["title"])}const pe=B(L,[["render",te]]);export{pe as default};