From e6a6bf274b7db3e7287840e69a437c7898a89be2 Mon Sep 17 00:00:00 2001 From: Laurent <58115082+naaturel@users.noreply.github.com> Date: Wed, 23 Oct 2024 23:01:11 +0200 Subject: [PATCH] Docker compose almost working --- back/Dockerfile | 25 ++ back/build.gradle | 2 +- .../unluckiest/configurations/Security.java | 1 - .../unluckiest/repositories/ScoreRepo.java | 2 +- .../src/main/resources/application.properties | 11 +- .../UnluckiestApplicationTests.java | 4 - compose.yaml | 62 ++- database/Dockerfile | 6 + database/healthcheck.sh | 390 ++++++++++++++++++ database/init.sh | 22 + front/.env.development | 1 + front/.gitignore | 5 +- front/.svelte-kit/ambient.d.ts | 2 + .../.svelte-kit/generated/server/internal.js | 2 +- .../output/client/.vite/manifest.json | 78 ++-- .../_app/immutable/assets/4.T_78NcA1.css | 1 - .../_app/immutable/assets/_page.T_78NcA1.css | 1 - .../_app/immutable/chunks/entry.CWTQmo3s.js | 3 - .../_app/immutable/chunks/index.BEtjop6e.js | 1 - .../_app/immutable/chunks/index.Dz99_Qdh.js | 1 - .../immutable/chunks/scheduler.t-3xYmlC.js | 1 - .../immutable/chunks/scoreStore.BJlEo5Dk.js | 1 - .../_app/immutable/entry/app.BB-guR1A.js | 2 - .../_app/immutable/entry/start.Dk8EHlvX.js | 1 - .../client/_app/immutable/nodes/0.BLjvgh0X.js | 1 - .../client/_app/immutable/nodes/1.DltsNqkt.js | 1 - .../client/_app/immutable/nodes/2.B0UqQsDX.js | 1 - .../client/_app/immutable/nodes/3.vi6sie8m.js | 1 - .../client/_app/immutable/nodes/4.69oG6wwC.js | 1 - .../output/client/_app/version.json | 2 +- .../output/server/.vite/manifest.json | 2 +- .../_app/immutable/assets/_page.T_78NcA1.css | 1 - .../.svelte-kit/output/server/chunks/index.js | 2 +- .../output/server/chunks/internal.js | 2 +- .../output/server/chunks/scoreStore.js | 40 +- front/.svelte-kit/output/server/chunks/ssr.js | 14 +- .../server/entries/pages/_page.svelte.js | 31 +- .../server/entries/pages/play/_page.svelte.js | 6 +- front/.svelte-kit/output/server/index.js | 2 +- .../output/server/manifest-full.js | 2 +- front/.svelte-kit/output/server/manifest.js | 2 +- front/.svelte-kit/output/server/nodes/0.js | 2 +- front/.svelte-kit/output/server/nodes/1.js | 2 +- front/.svelte-kit/output/server/nodes/2.js | 2 +- front/.svelte-kit/output/server/nodes/3.js | 2 +- front/.svelte-kit/output/server/nodes/4.js | 4 +- front/Dockerfile | 13 + front/package-lock.json | 184 ++++++++- front/package.json | 17 +- front/src/lib/components/LeaderBoard.svelte | 4 + front/src/lib/stores/requests.ts | 6 +- front/svelte.config.js | 11 +- front/vite.config.ts | 8 + nginx/Dockerfile | 5 + nginx/better_unluckiest_80 | 16 + nginx/unluckiest_443 | 37 ++ nginx/unluckiest_80 | 26 ++ 57 files changed, 906 insertions(+), 169 deletions(-) create mode 100644 back/Dockerfile create mode 100644 database/Dockerfile create mode 100644 database/healthcheck.sh create mode 100644 database/init.sh create mode 100644 front/.env.development delete mode 100644 front/.svelte-kit/output/client/_app/immutable/assets/4.T_78NcA1.css delete mode 100644 front/.svelte-kit/output/client/_app/immutable/assets/_page.T_78NcA1.css delete mode 100644 front/.svelte-kit/output/client/_app/immutable/chunks/entry.CWTQmo3s.js delete mode 100644 front/.svelte-kit/output/client/_app/immutable/chunks/index.BEtjop6e.js delete mode 100644 front/.svelte-kit/output/client/_app/immutable/chunks/index.Dz99_Qdh.js delete mode 100644 front/.svelte-kit/output/client/_app/immutable/chunks/scheduler.t-3xYmlC.js delete mode 100644 front/.svelte-kit/output/client/_app/immutable/chunks/scoreStore.BJlEo5Dk.js delete mode 100644 front/.svelte-kit/output/client/_app/immutable/entry/app.BB-guR1A.js delete mode 100644 front/.svelte-kit/output/client/_app/immutable/entry/start.Dk8EHlvX.js delete mode 100644 front/.svelte-kit/output/client/_app/immutable/nodes/0.BLjvgh0X.js delete mode 100644 front/.svelte-kit/output/client/_app/immutable/nodes/1.DltsNqkt.js delete mode 100644 front/.svelte-kit/output/client/_app/immutable/nodes/2.B0UqQsDX.js delete mode 100644 front/.svelte-kit/output/client/_app/immutable/nodes/3.vi6sie8m.js delete mode 100644 front/.svelte-kit/output/client/_app/immutable/nodes/4.69oG6wwC.js delete mode 100644 front/.svelte-kit/output/server/_app/immutable/assets/_page.T_78NcA1.css create mode 100644 front/Dockerfile create mode 100644 nginx/Dockerfile create mode 100644 nginx/better_unluckiest_80 create mode 100644 nginx/unluckiest_443 create mode 100644 nginx/unluckiest_80 diff --git a/back/Dockerfile b/back/Dockerfile new file mode 100644 index 0000000..1283e77 --- /dev/null +++ b/back/Dockerfile @@ -0,0 +1,25 @@ +# temp container to build using gradle +FROM gradle:8.10.2-jdk21 AS TEMP_BUILD_IMAGE +ENV APP_HOME=/usr/app/ +WORKDIR $APP_HOME +COPY build.gradle settings.gradle $APP_HOME + +COPY gradle $APP_HOME/gradle +COPY --chown=gradle:gradle . /home/gradle/src +USER root +RUN chown -R gradle /home/gradle/src + +RUN gradle build || return 0 +COPY . . +RUN gradle clean build + +# actual container +FROM eclipse-temurin:21-jdk +ENV ARTIFACT_NAME=unluckiest-1.0.0.jar +ENV APP_HOME=/usr/app/ + +WORKDIR $APP_HOME +COPY --from=TEMP_BUILD_IMAGE $APP_HOME/build/libs/$ARTIFACT_NAME . + +EXPOSE 8000 +ENTRYPOINT exec java -jar ${ARTIFACT_NAME} \ No newline at end of file diff --git a/back/build.gradle b/back/build.gradle index 719a8dc..a6757de 100644 --- a/back/build.gradle +++ b/back/build.gradle @@ -5,7 +5,7 @@ plugins { } springBoot { - mainClass = 'be.naaturel.homestorage.HomeStorageApplication' + mainClass = 'be.naaturel.unluckiest.UnluckiestApplication' } group = 'be.naaturel' diff --git a/back/src/main/java/be/naaturel/unluckiest/configurations/Security.java b/back/src/main/java/be/naaturel/unluckiest/configurations/Security.java index 0a72979..c121722 100644 --- a/back/src/main/java/be/naaturel/unluckiest/configurations/Security.java +++ b/back/src/main/java/be/naaturel/unluckiest/configurations/Security.java @@ -50,7 +50,6 @@ public class Security { config.setAllowedOrigins(Arrays.asList(conf.authorizedHosts)); config.setAllowedMethods(Arrays.asList(conf.authorizedMethods)); config.setAllowedHeaders(Arrays.asList(conf.authorizedHeaders)); - config.setAllowCredentials(true); UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); source.registerCorsConfiguration("/**", config); diff --git a/back/src/main/java/be/naaturel/unluckiest/repositories/ScoreRepo.java b/back/src/main/java/be/naaturel/unluckiest/repositories/ScoreRepo.java index c1fff7d..857fb6a 100644 --- a/back/src/main/java/be/naaturel/unluckiest/repositories/ScoreRepo.java +++ b/back/src/main/java/be/naaturel/unluckiest/repositories/ScoreRepo.java @@ -12,7 +12,7 @@ public interface ScoreRepo extends JpaRepository { @Query( - value = "SELECT * FROM Score s HAVING 10;", + value = "SELECT * FROM score s HAVING 10;", nativeQuery = true) List findLeaderboard(); diff --git a/back/src/main/resources/application.properties b/back/src/main/resources/application.properties index b066a38..92c9394 100644 --- a/back/src/main/resources/application.properties +++ b/back/src/main/resources/application.properties @@ -1,15 +1,18 @@ #=============MAIN============= spring.application.name=unluckiest +#=============SERVER============= +server.port=5000 + #=============SECURITY============= -sec.cors.authorizedHots=http://localhost:5173 +sec.cors.authorizedHots=* sec.cors.authorizedMethods=GET,POST,PUT,DELETE,OPTION sec.cors.authorizedHeader=Authorization,Content-type #=============DATABASE============= -spring.datasource.url=jdbc:mysql://127.0.0.1:3306/unluckiest_db -spring.datasource.username=root -spring.datasource.password= +spring.datasource.url=jdbc:${DB_URL} +spring.datasource.username=${DB_USER} +spring.datasource.password=${DB_PASSWORD} spring.jpa.database-platform=org.hibernate.dialect.MariaDBDialect spring.jpa.show-sql=true diff --git a/back/src/test/java/be/naaturel/unluckiest/UnluckiestApplicationTests.java b/back/src/test/java/be/naaturel/unluckiest/UnluckiestApplicationTests.java index 2b257a5..67febcb 100644 --- a/back/src/test/java/be/naaturel/unluckiest/UnluckiestApplicationTests.java +++ b/back/src/test/java/be/naaturel/unluckiest/UnluckiestApplicationTests.java @@ -6,8 +6,4 @@ import org.springframework.boot.test.context.SpringBootTest; @SpringBootTest class UnluckiestApplicationTests { - @Test - void contextLoads() { - } - } diff --git a/compose.yaml b/compose.yaml index 5e5cdd7..e70dfd4 100644 --- a/compose.yaml +++ b/compose.yaml @@ -1,35 +1,69 @@ volumes: unluckiest_database: +networks: + unluckiest_network: + driver: bridge + services: database: - image: mariadb:latest - container_name: database + build: + context : ./database + dockerfile : Dockerfile environment: - MARIADB_ROOT_PASSWORD=root + - DB_NAME=unluckiest_db + - DB_USER=unluckiest_user + - DB_PASSWORD=_nlckst_prod! volumes: - unluckiest_database:/var/lib/mysql networks: - - unluckiest_network - ports: - - "9000:3306" + - unluckiest_network + healthcheck: + test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"] + start_period: 15s + interval: 10s + timeout: 5s + retries: 3 api: container_name: api build: context: ./back dockerfile: Dockerfile - ports: - - "8000:8000" environment: - DB_URL: mysql://mariadb_test:3306/unluckiest_database - DB_USER: user - DB_PASSWORD: _unlckst_prod! + DB_URL: mysql://database:3306/unluckiest_db + DB_USER: unluckiest_user + DB_PASSWORD: _nlckst_prod! networks: - - storage_network + - unluckiest_network depends_on: - - database + database: + condition: service_healthy -networks: - unluckiest_network: \ No newline at end of file + webapp: + container_name : webapp + build: + context: ./front + dockerfile: Dockerfile + networks: + - unluckiest_network + depends_on: + - api + + reverse_proxy: + container_name : reverse_proxy + build: + context: ./nginx + dockerfile: Dockerfile + ports: + - "80:80" + - "443:443" + volumes: + - ./certs:/etc/ssl/certs + - ./certs:/etc/ssl/private + networks: + - unluckiest_network + depends_on: + - webapp \ No newline at end of file diff --git a/database/Dockerfile b/database/Dockerfile new file mode 100644 index 0000000..d327d09 --- /dev/null +++ b/database/Dockerfile @@ -0,0 +1,6 @@ +FROM mariadb:latest + +COPY ./init.sh /docker-entrypoint-initdb.d/ + +RUN chmod -R 755 /docker-entrypoint-initdb.d/ && \ + chmod +x /docker-entrypoint-initdb.d/init.sh \ No newline at end of file diff --git a/database/healthcheck.sh b/database/healthcheck.sh new file mode 100644 index 0000000..ad0b17f --- /dev/null +++ b/database/healthcheck.sh @@ -0,0 +1,390 @@ +#!/bin/bash +# +# Healthcheck script for MariaDB +# +# Runs various tests on the MariaDB server to check its health. Pass the tests +# to run as arguments. If all tests succeed, the server is considered healthy, +# otherwise it's not. +# +# Arguments are processed in strict order. Set replication_* options before +# the --replication option. This allows a different set of replication checks +# on different connections. +# +# --su{=|-mysql} is option to run the healthcheck as a different unix user. +# Useful if mysql@localhost user exists with unix socket authentication +# Using this option disregards previous options set, so should usually be the +# first option. +# +# Some tests require SQL privileges. +# +# TEST MINIMUM GRANTS REQUIRED +# connect none* +# innodb_initialized USAGE +# innodb_buffer_pool_loaded USAGE +# galera_online USAGE +# galera_ready USAGE +# replication REPLICATION_CLIENT (<10.5)or REPLICA MONITOR (10.5+) +# mariadbupgrade none, however unix user permissions on datadir +# +# The SQL user used is the default for the mariadb client. This can be the unix user +# if no user(or password) is set in the [mariadb-client] section of a configuration +# file. --defaults-{file,extra-file,group-suffix} can specify a file/configuration +# different from elsewhere. +# +# Note * though denied error message will result in error log without +# any permissions. USAGE recommend to avoid this. + +set -eo pipefail + +_process_sql() +{ + mariadb ${nodefaults:+--no-defaults} \ + ${def['file']:+--defaults-file=${def['file']}} \ + ${def['extra_file']:+--defaults-extra-file=${def['extra_file']}} \ + ${def['group_suffix']:+--defaults-group-suffix=${def['group_suffix']}} \ + --skip-ssl --skip-ssl-verify-server-cert \ + --protocol socket \ + -B "$@" +} + +# TESTS + + +# CONNECT +# +# Tests that a connection can be made over TCP, the final state +# of the entrypoint and is listening. The authentication used +# isn't tested. +connect() +{ + local s + # short cut mechanism, to work with --require-secure-transport + s=$(_process_sql --skip-column-names -e 'select @@skip_networking') + case "$s" in + 0|1) + connect_s=$s + return "$s"; + ;; + esac + # falling back to tcp if there wasn't a connection answer. + s=$(mariadb ${nodefaults:+--no-defaults} \ + ${def['file']:+--defaults-file=${def['file']}} \ + ${def['extra_file']:+--defaults-extra-file=${def['extra_file']}} \ + ${def['group_suffix']:+--defaults-group-suffix=${def['group_suffix']}} \ + --skip-ssl --skip-ssl-verify-server-cert \ + -h localhost --protocol tcp \ + --skip-column-names --batch --skip-print-query-on-error \ + -e 'select @@skip_networking' 2>&1) + + case "$s" in + 1) # skip-networking=1 (no network) + ;& + ERROR\ 2002\ \(HY000\):*) + # cannot connect + connect_s=1 + ;; + 0) # skip-networking=0 + ;& + ERROR\ 1820\ \(HY000\)*) # password expire + ;& + ERROR\ 4151\ \(HY000\):*) # account locked + ;& + ERROR\ 1226\ \(42000\)*) # resource limit exceeded + ;& + ERROR\ 1[0-9][0-9][0-9]\ \(28000\):*) + # grep access denied and other 28000 client errors - we did connect + connect_s=0 + ;; + *) + >&2 echo "Unknown error $s" + connect_s=1 + ;; + esac + return $connect_s +} + +# INNODB_INITIALIZED +# +# This tests that the crash recovery of InnoDB has completed +# along with all the other things required to make it to a healthy +# operational state. Note this may return true in the early +# states of initialization. Use with a connect test to avoid +# these false positives. +innodb_initialized() +{ + local s + s=$(_process_sql --skip-column-names -e "select 1 from information_schema.ENGINES WHERE engine='innodb' AND support in ('YES', 'DEFAULT', 'ENABLED')") + [ "$s" == 1 ] +} + +# INNODB_BUFFER_POOL_LOADED +# +# Tests the load of the innodb buffer pool as been complete +# implies innodb_buffer_pool_load_at_startup=1 (default), or if +# manually SET innodb_buffer_pool_load_now=1 +innodb_buffer_pool_loaded() +{ + local s + s=$(_process_sql --skip-column-names -e "select VARIABLE_VALUE from information_schema.GLOBAL_STATUS WHERE VARIABLE_NAME='Innodb_buffer_pool_load_status'") + if [[ $s =~ 'load completed' ]]; then + return 0 + fi + return 1 +} + +# GALERA_ONLINE +# +# Tests that the galera node is in the SYNCed state +galera_online() +{ + local s + s=$(_process_sql --skip-column-names -e "select VARIABLE_VALUE from information_schema.GLOBAL_STATUS WHERE VARIABLE_NAME='WSREP_LOCAL_STATE'") + # 4 from https://galeracluster.com/library/documentation/node-states.html#node-state-changes + # not https://xkcd.com/221/ + if [[ $s -eq 4 ]]; then + return 0 + fi + return 1 +} + +# GALERA_READY +# +# Tests that the Galera provider is ready. +galera_ready() +{ + local s + s=$(_process_sql --skip-column-names -e "select VARIABLE_VALUE from information_schema.GLOBAL_STATUS WHERE VARIABLE_NAME='WSREP_READY'") + if [ "$s" = "ON" ]; then + return 0 + fi + return 1 +} + +# REPLICATION +# +# Tests the replication has the required set of functions: +# --replication_all -> Checks all replication sources +# --replication_name=n -> sets the multisource connection name tested +# --replication_io -> IO thread is running +# --replication_sql -> SQL thread is running +# --replication_seconds_behind_master=n -> less than or equal this seconds of delay +# --replication_sql_remaining_delay=n -> less than or equal this seconds of remaining delay +# (ref: https://mariadb.com/kb/en/delayed-replication/) +replication() +{ + # SHOW REPLICA available 10.5+ + # https://github.com/koalaman/shellcheck/issues/2383 + # shellcheck disable=SC2016,SC2026 + _process_sql -e "SHOW ${repl['all']:+all} REPLICA${repl['all']:+S} ${repl['name']:+'${repl['name']}'} STATUS\G" | \ + { + # required for trim of leading space. + shopt -s extglob + # Row header + read -t 5 -r + # read timeout + [ $? -gt 128 ] && return 1 + while IFS=":" read -t 1 -r n v; do + # Trim leading space + n=${n##+([[:space:]])} + # Leading space on all values by the \G format needs to be trimmed. + v=${v:1} + case "$n" in + Slave_IO_Running) + if [ -n "${repl['io']}" ] && [ "$v" = 'No' ]; then + return 1 + fi + ;; + Slave_SQL_Running) + if [ -n "${repl['sql']}" ] && [ "$v" = 'No' ]; then + return 1 + fi + ;; + Seconds_Behind_Master) + # A NULL value is the IO thread not running: + if [ -n "${repl['seconds_behind_master']}" ] && + { [ "$v" = NULL ] || + (( "${repl['seconds_behind_master']}" < "$v" )); }; then + return 1 + fi + ;; + SQL_Remaining_Delay) + # Unlike Seconds_Behind_Master, sql_remaining_delay will hit NULL + # once replication is caught up - https://mariadb.com/kb/en/delayed-replication/ + if [ -n "${repl['sql_remaining_delay']}" ] && + [ "$v" != NULL ] && + (( "${repl['sql_remaining_delay']}" < "$v" )); then + return 1 + fi + ;; + esac + done + # read timeout + [ $? -gt 128 ] && return 1 + return 0 + } + # reachable in command not found(?) + # shellcheck disable=SC2317 + return $? +} + +# mariadbupgrade +# +# Test the lock on the file $datadir/mariadb_upgrade_info +# https://jira.mariadb.org/browse/MDEV-27068 +mariadbupgrade() +{ + local f="$datadir/mariadb_upgrade_info" + if [ -r "$f" ]; then + flock --exclusive --nonblock -n 9 9<"$f" + return $? + fi + return 0 +} + + +# MAIN + +if [ $# -eq 0 ]; then + echo "At least one argument required" >&2 + exit 1 +fi + +#ENDOFSUBSTITUTIONS +# Marks the end of mysql -> mariadb name changes in 10.6+ +# Global variables used by tests +declare -A repl +declare -A def +nodefaults= +connect_s= +datadir=/var/lib/mysql +if [ -f $datadir/.my-healthcheck.cnf ]; then + def['extra_file']=$datadir/.my-healthcheck.cnf +fi + +_repl_param_check() +{ + case "$1" in + seconds_behind_master) ;& + sql_remaining_delay) + if [ -z "${repl['io']}" ]; then + repl['io']=1 + echo "Forcing --replication_io=1, $1 requires IO thread to be running" >&2 + fi + ;; + all) + if [ -n "${repl['name']}" ]; then + unset 'repl[name]' + echo "Option --replication_all incompatible with specified source --replication_name, clearing replication_name" >&2 + fi + ;; + name) + if [ -n "${repl['all']}" ]; then + unset 'repl[all]' + echo "Option --replication_name incompatible with --replication_all, clearing replication_all" >&2 + fi + ;; + esac +} + +_test_exists() { + declare -F "$1" > /dev/null + return $? +} + +while [ $# -gt 0 ]; do + case "$1" in + --su=*) + u="${1#*=}" + shift + exec gosu "${u}" "${BASH_SOURCE[0]}" "$@" + ;; + --su) + shift + u=$1 + shift + exec gosu "$u" "${BASH_SOURCE[0]}" "$@" + ;; + --su-mysql) + shift + exec gosu mysql "${BASH_SOURCE[0]}" "$@" + ;; + --replication_*=*) + # Change the n to what is between _ and = and make lower case + n=${1#*_} + n=${n%%=*} + n=${n,,*} + # v is after the = + v=${1#*=} + repl[$n]=$v + _repl_param_check "$n" + ;; + --replication_*) + # Without =, look for a non --option next as the value, + # otherwise treat it as an "enable", just equate to 1. + # Clearing option is possible with "--replication_X=" + n=${1#*_} + n=${n,,*} + if [ "${2:0:2}" == '--' ]; then + repl[$n]=1 + else + repl[$n]=$2 + shift + fi + _repl_param_check "$n" + ;; + --datadir=*) + datadir=${1#*=} + ;; + --datadir) + shift + datadir=${1} + ;; + --no-defaults) + def=() + nodefaults=1 + ;; + --defaults-file=*|--defaults-extra-file=*|--defaults-group-suffix=*) + n=${1:11} # length --defaults- + n=${n%%=*} + n=${n//-/_} + # v is after the = + v=${1#*=} + def[$n]=$v + nodefaults= + ;; + --defaults-file|--defaults-extra-file|--defaults-group-suffix) + n=${1:11} # length --defaults- + n=${n//-/_} + if [ "${2:0:2}" == '--' ]; then + def[$n]="" + else + def[$n]=$2 + shift + fi + nodefaults= + ;; + --*) + test=${1#--} + ;; + *) + echo "Unknown healthcheck option $1" >&2 + exit 1 + esac + if [ -n "$test" ]; then + if ! _test_exists "$test" ; then + echo "healthcheck unknown option or test '$test'" >&2 + exit 1 + elif ! "$test"; then + echo "healthcheck $test failed" >&2 + exit 1 + fi + test= + fi + shift +done +if [ "$connect_s" != "0" ]; then + # we didn't pass a connnect test, so the current success status is suspicious + # return what connect thinks. + connect + exit $? +fi diff --git a/database/init.sh b/database/init.sh new file mode 100644 index 0000000..10f48ae --- /dev/null +++ b/database/init.sh @@ -0,0 +1,22 @@ +#!/bin/bash + + +# Check if required environment variables are set +: "${DB_NAME:?Environment variable DB_NAME is required}" +: "${DB_USER:?Environment variable DB_USER is required}" +: "${DB_PASSWORD:?Environment variable DB_PASSWORD is required}" + +# Generate the SQL file using environment variables +echo "Initializing the database with the following details:" +echo "Database Name: $DB_NAME" +echo "User: $DB_USER" +echo "Password: $DB_PASSWORD" + +cat << EOF > /tmp/init-db.sql +CREATE DATABASE IF NOT EXISTS \`$DB_NAME\`; +CREATE USER IF NOT EXISTS '$DB_USER'@'%' IDENTIFIED BY '$DB_PASSWORD'; +GRANT ALL PRIVILEGES ON \`$DB_NAME\`.* TO '$DB_USER'@'%'; +FLUSH PRIVILEGES; +EOF + +mariadb -uroot -p$MARIADB_ROOT_PASSWORD < /tmp/init-db.sql \ No newline at end of file diff --git a/front/.env.development b/front/.env.development new file mode 100644 index 0000000..4b4258d --- /dev/null +++ b/front/.env.development @@ -0,0 +1 @@ +VITE_API_URL=http://127.0.0.1/api \ No newline at end of file diff --git a/front/.gitignore b/front/.gitignore index c6bba59..6e3bc0e 100644 --- a/front/.gitignore +++ b/front/.gitignore @@ -73,7 +73,7 @@ web_modules/ .yarn-integrity # dotenv environment variable files -.env +.env.production .env.development.local .env.test.local .env.production.local @@ -128,3 +128,6 @@ dist .yarn/build-state.yml .yarn/install-state.gz .pnp.* +/build/ +/.svelte-kit/ +/.svelte-kit/ diff --git a/front/.svelte-kit/ambient.d.ts b/front/.svelte-kit/ambient.d.ts index 8c51594..ff7a60e 100644 --- a/front/.svelte-kit/ambient.d.ts +++ b/front/.svelte-kit/ambient.d.ts @@ -26,6 +26,7 @@ * ``` */ declare module '$env/static/private' { + export const VITE_API_URL: string; export const ALLUSERSPROFILE: string; export const APPDATA: string; export const CLion: string; @@ -132,6 +133,7 @@ declare module '$env/static/public' { */ declare module '$env/dynamic/private' { export const env: { + VITE_API_URL: string; ALLUSERSPROFILE: string; APPDATA: string; CLion: string; diff --git a/front/.svelte-kit/generated/server/internal.js b/front/.svelte-kit/generated/server/internal.js index 2be0982..0f6d4e7 100644 --- a/front/.svelte-kit/generated/server/internal.js +++ b/front/.svelte-kit/generated/server/internal.js @@ -21,7 +21,7 @@ export const options = { app: ({ head, body, assets, nonce, env }) => "\n\n\t\n\t\tUnluckiest\n\n\t\t\n\t\t\n\n\t\t\n\t\t\n\n\t\t\n\t\t\n\n\t\t\n\n\t\t" + head + "\n\t\n\t\n\t\t
" + body + "
\n\t\n\n", error: ({ status, message }) => "\n\n\t\n\t\t\n\t\t" + message + "\n\n\t\t\n\t\n\t\n\t\t
\n\t\t\t" + status + "\n\t\t\t
\n\t\t\t\t

