From a197d2123f85ea11343aa9293d33305bf3a8aaa5 Mon Sep 17 00:00:00 2001 From: lesion Date: Mon, 5 Sep 2022 00:02:33 +0200 Subject: [PATCH 01/16] fix microdata address --- components/Event.vue | 44 ++++++++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/components/Event.vue b/components/Event.vue index e3aae44f..d41eb02e 100644 --- a/components/Event.vue +++ b/components/Event.vue @@ -3,22 +3,22 @@ v-card.h-event.event.d-flex(itemscope itemtype="https://schema.org/Event") nuxt-link(:to='`/event/${event.slug || event.id}`' itemprop="url") MyPicture(:event='event' thumb :lazy='lazy') v-icon.float-right.mr-1(v-if='event.parentId' color='success' v-text='mdiRepeat') - .title.p-name(itemprop="name") {{event.title}} + .title.p-name(itemprop="name") {{ event.title }} v-card-text.body.pt-0.pb-0 - time.dt-start.subtitle-1(:datetime='event.start_datetime|unixFormat("YYYY-MM-DD HH:mm")' itemprop="startDate" :content="event.start_datetime|unixFormat('YYYY-MM-DDTHH:mm')") {{ event|when }} - .d-none.dt-end(itemprop="endDate" :content="event.end_datetime|unixFormat('YYYY-MM-DDTHH:mm')") {{event.end_datetime|unixFormat('YYYY-MM-DD HH:mm')}} - nuxt-link.place.d-block.p-location.pl-0(text color='primary' :to='`/place/${event.place.name}`' itemprop="location" :content="event.place.name") {{event.place.name}} - .d-none(itemprop='location.address') {{event.place.address}} + time.dt-start.subtitle-1(:datetime='event.start_datetime | unixFormat("YYYY-MM-DD HH:mm")' itemprop="startDate" :content="event.start_datetime | unixFormat('YYYY-MM-DDTHH:mm')") {{ event | when }} + .d-none.dt-end(itemprop="endDate" :content="event.end_datetime | unixFormat('YYYY-MM-DDTHH:mm')") {{ event.end_datetime | unixFormat('YYYY-MM-DD HH:mm') }} + nuxt-link.place.d-block.p-location.pl-0(text color='primary' :to='`/place/${event.place.name}`' itemprop="location" itemscope itemtype="https://schema.org/Place") {{ event.place.name }} + .d-none(itemprop='address') {{ event.place.address }} v-card-actions.pt-0.actions.justify-space-between .tags - v-chip.ml-1.mt-1(v-for='tag in event.tags.slice(0,6)' small :to='`/tag/${tag}`' - :key='tag' outlined color='primary') {{tag}} + v-chip.ml-1.mt-1(v-for='tag in event.tags.slice(0, 6)' small :to='`/tag/${tag}`' + :key='tag' outlined color='primary') {{ tag }} client-only v-menu(offset-y eager) - template(v-slot:activator="{on}") + template(v-slot:activator="{ on }") v-btn.align-self-end(icon v-on='on' color='primary' title='more' aria-label='more') v-icon(v-text='mdiDotsVertical') v-list(dense) @@ -27,22 +27,22 @@ v-card.h-event.event.d-flex(itemscope itemtype="https://schema.org/Event") v-list-item-icon v-icon(v-text='mdiContentCopy') v-list-item-content - v-list-item-title {{$t('common.copy_link')}} + v-list-item-title {{ $t('common.copy_link') }} v-list-item(:href='`/api/event/${event.slug || event.id}.ics`') v-list-item-icon v-icon(v-text='mdiCalendarExport') v-list-item-content - v-list-item-title {{$t('common.add_to_calendar')}} + v-list-item-title {{ $t('common.add_to_calendar') }} v-list-item(v-if='is_mine' :to='`/add/${event.id}`') v-list-item-icon v-icon(v-text='mdiPencil') v-list-item-content - v-list-item-title {{$t('common.edit')}} + v-list-item-title {{ $t('common.edit') }} v-list-item(v-if='is_mine' @click='remove(false)') v-list-item-icon v-icon(color='error' v-text='mdiDeleteForever') v-list-item-content - v-list-item-title {{$t('common.remove')}} + v-list-item-title {{ $t('common.remove') }} template(#placeholder) v-btn.align-self-end(icon color='primary' aria-label='more') v-icon(v-text='mdiDotsVertical') @@ -51,13 +51,17 @@ v-card.h-event.event.d-flex(itemscope itemtype="https://schema.org/Event") import { mapState } from 'vuex' import clipboard from '../assets/clipboard' import MyPicture from '~/components/MyPicture' -import { mdiRepeat, mdiPencil, mdiDotsVertical, mdiContentCopy, - mdiCalendarExport, mdiDeleteForever, mdiCalendar, mdiMapMarker } from '@mdi/js' +import { + mdiRepeat, mdiPencil, mdiDotsVertical, mdiContentCopy, + mdiCalendarExport, mdiDeleteForever, mdiCalendar, mdiMapMarker +} from '@mdi/js' export default { - data () { - return { mdiRepeat, mdiPencil, mdiDotsVertical, mdiContentCopy, mdiCalendarExport, - mdiDeleteForever, mdiMapMarker, mdiCalendar } + data() { + return { + mdiRepeat, mdiPencil, mdiDotsVertical, mdiContentCopy, mdiCalendarExport, + mdiDeleteForever, mdiMapMarker, mdiCalendar + } }, components: { MyPicture @@ -69,7 +73,7 @@ export default { mixins: [clipboard], computed: { ...mapState(['settings']), - is_mine () { + is_mine() { if (!this.$auth.user) { return false } @@ -79,13 +83,13 @@ export default { } }, methods: { - async remove () { + async remove() { const ret = await this.$root.$confirm('event.remove_confirmation') if (!ret) { return } await this.$axios.delete(`/event/${this.event.id}`) this.$emit('destroy', this.event.id) this.$root.$message('admin.event_remove_ok') - + } } } From d6c7ad050b755df88d5932a4475fde6dafe40ec7 Mon Sep 17 00:00:00 2001 From: lesion Date: Mon, 5 Sep 2022 00:06:16 +0200 Subject: [PATCH 02/16] fix endtime selection --- components/DateInput.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/DateInput.vue b/components/DateInput.vue index f03279ba..7ba78919 100644 --- a/components/DateInput.vue +++ b/components/DateInput.vue @@ -272,7 +272,7 @@ export default { this.$emit('input', { ...this.value, from, due }) } else { let from = value - let due = this.value.due || from + let due = this.value.due if (this.fromHour) { const [hour, minute] = this.fromHour.split(':') from = dayjs.tz(value).hour(hour).minute(minute).second(0).toDate() From 348707b9af2679a589cc81b278e43768f1b77c87 Mon Sep 17 00:00:00 2001 From: lesion Date: Mon, 5 Sep 2022 11:41:24 +0200 Subject: [PATCH 03/16] add reveal conf for hackit preso --- reveal-md.json | 4 ++++ reveal.json | 5 +++++ 2 files changed, 9 insertions(+) create mode 100644 reveal-md.json create mode 100644 reveal.json diff --git a/reveal-md.json b/reveal-md.json new file mode 100644 index 00000000..af346e4a --- /dev/null +++ b/reveal-md.json @@ -0,0 +1,4 @@ +{ + "separator": "^---", + "verticalSeparator": "^--" +} diff --git a/reveal.json b/reveal.json new file mode 100644 index 00000000..1944cb68 --- /dev/null +++ b/reveal.json @@ -0,0 +1,5 @@ +{ + "controls": true, + "progress": true, + "transition": "slide" +} From 5253cee835296d9ea4139657ea0600648e315508 Mon Sep 17 00:00:00 2001 From: lesion Date: Mon, 5 Sep 2022 11:41:56 +0200 Subject: [PATCH 04/16] update webcomponent deps --- webcomponents/package.json | 6 +- webcomponents/yarn.lock | 346 +++++++++++++++++++------------------ 2 files changed, 182 insertions(+), 170 deletions(-) diff --git a/webcomponents/package.json b/webcomponents/package.json index f88bd8dc..08866c04 100644 --- a/webcomponents/package.json +++ b/webcomponents/package.json @@ -9,8 +9,8 @@ "serve": "vite preview" }, "devDependencies": { - "@sveltejs/vite-plugin-svelte": "^1.0.0-next.34", - "svelte": "^3.46.3", - "vite": "^2.7.11" + "@sveltejs/vite-plugin-svelte": "^1.0.4", + "svelte": "^3.50.0", + "vite": "^3.0.9" } } diff --git a/webcomponents/yarn.lock b/webcomponents/yarn.lock index a2624f42..bf8efc56 100644 --- a/webcomponents/yarn.lock +++ b/webcomponents/yarn.lock @@ -2,157 +2,169 @@ # yarn lockfile v1 -"@rollup/pluginutils@^4.1.2": - version "4.2.0" - resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-4.2.0.tgz#a14bbd058fdbba0a5647143b16ed0d86fb60bd08" - integrity sha512-2WUyJNRkyH5p487pGnn4tWAsxhEFKN/pT8CMgHshd5H+IXkOnKvKZwsz5ZWz+YCXkleZRAU5kwbfgF8CPfDRqA== +"@esbuild/linux-loong64@0.14.54": + version "0.14.54" + resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.14.54.tgz#de2a4be678bd4d0d1ffbb86e6de779cde5999028" + integrity sha512-bZBrLAIX1kpWelV0XemxBZllyRmM6vgFQQG2GdNb+r3Fkp0FOh1NJSvekXDs7jq70k4euu1cryLMfU+mTXlEpw== + +"@rollup/pluginutils@^4.2.1": + version "4.2.1" + resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-4.2.1.tgz#e6c6c3aba0744edce3fb2074922d3776c0af2a6d" + integrity sha512-iKnFXr7NkdZAIHiIWE+BX5ULi/ucVFYWD6TbAV+rZctiRTY2PL6tsIKhoIOaoskiWAkgu+VsbXgUVDNLHf+InQ== dependencies: estree-walker "^2.0.1" picomatch "^2.2.2" -"@sveltejs/vite-plugin-svelte@^1.0.0-next.34": - version "1.0.0-next.39" - resolved "https://registry.yarnpkg.com/@sveltejs/vite-plugin-svelte/-/vite-plugin-svelte-1.0.0-next.39.tgz#b9437de18d13a475f76cf603511174cdf905b8d4" - integrity sha512-gnvvcAW2LK+KnUn8lKb2ypcXKwSp2K57mem5C4VNKfjxdRpM6+XwNavWwVf6otnDhz3qPYl/TKKW6/dRr6eeAw== +"@sveltejs/vite-plugin-svelte@^1.0.4": + version "1.0.4" + resolved "https://registry.yarnpkg.com/@sveltejs/vite-plugin-svelte/-/vite-plugin-svelte-1.0.4.tgz#363a0adeb9221c35abb65197c6db0754b9994a08" + integrity sha512-UZco2fdj0OVuRWC0SUJjEOftITc2IeHLFJNp00ym9MuQ9dShnlO4P29G8KUxRlcS7kSpzHuko6eCR9MOALj7lQ== dependencies: - "@rollup/pluginutils" "^4.1.2" - debug "^4.3.3" - kleur "^4.1.4" - magic-string "^0.25.7" - svelte-hmr "^0.14.9" + "@rollup/pluginutils" "^4.2.1" + debug "^4.3.4" + deepmerge "^4.2.2" + kleur "^4.1.5" + magic-string "^0.26.2" + svelte-hmr "^0.14.12" -debug@^4.3.3: - version "4.3.3" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.3.tgz#04266e0b70a98d4462e6e288e38259213332b664" - integrity sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q== +debug@^4.3.4: + version "4.3.4" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" + integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== dependencies: ms "2.1.2" -esbuild-android-64@0.14.25: - version "0.14.25" - resolved "https://registry.yarnpkg.com/esbuild-android-64/-/esbuild-android-64-0.14.25.tgz#d532d38cb5fe0ae45167ce35f4bbc784c636be40" - integrity sha512-L5vCUk7TzFbBnoESNoXjU3x9+/+7TDIE/1mTfy/erAfvZAqC+S3sp/Qa9wkypFMcFvN9FzvESkTlpeQDolREtQ== +deepmerge@^4.2.2: + version "4.2.2" + resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-4.2.2.tgz#44d2ea3679b8f4d4ffba33f03d865fc1e7bf4955" + integrity sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg== -esbuild-android-arm64@0.14.25: - version "0.14.25" - resolved "https://registry.yarnpkg.com/esbuild-android-arm64/-/esbuild-android-arm64-0.14.25.tgz#9c5bb3366aabfd14a1c726d36978b79441dfcb6e" - integrity sha512-4jv5xPjM/qNm27T5j3ZEck0PvjgQtoMHnz4FzwF5zNP56PvY2CT0WStcAIl6jNlsuDdN63rk2HRBIsO6xFbcFw== +esbuild-android-64@0.14.54: + version "0.14.54" + resolved "https://registry.yarnpkg.com/esbuild-android-64/-/esbuild-android-64-0.14.54.tgz#505f41832884313bbaffb27704b8bcaa2d8616be" + integrity sha512-Tz2++Aqqz0rJ7kYBfz+iqyE3QMycD4vk7LBRyWaAVFgFtQ/O8EJOnVmTOiDWYZ/uYzB4kvP+bqejYdVKzE5lAQ== -esbuild-darwin-64@0.14.25: - version "0.14.25" - resolved "https://registry.yarnpkg.com/esbuild-darwin-64/-/esbuild-darwin-64-0.14.25.tgz#05dcdb6d884f427039ffee5e92ff97527e56c26d" - integrity sha512-TGp8tuudIxOyWd1+8aYPxQmC1ZQyvij/AfNBa35RubixD0zJ1vkKHVAzo0Zao1zcG6pNqiSyzfPto8vmg0s7oA== +esbuild-android-arm64@0.14.54: + version "0.14.54" + resolved "https://registry.yarnpkg.com/esbuild-android-arm64/-/esbuild-android-arm64-0.14.54.tgz#8ce69d7caba49646e009968fe5754a21a9871771" + integrity sha512-F9E+/QDi9sSkLaClO8SOV6etqPd+5DgJje1F9lOWoNncDdOBL2YF59IhsWATSt0TLZbYCf3pNlTHvVV5VfHdvg== -esbuild-darwin-arm64@0.14.25: - version "0.14.25" - resolved "https://registry.yarnpkg.com/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.14.25.tgz#28e080da4ea0cfe9498071e7f8060498caee1a95" - integrity sha512-oTcDgdm0MDVEmw2DWu8BV68pYuImpFgvWREPErBZmNA4MYKGuBRaCiJqq6jZmBR1x+3y1DWCjez+5uLtuAm6mw== +esbuild-darwin-64@0.14.54: + version "0.14.54" + resolved "https://registry.yarnpkg.com/esbuild-darwin-64/-/esbuild-darwin-64-0.14.54.tgz#24ba67b9a8cb890a3c08d9018f887cc221cdda25" + integrity sha512-jtdKWV3nBviOd5v4hOpkVmpxsBy90CGzebpbO9beiqUYVMBtSc0AL9zGftFuBon7PNDcdvNCEuQqw2x0wP9yug== -esbuild-freebsd-64@0.14.25: - version "0.14.25" - resolved "https://registry.yarnpkg.com/esbuild-freebsd-64/-/esbuild-freebsd-64-0.14.25.tgz#200d3664a3b945bc9fdcba73614b49a11ebd1cfa" - integrity sha512-ueAqbnMZ8arnuLH8tHwTCQYeptnHOUV7vA6px6j4zjjQwDx7TdP7kACPf3TLZLdJQ3CAD1XCvQ2sPhX+8tacvQ== +esbuild-darwin-arm64@0.14.54: + version "0.14.54" + resolved "https://registry.yarnpkg.com/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.14.54.tgz#3f7cdb78888ee05e488d250a2bdaab1fa671bf73" + integrity sha512-OPafJHD2oUPyvJMrsCvDGkRrVCar5aVyHfWGQzY1dWnzErjrDuSETxwA2HSsyg2jORLY8yBfzc1MIpUkXlctmw== -esbuild-freebsd-arm64@0.14.25: - version "0.14.25" - resolved "https://registry.yarnpkg.com/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.14.25.tgz#624b08c5da6013bdc312aaa23c4ff409580f5c3c" - integrity sha512-+ZVWud2HKh+Ob6k/qiJWjBtUg4KmJGGmbvEXXW1SNKS7hW7HU+Zq2ZCcE1akFxOPkVB+EhOty/sSek30tkCYug== +esbuild-freebsd-64@0.14.54: + version "0.14.54" + resolved "https://registry.yarnpkg.com/esbuild-freebsd-64/-/esbuild-freebsd-64-0.14.54.tgz#09250f997a56ed4650f3e1979c905ffc40bbe94d" + integrity sha512-OKwd4gmwHqOTp4mOGZKe/XUlbDJ4Q9TjX0hMPIDBUWWu/kwhBAudJdBoxnjNf9ocIB6GN6CPowYpR/hRCbSYAg== -esbuild-linux-32@0.14.25: - version "0.14.25" - resolved "https://registry.yarnpkg.com/esbuild-linux-32/-/esbuild-linux-32-0.14.25.tgz#0238e597eb0b60aa06c7e98fccbbfd6bb9a0d6c5" - integrity sha512-3OP/lwV3kCzEz45tobH9nj+uE4ubhGsfx+tn0L26WAGtUbmmcRpqy7XRG/qK7h1mClZ+eguIANcQntYMdYklfw== +esbuild-freebsd-arm64@0.14.54: + version "0.14.54" + resolved "https://registry.yarnpkg.com/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.14.54.tgz#bafb46ed04fc5f97cbdb016d86947a79579f8e48" + integrity sha512-sFwueGr7OvIFiQT6WeG0jRLjkjdqWWSrfbVwZp8iMP+8UHEHRBvlaxL6IuKNDwAozNUmbb8nIMXa7oAOARGs1Q== -esbuild-linux-64@0.14.25: - version "0.14.25" - resolved "https://registry.yarnpkg.com/esbuild-linux-64/-/esbuild-linux-64-0.14.25.tgz#8a8b8cf47dfce127c858e71229d9a385a82c62e8" - integrity sha512-+aKHdHZmX9qwVlQmu5xYXh7GsBFf4TWrePgeJTalhXHOG7NNuUwoHmketGiZEoNsWyyqwH9rE5BC+iwcLY30Ug== +esbuild-linux-32@0.14.54: + version "0.14.54" + resolved "https://registry.yarnpkg.com/esbuild-linux-32/-/esbuild-linux-32-0.14.54.tgz#e2a8c4a8efdc355405325033fcebeb941f781fe5" + integrity sha512-1ZuY+JDI//WmklKlBgJnglpUL1owm2OX+8E1syCD6UAxcMM/XoWd76OHSjl/0MR0LisSAXDqgjT3uJqT67O3qw== -esbuild-linux-arm64@0.14.25: - version "0.14.25" - resolved "https://registry.yarnpkg.com/esbuild-linux-arm64/-/esbuild-linux-arm64-0.14.25.tgz#7ac94371418a2640ba413bc1700aaedeb2794e52" - integrity sha512-UxfenPx/wSZx55gScCImPtXekvZQLI2GW3qe5dtlmU7luiqhp5GWPzGeQEbD3yN3xg/pHc671m5bma5Ns7lBHw== +esbuild-linux-64@0.14.54: + version "0.14.54" + resolved "https://registry.yarnpkg.com/esbuild-linux-64/-/esbuild-linux-64-0.14.54.tgz#de5fdba1c95666cf72369f52b40b03be71226652" + integrity sha512-EgjAgH5HwTbtNsTqQOXWApBaPVdDn7XcK+/PtJwZLT1UmpLoznPd8c5CxqsH2dQK3j05YsB3L17T8vE7cp4cCg== -esbuild-linux-arm@0.14.25: - version "0.14.25" - resolved "https://registry.yarnpkg.com/esbuild-linux-arm/-/esbuild-linux-arm-0.14.25.tgz#034bd18e9310b9f010c89f90ef7f05706689600b" - integrity sha512-aTLcE2VBoLydL943REcAcgnDi3bHtmULSXWLbjtBdtykRatJVSxKMjK9YlBXUZC4/YcNQfH7AxwVeQr9fNxPhw== +esbuild-linux-arm64@0.14.54: + version "0.14.54" + resolved "https://registry.yarnpkg.com/esbuild-linux-arm64/-/esbuild-linux-arm64-0.14.54.tgz#dae4cd42ae9787468b6a5c158da4c84e83b0ce8b" + integrity sha512-WL71L+0Rwv+Gv/HTmxTEmpv0UgmxYa5ftZILVi2QmZBgX3q7+tDeOQNqGtdXSdsL8TQi1vIaVFHUPDe0O0kdig== -esbuild-linux-mips64le@0.14.25: - version "0.14.25" - resolved "https://registry.yarnpkg.com/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.14.25.tgz#05f98a8cf6b578eab6b4e6b0ab094f37530934f4" - integrity sha512-wLWYyqVfYx9Ur6eU5RT92yJVsaBGi5RdkoWqRHOqcJ38Kn60QMlcghsKeWfe9jcYut8LangYZ98xO1LxIoSXrQ== +esbuild-linux-arm@0.14.54: + version "0.14.54" + resolved "https://registry.yarnpkg.com/esbuild-linux-arm/-/esbuild-linux-arm-0.14.54.tgz#a2c1dff6d0f21dbe8fc6998a122675533ddfcd59" + integrity sha512-qqz/SjemQhVMTnvcLGoLOdFpCYbz4v4fUo+TfsWG+1aOu70/80RV6bgNpR2JCrppV2moUQkww+6bWxXRL9YMGw== -esbuild-linux-ppc64le@0.14.25: - version "0.14.25" - resolved "https://registry.yarnpkg.com/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.14.25.tgz#46fd0add8d8535678439d7a9c2876ad20042d952" - integrity sha512-0dR6Csl6Zas3g4p9ULckEl8Mo8IInJh33VCJ3eaV1hj9+MHGdmDOakYMN8MZP9/5nl+NU/0ygpd14cWgy8uqRw== +esbuild-linux-mips64le@0.14.54: + version "0.14.54" + resolved "https://registry.yarnpkg.com/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.14.54.tgz#d9918e9e4cb972f8d6dae8e8655bf9ee131eda34" + integrity sha512-qTHGQB8D1etd0u1+sB6p0ikLKRVuCWhYQhAHRPkO+OF3I/iSlTKNNS0Lh2Oc0g0UFGguaFZZiPJdJey3AGpAlw== -esbuild-linux-riscv64@0.14.25: - version "0.14.25" - resolved "https://registry.yarnpkg.com/esbuild-linux-riscv64/-/esbuild-linux-riscv64-0.14.25.tgz#ea2e986f0f3e5df73c635135dd778051734fc605" - integrity sha512-J4d20HDmTrgvhR0bdkDhvvJGaikH3LzXQnNaseo8rcw9Yqby9A90gKUmWpfwqLVNRILvNnAmKLfBjCKU9ajg8w== +esbuild-linux-ppc64le@0.14.54: + version "0.14.54" + resolved "https://registry.yarnpkg.com/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.14.54.tgz#3f9a0f6d41073fb1a640680845c7de52995f137e" + integrity sha512-j3OMlzHiqwZBDPRCDFKcx595XVfOfOnv68Ax3U4UKZ3MTYQB5Yz3X1mn5GnodEVYzhtZgxEBidLWeIs8FDSfrQ== -esbuild-linux-s390x@0.14.25: - version "0.14.25" - resolved "https://registry.yarnpkg.com/esbuild-linux-s390x/-/esbuild-linux-s390x-0.14.25.tgz#efe89486e9a1b1508925048076e3f3a6698aa6a3" - integrity sha512-YI2d5V6nTE73ZnhEKQD7MtsPs1EtUZJ3obS21oxQxGbbRw1G+PtJKjNyur+3t6nzHP9oTg6GHQ3S3hOLLmbDIQ== +esbuild-linux-riscv64@0.14.54: + version "0.14.54" + resolved "https://registry.yarnpkg.com/esbuild-linux-riscv64/-/esbuild-linux-riscv64-0.14.54.tgz#618853c028178a61837bc799d2013d4695e451c8" + integrity sha512-y7Vt7Wl9dkOGZjxQZnDAqqn+XOqFD7IMWiewY5SPlNlzMX39ocPQlOaoxvT4FllA5viyV26/QzHtvTjVNOxHZg== -esbuild-netbsd-64@0.14.25: - version "0.14.25" - resolved "https://registry.yarnpkg.com/esbuild-netbsd-64/-/esbuild-netbsd-64-0.14.25.tgz#439fe27d8ee3b5887501ee63988e85f920107db6" - integrity sha512-TKIVgNWLUOkr+Exrye70XTEE1lJjdQXdM4tAXRzfHE9iBA7LXWcNtVIuSnphTqpanPzTDFarF0yqq4kpbC6miA== +esbuild-linux-s390x@0.14.54: + version "0.14.54" + resolved "https://registry.yarnpkg.com/esbuild-linux-s390x/-/esbuild-linux-s390x-0.14.54.tgz#d1885c4c5a76bbb5a0fe182e2c8c60eb9e29f2a6" + integrity sha512-zaHpW9dziAsi7lRcyV4r8dhfG1qBidQWUXweUjnw+lliChJqQr+6XD71K41oEIC3Mx1KStovEmlzm+MkGZHnHA== -esbuild-openbsd-64@0.14.25: - version "0.14.25" - resolved "https://registry.yarnpkg.com/esbuild-openbsd-64/-/esbuild-openbsd-64-0.14.25.tgz#31ebf616aadf6e60674469f2b92cec92280d9930" - integrity sha512-QgFJ37A15D7NIXBTYEqz29+uw3nNBOIyog+3kFidANn6kjw0GHZ0lEYQn+cwjyzu94WobR+fes7cTl/ZYlHb1A== +esbuild-netbsd-64@0.14.54: + version "0.14.54" + resolved "https://registry.yarnpkg.com/esbuild-netbsd-64/-/esbuild-netbsd-64-0.14.54.tgz#69ae917a2ff241b7df1dbf22baf04bd330349e81" + integrity sha512-PR01lmIMnfJTgeU9VJTDY9ZerDWVFIUzAtJuDHwwceppW7cQWjBBqP48NdeRtoP04/AtO9a7w3viI+PIDr6d+w== -esbuild-sunos-64@0.14.25: - version "0.14.25" - resolved "https://registry.yarnpkg.com/esbuild-sunos-64/-/esbuild-sunos-64-0.14.25.tgz#815e4f936d74970292a63ccfd5791fe5e3569f5f" - integrity sha512-rmWfjUItYIVlqr5EnTH1+GCxXiBOC42WBZ3w++qh7n2cS9Xo0lO5pGSG2N+huOU2fX5L+6YUuJ78/vOYvefeFw== +esbuild-openbsd-64@0.14.54: + version "0.14.54" + resolved "https://registry.yarnpkg.com/esbuild-openbsd-64/-/esbuild-openbsd-64-0.14.54.tgz#db4c8495287a350a6790de22edea247a57c5d47b" + integrity sha512-Qyk7ikT2o7Wu76UsvvDS5q0amJvmRzDyVlL0qf5VLsLchjCa1+IAvd8kTBgUxD7VBUUVgItLkk609ZHUc1oCaw== -esbuild-windows-32@0.14.25: - version "0.14.25" - resolved "https://registry.yarnpkg.com/esbuild-windows-32/-/esbuild-windows-32-0.14.25.tgz#189e14df2478f2c193c86968ab1fb54e1ceaafd2" - integrity sha512-HGAxVUofl3iUIz9W10Y9XKtD0bNsK9fBXv1D55N/ljNvkrAYcGB8YCm0v7DjlwtyS6ws3dkdQyXadbxkbzaKOA== +esbuild-sunos-64@0.14.54: + version "0.14.54" + resolved "https://registry.yarnpkg.com/esbuild-sunos-64/-/esbuild-sunos-64-0.14.54.tgz#54287ee3da73d3844b721c21bc80c1dc7e1bf7da" + integrity sha512-28GZ24KmMSeKi5ueWzMcco6EBHStL3B6ubM7M51RmPwXQGLe0teBGJocmWhgwccA1GeFXqxzILIxXpHbl9Q/Kw== -esbuild-windows-64@0.14.25: - version "0.14.25" - resolved "https://registry.yarnpkg.com/esbuild-windows-64/-/esbuild-windows-64-0.14.25.tgz#3d5fbfdc3856850bb47439299e3b60dd18be111f" - integrity sha512-TirEohRkfWU9hXLgoDxzhMQD1g8I2mOqvdQF2RS9E/wbkORTAqJHyh7wqGRCQAwNzdNXdg3JAyhQ9/177AadWA== +esbuild-windows-32@0.14.54: + version "0.14.54" + resolved "https://registry.yarnpkg.com/esbuild-windows-32/-/esbuild-windows-32-0.14.54.tgz#f8aaf9a5667630b40f0fb3aa37bf01bbd340ce31" + integrity sha512-T+rdZW19ql9MjS7pixmZYVObd9G7kcaZo+sETqNH4RCkuuYSuv9AGHUVnPoP9hhuE1WM1ZimHz1CIBHBboLU7w== -esbuild-windows-arm64@0.14.25: - version "0.14.25" - resolved "https://registry.yarnpkg.com/esbuild-windows-arm64/-/esbuild-windows-arm64-0.14.25.tgz#8b243cbbad8a86cf98697da9ccb88c05df2ef458" - integrity sha512-4ype9ERiI45rSh+R8qUoBtaj6kJvUOI7oVLhKqPEpcF4Pa5PpT3hm/mXAyotJHREkHpM87PAJcA442mLnbtlNA== +esbuild-windows-64@0.14.54: + version "0.14.54" + resolved "https://registry.yarnpkg.com/esbuild-windows-64/-/esbuild-windows-64-0.14.54.tgz#bf54b51bd3e9b0f1886ffdb224a4176031ea0af4" + integrity sha512-AoHTRBUuYwXtZhjXZbA1pGfTo8cJo3vZIcWGLiUcTNgHpJJMC1rVA44ZereBHMJtotyN71S8Qw0npiCIkW96cQ== -esbuild@^0.14.14: - version "0.14.25" - resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.14.25.tgz#ddb9d47b91ca76abb7d850ce3dfed0bc3dc88d16" - integrity sha512-4JHEIOMNFvK09ziiL+iVmldIhLbn49V4NAVo888tcGFKedEZY/Y8YapfStJ6zSE23tzYPKxqKwQBnQoIO0BI/Q== +esbuild-windows-arm64@0.14.54: + version "0.14.54" + resolved "https://registry.yarnpkg.com/esbuild-windows-arm64/-/esbuild-windows-arm64-0.14.54.tgz#937d15675a15e4b0e4fafdbaa3a01a776a2be982" + integrity sha512-M0kuUvXhot1zOISQGXwWn6YtS+Y/1RT9WrVIOywZnJHo3jCDyewAc79aKNQWFCQm+xNHVTq9h8dZKvygoXQQRg== + +esbuild@^0.14.47: + version "0.14.54" + resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.14.54.tgz#8b44dcf2b0f1a66fc22459943dccf477535e9aa2" + integrity sha512-Cy9llcy8DvET5uznocPyqL3BFRrFXSVqbgpMJ9Wz8oVjZlh/zUSNbPRbov0VX7VxN2JH1Oa0uNxZ7eLRb62pJA== optionalDependencies: - esbuild-android-64 "0.14.25" - esbuild-android-arm64 "0.14.25" - esbuild-darwin-64 "0.14.25" - esbuild-darwin-arm64 "0.14.25" - esbuild-freebsd-64 "0.14.25" - esbuild-freebsd-arm64 "0.14.25" - esbuild-linux-32 "0.14.25" - esbuild-linux-64 "0.14.25" - esbuild-linux-arm "0.14.25" - esbuild-linux-arm64 "0.14.25" - esbuild-linux-mips64le "0.14.25" - esbuild-linux-ppc64le "0.14.25" - esbuild-linux-riscv64 "0.14.25" - esbuild-linux-s390x "0.14.25" - esbuild-netbsd-64 "0.14.25" - esbuild-openbsd-64 "0.14.25" - esbuild-sunos-64 "0.14.25" - esbuild-windows-32 "0.14.25" - esbuild-windows-64 "0.14.25" - esbuild-windows-arm64 "0.14.25" + "@esbuild/linux-loong64" "0.14.54" + esbuild-android-64 "0.14.54" + esbuild-android-arm64 "0.14.54" + esbuild-darwin-64 "0.14.54" + esbuild-darwin-arm64 "0.14.54" + esbuild-freebsd-64 "0.14.54" + esbuild-freebsd-arm64 "0.14.54" + esbuild-linux-32 "0.14.54" + esbuild-linux-64 "0.14.54" + esbuild-linux-arm "0.14.54" + esbuild-linux-arm64 "0.14.54" + esbuild-linux-mips64le "0.14.54" + esbuild-linux-ppc64le "0.14.54" + esbuild-linux-riscv64 "0.14.54" + esbuild-linux-s390x "0.14.54" + esbuild-netbsd-64 "0.14.54" + esbuild-openbsd-64 "0.14.54" + esbuild-sunos-64 "0.14.54" + esbuild-windows-32 "0.14.54" + esbuild-windows-64 "0.14.54" + esbuild-windows-arm64 "0.14.54" estree-walker@^2.0.1: version "2.0.2" @@ -176,22 +188,22 @@ has@^1.0.3: dependencies: function-bind "^1.1.1" -is-core-module@^2.8.1: - version "2.8.1" - resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.8.1.tgz#f59fdfca701d5879d0a6b100a40aa1560ce27211" - integrity sha512-SdNCUs284hr40hFTFP6l0IfZ/RSrMXF3qgoRHd3/79unUTvrFO/JoXwkGm+5J/Oe3E/b5GsnG330uUNgRpu1PA== +is-core-module@^2.9.0: + version "2.10.0" + resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.10.0.tgz#9012ede0a91c69587e647514e1d5277019e728ed" + integrity sha512-Erxj2n/LDAZ7H8WNJXd9tw38GYM3dv8rk8Zcs+jJuxYTW7sozH+SS8NtrSjVL1/vpLvWi1hxy96IzjJ3EHTJJg== dependencies: has "^1.0.3" -kleur@^4.1.4: - version "4.1.4" - resolved "https://registry.yarnpkg.com/kleur/-/kleur-4.1.4.tgz#8c202987d7e577766d039a8cd461934c01cda04d" - integrity sha512-8QADVssbrFjivHWQU7KkMgptGTl6WAcSdlbBPY4uNF+mWr6DGcKrvY2w4FQJoXch7+fKMjj0dRrL75vk3k23OA== +kleur@^4.1.5: + version "4.1.5" + resolved "https://registry.yarnpkg.com/kleur/-/kleur-4.1.5.tgz#95106101795f7050c6c650f350c683febddb1780" + integrity sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ== -magic-string@^0.25.7: - version "0.25.9" - resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.25.9.tgz#de7f9faf91ef8a1c91d02c2e5314c8277dbcdd1c" - integrity sha512-RmF0AsMzgt25qzqqLc1+MbHmhdx0ojF2Fvs4XnOqz2ZOBXzzkEwc/dJQZCYHAn7v1jbVOjAZfK8msRn4BxO4VQ== +magic-string@^0.26.2: + version "0.26.3" + resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.26.3.tgz#25840b875140f7b4785ab06bddc384270b7dd452" + integrity sha512-u1Po0NDyFcwdg2nzHT88wSK0+Rih0N1M+Ph1Sp08k8yvFFU3KR72wryS7e1qMPJypt99WB7fIFVCA92mQrMjrg== dependencies: sourcemap-codec "^1.4.8" @@ -200,10 +212,10 @@ ms@2.1.2: resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== -nanoid@^3.3.1: - version "3.3.1" - resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.1.tgz#6347a18cac88af88f58af0b3594b723d5e99bb35" - integrity sha512-n6Vs/3KGyxPQd6uO0eH4Bv0ojGSUvuLlIHtC3Y0kEO23YRge8H9x1GCzLn28YX0H66pMkxuaeESFq4tKISKwdw== +nanoid@^3.3.4: + version "3.3.4" + resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.4.tgz#730b67e3cd09e2deacf03c027c81c9d9dbc5e8ab" + integrity sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw== path-parse@^1.0.7: version "1.0.7" @@ -220,28 +232,28 @@ picomatch@^2.2.2: resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== -postcss@^8.4.6: - version "8.4.8" - resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.8.tgz#dad963a76e82c081a0657d3a2f3602ce10c2e032" - integrity sha512-2tXEqGxrjvAO6U+CJzDL2Fk2kPHTv1jQsYkSoMeOis2SsYaXRO2COxTdQp99cYvif9JTXaAk9lYGc3VhJt7JPQ== +postcss@^8.4.16: + version "8.4.16" + resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.16.tgz#33a1d675fac39941f5f445db0de4db2b6e01d43c" + integrity sha512-ipHE1XBvKzm5xI7hiHCZJCSugxvsdq2mPnsq5+UF+VHCjiBvtDrlxJfMBToWaP9D5XlgNmcFGqoHmUn0EYEaRQ== dependencies: - nanoid "^3.3.1" + nanoid "^3.3.4" picocolors "^1.0.0" source-map-js "^1.0.2" -resolve@^1.22.0: - version "1.22.0" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.0.tgz#5e0b8c67c15df57a89bdbabe603a002f21731198" - integrity sha512-Hhtrw0nLeSrFQ7phPp4OOcVjLPIeMnRlr5mcnVuMe7M/7eBn98A3hmFRLoFo3DLZkivSYwhRUJTyPyWAk56WLw== +resolve@^1.22.1: + version "1.22.1" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.1.tgz#27cb2ebb53f91abb49470a928bba7558066ac177" + integrity sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw== dependencies: - is-core-module "^2.8.1" + is-core-module "^2.9.0" path-parse "^1.0.7" supports-preserve-symlinks-flag "^1.0.0" -rollup@^2.59.0: - version "2.70.0" - resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.70.0.tgz#17a92e5938e92a251b962352e904c9f558230ec7" - integrity sha512-iEzYw+syFxQ0X9RefVwhr8BA2TNJsTaX8L8dhyeyMECDbmiba+8UQzcu+xZdji0+JQ+s7kouQnw+9Oz5M19XKA== +"rollup@>=2.75.6 <2.77.0 || ~2.77.0": + version "2.77.3" + resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.77.3.tgz#8f00418d3a2740036e15deb653bed1a90ee0cc12" + integrity sha512-/qxNTG7FbmefJWoeeYJFbHehJ2HNWnjkAFRKzWN/45eNBBF/r8lo992CwcJXEzyVxs5FmfId+vTSTQDb+bxA+g== optionalDependencies: fsevents "~2.3.2" @@ -260,24 +272,24 @@ supports-preserve-symlinks-flag@^1.0.0: resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09" integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w== -svelte-hmr@^0.14.9: - version "0.14.11" - resolved "https://registry.yarnpkg.com/svelte-hmr/-/svelte-hmr-0.14.11.tgz#63d532dc9c2c849ab708592f034765fa2502e568" - integrity sha512-R9CVfX6DXxW1Kn45Jtmx+yUe+sPhrbYSUp7TkzbW0jI5fVPn6lsNG9NEs5dFg5qRhFNAoVdRw5qQDLALNKhwbQ== +svelte-hmr@^0.14.12: + version "0.14.12" + resolved "https://registry.yarnpkg.com/svelte-hmr/-/svelte-hmr-0.14.12.tgz#a127aec02f1896500b10148b2d4d21ddde39973f" + integrity sha512-4QSW/VvXuqVcFZ+RhxiR8/newmwOCTlbYIezvkeN6302YFRE8cXy0naamHcjz8Y9Ce3ITTZtrHrIL0AGfyo61w== -svelte@^3.46.3: - version "3.46.4" - resolved "https://registry.yarnpkg.com/svelte/-/svelte-3.46.4.tgz#0c46bc4a3e20a2617a1b7dc43a722f9d6c084a38" - integrity sha512-qKJzw6DpA33CIa+C/rGp4AUdSfii0DOTCzj/2YpSKKayw5WGSS624Et9L1nU1k2OVRS9vaENQXp2CVZNU+xvIg== +svelte@^3.50.0: + version "3.50.0" + resolved "https://registry.yarnpkg.com/svelte/-/svelte-3.50.0.tgz#d11a7a6bd1e084ec051d55104a9af8bccf54461f" + integrity sha512-zXeOUDS7+85i+RxLN+0iB6PMbGH7OhEgjETcD1fD8ZrhuhNFxYxYEHU41xuhkHIulJavcu3PKbPyuCrBxdxskQ== -vite@^2.7.11: - version "2.8.6" - resolved "https://registry.yarnpkg.com/vite/-/vite-2.8.6.tgz#32d50e23c99ca31b26b8ccdc78b1d72d4d7323d3" - integrity sha512-e4H0QpludOVKkmOsRyqQ7LTcMUDF3mcgyNU4lmi0B5JUbe0ZxeBBl8VoZ8Y6Rfn9eFKYtdXNPcYK97ZwH+K2ug== +vite@^3.0.9: + version "3.0.9" + resolved "https://registry.yarnpkg.com/vite/-/vite-3.0.9.tgz#45fac22c2a5290a970f23d66c1aef56a04be8a30" + integrity sha512-waYABTM+G6DBTCpYAxvevpG50UOlZuynR0ckTK5PawNVt7ebX6X7wNXHaGIO6wYYFXSM7/WcuFuO2QzhBB6aMw== dependencies: - esbuild "^0.14.14" - postcss "^8.4.6" - resolve "^1.22.0" - rollup "^2.59.0" + esbuild "^0.14.47" + postcss "^8.4.16" + resolve "^1.22.1" + rollup ">=2.75.6 <2.77.0 || ~2.77.0" optionalDependencies: fsevents "~2.3.2" From 3c176ff7af2889f26228476fd76a6b55a231786b Mon Sep 17 00:00:00 2001 From: lesion Date: Mon, 5 Sep 2022 11:42:47 +0200 Subject: [PATCH 05/16] improve datetime display in webcomponent --- webcomponents/src/GancioEvents.svelte | 457 ++++++++++++++------------ 1 file changed, 248 insertions(+), 209 deletions(-) diff --git a/webcomponents/src/GancioEvents.svelte b/webcomponents/src/GancioEvents.svelte index 7cbd9c70..6e3dc9a3 100644 --- a/webcomponents/src/GancioEvents.svelte +++ b/webcomponents/src/GancioEvents.svelte @@ -1,5 +1,6 @@ - - -{#if external_style}{/if} + +{#if external_style}{/if} {#if events.length} -
- {#if title && sidebar === 'true'} - -
-
{title}
- -
-
- {/if} - {#each events as event} - - {#if sidebar !== 'true'} -
- {#if event.media.length} - {event.media[0].name} - {:else} - {event.title} - {/if} -
- {/if} -
-
- {when(event.start_datetime)} +
+ {#if title && sidebar === 'true'} + +
+
{title}
+
-
- {event.title} -
- @{event.place.name} {event.place.address} - {#if event.tags.length} -
- +
+
+ {when(event)} +
+
+ {event.title} +
+ @{event.place.name} + {event.place.address} + {#if event.tags.length} +
+ {#each event.tags as tag} + #{tag} + {/each} +
+ {/if} +
+ {/each} -
+
{/if} + From e8ed2ec4b031ef273a0316538d487601b7ad86aa Mon Sep 17 00:00:00 2001 From: lesion Date: Mon, 5 Sep 2022 12:32:27 +0200 Subject: [PATCH 06/16] webcomponent datetime format helpers --- docs/assets/js/gancio-events.es.js | 1628 ++++++++----------------- server/helpers.js | 32 +- static/gancio-events.es.js | 1628 ++++++++----------------- webcomponents/src/GancioEvent.svelte | 144 +-- webcomponents/src/GancioEvents.svelte | 26 +- webcomponents/src/helpers.js | 24 + wp-plugin/js/gancio-events.es.js | 1628 ++++++++----------------- 7 files changed, 1685 insertions(+), 3425 deletions(-) create mode 100644 webcomponents/src/helpers.js diff --git a/docs/assets/js/gancio-events.es.js b/docs/assets/js/gancio-events.es.js index c1fe9753..35d91346 100644 --- a/docs/assets/js/gancio-events.es.js +++ b/docs/assets/js/gancio-events.es.js @@ -1,943 +1,504 @@ -function noop() { +function L() { } -function run(fn) { - return fn(); +function W(t) { + return t(); } -function blank_object() { +function ee() { return /* @__PURE__ */ Object.create(null); } -function run_all(fns) { - fns.forEach(run); +function O(t) { + t.forEach(W); } -function is_function(thing) { - return typeof thing === "function"; +function _e(t) { + return typeof t == "function"; } -function safe_not_equal(a, b) { - return a != a ? b == b : a !== b || (a && typeof a === "object" || typeof a === "function"); +function be(t, e) { + return t != t ? e == e : t !== e || t && typeof t == "object" || typeof t == "function"; } -let src_url_equal_anchor; -function src_url_equal(element_src, url) { - if (!src_url_equal_anchor) { - src_url_equal_anchor = document.createElement("a"); - } - src_url_equal_anchor.href = url; - return element_src === src_url_equal_anchor.href; +let B; +function G(t, e) { + return B || (B = document.createElement("a")), B.href = e, t === B.href; } -function is_empty(obj) { - return Object.keys(obj).length === 0; +function xe(t) { + return Object.keys(t).length === 0; } -function append(target, node) { - target.appendChild(node); +function u(t, e) { + t.appendChild(e); } -function insert(target, node, anchor) { - target.insertBefore(node, anchor || null); +function v(t, e, i) { + t.insertBefore(e, i || null); } -function detach(node) { - node.parentNode.removeChild(node); +function x(t) { + t.parentNode.removeChild(t); } -function destroy_each(iterations, detaching) { - for (let i = 0; i < iterations.length; i += 1) { - if (iterations[i]) - iterations[i].d(detaching); - } +function pe(t, e) { + for (let i = 0; i < t.length; i += 1) + t[i] && t[i].d(e); } -function element(name) { - return document.createElement(name); +function g(t) { + return document.createElement(t); } -function text(data) { - return document.createTextNode(data); +function j(t) { + return document.createTextNode(t); } -function space() { - return text(" "); +function z() { + return j(" "); } -function empty() { - return text(""); +function ve() { + return j(""); } -function attr(node, attribute, value) { - if (value == null) - node.removeAttribute(attribute); - else if (node.getAttribute(attribute) !== value) - node.setAttribute(attribute, value); +function a(t, e, i) { + i == null ? t.removeAttribute(e) : t.getAttribute(e) !== i && t.setAttribute(e, i); } -function children(element2) { - return Array.from(element2.childNodes); +function $e(t) { + return Array.from(t.childNodes); } -function set_data(text2, data) { - data = "" + data; - if (text2.wholeText !== data) - text2.data = data; +function N(t, e) { + e = "" + e, t.wholeText !== e && (t.data = e); } -function toggle_class(element2, name, toggle) { - element2.classList[toggle ? "add" : "remove"](name); +function T(t, e, i) { + t.classList[i ? "add" : "remove"](e); } -function attribute_to_object(attributes) { - const result = {}; - for (const attribute of attributes) { - result[attribute.name] = attribute.value; - } - return result; +function ke(t) { + const e = {}; + for (const i of t) + e[i.name] = i.value; + return e; } -let current_component; -function set_current_component(component) { - current_component = component; +let I; +function R(t) { + I = t; } -function get_current_component() { - if (!current_component) +function Ee() { + if (!I) throw new Error("Function called outside component initialization"); - return current_component; + return I; } -function onMount(fn) { - get_current_component().$$.on_mount.push(fn); +function we(t) { + Ee().$$.on_mount.push(t); } -const dirty_components = []; -const binding_callbacks = []; -const render_callbacks = []; -const flush_callbacks = []; -const resolved_promise = Promise.resolve(); -let update_scheduled = false; -function schedule_update() { - if (!update_scheduled) { - update_scheduled = true; - resolved_promise.then(flush); - } +const H = [], te = [], P = [], ie = [], je = Promise.resolve(); +let K = !1; +function Se() { + K || (K = !0, je.then(y)); } -function add_render_callback(fn) { - render_callbacks.push(fn); +function Q(t) { + P.push(t); } -const seen_callbacks = /* @__PURE__ */ new Set(); -let flushidx = 0; -function flush() { - const saved_component = current_component; +const J = /* @__PURE__ */ new Set(); +let D = 0; +function y() { + const t = I; do { - while (flushidx < dirty_components.length) { - const component = dirty_components[flushidx]; - flushidx++; - set_current_component(component); - update(component.$$); + for (; D < H.length; ) { + const e = H[D]; + D++, R(e), ze(e.$$); } - set_current_component(null); - dirty_components.length = 0; - flushidx = 0; - while (binding_callbacks.length) - binding_callbacks.pop()(); - for (let i = 0; i < render_callbacks.length; i += 1) { - const callback = render_callbacks[i]; - if (!seen_callbacks.has(callback)) { - seen_callbacks.add(callback); - callback(); - } + for (R(null), H.length = 0, D = 0; te.length; ) + te.pop()(); + for (let e = 0; e < P.length; e += 1) { + const i = P[e]; + J.has(i) || (J.add(i), i()); } - render_callbacks.length = 0; - } while (dirty_components.length); - while (flush_callbacks.length) { - flush_callbacks.pop()(); - } - update_scheduled = false; - seen_callbacks.clear(); - set_current_component(saved_component); + P.length = 0; + } while (H.length); + for (; ie.length; ) + ie.pop()(); + K = !1, J.clear(), R(t); } -function update($$) { - if ($$.fragment !== null) { - $$.update(); - run_all($$.before_update); - const dirty = $$.dirty; - $$.dirty = [-1]; - $$.fragment && $$.fragment.p($$.ctx, dirty); - $$.after_update.forEach(add_render_callback); +function ze(t) { + if (t.fragment !== null) { + t.update(), O(t.before_update); + const e = t.dirty; + t.dirty = [-1], t.fragment && t.fragment.p(t.ctx, e), t.after_update.forEach(Q); } } -const outroing = /* @__PURE__ */ new Set(); -function transition_in(block, local) { - if (block && block.i) { - outroing.delete(block); - block.i(local); - } +const Ce = /* @__PURE__ */ new Set(); +function Ae(t, e) { + t && t.i && (Ce.delete(t), t.i(e)); } -function mount_component(component, target, anchor, customElement) { - const { fragment, on_mount, on_destroy, after_update } = component.$$; - fragment && fragment.m(target, anchor); - if (!customElement) { - add_render_callback(() => { - const new_on_destroy = on_mount.map(run).filter(is_function); - if (on_destroy) { - on_destroy.push(...new_on_destroy); - } else { - run_all(new_on_destroy); - } - component.$$.on_mount = []; - }); - } - after_update.forEach(add_render_callback); +function Me(t, e, i, n) { + const { fragment: l, on_mount: o, on_destroy: r, after_update: f } = t.$$; + l && l.m(e, i), n || Q(() => { + const c = o.map(W).filter(_e); + r ? r.push(...c) : O(c), t.$$.on_mount = []; + }), f.forEach(Q); } -function destroy_component(component, detaching) { - const $$ = component.$$; - if ($$.fragment !== null) { - run_all($$.on_destroy); - $$.fragment && $$.fragment.d(detaching); - $$.on_destroy = $$.fragment = null; - $$.ctx = []; - } +function Ne(t, e) { + const i = t.$$; + i.fragment !== null && (O(i.on_destroy), i.fragment && i.fragment.d(e), i.on_destroy = i.fragment = null, i.ctx = []); } -function make_dirty(component, i) { - if (component.$$.dirty[0] === -1) { - dirty_components.push(component); - schedule_update(); - component.$$.dirty.fill(0); - } - component.$$.dirty[i / 31 | 0] |= 1 << i % 31; +function Te(t, e) { + t.$$.dirty[0] === -1 && (H.push(t), Se(), t.$$.dirty.fill(0)), t.$$.dirty[e / 31 | 0] |= 1 << e % 31; } -function init(component, options, instance2, create_fragment2, not_equal, props, append_styles, dirty = [-1]) { - const parent_component = current_component; - set_current_component(component); - const $$ = component.$$ = { +function ye(t, e, i, n, l, o, r, f = [-1]) { + const c = I; + R(t); + const s = t.$$ = { fragment: null, ctx: null, - props, - update: noop, - not_equal, - bound: blank_object(), + props: o, + update: L, + not_equal: l, + bound: ee(), on_mount: [], on_destroy: [], on_disconnect: [], before_update: [], after_update: [], - context: new Map(options.context || (parent_component ? parent_component.$$.context : [])), - callbacks: blank_object(), - dirty, - skip_bound: false, - root: options.target || parent_component.$$.root + context: new Map(e.context || (c ? c.$$.context : [])), + callbacks: ee(), + dirty: f, + skip_bound: !1, + root: e.target || c.$$.root }; - append_styles && append_styles($$.root); - let ready = false; - $$.ctx = instance2 ? instance2(component, options.props || {}, (i, ret, ...rest) => { - const value = rest.length ? rest[0] : ret; - if ($$.ctx && not_equal($$.ctx[i], $$.ctx[i] = value)) { - if (!$$.skip_bound && $$.bound[i]) - $$.bound[i](value); - if (ready) - make_dirty(component, i); - } - return ret; - }) : []; - $$.update(); - ready = true; - run_all($$.before_update); - $$.fragment = create_fragment2 ? create_fragment2($$.ctx) : false; - if (options.target) { - if (options.hydrate) { - const nodes = children(options.target); - $$.fragment && $$.fragment.l(nodes); - nodes.forEach(detach); - } else { - $$.fragment && $$.fragment.c(); - } - if (options.intro) - transition_in(component.$$.fragment); - mount_component(component, options.target, options.anchor, options.customElement); - flush(); + r && r(s.root); + let k = !1; + if (s.ctx = i ? i(t, e.props || {}, (m, _, ...C) => { + const w = C.length ? C[0] : _; + return s.ctx && l(s.ctx[m], s.ctx[m] = w) && (!s.skip_bound && s.bound[m] && s.bound[m](w), k && Te(t, m)), _; + }) : [], s.update(), k = !0, O(s.before_update), s.fragment = n ? n(s.ctx) : !1, e.target) { + if (e.hydrate) { + const m = $e(e.target); + s.fragment && s.fragment.l(m), m.forEach(x); + } else + s.fragment && s.fragment.c(); + e.intro && Ae(t.$$.fragment), Me(t, e.target, e.anchor, e.customElement), y(); } - set_current_component(parent_component); + R(c); } -let SvelteElement; -if (typeof HTMLElement === "function") { - SvelteElement = class extends HTMLElement { - constructor() { - super(); - this.attachShadow({ mode: "open" }); - } - connectedCallback() { - const { on_mount } = this.$$; - this.$$.on_disconnect = on_mount.map(run).filter(is_function); - for (const key in this.$$.slotted) { - this.appendChild(this.$$.slotted[key]); - } - } - attributeChangedCallback(attr2, _oldValue, newValue) { - this[attr2] = newValue; - } - disconnectedCallback() { - run_all(this.$$.on_disconnect); - } - $destroy() { - destroy_component(this, 1); - this.$destroy = noop; - } - $on(type, callback) { - const callbacks = this.$$.callbacks[type] || (this.$$.callbacks[type] = []); - callbacks.push(callback); - return () => { - const index = callbacks.indexOf(callback); - if (index !== -1) - callbacks.splice(index, 1); - }; - } - $set($$props) { - if (this.$$set && !is_empty($$props)) { - this.$$.skip_bound = true; - this.$$set($$props); - this.$$.skip_bound = false; - } - } - }; -} -function get_each_context(ctx, list, i) { - const child_ctx = ctx.slice(); - child_ctx[12] = list[i]; - return child_ctx; -} -function get_each_context_1(ctx, list, i) { - const child_ctx = ctx.slice(); - child_ctx[15] = list[i]; - return child_ctx; -} -function create_if_block_5(ctx) { - let link; - return { - c() { - link = element("link"); - attr(link, "rel", "stylesheet"); - attr(link, "href", ctx[4]); - }, - m(target, anchor) { - insert(target, link, anchor); - }, - p(ctx2, dirty) { - if (dirty & 16) { - attr(link, "href", ctx2[4]); - } - }, - d(detaching) { - if (detaching) - detach(link); - } - }; -} -function create_if_block$1(ctx) { - let div; - let t; - let if_block = ctx[1] && ctx[3] === "true" && create_if_block_4(ctx); - let each_value = ctx[5]; - let each_blocks = []; - for (let i = 0; i < each_value.length; i += 1) { - each_blocks[i] = create_each_block(get_each_context(ctx, each_value, i)); +let X; +typeof HTMLElement == "function" && (X = class extends HTMLElement { + constructor() { + super(), this.attachShadow({ mode: "open" }); } - return { - c() { - div = element("div"); - if (if_block) - if_block.c(); - t = space(); - for (let i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].c(); - } - attr(div, "id", "gancioEvents"); - toggle_class(div, "dark", ctx[2] === "dark"); - toggle_class(div, "light", ctx[2] === "light"); - toggle_class(div, "sidebar", ctx[3] === "true"); - toggle_class(div, "nosidebar", ctx[3] !== "true"); - }, - m(target, anchor) { - insert(target, div, anchor); - if (if_block) - if_block.m(div, null); - append(div, t); - for (let i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].m(div, null); - } - }, - p(ctx2, dirty) { - if (ctx2[1] && ctx2[3] === "true") { - if (if_block) { - if_block.p(ctx2, dirty); - } else { - if_block = create_if_block_4(ctx2); - if_block.c(); - if_block.m(div, t); - } - } else if (if_block) { - if_block.d(1); - if_block = null; - } - if (dirty & 41) { - each_value = ctx2[5]; - let i; - for (i = 0; i < each_value.length; i += 1) { - const child_ctx = get_each_context(ctx2, each_value, i); - if (each_blocks[i]) { - each_blocks[i].p(child_ctx, dirty); - } else { - each_blocks[i] = create_each_block(child_ctx); - each_blocks[i].c(); - each_blocks[i].m(div, null); - } - } - for (; i < each_blocks.length; i += 1) { - each_blocks[i].d(1); - } - each_blocks.length = each_value.length; - } - if (dirty & 4) { - toggle_class(div, "dark", ctx2[2] === "dark"); - } - if (dirty & 4) { - toggle_class(div, "light", ctx2[2] === "light"); - } - if (dirty & 8) { - toggle_class(div, "sidebar", ctx2[3] === "true"); - } - if (dirty & 8) { - toggle_class(div, "nosidebar", ctx2[3] !== "true"); - } - }, - d(detaching) { - if (detaching) - detach(div); - if (if_block) - if_block.d(); - destroy_each(each_blocks, detaching); - } - }; -} -function create_if_block_4(ctx) { - let a; - let div1; - let div0; - let t0; - let t1; - let img; - let img_src_value; - return { - c() { - a = element("a"); - div1 = element("div"); - div0 = element("div"); - t0 = text(ctx[1]); - t1 = space(); - img = element("img"); - attr(div0, "class", "title"); - attr(img, "id", "logo"); - attr(img, "alt", "logo"); - if (!src_url_equal(img.src, img_src_value = ctx[0] + "/logo.png")) - attr(img, "src", img_src_value); - attr(div1, "class", "content"); - attr(a, "href", ctx[0]); - attr(a, "target", "_blank"); - attr(a, "id", "header"); - }, - m(target, anchor) { - insert(target, a, anchor); - append(a, div1); - append(div1, div0); - append(div0, t0); - append(div1, t1); - append(div1, img); - }, - p(ctx2, dirty) { - if (dirty & 2) - set_data(t0, ctx2[1]); - if (dirty & 1 && !src_url_equal(img.src, img_src_value = ctx2[0] + "/logo.png")) { - attr(img, "src", img_src_value); - } - if (dirty & 1) { - attr(a, "href", ctx2[0]); - } - }, - d(detaching) { - if (detaching) - detach(a); - } - }; -} -function create_if_block_2(ctx) { - let div; - function select_block_type(ctx2, dirty) { - if (ctx2[12].media.length) - return create_if_block_3; - return create_else_block; + connectedCallback() { + const { on_mount: t } = this.$$; + this.$$.on_disconnect = t.map(W).filter(_e); + for (const e in this.$$.slotted) + this.appendChild(this.$$.slotted[e]); } - let current_block_type = select_block_type(ctx); - let if_block = current_block_type(ctx); - return { - c() { - div = element("div"); - if_block.c(); - attr(div, "class", "img"); - }, - m(target, anchor) { - insert(target, div, anchor); - if_block.m(div, null); - }, - p(ctx2, dirty) { - if (current_block_type === (current_block_type = select_block_type(ctx2)) && if_block) { - if_block.p(ctx2, dirty); - } else { - if_block.d(1); - if_block = current_block_type(ctx2); - if (if_block) { - if_block.c(); - if_block.m(div, null); - } - } - }, - d(detaching) { - if (detaching) - detach(div); - if_block.d(); - } - }; -} -function create_else_block(ctx) { - let img; - let img_alt_value; - let img_src_value; - return { - c() { - img = element("img"); - attr(img, "style", "aspect-ratio=1.7778;"); - attr(img, "alt", img_alt_value = ctx[12].title); - if (!src_url_equal(img.src, img_src_value = ctx[0] + "/noimg.svg")) - attr(img, "src", img_src_value); - attr(img, "loading", "lazy"); - }, - m(target, anchor) { - insert(target, img, anchor); - }, - p(ctx2, dirty) { - if (dirty & 32 && img_alt_value !== (img_alt_value = ctx2[12].title)) { - attr(img, "alt", img_alt_value); - } - if (dirty & 1 && !src_url_equal(img.src, img_src_value = ctx2[0] + "/noimg.svg")) { - attr(img, "src", img_src_value); - } - }, - d(detaching) { - if (detaching) - detach(img); - } - }; -} -function create_if_block_3(ctx) { - let img; - let img_style_value; - let img_alt_value; - let img_src_value; - return { - c() { - img = element("img"); - attr(img, "style", img_style_value = "object-position: " + position$1(ctx[12]) + "; aspect-ratio=1.7778;"); - attr(img, "alt", img_alt_value = ctx[12].media[0].name); - if (!src_url_equal(img.src, img_src_value = ctx[0] + "/media/thumb/" + ctx[12].media[0].url)) - attr(img, "src", img_src_value); - attr(img, "loading", "lazy"); - }, - m(target, anchor) { - insert(target, img, anchor); - }, - p(ctx2, dirty) { - if (dirty & 32 && img_style_value !== (img_style_value = "object-position: " + position$1(ctx2[12]) + "; aspect-ratio=1.7778;")) { - attr(img, "style", img_style_value); - } - if (dirty & 32 && img_alt_value !== (img_alt_value = ctx2[12].media[0].name)) { - attr(img, "alt", img_alt_value); - } - if (dirty & 33 && !src_url_equal(img.src, img_src_value = ctx2[0] + "/media/thumb/" + ctx2[12].media[0].url)) { - attr(img, "src", img_src_value); - } - }, - d(detaching) { - if (detaching) - detach(img); - } - }; -} -function create_if_block_1$1(ctx) { - let div; - let each_value_1 = ctx[12].tags; - let each_blocks = []; - for (let i = 0; i < each_value_1.length; i += 1) { - each_blocks[i] = create_each_block_1(get_each_context_1(ctx, each_value_1, i)); + attributeChangedCallback(t, e, i) { + this[t] = i; } - return { - c() { - div = element("div"); - for (let i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].c(); - } - attr(div, "class", "tags"); - }, - m(target, anchor) { - insert(target, div, anchor); - for (let i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].m(div, null); - } - }, - p(ctx2, dirty) { - if (dirty & 32) { - each_value_1 = ctx2[12].tags; - let i; - for (i = 0; i < each_value_1.length; i += 1) { - const child_ctx = get_each_context_1(ctx2, each_value_1, i); - if (each_blocks[i]) { - each_blocks[i].p(child_ctx, dirty); - } else { - each_blocks[i] = create_each_block_1(child_ctx); - each_blocks[i].c(); - each_blocks[i].m(div, null); - } - } - for (; i < each_blocks.length; i += 1) { - each_blocks[i].d(1); - } - each_blocks.length = each_value_1.length; - } - }, - d(detaching) { - if (detaching) - detach(div); - destroy_each(each_blocks, detaching); - } - }; -} -function create_each_block_1(ctx) { - let span; - let t0; - let t1_value = ctx[15] + ""; - let t1; - return { - c() { - span = element("span"); - t0 = text("#"); - t1 = text(t1_value); - attr(span, "class", "tag"); - }, - m(target, anchor) { - insert(target, span, anchor); - append(span, t0); - append(span, t1); - }, - p(ctx2, dirty) { - if (dirty & 32 && t1_value !== (t1_value = ctx2[15] + "")) - set_data(t1, t1_value); - }, - d(detaching) { - if (detaching) - detach(span); - } - }; -} -function create_each_block(ctx) { - let a; - let t0; - let div2; - let div0; - let t1_value = when$1(ctx[12].start_datetime) + ""; - let t1; - let t2; - let div1; - let t3_value = ctx[12].title + ""; - let t3; - let t4; - let span1; - let t5; - let t6_value = ctx[12].place.name + ""; - let t6; - let t7; - let span0; - let t8_value = ctx[12].place.address + ""; - let t8; - let t9; - let t10; - let a_href_value; - let a_title_value; - let if_block0 = ctx[3] !== "true" && create_if_block_2(ctx); - let if_block1 = ctx[12].tags.length && create_if_block_1$1(ctx); - return { - c() { - a = element("a"); - if (if_block0) - if_block0.c(); - t0 = space(); - div2 = element("div"); - div0 = element("div"); - t1 = text(t1_value); - t2 = space(); - div1 = element("div"); - t3 = text(t3_value); - t4 = space(); - span1 = element("span"); - t5 = text("@"); - t6 = text(t6_value); - t7 = space(); - span0 = element("span"); - t8 = text(t8_value); - t9 = space(); - if (if_block1) - if_block1.c(); - t10 = space(); - attr(div0, "class", "subtitle"); - attr(div1, "class", "title"); - attr(span0, "class", "subtitle"); - attr(span1, "class", "place"); - attr(div2, "class", "content"); - attr(a, "href", a_href_value = ctx[0] + "/event/" + (ctx[12].slug || ctx[12].id)); - attr(a, "class", "event"); - attr(a, "title", a_title_value = ctx[12].title); - attr(a, "target", "_blank"); - }, - m(target, anchor) { - insert(target, a, anchor); - if (if_block0) - if_block0.m(a, null); - append(a, t0); - append(a, div2); - append(div2, div0); - append(div0, t1); - append(div2, t2); - append(div2, div1); - append(div1, t3); - append(div2, t4); - append(div2, span1); - append(span1, t5); - append(span1, t6); - append(span1, t7); - append(span1, span0); - append(span0, t8); - append(div2, t9); - if (if_block1) - if_block1.m(div2, null); - append(a, t10); - }, - p(ctx2, dirty) { - if (ctx2[3] !== "true") { - if (if_block0) { - if_block0.p(ctx2, dirty); - } else { - if_block0 = create_if_block_2(ctx2); - if_block0.c(); - if_block0.m(a, t0); - } - } else if (if_block0) { - if_block0.d(1); - if_block0 = null; - } - if (dirty & 32 && t1_value !== (t1_value = when$1(ctx2[12].start_datetime) + "")) - set_data(t1, t1_value); - if (dirty & 32 && t3_value !== (t3_value = ctx2[12].title + "")) - set_data(t3, t3_value); - if (dirty & 32 && t6_value !== (t6_value = ctx2[12].place.name + "")) - set_data(t6, t6_value); - if (dirty & 32 && t8_value !== (t8_value = ctx2[12].place.address + "")) - set_data(t8, t8_value); - if (ctx2[12].tags.length) { - if (if_block1) { - if_block1.p(ctx2, dirty); - } else { - if_block1 = create_if_block_1$1(ctx2); - if_block1.c(); - if_block1.m(div2, null); - } - } else if (if_block1) { - if_block1.d(1); - if_block1 = null; - } - if (dirty & 33 && a_href_value !== (a_href_value = ctx2[0] + "/event/" + (ctx2[12].slug || ctx2[12].id))) { - attr(a, "href", a_href_value); - } - if (dirty & 32 && a_title_value !== (a_title_value = ctx2[12].title)) { - attr(a, "title", a_title_value); - } - }, - d(detaching) { - if (detaching) - detach(a); - if (if_block0) - if_block0.d(); - if (if_block1) - if_block1.d(); - } - }; -} -function create_fragment$1(ctx) { - let t; - let if_block1_anchor; - let if_block0 = ctx[4] && create_if_block_5(ctx); - let if_block1 = ctx[5].length && create_if_block$1(ctx); - return { - c() { - if (if_block0) - if_block0.c(); - t = space(); - if (if_block1) - if_block1.c(); - if_block1_anchor = empty(); - this.c = noop; - }, - m(target, anchor) { - if (if_block0) - if_block0.m(target, anchor); - insert(target, t, anchor); - if (if_block1) - if_block1.m(target, anchor); - insert(target, if_block1_anchor, anchor); - }, - p(ctx2, [dirty]) { - if (ctx2[4]) { - if (if_block0) { - if_block0.p(ctx2, dirty); - } else { - if_block0 = create_if_block_5(ctx2); - if_block0.c(); - if_block0.m(t.parentNode, t); - } - } else if (if_block0) { - if_block0.d(1); - if_block0 = null; - } - if (ctx2[5].length) { - if (if_block1) { - if_block1.p(ctx2, dirty); - } else { - if_block1 = create_if_block$1(ctx2); - if_block1.c(); - if_block1.m(if_block1_anchor.parentNode, if_block1_anchor); - } - } else if (if_block1) { - if_block1.d(1); - if_block1 = null; - } - }, - i: noop, - o: noop, - d(detaching) { - if (if_block0) - if_block0.d(detaching); - if (detaching) - detach(t); - if (if_block1) - if_block1.d(detaching); - if (detaching) - detach(if_block1_anchor); - } - }; -} -function position$1(event) { - if (event.media[0].focalpoint) { - const focalpoint = event.media[0].focalpoint; - return `${(focalpoint[0] + 1) * 50}% ${(focalpoint[1] + 1) * 50}%`; + disconnectedCallback() { + O(this.$$.on_disconnect); } - return "center center"; -} -function when$1(timestamp) { - return new Date(timestamp * 1e3).toLocaleDateString(void 0, { + $destroy() { + Ne(this, 1), this.$destroy = L; + } + $on(t, e) { + const i = this.$$.callbacks[t] || (this.$$.callbacks[t] = []); + return i.push(e), () => { + const n = i.indexOf(e); + n !== -1 && i.splice(n, 1); + }; + } + $set(t) { + this.$$set && !xe(t) && (this.$$.skip_bound = !0, this.$$set(t), this.$$.skip_bound = !1); + } +}); +function F(t, e = "long") { + const i = e === "long" ? { weekday: "long", month: "long", day: "numeric", hour: "2-digit", minute: "2-digit" - }); + } : { hour: "2-digit", minute: "2-digit" }; + return new Date(t * 1e3).toLocaleString(void 0, i); } -function instance$1($$self, $$props, $$invalidate) { - let { baseurl = "" } = $$props; - let { title = "" } = $$props; - let { maxlength = false } = $$props; - let { tags = "" } = $$props; - let { places = "" } = $$props; - let { theme = "light" } = $$props; - let { show_recurrent = false } = $$props; - let { sidebar = "true" } = $$props; - let { external_style = "" } = $$props; - let mounted = false; - let events = []; - function update2(v) { - if (!mounted) +function V(t) { + return t.multidate ? F(t.start_datetime) + " - " + F(t.end_datetime) : F(t.start_datetime) + (t.end_datetime ? "-" + F(t.end_datetime, "short") : ""); +} +function ne(t, e, i) { + const n = t.slice(); + return n[12] = e[i], n; +} +function le(t, e, i) { + const n = t.slice(); + return n[15] = e[i], n; +} +function re(t) { + let e; + return { + c() { + e = g("link"), a(e, "rel", "stylesheet"), a(e, "href", t[4]); + }, + m(i, n) { + v(i, e, n); + }, + p(i, n) { + n & 16 && a(e, "href", i[4]); + }, + d(i) { + i && x(e); + } + }; +} +function oe(t) { + let e, i, n = t[1] && t[3] === "true" && ae(t), l = t[5], o = []; + for (let r = 0; r < l.length; r += 1) + o[r] = ue(ne(t, l, r)); + return { + c() { + e = g("div"), n && n.c(), i = z(); + for (let r = 0; r < o.length; r += 1) + o[r].c(); + a(e, "id", "gancioEvents"), T(e, "dark", t[2] === "dark"), T(e, "light", t[2] === "light"), T(e, "sidebar", t[3] === "true"), T(e, "nosidebar", t[3] !== "true"); + }, + m(r, f) { + v(r, e, f), n && n.m(e, null), u(e, i); + for (let c = 0; c < o.length; c += 1) + o[c].m(e, null); + }, + p(r, f) { + if (r[1] && r[3] === "true" ? n ? n.p(r, f) : (n = ae(r), n.c(), n.m(e, i)) : n && (n.d(1), n = null), f & 41) { + l = r[5]; + let c; + for (c = 0; c < l.length; c += 1) { + const s = ne(r, l, c); + o[c] ? o[c].p(s, f) : (o[c] = ue(s), o[c].c(), o[c].m(e, null)); + } + for (; c < o.length; c += 1) + o[c].d(1); + o.length = l.length; + } + f & 4 && T(e, "dark", r[2] === "dark"), f & 4 && T(e, "light", r[2] === "light"), f & 8 && T(e, "sidebar", r[3] === "true"), f & 8 && T(e, "nosidebar", r[3] !== "true"); + }, + d(r) { + r && x(e), n && n.d(), pe(o, r); + } + }; +} +function ae(t) { + let e, i, n, l, o, r, f; + return { + c() { + e = g("a"), i = g("div"), n = g("div"), l = j(t[1]), o = z(), r = g("img"), a(n, "class", "title"), a(r, "id", "logo"), a(r, "alt", "logo"), G(r.src, f = t[0] + "/logo.png") || a(r, "src", f), a(i, "class", "content"), a(e, "href", t[0]), a(e, "target", "_blank"), a(e, "id", "header"); + }, + m(c, s) { + v(c, e, s), u(e, i), u(i, n), u(n, l), u(i, o), u(i, r); + }, + p(c, s) { + s & 2 && N(l, c[1]), s & 1 && !G(r.src, f = c[0] + "/logo.png") && a(r, "src", f), s & 1 && a(e, "href", c[0]); + }, + d(c) { + c && x(e); + } + }; +} +function se(t) { + let e; + function i(o, r) { + return o[12].media.length ? Ge : Le; + } + let n = i(t), l = n(t); + return { + c() { + e = g("div"), l.c(), a(e, "class", "img"); + }, + m(o, r) { + v(o, e, r), l.m(e, null); + }, + p(o, r) { + n === (n = i(o)) && l ? l.p(o, r) : (l.d(1), l = n(o), l && (l.c(), l.m(e, null))); + }, + d(o) { + o && x(e), l.d(); + } + }; +} +function Le(t) { + let e, i, n; + return { + c() { + e = g("img"), a(e, "style", "aspect-ratio=1.7778;"), a(e, "alt", i = t[12].title), G(e.src, n = t[0] + "/noimg.svg") || a(e, "src", n), a(e, "loading", "lazy"); + }, + m(l, o) { + v(l, e, o); + }, + p(l, o) { + o & 32 && i !== (i = l[12].title) && a(e, "alt", i), o & 1 && !G(e.src, n = l[0] + "/noimg.svg") && a(e, "src", n); + }, + d(l) { + l && x(e); + } + }; +} +function Ge(t) { + let e, i, n, l; + return { + c() { + e = g("img"), a(e, "style", i = "object-position: " + de(t[12]) + "; aspect-ratio=1.7778;"), a(e, "alt", n = t[12].media[0].name), G(e.src, l = t[0] + "/media/thumb/" + t[12].media[0].url) || a(e, "src", l), a(e, "loading", "lazy"); + }, + m(o, r) { + v(o, e, r); + }, + p(o, r) { + r & 32 && i !== (i = "object-position: " + de(o[12]) + "; aspect-ratio=1.7778;") && a(e, "style", i), r & 32 && n !== (n = o[12].media[0].name) && a(e, "alt", n), r & 33 && !G(e.src, l = o[0] + "/media/thumb/" + o[12].media[0].url) && a(e, "src", l); + }, + d(o) { + o && x(e); + } + }; +} +function ce(t) { + let e, i = t[12].tags, n = []; + for (let l = 0; l < i.length; l += 1) + n[l] = fe(le(t, i, l)); + return { + c() { + e = g("div"); + for (let l = 0; l < n.length; l += 1) + n[l].c(); + a(e, "class", "tags"); + }, + m(l, o) { + v(l, e, o); + for (let r = 0; r < n.length; r += 1) + n[r].m(e, null); + }, + p(l, o) { + if (o & 32) { + i = l[12].tags; + let r; + for (r = 0; r < i.length; r += 1) { + const f = le(l, i, r); + n[r] ? n[r].p(f, o) : (n[r] = fe(f), n[r].c(), n[r].m(e, null)); + } + for (; r < n.length; r += 1) + n[r].d(1); + n.length = i.length; + } + }, + d(l) { + l && x(e), pe(n, l); + } + }; +} +function fe(t) { + let e, i, n = t[15] + "", l; + return { + c() { + e = g("span"), i = j("#"), l = j(n), a(e, "class", "tag"); + }, + m(o, r) { + v(o, e, r), u(e, i), u(e, l); + }, + p(o, r) { + r & 32 && n !== (n = o[15] + "") && N(l, n); + }, + d(o) { + o && x(e); + } + }; +} +function ue(t) { + let e, i, n, l, o = V(t[12]) + "", r, f, c, s = t[12].title + "", k, m, _, C, w = t[12].place.name + "", d, S, h, b = t[12].place.address + "", A, Y, Z, U, q, $ = t[3] !== "true" && se(t), E = t[12].tags.length && ce(t); + return { + c() { + e = g("a"), $ && $.c(), i = z(), n = g("div"), l = g("div"), r = j(o), f = z(), c = g("div"), k = j(s), m = z(), _ = g("span"), C = j("@"), d = j(w), S = z(), h = g("span"), A = j(b), Y = z(), E && E.c(), Z = z(), a(l, "class", "subtitle"), a(c, "class", "title"), a(h, "class", "subtitle"), a(_, "class", "place"), a(n, "class", "content"), a(e, "href", U = t[0] + "/event/" + (t[12].slug || t[12].id)), a(e, "class", "event"), a(e, "title", q = t[12].title), a(e, "target", "_blank"); + }, + m(p, M) { + v(p, e, M), $ && $.m(e, null), u(e, i), u(e, n), u(n, l), u(l, r), u(n, f), u(n, c), u(c, k), u(n, m), u(n, _), u(_, C), u(_, d), u(_, S), u(_, h), u(h, A), u(n, Y), E && E.m(n, null), u(e, Z); + }, + p(p, M) { + p[3] !== "true" ? $ ? $.p(p, M) : ($ = se(p), $.c(), $.m(e, i)) : $ && ($.d(1), $ = null), M & 32 && o !== (o = V(p[12]) + "") && N(r, o), M & 32 && s !== (s = p[12].title + "") && N(k, s), M & 32 && w !== (w = p[12].place.name + "") && N(d, w), M & 32 && b !== (b = p[12].place.address + "") && N(A, b), p[12].tags.length ? E ? E.p(p, M) : (E = ce(p), E.c(), E.m(n, null)) : E && (E.d(1), E = null), M & 33 && U !== (U = p[0] + "/event/" + (p[12].slug || p[12].id)) && a(e, "href", U), M & 32 && q !== (q = p[12].title) && a(e, "title", q); + }, + d(p) { + p && x(e), $ && $.d(), E && E.d(); + } + }; +} +function He(t) { + let e, i, n = t[4] && re(t), l = t[5].length && oe(t); + return { + c() { + n && n.c(), e = z(), l && l.c(), i = ve(), this.c = L; + }, + m(o, r) { + n && n.m(o, r), v(o, e, r), l && l.m(o, r), v(o, i, r); + }, + p(o, [r]) { + o[4] ? n ? n.p(o, r) : (n = re(o), n.c(), n.m(e.parentNode, e)) : n && (n.d(1), n = null), o[5].length ? l ? l.p(o, r) : (l = oe(o), l.c(), l.m(i.parentNode, i)) : l && (l.d(1), l = null); + }, + i: L, + o: L, + d(o) { + n && n.d(o), o && x(e), l && l.d(o), o && x(i); + } + }; +} +function de(t) { + if (t.media && t.media[0].focalpoint) { + const e = t.media[0].focalpoint; + return `${(e[0] + 1) * 50}% ${(e[1] + 1) * 50}%`; + } + return "center center"; +} +function Re(t, e, i) { + let { baseurl: n = "" } = e, { title: l = "" } = e, { maxlength: o = !1 } = e, { tags: r = "" } = e, { places: f = "" } = e, { theme: c = "light" } = e, { show_recurrent: s = !1 } = e, { sidebar: k = "true" } = e, { external_style: m = "" } = e, _ = !1, C = []; + function w(d) { + if (!_) return; - const params = []; - if (maxlength) { - params.push(`max=${maxlength}`); - } - if (tags) { - params.push(`tags=${tags}`); - } - if (places) { - params.push(`places=${places}`); - } - params.push(`show_recurrent=${show_recurrent ? "true" : "false"}`); - fetch(`${baseurl}/api/events?${params.join("&")}`).then((res) => res.json()).then((e) => { - $$invalidate(5, events = e); - }).catch((e) => { - console.error("Error loading Gancio API -> ", e); + const S = []; + o && S.push(`max=${o}`), r && S.push(`tags=${r}`), f && S.push(`places=${f}`), S.push(`show_recurrent=${s ? "true" : "false"}`), fetch(`${n}/api/events?${S.join("&")}`).then((h) => h.json()).then((h) => { + i(5, C = h); + }).catch((h) => { + console.error("Error loading Gancio API -> ", h); }); } - onMount(() => { - mounted = true; - update2(); - }); - $$self.$$set = ($$props2) => { - if ("baseurl" in $$props2) - $$invalidate(0, baseurl = $$props2.baseurl); - if ("title" in $$props2) - $$invalidate(1, title = $$props2.title); - if ("maxlength" in $$props2) - $$invalidate(6, maxlength = $$props2.maxlength); - if ("tags" in $$props2) - $$invalidate(7, tags = $$props2.tags); - if ("places" in $$props2) - $$invalidate(8, places = $$props2.places); - if ("theme" in $$props2) - $$invalidate(2, theme = $$props2.theme); - if ("show_recurrent" in $$props2) - $$invalidate(9, show_recurrent = $$props2.show_recurrent); - if ("sidebar" in $$props2) - $$invalidate(3, sidebar = $$props2.sidebar); - if ("external_style" in $$props2) - $$invalidate(4, external_style = $$props2.external_style); - }; - $$self.$$.update = () => { - if ($$self.$$.dirty & 974) { - update2(); - } - }; - return [ - baseurl, - title, - theme, - sidebar, - external_style, - events, - maxlength, - tags, - places, - show_recurrent + return we(() => { + _ = !0, w(); + }), t.$$set = (d) => { + "baseurl" in d && i(0, n = d.baseurl), "title" in d && i(1, l = d.title), "maxlength" in d && i(6, o = d.maxlength), "tags" in d && i(7, r = d.tags), "places" in d && i(8, f = d.places), "theme" in d && i(2, c = d.theme), "show_recurrent" in d && i(9, s = d.show_recurrent), "sidebar" in d && i(3, k = d.sidebar), "external_style" in d && i(4, m = d.external_style); + }, t.$$.update = () => { + t.$$.dirty & 974 && w(); + }, [ + n, + l, + c, + k, + m, + C, + o, + r, + f, + s ]; } -class GancioEvents extends SvelteElement { - constructor(options) { - super(); - this.shadowRoot.innerHTML = ``; - init(this, { - target: this.shadowRoot, - props: attribute_to_object(this.attributes), - customElement: true - }, instance$1, create_fragment$1, safe_not_equal, { - baseurl: 0, - title: 1, - maxlength: 6, - tags: 7, - places: 8, - theme: 2, - show_recurrent: 9, - sidebar: 3, - external_style: 4 - }, null); - if (options) { - if (options.target) { - insert(options.target, this, options.anchor); - } - if (options.props) { - this.$set(options.props); - flush(); - } - } +class Ie extends X { + constructor(e) { + super(), this.shadowRoot.innerHTML = ``, ye( + this, + { + target: this.shadowRoot, + props: ke(this.attributes), + customElement: !0 + }, + Re, + He, + be, + { + baseurl: 0, + title: 1, + maxlength: 6, + tags: 7, + places: 8, + theme: 2, + show_recurrent: 9, + sidebar: 3, + external_style: 4 + }, + null + ), e && (e.target && v(e.target, this, e.anchor), e.props && (this.$set(e.props), y())); } static get observedAttributes() { return [ @@ -955,291 +516,152 @@ class GancioEvents extends SvelteElement { get baseurl() { return this.$$.ctx[0]; } - set baseurl(baseurl) { - this.$$set({ baseurl }); - flush(); + set baseurl(e) { + this.$$set({ baseurl: e }), y(); } get title() { return this.$$.ctx[1]; } - set title(title) { - this.$$set({ title }); - flush(); + set title(e) { + this.$$set({ title: e }), y(); } get maxlength() { return this.$$.ctx[6]; } - set maxlength(maxlength) { - this.$$set({ maxlength }); - flush(); + set maxlength(e) { + this.$$set({ maxlength: e }), y(); } get tags() { return this.$$.ctx[7]; } - set tags(tags) { - this.$$set({ tags }); - flush(); + set tags(e) { + this.$$set({ tags: e }), y(); } get places() { return this.$$.ctx[8]; } - set places(places) { - this.$$set({ places }); - flush(); + set places(e) { + this.$$set({ places: e }), y(); } get theme() { return this.$$.ctx[2]; } - set theme(theme) { - this.$$set({ theme }); - flush(); + set theme(e) { + this.$$set({ theme: e }), y(); } get show_recurrent() { return this.$$.ctx[9]; } - set show_recurrent(show_recurrent) { - this.$$set({ show_recurrent }); - flush(); + set show_recurrent(e) { + this.$$set({ show_recurrent: e }), y(); } get sidebar() { return this.$$.ctx[3]; } - set sidebar(sidebar) { - this.$$set({ sidebar }); - flush(); + set sidebar(e) { + this.$$set({ sidebar: e }), y(); } get external_style() { return this.$$.ctx[4]; } - set external_style(external_style) { - this.$$set({ external_style }); - flush(); + set external_style(e) { + this.$$set({ external_style: e }), y(); } } -customElements.define("gancio-events", GancioEvents); -function create_if_block(ctx) { - let a; - let t0; - let div2; - let strong; - let t1_value = ctx[1].title + ""; - let t1; - let t2; - let div0; - let t3_value = when(ctx[1]) + ""; - let t3; - let t4; - let div1; - let t5; - let t6_value = ctx[1].place.name + ""; - let t6; - let a_href_value; - let if_block = ctx[1].media.length && create_if_block_1(ctx); +customElements.define("gancio-events", Ie); +function he(t) { + let e, i, n, l, o = t[1].title + "", r, f, c, s = V(t[1]) + "", k, m, _, C, w = t[1].place.name + "", d, S, h = t[1].media.length && ge(t); return { c() { - a = element("a"); - if (if_block) - if_block.c(); - t0 = space(); - div2 = element("div"); - strong = element("strong"); - t1 = text(t1_value); - t2 = space(); - div0 = element("div"); - t3 = text(t3_value); - t4 = space(); - div1 = element("div"); - t5 = text("@"); - t6 = text(t6_value); - attr(div1, "class", "place"); - attr(div2, "class", "container"); - attr(a, "href", a_href_value = ctx[0] + "/event/" + (ctx[1].slug || ctx[1].id)); - attr(a, "class", "card"); - attr(a, "target", "_blank"); + e = g("a"), h && h.c(), i = z(), n = g("div"), l = g("strong"), r = j(o), f = z(), c = g("div"), k = j(s), m = z(), _ = g("div"), C = j("@"), d = j(w), a(_, "class", "place"), a(n, "class", "container"), a(e, "href", S = t[0] + "/event/" + (t[1].slug || t[1].id)), a(e, "class", "card"), a(e, "target", "_blank"); }, - m(target, anchor) { - insert(target, a, anchor); - if (if_block) - if_block.m(a, null); - append(a, t0); - append(a, div2); - append(div2, strong); - append(strong, t1); - append(div2, t2); - append(div2, div0); - append(div0, t3); - append(div2, t4); - append(div2, div1); - append(div1, t5); - append(div1, t6); + m(b, A) { + v(b, e, A), h && h.m(e, null), u(e, i), u(e, n), u(n, l), u(l, r), u(n, f), u(n, c), u(c, k), u(n, m), u(n, _), u(_, C), u(_, d); }, - p(ctx2, dirty) { - if (ctx2[1].media.length) { - if (if_block) { - if_block.p(ctx2, dirty); - } else { - if_block = create_if_block_1(ctx2); - if_block.c(); - if_block.m(a, t0); - } - } else if (if_block) { - if_block.d(1); - if_block = null; - } - if (dirty & 2 && t1_value !== (t1_value = ctx2[1].title + "")) - set_data(t1, t1_value); - if (dirty & 2 && t3_value !== (t3_value = when(ctx2[1]) + "")) - set_data(t3, t3_value); - if (dirty & 2 && t6_value !== (t6_value = ctx2[1].place.name + "")) - set_data(t6, t6_value); - if (dirty & 3 && a_href_value !== (a_href_value = ctx2[0] + "/event/" + (ctx2[1].slug || ctx2[1].id))) { - attr(a, "href", a_href_value); - } + p(b, A) { + b[1].media.length ? h ? h.p(b, A) : (h = ge(b), h.c(), h.m(e, i)) : h && (h.d(1), h = null), A & 2 && o !== (o = b[1].title + "") && N(r, o), A & 2 && s !== (s = V(b[1]) + "") && N(k, s), A & 2 && w !== (w = b[1].place.name + "") && N(d, w), A & 3 && S !== (S = b[0] + "/event/" + (b[1].slug || b[1].id)) && a(e, "href", S); }, - d(detaching) { - if (detaching) - detach(a); - if (if_block) - if_block.d(); + d(b) { + b && x(e), h && h.d(); } }; } -function create_if_block_1(ctx) { - let img; - let img_src_value; - let img_alt_value; - let img_style_value; +function ge(t) { + let e, i, n, l; return { c() { - img = element("img"); - if (!src_url_equal(img.src, img_src_value = ctx[2](ctx[1]))) - attr(img, "src", img_src_value); - attr(img, "alt", img_alt_value = ctx[1].media[0].name); - attr(img, "style", img_style_value = "object-position: " + position(ctx[1]) + "; aspect-ratio=1.7778;"); + e = g("img"), G(e.src, i = t[2](t[1])) || a(e, "src", i), a(e, "alt", n = t[1].media[0].name), a(e, "style", l = "object-position: " + me(t[1]) + "; aspect-ratio=1.7778;"); }, - m(target, anchor) { - insert(target, img, anchor); + m(o, r) { + v(o, e, r); }, - p(ctx2, dirty) { - if (dirty & 2 && !src_url_equal(img.src, img_src_value = ctx2[2](ctx2[1]))) { - attr(img, "src", img_src_value); - } - if (dirty & 2 && img_alt_value !== (img_alt_value = ctx2[1].media[0].name)) { - attr(img, "alt", img_alt_value); - } - if (dirty & 2 && img_style_value !== (img_style_value = "object-position: " + position(ctx2[1]) + "; aspect-ratio=1.7778;")) { - attr(img, "style", img_style_value); - } + p(o, r) { + r & 2 && !G(e.src, i = o[2](o[1])) && a(e, "src", i), r & 2 && n !== (n = o[1].media[0].name) && a(e, "alt", n), r & 2 && l !== (l = "object-position: " + me(o[1]) + "; aspect-ratio=1.7778;") && a(e, "style", l); }, - d(detaching) { - if (detaching) - detach(img); + d(o) { + o && x(e); } }; } -function create_fragment(ctx) { - let if_block_anchor; - let if_block = ctx[1] && create_if_block(ctx); +function Oe(t) { + let e, i = t[1] && he(t); return { c() { - if (if_block) - if_block.c(); - if_block_anchor = empty(); - this.c = noop; + i && i.c(), e = ve(), this.c = L; }, - m(target, anchor) { - if (if_block) - if_block.m(target, anchor); - insert(target, if_block_anchor, anchor); + m(n, l) { + i && i.m(n, l), v(n, e, l); }, - p(ctx2, [dirty]) { - if (ctx2[1]) { - if (if_block) { - if_block.p(ctx2, dirty); - } else { - if_block = create_if_block(ctx2); - if_block.c(); - if_block.m(if_block_anchor.parentNode, if_block_anchor); - } - } else if (if_block) { - if_block.d(1); - if_block = null; - } + p(n, [l]) { + n[1] ? i ? i.p(n, l) : (i = he(n), i.c(), i.m(e.parentNode, e)) : i && (i.d(1), i = null); }, - i: noop, - o: noop, - d(detaching) { - if (if_block) - if_block.d(detaching); - if (detaching) - detach(if_block_anchor); + i: L, + o: L, + d(n) { + i && i.d(n), n && x(e); } }; } -function when(event) { - return new Date(event.start_datetime * 1e3).toLocaleDateString(void 0, { - weekday: "long", - month: "short", - day: "numeric", - hour: "2-digit", - minute: "2-digit" - }); -} -function position(event) { - if (event.media[0].focalpoint) { - const focalpoint = event.media[0].focalpoint; - return `${(focalpoint[0] + 1) * 50}% ${(focalpoint[1] + 1) * 50}%`; +function me(t) { + if (t.media[0].focalpoint) { + const e = t.media[0].focalpoint; + return `${(e[0] + 1) * 50}% ${(e[1] + 1) * 50}%`; } return "center center"; } -function instance($$self, $$props, $$invalidate) { - let { baseurl = "https://demo.gancio.org" } = $$props; - let { id } = $$props; - let mounted = false; - let event; - function update2(id2, baseurl2) { - if (mounted) { - fetch(`${baseurl2}/api/event/${id2}`).then((res) => res.json()).then((e) => $$invalidate(1, event = e)); - } +function Ue(t, e, i) { + let { baseurl: n = "https://demo.gancio.org" } = e, { id: l } = e, o = !1, r; + function f(s, k) { + o && fetch(`${k}/api/event/${s}`).then((m) => m.json()).then((m) => i(1, r = m)); } - onMount(() => { - mounted = true; - update2(id, baseurl); + we(() => { + o = !0, f(l, n); }); - function thumbnail(event2) { - return `${baseurl}/media/thumb/${event2.media[0].url}`; + function c(s) { + return `${n}/media/thumb/${s.media[0].url}`; } - $$self.$$set = ($$props2) => { - if ("baseurl" in $$props2) - $$invalidate(0, baseurl = $$props2.baseurl); - if ("id" in $$props2) - $$invalidate(3, id = $$props2.id); - }; - $$self.$$.update = () => { - if ($$self.$$.dirty & 9) { - update2(id, baseurl); - } - }; - return [baseurl, event, thumbnail, id]; + return t.$$set = (s) => { + "baseurl" in s && i(0, n = s.baseurl), "id" in s && i(3, l = s.id); + }, t.$$.update = () => { + t.$$.dirty & 9 && f(l, n); + }, [n, r, c, l]; } -class GancioEvent extends SvelteElement { - constructor(options) { - super(); - this.shadowRoot.innerHTML = ``; - init(this, { - target: this.shadowRoot, - props: attribute_to_object(this.attributes), - customElement: true - }, instance, create_fragment, safe_not_equal, { baseurl: 0, id: 3 }, null); - if (options) { - if (options.target) { - insert(options.target, this, options.anchor); - } - if (options.props) { - this.$set(options.props); - flush(); - } - } +class qe extends X { + constructor(e) { + super(), this.shadowRoot.innerHTML = ``, ye( + this, + { + target: this.shadowRoot, + props: ke(this.attributes), + customElement: !0 + }, + Ue, + Oe, + be, + { baseurl: 0, id: 3 }, + null + ), e && (e.target && v(e.target, this, e.anchor), e.props && (this.$set(e.props), y())); } static get observedAttributes() { return ["baseurl", "id"]; @@ -1247,16 +669,14 @@ class GancioEvent extends SvelteElement { get baseurl() { return this.$$.ctx[0]; } - set baseurl(baseurl) { - this.$$set({ baseurl }); - flush(); + set baseurl(e) { + this.$$set({ baseurl: e }), y(); } get id() { return this.$$.ctx[3]; } - set id(id) { - this.$$set({ id }); - flush(); + set id(e) { + this.$$set({ id: e }), y(); } } -customElements.define("gancio-event", GancioEvent); +customElements.define("gancio-event", qe); diff --git a/server/helpers.js b/server/helpers.js index 86e42adb..1af57593 100644 --- a/server/helpers.js +++ b/server/helpers.js @@ -48,14 +48,14 @@ domPurify.addHook('beforeSanitizeElements', node => { module.exports = { - randomString (length = 12) { + randomString(length = 12) { const wishlist = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz' return Array.from(crypto.randomFillSync(new Uint32Array(length))) .map(x => wishlist[x % wishlist.length]) .join('') }, - sanitizeHTML (html) { + sanitizeHTML(html) { return domPurify.sanitize(html, { ALLOWED_TAGS: ['p', 'h1', 'h2', 'h3', 'h4', 'h5', 'br', 'i', 'span', 'h6', 'b', 'a', 'li', 'ul', 'ol', 'code', 'blockquote', 'u', 's', 'strong'], @@ -63,7 +63,7 @@ module.exports = { }) }, - async setUserLocale (req, res, next) { + async setUserLocale(req, res, next) { // select locale based on cookie? and accept-language header acceptLanguage.languages(Object.keys(locales)) res.locals.acceptedLocale = acceptLanguage.get(req.headers['accept-language']) @@ -71,7 +71,7 @@ module.exports = { next() }, - async initSettings (_req, res, next) { + async initSettings(_req, res, next) { // initialize settings res.locals.settings = cloneDeep(settingsController.settings) delete res.locals.settings.smtp @@ -87,12 +87,12 @@ module.exports = { next() }, - serveStatic () { + serveStatic() { const router = express.Router() // serve images/thumb - router.use('/media/', express.static(config.upload_path, { immutable: true, maxAge: '1y' } ), (_req, res) => res.sendStatus(404)) + router.use('/media/', express.static(config.upload_path, { immutable: true, maxAge: '1y' }), (_req, res) => res.sendStatus(404)) router.use('/noimg.svg', express.static('./static/noimg.svg')) - + router.use('/logo.png', (req, res, next) => { const logoPath = res.locals.settings.logo || './static/gancio' return express.static(logoPath + '.png')(req, res, next) @@ -106,12 +106,12 @@ module.exports = { return router }, - logRequest (req, _res, next) { + logRequest(req, _res, next) { log.debug(`${req.method} ${req.path}`) next() }, - col (field) { + col(field) { if (config.db.dialect === 'postgres') { return '"' + field.split('.').join('"."') + '"' } else if (config.db.dialect === 'mariadb') { @@ -121,14 +121,14 @@ module.exports = { } }, - async getImageFromURL (url) { + async getImageFromURL(url) { log.debug(`getImageFromURL ${url}`) const filename = crypto.randomBytes(16).toString('hex') const sharpStream = sharp({ failOnError: true }) const promises = [ sharpStream.clone().resize(500, null, { withoutEnlargement: true }).jpeg({ effort: 6, mozjpeg: true }).toFile(path.resolve(config.upload_path, 'thumb', filename + '.jpg')), - sharpStream.clone().resize(1200, null, { withoutEnlargement: true } ).jpeg({ quality: 95, effort: 6, mozjpeg: true}).toFile(path.resolve(config.upload_path, filename + '.jpg')), + sharpStream.clone().resize(1200, null, { withoutEnlargement: true }).jpeg({ quality: 95, effort: 6, mozjpeg: true }).toFile(path.resolve(config.upload_path, filename + '.jpg')), ] const response = await axios({ method: 'GET', url: encodeURI(url), responseType: 'stream' }) @@ -157,7 +157,7 @@ module.exports = { * Import events from url * It does supports ICS and H-EVENT */ - async importURL (req, res) { + async importURL(req, res) { const URL = req.query.URL try { const response = await axios.get(URL) @@ -210,7 +210,7 @@ module.exports = { } }, - getWeekdayN (date, n, weekday) { + getWeekdayN(date, n, weekday) { let cursor if (n === -1) { cursor = date.endOf('month') @@ -227,8 +227,8 @@ module.exports = { log.debug(cursor) return cursor }, - - async APRedirect (req, res, next) { + + async APRedirect(req, res, next) { const acceptJson = req.accepts('html', 'application/activity+json') === 'application/activity+json' if (acceptJson) { const eventController = require('../server/api/controller/event') @@ -240,7 +240,7 @@ module.exports = { next() }, - async feedRedirect (req, res, next) { + async feedRedirect(req, res, next) { const accepted = req.accepts('html', 'application/rss+xml', 'text/calendar') if (['application/rss+xml', 'text/calendar'].includes(accepted) && /^\/(tag|place|collection)\/.*/.test(req.path)) { return res.redirect((accepted === 'application/rss+xml' ? '/feed/rss' : '/feed/ics') + req.path) diff --git a/static/gancio-events.es.js b/static/gancio-events.es.js index c1fe9753..35d91346 100644 --- a/static/gancio-events.es.js +++ b/static/gancio-events.es.js @@ -1,943 +1,504 @@ -function noop() { +function L() { } -function run(fn) { - return fn(); +function W(t) { + return t(); } -function blank_object() { +function ee() { return /* @__PURE__ */ Object.create(null); } -function run_all(fns) { - fns.forEach(run); +function O(t) { + t.forEach(W); } -function is_function(thing) { - return typeof thing === "function"; +function _e(t) { + return typeof t == "function"; } -function safe_not_equal(a, b) { - return a != a ? b == b : a !== b || (a && typeof a === "object" || typeof a === "function"); +function be(t, e) { + return t != t ? e == e : t !== e || t && typeof t == "object" || typeof t == "function"; } -let src_url_equal_anchor; -function src_url_equal(element_src, url) { - if (!src_url_equal_anchor) { - src_url_equal_anchor = document.createElement("a"); - } - src_url_equal_anchor.href = url; - return element_src === src_url_equal_anchor.href; +let B; +function G(t, e) { + return B || (B = document.createElement("a")), B.href = e, t === B.href; } -function is_empty(obj) { - return Object.keys(obj).length === 0; +function xe(t) { + return Object.keys(t).length === 0; } -function append(target, node) { - target.appendChild(node); +function u(t, e) { + t.appendChild(e); } -function insert(target, node, anchor) { - target.insertBefore(node, anchor || null); +function v(t, e, i) { + t.insertBefore(e, i || null); } -function detach(node) { - node.parentNode.removeChild(node); +function x(t) { + t.parentNode.removeChild(t); } -function destroy_each(iterations, detaching) { - for (let i = 0; i < iterations.length; i += 1) { - if (iterations[i]) - iterations[i].d(detaching); - } +function pe(t, e) { + for (let i = 0; i < t.length; i += 1) + t[i] && t[i].d(e); } -function element(name) { - return document.createElement(name); +function g(t) { + return document.createElement(t); } -function text(data) { - return document.createTextNode(data); +function j(t) { + return document.createTextNode(t); } -function space() { - return text(" "); +function z() { + return j(" "); } -function empty() { - return text(""); +function ve() { + return j(""); } -function attr(node, attribute, value) { - if (value == null) - node.removeAttribute(attribute); - else if (node.getAttribute(attribute) !== value) - node.setAttribute(attribute, value); +function a(t, e, i) { + i == null ? t.removeAttribute(e) : t.getAttribute(e) !== i && t.setAttribute(e, i); } -function children(element2) { - return Array.from(element2.childNodes); +function $e(t) { + return Array.from(t.childNodes); } -function set_data(text2, data) { - data = "" + data; - if (text2.wholeText !== data) - text2.data = data; +function N(t, e) { + e = "" + e, t.wholeText !== e && (t.data = e); } -function toggle_class(element2, name, toggle) { - element2.classList[toggle ? "add" : "remove"](name); +function T(t, e, i) { + t.classList[i ? "add" : "remove"](e); } -function attribute_to_object(attributes) { - const result = {}; - for (const attribute of attributes) { - result[attribute.name] = attribute.value; - } - return result; +function ke(t) { + const e = {}; + for (const i of t) + e[i.name] = i.value; + return e; } -let current_component; -function set_current_component(component) { - current_component = component; +let I; +function R(t) { + I = t; } -function get_current_component() { - if (!current_component) +function Ee() { + if (!I) throw new Error("Function called outside component initialization"); - return current_component; + return I; } -function onMount(fn) { - get_current_component().$$.on_mount.push(fn); +function we(t) { + Ee().$$.on_mount.push(t); } -const dirty_components = []; -const binding_callbacks = []; -const render_callbacks = []; -const flush_callbacks = []; -const resolved_promise = Promise.resolve(); -let update_scheduled = false; -function schedule_update() { - if (!update_scheduled) { - update_scheduled = true; - resolved_promise.then(flush); - } +const H = [], te = [], P = [], ie = [], je = Promise.resolve(); +let K = !1; +function Se() { + K || (K = !0, je.then(y)); } -function add_render_callback(fn) { - render_callbacks.push(fn); +function Q(t) { + P.push(t); } -const seen_callbacks = /* @__PURE__ */ new Set(); -let flushidx = 0; -function flush() { - const saved_component = current_component; +const J = /* @__PURE__ */ new Set(); +let D = 0; +function y() { + const t = I; do { - while (flushidx < dirty_components.length) { - const component = dirty_components[flushidx]; - flushidx++; - set_current_component(component); - update(component.$$); + for (; D < H.length; ) { + const e = H[D]; + D++, R(e), ze(e.$$); } - set_current_component(null); - dirty_components.length = 0; - flushidx = 0; - while (binding_callbacks.length) - binding_callbacks.pop()(); - for (let i = 0; i < render_callbacks.length; i += 1) { - const callback = render_callbacks[i]; - if (!seen_callbacks.has(callback)) { - seen_callbacks.add(callback); - callback(); - } + for (R(null), H.length = 0, D = 0; te.length; ) + te.pop()(); + for (let e = 0; e < P.length; e += 1) { + const i = P[e]; + J.has(i) || (J.add(i), i()); } - render_callbacks.length = 0; - } while (dirty_components.length); - while (flush_callbacks.length) { - flush_callbacks.pop()(); - } - update_scheduled = false; - seen_callbacks.clear(); - set_current_component(saved_component); + P.length = 0; + } while (H.length); + for (; ie.length; ) + ie.pop()(); + K = !1, J.clear(), R(t); } -function update($$) { - if ($$.fragment !== null) { - $$.update(); - run_all($$.before_update); - const dirty = $$.dirty; - $$.dirty = [-1]; - $$.fragment && $$.fragment.p($$.ctx, dirty); - $$.after_update.forEach(add_render_callback); +function ze(t) { + if (t.fragment !== null) { + t.update(), O(t.before_update); + const e = t.dirty; + t.dirty = [-1], t.fragment && t.fragment.p(t.ctx, e), t.after_update.forEach(Q); } } -const outroing = /* @__PURE__ */ new Set(); -function transition_in(block, local) { - if (block && block.i) { - outroing.delete(block); - block.i(local); - } +const Ce = /* @__PURE__ */ new Set(); +function Ae(t, e) { + t && t.i && (Ce.delete(t), t.i(e)); } -function mount_component(component, target, anchor, customElement) { - const { fragment, on_mount, on_destroy, after_update } = component.$$; - fragment && fragment.m(target, anchor); - if (!customElement) { - add_render_callback(() => { - const new_on_destroy = on_mount.map(run).filter(is_function); - if (on_destroy) { - on_destroy.push(...new_on_destroy); - } else { - run_all(new_on_destroy); - } - component.$$.on_mount = []; - }); - } - after_update.forEach(add_render_callback); +function Me(t, e, i, n) { + const { fragment: l, on_mount: o, on_destroy: r, after_update: f } = t.$$; + l && l.m(e, i), n || Q(() => { + const c = o.map(W).filter(_e); + r ? r.push(...c) : O(c), t.$$.on_mount = []; + }), f.forEach(Q); } -function destroy_component(component, detaching) { - const $$ = component.$$; - if ($$.fragment !== null) { - run_all($$.on_destroy); - $$.fragment && $$.fragment.d(detaching); - $$.on_destroy = $$.fragment = null; - $$.ctx = []; - } +function Ne(t, e) { + const i = t.$$; + i.fragment !== null && (O(i.on_destroy), i.fragment && i.fragment.d(e), i.on_destroy = i.fragment = null, i.ctx = []); } -function make_dirty(component, i) { - if (component.$$.dirty[0] === -1) { - dirty_components.push(component); - schedule_update(); - component.$$.dirty.fill(0); - } - component.$$.dirty[i / 31 | 0] |= 1 << i % 31; +function Te(t, e) { + t.$$.dirty[0] === -1 && (H.push(t), Se(), t.$$.dirty.fill(0)), t.$$.dirty[e / 31 | 0] |= 1 << e % 31; } -function init(component, options, instance2, create_fragment2, not_equal, props, append_styles, dirty = [-1]) { - const parent_component = current_component; - set_current_component(component); - const $$ = component.$$ = { +function ye(t, e, i, n, l, o, r, f = [-1]) { + const c = I; + R(t); + const s = t.$$ = { fragment: null, ctx: null, - props, - update: noop, - not_equal, - bound: blank_object(), + props: o, + update: L, + not_equal: l, + bound: ee(), on_mount: [], on_destroy: [], on_disconnect: [], before_update: [], after_update: [], - context: new Map(options.context || (parent_component ? parent_component.$$.context : [])), - callbacks: blank_object(), - dirty, - skip_bound: false, - root: options.target || parent_component.$$.root + context: new Map(e.context || (c ? c.$$.context : [])), + callbacks: ee(), + dirty: f, + skip_bound: !1, + root: e.target || c.$$.root }; - append_styles && append_styles($$.root); - let ready = false; - $$.ctx = instance2 ? instance2(component, options.props || {}, (i, ret, ...rest) => { - const value = rest.length ? rest[0] : ret; - if ($$.ctx && not_equal($$.ctx[i], $$.ctx[i] = value)) { - if (!$$.skip_bound && $$.bound[i]) - $$.bound[i](value); - if (ready) - make_dirty(component, i); - } - return ret; - }) : []; - $$.update(); - ready = true; - run_all($$.before_update); - $$.fragment = create_fragment2 ? create_fragment2($$.ctx) : false; - if (options.target) { - if (options.hydrate) { - const nodes = children(options.target); - $$.fragment && $$.fragment.l(nodes); - nodes.forEach(detach); - } else { - $$.fragment && $$.fragment.c(); - } - if (options.intro) - transition_in(component.$$.fragment); - mount_component(component, options.target, options.anchor, options.customElement); - flush(); + r && r(s.root); + let k = !1; + if (s.ctx = i ? i(t, e.props || {}, (m, _, ...C) => { + const w = C.length ? C[0] : _; + return s.ctx && l(s.ctx[m], s.ctx[m] = w) && (!s.skip_bound && s.bound[m] && s.bound[m](w), k && Te(t, m)), _; + }) : [], s.update(), k = !0, O(s.before_update), s.fragment = n ? n(s.ctx) : !1, e.target) { + if (e.hydrate) { + const m = $e(e.target); + s.fragment && s.fragment.l(m), m.forEach(x); + } else + s.fragment && s.fragment.c(); + e.intro && Ae(t.$$.fragment), Me(t, e.target, e.anchor, e.customElement), y(); } - set_current_component(parent_component); + R(c); } -let SvelteElement; -if (typeof HTMLElement === "function") { - SvelteElement = class extends HTMLElement { - constructor() { - super(); - this.attachShadow({ mode: "open" }); - } - connectedCallback() { - const { on_mount } = this.$$; - this.$$.on_disconnect = on_mount.map(run).filter(is_function); - for (const key in this.$$.slotted) { - this.appendChild(this.$$.slotted[key]); - } - } - attributeChangedCallback(attr2, _oldValue, newValue) { - this[attr2] = newValue; - } - disconnectedCallback() { - run_all(this.$$.on_disconnect); - } - $destroy() { - destroy_component(this, 1); - this.$destroy = noop; - } - $on(type, callback) { - const callbacks = this.$$.callbacks[type] || (this.$$.callbacks[type] = []); - callbacks.push(callback); - return () => { - const index = callbacks.indexOf(callback); - if (index !== -1) - callbacks.splice(index, 1); - }; - } - $set($$props) { - if (this.$$set && !is_empty($$props)) { - this.$$.skip_bound = true; - this.$$set($$props); - this.$$.skip_bound = false; - } - } - }; -} -function get_each_context(ctx, list, i) { - const child_ctx = ctx.slice(); - child_ctx[12] = list[i]; - return child_ctx; -} -function get_each_context_1(ctx, list, i) { - const child_ctx = ctx.slice(); - child_ctx[15] = list[i]; - return child_ctx; -} -function create_if_block_5(ctx) { - let link; - return { - c() { - link = element("link"); - attr(link, "rel", "stylesheet"); - attr(link, "href", ctx[4]); - }, - m(target, anchor) { - insert(target, link, anchor); - }, - p(ctx2, dirty) { - if (dirty & 16) { - attr(link, "href", ctx2[4]); - } - }, - d(detaching) { - if (detaching) - detach(link); - } - }; -} -function create_if_block$1(ctx) { - let div; - let t; - let if_block = ctx[1] && ctx[3] === "true" && create_if_block_4(ctx); - let each_value = ctx[5]; - let each_blocks = []; - for (let i = 0; i < each_value.length; i += 1) { - each_blocks[i] = create_each_block(get_each_context(ctx, each_value, i)); +let X; +typeof HTMLElement == "function" && (X = class extends HTMLElement { + constructor() { + super(), this.attachShadow({ mode: "open" }); } - return { - c() { - div = element("div"); - if (if_block) - if_block.c(); - t = space(); - for (let i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].c(); - } - attr(div, "id", "gancioEvents"); - toggle_class(div, "dark", ctx[2] === "dark"); - toggle_class(div, "light", ctx[2] === "light"); - toggle_class(div, "sidebar", ctx[3] === "true"); - toggle_class(div, "nosidebar", ctx[3] !== "true"); - }, - m(target, anchor) { - insert(target, div, anchor); - if (if_block) - if_block.m(div, null); - append(div, t); - for (let i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].m(div, null); - } - }, - p(ctx2, dirty) { - if (ctx2[1] && ctx2[3] === "true") { - if (if_block) { - if_block.p(ctx2, dirty); - } else { - if_block = create_if_block_4(ctx2); - if_block.c(); - if_block.m(div, t); - } - } else if (if_block) { - if_block.d(1); - if_block = null; - } - if (dirty & 41) { - each_value = ctx2[5]; - let i; - for (i = 0; i < each_value.length; i += 1) { - const child_ctx = get_each_context(ctx2, each_value, i); - if (each_blocks[i]) { - each_blocks[i].p(child_ctx, dirty); - } else { - each_blocks[i] = create_each_block(child_ctx); - each_blocks[i].c(); - each_blocks[i].m(div, null); - } - } - for (; i < each_blocks.length; i += 1) { - each_blocks[i].d(1); - } - each_blocks.length = each_value.length; - } - if (dirty & 4) { - toggle_class(div, "dark", ctx2[2] === "dark"); - } - if (dirty & 4) { - toggle_class(div, "light", ctx2[2] === "light"); - } - if (dirty & 8) { - toggle_class(div, "sidebar", ctx2[3] === "true"); - } - if (dirty & 8) { - toggle_class(div, "nosidebar", ctx2[3] !== "true"); - } - }, - d(detaching) { - if (detaching) - detach(div); - if (if_block) - if_block.d(); - destroy_each(each_blocks, detaching); - } - }; -} -function create_if_block_4(ctx) { - let a; - let div1; - let div0; - let t0; - let t1; - let img; - let img_src_value; - return { - c() { - a = element("a"); - div1 = element("div"); - div0 = element("div"); - t0 = text(ctx[1]); - t1 = space(); - img = element("img"); - attr(div0, "class", "title"); - attr(img, "id", "logo"); - attr(img, "alt", "logo"); - if (!src_url_equal(img.src, img_src_value = ctx[0] + "/logo.png")) - attr(img, "src", img_src_value); - attr(div1, "class", "content"); - attr(a, "href", ctx[0]); - attr(a, "target", "_blank"); - attr(a, "id", "header"); - }, - m(target, anchor) { - insert(target, a, anchor); - append(a, div1); - append(div1, div0); - append(div0, t0); - append(div1, t1); - append(div1, img); - }, - p(ctx2, dirty) { - if (dirty & 2) - set_data(t0, ctx2[1]); - if (dirty & 1 && !src_url_equal(img.src, img_src_value = ctx2[0] + "/logo.png")) { - attr(img, "src", img_src_value); - } - if (dirty & 1) { - attr(a, "href", ctx2[0]); - } - }, - d(detaching) { - if (detaching) - detach(a); - } - }; -} -function create_if_block_2(ctx) { - let div; - function select_block_type(ctx2, dirty) { - if (ctx2[12].media.length) - return create_if_block_3; - return create_else_block; + connectedCallback() { + const { on_mount: t } = this.$$; + this.$$.on_disconnect = t.map(W).filter(_e); + for (const e in this.$$.slotted) + this.appendChild(this.$$.slotted[e]); } - let current_block_type = select_block_type(ctx); - let if_block = current_block_type(ctx); - return { - c() { - div = element("div"); - if_block.c(); - attr(div, "class", "img"); - }, - m(target, anchor) { - insert(target, div, anchor); - if_block.m(div, null); - }, - p(ctx2, dirty) { - if (current_block_type === (current_block_type = select_block_type(ctx2)) && if_block) { - if_block.p(ctx2, dirty); - } else { - if_block.d(1); - if_block = current_block_type(ctx2); - if (if_block) { - if_block.c(); - if_block.m(div, null); - } - } - }, - d(detaching) { - if (detaching) - detach(div); - if_block.d(); - } - }; -} -function create_else_block(ctx) { - let img; - let img_alt_value; - let img_src_value; - return { - c() { - img = element("img"); - attr(img, "style", "aspect-ratio=1.7778;"); - attr(img, "alt", img_alt_value = ctx[12].title); - if (!src_url_equal(img.src, img_src_value = ctx[0] + "/noimg.svg")) - attr(img, "src", img_src_value); - attr(img, "loading", "lazy"); - }, - m(target, anchor) { - insert(target, img, anchor); - }, - p(ctx2, dirty) { - if (dirty & 32 && img_alt_value !== (img_alt_value = ctx2[12].title)) { - attr(img, "alt", img_alt_value); - } - if (dirty & 1 && !src_url_equal(img.src, img_src_value = ctx2[0] + "/noimg.svg")) { - attr(img, "src", img_src_value); - } - }, - d(detaching) { - if (detaching) - detach(img); - } - }; -} -function create_if_block_3(ctx) { - let img; - let img_style_value; - let img_alt_value; - let img_src_value; - return { - c() { - img = element("img"); - attr(img, "style", img_style_value = "object-position: " + position$1(ctx[12]) + "; aspect-ratio=1.7778;"); - attr(img, "alt", img_alt_value = ctx[12].media[0].name); - if (!src_url_equal(img.src, img_src_value = ctx[0] + "/media/thumb/" + ctx[12].media[0].url)) - attr(img, "src", img_src_value); - attr(img, "loading", "lazy"); - }, - m(target, anchor) { - insert(target, img, anchor); - }, - p(ctx2, dirty) { - if (dirty & 32 && img_style_value !== (img_style_value = "object-position: " + position$1(ctx2[12]) + "; aspect-ratio=1.7778;")) { - attr(img, "style", img_style_value); - } - if (dirty & 32 && img_alt_value !== (img_alt_value = ctx2[12].media[0].name)) { - attr(img, "alt", img_alt_value); - } - if (dirty & 33 && !src_url_equal(img.src, img_src_value = ctx2[0] + "/media/thumb/" + ctx2[12].media[0].url)) { - attr(img, "src", img_src_value); - } - }, - d(detaching) { - if (detaching) - detach(img); - } - }; -} -function create_if_block_1$1(ctx) { - let div; - let each_value_1 = ctx[12].tags; - let each_blocks = []; - for (let i = 0; i < each_value_1.length; i += 1) { - each_blocks[i] = create_each_block_1(get_each_context_1(ctx, each_value_1, i)); + attributeChangedCallback(t, e, i) { + this[t] = i; } - return { - c() { - div = element("div"); - for (let i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].c(); - } - attr(div, "class", "tags"); - }, - m(target, anchor) { - insert(target, div, anchor); - for (let i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].m(div, null); - } - }, - p(ctx2, dirty) { - if (dirty & 32) { - each_value_1 = ctx2[12].tags; - let i; - for (i = 0; i < each_value_1.length; i += 1) { - const child_ctx = get_each_context_1(ctx2, each_value_1, i); - if (each_blocks[i]) { - each_blocks[i].p(child_ctx, dirty); - } else { - each_blocks[i] = create_each_block_1(child_ctx); - each_blocks[i].c(); - each_blocks[i].m(div, null); - } - } - for (; i < each_blocks.length; i += 1) { - each_blocks[i].d(1); - } - each_blocks.length = each_value_1.length; - } - }, - d(detaching) { - if (detaching) - detach(div); - destroy_each(each_blocks, detaching); - } - }; -} -function create_each_block_1(ctx) { - let span; - let t0; - let t1_value = ctx[15] + ""; - let t1; - return { - c() { - span = element("span"); - t0 = text("#"); - t1 = text(t1_value); - attr(span, "class", "tag"); - }, - m(target, anchor) { - insert(target, span, anchor); - append(span, t0); - append(span, t1); - }, - p(ctx2, dirty) { - if (dirty & 32 && t1_value !== (t1_value = ctx2[15] + "")) - set_data(t1, t1_value); - }, - d(detaching) { - if (detaching) - detach(span); - } - }; -} -function create_each_block(ctx) { - let a; - let t0; - let div2; - let div0; - let t1_value = when$1(ctx[12].start_datetime) + ""; - let t1; - let t2; - let div1; - let t3_value = ctx[12].title + ""; - let t3; - let t4; - let span1; - let t5; - let t6_value = ctx[12].place.name + ""; - let t6; - let t7; - let span0; - let t8_value = ctx[12].place.address + ""; - let t8; - let t9; - let t10; - let a_href_value; - let a_title_value; - let if_block0 = ctx[3] !== "true" && create_if_block_2(ctx); - let if_block1 = ctx[12].tags.length && create_if_block_1$1(ctx); - return { - c() { - a = element("a"); - if (if_block0) - if_block0.c(); - t0 = space(); - div2 = element("div"); - div0 = element("div"); - t1 = text(t1_value); - t2 = space(); - div1 = element("div"); - t3 = text(t3_value); - t4 = space(); - span1 = element("span"); - t5 = text("@"); - t6 = text(t6_value); - t7 = space(); - span0 = element("span"); - t8 = text(t8_value); - t9 = space(); - if (if_block1) - if_block1.c(); - t10 = space(); - attr(div0, "class", "subtitle"); - attr(div1, "class", "title"); - attr(span0, "class", "subtitle"); - attr(span1, "class", "place"); - attr(div2, "class", "content"); - attr(a, "href", a_href_value = ctx[0] + "/event/" + (ctx[12].slug || ctx[12].id)); - attr(a, "class", "event"); - attr(a, "title", a_title_value = ctx[12].title); - attr(a, "target", "_blank"); - }, - m(target, anchor) { - insert(target, a, anchor); - if (if_block0) - if_block0.m(a, null); - append(a, t0); - append(a, div2); - append(div2, div0); - append(div0, t1); - append(div2, t2); - append(div2, div1); - append(div1, t3); - append(div2, t4); - append(div2, span1); - append(span1, t5); - append(span1, t6); - append(span1, t7); - append(span1, span0); - append(span0, t8); - append(div2, t9); - if (if_block1) - if_block1.m(div2, null); - append(a, t10); - }, - p(ctx2, dirty) { - if (ctx2[3] !== "true") { - if (if_block0) { - if_block0.p(ctx2, dirty); - } else { - if_block0 = create_if_block_2(ctx2); - if_block0.c(); - if_block0.m(a, t0); - } - } else if (if_block0) { - if_block0.d(1); - if_block0 = null; - } - if (dirty & 32 && t1_value !== (t1_value = when$1(ctx2[12].start_datetime) + "")) - set_data(t1, t1_value); - if (dirty & 32 && t3_value !== (t3_value = ctx2[12].title + "")) - set_data(t3, t3_value); - if (dirty & 32 && t6_value !== (t6_value = ctx2[12].place.name + "")) - set_data(t6, t6_value); - if (dirty & 32 && t8_value !== (t8_value = ctx2[12].place.address + "")) - set_data(t8, t8_value); - if (ctx2[12].tags.length) { - if (if_block1) { - if_block1.p(ctx2, dirty); - } else { - if_block1 = create_if_block_1$1(ctx2); - if_block1.c(); - if_block1.m(div2, null); - } - } else if (if_block1) { - if_block1.d(1); - if_block1 = null; - } - if (dirty & 33 && a_href_value !== (a_href_value = ctx2[0] + "/event/" + (ctx2[12].slug || ctx2[12].id))) { - attr(a, "href", a_href_value); - } - if (dirty & 32 && a_title_value !== (a_title_value = ctx2[12].title)) { - attr(a, "title", a_title_value); - } - }, - d(detaching) { - if (detaching) - detach(a); - if (if_block0) - if_block0.d(); - if (if_block1) - if_block1.d(); - } - }; -} -function create_fragment$1(ctx) { - let t; - let if_block1_anchor; - let if_block0 = ctx[4] && create_if_block_5(ctx); - let if_block1 = ctx[5].length && create_if_block$1(ctx); - return { - c() { - if (if_block0) - if_block0.c(); - t = space(); - if (if_block1) - if_block1.c(); - if_block1_anchor = empty(); - this.c = noop; - }, - m(target, anchor) { - if (if_block0) - if_block0.m(target, anchor); - insert(target, t, anchor); - if (if_block1) - if_block1.m(target, anchor); - insert(target, if_block1_anchor, anchor); - }, - p(ctx2, [dirty]) { - if (ctx2[4]) { - if (if_block0) { - if_block0.p(ctx2, dirty); - } else { - if_block0 = create_if_block_5(ctx2); - if_block0.c(); - if_block0.m(t.parentNode, t); - } - } else if (if_block0) { - if_block0.d(1); - if_block0 = null; - } - if (ctx2[5].length) { - if (if_block1) { - if_block1.p(ctx2, dirty); - } else { - if_block1 = create_if_block$1(ctx2); - if_block1.c(); - if_block1.m(if_block1_anchor.parentNode, if_block1_anchor); - } - } else if (if_block1) { - if_block1.d(1); - if_block1 = null; - } - }, - i: noop, - o: noop, - d(detaching) { - if (if_block0) - if_block0.d(detaching); - if (detaching) - detach(t); - if (if_block1) - if_block1.d(detaching); - if (detaching) - detach(if_block1_anchor); - } - }; -} -function position$1(event) { - if (event.media[0].focalpoint) { - const focalpoint = event.media[0].focalpoint; - return `${(focalpoint[0] + 1) * 50}% ${(focalpoint[1] + 1) * 50}%`; + disconnectedCallback() { + O(this.$$.on_disconnect); } - return "center center"; -} -function when$1(timestamp) { - return new Date(timestamp * 1e3).toLocaleDateString(void 0, { + $destroy() { + Ne(this, 1), this.$destroy = L; + } + $on(t, e) { + const i = this.$$.callbacks[t] || (this.$$.callbacks[t] = []); + return i.push(e), () => { + const n = i.indexOf(e); + n !== -1 && i.splice(n, 1); + }; + } + $set(t) { + this.$$set && !xe(t) && (this.$$.skip_bound = !0, this.$$set(t), this.$$.skip_bound = !1); + } +}); +function F(t, e = "long") { + const i = e === "long" ? { weekday: "long", month: "long", day: "numeric", hour: "2-digit", minute: "2-digit" - }); + } : { hour: "2-digit", minute: "2-digit" }; + return new Date(t * 1e3).toLocaleString(void 0, i); } -function instance$1($$self, $$props, $$invalidate) { - let { baseurl = "" } = $$props; - let { title = "" } = $$props; - let { maxlength = false } = $$props; - let { tags = "" } = $$props; - let { places = "" } = $$props; - let { theme = "light" } = $$props; - let { show_recurrent = false } = $$props; - let { sidebar = "true" } = $$props; - let { external_style = "" } = $$props; - let mounted = false; - let events = []; - function update2(v) { - if (!mounted) +function V(t) { + return t.multidate ? F(t.start_datetime) + " - " + F(t.end_datetime) : F(t.start_datetime) + (t.end_datetime ? "-" + F(t.end_datetime, "short") : ""); +} +function ne(t, e, i) { + const n = t.slice(); + return n[12] = e[i], n; +} +function le(t, e, i) { + const n = t.slice(); + return n[15] = e[i], n; +} +function re(t) { + let e; + return { + c() { + e = g("link"), a(e, "rel", "stylesheet"), a(e, "href", t[4]); + }, + m(i, n) { + v(i, e, n); + }, + p(i, n) { + n & 16 && a(e, "href", i[4]); + }, + d(i) { + i && x(e); + } + }; +} +function oe(t) { + let e, i, n = t[1] && t[3] === "true" && ae(t), l = t[5], o = []; + for (let r = 0; r < l.length; r += 1) + o[r] = ue(ne(t, l, r)); + return { + c() { + e = g("div"), n && n.c(), i = z(); + for (let r = 0; r < o.length; r += 1) + o[r].c(); + a(e, "id", "gancioEvents"), T(e, "dark", t[2] === "dark"), T(e, "light", t[2] === "light"), T(e, "sidebar", t[3] === "true"), T(e, "nosidebar", t[3] !== "true"); + }, + m(r, f) { + v(r, e, f), n && n.m(e, null), u(e, i); + for (let c = 0; c < o.length; c += 1) + o[c].m(e, null); + }, + p(r, f) { + if (r[1] && r[3] === "true" ? n ? n.p(r, f) : (n = ae(r), n.c(), n.m(e, i)) : n && (n.d(1), n = null), f & 41) { + l = r[5]; + let c; + for (c = 0; c < l.length; c += 1) { + const s = ne(r, l, c); + o[c] ? o[c].p(s, f) : (o[c] = ue(s), o[c].c(), o[c].m(e, null)); + } + for (; c < o.length; c += 1) + o[c].d(1); + o.length = l.length; + } + f & 4 && T(e, "dark", r[2] === "dark"), f & 4 && T(e, "light", r[2] === "light"), f & 8 && T(e, "sidebar", r[3] === "true"), f & 8 && T(e, "nosidebar", r[3] !== "true"); + }, + d(r) { + r && x(e), n && n.d(), pe(o, r); + } + }; +} +function ae(t) { + let e, i, n, l, o, r, f; + return { + c() { + e = g("a"), i = g("div"), n = g("div"), l = j(t[1]), o = z(), r = g("img"), a(n, "class", "title"), a(r, "id", "logo"), a(r, "alt", "logo"), G(r.src, f = t[0] + "/logo.png") || a(r, "src", f), a(i, "class", "content"), a(e, "href", t[0]), a(e, "target", "_blank"), a(e, "id", "header"); + }, + m(c, s) { + v(c, e, s), u(e, i), u(i, n), u(n, l), u(i, o), u(i, r); + }, + p(c, s) { + s & 2 && N(l, c[1]), s & 1 && !G(r.src, f = c[0] + "/logo.png") && a(r, "src", f), s & 1 && a(e, "href", c[0]); + }, + d(c) { + c && x(e); + } + }; +} +function se(t) { + let e; + function i(o, r) { + return o[12].media.length ? Ge : Le; + } + let n = i(t), l = n(t); + return { + c() { + e = g("div"), l.c(), a(e, "class", "img"); + }, + m(o, r) { + v(o, e, r), l.m(e, null); + }, + p(o, r) { + n === (n = i(o)) && l ? l.p(o, r) : (l.d(1), l = n(o), l && (l.c(), l.m(e, null))); + }, + d(o) { + o && x(e), l.d(); + } + }; +} +function Le(t) { + let e, i, n; + return { + c() { + e = g("img"), a(e, "style", "aspect-ratio=1.7778;"), a(e, "alt", i = t[12].title), G(e.src, n = t[0] + "/noimg.svg") || a(e, "src", n), a(e, "loading", "lazy"); + }, + m(l, o) { + v(l, e, o); + }, + p(l, o) { + o & 32 && i !== (i = l[12].title) && a(e, "alt", i), o & 1 && !G(e.src, n = l[0] + "/noimg.svg") && a(e, "src", n); + }, + d(l) { + l && x(e); + } + }; +} +function Ge(t) { + let e, i, n, l; + return { + c() { + e = g("img"), a(e, "style", i = "object-position: " + de(t[12]) + "; aspect-ratio=1.7778;"), a(e, "alt", n = t[12].media[0].name), G(e.src, l = t[0] + "/media/thumb/" + t[12].media[0].url) || a(e, "src", l), a(e, "loading", "lazy"); + }, + m(o, r) { + v(o, e, r); + }, + p(o, r) { + r & 32 && i !== (i = "object-position: " + de(o[12]) + "; aspect-ratio=1.7778;") && a(e, "style", i), r & 32 && n !== (n = o[12].media[0].name) && a(e, "alt", n), r & 33 && !G(e.src, l = o[0] + "/media/thumb/" + o[12].media[0].url) && a(e, "src", l); + }, + d(o) { + o && x(e); + } + }; +} +function ce(t) { + let e, i = t[12].tags, n = []; + for (let l = 0; l < i.length; l += 1) + n[l] = fe(le(t, i, l)); + return { + c() { + e = g("div"); + for (let l = 0; l < n.length; l += 1) + n[l].c(); + a(e, "class", "tags"); + }, + m(l, o) { + v(l, e, o); + for (let r = 0; r < n.length; r += 1) + n[r].m(e, null); + }, + p(l, o) { + if (o & 32) { + i = l[12].tags; + let r; + for (r = 0; r < i.length; r += 1) { + const f = le(l, i, r); + n[r] ? n[r].p(f, o) : (n[r] = fe(f), n[r].c(), n[r].m(e, null)); + } + for (; r < n.length; r += 1) + n[r].d(1); + n.length = i.length; + } + }, + d(l) { + l && x(e), pe(n, l); + } + }; +} +function fe(t) { + let e, i, n = t[15] + "", l; + return { + c() { + e = g("span"), i = j("#"), l = j(n), a(e, "class", "tag"); + }, + m(o, r) { + v(o, e, r), u(e, i), u(e, l); + }, + p(o, r) { + r & 32 && n !== (n = o[15] + "") && N(l, n); + }, + d(o) { + o && x(e); + } + }; +} +function ue(t) { + let e, i, n, l, o = V(t[12]) + "", r, f, c, s = t[12].title + "", k, m, _, C, w = t[12].place.name + "", d, S, h, b = t[12].place.address + "", A, Y, Z, U, q, $ = t[3] !== "true" && se(t), E = t[12].tags.length && ce(t); + return { + c() { + e = g("a"), $ && $.c(), i = z(), n = g("div"), l = g("div"), r = j(o), f = z(), c = g("div"), k = j(s), m = z(), _ = g("span"), C = j("@"), d = j(w), S = z(), h = g("span"), A = j(b), Y = z(), E && E.c(), Z = z(), a(l, "class", "subtitle"), a(c, "class", "title"), a(h, "class", "subtitle"), a(_, "class", "place"), a(n, "class", "content"), a(e, "href", U = t[0] + "/event/" + (t[12].slug || t[12].id)), a(e, "class", "event"), a(e, "title", q = t[12].title), a(e, "target", "_blank"); + }, + m(p, M) { + v(p, e, M), $ && $.m(e, null), u(e, i), u(e, n), u(n, l), u(l, r), u(n, f), u(n, c), u(c, k), u(n, m), u(n, _), u(_, C), u(_, d), u(_, S), u(_, h), u(h, A), u(n, Y), E && E.m(n, null), u(e, Z); + }, + p(p, M) { + p[3] !== "true" ? $ ? $.p(p, M) : ($ = se(p), $.c(), $.m(e, i)) : $ && ($.d(1), $ = null), M & 32 && o !== (o = V(p[12]) + "") && N(r, o), M & 32 && s !== (s = p[12].title + "") && N(k, s), M & 32 && w !== (w = p[12].place.name + "") && N(d, w), M & 32 && b !== (b = p[12].place.address + "") && N(A, b), p[12].tags.length ? E ? E.p(p, M) : (E = ce(p), E.c(), E.m(n, null)) : E && (E.d(1), E = null), M & 33 && U !== (U = p[0] + "/event/" + (p[12].slug || p[12].id)) && a(e, "href", U), M & 32 && q !== (q = p[12].title) && a(e, "title", q); + }, + d(p) { + p && x(e), $ && $.d(), E && E.d(); + } + }; +} +function He(t) { + let e, i, n = t[4] && re(t), l = t[5].length && oe(t); + return { + c() { + n && n.c(), e = z(), l && l.c(), i = ve(), this.c = L; + }, + m(o, r) { + n && n.m(o, r), v(o, e, r), l && l.m(o, r), v(o, i, r); + }, + p(o, [r]) { + o[4] ? n ? n.p(o, r) : (n = re(o), n.c(), n.m(e.parentNode, e)) : n && (n.d(1), n = null), o[5].length ? l ? l.p(o, r) : (l = oe(o), l.c(), l.m(i.parentNode, i)) : l && (l.d(1), l = null); + }, + i: L, + o: L, + d(o) { + n && n.d(o), o && x(e), l && l.d(o), o && x(i); + } + }; +} +function de(t) { + if (t.media && t.media[0].focalpoint) { + const e = t.media[0].focalpoint; + return `${(e[0] + 1) * 50}% ${(e[1] + 1) * 50}%`; + } + return "center center"; +} +function Re(t, e, i) { + let { baseurl: n = "" } = e, { title: l = "" } = e, { maxlength: o = !1 } = e, { tags: r = "" } = e, { places: f = "" } = e, { theme: c = "light" } = e, { show_recurrent: s = !1 } = e, { sidebar: k = "true" } = e, { external_style: m = "" } = e, _ = !1, C = []; + function w(d) { + if (!_) return; - const params = []; - if (maxlength) { - params.push(`max=${maxlength}`); - } - if (tags) { - params.push(`tags=${tags}`); - } - if (places) { - params.push(`places=${places}`); - } - params.push(`show_recurrent=${show_recurrent ? "true" : "false"}`); - fetch(`${baseurl}/api/events?${params.join("&")}`).then((res) => res.json()).then((e) => { - $$invalidate(5, events = e); - }).catch((e) => { - console.error("Error loading Gancio API -> ", e); + const S = []; + o && S.push(`max=${o}`), r && S.push(`tags=${r}`), f && S.push(`places=${f}`), S.push(`show_recurrent=${s ? "true" : "false"}`), fetch(`${n}/api/events?${S.join("&")}`).then((h) => h.json()).then((h) => { + i(5, C = h); + }).catch((h) => { + console.error("Error loading Gancio API -> ", h); }); } - onMount(() => { - mounted = true; - update2(); - }); - $$self.$$set = ($$props2) => { - if ("baseurl" in $$props2) - $$invalidate(0, baseurl = $$props2.baseurl); - if ("title" in $$props2) - $$invalidate(1, title = $$props2.title); - if ("maxlength" in $$props2) - $$invalidate(6, maxlength = $$props2.maxlength); - if ("tags" in $$props2) - $$invalidate(7, tags = $$props2.tags); - if ("places" in $$props2) - $$invalidate(8, places = $$props2.places); - if ("theme" in $$props2) - $$invalidate(2, theme = $$props2.theme); - if ("show_recurrent" in $$props2) - $$invalidate(9, show_recurrent = $$props2.show_recurrent); - if ("sidebar" in $$props2) - $$invalidate(3, sidebar = $$props2.sidebar); - if ("external_style" in $$props2) - $$invalidate(4, external_style = $$props2.external_style); - }; - $$self.$$.update = () => { - if ($$self.$$.dirty & 974) { - update2(); - } - }; - return [ - baseurl, - title, - theme, - sidebar, - external_style, - events, - maxlength, - tags, - places, - show_recurrent + return we(() => { + _ = !0, w(); + }), t.$$set = (d) => { + "baseurl" in d && i(0, n = d.baseurl), "title" in d && i(1, l = d.title), "maxlength" in d && i(6, o = d.maxlength), "tags" in d && i(7, r = d.tags), "places" in d && i(8, f = d.places), "theme" in d && i(2, c = d.theme), "show_recurrent" in d && i(9, s = d.show_recurrent), "sidebar" in d && i(3, k = d.sidebar), "external_style" in d && i(4, m = d.external_style); + }, t.$$.update = () => { + t.$$.dirty & 974 && w(); + }, [ + n, + l, + c, + k, + m, + C, + o, + r, + f, + s ]; } -class GancioEvents extends SvelteElement { - constructor(options) { - super(); - this.shadowRoot.innerHTML = ``; - init(this, { - target: this.shadowRoot, - props: attribute_to_object(this.attributes), - customElement: true - }, instance$1, create_fragment$1, safe_not_equal, { - baseurl: 0, - title: 1, - maxlength: 6, - tags: 7, - places: 8, - theme: 2, - show_recurrent: 9, - sidebar: 3, - external_style: 4 - }, null); - if (options) { - if (options.target) { - insert(options.target, this, options.anchor); - } - if (options.props) { - this.$set(options.props); - flush(); - } - } +class Ie extends X { + constructor(e) { + super(), this.shadowRoot.innerHTML = ``, ye( + this, + { + target: this.shadowRoot, + props: ke(this.attributes), + customElement: !0 + }, + Re, + He, + be, + { + baseurl: 0, + title: 1, + maxlength: 6, + tags: 7, + places: 8, + theme: 2, + show_recurrent: 9, + sidebar: 3, + external_style: 4 + }, + null + ), e && (e.target && v(e.target, this, e.anchor), e.props && (this.$set(e.props), y())); } static get observedAttributes() { return [ @@ -955,291 +516,152 @@ class GancioEvents extends SvelteElement { get baseurl() { return this.$$.ctx[0]; } - set baseurl(baseurl) { - this.$$set({ baseurl }); - flush(); + set baseurl(e) { + this.$$set({ baseurl: e }), y(); } get title() { return this.$$.ctx[1]; } - set title(title) { - this.$$set({ title }); - flush(); + set title(e) { + this.$$set({ title: e }), y(); } get maxlength() { return this.$$.ctx[6]; } - set maxlength(maxlength) { - this.$$set({ maxlength }); - flush(); + set maxlength(e) { + this.$$set({ maxlength: e }), y(); } get tags() { return this.$$.ctx[7]; } - set tags(tags) { - this.$$set({ tags }); - flush(); + set tags(e) { + this.$$set({ tags: e }), y(); } get places() { return this.$$.ctx[8]; } - set places(places) { - this.$$set({ places }); - flush(); + set places(e) { + this.$$set({ places: e }), y(); } get theme() { return this.$$.ctx[2]; } - set theme(theme) { - this.$$set({ theme }); - flush(); + set theme(e) { + this.$$set({ theme: e }), y(); } get show_recurrent() { return this.$$.ctx[9]; } - set show_recurrent(show_recurrent) { - this.$$set({ show_recurrent }); - flush(); + set show_recurrent(e) { + this.$$set({ show_recurrent: e }), y(); } get sidebar() { return this.$$.ctx[3]; } - set sidebar(sidebar) { - this.$$set({ sidebar }); - flush(); + set sidebar(e) { + this.$$set({ sidebar: e }), y(); } get external_style() { return this.$$.ctx[4]; } - set external_style(external_style) { - this.$$set({ external_style }); - flush(); + set external_style(e) { + this.$$set({ external_style: e }), y(); } } -customElements.define("gancio-events", GancioEvents); -function create_if_block(ctx) { - let a; - let t0; - let div2; - let strong; - let t1_value = ctx[1].title + ""; - let t1; - let t2; - let div0; - let t3_value = when(ctx[1]) + ""; - let t3; - let t4; - let div1; - let t5; - let t6_value = ctx[1].place.name + ""; - let t6; - let a_href_value; - let if_block = ctx[1].media.length && create_if_block_1(ctx); +customElements.define("gancio-events", Ie); +function he(t) { + let e, i, n, l, o = t[1].title + "", r, f, c, s = V(t[1]) + "", k, m, _, C, w = t[1].place.name + "", d, S, h = t[1].media.length && ge(t); return { c() { - a = element("a"); - if (if_block) - if_block.c(); - t0 = space(); - div2 = element("div"); - strong = element("strong"); - t1 = text(t1_value); - t2 = space(); - div0 = element("div"); - t3 = text(t3_value); - t4 = space(); - div1 = element("div"); - t5 = text("@"); - t6 = text(t6_value); - attr(div1, "class", "place"); - attr(div2, "class", "container"); - attr(a, "href", a_href_value = ctx[0] + "/event/" + (ctx[1].slug || ctx[1].id)); - attr(a, "class", "card"); - attr(a, "target", "_blank"); + e = g("a"), h && h.c(), i = z(), n = g("div"), l = g("strong"), r = j(o), f = z(), c = g("div"), k = j(s), m = z(), _ = g("div"), C = j("@"), d = j(w), a(_, "class", "place"), a(n, "class", "container"), a(e, "href", S = t[0] + "/event/" + (t[1].slug || t[1].id)), a(e, "class", "card"), a(e, "target", "_blank"); }, - m(target, anchor) { - insert(target, a, anchor); - if (if_block) - if_block.m(a, null); - append(a, t0); - append(a, div2); - append(div2, strong); - append(strong, t1); - append(div2, t2); - append(div2, div0); - append(div0, t3); - append(div2, t4); - append(div2, div1); - append(div1, t5); - append(div1, t6); + m(b, A) { + v(b, e, A), h && h.m(e, null), u(e, i), u(e, n), u(n, l), u(l, r), u(n, f), u(n, c), u(c, k), u(n, m), u(n, _), u(_, C), u(_, d); }, - p(ctx2, dirty) { - if (ctx2[1].media.length) { - if (if_block) { - if_block.p(ctx2, dirty); - } else { - if_block = create_if_block_1(ctx2); - if_block.c(); - if_block.m(a, t0); - } - } else if (if_block) { - if_block.d(1); - if_block = null; - } - if (dirty & 2 && t1_value !== (t1_value = ctx2[1].title + "")) - set_data(t1, t1_value); - if (dirty & 2 && t3_value !== (t3_value = when(ctx2[1]) + "")) - set_data(t3, t3_value); - if (dirty & 2 && t6_value !== (t6_value = ctx2[1].place.name + "")) - set_data(t6, t6_value); - if (dirty & 3 && a_href_value !== (a_href_value = ctx2[0] + "/event/" + (ctx2[1].slug || ctx2[1].id))) { - attr(a, "href", a_href_value); - } + p(b, A) { + b[1].media.length ? h ? h.p(b, A) : (h = ge(b), h.c(), h.m(e, i)) : h && (h.d(1), h = null), A & 2 && o !== (o = b[1].title + "") && N(r, o), A & 2 && s !== (s = V(b[1]) + "") && N(k, s), A & 2 && w !== (w = b[1].place.name + "") && N(d, w), A & 3 && S !== (S = b[0] + "/event/" + (b[1].slug || b[1].id)) && a(e, "href", S); }, - d(detaching) { - if (detaching) - detach(a); - if (if_block) - if_block.d(); + d(b) { + b && x(e), h && h.d(); } }; } -function create_if_block_1(ctx) { - let img; - let img_src_value; - let img_alt_value; - let img_style_value; +function ge(t) { + let e, i, n, l; return { c() { - img = element("img"); - if (!src_url_equal(img.src, img_src_value = ctx[2](ctx[1]))) - attr(img, "src", img_src_value); - attr(img, "alt", img_alt_value = ctx[1].media[0].name); - attr(img, "style", img_style_value = "object-position: " + position(ctx[1]) + "; aspect-ratio=1.7778;"); + e = g("img"), G(e.src, i = t[2](t[1])) || a(e, "src", i), a(e, "alt", n = t[1].media[0].name), a(e, "style", l = "object-position: " + me(t[1]) + "; aspect-ratio=1.7778;"); }, - m(target, anchor) { - insert(target, img, anchor); + m(o, r) { + v(o, e, r); }, - p(ctx2, dirty) { - if (dirty & 2 && !src_url_equal(img.src, img_src_value = ctx2[2](ctx2[1]))) { - attr(img, "src", img_src_value); - } - if (dirty & 2 && img_alt_value !== (img_alt_value = ctx2[1].media[0].name)) { - attr(img, "alt", img_alt_value); - } - if (dirty & 2 && img_style_value !== (img_style_value = "object-position: " + position(ctx2[1]) + "; aspect-ratio=1.7778;")) { - attr(img, "style", img_style_value); - } + p(o, r) { + r & 2 && !G(e.src, i = o[2](o[1])) && a(e, "src", i), r & 2 && n !== (n = o[1].media[0].name) && a(e, "alt", n), r & 2 && l !== (l = "object-position: " + me(o[1]) + "; aspect-ratio=1.7778;") && a(e, "style", l); }, - d(detaching) { - if (detaching) - detach(img); + d(o) { + o && x(e); } }; } -function create_fragment(ctx) { - let if_block_anchor; - let if_block = ctx[1] && create_if_block(ctx); +function Oe(t) { + let e, i = t[1] && he(t); return { c() { - if (if_block) - if_block.c(); - if_block_anchor = empty(); - this.c = noop; + i && i.c(), e = ve(), this.c = L; }, - m(target, anchor) { - if (if_block) - if_block.m(target, anchor); - insert(target, if_block_anchor, anchor); + m(n, l) { + i && i.m(n, l), v(n, e, l); }, - p(ctx2, [dirty]) { - if (ctx2[1]) { - if (if_block) { - if_block.p(ctx2, dirty); - } else { - if_block = create_if_block(ctx2); - if_block.c(); - if_block.m(if_block_anchor.parentNode, if_block_anchor); - } - } else if (if_block) { - if_block.d(1); - if_block = null; - } + p(n, [l]) { + n[1] ? i ? i.p(n, l) : (i = he(n), i.c(), i.m(e.parentNode, e)) : i && (i.d(1), i = null); }, - i: noop, - o: noop, - d(detaching) { - if (if_block) - if_block.d(detaching); - if (detaching) - detach(if_block_anchor); + i: L, + o: L, + d(n) { + i && i.d(n), n && x(e); } }; } -function when(event) { - return new Date(event.start_datetime * 1e3).toLocaleDateString(void 0, { - weekday: "long", - month: "short", - day: "numeric", - hour: "2-digit", - minute: "2-digit" - }); -} -function position(event) { - if (event.media[0].focalpoint) { - const focalpoint = event.media[0].focalpoint; - return `${(focalpoint[0] + 1) * 50}% ${(focalpoint[1] + 1) * 50}%`; +function me(t) { + if (t.media[0].focalpoint) { + const e = t.media[0].focalpoint; + return `${(e[0] + 1) * 50}% ${(e[1] + 1) * 50}%`; } return "center center"; } -function instance($$self, $$props, $$invalidate) { - let { baseurl = "https://demo.gancio.org" } = $$props; - let { id } = $$props; - let mounted = false; - let event; - function update2(id2, baseurl2) { - if (mounted) { - fetch(`${baseurl2}/api/event/${id2}`).then((res) => res.json()).then((e) => $$invalidate(1, event = e)); - } +function Ue(t, e, i) { + let { baseurl: n = "https://demo.gancio.org" } = e, { id: l } = e, o = !1, r; + function f(s, k) { + o && fetch(`${k}/api/event/${s}`).then((m) => m.json()).then((m) => i(1, r = m)); } - onMount(() => { - mounted = true; - update2(id, baseurl); + we(() => { + o = !0, f(l, n); }); - function thumbnail(event2) { - return `${baseurl}/media/thumb/${event2.media[0].url}`; + function c(s) { + return `${n}/media/thumb/${s.media[0].url}`; } - $$self.$$set = ($$props2) => { - if ("baseurl" in $$props2) - $$invalidate(0, baseurl = $$props2.baseurl); - if ("id" in $$props2) - $$invalidate(3, id = $$props2.id); - }; - $$self.$$.update = () => { - if ($$self.$$.dirty & 9) { - update2(id, baseurl); - } - }; - return [baseurl, event, thumbnail, id]; + return t.$$set = (s) => { + "baseurl" in s && i(0, n = s.baseurl), "id" in s && i(3, l = s.id); + }, t.$$.update = () => { + t.$$.dirty & 9 && f(l, n); + }, [n, r, c, l]; } -class GancioEvent extends SvelteElement { - constructor(options) { - super(); - this.shadowRoot.innerHTML = ``; - init(this, { - target: this.shadowRoot, - props: attribute_to_object(this.attributes), - customElement: true - }, instance, create_fragment, safe_not_equal, { baseurl: 0, id: 3 }, null); - if (options) { - if (options.target) { - insert(options.target, this, options.anchor); - } - if (options.props) { - this.$set(options.props); - flush(); - } - } +class qe extends X { + constructor(e) { + super(), this.shadowRoot.innerHTML = ``, ye( + this, + { + target: this.shadowRoot, + props: ke(this.attributes), + customElement: !0 + }, + Ue, + Oe, + be, + { baseurl: 0, id: 3 }, + null + ), e && (e.target && v(e.target, this, e.anchor), e.props && (this.$set(e.props), y())); } static get observedAttributes() { return ["baseurl", "id"]; @@ -1247,16 +669,14 @@ class GancioEvent extends SvelteElement { get baseurl() { return this.$$.ctx[0]; } - set baseurl(baseurl) { - this.$$set({ baseurl }); - flush(); + set baseurl(e) { + this.$$set({ baseurl: e }), y(); } get id() { return this.$$.ctx[3]; } - set id(id) { - this.$$set({ id }); - flush(); + set id(e) { + this.$$set({ id: e }), y(); } } -customElements.define("gancio-event", GancioEvent); +customElements.define("gancio-event", qe); diff --git a/webcomponents/src/GancioEvent.svelte b/webcomponents/src/GancioEvent.svelte index c42a4667..d347cedc 100644 --- a/webcomponents/src/GancioEvent.svelte +++ b/webcomponents/src/GancioEvent.svelte @@ -1,16 +1,19 @@ + + + +{#if event} + + {#if event.media.length} + {event.media[0].name} + {/if} +
+ {event.title} +
{when(event)}
+
@{event.place.name}
+
+
+{/if} + + diff --git a/webcomponents/src/GancioEvents.svelte b/webcomponents/src/GancioEvents.svelte index 6e3dc9a3..240ca5d9 100644 --- a/webcomponents/src/GancioEvents.svelte +++ b/webcomponents/src/GancioEvents.svelte @@ -2,6 +2,7 @@ \ No newline at end of file + diff --git a/plugins/filters.js b/plugins/filters.js index b0c0a3cb..9a5329ba 100644 --- a/plugins/filters.js +++ b/plugins/filters.js @@ -42,14 +42,15 @@ export default ({ app, store }) => { // shown in mobile homepage Vue.filter('day', value => dayjs.unix(value).tz().locale(store.state.locale).format('dddd, D MMM')) Vue.filter('mediaURL', (event, type, format = '.jpg') => { + const mediaPath = type === 'download' ? '/download/' : '/media/' if (event.media && event.media.length) { if (type === 'alt') { return event.media[0].name } else { - return store.state.settings.baseurl + '/media/' + (type === 'thumb' ? 'thumb/' : '') + event.media[0].url.replace(/.jpg$/, format) + return store.state.settings.baseurl + mediaPath + (type === 'thumb' ? 'thumb/' : '') + event.media[0].url.replace(/.jpg$/, format) } } else if (type !== 'alt') { - return store.state.settings.baseurl + '/media/' + (type === 'thumb' ? 'thumb/' : '') + 'logo.svg' + return store.state.settings.baseurl + mediaPath + (type === 'thumb' ? 'thumb/' : '') + 'logo.svg' } return '' }) diff --git a/server/helpers.js b/server/helpers.js index 1af57593..c0f42498 100644 --- a/server/helpers.js +++ b/server/helpers.js @@ -91,6 +91,9 @@ module.exports = { const router = express.Router() // serve images/thumb router.use('/media/', express.static(config.upload_path, { immutable: true, maxAge: '1y' }), (_req, res) => res.sendStatus(404)) + router.use('/download/:filename', (req, res, next) => { + return res.download(req.params.filename, undefined, { root: config.upload_path }, err => res.status(404).send('Not found (but nice try 😊)')) + }) router.use('/noimg.svg', express.static('./static/noimg.svg')) router.use('/logo.png', (req, res, next) => { From bc89a04e1ddc32300a006f2853ee7187c6884fa8 Mon Sep 17 00:00:00 2001 From: lesion Date: Mon, 5 Sep 2022 15:28:00 +0200 Subject: [PATCH 08/16] restore range event on calendar --- assets/helper.js | 38 ++++++++++++++++++++++++++------------ 1 file changed, 26 insertions(+), 12 deletions(-) diff --git a/assets/helper.js b/assets/helper.js index 4b7c2185..2643d27e 100644 --- a/assets/helper.js +++ b/assets/helper.js @@ -1,31 +1,45 @@ import dayjs from 'dayjs' -export function attributesFromEvents (_events) { +export function attributesFromEvents(_events) { // const colors = ['teal', 'green', 'yellow', 'teal', 'indigo', 'green', 'red', 'purple', 'pink', 'gray'] // merge events with same date let attributes = [] const now = dayjs().unix() - for(let e of _events) { + for (let e of _events) { const key = dayjs.unix(e.start_datetime).tz().format('YYYYMMDD') - const c = e.start_datetime < now ? 'vc-past' : '' + const c = (e.end_datetime || e.start_datetime) < now ? 'vc-past' : '' + + if (e.multidate) { + attributes.push({ + dates: { start: new Date(e.start_datetime * 1000), end: new Date(e.end_datetime * 1000) }, + highlight: { + start: { fillMode: 'outline' }, + base: { fillMode: 'light' }, + end: { fillMode: 'outline' }, + } + }) + continue + } const i = attributes.find(a => a.day === key) if (!i) { - attributes.push({ day: key, key: e.id, n: 1, dates: new Date(e.start_datetime * 1000), - dot: { color: 'teal', class: c } }) + attributes.push({ + day: key, key: e.id, n: 1, dates: new Date(e.start_datetime * 1000), + dot: { color: 'teal', class: c } + }) continue } i.n++ - if (i.n >= 20 ) { + if (i.n >= 20) { i.dot = { color: 'purple', class: c } - } else if ( i.n >= 10 ) { - i.dot = { color: 'red', class: c} - } else if ( i.n >= 5 ) { - i.dot = { color: 'orange', class: c} - } else if ( i.n >= 3 ) { - i.dot = { color: 'yellow', class: c} + } else if (i.n >= 10) { + i.dot = { color: 'red', class: c } + } else if (i.n >= 5) { + i.dot = { color: 'orange', class: c } + } else if (i.n >= 3) { + i.dot = { color: 'yellow', class: c } } else { i.dot = { color: 'teal', class: c } } From a7b0d37ba07ac9ffd6f97c02b5efc286300043e8 Mon Sep 17 00:00:00 2001 From: lesion Date: Tue, 6 Sep 2022 17:36:10 +0200 Subject: [PATCH 09/16] add preso --- .gitignore | 1 - preso.md | 226 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 226 insertions(+), 1 deletion(-) create mode 100644 preso.md diff --git a/.gitignore b/.gitignore index 4c576367..02e7389e 100644 --- a/.gitignore +++ b/.gitignore @@ -8,7 +8,6 @@ _*.js config*.json tests/seeds/testdb.sqlite -preso.md gancio.sqlite db.sqlite releases diff --git a/preso.md b/preso.md new file mode 100644 index 00000000..6eac2088 --- /dev/null +++ b/preso.md @@ -0,0 +1,226 @@ +# Gancio +_a shared agenda for local communities_ + + +lesion / underscore hacklab / hackmeeting 0x19 + + + +-- + +- a brief history, where we come from +- where are we at +- where we are going + +note: se qualcuno si sta chiedendo giustamente "ma ancora?" + +-- + +## Intro + +- is technology neutral? (hint: nope) +- there are choices based on values... +- ...and consequences + +note: essendo uno dei primi talk rimarchero' un concetto che proprio la +comunita' di hackmeeting mi ha spiegato e non vorrei darlo per assodato in +questo contesto, ovvero che la tecnologia non e' neutrale ma facilita dei casi +d'uso, modifica l'ambito del possibile, quello che facilita e quello che +complica. gli strumenti sono formati dalla visione di chi li ha pensati, +progettati e costruiti e ne propagano i valori. nello sviluppo di strumenti ci +sono quindi scelte progettuali e ci sono delle conseguenze sulle scelte che +vengono fatte, questa e' la teoria. in pratica parliamo di quali sono le +impostazioni di default, quali sono le funzionalita' che scegliamo di +implementare o meno, quali sono i casi d'uso che vogliamo agevolare o meno. +sono domande importanti da farsi quando si sviluppa e quando si usa uno +strumento e cerchero' di spiegare un po' le scelte che sono state fatte su +gancio e perche'. ovviamente queste scelte sono ridiscutibili, siamo qui anche +per questo. + +-- + +
+... choices many of us in the social movements/left/activist scene make to be present in certain social networks, or to use certain technologies due to pragmatism - everybody is there, we need to reach 'common people', and so on. This is totally ok, but I feel we lack spaces to imagine which tools we need, which tech we would want to have if anything was possible? Do we want a FLOSS version of Instagram? Or do we want something completely different? Perhaps pragmatism allows the big tech tools to shape us and how we do our activism? What if we could shape the tools? + +absorto @ hackit_desiderata pad
+ +note: tra le idee di tavole rotonde di quest'anno nel pad c'era questa serie di domande centrali. +questo non lo dico perche' penso che gancio sia chissa' che strumento +rivoluzionario, anzi. lo dico invece piu' che altro per spronarci tutti a farci +di questi ragionamenti e non solo per quanto riguarda gli strumenti tecnici. +dobbiamo chiederci cosa ci serve e perche'! non servono competenze per sognare e +desiderare, serve immaginarci dei modi altri, dei mondi altri. e questo sognare +lo ribadisco non si puo' lasciare ai nerd e basta. + +--- +### where we come from + +- born from needs + +note: carta canta, sgombero asilo 2019 + +-- + +## small & Local + +- size matters +- small tech does not scale and it's ok +- local (no timezone) + +note: progettando strumenti che devono scalare verso l'alto +costruiamo fondamentalmente centri di potere. +non e' solo una questione di software libero o della proprieta' del software... +se fb fosse nostro sarebbe comunque un problema, se il parlamento +fosse nostro sarebbe comunque un problema. +gancio non e' pensato per scalare, anzi, il caso d'uso facilitato +e' quello di un nodo legato ad un territorio e questa scelta +ha poi conseguenze sulla progettazione del sw e sulle conseguenze +nel suo utilizzo. ad es. una delle cons. di questa idea e' il fatto che +il fuso orario degli eventi e' uno per nodo, non per evento. +il caso d'uso poteva essere tematico ad esempio, nazionale, per posto.... +conseguenze sull'uso > gli utenti sanno dove trovarti nella vita vera, +c'e' un rapporto, se domani gancio ha problemi c'e' un canale privilegiato +per comunicare. + +-- +## focus on content + +nowhere on gancio appears the identity of who published the event, not even under a nickname, not even to administrators (except in the db). +This is not an ego-friendly platform. + +note: altre scelte, non c'e' scritto da nessuna parte chi ha postato l'evento.. + +-- + +## random people first +We do not want logged user to get more features than random visitor. +People don't have to register to use it, not even to publish events. + +note: eventi anonimi, gli eventi vanno confermati, possibilita' di modificare gli eventi? +-- +## fuck walled garden +We are not interested in making hits, monitor user activities, sell data or ads: we export events in many ways, via RSS feeds, via global or individual ics, incorporating lists of events or single event via iframe on other websites, via h-event (microformat), via microdata, via ActivityPub, via API. + +--- + +### 3 years later... + +-- + +### Status & Last Updates + +- 25 instances +- 11 languages +- 16k events (3k from gancio.cisti.org) + +-- + +- https://gancio.cisti.org - Torino +- https://lapunta.org - Firenze +- https://sapratza.in - Sardegna +- https://ponente.rocks - Ponente Ligure +- https://bcn.convoca.la/ - Barcellona +- https://lubakiagenda.net/ - Bilbao +- https://bonn.jetzt/ - Bonn +- https://impending.events - Minneapolis + +ma anche istanze tematiche: + +- https://quest.livellosegreto.it - livello segreto +- https://events.osm.lat - OSM latino america + +-- +### Maintainance +> Another flaw in the human character + is that everybody wants to build + and nobody wants to do maintenance.
+ - Kurt Vonnegut + +note: debito tecnico, la roba viene aggiornata, si scoprono bugs frequentemente e aggiornando di scoprono altri bug! + + +-- +Flyer download + +note: anche qui sono scelte, [il componente](https://vuetifyjs.com/en/components/images/) della libreria che sto usando ha fatto altre scelte. + +-- +new time selection widget + +-- + +- tag page +- place page + +-- + +### collection page + +-- + +### restrict new tag entropy + +-- + +### Improve Recurrent events + +-- + +### Redirect based on content-type + +note: feed rss, ics, AP +-- + +- Add microdata support +- sitemap + +--- +### Admin side + +- CLI! + +-- + +- Add MariaDB supports +-- + +- Improve SMTP configuration +- footer links reordering +- Unit Testing +- lot of fixes!! + + +--- + +### Dev side + +-- + +### API + +-- +### Webcomponent + + +-- +### WPGancio + +--- + +## where we are going + +-- +### Plugins! + +--- + +### Wanna help? + + - let's think about what serves the community we want to build + - let's maintain the tools we already have + +--- + +### References + - SITE: https://gancio.org + - DEMO: https://demo.gancio.org From 147958dc85900d9f03f6870603ed1839523e1258 Mon Sep 17 00:00:00 2001 From: lesion Date: Tue, 6 Sep 2022 21:42:32 +0200 Subject: [PATCH 10/16] auto-formatting --- server/api/controller/event.js | 84 +++++++++++++++++----------------- tests/app.test.js | 58 +++++++++++------------ 2 files changed, 71 insertions(+), 71 deletions(-) diff --git a/server/api/controller/event.js b/server/api/controller/event.js index bb2849cf..8824ce14 100644 --- a/server/api/controller/event.js +++ b/server/api/controller/event.js @@ -23,18 +23,18 @@ const log = require('../../log') const eventController = { - async searchMeta (req, res) { + async searchMeta(req, res) { const search = req.query.search const places = await Place.findAll({ order: [[Sequelize.col('w'), 'DESC']], where: { [Op.or]: [ - Sequelize.where(Sequelize.fn('LOWER', Sequelize.col('name')), 'LIKE', '%' + search + '%' ), + Sequelize.where(Sequelize.fn('LOWER', Sequelize.col('name')), 'LIKE', '%' + search + '%'), Sequelize.where(Sequelize.fn('LOWER', Sequelize.col('address')), 'LIKE', '%' + search + '%') ] }, - attributes: [['name', 'label'], 'address', 'id', [Sequelize.cast(Sequelize.fn('COUNT', Sequelize.col('events.placeId')),'INTEGER'), 'w']], + attributes: [['name', 'label'], 'address', 'id', [Sequelize.cast(Sequelize.fn('COUNT', Sequelize.col('events.placeId')), 'INTEGER'), 'w']], include: [{ model: Event, where: { is_visible: true }, required: true, attributes: [] }], group: ['place.id'], raw: true @@ -44,8 +44,8 @@ const eventController = { order: [[Sequelize.col('w'), 'DESC']], where: { tag: Sequelize.where(Sequelize.fn('LOWER', Sequelize.col('tag')), 'LIKE', '%' + search + '%'), - }, - attributes: [['tag','label'], [Sequelize.cast(Sequelize.fn('COUNT', Sequelize.col('tag.tag')), 'INTEGER'), 'w']], + }, + attributes: [['tag', 'label'], [Sequelize.cast(Sequelize.fn('COUNT', Sequelize.col('tag.tag')), 'INTEGER'), 'w']], include: [{ model: Event, where: { is_visible: true }, attributes: [], through: { attributes: [] }, required: true }], group: ['tag.tag'], raw: true @@ -57,13 +57,13 @@ const eventController = { }).concat(tags.map(t => { t.type = 'tag' return t - })).sort( (a, b) => b.w - a.w).slice(0, 10) + })).sort((a, b) => b.w - a.w).slice(0, 10) return res.json(ret) }, - async search (req, res) { + async search(req, res) { const search = req.query.search.trim().toLocaleLowerCase() const show_recurrent = req.query.show_recurrent || false const end = req.query.end @@ -89,11 +89,11 @@ const eventController = { if (search) { replacements.push(search) where[Op.or] = - [ - { title: Sequelize.where(Sequelize.fn('LOWER', Sequelize.col('title')), 'LIKE', '%' + search + '%') }, - Sequelize.where(Sequelize.fn('LOWER', Sequelize.col('name')), 'LIKE', '%' + search + '%'), - Sequelize.fn('EXISTS', Sequelize.literal(`SELECT 1 FROM event_tags WHERE ${Col('event_tags.eventId')}=${Col('event.id')} AND LOWER(${Col('tagTag')}) = ?`)) - ] + [ + { title: Sequelize.where(Sequelize.fn('LOWER', Sequelize.col('title')), 'LIKE', '%' + search + '%') }, + Sequelize.where(Sequelize.fn('LOWER', Sequelize.col('name')), 'LIKE', '%' + search + '%'), + Sequelize.fn('EXISTS', Sequelize.literal(`SELECT 1 FROM event_tags WHERE ${Col('event_tags.eventId')}=${Col('event.id')} AND LOWER(${Col('tagTag')}) = ?`)) + ] } @@ -129,9 +129,9 @@ const eventController = { }, - async getNotifications (event, action) { + async getNotifications(event, action) { log.debug(`getNotifications ${event.title} ${action}`) - function match (event, filters) { + function match(event, filters) { // matches if no filter specified if (!filters) { return true } @@ -170,7 +170,7 @@ const eventController = { }) }, - async get (req, res) { + async get(req, res) { const format = req.params.format || 'json' const is_admin = res.locals.user && res.locals.user.is_admin const slug = req.params.event_slug @@ -222,7 +222,7 @@ const eventController = { recurrent: null, [Op.or]: [ { start_datetime: { [Op.gt]: event.start_datetime } }, - { + { start_datetime: event.start_datetime, id: { [Op.gt]: event.id } } @@ -239,7 +239,7 @@ const eventController = { recurrent: null, [Op.or]: [ { start_datetime: { [Op.lt]: event.start_datetime } }, - { + { start_datetime: event.start_datetime, id: { [Op.lt]: event.id } } @@ -270,7 +270,7 @@ const eventController = { /** confirm an anonymous event * and send related notifications */ - async confirm (req, res) { + async confirm(req, res) { const id = Number(req.params.event_id) const event = await Event.findByPk(id, { include: [Place, Tag] }) if (!event) { @@ -299,7 +299,7 @@ const eventController = { } }, - async unconfirm (req, res) { + async unconfirm(req, res) { const id = Number(req.params.event_id) const event = await Event.findByPk(id) if (!event) { return req.sendStatus(404) } @@ -318,7 +318,7 @@ const eventController = { }, /** get all unconfirmed events */ - async getUnconfirmed (_req, res) { + async getUnconfirmed(_req, res) { try { const events = await Event.findAll({ where: { @@ -336,7 +336,7 @@ const eventController = { } }, - async addNotification (req, res) { + async addNotification(req, res) { try { const notification = { filters: { is_visible: true }, @@ -351,7 +351,7 @@ const eventController = { } }, - async delNotification (req, res) { + async delNotification(req, res) { const remove_code = req.params.code try { const notification = await Notification.findOne({ where: { remove_code } }) @@ -362,14 +362,14 @@ const eventController = { res.sendStatus(200) }, - async isAnonEventAllowed (_req, res, next) { + async isAnonEventAllowed(_req, res, next) { if (!res.locals.settings.allow_anon_event && !res.locals.user) { return res.sendStatus(403) } next() }, - async add (req, res) { + async add(req, res) { // req.err comes from multer streaming error if (req.err) { log.warn(req.err) @@ -380,7 +380,7 @@ const eventController = { const body = req.body const recurrent = body.recurrent ? JSON.parse(body.recurrent) : null - const required_fields = [ 'title', 'start_datetime'] + const required_fields = ['title', 'start_datetime'] let missing_field = required_fields.find(required_field => !body[required_field]) if (missing_field) { log.warn(`${missing_field} required`) @@ -398,7 +398,7 @@ const eventController = { if (!body.place_name) { return res.status(400).send(`Place not found`) } - place = await Place.findOne({ where: Sequelize.where(Sequelize.fn('LOWER', Sequelize.col('name')), Op.eq, body.place_name.trim().toLocaleLowerCase() )}) + place = await Place.findOne({ where: Sequelize.where(Sequelize.fn('LOWER', Sequelize.col('name')), Op.eq, body.place_name.trim().toLocaleLowerCase()) }) if (!place) { if (!body.place_address || !body.place_name) { return res.status(400).send(`place_id or place_name and place_address required`) @@ -479,7 +479,7 @@ const eventController = { } }, - async update (req, res) { + async update(req, res) { if (res.err) { log.warn(req.err) return res.status(400).json(req.err.toString()) @@ -537,7 +537,7 @@ const eventController = { } else if (body.image_focalpoint && event.media.length) { let focalpoint = body.image_focalpoint ? body.image_focalpoint.split(',') : ['0', '0'] focalpoint = [parseFloat(parseFloat(focalpoint[0]).toFixed(2)), parseFloat(parseFloat(focalpoint[1]).toFixed(2))] - eventDetails.media = [ { ...event.media[0], focalpoint } ] // [0].focalpoint = focalpoint + eventDetails.media = [{ ...event.media[0], focalpoint }] // [0].focalpoint = focalpoint } await event.update(eventDetails) @@ -552,7 +552,7 @@ const eventController = { if (!body.place_name) { return res.status(400).send(`Place not found`) } - place = await Place.findOne({ where: Sequelize.where(Sequelize.fn('LOWER', Sequelize.col('name')), Op.eq, body.place_name.trim().toLocaleLowerCase() )}) + place = await Place.findOne({ where: Sequelize.where(Sequelize.fn('LOWER', Sequelize.col('name')), Op.eq, body.place_name.trim().toLocaleLowerCase()) }) if (!place) { if (!body.place_address || !body.place_name) { return res.status(400).send(`place_id or place_name and place_address required`) @@ -565,7 +565,7 @@ const eventController = { } await event.setPlace(place) - + // create/assign tags let tags = [] if (body.tags) { @@ -593,7 +593,7 @@ const eventController = { } }, - async remove (req, res) { + async remove(req, res) { const event = await Event.findByPk(req.params.id) // check if event is mine (or user is admin) if (event && (res.locals.user.is_admin || res.locals.user.id === event.userId)) { @@ -626,7 +626,7 @@ const eventController = { * Method to search for events with pagination and filtering * @returns */ - async _select ({ + async _select({ start = dayjs().unix(), end, tags, @@ -665,8 +665,8 @@ const eventController = { const replacements = [] if (tags && places) { - where[Op.and] = [ - { placeId: places ? places.split(',') : []}, + where[Op.and] = [ + { placeId: places ? places.split(',') : [] }, Sequelize.fn('EXISTS', Sequelize.literal(`SELECT 1 FROM event_tags WHERE ${Col('event_tags.eventId')}=${Col('event.id')} AND LOWER(${Col('tagTag')}) in (?)`)) ] replacements.push(tags) @@ -679,10 +679,10 @@ const eventController = { let pagination = {} if (limit) { - pagination = { + pagination = { limit, offset: limit * page, - } + } } const events = await Event.findAll({ @@ -690,7 +690,7 @@ const eventController = { attributes: { exclude: ['likes', 'boost', 'userId', 'is_visible', 'createdAt', 'description', 'resources', 'recurrent', 'placeId', 'image_path'] }, - order: [['start_datetime', older ? 'DESC' : 'ASC' ]], + order: [['start_datetime', older ? 'DESC' : 'ASC']], include: [ { model: Tag, @@ -717,7 +717,7 @@ const eventController = { /** * Select events based on params */ - async select (req, res) { + async select(req, res) { const settings = res.locals.settings const start = req.query.start || dayjs().unix() const end = req.query.end @@ -738,7 +738,7 @@ const eventController = { /** * Ensure we have the next instance of a recurrent event */ - async _createRecurrentOccurrence (e, startAt) { + async _createRecurrentOccurrence(e, startAt) { log.debug(`Create recurrent event [${e.id}] ${e.title}"`) const event = { parentId: e.id, @@ -798,12 +798,12 @@ const eventController = { /** * Create instances of recurrent events */ - async _createRecurrent (start_datetime = dayjs().unix()) { + async _createRecurrent(start_datetime = dayjs().unix()) { // select recurrent events and its childs const events = await Event.findAll({ where: { is_visible: true, recurrent: { [Op.ne]: null } }, include: [{ model: Tag, required: false }, - { model: Event, as: 'child', required: false, where: { start_datetime: { [Op.gte]: start_datetime } }}], + { model: Event, as: 'child', required: false, where: { start_datetime: { [Op.gte]: start_datetime } } }], order: [['child', 'start_datetime', 'DESC']] }) @@ -811,7 +811,7 @@ const eventController = { const creations = events.map(e => { if (e.child.length) { if (e.child.find(c => c.is_visible)) return - return eventController._createRecurrentOccurrence(e, dayjs.unix(e.child[0].start_datetime+1)) + return eventController._createRecurrentOccurrence(e, dayjs.unix(e.child[0].start_datetime + 1)) } return eventController._createRecurrentOccurrence(e, dayjs()) }) diff --git a/tests/app.test.js b/tests/app.test.js index 11edc388..3271aad3 100644 --- a/tests/app.test.js +++ b/tests/app.test.js @@ -8,7 +8,7 @@ let token let app let places = [] -beforeAll( async () => { +beforeAll(async () => { switch (process.env.DB) { case 'mariadb': process.env.config_path = path.resolve(__dirname, './seeds/config.mariadb.json') @@ -32,7 +32,7 @@ beforeAll( async () => { await sequelize.query('DELETE FROM filters') }) -afterAll( async () => { +afterAll(async () => { await require('../server/initialize.server.js').shutdown(false) }) @@ -77,7 +77,7 @@ describe('Authentication / Authorization', () => { expect(response.body.token_type).toBe('Bearer') token = response.body }) - + test('should get user when authenticated', async () => { const response = await request(app).get('/api/user') .auth(token.access_token, { type: 'bearer' }) @@ -105,16 +105,16 @@ describe('Settings', () => { test('should retrieve stored array settings', async () => { await request(app).post('/api/settings') .auth(token.access_token, { type: 'bearer' }) - .send({ key: 'test', value: [1,2,'test'] }) + .send({ key: 'test', value: [1, 2, 'test'] }) .expect(200) const response = await request(app) .get('/api/settings') .auth(token.access_token, { type: 'bearer' }) .expect(200) - + expect(response.body.test.length).toBe(3) - expect(response.body.test).toStrictEqual([1,2,'test']) + expect(response.body.test).toStrictEqual([1, 2, 'test']) }) @@ -128,7 +128,7 @@ describe('Settings', () => { .get('/api/settings') .auth(token.access_token, { type: 'bearer' }) .expect(200) - + expect(response.body.test.name).toBe('test object') }) @@ -143,9 +143,9 @@ describe('Settings', () => { .get('/api/settings') .auth(token.access_token, { type: 'bearer' }) .expect(200) - + expect(response.body.test).toBe('test string') - }) + }) }) @@ -155,7 +155,7 @@ describe('Events', () => { const required_fields = { 'title': {}, 'start_datetime': { title: 'test title' }, - 'place_id or place_name and place_address': { title: 'test title', start_datetime: dayjs().unix()+1000, place_name: 'test place name'}, + 'place_id or place_name and place_address': { title: 'test title', start_datetime: dayjs().unix() + 1000, place_name: 'test place name' }, } const promises = Object.keys(required_fields).map(async field => { @@ -171,15 +171,15 @@ describe('Events', () => { test('should create anon event only when allowed', async () => { await request(app).post('/api/settings') - .send({ key: 'allow_anon_event', value: false }) - .auth(token.access_token, { type: 'bearer' }) + .send({ key: 'allow_anon_event', value: false }) + .auth(token.access_token, { type: 'bearer' }) .expect(200) await request(app).post('/api/event') .expect(403) let response = await request(app).post('/api/event') - .send({ title: 'test title 2', place_name: 'place name', place_address: 'address', tags: ['test'], start_datetime: dayjs().unix()+1000 }) + .send({ title: 'test title 2', place_name: 'place name', place_address: 'address', tags: ['test'], start_datetime: dayjs().unix() + 1000 }) .auth(token.access_token, { type: 'bearer' }) .expect(200) @@ -189,10 +189,10 @@ describe('Events', () => { await request(app).post('/api/settings') .send({ key: 'allow_anon_event', value: true }) .auth(token.access_token, { type: 'bearer' }) - .expect(200) + .expect(200) response = await request(app).post('/api/event') - .send({ title: 'test title 3', place_name: 'place name 2', place_address: 'address 2', tags: ['test'], start_datetime: dayjs().unix()+1000 }) + .send({ title: 'test title 3', place_name: 'place name 2', place_address: 'address 2', tags: ['test'], start_datetime: dayjs().unix() + 1000 }) .expect(200) expect(response.body.place.id).toBeDefined() @@ -204,7 +204,7 @@ describe('Events', () => { const event = { title: 'test title 4', place_id: places[0], - start_datetime: dayjs().unix()+1000, + start_datetime: dayjs().unix() + 1000, tags: [' test tag '] } @@ -221,7 +221,7 @@ let event = {} describe('Tags', () => { test('should create event with tags', async () => { event = await request(app).post('/api/event') - .send({ title: 'test tags', place_id: places[1], start_datetime: dayjs().unix()+1000 , tags: ['tag1', 'Tag2', 'tAg3'] }) + .send({ title: 'test tags', place_id: places[1], start_datetime: dayjs().unix() + 1000, tags: ['tag1', 'Tag2', 'tAg3'] }) .auth(token.access_token, { type: 'bearer' }) .expect(200) @@ -231,7 +231,7 @@ describe('Tags', () => { test('should create event trimming tags / ignore sensitiviness', async () => { const ret = await request(app).post('/api/event') - .send({ title: 'test trimming tags', place_id: places[1], start_datetime: dayjs().unix()+1000, tags: ['Tag1', 'taG2 '] }) + .send({ title: 'test trimming tags', place_id: places[1], start_datetime: dayjs().unix() + 1000, tags: ['Tag1', 'taG2 '] }) .auth(token.access_token, { type: 'bearer' }) .expect(200) @@ -243,9 +243,9 @@ describe('Tags', () => { test('should modify event tags', async () => { const ret = await request(app).put('/api/event') - .send({ id: event.body.id, tags: ['tag1', 'tag3', 'tag4'], place_id: places[1] }) - .auth(token.access_token, { type: 'bearer' }) - .expect(200) + .send({ id: event.body.id, tags: ['tag1', 'tag3', 'tag4'], place_id: places[1] }) + .auth(token.access_token, { type: 'bearer' }) + .expect(200) expect(ret.body.tags).toStrictEqual(['tag1', 'tAg3', 'tag4']) }) @@ -253,7 +253,7 @@ describe('Tags', () => { test('should return events searching for tags', async () => { const response = await request(app).get('/api/events?tags=tAg3') .expect(200) - + expect(response.body.length).toBe(1) // expect(response.body[0].title).toBe('test tags') expect(response.body[0].tags.length).toBe(3) @@ -264,7 +264,7 @@ describe('Place', () => { test('should get events by place', async () => { const response = await request(app).get('/api/place/place name 2') .expect(200) - + expect(response.body.place.name).toBe('place name 2') expect(response.body.events.length).toBe(2) expect(response.body.events[0].place.name).toBe('place name 2') @@ -277,7 +277,7 @@ describe('Place', () => { const response = await request(app).get('/api/place/all') .auth(token.access_token, { type: 'bearer' }) .expect(200) - + expect(response.body.length).toBe(2) }) @@ -285,7 +285,7 @@ describe('Place', () => { test('should search for a place', async () => { const response = await request(app).get('/api/place?search=place') .expect(200) - + expect(response.body.length).toBe(2) }) @@ -293,7 +293,7 @@ describe('Place', () => { let collections = [] let filters = [] -describe ('Collection', () => { +describe('Collection', () => { test('should not create a new collection if not allowed', () => { return request(app).post('/api/collections') .send({ name: 'test collection' }) @@ -313,8 +313,8 @@ describe ('Collection', () => { const response = await request(app).get('/api/collections/test collection') .expect(200) - expect(response.body.length).toBe(0) - }) + expect(response.body.length).toBe(0) + }) test('should add a new filter', async () => { await request(app) @@ -384,7 +384,7 @@ describe ('Collection', () => { // .expect(200) // expect(response.body.length).toBe(1) - response = await request(app) + response = await request(app) .get(`/api/collections/test collection`) .expect(200) From dc6ad2320739918f74a8f4543f56512c08318609 Mon Sep 17 00:00:00 2001 From: lesion Date: Tue, 6 Sep 2022 21:47:45 +0200 Subject: [PATCH 11/16] add a test to check for #182 --- tests/app.test.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/app.test.js b/tests/app.test.js index 3271aad3..b4dcfd6c 100644 --- a/tests/app.test.js +++ b/tests/app.test.js @@ -258,6 +258,17 @@ describe('Tags', () => { // expect(response.body[0].title).toBe('test tags') expect(response.body[0].tags.length).toBe(3) }) + + test('should return limited events', async () => { + let response = await request(app).get('/api/events?max=1') + .expect(200) + + expect(response.body.length).toBe(1) + response = await request(app).get('/api/events?max=2') + .expect(200) + + expect(response.body.length).toBe(2) + }) }) describe('Place', () => { From c28f4969c4d9575a21958eb63d5f47786a04e055 Mon Sep 17 00:00:00 2001 From: lesion Date: Tue, 6 Sep 2022 21:52:27 +0200 Subject: [PATCH 12/16] fix limit for mariadb on /api/events #183 --- server/api/controller/event.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/api/controller/event.js b/server/api/controller/event.js index 8824ce14..e39b40d7 100644 --- a/server/api/controller/event.js +++ b/server/api/controller/event.js @@ -723,8 +723,8 @@ const eventController = { const end = req.query.end const tags = req.query.tags const places = req.query.places - const limit = req.query.max - const page = req.query.page = 0 + const limit = Number(req.query.max) || 0 + const page = Number(req.query.page) || 0 const older = req.query.older || false const show_recurrent = settings.allow_recurrent_event && From e0d3b107a5677fee0f98dad9bbc5d2b384a5c0dc Mon Sep 17 00:00:00 2001 From: lesion Date: Tue, 6 Sep 2022 21:58:06 +0200 Subject: [PATCH 13/16] v1.5.4 - Update webcomponent deps - Refactor datime display in webcomponent - Force flyer download - Restore range events on calendar - Fix limit/max events for mariadb #183 - Fix endtime selection - Fix microdata address # On branch master # Your branch is up to date with 'origin/master'. # # Changes to be committed: # (use "git restore --staged ..." to unstage) # modified: CHANGELOG # modified: docs/changelog.md # modified: package.json # # Untracked files: # (use "git add ..." to include in what will be committed) # gancio_plugins/ # yunohost/ # # diff --git a/CHANGELOG b/CHANGELOG # index 954e339..0a7c66d 100644 # --- a/CHANGELOG # +++ b/CHANGELOG # @@ -1,5 +1,14 @@ # All notable changes to this project will be documented in this file. # # +### 1.5.4 - 6 set '22 # + - Update webcomponent deps # + - Refactor datime display in webcomponent # + - Force flyer download # + - Restore range events on calendar # + - Fix limit/max events for mariadb #183 # + - Fix endtime selection # + - Fix microdata address # + # ### 1.5.3 - 30 aug '22 # - Fix end time selection when it's in the next day # # diff --git a/docs/changelog.md b/docs/changelog.md # index 59d95e1..d441d93 100644 # --- a/docs/changelog.md # +++ b/docs/changelog.md # @@ -8,6 +8,16 @@ nav_order: 10 # # All notable changes to this project will be documented in this file. # # +### 1.5.4 - 6 set '22 # + - Update webcomponent deps # + - Refactor datime display in webcomponent # + - Force flyer download # + - Restore range events on calendar # + - Fix limit/max events for mariadb #183 # + - Fix endtime selection # + - Fix microdata address # + # + # ### 1.5.3 - 30 aug '22 # - Fix end time selection when it's in the next day # # diff --git a/package.json b/package.json # index 40ed9eb..776596b 100644 # --- a/package.json # +++ b/package.json # @@ -1,6 +1,6 @@ # { # "name": "gancio", # - "version": "1.5.3", # + "version": "1.5.4", # "description": "A shared agenda for local communities", # "author": "lesion", # "scripts": { --- CHANGELOG | 9 +++++++++ docs/changelog.md | 10 ++++++++++ package.json | 2 +- 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 954e339d..0a7c66d2 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,14 @@ All notable changes to this project will be documented in this file. +### 1.5.4 - 6 set '22 + - Update webcomponent deps + - Refactor datime display in webcomponent + - Force flyer download + - Restore range events on calendar + - Fix limit/max events for mariadb #183 + - Fix endtime selection + - Fix microdata address + ### 1.5.3 - 30 aug '22 - Fix end time selection when it's in the next day diff --git a/docs/changelog.md b/docs/changelog.md index 59d95e1f..d441d93a 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -8,6 +8,16 @@ nav_order: 10 All notable changes to this project will be documented in this file. +### 1.5.4 - 6 set '22 + - Update webcomponent deps + - Refactor datime display in webcomponent + - Force flyer download + - Restore range events on calendar + - Fix limit/max events for mariadb #183 + - Fix endtime selection + - Fix microdata address + + ### 1.5.3 - 30 aug '22 - Fix end time selection when it's in the next day diff --git a/package.json b/package.json index 40ed9eb1..776596b4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "gancio", - "version": "1.5.3", + "version": "1.5.4", "description": "A shared agenda for local communities", "author": "lesion", "scripts": { From 4c6295351b596f4814cc859f0ebb694727f2571a Mon Sep 17 00:00:00 2001 From: lesion Date: Wed, 7 Sep 2022 11:48:19 +0200 Subject: [PATCH 14/16] fix some dialog background on light theme --- components/admin/Announcement.vue | 40 +++++++++--------- components/admin/Collections.vue | 70 +++++++++++++++---------------- components/admin/Places.vue | 26 ++++++------ 3 files changed, 68 insertions(+), 68 deletions(-) diff --git a/components/admin/Announcement.vue b/components/admin/Announcement.vue index b04559e2..07f78450 100644 --- a/components/admin/Announcement.vue +++ b/components/admin/Announcement.vue @@ -1,10 +1,10 @@ \ No newline at end of file + diff --git a/components/admin/Places.vue b/components/admin/Places.vue index 4e9b0d14..57a2d010 100644 --- a/components/admin/Places.vue +++ b/components/admin/Places.vue @@ -1,6 +1,6 @@