1import{cR as D,cS as te,a_ as ze,a$ as Se,bR as xe,bK as Ce,bm as J,c1 as $e,bh as se,bJ as Te,cT as S,bp as Pe,cN as j,cO as Be,ba as _,bD as Ne,b2 as a,bb as x,b8 as u,b0 as c,b6 as M,b4 as C,bl as Ie,b7 as R,ci as ae,b1 as $,b3 as U,bc as V,bj as Y,b5 as Le,bk as H,bU as Fe,cr as T,cU as Re,cV as p}from"./entry.BT-GcA26.js";import{_ as Ue}from"./Skeleton.CszveRBM.js";import{a as Ve}from"./useGameBoard.Cq3L-TZt.js";import{_ as Ye,u as Ge}from"./PuzzleSelect.WOf8GPOt.js";import{_ as Ee}from"./Dialog.zXsku0v-.js";import{_ as Ae}from"./Page.Oo5dKSZy.js";import{$ as K}from"./game.Bk4LzXKG.js";import{g as Oe}from"./query.CLPQbI2c.js";import{u as qe,a as Je}from"./useJsonLd.CCcoJBgq.js";import{g as ne}from"./getDaysInMonth.Dyf8VdC6.js";import"./index.CY4sy0zI.js";import"./_plugin-vue_export-helper.B4sLsGaW.js";import"./Button.Cyq_1Kk1.js";import"./FocusScope.vZRDqEai.js";import"./useId.BkyRk-on.js";import"./DismissableLayer.DysIzGYx.js";import"./handleAndDispatchCustomEvent.HoFjh67n.js";import"./utils.CFFPIcGQ.js";import"./index._MyRakCg.js";import"./overlay.ME3bREg8.js";import"./Spinner.ClzqoHOl.js";import"./Offline.CjJqx8LO.js";import"./SmartAdServerContainer.BlyKuxVt.js";import"./FeatureGate.BKRsCcY0.js";import"./useIsNativeDev.aL6Pvc_D.js";import"./useHeaderOffset.DBzKheNk.js";import"./AuthIsland.DpilMDyZ.js";import"./differenceInDays.eTz2fkgQ.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};t.SENTRY_RELEASE={id:"3908-6ef0368"},t._sentryModuleMetadata=t._sentryModuleMetadata||{},t._sentryModuleMetadata[new t.Error().stack]=(function(o){for(var i=1;i<arguments.length;i++){var g=arguments[i];if(g!=null)for(var f in g)g.hasOwnProperty(f)&&(o[f]=g[f])}return o})({},t._sentryModuleMetadata[new t.Error().stack],{"_sentryBundlerPluginAppKey:kleinezeitung-ui":!0});var n=new t.Error().stack;
1n&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[n]="f2deeef3-7923-42e7-8c20-0bee7c476434",t._sentryDebugIdIdentifier="sentry-dbid-f2deeef3-7923-42e7-8c20-0bee7c476434")}catch{}})();function G(t,n,o){const i=D(t,o?.in);if(isNaN(n))return te(t,NaN);if(!n)return i;const g=i.getDate(),f=te(t,i.getTime());f.setMonth(i.getMonth()+n+1,0);const l=f.getDate();return g>=l?f:(i.setFullYear(f.getFullYear(),f.getMonth(),g),i)}function re(t,n,o){return G(t,n*12,o)}function Q(t,n){const o=D(t,n?.in),i=o.getMonth();return o.setFullYear(o.getFullYear(),i+1,0),o.setHours(23,59,59,999),o}function w(t,n){const o=D(t,n?.in);return o.setDate(1),o.setHours(0,0,0,0),o}function je(t,n){return D(t,n?.in).getDay()}function oe(t,n){return+D(t)>+D(n)}function P(t,n){return+D(t)<+D(n)}function le(t,n,o){return G(t,-1,o)}function He(t,n,o){return re(t,-1,o)}const Ke={class:"flex flex-col gap-4 pt-2"},Qe={class:"flex flex-row justify-center w-full gap-2"},Ze={class:"grow text-center klz-text-headline-xs"},We=["aria-busy","aria-label"],Xe={class:"text-center"},et={class:"klz-text-headline-xs"},tt={class:"!text-xs sm:!text-sm truncate"},Tt=ze({__name:"archiv",setup(t){const n=Se(),o=xe(),i=Ce(),g=u(()=>n.params.slug),f=n.query.date?new Date(n.query.date):new Date,l=J(w(f)),ie=u(()=>p(w(l.value))),ue=u(()=>{const e=p(new Date),r=p(Q(l.value));return oe(r,e)?e:r}),Z=u(()=>!0),ce=u(()=>({slug:g.value,from:S(ie.value,"yyyy-MM-dd'T'00:00:00'Z'"),to:S(ue.value,"yyyy-MM-dd'T'00:00:00'Z'")})),{result:de,loading:B,refetch:me}=$e(Oe,ce,{enabled:Z,errorPolicy:"ignore"}),h=u(()=>K.getGameBySlug(g.value)),v=u(()=>K.mapGame(de.value?.game)),W=u(()=>v.value?.puzzles??[]);se(async()=>{await me()});const{isSingleRegime:fe,isSingleRegimeSingleDifficulty:pe}=Ge(v,W),E=u(()=>{if(!v.value?.firstPuzzleTime)return p(new Date(0));const e=new Date(v.value.firstPuzzleTime);return p(new Date(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()))}),A=u(()=>p(new Date)),ge=e=>{const r=p(e);return!(oe(r,A.value)||P(r,E.value))},he=u(()=>{const e=new Map;for(const r of W.value){const m=S(new Date(r.publishTime),"yyyy-MM-dd"),k=e.get(m)??[];k.push(r),e.set(m,k)}return e}),ye=u(()=>{const e=[],r=ne(l.value);for(let m=0;m<r;m++){const k=m+1,b=new Date(l.value.getFullYear(),l.value.getMonth(),k),O=S(b,"yyyy-MM-dd"),d=he.value.get(O)??[],F=d.length>0&&d.every(y=>y.userSession?.status===T.Completed),q=d.length>0&&!F&&d.every(y=>y.userSession?.status===T.Lost),s=d.filter(y=>y.userSession?.status===T.Completed).length,ee=d.length>1&&s>0&&s<d.length,ke=d.some(y=>y.userSession?.status===T.InProgress||y.userSession?.status===T.Paused),we=d.some(y=>!!y.userSession);e.push({date:b,day:k,puzzles:d,isToday:Re(b),isSelectable:ge(b)&&d.length>0,allCompleted:F,allLost:q,partiallyCompleted:ee,hasInProgress:ke,hasSession:we})}return e}),N=u(()=>{const e=le(l.value),r=p(Q(e));return!P(r,E.value)}),I=u(()=>{const e=G(l.value,1);return P(p(w(e)),A.value)});function ve(){if(N.value){const e=He(l.value),r=p(Q(e));P(r,E.value)||(l.value=w(e))}}function be(){N.value&&(l.value=le(l.value))}function _e(){I.value&&(l.value=G(l.value,1))}function Me(){if(I.value){const e=re(l.value,1);P(p(w(e)),A.value)&&(l.value=w(e))}}Te(l,()=>{o.replace({query:{date:S(l.value,"yyyy-MM-dd")}})});const z=J(!1),L=J(null);function De(e){if(e.isSelectable){if(fe.value&&pe.value||e.puzzles.length===1){o.push(`/spiele/${v.value?.slug}/${e.puzzles[0].id}`);return}L.value=e,z.value=!0}}Pe({title:()=>`Archiv | ${h.value?.name}`,meta:[{name:"description",content:()=>h.value?.description},{property:"og:image",content:()=>h.value?.image??i("/meta.png")}]});const X=qe();return Je(()=>[X.getGame(h.value),X.getBreadcrumbList([{url:i("/spiele"),name:"Spiele"},{url:i(`/spiele/${h.value?.slug}`),name:h.value?.name},{url:i(n.path),name:`${h.value?.name} Archiv`}])]),j(()=>h.value?.image),se(()=>j(()=>h.value?.image)),Be(()=>{j("/icons/favicon-32x32.png")}),(e,r)=>{const m=Ie,k=Ue,b=Le,O=Ve,d=Ye,F=Ee,q=Ae;return c(),_(q,{header:{title:`${a(h)?.name??"Spiele"} Archiv`,showBackBtn:!0},"show-sitebar-ad":!1,"pull-to-refresh":!1,"feature-gate":"enable_games","content-client-only":""},Ne({default:x(()=>[C(F,{modelValue:a(z),"onUpdate:modelValue":r[1]||(r[1]=s=>Fe(z)?z.value=s:null),title:a(L)?("$date"in e?e.$date:a(ae)).format(a(L).date,"dd. MMMM yyyy"):"Variante wählen"},{default:x(()=>[a(v)?(c(),_(d,{key:0,game:a(v),puzzles:a(L)?.puzzles??[],onClick:r[0]||(r[0]=s=>z.value=!1)},null,8,["game","puzzles"])):H("",!0)]),_:1},8,["modelValue","title"])]),_:2},[a(v)||a(B)?{name:"content",fn:x(()=>[M("div",Ke,[M("section",Qe,[C(m,{color:"neutral",icon:"i-cis:chevron-double-left","aria-label":"Vorheriges Jahr",disabled:!a(N),class:"rounded-full",onClick:ve},null,8,["disabled"]),C(m,{color:"neutral",icon:"i-cis:chevron-left","aria-label":"Vorheriges Monat",disabled:!a(N),class:"rounded-full",onClick:be},null,8,["disabled"]),M("div",Ze,R(("$date"in e?e.$date:a(ae)).format(a(l),"MMMM yyyy")),1),C(m,{color:"neutral",icon:"i-cis:chevron-right","aria-label":"Nächstes Monat",disabled:!a(I),class:"rounded-full",onClick:_e},null,8,["disabled"]),C(m,{color:"neutral",icon:"i-cis:chevron-double-right","aria-label":"Nächstes Jahr",disabled:!a(I),class:"rounded-full",onClick:Me},null,8,["disabled"])]),M("section",{class:"grid grid-cols-7 gap-1 sm:gap-2","aria-busy":a(B),"aria-label":a(B)?"Tage werden geladen":void 0},[(c(),$(U,null,V(["So","Mo","Di","Mi","Do","Fr","Sa"],s=>M("div",{key:s,class:"text-center p-3 klz-text-info-lg"},R(s),1)),64)),(c(!0),$(U,null,V(a(je)(a(l)),s=>(c(),$("div",{key:`offset-${s}`}))),128)),a(B)?(c(!0),$(U,{key:0},V(a(ne)(a(l)),s=>(c(),_(k,{key:`skeleton-${s}`,class:"aspect-square rounded-lg animate-pulse"}))),128)):(c(!0),$(U,{key:1},V(a(ye),s=>(c(),_(m,{key:s.day,variant:s.isToday?"solid":"outline",color:s.isToday?"primary":"neutral",disabled:!s.isSelectable,class:Y([{"!opacity-50":!s.isSelectable},"relative aspect-square flex justify-center px-0 sm:px-1"]),onClick:ee=>De(s)},{default:x(()=>[M("div",Xe,[s.allCompleted?(c(),_(b,{key:0,name:"i-cis:circle-check-solid",class:Y([{"text-success":!s.isToday},"absolute top-0 right-0 w-4 h-4 m-1 sm:w-5 sm:h-5 sm:m-1.5"]),"aria-hidden":""},null,8,["class"])):s.allLost?(c(),_(b,{key:1,name:"i-cis:circle-x-solid",class:Y([{"text-error":!s.isToday},"absolute top-0 right-0 w-4 h-4 m-1 sm:w-5 sm:h-5 sm:m-1.5"]),"aria-hidden":""},null,8,["class"])):s.hasInProgress?(c(),_(b,{key:2,name:"i-cis:clock-solid",class:"absolute top-0 right-0 w-4 h-4 m-1 sm:w-5 sm:h-5 sm:m-1.5","aria-hidden":""})):s.partiallyCompleted?(c(),_(b,{key:3,name:"i-cis:pie-chart-1-solid",class:Y([{"text-info":!s.isToday},"absolute top-0 right-0 w-4 h-4 m-1 sm:w-5 sm:h-5 sm:m-1.5"]),"aria-hidden":""},null,8,["class"])):H("",!0),M("div",et,R(s.day),1),M("div",tt," #â"+R(("$game"in e?e.$game:a(K)).getGameNumber(a(v),s.date)),1)])]),_:2},1032,["variant","color","disabled","class","onClick"]))),128))],8,We)])]),key:"0"}:{name:"placeholder",fn:x(()=>[a(Z)?(c(),_(O,{key:0})):H("",!0)]),key:"1"}]),1032,["header"])}}});
1export{Tt 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.