diff --git a/Gemfile b/Gemfile index 2dad977..f7c9510 100644 --- a/Gemfile +++ b/Gemfile @@ -4,7 +4,6 @@ ruby "3.4.9" gem "dotenv-rails" -# Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main" gem "rails", "~> 8.1.2" gem "openssl" @@ -56,11 +55,8 @@ gem "bootsnap", require: false gem "image_processing", "~> 1.2" - - group :development do # Use console on exceptions pages [https://github.com/rails/web-console] gem "web-console" - gem "rubocop-rails-omakase", require: false end diff --git a/Gemfile.lock b/Gemfile.lock index 8c382fb..db36b70 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ GEM remote: https://rubygems.org/ specs: - action_text-trix (2.1.17) + action_text-trix (2.1.18) railties actioncable (8.1.3) actionpack (= 8.1.3) @@ -78,7 +78,7 @@ GEM acts_as_list (1.2.6) activerecord (>= 6.1) activesupport (>= 6.1) - addressable (2.8.9) + addressable (2.9.0) public_suffix (>= 2.0.2, < 8.0) ancestry (5.1.0) activerecord (>= 5.2.6) @@ -86,15 +86,15 @@ GEM ast (2.4.3) base64 (0.3.0) bcrypt (3.1.22) - bigdecimal (4.0.1) + bigdecimal (4.1.2) bindex (0.8.1) - bootsnap (1.23.0) + bootsnap (1.24.0) msgpack (~> 1.2) builder (3.3.0) concurrent-ruby (1.3.6) connection_pool (3.0.2) crass (1.0.6) - css_parser (2.0.0) + css_parser (2.1.0) addressable date (3.5.1) date_validator (0.12.0) @@ -106,16 +106,16 @@ GEM dotenv (= 3.2.0) railties (>= 6.1) drb (2.2.3) - erb (6.0.2) + erb (6.0.4) erubi (1.13.1) - ffi (1.17.3-aarch64-linux-gnu) - ffi (1.17.3-aarch64-linux-musl) - ffi (1.17.3-arm-linux-gnu) - ffi (1.17.3-arm-linux-musl) - ffi (1.17.3-arm64-darwin) - ffi (1.17.3-x86_64-darwin) - ffi (1.17.3-x86_64-linux-gnu) - ffi (1.17.3-x86_64-linux-musl) + ffi (1.17.4-aarch64-linux-gnu) + ffi (1.17.4-aarch64-linux-musl) + ffi (1.17.4-arm-linux-gnu) + ffi (1.17.4-arm-linux-musl) + ffi (1.17.4-arm64-darwin) + ffi (1.17.4-x86_64-darwin) + ffi (1.17.4-x86_64-linux-gnu) + ffi (1.17.4-x86_64-linux-musl) globalid (1.3.0) activesupport (>= 6.1) htmlentities (4.4.2) @@ -129,7 +129,7 @@ GEM activesupport (>= 6.0.0) railties (>= 6.0.0) io-console (0.8.2) - irb (1.17.0) + irb (1.18.0) pp (>= 0.6.0) prism (>= 1.3.0) rdoc (>= 4.0.0) @@ -137,7 +137,7 @@ GEM jbuilder (2.14.1) actionview (>= 7.0.0) activesupport (>= 7.0.0) - json (2.19.2) + json (2.19.4) kaminari (1.2.2) activesupport (>= 4.1.0) kaminari-actionview (= 1.2.2) @@ -151,7 +151,7 @@ GEM kaminari-core (= 1.2.2) kaminari-core (1.2.2) language_server-protocol (3.17.0.5) - lexxy (0.9.0.beta) + lexxy (0.9.10.beta) rails (>= 8.0.2) lint_roller (1.1.0) logger (1.7.0) @@ -168,14 +168,14 @@ GEM mini_magick (5.3.1) logger mini_mime (1.1.5) - minitest (6.0.2) + minitest (6.0.5) drb (~> 2.0) prism (~> 1.5) mobility (1.3.2) i18n (>= 0.6.10, < 2) request_store (~> 1.0) msgpack (1.8.0) - net-imap (0.6.3) + net-imap (0.6.4) date net-protocol net-pop (0.1.2) @@ -185,25 +185,25 @@ GEM net-smtp (0.5.1) net-protocol nio4r (2.7.5) - nokogiri (1.19.2-aarch64-linux-gnu) + nokogiri (1.19.3-aarch64-linux-gnu) racc (~> 1.4) - nokogiri (1.19.2-aarch64-linux-musl) + nokogiri (1.19.3-aarch64-linux-musl) racc (~> 1.4) - nokogiri (1.19.2-arm-linux-gnu) + nokogiri (1.19.3-arm-linux-gnu) racc (~> 1.4) - nokogiri (1.19.2-arm-linux-musl) + nokogiri (1.19.3-arm-linux-musl) racc (~> 1.4) - nokogiri (1.19.2-arm64-darwin) + nokogiri (1.19.3-arm64-darwin) racc (~> 1.4) - nokogiri (1.19.2-x86_64-darwin) + nokogiri (1.19.3-x86_64-darwin) racc (~> 1.4) - nokogiri (1.19.2-x86_64-linux-gnu) + nokogiri (1.19.3-x86_64-linux-gnu) racc (~> 1.4) - nokogiri (1.19.2-x86_64-linux-musl) + nokogiri (1.19.3-x86_64-linux-musl) racc (~> 1.4) openssl (4.0.1) - parallel (1.27.0) - parser (3.3.10.2) + parallel (2.1.0) + parser (3.3.11.1) ast (~> 2.4.1) racc pg (1.6.3) @@ -228,7 +228,7 @@ GEM premailer (~> 1.7, >= 1.7.9) prettyprint (0.2.0) prism (1.9.0) - propshaft (1.3.1) + propshaft (1.3.2) actionpack (>= 7.0.0) activesupport (>= 7.0.0) rack @@ -236,11 +236,11 @@ GEM date stringio public_suffix (7.0.5) - puma (7.2.0) + puma (8.0.1) nio4r (~> 2.0) racc (1.8.1) - rack (3.2.5) - rack-session (2.1.1) + rack (3.2.6) + rack-session (2.1.2) base64 (>= 0.1.0) rack (>= 3.0.0) rack-test (2.2.0) @@ -278,7 +278,7 @@ GEM tsort (>= 0.2) zeitwerk (~> 2.6) rainbow (3.1.1) - rake (13.3.1) + rake (13.4.2) rdoc (7.2.0) erb psych (>= 4.0.0) @@ -287,16 +287,16 @@ GEM redis-client (>= 0.22.0) redis-client (0.28.0) connection_pool - regexp_parser (2.11.3) + regexp_parser (2.12.0) reline (0.6.3) io-console (~> 0.5) request_store (1.7.0) rack (>= 1.4) - rubocop (1.86.0) + rubocop (1.86.1) json (~> 2.3) language_server-protocol (~> 3.17.0.2) lint_roller (~> 1.1.0) - parallel (~> 1.10) + parallel (>= 1.10) parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 2.9.3, < 3.0) @@ -325,7 +325,7 @@ GEM ffi (~> 1.12) logger securerandom (0.4.1) - sidekiq (8.1.2) + sidekiq (8.1.3) connection_pool (>= 3.0.0) json (>= 2.16.0) logger (>= 1.7.0) @@ -335,11 +335,11 @@ GEM railties (>= 6.0.0) stringio (3.2.0) thor (1.5.0) - thruster (0.1.19) - thruster (0.1.19-aarch64-linux) - thruster (0.1.19-arm64-darwin) - thruster (0.1.19-x86_64-darwin) - thruster (0.1.19-x86_64-linux) + thruster (0.1.20) + thruster (0.1.20-aarch64-linux) + thruster (0.1.20-arm64-darwin) + thruster (0.1.20-x86_64-darwin) + thruster (0.1.20-x86_64-linux) timeout (0.6.1) tsort (0.2.0) turbo-rails (2.0.23) @@ -404,7 +404,7 @@ DEPENDENCIES web-console CHECKSUMS - action_text-trix (2.1.17) sha256=b44691639d77e67169dc054ceacd1edc04d44dc3e4c6a427aa155a2beb4cc951 + action_text-trix (2.1.18) sha256=3fdb83f8bff4145d098be283cdd47ac41caf5110bfa6df4695ed7127d7fb3642 actioncable (8.1.3) sha256=e5bc7f75e44e6a22de29c4f43176927c3a9ce4824464b74ed18d8226e75a80f0 actionmailbox (8.1.3) sha256=df7da474eaa0e70df4ed5a6fef66eb3b3b0f2dbf7f14518deee8d77f1b4aae59 actionmailer (8.1.3) sha256=831f724891bb70d0aaa4d76581a6321124b6a752cb655c9346aae5479318448d @@ -417,50 +417,50 @@ CHECKSUMS activestorage (8.1.3) sha256=0564ce9309143951a67615e1bb4e090ee54b8befed417133cae614479b46384d activesupport (8.1.3) sha256=21a5e0dfbd4c3ddd9e1317ec6a4d782fa226e7867dc70b0743acda81a1dca20e acts_as_list (1.2.6) sha256=8345380900b7bee620c07ad00991ccee59af3d8c9e8574f426e321da2865fdc8 - addressable (2.8.9) sha256=cc154fcbe689711808a43601dee7b980238ce54368d23e127421753e46895485 + addressable (2.9.0) sha256=7fdf6ac3660f7f4e867a0838be3f6cf722ace541dd97767fa42bc6cfa980c7af ancestry (5.1.0) sha256=8a073cf6f7e306eeed36af72595abd19602ef4a197bf4beda2f31cf8f55de27b ast (2.4.3) sha256=954615157c1d6a382bc27d690d973195e79db7f55e9765ac7c481c60bdb4d383 base64 (0.3.0) sha256=27337aeabad6ffae05c265c450490628ef3ebd4b67be58257393227588f5a97b bcrypt (3.1.22) sha256=1f0072e88c2d705d94aff7f2c5cb02eb3f1ec4b8368671e19112527489f29032 - bigdecimal (4.0.1) sha256=8b07d3d065a9f921c80ceaea7c9d4ae596697295b584c296fe599dd0ad01c4a7 + bigdecimal (4.1.2) sha256=53d217666027eab4280346fba98e7d5b66baaae1b9c3c1c0ffe89d48188a3fbd bindex (0.8.1) sha256=7b1ecc9dc539ed8bccfc8cb4d2732046227b09d6f37582ff12e50a5047ceb17e - bootsnap (1.23.0) sha256=c1254f458d58558b58be0f8eb8f6eec2821456785b7cdd1e16248e2020d3f214 + bootsnap (1.24.0) sha256=34e6dea61ff4895101aa9c10894ce30186bec73fe2279e0eb52040d8d4cec297 builder (3.3.0) sha256=497918d2f9dca528fdca4b88d84e4ef4387256d984b8154e9d5d3fe5a9c8835f concurrent-ruby (1.3.6) sha256=6b56837e1e7e5292f9864f34b69c5a2cbc75c0cf5338f1ce9903d10fa762d5ab connection_pool (3.0.2) sha256=33fff5ba71a12d2aa26cb72b1db8bba2a1a01823559fb01d29eb74c286e62e0a crass (1.0.6) sha256=dc516022a56e7b3b156099abc81b6d2b08ea1ed12676ac7a5657617f012bd45d - css_parser (2.0.0) sha256=af5c759a127b125b635006a6c6c2e05b96a1ebdeec21b3c415fd5f09ec714a0a + css_parser (2.1.0) sha256=bfb7c9cf3896426b53337e34b4ad391c3cfe8c2f2c839e72f2cdccf615fb5247 date (3.5.1) sha256=750d06384d7b9c15d562c76291407d89e368dda4d4fff957eb94962d325a0dc0 date_validator (0.12.0) sha256=68c9834da240347b9c17441c553a183572508617ebfbe8c020020f3192ce3058 dkim (1.1.0) sha256=74f2e3075c89cd2967995f3ee293da9dccccffee21ee593715a068ab39a717f8 dotenv (3.2.0) sha256=e375b83121ea7ca4ce20f214740076129ab8514cd81378161f11c03853fe619d dotenv-rails (3.2.0) sha256=657e25554ba622ffc95d8c4f1670286510f47f2edda9f68293c3f661b303beab drb (2.2.3) sha256=0b00d6fdb50995fe4a45dea13663493c841112e4068656854646f418fda13373 - erb (6.0.2) sha256=9fe6264d44f79422c87490a1558479bd0e7dad4dd0e317656e67ea3077b5242b + erb (6.0.4) sha256=38e3803694be357fe2bfe312487c74beaf9fb4e5beb3e22498952fe1645b95d9 erubi (1.13.1) sha256=a082103b0885dbc5ecf1172fede897f9ebdb745a4b97a5e8dc63953db1ee4ad9 - ffi (1.17.3-aarch64-linux-gnu) sha256=28ad573df26560f0aedd8a90c3371279a0b2bd0b4e834b16a2baa10bd7a97068 - ffi (1.17.3-aarch64-linux-musl) sha256=020b33b76775b1abacc3b7d86b287cef3251f66d747092deec592c7f5df764b2 - ffi (1.17.3-arm-linux-gnu) sha256=5bd4cea83b68b5ec0037f99c57d5ce2dd5aa438f35decc5ef68a7d085c785668 - ffi (1.17.3-arm-linux-musl) sha256=0d7626bb96265f9af78afa33e267d71cfef9d9a8eb8f5525344f8da6c7d76053 - ffi (1.17.3-arm64-darwin) sha256=0c690555d4cee17a7f07c04d59df39b2fba74ec440b19da1f685c6579bb0717f - ffi (1.17.3-x86_64-darwin) sha256=1f211811eb5cfaa25998322cdd92ab104bfbd26d1c4c08471599c511f2c00bb5 - ffi (1.17.3-x86_64-linux-gnu) sha256=3746b01f677aae7b16dc1acb7cb3cc17b3e35bdae7676a3f568153fb0e2c887f - ffi (1.17.3-x86_64-linux-musl) sha256=086b221c3a68320b7564066f46fed23449a44f7a1935f1fe5a245bd89d9aea56 + ffi (1.17.4-aarch64-linux-gnu) sha256=b208f06f91ffd8f5e1193da3cae3d2ccfc27fc36fba577baf698d26d91c080df + ffi (1.17.4-aarch64-linux-musl) sha256=9286b7a615f2676245283aef0a0a3b475ae3aae2bb5448baace630bb77b91f39 + ffi (1.17.4-arm-linux-gnu) sha256=d6dbddf7cb77bf955411af5f187a65b8cd378cb003c15c05697f5feee1cb1564 + ffi (1.17.4-arm-linux-musl) sha256=9d4838ded0465bef6e2426935f6bcc93134b6616785a84ffd2a3d82bc3cf6f95 + ffi (1.17.4-arm64-darwin) sha256=19071aaf1419251b0a46852abf960e77330a3b334d13a4ab51d58b31a937001b + ffi (1.17.4-x86_64-darwin) sha256=aa70390523cf3235096cf64962b709b4cfbd5c082a2cb2ae714eb0fe2ccda496 + ffi (1.17.4-x86_64-linux-gnu) sha256=9d3db14c2eae074b382fa9c083fe95aec6e0a1451da249eab096c34002bc752d + ffi (1.17.4-x86_64-linux-musl) sha256=3fdf9888483de005f8ef8d1cf2d3b20d86626af206cbf780f6a6a12439a9c49e globalid (1.3.0) sha256=05c639ad6eb4594522a0b07983022f04aa7254626ab69445a0e493aa3786ff11 htmlentities (4.4.2) sha256=bbafbdf69f2eca9262be4efef7e43e6a1de54c95eb600f26984f71d2fe96c5c3 i18n (1.14.8) sha256=285778639134865c5e0f6269e0b818256017e8cde89993fdfcbfb64d088824a5 image_processing (1.14.0) sha256=754cc169c9c262980889bec6bfd325ed1dafad34f85242b5a07b60af004742fb importmap-rails (2.2.3) sha256=7101be2a4dc97cf1558fb8f573a718404c5f6bcfe94f304bf1f39e444feeb16a io-console (0.8.2) sha256=d6e3ae7a7cc7574f4b8893b4fca2162e57a825b223a177b7afa236c5ef9814cc - irb (1.17.0) sha256=168c4ddb93d8a361a045c41d92b2952c7a118fa73f23fe14e55609eb7a863aae + irb (1.18.0) sha256=de9454a0703a54704b9811a5ef31a60c86949fbf4013fcf244fabc7c775248e3 jbuilder (2.14.1) sha256=4eb26376ff60ef100cb4fd6fd7533cd271f9998327e86adf20fd8c0e69fabb42 - json (2.19.2) sha256=e7e1bd318b2c37c4ceee2444841c86539bc462e81f40d134cf97826cb14e83cf + json (2.19.4) sha256=670a7d333fb3b18ca5b29cb255eb7bef099e40d88c02c80bd42a3f30fe5239ac kaminari (1.2.2) sha256=c4076ff9adccc6109408333f87b5c4abbda5e39dc464bd4c66d06d9f73442a3e kaminari-actionview (1.2.2) sha256=1330f6fc8b59a4a4ef6a549ff8a224797289ebf7a3a503e8c1652535287cc909 kaminari-activerecord (1.2.2) sha256=0dd3a67bab356a356f36b3b7236bcb81cef313095365befe8e98057dd2472430 kaminari-core (1.2.2) sha256=3bd26fec7370645af40ca73b9426a448d09b8a8ba7afa9ba3c3e0d39cdbb83ff language_server-protocol (3.17.0.5) sha256=fd1e39a51a28bf3eec959379985a72e296e9f9acfce46f6a79d31ca8760803cc - lexxy (0.9.0.beta) sha256=d64aa2beb09ff64400e45813a4893a7cbe875273198680d95d172fe11ebe829d + lexxy (0.9.10.beta) sha256=f67df39cf7717b4a49b1694570128e42e6947a0d64bcbba1b53fa716e93b31fe lint_roller (1.1.0) sha256=2c0c845b632a7d172cb849cc90c1bce937a28c5c8ccccb50dfd46a485003cc87 logger (1.7.0) sha256=196edec7cc44b66cfb40f9755ce11b392f21f7967696af15d274dde7edff0203 loofah (2.25.1) sha256=d436c73dbd0c1147b16c4a41db097942d217303e1f7728704b37e4df9f6d2e04 @@ -468,25 +468,25 @@ CHECKSUMS marcel (1.1.0) sha256=fdcfcfa33cc52e93c4308d40e4090a5d4ea279e160a7f6af988260fa970e0bee mini_magick (5.3.1) sha256=29395dfd76badcabb6403ee5aff6f681e867074f8f28ce08d78661e9e4a351c4 mini_mime (1.1.5) sha256=8681b7e2e4215f2a159f9400b5816d85e9d8c6c6b491e96a12797e798f8bccef - minitest (6.0.2) sha256=db6e57956f6ecc6134683b4c87467d6dd792323c7f0eea7b93f66bd284adbc3d + minitest (6.0.5) sha256=f007d7246bf4feea549502842cd7c6aba8851cdc9c90ba06de9c476c0d01155c mobility (1.3.2) sha256=32fbbb0e53118ef42de20daa6ac94dbb758c628874092eba311b968a1e1d757b msgpack (1.8.0) sha256=e64ce0212000d016809f5048b48eb3a65ffb169db22238fb4b72472fecb2d732 - net-imap (0.6.3) sha256=9bab75f876596d09ee7bf911a291da478e0cd6badc54dfb82874855ccc82f2ad + net-imap (0.6.4) sha256=9a5598c67a3022c284d98430ef1d4948e7dbdb62596f61081ea8ca933270a02b net-pop (0.1.2) sha256=848b4e982013c15b2f0382792268763b748cce91c9e91e36b0f27ed26420dff3 net-protocol (0.2.2) sha256=aa73e0cba6a125369de9837b8d8ef82a61849360eba0521900e2c3713aa162a8 net-smtp (0.5.1) sha256=ed96a0af63c524fceb4b29b0d352195c30d82dd916a42f03c62a3a70e5b70736 nio4r (2.7.5) sha256=6c90168e48fb5f8e768419c93abb94ba2b892a1d0602cb06eef16d8b7df1dca1 - nokogiri (1.19.2-aarch64-linux-gnu) sha256=c34d5c8208025587554608e98fd88ab125b29c80f9352b821964e9a5d5cfbd19 - nokogiri (1.19.2-aarch64-linux-musl) sha256=7f6b4b0202d507326841a4f790294bf75098aef50c7173443812e3ac5cb06515 - nokogiri (1.19.2-arm-linux-gnu) sha256=b7fa1139016f3dc850bda1260988f0d749934a939d04ef2da13bec060d7d5081 - nokogiri (1.19.2-arm-linux-musl) sha256=61114d44f6742ff72194a1b3020967201e2eb982814778d130f6471c11f9828c - nokogiri (1.19.2-arm64-darwin) sha256=58d8ea2e31a967b843b70487a44c14c8ba1866daa1b9da9be9dbdf1b43dee205 - nokogiri (1.19.2-x86_64-darwin) sha256=7d9af11fda72dfaa2961d8c4d5380ca0b51bc389dc5f8d4b859b9644f195e7a4 - nokogiri (1.19.2-x86_64-linux-gnu) sha256=fa8feca882b73e871a9845f3817a72e9734c8e974bdc4fbad6e4bc6e8076b94f - nokogiri (1.19.2-x86_64-linux-musl) sha256=93128448e61a9383a30baef041bf1f5817e22f297a1d400521e90294445069a8 + nokogiri (1.19.3-aarch64-linux-gnu) sha256=46b89e5d7b9e844c2ee360794240c6ea2a4e6fa0c5892a4ed487db621224b639 + nokogiri (1.19.3-aarch64-linux-musl) sha256=8392dfdcd21be7a94dbbe9ccc138dea01b97b24cb2dc02a114ca98bfb1d9a0b7 + nokogiri (1.19.3-arm-linux-gnu) sha256=3919d5ffc334ad778a4a9eb88fda7dcb8b1fb58c8a52ac640c6dcd2f038e774f + nokogiri (1.19.3-arm-linux-musl) sha256=9ce1cb6346bb9c67b1550eb537aa183ead91e4b6eadb2f36ade02d8dd2a79fb6 + nokogiri (1.19.3-arm64-darwin) sha256=71b9bd424b1b7abc18b05052a1a3cfd3627abdca62be280854cc411791357e42 + nokogiri (1.19.3-x86_64-darwin) sha256=77f3fba57d46c53ab31e62fc6c28f705109d1bf6264356c76f132b2be5728d4d + nokogiri (1.19.3-x86_64-linux-gnu) sha256=2f5078620fe12e83669b5b17311b32532a8153d02eee7ad06948b926d6080976 + nokogiri (1.19.3-x86_64-linux-musl) sha256=248c906d2166eca5efb56d52fdee5f9a1f51d69a72e2b64fdac647b4ce39ea3f openssl (4.0.1) sha256=e27974136b7b02894a1bce46c5397ee889afafe704a839446b54dc81cb9c5f7d - parallel (1.27.0) sha256=4ac151e1806b755fb4e2dc2332cbf0e54f2e24ba821ff2d3dcf86bf6dc4ae130 - parser (3.3.10.2) sha256=6f60c84aa4bdcedb6d1a2434b738fe8a8136807b6adc8f7f53b97da9bc4e9357 + parallel (2.1.0) sha256=b35258865c2e31134c5ecb708beaaf6772adf9d5efae28e93e99260877b09356 + parser (3.3.11.1) sha256=d17ace7aabe3e72c3cc94043714be27cc6f852f104d81aa284c2281aecc65d54 pg (1.6.3) sha256=1388d0563e13d2758c1089e35e973a3249e955c659592d10e5b77c468f628a99 pg (1.6.3-aarch64-linux) sha256=0698ad563e02383c27510b76bf7d4cd2de19cd1d16a5013f375dd473e4be72ea pg (1.6.3-aarch64-linux-musl) sha256=06a75f4ea04b05140146f2a10550b8e0d9f006a79cdaf8b5b130cde40e3ecc2c @@ -500,13 +500,13 @@ CHECKSUMS premailer-rails (1.12.0) sha256=c13815d161b9bc7f7d3d81396b0bb0a61a90fa9bd89931548bf4e537c7710400 prettyprint (0.2.0) sha256=2bc9e15581a94742064a3cc8b0fb9d45aae3d03a1baa6ef80922627a0766f193 prism (1.9.0) sha256=7b530c6a9f92c24300014919c9dcbc055bf4cdf51ec30aed099b06cd6674ef85 - propshaft (1.3.1) sha256=9acc664ef67e819ffa3d95bd7ad4c3623ea799110c5f4dee67fa7e583e74c392 + propshaft (1.3.2) sha256=1d56a3e56a92c21bfc29caf07406b5386b00d4c47ddf357cf989a5a234b1389e psych (5.3.1) sha256=eb7a57cef10c9d70173ff74e739d843ac3b2c019a003de48447b2963d81b1974 public_suffix (7.0.5) sha256=1a8bb08f1bbea19228d3bed6e5ed908d1cb4f7c2726d18bd9cadf60bc676f623 - puma (7.2.0) sha256=bf8ef4ab514a4e6d4554cb4326b2004eba5036ae05cf765cfe51aba9706a72a8 + puma (8.0.1) sha256=7b94e50c07655718c1fb8ae41a11fc06c7d61293208b3aa608ff71a46d3ad37c racc (1.8.1) sha256=4a7f6929691dbec8b5209a0b373bc2614882b55fc5d2e447a21aaa691303d62f - rack (3.2.5) sha256=4cbd0974c0b79f7a139b4812004a62e4c60b145cba76422e288ee670601ed6d3 - rack-session (2.1.1) sha256=0b6dc07dea7e4b583f58a48e8b806d4c9f1c6c9214ebc202ec94562cbea2e4e9 + rack (3.2.6) sha256=5ed78e1f73b2e25679bec7d45ee2d4483cc4146eb1be0264fc4d94cb5ef212c2 + rack-session (2.1.2) sha256=595434f8c0c3473ae7d7ac56ecda6cc6dfd9d37c0b2b5255330aa1576967ffe8 rack-test (2.2.0) sha256=005a36692c306ac0b4a9350355ee080fd09ddef1148a5f8b2ac636c720f5c463 rackup (2.3.1) sha256=6c79c26753778e90983761d677a48937ee3192b3ffef6bc963c0950f94688868 rails (8.1.3) sha256=6d017ba5348c98fc909753a8169b21d44de14d2a0b92d140d1a966834c3c9cd3 @@ -514,14 +514,14 @@ CHECKSUMS rails-html-sanitizer (1.7.0) sha256=28b145cceaf9cc214a9874feaa183c3acba036c9592b19886e0e45efc62b1e89 railties (8.1.3) sha256=913eb0e0cb520aac687ffd74916bd726d48fa21f47833c6292576ef6a286de22 rainbow (3.1.1) sha256=039491aa3a89f42efa1d6dec2fc4e62ede96eb6acd95e52f1ad581182b79bc6a - rake (13.3.1) sha256=8c9e89d09f66a26a01264e7e3480ec0607f0c497a861ef16063604b1b08eb19c + rake (13.4.2) sha256=cb825b2bd5f1f8e91ca37bddb4b9aaf345551b4731da62949be002fa89283701 rdoc (7.2.0) sha256=8650f76cd4009c3b54955eb5d7e3a075c60a57276766ebf36f9085e8c9f23192 redis (5.4.1) sha256=b5e675b57ad22b15c9bcc765d5ac26f60b675408af916d31527af9bd5a81faae redis-client (0.28.0) sha256=888892f9cd8787a41c0ece00bdf5f556dfff7770326ce40bb2bc11f1bfec824b - regexp_parser (2.11.3) sha256=ca13f381a173b7a93450e53459075c9b76a10433caadcb2f1180f2c741fc55a4 + regexp_parser (2.12.0) sha256=35a916a1d63190ab5c9009457136ae5f3c0c7512d60291d0d1378ba18ce08ebb reline (0.6.3) sha256=1198b04973565b36ec0f11542ab3f5cfeeec34823f4e54cebde90968092b1835 request_store (1.7.0) sha256=e1b75d5346a315f452242a68c937ef8e48b215b9453a77a6c0acdca2934c88cb - rubocop (1.86.0) sha256=4ff1186fe16ebe9baff5e7aad66bb0ad4cabf5cdcd419f773146dbba2565d186 + rubocop (1.86.1) sha256=44415f3f01d01a21e01132248d2fd0867572475b566ca188a0a42133a08d4531 rubocop-ast (1.49.1) sha256=4412f3ee70f6fe4546cc489548e0f6fcf76cafcfa80fa03af67098ffed755035 rubocop-performance (1.26.1) sha256=cd19b936ff196df85829d264b522fd4f98b6c89ad271fa52744a8c11b8f71834 rubocop-rails (2.34.3) sha256=10d37989024865ecda8199f311f3faca990143fbac967de943f88aca11eb9ad2 @@ -529,15 +529,15 @@ CHECKSUMS ruby-progressbar (1.13.0) sha256=80fc9c47a9b640d6834e0dc7b3c94c9df37f08cb072b7761e4a71e22cff29b33 ruby-vips (2.3.0) sha256=e685ec02c13969912debbd98019e50492e12989282da5f37d05f5471442f5374 securerandom (0.4.1) sha256=cc5193d414a4341b6e225f0cb4446aceca8e50d5e1888743fac16987638ea0b1 - sidekiq (8.1.2) sha256=4a1266f22bb1dad675d77bf32e8d4c04e990640e3b271650f47ea7299c38fceb + sidekiq (8.1.3) sha256=a42f51aca3705d21cb50f37f5ec07e69de8708e126be4cf94b45cf15b84b3762 stimulus-rails (1.3.4) sha256=765676ffa1f33af64ce026d26b48e8ffb2e0b94e0f50e9119e11d6107d67cb06 stringio (3.2.0) sha256=c37cb2e58b4ffbd33fe5cd948c05934af997b36e0b6ca6fdf43afa234cf222e1 thor (1.5.0) sha256=e3a9e55fe857e44859ce104a84675ab6e8cd59c650a49106a05f55f136425e73 - thruster (0.1.19) sha256=3246eb6ea6fe699e89d6eecc4edda856452e4ebeb9d5999791f0e88832369527 - thruster (0.1.19-aarch64-linux) sha256=cfabff204f655359675c3f0e3e3940c6d1f110b765d0d48f5281077b8bb65325 - thruster (0.1.19-arm64-darwin) sha256=2e1994341ad1076cea438a5a86b0dc126dc6e66f5a67f2dc077779b73e9fb6e3 - thruster (0.1.19-x86_64-darwin) sha256=f026e833dc67048843919ce31a8b12b97b532df41a749d66b72f282efd2a0693 - thruster (0.1.19-x86_64-linux) sha256=7cddc1bd0c4fb2e26cc4878dc1f4eb7e883a45932e8d1cacda71b1aba1a645b6 + thruster (0.1.20) sha256=c05f2fbcae527bbe093a6e6d84fb12d9d680617e7c162325d9b97e8e9d4b5201 + thruster (0.1.20-aarch64-linux) sha256=754f1701061235235165dde31e7a3bc87ec88066a02981ff4241fcda0d76d397 + thruster (0.1.20-arm64-darwin) sha256=630cf8c273f562063b92ea5ccd7a721d7ba6130cc422c823727f4744f6d0770e + thruster (0.1.20-x86_64-darwin) sha256=4cc245f3ea2ad238b518ae3934048eade6cc2543bdcfef91a7f95f8194306432 + thruster (0.1.20-x86_64-linux) sha256=d579f252bf67aee6ba6d957e48f566b72e019d7657ba2f267a5db1e4d91d2479 timeout (0.6.1) sha256=78f57368a7e7bbadec56971f78a3f5ecbcfb59b7fcbb0a3ed6ddc08a5094accb tsort (0.2.0) sha256=9650a793f6859a43b6641671278f79cfead60ac714148aabe4e3f0060480089f turbo-rails (2.0.23) sha256=ee0d90733aafff056cf51ff11e803d65e43cae258cc55f6492020ec1f9f9315f @@ -555,4 +555,4 @@ RUBY VERSION ruby 3.4.9 BUNDLED WITH - 4.0.8 + 4.0.10 diff --git a/README.txt b/README.txt index 965c8de..064c129 100644 --- a/README.txt +++ b/README.txt @@ -1,3 +1,8 @@ +API +------------------- +curl -H "Authorization: Bearer ikea-tomato-2026" http://localhost:3000/api/v1/leaderboard +curl -H "Authorization: Bearer ikea-tomato-2026" https://ikea-foundation-week-2026.onc.dk/api/v1/leaderboard + Assets ------------------- RAILS_ENV=production bundle exec rake assets:precompile diff --git a/app/controllers/api/v1/leaderboard_controller.rb b/app/controllers/api/v1/leaderboard_controller.rb new file mode 100644 index 0000000..02bebf5 --- /dev/null +++ b/app/controllers/api/v1/leaderboard_controller.rb @@ -0,0 +1,32 @@ +class Api::V1::LeaderboardController < ApplicationController + skip_before_action :verify_authenticity_token + ACCESS_TOKEN = "ikea-tomato-2026" + + before_action :set_cors_headers, :set_locale_to_default, :verify_access_token + + def index + request.format = :json + + @leaderboard = I18n.t("countries").keys.map do |code| + { country_code: code.upcase, score: rand(1000..9999) } + end.sort_by { |e| -e[:score] } + @updated_at = Time.current + end + + private + + def set_locale_to_default + I18n.locale = I18n.default_locale + end + + + def verify_access_token + unless request.headers["Authorization"] == "Bearer #{ACCESS_TOKEN}" + render json: { error: "Unauthorized" }, status: :unauthorized + end + end + + def set_cors_headers + response.headers["Access-Control-Allow-Origin"] = "*" + end +end diff --git a/app/helpers/api/v1/leaderboard_helper.rb b/app/helpers/api/v1/leaderboard_helper.rb new file mode 100644 index 0000000..c0a70c7 --- /dev/null +++ b/app/helpers/api/v1/leaderboard_helper.rb @@ -0,0 +1,2 @@ +module Api::V1::LeaderboardHelper +end diff --git a/app/javascript/controllers/select_controller.js b/app/javascript/controllers/select_controller.js index a0914eb..ef8b77d 100644 --- a/app/javascript/controllers/select_controller.js +++ b/app/javascript/controllers/select_controller.js @@ -1,5 +1,5 @@ import { Controller } from "@hotwired/stimulus" -import TomSelect from "tom-select/dist/js/tom-select.base.min.js"; +import TomSelect from "tom-select"; export default class extends Controller { diff --git a/app/views/api/v1/leaderboard/index.json.jbuilder b/app/views/api/v1/leaderboard/index.json.jbuilder new file mode 100644 index 0000000..175d16a --- /dev/null +++ b/app/views/api/v1/leaderboard/index.json.jbuilder @@ -0,0 +1,6 @@ +json.leaderboard @leaderboard do |entry| + json.country_code entry[:country_code] + json.score entry[:score] +end + +json.updated_at @updated_at.iso8601 diff --git a/config/importmap.rb b/config/importmap.rb index ad7e597..e06586d 100644 --- a/config/importmap.rb +++ b/config/importmap.rb @@ -8,9 +8,9 @@ pin_all_from "app/javascript/controllers", under: "controllers" pin "sortablejs" # @1.15.7 pin "stimulus-use" # @0.52.3 pin "@rails/request.js", to: "@rails--request.js.js" # @0.0.13 -pin "@rails/activestorage", to: "@rails--activestorage.js" # @8.1.200 +pin "@rails/activestorage", to: "@rails--activestorage.js" # @8.1.300 pin "lexxy", to: "lexxy.js" -pin "tom-select/dist/js/tom-select.base.min.js", to: "tom-select--dist--js--tom-select.base.min.js.js" # @2.4.3 +pin "tom-select", to: "tom-select--dist--js--tom-select.base.min.js.js" # @2.4.3 # site_helper pin "application", preload: false diff --git a/config/initializers/new_framework_defaults_8_1.rb b/config/initializers/new_framework_defaults_8_1.rb new file mode 100644 index 0000000..8569b5b --- /dev/null +++ b/config/initializers/new_framework_defaults_8_1.rb @@ -0,0 +1,74 @@ +# Be sure to restart your server when you modify this file. +# +# This file eases your Rails 8.1 framework defaults upgrade. +# +# Uncomment each configuration one by one to switch to the new default. +# Once your application is ready to run with all new defaults, you can remove +# this file and set the `config.load_defaults` to `8.1`. +# +# Read the Guide for Upgrading Ruby on Rails for more info on each option. +# https://guides.rubyonrails.org/upgrading_ruby_on_rails.html + +### +# Skips escaping HTML entities and line separators. When set to `false`, the +# JSON renderer no longer escapes these to improve performance. +# +# Example: +# class PostsController < ApplicationController +# def index +# render json: { key: "\u2028\u2029<>&" } +# end +# end +# +# Renders `{"key":"\u2028\u2029\u003c\u003e\u0026"}` with the previous default, but `{"key":"

