1import{_ as M}from"./DF7cUkOr.js";import{_ as k}from"./yshTtBCs.js";import{g as j,u as q}from"./COR11w7B.js";import{s as x}from"./BOEpO4Cj.js";import{p as B}from"./C0wHgOVL.js";import{m as F,r as s,n as m,w as p,b as I,o as O,q as P,s as z,i as n,k as J,j as U,Z as C,e as N}from"./DaOdQDTG.js";import{u as V}from"./9Kh6eqQM.js";import"./C1y2R0tP.js";import"./DUwkIxeY.js";import"./CE1G-McA.js";import"./dit3uDuP.js";import"./4z1zEQle.js";import"./DIQAiVI2.js";import"./B_PfOvSR.js";import"./BxVJvMe7.js";import"./DgZGMbsn.js";import"./Be8i7rxg.js";import"./CCB1G4sm.js";import"./C-43K-xm.js";import"./Ddq1RLvw.js";import"./DlRUi2RT.js";/* empty css */import"./DSd84tgA.js";const de={__name:"[slug]",async setup(W){let e,a;const i=J(),_=F(),b=j(_.fullPath),l=x(_.params.slug);q(null,null,b,l);const A=`${i.public.CMS_URL}/wp-json/wp/v2/tags?search=${encodeURIComponent(l)}`,w=`${i.public.API_URL}/articles`,r=s([]),v=s(!1),g=s([]),f=s(!1),h=s(0),R=m(()=>h.value>r.value.length),y=m(()=>g.value.map(({slug:t})=>t).join(",")),c=m(()=>k(g.value.map(({name:t})=>B(t))).find(({city:t})=>t)),S=m(()=>c.value?{name:c.value.city}:null),{data:L,error:E}=([e,a]=p(()=>U(A,"$68JbmyAu2r")),e=await e,a(),e);if(E.value||L.value.length===0)[e,a]=p(()=>C()),await e,a();else{g.value=L.value.filter(({name:o})=>o&&o.toLowerCase().startsWith("loc:"));const{data:t,error:d}=([e,a]=p(()=>U(w,{query:{tag:y.value}},"$8u-veuHecS")),e=await e,a(),e);if(r.value=t.value.list,h.value=t.value.total,!c.value)[e,a]=p(()=>C()),await e,a();else{const o=`${c.value.city} - Travel Noire`,H={title:o,ogTitle:o,ogType:"article:tag",ogUrl:`${i.public.HOST_URL}/location/city/${l}`,twitterTitle:o};I(H),V(`${i.public.HOST_URL}/location/city/${l}`)}}function u(){f.value&&($(42),T()),f.value=!0}async function $(t=7){v.value=!0;const d=r.value.length,{list:o}=await $fetch(w,{query:{tag:y.value,count:t,offset:d}});r.value=[...r.value,...o],v.value=!1}function T(){window.removeEventListener("mouseover",u),window.removeEventListener("touchstart",u)}return O(()=>{window.addEventListener("mouseover",u),window.addEventListener("touchstart",u)}),P(()=>{T()}),(t,d)=>{const o=M;return N(),z(o,{articles:n(r),category:n(S),"has-more":n(R),label:"articles tagged",loading:n(v),rendered:n(f),onLoadMore:$},null,8,["articles","category","has-more","loading","rendered"])}}};export{de 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.