" + message + "

\n\t\t\t
\n\t\t
\n\t\n\n" }, - version_hash: "jr2x5n" + version_hash: "t8yzem" }; export async function get_hooks() { diff --git a/front/.svelte-kit/output/client/.vite/manifest.json b/front/.svelte-kit/output/client/.vite/manifest.json index dfcc8e2..330de93 100644 --- a/front/.svelte-kit/output/client/.vite/manifest.json +++ b/front/.svelte-kit/output/client/.vite/manifest.json @@ -1,13 +1,13 @@ { ".svelte-kit/generated/client-optimized/app.js": { - "file": "_app/immutable/entry/app.BB-guR1A.js", + "file": "_app/immutable/entry/app.CZjkDWD3.js", "name": "entry/app", "src": ".svelte-kit/generated/client-optimized/app.js", "isEntry": true, "imports": [ "_preload-helper.C1FmrZbK.js", - "_scheduler.t-3xYmlC.js", - "_index.Dz99_Qdh.js" + "_scheduler.PSnnHpgA.js", + "_index.0641B4xi.js" ], "dynamicImports": [ ".svelte-kit/generated/client-optimized/nodes/0.js", @@ -18,97 +18,97 @@ ] }, ".svelte-kit/generated/client-optimized/nodes/0.js": { - "file": "_app/immutable/nodes/0.BLjvgh0X.js", + "file": "_app/immutable/nodes/0.AnXNanYA.js", "name": "nodes/0", "src": ".svelte-kit/generated/client-optimized/nodes/0.js", "isEntry": true, "isDynamicEntry": true, "imports": [ "_preload-helper.C1FmrZbK.js", - "_scheduler.t-3xYmlC.js", - "_index.Dz99_Qdh.js" + "_scheduler.PSnnHpgA.js", + "_index.0641B4xi.js" ], "dynamicImports": [ "_jquery.DayQ7gTg.js" ] }, ".svelte-kit/generated/client-optimized/nodes/1.js": { - "file": "_app/immutable/nodes/1.DltsNqkt.js", + "file": "_app/immutable/nodes/1.BUIZ54fc.js", "name": "nodes/1", "src": ".svelte-kit/generated/client-optimized/nodes/1.js", "isEntry": true, "isDynamicEntry": true, "imports": [ - "_scheduler.t-3xYmlC.js", - "_index.Dz99_Qdh.js", - "_entry.CWTQmo3s.js" + "_scheduler.PSnnHpgA.js", + "_index.0641B4xi.js", + "_entry.Dac4waFl.js" ] }, ".svelte-kit/generated/client-optimized/nodes/2.js": { - "file": "_app/immutable/nodes/2.B0UqQsDX.js", + "file": "_app/immutable/nodes/2.CnoF6cHq.js", "name": "nodes/2", "src": ".svelte-kit/generated/client-optimized/nodes/2.js", "isEntry": true, "isDynamicEntry": true, "imports": [ - "_scheduler.t-3xYmlC.js", - "_index.Dz99_Qdh.js", - "_scoreStore.BJlEo5Dk.js" + "_scheduler.PSnnHpgA.js", + "_index.0641B4xi.js", + "_scoreStore.d37k1Evl.js" ], "css": [ "_app/immutable/assets/2.DxlxdAfj.css" ] }, ".svelte-kit/generated/client-optimized/nodes/3.js": { - "file": "_app/immutable/nodes/3.vi6sie8m.js", + "file": "_app/immutable/nodes/3.Cz998YEo.js", "name": "nodes/3", "src": ".svelte-kit/generated/client-optimized/nodes/3.js", "isEntry": true, "isDynamicEntry": true, "imports": [ - "_scheduler.t-3xYmlC.js", - "_index.Dz99_Qdh.js" + "_scheduler.PSnnHpgA.js", + "_index.0641B4xi.js" ] }, ".svelte-kit/generated/client-optimized/nodes/4.js": { - "file": "_app/immutable/nodes/4.69oG6wwC.js", + "file": "_app/immutable/nodes/4.DdPoLKDr.js", "name": "nodes/4", "src": ".svelte-kit/generated/client-optimized/nodes/4.js", "isEntry": true, "isDynamicEntry": true, "imports": [ "_preload-helper.C1FmrZbK.js", - "_scheduler.t-3xYmlC.js", - "_index.Dz99_Qdh.js", - "_scoreStore.BJlEo5Dk.js" + "_scheduler.PSnnHpgA.js", + "_index.0641B4xi.js", + "_scoreStore.d37k1Evl.js" ], "dynamicImports": [ "_jquery.DayQ7gTg.js" ], "css": [ - "_app/immutable/assets/4.T_78NcA1.css" + "_app/immutable/assets/4.DKtufWnM.css" ] }, - "_entry.CWTQmo3s.js": { - "file": "_app/immutable/chunks/entry.CWTQmo3s.js", + "_entry.Dac4waFl.js": { + "file": "_app/immutable/chunks/entry.Dac4waFl.js", "name": "entry", "imports": [ - "_scheduler.t-3xYmlC.js", - "_index.BEtjop6e.js" + "_scheduler.PSnnHpgA.js", + "_index.DXEl5lQ6.js" ] }, - "_index.BEtjop6e.js": { - "file": "_app/immutable/chunks/index.BEtjop6e.js", + "_index.0641B4xi.js": { + "file": "_app/immutable/chunks/index.0641B4xi.js", "name": "index", "imports": [ - "_scheduler.t-3xYmlC.js" + "_scheduler.PSnnHpgA.js" ] }, - "_index.Dz99_Qdh.js": { - "file": "_app/immutable/chunks/index.Dz99_Qdh.js", + "_index.DXEl5lQ6.js": { + "file": "_app/immutable/chunks/index.DXEl5lQ6.js", "name": "index", "imports": [ - "_scheduler.t-3xYmlC.js" + "_scheduler.PSnnHpgA.js" ] }, "_jquery.DayQ7gTg.js": { @@ -120,24 +120,24 @@ "file": "_app/immutable/chunks/preload-helper.C1FmrZbK.js", "name": "preload-helper" }, - "_scheduler.t-3xYmlC.js": { - "file": "_app/immutable/chunks/scheduler.t-3xYmlC.js", + "_scheduler.PSnnHpgA.js": { + "file": "_app/immutable/chunks/scheduler.PSnnHpgA.js", "name": "scheduler" }, - "_scoreStore.BJlEo5Dk.js": { - "file": "_app/immutable/chunks/scoreStore.BJlEo5Dk.js", + "_scoreStore.d37k1Evl.js": { + "file": "_app/immutable/chunks/scoreStore.d37k1Evl.js", "name": "scoreStore", "imports": [ - "_index.BEtjop6e.js" + "_index.DXEl5lQ6.js" ] }, "node_modules/@sveltejs/kit/src/runtime/client/entry.js": { - "file": "_app/immutable/entry/start.Dk8EHlvX.js", + "file": "_app/immutable/entry/start.M9x8rur4.js", "name": "entry/start", "src": "node_modules/@sveltejs/kit/src/runtime/client/entry.js", "isEntry": true, "imports": [ - "_entry.CWTQmo3s.js" + "_entry.Dac4waFl.js" ] } } \ No newline at end of file diff --git a/front/.svelte-kit/output/client/_app/immutable/assets/4.T_78NcA1.css b/front/.svelte-kit/output/client/_app/immutable/assets/4.T_78NcA1.css deleted file mode 100644 index 6a0ec78..0000000 --- a/front/.svelte-kit/output/client/_app/immutable/assets/4.T_78NcA1.css +++ /dev/null @@ -1 +0,0 @@ -.container.svelte-31d80g,.player.svelte-31d80g{display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center}.disabled.svelte-31d80g{display:none}.player.svelte-31d80g{gap:2vh}.name.svelte-31d80g{width:17vw;height:6vh;border:2px solid #A1674A;border-radius:10px;box-shadow:0 0 10px #343232}.circular-loader.svelte-31d80g{stroke-dasharray:100,125;stroke-dashoffset:-5;animation:svelte-31d80g-rotate 2s ease-in-out infinite;stroke-linecap:round}.loader-path.svelte-31d80g{width:25vw;height:25vh}button.svelte-31d80g{color:#000;width:18vw;height:15vh;border-radius:10px;background-color:#f1ecec;border:2px solid #A1674A;background-size:1800% 1800%;box-shadow:0 0 10px #343232}.name.svelte-31d80g:hover,button.svelte-31d80g:hover{transform:scale(1.1)}@keyframes svelte-31d80g-rotate{to{transform:rotate(360deg)}} diff --git a/front/.svelte-kit/output/client/_app/immutable/assets/_page.T_78NcA1.css b/front/.svelte-kit/output/client/_app/immutable/assets/_page.T_78NcA1.css deleted file mode 100644 index 6a0ec78..0000000 --- a/front/.svelte-kit/output/client/_app/immutable/assets/_page.T_78NcA1.css +++ /dev/null @@ -1 +0,0 @@ -.container.svelte-31d80g,.player.svelte-31d80g{display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center}.disabled.svelte-31d80g{display:none}.player.svelte-31d80g{gap:2vh}.name.svelte-31d80g{width:17vw;height:6vh;border:2px solid #A1674A;border-radius:10px;box-shadow:0 0 10px #343232}.circular-loader.svelte-31d80g{stroke-dasharray:100,125;stroke-dashoffset:-5;animation:svelte-31d80g-rotate 2s ease-in-out infinite;stroke-linecap:round}.loader-path.svelte-31d80g{width:25vw;height:25vh}button.svelte-31d80g{color:#000;width:18vw;height:15vh;border-radius:10px;background-color:#f1ecec;border:2px solid #A1674A;background-size:1800% 1800%;box-shadow:0 0 10px #343232}.name.svelte-31d80g:hover,button.svelte-31d80g:hover{transform:scale(1.1)}@keyframes svelte-31d80g-rotate{to{transform:rotate(360deg)}} diff --git a/front/.svelte-kit/output/client/_app/immutable/chunks/entry.CWTQmo3s.js b/front/.svelte-kit/output/client/_app/immutable/chunks/entry.CWTQmo3s.js deleted file mode 100644 index eafb120..0000000 --- a/front/.svelte-kit/output/client/_app/immutable/chunks/entry.CWTQmo3s.js +++ /dev/null @@ -1,3 +0,0 @@ -import{t as ct}from"./scheduler.t-3xYmlC.js";import{w as pe}from"./index.BEtjop6e.js";new URL("sveltekit-internal://");function lt(e,n){return e==="/"||n==="ignore"?e:n==="never"?e.endsWith("/")?e.slice(0,-1):e:n==="always"&&!e.endsWith("/")?e+"/":e}function ft(e){return e.split("%25").map(decodeURI).join("%25")}function ut(e){for(const n in e)e[n]=decodeURIComponent(e[n]);return e}function ce({href:e}){return e.split("#")[0]}const dt=["href","pathname","search","toString","toJSON"];function ht(e,n,t){const r=new URL(e);Object.defineProperty(r,"searchParams",{value:new Proxy(r.searchParams,{get(a,o){if(o==="get"||o==="getAll"||o==="has")return s=>(t(s),a[o](s));n();const i=Reflect.get(a,o);return typeof i=="function"?i.bind(a):i}}),enumerable:!0,configurable:!0});for(const a of dt)Object.defineProperty(r,a,{get(){return n(),e[a]},enumerable:!0,configurable:!0});return r}const pt="/__data.json",gt=".html__data.json";function mt(e){return e.endsWith(".html")?e.replace(/\.html$/,gt):e.replace(/\/$/,"")+pt}function yt(...e){let n=5381;for(const t of e)if(typeof t=="string"){let r=t.length;for(;r;)n=n*33^t.charCodeAt(--r)}else if(ArrayBuffer.isView(t)){const r=new Uint8Array(t.buffer,t.byteOffset,t.byteLength);let a=r.length;for(;a;)n=n*33^r[--a]}else throw new TypeError("value must be a string or TypedArray");return(n>>>0).toString(36)}function _t(e){const n=atob(e),t=new Uint8Array(n.length);for(let r=0;r((e instanceof Request?e.method:(n==null?void 0:n.method)||"GET")!=="GET"&&B.delete(ge(e)),$e(e,n));const B=new Map;function wt(e,n){const t=ge(e,n),r=document.querySelector(t);if(r!=null&&r.textContent){let{body:a,...o}=JSON.parse(r.textContent);const i=r.getAttribute("data-ttl");return i&&B.set(t,{body:a,init:o,ttl:1e3*Number(i)}),r.getAttribute("data-b64")!==null&&(a=_t(a)),Promise.resolve(new Response(a,o))}return window.fetch(e,n)}function vt(e,n,t){if(B.size>0){const r=ge(e,t),a=B.get(r);if(a){if(performance.now(){const a=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(r);if(a)return n.push({name:a[1],matcher:a[2],optional:!1,rest:!0,chained:!0}),"(?:/(.*))?";const o=/^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(r);if(o)return n.push({name:o[1],matcher:o[2],optional:!0,rest:!1,chained:!0}),"(?:/([^/]+))?";if(!r)return;const i=r.split(/\[(.+?)\](?!\])/);return"/"+i.map((c,f)=>{if(f%2){if(c.startsWith("x+"))return le(String.fromCharCode(parseInt(c.slice(2),16)));if(c.startsWith("u+"))return le(String.fromCharCode(...c.slice(2).split("-").map(l=>parseInt(l,16))));const d=bt.exec(c),[,h,y,u,g]=d;return n.push({name:u,matcher:g,optional:!!h,rest:!!y,chained:y?f===1&&i[0]==="":!1}),y?"(.*?)":h?"([^/]*)?":"([^/]+?)"}return le(c)}).join("")}).join("")}/?$`),params:n}}function kt(e){return!/^\([^)]+\)$/.test(e)}function Et(e){return e.slice(1).split("/").filter(kt)}function St(e,n,t){const r={},a=e.slice(1),o=a.filter(s=>s!==void 0);let i=0;for(let s=0;sd).join("/"),i=0),f===void 0){c.rest&&(r[c.name]="");continue}if(!c.matcher||t[c.matcher](f)){r[c.name]=f;const d=n[s+1],h=a[s+1];d&&!d.rest&&d.optional&&h&&c.chained&&(i=0),!d&&!h&&Object.keys(r).length===o.length&&(i=0);continue}if(c.optional&&c.chained){i++;continue}return}if(!i)return r}function le(e){return e.normalize().replace(/[[\]]/g,"\\$&").replace(/%/g,"%25").replace(/\//g,"%2[Ff]").replace(/\?/g,"%3[Ff]").replace(/#/g,"%23").replace(/[.*+?^${}()|\\]/g,"\\$&")}function Rt({nodes:e,server_loads:n,dictionary:t,matchers:r}){const a=new Set(n);return Object.entries(t).map(([s,[c,f,d]])=>{const{pattern:h,params:y}=At(s),u={id:s,exec:g=>{const l=h.exec(g);if(l)return St(l,y,r)},errors:[1,...d||[]].map(g=>e[g]),layouts:[0,...f||[]].map(i),leaf:o(c)};return u.errors.length=u.layouts.length=Math.max(u.errors.length,u.layouts.length),u});function o(s){const c=s<0;return c&&(s=~s),[c,e[s]]}function i(s){return s===void 0?s:[a.has(s),e[s]]}}function Fe(e,n=JSON.parse){try{return n(sessionStorage[e])}catch{}}function Ie(e,n,t=JSON.stringify){const r=t(n);try{sessionStorage[e]=r}catch{}}var je;const L=((je=globalThis.__sveltekit_vmq992)==null?void 0:je.base)??"";var De;const It=((De=globalThis.__sveltekit_vmq992)==null?void 0:De.assets)??L,Tt="1728922282538",Ve="sveltekit:snapshot",Be="sveltekit:scroll",qe="sveltekit:states",Lt="sveltekit:pageurl",j="sveltekit:history",G="sveltekit:navigation",J={tap:1,hover:2,viewport:3,eager:4,off:-1,false:-1},K=location.origin;function Ge(e){if(e instanceof URL)return e;let n=document.baseURI;if(!n){const t=document.getElementsByTagName("base");n=t.length?t[0].href:document.URL}return new URL(e,n)}function me(){return{x:pageXOffset,y:pageYOffset}}function N(e,n){return e.getAttribute(`data-sveltekit-${n}`)}const Te={...J,"":J.hover};function Me(e){let n=e.assignedSlot??e.parentNode;return(n==null?void 0:n.nodeType)===11&&(n=n.host),n}function He(e,n){for(;e&&e!==n;){if(e.nodeName.toUpperCase()==="A"&&e.hasAttribute("href"))return e;e=Me(e)}}function ue(e,n){let t;try{t=new URL(e instanceof SVGAElement?e.href.baseVal:e.href,document.baseURI)}catch{}const r=e instanceof SVGAElement?e.target.baseVal:e.target,a=!t||!!r||ne(t,n)||(e.getAttribute("rel")||"").split(/\s+/).includes("external"),o=(t==null?void 0:t.origin)===K&&e.hasAttribute("download");return{url:t,external:a,target:r,download:o}}function W(e){let n=null,t=null,r=null,a=null,o=null,i=null,s=e;for(;s&&s!==document.documentElement;)r===null&&(r=N(s,"preload-code")),a===null&&(a=N(s,"preload-data")),n===null&&(n=N(s,"keepfocus")),t===null&&(t=N(s,"noscroll")),o===null&&(o=N(s,"reload")),i===null&&(i=N(s,"replacestate")),s=Me(s);function c(f){switch(f){case"":case"true":return!0;case"off":case"false":return!1;default:return}}return{preload_code:Te[r??"off"],preload_data:Te[a??"off"],keepfocus:c(n),noscroll:c(t),reload:c(o),replace_state:c(i)}}function Le(e){const n=pe(e);let t=!0;function r(){t=!0,n.update(i=>i)}function a(i){t=!1,n.set(i)}function o(i){let s;return n.subscribe(c=>{(s===void 0||t&&c!==s)&&i(s=c)})}return{notify:r,set:a,subscribe:o}}function Ut(){const{set:e,subscribe:n}=pe(!1);let t;async function r(){clearTimeout(t);try{const a=await fetch(`${It}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(!a.ok)return!1;const i=(await a.json()).version!==Tt;return i&&(e(!0),clearTimeout(t)),i}catch{return!1}}return{subscribe:n,check:r}}function ne(e,n){return e.origin!==K||!e.pathname.startsWith(n)}function Ue(e){const n=xt(e),t=new ArrayBuffer(n.length),r=new DataView(t);for(let a=0;a>16),n+=String.fromCharCode((t&65280)>>8),n+=String.fromCharCode(t&255),t=r=0);return r===12?(t>>=4,n+=String.fromCharCode(t)):r===18&&(t>>=2,n+=String.fromCharCode((t&65280)>>8),n+=String.fromCharCode(t&255)),n}const Ct=-1,Nt=-2,Ot=-3,jt=-4,Dt=-5,$t=-6;function Ft(e,n){if(typeof e=="number")return a(e,!0);if(!Array.isArray(e)||e.length===0)throw new Error("Invalid input");const t=e,r=Array(t.length);function a(o,i=!1){if(o===Ct)return;if(o===Ot)return NaN;if(o===jt)return 1/0;if(o===Dt)return-1/0;if(o===$t)return-0;if(i)throw new Error("Invalid input");if(o in r)return r[o];const s=t[o];if(!s||typeof s!="object")r[o]=s;else if(Array.isArray(s))if(typeof s[0]=="string"){const c=s[0],f=n==null?void 0:n[c];if(f)return r[o]=f(a(s[1]));switch(c){case"Date":r[o]=new Date(s[1]);break;case"Set":const d=new Set;r[o]=d;for(let u=1;un!=null)}class re{constructor(n,t){this.status=n,typeof t=="string"?this.body={message:t}:t?this.body=t:this.body={message:`Error: ${n}`}}toString(){return JSON.stringify(this.body)}}class Ye{constructor(n,t){this.status=n,this.location=t}}class ye extends Error{constructor(n,t,r){super(r),this.status=n,this.text=t}}const qt="x-sveltekit-invalidated",Gt="x-sveltekit-trailing-slash";function z(e){return e instanceof re||e instanceof ye?e.status:500}function Mt(e){return e instanceof ye?e.text:"Internal Error"}const C=Fe(Be)??{},M=Fe(Ve)??{},P={url:Le({}),page:Le({}),navigating:pe(null),updated:Ut()};function _e(e){C[e]=me()}function Ht(e,n){let t=e+1;for(;C[t];)delete C[t],t+=1;for(t=n+1;M[t];)delete M[t],t+=1}function $(e){return location.href=e.href,new Promise(()=>{})}function Pe(){}let ae,de,X,U,he,F;const Je=[],Z=[];let R=null;const We=[],Kt=[];let O=[],_={branch:[],error:null,url:null},we=!1,Q=!1,xe=!0,H=!1,V=!1,ze=!1,ve=!1,be,E,T,I,ee;const q=new Set;async function an(e,n,t){var a,o;document.URL!==location.href&&(location.href=location.href),F=e,ae=Rt(e),U=document.documentElement,he=n,de=e.nodes[0],X=e.nodes[1],de(),X(),E=(a=history.state)==null?void 0:a[j],T=(o=history.state)==null?void 0:o[G],E||(E=T=Date.now(),history.replaceState({...history.state,[j]:E,[G]:T},""));const r=C[E];r&&(history.scrollRestoration="manual",scrollTo(r.x,r.y)),t?await en(he,t):Zt(location.href,{replaceState:!0}),Qt()}function Yt(){Je.length=0,ve=!1}function Xe(e){Z.some(n=>n==null?void 0:n.snapshot)&&(M[e]=Z.map(n=>{var t;return(t=n==null?void 0:n.snapshot)==null?void 0:t.capture()}))}function Ze(e){var n;(n=M[e])==null||n.forEach((t,r)=>{var a,o;(o=(a=Z[r])==null?void 0:a.snapshot)==null||o.restore(t)})}function Ce(){_e(E),Ie(Be,C),Xe(T),Ie(Ve,M)}async function Qe(e,n,t,r){return Y({type:"goto",url:Ge(e),keepfocus:n.keepFocus,noscroll:n.noScroll,replace_state:n.replaceState,state:n.state,redirect_count:t,nav_token:r,accept:()=>{n.invalidateAll&&(ve=!0)}})}async function Jt(e){if(e.id!==(R==null?void 0:R.id)){const n={};q.add(n),R={id:e.id,token:n,promise:tt({...e,preload:n}).then(t=>(q.delete(n),t.type==="loaded"&&t.state.error&&(R=null),t))}}return R.promise}async function fe(e){const n=ae.find(t=>t.exec(nt(e)));n&&await Promise.all([...n.layouts,n.leaf].map(t=>t==null?void 0:t[1]()))}function et(e,n,t){var o;_=e.state;const r=document.querySelector("style[data-sveltekit]");r&&r.remove(),I=e.props.page,be=new F.root({target:n,props:{...e.props,stores:P,components:Z},hydrate:t,sync:!1}),Ze(T);const a={from:null,to:{params:_.params,route:{id:((o=_.route)==null?void 0:o.id)??null},url:new URL(location.href)},willUnload:!1,type:"enter",complete:Promise.resolve()};O.forEach(i=>i(a)),Q=!0}function te({url:e,params:n,branch:t,status:r,error:a,route:o,form:i}){let s="never";if(L&&(e.pathname===L||e.pathname===L+"/"))s="always";else for(const u of t)(u==null?void 0:u.slash)!==void 0&&(s=u.slash);e.pathname=lt(e.pathname,s),e.search=e.search;const c={type:"loaded",state:{url:e,params:n,branch:t,error:a,route:o},props:{constructors:Bt(t).map(u=>u.node.component),page:I}};i!==void 0&&(c.props.form=i);let f={},d=!I,h=0;for(let u=0;u(s&&(c.route=!0),l[m])}),params:new Proxy(r,{get:(l,m)=>(s&&c.params.add(m),l[m])}),data:(o==null?void 0:o.data)??null,url:ht(t,()=>{s&&(c.url=!0)},l=>{s&&c.search_params.add(l)}),async fetch(l,m){let b;l instanceof Request?(b=l.url,m={body:l.method==="GET"||l.method==="HEAD"?void 0:await l.blob(),cache:l.cache,credentials:l.credentials,headers:l.headers,integrity:l.integrity,keepalive:l.keepalive,method:l.method,mode:l.mode,redirect:l.redirect,referrer:l.referrer,referrerPolicy:l.referrerPolicy,signal:l.signal,...m}):b=l;const S=new URL(b,t);return s&&u(S.href),S.origin===t.origin&&(b=S.href.slice(t.origin.length)),Q?vt(b,S.href,m):wt(b,m)},setHeaders:()=>{},depends:u,parent(){return s&&(c.parent=!0),n()},untrack(l){s=!1;try{return l()}finally{s=!0}}};i=await f.universal.load.call(null,g)??null}return{node:f,loader:e,server:o,universal:(h=f.universal)!=null&&h.load?{type:"data",data:i,uses:c}:null,data:i??(o==null?void 0:o.data)??null,slash:((y=f.universal)==null?void 0:y.trailingSlash)??(o==null?void 0:o.slash)}}function Ne(e,n,t,r,a,o){if(ve)return!0;if(!a)return!1;if(a.parent&&e||a.route&&n||a.url&&t)return!0;for(const i of a.search_params)if(r.has(i))return!0;for(const i of a.params)if(o[i]!==_.params[i])return!0;for(const i of a.dependencies)if(Je.some(s=>s(new URL(i))))return!0;return!1}function ke(e,n){return(e==null?void 0:e.type)==="data"?e:(e==null?void 0:e.type)==="skip"?n??null:null}function Wt(e,n){if(!e)return new Set(n.searchParams.keys());const t=new Set([...e.searchParams.keys(),...n.searchParams.keys()]);for(const r of t){const a=e.searchParams.getAll(r),o=n.searchParams.getAll(r);a.every(i=>o.includes(i))&&o.every(i=>a.includes(i))&&t.delete(r)}return t}function Oe({error:e,url:n,route:t,params:r}){return{type:"loaded",state:{error:e,url:n,route:t,params:r,branch:[]},props:{page:I,constructors:[]}}}async function tt({id:e,invalidating:n,url:t,params:r,route:a,preload:o}){if((R==null?void 0:R.id)===e)return q.delete(R.token),R.promise;const{errors:i,layouts:s,leaf:c}=a,f=[...s,c];i.forEach(p=>p==null?void 0:p().catch(()=>{})),f.forEach(p=>p==null?void 0:p[1]().catch(()=>{}));let d=null;const h=_.url?e!==_.url.pathname+_.url.search:!1,y=_.route?a.id!==_.route.id:!1,u=Wt(_.url,t);let g=!1;const l=f.map((p,v)=>{var x;const A=_.branch[v],k=!!(p!=null&&p[0])&&((A==null?void 0:A.loader)!==p[1]||Ne(g,y,h,u,(x=A.server)==null?void 0:x.uses,r));return k&&(g=!0),k});if(l.some(Boolean)){try{d=await ot(t,l)}catch(p){const v=await D(p,{url:t,params:r,route:{id:e}});return q.has(o)?Oe({error:v,url:t,params:r,route:a}):oe({status:z(p),error:v,url:t,route:a})}if(d.type==="redirect")return d}const m=d==null?void 0:d.nodes;let b=!1;const S=f.map(async(p,v)=>{var se;if(!p)return;const A=_.branch[v],k=m==null?void 0:m[v];if((!k||k.type==="skip")&&p[1]===(A==null?void 0:A.loader)&&!Ne(b,y,h,u,(se=A.universal)==null?void 0:se.uses,r))return A;if(b=!0,(k==null?void 0:k.type)==="error")throw k;return Ae({loader:p[1],url:t,params:r,route:a,parent:async()=>{var Re;const Se={};for(let ie=0;ie{});const w=[];for(let p=0;pPromise.resolve({}),server_data_node:ke(o)}),c={node:await X(),loader:X,universal:null,server:null,data:null};return te({url:t,params:a,branch:[s,c],status:e,error:n,route:null})}function Ee(e,n){if(!e||ne(e,L))return;let t;try{t=F.hooks.reroute({url:new URL(e)})??e.pathname}catch{return}const r=nt(t);for(const a of ae){const o=a.exec(r);if(o)return{id:e.pathname+e.search,invalidating:n,route:a,params:ut(o),url:e}}}function nt(e){return ft(e.slice(L.length)||"/")}function rt({url:e,type:n,intent:t,delta:r}){let a=!1;const o=it(_,t,e,n);r!==void 0&&(o.navigation.delta=r);const i={...o.navigation,cancel:()=>{a=!0,o.reject(new Error("navigation cancelled"))}};return H||We.forEach(s=>s(i)),a?null:o}async function Y({type:e,url:n,popped:t,keepfocus:r,noscroll:a,replace_state:o,state:i={},redirect_count:s=0,nav_token:c={},accept:f=Pe,block:d=Pe}){const h=Ee(n,!1),y=rt({url:n,type:e,delta:t==null?void 0:t.delta,intent:h});if(!y){d();return}const u=E,g=T;f(),H=!0,Q&&P.navigating.set(y.navigation),ee=c;let l=h&&await tt(h);if(!l){if(ne(n,L))return await $(n);l=await at(n,{id:null},await D(new ye(404,"Not Found",`Not found: ${n.pathname}`),{url:n,params:{},route:{id:null}}),404)}if(n=(h==null?void 0:h.url)||n,ee!==c)return y.reject(new Error("navigation aborted")),!1;if(l.type==="redirect")if(s>=20)l=await oe({status:500,error:await D(new Error("Redirect loop"),{url:n,params:{},route:{id:null}}),url:n,route:{id:null}});else return Qe(new URL(l.location,n).href,{},s+1,c),!1;else l.props.page.status>=400&&await P.updated.check()&&await $(n);if(Yt(),_e(u),Xe(g),l.props.page.url.pathname!==n.pathname&&(n.pathname=l.props.page.url.pathname),i=t?t.state:i,!t){const w=o?0:1,p={[j]:E+=w,[G]:T+=w,[qe]:i};(o?history.replaceState:history.pushState).call(history,p,"",n),o||Ht(E,T)}if(R=null,l.props.page.state=i,Q){_=l.state,l.props.page&&(l.props.page.url=n);const w=(await Promise.all(Kt.map(p=>p(y.navigation)))).filter(p=>typeof p=="function");if(w.length>0){let p=function(){O=O.filter(v=>!w.includes(v))};w.push(p),O.push(...w)}be.$set(l.props),ze=!0}else et(l,he,!1);const{activeElement:m}=document;await ct();const b=t?t.scroll:a?me():null;if(xe){const w=n.hash&&document.getElementById(decodeURIComponent(n.hash.slice(1)));b?scrollTo(b.x,b.y):w?w.scrollIntoView():scrollTo(0,0)}const S=document.activeElement!==m&&document.activeElement!==document.body;!r&&!S&&tn(),xe=!0,l.props.page&&(I=l.props.page),H=!1,e==="popstate"&&Ze(T),y.fulfil(void 0),O.forEach(w=>w(y.navigation)),P.navigating.set(null)}async function at(e,n,t,r){return e.origin===K&&e.pathname===location.pathname&&!we?await oe({status:r,error:t,url:e,route:n}):await $(e)}function Xt(){let e;U.addEventListener("mousemove",o=>{const i=o.target;clearTimeout(e),e=setTimeout(()=>{r(i,2)},20)});function n(o){r(o.composedPath()[0],1)}U.addEventListener("mousedown",n),U.addEventListener("touchstart",n,{passive:!0});const t=new IntersectionObserver(o=>{for(const i of o)i.isIntersecting&&(fe(i.target.href),t.unobserve(i.target))},{threshold:0});function r(o,i){const s=He(o,U);if(!s)return;const{url:c,external:f,download:d}=ue(s,L);if(f||d)return;const h=W(s),y=c&&_.url.pathname+_.url.search===c.pathname+c.search;if(!h.reload&&!y)if(i<=h.preload_data){const u=Ee(c,!1);u&&Jt(u)}else i<=h.preload_code&&fe(c.pathname)}function a(){t.disconnect();for(const o of U.querySelectorAll("a")){const{url:i,external:s,download:c}=ue(o,L);if(s||c)continue;const f=W(o);f.reload||(f.preload_code===J.viewport&&t.observe(o),f.preload_code===J.eager&&fe(i.pathname))}}O.push(a),a()}function D(e,n){if(e instanceof re)return e.body;const t=z(e),r=Mt(e);return F.hooks.handleError({error:e,event:n,status:t,message:r})??{message:r}}function Zt(e,n={}){return e=Ge(e),e.origin!==K?Promise.reject(new Error("goto: invalid URL")):Qe(e,n,0)}function Qt(){var n;history.scrollRestoration="manual",addEventListener("beforeunload",t=>{let r=!1;if(Ce(),!H){const a=it(_,void 0,null,"leave"),o={...a.navigation,cancel:()=>{r=!0,a.reject(new Error("navigation cancelled"))}};We.forEach(i=>i(o))}r?(t.preventDefault(),t.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&Ce()}),(n=navigator.connection)!=null&&n.saveData||Xt(),U.addEventListener("click",async t=>{var y;if(t.button||t.which!==1||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.defaultPrevented)return;const r=He(t.composedPath()[0],U);if(!r)return;const{url:a,external:o,target:i,download:s}=ue(r,L);if(!a)return;if(i==="_parent"||i==="_top"){if(window.parent!==window)return}else if(i&&i!=="_self")return;const c=W(r);if(!(r instanceof SVGAElement)&&a.protocol!==location.protocol&&!(a.protocol==="https:"||a.protocol==="http:")||s)return;if(o||c.reload){rt({url:a,type:"link"})?H=!0:t.preventDefault();return}const[d,h]=a.href.split("#");if(h!==void 0&&d===ce(location)){const[,u]=_.url.href.split("#");if(u===h){t.preventDefault(),h===""||h==="top"&&r.ownerDocument.getElementById("top")===null?window.scrollTo({top:0}):(y=r.ownerDocument.getElementById(h))==null||y.scrollIntoView();return}if(V=!0,_e(E),e(a),!c.replace_state)return;V=!1}t.preventDefault(),await new Promise(u=>{requestAnimationFrame(()=>{setTimeout(u,0)}),setTimeout(u,100)}),Y({type:"link",url:a,keepfocus:c.keepfocus,noscroll:c.noscroll,replace_state:c.replace_state??a.href===location.href})}),U.addEventListener("submit",t=>{if(t.defaultPrevented)return;const r=HTMLFormElement.prototype.cloneNode.call(t.target),a=t.submitter;if(((a==null?void 0:a.formTarget)||r.target)==="_blank"||((a==null?void 0:a.formMethod)||r.method)!=="get")return;const s=new URL((a==null?void 0:a.hasAttribute("formaction"))&&(a==null?void 0:a.formAction)||r.action);if(ne(s,L))return;const c=t.target,f=W(c);if(f.reload)return;t.preventDefault(),t.stopPropagation();const d=new FormData(c),h=a==null?void 0:a.getAttribute("name");h&&d.append(h,(a==null?void 0:a.getAttribute("value"))??""),s.search=new URLSearchParams(d).toString(),Y({type:"form",url:s,keepfocus:f.keepfocus,noscroll:f.noscroll,replace_state:f.replace_state??s.href===location.href})}),addEventListener("popstate",async t=>{var r;if((r=t.state)!=null&&r[j]){const a=t.state[j];if(ee={},a===E)return;const o=C[a],i=t.state[qe]??{},s=new URL(t.state[Lt]??location.href),c=t.state[G],f=ce(location)===ce(_.url);if(c===T&&(ze||f)){e(s),C[E]=me(),o&&scrollTo(o.x,o.y),i!==I.state&&(I={...I,state:i},be.$set({page:I})),E=a;return}const h=a-E;await Y({type:"popstate",url:s,popped:{state:i,scroll:o,delta:h},accept:()=>{E=a,T=c},block:()=>{history.go(-h)},nav_token:ee})}else if(!V){const a=new URL(location.href);e(a)}}),addEventListener("hashchange",()=>{V&&(V=!1,history.replaceState({...history.state,[j]:++E,[G]:T},"",location.href))});for(const t of document.querySelectorAll("link"))t.rel==="icon"&&(t.href=t.href);addEventListener("pageshow",t=>{t.persisted&&P.navigating.set(null)});function e(t){_.url=t,P.page.set({...I,url:t}),P.page.notify()}}async function en(e,{status:n=200,error:t,node_ids:r,params:a,route:o,data:i,form:s}){we=!0;const c=new URL(location.href);({params:a={},route:o={id:null}}=Ee(c,!1)||{});let f;try{const d=r.map(async(u,g)=>{const l=i[g];return l!=null&&l.uses&&(l.uses=st(l.uses)),Ae({loader:F.nodes[u],url:c,params:a,route:o,parent:async()=>{const m={};for(let b=0;bu===o.id);if(y){const u=y.layouts;for(let g=0;go?"1":"0").join(""));const r=await $e(t.href);if(!r.ok){let o;throw(a=r.headers.get("content-type"))!=null&&a.includes("application/json")?o=await r.json():r.status===404?o="Not Found":r.status===500&&(o="Internal Error"),new re(r.status,o)}return new Promise(async o=>{var h;const i=new Map,s=r.body.getReader(),c=new TextDecoder;function f(y){return Ft(y,{Promise:u=>new Promise((g,l)=>{i.set(u,{fulfil:g,reject:l})})})}let d="";for(;;){const{done:y,value:u}=await s.read();if(y&&!d)break;for(d+=!u&&d?` -`:c.decode(u,{stream:!0});;){const g=d.indexOf(` -`);if(g===-1)break;const l=JSON.parse(d.slice(0,g));if(d=d.slice(g+1),l.type==="redirect")return o(l);if(l.type==="data")(h=l.nodes)==null||h.forEach(m=>{(m==null?void 0:m.type)==="data"&&(m.uses=st(m.uses),m.data=f(m.data))}),o(l);else if(l.type==="chunk"){const{id:m,data:b,error:S}=l,w=i.get(m);i.delete(m),S?w.reject(f(S)):w.fulfil(f(b))}}}})}function st(e){return{dependencies:new Set((e==null?void 0:e.dependencies)??[]),params:new Set((e==null?void 0:e.params)??[]),parent:!!(e!=null&&e.parent),route:!!(e!=null&&e.route),url:!!(e!=null&&e.url),search_params:new Set((e==null?void 0:e.search_params)??[])}}function tn(){const e=document.querySelector("[autofocus]");if(e)e.focus();else{const n=document.body,t=n.getAttribute("tabindex");n.tabIndex=-1,n.focus({preventScroll:!0,focusVisible:!1}),t!==null?n.setAttribute("tabindex",t):n.removeAttribute("tabindex");const r=getSelection();if(r&&r.type!=="None"){const a=[];for(let o=0;o{if(r.rangeCount===a.length){for(let o=0;o{a=d,o=h});return i.catch(()=>{}),{navigation:{from:{params:e.params,route:{id:((c=e.route)==null?void 0:c.id)??null},url:e.url},to:t&&{params:(n==null?void 0:n.params)??null,route:{id:((f=n==null?void 0:n.route)==null?void 0:f.id)??null},url:t},willUnload:!n,type:r,complete:i},fulfil:a,reject:o}}export{an as a,P as s}; diff --git a/front/.svelte-kit/output/client/_app/immutable/chunks/index.BEtjop6e.js b/front/.svelte-kit/output/client/_app/immutable/chunks/index.BEtjop6e.js deleted file mode 100644 index d3c020b..0000000 --- a/front/.svelte-kit/output/client/_app/immutable/chunks/index.BEtjop6e.js +++ /dev/null @@ -1 +0,0 @@ -import{n as f,s as l}from"./scheduler.t-3xYmlC.js";const e=[];function h(n,b=f){let i;const o=new Set;function r(t){if(l(n,t)&&(n=t,i)){const c=!e.length;for(const s of o)s[1](),e.push(s,n);if(c){for(let s=0;s{o.delete(s),o.size===0&&i&&(i(),i=null)}}return{set:r,update:u,subscribe:p}}export{h as w}; diff --git a/front/.svelte-kit/output/client/_app/immutable/chunks/index.Dz99_Qdh.js b/front/.svelte-kit/output/client/_app/immutable/chunks/index.Dz99_Qdh.js deleted file mode 100644 index 4b5fee5..0000000 --- a/front/.svelte-kit/output/client/_app/immutable/chunks/index.Dz99_Qdh.js +++ /dev/null @@ -1 +0,0 @@ -var C=Object.defineProperty;var j=(e,t,n)=>t in e?C(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var p=(e,t,n)=>j(e,typeof t!="symbol"?t+"":t,n);import{r as h,n as y,i as w,j as B,k as E,l as I,m as b,p as L,q as P,v as N,w as T,x as q,y as D}from"./scheduler.t-3xYmlC.js";let $=!1;function H(){$=!0}function M(){$=!1}function O(e,t,n,i){for(;e>1);n(l)<=i?e=l+1:t=l}return e}function z(e){if(e.hydrate_init)return;e.hydrate_init=!0;let t=e.childNodes;if(e.nodeName==="HEAD"){const r=[];for(let s=0;s0&&t[n[l]].claim_order<=s?l+1:O(1,l,_=>t[n[_]].claim_order,s))-1;i[r]=n[o]+1;const c=o+1;n[c]=r,l=Math.max(c,l)}const f=[],a=[];let u=t.length-1;for(let r=n[l]+1;r!=0;r=i[r-1]){for(f.push(t[r-1]);u>=r;u--)a.push(t[u]);u--}for(;u>=0;u--)a.push(t[u]);f.reverse(),a.sort((r,s)=>r.claim_order-s.claim_order);for(let r=0,s=0;r=f[s].claim_order;)s++;const o=se.removeEventListener(t,n,i)}function ae(e,t,n){n==null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function le(e){return e.dataset.svelteH}function F(e){return Array.from(e.childNodes)}function G(e){e.claim_info===void 0&&(e.claim_info={last_index:0,total_claimed:0})}function S(e,t,n,i,l=!1){G(e);const f=(()=>{for(let a=e.claim_info.last_index;a=0;a--){const u=e[a];if(t(u)){const r=n(u);return r===void 0?e.splice(a,1):e[a]=r,l?r===void 0&&e.claim_info.last_index--:e.claim_info.last_index=a,u}}return i()})();return f.claim_order=e.claim_info.total_claimed,e.claim_info.total_claimed+=1,f}function A(e,t,n,i){return S(e,l=>l.nodeName===t,l=>{const f=[];for(let a=0;al.removeAttribute(a))},()=>i(t))}function ue(e,t,n){return A(e,t,n,V)}function fe(e,t,n){return A(e,t,n,W)}function J(e,t){return S(e,n=>n.nodeType===3,n=>{const i=""+t;if(n.data.startsWith(i)){if(n.data.length!==i.length)return n.splitText(i.length)}else n.data=i},()=>x(t),!0)}function ce(e){return J(e," ")}function oe(e,t){t=""+t,e.data!==t&&(e.data=t)}function de(e,t){e.value=t??""}function _e(e,t,n,i){n==null?e.style.removeProperty(t):e.style.setProperty(t,n,"")}function me(e,t){return new e(t)}const m=new Set;let d;function he(){d={r:0,c:[],p:d}}function $e(){d.r||h(d.c),d=d.p}function K(e,t){e&&e.i&&(m.delete(e),e.i(t))}function pe(e,t,n,i){if(e&&e.o){if(m.has(e))return;m.add(e),d.c.push(()=>{m.delete(e),i&&(n&&e.d(1),i())}),e.o(t)}else i&&i()}function ye(e,t,n){const i=e.$$.props[t];i!==void 0&&(e.$$.bound[i]=n,n(e.$$.ctx[i]))}function xe(e){e&&e.c()}function ge(e,t){e&&e.l(t)}function Q(e,t,n){const{fragment:i,after_update:l}=e.$$;i&&i.m(t,n),b(()=>{const f=e.$$.on_mount.map(T).filter(E);e.$$.on_destroy?e.$$.on_destroy.push(...f):h(f),e.$$.on_mount=[]}),l.forEach(b)}function X(e,t){const n=e.$$;n.fragment!==null&&(L(n.after_update),h(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function Y(e,t){e.$$.dirty[0]===-1&&(q.push(e),D(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<{const v=g.length?g[0]:_;return s.ctx&&l(s.ctx[c],s.ctx[c]=v)&&(!s.skip_bound&&s.bound[c]&&s.bound[c](v),o&&Y(e,c)),_}):[],s.update(),o=!0,h(s.before_update),s.fragment=i?i(s.ctx):!1,t.target){if(t.hydrate){H();const c=F(t.target);s.fragment&&s.fragment.l(c),c.forEach(U)}else s.fragment&&s.fragment.c();t.intro&&K(e.$$.fragment),Q(e,t.target,t.anchor),M(),B()}N(r)}class we{constructor(){p(this,"$$");p(this,"$$set")}$destroy(){X(this,1),this.$destroy=y}$on(t,n){if(!E(n))return y;const i=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return i.push(n),()=>{const l=i.indexOf(n);l!==-1&&i.splice(l,1)}}$set(t){this.$$set&&!I(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const Z="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(Z);export{ge as A,Q as B,X as C,ne as D,ye as E,we as S,te as a,F as b,ue as c,U as d,V as e,J as f,le as g,ce as h,ve as i,R as j,oe as k,W as l,fe as m,ae as n,de as o,se as p,re as q,pe as r,ie as s,x as t,$e as u,K as v,_e as w,he as x,me as y,xe as z}; diff --git a/front/.svelte-kit/output/client/_app/immutable/chunks/scheduler.t-3xYmlC.js b/front/.svelte-kit/output/client/_app/immutable/chunks/scheduler.t-3xYmlC.js deleted file mode 100644 index a92071d..0000000 --- a/front/.svelte-kit/output/client/_app/immutable/chunks/scheduler.t-3xYmlC.js +++ /dev/null @@ -1 +0,0 @@ -function x(){}function w(t,n){for(const e in n)t[e]=n[e];return t}function j(t){return t()}function F(){return Object.create(null)}function E(t){t.forEach(j)}function P(t){return typeof t=="function"}function S(t,n){return t!=t?n==n:t!==n||t&&typeof t=="object"||typeof t=="function"}let i;function U(t,n){return t===n?!0:(i||(i=document.createElement("a")),i.href=n,t===i.href)}function A(t){return Object.keys(t).length===0}function q(t,...n){if(t==null){for(const r of n)r(void 0);return x}const e=t.subscribe(...n);return e.unsubscribe?()=>e.unsubscribe():e}function B(t,n,e){t.$$.on_destroy.push(q(n,e))}function C(t,n,e,r){if(t){const o=m(t,n,e,r);return t[0](o)}}function m(t,n,e,r){return t[1]&&r?w(e.ctx.slice(),t[1](r(n))):e.ctx}function D(t,n,e,r){if(t[2]&&r){const o=t[2](r(e));if(n.dirty===void 0)return o;if(typeof o=="object"){const l=[],_=Math.max(n.dirty.length,o.length);for(let s=0;s<_;s+=1)l[s]=n.dirty[s]|o[s];return l}return n.dirty|o}return n.dirty}function G(t,n,e,r,o,l){if(o){const _=m(n,e,r,l);t.p(_,o)}}function H(t){if(t.ctx.length>32){const n=[],e=t.ctx.length/32;for(let r=0;rt.indexOf(r)===-1?n.push(r):e.push(r)),e.forEach(r=>r()),u=n}export{J as a,g as b,B as c,C as d,D as e,U as f,H as g,L as h,F as i,M as j,P as k,A as l,O as m,x as n,I as o,N as p,f as q,E as r,S as s,K as t,G as u,h as v,j as w,a as x,v as y}; diff --git a/front/.svelte-kit/output/client/_app/immutable/chunks/scoreStore.BJlEo5Dk.js b/front/.svelte-kit/output/client/_app/immutable/chunks/scoreStore.BJlEo5Dk.js deleted file mode 100644 index 4ea8b12..0000000 --- a/front/.svelte-kit/output/client/_app/immutable/chunks/scoreStore.BJlEo5Dk.js +++ /dev/null @@ -1 +0,0 @@ -var S=Object.defineProperty;var p=(t,e,r)=>e in t?S(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var a=(t,e,r)=>p(t,typeof e!="symbol"?e+"":e,r);import{w}from"./index.BEtjop6e.js";class g{constructor({playerName:e="",value:r=0}){a(this,"playerName");a(this,"value");this.playerName=e,this.value=r}}let n="scores";function c(){return typeof window<"u"&&typeof window.localStorage<"u"}function m(){const t=c()?localStorage.getItem(n):null,{set:e,update:r,subscribe:l}=w(t?JSON.parse(t):[]);return c()&&l(o=>localStorage.setItem(n,JSON.stringify(o))),{update:r,subscribe:l,set:o=>e(o||[]),reset:()=>e([]),add:(o,i)=>{r(u=>{let s=[...u,new g({playerName:o,value:i})];return s.length>=2&&s.sort((d,f)=>d.value-f.value),s})}}}const b=m();export{b as s}; diff --git a/front/.svelte-kit/output/client/_app/immutable/entry/app.BB-guR1A.js b/front/.svelte-kit/output/client/_app/immutable/entry/app.BB-guR1A.js deleted file mode 100644 index 2926d0c..0000000 --- a/front/.svelte-kit/output/client/_app/immutable/entry/app.BB-guR1A.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../nodes/0.BLjvgh0X.js","../chunks/preload-helper.C1FmrZbK.js","../chunks/scheduler.t-3xYmlC.js","../chunks/index.Dz99_Qdh.js","../nodes/1.DltsNqkt.js","../chunks/entry.CWTQmo3s.js","../chunks/index.BEtjop6e.js","../nodes/2.B0UqQsDX.js","../chunks/scoreStore.BJlEo5Dk.js","../assets/2.DxlxdAfj.css","../nodes/3.vi6sie8m.js","../nodes/4.69oG6wwC.js","../assets/4.T_78NcA1.css"])))=>i.map(i=>d[i]); -import{_ as A}from"../chunks/preload-helper.C1FmrZbK.js";import{s as C,a as S,o as z,b as P,t as B}from"../chunks/scheduler.t-3xYmlC.js";import{S as M,i as U,s as j,q as p,h as F,a as w,r as d,u as D,v as h,d as g,e as G,c as H,b as J,n as R,w as m,t as K,f as Q,k as W,x as I,y as k,z as v,A as V,B as E,C as y}from"../chunks/index.Dz99_Qdh.js";const ie={};function X(o){let e,n,i;var s=o[1][0];function c(t,r){return{props:{data:t[3],form:t[2]}}}return s&&(e=k(s,c(o)),o[12](e)),{c(){e&&v(e.$$.fragment),n=p()},l(t){e&&V(e.$$.fragment,t),n=p()},m(t,r){e&&E(e,t,r),w(t,n,r),i=!0},p(t,r){if(r&2&&s!==(s=t[1][0])){if(e){I();const a=e;d(a.$$.fragment,1,0,()=>{y(a,1)}),D()}s?(e=k(s,c(t)),t[12](e),v(e.$$.fragment),h(e.$$.fragment,1),E(e,n.parentNode,n)):e=null}else if(s){const a={};r&8&&(a.data=t[3]),r&4&&(a.form=t[2]),e.$set(a)}},i(t){i||(e&&h(e.$$.fragment,t),i=!0)},o(t){e&&d(e.$$.fragment,t),i=!1},d(t){t&&g(n),o[12](null),e&&y(e,t)}}}function Y(o){let e,n,i;var s=o[1][0];function c(t,r){return{props:{data:t[3],$$slots:{default:[Z]},$$scope:{ctx:t}}}}return s&&(e=k(s,c(o)),o[11](e)),{c(){e&&v(e.$$.fragment),n=p()},l(t){e&&V(e.$$.fragment,t),n=p()},m(t,r){e&&E(e,t,r),w(t,n,r),i=!0},p(t,r){if(r&2&&s!==(s=t[1][0])){if(e){I();const a=e;d(a.$$.fragment,1,0,()=>{y(a,1)}),D()}s?(e=k(s,c(t)),t[11](e),v(e.$$.fragment),h(e.$$.fragment,1),E(e,n.parentNode,n)):e=null}else if(s){const a={};r&8&&(a.data=t[3]),r&8215&&(a.$$scope={dirty:r,ctx:t}),e.$set(a)}},i(t){i||(e&&h(e.$$.fragment,t),i=!0)},o(t){e&&d(e.$$.fragment,t),i=!1},d(t){t&&g(n),o[11](null),e&&y(e,t)}}}function Z(o){let e,n,i;var s=o[1][1];function c(t,r){return{props:{data:t[4],form:t[2]}}}return s&&(e=k(s,c(o)),o[10](e)),{c(){e&&v(e.$$.fragment),n=p()},l(t){e&&V(e.$$.fragment,t),n=p()},m(t,r){e&&E(e,t,r),w(t,n,r),i=!0},p(t,r){if(r&2&&s!==(s=t[1][1])){if(e){I();const a=e;d(a.$$.fragment,1,0,()=>{y(a,1)}),D()}s?(e=k(s,c(t)),t[10](e),v(e.$$.fragment),h(e.$$.fragment,1),E(e,n.parentNode,n)):e=null}else if(s){const a={};r&16&&(a.data=t[4]),r&4&&(a.form=t[2]),e.$set(a)}},i(t){i||(e&&h(e.$$.fragment,t),i=!0)},o(t){e&&d(e.$$.fragment,t),i=!1},d(t){t&&g(n),o[10](null),e&&y(e,t)}}}function L(o){let e,n=o[6]&&N(o);return{c(){e=G("div"),n&&n.c(),this.h()},l(i){e=H(i,"DIV",{id:!0,"aria-live":!0,"aria-atomic":!0,style:!0});var s=J(e);n&&n.l(s),s.forEach(g),this.h()},h(){R(e,"id","svelte-announcer"),R(e,"aria-live","assertive"),R(e,"aria-atomic","true"),m(e,"position","absolute"),m(e,"left","0"),m(e,"top","0"),m(e,"clip","rect(0 0 0 0)"),m(e,"clip-path","inset(50%)"),m(e,"overflow","hidden"),m(e,"white-space","nowrap"),m(e,"width","1px"),m(e,"height","1px")},m(i,s){w(i,e,s),n&&n.m(e,null)},p(i,s){i[6]?n?n.p(i,s):(n=N(i),n.c(),n.m(e,null)):n&&(n.d(1),n=null)},d(i){i&&g(e),n&&n.d()}}}function N(o){let e;return{c(){e=K(o[7])},l(n){e=Q(n,o[7])},m(n,i){w(n,e,i)},p(n,i){i&128&&W(e,n[7])},d(n){n&&g(e)}}}function $(o){let e,n,i,s,c;const t=[Y,X],r=[];function a(f,u){return f[1][1]?0:1}e=a(o),n=r[e]=t[e](o);let _=o[5]&&L(o);return{c(){n.c(),i=j(),_&&_.c(),s=p()},l(f){n.l(f),i=F(f),_&&_.l(f),s=p()},m(f,u){r[e].m(f,u),w(f,i,u),_&&_.m(f,u),w(f,s,u),c=!0},p(f,[u]){let b=e;e=a(f),e===b?r[e].p(f,u):(I(),d(r[b],1,1,()=>{r[b]=null}),D(),n=r[e],n?n.p(f,u):(n=r[e]=t[e](f),n.c()),h(n,1),n.m(i.parentNode,i)),f[5]?_?_.p(f,u):(_=L(f),_.c(),_.m(s.parentNode,s)):_&&(_.d(1),_=null)},i(f){c||(h(n),c=!0)},o(f){d(n),c=!1},d(f){f&&(g(i),g(s)),r[e].d(f),_&&_.d(f)}}}function x(o,e,n){let{stores:i}=e,{page:s}=e,{constructors:c}=e,{components:t=[]}=e,{form:r}=e,{data_0:a=null}=e,{data_1:_=null}=e;S(i.page.notify);let f=!1,u=!1,b=null;z(()=>{const l=i.page.subscribe(()=>{f&&(n(6,u=!0),B().then(()=>{n(7,b=document.title||"untitled page")}))});return n(5,f=!0),l});function O(l){P[l?"unshift":"push"](()=>{t[1]=l,n(0,t)})}function T(l){P[l?"unshift":"push"](()=>{t[0]=l,n(0,t)})}function q(l){P[l?"unshift":"push"](()=>{t[0]=l,n(0,t)})}return o.$$set=l=>{"stores"in l&&n(8,i=l.stores),"page"in l&&n(9,s=l.page),"constructors"in l&&n(1,c=l.constructors),"components"in l&&n(0,t=l.components),"form"in l&&n(2,r=l.form),"data_0"in l&&n(3,a=l.data_0),"data_1"in l&&n(4,_=l.data_1)},o.$$.update=()=>{o.$$.dirty&768&&i.page.set(s)},[t,c,r,a,_,f,u,b,i,s,O,T,q]}class se extends M{constructor(e){super(),U(this,e,x,$,C,{stores:8,page:9,constructors:1,components:0,form:2,data_0:3,data_1:4})}}const re=[()=>A(()=>import("../nodes/0.BLjvgh0X.js"),__vite__mapDeps([0,1,2,3]),import.meta.url),()=>A(()=>import("../nodes/1.DltsNqkt.js"),__vite__mapDeps([4,2,3,5,6]),import.meta.url),()=>A(()=>import("../nodes/2.B0UqQsDX.js"),__vite__mapDeps([7,2,3,8,6,9]),import.meta.url),()=>A(()=>import("../nodes/3.vi6sie8m.js"),__vite__mapDeps([10,2,3]),import.meta.url),()=>A(()=>import("../nodes/4.69oG6wwC.js"),__vite__mapDeps([11,1,2,3,8,6,12]),import.meta.url)],oe=[],ae={"/":[2],"/about":[3],"/play":[4]},fe={handleError:({error:o})=>{console.error(o)},reroute:()=>{}};export{ae as dictionary,fe as hooks,ie as matchers,re as nodes,se as root,oe as server_loads}; diff --git a/front/.svelte-kit/output/client/_app/immutable/entry/start.Dk8EHlvX.js b/front/.svelte-kit/output/client/_app/immutable/entry/start.Dk8EHlvX.js deleted file mode 100644 index 89409d3..0000000 --- a/front/.svelte-kit/output/client/_app/immutable/entry/start.Dk8EHlvX.js +++ /dev/null @@ -1 +0,0 @@ -import{a as t}from"../chunks/entry.CWTQmo3s.js";export{t as start}; diff --git a/front/.svelte-kit/output/client/_app/immutable/nodes/0.BLjvgh0X.js b/front/.svelte-kit/output/client/_app/immutable/nodes/0.BLjvgh0X.js deleted file mode 100644 index 603e6db..0000000 --- a/front/.svelte-kit/output/client/_app/immutable/nodes/0.BLjvgh0X.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as $}from"../chunks/preload-helper.C1FmrZbK.js";import{s as b,d as y,u as x,g as F,e as L,o as M}from"../chunks/scheduler.t-3xYmlC.js";import{S as T,i as j,e as _,s as v,c as p,g as C,h as w,b as k,d as c,n as g,a as d,v as E,r as H}from"../chunks/index.Dz99_Qdh.js";const D="data:image/svg+xml,%3csvg%20width='98'%20height='96'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M48.854%200C21.839%200%200%2022%200%2049.217c0%2021.756%2013.993%2040.172%2033.405%2046.69%202.427.49%203.316-1.059%203.316-2.362%200-1.141-.08-5.052-.08-9.127-13.59%202.934-16.42-5.867-16.42-5.867-2.184-5.704-5.42-7.17-5.42-7.17-4.448-3.015.324-3.015.324-3.015%204.934.326%207.523%205.052%207.523%205.052%204.367%207.496%2011.404%205.378%2014.235%204.074.404-3.178%201.699-5.378%203.074-6.6-10.839-1.141-22.243-5.378-22.243-24.283%200-5.378%201.94-9.778%205.014-13.2-.485-1.222-2.184-6.275.486-13.038%200%200%204.125-1.304%2013.426%205.052a46.97%2046.97%200%200%201%2012.214-1.63c4.125%200%208.33.571%2012.213%201.63%209.302-6.356%2013.427-5.052%2013.427-5.052%202.67%206.763.97%2011.816.485%2013.038%203.155%203.422%205.015%207.822%205.015%2013.2%200%2018.905-11.404%2023.06-22.324%2024.283%201.78%201.548%203.316%204.481%203.316%209.126%200%206.6-.08%2011.897-.08%2013.526%200%201.304.89%202.853%203.316%202.364%2019.412-6.52%2033.405-24.935%2033.405-46.691C97.707%2022%2075.788%200%2048.854%200z'%20fill='%23fff'/%3e%3c/svg%3e",I="data:image/svg+xml,%3csvg%20fill='%23FFFFFF'%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2050%2050'%20width='50px'%20height='50px'%3e%3cpath%20d='M%2050.0625%2010.4375%20C%2048.214844%2011.257813%2046.234375%2011.808594%2044.152344%2012.058594%20C%2046.277344%2010.785156%2047.910156%208.769531%2048.675781%206.371094%20C%2046.691406%207.546875%2044.484375%208.402344%2042.144531%208.863281%20C%2040.269531%206.863281%2037.597656%205.617188%2034.640625%205.617188%20C%2028.960938%205.617188%2024.355469%2010.21875%2024.355469%2015.898438%20C%2024.355469%2016.703125%2024.449219%2017.488281%2024.625%2018.242188%20C%2016.078125%2017.8125%208.503906%2013.71875%203.429688%207.496094%20C%202.542969%209.019531%202.039063%2010.785156%202.039063%2012.667969%20C%202.039063%2016.234375%203.851563%2019.382813%206.613281%2021.230469%20C%204.925781%2021.175781%203.339844%2020.710938%201.953125%2019.941406%20C%201.953125%2019.984375%201.953125%2020.027344%201.953125%2020.070313%20C%201.953125%2025.054688%205.5%2029.207031%2010.199219%2030.15625%20C%209.339844%2030.390625%208.429688%2030.515625%207.492188%2030.515625%20C%206.828125%2030.515625%206.183594%2030.453125%205.554688%2030.328125%20C%206.867188%2034.410156%2010.664063%2037.390625%2015.160156%2037.472656%20C%2011.644531%2040.230469%207.210938%2041.871094%202.390625%2041.871094%20C%201.558594%2041.871094%200.742188%2041.824219%20-0.0585938%2041.726563%20C%204.488281%2044.648438%209.894531%2046.347656%2015.703125%2046.347656%20C%2034.617188%2046.347656%2044.960938%2030.679688%2044.960938%2017.09375%20C%2044.960938%2016.648438%2044.949219%2016.199219%2044.933594%2015.761719%20C%2046.941406%2014.3125%2048.683594%2012.5%2050.0625%2010.4375%20Z'/%3e%3c/svg%3e";function O(r){let a,f='
',o,i,n,l,h=`Github mark Twitter mark`,u;const m=r[1].default,e=y(m,r,r[0],null);return{c(){a=_("div"),a.innerHTML=f,o=v(),i=_("div"),e&&e.c(),n=v(),l=_("footer"),l.innerHTML=h,this.h()},l(t){a=p(t,"DIV",{class:!0,"data-svelte-h":!0}),C(a)!=="svelte-1e7h1m1"&&(a.innerHTML=f),o=w(t),i=p(t,"DIV",{class:!0});var s=k(i);e&&e.l(s),s.forEach(c),n=w(t),l=p(t,"FOOTER",{"data-svelte-h":!0}),C(l)!=="svelte-1urjbwz"&&(l.innerHTML=h),this.h()},h(){g(a,"class","menu-collapsed"),g(i,"class","container")},m(t,s){d(t,a,s),d(t,o,s),d(t,i,s),e&&e.m(i,null),d(t,n,s),d(t,l,s),u=!0},p(t,[s]){e&&e.p&&(!u||s&1)&&x(e,m,t,t[0],u?L(m,t[0],s,null):F(t[0]),null)},i(t){u||(E(e,t),u=!0)},o(t){H(e,t),u=!1},d(t){t&&(c(a),c(o),c(i),c(n),c(l)),e&&e.d(t)}}}function P(r,a,f){let{$$slots:o={},$$scope:i}=a;return M(async()=>{const l=(await $(()=>import("../chunks/jquery.DayQ7gTg.js").then(h=>h.j),[],import.meta.url)).default;window.$=l,window.jQuery=l,window.$(".menu-collapsed").click(function(){window.$(this).toggleClass("menu-expanded")})}),r.$$set=n=>{"$$scope"in n&&f(0,i=n.$$scope)},[i,o]}class A extends T{constructor(a){super(),j(this,a,P,O,b,{})}}export{A as component}; diff --git a/front/.svelte-kit/output/client/_app/immutable/nodes/1.DltsNqkt.js b/front/.svelte-kit/output/client/_app/immutable/nodes/1.DltsNqkt.js deleted file mode 100644 index 5fe2678..0000000 --- a/front/.svelte-kit/output/client/_app/immutable/nodes/1.DltsNqkt.js +++ /dev/null @@ -1 +0,0 @@ -import{s as S,n as _,c as x}from"../chunks/scheduler.t-3xYmlC.js";import{S as j,i as k,e as f,t as d,s as q,c as g,b as h,f as v,d as u,h as y,a as m,j as $,k as E}from"../chunks/index.Dz99_Qdh.js";import{s as C}from"../chunks/entry.CWTQmo3s.js";const H=()=>{const s=C;return{page:{subscribe:s.page.subscribe},navigating:{subscribe:s.navigating.subscribe},updated:s.updated}},P={subscribe(s){return H().page.subscribe(s)}};function w(s){var b;let t,r=s[0].status+"",o,n,i,c=((b=s[0].error)==null?void 0:b.message)+"",l;return{c(){t=f("h1"),o=d(r),n=q(),i=f("p"),l=d(c)},l(e){t=g(e,"H1",{});var a=h(t);o=v(a,r),a.forEach(u),n=y(e),i=g(e,"P",{});var p=h(i);l=v(p,c),p.forEach(u)},m(e,a){m(e,t,a),$(t,o),m(e,n,a),m(e,i,a),$(i,l)},p(e,[a]){var p;a&1&&r!==(r=e[0].status+"")&&E(o,r),a&1&&c!==(c=((p=e[0].error)==null?void 0:p.message)+"")&&E(l,c)},i:_,o:_,d(e){e&&(u(t),u(n),u(i))}}}function z(s,t,r){let o;return x(s,P,n=>r(0,o=n)),[o]}let F=class extends j{constructor(t){super(),k(this,t,z,w,S,{})}};export{F as component}; diff --git a/front/.svelte-kit/output/client/_app/immutable/nodes/2.B0UqQsDX.js b/front/.svelte-kit/output/client/_app/immutable/nodes/2.B0UqQsDX.js deleted file mode 100644 index f8668d3..0000000 --- a/front/.svelte-kit/output/client/_app/immutable/nodes/2.B0UqQsDX.js +++ /dev/null @@ -1 +0,0 @@ -import{s as j,n as q,f as M,b as P,h as U,c as y}from"../chunks/scheduler.t-3xYmlC.js";import{S as w,i as z,e as g,c as v,b as $,d as m,n as h,a as G,D as F,s as I,t as S,h as D,f as L,j as i,k as A,E as H,z as J,A as K,B as O,v as Q,r as R,C as T}from"../chunks/index.Dz99_Qdh.js";import{s as B}from"../chunks/scoreStore.BJlEo5Dk.js";function C(l){return(l==null?void 0:l.length)!==void 0?l:Array.from(l)}function N(l,t,a){const e=l.slice();return e[1]=t[a],e[3]=a,e}function V(l){let t,a,e,n,r,s=l[1].playerName+"",c,f,d,p=l[1].value+"",b,x,E;return{c(){t=g("li"),a=g("div"),e=g("img"),r=I(),c=S(s),f=I(),d=g("div"),b=S(p),x=S(" pts."),E=I(),this.h()},l(u){t=v(u,"LI",{class:!0});var o=$(t);a=v(o,"DIV",{class:!0});var _=$(a);e=v(_,"IMG",{src:!0,alt:!0}),r=D(_),c=L(_,s),f=D(_),_.forEach(m),d=v(o,"DIV",{class:!0});var k=$(d);b=L(k,p),x=L(k," pts."),k.forEach(m),E=D(o),o.forEach(m),this.h()},h(){M(e.src,n="")||h(e,"src",n),h(e,"alt",""),h(a,"class","name svelte-13k6dxr"),h(d,"class","score svelte-13k6dxr"),h(t,"class","item svelte-13k6dxr")},m(u,o){G(u,t,o),i(t,a),i(a,e),i(a,r),i(a,c),i(a,f),i(t,d),i(d,b),i(d,x),i(t,E)},p(u,o){o&1&&s!==(s=u[1].playerName+"")&&A(c,s),o&1&&p!==(p=u[1].value+"")&&A(b,p)},d(u){u&&m(t)}}}function W(l){let t,a=C(l[0]),e=[];for(let n=0;n{"scores"in n&&a(0,e=n.scores)},[e]}class Y extends w{constructor(t){super(),z(this,t,X,W,j,{scores:0})}}function Z(l){let t,a,e;function n(s){l[1](s)}let r={};return l[0]!==void 0&&(r.scores=l[0]),t=new Y({props:r}),P.push(()=>H(t,"scores",n)),{c(){J(t.$$.fragment)},l(s){K(t.$$.fragment,s)},m(s,c){O(t,s,c),e=!0},p(s,[c]){const f={};!a&&c&1&&(a=!0,f.scores=s[0],U(()=>a=!1)),t.$set(f)},i(s){e||(Q(t.$$.fragment,s),e=!0)},o(s){R(t.$$.fragment,s),e=!1},d(s){T(t,s)}}}function ee(l,t,a){let e;y(l,B,r=>a(0,e=r));function n(r){e=r,B.set(e)}return[e,n]}class ae extends w{constructor(t){super(),z(this,t,ee,Z,j,{})}}export{ae as component}; diff --git a/front/.svelte-kit/output/client/_app/immutable/nodes/3.vi6sie8m.js b/front/.svelte-kit/output/client/_app/immutable/nodes/3.vi6sie8m.js deleted file mode 100644 index 502f9dd..0000000 --- a/front/.svelte-kit/output/client/_app/immutable/nodes/3.vi6sie8m.js +++ /dev/null @@ -1 +0,0 @@ -import{s as r,n as a}from"../chunks/scheduler.t-3xYmlC.js";import{S as i,i as l,e as m,c,g as p,a as d,d as f}from"../chunks/index.Dz99_Qdh.js";function u(s){let e,n="It was revealed to me in a dream";return{c(){e=m("p"),e.textContent=n},l(t){e=c(t,"P",{"data-svelte-h":!0}),p(e)!=="svelte-nwzi5w"&&(e.textContent=n)},m(t,o){d(t,e,o)},p:a,i:a,o:a,d(t){t&&f(e)}}}class v extends i{constructor(e){super(),l(this,e,null,u,r,{})}}export{v as component}; diff --git a/front/.svelte-kit/output/client/_app/immutable/nodes/4.69oG6wwC.js b/front/.svelte-kit/output/client/_app/immutable/nodes/4.69oG6wwC.js deleted file mode 100644 index 76b32dc..0000000 --- a/front/.svelte-kit/output/client/_app/immutable/nodes/4.69oG6wwC.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as A}from"../chunks/preload-helper.C1FmrZbK.js";import{s as Y,n as N,r as z,o as F}from"../chunks/scheduler.t-3xYmlC.js";import{S as G,i as H,e as m,l as Q,s as I,t as T,c as f,b as p,m as S,d as v,h as C,f as R,g as J,n as e,a as K,j as s,o as O,p as U}from"../chunks/index.Dz99_Qdh.js";import{s as W}from"../chunks/scoreStore.BJlEo5Dk.js";function X(w){let a,r,l,t,y,o,h,_,$,V,n,i,j,d,B="Let's roll !",k,b,P,L;return{c(){a=m("div"),r=m("div"),l=Q("svg"),t=Q("circle"),y=I(),o=m("div"),h=T("Rolling a random numbers within range 0-"),_=T(D),$=T("..."),V=I(),n=m("div"),i=m("input"),j=I(),d=m("button"),d.textContent=B,k=I(),b=m("div"),this.h()},l(c){a=f(c,"DIV",{class:!0});var u=p(a);r=f(u,"DIV",{class:!0});var x=p(r);l=S(x,"svg",{class:!0,viewBox:!0});var M=p(l);t=S(M,"circle",{class:!0,cx:!0,cy:!0,r:!0,fill:!0,stroke:!0,"stroke-width":!0}),p(t).forEach(v),M.forEach(v),y=C(x),o=f(x,"DIV",{class:!0});var E=p(o);h=R(E,"Rolling a random numbers within range 0-"),_=R(E,D),$=R(E,"..."),E.forEach(v),x.forEach(v),V=C(u),n=f(u,"DIV",{class:!0});var g=p(n);i=f(g,"INPUT",{class:!0,placeholder:!0}),j=C(g),d=f(g,"BUTTON",{class:!0,"data-svelte-h":!0}),J(d)!=="svelte-bef7me"&&(d.textContent=B),k=C(g),b=f(g,"DIV",{class:!0}),p(b).forEach(v),g.forEach(v),u.forEach(v),this.h()},h(){e(t,"class","loader-path svelte-31d80g"),e(t,"cx","15"),e(t,"cy","15"),e(t,"r","5"),e(t,"fill","none"),e(t,"stroke","#f1ecec"),e(t,"stroke-width","0.7"),e(l,"class","circular-loader svelte-31d80g"),e(l,"viewBox","0 0 30 30"),e(o,"class","info"),e(r,"class","loader disabled svelte-31d80g"),e(i,"class","name svelte-31d80g"),e(i,"placeholder","Your name"),e(d,"class","svelte-31d80g"),e(b,"class","result"),e(n,"class","player svelte-31d80g"),e(a,"class","container svelte-31d80g")},m(c,u){K(c,a,u),s(a,r),s(r,l),s(l,t),s(r,y),s(r,o),s(o,h),s(o,_),s(o,$),s(a,V),s(a,n),s(n,i),O(i,w[0]),s(n,j),s(n,d),s(n,k),s(n,b),P||(L=[U(i,"input",w[2]),U(d,"click",w[1])],P=!0)},p(c,[u]){u&1&&i.value!==c[0]&&O(i,c[0])},i:N,o:N,d(c){c&&v(a),P=!1,z(L)}}}let D=100;function q(){window.$(".loader").toggleClass("disabled"),window.$(".player").toggleClass("disabled")}function Z(w,a,r){let l,t=0;F(async()=>{const _=(await A(()=>import("../chunks/jquery.DayQ7gTg.js").then($=>$.j),[],import.meta.url)).default;window.$=_,window.jQuery=_});async function y(){q(),t=Math.floor(Math.random()*(D+1)),await new Promise(h=>setTimeout(h,3e3)),q(),window.$(".result").text(`Result : ${t}/${D}`),W.add(l,t)}function o(){l=this.value,r(0,l)}return[l,y,o]}class le extends G{constructor(a){super(),H(this,a,Z,X,Y,{})}}export{le as component}; diff --git a/front/.svelte-kit/output/client/_app/version.json b/front/.svelte-kit/output/client/_app/version.json index 9fbb0be..d3083f3 100644 --- a/front/.svelte-kit/output/client/_app/version.json +++ b/front/.svelte-kit/output/client/_app/version.json @@ -1 +1 @@ -{"version":"1728922282538"} \ No newline at end of file +{"version":"1729708008371"} \ No newline at end of file diff --git a/front/.svelte-kit/output/server/.vite/manifest.json b/front/.svelte-kit/output/server/.vite/manifest.json index fe0714a..645f37d 100644 --- a/front/.svelte-kit/output/server/.vite/manifest.json +++ b/front/.svelte-kit/output/server/.vite/manifest.json @@ -99,7 +99,7 @@ "_scoreStore.js" ], "css": [ - "_app/immutable/assets/_page.T_78NcA1.css" + "_app/immutable/assets/_page.DKtufWnM.css" ] } } \ No newline at end of file diff --git a/front/.svelte-kit/output/server/_app/immutable/assets/_page.T_78NcA1.css b/front/.svelte-kit/output/server/_app/immutable/assets/_page.T_78NcA1.css deleted file mode 100644 index 6a0ec78..0000000 --- a/front/.svelte-kit/output/server/_app/immutable/assets/_page.T_78NcA1.css +++ /dev/null @@ -1 +0,0 @@ -.container.svelte-31d80g,.player.svelte-31d80g{display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center}.disabled.svelte-31d80g{display:none}.player.svelte-31d80g{gap:2vh}.name.svelte-31d80g{width:17vw;height:6vh;border:2px solid #A1674A;border-radius:10px;box-shadow:0 0 10px #343232}.circular-loader.svelte-31d80g{stroke-dasharray:100,125;stroke-dashoffset:-5;animation:svelte-31d80g-rotate 2s ease-in-out infinite;stroke-linecap:round}.loader-path.svelte-31d80g{width:25vw;height:25vh}button.svelte-31d80g{color:#000;width:18vw;height:15vh;border-radius:10px;background-color:#f1ecec;border:2px solid #A1674A;background-size:1800% 1800%;box-shadow:0 0 10px #343232}.name.svelte-31d80g:hover,button.svelte-31d80g:hover{transform:scale(1.1)}@keyframes svelte-31d80g-rotate{to{transform:rotate(360deg)}} diff --git a/front/.svelte-kit/output/server/chunks/index.js b/front/.svelte-kit/output/server/chunks/index.js index 5bda118..a05e627 100644 --- a/front/.svelte-kit/output/server/chunks/index.js +++ b/front/.svelte-kit/output/server/chunks/index.js @@ -1,4 +1,4 @@ -import { n as noop, f as safe_not_equal } from "./ssr.js"; +import { n as noop, d as safe_not_equal } from "./ssr.js"; const subscriber_queue = []; function readable(value, start) { return { diff --git a/front/.svelte-kit/output/server/chunks/internal.js b/front/.svelte-kit/output/server/chunks/internal.js index a4ddff8..9b75b8b 100644 --- a/front/.svelte-kit/output/server/chunks/internal.js +++ b/front/.svelte-kit/output/server/chunks/internal.js @@ -204,7 +204,7 @@ const options = {
` + status + '\n
\n

' + message + "

\n
\n
\n \n\n" }, - version_hash: "vmq992" + version_hash: "1xthrp6" }; async function get_hooks() { return {}; diff --git a/front/.svelte-kit/output/server/chunks/scoreStore.js b/front/.svelte-kit/output/server/chunks/scoreStore.js index dfa61c5..a785137 100644 --- a/front/.svelte-kit/output/server/chunks/scoreStore.js +++ b/front/.svelte-kit/output/server/chunks/scoreStore.js @@ -7,29 +7,43 @@ class Score { this.value = value; } } -let localStorageKey = "scores"; -function isBrowser() { - return typeof window !== "undefined" && typeof window.localStorage !== "undefined"; +const api_url = "http://naaturel.be:5000/api"; +async function getLeaderboard() { + return await handleRequest( + `${api_url}/api/leaderboard/`, + { method: "GET" } + ); } -function createStore() { - const storedValue = isBrowser() ? localStorage.getItem(localStorageKey) : null; - const { set, update, subscribe } = writable(!storedValue ? [] : JSON.parse(storedValue)); - if (isBrowser()) subscribe((value) => localStorage.setItem(localStorageKey, JSON.stringify(value))); +async function handleRequest(url, init) { + return await fetch(url, init).then((response) => { + if (response.status === 500) throw new Error(`${response.text()}`); + if (!response.ok) throw new Error(`${response.status} : ${response.body}`); + return response; + }).then((response) => { + return response.json(); + }).catch((error) => { + return `Exception: ${error.message}`; + }); +} +function createStore(scores) { + const { set, update, subscribe } = writable(scores); return { update, subscribe, set: (value) => set(!value ? [] : value), reset: () => set([]), add: (playerName, value) => { - update((scores) => { - let s = [...scores, new Score({ playerName, value })]; + update((scores2) => { + let s = [...scores2, new Score({ playerName, value })]; if (s.length >= 2) s.sort((s1, s2) => s1.value - s2.value); return s; }); } }; } -const scoreStore = createStore(); -export { - scoreStore as s -}; +async function createStoreFromAPI() { + console.log("http://naaturel.be:5000/api"); + let scores = await getLeaderboard(); + return createStore(scores); +} +createStoreFromAPI(); diff --git a/front/.svelte-kit/output/server/chunks/ssr.js b/front/.svelte-kit/output/server/chunks/ssr.js index 1e463ae..eaaa62a 100644 --- a/front/.svelte-kit/output/server/chunks/ssr.js +++ b/front/.svelte-kit/output/server/chunks/ssr.js @@ -37,9 +37,6 @@ function setContext(key, context) { function getContext(key) { return get_current_component().$$.context.get(key); } -function ensure_array_like(array_like_or_iterator) { - return array_like_or_iterator?.length !== void 0 ? array_like_or_iterator : Array.from(array_like_or_iterator); -} const ATTR_REGEX = /[&"<]/g; const CONTENT_REGEX = /[&<]/g; function escape(value, is_attr = false) { @@ -56,14 +53,6 @@ function escape(value, is_attr = false) { } return escaped + str.substring(last); } -function each(items, fn) { - items = ensure_array_like(items); - let str = ""; - for (let i = 0; i < items.length; i += 1) { - str += fn(items[i], i); - } - return str; -} const missing_component = { $$render: () => "" }; @@ -122,9 +111,8 @@ export { add_attribute as a, subscribe as b, create_ssr_component as c, - each as d, + safe_not_equal as d, escape as e, - safe_not_equal as f, getContext as g, missing_component as m, noop as n, diff --git a/front/.svelte-kit/output/server/entries/pages/_page.svelte.js b/front/.svelte-kit/output/server/entries/pages/_page.svelte.js index 985a23c..4ed8f2a 100644 --- a/front/.svelte-kit/output/server/entries/pages/_page.svelte.js +++ b/front/.svelte-kit/output/server/entries/pages/_page.svelte.js @@ -1,39 +1,14 @@ -import { c as create_ssr_component, d as each, e as escape, b as subscribe, v as validate_component } from "../../chunks/ssr.js"; -import { s as scoreStore } from "../../chunks/scoreStore.js"; -const css = { - code: ".leaderboard.svelte-13k6dxr{display:flex;flex-direction:column;width:60vw;height:65vh;padding:0 2vw 2vw 2vw;overflow:scroll;overflow-x:hidden}.leaderboard.svelte-13k6dxr::-webkit-scrollbar{display:none}li.svelte-13k6dxr{display:flex;justify-content:space-around;padding:1.25vh;margin:1.5vh;border:2px solid #A1674A;border-radius:10px;background-color:#f1ecec;box-shadow:0 0 10px #343232}li.svelte-13k6dxr:hover{transform:scale(1.075);background-color:#F5F5F5}.name.svelte-13k6dxr,.score.svelte-13k6dxr{color:black;margin-left:3vh}.name.svelte-13k6dxr{flex-grow:100;border-right:1px solid #A1674A}.score.svelte-13k6dxr{flex-grow:20;text-align:center}", - map: '{"version":3,"file":"LeaderBoard.svelte","sources":["LeaderBoard.svelte"],"sourcesContent":["