import{T as M}from"./TranslationNotice.82fc4418.js";import{A as T,_ as G}from"./Footer.d2beca6f.js";import{f as N,q as V,m as g,s as B,c,a as e,b as s,j as u,v as D,t as n,x as I,y as S,z as b,n as p,F as v,r as y,w as j,l as h,o as d,d as k}from"./entry.7d488e22.js";import{u as z}from"./index.5cd502d4.js";import{A as x,_ as o}from"./Button.c38369dc.js";import{G as $}from"./GameNavbar.ba487733.js";import{i as A}from"./links.30cf72e1.js";import{u as E}from"./vue.f36acd1f.1bc9aa1f.js";import"./nuxt-link.5732dbb1.js";import"./Navbar.e43cda71.js";import"./unicorn.d30f64a6.js";const F={class:"min-h-screen"},H={class:"container"},O={class:"relative"},P={class:"w-full relative mb-4 block p-4 md:p-8 transition-all border border-gray-200 rounded-lg shadow bg-gray-100"},q={class:""},R={class:"block w-full"},U=["for"],W={class:"relative"},J=["id"],K={class:"absolute -left-12 rotate-90 top-1"},Q={class:"text-xl md:text-5xl font-bold text-gray-800 hyphenate ml-4 md:ml-8"},X={class:"text-base md:text-lg"},Y={key:0},Z={class:"text-md md:text-xl text-gray-800 font-bold"},tt=["innerHTML"],et={key:1},st={class:"text-md md:text-xl text-gray-800 font-bold"},it={class:"text-base md:text-lg"},ot={class:"flex items-center"},at={key:2},lt={class:"text-md md:text-xl text-gray-800 font-bold"},nt={class:"text-base md:text-lg"},rt={class:"flex items-center"},dt={key:3},ct={class:"text-base text-gray-800 font-bold"},ut={class:"text-sm md:text-md list-decimal list-inside-out"},ht=["href"],mt={key:0},pt={class:"flex justify-between items-end"},gt=e("div",null,null,-1),ft={class:"relative"},kt={class:"rotate-180 z-20 absolute -top-8"},_t={class:"inline-flex hyphenate items-center"},vt={components:{Space:o,AppButton:x,AppFooter:T,GameNavbar:$},data:function(){return{completed:!1,tasks:g,links:A,filterTags:h,visited:!0}},computed:{task:function(){for(let r in g)if(g[r].slug[this.$i18n.locale]==this.$route.params.slug)return g[r];return!1},targetGroupTags:function(){let r=[];for(let i in h)h[i].type=="target-group"&&this.task.tags&&this.task.tags.includes(h[i].key)&&r.push(h[i]);return r},otherTags:function(){let r=[];for(let i in h)h[i].type!="target-group"&&this.task.tags&&this.task.tags.includes(h[i].key)&&r.push(h[i]);return r},populatedLinks(){var r=[];return this.task&&this.task.links&&this.task.links.length&&this.task.links.forEach(i=>{r.push(this.links[i])}),r.sort((i,m)=>(i.date||(i.date=""),m.date||(m.date=""),i.date<m.date?1:i.date>m.date?-1:0))}},watch:{completed:{handler(r,i){r&&this.$game.sendMessage(this.$t("unicornDetailTaskComplete"))}}},mounted:function(){this.completed=this.$game.isChecked(this.task.id),this.task.checked&&!this.completed&&(this.completed=!0,this.change()),localStorage.getItem("visited-task-detail")===null&&(this.visited=!1,localStorage.setItem("visited-task-detail","true"),this.$game.sendMessage(this.$t("unicornDetailWelcome")))},methods:{change(){this.completed?this.$game.check(this.task.id):this.$game.uncheck(this.task.id)}}},Vt=Object.assign(vt,{__name:"[slug]",setup(r){const{locale:i,t:m}=N(),{slug:w}=V().params;let a=!1;for(let t in g)g[t].slug[i.value]==w&&(a=g[t]);if(!a)throw B({statusCode:404,statusMessage:"Task slug not found"});return a&&(E({title:a.title[i.value]+" - "+m("title"),meta:[{name:"description",content:a.shortText[i.value]}]}),z({title:a.title[i.value]+" - "+m("title"),ogTitle:a.title[i.value]+" - "+m("title"),description:a.shortText[i.value],ogDescription:a.shortText[i.value],ogImage:"https://smartphone-dont-spy.de/icon.png"})),(t,_)=>{const L=M,f=G;return d(),c(v,null,[e("div",F,[s($,{task:u(a)},null,8,["task"]),s(L),e("div",H,[e("div",null,[s(o),s(o),s(o),s(o),e("div",O,[e("div",P,[e("div",q,[e("div",R,[e("div",{class:D((t.completed?"":"animate-pulse")+" text-sm md:text-lg italic mb-2 md:mb-4")},n(u(a).points)+" "+n(t.$t("listPoints")),3),e("label",{for:"checkbox"+u(a).id,class:"cursor-pointer flex items-center"},[e("div",W,[I(e("input",{id:"checkbox"+u(a).id,type:"checkbox","onUpdate:modelValue":_[0]||(_[0]=l=>t.completed=l),onChange:_[1]||(_[1]=(...l)=>t.change&&t.change(...l)),value:"",class:"accent-pink-600 w-6 h-6 md:w-12 md:h-12 rounded focus:ring-pink-300 focus:ring-2"},null,40,J),[[S,t.completed]]),e("div",K,[!t.visited&&!t.completed?(d(),b(f,{key:0,class:"h-8 w-8 animate-bounce fill-pink-400",type:"pointer"})):p("",!0)])]),e("h1",Q,n(u(a).title[t.$i18n.locale]),1)],8,U),s(o),s(o),e("div",X,n(u(a).shortText[t.$i18n.locale]),1),u(a).longText&&Object.keys(u(a).longText).length&&u(a).longText[t.$i18n.locale]?(d(),c("div",Y,[s(o),s(o),e("h2",Z,n(t.$t("listMoreInformation")),1),s(o),e("div",{class:"text-base md:text-lg",innerHTML:u(a).longText[t.$i18n.locale]},null,8,tt)])):p("",!0),t.targetGroupTags.length?(d(),c("div",et,[s(o),s(o),e("h2",st,n(t.$t("targetGroups")),1),s(o),e("ul",it,[(d(!0),c(v,null,y(t.targetGroupTags,l=>(d(),c("li",{key:l.key},[e("span",ot,[s(f,{class:"mr-2 h-4 w-4 fill-gray-800",type:l.icon},null,8,["type"]),k(" "+n(l.title[t.$i18n.locale]),1)])]))),128))])])):p("",!0),t.otherTags.length?(d(),c("div",at,[s(o),s(o),e("h2",lt,n(t.$t("listTags")),1),s(o),e("ul",nt,[(d(!0),c(v,null,y(t.otherTags,l=>(d(),c("li",{key:l.key},[e("span",rt,[s(f,{class:"mr-2 h-4 w-4 fill-gray-800",type:l.icon},null,8,["type"]),k(" "+n(l.title[t.$i18n.locale]),1)])]))),128))])])):p("",!0),u(a).links&&u(a).links.length?(d(),c("div",dt,[s(o),s(o),e("h2",ct,n(t.$t("listLinks")),1),s(o),e("ol",ut,[(d(!0),c(v,null,y(t.populatedLinks,(l,C)=>(d(),c("li",{key:C},[e("a",{target:"_blank",href:l.url,class:"underline"},n(l.title[t.$i18n.locale]),9,ht),k(", "),e("span",null,n(l.vendor),1),k(", "),e("span",null,"("+n(l.language)+")",1),l.date?(d(),c("span",mt,", "+n(l.date),1)):p("",!0)]))),128))])])):p("",!0)]),s(o)])]),e("div",pt,[gt,e("div",ft,[e("div",kt,[!t.visited&&t.completed?(d(),b(f,{key:0,class:"h-8 w-8 animate-bounce fill-pink-400",type:"pointer"})):p("",!0)]),s(x,{to:t.localePath("list"),"aria-label":t.$t("backToList"),color:"light",text:"text-black",class:"relative z-10 hover:scale-105 transition-all cursor-pointer max-w-full animate-pulse"},{default:j(()=>[e("span",_t,[s(f,{class:"mr-2 h-4 w-4 fill-black",type:"left"}),k(" "+n(t.$t("backToList")),1)])]),_:1},8,["to","aria-label"])])])]),s(o),s(o)])])]),s(T)],64)}}});export{Vt as default};
