inhaus-plugin-gruppen/dist/chunks/PostCard-BrusE-7w.js
Friederich Loheide c2792f6a63 Volle Breite mit Seitenleiste in Gruppen (1.0.1)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-27 18:42:03 +00:00

1 line
No EOL
19 KiB
JavaScript

import{n as e,t}from"./loader-circle-CxzeMpQS.js";import{Fragment as n,computed as r,createBlock as i,createCommentVNode as a,createElementBlock as o,createElementVNode as s,createTextVNode as c,createVNode as l,normalizeClass as u,normalizeStyle as d,openBlock as f,ref as p,renderList as m,resolveDynamicComponent as h,toDisplayString as g,unref as _,vModelText as v,withCtx as y,withDirectives as b,withModifiers as x}from"vue";import{Button as S,DropdownMenu as C,DropdownMenuContent as w,DropdownMenuItem as T,DropdownMenuTrigger as ee,FileIcon as te,PersonAvatar as E,formatRelative as D,http as O,toast as k}from"@inhaus/ui";var A=e({name:`corner-down-right`,size:24,node:[[`path`,{d:`m15 10 5 5-5 5`,key:`qqa56n`}],[`path`,{d:`M4 4v7a4 4 0 0 0 4 4h12`,key:`z08zvw`}]]}),ne=e({name:`download`,size:24,node:[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]}),re=e({name:`ellipsis`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]],aliases:[`more-horizontal`]}),j=e({name:`flag`,size:24,node:[[`path`,{d:`M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528`,key:`1jaruq`}]]}),ie=e({name:`message-circle`,size:24,node:[[`path`,{d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719`,key:`1sd12s`}]]}),ae=e({name:`pencil`,size:24,node:[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]}),M=e({name:`pin-off`,size:24,node:[[`path`,{d:`M12 17v5`,key:`bb1du9`}],[`path`,{d:`M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89`,key:`znwnzq`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11`,key:`c9qhm2`}]]}),N=e({name:`pin`,size:24,node:[[`path`,{d:`M12 17v5`,key:`bb1du9`}],[`path`,{d:`M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z`,key:`1nkz8b`}]]}),P=e({name:`send-horizontal`,size:24,node:[[`path`,{d:`M3.714 3.048a.498.498 0 0 0-.683.627l2.843 7.627a2 2 0 0 1 0 1.396l-2.842 7.627a.498.498 0 0 0 .682.627l18-8.5a.5.5 0 0 0 0-.904z`,key:`117uat`}],[`path`,{d:`M6 12h16`,key:`s4cdu5`}]],aliases:[`send-horizonal`]}),F=e({name:`trash`,size:24,node:[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]],aliases:[`trash-2`]});function I(e){let t=[],n=/(https?:\/\/[^\s<>"']+[^\s<>"'.,;:!?)\]])/g,r=0;for(let i of(e??``).matchAll(n))i.index>r&&t.push({text:e.slice(r,i.index)}),t.push({text:i[0],href:i[0]}),r=i.index+i[0].length;return r<(e??``).length&&t.push({text:e.slice(r)}),t}function L(e){return e<1048576?`${Math.max(1,Math.round(e/1024))} KB`:`${(e/1024/1024).toFixed(1).replace(`.`,`,`)} MB`}var R={class:`ih:break-words ih:whitespace-pre-wrap`},z=[`href`],B={__name:`RichText`,props:{text:{type:String,default:``},limit:{type:Number,default:600}},setup(e){let t=e,i=p(!1),s=r(()=>t.text.length>t.limit),l=r(()=>s.value&&!i.value?`${t.text.slice(0,t.limit).trimEnd()} …`:t.text);return(e,t)=>(f(),o(`p`,R,[(f(!0),o(n,null,m(_(I)(l.value),(e,t)=>(f(),o(n,{key:t},[e.href?(f(),o(`a`,{key:0,href:e.href,target:`_blank`,rel:`noopener noreferrer`,class:`ih:text-brand-text ih:underline ih:underline-offset-2`},g(e.text),9,z)):(f(),o(n,{key:1},[c(g(e.text),1)],64))],64))),128)),s.value?(f(),o(`button`,{key:0,type:`button`,class:`ih:ml-1 ih:font-medium ih:text-brand-text ih:hover:underline`,onClick:t[0]||=e=>i.value=!i.value},g(i.value?`Weniger`:`Mehr anzeigen`),1)):a(``,!0)]))}},V={class:`ih:grid ih:gap-3 ih:border-t ih:px-4 ih:pt-3 ih:pb-4 ih:sm:px-5`},H=[`id`],U={class:`ih:flex ih:gap-2.5`},W={class:`ih:min-w-0 ih:flex-1`},G={class:`ih:inline-block ih:max-w-full ih:rounded-2xl ih:bg-muted ih:px-3 ih:py-2 ih:text-sm`},K=[`href`],q={class:`ih:mt-0.5 ih:flex ih:gap-3 ih:px-3 ih:text-xs ih:text-muted-foreground`},J=[`onClick`],Y=[`aria-label`,`onClick`],X=[`id`],Z={class:`ih:min-w-0 ih:flex-1`},Q={class:`ih:inline-block ih:max-w-full ih:rounded-2xl ih:bg-muted ih:px-3 ih:py-2 ih:text-sm`},oe=[`href`],se={class:`ih:mt-0.5 ih:flex ih:gap-3 ih:px-3 ih:text-xs ih:text-muted-foreground`},ce=[`onClick`],le=[`onSubmit`],ue=[`placeholder`],de=[`disabled`],fe={__name:`Comments`,props:{post:{type:Object,required:!0},full:{type:Boolean,default:!1},initial:{type:Array,default:null}},setup(e){let r=e,c=p(r.initial??r.post.comments),u=p(r.full),d=p(``),h=p(null),y=p(``),S=p(!1);async function C(){c.value=(await O.get(`/gruppen/beitraege/${r.post.id}/kommentare`)).comments,u.value=!0}async function w(e,t=null){if(e.trim()){S.value=!0;try{let n=await O.post(`/gruppen/beitraege/${r.post.id}/kommentare`,{body:e,parent_id:t});c.value=n.comments,u.value=!0,r.post.comments_count=n.comments.reduce((e,t)=>e+1+t.replies.length,0),d.value=y.value=``,h.value=null}catch(e){k.error(e.message)}finally{S.value=!1}}}async function T(e){window.confirm(`Kommentar löschen?`)&&(await O.delete(`/gruppen/kommentare/${e.id}`),await C(),r.post.comments_count=c.value.reduce((e,t)=>e+1+t.replies.length,0))}return(r,p)=>(f(),o(`div`,V,[!u.value&&e.post.comments_count>c.value.length?(f(),o(`button`,{key:0,type:`button`,class:`ih:justify-self-start ih:text-[13px] ih:font-medium ih:text-muted-foreground ih:hover:text-foreground ih:hover:underline`,onClick:C},` Alle `+g(e.post.comments_count)+` Kommentare anzeigen `,1)):a(``,!0),(f(!0),o(n,null,m(c.value,t=>(f(),o(`div`,{id:`kommentar-${t.id}`,key:t.id,class:`ih:grid ih:gap-2`},[s(`div`,U,[t.user?(f(),i(_(E),{key:0,person:t.user,class:`ih:size-8 ih:text-[11px]`},null,8,[`person`])):a(``,!0),s(`div`,W,[s(`div`,G,[t.user?(f(),o(`a`,{key:0,href:`/personen/${t.user.id}`,class:`ih:font-semibold ih:hover:underline`},g(t.user.name),9,K)):a(``,!0),l(B,{text:t.body,limit:400},null,8,[`text`])]),s(`div`,q,[s(`span`,null,g(_(D)(t.created_at)),1),e.post.can_comment?(f(),o(`button`,{key:0,type:`button`,class:`ih:font-medium ih:hover:text-foreground`,onClick:e=>h.value=h.value===t.id?null:t.id},`Antworten`,8,J)):a(``,!0),t.can_delete?(f(),o(`button`,{key:1,type:`button`,class:`ih:hover:text-destructive`,"aria-label":`Kommentar von ${t.user?.name} löschen`,onClick:e=>T(t)},[l(_(F),{class:`ih:size-3.5`})],8,Y)):a(``,!0)])])]),(f(!0),o(n,null,m(t.replies,e=>(f(),o(`div`,{id:`kommentar-${e.id}`,key:e.id,class:`ih:ml-10 ih:flex ih:gap-2.5`},[e.user?(f(),i(_(E),{key:0,person:e.user,class:`ih:size-7 ih:text-[10px]`},null,8,[`person`])):a(``,!0),s(`div`,Z,[s(`div`,Q,[e.user?(f(),o(`a`,{key:0,href:`/personen/${e.user.id}`,class:`ih:font-semibold ih:hover:underline`},g(e.user.name),9,oe)):a(``,!0),l(B,{text:e.body,limit:400},null,8,[`text`])]),s(`div`,se,[s(`span`,null,g(_(D)(e.created_at)),1),e.can_delete?(f(),o(`button`,{key:0,type:`button`,class:`ih:hover:text-destructive`,"aria-label":`Antwort löschen`,onClick:t=>T(e)},[l(_(F),{class:`ih:size-3.5`})],8,ce)):a(``,!0)])])],8,X))),128)),h.value===t.id?(f(),o(`form`,{key:0,class:`ih:ml-10 ih:flex ih:items-center ih:gap-2`,onSubmit:x(e=>w(y.value,t.id),[`prevent`])},[l(_(A),{class:`ih:size-4 ih:shrink-0 ih:text-muted-foreground`}),b(s(`input`,{"onUpdate:modelValue":p[0]||=e=>y.value=e,maxlength:`3000`,placeholder:`Antwort an ${t.user?.name??``}`,"aria-label":`Antwort`,autofocus:``,class:`ih:h-9 ih:min-w-0 ih:flex-1 ih:rounded-full ih:border ih:border-input ih:bg-background ih:px-4 ih:text-sm ih:focus-visible:ring-3 ih:focus-visible:ring-ring/30 ih:focus-visible:outline-none`},null,8,ue),[[v,y.value]])],40,le)):a(``,!0)],8,H))),128)),e.post.can_comment?(f(),o(`form`,{key:1,class:`ih:flex ih:items-center ih:gap-2`,onSubmit:p[2]||=x(e=>w(d.value),[`prevent`])},[b(s(`input`,{"onUpdate:modelValue":p[1]||=e=>d.value=e,maxlength:`3000`,placeholder:`Kommentieren …`,"aria-label":`Kommentar`,class:`ih:h-9 ih:min-w-0 ih:flex-1 ih:rounded-full ih:border ih:border-input ih:bg-background ih:px-4 ih:text-sm ih:focus-visible:ring-3 ih:focus-visible:ring-ring/30 ih:focus-visible:outline-none`},null,512),[[v,d.value]]),s(`button`,{type:`submit`,class:`ih:grid ih:size-9 ih:shrink-0 ih:place-items-center ih:rounded-full ih:text-brand-text ih:hover:bg-brand-soft ih:disabled:opacity-40`,disabled:S.value||!d.value.trim(),"aria-label":`Kommentar senden`},[S.value?(f(),i(_(t),{key:0,class:`ih:size-4 ih:animate-spin`})):(f(),i(_(P),{key:1,class:`ih:size-4`}))],8,de)],32)):a(``,!0)]))}},pe=[`aria-label`],me={class:`ih:flex ih:items-start ih:gap-3 ih:px-4 ih:pt-4 ih:sm:px-5`},he={class:`ih:min-w-0 ih:flex-1 ih:text-sm`},ge={class:`ih:leading-snug`},_e=[`href`],ve=[`href`],$={class:`ih:flex ih:items-center ih:gap-1.5 ih:text-xs ih:text-muted-foreground`},ye=[`href`],be={key:1,class:`ih:inline-flex ih:items-center ih:gap-0.5 ih:font-medium ih:text-brand-text`},xe={type:`button`,class:`ih:grid ih:size-8 ih:place-items-center ih:rounded-full ih:text-muted-foreground ih:hover:bg-accent`,"aria-label":`Weitere Aktionen`},Se={class:`ih:px-4 ih:pt-3 ih:text-[15px] ih:leading-relaxed ih:sm:px-5`},Ce={class:`ih:flex ih:gap-2`},we=[`href`],Te=[`src`,`alt`],Ee={key:0,class:`ih:absolute ih:inset-0 ih:grid ih:place-items-center ih:bg-foreground/55 ih:text-2xl ih:font-semibold ih:text-background`},De={key:1,class:`ih:grid ih:gap-2 ih:px-4 ih:pt-3 ih:sm:px-5`},Oe=[`href`],ke={class:`ih:min-w-0 ih:flex-1`},Ae={class:`ih:block ih:truncate ih:text-sm ih:font-medium`},je={class:`ih:text-xs ih:text-muted-foreground`},Me={key:2,class:`ih:mx-4 ih:mt-3 ih:grid ih:gap-2 ih:rounded-lg ih:border ih:p-3 ih:sm:mx-5`},Ne={class:`ih:px-1 ih:text-xs ih:font-semibold ih:text-muted-foreground`},Pe=[`aria-pressed`,`disabled`,`onClick`],Fe={class:`ih:relative ih:flex ih:justify-between ih:gap-3`},Ie={key:0,class:`ih:text-muted-foreground ih:tabular-nums`},Le={class:`ih:flex ih:items-center ih:justify-between ih:text-xs ih:text-muted-foreground`},Re={class:`ih:mt-3 ih:flex ih:items-center ih:justify-between ih:px-4 ih:text-[13px] ih:text-muted-foreground ih:sm:px-5`},ze={key:0,class:`ih:inline-flex ih:items-center ih:gap-1`},Be={class:`ih:tracking-tighter`},Ve={key:1},He={key:3,class:`ih:mx-4 ih:mt-2 ih:grid ih:grid-cols-2 ih:border-t ih:py-1 ih:sm:mx-5`},Ue={class:`ih:group/react ih:relative`},We=[`aria-pressed`],Ge={class:`ih:text-base`},Ke={class:`ih:absolute ih:bottom-full ih:left-2 ih:z-20 ih:hidden ih:gap-0.5 ih:rounded-full ih:border ih:bg-popover ih:p-1 ih:shadow-md ih:group-focus-within/react:flex ih:group-hover/react:flex`},qe=[`aria-label`,`onClick`],Je={key:4,class:`ih:h-3`},Ye={__name:`PostCard`,props:{post:{type:Object,required:!0},reactions:{type:Array,required:!0},showGroup:{type:Boolean,default:!1},fullComments:{type:Array,default:null}},emits:[`deleted`,`changed`],setup(e,{emit:t}){let A=e,P=t,I=A.post,R=p(!!A.fullComments||I.comments.length>0),z=p(!1),V=p(I.body??``);async function H(e){let t=I.my_reaction===e?null:e,n=I.my_reaction,r=(e,t)=>{if(!e)return;let n=I.reactions.find(t=>t.emoji===e);n?n.count+=t:t>0&&I.reactions.push({emoji:e,count:1}),I.reactions=I.reactions.filter(e=>e.count>0).sort((e,t)=>t.count-e.count),I.reactions_total+=t};r(n,-1),r(t,1),I.my_reaction=t,await O.post(`/gruppen/beitraege/${I.id}/reaktion`,{emoji:t}).catch(e=>k.error(e.message))}let U=p([...I.poll?.mine??[]]),W=r(()=>(I.poll?.mine??[]).length>0),G=r(()=>I.poll?.options.reduce((e,t)=>e+t.votes,0)??0);async function K(e){try{I.poll=(await O.post(`/gruppen/beitraege/${I.id}/abstimmen`,{options:e})).poll,U.value=[...I.poll.mine]}catch(e){k.error(e.message)}}function q(e){I.can_comment&&(I.poll.multiple?U.value=U.value.includes(e)?U.value.filter(t=>t!==e):[...U.value,e]:K([e]))}async function J(){try{await O.post(`/gruppen/beitraege/${I.id}/anpinnen`,{pinned:!I.pinned}),I.pinned=!I.pinned,P(`changed`)}catch(e){k.error(e.message)}}async function Y(){window.confirm(`Beitrag löschen?`)&&(await O.delete(`/gruppen/beitraege/${I.id}`),P(`deleted`,I))}async function X(){await O.put(`/gruppen/beitraege/${I.id}`,{body:V.value}),I.body=V.value,I.edited=!0,z.value=!1}async function Z(){let e=window.prompt(`Was stimmt mit diesem Beitrag nicht?`);if(!e?.trim())return;let t=await O.post(`/gruppen/beitraege/${I.id}/melden`,{reason:e});k.success(t.message)}let Q=r(()=>I.images.slice(0,4));return(t,r)=>(f(),o(`article`,{class:`ih:overflow-hidden ih:rounded-xl ih:border ih:bg-card ih:shadow-xs`,"aria-label":`Beitrag von ${_(I).user?.name??`Gelöschtes Konto`}`},[s(`header`,me,[_(I).user?(f(),i(_(E),{key:0,person:_(I).user,class:`ih:size-10`},null,8,[`person`])):a(``,!0),s(`div`,he,[s(`p`,ge,[_(I).user?(f(),o(`a`,{key:0,href:`/personen/${_(I).user.id}`,class:`ih:font-semibold ih:hover:underline`},g(_(I).user.name),9,_e)):a(``,!0),e.showGroup?(f(),o(n,{key:1},[r[7]||=s(`span`,{class:`ih:mx-1 ih:text-muted-foreground`},`in`,-1),s(`a`,{href:`/gruppen/${_(I).group.slug}`,class:`ih:font-semibold ih:hover:underline`},g(_(I).group.name),9,ve)],64)):a(``,!0)]),s(`p`,$,[s(`a`,{href:_(I).url,class:`ih:hover:underline`},g(_(D)(_(I).created_at)),9,ye),_(I).edited?(f(),o(n,{key:0},[c(` · bearbeitet`)],64)):a(``,!0),_(I).pinned?(f(),o(`span`,be,[l(_(N),{class:`ih:size-3`}),r[8]||=c(` Angepinnt`,-1)])):a(``,!0)])]),l(_(C),null,{default:y(()=>[l(_(ee),{"as-child":``},{default:y(()=>[s(`button`,xe,[l(_(re),{class:`ih:size-5`})])]),_:1}),l(_(w),{align:`end`},{default:y(()=>[_(I).can_pin?(f(),i(_(T),{key:0,onSelect:J},{default:y(()=>[(f(),i(h(_(I).pinned?_(M):_(N)))),c(` `+g(_(I).pinned?`Nicht mehr anpinnen`:`Oben anpinnen`),1)]),_:1})):a(``,!0),_(I).can_edit&&_(I).body!==null?(f(),i(_(T),{key:1,onSelect:r[0]||=e=>{z.value=!0,V.value=_(I).body}},{default:y(()=>[l(_(ae)),r[9]||=c(` Bearbeiten`,-1)]),_:1})):a(``,!0),_(I).can_delete?(f(),i(_(T),{key:2,class:`ih:text-destructive`,onSelect:Y},{default:y(()=>[l(_(F)),r[10]||=c(` Löschen`,-1)]),_:1})):a(``,!0),_(I).can_edit?a(``,!0):(f(),i(_(T),{key:3,onSelect:Z},{default:y(()=>[l(_(j)),r[11]||=c(` Melden`,-1)]),_:1}))]),_:1})]),_:1})]),s(`div`,Se,[z.value?(f(),o(`form`,{key:0,class:`ih:grid ih:gap-2`,onSubmit:x(X,[`prevent`])},[b(s(`textarea`,{"onUpdate:modelValue":r[1]||=e=>V.value=e,rows:`4`,maxlength:`10000`,"aria-label":`Beitrag bearbeiten`,class:`ih:w-full ih:rounded-md ih:border ih:border-input ih:bg-background ih:p-3 ih:text-sm`},null,512),[[v,V.value]]),s(`div`,Ce,[l(_(S),{size:`sm`,type:`submit`},{default:y(()=>[...r[12]||=[c(`Speichern`,-1)]]),_:1}),l(_(S),{size:`sm`,variant:`ghost`,type:`button`,onClick:r[2]||=e=>z.value=!1},{default:y(()=>[...r[13]||=[c(`Abbrechen`,-1)]]),_:1})])],32)):_(I).body?(f(),i(B,{key:1,text:_(I).body},null,8,[`text`])):a(``,!0)]),_(I).images.length?(f(),o(`div`,{key:0,class:u([`ih:mt-3 ih:grid ih:gap-0.5`,_(I).images.length===1?``:`ih:grid-cols-2`])},[(f(!0),o(n,null,m(Q.value,(e,t)=>(f(),o(`a`,{key:e.id,href:e.url,target:`_blank`,rel:`noopener`,class:u([`ih:relative ih:block ih:overflow-hidden ih:bg-muted`,_(I).images.length===3&&t===0?`ih:row-span-2`:``])},[s(`img`,{src:_(I).images.length===1?e.url:e.thumb_url,alt:e.name,loading:`lazy`,class:u([`ih:w-full`,_(I).images.length===1?`ih:max-h-[32rem] ih:object-contain`:`ih:aspect-square ih:h-full ih:object-cover`])},null,10,Te),t===3&&_(I).images.length>4?(f(),o(`span`,Ee,`+`+g(_(I).images.length-4),1)):a(``,!0)],10,we))),128))],2)):a(``,!0),_(I).files.length?(f(),o(`div`,De,[(f(!0),o(n,null,m(_(I).files,e=>(f(),o(`a`,{key:e.id,href:e.url,class:`ih:flex ih:items-center ih:gap-3 ih:rounded-lg ih:border ih:p-2.5 ih:hover:bg-accent/60`},[l(_(te),{extension:e.name.split(`.`).pop(),class:`ih:shrink-0`},null,8,[`extension`]),s(`span`,ke,[s(`span`,Ae,g(e.name),1),s(`span`,je,g(_(L)(e.size)),1)]),l(_(ne),{class:`ih:size-4 ih:text-muted-foreground`})],8,Oe))),128))])):a(``,!0),_(I).poll?(f(),o(`fieldset`,Me,[s(`legend`,Ne,`Umfrage`+g(_(I).poll.multiple?` · mehrere Antworten möglich`:``),1),(f(!0),o(n,null,m(_(I).poll.options,(e,t)=>(f(),o(`button`,{key:t,type:`button`,class:u([`ih:relative ih:overflow-hidden ih:rounded-md ih:border ih:px-3 ih:py-2 ih:text-left ih:text-sm ih:disabled:cursor-default`,(W.value?_(I).poll.mine:U.value).includes(t)?`ih:border-brand`:`ih:hover:border-brand/50`]),"aria-pressed":(W.value?_(I).poll.mine:U.value).includes(t),disabled:!_(I).can_comment,onClick:e=>q(t)},[W.value?(f(),o(`span`,{key:0,class:`ih:absolute ih:inset-y-0 ih:left-0 ih:bg-brand-soft`,style:d({width:`${G.value?Math.round(e.votes/G.value*100):0}%`}),"aria-hidden":`true`},null,4)):a(``,!0),s(`span`,Fe,[s(`span`,{class:u({"ih:font-semibold":_(I).poll.mine.includes(t)})},g(e.label),3),W.value?(f(),o(`span`,Ie,g(G.value?Math.round(e.votes/G.value*100):0)+` % · `+g(e.votes),1)):a(``,!0)])],10,Pe))),128)),s(`div`,Le,[s(`span`,null,g(_(I).poll.voters)+` `+g(_(I).poll.voters===1?`Person hat`:`Personen haben`)+` abgestimmt`,1),_(I).poll.multiple&&_(I).can_comment?(f(),i(_(S),{key:0,size:`sm`,variant:`outline`,disabled:!U.value.length&&!W.value,onClick:r[3]||=e=>K(U.value)},{default:y(()=>[c(g(W.value?`Stimme ändern`:`Abstimmen`),1)]),_:1},8,[`disabled`])):a(``,!0)])])):a(``,!0),s(`div`,Re,[_(I).reactions_total?(f(),o(`span`,ze,[s(`span`,Be,g(_(I).reactions.slice(0,3).map(e=>e.emoji).join(``)),1),c(` `+g(_(I).reactions_total),1)])):(f(),o(`span`,Ve)),_(I).comments_count?(f(),o(`button`,{key:2,type:`button`,class:`ih:hover:underline`,onClick:r[4]||=e=>R.value=!R.value},g(_(I).comments_count)+` `+g(_(I).comments_count===1?`Kommentar`:`Kommentare`),1)):a(``,!0)]),_(I).can_comment?(f(),o(`div`,He,[s(`div`,Ue,[s(`button`,{type:`button`,class:u([`ih:flex ih:w-full ih:items-center ih:justify-center ih:gap-2 ih:rounded-md ih:py-2 ih:text-sm ih:font-medium ih:hover:bg-accent`,_(I).my_reaction?`ih:text-brand-text`:`ih:text-muted-foreground`]),"aria-pressed":!!_(I).my_reaction,onClick:r[5]||=e=>H(_(I).my_reaction??`👍`)},[s(`span`,Ge,g(_(I).my_reaction??`👍`),1),c(` `+g(_(I).my_reaction?`Reagiert`:`Gefällt mir`),1)],10,We),s(`div`,Ke,[(f(!0),o(n,null,m(e.reactions,e=>(f(),o(`button`,{key:e,type:`button`,class:`ih:grid ih:size-9 ih:place-items-center ih:rounded-full ih:text-xl ih:transition-transform ih:hover:scale-125`,"aria-label":`Mit ${e} reagieren`,onClick:t=>H(e)},g(e),9,qe))),128))])]),s(`button`,{type:`button`,class:`ih:flex ih:items-center ih:justify-center ih:gap-2 ih:rounded-md ih:py-2 ih:text-sm ih:font-medium ih:text-muted-foreground ih:hover:bg-accent`,onClick:r[6]||=e=>R.value=!0},[l(_(ie),{class:`ih:size-4`}),r[14]||=c(` Kommentieren`,-1)])])):(f(),o(`div`,Je)),R.value?(f(),i(fe,{key:5,post:_(I),full:!!e.fullComments,initial:e.fullComments},null,8,[`post`,`full`,`initial`])):a(``,!0)],8,pe))}};export{j as i,L as n,F as r,Ye as t};