<>&"}` with the config +# set to `false`. +# +# Applications that want to keep the escaping behavior can set the config to `true`. +#++ +# Rails.configuration.action_controller.escape_json_responses = false + +### +# Skips escaping LINE SEPARATOR (U+2028) and PARAGRAPH SEPARATOR (U+2029) in JSON. +# +# Historically these characters were not valid inside JavaScript literal strings but that changed in ECMAScript 2019. +# As such it's no longer a concern in modern browsers: https://caniuse.com/mdn-javascript_builtins_json_json_superset. +#++ +# Rails.configuration.active_support.escape_js_separators_in_json = false + +### +# Raises an error when order dependent finder methods (e.g. `#first`, `#second`) are called without `order` values +# on the relation, and the model does not have any order columns (`implicit_order_column`, `query_constraints`, or +# `primary_key`) to fall back on. +# +# The current behavior of not raising an error has been deprecated, and this configuration option will be removed in +# Rails 8.2. +#++ +# Rails.configuration.active_record.raise_on_missing_required_finder_order_columns = true + +### +# Controls how Rails handles path relative URL redirects. +# When set to `:raise`, Rails will raise an `ActionController::Redirecting::UnsafeRedirectError` +# for relative URLs without a leading slash, which can help prevent open redirect vulnerabilities. +# +# Example: +# redirect_to "example.com" # Raises UnsafeRedirectError +# redirect_to "@attacker.com" # Raises UnsafeRedirectError +# redirect_to "/safe/path" # Works correctly +# +# Applications that want to allow these redirects can set the config to `:log` (previous default) +# to only log warnings, or `:notify` to send ActiveSupport notifications. +#++ +# Rails.configuration.action_controller.action_on_path_relative_redirect = :raise + +### +# Use a Ruby parser to track dependencies between Action View templates +#++ +# Rails.configuration.action_view.render_tracker = :ruby + +### +# When enabled, hidden inputs generated by `form_tag`, `token_tag`, `method_tag`, and the hidden parameter fields +# included in `button_to` forms will omit the `autocomplete="off"` attribute. +# +# Applications that want to keep generating the `autocomplete` attribute for those tags can set it to `false`. +#++ +# Rails.configuration.action_view.remove_hidden_field_autocomplete = true diff --git a/config/locales/en.yml b/config/locales/en.yml index 48c650f..6b4fa9d 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -12,7 +12,69 @@ en: get_bonus_point: Get bonus point let_my_try: Let me try - + countries: + au: Australia + at: Austria + bh: Bahrain + es: Spain # also covers Balearic Islands and Canary Islands + be: Belgium + bg: Bulgaria + ca: Canada + cl: Chile + cn: China + co: Colombia + hr: Croatia + cy: Cyprus + cz: Czech Republic + dk: Denmark + do: Dominican Republic + eg: Egypt + ee: Estonia + fi: Finland + fr: France + de: Germany + gr: Greece + hk: Hong Kong + hu: Hungary + is: Iceland + in: India + id: Indonesia + ie: Ireland + il: Israel + it: Italy + jp: Japan + jo: Jordan + kw: Kuwait + lv: Latvia + lt: Lithuania + my: Malaysia + mx: Mexico + ma: Morocco + nl: Netherlands + nz: New Zealand + "no": Norway + om: Oman + ph: Philippines + pl: Poland + pt: Portugal + pr: Puerto Rico + qa: Qatar + ro: Romania + sa: Saudi Arabia + rs: Serbia + sg: Singapore + sk: Slovakia + si: Slovenia + kr: South Korea + se: Sweden + ch: Switzerland + tw: Taiwan + th: Thailand + tr: Turkey + ae: United Arab Emirates + gb: United Kingdom + us: United States of America + languages: en: English zh: 中文 diff --git a/config/routes.rb b/config/routes.rb index 39f8041..87e7f2b 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -78,6 +78,12 @@ Rails.application.routes.draw do # get "*url", to: "site#page", constraints: lambda { |req| req.path.exclude?("storage") } end + namespace :api do + namespace :v1 do + get "leaderboard", to: "leaderboard#index" + end + end + put "update_locale", to: "languages#update" # Defines the root path route ("/") diff --git a/test/controllers/api/v1/leaderboard_controller_test.rb b/test/controllers/api/v1/leaderboard_controller_test.rb new file mode 100644 index 0000000..d10694c --- /dev/null +++ b/test/controllers/api/v1/leaderboard_controller_test.rb @@ -0,0 +1,7 @@ +require "test_helper" + +class Api::V1::LeaderboardControllerTest < ActionDispatch::IntegrationTest + # test "the truth" do + # assert true + # end +end diff --git a/vendor/javascript/@orchidjs--sifter.js b/vendor/javascript/@orchidjs--sifter.js deleted file mode 100644 index 0fb4475..0000000 --- a/vendor/javascript/@orchidjs--sifter.js +++ /dev/null @@ -1,17 +0,0 @@ -// @orchidjs/sifter@1.1.0 downloaded from https://ga.jspm.io/npm:@orchidjs/sifter@1.1.0/dist/esm/sifter.js - -import{scoreValue as t,iterate as e,cmp as r,propToArray as i,getAttrNesting as n,getAttr as s}from"./utils.js";import{escape_regex as o,getPattern as c}from"@orchidjs/unicode-variants";export{getPattern}from"@orchidjs/unicode-variants";import"./types.js";class Sifter{items;settings;constructor(t,e){this.items=t;this.settings=e||{diacritics:true}}tokenize(t,e,r){if(!t||!t.length)return[];const i=[];const n=t.split(/\s+/);var s;r&&(s=new RegExp("^("+Object.keys(r).map(o).join("|")+"):(.*)$"));n.forEach((t=>{let r;let n=null;let u=null;if(s&&(r=t.match(s))){n=r[1];t=r[2]}if(t.length>0){u=this.settings.diacritics?c(t)||null:o(t);u&&e&&(u="\\b"+u)}i.push({string:t,regex:u?new RegExp(u,"iu"):null,field:n})}));return i} -/** - * Returns a function to be used to score individual results. - * - * Good matches will have a higher score than poor matches. - * If an item is not a match, 0 will be returned by the function. - * - * @returns {T.ScoreFn} - */ -getScoreFunction(t,e){var r=this.prepareSearch(t,e);return this._getScoreFunction(r)} -/** - * @returns {T.ScoreFn} - * - */_getScoreFunction(r){const i=r.tokens,n=i.length;if(!n)return function(){return 0};const s=r.options.fields,o=r.weights,c=s.length,u=r.getAttrFn;if(!c)return function(){return 1};const f=function(){return c===1?function(e,r){const i=s[0].field;return t(u(r,i),e,o[i]||1)}:function(r,i){var n=0;if(r.field){const e=u(i,r.field);!r.regex&&e?n+=1/c:n+=t(e,r,1)}else e(o,((e,s)=>{n+=t(u(i,s),r,e)}));return n/c}}();return n===1?function(t){return f(i[0],t)}:r.options.conjunction==="and"?function(t){var e,r=0;for(let n of i){e=f(n,t);if(e<=0)return 0;r+=e}return r/n}:function(t){var r=0;e(i,(e=>{r+=f(e,t)}));return r/n}}getSortFunction(t,e){var r=this.prepareSearch(t,e);return this._getSortFunction(r)}_getSortFunction(t){var e,i=[];const n=this,s=t.options,o=!t.query&&s.sort_empty?s.sort_empty:s.sort;if(typeof o=="function")return o.bind(this);const get_field=function(e,r){return e==="$score"?r.score:t.getAttrFn(n.items[r.id],e)};if(o)for(let e of o)(t.query||e.field!=="$score")&&i.push(e);if(t.query){e=true;for(let t of i)if(t.field==="$score"){e=false;break}e&&i.unshift({field:"$score",direction:"desc"})}else i=i.filter((t=>t.field!=="$score"));const c=i.length;return c?function(t,e){var n,s;for(let o of i){s=o.field;let i=o.direction==="desc"?-1:1;n=i*r(get_field(s,t),get_field(s,e));if(n)return n}return 0}:null}prepareSearch(t,e){const r={};var o=Object.assign({},e);i(o,"sort");i(o,"sort_empty");if(o.fields){i(o,"fields");const t=[];o.fields.forEach((e=>{typeof e=="string"&&(e={field:e,weight:1});t.push(e);r[e.field]="weight"in e?e.weight:1}));o.fields=t}return{options:o,query:t.toLowerCase().trim(),tokens:this.tokenize(t,o.respect_word_boundaries,r),total:0,items:[],weights:r,getAttrFn:o.nesting?n:s}}search(t,r){var i,n,s=this;n=this.prepareSearch(t,r);r=n.options;t=n.query;const o=r.score||s._getScoreFunction(n);t.length?e(s.items,((t,e)=>{i=o(t);(r.filter===false||i>0)&&n.items.push({score:i,id:e})})):e(s.items,((t,e)=>{n.items.push({score:1,id:e})}));const c=s._getSortFunction(n);c&&n.items.sort(c);n.total=n.items.length;typeof r.limit==="number"&&(n.items=n.items.slice(0,r.limit));return n}}export{Sifter,r as cmp,s as getAttr,n as getAttrNesting,e as iterate,i as propToArray,t as scoreValue}; - diff --git a/vendor/javascript/@orchidjs--unicode-variants.js b/vendor/javascript/@orchidjs--unicode-variants.js deleted file mode 100644 index 9b14c64..0000000 --- a/vendor/javascript/@orchidjs--unicode-variants.js +++ /dev/null @@ -1,11 +0,0 @@ -// @orchidjs/unicode-variants@1.1.2 downloaded from https://ga.jspm.io/npm:@orchidjs/unicode-variants@1.1.2/dist/esm/index.js - -import{setToPattern as t,escape_regex as e,arrayToPattern as s,sequencePattern as n}from"./regex.js";import{allSubstrings as r}from"./strings.js";const o=[[0,65535]];const l="[̀-ͯ·ʾʼ]";let a;let u;const h=3;const c={};const i={"/":"⁄∕",0:"߀",a:"ⱥɐɑ",aa:"ꜳ",ae:"æǽǣ",ao:"ꜵ",au:"ꜷ",av:"ꜹꜻ",ay:"ꜽ",b:"ƀɓƃ",c:"ꜿƈȼↄ",d:"đɗɖᴅƌꮷԁɦ",e:"ɛǝᴇɇ",f:"ꝼƒ",g:"ǥɠꞡᵹꝿɢ",h:"ħⱨⱶɥ",i:"ɨı",j:"ɉȷ",k:"ƙⱪꝁꝃꝅꞣ",l:"łƚɫⱡꝉꝇꞁɭ",m:"ɱɯϻ",n:"ꞥƞɲꞑᴎлԉ",o:"øǿɔɵꝋꝍᴑ",oe:"œ",oi:"ƣ",oo:"ꝏ",ou:"ȣ",p:"ƥᵽꝑꝓꝕρ",q:"ꝗꝙɋ",r:"ɍɽꝛꞧꞃ",s:"ßȿꞩꞅʂ",t:"ŧƭʈⱦꞇ",th:"þ",tz:"ꜩ",u:"ʉ",v:"ʋꝟʌ",vy:"ꝡ",w:"ⱳ",y:"ƴɏỿ",z:"ƶȥɀⱬꝣ",hv:"ƕ"};for(let t in i){let e=i[t]||"";for(let s=0;s{a===void 0&&(a=generateMap(t||o))};const normalize=(t,e="NFKD")=>t.normalize(e);const asciifold=t=>Array.from(t).reduce(( -/** - * @param {string} result - * @param {string} char - */ -(t,e)=>t+_asciifold(e)),"");const _asciifold=t=>{t=normalize(t).toLowerCase().replace(d,(/** @type {string} */t=>c[t]||""));return normalize(t,"NFC")};function*generator(t){for(const[e,s]of t)for(let t=e;t<=s;t++){let e=String.fromCharCode(t);let s=asciifold(e);s!=e.toLowerCase()&&(s.length>h||s.length!=0&&(yield{folded:s,composed:e,code_point:t}))}}const generateSets=s=>{const n={};const addMatching=(s,r)=>{ -/** @type {Set} */ -const o=n[s]||new Set;const l=new RegExp("^"+t(o)+"$","iu");if(!r.match(l)){o.add(e(r));n[s]=o}};for(let t of generator(s)){addMatching(t.folded,t.folded);addMatching(t.folded,t.composed)}return n};const generateMap=n=>{const r=generateSets(n);const o={};let l=[];for(let s in r){let n=r[s];n&&(o[s]=t(n));s.length>1&&l.push(e(s))}l.sort(((t,e)=>e.length-t.length));const a=s(l);u=new RegExp("^"+a,"u");return o};const mapSequence=(t,e=1)=>{let s=0;t=t.map((t=>{a[t]&&(s+=t.length);return a[t]||t}));return s>=e?n(t):""};const substringsToPattern=(t,e=1)=>{e=Math.max(e,t.length-1);return s(r(t).map((t=>mapSequence(t,e))))};const sequencesToPattern=(t,e=true)=>{let r=t.length>1?1:0;return s(t.map((t=>{let s=[];const o=e?t.length():t.length()-1;for(let e=0;e{for(const s of e){if(s.start!=t.start||s.end!=t.end)continue;if(s.substrs.join("")!==t.substrs.join(""))continue;let e=t.parts;const filter=t=>{for(const s of e){if(s.start===t.start&&s.substr===t.substr)return false;if(t.length!=1&&s.length!=1){if(t.starts.start)return true;if(s.startt.start)return true}}return false};let n=s.parts.filter(filter);if(!(n.length>0))return true}return false};class Sequence{parts;substrs;start;end;constructor(){this.parts=[];this.substrs=[];this.start=0;this.end=0}add(t){if(t){this.parts.push(t);this.substrs.push(t.substr);this.start=Math.min(t.start,this.start);this.end=Math.max(t.end,this.end)}}last(){return this.parts[this.parts.length-1]}length(){return this.parts.length}clone(t,e){let s=new Sequence;let n=JSON.parse(JSON.stringify(this.parts));let r=n.pop();for(const t of n)s.add(t);let o=e.substr.substring(0,t-r.start);let l=o.length;s.add({start:r.start,end:r.start+l,length:l,substr:o});return s}}const getPattern=t=>{initialize();t=asciifold(t);let e="";let s=[new Sequence];for(let n=0;n0){h=h.sort(((t,e)=>t.length()-e.length()));for(let t of h)inSequences(t,s)||s.push(t)}else if(n>0&&c.size==1&&!c.has("3")){e+=sequencesToPattern(s,false);let t=new Sequence;const n=s[0];n&&t.add(n.last());s=[t]}}e+=sequencesToPattern(s,true);return e};export{_asciifold,asciifold,o as code_points,e as escape_regex,generateMap,generateSets,generator,getPattern,initialize,mapSequence,normalize,substringsToPattern,a as unicode_map}; - diff --git a/vendor/javascript/@rails--activestorage.js b/vendor/javascript/@rails--activestorage.js index d6e480c..c14633a 100644 --- a/vendor/javascript/@rails--activestorage.js +++ b/vendor/javascript/@rails--activestorage.js @@ -1,4 +1,4 @@ -// @rails/activestorage@8.1.200 downloaded from https://ga.jspm.io/npm:@rails/activestorage@8.1.200/app/assets/javascripts/activestorage.esm.js +// @rails/activestorage@8.1.300 downloaded from https://ga.jspm.io/npm:@rails/activestorage@8.1.300/app/assets/javascripts/activestorage.esm.js -var t={exports:{}};(function(t){(function(e){t.exports=e()})((function(t){var e=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function r(t,e){var r=t[0],s=t[1],i=t[2],n=t[3];r+=(s&i|~s&n)+e[0]-680876936|0;r=(r<<7|r>>>25)+s|0;n+=(r&s|~r&i)+e[1]-389564586|0;n=(n<<12|n>>>20)+r|0;i+=(n&r|~n&s)+e[2]+606105819|0;i=(i<<17|i>>>15)+n|0;s+=(i&n|~i&r)+e[3]-1044525330|0;s=(s<<22|s>>>10)+i|0;r+=(s&i|~s&n)+e[4]-176418897|0;r=(r<<7|r>>>25)+s|0;n+=(r&s|~r&i)+e[5]+1200080426|0;n=(n<<12|n>>>20)+r|0;i+=(n&r|~n&s)+e[6]-1473231341|0;i=(i<<17|i>>>15)+n|0;s+=(i&n|~i&r)+e[7]-45705983|0;s=(s<<22|s>>>10)+i|0;r+=(s&i|~s&n)+e[8]+1770035416|0;r=(r<<7|r>>>25)+s|0;n+=(r&s|~r&i)+e[9]-1958414417|0;n=(n<<12|n>>>20)+r|0;i+=(n&r|~n&s)+e[10]-42063|0;i=(i<<17|i>>>15)+n|0;s+=(i&n|~i&r)+e[11]-1990404162|0;s=(s<<22|s>>>10)+i|0;r+=(s&i|~s&n)+e[12]+1804603682|0;r=(r<<7|r>>>25)+s|0;n+=(r&s|~r&i)+e[13]-40341101|0;n=(n<<12|n>>>20)+r|0;i+=(n&r|~n&s)+e[14]-1502002290|0;i=(i<<17|i>>>15)+n|0;s+=(i&n|~i&r)+e[15]+1236535329|0;s=(s<<22|s>>>10)+i|0;r+=(s&n|i&~n)+e[1]-165796510|0;r=(r<<5|r>>>27)+s|0;n+=(r&i|s&~i)+e[6]-1069501632|0;n=(n<<9|n>>>23)+r|0;i+=(n&s|r&~s)+e[11]+643717713|0;i=(i<<14|i>>>18)+n|0;s+=(i&r|n&~r)+e[0]-373897302|0;s=(s<<20|s>>>12)+i|0;r+=(s&n|i&~n)+e[5]-701558691|0;r=(r<<5|r>>>27)+s|0;n+=(r&i|s&~i)+e[10]+38016083|0;n=(n<<9|n>>>23)+r|0;i+=(n&s|r&~s)+e[15]-660478335|0;i=(i<<14|i>>>18)+n|0;s+=(i&r|n&~r)+e[4]-405537848|0;s=(s<<20|s>>>12)+i|0;r+=(s&n|i&~n)+e[9]+568446438|0;r=(r<<5|r>>>27)+s|0;n+=(r&i|s&~i)+e[14]-1019803690|0;n=(n<<9|n>>>23)+r|0;i+=(n&s|r&~s)+e[3]-187363961|0;i=(i<<14|i>>>18)+n|0;s+=(i&r|n&~r)+e[8]+1163531501|0;s=(s<<20|s>>>12)+i|0;r+=(s&n|i&~n)+e[13]-1444681467|0;r=(r<<5|r>>>27)+s|0;n+=(r&i|s&~i)+e[2]-51403784|0;n=(n<<9|n>>>23)+r|0;i+=(n&s|r&~s)+e[7]+1735328473|0;i=(i<<14|i>>>18)+n|0;s+=(i&r|n&~r)+e[12]-1926607734|0;s=(s<<20|s>>>12)+i|0;r+=(s^i^n)+e[5]-378558|0;r=(r<<4|r>>>28)+s|0;n+=(r^s^i)+e[8]-2022574463|0;n=(n<<11|n>>>21)+r|0;i+=(n^r^s)+e[11]+1839030562|0;i=(i<<16|i>>>16)+n|0;s+=(i^n^r)+e[14]-35309556|0;s=(s<<23|s>>>9)+i|0;r+=(s^i^n)+e[1]-1530992060|0;r=(r<<4|r>>>28)+s|0;n+=(r^s^i)+e[4]+1272893353|0;n=(n<<11|n>>>21)+r|0;i+=(n^r^s)+e[7]-155497632|0;i=(i<<16|i>>>16)+n|0;s+=(i^n^r)+e[10]-1094730640|0;s=(s<<23|s>>>9)+i|0;r+=(s^i^n)+e[13]+681279174|0;r=(r<<4|r>>>28)+s|0;n+=(r^s^i)+e[0]-358537222|0;n=(n<<11|n>>>21)+r|0;i+=(n^r^s)+e[3]-722521979|0;i=(i<<16|i>>>16)+n|0;s+=(i^n^r)+e[6]+76029189|0;s=(s<<23|s>>>9)+i|0;r+=(s^i^n)+e[9]-640364487|0;r=(r<<4|r>>>28)+s|0;n+=(r^s^i)+e[12]-421815835|0;n=(n<<11|n>>>21)+r|0;i+=(n^r^s)+e[15]+530742520|0;i=(i<<16|i>>>16)+n|0;s+=(i^n^r)+e[2]-995338651|0;s=(s<<23|s>>>9)+i|0;r+=(i^(s|~n))+e[0]-198630844|0;r=(r<<6|r>>>26)+s|0;n+=(s^(r|~i))+e[7]+1126891415|0;n=(n<<10|n>>>22)+r|0;i+=(r^(n|~s))+e[14]-1416354905|0;i=(i<<15|i>>>17)+n|0;s+=(n^(i|~r))+e[5]-57434055|0;s=(s<<21|s>>>11)+i|0;r+=(i^(s|~n))+e[12]+1700485571|0;r=(r<<6|r>>>26)+s|0;n+=(s^(r|~i))+e[3]-1894986606|0;n=(n<<10|n>>>22)+r|0;i+=(r^(n|~s))+e[10]-1051523|0;i=(i<<15|i>>>17)+n|0;s+=(n^(i|~r))+e[1]-2054922799|0;s=(s<<21|s>>>11)+i|0;r+=(i^(s|~n))+e[8]+1873313359|0;r=(r<<6|r>>>26)+s|0;n+=(s^(r|~i))+e[15]-30611744|0;n=(n<<10|n>>>22)+r|0;i+=(r^(n|~s))+e[6]-1560198380|0;i=(i<<15|i>>>17)+n|0;s+=(n^(i|~r))+e[13]+1309151649|0;s=(s<<21|s>>>11)+i|0;r+=(i^(s|~n))+e[4]-145523070|0;r=(r<<6|r>>>26)+s|0;n+=(s^(r|~i))+e[11]-1120210379|0;n=(n<<10|n>>>22)+r|0;i+=(r^(n|~s))+e[2]+718787259|0;i=(i<<15|i>>>17)+n|0;s+=(n^(i|~r))+e[9]-343485551|0;s=(s<<21|s>>>11)+i|0;t[0]=r+t[0]|0;t[1]=s+t[1]|0;t[2]=i+t[2]|0;t[3]=n+t[3]|0}function s(t){var e,r=[];for(e=0;e<64;e+=4)r[e>>2]=t.charCodeAt(e)+(t.charCodeAt(e+1)<<8)+(t.charCodeAt(e+2)<<16)+(t.charCodeAt(e+3)<<24);return r}function i(t){var e,r=[];for(e=0;e<64;e+=4)r[e>>2]=t[e]+(t[e+1]<<8)+(t[e+2]<<16)+(t[e+3]<<24);return r}function n(t){var e,i,n,o,a,h,u=t.length,c=[1732584193,-271733879,-1732584194,271733878];for(e=64;e<=u;e+=64)r(c,s(t.substring(e-64,e)));t=t.substring(e-64);i=t.length;n=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(e=0;e>2]|=t.charCodeAt(e)<<(e%4<<3);n[e>>2]|=128<<(e%4<<3);if(e>55){r(c,n);for(e=0;e<16;e+=1)n[e]=0}o=u*8;o=o.toString(16).match(/(.*?)(.{0,8})$/);a=parseInt(o[2],16);h=parseInt(o[1],16)||0;n[14]=a;n[15]=h;r(c,n);return c}function o(t){var e,s,n,o,a,h,u=t.length,c=[1732584193,-271733879,-1732584194,271733878];for(e=64;e<=u;e+=64)r(c,i(t.subarray(e-64,e)));t=e-64>2]|=t[e]<<(e%4<<3);n[e>>2]|=128<<(e%4<<3);if(e>55){r(c,n);for(e=0;e<16;e+=1)n[e]=0}o=u*8;o=o.toString(16).match(/(.*?)(.{0,8})$/);a=parseInt(o[2],16);h=parseInt(o[1],16)||0;n[14]=a;n[15]=h;r(c,n);return c}function a(t){var r,s="";for(r=0;r<4;r+=1)s+=e[t>>r*8+4&15]+e[t>>r*8&15];return s}function h(t){var e;for(e=0;ec)return new ArrayBuffer(0);i=c-u;n=new ArrayBuffer(i);o=new Uint8Array(n);a=new Uint8Array(this,u,i);o.set(a);return n}}();function u(t){/[\u0080-\uFFFF]/.test(t)&&(t=unescape(encodeURIComponent(t)));return t}function c(t,e){var r,s=t.length,i=new ArrayBuffer(s),n=new Uint8Array(i);for(r=0;r>2]|=s.charCodeAt(e)<<(e%4<<3);this._finish(n,i);r=h(this._hash);t&&(r=d(r));this.reset();return r};p.prototype.reset=function(){this._buff="";this._length=0;this._hash=[1732584193,-271733879,-1732584194,271733878];return this};p.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash.slice()}};p.prototype.setState=function(t){this._buff=t.buff;this._length=t.length;this._hash=t.hash;return this};p.prototype.destroy=function(){delete this._hash;delete this._buff;delete this._length};p.prototype._finish=function(t,e){var s,i,n,o=e;t[o>>2]|=128<<(o%4<<3);if(o>55){r(this._hash,t);for(o=0;o<16;o+=1)t[o]=0}s=this._length*8;s=s.toString(16).match(/(.*?)(.{0,8})$/);i=parseInt(s[2],16);n=parseInt(s[1],16)||0;t[14]=i;t[15]=n;r(this._hash,t)};p.hash=function(t,e){return p.hashBinary(u(t),e)};p.hashBinary=function(t,e){var r=n(t),s=h(r);return e?d(s):s};p.ArrayBuffer=function(){this.reset()};p.ArrayBuffer.prototype.append=function(t){var e,s=f(this._buff.buffer,t,true),n=s.length;this._length+=t.byteLength;for(e=64;e<=n;e+=64)r(this._hash,i(s.subarray(e-64,e)));this._buff=e-64>2]|=s[e]<<(e%4<<3);this._finish(n,i);r=h(this._hash);t&&(r=d(r));this.reset();return r};p.ArrayBuffer.prototype.reset=function(){this._buff=new Uint8Array(0);this._length=0;this._hash=[1732584193,-271733879,-1732584194,271733878];return this};p.ArrayBuffer.prototype.getState=function(){var t=p.prototype.getState.call(this);t.buff=l(t.buff);return t};p.ArrayBuffer.prototype.setState=function(t){t.buff=c(t.buff,true);return p.prototype.setState.call(this,t)};p.ArrayBuffer.prototype.destroy=p.prototype.destroy;p.ArrayBuffer.prototype._finish=p.prototype._finish;p.ArrayBuffer.hash=function(t,e){var r=o(new Uint8Array(t)),s=h(r);return e?d(s):s};return p}))})(t);var e=t.exports;const r=File.prototype.slice||File.prototype.mozSlice||File.prototype.webkitSlice;class FileChecksum{static create(t,e){const r=new FileChecksum(t);r.create(e)}constructor(t){this.file=t;this.chunkSize=2097152;this.chunkCount=Math.ceil(this.file.size/this.chunkSize);this.chunkIndex=0}create(t){this.callback=t;this.md5Buffer=new e.ArrayBuffer;this.fileReader=new FileReader;this.fileReader.addEventListener("load",(t=>this.fileReaderDidLoad(t)));this.fileReader.addEventListener("error",(t=>this.fileReaderDidError(t)));this.readNextChunk()}fileReaderDidLoad(t){this.md5Buffer.append(t.target.result);if(!this.readNextChunk()){const t=this.md5Buffer.end(true);const e=btoa(t);this.callback(null,e)}}fileReaderDidError(t){this.callback(`Error reading ${this.file.name}`)}readNextChunk(){if(this.chunkIndex{this.xhr.setRequestHeader(t,i[t])}));const n=s("csrf-token");n!=void 0&&this.xhr.setRequestHeader("X-CSRF-Token",n);this.xhr.addEventListener("load",(t=>this.requestDidLoad(t)));this.xhr.addEventListener("error",(t=>this.requestDidError(t)))}get status(){return this.xhr.status}get response(){const{responseType:t,response:e}=this.xhr;return t=="json"?e:JSON.parse(e)}create(t){this.callback=t;this.xhr.send(JSON.stringify({blob:this.attributes}))}requestDidLoad(t){if(this.status>=200&&this.status<300){const{response:t}=this;const{direct_upload:e}=t;delete t.direct_upload;this.attributes=t;this.directUploadData=e;this.callback(null,this.toJSON())}else this.requestDidError(t)}requestDidError(t){this.callback(`Error creating Blob for "${this.file.name}". Status: ${this.status}`)}toJSON(){const t={};for(const e in this.attributes)t[e]=this.attributes[e];return t}}class BlobUpload{constructor(t){this.blob=t;this.file=t.file;const{url:e,headers:r}=t.directUploadData;this.xhr=new XMLHttpRequest;this.xhr.open("PUT",e,true);this.xhr.responseType="text";for(const t in r)this.xhr.setRequestHeader(t,r[t]);this.xhr.addEventListener("load",(t=>this.requestDidLoad(t)));this.xhr.addEventListener("error",(t=>this.requestDidError(t)))}create(t){this.callback=t;this.xhr.send(this.file.slice())}requestDidLoad(t){const{status:e,response:r}=this.xhr;e>=200&&e<300?this.callback(null,r):this.requestDidError(t)}requestDidError(t){this.callback(`Error storing "${this.file.name}". Status: ${this.xhr.status}`)}}let h=0;class DirectUpload{constructor(t,e,r,s={}){this.id=++h;this.file=t;this.url=e;this.delegate=r;this.customHeaders=s}create(t){FileChecksum.create(this.file,((e,r)=>{if(e){t(e);return}const s=new BlobRecord(this.file,r,this.url,this.customHeaders);u(this.delegate,"directUploadWillCreateBlobWithXHR",s.xhr);s.create((e=>{if(e)t(e);else{const e=new BlobUpload(s);u(this.delegate,"directUploadWillStoreFileWithXHR",e.xhr);e.create((e=>{e?t(e):t(null,s.toJSON())}))}}))}))}}function u(t,e,...r){if(t&&typeof t[e]=="function")return t[e](...r)}class DirectUploadController{constructor(t,e){this.input=t;this.file=e;this.directUpload=new DirectUpload(this.file,this.url,this);this.dispatch("initialize")}start(t){const e=document.createElement("input");e.type="hidden";e.name=this.input.name;this.input.insertAdjacentElement("beforebegin",e);this.dispatch("start");this.directUpload.create(((r,s)=>{if(r){e.parentNode.removeChild(e);this.dispatchError(r)}else e.value=s.signed_id;this.dispatch("end");t(r)}))}uploadRequestDidProgress(t){const e=t.loaded/t.total*90;e&&this.dispatch("progress",{progress:e})}get url(){return this.input.getAttribute("data-direct-upload-url")}dispatch(t,e={}){e.file=this.file;e.id=this.directUpload.id;return o(this.input,`direct-upload:${t}`,{detail:e})}dispatchError(t){const e=this.dispatch("error",{error:t});e.defaultPrevented||alert(t)}directUploadWillCreateBlobWithXHR(t){this.dispatch("before-blob-request",{xhr:t})}directUploadWillStoreFileWithXHR(t){this.dispatch("before-storage-request",{xhr:t});t.upload.addEventListener("progress",(t=>this.uploadRequestDidProgress(t)));t.upload.addEventListener("loadend",(()=>{this.simulateResponseProgress(t)}))}simulateResponseProgress(t){let e=90;const r=Date.now();const s=()=>{const i=Date.now()-r;const n=this.estimateResponseTime();const o=Math.min(i/n,1);e=90+o*9;this.dispatch("progress",{progress:e});t.readyState!==XMLHttpRequest.DONE&&e<99&&requestAnimationFrame(s)};t.addEventListener("loadend",(()=>{this.dispatch("progress",{progress:100})}));requestAnimationFrame(s)}estimateResponseTime(){const t=this.file.size;const e=1048576;return tt.files.length))}start(t){const e=this.createDirectUploadControllers();const r=()=>{const s=e.shift();if(s)s.start((e=>{if(e){t(e);this.dispatch("end")}else r()}));else{t();this.dispatch("end")}};this.dispatch("start");r()}createDirectUploadControllers(){const t=[];this.inputs.forEach((e=>{a(e.files).forEach((r=>{const s=new DirectUploadController(e,r);t.push(s)}))}));return t}dispatch(t,e={}){return o(this.form,`direct-uploads:${t}`,{detail:e})}}const l="data-direct-uploads-processing";const f=new WeakMap;let d=false;function p(){if(!d){d=true;document.addEventListener("click",b,true);document.addEventListener("submit",y,true);document.addEventListener("ajax:before",g)}}function b(t){const e=t.target.closest("button, input");e&&e.type==="submit"&&e.form&&f.set(e.form,e)}function y(t){m(t)}function g(t){t.target.tagName=="FORM"&&m(t)}function m(t){const e=t.target;if(e.hasAttribute(l)){t.preventDefault();return}const r=new DirectUploadsController(e);const{inputs:s}=r;if(s.length){t.preventDefault();e.setAttribute(l,"");s.forEach(v);r.start((t=>{e.removeAttribute(l);t?s.forEach(_):A(e)}))}}function A(t){let e=f.get(t)||n(t,"input[type=submit], button[type=submit]");if(e){const{disabled:t}=e;e.disabled=false;e.focus();e.click();e.disabled=t}else{e=document.createElement("input");e.type="submit";e.style.display="none";t.appendChild(e);e.click();t.removeChild(e)}f.delete(t)}function v(t){t.disabled=true}function _(t){t.disabled=false}function x(){window.ActiveStorage&&p()}setTimeout(x,1);export{DirectUpload,DirectUploadController,DirectUploadsController,o as dispatchEvent,p as start}; +var e={exports:{}};(function(e,t){(function(t){e.exports=t()})((function(e){var t=[`0`,`1`,`2`,`3`,`4`,`5`,`6`,`7`,`8`,`9`,`a`,`b`,`c`,`d`,`e`,`f`];function n(e,t){var n=e[0],r=e[1],i=e[2],a=e[3];n+=(r&i|~r&a)+t[0]-680876936|0,n=(n<<7|n>>>25)+r|0,a+=(n&r|~n&i)+t[1]-389564586|0,a=(a<<12|a>>>20)+n|0,i+=(a&n|~a&r)+t[2]+606105819|0,i=(i<<17|i>>>15)+a|0,r+=(i&a|~i&n)+t[3]-1044525330|0,r=(r<<22|r>>>10)+i|0,n+=(r&i|~r&a)+t[4]-176418897|0,n=(n<<7|n>>>25)+r|0,a+=(n&r|~n&i)+t[5]+1200080426|0,a=(a<<12|a>>>20)+n|0,i+=(a&n|~a&r)+t[6]-1473231341|0,i=(i<<17|i>>>15)+a|0,r+=(i&a|~i&n)+t[7]-45705983|0,r=(r<<22|r>>>10)+i|0,n+=(r&i|~r&a)+t[8]+1770035416|0,n=(n<<7|n>>>25)+r|0,a+=(n&r|~n&i)+t[9]-1958414417|0,a=(a<<12|a>>>20)+n|0,i+=(a&n|~a&r)+t[10]-42063|0,i=(i<<17|i>>>15)+a|0,r+=(i&a|~i&n)+t[11]-1990404162|0,r=(r<<22|r>>>10)+i|0,n+=(r&i|~r&a)+t[12]+1804603682|0,n=(n<<7|n>>>25)+r|0,a+=(n&r|~n&i)+t[13]-40341101|0,a=(a<<12|a>>>20)+n|0,i+=(a&n|~a&r)+t[14]-1502002290|0,i=(i<<17|i>>>15)+a|0,r+=(i&a|~i&n)+t[15]+1236535329|0,r=(r<<22|r>>>10)+i|0,n+=(r&a|i&~a)+t[1]-165796510|0,n=(n<<5|n>>>27)+r|0,a+=(n&i|r&~i)+t[6]-1069501632|0,a=(a<<9|a>>>23)+n|0,i+=(a&r|n&~r)+t[11]+643717713|0,i=(i<<14|i>>>18)+a|0,r+=(i&n|a&~n)+t[0]-373897302|0,r=(r<<20|r>>>12)+i|0,n+=(r&a|i&~a)+t[5]-701558691|0,n=(n<<5|n>>>27)+r|0,a+=(n&i|r&~i)+t[10]+38016083|0,a=(a<<9|a>>>23)+n|0,i+=(a&r|n&~r)+t[15]-660478335|0,i=(i<<14|i>>>18)+a|0,r+=(i&n|a&~n)+t[4]-405537848|0,r=(r<<20|r>>>12)+i|0,n+=(r&a|i&~a)+t[9]+568446438|0,n=(n<<5|n>>>27)+r|0,a+=(n&i|r&~i)+t[14]-1019803690|0,a=(a<<9|a>>>23)+n|0,i+=(a&r|n&~r)+t[3]-187363961|0,i=(i<<14|i>>>18)+a|0,r+=(i&n|a&~n)+t[8]+1163531501|0,r=(r<<20|r>>>12)+i|0,n+=(r&a|i&~a)+t[13]-1444681467|0,n=(n<<5|n>>>27)+r|0,a+=(n&i|r&~i)+t[2]-51403784|0,a=(a<<9|a>>>23)+n|0,i+=(a&r|n&~r)+t[7]+1735328473|0,i=(i<<14|i>>>18)+a|0,r+=(i&n|a&~n)+t[12]-1926607734|0,r=(r<<20|r>>>12)+i|0,n+=(r^i^a)+t[5]-378558|0,n=(n<<4|n>>>28)+r|0,a+=(n^r^i)+t[8]-2022574463|0,a=(a<<11|a>>>21)+n|0,i+=(a^n^r)+t[11]+1839030562|0,i=(i<<16|i>>>16)+a|0,r+=(i^a^n)+t[14]-35309556|0,r=(r<<23|r>>>9)+i|0,n+=(r^i^a)+t[1]-1530992060|0,n=(n<<4|n>>>28)+r|0,a+=(n^r^i)+t[4]+1272893353|0,a=(a<<11|a>>>21)+n|0,i+=(a^n^r)+t[7]-155497632|0,i=(i<<16|i>>>16)+a|0,r+=(i^a^n)+t[10]-1094730640|0,r=(r<<23|r>>>9)+i|0,n+=(r^i^a)+t[13]+681279174|0,n=(n<<4|n>>>28)+r|0,a+=(n^r^i)+t[0]-358537222|0,a=(a<<11|a>>>21)+n|0,i+=(a^n^r)+t[3]-722521979|0,i=(i<<16|i>>>16)+a|0,r+=(i^a^n)+t[6]+76029189|0,r=(r<<23|r>>>9)+i|0,n+=(r^i^a)+t[9]-640364487|0,n=(n<<4|n>>>28)+r|0,a+=(n^r^i)+t[12]-421815835|0,a=(a<<11|a>>>21)+n|0,i+=(a^n^r)+t[15]+530742520|0,i=(i<<16|i>>>16)+a|0,r+=(i^a^n)+t[2]-995338651|0,r=(r<<23|r>>>9)+i|0,n+=(i^(r|~a))+t[0]-198630844|0,n=(n<<6|n>>>26)+r|0,a+=(r^(n|~i))+t[7]+1126891415|0,a=(a<<10|a>>>22)+n|0,i+=(n^(a|~r))+t[14]-1416354905|0,i=(i<<15|i>>>17)+a|0,r+=(a^(i|~n))+t[5]-57434055|0,r=(r<<21|r>>>11)+i|0,n+=(i^(r|~a))+t[12]+1700485571|0,n=(n<<6|n>>>26)+r|0,a+=(r^(n|~i))+t[3]-1894986606|0,a=(a<<10|a>>>22)+n|0,i+=(n^(a|~r))+t[10]-1051523|0,i=(i<<15|i>>>17)+a|0,r+=(a^(i|~n))+t[1]-2054922799|0,r=(r<<21|r>>>11)+i|0,n+=(i^(r|~a))+t[8]+1873313359|0,n=(n<<6|n>>>26)+r|0,a+=(r^(n|~i))+t[15]-30611744|0,a=(a<<10|a>>>22)+n|0,i+=(n^(a|~r))+t[6]-1560198380|0,i=(i<<15|i>>>17)+a|0,r+=(a^(i|~n))+t[13]+1309151649|0,r=(r<<21|r>>>11)+i|0,n+=(i^(r|~a))+t[4]-145523070|0,n=(n<<6|n>>>26)+r|0,a+=(r^(n|~i))+t[11]-1120210379|0,a=(a<<10|a>>>22)+n|0,i+=(n^(a|~r))+t[2]+718787259|0,i=(i<<15|i>>>17)+a|0,r+=(a^(i|~n))+t[9]-343485551|0,r=(r<<21|r>>>11)+i|0,e[0]=n+e[0]|0,e[1]=r+e[1]|0,e[2]=i+e[2]|0,e[3]=a+e[3]|0}function r(e){var t=[],n;for(n=0;n<64;n+=4)t[n>>2]=e.charCodeAt(n)+(e.charCodeAt(n+1)<<8)+(e.charCodeAt(n+2)<<16)+(e.charCodeAt(n+3)<<24);return t}function i(e){var t=[],n;for(n=0;n<64;n+=4)t[n>>2]=e[n]+(e[n+1]<<8)+(e[n+2]<<16)+(e[n+3]<<24);return t}function a(e){var t=e.length,i=[1732584193,-271733879,-1732584194,271733878],a,o,s,c,l,u;for(a=64;a<=t;a+=64)n(i,r(e.substring(a-64,a)));for(e=e.substring(a-64),o=e.length,s=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],a=0;a>2]|=e.charCodeAt(a)<<(a%4<<3);if(s[a>>2]|=128<<(a%4<<3),a>55)for(n(i,s),a=0;a<16;a+=1)s[a]=0;return c=t*8,c=c.toString(16).match(/(.*?)(.{0,8})$/),l=parseInt(c[2],16),u=parseInt(c[1],16)||0,s[14]=l,s[15]=u,n(i,s),i}function o(e){var t=e.length,r=[1732584193,-271733879,-1732584194,271733878],a,o,s,c,l,u;for(a=64;a<=t;a+=64)n(r,i(e.subarray(a-64,a)));for(e=a-64>2]|=e[a]<<(a%4<<3);if(s[a>>2]|=128<<(a%4<<3),a>55)for(n(r,s),a=0;a<16;a+=1)s[a]=0;return c=t*8,c=c.toString(16).match(/(.*?)(.{0,8})$/),l=parseInt(c[2],16),u=parseInt(c[1],16)||0,s[14]=l,s[15]=u,n(r,s),r}function s(e){var n=``,r;for(r=0;r<4;r+=1)n+=t[e>>r*8+4&15]+t[e>>r*8&15];return n}function c(e){var t;for(t=0;to?/* @__PURE__ */ new ArrayBuffer(0):(s=o-a,c=new ArrayBuffer(s),l=new Uint8Array(c),u=new Uint8Array(this,a,s),l.set(u),c)}})();function l(e){return/[\u0080-\uFFFF]/.test(e)&&(e=unescape(encodeURIComponent(e))),e}function u(e,t){var n=e.length,r=new ArrayBuffer(n),i=new Uint8Array(r),a;for(a=0;a>2]|=t.charCodeAt(r)<<(r%4<<3);return this._finish(i,n),a=c(this._hash),e&&(a=p(a)),this.reset(),a},m.prototype.reset=function(){return this._buff=``,this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},m.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash.slice()}},m.prototype.setState=function(e){return this._buff=e.buff,this._length=e.length,this._hash=e.hash,this},m.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},m.prototype._finish=function(e,t){var r=t,i,a,o;if(e[r>>2]|=128<<(r%4<<3),r>55)for(n(this._hash,e),r=0;r<16;r+=1)e[r]=0;i=this._length*8,i=i.toString(16).match(/(.*?)(.{0,8})$/),a=parseInt(i[2],16),o=parseInt(i[1],16)||0,e[14]=a,e[15]=o,n(this._hash,e)},m.hash=function(e,t){return m.hashBinary(l(e),t)},m.hashBinary=function(e,t){var n=c(a(e));return t?p(n):n},m.ArrayBuffer=function(){this.reset()},m.ArrayBuffer.prototype.append=function(e){var t=f(this._buff.buffer,e,!0),r=t.length,a;for(this._length+=e.byteLength,a=64;a<=r;a+=64)n(this._hash,i(t.subarray(a-64,a)));return this._buff=a-64>2]|=t[i]<<(i%4<<3);return this._finish(r,n),a=c(this._hash),e&&(a=p(a)),this.reset(),a},m.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array,this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},m.ArrayBuffer.prototype.getState=function(){var e=m.prototype.getState.call(this);return e.buff=d(e.buff),e},m.ArrayBuffer.prototype.setState=function(e){return e.buff=u(e.buff,!0),m.prototype.setState.call(this,e)},m.ArrayBuffer.prototype.destroy=m.prototype.destroy,m.ArrayBuffer.prototype._finish=m.prototype._finish,m.ArrayBuffer.hash=function(e,t){var n=c(o(new Uint8Array(e)));return t?p(n):n},m}))})(e);var t=e.exports;const n=File.prototype.slice||File.prototype.mozSlice||File.prototype.webkitSlice;class FileChecksum{static create(e,t){new FileChecksum(e).create(t)}constructor(e){this.file=e,this.chunkSize=2097152,this.chunkCount=Math.ceil(this.file.size/this.chunkSize),this.chunkIndex=0}create(e){this.callback=e,this.md5Buffer=new t.ArrayBuffer,this.fileReader=new FileReader,this.fileReader.addEventListener(`load`,(e=>this.fileReaderDidLoad(e))),this.fileReader.addEventListener(`error`,(e=>this.fileReaderDidError(e))),this.readNextChunk()}fileReaderDidLoad(e){if(this.md5Buffer.append(e.target.result),!this.readNextChunk()){let e=this.md5Buffer.end(!0),t=btoa(e);this.callback(null,t)}}fileReaderDidError(e){this.callback(`Error reading ${this.file.name}`)}readNextChunk(){if(this.chunkIndex{this.xhr.setRequestHeader(e,i[e])}));let a=r(`csrf-token`);a!=null&&this.xhr.setRequestHeader(`X-CSRF-Token`,a),this.xhr.addEventListener(`load`,(e=>this.requestDidLoad(e))),this.xhr.addEventListener(`error`,(e=>this.requestDidError(e)))}get status(){return this.xhr.status}get response(){let{responseType:e,response:t}=this.xhr;return e==`json`?t:JSON.parse(t)}create(e){this.callback=e,this.xhr.send(JSON.stringify({blob:this.attributes}))}requestDidLoad(e){if(this.status>=200&&this.status<300){let{response:e}=this,{direct_upload:t}=e;delete e.direct_upload,this.attributes=e,this.directUploadData=t,this.callback(null,this.toJSON())}else this.requestDidError(e)}requestDidError(e){this.callback(`Error creating Blob for "${this.file.name}". Status: ${this.status}`)}toJSON(){let e={};for(let t in this.attributes)e[t]=this.attributes[t];return e}}class BlobUpload{constructor(e){this.blob=e,this.file=e.file;let{url:t,headers:n}=e.directUploadData;this.xhr=new XMLHttpRequest,this.xhr.open(`PUT`,t,!0),this.xhr.responseType=`text`;for(let e in n)this.xhr.setRequestHeader(e,n[e]);this.xhr.addEventListener(`load`,(e=>this.requestDidLoad(e))),this.xhr.addEventListener(`error`,(e=>this.requestDidError(e)))}create(e){this.callback=e,this.xhr.send(this.file.slice())}requestDidLoad(e){let{status:t,response:n}=this.xhr;t>=200&&t<300?this.callback(null,n):this.requestDidError(e)}requestDidError(e){this.callback(`Error storing "${this.file.name}". Status: ${this.xhr.status}`)}}let c=0;class DirectUpload{constructor(e,t,n,r={}){this.id=++c,this.file=e,this.url=t,this.delegate=n,this.customHeaders=r}create(e){FileChecksum.create(this.file,((t,n)=>{if(t){e(t);return}let r=new BlobRecord(this.file,n,this.url,this.customHeaders);l(this.delegate,`directUploadWillCreateBlobWithXHR`,r.xhr),r.create((t=>{if(t)e(t);else{let t=new BlobUpload(r);l(this.delegate,`directUploadWillStoreFileWithXHR`,t.xhr),t.create((t=>{t?e(t):e(null,r.toJSON())}))}}))}))}}function l(e,t,...n){if(e&&typeof e[t]==`function`)return e[t](...n)}class DirectUploadController{constructor(e,t){this.input=e,this.file=t,this.directUpload=new DirectUpload(this.file,this.url,this),this.dispatch(`initialize`)}start(e){let t=document.createElement(`input`);t.type=`hidden`,t.name=this.input.name,this.input.insertAdjacentElement(`beforebegin`,t),this.dispatch(`start`),this.directUpload.create(((n,r)=>{n?(t.parentNode.removeChild(t),this.dispatchError(n)):t.value=r.signed_id,this.dispatch(`end`),e(n)}))}uploadRequestDidProgress(e){let t=e.loaded/e.total*90;t&&this.dispatch(`progress`,{progress:t})}get url(){return this.input.getAttribute(`data-direct-upload-url`)}dispatch(e,t={}){return t.file=this.file,t.id=this.directUpload.id,o(this.input,`direct-upload:${e}`,{detail:t})}dispatchError(e){this.dispatch(`error`,{error:e}).defaultPrevented||alert(e)}directUploadWillCreateBlobWithXHR(e){this.dispatch(`before-blob-request`,{xhr:e})}directUploadWillStoreFileWithXHR(e){this.dispatch(`before-storage-request`,{xhr:e}),e.upload.addEventListener(`progress`,(e=>this.uploadRequestDidProgress(e))),e.upload.addEventListener(`loadend`,(()=>{this.simulateResponseProgress(e)}))}simulateResponseProgress(e){let t=90,n=Date.now(),r=()=>{let i=Date.now()-n,a=this.estimateResponseTime();t=90+Math.min(i/a,1)*9,this.dispatch(`progress`,{progress:t}),e.readyState!==XMLHttpRequest.DONE&&t<99&&requestAnimationFrame(r)};e.addEventListener(`loadend`,(()=>{this.dispatch(`progress`,{progress:100})})),requestAnimationFrame(r)}estimateResponseTime(){let e=this.file.size,t=1024*1024;return ee.files.length))}start(e){let t=this.createDirectUploadControllers(),n=()=>{let r=t.shift();r?r.start((t=>{t?(e(t),this.dispatch(`end`)):n()})):(e(),this.dispatch(`end`))};this.dispatch(`start`),n()}createDirectUploadControllers(){let e=[];return this.inputs.forEach((t=>{s(t.files).forEach((n=>{let r=new DirectUploadController(t,n);e.push(r)}))})),e}dispatch(e,t={}){return o(this.form,`direct-uploads:${e}`,{detail:t})}}const d=`data-direct-uploads-processing`,f=/* @__PURE__ */ new WeakMap;let p=!1;function m(){p||(p=!0,document.addEventListener(`click`,h,!0),document.addEventListener(`submit`,g,!0),document.addEventListener(`ajax:before`,_))}function h(e){let t=e.target.closest(`button, input`);t&&t.type===`submit`&&t.form&&f.set(t.form,t)}function g(e){v(e)}function _(e){e.target.tagName==`FORM`&&v(e)}function v(e){let t=e.target;if(t.hasAttribute(d)){e.preventDefault();return}let n=new DirectUploadsController(t),{inputs:r}=n;r.length&&(e.preventDefault(),t.setAttribute(d,``),r.forEach(b),n.start((e=>{t.removeAttribute(d),e?r.forEach(x):y(t)})))}function y(e){let t=f.get(e)||a(e,`input[type=submit], button[type=submit]`);if(t){let{disabled:e}=t;t.disabled=!1,t.focus(),t.click(),t.disabled=e}else t=document.createElement(`input`),t.type=`submit`,t.style.display=`none`,e.appendChild(t),t.click(),e.removeChild(t);f.delete(e)}function b(e){e.disabled=!0}function x(e){e.disabled=!1}function S(){window.ActiveStorage&&m()}setTimeout(S,1);export{DirectUpload,DirectUploadController,DirectUploadsController,o as dispatchEvent,m as start}; diff --git a/vendor/javascript/tom-select.js b/vendor/javascript/tom-select.js deleted file mode 100644 index 6414c54..0000000 --- a/vendor/javascript/tom-select.js +++ /dev/null @@ -1,4 +0,0 @@ -// tom-select@2.4.3 downloaded from https://ga.jspm.io/npm:tom-select@2.4.3/dist/esm/tom-select.complete.js - -import i from"./tom-select.js";import o from"./plugins/change_listener/plugin.js";import n from"./plugins/checkbox_options/plugin.js";import r from"./plugins/clear_button/plugin.js";import e from"./plugins/drag_drop/plugin.js";import p from"./plugins/dropdown_header/plugin.js";import t from"./plugins/caret_position/plugin.js";import s from"./plugins/dropdown_input/plugin.js";import l from"./plugins/input_autogrow/plugin.js";import m from"./plugins/no_backspace_delete/plugin.js";import u from"./plugins/no_active_items/plugin.js";import g from"./plugins/optgroup_columns/plugin.js";import d from"./plugins/remove_button/plugin.js";import c from"./plugins/restore_on_backspace/plugin.js";import _ from"./plugins/virtual_scroll/plugin.js";import"./contrib/microevent.js";import"./contrib/microplugin.js";import"@orchidjs/sifter";import"@orchidjs/unicode-variants";import"./contrib/highlight.js";import"./vanilla.js";import"./utils.js";import"./constants.js";import"./getSettings.js";import"./defaults.js";i.define("change_listener",o);i.define("checkbox_options",n);i.define("clear_button",r);i.define("drag_drop",e);i.define("dropdown_header",p);i.define("caret_position",t);i.define("dropdown_input",s);i.define("input_autogrow",l);i.define("no_backspace_delete",m);i.define("no_active_items",u);i.define("optgroup_columns",g);i.define("remove_button",d);i.define("restore_on_backspace",c);i.define("virtual_scroll",_);export{i as default}; -