diff --git a/README.md b/README.md index 647947a..112479e 100644 --- a/README.md +++ b/README.md @@ -27,23 +27,6 @@ Voraussetzung: Inhaus **0.39.0** oder neuer. 1. `gruppen-.zip` unter https://git.loheide.cloud/friloo/inhaus-plugin-gruppen/releases laden. 2. Backend → **Plugins** → hochladen → aktivieren. Updates erscheinen danach automatisch. -## Schnittstelle für die App - -Unter `/api/v1/gruppen/…` (Token nötig), dieselben Regeln wie im Portal: - -| Methode | Pfad | Zweck | -|---|---|---| -| GET | `/?vor=` | eigene Gruppen, Einladungen, Beiträge aus allen eigenen Gruppen (15 je Seite) | -| GET | `entdecken?q=&page=` | sichtbare Gruppen mit eigenem Status | -| GET | `{slug}?vor=` | Gruppe, Mitgliedschaft, Rechte (`can`), Mitglieder, Beiträge (angepinnte zuerst) | -| POST | `{slug}/beitreten`, `{slug}/verlassen` | beitreten bzw. Anfrage stellen, Einladung annehmen / verlassen | -| PUT | `{slug}/benachrichtigungen {notify: all\|off}` | Benachrichtigungen zu neuen Beiträgen | -| POST | `{slug}/beitraege {body, files[], poll[], multiple}` | Beitrag schreiben (multipart mit Dateien) | -| GET | `beitraege/{id}` | Beitrag mit allen Kommentaren | -| POST | `beitraege/{id}/reaktion {emoji}`, `/abstimmen {options[]}`, `/kommentare {body, parent_id}`, `/melden {reason}` | reagieren, abstimmen, kommentieren, melden | -| DELETE | `beitraege/{id}`, `kommentare/{id}` | löschen (eigene bzw. als Moderation) | -| GET | `dateien/{id}/{thumb\|full}`, `{slug}/titelbild` | Fotos, Dateien, Titelbild (Adressen in API-Antworten zeigen hierher) | - ## Entwicklung ```bash diff --git a/dist/assets/style-B47C9pxK.css b/dist/assets/style-B47C9pxK.css deleted file mode 100644 index e21e6e4..0000000 --- a/dist/assets/style-B47C9pxK.css +++ /dev/null @@ -1,2 +0,0 @@ -/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */ -@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1}::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1}}}@layer theme{:root,:host{--ih-spacing:.25rem;--ih-container-md:28rem;--ih-container-lg:32rem;--ih-container-4xl:56rem;--ih-text-xs:.75rem;--ih-text-xs--line-height:calc(1 / .75);--ih-text-sm:.875rem;--ih-text-sm--line-height:calc(1.25 / .875);--ih-text-base:1rem;--ih-text-base--line-height:calc(1.5 / 1);--ih-text-xl:1.25rem;--ih-text-xl--line-height:calc(1.75 / 1.25);--ih-text-2xl:1.5rem;--ih-text-2xl--line-height:calc(2 / 1.5);--ih-font-weight-medium:500;--ih-font-weight-semibold:600;--ih-tracking-tighter:-.05em;--ih-leading-snug:1.375;--ih-leading-relaxed:1.625;--ih-animate-spin:spin 1s linear infinite;--ih-default-transition-duration:.15s;--ih-default-transition-timing-function:cubic-bezier(.4, 0, .2, 1)}}@layer utilities{.ih\:pointer-events-none{pointer-events:none}.ih\:absolute{position:absolute}.ih\:relative{position:relative}.ih\:inset-0{inset:0}.ih\:inset-x-2{inset-inline:calc(var(--ih-spacing) * 2)}.ih\:inset-y-0{inset-block:0}.ih\:-top-1\.5{top:calc(var(--ih-spacing) * -1.5)}.ih\:top-1\/2{top:50%}.ih\:-right-1\.5{right:calc(var(--ih-spacing) * -1.5)}.ih\:bottom-0{bottom:0}.ih\:bottom-full{bottom:100%}.ih\:left-0{left:0}.ih\:left-2{left:calc(var(--ih-spacing) * 2)}.ih\:left-2\.5{left:calc(var(--ih-spacing) * 2.5)}.ih\:z-20{z-index:20}.ih\:row-span-2{grid-row:span 2/span 2}.ih\:-mx-2{margin-inline:calc(var(--ih-spacing) * -2)}.ih\:mx-1{margin-inline:var(--ih-spacing)}.ih\:mx-4{margin-inline:calc(var(--ih-spacing) * 4)}.ih\:mx-auto{margin-inline:auto}.ih\:-my-1{margin-block:calc(var(--ih-spacing) * -1)}.ih\:mt-0\.5{margin-top:calc(var(--ih-spacing) * .5)}.ih\:mt-1{margin-top:var(--ih-spacing)}.ih\:mt-2{margin-top:calc(var(--ih-spacing) * 2)}.ih\:mt-3{margin-top:calc(var(--ih-spacing) * 3)}.ih\:mt-4{margin-top:calc(var(--ih-spacing) * 4)}.ih\:mt-5{margin-top:calc(var(--ih-spacing) * 5)}.ih\:mt-6{margin-top:calc(var(--ih-spacing) * 6)}.ih\:mt-auto{margin-top:auto}.ih\:mb-1{margin-bottom:var(--ih-spacing)}.ih\:mb-2{margin-bottom:calc(var(--ih-spacing) * 2)}.ih\:mb-3{margin-bottom:calc(var(--ih-spacing) * 3)}.ih\:mb-5{margin-bottom:calc(var(--ih-spacing) * 5)}.ih\:ml-1{margin-left:var(--ih-spacing)}.ih\:ml-10{margin-left:calc(var(--ih-spacing) * 10)}.ih\:line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.ih\:line-clamp-6{-webkit-line-clamp:6;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.ih\:block{display:block}.ih\:flex{display:flex}.ih\:grid{display:grid}.ih\:hidden{display:none}.ih\:inline-block{display:inline-block}.ih\:inline-flex{display:inline-flex}.ih\:aspect-square{aspect-ratio:1}.ih\:size-3{width:calc(var(--ih-spacing) * 3);height:calc(var(--ih-spacing) * 3)}.ih\:size-3\.5{width:calc(var(--ih-spacing) * 3.5);height:calc(var(--ih-spacing) * 3.5)}.ih\:size-4{width:calc(var(--ih-spacing) * 4);height:calc(var(--ih-spacing) * 4)}.ih\:size-5{width:calc(var(--ih-spacing) * 5);height:calc(var(--ih-spacing) * 5)}.ih\:size-6{width:calc(var(--ih-spacing) * 6);height:calc(var(--ih-spacing) * 6)}.ih\:size-7{width:calc(var(--ih-spacing) * 7);height:calc(var(--ih-spacing) * 7)}.ih\:size-8{width:calc(var(--ih-spacing) * 8);height:calc(var(--ih-spacing) * 8)}.ih\:size-9{width:calc(var(--ih-spacing) * 9);height:calc(var(--ih-spacing) * 9)}.ih\:size-10{width:calc(var(--ih-spacing) * 10);height:calc(var(--ih-spacing) * 10)}.ih\:size-20{width:calc(var(--ih-spacing) * 20);height:calc(var(--ih-spacing) * 20)}.ih\:h-3{height:calc(var(--ih-spacing) * 3)}.ih\:h-8{height:calc(var(--ih-spacing) * 8)}.ih\:h-9{height:calc(var(--ih-spacing) * 9)}.ih\:h-10{height:calc(var(--ih-spacing) * 10)}.ih\:h-20{height:calc(var(--ih-spacing) * 20)}.ih\:h-24{height:calc(var(--ih-spacing) * 24)}.ih\:h-36{height:calc(var(--ih-spacing) * 36)}.ih\:h-\[3px\]{height:3px}.ih\:h-full{height:100%}.ih\:max-h-64{max-height:calc(var(--ih-spacing) * 64)}.ih\:max-h-\[32rem\]{max-height:32rem}.ih\:min-h-10{min-height:calc(var(--ih-spacing) * 10)}.ih\:w-40{width:calc(var(--ih-spacing) * 40)}.ih\:w-full{width:100%}.ih\:max-w-4xl{max-width:var(--ih-container-4xl)}.ih\:max-w-full{max-width:100%}.ih\:max-w-md{max-width:var(--ih-container-md)}.ih\:min-w-0{min-width:0}.ih\:flex-1{flex:1}.ih\:shrink-0{flex-shrink:0}.ih\:-translate-y-1\/2{--tw-translate-y:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.ih\:animate-spin{animation:var(--ih-animate-spin)}.ih\:cursor-pointer{cursor:pointer}.ih\:resize-none{resize:none}.ih\:list-disc{list-style-type:disc}.ih\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.ih\:flex-col{flex-direction:column}.ih\:flex-wrap{flex-wrap:wrap}.ih\:place-items-center{place-items:center}.ih\:content-start{align-content:flex-start}.ih\:items-baseline{align-items:baseline}.ih\:items-center{align-items:center}.ih\:items-start{align-items:flex-start}.ih\:justify-between{justify-content:space-between}.ih\:justify-center{justify-content:center}.ih\:gap-0\.5{gap:calc(var(--ih-spacing) * .5)}.ih\:gap-1{gap:var(--ih-spacing)}.ih\:gap-1\.5{gap:calc(var(--ih-spacing) * 1.5)}.ih\:gap-2{gap:calc(var(--ih-spacing) * 2)}.ih\:gap-2\.5{gap:calc(var(--ih-spacing) * 2.5)}.ih\:gap-3{gap:calc(var(--ih-spacing) * 3)}.ih\:gap-4{gap:calc(var(--ih-spacing) * 4)}.ih\:gap-5{gap:calc(var(--ih-spacing) * 5)}.ih\:gap-6{gap:calc(var(--ih-spacing) * 6)}.ih\:gap-x-3{column-gap:calc(var(--ih-spacing) * 3)}.ih\:gap-y-1{row-gap:var(--ih-spacing)}.ih\:justify-self-start{justify-self:flex-start}.ih\:truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.ih\:overflow-hidden{overflow:hidden}.ih\:overflow-y-auto{overflow-y:auto}.ih\:rounded{border-radius:.25rem}.ih\:rounded-2xl{border-radius:calc(var(--radius) * 2)}.ih\:rounded-full{border-radius:2147483647px}.ih\:rounded-lg{border-radius:var(--radius)}.ih\:rounded-md{border-radius:calc(var(--radius) - 2px)}.ih\:rounded-xl{border-radius:calc(var(--radius) * 1.5)}.ih\:rounded-t-full{border-top-left-radius:2147483647px;border-top-right-radius:2147483647px}.ih\:border{border-style:var(--tw-border-style);border-width:1px}.ih\:border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.ih\:border-brand,.ih\:border-brand\/40{border-color:var(--brand)}@supports (color:color-mix(in lab, red, red)){.ih\:border-brand\/40.ih\:border-brand\/40{border-color:color-mix(in oklab, var(--brand) 40%, transparent)}}.ih\:border-destructive\/30{border-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.ih\:border-destructive\/30.ih\:border-destructive\/30{border-color:color-mix(in oklab, var(--destructive) 30%, transparent)}}.ih\:border-input{border-color:var(--input)}.ih\:bg-accent{background-color:var(--accent)}.ih\:bg-background{background-color:var(--background)}.ih\:bg-brand{background-color:var(--brand)}.ih\:bg-brand-soft,.ih\:bg-brand-soft\/40{background-color:var(--brand-soft)}@supports (color:color-mix(in lab, red, red)){.ih\:bg-brand-soft\/40.ih\:bg-brand-soft\/40{background-color:color-mix(in oklab, var(--brand-soft) 40%, transparent)}}.ih\:bg-card{background-color:var(--card)}.ih\:bg-destructive\/5{background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.ih\:bg-destructive\/5.ih\:bg-destructive\/5{background-color:color-mix(in oklab, var(--destructive) 5%, transparent)}}.ih\:bg-foreground,.ih\:bg-foreground\/55{background-color:var(--foreground)}@supports (color:color-mix(in lab, red, red)){.ih\:bg-foreground\/55.ih\:bg-foreground\/55{background-color:color-mix(in oklab, var(--foreground) 55%, transparent)}}.ih\:bg-muted{background-color:var(--muted)}.ih\:bg-popover{background-color:var(--popover)}.ih\:bg-cover{background-size:cover}.ih\:bg-center{background-position:50%}.ih\:object-contain{object-fit:contain}.ih\:object-cover{object-fit:cover}.ih\:p-0\.5{padding:calc(var(--ih-spacing) * .5)}.ih\:p-1{padding:var(--ih-spacing)}.ih\:p-1\.5{padding:calc(var(--ih-spacing) * 1.5)}.ih\:p-2{padding:calc(var(--ih-spacing) * 2)}.ih\:p-2\.5{padding:calc(var(--ih-spacing) * 2.5)}.ih\:p-3{padding:calc(var(--ih-spacing) * 3)}.ih\:p-4{padding:calc(var(--ih-spacing) * 4)}.ih\:p-5{padding:calc(var(--ih-spacing) * 5)}.ih\:px-1{padding-inline:var(--ih-spacing)}.ih\:px-1\.5{padding-inline:calc(var(--ih-spacing) * 1.5)}.ih\:px-2{padding-inline:calc(var(--ih-spacing) * 2)}.ih\:px-2\.5{padding-inline:calc(var(--ih-spacing) * 2.5)}.ih\:px-3{padding-inline:calc(var(--ih-spacing) * 3)}.ih\:px-4{padding-inline:calc(var(--ih-spacing) * 4)}.ih\:py-0\.5{padding-block:calc(var(--ih-spacing) * .5)}.ih\:py-1{padding-block:var(--ih-spacing)}.ih\:py-1\.5{padding-block:calc(var(--ih-spacing) * 1.5)}.ih\:py-2{padding-block:calc(var(--ih-spacing) * 2)}.ih\:py-3{padding-block:calc(var(--ih-spacing) * 3)}.ih\:pt-3{padding-top:calc(var(--ih-spacing) * 3)}.ih\:pt-4{padding-top:calc(var(--ih-spacing) * 4)}.ih\:pr-1{padding-right:var(--ih-spacing)}.ih\:pr-3{padding-right:calc(var(--ih-spacing) * 3)}.ih\:pb-4{padding-bottom:calc(var(--ih-spacing) * 4)}.ih\:pl-0\.5{padding-left:calc(var(--ih-spacing) * .5)}.ih\:pl-6{padding-left:calc(var(--ih-spacing) * 6)}.ih\:pl-8{padding-left:calc(var(--ih-spacing) * 8)}.ih\:pl-13{padding-left:calc(var(--ih-spacing) * 13)}.ih\:text-left{text-align:left}.ih\:text-2xl{font-size:var(--ih-text-2xl);line-height:var(--tw-leading,var(--ih-text-2xl--line-height))}.ih\:text-base{font-size:var(--ih-text-base);line-height:var(--tw-leading,var(--ih-text-base--line-height))}.ih\:text-sm{font-size:var(--ih-text-sm);line-height:var(--tw-leading,var(--ih-text-sm--line-height))}.ih\:text-xl{font-size:var(--ih-text-xl);line-height:var(--tw-leading,var(--ih-text-xl--line-height))}.ih\:text-xs{font-size:var(--ih-text-xs);line-height:var(--tw-leading,var(--ih-text-xs--line-height))}.ih\:text-\[10px\]{font-size:10px}.ih\:text-\[11px\]{font-size:11px}.ih\:text-\[13px\]{font-size:13px}.ih\:text-\[15px\]{font-size:15px}.ih\:leading-relaxed{--tw-leading:var(--ih-leading-relaxed);line-height:var(--ih-leading-relaxed)}.ih\:leading-snug{--tw-leading:var(--ih-leading-snug);line-height:var(--ih-leading-snug)}.ih\:font-medium{--tw-font-weight:var(--ih-font-weight-medium);font-weight:var(--ih-font-weight-medium)}.ih\:font-semibold{--tw-font-weight:var(--ih-font-weight-semibold);font-weight:var(--ih-font-weight-semibold)}.ih\:tracking-tighter{--tw-tracking:var(--ih-tracking-tighter);letter-spacing:var(--ih-tracking-tighter)}.ih\:break-words{overflow-wrap:break-word}.ih\:whitespace-pre-line{white-space:pre-line}.ih\:whitespace-pre-wrap{white-space:pre-wrap}.ih\:text-background{color:var(--background)}.ih\:text-brand-foreground{color:var(--brand-foreground)}.ih\:text-brand-text{color:var(--brand-text)}.ih\:text-destructive{color:var(--destructive)}.ih\:text-foreground{color:var(--foreground)}.ih\:text-muted-foreground{color:var(--muted-foreground)}.ih\:tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.ih\:underline{text-decoration-line:underline}.ih\:underline-offset-2{text-underline-offset:2px}.ih\:accent-\[var\(--color-brand\)\]{accent-color:var(--color-brand)}.ih\:shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ih\:shadow-xs{--tw-shadow:0 1px 2px 0 var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ih\:transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--ih-default-transition-timing-function));transition-duration:var(--tw-duration,var(--ih-default-transition-duration))}.ih\:group-focus-within\/react\:flex.ih\:group-focus-within\/react\:flex:is(:where(.ih\:group\/react):focus-within *){display:flex}@media (hover:hover){.ih\:group-hover\/react\:flex.ih\:group-hover\/react\:flex:is(:where(.ih\:group\/react):hover *){display:flex}.ih\:hover\:scale-125.ih\:hover\:scale-125:hover{--tw-scale-x:125%;--tw-scale-y:125%;--tw-scale-z:125%;scale:var(--tw-scale-x) var(--tw-scale-y)}.ih\:hover\:border-brand\/50.ih\:hover\:border-brand\/50:hover{border-color:var(--brand)}@supports (color:color-mix(in lab, red, red)){.ih\:hover\:border-brand\/50.ih\:hover\:border-brand\/50:hover{border-color:color-mix(in oklab, var(--brand) 50%, transparent)}}.ih\:hover\:bg-accent.ih\:hover\:bg-accent:hover,.ih\:hover\:bg-accent\/50.ih\:hover\:bg-accent\/50:hover{background-color:var(--accent)}@supports (color:color-mix(in lab, red, red)){.ih\:hover\:bg-accent\/50.ih\:hover\:bg-accent\/50:hover{background-color:color-mix(in oklab, var(--accent) 50%, transparent)}}.ih\:hover\:bg-accent\/60.ih\:hover\:bg-accent\/60:hover{background-color:var(--accent)}@supports (color:color-mix(in lab, red, red)){.ih\:hover\:bg-accent\/60.ih\:hover\:bg-accent\/60:hover{background-color:color-mix(in oklab, var(--accent) 60%, transparent)}}.ih\:hover\:bg-brand-soft.ih\:hover\:bg-brand-soft:hover{background-color:var(--brand-soft)}.ih\:hover\:bg-muted.ih\:hover\:bg-muted:hover,.ih\:hover\:bg-muted\/50.ih\:hover\:bg-muted\/50:hover{background-color:var(--muted)}@supports (color:color-mix(in lab, red, red)){.ih\:hover\:bg-muted\/50.ih\:hover\:bg-muted\/50:hover{background-color:color-mix(in oklab, var(--muted) 50%, transparent)}}.ih\:hover\:text-destructive.ih\:hover\:text-destructive:hover{color:var(--destructive)}.ih\:hover\:text-foreground.ih\:hover\:text-foreground:hover{color:var(--foreground)}.ih\:hover\:underline.ih\:hover\:underline:hover{text-decoration-line:underline}}.ih\:focus-visible\:bg-background.ih\:focus-visible\:bg-background:focus-visible{background-color:var(--background)}.ih\:focus-visible\:ring-3.ih\:focus-visible\:ring-3:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ih\:focus-visible\:ring-ring\/30.ih\:focus-visible\:ring-ring\/30:focus-visible{--tw-ring-color:var(--ring)}@supports (color:color-mix(in lab, red, red)){.ih\:focus-visible\:ring-ring\/30.ih\:focus-visible\:ring-ring\/30:focus-visible{--tw-ring-color:color-mix(in oklab, var(--ring) 30%, transparent)}}.ih\:focus-visible\:outline-none.ih\:focus-visible\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}.ih\:disabled\:cursor-default.ih\:disabled\:cursor-default:disabled{cursor:default}.ih\:disabled\:opacity-40.ih\:disabled\:opacity-40:disabled{opacity:.4}.ih\:has-\[\:checked\]\:border-brand.ih\:has-\[\:checked\]\:border-brand:has(:checked){border-color:var(--brand)}.ih\:has-\[\:checked\]\:bg-brand-soft\/50.ih\:has-\[\:checked\]\:bg-brand-soft\/50:has(:checked){background-color:var(--brand-soft)}@supports (color:color-mix(in lab, red, red)){.ih\:has-\[\:checked\]\:bg-brand-soft\/50.ih\:has-\[\:checked\]\:bg-brand-soft\/50:has(:checked){background-color:color-mix(in oklab, var(--brand-soft) 50%, transparent)}}@media (min-width:40rem){.ih\:sm\:mx-5.ih\:sm\:mx-5{margin-inline:calc(var(--ih-spacing) * 5)}.ih\:sm\:ml-13.ih\:sm\:ml-13{margin-left:calc(var(--ih-spacing) * 13)}.ih\:sm\:h-52.ih\:sm\:h-52{height:calc(var(--ih-spacing) * 52)}.ih\:sm\:max-w-lg.ih\:sm\:max-w-lg{max-width:var(--ih-container-lg)}.ih\:sm\:max-w-md.ih\:sm\:max-w-md{max-width:var(--ih-container-md)}.ih\:sm\:grid-cols-2.ih\:sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.ih\:sm\:px-5.ih\:sm\:px-5{padding-inline:calc(var(--ih-spacing) * 5)}}@media (min-width:64rem){.ih\:lg\:sticky.ih\:lg\:sticky{position:sticky}.ih\:lg\:top-24.ih\:lg\:top-24{top:calc(var(--ih-spacing) * 24)}.ih\:lg\:grid.ih\:lg\:grid{display:grid}.ih\:lg\:grid-cols-3.ih\:lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.ih\:lg\:grid-cols-\[minmax\(0\,1fr\)_20rem\].ih\:lg\:grid-cols-\[minmax\(0\,1fr\)_20rem\]{grid-template-columns:minmax(0,1fr) 20rem}}@media (min-width:80rem){.ih\:xl\:grid-cols-4.ih\:xl\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@keyframes spin{to{transform:rotate(360deg)}} diff --git a/dist/assets/style-CWIv2Jl3.css b/dist/assets/style-CWIv2Jl3.css new file mode 100644 index 0000000..ae4d16d --- /dev/null +++ b/dist/assets/style-CWIv2Jl3.css @@ -0,0 +1,2 @@ +/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */ +@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1}::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1}}}@layer theme{:root,:host{--ih-spacing:.25rem;--ih-container-md:28rem;--ih-container-lg:32rem;--ih-container-2xl:42rem;--ih-text-xs:.75rem;--ih-text-xs--line-height:calc(1 / .75);--ih-text-sm:.875rem;--ih-text-sm--line-height:calc(1.25 / .875);--ih-text-base:1rem;--ih-text-base--line-height:calc(1.5 / 1);--ih-text-xl:1.25rem;--ih-text-xl--line-height:calc(1.75 / 1.25);--ih-text-2xl:1.5rem;--ih-text-2xl--line-height:calc(2 / 1.5);--ih-font-weight-medium:500;--ih-font-weight-semibold:600;--ih-tracking-tighter:-.05em;--ih-tracking-tight:-.025em;--ih-leading-snug:1.375;--ih-leading-relaxed:1.625;--ih-animate-spin:spin 1s linear infinite;--ih-default-transition-duration:.15s;--ih-default-transition-timing-function:cubic-bezier(.4, 0, .2, 1)}}@layer utilities{.ih\:pointer-events-none{pointer-events:none}.ih\:absolute{position:absolute}.ih\:relative{position:relative}.ih\:inset-0{inset:0}.ih\:inset-x-2{inset-inline:calc(var(--ih-spacing) * 2)}.ih\:inset-y-0{inset-block:0}.ih\:-top-1\.5{top:calc(var(--ih-spacing) * -1.5)}.ih\:top-1\/2{top:50%}.ih\:-right-1\.5{right:calc(var(--ih-spacing) * -1.5)}.ih\:bottom-0{bottom:0}.ih\:bottom-full{bottom:100%}.ih\:left-0{left:0}.ih\:left-2{left:calc(var(--ih-spacing) * 2)}.ih\:left-2\.5{left:calc(var(--ih-spacing) * 2.5)}.ih\:z-20{z-index:20}.ih\:row-span-2{grid-row:span 2/span 2}.ih\:-mx-2{margin-inline:calc(var(--ih-spacing) * -2)}.ih\:mx-1{margin-inline:var(--ih-spacing)}.ih\:mx-4{margin-inline:calc(var(--ih-spacing) * 4)}.ih\:mx-auto{margin-inline:auto}.ih\:-my-1{margin-block:calc(var(--ih-spacing) * -1)}.ih\:mt-0\.5{margin-top:calc(var(--ih-spacing) * .5)}.ih\:mt-1{margin-top:var(--ih-spacing)}.ih\:mt-2{margin-top:calc(var(--ih-spacing) * 2)}.ih\:mt-3{margin-top:calc(var(--ih-spacing) * 3)}.ih\:mt-5{margin-top:calc(var(--ih-spacing) * 5)}.ih\:mt-6{margin-top:calc(var(--ih-spacing) * 6)}.ih\:mt-auto{margin-top:auto}.ih\:mb-1{margin-bottom:var(--ih-spacing)}.ih\:mb-2{margin-bottom:calc(var(--ih-spacing) * 2)}.ih\:mb-5{margin-bottom:calc(var(--ih-spacing) * 5)}.ih\:ml-1{margin-left:var(--ih-spacing)}.ih\:ml-10{margin-left:calc(var(--ih-spacing) * 10)}.ih\:line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.ih\:block{display:block}.ih\:flex{display:flex}.ih\:grid{display:grid}.ih\:hidden{display:none}.ih\:inline-block{display:inline-block}.ih\:inline-flex{display:inline-flex}.ih\:aspect-square{aspect-ratio:1}.ih\:size-3{width:calc(var(--ih-spacing) * 3);height:calc(var(--ih-spacing) * 3)}.ih\:size-3\.5{width:calc(var(--ih-spacing) * 3.5);height:calc(var(--ih-spacing) * 3.5)}.ih\:size-4{width:calc(var(--ih-spacing) * 4);height:calc(var(--ih-spacing) * 4)}.ih\:size-5{width:calc(var(--ih-spacing) * 5);height:calc(var(--ih-spacing) * 5)}.ih\:size-6{width:calc(var(--ih-spacing) * 6);height:calc(var(--ih-spacing) * 6)}.ih\:size-7{width:calc(var(--ih-spacing) * 7);height:calc(var(--ih-spacing) * 7)}.ih\:size-8{width:calc(var(--ih-spacing) * 8);height:calc(var(--ih-spacing) * 8)}.ih\:size-9{width:calc(var(--ih-spacing) * 9);height:calc(var(--ih-spacing) * 9)}.ih\:size-10{width:calc(var(--ih-spacing) * 10);height:calc(var(--ih-spacing) * 10)}.ih\:size-20{width:calc(var(--ih-spacing) * 20);height:calc(var(--ih-spacing) * 20)}.ih\:h-3{height:calc(var(--ih-spacing) * 3)}.ih\:h-8{height:calc(var(--ih-spacing) * 8)}.ih\:h-9{height:calc(var(--ih-spacing) * 9)}.ih\:h-10{height:calc(var(--ih-spacing) * 10)}.ih\:h-20{height:calc(var(--ih-spacing) * 20)}.ih\:h-24{height:calc(var(--ih-spacing) * 24)}.ih\:h-36{height:calc(var(--ih-spacing) * 36)}.ih\:h-\[3px\]{height:3px}.ih\:h-full{height:100%}.ih\:max-h-64{max-height:calc(var(--ih-spacing) * 64)}.ih\:max-h-\[32rem\]{max-height:32rem}.ih\:min-h-10{min-height:calc(var(--ih-spacing) * 10)}.ih\:w-40{width:calc(var(--ih-spacing) * 40)}.ih\:w-full{width:100%}.ih\:max-w-2xl{max-width:var(--ih-container-2xl)}.ih\:max-w-full{max-width:100%}.ih\:max-w-md{max-width:var(--ih-container-md)}.ih\:min-w-0{min-width:0}.ih\:flex-1{flex:1}.ih\:shrink-0{flex-shrink:0}.ih\:-translate-y-1\/2{--tw-translate-y:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.ih\:animate-spin{animation:var(--ih-animate-spin)}.ih\:cursor-pointer{cursor:pointer}.ih\:resize-none{resize:none}.ih\:list-disc{list-style-type:disc}.ih\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.ih\:flex-col{flex-direction:column}.ih\:flex-wrap{flex-wrap:wrap}.ih\:place-items-center{place-items:center}.ih\:content-start{align-content:flex-start}.ih\:items-center{align-items:center}.ih\:items-end{align-items:flex-end}.ih\:items-start{align-items:flex-start}.ih\:justify-between{justify-content:space-between}.ih\:justify-center{justify-content:center}.ih\:gap-0\.5{gap:calc(var(--ih-spacing) * .5)}.ih\:gap-1{gap:var(--ih-spacing)}.ih\:gap-1\.5{gap:calc(var(--ih-spacing) * 1.5)}.ih\:gap-2{gap:calc(var(--ih-spacing) * 2)}.ih\:gap-2\.5{gap:calc(var(--ih-spacing) * 2.5)}.ih\:gap-3{gap:calc(var(--ih-spacing) * 3)}.ih\:gap-4{gap:calc(var(--ih-spacing) * 4)}.ih\:gap-5{gap:calc(var(--ih-spacing) * 5)}.ih\:gap-6{gap:calc(var(--ih-spacing) * 6)}.ih\:gap-x-3{column-gap:calc(var(--ih-spacing) * 3)}.ih\:gap-y-1{row-gap:var(--ih-spacing)}.ih\:justify-self-start{justify-self:flex-start}.ih\:truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.ih\:overflow-hidden{overflow:hidden}.ih\:overflow-y-auto{overflow-y:auto}.ih\:rounded{border-radius:.25rem}.ih\:rounded-2xl{border-radius:calc(var(--radius) * 2)}.ih\:rounded-full{border-radius:2147483647px}.ih\:rounded-lg{border-radius:var(--radius)}.ih\:rounded-md{border-radius:calc(var(--radius) - 2px)}.ih\:rounded-xl{border-radius:calc(var(--radius) * 1.5)}.ih\:rounded-t-full{border-top-left-radius:2147483647px;border-top-right-radius:2147483647px}.ih\:border{border-style:var(--tw-border-style);border-width:1px}.ih\:border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.ih\:border-brand,.ih\:border-brand\/40{border-color:var(--brand)}@supports (color:color-mix(in lab, red, red)){.ih\:border-brand\/40.ih\:border-brand\/40{border-color:color-mix(in oklab, var(--brand) 40%, transparent)}}.ih\:border-destructive\/30{border-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.ih\:border-destructive\/30.ih\:border-destructive\/30{border-color:color-mix(in oklab, var(--destructive) 30%, transparent)}}.ih\:border-input{border-color:var(--input)}.ih\:bg-accent{background-color:var(--accent)}.ih\:bg-background{background-color:var(--background)}.ih\:bg-brand{background-color:var(--brand)}.ih\:bg-brand-soft,.ih\:bg-brand-soft\/40{background-color:var(--brand-soft)}@supports (color:color-mix(in lab, red, red)){.ih\:bg-brand-soft\/40.ih\:bg-brand-soft\/40{background-color:color-mix(in oklab, var(--brand-soft) 40%, transparent)}}.ih\:bg-card{background-color:var(--card)}.ih\:bg-destructive\/5{background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.ih\:bg-destructive\/5.ih\:bg-destructive\/5{background-color:color-mix(in oklab, var(--destructive) 5%, transparent)}}.ih\:bg-foreground,.ih\:bg-foreground\/55{background-color:var(--foreground)}@supports (color:color-mix(in lab, red, red)){.ih\:bg-foreground\/55.ih\:bg-foreground\/55{background-color:color-mix(in oklab, var(--foreground) 55%, transparent)}}.ih\:bg-muted{background-color:var(--muted)}.ih\:bg-popover{background-color:var(--popover)}.ih\:bg-cover{background-size:cover}.ih\:bg-center{background-position:50%}.ih\:object-cover{object-fit:cover}.ih\:p-0\.5{padding:calc(var(--ih-spacing) * .5)}.ih\:p-1{padding:var(--ih-spacing)}.ih\:p-1\.5{padding:calc(var(--ih-spacing) * 1.5)}.ih\:p-2{padding:calc(var(--ih-spacing) * 2)}.ih\:p-2\.5{padding:calc(var(--ih-spacing) * 2.5)}.ih\:p-3{padding:calc(var(--ih-spacing) * 3)}.ih\:p-4{padding:calc(var(--ih-spacing) * 4)}.ih\:p-5{padding:calc(var(--ih-spacing) * 5)}.ih\:px-1{padding-inline:var(--ih-spacing)}.ih\:px-1\.5{padding-inline:calc(var(--ih-spacing) * 1.5)}.ih\:px-2{padding-inline:calc(var(--ih-spacing) * 2)}.ih\:px-2\.5{padding-inline:calc(var(--ih-spacing) * 2.5)}.ih\:px-3{padding-inline:calc(var(--ih-spacing) * 3)}.ih\:px-4{padding-inline:calc(var(--ih-spacing) * 4)}.ih\:py-0\.5{padding-block:calc(var(--ih-spacing) * .5)}.ih\:py-1{padding-block:var(--ih-spacing)}.ih\:py-1\.5{padding-block:calc(var(--ih-spacing) * 1.5)}.ih\:py-2{padding-block:calc(var(--ih-spacing) * 2)}.ih\:py-3{padding-block:calc(var(--ih-spacing) * 3)}.ih\:pt-3{padding-top:calc(var(--ih-spacing) * 3)}.ih\:pt-4{padding-top:calc(var(--ih-spacing) * 4)}.ih\:pr-1{padding-right:var(--ih-spacing)}.ih\:pr-3{padding-right:calc(var(--ih-spacing) * 3)}.ih\:pb-4{padding-bottom:calc(var(--ih-spacing) * 4)}.ih\:pl-0\.5{padding-left:calc(var(--ih-spacing) * .5)}.ih\:pl-6{padding-left:calc(var(--ih-spacing) * 6)}.ih\:pl-8{padding-left:calc(var(--ih-spacing) * 8)}.ih\:pl-13{padding-left:calc(var(--ih-spacing) * 13)}.ih\:text-left{text-align:left}.ih\:text-2xl{font-size:var(--ih-text-2xl);line-height:var(--tw-leading,var(--ih-text-2xl--line-height))}.ih\:text-base{font-size:var(--ih-text-base);line-height:var(--tw-leading,var(--ih-text-base--line-height))}.ih\:text-sm{font-size:var(--ih-text-sm);line-height:var(--tw-leading,var(--ih-text-sm--line-height))}.ih\:text-xl{font-size:var(--ih-text-xl);line-height:var(--tw-leading,var(--ih-text-xl--line-height))}.ih\:text-xs{font-size:var(--ih-text-xs);line-height:var(--tw-leading,var(--ih-text-xs--line-height))}.ih\:text-\[10px\]{font-size:10px}.ih\:text-\[11px\]{font-size:11px}.ih\:text-\[13px\]{font-size:13px}.ih\:text-\[15px\]{font-size:15px}.ih\:leading-relaxed{--tw-leading:var(--ih-leading-relaxed);line-height:var(--ih-leading-relaxed)}.ih\:leading-snug{--tw-leading:var(--ih-leading-snug);line-height:var(--ih-leading-snug)}.ih\:font-medium{--tw-font-weight:var(--ih-font-weight-medium);font-weight:var(--ih-font-weight-medium)}.ih\:font-semibold{--tw-font-weight:var(--ih-font-weight-semibold);font-weight:var(--ih-font-weight-semibold)}.ih\:tracking-tight{--tw-tracking:var(--ih-tracking-tight);letter-spacing:var(--ih-tracking-tight)}.ih\:tracking-tighter{--tw-tracking:var(--ih-tracking-tighter);letter-spacing:var(--ih-tracking-tighter)}.ih\:break-words{overflow-wrap:break-word}.ih\:whitespace-pre-line{white-space:pre-line}.ih\:whitespace-pre-wrap{white-space:pre-wrap}.ih\:text-background{color:var(--background)}.ih\:text-brand-foreground{color:var(--brand-foreground)}.ih\:text-brand-text{color:var(--brand-text)}.ih\:text-destructive{color:var(--destructive)}.ih\:text-foreground{color:var(--foreground)}.ih\:text-muted-foreground{color:var(--muted-foreground)}.ih\:tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.ih\:underline{text-decoration-line:underline}.ih\:underline-offset-2{text-underline-offset:2px}.ih\:accent-\[var\(--color-brand\)\]{accent-color:var(--color-brand)}.ih\:shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ih\:shadow-xs{--tw-shadow:0 1px 2px 0 var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ih\:transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--ih-default-transition-timing-function));transition-duration:var(--tw-duration,var(--ih-default-transition-duration))}.ih\:group-focus-within\/react\:flex.ih\:group-focus-within\/react\:flex:is(:where(.ih\:group\/react):focus-within *){display:flex}@media (hover:hover){.ih\:group-hover\/react\:flex.ih\:group-hover\/react\:flex:is(:where(.ih\:group\/react):hover *){display:flex}.ih\:hover\:scale-125.ih\:hover\:scale-125:hover{--tw-scale-x:125%;--tw-scale-y:125%;--tw-scale-z:125%;scale:var(--tw-scale-x) var(--tw-scale-y)}.ih\:hover\:border-brand\/50.ih\:hover\:border-brand\/50:hover{border-color:var(--brand)}@supports (color:color-mix(in lab, red, red)){.ih\:hover\:border-brand\/50.ih\:hover\:border-brand\/50:hover{border-color:color-mix(in oklab, var(--brand) 50%, transparent)}}.ih\:hover\:bg-accent.ih\:hover\:bg-accent:hover,.ih\:hover\:bg-accent\/50.ih\:hover\:bg-accent\/50:hover{background-color:var(--accent)}@supports (color:color-mix(in lab, red, red)){.ih\:hover\:bg-accent\/50.ih\:hover\:bg-accent\/50:hover{background-color:color-mix(in oklab, var(--accent) 50%, transparent)}}.ih\:hover\:bg-accent\/60.ih\:hover\:bg-accent\/60:hover{background-color:var(--accent)}@supports (color:color-mix(in lab, red, red)){.ih\:hover\:bg-accent\/60.ih\:hover\:bg-accent\/60:hover{background-color:color-mix(in oklab, var(--accent) 60%, transparent)}}.ih\:hover\:bg-brand-soft.ih\:hover\:bg-brand-soft:hover{background-color:var(--brand-soft)}.ih\:hover\:bg-muted.ih\:hover\:bg-muted:hover,.ih\:hover\:bg-muted\/50.ih\:hover\:bg-muted\/50:hover{background-color:var(--muted)}@supports (color:color-mix(in lab, red, red)){.ih\:hover\:bg-muted\/50.ih\:hover\:bg-muted\/50:hover{background-color:color-mix(in oklab, var(--muted) 50%, transparent)}}.ih\:hover\:text-destructive.ih\:hover\:text-destructive:hover{color:var(--destructive)}.ih\:hover\:text-foreground.ih\:hover\:text-foreground:hover{color:var(--foreground)}.ih\:hover\:underline.ih\:hover\:underline:hover{text-decoration-line:underline}}.ih\:focus-visible\:bg-background.ih\:focus-visible\:bg-background:focus-visible{background-color:var(--background)}.ih\:focus-visible\:ring-3.ih\:focus-visible\:ring-3:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ih\:focus-visible\:ring-ring\/30.ih\:focus-visible\:ring-ring\/30:focus-visible{--tw-ring-color:var(--ring)}@supports (color:color-mix(in lab, red, red)){.ih\:focus-visible\:ring-ring\/30.ih\:focus-visible\:ring-ring\/30:focus-visible{--tw-ring-color:color-mix(in oklab, var(--ring) 30%, transparent)}}.ih\:focus-visible\:outline-none.ih\:focus-visible\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}.ih\:disabled\:cursor-default.ih\:disabled\:cursor-default:disabled{cursor:default}.ih\:disabled\:opacity-40.ih\:disabled\:opacity-40:disabled{opacity:.4}.ih\:has-\[\:checked\]\:border-brand.ih\:has-\[\:checked\]\:border-brand:has(:checked){border-color:var(--brand)}.ih\:has-\[\:checked\]\:bg-brand-soft\/50.ih\:has-\[\:checked\]\:bg-brand-soft\/50:has(:checked){background-color:var(--brand-soft)}@supports (color:color-mix(in lab, red, red)){.ih\:has-\[\:checked\]\:bg-brand-soft\/50.ih\:has-\[\:checked\]\:bg-brand-soft\/50:has(:checked){background-color:color-mix(in oklab, var(--brand-soft) 50%, transparent)}}@media (min-width:40rem){.ih\:sm\:mx-5.ih\:sm\:mx-5{margin-inline:calc(var(--ih-spacing) * 5)}.ih\:sm\:ml-13.ih\:sm\:ml-13{margin-left:calc(var(--ih-spacing) * 13)}.ih\:sm\:h-52.ih\:sm\:h-52{height:calc(var(--ih-spacing) * 52)}.ih\:sm\:max-w-lg.ih\:sm\:max-w-lg{max-width:var(--ih-container-lg)}.ih\:sm\:max-w-md.ih\:sm\:max-w-md{max-width:var(--ih-container-md)}.ih\:sm\:grid-cols-2.ih\:sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.ih\:sm\:px-5.ih\:sm\:px-5{padding-inline:calc(var(--ih-spacing) * 5)}}@media (min-width:64rem){.ih\:lg\:grid-cols-3.ih\:lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.ih\:lg\:grid-cols-\[minmax\(0\,1fr\)_20rem\].ih\:lg\:grid-cols-\[minmax\(0\,1fr\)_20rem\]{grid-template-columns:minmax(0,1fr) 20rem}}@media (min-width:80rem){.ih\:xl\:grid-cols-4.ih\:xl\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@keyframes spin{to{transform:rotate(360deg)}} diff --git a/dist/chunks/PostCard-ClNPcHNo.js b/dist/chunks/PostCard-ClNPcHNo.js deleted file mode 100644 index 1f8dce9..0000000 --- a/dist/chunks/PostCard-ClNPcHNo.js +++ /dev/null @@ -1 +0,0 @@ -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`}]]}),M=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`}]]}),ae=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`]}),oe=e({name:`thumbs-up`,size:24,node:[[`path`,{d:`M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z`,key:`emmmcr`}],[`path`,{d:`M7 10v12`,key:`1qc93n`}]]}),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`},se=[`href`],ce={class:`ih:mt-0.5 ih:flex ih:gap-3 ih:px-3 ih:text-xs ih:text-muted-foreground`},le=[`onClick`],ue=[`onSubmit`],de=[`placeholder`],fe=[`disabled`],pe={__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,se)):a(``,!0),l(B,{text:e.body,limit:400},null,8,[`text`])]),s(`div`,ce,[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,le)):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,de),[[v,y.value]])],40,ue)):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,fe)],32)):a(``,!0)]))}},me=[`aria-label`],he={class:`ih:flex ih:items-start ih:gap-3 ih:px-4 ih:pt-4 ih:sm:px-5`},ge={class:`ih:min-w-0 ih:flex-1 ih:text-sm`},_e={class:`ih:leading-snug`},ve=[`href`],ye=[`href`],be={class:`ih:flex ih:items-center ih:gap-1.5 ih:text-xs ih:text-muted-foreground`},xe=[`href`],Se={key:1,class:`ih:inline-flex ih:items-center ih:gap-0.5 ih:font-medium ih:text-brand-text`},Ce={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`},we={class:`ih:px-4 ih:pt-3 ih:text-[15px] ih:leading-relaxed ih:sm:px-5`},Te={class:`ih:flex ih:gap-2`},Ee=[`href`],De=[`src`,`alt`],Oe={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`},ke={key:1,class:`ih:grid ih:gap-2 ih:px-4 ih:pt-3 ih:sm:px-5`},Ae=[`href`],je={class:`ih:min-w-0 ih:flex-1`},Me={class:`ih:block ih:truncate ih:text-sm ih:font-medium`},Ne={class:`ih:text-xs ih:text-muted-foreground`},Pe={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`},Fe={class:`ih:px-1 ih:text-xs ih:font-semibold ih:text-muted-foreground`},Ie=[`aria-pressed`,`disabled`,`onClick`],Le={class:`ih:relative ih:flex ih:justify-between ih:gap-3`},Re={key:0,class:`ih:text-muted-foreground ih:tabular-nums`},ze={class:`ih:flex ih:items-center ih:justify-between ih:text-xs ih:text-muted-foreground`},$={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`},Be={key:0,class:`ih:inline-flex ih:items-center ih:gap-1`},Ve={class:`ih:tracking-tighter`},He={key:1},Ue={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`},We={class:`ih:group/react ih:relative`},Ge=[`aria-pressed`],Ke={key:0,class:`ih:text-base`},qe={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`},Je=[`aria-label`,`onClick`],Ye={key:4,class:`ih:h-3`},Xe={__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`,he,[_(I).user?(f(),i(_(E),{key:0,person:_(I).user,class:`ih:size-10`},null,8,[`person`])):a(``,!0),s(`div`,ge,[s(`p`,_e,[_(I).user?(f(),o(`a`,{key:0,href:`/personen/${_(I).user.id}`,class:`ih:font-semibold ih:hover:underline`},g(_(I).user.name),9,ve)):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,ye)],64)):a(``,!0)]),s(`p`,be,[s(`a`,{href:_(I).url,class:`ih:hover:underline`},g(_(D)(_(I).created_at)),9,xe),_(I).edited?(f(),o(n,{key:0},[c(` · bearbeitet`)],64)):a(``,!0),_(I).pinned?(f(),o(`span`,Se,[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`,Ce,[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?_(ae):_(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(_(M)),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`,we,[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`,Te,[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,De),t===3&&_(I).images.length>4?(f(),o(`span`,Oe,`+`+g(_(I).images.length-4),1)):a(``,!0)],10,Ee))),128))],2)):a(``,!0),_(I).files.length?(f(),o(`div`,ke,[(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`,je,[s(`span`,Me,g(e.name),1),s(`span`,Ne,g(_(L)(e.size)),1)]),l(_(ne),{class:`ih:size-4 ih:text-muted-foreground`})],8,Ae))),128))])):a(``,!0),_(I).poll?(f(),o(`fieldset`,Pe,[s(`legend`,Fe,`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`,Le,[s(`span`,{class:u({"ih:font-semibold":_(I).poll.mine.includes(t)})},g(e.label),3),W.value?(f(),o(`span`,Re,g(G.value?Math.round(e.votes/G.value*100):0)+` % · `+g(e.votes),1)):a(``,!0)])],10,Ie))),128)),s(`div`,ze,[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`,$,[_(I).reactions_total?(f(),o(`span`,Be,[s(`span`,Ve,g(_(I).reactions.slice(0,3).map(e=>e.emoji).join(``)),1),c(` `+g(_(I).reactions_total),1)])):(f(),o(`span`,He)),_(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`,Ue,[s(`div`,We,[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??`👍`)},[_(I).my_reaction?(f(),o(`span`,Ke,g(_(I).my_reaction),1)):(f(),i(_(oe),{key:1,class:`ih:size-4`})),c(` `+g(_(I).my_reaction?`Reagiert`:`Gefällt mir`),1)],10,Ge),s(`div`,qe,[(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,Je))),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`,Ye)),R.value?(f(),i(pe,{key:5,post:_(I),full:!!e.fullComments,initial:e.fullComments},null,8,[`post`,`full`,`initial`])):a(``,!0)],8,me))}};export{j as i,L as n,F as r,Xe as t}; \ No newline at end of file diff --git a/dist/chunks/PostCard-hYMtqskw.js b/dist/chunks/PostCard-hYMtqskw.js new file mode 100644 index 0000000..e268f50 --- /dev/null +++ b/dist/chunks/PostCard-hYMtqskw.js @@ -0,0 +1 @@ +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 ih:object-cover`,_(I).images.length===1?`ih:max-h-[32rem]`:`ih:aspect-square ih:h-full`])},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}; \ No newline at end of file diff --git a/dist/inhaus.json b/dist/inhaus.json index 76ee846..b962745 100644 --- a/dist/inhaus.json +++ b/dist/inhaus.json @@ -7,6 +7,6 @@ "widgets/Recent": "widgets/Recent.js" }, "css": [ - "assets/style-B47C9pxK.css" + "assets/style-CWIv2Jl3.css" ] } \ No newline at end of file diff --git a/dist/pages/Index.js b/dist/pages/Index.js index 60bf562..0f3ba23 100644 --- a/dist/pages/Index.js +++ b/dist/pages/Index.js @@ -1 +1 @@ -import{n as e,t}from"../chunks/loader-circle-CxzeMpQS.js";import{n,t as r}from"../chunks/GroupCard-5fLVVVGb.js";import{t as i}from"../chunks/PostCard-ClNPcHNo.js";import{r as a,t as o}from"../chunks/GroupDialog-DkTJQL7Q.js";import{Fragment as s,createBlock as c,createCommentVNode as l,createElementBlock as u,createElementVNode as d,createTextVNode as f,createVNode as p,normalizeStyle as m,openBlock as h,ref as g,renderList as _,toDisplayString as v,unref as y,watch as b,withCtx as x}from"vue";import{Link as S,usePage as C}from"@inertiajs/vue3";import{AppLayout as w,Button as T,EmptyState as E,PageHeader as D,http as O,toast as k}from"@inhaus/ui";var A=e({name:`users-round`,size:24,node:[[`path`,{d:`M18 21a8 8 0 0 0-16 0`,key:`3ypg7q`}],[`circle`,{cx:`10`,cy:`8`,r:`5`,key:`o932ke`}],[`path`,{d:`M22 20c0-3.37-2-6.5-4-8a5 5 0 0 0-.45-8.3`,key:`10s06x`}]],aliases:[`users-2`]}),j={class:`ih:grid ih:gap-6 ih:lg:grid-cols-[minmax(0,1fr)_20rem]`},M={class:`ih:grid ih:min-w-0 ih:content-start ih:gap-4`,"aria-label":`Neue Beiträge aus Ihren Gruppen`},N={key:1,class:`ih:rounded-xl ih:border ih:bg-card`},P={class:`ih:grid ih:content-start ih:gap-5`},F={key:0,class:`ih:rounded-xl ih:border ih:border-brand/40 ih:bg-brand-soft/40 ih:p-4`},I={class:`ih:grid ih:gap-3`},L={class:`ih:rounded-xl ih:border ih:bg-card ih:p-4`},R={key:0,class:`ih:-mx-2 ih:grid`},z={class:`ih:min-w-0`},B={class:`ih:block ih:truncate ih:text-sm ih:font-medium`},V={class:`ih:text-xs ih:text-muted-foreground`},H={key:1,class:`ih:text-sm ih:text-muted-foreground`},U={key:1,class:`ih:grid ih:gap-3`},W={__name:`Index`,props:{posts:{type:Array,required:!0},more:{type:Boolean,default:!1},groups:{type:Array,required:!0},invitations:{type:Array,default:()=>[]},suggested:{type:Array,default:()=>[]},privacy:{type:Object,required:!0},privacyHints:{type:Object,required:!0}},setup(e){let W=e,G=C();b(()=>G.props.flash?.status,e=>e&&k.success(e),{immediate:!0});let K=g(W.posts),q=g(W.more),J=g(!1),Y=g(!1),X=[`👍`,`❤️`,`😂`,`😮`,`😢`,`👏`];async function Z(){J.value=!0;let e=await O.get(`/gruppen?vor=${K.value.at(-1).id}`);K.value.push(...e.posts),q.value=e.more,J.value=!1}return(g,b)=>(h(),c(y(w),{title:`Gruppen`},{default:x(()=>[p(y(D),{title:`Gruppen`,description:`Austausch zu Themen, Hobbys und Projekten – offen, geschlossen oder privat.`},{actions:x(()=>[p(y(T),{variant:`outline`,"as-child":``},{default:x(()=>[p(y(S),{href:`/gruppen/entdecken`},{default:x(()=>[p(y(n)),b[2]||=f(` Gruppen entdecken`,-1)]),_:1})]),_:1}),p(y(T),{onClick:b[0]||=e=>Y.value=!0},{default:x(()=>[p(y(a)),b[3]||=f(` Gruppe gründen`,-1)]),_:1})]),_:1}),d(`div`,j,[d(`section`,M,[(h(!0),u(s,null,_(K.value,e=>(h(),c(i,{key:e.id,post:e,reactions:X,"show-group":``,onDeleted:t=>K.value=K.value.filter(t=>t.id!==e.id)},null,8,[`post`,`onDeleted`]))),128)),q.value?(h(),c(y(T),{key:0,variant:`outline`,disabled:J.value,onClick:Z},{default:x(()=>[J.value?(h(),c(y(t),{key:0,class:`ih:animate-spin`})):l(``,!0),b[4]||=f(` Ältere Beiträge laden`,-1)]),_:1},8,[`disabled`])):l(``,!0),K.value.length?l(``,!0):(h(),u(`div`,N,[p(y(E),{icon:y(A),title:e.groups.length?`Noch keine Beiträge`:`Sie sind noch in keiner Gruppe`,text:e.groups.length?`Schreiben Sie den ersten Beitrag in einer Ihrer Gruppen.`:`Entdecken Sie Gruppen zu Ihren Themen – oder gründen Sie selbst eine.`},null,8,[`icon`,`title`,`text`])]))]),d(`aside`,P,[e.invitations.length?(h(),u(`section`,F,[b[5]||=d(`h2`,{class:`ih:mb-2 ih:text-sm ih:font-semibold`},`Einladungen`,-1),d(`div`,I,[(h(!0),u(s,null,_(e.invitations,e=>(h(),c(r,{key:e.id,group:e},null,8,[`group`]))),128))])])):l(``,!0),d(`section`,L,[b[6]||=d(`h2`,{class:`ih:mb-2 ih:text-sm ih:font-semibold`},`Ihre Gruppen`,-1),e.groups.length?(h(),u(`ul`,R,[(h(!0),u(s,null,_(e.groups,e=>(h(),u(`li`,{key:e.id},[p(y(S),{href:e.url,class:`ih:flex ih:items-center ih:gap-3 ih:rounded-md ih:p-2 ih:hover:bg-accent/60`},{default:x(()=>[d(`span`,{class:`ih:size-10 ih:shrink-0 ih:rounded-md ih:bg-brand ih:bg-cover ih:bg-center`,style:m(e.cover_url?{backgroundImage:`url(${e.cover_url})`}:{})},null,4),d(`span`,z,[d(`span`,B,v(e.name),1),d(`span`,V,v(e.members_count)+` `+v(e.members_count===1?`Mitglied`:`Mitglieder`),1)])]),_:2},1032,[`href`])]))),128))])):(h(),u(`p`,H,`Noch keine.`))]),e.suggested.length?(h(),u(`section`,U,[b[7]||=d(`h2`,{class:`ih:text-sm ih:font-semibold`},`Vorschläge`,-1),(h(!0),u(s,null,_(e.suggested,e=>(h(),c(r,{key:e.id,group:e},null,8,[`group`]))),128))])):l(``,!0)])]),p(o,{open:Y.value,"onUpdate:open":b[1]||=e=>Y.value=e,privacy:e.privacy,"privacy-hints":e.privacyHints},null,8,[`open`,`privacy`,`privacy-hints`])]),_:1}))}};export{W as default}; \ No newline at end of file +import{n as e,t}from"../chunks/loader-circle-CxzeMpQS.js";import{n,t as r}from"../chunks/GroupCard-5fLVVVGb.js";import{t as i}from"../chunks/PostCard-hYMtqskw.js";import{r as a,t as o}from"../chunks/GroupDialog-DkTJQL7Q.js";import{Fragment as s,createBlock as c,createCommentVNode as l,createElementBlock as u,createElementVNode as d,createTextVNode as f,createVNode as p,normalizeStyle as m,openBlock as h,ref as g,renderList as _,toDisplayString as v,unref as y,watch as b,withCtx as x}from"vue";import{Link as S,usePage as C}from"@inertiajs/vue3";import{AppLayout as w,Button as T,EmptyState as E,PageHeader as D,http as O,toast as k}from"@inhaus/ui";var A=e({name:`users-round`,size:24,node:[[`path`,{d:`M18 21a8 8 0 0 0-16 0`,key:`3ypg7q`}],[`circle`,{cx:`10`,cy:`8`,r:`5`,key:`o932ke`}],[`path`,{d:`M22 20c0-3.37-2-6.5-4-8a5 5 0 0 0-.45-8.3`,key:`10s06x`}]],aliases:[`users-2`]}),j={class:`ih:grid ih:gap-6 ih:lg:grid-cols-[minmax(0,1fr)_20rem]`},M={class:`ih:mx-auto ih:grid ih:w-full ih:max-w-2xl ih:content-start ih:gap-4`,"aria-label":`Neue Beiträge aus Ihren Gruppen`},N={key:1,class:`ih:rounded-xl ih:border ih:bg-card`},P={class:`ih:grid ih:content-start ih:gap-5`},F={key:0,class:`ih:rounded-xl ih:border ih:border-brand/40 ih:bg-brand-soft/40 ih:p-4`},I={class:`ih:grid ih:gap-3`},L={class:`ih:rounded-xl ih:border ih:bg-card ih:p-4`},R={key:0,class:`ih:-mx-2 ih:grid`},z={class:`ih:min-w-0`},B={class:`ih:block ih:truncate ih:text-sm ih:font-medium`},V={class:`ih:text-xs ih:text-muted-foreground`},H={key:1,class:`ih:text-sm ih:text-muted-foreground`},U={key:1,class:`ih:grid ih:gap-3`},W={__name:`Index`,props:{posts:{type:Array,required:!0},more:{type:Boolean,default:!1},groups:{type:Array,required:!0},invitations:{type:Array,default:()=>[]},suggested:{type:Array,default:()=>[]},privacy:{type:Object,required:!0},privacyHints:{type:Object,required:!0}},setup(e){let W=e,G=C();b(()=>G.props.flash?.status,e=>e&&k.success(e),{immediate:!0});let K=g(W.posts),q=g(W.more),J=g(!1),Y=g(!1),X=[`👍`,`❤️`,`😂`,`😮`,`😢`,`👏`];async function Z(){J.value=!0;let e=await O.get(`/gruppen?vor=${K.value.at(-1).id}`);K.value.push(...e.posts),q.value=e.more,J.value=!1}return(g,b)=>(h(),c(y(w),{title:`Gruppen`},{default:x(()=>[p(y(D),{title:`Gruppen`,description:`Austausch zu Themen, Hobbys und Projekten – offen, geschlossen oder privat.`},{actions:x(()=>[p(y(T),{variant:`outline`,"as-child":``},{default:x(()=>[p(y(S),{href:`/gruppen/entdecken`},{default:x(()=>[p(y(n)),b[2]||=f(` Gruppen entdecken`,-1)]),_:1})]),_:1}),p(y(T),{onClick:b[0]||=e=>Y.value=!0},{default:x(()=>[p(y(a)),b[3]||=f(` Gruppe gründen`,-1)]),_:1})]),_:1}),d(`div`,j,[d(`section`,M,[(h(!0),u(s,null,_(K.value,e=>(h(),c(i,{key:e.id,post:e,reactions:X,"show-group":``,onDeleted:t=>K.value=K.value.filter(t=>t.id!==e.id)},null,8,[`post`,`onDeleted`]))),128)),q.value?(h(),c(y(T),{key:0,variant:`outline`,disabled:J.value,onClick:Z},{default:x(()=>[J.value?(h(),c(y(t),{key:0,class:`ih:animate-spin`})):l(``,!0),b[4]||=f(` Ältere Beiträge laden`,-1)]),_:1},8,[`disabled`])):l(``,!0),K.value.length?l(``,!0):(h(),u(`div`,N,[p(y(E),{icon:y(A),title:e.groups.length?`Noch keine Beiträge`:`Sie sind noch in keiner Gruppe`,text:e.groups.length?`Schreiben Sie den ersten Beitrag in einer Ihrer Gruppen.`:`Entdecken Sie Gruppen zu Ihren Themen – oder gründen Sie selbst eine.`},null,8,[`icon`,`title`,`text`])]))]),d(`aside`,P,[e.invitations.length?(h(),u(`section`,F,[b[5]||=d(`h2`,{class:`ih:mb-2 ih:text-sm ih:font-semibold`},`Einladungen`,-1),d(`div`,I,[(h(!0),u(s,null,_(e.invitations,e=>(h(),c(r,{key:e.id,group:e},null,8,[`group`]))),128))])])):l(``,!0),d(`section`,L,[b[6]||=d(`h2`,{class:`ih:mb-2 ih:text-sm ih:font-semibold`},`Ihre Gruppen`,-1),e.groups.length?(h(),u(`ul`,R,[(h(!0),u(s,null,_(e.groups,e=>(h(),u(`li`,{key:e.id},[p(y(S),{href:e.url,class:`ih:flex ih:items-center ih:gap-3 ih:rounded-md ih:p-2 ih:hover:bg-accent/60`},{default:x(()=>[d(`span`,{class:`ih:size-10 ih:shrink-0 ih:rounded-md ih:bg-brand ih:bg-cover ih:bg-center`,style:m(e.cover_url?{backgroundImage:`url(${e.cover_url})`}:{})},null,4),d(`span`,z,[d(`span`,B,v(e.name),1),d(`span`,V,v(e.members_count)+` `+v(e.members_count===1?`Mitglied`:`Mitglieder`),1)])]),_:2},1032,[`href`])]))),128))])):(h(),u(`p`,H,`Noch keine.`))]),e.suggested.length?(h(),u(`section`,U,[b[7]||=d(`h2`,{class:`ih:text-sm ih:font-semibold`},`Vorschläge`,-1),(h(!0),u(s,null,_(e.suggested,e=>(h(),c(r,{key:e.id,group:e},null,8,[`group`]))),128))])):l(``,!0)])]),p(o,{open:Y.value,"onUpdate:open":b[1]||=e=>Y.value=e,privacy:e.privacy,"privacy-hints":e.privacyHints},null,8,[`open`,`privacy`,`privacy-hints`])]),_:1}))}};export{W as default}; \ No newline at end of file diff --git a/dist/pages/Post.js b/dist/pages/Post.js index d41304d..17c5a26 100644 --- a/dist/pages/Post.js +++ b/dist/pages/Post.js @@ -1 +1 @@ -import{i as e,t}from"../chunks/PostCard-ClNPcHNo.js";import{Fragment as n,createBlock as r,createCommentVNode as i,createElementBlock as a,createElementVNode as o,createTextVNode as s,createVNode as c,onMounted as l,openBlock as u,renderList as d,toDisplayString as f,unref as p,withCtx as m}from"vue";import{router as h}from"@inertiajs/vue3";import{AppLayout as g,Button as _,PageHeader as v,http as y,toast as b}from"@inhaus/ui";var x={class:`ih:mx-auto ih:grid ih:max-w-4xl ih:gap-4`},S={key:0,class:`ih:rounded-md ih:border ih:border-destructive/30 ih:bg-destructive/5 ih:p-3 ih:text-sm`},C={class:`ih:flex ih:items-center ih:gap-2 ih:font-medium`},w={class:`ih:mt-1 ih:list-disc ih:pl-6 ih:text-muted-foreground`},T={__name:`Post`,props:{group:{type:Object,required:!0},post:{type:Object,required:!0},comments:{type:Array,required:!0},reactions:{type:Array,required:!0},reports:{type:Array,default:()=>[]}},setup(T){let E=T;l(()=>{(location.hash?document.querySelector(location.hash):null)?.scrollIntoView({block:`center`})});async function D(){await y.post(`/gruppen/beitraege/${E.post.id}/meldungen-erledigt`),b.success(`Meldungen erledigt`),h.reload()}return(l,y)=>(u(),r(p(g),{title:`Beitrag in ${T.group.name}`,width:`medium`},{default:m(()=>[c(p(v),{title:`Beitrag`,breadcrumbs:[{label:`Gruppen`,href:`/gruppen`},{label:T.group.name,href:T.group.url}]},null,8,[`breadcrumbs`]),o(`div`,x,[T.reports.length?(u(),a(`div`,S,[o(`p`,C,[c(p(e),{class:`ih:size-4 ih:text-destructive`}),s(` `+f(T.reports.length)+` `+f(T.reports.length===1?`Meldung`:`Meldungen`),1)]),o(`ul`,w,[(u(!0),a(n,null,d(T.reports,e=>(u(),a(`li`,{key:e.id},f(e.comment_id?`Kommentar: `:``)+f(e.reason),1))),128))]),c(p(_),{size:`sm`,variant:`outline`,class:`ih:mt-2`,onClick:D},{default:m(()=>[...y[1]||=[s(`In Ordnung – erledigt`,-1)]]),_:1})])):i(``,!0),c(t,{post:T.post,reactions:T.reactions,"full-comments":T.comments,onDeleted:y[0]||=e=>p(h).visit(T.group.url)},null,8,[`post`,`reactions`,`full-comments`])])]),_:1},8,[`title`]))}};export{T as default}; \ No newline at end of file +import{n as e}from"../chunks/loader-circle-CxzeMpQS.js";import{i as t,t as n}from"../chunks/PostCard-hYMtqskw.js";import{Fragment as r,createBlock as i,createCommentVNode as a,createElementBlock as o,createElementVNode as s,createTextVNode as c,createVNode as l,onMounted as u,openBlock as d,renderList as f,toDisplayString as p,unref as m,withCtx as h}from"vue";import{Link as g,router as _}from"@inertiajs/vue3";import{AppLayout as v,Button as y,http as b,toast as x}from"@inhaus/ui";var S=e({name:`chevron-left`,size:24,node:[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]}),C={class:`ih:mx-auto ih:grid ih:max-w-2xl ih:gap-4`},w={key:0,class:`ih:rounded-md ih:border ih:border-destructive/30 ih:bg-destructive/5 ih:p-3 ih:text-sm`},T={class:`ih:flex ih:items-center ih:gap-2 ih:font-medium`},E={class:`ih:mt-1 ih:list-disc ih:pl-6 ih:text-muted-foreground`},D={__name:`Post`,props:{group:{type:Object,required:!0},post:{type:Object,required:!0},comments:{type:Array,required:!0},reactions:{type:Array,required:!0},reports:{type:Array,default:()=>[]}},setup(e){let D=e;u(()=>{(location.hash&&document.querySelector(location.hash))?.scrollIntoView({block:`center`})});async function O(){await b.post(`/gruppen/beitraege/${D.post.id}/meldungen-erledigt`),x.success(`Meldungen erledigt`),_.reload()}return(u,b)=>(d(),i(m(v),{title:`Beitrag in ${e.group.name}`},{default:h(()=>[s(`div`,C,[l(m(g),{href:e.group.url,class:`ih:inline-flex ih:items-center ih:gap-1 ih:text-sm ih:font-medium ih:text-muted-foreground ih:hover:text-foreground`},{default:h(()=>[l(m(S),{class:`ih:size-4`}),c(` `+p(e.group.name),1)]),_:1},8,[`href`]),e.reports.length?(d(),o(`div`,w,[s(`p`,T,[l(m(t),{class:`ih:size-4 ih:text-destructive`}),c(` `+p(e.reports.length)+` `+p(e.reports.length===1?`Meldung`:`Meldungen`),1)]),s(`ul`,E,[(d(!0),o(r,null,f(e.reports,e=>(d(),o(`li`,{key:e.id},p(e.comment_id?`Kommentar: `:``)+p(e.reason),1))),128))]),l(m(y),{size:`sm`,variant:`outline`,class:`ih:mt-2`,onClick:O},{default:h(()=>[...b[1]||=[c(`In Ordnung – erledigt`,-1)]]),_:1})])):a(``,!0),l(n,{post:e.post,reactions:e.reactions,"full-comments":e.comments,onDeleted:b[0]||=t=>m(_).visit(e.group.url)},null,8,[`post`,`reactions`,`full-comments`])])]),_:1},8,[`title`]))}};export{D as default}; \ No newline at end of file diff --git a/dist/pages/Show.js b/dist/pages/Show.js index 4cb4a40..a013c19 100644 --- a/dist/pages/Show.js +++ b/dist/pages/Show.js @@ -1 +1 @@ -import{n as e,t}from"../chunks/loader-circle-CxzeMpQS.js";import{i as n,n as r,r as i,t as a}from"../chunks/PostCard-ClNPcHNo.js";import{a as o,i as s,n as c,o as l,r as u,t as d}from"../chunks/GroupDialog-DkTJQL7Q.js";import{t as f}from"../chunks/search-7rL_HYGC.js";import{Fragment as p,computed as m,createBlock as h,createCommentVNode as g,createElementBlock as _,createElementVNode as v,createTextVNode as y,createVNode as b,mergeModels as x,normalizeClass as S,normalizeStyle as C,openBlock as w,ref as T,renderList as E,resolveDynamicComponent as D,toDisplayString as O,unref as k,useModel as A,vModelText as j,watch as M,withCtx as N,withDirectives as P,withKeys as F,withModifiers as I}from"vue";import{router as L,usePage as ee}from"@inertiajs/vue3";import{AppLayout as te,Button as R,Dialog as ne,DialogContent as re,DialogDescription as ie,DialogFooter as ae,DialogHeader as oe,DialogTitle as se,EmptyState as z,PageHeader as ce,PersonAvatar as B,Switch as V,http as H,toast as U}from"@inhaus/ui";var le=e({name:`bell-off`,size:24,node:[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742`,key:`178tsu`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05`,key:`1hqiys`}]]}),ue=e({name:`bell`,size:24,node:[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}]]}),W=e({name:`chart-column`,size:24,node:[[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}],[`path`,{d:`M18 17V9`,key:`2bz60n`}],[`path`,{d:`M13 17V5`,key:`1frdt8`}],[`path`,{d:`M8 17v-3`,key:`17ska0`}]],aliases:[`bar-chart-3`]}),G=e({name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]}),K=e({name:`file`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}]]}),q=e({name:`image-plus`,size:24,node:[[`path`,{d:`M16 5h6`,key:`1vod17`}],[`path`,{d:`M19 2v6`,key:`4bpg5p`}],[`path`,{d:`M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5`,key:`1ue2ih`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}]]}),de=e({name:`log-out`,size:24,node:[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]}),J=e({name:`paperclip`,size:24,node:[[`path`,{d:`m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551`,key:`1miecu`}]]}),Y=e({name:`pencil-line`,size:24,node:[[`path`,{d:`M13 21h8`,key:`1jsn5i`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}],[`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`}]]}),fe=e({name:`user-minus`,size:24,node:[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}],[`line`,{x1:`22`,x2:`16`,y1:`11`,y2:`11`,key:`1shjgl`}]]}),X=e({name:`user-plus`,size:24,node:[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}],[`line`,{x1:`19`,x2:`19`,y1:`8`,y2:`14`,key:`1bvyxn`}],[`line`,{x1:`22`,x2:`16`,y1:`11`,y2:`11`,key:`1shjgl`}]]}),Z=e({name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]}),Q={class:`ih:grid ih:gap-2`},pe={key:0,class:`ih:flex ih:flex-wrap ih:gap-1.5`},me=[`aria-label`,`onClick`],he={class:`ih:relative`},$=[`autofocus`,`placeholder`],ge={key:1,class:`ih:max-h-64 ih:overflow-y-auto ih:rounded-md ih:border ih:bg-popover ih:p-1`,role:`listbox`},_e=[`aria-selected`],ve=[`onClick`,`onMouseenter`],ye={class:`ih:min-w-0 ih:flex-1`},be={class:`ih:block ih:truncate ih:font-medium`},xe={key:0,class:`ih:block ih:truncate ih:text-xs ih:text-muted-foreground`},Se={key:2,class:`ih:px-1 ih:text-[13px] ih:text-muted-foreground`},Ce={__name:`PeopleSelect`,props:x({multiple:{type:Boolean,default:!1},exclude:{type:Array,default:()=>[]},placeholder:{type:String,default:`Name oder E-Mail eingeben …`},autofocus:{type:Boolean,default:!1}},{modelValue:{type:Array,default:()=>[]},modelModifiers:{}}),emits:x([`pick`],[`update:modelValue`]),setup(e,{emit:t}){let n=e,r=t,i=A(e,`modelValue`),a=T(``),o=T([]),s=T(0),c=T(!1),l;M(a,e=>{if(clearTimeout(l),e.trim().length<2){o.value=[];return}l=setTimeout(async()=>{c.value=!0;try{let t=[...n.exclude,...i.value.map(e=>e.id)];o.value=(await H.get(`/personen/suche?q=${encodeURIComponent(e.trim())}`)).people.filter(e=>!t.includes(e.id)),s.value=0}finally{c.value=!1}},200)});function u(e){e&&(r(`pick`,e),n.multiple&&(i.value=[...i.value,e]),a.value=``,o.value=[])}let d=e=>i.value=i.value.filter(t=>t.id!==e.id);return(t,n)=>(w(),_(`div`,Q,[e.multiple&&i.value.length?(w(),_(`div`,pe,[(w(!0),_(p,null,E(i.value,e=>(w(),_(`span`,{key:e.id,class:`ih:inline-flex ih:items-center ih:gap-1.5 ih:rounded-full ih:border ih:bg-card ih:py-0.5 ih:pr-1 ih:pl-0.5 ih:text-[13px]`},[b(k(B),{person:e,class:`ih:size-6 ih:text-[10px]`},null,8,[`person`]),y(` `+O(e.name)+` `,1),v(`button`,{type:`button`,class:`ih:rounded-full ih:p-0.5 ih:text-muted-foreground ih:hover:bg-muted ih:hover:text-foreground`,"aria-label":`${e.name} entfernen`,onClick:t=>d(e)},[b(k(Z),{class:`ih:size-3.5`})],8,me)]))),128))])):g(``,!0),v(`div`,he,[b(k(f),{class:`ih:pointer-events-none ih:absolute ih:top-1/2 ih:left-2.5 ih:size-4 ih:-translate-y-1/2 ih:text-muted-foreground`}),P(v(`input`,{"onUpdate:modelValue":n[0]||=e=>a.value=e,type:`search`,autocomplete:`off`,autofocus:e.autofocus,placeholder:e.placeholder,"aria-label":`Person suchen`,class:`ih:h-10 ih:w-full ih:rounded-md ih:border ih:border-input ih:bg-card ih:pr-3 ih:pl-8 ih:text-sm ih:shadow-xs ih:focus-visible:ring-3 ih:focus-visible:ring-ring/30 ih:focus-visible:outline-none`,onKeydown:[n[1]||=F(I(e=>s.value=Math.min(o.value.length-1,s.value+1),[`prevent`]),[`down`]),n[2]||=F(I(e=>s.value=Math.max(0,s.value-1),[`prevent`]),[`up`]),n[3]||=F(I(e=>u(o.value[s.value]),[`prevent`]),[`enter`])]},null,40,$),[[j,a.value]])]),o.value.length?(w(),_(`ul`,ge,[(w(!0),_(p,null,E(o.value,(e,t)=>(w(),_(`li`,{key:e.id,role:`option`,"aria-selected":t===s.value},[v(`button`,{type:`button`,class:S([`ih:flex ih:w-full ih:items-center ih:gap-2.5 ih:rounded ih:px-2 ih:py-1.5 ih:text-left ih:text-sm`,t===s.value?`ih:bg-accent`:`ih:hover:bg-accent/60`]),onClick:t=>u(e),onMouseenter:e=>s.value=t},[b(k(B),{person:e,class:`ih:size-7 ih:text-[11px]`},null,8,[`person`]),v(`span`,ye,[v(`span`,be,O(e.name),1),e.job_title||e.department?(w(),_(`span`,xe,O([e.job_title,e.department].filter(Boolean).join(` · `)),1)):g(``,!0)])],42,ve)],8,_e))),128))])):a.value.trim().length>=2&&!c.value?(w(),_(`p`,Se,`Niemand gefunden.`)):g(``,!0)]))}},we={class:`ih:flex ih:gap-3`},Te=[`rows`],Ee={key:0,class:`ih:mt-3 ih:flex ih:flex-wrap ih:gap-2 ih:pl-13`},De=[`src`,`alt`],Oe={key:1,class:`ih:flex ih:h-20 ih:w-40 ih:items-center ih:gap-2 ih:rounded-md ih:border ih:bg-muted ih:px-2 ih:text-xs`},ke={class:`ih:min-w-0`},Ae={class:`ih:block ih:truncate ih:font-medium`},je=[`aria-label`,`onClick`],Me={key:1,class:`ih:mt-3 ih:grid ih:gap-2 ih:rounded-lg ih:border ih:p-3 ih:sm:ml-13`},Ne={class:`ih:flex ih:items-center ih:justify-between`},Pe=[`onUpdate:modelValue`,`placeholder`,`aria-label`],Fe={class:`ih:flex ih:flex-wrap ih:items-center ih:justify-between ih:gap-2`},Ie={class:`ih:flex ih:items-center ih:gap-2 ih:text-sm`},Le={key:2,class:`ih:mt-3 ih:flex ih:flex-wrap ih:items-center ih:gap-1 ih:border-t ih:pt-3`},Re={__name:`PostComposer`,props:{group:{type:Object,required:!0},me:{type:Object,required:!0}},emits:[`created`],setup(e,{emit:n}){let i=e,a=n,o=T(``),s=T([]),c=T(null),l=T(!1),d=T(!1),f=T(null),x=T(null),S=T(!1),C=m(()=>!d.value&&(o.value.trim()||s.value.length||c.value&&c.value.filter(e=>e.trim()).length>=2));function D(e){for(let t of e){if(s.value.length>=10){U.error(`Höchstens 10 Dateien je Beitrag.`);break}s.value.push({file:t,url:t.type.startsWith(`image/`)?URL.createObjectURL(t):null})}S.value=!0}function A(e){let[t]=s.value.splice(e,1);t?.url&&URL.revokeObjectURL(t.url)}async function M(){d.value=!0;let e=new FormData;o.value.trim()&&e.append(`body`,o.value),s.value.forEach(t=>e.append(`files[]`,t.file)),c.value&&(c.value.filter(e=>e.trim()).forEach(t=>e.append(`poll[]`,t)),e.append(`multiple`,l.value?`1`:`0`));try{let{post:t}=await H.post(`/gruppen/${i.group.slug}/beitraege`,e);a(`created`,t),s.value.forEach(e=>e.url&&URL.revokeObjectURL(e.url)),o.value=``,s.value=[],c.value=null,S.value=!1}catch(e){U.error(e.message)}finally{d.value=!1}}return(n,i)=>(w(),_(`section`,{class:`ih:rounded-xl ih:border ih:bg-card ih:p-4 ih:shadow-xs`,"aria-label":`Neuer Beitrag`,onDragover:i[11]||=I(()=>{},[`prevent`]),onDrop:i[12]||=I(e=>D([...e.dataTransfer.files]),[`prevent`])},[v(`div`,we,[b(k(B),{person:e.me,class:`ih:size-10`},null,8,[`person`]),P(v(`textarea`,{"onUpdate:modelValue":i[0]||=e=>o.value=e,rows:S.value||o.value?4:1,maxlength:`10000`,placeholder:`Was möchten Sie teilen?`,"aria-label":`Beitrag schreiben`,class:`ih:min-h-10 ih:min-w-0 ih:flex-1 ih:resize-none ih:rounded-2xl ih:bg-muted ih:px-4 ih:py-2 ih:text-[15px] ih:focus-visible:bg-background ih:focus-visible:ring-3 ih:focus-visible:ring-ring/30 ih:focus-visible:outline-none`,onFocus:i[1]||=e=>S.value=!0,onPaste:i[2]||=e=>e.clipboardData?.files?.length&&(e.preventDefault(),D([...e.clipboardData.files]))},null,40,Te),[[j,o.value]])]),s.value.length?(w(),_(`ul`,Ee,[(w(!0),_(p,null,E(s.value,(e,t)=>(w(),_(`li`,{key:t,class:`ih:relative`},[e.url?(w(),_(`img`,{key:0,src:e.url,alt:e.file.name,class:`ih:size-20 ih:rounded-md ih:border ih:object-cover`},null,8,De)):(w(),_(`span`,Oe,[b(k(K),{class:`ih:size-5 ih:shrink-0`}),v(`span`,ke,[v(`span`,Ae,O(e.file.name),1),y(O(k(r)(e.file.size)),1)])])),v(`button`,{type:`button`,class:`ih:absolute ih:-top-1.5 ih:-right-1.5 ih:grid ih:size-5 ih:place-items-center ih:rounded-full ih:bg-foreground ih:text-background`,"aria-label":`${e.file.name} entfernen`,onClick:e=>A(t)},[b(k(Z),{class:`ih:size-3`})],8,je)]))),128))])):g(``,!0),c.value?(w(),_(`div`,Me,[v(`div`,Ne,[i[13]||=v(`span`,{class:`ih:text-sm ih:font-medium`},`Umfrage`,-1),v(`button`,{type:`button`,class:`ih:text-xs ih:text-muted-foreground ih:hover:text-foreground`,onClick:i[3]||=e=>c.value=null},`Entfernen`)]),(w(!0),_(p,null,E(c.value,(e,t)=>P((w(),_(`input`,{key:t,"onUpdate:modelValue":e=>c.value[t]=e,maxlength:`120`,placeholder:`Antwort ${t+1}`,"aria-label":`Antwort ${t+1}`,class:`ih:h-9 ih:rounded-md ih:border ih:border-input ih:bg-background ih:px-3 ih:text-sm`},null,8,Pe)),[[j,c.value[t]]])),128)),v(`div`,Fe,[c.value.length<10?(w(),_(`button`,{key:0,type:`button`,class:`ih:inline-flex ih:items-center ih:gap-1 ih:text-sm ih:text-brand-text ih:hover:underline`,onClick:i[4]||=e=>c.value.push(``)},[b(k(u),{class:`ih:size-4`}),i[14]||=y(` Antwort`,-1)])):g(``,!0),v(`label`,Ie,[b(k(V),{modelValue:l.value,"onUpdate:modelValue":i[5]||=e=>l.value=e},null,8,[`modelValue`]),i[15]||=y(` Mehrere Antworten erlauben`,-1)])])])):g(``,!0),S.value||o.value||s.value.length||c.value?(w(),_(`div`,Le,[v(`button`,{type:`button`,class:`ih:inline-flex ih:items-center ih:gap-1.5 ih:rounded-md ih:px-2.5 ih:py-1.5 ih:text-sm ih:text-muted-foreground ih:hover:bg-accent`,onClick:i[6]||=e=>f.value?.click()},[b(k(q),{class:`ih:size-4`}),i[16]||=y(` Foto`,-1)]),v(`button`,{type:`button`,class:`ih:inline-flex ih:items-center ih:gap-1.5 ih:rounded-md ih:px-2.5 ih:py-1.5 ih:text-sm ih:text-muted-foreground ih:hover:bg-accent`,onClick:i[7]||=e=>x.value?.click()},[b(k(J),{class:`ih:size-4`}),i[17]||=y(` Datei`,-1)]),c.value?g(``,!0):(w(),_(`button`,{key:0,type:`button`,class:`ih:inline-flex ih:items-center ih:gap-1.5 ih:rounded-md ih:px-2.5 ih:py-1.5 ih:text-sm ih:text-muted-foreground ih:hover:bg-accent`,onClick:i[8]||=e=>c.value=[``,``]},[b(k(W),{class:`ih:size-4`}),i[18]||=y(` Umfrage`,-1)])),i[20]||=v(`span`,{class:`ih:flex-1`},null,-1),b(k(R),{disabled:!C.value,onClick:M},{default:N(()=>[d.value?(w(),h(k(t),{key:0,class:`ih:animate-spin`})):g(``,!0),i[19]||=y(` Veröffentlichen`,-1)]),_:1},8,[`disabled`]),v(`input`,{ref_key:`photoInput`,ref:f,type:`file`,accept:`image/*`,multiple:``,class:`ih:hidden`,onChange:i[9]||=e=>{D([...e.target.files]),e.target.value=``}},null,544),v(`input`,{ref_key:`fileInput`,ref:x,type:`file`,multiple:``,class:`ih:hidden`,onChange:i[10]||=e=>{D([...e.target.files]),e.target.value=``}},null,544)])):g(``,!0)],32))}},ze={class:`ih:flex ih:flex-wrap ih:items-center ih:gap-x-3 ih:gap-y-1`},Be=[`title`],Ve={class:`ih:inline-flex ih:items-center ih:gap-1`},He={class:`ih:overflow-hidden ih:rounded-xl ih:border ih:bg-card ih:shadow-xs`},Ue=[`aria-selected`,`onClick`],We={key:0,class:`ih:ml-1 ih:rounded-full ih:bg-brand ih:px-1.5 ih:text-[11px] ih:text-brand-foreground`},Ge={key:1,class:`ih:absolute ih:inset-x-2 ih:bottom-0 ih:h-[3px] ih:rounded-t-full ih:bg-brand`},Ke={class:`ih:mt-6 ih:grid ih:items-start ih:gap-6 ih:lg:grid-cols-[minmax(0,1fr)_20rem]`},qe={class:`ih:grid ih:min-w-0 ih:gap-4`},Je={key:0,class:`ih:flex ih:items-center ih:gap-2 ih:rounded-md ih:border ih:border-destructive/30 ih:bg-destructive/5 ih:p-3 ih:text-sm`},Ye={key:2,class:`ih:rounded-xl ih:border ih:bg-card`},Xe={key:1,class:`ih:rounded-xl ih:border ih:bg-card`},Ze={key:2,class:`ih:rounded-xl ih:border ih:bg-card ih:p-5`},Qe={class:`ih:-mx-2 ih:mb-5 ih:grid`},$e={class:`ih:min-w-0 ih:flex-1 ih:text-sm`},et={class:`ih:font-medium`},tt={class:`ih:block ih:text-xs ih:text-muted-foreground`},nt={class:`ih:mb-2 ih:text-sm ih:font-semibold`},rt={class:`ih:-mx-2 ih:grid`},it=[`href`],at={class:`ih:font-medium`},ot={class:`ih:block ih:text-xs ih:text-muted-foreground`},st=[`value`,`aria-label`,`onChange`],ct=[`value`],lt={key:1,class:`ih:rounded ih:bg-brand-soft ih:px-1.5 ih:py-0.5 ih:text-[11px] ih:font-medium ih:text-brand-text`},ut=[`aria-label`,`onClick`],dt={class:`ih:text-sm ih:text-muted-foreground`},ft={key:1,class:`ih:text-sm ih:text-muted-foreground`},pt={key:3,class:`ih:grid ih:gap-4 ih:rounded-xl ih:border ih:bg-card ih:p-5 ih:text-sm`},mt={key:0,class:`ih:text-[15px] ih:leading-relaxed ih:whitespace-pre-line`},ht={class:`ih:flex ih:items-start ih:gap-2 ih:text-muted-foreground`},gt={class:`ih:hidden ih:content-start ih:gap-4 ih:lg:sticky ih:lg:top-24 ih:lg:grid`},_t={class:`ih:rounded-xl ih:border ih:bg-card ih:p-5`},vt={key:0,class:`ih:line-clamp-6 ih:text-sm ih:leading-relaxed ih:whitespace-pre-line`},yt={class:`ih:mt-3 ih:flex ih:items-start ih:gap-2 ih:text-[13px] ih:text-muted-foreground`},bt={key:0,class:`ih:rounded-xl ih:border ih:bg-card ih:p-5`},xt={class:`ih:mb-3 ih:flex ih:items-baseline ih:justify-between`},St={class:`ih:text-sm ih:font-semibold`},Ct={class:`ih:flex ih:flex-wrap ih:gap-1.5`},wt=[`href`,`title`],Tt={key:0,class:`ih:mt-3 ih:text-[13px]`},Et={__name:`Show`,props:{group:{type:Object,required:!0},membership:{type:Object,default:null},can:{type:Object,required:!0},posts:{type:Array,required:!0},more:{type:Boolean,default:!1},members:{type:Object,default:null},privacy:{type:Object,required:!0},privacyHints:{type:Object,required:!0},roles:{type:Object,required:!0},reactions:{type:Array,required:!0},tab:{type:String,default:`beitraege`},reports:{type:Number,default:0}},setup(e){let r=e,u=ee();M(()=>u.props.flash?.status,e=>e&&U.success(e),{immediate:!0});let f=m(()=>u.props.auth.user),x=T(r.posts);M(()=>r.posts,e=>x.value=e);let A=T(r.more),j=T(!1),P=T(r.tab),F=T(!1),I=T(!1),V=T([]),W={open:o,closed:s,secret:l},K=m(()=>r.membership?.status);async function q(){j.value=!0;let e=x.value.filter(e=>!e.pinned).at(-1),t=await H.get(`/gruppen/${r.group.slug}?vor=${e?.id??0}`);x.value.push(...t.posts.filter(e=>!x.value.some(t=>t.id===e.id))),A.value=t.more,j.value=!1}let J=(e,t={},n=`post`)=>L.visit(`/gruppen/${r.group.slug}${e}`,{method:n,data:t,preserveScroll:!0}),Q=e=>window.confirm(`${e.name} aus der Gruppe entfernen?`)&&J(`/mitglieder/${e.id}`,{},`delete`),pe=()=>window.confirm(`„${r.group.name}“ verlassen?`)&&J(`/verlassen`),me=()=>window.confirm(`Gruppe „${r.group.name}“ mit allen Beiträgen löschen?`)&&J(``,{},`delete`);function he(){L.post(`/gruppen/${r.group.slug}/einladen`,{users:V.value.map(e=>e.id)},{preserveScroll:!0,onSuccess:()=>{I.value=!1,V.value=[]}})}let $=m(()=>r.can.post&&(r.group.privacy===`open`||r.can.moderate));return(r,o)=>(w(),h(k(te),{title:e.group.name},{default:N(()=>[b(k(ce),{title:e.group.name,breadcrumbs:[{label:`Gruppen`,href:`/gruppen`}]},{description:N(()=>[v(`span`,ze,[v(`span`,{class:`ih:inline-flex ih:items-center ih:gap-1`,title:e.group.privacy_hint},[(w(),h(D(W[e.group.privacy]),{class:`ih:size-4`})),y(` `+O(e.group.privacy_label)+`e Gruppe`,1)],8,Be),v(`span`,Ve,[b(k(c),{class:`ih:size-4`}),y(` `+O(e.group.members_count)+` `+O(e.group.members_count===1?`Mitglied`:`Mitglieder`),1)])])]),actions:N(()=>[K.value===`active`?(w(),_(p,{key:0},[$.value?(w(),h(k(R),{key:0,onClick:o[0]||=e=>I.value=!0},{default:N(()=>[b(k(X)),o[14]||=y(` Einladen`,-1)]),_:1})):g(``,!0),b(k(R),{variant:`outline`,size:`icon`,"aria-label":e.membership.notify===`all`?`Benachrichtigungen ausschalten`:`Benachrichtigungen einschalten`,title:e.membership.notify===`all`?`Sie werden über neue Beiträge benachrichtigt`:`Keine Benachrichtigungen`,onClick:o[1]||=t=>J(`/benachrichtigungen`,{notify:e.membership.notify===`all`?`off`:`all`},`put`)},{default:N(()=>[(w(),h(D(e.membership.notify===`all`?k(ue):k(le))))]),_:1},8,[`aria-label`,`title`]),e.can.admin?(w(),h(k(R),{key:1,variant:`outline`,onClick:o[2]||=e=>F.value=!0},{default:N(()=>[b(k(Y)),o[15]||=y(` Bearbeiten`,-1)]),_:1})):g(``,!0),b(k(R),{variant:`ghost`,class:`ih:text-muted-foreground`,onClick:pe},{default:N(()=>[b(k(de)),o[16]||=y(` Verlassen`,-1)]),_:1})],64)):K.value===`pending`?(w(),h(k(R),{key:1,variant:`outline`,disabled:``},{default:N(()=>[...o[17]||=[y(`Beitritt angefragt`,-1)]]),_:1})):K.value===`invited`?(w(),h(k(R),{key:2,onClick:o[3]||=e=>J(`/beitreten`)},{default:N(()=>[b(k(G)),o[18]||=y(` Einladung annehmen`,-1)]),_:1})):e.group.privacy===`secret`?g(``,!0):(w(),h(k(R),{key:3,onClick:o[4]||=e=>J(`/beitreten`)},{default:N(()=>[y(O(e.group.privacy===`open`?`Beitreten`:`Beitritt anfragen`),1)]),_:1})),e.can.admin&&K.value!==`active`?(w(),h(k(R),{key:4,variant:`outline`,onClick:o[5]||=e=>F.value=!0},{default:N(()=>[b(k(Y)),o[19]||=y(` Bearbeiten`,-1)]),_:1})):g(``,!0)]),_:1},8,[`title`]),v(`div`,He,[e.group.cover_url?(w(),_(`div`,{key:0,class:`ih:h-36 ih:bg-cover ih:bg-center ih:sm:h-52`,style:C({backgroundImage:`url(${e.group.cover_url})`})},null,4)):g(``,!0),v(`nav`,{class:S([`ih:flex ih:gap-1 ih:px-3`,e.group.cover_url?`ih:border-t`:``]),role:`tablist`},[(w(),_(p,null,E([{key:`beitraege`,label:`Beiträge`},{key:`mitglieder`,label:`Mitglieder`},{key:`info`,label:`Info`}],t=>v(`button`,{key:t.key,type:`button`,role:`tab`,"aria-selected":P.value===t.key,class:S([`ih:relative ih:px-3 ih:py-3 ih:text-sm ih:font-medium`,P.value===t.key?`ih:text-foreground`:`ih:text-muted-foreground ih:hover:text-foreground`]),onClick:e=>P.value=t.key},[y(O(t.label),1),t.key===`mitglieder`&&e.members?.pending.length?(w(),_(`span`,We,O(e.members.pending.length),1)):g(``,!0),P.value===t.key?(w(),_(`span`,Ge)):g(``,!0)],10,Ue)),64))],2)]),v(`div`,Ke,[v(`div`,qe,[e.can.moderate&&e.reports?(w(),_(`p`,Je,[b(k(n),{class:`ih:size-4 ih:text-destructive`}),y(` `+O(e.reports)+` offene `+O(e.reports===1?`Meldung`:`Meldungen`)+` – zu finden an den betroffenen Beiträgen.`,1)])):g(``,!0),P.value===`beitraege`?(w(),_(p,{key:1},[e.can.read?(w(),_(p,{key:0},[e.can.post?(w(),h(Re,{key:0,group:e.group,me:f.value,onCreated:o[6]||=e=>x.value.splice(x.value.filter(e=>e.pinned).length,0,e)},null,8,[`group`,`me`])):g(``,!0),(w(!0),_(p,null,E(x.value,t=>(w(),h(a,{key:t.id,post:t,reactions:e.reactions,onDeleted:e=>x.value=x.value.filter(e=>e.id!==t.id)},null,8,[`post`,`reactions`,`onDeleted`]))),128)),A.value?(w(),h(k(R),{key:1,variant:`outline`,disabled:j.value,onClick:q},{default:N(()=>[j.value?(w(),h(k(t),{key:0,class:`ih:animate-spin`})):g(``,!0),o[20]||=y(` Ältere Beiträge laden`,-1)]),_:1},8,[`disabled`])):g(``,!0),x.value.length?g(``,!0):(w(),_(`div`,Ye,[b(k(z),{icon:k(c),title:`Noch keine Beiträge`,text:e.can.post?`Schreiben Sie den ersten Beitrag!`:`Treten Sie bei, um mitzuschreiben.`},null,8,[`icon`,`text`])]))],64)):(w(),_(`div`,Xe,[b(k(z),{icon:k(s),title:`Nur für Mitglieder`,text:e.group.privacy_hint},null,8,[`icon`,`text`])]))],64)):P.value===`mitglieder`?(w(),_(`section`,Ze,[e.members?(w(),_(p,{key:0},[e.members.pending.length?(w(),_(p,{key:0},[o[22]||=v(`h2`,{class:`ih:mb-2 ih:text-sm ih:font-semibold`},`Beitrittsanfragen`,-1),v(`ul`,Qe,[(w(!0),_(p,null,E(e.members.pending,e=>(w(),_(`li`,{key:e.id,class:`ih:flex ih:items-center ih:gap-3 ih:rounded-md ih:p-2`},[b(k(B),{person:e,class:`ih:size-9`},null,8,[`person`]),v(`span`,$e,[v(`span`,et,O(e.name),1),v(`span`,tt,O(e.job_title),1)]),b(k(R),{size:`sm`,onClick:t=>J(`/anfragen/${e.id}`,{accept:!0})},{default:N(()=>[b(k(G)),o[21]||=y(` Aufnehmen`,-1)]),_:1},8,[`onClick`]),b(k(R),{size:`sm`,variant:`ghost`,"aria-label":`Anfrage von ${e.name} ablehnen`,onClick:t=>J(`/anfragen/${e.id}`,{accept:!1})},{default:N(()=>[b(k(Z))]),_:1},8,[`aria-label`,`onClick`])]))),128))])],64)):g(``,!0),v(`h2`,nt,O(e.members.active.length)+` `+O(e.members.active.length===1?`Mitglied`:`Mitglieder`),1),v(`ul`,rt,[(w(!0),_(p,null,E(e.members.active,t=>(w(),_(`li`,{key:t.id,class:`ih:flex ih:items-center ih:gap-3 ih:rounded-md ih:p-2 ih:hover:bg-muted/50`},[b(k(B),{person:t,class:`ih:size-9`},null,8,[`person`]),v(`a`,{href:`/personen/${t.id}`,class:`ih:min-w-0 ih:flex-1 ih:text-sm ih:hover:underline`},[v(`span`,at,O(t.name),1),v(`span`,ot,O(t.job_title),1)],8,it),e.can.admin&&t.id!==f.value.id?(w(),_(`select`,{key:0,value:t.role,class:`ih:h-8 ih:rounded-md ih:border ih:bg-card ih:px-2 ih:text-xs`,"aria-label":`Rolle von ${t.name}`,onChange:e=>J(`/mitglieder/${t.id}`,{role:e.target.value},`put`)},[(w(!0),_(p,null,E(e.roles,(e,t)=>(w(),_(`option`,{key:t,value:t},O(e),9,ct))),128))],40,st)):t.role===`member`?g(``,!0):(w(),_(`span`,lt,O(e.roles[t.role]),1)),e.can.moderate&&t.id!==f.value.id&&(e.can.admin||t.role===`member`)?(w(),_(`button`,{key:2,type:`button`,class:`ih:rounded ih:p-1.5 ih:text-muted-foreground ih:hover:text-destructive`,"aria-label":`${t.name} entfernen`,onClick:e=>Q(t)},[b(k(fe),{class:`ih:size-4`})],8,ut)):g(``,!0)]))),128))]),e.members.invited.length?(w(),_(p,{key:1},[o[23]||=v(`h2`,{class:`ih:mt-5 ih:mb-2 ih:text-sm ih:font-semibold`},`Eingeladen`,-1),v(`p`,dt,O(e.members.invited.map(e=>e.name).join(`, `)),1)],64)):g(``,!0)],64)):(w(),_(`p`,ft,`Die Mitgliederliste sehen nur Mitglieder.`))])):(w(),_(`section`,pt,[e.group.description?(w(),_(`p`,mt,O(e.group.description),1)):g(``,!0),v(`p`,ht,[(w(),h(D(W[e.group.privacy]),{class:`ih:mt-0.5 ih:size-4 ih:shrink-0`})),y(` `+O(e.group.privacy_hint),1)]),e.can.admin?(w(),h(k(R),{key:1,variant:`outline`,class:`ih:justify-self-start ih:text-destructive ih:hover:text-destructive`,onClick:me},{default:N(()=>[b(k(i)),o[24]||=y(` Gruppe löschen`,-1)]),_:1})):g(``,!0)]))]),v(`aside`,gt,[v(`section`,_t,[o[25]||=v(`h2`,{class:`ih:mb-2 ih:text-sm ih:font-semibold`},`Über die Gruppe`,-1),e.group.description?(w(),_(`p`,vt,O(e.group.description),1)):g(``,!0),v(`p`,yt,[(w(),h(D(W[e.group.privacy]),{class:`ih:mt-0.5 ih:size-4 ih:shrink-0`})),y(` `+O(e.group.privacy_hint),1)])]),e.members?(w(),_(`section`,bt,[v(`div`,xt,[v(`h2`,St,O(e.members.active.length)+` `+O(e.members.active.length===1?`Mitglied`:`Mitglieder`),1),v(`button`,{type:`button`,class:`ih:text-[13px] ih:font-medium ih:text-brand-text ih:hover:underline`,onClick:o[7]||=e=>P.value=`mitglieder`},`Alle ansehen`)]),v(`ul`,Ct,[(w(!0),_(p,null,E(e.members.active.slice(0,15),e=>(w(),_(`li`,{key:e.id},[v(`a`,{href:`/personen/${e.id}`,title:e.name},[b(k(B),{person:e,class:`ih:size-9 ih:text-[11px]`},null,8,[`person`])],8,wt)]))),128))]),e.members.pending.length?(w(),_(`p`,Tt,[v(`button`,{type:`button`,class:`ih:font-medium ih:text-brand-text ih:hover:underline`,onClick:o[8]||=e=>P.value=`mitglieder`},O(e.members.pending.length)+` `+O(e.members.pending.length===1?`Beitrittsanfrage`:`Beitrittsanfragen`),1)])):g(``,!0),$.value?(w(),h(k(R),{key:1,variant:`outline`,size:`sm`,class:`ih:mt-4 ih:w-full`,onClick:o[9]||=e=>I.value=!0},{default:N(()=>[b(k(X)),o[26]||=y(` Einladen`,-1)]),_:1})):g(``,!0)])):g(``,!0)])]),b(d,{open:F.value,"onUpdate:open":o[10]||=e=>F.value=e,group:e.group,privacy:e.privacy,"privacy-hints":e.privacyHints},null,8,[`open`,`group`,`privacy`,`privacy-hints`]),b(k(ne),{open:I.value,"onUpdate:open":o[13]||=e=>I.value=e},{default:N(()=>[b(k(re),{class:`ih:sm:max-w-md`},{default:N(()=>[b(k(oe),null,{default:N(()=>[b(k(se),null,{default:N(()=>[y(`In „`+O(e.group.name)+`“ einladen`,1)]),_:1}),b(k(ie),null,{default:N(()=>[...o[27]||=[y(`Die Eingeladenen bekommen eine Benachrichtigung und können annehmen.`,-1)]]),_:1})]),_:1}),b(Ce,{modelValue:V.value,"onUpdate:modelValue":o[11]||=e=>V.value=e,multiple:``,exclude:e.members?.active.map(e=>e.id)??[]},null,8,[`modelValue`,`exclude`]),b(k(ae),null,{default:N(()=>[b(k(R),{variant:`ghost`,onClick:o[12]||=e=>I.value=!1},{default:N(()=>[...o[28]||=[y(`Abbrechen`,-1)]]),_:1}),b(k(R),{disabled:!V.value.length,onClick:he},{default:N(()=>[...o[29]||=[y(`Einladen`,-1)]]),_:1},8,[`disabled`])]),_:1})]),_:1})]),_:1},8,[`open`])]),_:1},8,[`title`]))}};export{Et as default}; \ No newline at end of file +import{n as e,t}from"../chunks/loader-circle-CxzeMpQS.js";import{i as n,n as r,r as i,t as a}from"../chunks/PostCard-hYMtqskw.js";import{a as o,i as s,n as c,o as l,r as u,t as d}from"../chunks/GroupDialog-DkTJQL7Q.js";import{t as f}from"../chunks/search-7rL_HYGC.js";import{Fragment as p,computed as m,createBlock as h,createCommentVNode as g,createElementBlock as _,createElementVNode as v,createTextVNode as y,createVNode as b,mergeModels as x,normalizeClass as S,normalizeStyle as C,openBlock as w,ref as T,renderList as E,resolveDynamicComponent as D,toDisplayString as O,unref as k,useModel as A,vModelText as j,watch as M,withCtx as N,withDirectives as P,withKeys as F,withModifiers as I}from"vue";import{Link as ee,router as L,usePage as te}from"@inertiajs/vue3";import{AppLayout as ne,Button as R,Dialog as re,DialogContent as ie,DialogDescription as ae,DialogFooter as oe,DialogHeader as se,DialogTitle as ce,EmptyState as z,PersonAvatar as B,Switch as V,http as H,toast as U}from"@inhaus/ui";var le=e({name:`bell-off`,size:24,node:[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742`,key:`178tsu`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05`,key:`1hqiys`}]]}),ue=e({name:`bell`,size:24,node:[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}]]}),W=e({name:`chart-column`,size:24,node:[[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}],[`path`,{d:`M18 17V9`,key:`2bz60n`}],[`path`,{d:`M13 17V5`,key:`1frdt8`}],[`path`,{d:`M8 17v-3`,key:`17ska0`}]],aliases:[`bar-chart-3`]}),G=e({name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]}),K=e({name:`file`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}]]}),q=e({name:`image-plus`,size:24,node:[[`path`,{d:`M16 5h6`,key:`1vod17`}],[`path`,{d:`M19 2v6`,key:`4bpg5p`}],[`path`,{d:`M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5`,key:`1ue2ih`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}]]}),de=e({name:`log-out`,size:24,node:[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]}),J=e({name:`paperclip`,size:24,node:[[`path`,{d:`m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551`,key:`1miecu`}]]}),Y=e({name:`pencil-line`,size:24,node:[[`path`,{d:`M13 21h8`,key:`1jsn5i`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}],[`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`}]]}),fe=e({name:`user-minus`,size:24,node:[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}],[`line`,{x1:`22`,x2:`16`,y1:`11`,y2:`11`,key:`1shjgl`}]]}),pe=e({name:`user-plus`,size:24,node:[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}],[`line`,{x1:`19`,x2:`19`,y1:`8`,y2:`14`,key:`1bvyxn`}],[`line`,{x1:`22`,x2:`16`,y1:`11`,y2:`11`,key:`1shjgl`}]]}),X=e({name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]}),Z={class:`ih:grid ih:gap-2`},Q={key:0,class:`ih:flex ih:flex-wrap ih:gap-1.5`},$=[`aria-label`,`onClick`],me={class:`ih:relative`},he=[`autofocus`,`placeholder`],ge={key:1,class:`ih:max-h-64 ih:overflow-y-auto ih:rounded-md ih:border ih:bg-popover ih:p-1`,role:`listbox`},_e=[`aria-selected`],ve=[`onClick`,`onMouseenter`],ye={class:`ih:min-w-0 ih:flex-1`},be={class:`ih:block ih:truncate ih:font-medium`},xe={key:0,class:`ih:block ih:truncate ih:text-xs ih:text-muted-foreground`},Se={key:2,class:`ih:px-1 ih:text-[13px] ih:text-muted-foreground`},Ce={__name:`PeopleSelect`,props:x({multiple:{type:Boolean,default:!1},exclude:{type:Array,default:()=>[]},placeholder:{type:String,default:`Name oder E-Mail eingeben …`},autofocus:{type:Boolean,default:!1}},{modelValue:{type:Array,default:()=>[]},modelModifiers:{}}),emits:x([`pick`],[`update:modelValue`]),setup(e,{emit:t}){let n=e,r=t,i=A(e,`modelValue`),a=T(``),o=T([]),s=T(0),c=T(!1),l;M(a,e=>{if(clearTimeout(l),e.trim().length<2){o.value=[];return}l=setTimeout(async()=>{c.value=!0;try{let t=[...n.exclude,...i.value.map(e=>e.id)];o.value=(await H.get(`/personen/suche?q=${encodeURIComponent(e.trim())}`)).people.filter(e=>!t.includes(e.id)),s.value=0}finally{c.value=!1}},200)});function u(e){e&&(r(`pick`,e),n.multiple&&(i.value=[...i.value,e]),a.value=``,o.value=[])}let d=e=>i.value=i.value.filter(t=>t.id!==e.id);return(t,n)=>(w(),_(`div`,Z,[e.multiple&&i.value.length?(w(),_(`div`,Q,[(w(!0),_(p,null,E(i.value,e=>(w(),_(`span`,{key:e.id,class:`ih:inline-flex ih:items-center ih:gap-1.5 ih:rounded-full ih:border ih:bg-card ih:py-0.5 ih:pr-1 ih:pl-0.5 ih:text-[13px]`},[b(k(B),{person:e,class:`ih:size-6 ih:text-[10px]`},null,8,[`person`]),y(` `+O(e.name)+` `,1),v(`button`,{type:`button`,class:`ih:rounded-full ih:p-0.5 ih:text-muted-foreground ih:hover:bg-muted ih:hover:text-foreground`,"aria-label":`${e.name} entfernen`,onClick:t=>d(e)},[b(k(X),{class:`ih:size-3.5`})],8,$)]))),128))])):g(``,!0),v(`div`,me,[b(k(f),{class:`ih:pointer-events-none ih:absolute ih:top-1/2 ih:left-2.5 ih:size-4 ih:-translate-y-1/2 ih:text-muted-foreground`}),P(v(`input`,{"onUpdate:modelValue":n[0]||=e=>a.value=e,type:`search`,autocomplete:`off`,autofocus:e.autofocus,placeholder:e.placeholder,"aria-label":`Person suchen`,class:`ih:h-10 ih:w-full ih:rounded-md ih:border ih:border-input ih:bg-card ih:pr-3 ih:pl-8 ih:text-sm ih:shadow-xs ih:focus-visible:ring-3 ih:focus-visible:ring-ring/30 ih:focus-visible:outline-none`,onKeydown:[n[1]||=F(I(e=>s.value=Math.min(o.value.length-1,s.value+1),[`prevent`]),[`down`]),n[2]||=F(I(e=>s.value=Math.max(0,s.value-1),[`prevent`]),[`up`]),n[3]||=F(I(e=>u(o.value[s.value]),[`prevent`]),[`enter`])]},null,40,he),[[j,a.value]])]),o.value.length?(w(),_(`ul`,ge,[(w(!0),_(p,null,E(o.value,(e,t)=>(w(),_(`li`,{key:e.id,role:`option`,"aria-selected":t===s.value},[v(`button`,{type:`button`,class:S([`ih:flex ih:w-full ih:items-center ih:gap-2.5 ih:rounded ih:px-2 ih:py-1.5 ih:text-left ih:text-sm`,t===s.value?`ih:bg-accent`:`ih:hover:bg-accent/60`]),onClick:t=>u(e),onMouseenter:e=>s.value=t},[b(k(B),{person:e,class:`ih:size-7 ih:text-[11px]`},null,8,[`person`]),v(`span`,ye,[v(`span`,be,O(e.name),1),e.job_title||e.department?(w(),_(`span`,xe,O([e.job_title,e.department].filter(Boolean).join(` · `)),1)):g(``,!0)])],42,ve)],8,_e))),128))])):a.value.trim().length>=2&&!c.value?(w(),_(`p`,Se,`Niemand gefunden.`)):g(``,!0)]))}},we={class:`ih:flex ih:gap-3`},Te=[`rows`,`placeholder`],Ee={key:0,class:`ih:mt-3 ih:flex ih:flex-wrap ih:gap-2 ih:pl-13`},De=[`src`,`alt`],Oe={key:1,class:`ih:flex ih:h-20 ih:w-40 ih:items-center ih:gap-2 ih:rounded-md ih:border ih:bg-muted ih:px-2 ih:text-xs`},ke={class:`ih:min-w-0`},Ae={class:`ih:block ih:truncate ih:font-medium`},je=[`aria-label`,`onClick`],Me={key:1,class:`ih:mt-3 ih:grid ih:gap-2 ih:rounded-lg ih:border ih:p-3 ih:sm:ml-13`},Ne={class:`ih:flex ih:items-center ih:justify-between`},Pe=[`onUpdate:modelValue`,`placeholder`,`aria-label`],Fe={class:`ih:flex ih:flex-wrap ih:items-center ih:justify-between ih:gap-2`},Ie={class:`ih:flex ih:items-center ih:gap-2 ih:text-sm`},Le={key:2,class:`ih:mt-3 ih:flex ih:flex-wrap ih:items-center ih:gap-1 ih:border-t ih:pt-3`},Re={__name:`PostComposer`,props:{group:{type:Object,required:!0},me:{type:Object,required:!0}},emits:[`created`],setup(e,{emit:n}){let i=e,a=n,o=T(``),s=T([]),c=T(null),l=T(!1),d=T(!1),f=T(null),x=T(null),S=T(!1),C=m(()=>!d.value&&(o.value.trim()||s.value.length||c.value&&c.value.filter(e=>e.trim()).length>=2));function D(e){for(let t of e){if(s.value.length>=10){U.error(`Höchstens 10 Dateien je Beitrag.`);break}s.value.push({file:t,url:t.type.startsWith(`image/`)?URL.createObjectURL(t):null})}S.value=!0}function A(e){let[t]=s.value.splice(e,1);t?.url&&URL.revokeObjectURL(t.url)}async function M(){d.value=!0;let e=new FormData;o.value.trim()&&e.append(`body`,o.value),s.value.forEach(t=>e.append(`files[]`,t.file)),c.value&&(c.value.filter(e=>e.trim()).forEach(t=>e.append(`poll[]`,t)),e.append(`multiple`,l.value?`1`:`0`));try{let{post:t}=await H.post(`/gruppen/${i.group.slug}/beitraege`,e);a(`created`,t),s.value.forEach(e=>e.url&&URL.revokeObjectURL(e.url)),o.value=``,s.value=[],c.value=null,S.value=!1}catch(e){U.error(e.message)}finally{d.value=!1}}return(n,i)=>(w(),_(`section`,{class:`ih:rounded-xl ih:border ih:bg-card ih:p-4 ih:shadow-xs`,"aria-label":`Neuer Beitrag`,onDragover:i[11]||=I(()=>{},[`prevent`]),onDrop:i[12]||=I(e=>D([...e.dataTransfer.files]),[`prevent`])},[v(`div`,we,[b(k(B),{person:e.me,class:`ih:size-10`},null,8,[`person`]),P(v(`textarea`,{"onUpdate:modelValue":i[0]||=e=>o.value=e,rows:S.value||o.value?4:1,maxlength:`10000`,placeholder:`Was möchten Sie mit „${e.group.name}“ teilen?`,"aria-label":`Beitrag schreiben`,class:`ih:min-h-10 ih:flex-1 ih:resize-none ih:rounded-2xl ih:bg-muted ih:px-4 ih:py-2 ih:text-[15px] ih:focus-visible:bg-background ih:focus-visible:ring-3 ih:focus-visible:ring-ring/30 ih:focus-visible:outline-none`,onFocus:i[1]||=e=>S.value=!0,onPaste:i[2]||=e=>e.clipboardData?.files?.length&&(e.preventDefault(),D([...e.clipboardData.files]))},null,40,Te),[[j,o.value]])]),s.value.length?(w(),_(`ul`,Ee,[(w(!0),_(p,null,E(s.value,(e,t)=>(w(),_(`li`,{key:t,class:`ih:relative`},[e.url?(w(),_(`img`,{key:0,src:e.url,alt:e.file.name,class:`ih:size-20 ih:rounded-md ih:border ih:object-cover`},null,8,De)):(w(),_(`span`,Oe,[b(k(K),{class:`ih:size-5 ih:shrink-0`}),v(`span`,ke,[v(`span`,Ae,O(e.file.name),1),y(O(k(r)(e.file.size)),1)])])),v(`button`,{type:`button`,class:`ih:absolute ih:-top-1.5 ih:-right-1.5 ih:grid ih:size-5 ih:place-items-center ih:rounded-full ih:bg-foreground ih:text-background`,"aria-label":`${e.file.name} entfernen`,onClick:e=>A(t)},[b(k(X),{class:`ih:size-3`})],8,je)]))),128))])):g(``,!0),c.value?(w(),_(`div`,Me,[v(`div`,Ne,[i[13]||=v(`span`,{class:`ih:text-sm ih:font-medium`},`Umfrage`,-1),v(`button`,{type:`button`,class:`ih:text-xs ih:text-muted-foreground ih:hover:text-foreground`,onClick:i[3]||=e=>c.value=null},`Entfernen`)]),(w(!0),_(p,null,E(c.value,(e,t)=>P((w(),_(`input`,{key:t,"onUpdate:modelValue":e=>c.value[t]=e,maxlength:`120`,placeholder:`Antwort ${t+1}`,"aria-label":`Antwort ${t+1}`,class:`ih:h-9 ih:rounded-md ih:border ih:border-input ih:bg-background ih:px-3 ih:text-sm`},null,8,Pe)),[[j,c.value[t]]])),128)),v(`div`,Fe,[c.value.length<10?(w(),_(`button`,{key:0,type:`button`,class:`ih:inline-flex ih:items-center ih:gap-1 ih:text-sm ih:text-brand-text ih:hover:underline`,onClick:i[4]||=e=>c.value.push(``)},[b(k(u),{class:`ih:size-4`}),i[14]||=y(` Antwort`,-1)])):g(``,!0),v(`label`,Ie,[b(k(V),{modelValue:l.value,"onUpdate:modelValue":i[5]||=e=>l.value=e},null,8,[`modelValue`]),i[15]||=y(` Mehrere Antworten erlauben`,-1)])])])):g(``,!0),S.value||o.value||s.value.length||c.value?(w(),_(`div`,Le,[v(`button`,{type:`button`,class:`ih:inline-flex ih:items-center ih:gap-1.5 ih:rounded-md ih:px-2.5 ih:py-1.5 ih:text-sm ih:text-muted-foreground ih:hover:bg-accent`,onClick:i[6]||=e=>f.value?.click()},[b(k(q),{class:`ih:size-4`}),i[16]||=y(` Foto`,-1)]),v(`button`,{type:`button`,class:`ih:inline-flex ih:items-center ih:gap-1.5 ih:rounded-md ih:px-2.5 ih:py-1.5 ih:text-sm ih:text-muted-foreground ih:hover:bg-accent`,onClick:i[7]||=e=>x.value?.click()},[b(k(J),{class:`ih:size-4`}),i[17]||=y(` Datei`,-1)]),c.value?g(``,!0):(w(),_(`button`,{key:0,type:`button`,class:`ih:inline-flex ih:items-center ih:gap-1.5 ih:rounded-md ih:px-2.5 ih:py-1.5 ih:text-sm ih:text-muted-foreground ih:hover:bg-accent`,onClick:i[8]||=e=>c.value=[``,``]},[b(k(W),{class:`ih:size-4`}),i[18]||=y(` Umfrage`,-1)])),i[20]||=v(`span`,{class:`ih:flex-1`},null,-1),b(k(R),{disabled:!C.value,onClick:M},{default:N(()=>[d.value?(w(),h(k(t),{key:0,class:`ih:animate-spin`})):g(``,!0),i[19]||=y(` Veröffentlichen`,-1)]),_:1},8,[`disabled`]),v(`input`,{ref_key:`photoInput`,ref:f,type:`file`,accept:`image/*`,multiple:``,class:`ih:hidden`,onChange:i[9]||=e=>{D([...e.target.files]),e.target.value=``}},null,544),v(`input`,{ref_key:`fileInput`,ref:x,type:`file`,multiple:``,class:`ih:hidden`,onChange:i[10]||=e=>{D([...e.target.files]),e.target.value=``}},null,544)])):g(``,!0)],32))}},ze={class:`ih:overflow-hidden ih:rounded-xl ih:border ih:bg-card ih:shadow-xs`},Be={class:`ih:flex ih:flex-wrap ih:items-end ih:gap-4 ih:p-5`},Ve={class:`ih:min-w-0 ih:flex-1`},He={class:`ih:mb-1 ih:text-[13px]`},Ue={class:`ih:text-2xl ih:font-semibold ih:tracking-tight`},We={class:`ih:mt-1 ih:flex ih:flex-wrap ih:items-center ih:gap-x-3 ih:gap-y-1 ih:text-sm ih:text-muted-foreground`},Ge=[`title`],Ke={class:`ih:inline-flex ih:items-center ih:gap-1`},qe={class:`ih:flex ih:flex-wrap ih:gap-2`},Je={class:`ih:flex ih:gap-1 ih:border-t ih:px-3`,role:`tablist`},Ye=[`aria-selected`,`onClick`],Xe={key:0,class:`ih:ml-1 ih:rounded-full ih:bg-brand ih:px-1.5 ih:text-[11px] ih:text-brand-foreground`},Ze={key:1,class:`ih:absolute ih:inset-x-2 ih:bottom-0 ih:h-[3px] ih:rounded-t-full ih:bg-brand`},Qe={class:`ih:mx-auto ih:mt-6 ih:grid ih:max-w-2xl ih:gap-4`},$e={key:0,class:`ih:flex ih:items-center ih:gap-2 ih:rounded-md ih:border ih:border-destructive/30 ih:bg-destructive/5 ih:p-3 ih:text-sm`},et={key:2,class:`ih:rounded-xl ih:border ih:bg-card`},tt={key:1,class:`ih:rounded-xl ih:border ih:bg-card`},nt={key:2,class:`ih:rounded-xl ih:border ih:bg-card ih:p-5`},rt={class:`ih:-mx-2 ih:mb-5 ih:grid`},it={class:`ih:min-w-0 ih:flex-1 ih:text-sm`},at={class:`ih:font-medium`},ot={class:`ih:block ih:text-xs ih:text-muted-foreground`},st={class:`ih:mb-2 ih:text-sm ih:font-semibold`},ct={class:`ih:-mx-2 ih:grid`},lt=[`href`],ut={class:`ih:font-medium`},dt={class:`ih:block ih:text-xs ih:text-muted-foreground`},ft=[`value`,`aria-label`,`onChange`],pt=[`value`],mt={key:1,class:`ih:rounded ih:bg-brand-soft ih:px-1.5 ih:py-0.5 ih:text-[11px] ih:font-medium ih:text-brand-text`},ht=[`aria-label`,`onClick`],gt={class:`ih:text-sm ih:text-muted-foreground`},_t={key:1,class:`ih:text-sm ih:text-muted-foreground`},vt={key:3,class:`ih:grid ih:gap-4 ih:rounded-xl ih:border ih:bg-card ih:p-5 ih:text-sm`},yt={key:0,class:`ih:text-[15px] ih:leading-relaxed ih:whitespace-pre-line`},bt={class:`ih:flex ih:items-start ih:gap-2 ih:text-muted-foreground`},xt={__name:`Show`,props:{group:{type:Object,required:!0},membership:{type:Object,default:null},can:{type:Object,required:!0},posts:{type:Array,required:!0},more:{type:Boolean,default:!1},members:{type:Object,default:null},privacy:{type:Object,required:!0},privacyHints:{type:Object,required:!0},roles:{type:Object,required:!0},reactions:{type:Array,required:!0},tab:{type:String,default:`beitraege`},reports:{type:Number,default:0}},setup(e){let r=e,u=te();M(()=>u.props.flash?.status,e=>e&&U.success(e),{immediate:!0});let f=m(()=>u.props.auth.user),x=T(r.posts);M(()=>r.posts,e=>x.value=e);let A=T(r.more),j=T(!1),P=T(r.tab),F=T(!1),I=T(!1),V=T([]),W={open:o,closed:s,secret:l},K=m(()=>r.membership?.status);async function q(){j.value=!0;let e=x.value.filter(e=>!e.pinned).at(-1),t=await H.get(`/gruppen/${r.group.slug}?vor=${e?.id??0}`);x.value.push(...t.posts.filter(e=>!x.value.some(t=>t.id===e.id))),A.value=t.more,j.value=!1}let J=(e,t={},n=`post`)=>L.visit(`/gruppen/${r.group.slug}${e}`,{method:n,data:t,preserveScroll:!0}),Z=e=>window.confirm(`${e.name} aus der Gruppe entfernen?`)&&J(`/mitglieder/${e.id}`,{},`delete`),Q=()=>window.confirm(`„${r.group.name}“ verlassen?`)&&J(`/verlassen`),$=()=>window.confirm(`Gruppe „${r.group.name}“ mit allen Beiträgen löschen?`)&&J(``,{},`delete`);function me(){L.post(`/gruppen/${r.group.slug}/einladen`,{users:V.value.map(e=>e.id)},{preserveScroll:!0,onSuccess:()=>{I.value=!1,V.value=[]}})}let he=m(()=>r.can.post&&(r.group.privacy===`open`||r.can.moderate));return(r,o)=>(w(),h(k(ne),{title:e.group.name},{default:N(()=>[v(`header`,ze,[v(`div`,{class:`ih:h-36 ih:bg-brand ih:bg-cover ih:bg-center ih:sm:h-52`,style:C(e.group.cover_url?{backgroundImage:`url(${e.group.cover_url})`}:{})},null,4),v(`div`,Be,[v(`div`,Ve,[v(`p`,He,[b(k(ee),{href:`/gruppen`,class:`ih:text-muted-foreground ih:hover:underline`},{default:N(()=>[...o[11]||=[y(`Gruppen`,-1)]]),_:1})]),v(`h1`,Ue,O(e.group.name),1),v(`p`,We,[v(`span`,{class:`ih:inline-flex ih:items-center ih:gap-1`,title:e.group.privacy_hint},[(w(),h(D(W[e.group.privacy]),{class:`ih:size-4`})),y(` `+O(e.group.privacy_label)+`e Gruppe`,1)],8,Ge),v(`span`,Ke,[b(k(c),{class:`ih:size-4`}),y(` `+O(e.group.members_count)+` `+O(e.group.members_count===1?`Mitglied`:`Mitglieder`),1)])])]),v(`div`,qe,[K.value===`active`?(w(),_(p,{key:0},[he.value?(w(),h(k(R),{key:0,onClick:o[0]||=e=>I.value=!0},{default:N(()=>[b(k(pe)),o[12]||=y(` Einladen`,-1)]),_:1})):g(``,!0),b(k(R),{variant:`outline`,size:`icon`,"aria-label":e.membership.notify===`all`?`Benachrichtigungen ausschalten`:`Benachrichtigungen einschalten`,title:e.membership.notify===`all`?`Sie werden über neue Beiträge benachrichtigt`:`Keine Benachrichtigungen`,onClick:o[1]||=t=>J(`/benachrichtigungen`,{notify:e.membership.notify===`all`?`off`:`all`},`put`)},{default:N(()=>[(w(),h(D(e.membership.notify===`all`?k(ue):k(le))))]),_:1},8,[`aria-label`,`title`]),e.can.admin?(w(),h(k(R),{key:1,variant:`outline`,onClick:o[2]||=e=>F.value=!0},{default:N(()=>[b(k(Y)),o[13]||=y(` Bearbeiten`,-1)]),_:1})):g(``,!0),b(k(R),{variant:`ghost`,class:`ih:text-muted-foreground`,onClick:Q},{default:N(()=>[b(k(de)),o[14]||=y(` Verlassen`,-1)]),_:1})],64)):K.value===`pending`?(w(),h(k(R),{key:1,variant:`outline`,disabled:``},{default:N(()=>[...o[15]||=[y(`Beitritt angefragt`,-1)]]),_:1})):K.value===`invited`?(w(),h(k(R),{key:2,onClick:o[3]||=e=>J(`/beitreten`)},{default:N(()=>[b(k(G)),o[16]||=y(` Einladung annehmen`,-1)]),_:1})):e.group.privacy===`secret`?g(``,!0):(w(),h(k(R),{key:3,onClick:o[4]||=e=>J(`/beitreten`)},{default:N(()=>[y(O(e.group.privacy===`open`?`Beitreten`:`Beitritt anfragen`),1)]),_:1})),e.can.admin&&K.value!==`active`?(w(),h(k(R),{key:4,variant:`outline`,onClick:o[5]||=e=>F.value=!0},{default:N(()=>[b(k(Y)),o[17]||=y(` Bearbeiten`,-1)]),_:1})):g(``,!0)])]),v(`nav`,Je,[(w(),_(p,null,E([{key:`beitraege`,label:`Beiträge`},{key:`mitglieder`,label:`Mitglieder`},{key:`info`,label:`Info`}],t=>v(`button`,{key:t.key,type:`button`,role:`tab`,"aria-selected":P.value===t.key,class:S([`ih:relative ih:px-3 ih:py-3 ih:text-sm ih:font-medium`,P.value===t.key?`ih:text-foreground`:`ih:text-muted-foreground ih:hover:text-foreground`]),onClick:e=>P.value=t.key},[y(O(t.label),1),t.key===`mitglieder`&&e.members?.pending.length?(w(),_(`span`,Xe,O(e.members.pending.length),1)):g(``,!0),P.value===t.key?(w(),_(`span`,Ze)):g(``,!0)],10,Ye)),64))])]),v(`div`,Qe,[e.can.moderate&&e.reports?(w(),_(`p`,$e,[b(k(n),{class:`ih:size-4 ih:text-destructive`}),y(` `+O(e.reports)+` offene `+O(e.reports===1?`Meldung`:`Meldungen`)+` – zu finden an den betroffenen Beiträgen.`,1)])):g(``,!0),P.value===`beitraege`?(w(),_(p,{key:1},[e.can.read?(w(),_(p,{key:0},[e.can.post?(w(),h(Re,{key:0,group:e.group,me:f.value,onCreated:o[6]||=e=>x.value.splice(x.value.filter(e=>e.pinned).length,0,e)},null,8,[`group`,`me`])):g(``,!0),(w(!0),_(p,null,E(x.value,t=>(w(),h(a,{key:t.id,post:t,reactions:e.reactions,onDeleted:e=>x.value=x.value.filter(e=>e.id!==t.id)},null,8,[`post`,`reactions`,`onDeleted`]))),128)),A.value?(w(),h(k(R),{key:1,variant:`outline`,disabled:j.value,onClick:q},{default:N(()=>[j.value?(w(),h(k(t),{key:0,class:`ih:animate-spin`})):g(``,!0),o[18]||=y(` Ältere Beiträge laden`,-1)]),_:1},8,[`disabled`])):g(``,!0),x.value.length?g(``,!0):(w(),_(`div`,et,[b(k(z),{icon:k(c),title:`Noch keine Beiträge`,text:e.can.post?`Schreiben Sie den ersten Beitrag!`:`Treten Sie bei, um mitzuschreiben.`},null,8,[`icon`,`text`])]))],64)):(w(),_(`div`,tt,[b(k(z),{icon:k(s),title:`Nur für Mitglieder`,text:e.group.privacy_hint},null,8,[`icon`,`text`])]))],64)):P.value===`mitglieder`?(w(),_(`section`,nt,[e.members?(w(),_(p,{key:0},[e.members.pending.length?(w(),_(p,{key:0},[o[20]||=v(`h2`,{class:`ih:mb-2 ih:text-sm ih:font-semibold`},`Beitrittsanfragen`,-1),v(`ul`,rt,[(w(!0),_(p,null,E(e.members.pending,e=>(w(),_(`li`,{key:e.id,class:`ih:flex ih:items-center ih:gap-3 ih:rounded-md ih:p-2`},[b(k(B),{person:e,class:`ih:size-9`},null,8,[`person`]),v(`span`,it,[v(`span`,at,O(e.name),1),v(`span`,ot,O(e.job_title),1)]),b(k(R),{size:`sm`,onClick:t=>J(`/anfragen/${e.id}`,{accept:!0})},{default:N(()=>[b(k(G)),o[19]||=y(` Aufnehmen`,-1)]),_:1},8,[`onClick`]),b(k(R),{size:`sm`,variant:`ghost`,"aria-label":`Anfrage von ${e.name} ablehnen`,onClick:t=>J(`/anfragen/${e.id}`,{accept:!1})},{default:N(()=>[b(k(X))]),_:1},8,[`aria-label`,`onClick`])]))),128))])],64)):g(``,!0),v(`h2`,st,O(e.members.active.length)+` `+O(e.members.active.length===1?`Mitglied`:`Mitglieder`),1),v(`ul`,ct,[(w(!0),_(p,null,E(e.members.active,t=>(w(),_(`li`,{key:t.id,class:`ih:flex ih:items-center ih:gap-3 ih:rounded-md ih:p-2 ih:hover:bg-muted/50`},[b(k(B),{person:t,class:`ih:size-9`},null,8,[`person`]),v(`a`,{href:`/personen/${t.id}`,class:`ih:min-w-0 ih:flex-1 ih:text-sm ih:hover:underline`},[v(`span`,ut,O(t.name),1),v(`span`,dt,O(t.job_title),1)],8,lt),e.can.admin&&t.id!==f.value.id?(w(),_(`select`,{key:0,value:t.role,class:`ih:h-8 ih:rounded-md ih:border ih:bg-card ih:px-2 ih:text-xs`,"aria-label":`Rolle von ${t.name}`,onChange:e=>J(`/mitglieder/${t.id}`,{role:e.target.value},`put`)},[(w(!0),_(p,null,E(e.roles,(e,t)=>(w(),_(`option`,{key:t,value:t},O(e),9,pt))),128))],40,ft)):t.role===`member`?g(``,!0):(w(),_(`span`,mt,O(e.roles[t.role]),1)),e.can.moderate&&t.id!==f.value.id&&(e.can.admin||t.role===`member`)?(w(),_(`button`,{key:2,type:`button`,class:`ih:rounded ih:p-1.5 ih:text-muted-foreground ih:hover:text-destructive`,"aria-label":`${t.name} entfernen`,onClick:e=>Z(t)},[b(k(fe),{class:`ih:size-4`})],8,ht)):g(``,!0)]))),128))]),e.members.invited.length?(w(),_(p,{key:1},[o[21]||=v(`h2`,{class:`ih:mt-5 ih:mb-2 ih:text-sm ih:font-semibold`},`Eingeladen`,-1),v(`p`,gt,O(e.members.invited.map(e=>e.name).join(`, `)),1)],64)):g(``,!0)],64)):(w(),_(`p`,_t,`Die Mitgliederliste sehen nur Mitglieder.`))])):(w(),_(`section`,vt,[e.group.description?(w(),_(`p`,yt,O(e.group.description),1)):g(``,!0),v(`p`,bt,[(w(),h(D(W[e.group.privacy]),{class:`ih:mt-0.5 ih:size-4 ih:shrink-0`})),y(` `+O(e.group.privacy_hint),1)]),e.can.admin?(w(),h(k(R),{key:1,variant:`outline`,class:`ih:justify-self-start ih:text-destructive ih:hover:text-destructive`,onClick:$},{default:N(()=>[b(k(i)),o[22]||=y(` Gruppe löschen`,-1)]),_:1})):g(``,!0)]))]),b(d,{open:F.value,"onUpdate:open":o[7]||=e=>F.value=e,group:e.group,privacy:e.privacy,"privacy-hints":e.privacyHints},null,8,[`open`,`group`,`privacy`,`privacy-hints`]),b(k(re),{open:I.value,"onUpdate:open":o[10]||=e=>I.value=e},{default:N(()=>[b(k(ie),{class:`ih:sm:max-w-md`},{default:N(()=>[b(k(se),null,{default:N(()=>[b(k(ce),null,{default:N(()=>[y(`In „`+O(e.group.name)+`“ einladen`,1)]),_:1}),b(k(ae),null,{default:N(()=>[...o[23]||=[y(`Die Eingeladenen bekommen eine Benachrichtigung und können annehmen.`,-1)]]),_:1})]),_:1}),b(Ce,{modelValue:V.value,"onUpdate:modelValue":o[8]||=e=>V.value=e,multiple:``,exclude:e.members?.active.map(e=>e.id)??[]},null,8,[`modelValue`,`exclude`]),b(k(oe),null,{default:N(()=>[b(k(R),{variant:`ghost`,onClick:o[9]||=e=>I.value=!1},{default:N(()=>[...o[24]||=[y(`Abbrechen`,-1)]]),_:1}),b(k(R),{disabled:!V.value.length,onClick:me},{default:N(()=>[...o[25]||=[y(`Einladen`,-1)]]),_:1},8,[`disabled`])]),_:1})]),_:1})]),_:1},8,[`open`])]),_:1},8,[`title`]))}};export{xt as default}; \ No newline at end of file diff --git a/plugin.json b/plugin.json index c1fbb53..9c69226 100644 --- a/plugin.json +++ b/plugin.json @@ -1,7 +1,7 @@ { "slug": "gruppen", "name": "Gruppen", - "version": "1.3.2", + "version": "1.0.0", "description": "Diskussionsgruppen wie bei Facebook: offen, geschlossen (Beitritt auf Anfrage) oder privat (nur auf Einladung). Beiträge mit Fotos, Dateien und Umfragen, Reaktionen, Kommentare mit Antworten, Anpinnen, Melden und Moderation.", "author": "Loheide", "namespace": "Inhaus\\Plugins\\Gruppen\\", diff --git a/resources/js/components/PostCard.vue b/resources/js/components/PostCard.vue index d2192d0..eb20f0c 100644 --- a/resources/js/components/PostCard.vue +++ b/resources/js/components/PostCard.vue @@ -1,6 +1,6 @@