diff --git a/app/Jobs/CalendarsClearElapsed.php b/app/Jobs/CalendarsClearElapsed.php
new file mode 100644
index 0000000000..458611e8a0
--- /dev/null
+++ b/app/Jobs/CalendarsClearElapsed.php
@@ -0,0 +1,41 @@
+id = $calendar->id;
+ }
+
+ /**
+ * Execute the job.
+ */
+ public function handle(): void
+ {
+ $calendar = Calendar::find($this->id);
+ if (!$calendar) {
+ return;
+ }
+
+ $model = new EntityEvent();
+ DB::update('UPDATE ' . $model->getTable() . ' SET elapsed = NULL WHERE calendar_id = \'' . $calendar->id . '\'');
+ }
+}
diff --git a/app/Models/EntityEvent.php b/app/Models/EntityEvent.php
index 51f0c0f7bf..15aeb9995a 100644
--- a/app/Models/EntityEvent.php
+++ b/app/Models/EntityEvent.php
@@ -27,7 +27,7 @@
* @property int|null $recurring_until
* @property string $recurring_periodicity
* @property int $type_id
- * @property int $elapsed
+ * @property int|null $elapsed
*
* @property Calendar|null $calendar
* @property EntityEvent|null $death
@@ -244,6 +244,11 @@ public function isPastDate(int $year, int $month, int $day): bool
*/
public function calcElapsed(EntityEvent $event = null): int
{
+ // Have the value cached? Don't bother with more work
+ if (empty($event) && !empty($this->elapsed)) {
+ return $this->elapsed;
+ }
+
if (!empty($event)) {
$year = $event->year;
$month = $event->month;
@@ -262,14 +267,25 @@ public function calcElapsed(EntityEvent $event = null): int
$years = $year - $baseYear;
if ($month < $this->month) {
- return $years - 1;
+ return $this->saveElapsed($years - 1, empty($event));
}
if ($month > $this->month) {
- return $years;
+ return $this->saveElapsed($years, empty($event));
}
// Same month
- return $years - ($day < $this->day ? 1 : 0);
+ return $this->saveElapsed($years - ($day < $this->day ? 1 : 0), empty($event));
+ }
+
+ protected function saveElapsed(int $number, bool $save): int
+ {
+ // If comparing two days, don't save the "elapsed" part, we need to re-calc those one each page load
+ if (!$save) {
+ return $number;
+ }
+ $this->elapsed = $number;
+ $this->saveQuietly();
+ return $this->elapsed;
}
/**
diff --git a/app/Observers/CalendarObserver.php b/app/Observers/CalendarObserver.php
index 2efe4150b8..410b16b6de 100644
--- a/app/Observers/CalendarObserver.php
+++ b/app/Observers/CalendarObserver.php
@@ -2,6 +2,15 @@
namespace App\Observers;
+use App\Jobs\CalendarsClearElapsed;
+use App\Models\MiscModel;
+
class CalendarObserver extends MiscObserver
{
+ public function updated(MiscModel $model)
+ {
+ if ($model->isDirty(['date'])) {
+ CalendarsClearElapsed::dispatch($model);
+ }
+ }
}
diff --git a/app/Observers/EntityEventObserver.php b/app/Observers/EntityEventObserver.php
index 4d45fa3cdd..6f0cf3595d 100644
--- a/app/Observers/EntityEventObserver.php
+++ b/app/Observers/EntityEventObserver.php
@@ -15,4 +15,12 @@ public function saving(EntityEvent $entityEvent)
$entityEvent->recurring_until = null;
}
}
+
+ public function updating(EntityEvent $entityEvent)
+ {
+ // When updating and elapsed isn't dirty (calculated on the overview), reset it
+ if ($entityEvent->isDirty(['year', 'month', 'day', 'calendar_id'])) {
+ $entityEvent->elapsed = null;
+ }
+ }
}
diff --git a/app/Services/Calendars/AdvancerService.php b/app/Services/Calendars/AdvancerService.php
index 92020636b8..2730ac739e 100644
--- a/app/Services/Calendars/AdvancerService.php
+++ b/app/Services/Calendars/AdvancerService.php
@@ -2,6 +2,7 @@
namespace App\Services\Calendars;
+use App\Jobs\CalendarsClearElapsed;
use App\Models\Calendar;
class AdvancerService
@@ -42,7 +43,7 @@ public function advance(): self
$year++;
}
$this->calendar->date = $year . '-' . $month . ($day !== false ? '-' . $day : null);
- $this->calendar->saveQuietly();
+ $this->calendar->save();
return $this;
}
@@ -68,7 +69,8 @@ public function retreat(): self
$year--;
}
$this->calendar->date = $year . '-' . $month . '-' . $day;
- $this->calendar->saveQuietly();
+ $this->calendar->save();
+ CalendarsClearElapsed::dispatch($this->calendar);
return $this;
}
}
diff --git a/public/build/assets/app-b968c210.js b/public/build/assets/app-b968c210.js
new file mode 100644
index 0000000000..6205fcc7f0
--- /dev/null
+++ b/public/build/assets/app-b968c210.js
@@ -0,0 +1 @@
+import{t as U,C as W}from"./tippy.esm-24ef6cb2.js";import{d as ot}from"./mention-6dbb4e38.js";import{S as Me}from"./sortable.esm-be94e56d.js";import{_ as S,c as l,a as o,t as d,o as r,n as E,w as te,b as h,F as v,r as b,d as y,e as g,f as L,g as j,h as ne,i as at,v as rt,j as F,k as Ie,l as lt}from"./_plugin-vue_export-helper-c420bb3b.js";import{m as ct}from"./mitt-f7ef348c.js";import{v as Ae}from"./v-click-outside.umd-d5c5f7b0.js";import"./_commonjsHelpers-725317a4.js";$(document).ready(function(){window.initTags=function(){$.each($(".form-tags"),function(){$(this).hasClass("select2-hidden-accessible")||$(this).select2({tags:$(this).data("allow-new"),allowClear:$(this).data("allow-clear"),dropdownParent:$(this).data("dropdown-parent")||"",minimumInputLength:0,ajax:{quietMillis:500,delay:500,url:$(this).data("url"),dataType:"json",data:function(e){return{q:$.trim(e.term)}},processResults:function(e){return{results:e}},cache:!0},createTag:function(e){var t=$.trim(e.term);return t===""?null:{id:t,text:t,newTag:!0}},templateResult:function(e){var t=$(""+e.text+"");return e.colour&&(t=$(""+e.text+"")),t},templateSelection:function(e,t){if(e.newTag)return $(''+e.text+' ');let n=$(e.element);return e.colour?$(t).addClass(e.colour):n.data("colour")&&$(t).addClass(n.data("colour")),$(t).addClass("text-left"),e.text}})})},window.initTags()});/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/ca",[],function(){return{errorLoading:function(){return"La càrrega ha fallat"},inputTooLong:function(t){var n=t.input.length-t.maximum,s="Si us plau, elimina "+n+" car";return s+=n==1?"àcter":"àcters"},inputTooShort:function(t){var n=t.minimum-t.input.length,s="Si us plau, introdueix "+n+" car";return s+=n==1?"àcter":"àcters"},loadingMore:function(){return"Carregant més resultats…"},maximumSelected:function(t){var n="Només es pot seleccionar "+t.maximum+" element";return t.maximum!=1&&(n+="s"),n},noResults:function(){return"No s'han trobat resultats"},searching:function(){return"Cercant…"},removeAllItems:function(){return"Treu tots els elements"}}}),e.define,e.require})();/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/de",[],function(){return{errorLoading:function(){return"Die Ergebnisse konnten nicht geladen werden."},inputTooLong:function(t){return"Bitte "+(t.input.length-t.maximum)+" Zeichen weniger eingeben"},inputTooShort:function(t){return"Bitte "+(t.minimum-t.input.length)+" Zeichen mehr eingeben"},loadingMore:function(){return"Lade mehr Ergebnisse…"},maximumSelected:function(t){var n="Sie können nur "+t.maximum+" Element";return t.maximum!=1&&(n+="e"),n+=" auswählen"},noResults:function(){return"Keine Übereinstimmungen gefunden"},searching:function(){return"Suche…"},removeAllItems:function(){return"Entferne alle Elemente"}}}),e.define,e.require})();/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/en",[],function(){return{errorLoading:function(){return"The results could not be loaded."},inputTooLong:function(t){var n=t.input.length-t.maximum,s="Please delete "+n+" character";return n!=1&&(s+="s"),s},inputTooShort:function(t){return"Please enter "+(t.minimum-t.input.length)+" or more characters"},loadingMore:function(){return"Loading more results…"},maximumSelected:function(t){var n="You can only select "+t.maximum+" item";return t.maximum!=1&&(n+="s"),n},noResults:function(){return"No results found"},searching:function(){return"Searching…"},removeAllItems:function(){return"Remove all items"}}}),e.define,e.require})();/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/es",[],function(){return{errorLoading:function(){return"No se pudieron cargar los resultados"},inputTooLong:function(t){var n=t.input.length-t.maximum,s="Por favor, elimine "+n+" car";return s+=n==1?"ácter":"acteres"},inputTooShort:function(t){var n=t.minimum-t.input.length,s="Por favor, introduzca "+n+" car";return s+=n==1?"ácter":"acteres"},loadingMore:function(){return"Cargando más resultados…"},maximumSelected:function(t){var n="Sólo puede seleccionar "+t.maximum+" elemento";return t.maximum!=1&&(n+="s"),n},noResults:function(){return"No se encontraron resultados"},searching:function(){return"Buscando…"},removeAllItems:function(){return"Eliminar todos los elementos"}}}),e.define,e.require})();/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/fr",[],function(){return{errorLoading:function(){return"Les résultats ne peuvent pas être chargés."},inputTooLong:function(t){var n=t.input.length-t.maximum;return"Supprimez "+n+" caractère"+(n>1?"s":"")},inputTooShort:function(t){var n=t.minimum-t.input.length;return"Saisissez au moins "+n+" caractère"+(n>1?"s":"")},loadingMore:function(){return"Chargement de résultats supplémentaires…"},maximumSelected:function(t){return"Vous pouvez seulement sélectionner "+t.maximum+" élément"+(t.maximum>1?"s":"")},noResults:function(){return"Aucun résultat trouvé"},searching:function(){return"Recherche en cours…"},removeAllItems:function(){return"Supprimer tous les éléments"}}}),e.define,e.require})();/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/hu",[],function(){return{errorLoading:function(){return"Az eredmények betöltése nem sikerült."},inputTooLong:function(t){return"Túl hosszú. "+(t.input.length-t.maximum)+" karakterrel több, mint kellene."},inputTooShort:function(t){return"Túl rövid. Még "+(t.minimum-t.input.length)+" karakter hiányzik."},loadingMore:function(){return"Töltés…"},maximumSelected:function(t){return"Csak "+t.maximum+" elemet lehet kiválasztani."},noResults:function(){return"Nincs találat."},searching:function(){return"Keresés…"},removeAllItems:function(){return"Távolítson el minden elemet"}}}),e.define,e.require})();/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/it",[],function(){return{errorLoading:function(){return"I risultati non possono essere caricati."},inputTooLong:function(t){var n=t.input.length-t.maximum,s="Per favore cancella "+n+" caratter";return s+=n!==1?"i":"e"},inputTooShort:function(t){return"Per favore inserisci "+(t.minimum-t.input.length)+" o più caratteri"},loadingMore:function(){return"Caricando più risultati…"},maximumSelected:function(t){var n="Puoi selezionare solo "+t.maximum+" element";return t.maximum!==1?n+="i":n+="o",n},noResults:function(){return"Nessun risultato trovato"},searching:function(){return"Sto cercando…"},removeAllItems:function(){return"Rimuovi tutti gli oggetti"}}}),e.define,e.require})();/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/nl",[],function(){return{errorLoading:function(){return"De resultaten konden niet worden geladen."},inputTooLong:function(t){return"Gelieve "+(t.input.length-t.maximum)+" karakters te verwijderen"},inputTooShort:function(t){return"Gelieve "+(t.minimum-t.input.length)+" of meer karakters in te voeren"},loadingMore:function(){return"Meer resultaten laden…"},maximumSelected:function(t){var n=t.maximum==1?"kan":"kunnen",s="Er "+n+" maar "+t.maximum+" item";return t.maximum!=1&&(s+="s"),s+=" worden geselecteerd"},noResults:function(){return"Geen resultaten gevonden…"},searching:function(){return"Zoeken…"},removeAllItems:function(){return"Verwijder alle items"}}}),e.define,e.require})();/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/pl",[],function(){var t=["znak","znaki","znaków"],n=["element","elementy","elementów"],s=function(i,a){return i===1?a[0]:i>1&&i<=4?a[1]:i>=5?a[2]:void 0};return{errorLoading:function(){return"Nie można załadować wyników."},inputTooLong:function(i){var a=i.input.length-i.maximum;return"Usuń "+a+" "+s(a,t)},inputTooShort:function(i){var a=i.minimum-i.input.length;return"Podaj przynajmniej "+a+" "+s(a,t)},loadingMore:function(){return"Trwa ładowanie…"},maximumSelected:function(i){return"Możesz zaznaczyć tylko "+i.maximum+" "+s(i.maximum,n)},noResults:function(){return"Brak wyników"},searching:function(){return"Trwa wyszukiwanie…"},removeAllItems:function(){return"Usuń wszystkie przedmioty"}}}),e.define,e.require})();/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/pt-BR",[],function(){return{errorLoading:function(){return"Os resultados não puderam ser carregados."},inputTooLong:function(t){var n=t.input.length-t.maximum,s="Apague "+n+" caracter";return n!=1&&(s+="es"),s},inputTooShort:function(t){return"Digite "+(t.minimum-t.input.length)+" ou mais caracteres"},loadingMore:function(){return"Carregando mais resultados…"},maximumSelected:function(t){var n="Você só pode selecionar "+t.maximum+" ite";return t.maximum==1?n+="m":n+="ns",n},noResults:function(){return"Nenhum resultado encontrado"},searching:function(){return"Buscando…"},removeAllItems:function(){return"Remover todos os itens"}}}),e.define,e.require})();/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/ru",[],function(){function t(n,s,i,a){return n%10<5&&n%10>0&&n%100<5||n%100>20?n%10>1?i:s:a}return{errorLoading:function(){return"Невозможно загрузить результаты"},inputTooLong:function(n){var s=n.input.length-n.maximum,i="Пожалуйста, введите на "+s+" символ";return i+=t(s,"","a","ов"),i+=" меньше"},inputTooShort:function(n){var s=n.minimum-n.input.length,i="Пожалуйста, введите ещё хотя бы "+s+" символ";return i+=t(s,"","a","ов")},loadingMore:function(){return"Загрузка данных…"},maximumSelected:function(n){var s="Вы можете выбрать не более "+n.maximum+" элемент";return s+=t(n.maximum,"","a","ов")},noResults:function(){return"Совпадений не найдено"},searching:function(){return"Поиск…"},removeAllItems:function(){return"Удалить все элементы"}}}),e.define,e.require})();/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/sk",[],function(){var t={2:function(n){return n?"dva":"dve"},3:function(){return"tri"},4:function(){return"štyri"}};return{errorLoading:function(){return"Výsledky sa nepodarilo načítať."},inputTooLong:function(n){var s=n.input.length-n.maximum;return s==1?"Prosím, zadajte o jeden znak menej":s>=2&&s<=4?"Prosím, zadajte o "+t[s](!0)+" znaky menej":"Prosím, zadajte o "+s+" znakov menej"},inputTooShort:function(n){var s=n.minimum-n.input.length;return s==1?"Prosím, zadajte ešte jeden znak":s<=4?"Prosím, zadajte ešte ďalšie "+t[s](!0)+" znaky":"Prosím, zadajte ešte ďalších "+s+" znakov"},loadingMore:function(){return"Načítanie ďalších výsledkov…"},maximumSelected:function(n){return n.maximum==1?"Môžete zvoliť len jednu položku":n.maximum>=2&&n.maximum<=4?"Môžete zvoliť najviac "+t[n.maximum](!1)+" položky":"Môžete zvoliť najviac "+n.maximum+" položiek"},noResults:function(){return"Nenašli sa žiadne položky"},searching:function(){return"Vyhľadávanie…"},removeAllItems:function(){return"Odstráňte všetky položky"}}}),e.define,e.require})();$(document).ready(function(){window.initForeignSelect=function(){$("select.select2").length!==0&&($.each($("select.select2"),function(e){if($(this).hasClass("select2-hidden-accessible"))return;if($(this).hasClass("campaign-genres")){$(this).select2({tags:!1,allowClear:!0,dropdownParent:"",width:"100%",maximumSelectionLength:3});return}let t=$(this).data("allow-clear"),n=$(this).data("dropdown-parent");$(this).select2({tags:!1,placeholder:$(this).data("placeholder"),allowClear:t||!0,language:$(this).data("language"),minimumInputLength:0,dropdownParent:n||"",width:"100%",ajax:{delay:500,quietMillis:500,url:$(this).data("url"),dataType:"json",data:function(s){return{q:$.trim(s.term)}},processResults:function(s){return{results:s}},error:function(s){return console.log("error",s),s.status===503&&window.showToast(s.responseJSON.message,"error"),{results:[]}},cache:!0},templateResult:function(s){var i="";return s.image?i=$(""+s.text+""):i=$(""+s.text+""),i},createTag:function(s){return null}})}),$("select.select2-local").select2({placeholder:$(this).data("placeholder"),language:$(this).data("language"),allowClear:!0}),$("select.select2-colour").select2({allowClear:!1,templateResult:ve,templateSelection:ve}))}});function ve(e){return e.id==="none"?e.text:$('
"):i=!1});let a=Object.keys(n)[0],c=e.find('[name="'+a+'"]');c.length>0&&c.focus(),i||s.forEach(function(u){window.showToast(n[u][0],"error")}),ee(e)},ea=e=>{e.find(".submit-group").find(".btn2").addClass("btn-disabled"),e.find(".submit-group").find(".btn2:first").addClass("loading")},ee=e=>{e.find(".submit-group").find(".btn2").removeClass("btn-disabled"),e.find(".submit-group").find(".btn2:first").removeClass("loading")};$(document).ready(function(){sa(),window.initForeignSelect(),window.initDialogs(),je(),ia(),ta(),na(),ot(),he(),De(),Te(),qe(),Ee(),$(document).on("shown.bs.modal shown.bs.popover",function(){window.initForeignSelect(),window.initTags(),window.initDialogs(),window.initTooltips(),window.initDropdowns(),he(),je(),De(),Te(),qe(),Ee()})});function je(){W.init(),W({el:".spectrum",format:"hex",alpha:!1,theme:"pill",clearButton:!0,closeButton:!0}),document.querySelectorAll(".spectrum").forEach(e=>{e.dataset.init!=="1"&&(e.dataset.init=1,e.addEventListener("click",function(t){W({parent:e.dataset.appendTo??".container"})}),e.addEventListener("close",t=>{t.stopPropagation()}))})}function ta(){let e=$(".list-treeview");if(e.length===0)return;let t=e.data("url");$.each($(".table-nested > tbody > tr"),function(){let n=$(this).data("children");parseInt(n)>0&&($(this).addClass("tr-hover cursor-pointer"),$(this).on("click",function(s){let i=$(s.target);s.target.type!=="checkbox"&&i.data("tree")!=="escape"&&(window.location=t+"?parent_id="+$(this).data("id")+"&m=table")}))})}function na(){let e=$(".nav-tabs li a");e.click(function(n){n.preventDefault(),$(this).data("url")||$(this).tab("show")}),e.on("shown.bs.tab",function(n){n.preventDefault();let s=$(n.target).attr("href").substr(1),i=$(n.target).attr("ajax-modal"),a=$(n.target).data("nohash");if(i&&i==="ajax-modal"||a)return!0;window.location.hash="tab_"+s});let t=window.location.hash.replace("tab_","");$('ul.nav-tabs > li > a[href="'+t+'"]').tab("show")}function Te(){$.each($('[data-img="delete"]'),function(){$(this).unbind("click").click(function(e){e.preventDefault(),$("input[name="+$(this).data("target")+"]")[0].value=1,$(this).closest(".preview").hide()})})}function he(){$(".pagination-ajax-links a").on("click",function(e){e.preventDefault();let t=$(".pagination-ajax-body");return t.find(".modal-loading").show(),t.find(".pagination-ajax-content").hide(),fetch($(this).attr("href")).then(n=>n.text()).then(n=>{t.parent().html(n),he(),$(document).trigger("shown.bs.modal")}),!1})}function De(){$('[data-toggle="confirm-delete"]').unbind("click").on("click",function(e){if(e.preventDefault(),$(this).data("confirming")===1){$(this).addClass("loading"),$(this).html("");let t=$(this).data("target");$(t).length===0?console.error("Unknown target",t):$(t).submit();return}$(this).data("confirming",1),$(this).find("span").html($(this).data("confirm"))}),$('a[data-toggle="delete-form"]').unbind("click").click(function(e){e.preventDefault();let t=$(this).data("target");$(t).submit()})}function ia(){$(".submenu-switcher").change(function(e){e.preventDefault();let t=$(this).find(":selected");window.location.href=t.data("route")})}function sa(){let e=0;const t={window:$(window).height(),header:$("header").length>0?$("header").outerHeight():0,footer:$(".main-footer").length>0?$(".main-footer").outerHeight():0,sidebar:$(".main-sidebar .sidebar").length>0?$(".main-sidebar .sidebar").height():0,controlSidebar:e};let n=oa(t),s=$(".content-wrapper");n===t.controlSidebar?s.css("min-height",n):n===t.window?s.css("min-height",n-t.header-t.footer):s.css("min-height",n-t.header)}function oa(e){let t=0;return Object.keys(e).forEach(n=>{e[n]>t&&(t=e[n])}),t}const qe=()=>{document.querySelectorAll(".btn-feedback").forEach(e=>{e.dataset.feedback||(e.dataset.feedback=1,e.addEventListener("click",n=>{n.target.classList.add("loading")},!1))}),$("#quick-privacy-select").change(function(){let e=$(this).data("url");axios.post(e).then(t=>{window.showToast(t.data.toast);let n=document.querySelector("body");t.data.status?n.classList.remove("kanka-entity-private"):n.classList.add("kanka-entity-private")})})},Ee=()=>{document.querySelectorAll("[data-dismisses]").forEach(t=>{t.addEventListener("click",function(n){n.preventDefault();let s=document.querySelector(this.dataset.dismisses);s.classList.remove("opacity-100"),s.classList.add("opacity-0"),setTimeout(function(){s.remove()},150)})})};
diff --git a/public/build/assets/app-c41b2a06.js b/public/build/assets/app-c41b2a06.js
deleted file mode 100644
index 6d341f279c..0000000000
--- a/public/build/assets/app-c41b2a06.js
+++ /dev/null
@@ -1 +0,0 @@
-import{t as U,C as W}from"./tippy.esm-24ef6cb2.js";import{d as ot}from"./mention-6dbb4e38.js";import{S as Me}from"./sortable.esm-be94e56d.js";import{_ as S,c as l,a as o,t as d,o as r,n as E,w as te,b as h,F as v,r as b,d as y,e as g,f as L,g as j,h as ne,i as at,v as rt,j as F,k as Ie,l as lt}from"./_plugin-vue_export-helper-c420bb3b.js";import{m as ct}from"./mitt-f7ef348c.js";import{v as Ae}from"./v-click-outside.umd-d5c5f7b0.js";import"./_commonjsHelpers-725317a4.js";$(document).ready(function(){window.initTags=function(){$.each($(".form-tags"),function(){$(this).hasClass("select2-hidden-accessible")||$(this).select2({tags:$(this).data("allow-new"),allowClear:$(this).data("allow-clear"),dropdownParent:$(this).data("dropdown-parent")||"",minimumInputLength:0,ajax:{quietMillis:500,delay:500,url:$(this).data("url"),dataType:"json",data:function(e){return{q:$.trim(e.term)}},processResults:function(e){return{results:e}},cache:!0},createTag:function(e){var t=$.trim(e.term);return t===""?null:{id:t,text:t,newTag:!0}},templateResult:function(e){var t=$(""+e.text+"");return e.colour&&(t=$(""+e.text+"")),t},templateSelection:function(e,t){if(e.newTag)return $(''+e.text+' ');let n=$(e.element);return e.colour?$(t).addClass(e.colour):n.data("colour")&&$(t).addClass(n.data("colour")),$(t).addClass("text-left"),e.text}})})},window.initTags()});/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/ca",[],function(){return{errorLoading:function(){return"La càrrega ha fallat"},inputTooLong:function(t){var n=t.input.length-t.maximum,s="Si us plau, elimina "+n+" car";return s+=n==1?"àcter":"àcters"},inputTooShort:function(t){var n=t.minimum-t.input.length,s="Si us plau, introdueix "+n+" car";return s+=n==1?"àcter":"àcters"},loadingMore:function(){return"Carregant més resultats…"},maximumSelected:function(t){var n="Només es pot seleccionar "+t.maximum+" element";return t.maximum!=1&&(n+="s"),n},noResults:function(){return"No s'han trobat resultats"},searching:function(){return"Cercant…"},removeAllItems:function(){return"Treu tots els elements"}}}),e.define,e.require})();/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/de",[],function(){return{errorLoading:function(){return"Die Ergebnisse konnten nicht geladen werden."},inputTooLong:function(t){return"Bitte "+(t.input.length-t.maximum)+" Zeichen weniger eingeben"},inputTooShort:function(t){return"Bitte "+(t.minimum-t.input.length)+" Zeichen mehr eingeben"},loadingMore:function(){return"Lade mehr Ergebnisse…"},maximumSelected:function(t){var n="Sie können nur "+t.maximum+" Element";return t.maximum!=1&&(n+="e"),n+=" auswählen"},noResults:function(){return"Keine Übereinstimmungen gefunden"},searching:function(){return"Suche…"},removeAllItems:function(){return"Entferne alle Elemente"}}}),e.define,e.require})();/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/en",[],function(){return{errorLoading:function(){return"The results could not be loaded."},inputTooLong:function(t){var n=t.input.length-t.maximum,s="Please delete "+n+" character";return n!=1&&(s+="s"),s},inputTooShort:function(t){return"Please enter "+(t.minimum-t.input.length)+" or more characters"},loadingMore:function(){return"Loading more results…"},maximumSelected:function(t){var n="You can only select "+t.maximum+" item";return t.maximum!=1&&(n+="s"),n},noResults:function(){return"No results found"},searching:function(){return"Searching…"},removeAllItems:function(){return"Remove all items"}}}),e.define,e.require})();/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/es",[],function(){return{errorLoading:function(){return"No se pudieron cargar los resultados"},inputTooLong:function(t){var n=t.input.length-t.maximum,s="Por favor, elimine "+n+" car";return s+=n==1?"ácter":"acteres"},inputTooShort:function(t){var n=t.minimum-t.input.length,s="Por favor, introduzca "+n+" car";return s+=n==1?"ácter":"acteres"},loadingMore:function(){return"Cargando más resultados…"},maximumSelected:function(t){var n="Sólo puede seleccionar "+t.maximum+" elemento";return t.maximum!=1&&(n+="s"),n},noResults:function(){return"No se encontraron resultados"},searching:function(){return"Buscando…"},removeAllItems:function(){return"Eliminar todos los elementos"}}}),e.define,e.require})();/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/fr",[],function(){return{errorLoading:function(){return"Les résultats ne peuvent pas être chargés."},inputTooLong:function(t){var n=t.input.length-t.maximum;return"Supprimez "+n+" caractère"+(n>1?"s":"")},inputTooShort:function(t){var n=t.minimum-t.input.length;return"Saisissez au moins "+n+" caractère"+(n>1?"s":"")},loadingMore:function(){return"Chargement de résultats supplémentaires…"},maximumSelected:function(t){return"Vous pouvez seulement sélectionner "+t.maximum+" élément"+(t.maximum>1?"s":"")},noResults:function(){return"Aucun résultat trouvé"},searching:function(){return"Recherche en cours…"},removeAllItems:function(){return"Supprimer tous les éléments"}}}),e.define,e.require})();/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/hu",[],function(){return{errorLoading:function(){return"Az eredmények betöltése nem sikerült."},inputTooLong:function(t){return"Túl hosszú. "+(t.input.length-t.maximum)+" karakterrel több, mint kellene."},inputTooShort:function(t){return"Túl rövid. Még "+(t.minimum-t.input.length)+" karakter hiányzik."},loadingMore:function(){return"Töltés…"},maximumSelected:function(t){return"Csak "+t.maximum+" elemet lehet kiválasztani."},noResults:function(){return"Nincs találat."},searching:function(){return"Keresés…"},removeAllItems:function(){return"Távolítson el minden elemet"}}}),e.define,e.require})();/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/it",[],function(){return{errorLoading:function(){return"I risultati non possono essere caricati."},inputTooLong:function(t){var n=t.input.length-t.maximum,s="Per favore cancella "+n+" caratter";return s+=n!==1?"i":"e"},inputTooShort:function(t){return"Per favore inserisci "+(t.minimum-t.input.length)+" o più caratteri"},loadingMore:function(){return"Caricando più risultati…"},maximumSelected:function(t){var n="Puoi selezionare solo "+t.maximum+" element";return t.maximum!==1?n+="i":n+="o",n},noResults:function(){return"Nessun risultato trovato"},searching:function(){return"Sto cercando…"},removeAllItems:function(){return"Rimuovi tutti gli oggetti"}}}),e.define,e.require})();/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/nl",[],function(){return{errorLoading:function(){return"De resultaten konden niet worden geladen."},inputTooLong:function(t){return"Gelieve "+(t.input.length-t.maximum)+" karakters te verwijderen"},inputTooShort:function(t){return"Gelieve "+(t.minimum-t.input.length)+" of meer karakters in te voeren"},loadingMore:function(){return"Meer resultaten laden…"},maximumSelected:function(t){var n=t.maximum==1?"kan":"kunnen",s="Er "+n+" maar "+t.maximum+" item";return t.maximum!=1&&(s+="s"),s+=" worden geselecteerd"},noResults:function(){return"Geen resultaten gevonden…"},searching:function(){return"Zoeken…"},removeAllItems:function(){return"Verwijder alle items"}}}),e.define,e.require})();/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/pl",[],function(){var t=["znak","znaki","znaków"],n=["element","elementy","elementów"],s=function(i,a){return i===1?a[0]:i>1&&i<=4?a[1]:i>=5?a[2]:void 0};return{errorLoading:function(){return"Nie można załadować wyników."},inputTooLong:function(i){var a=i.input.length-i.maximum;return"Usuń "+a+" "+s(a,t)},inputTooShort:function(i){var a=i.minimum-i.input.length;return"Podaj przynajmniej "+a+" "+s(a,t)},loadingMore:function(){return"Trwa ładowanie…"},maximumSelected:function(i){return"Możesz zaznaczyć tylko "+i.maximum+" "+s(i.maximum,n)},noResults:function(){return"Brak wyników"},searching:function(){return"Trwa wyszukiwanie…"},removeAllItems:function(){return"Usuń wszystkie przedmioty"}}}),e.define,e.require})();/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/pt-BR",[],function(){return{errorLoading:function(){return"Os resultados não puderam ser carregados."},inputTooLong:function(t){var n=t.input.length-t.maximum,s="Apague "+n+" caracter";return n!=1&&(s+="es"),s},inputTooShort:function(t){return"Digite "+(t.minimum-t.input.length)+" ou mais caracteres"},loadingMore:function(){return"Carregando mais resultados…"},maximumSelected:function(t){var n="Você só pode selecionar "+t.maximum+" ite";return t.maximum==1?n+="m":n+="ns",n},noResults:function(){return"Nenhum resultado encontrado"},searching:function(){return"Buscando…"},removeAllItems:function(){return"Remover todos os itens"}}}),e.define,e.require})();/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/ru",[],function(){function t(n,s,i,a){return n%10<5&&n%10>0&&n%100<5||n%100>20?n%10>1?i:s:a}return{errorLoading:function(){return"Невозможно загрузить результаты"},inputTooLong:function(n){var s=n.input.length-n.maximum,i="Пожалуйста, введите на "+s+" символ";return i+=t(s,"","a","ов"),i+=" меньше"},inputTooShort:function(n){var s=n.minimum-n.input.length,i="Пожалуйста, введите ещё хотя бы "+s+" символ";return i+=t(s,"","a","ов")},loadingMore:function(){return"Загрузка данных…"},maximumSelected:function(n){var s="Вы можете выбрать не более "+n.maximum+" элемент";return s+=t(n.maximum,"","a","ов")},noResults:function(){return"Совпадений не найдено"},searching:function(){return"Поиск…"},removeAllItems:function(){return"Удалить все элементы"}}}),e.define,e.require})();/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/sk",[],function(){var t={2:function(n){return n?"dva":"dve"},3:function(){return"tri"},4:function(){return"štyri"}};return{errorLoading:function(){return"Výsledky sa nepodarilo načítať."},inputTooLong:function(n){var s=n.input.length-n.maximum;return s==1?"Prosím, zadajte o jeden znak menej":s>=2&&s<=4?"Prosím, zadajte o "+t[s](!0)+" znaky menej":"Prosím, zadajte o "+s+" znakov menej"},inputTooShort:function(n){var s=n.minimum-n.input.length;return s==1?"Prosím, zadajte ešte jeden znak":s<=4?"Prosím, zadajte ešte ďalšie "+t[s](!0)+" znaky":"Prosím, zadajte ešte ďalších "+s+" znakov"},loadingMore:function(){return"Načítanie ďalších výsledkov…"},maximumSelected:function(n){return n.maximum==1?"Môžete zvoliť len jednu položku":n.maximum>=2&&n.maximum<=4?"Môžete zvoliť najviac "+t[n.maximum](!1)+" položky":"Môžete zvoliť najviac "+n.maximum+" položiek"},noResults:function(){return"Nenašli sa žiadne položky"},searching:function(){return"Vyhľadávanie…"},removeAllItems:function(){return"Odstráňte všetky položky"}}}),e.define,e.require})();$(document).ready(function(){window.initForeignSelect=function(){$("select.select2").length!==0&&($.each($("select.select2"),function(e){if($(this).hasClass("select2-hidden-accessible"))return;if($(this).hasClass("campaign-genres")){$(this).select2({tags:!1,allowClear:!0,dropdownParent:"",width:"100%",maximumSelectionLength:3});return}let t=$(this).data("allow-clear"),n=$(this).data("dropdown-parent");$(this).select2({tags:!1,placeholder:$(this).data("placeholder"),allowClear:t||!0,language:$(this).data("language"),minimumInputLength:0,dropdownParent:n||"",width:"100%",ajax:{delay:500,quietMillis:500,url:$(this).data("url"),dataType:"json",data:function(s){return{q:$.trim(s.term)}},processResults:function(s){return{results:s}},error:function(s){return console.log("error",s),s.status===503&&window.showToast(s.responseJSON.message,"error"),{results:[]}},cache:!0},templateResult:function(s){var i="";return s.image?i=$(""+s.text+""):i=$(""+s.text+""),i},createTag:function(s){return null}})}),$("select.select2-local").select2({placeholder:$(this).data("placeholder"),language:$(this).data("language"),allowClear:!0}),$("select.select2-colour").select2({allowClear:!1,templateResult:ve,templateSelection:ve}))}});function ve(e){return e.id==="none"?e.text:$('