1import{f as j,a5 as D,m as z,s as B,a6 as E,q as C,i as G,o as a,w as k,b as c,k as y,d as P,z as R,t as f,T as A,c as l,F as x,j as L,a as g,g as F,v as J,a7 as q,p as U,y as H,I as K,x as O,a8 as Q}from"./CBLl45Ki.js";import{u as M}from"./DTehyDvv.js";import{G as W,j as X,y as Y}from"./DRTFCkDc.js";import{u as Z}from"./Pr3i4TXV.js";import"./CnQ63F6t.js";const ee={class:"text-xs font-semibold text-gray-500 sticky top-0 bg-white py-2"},se={class:"space-y-2"},te=["onClick"],oe={class:"text-sm font-medium text-gray-800"},ae={key:0,class:"text-xs text-gray-500"},re=j({__name:"IssueSelector",props:{modelValue:{},modelModifiers:{}},emits:D(["select"],["update:modelValue"]),setup(S,{emit:i}){const{t:_}=z(),h=i,b=M(),{issues:m}=B(b),v=E(S,"modelValue"),V=C(()=>{var o;const e=(o=m.value)==null?void 0:o.find(t=>t.id===v.value);return e?d(e)?"e-Pub":e.volume==0&&e.issueNumber==0?w(e.issueType||""):`Volume ${e.volume}, Issue ${e.issueNumber}`:_("shared.selectIssue")}),I=C(()=>{if(!m.value)return[];const e=m.value.filter(s=>d(s)),o=m.value.filter(s=>s.isPublished===!0&&!d(s)),t=[];e.length>0&&t.push({year:"e-Pub",items:e});const r=o.filter(s=>s.volume==0&&s.issueNumber==0),n=o.filter(s=>!(s.volume==0&&s.issueNumber==0));if(r.length>0){const s=new Map;for(const u of r){const $=u.issueType||"Special",T=s.get($)||[];T.push(u),s.set($,T)}for(const[u,$]of s.entries())t.push({year:u,items:$})}for(const s of n){const u=t[t.length-1];!u||u.year!==(s.year??0)?t.push({year:s.year??0,items:[s]}):u.items.push(s)}return t});function d(e){const o=(e.id||"").trim().toLowerCase(),t=(e.issueType||"").trim().toLowerCase();return o==="e-pub"||t==="e-pub"}function w(e){if(!e)return"e-Pub";const t=`issues.types.${e.trim().toLowerCase().replace(/\s+/g,"-")}`,r=_(t);return r!==t?r:e}function p(e){v.value=e.id,h("select",e)}function N(e){return e.year&&e.month?`${e.year}-${String(e.month).padStart(2,"0")}`:e.year?String(e.year):""}return(e,o)=>{const t=R;return a(),G(y(Y),{class:"relative"},{default:k(()=>[c(y(W),{class:"bg-white border border-gray-300 text-gray-700 text-sm font-medium py-2 px-4 rounded-full shadow flex items-center gap-2 hover:border-primary focus:outline-none focus:ring-2 focus:ring-primary"},{default:k(()=>[c(t,{name:"lucide:calendar",class:"w-4 h-4"}),P(" "+f(y(V))+" ",1),c(t,{name:"lucide:chevron-down",class:"w-4 h-4"})]),_:1}),c(A,{name:"fade"},{default:k(()=>[c(y(X),{class:"absolute z-10 mt-2 w-72 max-h-80 overflow-y-auto bg-white border border-gray-200 rounded-xl shadow-xl px-4 scroll-smooth overflow-x-hidden"},{default:k(({close:r})=>[(a(!0),l(x,null,L(y(I),n=>(a(),l("div",{key:n.year},[g("h4",ee,f(typeof n.year=="string"?w(String(n.year)):n.year),1),g("div",se,[(a(!0),l(x,null,L(n.items,s=>(a(),l("div",{key:s.id,onClick:u=>{p(s),r()},class:"cursor-pointer px-3 py-2 rounded-lg hover:bg-primary/10 transition"},[g("p",oe,[d(s)?(a(),l(x,{key:0},[P(" e-Pub ")],64)):s.volume==0&&s.issueNumber==0?(a(),l(x,{key:1},[P(f(w(s.issueType||"")),1)],64)):(a(),l(x,{key:2},[P(" Volume "+f(s.volume)+", Issue "+f(s.issueNumber),1)],64))]),d(s)?F("",!0):(a(),l("p",ae,f(N(s)),1))],8,te))),128))])]))),128))]),_:1})]),_:1})]),_:1})}}}),ne={class:"pt-4 pb-16 bg-zinc-50"},ue={class:"container mx-auto px-4 max-w-screen-xl"},le={class:"flex mb-10"},fe=j({__name:"articles",async setup(S){let i,_;const{locale:h}=z(),b=J(),m=q(),v=M(),{journal:V}=B(v),{data:I,status:d,error:w}=([i,_]=U(()=>Z(`journaldetails:${h.value}:issues`,()=>{var e;return $fetch(`/api/${h.value}/journals/${(e=V.value)==null?void 0:e.id}/issues`)},{server:!0,watch:[()=>h.value,()=>b.params.slug]})),i=await i,_(),i);I.value&&(v.issues=I.value);const p=H(b.params.issueId);function N(e){p.value=e.id,Q(m({name:"journals-slug-articles-issueId",params:{slug:b.params.slug,issueId:e.id}}))}return(e,o)=>{const t=re,r=O;return a(),l("section",ne,[g("div",ue,[g("div",le,[c(t,{modelValue:y(p),"onUpdate:modelValue":o[0]||(o[0]=n=>K(p)?p.value=n:null),onSelect:N},null,8,["modelValue"])]),c(r)])])}}});export{fe 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.