1import{A as e,C as t,D as n,E as r,G as i,M as a,O as o,T as s,s as c}from"./bugsnag-BdxMK30U.js";import{G as l,H as u,Zt as d,b as f,ct as p,d as m,f as h,h as g,i as _,m as v,ot as y,p as b,q as x,qt as S,y as C,yt as w}from"./runtime-core.esm-bundler-UheJ8LN3.js";import{n as T}from"./runtime-dom.esm-bundler-D7tVTH1H.js";import{i as E,r as D,s as O}from"./pinia-OySfIGJ0.js";import{t as k}from"./usePrefetchData-DJp9-NO0.js";import{t as A}from"./VChip-Do08bGXy.js";import{t as j}from"./VSpacer-VTIKE9eJ.js";import{t as M}from"./useUserOptions-CcQkERYH.js";import{T as N,c as P,d as F,gt as I,ht as L}from"./app-CnPq_KEX.js";import{t as R}from"./LoadingDummyCustom-5E5fkQKj.js";import{t as z}from"./Overlay-BaYjlFzu.js";import{t as B}from"./H1Title-DGl_F-iT.js";import{t as V}from"./SearchFilter-DaUHEMGS.js";import{t as H}from"./InfiniteScroll-mOk6GgZi.js";import{t as U}from"./ButtonListGrid-CDws_J3R.js";import{t as W}from"./useComponentIsActive-BRY11LsH.js";import{t as G}from"./SwitchFilter-Dxys-nCx.js";import{t as K}from"./SortOptions-d567uyaS.js";import{n as q,t as J}from"./tag-8Po5EfSK.js";function Y(){let t=D(),n=q(t),{tags:r,reload:i,search:o}=O(n),{messagesLoaded:s,asyncStatus:c,updateData:l}=k({actions:[{item:r,action:n.getTags,payload:{page:1}}],loadAsyncMessages:[`tag`,`common`]}),{componentIsActive:u}=W();y(i,async(e,t)=>{e&&e!==t&&u&&(await l(),n.reload=!1)});let d=w(o.value);y(d,a(e=>o.value=e,300),{immediate:!0}),y(o,()=>{n.reload=!1,setTimeout(()=>{n.reload=!0})});let f=m(P(`tag/list/my`));y(f,()=>n.reload=!0);let{getUserOption:p}=M(),h=w(p(`tag/list/my`));y(h,a(t=>{f.value=t,g.value===`color`&&(g.value=e)},300),{immediate:!0});let g=m(P(`tag/list/sort`));y(g,()=>n.reload=!0);let _=m(P(`tag/gridView`));return{messagesLoaded:s,asyncStatusLoaded:m(()=>c.value===2),tags:r,debouncedSearch:d,my:h,componentIsActive:u,sort:g,gridView:_}}var X={name:`TagList`,components:{InfiniteScroll:H,SortOptions:K,SwitchFilter:G,SearchFilter:V,H1Title:B,LoadingDummyCustom:R,ButtonListGrid:U,Overlay:z},setup(){F({titleKey:`async.tag.list.title`});let a=D(),{page:l,maxPages:u}=O(q(a)),{loggedIn:d}=O(c(a)),{backToList:f}=O(J(a)),{printing:p}=O(i(a)),{messagesLoaded:h,asyncStatusLoaded:g,tags:_,debouncedSearch:v,my:y,componentIsActive:b,sort:x,gridView:S}=Y();return{page:l,maxPages:u,loggedIn:d,backToList:f,printing:p,messagesLoaded:h,asyncStatusLoaded:g,tags:_,debouncedSearch:v,my:y,componentIsActive:b,sort:x,gridView:S,...I(),colors:L,sortEnum:m(()=>{let i=[e,n,t,s];return y.value&&i.push(r),v.value.length!==0&&i.push(o),i})}},data(){return{loadingNext:!1,gridDummyCount:50}},computed:{randomTagWidth:function(){return Array(this.gridDummyCount).fill(0).map(()=>Math.floor(Math.random()*121+50)+`px`)}},methods:{...E(q,[`getTags`]),getColor:function(e){if(e.user_tags!==void 0){let t=e.user_tags[0].color;if(t!==void 0)return t}return``},getMoreResults(){if(this.page===this.maxPages)return;this.loadingNext=!0;let e=this.page+1,t=this;this.getTags({page:e}).then(()=>{t.loadingNext=!1,this.$bsa&&this.$bsa.event({eventCategory:`load more`,eventAction:`Tags nachladen`,eventLabel:e})})}}},Z={class:`d-flex mb-7`},Q={class:`d-flex align-center mb-7`},$={key:0,class:`d-flex flex-wrap`},ee={key:0},te={key:1};function ne(e,t,n,r,i,a){let o=x(`h1-title`),s=x(`button-list-grid`),c=x(`search-filter`),m=x(`switch-filter`),y=x(`sort-options`),w=x(`router-link`),E=x(`infinite-scroll`),D=x(`loading-dummy-custom`),O=x(`overlay`);return u(),b(O,{"class-name":`tag-list`},{default:p(()=>[h(`div`,Z,[f(o,{"title-key":`async.tag.list.title`}),f(j),f(s,{"grid-view":r.gridView,onToggle:t[0]||=e=>r.gridView=!r.gridView},null,8,[`grid-view`])]),f(c,{modelValue:r.debouncedSearch,"onUpdate:modelValue":t[1]||=e=>r.debouncedSearch=e,"label-key":`async.tag.list.filter_placeholder`},null,8,[`modelValue`]),h(`div`,Q,[f(m,{modelValue:r.my,"onUpdate:modelValue":t[2]||=e=>r.my=e,disabled:!r.loggedIn,"label-key":`async.tag.list.only_my`},null,8,[`modelValue`,`disabled`]),f(j),f(y,{modelValue:r.sort,"onUpdate:modelValue":t[3]||=e=>r.sort=e,types:r.sortEnum},null,8,[`modelValue`,`types`])]),r.gridView?v(``,!0):(u(),b(T,{key:0,name:`scale-trans`,tag:`div`,class:`d-flex flex-wrap tag-list`},{default:p(()=>[(u(!0),g(_,null,l(r.tags,(e,n)=>(u(),b(w,{key:`list-item`+e.id,class:S([{first:n===0},`tag-list-item`,a.getColor(e)]),to:r.my?{path:`/tag/${encodeURIComponent(e.key)}`,query:{filter:`my`}}:{path:`/tag/${encodeURIComponent(e.key)}`},onClick:t[4]||=e=>r.backToList=!0},{default:p(()=>[C(d(e.key),1)]),_:2},1032,[`class`,`to`]))),128))]),_:1})),r.gridView?(u(),b(T,{key:1,name:`scale-trans`,tag:`div`,class:`d-flex flex-wrap tag-grid`},{default:p(()=>[(u(!0),g(_,null,l(r.tags,e=>(u(),b(w,{key:`grid-item`+e.id,to:r.my?{path:`/tag/${encodeURIComponent(e.key)}`,query:{filter:`my`}}:{path:`/tag/${encodeURIComponent(e.key)}`},onClick:t[5]||=e=>r.backToList=!0},{default:p(()=>[f(A,{class:S([`tag-grid-item`,a.getColor(e)]),label:``},{default:p(()=>[C(d(e.key),1)]),_:2},1032,[`class`])]),_:2},1032,[`to`]))),128)),f(j,{key:`spacer`})]),_:1})):v(``,!0),r.page<r.maxPages&&!r.printing&&r.asyncStatusLoaded?(u(),g(_,{key:2},[(u(!0),g(_,null,l(r.gridView?i.gridDummyCount:10,e=>
1(u(),b(D,{key:`tag_dummy_`+e,height:r.gridView?`32px`:`24px`,width:r.gridView?a.randomTagWidth[e]:`100%`,margin:r.gridView?`4px`:`12px`},{default:p(()=>[e===1?(u(),b(E,{key:0,handler:a.getMoreResults,"should-handle":!i.loadingNext&&r.componentIsActive,class:S([`layout`,`wrap`,`hidden-print-only`,{"justify-space-between":r.gridView}]),style:{margin:`4px -4px`}},null,8,[`handler`,`should-handle`,`class`])):v(``,!0)]),_:2},1032,[`height`,`width`,`margin`]))),128)),r.gridView?(u(),b(j,{key:0})):v(``,!0)],64)):v(``,!0),r.messagesLoaded?(u(),g(_,{key:3},[r.tags.length===0&&r.debouncedSearch.length!==0?(u(),g(`div`,$,[r.my?(u(),g(`p`,ee,d(e.t(`async.tag.list.no_my_items`)),1)):(u(),g(`p`,te,d(e.t(`async.tag.list.no_filtered_items`)),1))])):v(``,!0)],64)):v(``,!0)]),_:1})}var re=N(X,[[`render`,ne]]);export{re as default}; 2//# sourceMappingURL=TagList-IGx78TU2.js.map
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.