├── 2022 └── day │ ├── 1 │ ├── index.qmd │ ├── input │ └── script.R │ ├── 2 │ └── input │ └── _metadata.yml ├── 2024 └── day │ ├── _metadata.yml │ └── introduction │ └── index.qmd ├── .github └── workflows │ └── publish.yml ├── .gitignore ├── 2022.qmd ├── 2024.qmd ├── README.Rmd ├── README.md ├── README_files └── libs │ ├── bootstrap │ ├── bootstrap-icons.css │ ├── bootstrap-icons.woff │ ├── bootstrap.min.css │ └── bootstrap.min.js │ ├── clipboard │ └── clipboard.min.js │ └── quarto-html │ ├── anchor.min.js │ ├── popper.min.js │ ├── quarto-syntax-highlighting.css │ ├── quarto.js │ ├── tippy.css │ └── tippy.umd.min.js ├── _freeze ├── 2022 │ └── day │ │ └── 1 │ │ └── index │ │ └── execute-results │ │ └── html.json └── site_libs │ ├── clipboard │ └── clipboard.min.js │ └── quarto-listing │ ├── list.min.js │ └── quarto-listing.js ├── _quarto.yml ├── _templates ├── YYYY-conclusion │ └── index.qmd ├── YYYY-intro │ └── index.qmd ├── YYYY.qmd ├── _metadata.yml └── post-template │ ├── index.qmd │ └── script.R ├── advent-of-code-website-template.Rproj ├── custom-dark.scss ├── custom-light.scss ├── fonts ├── LICENSE.md ├── Readme.md ├── iAWriterMonoS-Bold.woff ├── iAWriterMonoS-Bold.woff2 ├── iAWriterMonoS-Regular.woff ├── iAWriterMonoS-Regular.woff2 ├── iAWriterQuattroS-Bold.woff ├── iAWriterQuattroS-Bold.woff2 ├── iAWriterQuattroS-Regular.woff └── iAWriterQuattroS-Regular.woff2 ├── index.qmd └── styles.css /.github/workflows/publish.yml: -------------------------------------------------------------------------------- 1 | on: 2 | workflow_dispatch: 3 | push: 4 | branches: main 5 | 6 | name: Quarto Publish 7 | 8 | jobs: 9 | build-deploy: 10 | runs-on: ubuntu-latest 11 | permissions: 12 | contents: write 13 | steps: 14 | - name: Check out repository 15 | uses: actions/checkout@v4 16 | 17 | - name: Set up Quarto 18 | uses: quarto-dev/quarto-actions/setup@v2 19 | 20 | - name: Render and Publish 21 | uses: quarto-dev/quarto-actions/publish@v2 22 | with: 23 | target: gh-pages 24 | env: 25 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .Rproj.user 2 | .Rhistory 3 | .RData 4 | .Ruserdata 5 | .Rdata 6 | .httr-oauth 7 | .DS_Store 8 | 9 | /.quarto/ 10 | /_site/ 11 | input -------------------------------------------------------------------------------- /2022.qmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "2022" 3 | listing: 4 | contents: "2022/day" 5 | sort: "date" 6 | type: table 7 | categories: true 8 | sort-ui: false 9 | filter-ui: false 10 | fields: [title, categories] 11 | --- 12 | -------------------------------------------------------------------------------- /2022/day/1/index.qmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "2022: Day 1" 3 | date: 2022-12-1 4 | categories: [base R, lists] 5 | draft: false 6 | --- 7 | 8 | ## Setup 9 | 10 | [The original challenge](https://adventofcode.com/2022/day/1) 11 | 12 | ## Part 1 13 | 14 | I'm including this post in the website example to demonstrate what a typical post will look like, using `post-template`, in the `_templates` directory as a starting point. This post is created by a call to `aoc_new_day(1, 2022)`. It can be deleted with a call to `aoc_delete_day(1, 2022)`, or all posts and the listing for the year can be deleted with `aoc_delete_year(2022)`. 15 | 16 | ```{r} 17 | #| echo: false 18 | OK <- "2022" < 3000 19 | # Will only evaluate next code block if an actual year has been substituted for the placeholder 20 | ``` 21 | 22 | ::: {.callout-note} 23 | This is Ella Kaye's solution^[Ella is the author of this website template and of the **aochelpers** package, and the author of this demo post.], with her puzzle input. If attempting this challenge yourself, your solution will be different. 24 | ::: 25 | 26 | ```{r} 27 | #| eval: !expr OK 28 | library(aochelpers) 29 | input <- aoc_input_vector(1, 2022, mode = "numeric") 30 | ``` 31 | 32 | I'm using the `aoc_input_vector()` function from the **aochelpers** package to read in the data, but otherwise using base R functions (including the native pipe, `|>`) for this puzzle. 33 | 34 | In this challenge, we're given groups of numbers and we need to find the sum of each group. 35 | Our solution is the largest of these. The groups are separated by a blank line. When reading in the input as a numeric vector, these are coerced to `NA`. 36 | We can identify the new groups by the `NA` values, produce an index for them with `cumsum(is.na(input))`, 37 | which increments when a new `NA` is reached, then use this with `split()` to split the input into a list of vectors, one for each group. 38 | We need the argument `na.rm = TRUE` in `sapply()` because each vector, other than the first, starts with `NA`, as that's where it was split. 39 | 40 | ```{r} 41 | totals <- split(input, cumsum(is.na(input))) |> 42 | sapply(sum, na.rm = TRUE) 43 | 44 | max(totals) 45 | ``` 46 | 47 | ## Part 2 48 | 49 | This is similar, except we want to find the sum of the sums of the top three groups. 50 | 51 | ```{r} 52 | totals |> 53 | sort() |> 54 | tail(3) |> 55 | sum() 56 | ``` 57 | 58 | -------------------------------------------------------------------------------- /2022/day/1/input: -------------------------------------------------------------------------------- 1 | 5686 2 | 2211 3 | 1513 4 | 7036 5 | 5196 6 | 10274 7 | 2967 8 | 2551 9 | 10 | 5942 11 | 5827 12 | 2514 13 | 4024 14 | 15 | 9857 16 | 13173 17 | 13071 18 | 17540 19 | 20 | 8264 21 | 2725 22 | 6163 23 | 3589 24 | 4223 25 | 8568 26 | 3009 27 | 8662 28 | 1376 29 | 30 | 1270 31 | 5911 32 | 6619 33 | 4174 34 | 1153 35 | 7989 36 | 2435 37 | 3577 38 | 1086 39 | 3233 40 | 41 | 16008 42 | 16955 43 | 13004 44 | 45 | 5135 46 | 2622 47 | 7433 48 | 2508 49 | 6498 50 | 6702 51 | 4321 52 | 3999 53 | 5778 54 | 2692 55 | 1523 56 | 57 | 7310 58 | 1841 59 | 2040 60 | 4938 61 | 6186 62 | 1555 63 | 6107 64 | 2880 65 | 4305 66 | 1270 67 | 8060 68 | 69 | 8727 70 | 5727 71 | 12263 72 | 14610 73 | 9171 74 | 75 | 42938 76 | 77 | 1860 78 | 5190 79 | 3635 80 | 1963 81 | 4026 82 | 4287 83 | 3410 84 | 1670 85 | 6451 86 | 3981 87 | 1281 88 | 1225 89 | 6461 90 | 3709 91 | 92 | 5058 93 | 5947 94 | 1528 95 | 10692 96 | 11369 97 | 12969 98 | 99 | 7290 100 | 4303 101 | 6729 102 | 3143 103 | 4367 104 | 2374 105 | 2881 106 | 1956 107 | 3864 108 | 6972 109 | 3263 110 | 6477 111 | 112 | 1507 113 | 5380 114 | 5788 115 | 4267 116 | 2937 117 | 1139 118 | 1529 119 | 3569 120 | 2081 121 | 3857 122 | 4758 123 | 2987 124 | 2080 125 | 2219 126 | 1794 127 | 128 | 2735 129 | 8620 130 | 3851 131 | 6929 132 | 3448 133 | 6822 134 | 5281 135 | 7563 136 | 4385 137 | 7865 138 | 139 | 2160 140 | 3457 141 | 2468 142 | 6635 143 | 3777 144 | 6423 145 | 3603 146 | 7088 147 | 3747 148 | 4105 149 | 3059 150 | 3236 151 | 152 | 14116 153 | 4368 154 | 18640 155 | 1213 156 | 157 | 11151 158 | 11231 159 | 10021 160 | 12658 161 | 162 | 1899 163 | 4539 164 | 4194 165 | 6465 166 | 6112 167 | 5642 168 | 4383 169 | 1999 170 | 1089 171 | 6234 172 | 5598 173 | 2817 174 | 1435 175 | 4993 176 | 177 | 16336 178 | 179 | 6654 180 | 6290 181 | 2606 182 | 1222 183 | 4484 184 | 4007 185 | 5560 186 | 4120 187 | 2672 188 | 1716 189 | 3431 190 | 6629 191 | 3534 192 | 193 | 1428 194 | 1117 195 | 4014 196 | 4237 197 | 3441 198 | 1564 199 | 2492 200 | 3999 201 | 1975 202 | 1689 203 | 5245 204 | 2862 205 | 4494 206 | 2527 207 | 208 | 4460 209 | 2987 210 | 4546 211 | 2783 212 | 6449 213 | 4539 214 | 5181 215 | 6599 216 | 5812 217 | 6772 218 | 5509 219 | 2650 220 | 3553 221 | 222 | 1375 223 | 7067 224 | 8702 225 | 4222 226 | 1146 227 | 2016 228 | 7478 229 | 5190 230 | 5963 231 | 4371 232 | 233 | 6564 234 | 1322 235 | 4502 236 | 1932 237 | 1589 238 | 3294 239 | 7798 240 | 7951 241 | 1151 242 | 243 | 9588 244 | 3857 245 | 6452 246 | 5841 247 | 4617 248 | 7876 249 | 250 | 3290 251 | 3008 252 | 8186 253 | 15610 254 | 11186 255 | 256 | 2275 257 | 4886 258 | 7045 259 | 1983 260 | 6616 261 | 7320 262 | 6840 263 | 1071 264 | 5123 265 | 6501 266 | 4227 267 | 5072 268 | 269 | 1553 270 | 3815 271 | 3787 272 | 3013 273 | 2284 274 | 4355 275 | 1161 276 | 4593 277 | 4336 278 | 2256 279 | 2382 280 | 5055 281 | 3923 282 | 5132 283 | 284 | 5379 285 | 1987 286 | 4347 287 | 5061 288 | 5045 289 | 6672 290 | 1153 291 | 5484 292 | 6456 293 | 6824 294 | 1588 295 | 296 | 14163 297 | 16215 298 | 1954 299 | 9164 300 | 301 | 7350 302 | 5067 303 | 2170 304 | 7769 305 | 5656 306 | 1661 307 | 7576 308 | 7416 309 | 6151 310 | 5020 311 | 5729 312 | 313 | 32348 314 | 20553 315 | 316 | 15878 317 | 7366 318 | 13034 319 | 3482 320 | 8740 321 | 322 | 16102 323 | 8408 324 | 16886 325 | 326 | 8592 327 | 9925 328 | 9337 329 | 4966 330 | 5435 331 | 6582 332 | 9328 333 | 6201 334 | 335 | 3962 336 | 6432 337 | 6527 338 | 5883 339 | 5532 340 | 4407 341 | 2796 342 | 5365 343 | 1840 344 | 7334 345 | 2920 346 | 4086 347 | 348 | 10664 349 | 5976 350 | 8604 351 | 2827 352 | 10060 353 | 10229 354 | 11492 355 | 356 | 5451 357 | 3545 358 | 5641 359 | 5779 360 | 7277 361 | 2628 362 | 1250 363 | 1811 364 | 5818 365 | 6112 366 | 3898 367 | 3523 368 | 369 | 1371 370 | 1946 371 | 5127 372 | 4787 373 | 3784 374 | 1134 375 | 2292 376 | 5031 377 | 5291 378 | 5038 379 | 1637 380 | 1178 381 | 1697 382 | 2475 383 | 4239 384 | 385 | 5933 386 | 9062 387 | 2975 388 | 5058 389 | 1127 390 | 1918 391 | 5812 392 | 3932 393 | 3434 394 | 395 | 4523 396 | 10216 397 | 10764 398 | 9355 399 | 1272 400 | 3639 401 | 2747 402 | 2548 403 | 404 | 5359 405 | 5827 406 | 3677 407 | 7954 408 | 6695 409 | 7177 410 | 7101 411 | 3889 412 | 4736 413 | 5698 414 | 3803 415 | 416 | 2079 417 | 1641 418 | 1348 419 | 3200 420 | 4035 421 | 1547 422 | 1347 423 | 5528 424 | 3003 425 | 1209 426 | 3457 427 | 3948 428 | 4284 429 | 3396 430 | 2369 431 | 432 | 1015 433 | 2463 434 | 5926 435 | 4967 436 | 1398 437 | 4356 438 | 2397 439 | 4613 440 | 2909 441 | 3431 442 | 3482 443 | 444 | 2449 445 | 3480 446 | 2076 447 | 3984 448 | 3030 449 | 2249 450 | 2718 451 | 4658 452 | 4959 453 | 3047 454 | 5571 455 | 3218 456 | 457 | 6923 458 | 7052 459 | 3144 460 | 6109 461 | 7223 462 | 5610 463 | 2834 464 | 5771 465 | 1290 466 | 2216 467 | 7407 468 | 1853 469 | 470 | 16073 471 | 5598 472 | 2369 473 | 3785 474 | 15890 475 | 476 | 5797 477 | 1682 478 | 6510 479 | 8054 480 | 481 | 6160 482 | 6406 483 | 3893 484 | 3531 485 | 3712 486 | 2649 487 | 3254 488 | 2373 489 | 6053 490 | 6616 491 | 4503 492 | 3573 493 | 5476 494 | 495 | 11525 496 | 7276 497 | 12639 498 | 2181 499 | 3772 500 | 501 | 15209 502 | 18108 503 | 14012 504 | 13754 505 | 506 | 5564 507 | 9463 508 | 10638 509 | 9542 510 | 2412 511 | 4357 512 | 10507 513 | 514 | 4852 515 | 3004 516 | 5131 517 | 4503 518 | 6019 519 | 5520 520 | 1506 521 | 1493 522 | 2572 523 | 2354 524 | 4924 525 | 4807 526 | 4789 527 | 4351 528 | 3845 529 | 530 | 40493 531 | 532 | 39589 533 | 534 | 4519 535 | 6704 536 | 4962 537 | 9477 538 | 1208 539 | 10288 540 | 3798 541 | 5526 542 | 543 | 2682 544 | 13451 545 | 10034 546 | 2545 547 | 4452 548 | 7412 549 | 550 | 32413 551 | 5857 552 | 553 | 6163 554 | 11407 555 | 8780 556 | 5351 557 | 2741 558 | 9916 559 | 10314 560 | 561 | 6667 562 | 35063 563 | 564 | 12333 565 | 22183 566 | 23309 567 | 568 | 2949 569 | 5861 570 | 4380 571 | 3457 572 | 1019 573 | 6456 574 | 4615 575 | 4039 576 | 6861 577 | 2787 578 | 6200 579 | 4583 580 | 3176 581 | 582 | 4526 583 | 7517 584 | 8417 585 | 7109 586 | 8327 587 | 6758 588 | 3958 589 | 590 | 12106 591 | 13851 592 | 16017 593 | 7920 594 | 13186 595 | 596 | 1444 597 | 5154 598 | 10869 599 | 6868 600 | 5040 601 | 11545 602 | 9097 603 | 604 | 1244 605 | 4683 606 | 8043 607 | 9237 608 | 4766 609 | 12954 610 | 611 | 7405 612 | 2364 613 | 7117 614 | 6204 615 | 1116 616 | 2605 617 | 4528 618 | 1003 619 | 4004 620 | 7295 621 | 6348 622 | 623 | 7835 624 | 6402 625 | 8314 626 | 1188 627 | 6044 628 | 7310 629 | 4614 630 | 7415 631 | 1987 632 | 633 | 2847 634 | 5827 635 | 5559 636 | 4660 637 | 3528 638 | 1034 639 | 5672 640 | 5868 641 | 4208 642 | 2761 643 | 4184 644 | 4177 645 | 646 | 51072 647 | 648 | 4750 649 | 8432 650 | 4449 651 | 4830 652 | 2616 653 | 1373 654 | 9126 655 | 9834 656 | 657 | 36394 658 | 26194 659 | 660 | 1227 661 | 13357 662 | 16812 663 | 9012 664 | 665 | 18457 666 | 20244 667 | 10274 668 | 669 | 3070 670 | 4738 671 | 5567 672 | 7328 673 | 7028 674 | 4186 675 | 1472 676 | 7041 677 | 4009 678 | 4126 679 | 6411 680 | 1744 681 | 682 | 2004 683 | 10907 684 | 7451 685 | 4526 686 | 8140 687 | 6890 688 | 689 | 4716 690 | 3610 691 | 2470 692 | 1736 693 | 2892 694 | 5414 695 | 2949 696 | 5628 697 | 1411 698 | 2775 699 | 2604 700 | 4958 701 | 5322 702 | 1891 703 | 4458 704 | 705 | 3784 706 | 11731 707 | 8898 708 | 12113 709 | 13296 710 | 10644 711 | 712 | 3783 713 | 1713 714 | 1379 715 | 7704 716 | 5959 717 | 3955 718 | 9411 719 | 7517 720 | 1514 721 | 722 | 2962 723 | 2602 724 | 1501 725 | 1045 726 | 1479 727 | 5280 728 | 4134 729 | 5198 730 | 4167 731 | 5033 732 | 5241 733 | 1822 734 | 1567 735 | 3668 736 | 2178 737 | 738 | 5060 739 | 6325 740 | 2962 741 | 1971 742 | 5843 743 | 4140 744 | 6175 745 | 3161 746 | 1466 747 | 6243 748 | 2931 749 | 3443 750 | 4895 751 | 4249 752 | 753 | 66339 754 | 755 | 6137 756 | 4851 757 | 3798 758 | 9698 759 | 9988 760 | 5932 761 | 10712 762 | 7545 763 | 764 | 5195 765 | 3263 766 | 1797 767 | 2538 768 | 1837 769 | 2693 770 | 5952 771 | 5333 772 | 3238 773 | 3717 774 | 3950 775 | 4183 776 | 3355 777 | 1280 778 | 5517 779 | 780 | 5045 781 | 4841 782 | 2418 783 | 4492 784 | 3604 785 | 4101 786 | 2854 787 | 5791 788 | 2241 789 | 4027 790 | 1901 791 | 3826 792 | 5477 793 | 5254 794 | 3898 795 | 796 | 53971 797 | 798 | 1540 799 | 6936 800 | 1328 801 | 5334 802 | 2123 803 | 4618 804 | 6537 805 | 2609 806 | 5653 807 | 7098 808 | 3316 809 | 810 | 8590 811 | 5386 812 | 8241 813 | 6987 814 | 3924 815 | 6265 816 | 1818 817 | 9420 818 | 819 | 5772 820 | 4715 821 | 1295 822 | 2652 823 | 4765 824 | 7480 825 | 7577 826 | 5010 827 | 7227 828 | 6538 829 | 4707 830 | 831 | 1952 832 | 8437 833 | 25310 834 | 835 | 15936 836 | 11883 837 | 8696 838 | 10347 839 | 840 | 8198 841 | 1014 842 | 1004 843 | 10270 844 | 6566 845 | 9284 846 | 10468 847 | 4297 848 | 849 | 15267 850 | 17919 851 | 16656 852 | 2900 853 | 854 | 3359 855 | 5649 856 | 1962 857 | 5618 858 | 1020 859 | 5969 860 | 7258 861 | 7309 862 | 2926 863 | 3786 864 | 2299 865 | 6614 866 | 867 | 31552 868 | 33941 869 | 870 | 5132 871 | 6793 872 | 3625 873 | 5910 874 | 7575 875 | 2603 876 | 8697 877 | 5588 878 | 3027 879 | 3054 880 | 881 | 2876 882 | 4464 883 | 2819 884 | 7178 885 | 5485 886 | 6972 887 | 6319 888 | 1102 889 | 5341 890 | 3281 891 | 6218 892 | 6124 893 | 894 | 9471 895 | 5155 896 | 1390 897 | 9056 898 | 1916 899 | 3727 900 | 3844 901 | 6099 902 | 903 | 6751 904 | 4444 905 | 10612 906 | 3560 907 | 6783 908 | 7374 909 | 3158 910 | 911 | 11589 912 | 2594 913 | 7521 914 | 8873 915 | 3482 916 | 9678 917 | 918 | 2023 919 | 2438 920 | 1459 921 | 5165 922 | 5927 923 | 4658 924 | 3113 925 | 1489 926 | 2826 927 | 5113 928 | 3540 929 | 4479 930 | 5627 931 | 1006 932 | 4791 933 | 934 | 6965 935 | 9145 936 | 5658 937 | 13566 938 | 4225 939 | 3005 940 | 941 | 8233 942 | 9556 943 | 6895 944 | 7522 945 | 1053 946 | 4909 947 | 4475 948 | 8203 949 | 950 | 6371 951 | 6845 952 | 4501 953 | 8168 954 | 8605 955 | 7805 956 | 4562 957 | 1825 958 | 7172 959 | 8205 960 | 961 | 5165 962 | 1183 963 | 2962 964 | 6412 965 | 3125 966 | 1423 967 | 5257 968 | 1541 969 | 2680 970 | 1459 971 | 1834 972 | 1652 973 | 4339 974 | 975 | 2552 976 | 7801 977 | 15625 978 | 9736 979 | 980 | 4617 981 | 8744 982 | 4576 983 | 13632 984 | 985 | 8073 986 | 7400 987 | 8054 988 | 6318 989 | 5631 990 | 6028 991 | 2021 992 | 2856 993 | 1557 994 | 6371 995 | 7764 996 | 997 | 4259 998 | 2112 999 | 4290 1000 | 2650 1001 | 6900 1002 | 6061 1003 | 6765 1004 | 2745 1005 | 3157 1006 | 5283 1007 | 5755 1008 | 3457 1009 | 3872 1010 | 1011 | 62600 1012 | 1013 | 32544 1014 | 11804 1015 | 1016 | 1788 1017 | 7140 1018 | 5592 1019 | 12124 1020 | 6868 1021 | 8209 1022 | 2575 1023 | 1024 | 2533 1025 | 2662 1026 | 5275 1027 | 1751 1028 | 5218 1029 | 2712 1030 | 4346 1031 | 2166 1032 | 3709 1033 | 5848 1034 | 5855 1035 | 4637 1036 | 1644 1037 | 3088 1038 | 1907 1039 | 1040 | 8172 1041 | 1759 1042 | 7682 1043 | 6871 1044 | 3318 1045 | 9522 1046 | 7511 1047 | 6831 1048 | 4015 1049 | 1050 | 52441 1051 | 1052 | 6537 1053 | 2908 1054 | 1451 1055 | 6115 1056 | 1954 1057 | 1099 1058 | 5712 1059 | 8426 1060 | 1061 | 1236 1062 | 7381 1063 | 5167 1064 | 6563 1065 | 7318 1066 | 2436 1067 | 1325 1068 | 2948 1069 | 2710 1070 | 6319 1071 | 2608 1072 | 3591 1073 | 1074 | 3734 1075 | 4626 1076 | 1460 1077 | 5719 1078 | 1715 1079 | 1842 1080 | 4747 1081 | 1875 1082 | 2922 1083 | 3464 1084 | 5489 1085 | 5568 1086 | 5174 1087 | 3365 1088 | 1089 | 3662 1090 | 2200 1091 | 4326 1092 | 4968 1093 | 4482 1094 | 5444 1095 | 6657 1096 | 5091 1097 | 2117 1098 | 5027 1099 | 5595 1100 | 3765 1101 | 1102 | 6974 1103 | 2450 1104 | 7465 1105 | 7285 1106 | 6168 1107 | 7462 1108 | 3116 1109 | 4750 1110 | 4413 1111 | 6386 1112 | 1113 | 6612 1114 | 4050 1115 | 11379 1116 | 18968 1117 | 1118 | 63747 1119 | 1120 | 12307 1121 | 7764 1122 | 11390 1123 | 1859 1124 | 9217 1125 | 5600 1126 | 1127 | 7166 1128 | 3973 1129 | 6159 1130 | 6484 1131 | 6661 1132 | 4646 1133 | 5470 1134 | 1719 1135 | 4798 1136 | 2951 1137 | 3190 1138 | 1139 | 2213 1140 | 5373 1141 | 2129 1142 | 1122 1143 | 5100 1144 | 6373 1145 | 5480 1146 | 1418 1147 | 4490 1148 | 3008 1149 | 4265 1150 | 2939 1151 | 6175 1152 | 5050 1153 | 1154 | 3364 1155 | 2910 1156 | 2761 1157 | 4320 1158 | 3238 1159 | 1077 1160 | 2253 1161 | 4776 1162 | 5965 1163 | 3933 1164 | 1826 1165 | 3258 1166 | 2282 1167 | 2310 1168 | 6098 1169 | 1170 | 8459 1171 | 7811 1172 | 11796 1173 | 5612 1174 | 5306 1175 | 1946 1176 | 11206 1177 | 1178 | 1864 1179 | 8864 1180 | 3044 1181 | 3377 1182 | 5829 1183 | 1790 1184 | 9450 1185 | 2676 1186 | 7701 1187 | 1188 | 3103 1189 | 4985 1190 | 6899 1191 | 1125 1192 | 5296 1193 | 4143 1194 | 1526 1195 | 1579 1196 | 6668 1197 | 1724 1198 | 1255 1199 | 5107 1200 | 3720 1201 | 1202 | 13512 1203 | 4587 1204 | 7594 1205 | 14548 1206 | 6246 1207 | 1208 | 54371 1209 | 1210 | 24950 1211 | 7799 1212 | 1213 | 2613 1214 | 1020 1215 | 6330 1216 | 5597 1217 | 5295 1218 | 5496 1219 | 4732 1220 | 1885 1221 | 1815 1222 | 5758 1223 | 4727 1224 | 4220 1225 | 6374 1226 | 6162 1227 | 1228 | 9551 1229 | 13121 1230 | 1684 1231 | 2595 1232 | 8505 1233 | 1234 | 16528 1235 | 1799 1236 | 11308 1237 | 1238 | 1418 1239 | 14711 1240 | 2147 1241 | 4801 1242 | 10105 1243 | 1244 | 1782 1245 | 1685 1246 | 1395 1247 | 2044 1248 | 5382 1249 | 5480 1250 | 3573 1251 | 2435 1252 | 4070 1253 | 1733 1254 | 5930 1255 | 6195 1256 | 1692 1257 | 2888 1258 | 1259 | 1688 1260 | 1365 1261 | 3200 1262 | 7047 1263 | 7839 1264 | 10228 1265 | 5983 1266 | 9591 1267 | 1268 | 5619 1269 | 3939 1270 | 2610 1271 | 4845 1272 | 3442 1273 | 2821 1274 | 2711 1275 | 2356 1276 | 2747 1277 | 1590 1278 | 5593 1279 | 4981 1280 | 5711 1281 | 2920 1282 | 3485 1283 | 1284 | 1987 1285 | 8420 1286 | 8357 1287 | 9771 1288 | 1106 1289 | 2037 1290 | 8409 1291 | 5252 1292 | 1293 | 4473 1294 | 2256 1295 | 4295 1296 | 3253 1297 | 5912 1298 | 5230 1299 | 5528 1300 | 1421 1301 | 2026 1302 | 1223 1303 | 4933 1304 | 5041 1305 | 5405 1306 | 5195 1307 | 1308 | 5986 1309 | 3142 1310 | 4773 1311 | 2566 1312 | 3557 1313 | 2614 1314 | 5763 1315 | 1462 1316 | 1942 1317 | 3376 1318 | 3863 1319 | 1121 1320 | 1001 1321 | 2506 1322 | 1328 1323 | 1324 | 8899 1325 | 32401 1326 | 1327 | 3826 1328 | 4732 1329 | 9256 1330 | 4515 1331 | 1866 1332 | 6861 1333 | 4562 1334 | 7148 1335 | 1336 | 9787 1337 | 4012 1338 | 3233 1339 | 2360 1340 | 1353 1341 | 9267 1342 | 4474 1343 | 1344 | 3933 1345 | 6957 1346 | 3359 1347 | 2793 1348 | 2137 1349 | 1946 1350 | 1787 1351 | 3257 1352 | 1387 1353 | 6363 1354 | 3830 1355 | 7331 1356 | 1357 | 6606 1358 | 3538 1359 | 1473 1360 | 4664 1361 | 3248 1362 | 2199 1363 | 3458 1364 | 2771 1365 | 3712 1366 | 5024 1367 | 7635 1368 | 1369 | 4009 1370 | 2360 1371 | 1715 1372 | 3068 1373 | 5032 1374 | 7249 1375 | 8362 1376 | 1018 1377 | 1378 | 2848 1379 | 6090 1380 | 1763 1381 | 4889 1382 | 2423 1383 | 5758 1384 | 2886 1385 | 2869 1386 | 3108 1387 | 6094 1388 | 5110 1389 | 2166 1390 | 2701 1391 | 5737 1392 | 2866 1393 | 1394 | 3125 1395 | 7121 1396 | 4234 1397 | 5931 1398 | 3149 1399 | 8701 1400 | 6860 1401 | 6051 1402 | 1847 1403 | 1404 | 4292 1405 | 2447 1406 | 5733 1407 | 1676 1408 | 1638 1409 | 4310 1410 | 5501 1411 | 4375 1412 | 4814 1413 | 5728 1414 | 5735 1415 | 2035 1416 | 4964 1417 | 1828 1418 | 1419 | 11862 1420 | 5538 1421 | 10841 1422 | 6768 1423 | 5855 1424 | 2538 1425 | 2995 1426 | 1427 | 12807 1428 | 11304 1429 | 8668 1430 | 11295 1431 | 2680 1432 | 1433 | 7589 1434 | 3729 1435 | 1859 1436 | 5542 1437 | 13730 1438 | 1439 | 2782 1440 | 2929 1441 | 7461 1442 | 5840 1443 | 3916 1444 | 3574 1445 | 5958 1446 | 7601 1447 | 6122 1448 | 1449 | 3173 1450 | 3044 1451 | 4904 1452 | 1544 1453 | 6463 1454 | 5239 1455 | 1532 1456 | 6951 1457 | 5903 1458 | 3948 1459 | 4742 1460 | 5825 1461 | 6288 1462 | 1463 | 6793 1464 | 6722 1465 | 2365 1466 | 8678 1467 | 8568 1468 | 6098 1469 | 4378 1470 | 10526 1471 | 1472 | 7743 1473 | 2658 1474 | 8311 1475 | 9915 1476 | 9120 1477 | 6152 1478 | 7100 1479 | 2698 1480 | 1481 | 3476 1482 | 5111 1483 | 1201 1484 | 4971 1485 | 3830 1486 | 4158 1487 | 4172 1488 | 2841 1489 | 6041 1490 | 1082 1491 | 3207 1492 | 3050 1493 | 4469 1494 | 1108 1495 | 4274 1496 | 1497 | 36944 1498 | 1499 | 34023 1500 | 1501 | 1962 1502 | 8656 1503 | 6074 1504 | 5546 1505 | 1960 1506 | 5754 1507 | 2000 1508 | 5672 1509 | 2729 1510 | 6064 1511 | 1512 | 8110 1513 | 2537 1514 | 4370 1515 | 8336 1516 | 8927 1517 | 3813 1518 | 10038 1519 | 1520 | 5609 1521 | 3904 1522 | 4523 1523 | 6963 1524 | 5864 1525 | 6166 1526 | 3660 1527 | 4891 1528 | 6953 1529 | 2136 1530 | 3276 1531 | 1712 1532 | 1533 | 5198 1534 | 5254 1535 | 2456 1536 | 2133 1537 | 5835 1538 | 6961 1539 | 4780 1540 | 4041 1541 | 3036 1542 | 7408 1543 | 1156 1544 | 4275 1545 | 1546 | 1475 1547 | 2273 1548 | 1772 1549 | 5900 1550 | 5851 1551 | 1855 1552 | 3375 1553 | 5359 1554 | 3649 1555 | 3862 1556 | 6099 1557 | 1670 1558 | 5600 1559 | 4647 1560 | 4341 1561 | 1562 | 46294 1563 | 1564 | 2287 1565 | 2354 1566 | 13619 1567 | 12330 1568 | 1569 | 6849 1570 | 6447 1571 | 2673 1572 | 4925 1573 | 3479 1574 | 2903 1575 | 6599 1576 | 2637 1577 | 1192 1578 | 2638 1579 | 3227 1580 | 2511 1581 | 1582 | 4905 1583 | 2874 1584 | 2714 1585 | 5883 1586 | 1294 1587 | 4703 1588 | 1253 1589 | 1953 1590 | 2612 1591 | 3925 1592 | 5052 1593 | 5528 1594 | 5792 1595 | 1995 1596 | 1597 | 4126 1598 | 3937 1599 | 4979 1600 | 2042 1601 | 6663 1602 | 4358 1603 | 3326 1604 | 2671 1605 | 4920 1606 | 6420 1607 | 1173 1608 | 6682 1609 | 1610 | 6146 1611 | 10792 1612 | 1613 | 5228 1614 | 9530 1615 | 2288 1616 | 6322 1617 | 6413 1618 | 8780 1619 | 2075 1620 | 8491 1621 | 8592 1622 | 1623 | 6969 1624 | 11615 1625 | 4852 1626 | 13647 1627 | 2478 1628 | 2086 1629 | 1630 | 1406 1631 | 6041 1632 | 7324 1633 | 5281 1634 | 1048 1635 | 10324 1636 | 2467 1637 | 9719 1638 | 1639 | 1130 1640 | 6482 1641 | 4859 1642 | 6020 1643 | 1310 1644 | 1177 1645 | 5693 1646 | 6083 1647 | 3293 1648 | 2918 1649 | 4021 1650 | 6944 1651 | 1652 | 40367 1653 | 1654 | 15216 1655 | 23154 1656 | 19153 1657 | 1658 | 2732 1659 | 5987 1660 | 3554 1661 | 5038 1662 | 4885 1663 | 3758 1664 | 3484 1665 | 5554 1666 | 6351 1667 | 5914 1668 | 6207 1669 | 6271 1670 | 1024 1671 | 5960 1672 | 1673 | 4697 1674 | 5988 1675 | 6690 1676 | 2995 1677 | 6827 1678 | 4316 1679 | 3337 1680 | 7094 1681 | 2862 1682 | 6290 1683 | 1684 | 63498 1685 | 1686 | 5589 1687 | 3523 1688 | 1863 1689 | 1700 1690 | 4449 1691 | 7025 1692 | 7054 1693 | 3637 1694 | 2383 1695 | 4719 1696 | 5384 1697 | 1387 1698 | 1699 | 4577 1700 | 3062 1701 | 6850 1702 | 2126 1703 | 6193 1704 | 2972 1705 | 4998 1706 | 3929 1707 | 5273 1708 | 3607 1709 | 7216 1710 | 1711 | 1426 1712 | 6363 1713 | 12553 1714 | 7710 1715 | 7427 1716 | 7299 1717 | 1718 | 12100 1719 | 8643 1720 | 6472 1721 | 12582 1722 | 10330 1723 | 12994 1724 | 1725 | 1106 1726 | 1185 1727 | 1573 1728 | 6559 1729 | 1967 1730 | 1086 1731 | 4571 1732 | 6671 1733 | 2747 1734 | 2082 1735 | 6384 1736 | 1095 1737 | 6899 1738 | 1739 | 22318 1740 | 10321 1741 | 20543 1742 | 1743 | 5025 1744 | 10184 1745 | 4425 1746 | 8082 1747 | 5629 1748 | 5123 1749 | 7509 1750 | 3100 1751 | 1752 | 11271 1753 | 1754 | 5133 1755 | 10929 1756 | 10907 1757 | 3629 1758 | 1759 | 39333 1760 | 1761 | 15442 1762 | 4322 1763 | 5391 1764 | 10882 1765 | 1766 | 1252 1767 | 5624 1768 | 2407 1769 | 1285 1770 | 2655 1771 | 1530 1772 | 5705 1773 | 1976 1774 | 5795 1775 | 5008 1776 | 3813 1777 | 6850 1778 | 2362 1779 | 1780 | 9416 1781 | 3180 1782 | 4462 1783 | 9918 1784 | 8511 1785 | 4608 1786 | 7612 1787 | 1788 | 3916 1789 | 1591 1790 | 1388 1791 | 1359 1792 | 4867 1793 | 3931 1794 | 1067 1795 | 5182 1796 | 2090 1797 | 2947 1798 | 1294 1799 | 2085 1800 | 3805 1801 | 1590 1802 | 1803 | 7226 1804 | 19778 1805 | 11590 1806 | 12208 1807 | 1808 | 3548 1809 | 1990 1810 | 2859 1811 | 4534 1812 | 2179 1813 | 1744 1814 | 1306 1815 | 5906 1816 | 3215 1817 | 3481 1818 | 2609 1819 | 2419 1820 | 4632 1821 | 1157 1822 | 2905 1823 | 1824 | 18058 1825 | 4750 1826 | 1827 | 49356 1828 | 1829 | 16871 1830 | 8564 1831 | 9745 1832 | 1833 | 1053 1834 | 7954 1835 | 7528 1836 | 6434 1837 | 6002 1838 | 3767 1839 | 4369 1840 | 4096 1841 | 6194 1842 | 2337 1843 | 1844 | 6370 1845 | 3509 1846 | 2154 1847 | 6608 1848 | 3095 1849 | 2018 1850 | 4408 1851 | 2043 1852 | 5681 1853 | 4497 1854 | 3804 1855 | 6079 1856 | 3573 1857 | 1858 | 4693 1859 | 7043 1860 | 2251 1861 | 3734 1862 | 5938 1863 | 4208 1864 | 1597 1865 | 4259 1866 | 2465 1867 | 4080 1868 | 3073 1869 | 1870 | 7024 1871 | 1532 1872 | 7929 1873 | 5973 1874 | 6399 1875 | 6470 1876 | 1448 1877 | 1294 1878 | 4885 1879 | 6496 1880 | 7414 1881 | 1882 | 6637 1883 | 6833 1884 | 7369 1885 | 2115 1886 | 7831 1887 | 1481 1888 | 2643 1889 | 4148 1890 | 6127 1891 | 2478 1892 | 3002 1893 | 1894 | 1639 1895 | 5157 1896 | 2462 1897 | 5910 1898 | 2454 1899 | 4438 1900 | 2088 1901 | 3383 1902 | 5588 1903 | 2774 1904 | 3770 1905 | 2140 1906 | 2121 1907 | 3549 1908 | 1125 1909 | 1910 | 14689 1911 | 1193 1912 | 7130 1913 | 14422 1914 | 1915 | 5902 1916 | 8740 1917 | 11007 1918 | 2637 1919 | 4399 1920 | 13932 1921 | 1922 | 8542 1923 | 1924 | 8006 1925 | 3383 1926 | 6661 1927 | 1928 | 3629 1929 | 5891 1930 | 4089 1931 | 4036 1932 | 1894 1933 | 3724 1934 | 4280 1935 | 4668 1936 | 7766 1937 | 7213 1938 | 4984 1939 | 1940 | 2121 1941 | 4136 1942 | 4122 1943 | 4981 1944 | 3366 1945 | 3487 1946 | 5660 1947 | 6185 1948 | 5341 1949 | 3040 1950 | 1184 1951 | 3292 1952 | 3104 1953 | 2783 1954 | 1955 | 4434 1956 | 2764 1957 | 5501 1958 | 2961 1959 | 5751 1960 | 6443 1961 | 7688 1962 | 3503 1963 | 4029 1964 | 3115 1965 | 1031 1966 | 1967 | 6883 1968 | 3437 1969 | 8649 1970 | 3473 1971 | 1330 1972 | 1610 1973 | 2567 1974 | 2166 1975 | 1976 | 24926 1977 | 18747 1978 | 1979 | 5563 1980 | 1884 1981 | 6674 1982 | 5340 1983 | 2876 1984 | 3261 1985 | 5075 1986 | 3746 1987 | 4940 1988 | 3418 1989 | 6437 1990 | 5463 1991 | 1992 | 3014 1993 | 6235 1994 | 7541 1995 | 2502 1996 | 7472 1997 | 8412 1998 | 9054 1999 | 3331 2000 | 2001 | 8768 2002 | 15514 2003 | 12115 2004 | 8092 2005 | 2006 | 3537 2007 | 3246 2008 | 6697 2009 | 1753 2010 | 6707 2011 | 7686 2012 | 4786 2013 | 6161 2014 | 5616 2015 | 2016 | 2253 2017 | 1839 2018 | 3053 2019 | 4429 2020 | 2569 2021 | 4310 2022 | 4188 2023 | 5145 2024 | 4144 2025 | 4740 2026 | 3299 2027 | 4502 2028 | 1495 2029 | 1925 2030 | 2112 2031 | 2032 | 46591 2033 | 2034 | 46938 2035 | 2036 | 3368 2037 | 6572 2038 | 1033 2039 | 3438 2040 | 1798 2041 | 6177 2042 | 4166 2043 | 1909 2044 | 4290 2045 | 4280 2046 | 2047 | 4748 2048 | 12999 2049 | 13505 2050 | 10698 2051 | 2052 | 4707 2053 | 1446 2054 | 2259 2055 | 2201 2056 | 3459 2057 | 1993 2058 | 1617 2059 | 6531 2060 | 3460 2061 | 2272 2062 | 1754 2063 | 6588 2064 | 2898 2065 | 2066 | 8242 2067 | 6533 2068 | 8501 2069 | 9404 2070 | 2286 2071 | 1011 2072 | 1940 2073 | 4199 2074 | 4995 2075 | 2076 | 11510 2077 | 7982 2078 | 10005 2079 | 15579 2080 | 2081 | 3578 2082 | 12406 2083 | 7940 2084 | 11947 2085 | 1380 2086 | 12643 2087 | 2088 | 4574 2089 | 2465 2090 | 2184 2091 | 4976 2092 | 3793 2093 | 1405 2094 | 3976 2095 | 5843 2096 | 4954 2097 | 2814 2098 | 1596 2099 | 5310 2100 | 1758 2101 | 4990 2102 | 5705 2103 | 2104 | 7945 2105 | 5108 2106 | 9589 2107 | 9098 2108 | 3039 2109 | 8847 2110 | 3776 2111 | 8315 2112 | 5749 2113 | 2114 | 26315 2115 | 2116 | 5415 2117 | 1420 2118 | 4067 2119 | 5821 2120 | 7466 2121 | 7027 2122 | 7916 2123 | 6201 2124 | 4556 2125 | 2711 2126 | 2127 | 25290 2128 | 1682 2129 | 5357 2130 | 2131 | 29197 2132 | 35285 2133 | 2134 | 1112 2135 | 8038 2136 | 5132 2137 | 8695 2138 | 7350 2139 | 6903 2140 | 1253 2141 | 5873 2142 | 5274 2143 | 3940 2144 | 2145 | 6671 2146 | 3196 2147 | 9273 2148 | 2164 2149 | 5533 2150 | 7340 2151 | 5761 2152 | 8737 2153 | 5184 2154 | 2155 | 1281 2156 | 2505 2157 | 6171 2158 | 5617 2159 | 1200 2160 | 5848 2161 | 6105 2162 | 4476 2163 | 3495 2164 | 1808 2165 | 5065 2166 | 2231 2167 | 2168 | 7002 2169 | 1749 2170 | 13548 2171 | 2172 | 3303 2173 | 6583 2174 | 3171 2175 | 3051 2176 | 1036 2177 | 7790 2178 | 7159 2179 | 4326 2180 | 4447 2181 | 7013 2182 | 2183 | 5551 2184 | 3972 2185 | 3022 2186 | 5275 2187 | 2300 2188 | 5675 2189 | 2422 2190 | 2813 2191 | 3501 2192 | 3537 2193 | 2440 2194 | 3393 2195 | 5644 2196 | 3351 2197 | 2454 2198 | 2199 | 5692 2200 | 4309 2201 | 4409 2202 | 1967 2203 | 2068 2204 | 6467 2205 | 6315 2206 | 8051 2207 | 6237 2208 | 8069 2209 | 2213 2210 | 2211 | 42975 2212 | 2213 | 11367 2214 | 14938 2215 | 7848 2216 | 15849 2217 | 1867 2218 | 2219 | 2803 2220 | 3757 2221 | 4045 2222 | 1854 2223 | 5027 2224 | 3637 2225 | 5425 2226 | 3113 2227 | 4754 2228 | 1822 2229 | 1086 2230 | 1024 2231 | 1890 2232 | 3692 2233 | 2234 | 4391 2235 | 13299 2236 | 9709 2237 | 4887 2238 | 8221 2239 | 7477 2240 | 2241 | 1104 2242 | 3085 2243 | 1590 2244 | 4909 2245 | 1787 2246 | 4197 2247 | 3948 2248 | 4187 2249 | 1126 2250 | 3158 2251 | 1919 2252 | 4529 2253 | 1791 2254 | 1510 2255 | 5279 2256 | -------------------------------------------------------------------------------- /2022/day/1/script.R: -------------------------------------------------------------------------------- 1 | library(aochelpers) 2 | # input <- aoc_input_vector(1, 2022) # uncomment at end, once correct on test input 3 | # also consider aoc_input_data_frame() or aoc_input_matrix(), with view = TRUE 4 | 5 | browseURL("https://adventofcode.com/2022/day/1") 6 | # use datapasta addin to copy in test input from the website 7 | # triple-click in test input box in the puzzle to select, 8 | # then choose appropriate paste format from addin 9 | # comment out once ready to run on full input 10 | 11 | # input <- 12 | 13 | # Part 1 --------------------------------------------------------------------- 14 | 15 | 16 | 17 | # Part 2 --------------------------------------------------------------------- 18 | -------------------------------------------------------------------------------- /2022/day/2/input: -------------------------------------------------------------------------------- 1 | A X 2 | B Y 3 | B Y 4 | C X 5 | B X 6 | C Z 7 | C Z 8 | A Z 9 | A Z 10 | B Y 11 | C Z 12 | A Z 13 | C Z 14 | C X 15 | B Z 16 | C Z 17 | C Z 18 | C Z 19 | B Y 20 | C Z 21 | C Z 22 | C Z 23 | A Z 24 | A Y 25 | B Z 26 | B Z 27 | A Y 28 | B X 29 | C Z 30 | C Z 31 | A Z 32 | A Z 33 | C Z 34 | A Y 35 | A X 36 | A Z 37 | A Z 38 | B X 39 | B Z 40 | B X 41 | A Z 42 | B X 43 | B Z 44 | B Z 45 | C Z 46 | A Z 47 | A Z 48 | A Z 49 | C Z 50 | B Z 51 | A Z 52 | A Y 53 | A Y 54 | B Y 55 | B Y 56 | B Z 57 | A Z 58 | B Z 59 | A Z 60 | B Z 61 | C Z 62 | B Y 63 | A Z 64 | B Y 65 | A Z 66 | A Z 67 | A Z 68 | C Z 69 | A Y 70 | A Z 71 | C Z 72 | C Z 73 | A Z 74 | A X 75 | B Y 76 | C Z 77 | A Z 78 | A Z 79 | C X 80 | C Z 81 | B X 82 | C X 83 | B X 84 | A Z 85 | C Z 86 | C Z 87 | A Y 88 | A Z 89 | B X 90 | C X 91 | A Z 92 | A Z 93 | C Z 94 | C Z 95 | B Y 96 | C Z 97 | A Z 98 | A Z 99 | A Y 100 | B X 101 | B Y 102 | A Z 103 | C Z 104 | A Z 105 | A Z 106 | A Z 107 | C X 108 | C Y 109 | C Z 110 | B X 111 | B X 112 | B X 113 | A Z 114 | A X 115 | C Z 116 | A Z 117 | B Y 118 | B X 119 | A Y 120 | B X 121 | A Z 122 | C Z 123 | C Z 124 | A X 125 | A Z 126 | C Z 127 | B Z 128 | B X 129 | A Z 130 | C Z 131 | C Z 132 | C X 133 | C Z 134 | C Z 135 | C Z 136 | A Y 137 | B X 138 | A Y 139 | A Z 140 | B Z 141 | B Z 142 | C Z 143 | B Z 144 | B Z 145 | B X 146 | A Z 147 | C Z 148 | A Z 149 | A Y 150 | C Z 151 | A Z 152 | C X 153 | A Z 154 | A Z 155 | A Y 156 | A Y 157 | A Z 158 | C Z 159 | B Y 160 | A X 161 | A Z 162 | A Y 163 | C Z 164 | A Z 165 | B X 166 | A Z 167 | B Y 168 | A X 169 | C X 170 | B X 171 | A Y 172 | A Z 173 | B Z 174 | A Z 175 | A Z 176 | B X 177 | A X 178 | C Z 179 | B X 180 | B Y 181 | A Z 182 | B X 183 | C Z 184 | A Z 185 | C Z 186 | B X 187 | A Z 188 | A Y 189 | A Z 190 | A Z 191 | B X 192 | B X 193 | B Z 194 | A Z 195 | B Y 196 | C Z 197 | B Z 198 | C Z 199 | C Z 200 | B X 201 | B X 202 | A Z 203 | C Z 204 | C Z 205 | A X 206 | B X 207 | B X 208 | A Y 209 | C Z 210 | A Z 211 | A Y 212 | B X 213 | A Z 214 | A Z 215 | B X 216 | A Z 217 | C Z 218 | B X 219 | B Z 220 | B Y 221 | B X 222 | A Y 223 | C Z 224 | C Z 225 | C Z 226 | A X 227 | C Z 228 | A Z 229 | C Z 230 | C Y 231 | C Z 232 | C Z 233 | C Z 234 | B X 235 | A Z 236 | B X 237 | B Z 238 | A Z 239 | C Z 240 | B Y 241 | B Y 242 | B Z 243 | C Z 244 | C Z 245 | C Z 246 | B Z 247 | B Y 248 | A Z 249 | B X 250 | B Z 251 | C Z 252 | A Z 253 | B Y 254 | B Y 255 | A X 256 | C Z 257 | B Y 258 | A Y 259 | B Y 260 | B X 261 | B Y 262 | B Y 263 | A Y 264 | B Y 265 | C X 266 | A Y 267 | A Y 268 | C Z 269 | A Z 270 | A Y 271 | C Z 272 | A Z 273 | A Z 274 | C Z 275 | C Z 276 | C Z 277 | B X 278 | B Y 279 | A Y 280 | A Y 281 | B Z 282 | A Z 283 | B Y 284 | B X 285 | B Y 286 | A Y 287 | A Y 288 | A Z 289 | B Z 290 | C Z 291 | C Z 292 | C Z 293 | A Z 294 | C Z 295 | A Z 296 | A Z 297 | A Z 298 | A Z 299 | C Z 300 | B Y 301 | C Z 302 | B X 303 | C Z 304 | A X 305 | A Z 306 | B X 307 | C Y 308 | C X 309 | A X 310 | A X 311 | A Z 312 | A Z 313 | B X 314 | A Y 315 | B Z 316 | A Z 317 | B Z 318 | A Z 319 | C Z 320 | C X 321 | C Z 322 | C Z 323 | C X 324 | C Z 325 | C Z 326 | C X 327 | C Z 328 | B Z 329 | A Z 330 | B Y 331 | A Z 332 | C Z 333 | B X 334 | C Z 335 | B Z 336 | B Y 337 | A Z 338 | B Y 339 | A Y 340 | B X 341 | B Z 342 | B Z 343 | A Z 344 | B Z 345 | C Z 346 | C Z 347 | A Y 348 | A Z 349 | A X 350 | A Y 351 | C Z 352 | B X 353 | A Z 354 | C X 355 | A Z 356 | A Z 357 | A Z 358 | A Z 359 | C Y 360 | B Y 361 | B Y 362 | A X 363 | C Z 364 | A X 365 | A Z 366 | A Y 367 | C X 368 | A Y 369 | A Y 370 | A Z 371 | C X 372 | C Z 373 | B Z 374 | B X 375 | A Z 376 | C Z 377 | C Z 378 | B Z 379 | B X 380 | C Z 381 | C Z 382 | A Y 383 | B Z 384 | A X 385 | B Y 386 | A Z 387 | C X 388 | B X 389 | C Z 390 | B Y 391 | A X 392 | A Z 393 | B Y 394 | A Y 395 | A Z 396 | B Z 397 | A Y 398 | B Y 399 | A Z 400 | B Y 401 | B X 402 | B Z 403 | A Z 404 | B Y 405 | B Z 406 | A Y 407 | A Z 408 | C Z 409 | B X 410 | C Z 411 | B X 412 | C Z 413 | B Z 414 | C Z 415 | C Z 416 | B Z 417 | A Y 418 | A Y 419 | C Z 420 | B Z 421 | A Z 422 | A X 423 | C Z 424 | A Z 425 | C Z 426 | A Z 427 | A X 428 | A Z 429 | A Z 430 | A Y 431 | B Z 432 | B X 433 | C X 434 | B Y 435 | C Z 436 | B X 437 | B Z 438 | B X 439 | A Z 440 | A Z 441 | A Z 442 | B Z 443 | B Y 444 | A Z 445 | B Y 446 | C Z 447 | B Z 448 | A Z 449 | A Y 450 | C Z 451 | A Z 452 | B Y 453 | B X 454 | B Y 455 | B X 456 | C Z 457 | C Y 458 | A Z 459 | C Z 460 | C Z 461 | A Z 462 | C X 463 | B Z 464 | A Y 465 | B Y 466 | B Y 467 | B Y 468 | C Z 469 | B Z 470 | A Z 471 | B Y 472 | A Z 473 | A Z 474 | C Z 475 | B Y 476 | B Y 477 | A X 478 | A Z 479 | A Z 480 | C Z 481 | A Z 482 | C Z 483 | C Z 484 | A X 485 | B Z 486 | A Z 487 | A Z 488 | C Z 489 | C Z 490 | B Y 491 | B Y 492 | A Z 493 | A Y 494 | A Z 495 | B Y 496 | B Z 497 | A Y 498 | B Z 499 | A Z 500 | A Z 501 | A Y 502 | C Z 503 | A Y 504 | C Z 505 | B X 506 | A Z 507 | A Z 508 | C Z 509 | A Y 510 | C Z 511 | A Z 512 | A Y 513 | A Y 514 | C Z 515 | A Z 516 | A Y 517 | B X 518 | A Y 519 | B X 520 | A Z 521 | A Z 522 | A Y 523 | B Y 524 | B Y 525 | B X 526 | C Z 527 | C Z 528 | B Y 529 | B X 530 | C Z 531 | B Y 532 | C Z 533 | B Y 534 | B X 535 | C Z 536 | A Y 537 | B Z 538 | C X 539 | A Y 540 | C Z 541 | C Z 542 | C X 543 | A Y 544 | A Z 545 | B X 546 | C Z 547 | A Z 548 | B Y 549 | C Z 550 | B X 551 | B Z 552 | C Z 553 | C Z 554 | C Z 555 | A Z 556 | B X 557 | C Z 558 | A Z 559 | A Y 560 | B Y 561 | C Z 562 | A X 563 | C Z 564 | A Y 565 | C X 566 | A Y 567 | B Y 568 | C Z 569 | B X 570 | A Z 571 | C Z 572 | C Z 573 | B Z 574 | B Y 575 | A Z 576 | A Z 577 | A Y 578 | C Z 579 | A Y 580 | A X 581 | A Y 582 | B Z 583 | C Z 584 | C Z 585 | A Z 586 | A Z 587 | C Z 588 | A Y 589 | C Z 590 | C Z 591 | B Z 592 | C Z 593 | C Z 594 | A Z 595 | C Z 596 | B Z 597 | C Z 598 | B X 599 | A Y 600 | A Y 601 | A Z 602 | C X 603 | C Z 604 | C Y 605 | C Z 606 | C Z 607 | C Z 608 | B Z 609 | A Z 610 | C Z 611 | C Z 612 | A Y 613 | B Y 614 | B X 615 | B X 616 | C Z 617 | A Z 618 | B Y 619 | C Z 620 | C Z 621 | B X 622 | C Z 623 | C Z 624 | A Y 625 | A Y 626 | A Z 627 | A Y 628 | B Y 629 | C Z 630 | A X 631 | A Y 632 | C Z 633 | A Z 634 | C Z 635 | C Z 636 | A X 637 | A Z 638 | C Z 639 | B Z 640 | A Z 641 | A Z 642 | B Y 643 | B X 644 | A Z 645 | A Z 646 | B Z 647 | C Z 648 | C Z 649 | A Y 650 | A Z 651 | B Z 652 | B Z 653 | C Z 654 | B Z 655 | A Y 656 | B X 657 | A Z 658 | B X 659 | C Z 660 | A Z 661 | A Y 662 | C Z 663 | C Z 664 | A Z 665 | A Z 666 | A Z 667 | A Z 668 | A Z 669 | B X 670 | C Z 671 | C Z 672 | C Z 673 | A Z 674 | A Z 675 | A Z 676 | A Z 677 | B X 678 | C Z 679 | B X 680 | C Z 681 | A Z 682 | C Z 683 | A X 684 | A Y 685 | A Z 686 | C Z 687 | B Y 688 | C Z 689 | C Z 690 | B Z 691 | C Z 692 | B X 693 | C Z 694 | B X 695 | A Z 696 | A Z 697 | B Y 698 | B X 699 | C Z 700 | C Z 701 | C Z 702 | C Y 703 | C X 704 | B Y 705 | B Y 706 | C Z 707 | A Z 708 | A Z 709 | C Y 710 | C Z 711 | B Y 712 | C X 713 | A Z 714 | B X 715 | A Z 716 | C Z 717 | C Z 718 | A Z 719 | C X 720 | A Z 721 | B Z 722 | B Y 723 | A X 724 | C Z 725 | A Z 726 | B X 727 | A Z 728 | B Y 729 | C Z 730 | B X 731 | C Z 732 | B Y 733 | C Z 734 | A X 735 | C Z 736 | A Z 737 | C Z 738 | A Y 739 | A Y 740 | C Z 741 | C Z 742 | B X 743 | B Z 744 | A Z 745 | C Z 746 | A Z 747 | C Z 748 | A Y 749 | B X 750 | C Z 751 | A Z 752 | B X 753 | C Z 754 | C Z 755 | B Y 756 | C Z 757 | C Z 758 | C Y 759 | B Y 760 | B X 761 | C Z 762 | B Y 763 | A Z 764 | A Z 765 | B X 766 | B Y 767 | B Y 768 | B Y 769 | B Y 770 | B Z 771 | C Z 772 | C Z 773 | A Z 774 | C Z 775 | C X 776 | C Z 777 | B Z 778 | C X 779 | C X 780 | A Z 781 | A Z 782 | B Y 783 | B Z 784 | B Y 785 | C Z 786 | A Y 787 | A Z 788 | B Y 789 | B Y 790 | B X 791 | A Z 792 | A Z 793 | A Z 794 | C Z 795 | C Z 796 | C Z 797 | B Z 798 | A X 799 | A Z 800 | A Y 801 | C Z 802 | A Z 803 | A Z 804 | B Z 805 | B Y 806 | B Y 807 | A X 808 | C Z 809 | C Z 810 | B X 811 | A Z 812 | B Y 813 | A Z 814 | B Z 815 | A Z 816 | C Z 817 | C X 818 | A Y 819 | A Z 820 | C Z 821 | C Z 822 | C Z 823 | A Z 824 | C Z 825 | C Z 826 | B Y 827 | A Z 828 | A Z 829 | A Z 830 | A Y 831 | C Z 832 | A Z 833 | C Z 834 | B Z 835 | A Z 836 | C Z 837 | C X 838 | B Z 839 | C X 840 | B X 841 | C Z 842 | B Z 843 | A Y 844 | C Z 845 | C Z 846 | B X 847 | B Y 848 | B Y 849 | A Z 850 | B X 851 | A Y 852 | A Y 853 | A Z 854 | B Z 855 | C Z 856 | C Z 857 | B Z 858 | A Z 859 | C Z 860 | B Y 861 | C X 862 | B Z 863 | C Z 864 | B Z 865 | C Y 866 | C Z 867 | A Y 868 | A Z 869 | C Z 870 | A Z 871 | A Z 872 | C Z 873 | C Z 874 | C Z 875 | B Z 876 | A Z 877 | C Z 878 | C X 879 | A Z 880 | A Z 881 | B X 882 | B Y 883 | C Z 884 | A Y 885 | A Z 886 | C Z 887 | B Z 888 | C Z 889 | A Y 890 | A Y 891 | C Z 892 | A Z 893 | A Z 894 | B X 895 | A Y 896 | B Y 897 | C Z 898 | C Z 899 | B Y 900 | A Z 901 | A Y 902 | C X 903 | C Z 904 | C Z 905 | A Z 906 | C Z 907 | A Y 908 | C Z 909 | A Z 910 | A Z 911 | C Z 912 | A Z 913 | A X 914 | C Z 915 | C Z 916 | A Z 917 | B Z 918 | B Z 919 | B X 920 | A Z 921 | B X 922 | A Y 923 | A Z 924 | C Z 925 | C Z 926 | A Y 927 | B Z 928 | C Z 929 | A Z 930 | A Z 931 | C X 932 | B Z 933 | B Y 934 | B Y 935 | A Y 936 | B X 937 | B X 938 | C Z 939 | B X 940 | A Z 941 | B X 942 | A Z 943 | C Z 944 | C Z 945 | A Z 946 | B Y 947 | C Z 948 | C X 949 | C Z 950 | C Z 951 | A Z 952 | B X 953 | C Z 954 | C Z 955 | A Y 956 | C Z 957 | C Z 958 | B X 959 | B X 960 | B X 961 | A Z 962 | B Y 963 | C Z 964 | A Z 965 | C Z 966 | C Z 967 | B Y 968 | C Z 969 | A Z 970 | C Z 971 | B Y 972 | B Z 973 | C Z 974 | C Z 975 | C X 976 | C Z 977 | B Z 978 | C Z 979 | B Y 980 | B X 981 | A Z 982 | A Y 983 | B X 984 | A Y 985 | B Y 986 | A Z 987 | C Z 988 | C Z 989 | C Z 990 | B X 991 | C Z 992 | B X 993 | A Z 994 | B X 995 | B Y 996 | A Z 997 | C Z 998 | C Z 999 | C Z 1000 | A Y 1001 | B Y 1002 | A Y 1003 | C Z 1004 | A Z 1005 | C Z 1006 | C Z 1007 | A Z 1008 | A Y 1009 | C Z 1010 | B X 1011 | A Y 1012 | A Z 1013 | C Z 1014 | B Y 1015 | C Z 1016 | A Z 1017 | C Z 1018 | B Y 1019 | C Z 1020 | C Z 1021 | B Y 1022 | C Z 1023 | C Z 1024 | B X 1025 | C Z 1026 | B Y 1027 | C Z 1028 | B Y 1029 | A Z 1030 | C Z 1031 | B Y 1032 | A Z 1033 | C Z 1034 | C Z 1035 | B Y 1036 | B X 1037 | B Z 1038 | A Z 1039 | A Y 1040 | A Z 1041 | A Y 1042 | C Z 1043 | C Z 1044 | B X 1045 | C Z 1046 | B Y 1047 | C Z 1048 | C X 1049 | C Z 1050 | A Y 1051 | A Z 1052 | C Z 1053 | C Z 1054 | C Z 1055 | A Z 1056 | B Y 1057 | C Z 1058 | C Z 1059 | A Z 1060 | B Y 1061 | C Z 1062 | A Y 1063 | B Z 1064 | B X 1065 | A Y 1066 | B Y 1067 | C Z 1068 | A Y 1069 | C Z 1070 | B Y 1071 | B Y 1072 | C Z 1073 | C Z 1074 | B Y 1075 | B X 1076 | C Z 1077 | B X 1078 | B Z 1079 | B Y 1080 | C Z 1081 | C Z 1082 | C Z 1083 | A Z 1084 | A X 1085 | A Z 1086 | B Z 1087 | A Z 1088 | C Z 1089 | A Z 1090 | C Z 1091 | C Z 1092 | A Z 1093 | A Z 1094 | B Z 1095 | C Z 1096 | C Z 1097 | C Z 1098 | A Z 1099 | B Y 1100 | A Z 1101 | A Y 1102 | C Z 1103 | B X 1104 | B X 1105 | A Y 1106 | C Z 1107 | C Z 1108 | B X 1109 | B Z 1110 | C X 1111 | B X 1112 | B Y 1113 | A Z 1114 | A Y 1115 | A Z 1116 | C Z 1117 | B X 1118 | C Z 1119 | B Z 1120 | C Z 1121 | A Y 1122 | C Z 1123 | A Y 1124 | C Z 1125 | B Y 1126 | B Z 1127 | C Z 1128 | C Z 1129 | C Z 1130 | C Z 1131 | C Z 1132 | A Z 1133 | B Y 1134 | C Z 1135 | C X 1136 | B Y 1137 | C X 1138 | B Y 1139 | B Z 1140 | B Y 1141 | A Z 1142 | A Z 1143 | B X 1144 | C Y 1145 | A Z 1146 | C Z 1147 | B X 1148 | B X 1149 | A Z 1150 | A Z 1151 | B Y 1152 | C Z 1153 | B Y 1154 | B Z 1155 | A Y 1156 | A Z 1157 | C Z 1158 | C Z 1159 | B X 1160 | A Z 1161 | A Z 1162 | A Z 1163 | C Z 1164 | C X 1165 | C Z 1166 | C Z 1167 | C Z 1168 | C Z 1169 | A Z 1170 | B Y 1171 | C Z 1172 | C Z 1173 | C Z 1174 | B Z 1175 | C Z 1176 | B X 1177 | C Z 1178 | A Z 1179 | A Z 1180 | C Z 1181 | C Y 1182 | B Y 1183 | A Z 1184 | A Y 1185 | B Z 1186 | A Y 1187 | B Y 1188 | C Z 1189 | A Y 1190 | C Z 1191 | A Z 1192 | C Z 1193 | B X 1194 | C Z 1195 | A Z 1196 | A Z 1197 | B Z 1198 | A Z 1199 | B Z 1200 | A Z 1201 | B Y 1202 | C Z 1203 | B Z 1204 | B Y 1205 | C Z 1206 | A Z 1207 | A Z 1208 | B X 1209 | B X 1210 | A Y 1211 | A Z 1212 | B Y 1213 | A Y 1214 | A Z 1215 | C Z 1216 | A X 1217 | C Z 1218 | A Z 1219 | A Z 1220 | C Z 1221 | A Z 1222 | B X 1223 | A Z 1224 | A Y 1225 | A Y 1226 | B Y 1227 | A Z 1228 | A Z 1229 | A Z 1230 | B Y 1231 | B Y 1232 | A Z 1233 | A Z 1234 | C Z 1235 | C Z 1236 | A Y 1237 | B X 1238 | B X 1239 | C Z 1240 | A Y 1241 | C Z 1242 | C Z 1243 | C Z 1244 | A Y 1245 | C Z 1246 | C X 1247 | C Z 1248 | B Y 1249 | A Z 1250 | B Y 1251 | A Z 1252 | C Z 1253 | A Y 1254 | C Z 1255 | A Y 1256 | B Z 1257 | B X 1258 | B Y 1259 | B X 1260 | B Y 1261 | B X 1262 | A Y 1263 | C Z 1264 | C Z 1265 | B Z 1266 | C Z 1267 | C X 1268 | B X 1269 | A X 1270 | A Z 1271 | A Z 1272 | B Y 1273 | C Z 1274 | C Z 1275 | B Y 1276 | C Z 1277 | C Z 1278 | B Y 1279 | A Z 1280 | B Z 1281 | C X 1282 | C Z 1283 | C Z 1284 | B Y 1285 | C X 1286 | C Z 1287 | B Z 1288 | A Z 1289 | C Z 1290 | B X 1291 | A Z 1292 | C Z 1293 | A Z 1294 | C Z 1295 | B X 1296 | B Z 1297 | C Z 1298 | C Z 1299 | C Z 1300 | A Z 1301 | B Y 1302 | A Y 1303 | A Z 1304 | C Z 1305 | C Z 1306 | C Z 1307 | B Y 1308 | A Z 1309 | C Z 1310 | C Z 1311 | A Z 1312 | B Z 1313 | B Y 1314 | C Z 1315 | A Y 1316 | A Z 1317 | A Z 1318 | C Z 1319 | C Z 1320 | C Z 1321 | C Z 1322 | A Z 1323 | C Z 1324 | C Z 1325 | A Y 1326 | A Y 1327 | A Z 1328 | C Z 1329 | A Z 1330 | A Z 1331 | B X 1332 | A Y 1333 | A Z 1334 | A Y 1335 | C Z 1336 | B Z 1337 | A Y 1338 | A Z 1339 | B X 1340 | C Z 1341 | A Z 1342 | A Z 1343 | A Y 1344 | B Y 1345 | C Z 1346 | C Z 1347 | A Z 1348 | B X 1349 | A Y 1350 | A Z 1351 | C Z 1352 | C Z 1353 | B Y 1354 | C Z 1355 | A Z 1356 | B Y 1357 | C Z 1358 | C Z 1359 | B Y 1360 | C X 1361 | A Z 1362 | C Z 1363 | C Z 1364 | C Z 1365 | C Z 1366 | A Z 1367 | B Y 1368 | A Y 1369 | B Y 1370 | B Z 1371 | C Z 1372 | A Z 1373 | B Z 1374 | C Z 1375 | A X 1376 | C Z 1377 | C X 1378 | A Z 1379 | A Z 1380 | A X 1381 | A Z 1382 | A Z 1383 | A Z 1384 | A Z 1385 | B X 1386 | A Z 1387 | A Z 1388 | A Z 1389 | C Z 1390 | C Z 1391 | C Z 1392 | C Z 1393 | A Z 1394 | A Y 1395 | B X 1396 | C Z 1397 | B Y 1398 | A Y 1399 | A Z 1400 | C Z 1401 | C Z 1402 | C Z 1403 | B Y 1404 | A Z 1405 | B Z 1406 | C Z 1407 | B X 1408 | B Z 1409 | B Z 1410 | B Y 1411 | C Z 1412 | C X 1413 | B Y 1414 | A Y 1415 | C X 1416 | C Z 1417 | C Z 1418 | B Y 1419 | A Z 1420 | C Z 1421 | A Z 1422 | A Z 1423 | C Z 1424 | C Z 1425 | C Z 1426 | C Z 1427 | B Z 1428 | C Z 1429 | B X 1430 | C Z 1431 | B X 1432 | B Z 1433 | A Z 1434 | B Y 1435 | C Z 1436 | A Z 1437 | C Z 1438 | A Z 1439 | A Y 1440 | A Z 1441 | C Z 1442 | B X 1443 | C Z 1444 | C Z 1445 | A Z 1446 | A Z 1447 | C Z 1448 | C Z 1449 | A Z 1450 | C Z 1451 | A Y 1452 | C Z 1453 | C Z 1454 | A Z 1455 | A X 1456 | A Z 1457 | C Z 1458 | A Z 1459 | C Z 1460 | C Z 1461 | A Z 1462 | B X 1463 | C Z 1464 | C Z 1465 | C X 1466 | A Z 1467 | A Z 1468 | A X 1469 | B X 1470 | C Z 1471 | C Z 1472 | A Z 1473 | B X 1474 | C X 1475 | A Z 1476 | C Z 1477 | B Y 1478 | C Z 1479 | A Z 1480 | C Z 1481 | A Y 1482 | A Z 1483 | C Z 1484 | C Z 1485 | B X 1486 | A Z 1487 | B Y 1488 | A Z 1489 | C Z 1490 | C X 1491 | B Z 1492 | C Z 1493 | A X 1494 | A Y 1495 | C Z 1496 | C Z 1497 | C X 1498 | B Z 1499 | A Z 1500 | A Z 1501 | B Z 1502 | A Y 1503 | C X 1504 | A Z 1505 | C Z 1506 | A Z 1507 | C Z 1508 | A Z 1509 | A Z 1510 | A Z 1511 | C Z 1512 | A Z 1513 | C Z 1514 | B X 1515 | A Y 1516 | A Z 1517 | C Z 1518 | B Y 1519 | C Z 1520 | A Y 1521 | C Z 1522 | C Z 1523 | C Z 1524 | C Z 1525 | A Z 1526 | A Z 1527 | B Z 1528 | C Z 1529 | A Y 1530 | C X 1531 | C Z 1532 | C Y 1533 | B Y 1534 | C X 1535 | A Y 1536 | C Z 1537 | C Z 1538 | B Z 1539 | B Y 1540 | B Z 1541 | A Z 1542 | B Y 1543 | C Z 1544 | C Z 1545 | B X 1546 | B Y 1547 | B Z 1548 | A Z 1549 | A Z 1550 | C Z 1551 | B X 1552 | A Z 1553 | B Y 1554 | C Z 1555 | C Z 1556 | B X 1557 | C Z 1558 | A X 1559 | C Z 1560 | B X 1561 | A Y 1562 | A Z 1563 | B Y 1564 | C Z 1565 | C Z 1566 | A Y 1567 | A Z 1568 | C Z 1569 | C Z 1570 | A Z 1571 | C Z 1572 | C Z 1573 | C Z 1574 | B X 1575 | C Z 1576 | B Y 1577 | B Y 1578 | C Z 1579 | B Z 1580 | C Z 1581 | C X 1582 | C Z 1583 | B X 1584 | A Z 1585 | B Z 1586 | B Z 1587 | B Z 1588 | C Z 1589 | A X 1590 | C Z 1591 | B X 1592 | A Z 1593 | A Z 1594 | A Z 1595 | A Y 1596 | C Z 1597 | C Z 1598 | C Z 1599 | C X 1600 | A Y 1601 | A Z 1602 | A Z 1603 | C Z 1604 | C Z 1605 | A Z 1606 | B X 1607 | C Z 1608 | B Y 1609 | A X 1610 | C X 1611 | B Y 1612 | B Y 1613 | A Y 1614 | C X 1615 | C Z 1616 | B X 1617 | A Z 1618 | A Z 1619 | B Z 1620 | A Y 1621 | C Z 1622 | C Z 1623 | A Z 1624 | C Z 1625 | C Z 1626 | A Y 1627 | C Z 1628 | C Z 1629 | B Y 1630 | C Z 1631 | C Z 1632 | A Z 1633 | A Z 1634 | B Z 1635 | A Z 1636 | C Z 1637 | C Z 1638 | C Z 1639 | C X 1640 | C Z 1641 | A Z 1642 | C Z 1643 | C Z 1644 | C Z 1645 | C X 1646 | C Z 1647 | C Z 1648 | A Z 1649 | B Y 1650 | C Z 1651 | B X 1652 | A Z 1653 | C Z 1654 | C Y 1655 | A Z 1656 | A Y 1657 | A Z 1658 | C X 1659 | C X 1660 | A Y 1661 | B X 1662 | A Y 1663 | B Y 1664 | B Z 1665 | B Y 1666 | B Y 1667 | B Y 1668 | B Y 1669 | B Y 1670 | B Y 1671 | B Y 1672 | B X 1673 | B Z 1674 | A Y 1675 | A Y 1676 | A Y 1677 | B Y 1678 | A Y 1679 | B X 1680 | C X 1681 | A Z 1682 | C Z 1683 | A Z 1684 | A X 1685 | C Z 1686 | C Z 1687 | B Z 1688 | C Z 1689 | B Z 1690 | B Z 1691 | A Z 1692 | A Y 1693 | A Z 1694 | B X 1695 | B Z 1696 | C Y 1697 | A Z 1698 | A Z 1699 | A Z 1700 | C Z 1701 | C Z 1702 | C Z 1703 | C Z 1704 | A Z 1705 | C Y 1706 | A Y 1707 | C X 1708 | C Z 1709 | B Y 1710 | C Z 1711 | A Z 1712 | A X 1713 | A Z 1714 | B Z 1715 | C Z 1716 | B X 1717 | B X 1718 | A Z 1719 | C Z 1720 | B X 1721 | C Z 1722 | C Z 1723 | A X 1724 | C Z 1725 | A Z 1726 | C Z 1727 | C Z 1728 | B Z 1729 | B Y 1730 | B X 1731 | B Z 1732 | A X 1733 | A Y 1734 | C Z 1735 | A X 1736 | A Y 1737 | B Y 1738 | A Y 1739 | C Z 1740 | C Z 1741 | B X 1742 | C Z 1743 | B Z 1744 | C Z 1745 | B Y 1746 | C Z 1747 | A Z 1748 | A Y 1749 | B Z 1750 | B Z 1751 | A Z 1752 | A Z 1753 | A Z 1754 | A Y 1755 | C Z 1756 | C X 1757 | A Z 1758 | A X 1759 | B Y 1760 | B X 1761 | A Z 1762 | C Z 1763 | A Z 1764 | A Z 1765 | C Z 1766 | B Z 1767 | B Z 1768 | B Y 1769 | B Y 1770 | A Y 1771 | C Z 1772 | A Z 1773 | A Z 1774 | C Z 1775 | A Z 1776 | C Z 1777 | C Z 1778 | B X 1779 | B Y 1780 | C Z 1781 | C Z 1782 | B X 1783 | C X 1784 | C Z 1785 | A Y 1786 | C X 1787 | B X 1788 | A Z 1789 | A Z 1790 | A Y 1791 | B Y 1792 | A Z 1793 | B Z 1794 | C Z 1795 | C Z 1796 | A Z 1797 | B X 1798 | A X 1799 | B Y 1800 | A Z 1801 | B Z 1802 | A Z 1803 | B Y 1804 | C Z 1805 | A Z 1806 | A Y 1807 | C Z 1808 | A Y 1809 | C Z 1810 | C Z 1811 | A Z 1812 | C Z 1813 | C Z 1814 | A Z 1815 | A Y 1816 | C Z 1817 | A Z 1818 | B Z 1819 | A Y 1820 | A Z 1821 | C Z 1822 | C Z 1823 | A Y 1824 | C Z 1825 | A Y 1826 | A Z 1827 | C X 1828 | B X 1829 | B Z 1830 | B Z 1831 | B Z 1832 | B Z 1833 | B Y 1834 | B X 1835 | A Z 1836 | C Z 1837 | B Z 1838 | C Z 1839 | C Z 1840 | C X 1841 | A Z 1842 | A Z 1843 | B X 1844 | C Z 1845 | A Y 1846 | C Z 1847 | B Z 1848 | A Z 1849 | C X 1850 | C Z 1851 | C Z 1852 | B Y 1853 | C Z 1854 | B Z 1855 | A Z 1856 | A X 1857 | C Z 1858 | B X 1859 | A Z 1860 | B Y 1861 | C Y 1862 | C X 1863 | C Z 1864 | A Z 1865 | B Z 1866 | A Z 1867 | B Y 1868 | C Z 1869 | C Z 1870 | A Z 1871 | C Z 1872 | C Z 1873 | C Z 1874 | C Z 1875 | B Z 1876 | C Z 1877 | B X 1878 | B Y 1879 | A Z 1880 | B Y 1881 | B Y 1882 | A Z 1883 | C Z 1884 | C Z 1885 | B Y 1886 | B Y 1887 | B Y 1888 | B Y 1889 | B Z 1890 | B X 1891 | A Z 1892 | B Y 1893 | B X 1894 | A Z 1895 | A Y 1896 | B X 1897 | B X 1898 | C Z 1899 | C X 1900 | B Y 1901 | C Z 1902 | C Z 1903 | A Z 1904 | C X 1905 | C Z 1906 | A Z 1907 | B Y 1908 | A Z 1909 | A Z 1910 | A X 1911 | C Z 1912 | B Y 1913 | A Z 1914 | C Z 1915 | C Z 1916 | A Z 1917 | B Y 1918 | B Y 1919 | B Z 1920 | B Z 1921 | B X 1922 | A X 1923 | A Z 1924 | A Z 1925 | C X 1926 | B Y 1927 | A Y 1928 | B Z 1929 | A Z 1930 | B Y 1931 | C Z 1932 | C Z 1933 | B X 1934 | C Z 1935 | C Z 1936 | A Z 1937 | C Z 1938 | A Z 1939 | A Z 1940 | C Z 1941 | C Z 1942 | C Z 1943 | B X 1944 | B Z 1945 | A Y 1946 | B X 1947 | C Z 1948 | A Z 1949 | C Z 1950 | A Y 1951 | B Y 1952 | A X 1953 | C Z 1954 | A Y 1955 | A Z 1956 | A Z 1957 | A Z 1958 | B Z 1959 | C Z 1960 | C Z 1961 | C Z 1962 | C Z 1963 | C Z 1964 | B Z 1965 | B X 1966 | C Z 1967 | A Z 1968 | C Z 1969 | A X 1970 | B Z 1971 | C Z 1972 | C Z 1973 | A Z 1974 | A Z 1975 | B Y 1976 | C Z 1977 | A Z 1978 | C Z 1979 | B Y 1980 | A Z 1981 | A Y 1982 | A Y 1983 | C X 1984 | C Z 1985 | A Z 1986 | B Y 1987 | C Z 1988 | C X 1989 | C Z 1990 | A Y 1991 | A Z 1992 | A Z 1993 | B X 1994 | C Z 1995 | B X 1996 | B Y 1997 | A Y 1998 | A Y 1999 | B Z 2000 | A Y 2001 | A Z 2002 | B Z 2003 | A Z 2004 | A X 2005 | B Z 2006 | C Z 2007 | C X 2008 | C Z 2009 | C Z 2010 | C Z 2011 | C Z 2012 | C X 2013 | C Z 2014 | A Z 2015 | A Z 2016 | B X 2017 | A Z 2018 | A Z 2019 | A Z 2020 | C Z 2021 | A Z 2022 | C Y 2023 | B Y 2024 | B Y 2025 | C Z 2026 | A Y 2027 | B Z 2028 | C Z 2029 | C Z 2030 | C Z 2031 | A Z 2032 | C Z 2033 | A Z 2034 | B Z 2035 | B Y 2036 | A Y 2037 | C Z 2038 | A Z 2039 | A Y 2040 | C Z 2041 | C Z 2042 | A Y 2043 | B Y 2044 | C Z 2045 | A Z 2046 | A Y 2047 | A Z 2048 | B X 2049 | C X 2050 | C Z 2051 | C Z 2052 | A Y 2053 | A Z 2054 | B X 2055 | C Z 2056 | A Z 2057 | C Z 2058 | C Z 2059 | A Z 2060 | C Z 2061 | B X 2062 | A Z 2063 | A Z 2064 | B Y 2065 | C Z 2066 | B X 2067 | C Z 2068 | C X 2069 | A Z 2070 | B X 2071 | C X 2072 | C Z 2073 | C Z 2074 | A Z 2075 | B Y 2076 | A Y 2077 | C Z 2078 | B Z 2079 | B Y 2080 | C X 2081 | B X 2082 | C Z 2083 | C Y 2084 | A Z 2085 | A Z 2086 | C Z 2087 | B X 2088 | A Z 2089 | C Z 2090 | B Y 2091 | B X 2092 | B Z 2093 | B X 2094 | A Y 2095 | C Z 2096 | C Z 2097 | C Y 2098 | A Z 2099 | A Y 2100 | C Z 2101 | B X 2102 | A Z 2103 | A Z 2104 | B Z 2105 | B Z 2106 | B X 2107 | A Y 2108 | A Z 2109 | C Z 2110 | A Z 2111 | A X 2112 | A Y 2113 | C Z 2114 | C Z 2115 | B Y 2116 | A Z 2117 | C Z 2118 | B Z 2119 | A Z 2120 | B Y 2121 | C Z 2122 | B Y 2123 | A Z 2124 | B Z 2125 | A Z 2126 | B Y 2127 | B Z 2128 | C Z 2129 | C Z 2130 | A Y 2131 | C Z 2132 | A Z 2133 | B X 2134 | C Z 2135 | B X 2136 | B X 2137 | A Z 2138 | C Z 2139 | B Z 2140 | A Z 2141 | C Z 2142 | C Z 2143 | C Z 2144 | C Z 2145 | A Z 2146 | C Z 2147 | B Z 2148 | C Z 2149 | A Z 2150 | B X 2151 | C Z 2152 | A Z 2153 | C Z 2154 | C Z 2155 | A Y 2156 | A Y 2157 | C Z 2158 | A Y 2159 | A X 2160 | C Z 2161 | A Z 2162 | A Z 2163 | B Z 2164 | A Z 2165 | A X 2166 | C Z 2167 | B Y 2168 | A Y 2169 | B Y 2170 | A Y 2171 | C Z 2172 | C Z 2173 | B X 2174 | A Z 2175 | B X 2176 | B Z 2177 | B Z 2178 | A Y 2179 | C X 2180 | A Y 2181 | C Z 2182 | B Y 2183 | A Z 2184 | A Z 2185 | C Z 2186 | A Z 2187 | A Z 2188 | B Y 2189 | C X 2190 | B X 2191 | A Z 2192 | A X 2193 | C Z 2194 | A Z 2195 | B Y 2196 | A Z 2197 | C Z 2198 | C Z 2199 | A Z 2200 | B X 2201 | B Z 2202 | A X 2203 | A Y 2204 | A Y 2205 | B Y 2206 | B Z 2207 | B X 2208 | B Z 2209 | C X 2210 | B Z 2211 | C Z 2212 | C Z 2213 | B X 2214 | B Y 2215 | B X 2216 | B Z 2217 | B Z 2218 | C Z 2219 | A Z 2220 | A X 2221 | B X 2222 | C Z 2223 | A Z 2224 | B Y 2225 | B Y 2226 | C X 2227 | A Z 2228 | B X 2229 | A X 2230 | C Z 2231 | B Y 2232 | A Y 2233 | B Y 2234 | A Y 2235 | B Z 2236 | C Z 2237 | C Z 2238 | C Z 2239 | B Y 2240 | B Y 2241 | A Y 2242 | C Z 2243 | C Y 2244 | B Z 2245 | A Z 2246 | C Z 2247 | C Y 2248 | B X 2249 | B X 2250 | A Z 2251 | B Y 2252 | A Z 2253 | B X 2254 | A Z 2255 | B Y 2256 | B Y 2257 | C Z 2258 | C Z 2259 | A Z 2260 | B Y 2261 | C Z 2262 | C Y 2263 | C Z 2264 | C Z 2265 | A Y 2266 | B X 2267 | C Y 2268 | A Y 2269 | B X 2270 | C Z 2271 | C Z 2272 | C Z 2273 | B Z 2274 | B Y 2275 | A Z 2276 | A Y 2277 | A Z 2278 | C Z 2279 | C Z 2280 | B Y 2281 | C Z 2282 | C Z 2283 | A Z 2284 | B Z 2285 | C Z 2286 | A Z 2287 | A Z 2288 | A Z 2289 | A Y 2290 | C X 2291 | B Y 2292 | B Y 2293 | A Y 2294 | C Z 2295 | B Y 2296 | B X 2297 | B Z 2298 | C Z 2299 | C Z 2300 | A Y 2301 | A Z 2302 | A Z 2303 | B Z 2304 | C Z 2305 | C Z 2306 | B Y 2307 | C Z 2308 | A Z 2309 | C Z 2310 | C Z 2311 | C X 2312 | B X 2313 | B Y 2314 | C Z 2315 | A Z 2316 | A Y 2317 | C Z 2318 | C Z 2319 | C Z 2320 | A Z 2321 | A Y 2322 | C Z 2323 | A Z 2324 | A Y 2325 | A Y 2326 | C Z 2327 | B X 2328 | C Z 2329 | C X 2330 | B Y 2331 | A Z 2332 | B Y 2333 | C Z 2334 | B X 2335 | A Z 2336 | A Y 2337 | C Z 2338 | A Z 2339 | C Z 2340 | A Z 2341 | C Z 2342 | C Z 2343 | A Y 2344 | A Z 2345 | A Z 2346 | B Z 2347 | A Z 2348 | A Z 2349 | C Z 2350 | A X 2351 | A Y 2352 | C X 2353 | A Z 2354 | A Z 2355 | B Z 2356 | B Y 2357 | A Z 2358 | C Z 2359 | B Z 2360 | C Z 2361 | A Z 2362 | C Z 2363 | B X 2364 | C Z 2365 | B Z 2366 | B Z 2367 | C Z 2368 | B Z 2369 | A Z 2370 | A Z 2371 | C Z 2372 | A Z 2373 | C X 2374 | C Z 2375 | A Y 2376 | A Z 2377 | A X 2378 | A Z 2379 | B Z 2380 | B Z 2381 | C Z 2382 | C X 2383 | A Y 2384 | C Z 2385 | A Z 2386 | A Z 2387 | A X 2388 | C Z 2389 | C Z 2390 | C X 2391 | B Z 2392 | B X 2393 | B Z 2394 | B Y 2395 | C Z 2396 | A Z 2397 | A Y 2398 | A Y 2399 | B X 2400 | A Y 2401 | A Y 2402 | C Z 2403 | C Z 2404 | B Z 2405 | A Z 2406 | B Z 2407 | C Z 2408 | A Z 2409 | B Y 2410 | B Y 2411 | C Z 2412 | A Z 2413 | C Z 2414 | A Z 2415 | B Y 2416 | A Z 2417 | C Z 2418 | B X 2419 | C Z 2420 | A Z 2421 | C Z 2422 | A Y 2423 | B Y 2424 | A Y 2425 | B Z 2426 | A Y 2427 | C Z 2428 | A Z 2429 | C Z 2430 | B X 2431 | B X 2432 | B Y 2433 | B X 2434 | C Z 2435 | A X 2436 | B Y 2437 | B Z 2438 | C Z 2439 | A Y 2440 | C Z 2441 | B Z 2442 | C Z 2443 | A Z 2444 | C X 2445 | C Z 2446 | A Z 2447 | A Y 2448 | C Z 2449 | C Z 2450 | B Y 2451 | C Z 2452 | B Y 2453 | C Z 2454 | C Z 2455 | B Z 2456 | A Z 2457 | C Z 2458 | B Y 2459 | B X 2460 | A Z 2461 | C Z 2462 | C Z 2463 | A Z 2464 | C Z 2465 | C Z 2466 | B Y 2467 | A Z 2468 | B X 2469 | C Z 2470 | B Y 2471 | B X 2472 | A Z 2473 | C Z 2474 | A Z 2475 | C Z 2476 | A Z 2477 | C Z 2478 | B Y 2479 | C Z 2480 | A Z 2481 | B X 2482 | C Z 2483 | A Y 2484 | A Y 2485 | A Z 2486 | A Y 2487 | A Z 2488 | A X 2489 | C Z 2490 | B X 2491 | B Z 2492 | C Z 2493 | A Z 2494 | C X 2495 | A Z 2496 | A Z 2497 | A Z 2498 | C Z 2499 | A Z 2500 | C Z 2501 | -------------------------------------------------------------------------------- /2022/day/_metadata.yml: -------------------------------------------------------------------------------- 1 | # options specified here will apply to all posts in this folder 2 | 3 | freeze: auto 4 | 5 | toc: true 6 | toc-depth: 3 7 | 8 | code-fold: show 9 | code-summary: "Toggle the code" 10 | code-tools: true 11 | 12 | execute: 13 | echo: true 14 | message: false 15 | warning: false 16 | -------------------------------------------------------------------------------- /2024.qmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "2024" 3 | listing: 4 | contents: "2024/day" 5 | sort: "date" 6 | type: table 7 | categories: true 8 | sort-ui: false 9 | filter-ui: false 10 | fields: [title, categories] 11 | --- 12 | -------------------------------------------------------------------------------- /2024/day/_metadata.yml: -------------------------------------------------------------------------------- 1 | # options specified here will apply to all posts in this folder 2 | 3 | freeze: auto 4 | 5 | toc: true 6 | toc-depth: 3 7 | 8 | code-fold: show 9 | code-summary: "Toggle the code" 10 | code-tools: true 11 | 12 | execute: 13 | echo: true 14 | message: false 15 | warning: false 16 | -------------------------------------------------------------------------------- /2024/day/introduction/index.qmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "2024: Introduction" 3 | date: 2024-11-25 4 | code-tools: false 5 | categories: [demo] 6 | --- 7 | 8 | Here's a demo introduction page. It's created from `"./_templates/YYYY-intro"` as part of the call to `aoc_new_year(2024)`. 9 | 10 | It can be deleted with a call to `aoc_delete_intro(2024)` (though there needs to be at least one post in `./2024/day` for the website to render from Quarto v1.4). 11 | 12 | This is a good place to note any overarching themes for the year, what you want to practice/learn, etc. -------------------------------------------------------------------------------- /README.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | output: github_document 3 | --- 4 | 5 | # Advent of Code Website Template 6 | 7 | Here's a template for making [Quarto](https://quarto.org) websites for working on and (optionally) publishing [Advent of Code](https://adventofcode.com) solutions. Essentially, each year is a listing page, and each day is a post. 8 | 9 | It works hand-in-hand with the [**aochelpers**](https://ellakaye.github.io/aochelpers) package for R, 10 | which makes it incredibly easy to set up new posts, scripts and listings, 11 | using supplied (though personalisable) templates, found in the `_templates` directory. 12 | When a template is copied by functions from **aochelpers**, 13 | e.g. `aoc_new_year(2022)` or `aoc_new_day(1, 4)` 14 | any occurrence of "DD" and "YYYY" in both the copied files' titles 15 | and the text inside will be replaced with the value of the `day` 16 | and `year` arguments respectively. 17 | 18 | The website corresponding to this template is , so you can see it in action there. 19 | 20 | ## Templates 21 | The `_templates` directory contains the following templates: 22 | 23 | - `post-template`, which contains `index.qmd` and `script.R`, which gets copied on calls to `aoc_new_day()` 24 | - `index.qmd` is the template for writing up each day's solution. 25 | It automatically provides correct links to the relevant puzzle on the Advent of Code website, as well as a link to your input 26 | (assuming the input is in the same directory, which it will be if the post has been created with `aoc_new_day()`). 27 | It also reads in the input using `aoc_input_vector()`, and notes alternative `aoc_input_*` functions if those are more appropriate for the day. 28 | - `script.R` provides a place to work on your solutions, 29 | before writing them up. 30 | - `YYYY-intro`, which contains `index.qmd` is the template for an introductory post for each year. It gets copied by `aoc_new_year()` and is necessary for the website to render after a call to that function, but before any other posts are present (Quarto v1.4 onwards doesn't allow empty listings pages.) 31 | - `YYYY.qmd` is the listing page for the year, which gets copied on a call to `aoc_new_year()` 32 | - `_metadata.yml`, which gets copied by `aoc_new_year()`, sets the options for all the posts for the year. See [this page of the Quarto website](https://quarto.org/docs/projects/quarto-projects.html#shared-metadata) for more details. 33 | 34 | I've set up these templates in a way that I think works well, 35 | but of course you can customise them to whatever you want for your version of the site. 36 | **Don't rename them** though, otherwise the **aochelpers** functions won't be able to find them. Do use "DD" and "YYYY" wherever you want the actual value of the day and year to appear. 37 | 38 | ## A note on directory structure and file names 39 | The directory structure and file names have been set to echo the Advent of Code website. So, for example, the Day 1 puzzle for 2022 is at and the corresponding page on the template website is . Likewise, the input can be found at and respectively. (For your own version of the website, swap out the user name and repo name accordingly). 40 | 41 | ## Using the website with **aochelpers** 42 | 43 | **aochelpers** can be installed from its [repo](https://github.com/EllaKaye/aochelpers): 44 | 45 | ```{r eval=FALSE} 46 | remotes::install_github("EllaKaye/aochelpers") 47 | ``` 48 | 49 | ```{r} 50 | library(aochelpers) 51 | ``` 52 | 53 | The two main functions for managing files, already mentioned above, are `aoc_new_year()` and `aoc_new_day()`. 54 | 55 | The calls used to create this template were: 56 | 57 | ```{r example} 58 | #| eval: false 59 | # Add a listing page a directory for a new year 60 | aoc_new_year() # set up current year (including intro post) 61 | aoc_new_year(2022, intro = FALSE) # set up a specified year (without intro post) 62 | 63 | # Add a post for a new day 64 | aoc_new_day(1, 2022) # day 1 of 2022 (don't need to specify year for current year) 65 | 66 | # Get input for a day without generating a post 67 | # (i.e. no index.qmd or script.R in the 2022/day/2 directory) 68 | aoc_get_input(2, 2022) # day 2 of specified year 69 | ``` 70 | 71 | In the descriptions below, the `YYYY` and `DD` placeholders are used to indicate where the year and day values will be inserted. 72 | 73 | [`aoc_new_year()`](https://ellakaye.github.io/aochelpers/reference/aoc_new_year.html) will 74 | 75 | - create a new directory for the specified year, at `./YYYY/`. 76 | - create a new listing page for the year, as `./YYYY.qmd`. The listing page will be created using the template `./_templates/YYYY.qmd`. The listing page picks up posts from the `YYYY/day` directory. (This directory structure echoes the structure of the Advent of Code website.) 77 | - optionally create an introductory post for the year, as `./YYYY/day/YYYY-introduction`, using the template `./_templates/YYYY-intro`. The post will be created only if the `intro` argument is `TRUE` (the default). Note that, as of Quarto v1.4, there needs to be at least one post in the `YYYY/day` directory for the website to render without error. 78 | - if `_templates/_metadata.yml` exists, it will be copied to `./YYYY/day/_metadata.yml`. 79 | 80 | [`aoc_new_day()`](https://ellakaye.github.io/aochelpers/reference/aoc_new_day.html) will 81 | 82 | - create a new directory for the specified day, at `./YYYY/day/DD/` 83 | - copy the contents of `_templates/post-template` into the above directory 84 | - download the puzzle input for the day from the Advent of Code website, and save it as `./YYYY/day/DD/input` (via a call to [`aoc_get_input()`)](https://ellakaye.github.io/aochelpers/reference/aoc_get_input.html) 85 | 86 | There are other functions for creating and deleting directories and files based on the advent-of-code-website-template. See the package [Reference](https://ellakaye.github.io/aochelpers/reference/index.html) page for details. 87 | 88 | ## Examples posts 89 | The template comes ready to go for 2024, with a placeholder introduction post, 90 | and also with an day 1 post for 2022, 91 | so you can see what the templates look in action. 92 | All files related to 2022 can be removed with a call to `aoc_delete_year(2022)`. 93 | The intro post for 2024 can be removed with `aoc_delete_intro(2024)` (once there's another post for 2024 present). 94 | 95 | ## Functions for reading in input 96 | **aochelpers** provides functions for reading in input in various ways. 97 | The input for Day 2 of 2022 allows us to demonstrate all three: 98 | 99 | ```{r} 100 | aoc_input_vector(2, 2022) |> head() 101 | aoc_input_data_frame(2, 2022) |> head() 102 | aoc_input_matrix(2, 2022) |> head() 103 | ``` 104 | 105 | `aoc_input_vector()` and `aoc_input_matrix()` both have a `mode` argument that allow you to specify whether the input is character or numeric (defaults to character). `aoc_input_matrix()` by default has a new column for each single character/digit, though that can be changed with the `split` argument. 106 | `aoc_input_data_frame()` can return either a `tbl_df` or `data.frame`. 107 | 108 | ## Themes 109 | The website template comes with two custom themes, one light and one dark. 110 | The light theme is clean, with Christmas-y shades of green and red. 111 | The dark theme is reminiscent of the Advent of Code website (though not identical, since the design of is part of its registered trademark). You can switch between them using the toggle in the top right corner of the page. 112 | Both themes use [fonts from iA](https://github.com/iaolo/iA-Fonts). 113 | The themes can be adapted in the `custom-light.scss` and `custom-dark.scss` files. 114 | For more on Quarto themes, see the [documentation](https://quarto.org/docs/output-formats/html-themes.html). 115 | 116 | ## Publishing 117 | The template is set up with the option to publish automatically to GitHub pages, 118 | using a GitHub action that activates on push to the main branch. 119 | To allow this, when using the template, tick the box to 'include all branches', 120 | which will then copy over the `gh-pages` branch as well. 121 | If you do not wish to publish in this way, only copy the default branch, 122 | and then you can delete the `.github` directory as well. 123 | 124 | For more information on the many options for publishing Quarto websites, 125 | see the [documentation](https://quarto.org/docs/publishing/). 126 | 127 | ## Examples 128 | This template is an extension of my work on an Advent of Code website for myself, links below. 129 | If anyone else uses this template and would like to share the links on this README, 130 | please do submit a pull request to include it here, or raise an issue and I'll add it. 131 | It would be great to get a collection. 132 | 133 | - Ella Kaye: [website](https://adventofcode.ellakaye.co.uk), [repo](https://github.com/EllaKaye/advent-of-code-website). 134 | This version has substantially different theming to the template (to match my [personal site](https://ellakaye.co.uk)) and deploys manually to netlify (due to purchased, licensed fonts that I can't check into GitHub). 135 | 136 | ## Other R Advent of Code projects 137 | The project arose because my write-up of my 2020 solutions as one long blog post was too unwieldy. 138 | I was inspired by Emil Hvitfledt's [R Advent of Code](https://emilhvitfeldt.github.io/rstats-adventofcode/) website, 139 | which has a separate page for each year, 140 | though his site uses a tabset for the different days, 141 | whereas this one has a separeate listing page for each year, then separate posts for each day. 142 | 143 | **aochelpers** adapts and builds upon code from David Robinson's [adventdrob](https://github.com/dgrtwo/adventdrob) package. His package contains other functions for working with Advent of Code input that he has found useful when approaching the challenges over the years. 144 | 145 | TJ Mahr has an [**aoc**](https://github.com/tjmahr/aoc) package that provides [usethis](https://usethis.r-lib.org)-style functions for Advent fo Code puzzles. 146 | It takes a different approach to **aochelpers** by organising everything within the structure of an R package, 147 | with a new package for each year. 148 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | # Advent of Code Website Template 3 | 4 | Here’s a template for making [Quarto](https://quarto.org) websites for 5 | working on and (optionally) publishing [Advent of 6 | Code](https://adventofcode.com) solutions. Essentially, each year is a 7 | listing page, and each day is a post. 8 | 9 | It works hand-in-hand with the 10 | [**aochelpers**](https://ellakaye.github.io/aochelpers) package for R, 11 | which makes it incredibly easy to set up new posts, scripts and 12 | listings, using supplied (though personalisable) templates, found in the 13 | `_templates` directory. When a template is copied by functions from 14 | **aochelpers**, e.g. `aoc_new_year(2022)` or `aoc_new_day(1, 2024)` any 15 | occurrence of “DD” and “YYYY” in both the copied files’ titles and the 16 | text inside will be replaced with the value of the `day` and `year` 17 | arguments respectively. 18 | 19 | The website corresponding to this template is 20 | , so you can 21 | see it in action there. 22 | 23 | ## Templates 24 | 25 | The `_templates` directory contains the following templates: 26 | 27 | - `post-template`, which contains `index.qmd` and `script.R`, which gets 28 | copied on calls to `aoc_new_day()` 29 | - `index.qmd` is the template for writing up each day’s solution. It 30 | automatically provides correct links to the relevant puzzle on the 31 | Advent of Code website, as well as a link to your input (assuming 32 | the input is in the same directory, which it will be if the post has 33 | been created with `aoc_new_day()`). It also reads in the input using 34 | `aoc_input_vector()`, and notes alternative `aoc_input_*` functions 35 | if those are more appropriate for the day. 36 | - `script.R` provides a place to work on your solutions, before 37 | writing them up. 38 | - `YYYY-intro`, which contains `index.qmd` is the template for an 39 | introductory post for each year. It gets copied by `aoc_new_year()` 40 | and is necessary for the website to render after a call to that 41 | function, but before any other posts are present (Quarto v1.4 onwards 42 | doesn’t allow empty listings pages.) 43 | - `YYYY.qmd` is the listing page for the year, which gets copied on a 44 | call to `aoc_new_year()` 45 | - `_metadata.yml`, which gets copied by `aoc_new_year()`, sets the 46 | options for all the posts for the year. See [this page of the Quarto 47 | website](https://quarto.org/docs/projects/quarto-projects.html#shared-metadata) 48 | for more details. 49 | 50 | I’ve set up these templates in a way that I think works well, but of 51 | course you can customise them to whatever you want for your version of 52 | the site. **Don’t rename them** though, otherwise the **aochelpers** 53 | functions won’t be able to find them. Do use “DD” and “YYYY” wherever 54 | you want the actual value of the day and year to appear. 55 | 56 | ## A note on directory structure and file names 57 | 58 | The directory structure and file names have been set to echo the Advent 59 | of Code website. So, for example, the Day 1 puzzle for 2022 is at 60 | and the corresponding page on the 61 | template website is 62 | . 63 | Likewise, the input can be found at 64 | and 65 | 66 | respectively. (For your own version of the website, swap out the user 67 | name and repo name accordingly). 68 | 69 | ## Using the website with **aochelpers** 70 | 71 | **aochelpers** can be installed from its 72 | [repo](https://github.com/EllaKaye/aochelpers): 73 | 74 | ``` r 75 | remotes::install_github("EllaKaye/aochelpers") 76 | ``` 77 | 78 | ``` r 79 | library(aochelpers) 80 | ``` 81 | 82 | The two main functions for managing files, already mentioned above, are 83 | `aoc_new_year()` and `aoc_new_day()`. 84 | 85 | The calls used to create this template were: 86 | 87 | ``` r 88 | # Add a listing page a directory for a new year 89 | aoc_new_year() # set up current year (including intro post) 90 | aoc_new_year(2022, intro = FALSE) # set up a specified year (without intro post) 91 | 92 | # Add a post for a new day 93 | aoc_new_day(1, 2022) # day 1 of 2022 (don't need to specify year for current year) 94 | 95 | # Get input for a day without generating a post 96 | # (i.e. no index.qmd or script.R in the 2022/day/2 directory) 97 | aoc_get_input(2, 2022) # day 2 of specified year 98 | ``` 99 | 100 | In the descriptions below, the `YYYY` and `DD` placeholders are used to 101 | indicate where the year and day values will be inserted. 102 | 103 | [`aoc_new_year()`](https://ellakaye.github.io/aochelpers/reference/aoc_new_year.html) 104 | will 105 | 106 | - create a new directory for the specified year, at `./YYYY/`. 107 | - create a new listing page for the year, as `./YYYY.qmd`. The listing 108 | page will be created using the template `./_templates/YYYY.qmd`. The 109 | listing page picks up posts from the `YYYY/day` directory. (This 110 | directory structure echoes the structure of the Advent of Code 111 | website.) 112 | - optionally create an introductory post for the year, as 113 | `./YYYY/day/YYYY-introduction`, using the template 114 | `./_templates/YYYY-intro`. The post will be created only if the 115 | `intro` argument is `TRUE` (the default). Note that, as of Quarto 116 | v1.4, there needs to be at least one post in the `YYYY/day` directory 117 | for the website to render without error. 118 | - if `_templates/_metadata.yml` exists, it will be copied to 119 | `./YYYY/day/_metadata.yml`. 120 | 121 | [`aoc_new_day()`](https://ellakaye.github.io/aochelpers/reference/aoc_new_day.html) 122 | will 123 | 124 | - create a new directory for the specified day, at `./YYYY/day/DD/` 125 | - copy the contents of `_templates/post-template` into the above 126 | directory 127 | - download the puzzle input for the day from the Advent of Code website, 128 | and save it as `./YYYY/day/DD/input` (via a call to 129 | [`aoc_get_input()`)](https://ellakaye.github.io/aochelpers/reference/aoc_get_input.html) 130 | 131 | There are other functions for creating and deleting directories and 132 | files based on the advent-of-code-website-template. See the package 133 | [Reference](https://ellakaye.github.io/aochelpers/reference/index.html) 134 | page for details. 135 | 136 | ## Examples posts 137 | 138 | The template comes ready to go for 2024, with a placeholder introduction 139 | post, and also with an day 1 post for 2022, so you can see what the 140 | templates look in action. All files related to 2022 can be removed with 141 | a call to `aoc_delete_year(2022)`. The intro post for 2024 can be 142 | removed with `aoc_delete_intro(2024)` (once there’s another post for 143 | 2024 present). 144 | 145 | ## Functions for reading in input 146 | 147 | **aochelpers** provides functions for reading in input in various ways. 148 | The input for Day 2 of 2022 allows us to demonstrate all three: 149 | 150 | ``` r 151 | aoc_input_vector(2, 2022) |> head() 152 | ``` 153 | 154 | ## [1] "A X" "B Y" "B Y" "C X" "B X" "C Z" 155 | 156 | ``` r 157 | aoc_input_data_frame(2, 2022) |> head() 158 | ``` 159 | 160 | ## # A tibble: 6 × 2 161 | ## X1 X2 162 | ## 163 | ## 1 A X 164 | ## 2 B Y 165 | ## 3 B Y 166 | ## 4 C X 167 | ## 5 B X 168 | ## 6 C Z 169 | 170 | ``` r 171 | aoc_input_matrix(2, 2022) |> head() 172 | ``` 173 | 174 | ## [,1] [,2] [,3] 175 | ## [1,] "A" " " "X" 176 | ## [2,] "B" " " "Y" 177 | ## [3,] "B" " " "Y" 178 | ## [4,] "C" " " "X" 179 | ## [5,] "B" " " "X" 180 | ## [6,] "C" " " "Z" 181 | 182 | `aoc_input_vector()` and `aoc_input_matrix()` both have a `mode` 183 | argument that allow you to specify whether the input is character or 184 | numeric (defaults to character). `aoc_input_matrix()` by default has a 185 | new column for each single character/digit, though that can be changed 186 | with the `split` argument. `aoc_input_data_frame()` can return either a 187 | `tbl_df` or `data.frame`. 188 | 189 | ## Themes 190 | 191 | The website template comes with two custom themes, one light and one 192 | dark. The light theme is clean, with Christmas-y shades of green and 193 | red. The dark theme is reminiscent of the Advent of Code website (though 194 | not identical, since the design of is part of 195 | its registered trademark). You can switch between them using the toggle 196 | in the top right corner of the page. Both themes use [fonts from 197 | iA](https://github.com/iaolo/iA-Fonts). The themes can be adapted in the 198 | `custom-light.scss` and `custom-dark.scss` files. For more on Quarto 199 | themes, see the 200 | [documentation](https://quarto.org/docs/output-formats/html-themes.html). 201 | 202 | ## Publishing 203 | 204 | The template is set up with the option to publish automatically to 205 | GitHub pages, using a GitHub action that activates on push to the main 206 | branch. To allow this, when using the template, tick the box to ‘include 207 | all branches’, which will then copy over the `gh-pages` branch as well. 208 | If you do not wish to publish in this way, only copy the default branch, 209 | and then you can delete the `.github` directory as well. 210 | 211 | For more information on the many options for publishing Quarto websites, 212 | see the [documentation](https://quarto.org/docs/publishing/). 213 | 214 | ## Examples 215 | 216 | This template is an extension of my work on an Advent of Code website 217 | for myself, links below. If anyone else uses this template and would 218 | like to share the links on this README, please do submit a pull request 219 | to include it here, or raise an issue and I’ll add it. It would be great 220 | to get a collection. 221 | 222 | - Ella Kaye: [website](https://adventofcode.ellakaye.co.uk), 223 | [repo](https://github.com/EllaKaye/advent-of-code-website). This 224 | version has substantially different theming to the template (to match 225 | my [personal site](https://ellakaye.co.uk)) and deploys manually to 226 | netlify (due to purchased, licensed fonts that I can’t check into 227 | GitHub). 228 | 229 | ## Other R Advent of Code projects 230 | 231 | The project arose because my write-up of my 2020 solutions as one long 232 | blog post was too unwieldy. I was inspired by Emil Hvitfledt’s [R Advent 233 | of Code](https://emilhvitfeldt.github.io/rstats-adventofcode/) website, 234 | which has a separate page for each year, though his site uses a tabset 235 | for the different days, whereas this one has a separeate listing page 236 | for each year, then separate posts for each day. 237 | 238 | **aochelpers** adapts and builds upon code from David Robinson’s 239 | [adventdrob](https://github.com/dgrtwo/adventdrob) package. His package 240 | contains other functions for working with Advent of Code input that he 241 | has found useful when approaching the challenges over the years. 242 | 243 | TJ Mahr has an [**aoc**](https://github.com/tjmahr/aoc) package that 244 | provides [usethis](https://usethis.r-lib.org)-style functions for Advent 245 | fo Code puzzles. It takes a different approach to **aochelpers** by 246 | organising everything within the structure of an R package, with a new 247 | package for each year. 248 | -------------------------------------------------------------------------------- /README_files/libs/bootstrap/bootstrap-icons.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EllaKaye/advent-of-code-website-template/39437a5ed3c0ba6e1db6ccd761de56bb1f2f0b47/README_files/libs/bootstrap/bootstrap-icons.woff -------------------------------------------------------------------------------- /README_files/libs/clipboard/clipboard.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * clipboard.js v2.0.11 3 | * https://clipboardjs.com/ 4 | * 5 | * Licensed MIT © Zeno Rocha 6 | */ 7 | !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.ClipboardJS=e():t.ClipboardJS=e()}(this,function(){return n={686:function(t,e,n){"use strict";n.d(e,{default:function(){return b}});var e=n(279),i=n.n(e),e=n(370),u=n.n(e),e=n(817),r=n.n(e);function c(t){try{return document.execCommand(t)}catch(t){return}}var a=function(t){t=r()(t);return c("cut"),t};function o(t,e){var n,o,t=(n=t,o="rtl"===document.documentElement.getAttribute("dir"),(t=document.createElement("textarea")).style.fontSize="12pt",t.style.border="0",t.style.padding="0",t.style.margin="0",t.style.position="absolute",t.style[o?"right":"left"]="-9999px",o=window.pageYOffset||document.documentElement.scrollTop,t.style.top="".concat(o,"px"),t.setAttribute("readonly",""),t.value=n,t);return e.container.appendChild(t),e=r()(t),c("copy"),t.remove(),e}var f=function(t){var e=1.anchorjs-link,.anchorjs-link:focus{opacity:1}",A.sheet.cssRules.length),A.sheet.insertRule("[data-anchorjs-icon]::after{content:attr(data-anchorjs-icon)}",A.sheet.cssRules.length),A.sheet.insertRule('@font-face{font-family:anchorjs-icons;src:url(data:n/a;base64,AAEAAAALAIAAAwAwT1MvMg8yG2cAAAE4AAAAYGNtYXDp3gC3AAABpAAAAExnYXNwAAAAEAAAA9wAAAAIZ2x5ZlQCcfwAAAH4AAABCGhlYWQHFvHyAAAAvAAAADZoaGVhBnACFwAAAPQAAAAkaG10eASAADEAAAGYAAAADGxvY2EACACEAAAB8AAAAAhtYXhwAAYAVwAAARgAAAAgbmFtZQGOH9cAAAMAAAAAunBvc3QAAwAAAAADvAAAACAAAQAAAAEAAHzE2p9fDzz1AAkEAAAAAADRecUWAAAAANQA6R8AAAAAAoACwAAAAAgAAgAAAAAAAAABAAADwP/AAAACgAAA/9MCrQABAAAAAAAAAAAAAAAAAAAAAwABAAAAAwBVAAIAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAMCQAGQAAUAAAKZAswAAACPApkCzAAAAesAMwEJAAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAAAAAAAAAAAAAQAAg//0DwP/AAEADwABAAAAAAQAAAAAAAAAAAAAAIAAAAAAAAAIAAAACgAAxAAAAAwAAAAMAAAAcAAEAAwAAABwAAwABAAAAHAAEADAAAAAIAAgAAgAAACDpy//9//8AAAAg6cv//f///+EWNwADAAEAAAAAAAAAAAAAAAAACACEAAEAAAAAAAAAAAAAAAAxAAACAAQARAKAAsAAKwBUAAABIiYnJjQ3NzY2MzIWFxYUBwcGIicmNDc3NjQnJiYjIgYHBwYUFxYUBwYGIwciJicmNDc3NjIXFhQHBwYUFxYWMzI2Nzc2NCcmNDc2MhcWFAcHBgYjARQGDAUtLXoWOR8fORYtLTgKGwoKCjgaGg0gEhIgDXoaGgkJBQwHdR85Fi0tOAobCgoKOBoaDSASEiANehoaCQkKGwotLXoWOR8BMwUFLYEuehYXFxYugC44CQkKGwo4GkoaDQ0NDXoaShoKGwoFBe8XFi6ALjgJCQobCjgaShoNDQ0NehpKGgobCgoKLYEuehYXAAAADACWAAEAAAAAAAEACAAAAAEAAAAAAAIAAwAIAAEAAAAAAAMACAAAAAEAAAAAAAQACAAAAAEAAAAAAAUAAQALAAEAAAAAAAYACAAAAAMAAQQJAAEAEAAMAAMAAQQJAAIABgAcAAMAAQQJAAMAEAAMAAMAAQQJAAQAEAAMAAMAAQQJAAUAAgAiAAMAAQQJAAYAEAAMYW5jaG9yanM0MDBAAGEAbgBjAGgAbwByAGoAcwA0ADAAMABAAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAH//wAP) format("truetype")}',A.sheet.cssRules.length)),h=document.querySelectorAll("[id]"),t=[].map.call(h,function(A){return A.id}),i=0;i\]./()*\\\n\t\b\v\u00A0]/g,"-").replace(/-{2,}/g,"-").substring(0,this.options.truncate).replace(/^-+|-+$/gm,"").toLowerCase()},this.hasAnchorJSLink=function(A){var e=A.firstChild&&-1<(" "+A.firstChild.className+" ").indexOf(" anchorjs-link "),A=A.lastChild&&-1<(" "+A.lastChild.className+" ").indexOf(" anchorjs-link ");return e||A||!1}}}); 9 | // @license-end -------------------------------------------------------------------------------- /README_files/libs/quarto-html/popper.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @popperjs/core v2.11.7 - MIT License 3 | */ 4 | 5 | !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).Popper={})}(this,(function(e){"use strict";function t(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function n(e){return e instanceof t(e).Element||e instanceof Element}function r(e){return e instanceof t(e).HTMLElement||e instanceof HTMLElement}function o(e){return"undefined"!=typeof ShadowRoot&&(e instanceof t(e).ShadowRoot||e instanceof ShadowRoot)}var i=Math.max,a=Math.min,s=Math.round;function f(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map((function(e){return e.brand+"/"+e.version})).join(" "):navigator.userAgent}function c(){return!/^((?!chrome|android).)*safari/i.test(f())}function p(e,o,i){void 0===o&&(o=!1),void 0===i&&(i=!1);var a=e.getBoundingClientRect(),f=1,p=1;o&&r(e)&&(f=e.offsetWidth>0&&s(a.width)/e.offsetWidth||1,p=e.offsetHeight>0&&s(a.height)/e.offsetHeight||1);var u=(n(e)?t(e):window).visualViewport,l=!c()&&i,d=(a.left+(l&&u?u.offsetLeft:0))/f,h=(a.top+(l&&u?u.offsetTop:0))/p,m=a.width/f,v=a.height/p;return{width:m,height:v,top:h,right:d+m,bottom:h+v,left:d,x:d,y:h}}function u(e){var n=t(e);return{scrollLeft:n.pageXOffset,scrollTop:n.pageYOffset}}function l(e){return e?(e.nodeName||"").toLowerCase():null}function d(e){return((n(e)?e.ownerDocument:e.document)||window.document).documentElement}function h(e){return p(d(e)).left+u(e).scrollLeft}function m(e){return t(e).getComputedStyle(e)}function v(e){var t=m(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function y(e,n,o){void 0===o&&(o=!1);var i,a,f=r(n),c=r(n)&&function(e){var t=e.getBoundingClientRect(),n=s(t.width)/e.offsetWidth||1,r=s(t.height)/e.offsetHeight||1;return 1!==n||1!==r}(n),m=d(n),y=p(e,c,o),g={scrollLeft:0,scrollTop:0},b={x:0,y:0};return(f||!f&&!o)&&(("body"!==l(n)||v(m))&&(g=(i=n)!==t(i)&&r(i)?{scrollLeft:(a=i).scrollLeft,scrollTop:a.scrollTop}:u(i)),r(n)?((b=p(n,!0)).x+=n.clientLeft,b.y+=n.clientTop):m&&(b.x=h(m))),{x:y.left+g.scrollLeft-b.x,y:y.top+g.scrollTop-b.y,width:y.width,height:y.height}}function g(e){var t=p(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function b(e){return"html"===l(e)?e:e.assignedSlot||e.parentNode||(o(e)?e.host:null)||d(e)}function x(e){return["html","body","#document"].indexOf(l(e))>=0?e.ownerDocument.body:r(e)&&v(e)?e:x(b(e))}function w(e,n){var r;void 0===n&&(n=[]);var o=x(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),a=t(o),s=i?[a].concat(a.visualViewport||[],v(o)?o:[]):o,f=n.concat(s);return i?f:f.concat(w(b(s)))}function O(e){return["table","td","th"].indexOf(l(e))>=0}function j(e){return r(e)&&"fixed"!==m(e).position?e.offsetParent:null}function E(e){for(var n=t(e),i=j(e);i&&O(i)&&"static"===m(i).position;)i=j(i);return i&&("html"===l(i)||"body"===l(i)&&"static"===m(i).position)?n:i||function(e){var t=/firefox/i.test(f());if(/Trident/i.test(f())&&r(e)&&"fixed"===m(e).position)return null;var n=b(e);for(o(n)&&(n=n.host);r(n)&&["html","body"].indexOf(l(n))<0;){var i=m(n);if("none"!==i.transform||"none"!==i.perspective||"paint"===i.contain||-1!==["transform","perspective"].indexOf(i.willChange)||t&&"filter"===i.willChange||t&&i.filter&&"none"!==i.filter)return n;n=n.parentNode}return null}(e)||n}var D="top",A="bottom",L="right",P="left",M="auto",k=[D,A,L,P],W="start",B="end",H="viewport",T="popper",R=k.reduce((function(e,t){return e.concat([t+"-"+W,t+"-"+B])}),[]),S=[].concat(k,[M]).reduce((function(e,t){return e.concat([t,t+"-"+W,t+"-"+B])}),[]),V=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function q(e){var t=new Map,n=new Set,r=[];function o(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var r=t.get(e);r&&o(r)}})),r.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||o(e)})),r}function C(e){return e.split("-")[0]}function N(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&o(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function I(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function _(e,r,o){return r===H?I(function(e,n){var r=t(e),o=d(e),i=r.visualViewport,a=o.clientWidth,s=o.clientHeight,f=0,p=0;if(i){a=i.width,s=i.height;var u=c();(u||!u&&"fixed"===n)&&(f=i.offsetLeft,p=i.offsetTop)}return{width:a,height:s,x:f+h(e),y:p}}(e,o)):n(r)?function(e,t){var n=p(e,!1,"fixed"===t);return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}(r,o):I(function(e){var t,n=d(e),r=u(e),o=null==(t=e.ownerDocument)?void 0:t.body,a=i(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),s=i(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),f=-r.scrollLeft+h(e),c=-r.scrollTop;return"rtl"===m(o||n).direction&&(f+=i(n.clientWidth,o?o.clientWidth:0)-a),{width:a,height:s,x:f,y:c}}(d(e)))}function F(e,t,o,s){var f="clippingParents"===t?function(e){var t=w(b(e)),o=["absolute","fixed"].indexOf(m(e).position)>=0&&r(e)?E(e):e;return n(o)?t.filter((function(e){return n(e)&&N(e,o)&&"body"!==l(e)})):[]}(e):[].concat(t),c=[].concat(f,[o]),p=c[0],u=c.reduce((function(t,n){var r=_(e,n,s);return t.top=i(r.top,t.top),t.right=a(r.right,t.right),t.bottom=a(r.bottom,t.bottom),t.left=i(r.left,t.left),t}),_(e,p,s));return u.width=u.right-u.left,u.height=u.bottom-u.top,u.x=u.left,u.y=u.top,u}function U(e){return e.split("-")[1]}function z(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function X(e){var t,n=e.reference,r=e.element,o=e.placement,i=o?C(o):null,a=o?U(o):null,s=n.x+n.width/2-r.width/2,f=n.y+n.height/2-r.height/2;switch(i){case D:t={x:s,y:n.y-r.height};break;case A:t={x:s,y:n.y+n.height};break;case L:t={x:n.x+n.width,y:f};break;case P:t={x:n.x-r.width,y:f};break;default:t={x:n.x,y:n.y}}var c=i?z(i):null;if(null!=c){var p="y"===c?"height":"width";switch(a){case W:t[c]=t[c]-(n[p]/2-r[p]/2);break;case B:t[c]=t[c]+(n[p]/2-r[p]/2)}}return t}function Y(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function G(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}function J(e,t){void 0===t&&(t={});var r=t,o=r.placement,i=void 0===o?e.placement:o,a=r.strategy,s=void 0===a?e.strategy:a,f=r.boundary,c=void 0===f?"clippingParents":f,u=r.rootBoundary,l=void 0===u?H:u,h=r.elementContext,m=void 0===h?T:h,v=r.altBoundary,y=void 0!==v&&v,g=r.padding,b=void 0===g?0:g,x=Y("number"!=typeof b?b:G(b,k)),w=m===T?"reference":T,O=e.rects.popper,j=e.elements[y?w:m],E=F(n(j)?j:j.contextElement||d(e.elements.popper),c,l,s),P=p(e.elements.reference),M=X({reference:P,element:O,strategy:"absolute",placement:i}),W=I(Object.assign({},O,M)),B=m===T?W:P,R={top:E.top-B.top+x.top,bottom:B.bottom-E.bottom+x.bottom,left:E.left-B.left+x.left,right:B.right-E.right+x.right},S=e.modifiersData.offset;if(m===T&&S){var V=S[i];Object.keys(R).forEach((function(e){var t=[L,A].indexOf(e)>=0?1:-1,n=[D,A].indexOf(e)>=0?"y":"x";R[e]+=V[n]*t}))}return R}var K={placement:"bottom",modifiers:[],strategy:"absolute"};function Q(){for(var e=arguments.length,t=new Array(e),n=0;n=0?-1:1,i="function"==typeof n?n(Object.assign({},t,{placement:e})):n,a=i[0],s=i[1];return a=a||0,s=(s||0)*o,[P,L].indexOf(r)>=0?{x:s,y:a}:{x:a,y:s}}(n,t.rects,i),e}),{}),s=a[t.placement],f=s.x,c=s.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=f,t.modifiersData.popperOffsets.y+=c),t.modifiersData[r]=a}},se={left:"right",right:"left",bottom:"top",top:"bottom"};function fe(e){return e.replace(/left|right|bottom|top/g,(function(e){return se[e]}))}var ce={start:"end",end:"start"};function pe(e){return e.replace(/start|end/g,(function(e){return ce[e]}))}function ue(e,t){void 0===t&&(t={});var n=t,r=n.placement,o=n.boundary,i=n.rootBoundary,a=n.padding,s=n.flipVariations,f=n.allowedAutoPlacements,c=void 0===f?S:f,p=U(r),u=p?s?R:R.filter((function(e){return U(e)===p})):k,l=u.filter((function(e){return c.indexOf(e)>=0}));0===l.length&&(l=u);var d=l.reduce((function(t,n){return t[n]=J(e,{placement:n,boundary:o,rootBoundary:i,padding:a})[C(n)],t}),{});return Object.keys(d).sort((function(e,t){return d[e]-d[t]}))}var le={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var o=n.mainAxis,i=void 0===o||o,a=n.altAxis,s=void 0===a||a,f=n.fallbackPlacements,c=n.padding,p=n.boundary,u=n.rootBoundary,l=n.altBoundary,d=n.flipVariations,h=void 0===d||d,m=n.allowedAutoPlacements,v=t.options.placement,y=C(v),g=f||(y===v||!h?[fe(v)]:function(e){if(C(e)===M)return[];var t=fe(e);return[pe(e),t,pe(t)]}(v)),b=[v].concat(g).reduce((function(e,n){return e.concat(C(n)===M?ue(t,{placement:n,boundary:p,rootBoundary:u,padding:c,flipVariations:h,allowedAutoPlacements:m}):n)}),[]),x=t.rects.reference,w=t.rects.popper,O=new Map,j=!0,E=b[0],k=0;k=0,S=R?"width":"height",V=J(t,{placement:B,boundary:p,rootBoundary:u,altBoundary:l,padding:c}),q=R?T?L:P:T?A:D;x[S]>w[S]&&(q=fe(q));var N=fe(q),I=[];if(i&&I.push(V[H]<=0),s&&I.push(V[q]<=0,V[N]<=0),I.every((function(e){return e}))){E=B,j=!1;break}O.set(B,I)}if(j)for(var _=function(e){var t=b.find((function(t){var n=O.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return E=t,"break"},F=h?3:1;F>0;F--){if("break"===_(F))break}t.placement!==E&&(t.modifiersData[r]._skip=!0,t.placement=E,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function de(e,t,n){return i(e,a(t,n))}var he={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name,o=n.mainAxis,s=void 0===o||o,f=n.altAxis,c=void 0!==f&&f,p=n.boundary,u=n.rootBoundary,l=n.altBoundary,d=n.padding,h=n.tether,m=void 0===h||h,v=n.tetherOffset,y=void 0===v?0:v,b=J(t,{boundary:p,rootBoundary:u,padding:d,altBoundary:l}),x=C(t.placement),w=U(t.placement),O=!w,j=z(x),M="x"===j?"y":"x",k=t.modifiersData.popperOffsets,B=t.rects.reference,H=t.rects.popper,T="function"==typeof y?y(Object.assign({},t.rects,{placement:t.placement})):y,R="number"==typeof T?{mainAxis:T,altAxis:T}:Object.assign({mainAxis:0,altAxis:0},T),S=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,V={x:0,y:0};if(k){if(s){var q,N="y"===j?D:P,I="y"===j?A:L,_="y"===j?"height":"width",F=k[j],X=F+b[N],Y=F-b[I],G=m?-H[_]/2:0,K=w===W?B[_]:H[_],Q=w===W?-H[_]:-B[_],Z=t.elements.arrow,$=m&&Z?g(Z):{width:0,height:0},ee=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},te=ee[N],ne=ee[I],re=de(0,B[_],$[_]),oe=O?B[_]/2-G-re-te-R.mainAxis:K-re-te-R.mainAxis,ie=O?-B[_]/2+G+re+ne+R.mainAxis:Q+re+ne+R.mainAxis,ae=t.elements.arrow&&E(t.elements.arrow),se=ae?"y"===j?ae.clientTop||0:ae.clientLeft||0:0,fe=null!=(q=null==S?void 0:S[j])?q:0,ce=F+ie-fe,pe=de(m?a(X,F+oe-fe-se):X,F,m?i(Y,ce):Y);k[j]=pe,V[j]=pe-F}if(c){var ue,le="x"===j?D:P,he="x"===j?A:L,me=k[M],ve="y"===M?"height":"width",ye=me+b[le],ge=me-b[he],be=-1!==[D,P].indexOf(x),xe=null!=(ue=null==S?void 0:S[M])?ue:0,we=be?ye:me-B[ve]-H[ve]-xe+R.altAxis,Oe=be?me+B[ve]+H[ve]-xe-R.altAxis:ge,je=m&&be?function(e,t,n){var r=de(e,t,n);return r>n?n:r}(we,me,Oe):de(m?we:ye,me,m?Oe:ge);k[M]=je,V[M]=je-me}t.modifiersData[r]=V}},requiresIfExists:["offset"]};var me={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,r=e.name,o=e.options,i=n.elements.arrow,a=n.modifiersData.popperOffsets,s=C(n.placement),f=z(s),c=[P,L].indexOf(s)>=0?"height":"width";if(i&&a){var p=function(e,t){return Y("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:G(e,k))}(o.padding,n),u=g(i),l="y"===f?D:P,d="y"===f?A:L,h=n.rects.reference[c]+n.rects.reference[f]-a[f]-n.rects.popper[c],m=a[f]-n.rects.reference[f],v=E(i),y=v?"y"===f?v.clientHeight||0:v.clientWidth||0:0,b=h/2-m/2,x=p[l],w=y-u[c]-p[d],O=y/2-u[c]/2+b,j=de(x,O,w),M=f;n.modifiersData[r]=((t={})[M]=j,t.centerOffset=j-O,t)}},effect:function(e){var t=e.state,n=e.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!=typeof r||(r=t.elements.popper.querySelector(r)))&&N(t.elements.popper,r)&&(t.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function ve(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function ye(e){return[D,L,A,P].some((function(t){return e[t]>=0}))}var ge={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,r=t.rects.reference,o=t.rects.popper,i=t.modifiersData.preventOverflow,a=J(t,{elementContext:"reference"}),s=J(t,{altBoundary:!0}),f=ve(a,r),c=ve(s,o,i),p=ye(f),u=ye(c);t.modifiersData[n]={referenceClippingOffsets:f,popperEscapeOffsets:c,isReferenceHidden:p,hasPopperEscaped:u},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":p,"data-popper-escaped":u})}},be=Z({defaultModifiers:[ee,te,oe,ie]}),xe=[ee,te,oe,ie,ae,le,he,me,ge],we=Z({defaultModifiers:xe});e.applyStyles=ie,e.arrow=me,e.computeStyles=oe,e.createPopper=we,e.createPopperLite=be,e.defaultModifiers=xe,e.detectOverflow=J,e.eventListeners=ee,e.flip=le,e.hide=ge,e.offset=ae,e.popperGenerator=Z,e.popperOffsets=te,e.preventOverflow=he,Object.defineProperty(e,"__esModule",{value:!0})})); 6 | 7 | -------------------------------------------------------------------------------- /README_files/libs/quarto-html/quarto-syntax-highlighting.css: -------------------------------------------------------------------------------- 1 | /* quarto syntax highlight colors */ 2 | :root { 3 | --quarto-hl-ot-color: #003B4F; 4 | --quarto-hl-at-color: #657422; 5 | --quarto-hl-ss-color: #20794D; 6 | --quarto-hl-an-color: #5E5E5E; 7 | --quarto-hl-fu-color: #4758AB; 8 | --quarto-hl-st-color: #20794D; 9 | --quarto-hl-cf-color: #003B4F; 10 | --quarto-hl-op-color: #5E5E5E; 11 | --quarto-hl-er-color: #AD0000; 12 | --quarto-hl-bn-color: #AD0000; 13 | --quarto-hl-al-color: #AD0000; 14 | --quarto-hl-va-color: #111111; 15 | --quarto-hl-bu-color: inherit; 16 | --quarto-hl-ex-color: inherit; 17 | --quarto-hl-pp-color: #AD0000; 18 | --quarto-hl-in-color: #5E5E5E; 19 | --quarto-hl-vs-color: #20794D; 20 | --quarto-hl-wa-color: #5E5E5E; 21 | --quarto-hl-do-color: #5E5E5E; 22 | --quarto-hl-im-color: #00769E; 23 | --quarto-hl-ch-color: #20794D; 24 | --quarto-hl-dt-color: #AD0000; 25 | --quarto-hl-fl-color: #AD0000; 26 | --quarto-hl-co-color: #5E5E5E; 27 | --quarto-hl-cv-color: #5E5E5E; 28 | --quarto-hl-cn-color: #8f5902; 29 | --quarto-hl-sc-color: #5E5E5E; 30 | --quarto-hl-dv-color: #AD0000; 31 | --quarto-hl-kw-color: #003B4F; 32 | } 33 | 34 | /* other quarto variables */ 35 | :root { 36 | --quarto-font-monospace: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; 37 | } 38 | 39 | pre > code.sourceCode > span { 40 | color: #003B4F; 41 | } 42 | 43 | code span { 44 | color: #003B4F; 45 | } 46 | 47 | code.sourceCode > span { 48 | color: #003B4F; 49 | } 50 | 51 | div.sourceCode, 52 | div.sourceCode pre.sourceCode { 53 | color: #003B4F; 54 | } 55 | 56 | code span.ot { 57 | color: #003B4F; 58 | font-style: inherit; 59 | } 60 | 61 | code span.at { 62 | color: #657422; 63 | font-style: inherit; 64 | } 65 | 66 | code span.ss { 67 | color: #20794D; 68 | font-style: inherit; 69 | } 70 | 71 | code span.an { 72 | color: #5E5E5E; 73 | font-style: inherit; 74 | } 75 | 76 | code span.fu { 77 | color: #4758AB; 78 | font-style: inherit; 79 | } 80 | 81 | code span.st { 82 | color: #20794D; 83 | font-style: inherit; 84 | } 85 | 86 | code span.cf { 87 | color: #003B4F; 88 | font-weight: bold; 89 | font-style: inherit; 90 | } 91 | 92 | code span.op { 93 | color: #5E5E5E; 94 | font-style: inherit; 95 | } 96 | 97 | code span.er { 98 | color: #AD0000; 99 | font-style: inherit; 100 | } 101 | 102 | code span.bn { 103 | color: #AD0000; 104 | font-style: inherit; 105 | } 106 | 107 | code span.al { 108 | color: #AD0000; 109 | font-style: inherit; 110 | } 111 | 112 | code span.va { 113 | color: #111111; 114 | font-style: inherit; 115 | } 116 | 117 | code span.bu { 118 | font-style: inherit; 119 | } 120 | 121 | code span.ex { 122 | font-style: inherit; 123 | } 124 | 125 | code span.pp { 126 | color: #AD0000; 127 | font-style: inherit; 128 | } 129 | 130 | code span.in { 131 | color: #5E5E5E; 132 | font-style: inherit; 133 | } 134 | 135 | code span.vs { 136 | color: #20794D; 137 | font-style: inherit; 138 | } 139 | 140 | code span.wa { 141 | color: #5E5E5E; 142 | font-style: italic; 143 | } 144 | 145 | code span.do { 146 | color: #5E5E5E; 147 | font-style: italic; 148 | } 149 | 150 | code span.im { 151 | color: #00769E; 152 | font-style: inherit; 153 | } 154 | 155 | code span.ch { 156 | color: #20794D; 157 | font-style: inherit; 158 | } 159 | 160 | code span.dt { 161 | color: #AD0000; 162 | font-style: inherit; 163 | } 164 | 165 | code span.fl { 166 | color: #AD0000; 167 | font-style: inherit; 168 | } 169 | 170 | code span.co { 171 | color: #5E5E5E; 172 | font-style: inherit; 173 | } 174 | 175 | code span.cv { 176 | color: #5E5E5E; 177 | font-style: italic; 178 | } 179 | 180 | code span.cn { 181 | color: #8f5902; 182 | font-style: inherit; 183 | } 184 | 185 | code span.sc { 186 | color: #5E5E5E; 187 | font-style: inherit; 188 | } 189 | 190 | code span.dv { 191 | color: #AD0000; 192 | font-style: inherit; 193 | } 194 | 195 | code span.kw { 196 | color: #003B4F; 197 | font-weight: bold; 198 | font-style: inherit; 199 | } 200 | 201 | .prevent-inlining { 202 | content: " { 9 | // Find any conflicting margin elements and add margins to the 10 | // top to prevent overlap 11 | const marginChildren = window.document.querySelectorAll( 12 | ".column-margin.column-container > *, .margin-caption, .aside" 13 | ); 14 | 15 | let lastBottom = 0; 16 | for (const marginChild of marginChildren) { 17 | if (marginChild.offsetParent !== null) { 18 | // clear the top margin so we recompute it 19 | marginChild.style.marginTop = null; 20 | const top = marginChild.getBoundingClientRect().top + window.scrollY; 21 | if (top < lastBottom) { 22 | const marginChildStyle = window.getComputedStyle(marginChild); 23 | const marginBottom = parseFloat(marginChildStyle["marginBottom"]); 24 | const margin = lastBottom - top + marginBottom; 25 | marginChild.style.marginTop = `${margin}px`; 26 | } 27 | const styles = window.getComputedStyle(marginChild); 28 | const marginTop = parseFloat(styles["marginTop"]); 29 | lastBottom = top + marginChild.getBoundingClientRect().height + marginTop; 30 | } 31 | } 32 | }; 33 | 34 | window.document.addEventListener("DOMContentLoaded", function (_event) { 35 | // Recompute the position of margin elements anytime the body size changes 36 | if (window.ResizeObserver) { 37 | const resizeObserver = new window.ResizeObserver( 38 | throttle(() => { 39 | layoutMarginEls(); 40 | if ( 41 | window.document.body.getBoundingClientRect().width < 990 && 42 | isReaderMode() 43 | ) { 44 | quartoToggleReader(); 45 | } 46 | }, 50) 47 | ); 48 | resizeObserver.observe(window.document.body); 49 | } 50 | 51 | const tocEl = window.document.querySelector('nav.toc-active[role="doc-toc"]'); 52 | const sidebarEl = window.document.getElementById("quarto-sidebar"); 53 | const leftTocEl = window.document.getElementById("quarto-sidebar-toc-left"); 54 | const marginSidebarEl = window.document.getElementById( 55 | "quarto-margin-sidebar" 56 | ); 57 | // function to determine whether the element has a previous sibling that is active 58 | const prevSiblingIsActiveLink = (el) => { 59 | const sibling = el.previousElementSibling; 60 | if (sibling && sibling.tagName === "A") { 61 | return sibling.classList.contains("active"); 62 | } else { 63 | return false; 64 | } 65 | }; 66 | 67 | // fire slideEnter for bootstrap tab activations (for htmlwidget resize behavior) 68 | function fireSlideEnter(e) { 69 | const event = window.document.createEvent("Event"); 70 | event.initEvent("slideenter", true, true); 71 | window.document.dispatchEvent(event); 72 | } 73 | const tabs = window.document.querySelectorAll('a[data-bs-toggle="tab"]'); 74 | tabs.forEach((tab) => { 75 | tab.addEventListener("shown.bs.tab", fireSlideEnter); 76 | }); 77 | 78 | // fire slideEnter for tabby tab activations (for htmlwidget resize behavior) 79 | document.addEventListener("tabby", fireSlideEnter, false); 80 | 81 | // Track scrolling and mark TOC links as active 82 | // get table of contents and sidebar (bail if we don't have at least one) 83 | const tocLinks = tocEl 84 | ? [...tocEl.querySelectorAll("a[data-scroll-target]")] 85 | : []; 86 | const makeActive = (link) => tocLinks[link].classList.add("active"); 87 | const removeActive = (link) => tocLinks[link].classList.remove("active"); 88 | const removeAllActive = () => 89 | [...Array(tocLinks.length).keys()].forEach((link) => removeActive(link)); 90 | 91 | // activate the anchor for a section associated with this TOC entry 92 | tocLinks.forEach((link) => { 93 | link.addEventListener("click", () => { 94 | if (link.href.indexOf("#") !== -1) { 95 | const anchor = link.href.split("#")[1]; 96 | const heading = window.document.querySelector( 97 | `[data-anchor-id="${anchor}"]` 98 | ); 99 | if (heading) { 100 | // Add the class 101 | heading.classList.add("reveal-anchorjs-link"); 102 | 103 | // function to show the anchor 104 | const handleMouseout = () => { 105 | heading.classList.remove("reveal-anchorjs-link"); 106 | heading.removeEventListener("mouseout", handleMouseout); 107 | }; 108 | 109 | // add a function to clear the anchor when the user mouses out of it 110 | heading.addEventListener("mouseout", handleMouseout); 111 | } 112 | } 113 | }); 114 | }); 115 | 116 | const sections = tocLinks.map((link) => { 117 | const target = link.getAttribute("data-scroll-target"); 118 | if (target.startsWith("#")) { 119 | return window.document.getElementById(decodeURI(`${target.slice(1)}`)); 120 | } else { 121 | return window.document.querySelector(decodeURI(`${target}`)); 122 | } 123 | }); 124 | 125 | const sectionMargin = 200; 126 | let currentActive = 0; 127 | // track whether we've initialized state the first time 128 | let init = false; 129 | 130 | const updateActiveLink = () => { 131 | // The index from bottom to top (e.g. reversed list) 132 | let sectionIndex = -1; 133 | if ( 134 | window.innerHeight + window.pageYOffset >= 135 | window.document.body.offsetHeight 136 | ) { 137 | // This is the no-scroll case where last section should be the active one 138 | sectionIndex = 0; 139 | } else { 140 | // This finds the last section visible on screen that should be made active 141 | sectionIndex = [...sections].reverse().findIndex((section) => { 142 | if (section) { 143 | return window.pageYOffset >= section.offsetTop - sectionMargin; 144 | } else { 145 | return false; 146 | } 147 | }); 148 | } 149 | if (sectionIndex > -1) { 150 | const current = sections.length - sectionIndex - 1; 151 | if (current !== currentActive) { 152 | removeAllActive(); 153 | currentActive = current; 154 | makeActive(current); 155 | if (init) { 156 | window.dispatchEvent(sectionChanged); 157 | } 158 | init = true; 159 | } 160 | } 161 | }; 162 | 163 | const inHiddenRegion = (top, bottom, hiddenRegions) => { 164 | for (const region of hiddenRegions) { 165 | if (top <= region.bottom && bottom >= region.top) { 166 | return true; 167 | } 168 | } 169 | return false; 170 | }; 171 | 172 | const categorySelector = "header.quarto-title-block .quarto-category"; 173 | const activateCategories = (href) => { 174 | // Find any categories 175 | // Surround them with a link pointing back to: 176 | // #category=Authoring 177 | try { 178 | const categoryEls = window.document.querySelectorAll(categorySelector); 179 | for (const categoryEl of categoryEls) { 180 | const categoryText = categoryEl.textContent; 181 | if (categoryText) { 182 | const link = `${href}#category=${encodeURIComponent(categoryText)}`; 183 | const linkEl = window.document.createElement("a"); 184 | linkEl.setAttribute("href", link); 185 | for (const child of categoryEl.childNodes) { 186 | linkEl.append(child); 187 | } 188 | categoryEl.appendChild(linkEl); 189 | } 190 | } 191 | } catch { 192 | // Ignore errors 193 | } 194 | }; 195 | function hasTitleCategories() { 196 | return window.document.querySelector(categorySelector) !== null; 197 | } 198 | 199 | function offsetRelativeUrl(url) { 200 | const offset = getMeta("quarto:offset"); 201 | return offset ? offset + url : url; 202 | } 203 | 204 | function offsetAbsoluteUrl(url) { 205 | const offset = getMeta("quarto:offset"); 206 | const baseUrl = new URL(offset, window.location); 207 | 208 | const projRelativeUrl = url.replace(baseUrl, ""); 209 | if (projRelativeUrl.startsWith("/")) { 210 | return projRelativeUrl; 211 | } else { 212 | return "/" + projRelativeUrl; 213 | } 214 | } 215 | 216 | // read a meta tag value 217 | function getMeta(metaName) { 218 | const metas = window.document.getElementsByTagName("meta"); 219 | for (let i = 0; i < metas.length; i++) { 220 | if (metas[i].getAttribute("name") === metaName) { 221 | return metas[i].getAttribute("content"); 222 | } 223 | } 224 | return ""; 225 | } 226 | 227 | async function findAndActivateCategories() { 228 | const currentPagePath = offsetAbsoluteUrl(window.location.href); 229 | const response = await fetch(offsetRelativeUrl("listings.json")); 230 | if (response.status == 200) { 231 | return response.json().then(function (listingPaths) { 232 | const listingHrefs = []; 233 | for (const listingPath of listingPaths) { 234 | const pathWithoutLeadingSlash = listingPath.listing.substring(1); 235 | for (const item of listingPath.items) { 236 | if ( 237 | item === currentPagePath || 238 | item === currentPagePath + "index.html" 239 | ) { 240 | // Resolve this path against the offset to be sure 241 | // we already are using the correct path to the listing 242 | // (this adjusts the listing urls to be rooted against 243 | // whatever root the page is actually running against) 244 | const relative = offsetRelativeUrl(pathWithoutLeadingSlash); 245 | const baseUrl = window.location; 246 | const resolvedPath = new URL(relative, baseUrl); 247 | listingHrefs.push(resolvedPath.pathname); 248 | break; 249 | } 250 | } 251 | } 252 | 253 | // Look up the tree for a nearby linting and use that if we find one 254 | const nearestListing = findNearestParentListing( 255 | offsetAbsoluteUrl(window.location.pathname), 256 | listingHrefs 257 | ); 258 | if (nearestListing) { 259 | activateCategories(nearestListing); 260 | } else { 261 | // See if the referrer is a listing page for this item 262 | const referredRelativePath = offsetAbsoluteUrl(document.referrer); 263 | const referrerListing = listingHrefs.find((listingHref) => { 264 | const isListingReferrer = 265 | listingHref === referredRelativePath || 266 | listingHref === referredRelativePath + "index.html"; 267 | return isListingReferrer; 268 | }); 269 | 270 | if (referrerListing) { 271 | // Try to use the referrer if possible 272 | activateCategories(referrerListing); 273 | } else if (listingHrefs.length > 0) { 274 | // Otherwise, just fall back to the first listing 275 | activateCategories(listingHrefs[0]); 276 | } 277 | } 278 | }); 279 | } 280 | } 281 | if (hasTitleCategories()) { 282 | findAndActivateCategories(); 283 | } 284 | 285 | const findNearestParentListing = (href, listingHrefs) => { 286 | if (!href || !listingHrefs) { 287 | return undefined; 288 | } 289 | // Look up the tree for a nearby linting and use that if we find one 290 | const relativeParts = href.substring(1).split("/"); 291 | while (relativeParts.length > 0) { 292 | const path = relativeParts.join("/"); 293 | for (const listingHref of listingHrefs) { 294 | if (listingHref.startsWith(path)) { 295 | return listingHref; 296 | } 297 | } 298 | relativeParts.pop(); 299 | } 300 | 301 | return undefined; 302 | }; 303 | 304 | const manageSidebarVisiblity = (el, placeholderDescriptor) => { 305 | let isVisible = true; 306 | let elRect; 307 | 308 | return (hiddenRegions) => { 309 | if (el === null) { 310 | return; 311 | } 312 | 313 | // Find the last element of the TOC 314 | const lastChildEl = el.lastElementChild; 315 | 316 | if (lastChildEl) { 317 | // Converts the sidebar to a menu 318 | const convertToMenu = () => { 319 | for (const child of el.children) { 320 | child.style.opacity = 0; 321 | child.style.overflow = "hidden"; 322 | child.style.pointerEvents = "none"; 323 | } 324 | 325 | nexttick(() => { 326 | const toggleContainer = window.document.createElement("div"); 327 | toggleContainer.style.width = "100%"; 328 | toggleContainer.classList.add("zindex-over-content"); 329 | toggleContainer.classList.add("quarto-sidebar-toggle"); 330 | toggleContainer.classList.add("headroom-target"); // Marks this to be managed by headeroom 331 | toggleContainer.id = placeholderDescriptor.id; 332 | toggleContainer.style.position = "fixed"; 333 | 334 | const toggleIcon = window.document.createElement("i"); 335 | toggleIcon.classList.add("quarto-sidebar-toggle-icon"); 336 | toggleIcon.classList.add("bi"); 337 | toggleIcon.classList.add("bi-caret-down-fill"); 338 | 339 | const toggleTitle = window.document.createElement("div"); 340 | const titleEl = window.document.body.querySelector( 341 | placeholderDescriptor.titleSelector 342 | ); 343 | if (titleEl) { 344 | toggleTitle.append( 345 | titleEl.textContent || titleEl.innerText, 346 | toggleIcon 347 | ); 348 | } 349 | toggleTitle.classList.add("zindex-over-content"); 350 | toggleTitle.classList.add("quarto-sidebar-toggle-title"); 351 | toggleContainer.append(toggleTitle); 352 | 353 | const toggleContents = window.document.createElement("div"); 354 | toggleContents.classList = el.classList; 355 | toggleContents.classList.add("zindex-over-content"); 356 | toggleContents.classList.add("quarto-sidebar-toggle-contents"); 357 | for (const child of el.children) { 358 | if (child.id === "toc-title") { 359 | continue; 360 | } 361 | 362 | const clone = child.cloneNode(true); 363 | clone.style.opacity = 1; 364 | clone.style.pointerEvents = null; 365 | clone.style.display = null; 366 | toggleContents.append(clone); 367 | } 368 | toggleContents.style.height = "0px"; 369 | const positionToggle = () => { 370 | // position the element (top left of parent, same width as parent) 371 | if (!elRect) { 372 | elRect = el.getBoundingClientRect(); 373 | } 374 | toggleContainer.style.left = `${elRect.left}px`; 375 | toggleContainer.style.top = `${elRect.top}px`; 376 | toggleContainer.style.width = `${elRect.width}px`; 377 | }; 378 | positionToggle(); 379 | 380 | toggleContainer.append(toggleContents); 381 | el.parentElement.prepend(toggleContainer); 382 | 383 | // Process clicks 384 | let tocShowing = false; 385 | // Allow the caller to control whether this is dismissed 386 | // when it is clicked (e.g. sidebar navigation supports 387 | // opening and closing the nav tree, so don't dismiss on click) 388 | const clickEl = placeholderDescriptor.dismissOnClick 389 | ? toggleContainer 390 | : toggleTitle; 391 | 392 | const closeToggle = () => { 393 | if (tocShowing) { 394 | toggleContainer.classList.remove("expanded"); 395 | toggleContents.style.height = "0px"; 396 | tocShowing = false; 397 | } 398 | }; 399 | 400 | // Get rid of any expanded toggle if the user scrolls 401 | window.document.addEventListener( 402 | "scroll", 403 | throttle(() => { 404 | closeToggle(); 405 | }, 50) 406 | ); 407 | 408 | // Handle positioning of the toggle 409 | window.addEventListener( 410 | "resize", 411 | throttle(() => { 412 | elRect = undefined; 413 | positionToggle(); 414 | }, 50) 415 | ); 416 | 417 | window.addEventListener("quarto-hrChanged", () => { 418 | elRect = undefined; 419 | }); 420 | 421 | // Process the click 422 | clickEl.onclick = () => { 423 | if (!tocShowing) { 424 | toggleContainer.classList.add("expanded"); 425 | toggleContents.style.height = null; 426 | tocShowing = true; 427 | } else { 428 | closeToggle(); 429 | } 430 | }; 431 | }); 432 | }; 433 | 434 | // Converts a sidebar from a menu back to a sidebar 435 | const convertToSidebar = () => { 436 | for (const child of el.children) { 437 | child.style.opacity = 1; 438 | child.style.overflow = null; 439 | child.style.pointerEvents = null; 440 | } 441 | 442 | const placeholderEl = window.document.getElementById( 443 | placeholderDescriptor.id 444 | ); 445 | if (placeholderEl) { 446 | placeholderEl.remove(); 447 | } 448 | 449 | el.classList.remove("rollup"); 450 | }; 451 | 452 | if (isReaderMode()) { 453 | convertToMenu(); 454 | isVisible = false; 455 | } else { 456 | // Find the top and bottom o the element that is being managed 457 | const elTop = el.offsetTop; 458 | const elBottom = 459 | elTop + lastChildEl.offsetTop + lastChildEl.offsetHeight; 460 | 461 | if (!isVisible) { 462 | // If the element is current not visible reveal if there are 463 | // no conflicts with overlay regions 464 | if (!inHiddenRegion(elTop, elBottom, hiddenRegions)) { 465 | convertToSidebar(); 466 | isVisible = true; 467 | } 468 | } else { 469 | // If the element is visible, hide it if it conflicts with overlay regions 470 | // and insert a placeholder toggle (or if we're in reader mode) 471 | if (inHiddenRegion(elTop, elBottom, hiddenRegions)) { 472 | convertToMenu(); 473 | isVisible = false; 474 | } 475 | } 476 | } 477 | } 478 | }; 479 | }; 480 | 481 | const tabEls = document.querySelectorAll('a[data-bs-toggle="tab"]'); 482 | for (const tabEl of tabEls) { 483 | const id = tabEl.getAttribute("data-bs-target"); 484 | if (id) { 485 | const columnEl = document.querySelector( 486 | `${id} .column-margin, .tabset-margin-content` 487 | ); 488 | if (columnEl) 489 | tabEl.addEventListener("shown.bs.tab", function (event) { 490 | const el = event.srcElement; 491 | if (el) { 492 | const visibleCls = `${el.id}-margin-content`; 493 | // walk up until we find a parent tabset 494 | let panelTabsetEl = el.parentElement; 495 | while (panelTabsetEl) { 496 | if (panelTabsetEl.classList.contains("panel-tabset")) { 497 | break; 498 | } 499 | panelTabsetEl = panelTabsetEl.parentElement; 500 | } 501 | 502 | if (panelTabsetEl) { 503 | const prevSib = panelTabsetEl.previousElementSibling; 504 | if ( 505 | prevSib && 506 | prevSib.classList.contains("tabset-margin-container") 507 | ) { 508 | const childNodes = prevSib.querySelectorAll( 509 | ".tabset-margin-content" 510 | ); 511 | for (const childEl of childNodes) { 512 | if (childEl.classList.contains(visibleCls)) { 513 | childEl.classList.remove("collapse"); 514 | } else { 515 | childEl.classList.add("collapse"); 516 | } 517 | } 518 | } 519 | } 520 | } 521 | 522 | layoutMarginEls(); 523 | }); 524 | } 525 | } 526 | 527 | // Manage the visibility of the toc and the sidebar 528 | const marginScrollVisibility = manageSidebarVisiblity(marginSidebarEl, { 529 | id: "quarto-toc-toggle", 530 | titleSelector: "#toc-title", 531 | dismissOnClick: true, 532 | }); 533 | const sidebarScrollVisiblity = manageSidebarVisiblity(sidebarEl, { 534 | id: "quarto-sidebarnav-toggle", 535 | titleSelector: ".title", 536 | dismissOnClick: false, 537 | }); 538 | let tocLeftScrollVisibility; 539 | if (leftTocEl) { 540 | tocLeftScrollVisibility = manageSidebarVisiblity(leftTocEl, { 541 | id: "quarto-lefttoc-toggle", 542 | titleSelector: "#toc-title", 543 | dismissOnClick: true, 544 | }); 545 | } 546 | 547 | // Find the first element that uses formatting in special columns 548 | const conflictingEls = window.document.body.querySelectorAll( 549 | '[class^="column-"], [class*=" column-"], aside, [class*="margin-caption"], [class*=" margin-caption"], [class*="margin-ref"], [class*=" margin-ref"]' 550 | ); 551 | 552 | // Filter all the possibly conflicting elements into ones 553 | // the do conflict on the left or ride side 554 | const arrConflictingEls = Array.from(conflictingEls); 555 | const leftSideConflictEls = arrConflictingEls.filter((el) => { 556 | if (el.tagName === "ASIDE") { 557 | return false; 558 | } 559 | return Array.from(el.classList).find((className) => { 560 | return ( 561 | className !== "column-body" && 562 | className.startsWith("column-") && 563 | !className.endsWith("right") && 564 | !className.endsWith("container") && 565 | className !== "column-margin" 566 | ); 567 | }); 568 | }); 569 | const rightSideConflictEls = arrConflictingEls.filter((el) => { 570 | if (el.tagName === "ASIDE") { 571 | return true; 572 | } 573 | 574 | const hasMarginCaption = Array.from(el.classList).find((className) => { 575 | return className == "margin-caption"; 576 | }); 577 | if (hasMarginCaption) { 578 | return true; 579 | } 580 | 581 | return Array.from(el.classList).find((className) => { 582 | return ( 583 | className !== "column-body" && 584 | !className.endsWith("container") && 585 | className.startsWith("column-") && 586 | !className.endsWith("left") 587 | ); 588 | }); 589 | }); 590 | 591 | const kOverlapPaddingSize = 10; 592 | function toRegions(els) { 593 | return els.map((el) => { 594 | const boundRect = el.getBoundingClientRect(); 595 | const top = 596 | boundRect.top + 597 | document.documentElement.scrollTop - 598 | kOverlapPaddingSize; 599 | return { 600 | top, 601 | bottom: top + el.scrollHeight + 2 * kOverlapPaddingSize, 602 | }; 603 | }); 604 | } 605 | 606 | let hasObserved = false; 607 | const visibleItemObserver = (els) => { 608 | let visibleElements = [...els]; 609 | const intersectionObserver = new IntersectionObserver( 610 | (entries, _observer) => { 611 | entries.forEach((entry) => { 612 | if (entry.isIntersecting) { 613 | if (visibleElements.indexOf(entry.target) === -1) { 614 | visibleElements.push(entry.target); 615 | } 616 | } else { 617 | visibleElements = visibleElements.filter((visibleEntry) => { 618 | return visibleEntry !== entry; 619 | }); 620 | } 621 | }); 622 | 623 | if (!hasObserved) { 624 | hideOverlappedSidebars(); 625 | } 626 | hasObserved = true; 627 | }, 628 | {} 629 | ); 630 | els.forEach((el) => { 631 | intersectionObserver.observe(el); 632 | }); 633 | 634 | return { 635 | getVisibleEntries: () => { 636 | return visibleElements; 637 | }, 638 | }; 639 | }; 640 | 641 | const rightElementObserver = visibleItemObserver(rightSideConflictEls); 642 | const leftElementObserver = visibleItemObserver(leftSideConflictEls); 643 | 644 | const hideOverlappedSidebars = () => { 645 | marginScrollVisibility(toRegions(rightElementObserver.getVisibleEntries())); 646 | sidebarScrollVisiblity(toRegions(leftElementObserver.getVisibleEntries())); 647 | if (tocLeftScrollVisibility) { 648 | tocLeftScrollVisibility( 649 | toRegions(leftElementObserver.getVisibleEntries()) 650 | ); 651 | } 652 | }; 653 | 654 | window.quartoToggleReader = () => { 655 | // Applies a slow class (or removes it) 656 | // to update the transition speed 657 | const slowTransition = (slow) => { 658 | const manageTransition = (id, slow) => { 659 | const el = document.getElementById(id); 660 | if (el) { 661 | if (slow) { 662 | el.classList.add("slow"); 663 | } else { 664 | el.classList.remove("slow"); 665 | } 666 | } 667 | }; 668 | 669 | manageTransition("TOC", slow); 670 | manageTransition("quarto-sidebar", slow); 671 | }; 672 | const readerMode = !isReaderMode(); 673 | setReaderModeValue(readerMode); 674 | 675 | // If we're entering reader mode, slow the transition 676 | if (readerMode) { 677 | slowTransition(readerMode); 678 | } 679 | highlightReaderToggle(readerMode); 680 | hideOverlappedSidebars(); 681 | 682 | // If we're exiting reader mode, restore the non-slow transition 683 | if (!readerMode) { 684 | slowTransition(!readerMode); 685 | } 686 | }; 687 | 688 | const highlightReaderToggle = (readerMode) => { 689 | const els = document.querySelectorAll(".quarto-reader-toggle"); 690 | if (els) { 691 | els.forEach((el) => { 692 | if (readerMode) { 693 | el.classList.add("reader"); 694 | } else { 695 | el.classList.remove("reader"); 696 | } 697 | }); 698 | } 699 | }; 700 | 701 | const setReaderModeValue = (val) => { 702 | if (window.location.protocol !== "file:") { 703 | window.localStorage.setItem("quarto-reader-mode", val); 704 | } else { 705 | localReaderMode = val; 706 | } 707 | }; 708 | 709 | const isReaderMode = () => { 710 | if (window.location.protocol !== "file:") { 711 | return window.localStorage.getItem("quarto-reader-mode") === "true"; 712 | } else { 713 | return localReaderMode; 714 | } 715 | }; 716 | let localReaderMode = null; 717 | 718 | const tocOpenDepthStr = tocEl?.getAttribute("data-toc-expanded"); 719 | const tocOpenDepth = tocOpenDepthStr ? Number(tocOpenDepthStr) : 1; 720 | 721 | // Walk the TOC and collapse/expand nodes 722 | // Nodes are expanded if: 723 | // - they are top level 724 | // - they have children that are 'active' links 725 | // - they are directly below an link that is 'active' 726 | const walk = (el, depth) => { 727 | // Tick depth when we enter a UL 728 | if (el.tagName === "UL") { 729 | depth = depth + 1; 730 | } 731 | 732 | // It this is active link 733 | let isActiveNode = false; 734 | if (el.tagName === "A" && el.classList.contains("active")) { 735 | isActiveNode = true; 736 | } 737 | 738 | // See if there is an active child to this element 739 | let hasActiveChild = false; 740 | for (child of el.children) { 741 | hasActiveChild = walk(child, depth) || hasActiveChild; 742 | } 743 | 744 | // Process the collapse state if this is an UL 745 | if (el.tagName === "UL") { 746 | if (tocOpenDepth === -1 && depth > 1) { 747 | // toc-expand: false 748 | el.classList.add("collapse"); 749 | } else if ( 750 | depth <= tocOpenDepth || 751 | hasActiveChild || 752 | prevSiblingIsActiveLink(el) 753 | ) { 754 | el.classList.remove("collapse"); 755 | } else { 756 | el.classList.add("collapse"); 757 | } 758 | 759 | // untick depth when we leave a UL 760 | depth = depth - 1; 761 | } 762 | return hasActiveChild || isActiveNode; 763 | }; 764 | 765 | // walk the TOC and expand / collapse any items that should be shown 766 | if (tocEl) { 767 | updateActiveLink(); 768 | walk(tocEl, 0); 769 | } 770 | 771 | // Throttle the scroll event and walk peridiocally 772 | window.document.addEventListener( 773 | "scroll", 774 | throttle(() => { 775 | if (tocEl) { 776 | updateActiveLink(); 777 | walk(tocEl, 0); 778 | } 779 | if (!isReaderMode()) { 780 | hideOverlappedSidebars(); 781 | } 782 | }, 5) 783 | ); 784 | window.addEventListener( 785 | "resize", 786 | throttle(() => { 787 | if (tocEl) { 788 | updateActiveLink(); 789 | walk(tocEl, 0); 790 | } 791 | if (!isReaderMode()) { 792 | hideOverlappedSidebars(); 793 | } 794 | }, 10) 795 | ); 796 | hideOverlappedSidebars(); 797 | highlightReaderToggle(isReaderMode()); 798 | }); 799 | 800 | // grouped tabsets 801 | window.addEventListener("pageshow", (_event) => { 802 | function getTabSettings() { 803 | const data = localStorage.getItem("quarto-persistent-tabsets-data"); 804 | if (!data) { 805 | localStorage.setItem("quarto-persistent-tabsets-data", "{}"); 806 | return {}; 807 | } 808 | if (data) { 809 | return JSON.parse(data); 810 | } 811 | } 812 | 813 | function setTabSettings(data) { 814 | localStorage.setItem( 815 | "quarto-persistent-tabsets-data", 816 | JSON.stringify(data) 817 | ); 818 | } 819 | 820 | function setTabState(groupName, groupValue) { 821 | const data = getTabSettings(); 822 | data[groupName] = groupValue; 823 | setTabSettings(data); 824 | } 825 | 826 | function toggleTab(tab, active) { 827 | const tabPanelId = tab.getAttribute("aria-controls"); 828 | const tabPanel = document.getElementById(tabPanelId); 829 | if (active) { 830 | tab.classList.add("active"); 831 | tabPanel.classList.add("active"); 832 | } else { 833 | tab.classList.remove("active"); 834 | tabPanel.classList.remove("active"); 835 | } 836 | } 837 | 838 | function toggleAll(selectedGroup, selectorsToSync) { 839 | for (const [thisGroup, tabs] of Object.entries(selectorsToSync)) { 840 | const active = selectedGroup === thisGroup; 841 | for (const tab of tabs) { 842 | toggleTab(tab, active); 843 | } 844 | } 845 | } 846 | 847 | function findSelectorsToSyncByLanguage() { 848 | const result = {}; 849 | const tabs = Array.from( 850 | document.querySelectorAll(`div[data-group] a[id^='tabset-']`) 851 | ); 852 | for (const item of tabs) { 853 | const div = item.parentElement.parentElement.parentElement; 854 | const group = div.getAttribute("data-group"); 855 | if (!result[group]) { 856 | result[group] = {}; 857 | } 858 | const selectorsToSync = result[group]; 859 | const value = item.innerHTML; 860 | if (!selectorsToSync[value]) { 861 | selectorsToSync[value] = []; 862 | } 863 | selectorsToSync[value].push(item); 864 | } 865 | return result; 866 | } 867 | 868 | function setupSelectorSync() { 869 | const selectorsToSync = findSelectorsToSyncByLanguage(); 870 | Object.entries(selectorsToSync).forEach(([group, tabSetsByValue]) => { 871 | Object.entries(tabSetsByValue).forEach(([value, items]) => { 872 | items.forEach((item) => { 873 | item.addEventListener("click", (_event) => { 874 | setTabState(group, value); 875 | toggleAll(value, selectorsToSync[group]); 876 | }); 877 | }); 878 | }); 879 | }); 880 | return selectorsToSync; 881 | } 882 | 883 | const selectorsToSync = setupSelectorSync(); 884 | for (const [group, selectedName] of Object.entries(getTabSettings())) { 885 | const selectors = selectorsToSync[group]; 886 | // it's possible that stale state gives us empty selections, so we explicitly check here. 887 | if (selectors) { 888 | toggleAll(selectedName, selectors); 889 | } 890 | } 891 | }); 892 | 893 | function throttle(func, wait) { 894 | let waiting = false; 895 | return function () { 896 | if (!waiting) { 897 | func.apply(this, arguments); 898 | waiting = true; 899 | setTimeout(function () { 900 | waiting = false; 901 | }, wait); 902 | } 903 | }; 904 | } 905 | 906 | function nexttick(func) { 907 | return setTimeout(func, 0); 908 | } 909 | -------------------------------------------------------------------------------- /README_files/libs/quarto-html/tippy.css: -------------------------------------------------------------------------------- 1 | .tippy-box[data-animation=fade][data-state=hidden]{opacity:0}[data-tippy-root]{max-width:calc(100vw - 10px)}.tippy-box{position:relative;background-color:#333;color:#fff;border-radius:4px;font-size:14px;line-height:1.4;white-space:normal;outline:0;transition-property:transform,visibility,opacity}.tippy-box[data-placement^=top]>.tippy-arrow{bottom:0}.tippy-box[data-placement^=top]>.tippy-arrow:before{bottom:-7px;left:0;border-width:8px 8px 0;border-top-color:initial;transform-origin:center top}.tippy-box[data-placement^=bottom]>.tippy-arrow{top:0}.tippy-box[data-placement^=bottom]>.tippy-arrow:before{top:-7px;left:0;border-width:0 8px 8px;border-bottom-color:initial;transform-origin:center bottom}.tippy-box[data-placement^=left]>.tippy-arrow{right:0}.tippy-box[data-placement^=left]>.tippy-arrow:before{border-width:8px 0 8px 8px;border-left-color:initial;right:-7px;transform-origin:center left}.tippy-box[data-placement^=right]>.tippy-arrow{left:0}.tippy-box[data-placement^=right]>.tippy-arrow:before{left:-7px;border-width:8px 8px 8px 0;border-right-color:initial;transform-origin:center right}.tippy-box[data-inertia][data-state=visible]{transition-timing-function:cubic-bezier(.54,1.5,.38,1.11)}.tippy-arrow{width:16px;height:16px;color:#333}.tippy-arrow:before{content:"";position:absolute;border-color:transparent;border-style:solid}.tippy-content{position:relative;padding:5px 9px;z-index:1} -------------------------------------------------------------------------------- /README_files/libs/quarto-html/tippy.umd.min.js: -------------------------------------------------------------------------------- 1 | !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("@popperjs/core")):"function"==typeof define&&define.amd?define(["@popperjs/core"],t):(e=e||self).tippy=t(e.Popper)}(this,(function(e){"use strict";var t={passive:!0,capture:!0},n=function(){return document.body};function r(e,t,n){if(Array.isArray(e)){var r=e[t];return null==r?Array.isArray(n)?n[t]:n:r}return e}function o(e,t){var n={}.toString.call(e);return 0===n.indexOf("[object")&&n.indexOf(t+"]")>-1}function i(e,t){return"function"==typeof e?e.apply(void 0,t):e}function a(e,t){return 0===t?e:function(r){clearTimeout(n),n=setTimeout((function(){e(r)}),t)};var n}function s(e,t){var n=Object.assign({},e);return t.forEach((function(e){delete n[e]})),n}function u(e){return[].concat(e)}function c(e,t){-1===e.indexOf(t)&&e.push(t)}function p(e){return e.split("-")[0]}function f(e){return[].slice.call(e)}function l(e){return Object.keys(e).reduce((function(t,n){return void 0!==e[n]&&(t[n]=e[n]),t}),{})}function d(){return document.createElement("div")}function v(e){return["Element","Fragment"].some((function(t){return o(e,t)}))}function m(e){return o(e,"MouseEvent")}function g(e){return!(!e||!e._tippy||e._tippy.reference!==e)}function h(e){return v(e)?[e]:function(e){return o(e,"NodeList")}(e)?f(e):Array.isArray(e)?e:f(document.querySelectorAll(e))}function b(e,t){e.forEach((function(e){e&&(e.style.transitionDuration=t+"ms")}))}function y(e,t){e.forEach((function(e){e&&e.setAttribute("data-state",t)}))}function w(e){var t,n=u(e)[0];return null!=n&&null!=(t=n.ownerDocument)&&t.body?n.ownerDocument:document}function E(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(t){e[r](t,n)}))}function O(e,t){for(var n=t;n;){var r;if(e.contains(n))return!0;n=null==n.getRootNode||null==(r=n.getRootNode())?void 0:r.host}return!1}var x={isTouch:!1},C=0;function T(){x.isTouch||(x.isTouch=!0,window.performance&&document.addEventListener("mousemove",A))}function A(){var e=performance.now();e-C<20&&(x.isTouch=!1,document.removeEventListener("mousemove",A)),C=e}function L(){var e=document.activeElement;if(g(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}var D=!!("undefined"!=typeof window&&"undefined"!=typeof document)&&!!window.msCrypto,R=Object.assign({appendTo:n,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},{animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),k=Object.keys(R);function P(e){var t=(e.plugins||[]).reduce((function(t,n){var r,o=n.name,i=n.defaultValue;o&&(t[o]=void 0!==e[o]?e[o]:null!=(r=R[o])?r:i);return t}),{});return Object.assign({},e,t)}function j(e,t){var n=Object.assign({},t,{content:i(t.content,[e])},t.ignoreAttributes?{}:function(e,t){return(t?Object.keys(P(Object.assign({},R,{plugins:t}))):k).reduce((function(t,n){var r=(e.getAttribute("data-tippy-"+n)||"").trim();if(!r)return t;if("content"===n)t[n]=r;else try{t[n]=JSON.parse(r)}catch(e){t[n]=r}return t}),{})}(e,t.plugins));return n.aria=Object.assign({},R.aria,n.aria),n.aria={expanded:"auto"===n.aria.expanded?t.interactive:n.aria.expanded,content:"auto"===n.aria.content?t.interactive?null:"describedby":n.aria.content},n}function M(e,t){e.innerHTML=t}function V(e){var t=d();return!0===e?t.className="tippy-arrow":(t.className="tippy-svg-arrow",v(e)?t.appendChild(e):M(t,e)),t}function I(e,t){v(t.content)?(M(e,""),e.appendChild(t.content)):"function"!=typeof t.content&&(t.allowHTML?M(e,t.content):e.textContent=t.content)}function S(e){var t=e.firstElementChild,n=f(t.children);return{box:t,content:n.find((function(e){return e.classList.contains("tippy-content")})),arrow:n.find((function(e){return e.classList.contains("tippy-arrow")||e.classList.contains("tippy-svg-arrow")})),backdrop:n.find((function(e){return e.classList.contains("tippy-backdrop")}))}}function N(e){var t=d(),n=d();n.className="tippy-box",n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=d();function o(n,r){var o=S(t),i=o.box,a=o.content,s=o.arrow;r.theme?i.setAttribute("data-theme",r.theme):i.removeAttribute("data-theme"),"string"==typeof r.animation?i.setAttribute("data-animation",r.animation):i.removeAttribute("data-animation"),r.inertia?i.setAttribute("data-inertia",""):i.removeAttribute("data-inertia"),i.style.maxWidth="number"==typeof r.maxWidth?r.maxWidth+"px":r.maxWidth,r.role?i.setAttribute("role",r.role):i.removeAttribute("role"),n.content===r.content&&n.allowHTML===r.allowHTML||I(a,e.props),r.arrow?s?n.arrow!==r.arrow&&(i.removeChild(s),i.appendChild(V(r.arrow))):i.appendChild(V(r.arrow)):s&&i.removeChild(s)}return r.className="tippy-content",r.setAttribute("data-state","hidden"),I(r,e.props),t.appendChild(n),n.appendChild(r),o(e.props,e.props),{popper:t,onUpdate:o}}N.$$tippy=!0;var B=1,H=[],U=[];function _(o,s){var v,g,h,C,T,A,L,k,M=j(o,Object.assign({},R,P(l(s)))),V=!1,I=!1,N=!1,_=!1,F=[],W=a(we,M.interactiveDebounce),X=B++,Y=(k=M.plugins).filter((function(e,t){return k.indexOf(e)===t})),$={id:X,reference:o,popper:d(),popperInstance:null,props:M,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:Y,clearDelayTimeouts:function(){clearTimeout(v),clearTimeout(g),cancelAnimationFrame(h)},setProps:function(e){if($.state.isDestroyed)return;ae("onBeforeUpdate",[$,e]),be();var t=$.props,n=j(o,Object.assign({},t,l(e),{ignoreAttributes:!0}));$.props=n,he(),t.interactiveDebounce!==n.interactiveDebounce&&(ce(),W=a(we,n.interactiveDebounce));t.triggerTarget&&!n.triggerTarget?u(t.triggerTarget).forEach((function(e){e.removeAttribute("aria-expanded")})):n.triggerTarget&&o.removeAttribute("aria-expanded");ue(),ie(),J&&J(t,n);$.popperInstance&&(Ce(),Ae().forEach((function(e){requestAnimationFrame(e._tippy.popperInstance.forceUpdate)})));ae("onAfterUpdate",[$,e])},setContent:function(e){$.setProps({content:e})},show:function(){var e=$.state.isVisible,t=$.state.isDestroyed,o=!$.state.isEnabled,a=x.isTouch&&!$.props.touch,s=r($.props.duration,0,R.duration);if(e||t||o||a)return;if(te().hasAttribute("disabled"))return;if(ae("onShow",[$],!1),!1===$.props.onShow($))return;$.state.isVisible=!0,ee()&&(z.style.visibility="visible");ie(),de(),$.state.isMounted||(z.style.transition="none");if(ee()){var u=re(),p=u.box,f=u.content;b([p,f],0)}A=function(){var e;if($.state.isVisible&&!_){if(_=!0,z.offsetHeight,z.style.transition=$.props.moveTransition,ee()&&$.props.animation){var t=re(),n=t.box,r=t.content;b([n,r],s),y([n,r],"visible")}se(),ue(),c(U,$),null==(e=$.popperInstance)||e.forceUpdate(),ae("onMount",[$]),$.props.animation&&ee()&&function(e,t){me(e,t)}(s,(function(){$.state.isShown=!0,ae("onShown",[$])}))}},function(){var e,t=$.props.appendTo,r=te();e=$.props.interactive&&t===n||"parent"===t?r.parentNode:i(t,[r]);e.contains(z)||e.appendChild(z);$.state.isMounted=!0,Ce()}()},hide:function(){var e=!$.state.isVisible,t=$.state.isDestroyed,n=!$.state.isEnabled,o=r($.props.duration,1,R.duration);if(e||t||n)return;if(ae("onHide",[$],!1),!1===$.props.onHide($))return;$.state.isVisible=!1,$.state.isShown=!1,_=!1,V=!1,ee()&&(z.style.visibility="hidden");if(ce(),ve(),ie(!0),ee()){var i=re(),a=i.box,s=i.content;$.props.animation&&(b([a,s],o),y([a,s],"hidden"))}se(),ue(),$.props.animation?ee()&&function(e,t){me(e,(function(){!$.state.isVisible&&z.parentNode&&z.parentNode.contains(z)&&t()}))}(o,$.unmount):$.unmount()},hideWithInteractivity:function(e){ne().addEventListener("mousemove",W),c(H,W),W(e)},enable:function(){$.state.isEnabled=!0},disable:function(){$.hide(),$.state.isEnabled=!1},unmount:function(){$.state.isVisible&&$.hide();if(!$.state.isMounted)return;Te(),Ae().forEach((function(e){e._tippy.unmount()})),z.parentNode&&z.parentNode.removeChild(z);U=U.filter((function(e){return e!==$})),$.state.isMounted=!1,ae("onHidden",[$])},destroy:function(){if($.state.isDestroyed)return;$.clearDelayTimeouts(),$.unmount(),be(),delete o._tippy,$.state.isDestroyed=!0,ae("onDestroy",[$])}};if(!M.render)return $;var q=M.render($),z=q.popper,J=q.onUpdate;z.setAttribute("data-tippy-root",""),z.id="tippy-"+$.id,$.popper=z,o._tippy=$,z._tippy=$;var G=Y.map((function(e){return e.fn($)})),K=o.hasAttribute("aria-expanded");return he(),ue(),ie(),ae("onCreate",[$]),M.showOnCreate&&Le(),z.addEventListener("mouseenter",(function(){$.props.interactive&&$.state.isVisible&&$.clearDelayTimeouts()})),z.addEventListener("mouseleave",(function(){$.props.interactive&&$.props.trigger.indexOf("mouseenter")>=0&&ne().addEventListener("mousemove",W)})),$;function Q(){var e=$.props.touch;return Array.isArray(e)?e:[e,0]}function Z(){return"hold"===Q()[0]}function ee(){var e;return!(null==(e=$.props.render)||!e.$$tippy)}function te(){return L||o}function ne(){var e=te().parentNode;return e?w(e):document}function re(){return S(z)}function oe(e){return $.state.isMounted&&!$.state.isVisible||x.isTouch||C&&"focus"===C.type?0:r($.props.delay,e?0:1,R.delay)}function ie(e){void 0===e&&(e=!1),z.style.pointerEvents=$.props.interactive&&!e?"":"none",z.style.zIndex=""+$.props.zIndex}function ae(e,t,n){var r;(void 0===n&&(n=!0),G.forEach((function(n){n[e]&&n[e].apply(n,t)})),n)&&(r=$.props)[e].apply(r,t)}function se(){var e=$.props.aria;if(e.content){var t="aria-"+e.content,n=z.id;u($.props.triggerTarget||o).forEach((function(e){var r=e.getAttribute(t);if($.state.isVisible)e.setAttribute(t,r?r+" "+n:n);else{var o=r&&r.replace(n,"").trim();o?e.setAttribute(t,o):e.removeAttribute(t)}}))}}function ue(){!K&&$.props.aria.expanded&&u($.props.triggerTarget||o).forEach((function(e){$.props.interactive?e.setAttribute("aria-expanded",$.state.isVisible&&e===te()?"true":"false"):e.removeAttribute("aria-expanded")}))}function ce(){ne().removeEventListener("mousemove",W),H=H.filter((function(e){return e!==W}))}function pe(e){if(!x.isTouch||!N&&"mousedown"!==e.type){var t=e.composedPath&&e.composedPath()[0]||e.target;if(!$.props.interactive||!O(z,t)){if(u($.props.triggerTarget||o).some((function(e){return O(e,t)}))){if(x.isTouch)return;if($.state.isVisible&&$.props.trigger.indexOf("click")>=0)return}else ae("onClickOutside",[$,e]);!0===$.props.hideOnClick&&($.clearDelayTimeouts(),$.hide(),I=!0,setTimeout((function(){I=!1})),$.state.isMounted||ve())}}}function fe(){N=!0}function le(){N=!1}function de(){var e=ne();e.addEventListener("mousedown",pe,!0),e.addEventListener("touchend",pe,t),e.addEventListener("touchstart",le,t),e.addEventListener("touchmove",fe,t)}function ve(){var e=ne();e.removeEventListener("mousedown",pe,!0),e.removeEventListener("touchend",pe,t),e.removeEventListener("touchstart",le,t),e.removeEventListener("touchmove",fe,t)}function me(e,t){var n=re().box;function r(e){e.target===n&&(E(n,"remove",r),t())}if(0===e)return t();E(n,"remove",T),E(n,"add",r),T=r}function ge(e,t,n){void 0===n&&(n=!1),u($.props.triggerTarget||o).forEach((function(r){r.addEventListener(e,t,n),F.push({node:r,eventType:e,handler:t,options:n})}))}function he(){var e;Z()&&(ge("touchstart",ye,{passive:!0}),ge("touchend",Ee,{passive:!0})),(e=$.props.trigger,e.split(/\s+/).filter(Boolean)).forEach((function(e){if("manual"!==e)switch(ge(e,ye),e){case"mouseenter":ge("mouseleave",Ee);break;case"focus":ge(D?"focusout":"blur",Oe);break;case"focusin":ge("focusout",Oe)}}))}function be(){F.forEach((function(e){var t=e.node,n=e.eventType,r=e.handler,o=e.options;t.removeEventListener(n,r,o)})),F=[]}function ye(e){var t,n=!1;if($.state.isEnabled&&!xe(e)&&!I){var r="focus"===(null==(t=C)?void 0:t.type);C=e,L=e.currentTarget,ue(),!$.state.isVisible&&m(e)&&H.forEach((function(t){return t(e)})),"click"===e.type&&($.props.trigger.indexOf("mouseenter")<0||V)&&!1!==$.props.hideOnClick&&$.state.isVisible?n=!0:Le(e),"click"===e.type&&(V=!n),n&&!r&&De(e)}}function we(e){var t=e.target,n=te().contains(t)||z.contains(t);"mousemove"===e.type&&n||function(e,t){var n=t.clientX,r=t.clientY;return e.every((function(e){var t=e.popperRect,o=e.popperState,i=e.props.interactiveBorder,a=p(o.placement),s=o.modifiersData.offset;if(!s)return!0;var u="bottom"===a?s.top.y:0,c="top"===a?s.bottom.y:0,f="right"===a?s.left.x:0,l="left"===a?s.right.x:0,d=t.top-r+u>i,v=r-t.bottom-c>i,m=t.left-n+f>i,g=n-t.right-l>i;return d||v||m||g}))}(Ae().concat(z).map((function(e){var t,n=null==(t=e._tippy.popperInstance)?void 0:t.state;return n?{popperRect:e.getBoundingClientRect(),popperState:n,props:M}:null})).filter(Boolean),e)&&(ce(),De(e))}function Ee(e){xe(e)||$.props.trigger.indexOf("click")>=0&&V||($.props.interactive?$.hideWithInteractivity(e):De(e))}function Oe(e){$.props.trigger.indexOf("focusin")<0&&e.target!==te()||$.props.interactive&&e.relatedTarget&&z.contains(e.relatedTarget)||De(e)}function xe(e){return!!x.isTouch&&Z()!==e.type.indexOf("touch")>=0}function Ce(){Te();var t=$.props,n=t.popperOptions,r=t.placement,i=t.offset,a=t.getReferenceClientRect,s=t.moveTransition,u=ee()?S(z).arrow:null,c=a?{getBoundingClientRect:a,contextElement:a.contextElement||te()}:o,p=[{name:"offset",options:{offset:i}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!s}},{name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var t=e.state;if(ee()){var n=re().box;["placement","reference-hidden","escaped"].forEach((function(e){"placement"===e?n.setAttribute("data-placement",t.placement):t.attributes.popper["data-popper-"+e]?n.setAttribute("data-"+e,""):n.removeAttribute("data-"+e)})),t.attributes.popper={}}}}];ee()&&u&&p.push({name:"arrow",options:{element:u,padding:3}}),p.push.apply(p,(null==n?void 0:n.modifiers)||[]),$.popperInstance=e.createPopper(c,z,Object.assign({},n,{placement:r,onFirstUpdate:A,modifiers:p}))}function Te(){$.popperInstance&&($.popperInstance.destroy(),$.popperInstance=null)}function Ae(){return f(z.querySelectorAll("[data-tippy-root]"))}function Le(e){$.clearDelayTimeouts(),e&&ae("onTrigger",[$,e]),de();var t=oe(!0),n=Q(),r=n[0],o=n[1];x.isTouch&&"hold"===r&&o&&(t=o),t?v=setTimeout((function(){$.show()}),t):$.show()}function De(e){if($.clearDelayTimeouts(),ae("onUntrigger",[$,e]),$.state.isVisible){if(!($.props.trigger.indexOf("mouseenter")>=0&&$.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(e.type)>=0&&V)){var t=oe(!1);t?g=setTimeout((function(){$.state.isVisible&&$.hide()}),t):h=requestAnimationFrame((function(){$.hide()}))}}else ve()}}function F(e,n){void 0===n&&(n={});var r=R.plugins.concat(n.plugins||[]);document.addEventListener("touchstart",T,t),window.addEventListener("blur",L);var o=Object.assign({},n,{plugins:r}),i=h(e).reduce((function(e,t){var n=t&&_(t,o);return n&&e.push(n),e}),[]);return v(e)?i[0]:i}F.defaultProps=R,F.setDefaultProps=function(e){Object.keys(e).forEach((function(t){R[t]=e[t]}))},F.currentInput=x;var W=Object.assign({},e.applyStyles,{effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow)}}),X={mouseover:"mouseenter",focusin:"focus",click:"click"};var Y={name:"animateFill",defaultValue:!1,fn:function(e){var t;if(null==(t=e.props.render)||!t.$$tippy)return{};var n=S(e.popper),r=n.box,o=n.content,i=e.props.animateFill?function(){var e=d();return e.className="tippy-backdrop",y([e],"hidden"),e}():null;return{onCreate:function(){i&&(r.insertBefore(i,r.firstElementChild),r.setAttribute("data-animatefill",""),r.style.overflow="hidden",e.setProps({arrow:!1,animation:"shift-away"}))},onMount:function(){if(i){var e=r.style.transitionDuration,t=Number(e.replace("ms",""));o.style.transitionDelay=Math.round(t/10)+"ms",i.style.transitionDuration=e,y([i],"visible")}},onShow:function(){i&&(i.style.transitionDuration="0ms")},onHide:function(){i&&y([i],"hidden")}}}};var $={clientX:0,clientY:0},q=[];function z(e){var t=e.clientX,n=e.clientY;$={clientX:t,clientY:n}}var J={name:"followCursor",defaultValue:!1,fn:function(e){var t=e.reference,n=w(e.props.triggerTarget||t),r=!1,o=!1,i=!0,a=e.props;function s(){return"initial"===e.props.followCursor&&e.state.isVisible}function u(){n.addEventListener("mousemove",f)}function c(){n.removeEventListener("mousemove",f)}function p(){r=!0,e.setProps({getReferenceClientRect:null}),r=!1}function f(n){var r=!n.target||t.contains(n.target),o=e.props.followCursor,i=n.clientX,a=n.clientY,s=t.getBoundingClientRect(),u=i-s.left,c=a-s.top;!r&&e.props.interactive||e.setProps({getReferenceClientRect:function(){var e=t.getBoundingClientRect(),n=i,r=a;"initial"===o&&(n=e.left+u,r=e.top+c);var s="horizontal"===o?e.top:r,p="vertical"===o?e.right:n,f="horizontal"===o?e.bottom:r,l="vertical"===o?e.left:n;return{width:p-l,height:f-s,top:s,right:p,bottom:f,left:l}}})}function l(){e.props.followCursor&&(q.push({instance:e,doc:n}),function(e){e.addEventListener("mousemove",z)}(n))}function d(){0===(q=q.filter((function(t){return t.instance!==e}))).filter((function(e){return e.doc===n})).length&&function(e){e.removeEventListener("mousemove",z)}(n)}return{onCreate:l,onDestroy:d,onBeforeUpdate:function(){a=e.props},onAfterUpdate:function(t,n){var i=n.followCursor;r||void 0!==i&&a.followCursor!==i&&(d(),i?(l(),!e.state.isMounted||o||s()||u()):(c(),p()))},onMount:function(){e.props.followCursor&&!o&&(i&&(f($),i=!1),s()||u())},onTrigger:function(e,t){m(t)&&($={clientX:t.clientX,clientY:t.clientY}),o="focus"===t.type},onHidden:function(){e.props.followCursor&&(p(),c(),i=!0)}}}};var G={name:"inlinePositioning",defaultValue:!1,fn:function(e){var t,n=e.reference;var r=-1,o=!1,i=[],a={name:"tippyInlinePositioning",enabled:!0,phase:"afterWrite",fn:function(o){var a=o.state;e.props.inlinePositioning&&(-1!==i.indexOf(a.placement)&&(i=[]),t!==a.placement&&-1===i.indexOf(a.placement)&&(i.push(a.placement),e.setProps({getReferenceClientRect:function(){return function(e){return function(e,t,n,r){if(n.length<2||null===e)return t;if(2===n.length&&r>=0&&n[0].left>n[1].right)return n[r]||t;switch(e){case"top":case"bottom":var o=n[0],i=n[n.length-1],a="top"===e,s=o.top,u=i.bottom,c=a?o.left:i.left,p=a?o.right:i.right;return{top:s,bottom:u,left:c,right:p,width:p-c,height:u-s};case"left":case"right":var f=Math.min.apply(Math,n.map((function(e){return e.left}))),l=Math.max.apply(Math,n.map((function(e){return e.right}))),d=n.filter((function(t){return"left"===e?t.left===f:t.right===l})),v=d[0].top,m=d[d.length-1].bottom;return{top:v,bottom:m,left:f,right:l,width:l-f,height:m-v};default:return t}}(p(e),n.getBoundingClientRect(),f(n.getClientRects()),r)}(a.placement)}})),t=a.placement)}};function s(){var t;o||(t=function(e,t){var n;return{popperOptions:Object.assign({},e.popperOptions,{modifiers:[].concat(((null==(n=e.popperOptions)?void 0:n.modifiers)||[]).filter((function(e){return e.name!==t.name})),[t])})}}(e.props,a),o=!0,e.setProps(t),o=!1)}return{onCreate:s,onAfterUpdate:s,onTrigger:function(t,n){if(m(n)){var o=f(e.reference.getClientRects()),i=o.find((function(e){return e.left-2<=n.clientX&&e.right+2>=n.clientX&&e.top-2<=n.clientY&&e.bottom+2>=n.clientY})),a=o.indexOf(i);r=a>-1?a:r}},onHidden:function(){r=-1}}}};var K={name:"sticky",defaultValue:!1,fn:function(e){var t=e.reference,n=e.popper;function r(t){return!0===e.props.sticky||e.props.sticky===t}var o=null,i=null;function a(){var s=r("reference")?(e.popperInstance?e.popperInstance.state.elements.reference:t).getBoundingClientRect():null,u=r("popper")?n.getBoundingClientRect():null;(s&&Q(o,s)||u&&Q(i,u))&&e.popperInstance&&e.popperInstance.update(),o=s,i=u,e.state.isMounted&&requestAnimationFrame(a)}return{onMount:function(){e.props.sticky&&a()}}}};function Q(e,t){return!e||!t||(e.top!==t.top||e.right!==t.right||e.bottom!==t.bottom||e.left!==t.left)}return F.setDefaultProps({plugins:[Y,J,G,K],render:N}),F.createSingleton=function(e,t){var n;void 0===t&&(t={});var r,o=e,i=[],a=[],c=t.overrides,p=[],f=!1;function l(){a=o.map((function(e){return u(e.props.triggerTarget||e.reference)})).reduce((function(e,t){return e.concat(t)}),[])}function v(){i=o.map((function(e){return e.reference}))}function m(e){o.forEach((function(t){e?t.enable():t.disable()}))}function g(e){return o.map((function(t){var n=t.setProps;return t.setProps=function(o){n(o),t.reference===r&&e.setProps(o)},function(){t.setProps=n}}))}function h(e,t){var n=a.indexOf(t);if(t!==r){r=t;var s=(c||[]).concat("content").reduce((function(e,t){return e[t]=o[n].props[t],e}),{});e.setProps(Object.assign({},s,{getReferenceClientRect:"function"==typeof s.getReferenceClientRect?s.getReferenceClientRect:function(){var e;return null==(e=i[n])?void 0:e.getBoundingClientRect()}}))}}m(!1),v(),l();var b={fn:function(){return{onDestroy:function(){m(!0)},onHidden:function(){r=null},onClickOutside:function(e){e.props.showOnCreate&&!f&&(f=!0,r=null)},onShow:function(e){e.props.showOnCreate&&!f&&(f=!0,h(e,i[0]))},onTrigger:function(e,t){h(e,t.currentTarget)}}}},y=F(d(),Object.assign({},s(t,["overrides"]),{plugins:[b].concat(t.plugins||[]),triggerTarget:a,popperOptions:Object.assign({},t.popperOptions,{modifiers:[].concat((null==(n=t.popperOptions)?void 0:n.modifiers)||[],[W])})})),w=y.show;y.show=function(e){if(w(),!r&&null==e)return h(y,i[0]);if(!r||null!=e){if("number"==typeof e)return i[e]&&h(y,i[e]);if(o.indexOf(e)>=0){var t=e.reference;return h(y,t)}return i.indexOf(e)>=0?h(y,e):void 0}},y.showNext=function(){var e=i[0];if(!r)return y.show(0);var t=i.indexOf(r);y.show(i[t+1]||e)},y.showPrevious=function(){var e=i[i.length-1];if(!r)return y.show(e);var t=i.indexOf(r),n=i[t-1]||e;y.show(n)};var E=y.setProps;return y.setProps=function(e){c=e.overrides||c,E(e)},y.setInstances=function(e){m(!0),p.forEach((function(e){return e()})),o=e,m(!1),v(),l(),p=g(y),y.setProps({triggerTarget:a})},p=g(y),y},F.delegate=function(e,n){var r=[],o=[],i=!1,a=n.target,c=s(n,["target"]),p=Object.assign({},c,{trigger:"manual",touch:!1}),f=Object.assign({touch:R.touch},c,{showOnCreate:!0}),l=F(e,p);function d(e){if(e.target&&!i){var t=e.target.closest(a);if(t){var r=t.getAttribute("data-tippy-trigger")||n.trigger||R.trigger;if(!t._tippy&&!("touchstart"===e.type&&"boolean"==typeof f.touch||"touchstart"!==e.type&&r.indexOf(X[e.type])<0)){var s=F(t,f);s&&(o=o.concat(s))}}}}function v(e,t,n,o){void 0===o&&(o=!1),e.addEventListener(t,n,o),r.push({node:e,eventType:t,handler:n,options:o})}return u(l).forEach((function(e){var n=e.destroy,a=e.enable,s=e.disable;e.destroy=function(e){void 0===e&&(e=!0),e&&o.forEach((function(e){e.destroy()})),o=[],r.forEach((function(e){var t=e.node,n=e.eventType,r=e.handler,o=e.options;t.removeEventListener(n,r,o)})),r=[],n()},e.enable=function(){a(),o.forEach((function(e){return e.enable()})),i=!1},e.disable=function(){s(),o.forEach((function(e){return e.disable()})),i=!0},function(e){var n=e.reference;v(n,"touchstart",d,t),v(n,"mouseover",d),v(n,"focusin",d),v(n,"click",d)}(e)})),l},F.hideAll=function(e){var t=void 0===e?{}:e,n=t.exclude,r=t.duration;U.forEach((function(e){var t=!1;if(n&&(t=g(n)?e.reference===n:e.popper===n.popper),!t){var o=e.props.duration;e.setProps({duration:r}),e.hide(),e.state.isDestroyed||e.setProps({duration:o})}}))},F.roundArrow='',F})); 2 | 3 | -------------------------------------------------------------------------------- /_freeze/2022/day/1/index/execute-results/html.json: -------------------------------------------------------------------------------- 1 | { 2 | "hash": "8db02dacc02ff123f9c033a6716b6adc", 3 | "result": { 4 | "engine": "knitr", 5 | "markdown": "---\ntitle: \"2022: Day 1\"\ndate: 2022-12-1\ncategories: [base R, lists]\ndraft: false\n---\n\n\n\n\n## Setup\n\n[The original challenge](https://adventofcode.com/2022/day/1)\n\n## Part 1\n\nI'm including this post in the website example to demonstrate what a typical post will look like, using `post-template`, in the `_templates` directory as a starting point. This post is created by a call to `aoc_new_day(1, 2022)`. It can be deleted with a call to `aoc_delete_day(1, 2022)`, or all posts and the listing for the year can be deleted with `aoc_delete_year(2022)`.\n\n\n\n\n::: {.cell}\n\n:::\n\n\n\n\n::: {.callout-note}\nThis is Ella Kaye's solution^[Ella is the author of this website template and of the **aochelpers** package, and the author of this demo post.], with her puzzle input. If attempting this challenge yourself, your solution will be different.\n:::\n\n\n\n\n::: {.cell}\n\n```{.r .cell-code}\nlibrary(aochelpers)\ninput <- aoc_input_vector(1, 2022, mode = \"numeric\")\n```\n:::\n\n\n\n\nI'm using the `aoc_input_vector()` function from the **aochelpers** package to read in the data, but otherwise using base R functions (including the native pipe, `|>`) for this puzzle. \n\nIn this challenge, we're given groups of numbers and we need to find the sum of each group. \nOur solution is the largest of these. The groups are separated by a blank line. When reading in the input as a numeric vector, these are coerced to `NA`.\nWe can identify the new groups by the `NA` values, produce an index for them with `cumsum(is.na(input))`,\nwhich increments when a new `NA` is reached, then use this with `split()` to split the input into a list of vectors, one for each group.\nWe need the argument `na.rm = TRUE` in `sapply()` because each vector, other than the first, starts with `NA`, as that's where it was split.\n\n\n\n\n::: {.cell}\n\n```{.r .cell-code}\ntotals <- split(input, cumsum(is.na(input))) |> \n sapply(sum, na.rm = TRUE) \n\nmax(totals)\n```\n\n::: {.cell-output .cell-output-stdout}\n\n```\n[1] 66719\n```\n\n\n:::\n:::\n\n\n\n\n## Part 2\n\nThis is similar, except we want to find the sum of the sums of the top three groups.\n\n\n\n\n::: {.cell}\n\n```{.r .cell-code}\ntotals |> \n sort() |> \n tail(3) |> \n sum()\n```\n\n::: {.cell-output .cell-output-stdout}\n\n```\n[1] 198551\n```\n\n\n:::\n:::\n", 6 | "supporting": [ 7 | "index_files" 8 | ], 9 | "filters": [ 10 | "rmarkdown/pagebreak.lua" 11 | ], 12 | "includes": {}, 13 | "engineDependencies": {}, 14 | "preserve": {}, 15 | "postProcess": true 16 | } 17 | } -------------------------------------------------------------------------------- /_freeze/site_libs/clipboard/clipboard.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * clipboard.js v2.0.11 3 | * https://clipboardjs.com/ 4 | * 5 | * Licensed MIT © Zeno Rocha 6 | */ 7 | !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.ClipboardJS=e():t.ClipboardJS=e()}(this,function(){return n={686:function(t,e,n){"use strict";n.d(e,{default:function(){return b}});var e=n(279),i=n.n(e),e=n(370),u=n.n(e),e=n(817),r=n.n(e);function c(t){try{return document.execCommand(t)}catch(t){return}}var a=function(t){t=r()(t);return c("cut"),t};function o(t,e){var n,o,t=(n=t,o="rtl"===document.documentElement.getAttribute("dir"),(t=document.createElement("textarea")).style.fontSize="12pt",t.style.border="0",t.style.padding="0",t.style.margin="0",t.style.position="absolute",t.style[o?"right":"left"]="-9999px",o=window.pageYOffset||document.documentElement.scrollTop,t.style.top="".concat(o,"px"),t.setAttribute("readonly",""),t.value=n,t);return e.container.appendChild(t),e=r()(t),c("copy"),t.remove(),e}var f=function(t){var e=10?setTimeout((function(){e(r,n,s)}),1):(t.update(),n(s))}}},"./src/filter.js":function(t){t.exports=function(t){return t.handlers.filterStart=t.handlers.filterStart||[],t.handlers.filterComplete=t.handlers.filterComplete||[],function(e){if(t.trigger("filterStart"),t.i=1,t.reset.filter(),void 0===e)t.filtered=!1;else{t.filtered=!0;for(var r=t.items,n=0,s=r.length;nv.page,a=new g(t[s],void 0,n),v.items.push(a),r.push(a)}return v.update(),r}m(t.slice(0),e)}},this.show=function(t,e){return this.i=t,this.page=e,v.update(),v},this.remove=function(t,e,r){for(var n=0,s=0,i=v.items.length;s-1&&r.splice(n,1),v},this.trigger=function(t){for(var e=v.handlers[t].length;e--;)v.handlers[t][e](v);return v},this.reset={filter:function(){for(var t=v.items,e=t.length;e--;)t[e].filtered=!1;return v},search:function(){for(var t=v.items,e=t.length;e--;)t[e].found=!1;return v}},this.update=function(){var t=v.items,e=t.length;v.visibleItems=[],v.matchingItems=[],v.templater.clear();for(var r=0;r=v.i&&v.visibleItems.lengthe},innerWindow:function(t,e,r){return t>=e-r&&t<=e+r},dotted:function(t,e,r,n,s,i,a){return this.dottedLeft(t,e,r,n,s,i)||this.dottedRight(t,e,r,n,s,i,a)},dottedLeft:function(t,e,r,n,s,i){return e==r+1&&!this.innerWindow(e,s,i)&&!this.right(e,n)},dottedRight:function(t,e,r,n,s,i,a){return!t.items[a-1].values().dotted&&(e==n&&!this.innerWindow(e,s,i)&&!this.right(e,n))}};return function(e){var n=new i(t.listContainer.id,{listClass:e.paginationClass||"pagination",item:e.item||"
  • ",valueNames:["page","dotted"],searchClass:"pagination-search-that-is-not-supposed-to-exist",sortClass:"pagination-sort-that-is-not-supposed-to-exist"});s.bind(n.listContainer,"click",(function(e){var r=e.target||e.srcElement,n=t.utils.getAttribute(r,"data-page"),s=t.utils.getAttribute(r,"data-i");s&&t.show((s-1)*n+1,n)})),t.on("updated",(function(){r(n,e)})),r(n,e)}}},"./src/parse.js":function(t,e,r){t.exports=function(t){var e=r("./src/item.js")(t),n=function(r,n){for(var s=0,i=r.length;s0?setTimeout((function(){e(r,s)}),1):(t.update(),t.trigger("parseComplete"))};return t.handlers.parseComplete=t.handlers.parseComplete||[],function(){var e=function(t){for(var e=t.childNodes,r=[],n=0,s=e.length;n]/g.exec(t)){var e=document.createElement("tbody");return e.innerHTML=t,e.firstElementChild}if(-1!==t.indexOf("<")){var r=document.createElement("div");return r.innerHTML=t,r.firstElementChild}}},a=function(e,r,n){var s=void 0,i=function(e){for(var r=0,n=t.valueNames.length;r=1;)t.list.removeChild(t.list.firstChild)},function(){var r;if("function"!=typeof t.item){if(!(r="string"==typeof t.item?-1===t.item.indexOf("<")?document.getElementById(t.item):i(t.item):s()))throw new Error("The list needs to have at least one item on init otherwise you'll have to add a template.");r=n(r,t.valueNames),e=function(){return r.cloneNode(!0)}}else e=function(e){var r=t.item(e);return i(r)}}()};t.exports=function(t){return new e(t)}},"./src/utils/classes.js":function(t,e,r){var n=r("./src/utils/index-of.js"),s=/\s+/;Object.prototype.toString;function i(t){if(!t||!t.nodeType)throw new Error("A DOM element reference is required");this.el=t,this.list=t.classList}t.exports=function(t){return new i(t)},i.prototype.add=function(t){if(this.list)return this.list.add(t),this;var e=this.array();return~n(e,t)||e.push(t),this.el.className=e.join(" "),this},i.prototype.remove=function(t){if(this.list)return this.list.remove(t),this;var e=this.array(),r=n(e,t);return~r&&e.splice(r,1),this.el.className=e.join(" "),this},i.prototype.toggle=function(t,e){return this.list?(void 0!==e?e!==this.list.toggle(t,e)&&this.list.toggle(t):this.list.toggle(t),this):(void 0!==e?e?this.add(t):this.remove(t):this.has(t)?this.remove(t):this.add(t),this)},i.prototype.array=function(){var t=(this.el.getAttribute("class")||"").replace(/^\s+|\s+$/g,"").split(s);return""===t[0]&&t.shift(),t},i.prototype.has=i.prototype.contains=function(t){return this.list?this.list.contains(t):!!~n(this.array(),t)}},"./src/utils/events.js":function(t,e,r){var n=window.addEventListener?"addEventListener":"attachEvent",s=window.removeEventListener?"removeEventListener":"detachEvent",i="addEventListener"!==n?"on":"",a=r("./src/utils/to-array.js");e.bind=function(t,e,r,s){for(var o=0,l=(t=a(t)).length;o32)return!1;var a=n,o=function(){var t,r={};for(t=0;t=p;b--){var j=o[t.charAt(b-1)];if(C[b]=0===m?(C[b+1]<<1|1)&j:(C[b+1]<<1|1)&j|(v[b+1]|v[b])<<1|1|v[b+1],C[b]&d){var x=l(m,b-1);if(x<=u){if(u=x,!((c=b-1)>a))break;p=Math.max(1,2*a-c)}}}if(l(m+1,a)>u)break;v=C}return!(c<0)}},"./src/utils/get-attribute.js":function(t){t.exports=function(t,e){var r=t.getAttribute&&t.getAttribute(e)||null;if(!r)for(var n=t.attributes,s=n.length,i=0;i=48&&t<=57}function i(t,e){for(var i=(t+="").length,a=(e+="").length,o=0,l=0;o=i&&l=a?-1:l>=a&&o=i?1:i-a}i.caseInsensitive=i.i=function(t,e){return i((""+t).toLowerCase(),(""+e).toLowerCase())},Object.defineProperties(i,{alphabet:{get:function(){return e},set:function(t){r=[];var s=0;if(e=t)for(;s { 5 | category = atob(category); 6 | if (categoriesLoaded) { 7 | activateCategory(category); 8 | setCategoryHash(category); 9 | } 10 | }; 11 | 12 | window["quarto-listing-loaded"] = () => { 13 | // Process any existing hash 14 | const hash = getHash(); 15 | 16 | if (hash) { 17 | // If there is a category, switch to that 18 | if (hash.category) { 19 | // category hash are URI encoded so we need to decode it before processing 20 | // so that we can match it with the category element processed in JS 21 | activateCategory(decodeURIComponent(hash.category)); 22 | } 23 | // Paginate a specific listing 24 | const listingIds = Object.keys(window["quarto-listings"]); 25 | for (const listingId of listingIds) { 26 | const page = hash[getListingPageKey(listingId)]; 27 | if (page) { 28 | showPage(listingId, page); 29 | } 30 | } 31 | } 32 | 33 | const listingIds = Object.keys(window["quarto-listings"]); 34 | for (const listingId of listingIds) { 35 | // The actual list 36 | const list = window["quarto-listings"][listingId]; 37 | 38 | // Update the handlers for pagination events 39 | refreshPaginationHandlers(listingId); 40 | 41 | // Render any visible items that need it 42 | renderVisibleProgressiveImages(list); 43 | 44 | // Whenever the list is updated, we also need to 45 | // attach handlers to the new pagination elements 46 | // and refresh any newly visible items. 47 | list.on("updated", function () { 48 | renderVisibleProgressiveImages(list); 49 | setTimeout(() => refreshPaginationHandlers(listingId)); 50 | 51 | // Show or hide the no matching message 52 | toggleNoMatchingMessage(list); 53 | }); 54 | } 55 | }; 56 | 57 | window.document.addEventListener("DOMContentLoaded", function (_event) { 58 | // Attach click handlers to categories 59 | const categoryEls = window.document.querySelectorAll( 60 | ".quarto-listing-category .category" 61 | ); 62 | 63 | for (const categoryEl of categoryEls) { 64 | // category needs to support non ASCII characters 65 | const category = decodeURIComponent( 66 | atob(categoryEl.getAttribute("data-category")) 67 | ); 68 | categoryEl.onclick = () => { 69 | activateCategory(category); 70 | setCategoryHash(category); 71 | }; 72 | } 73 | 74 | // Attach a click handler to the category title 75 | // (there should be only one, but since it is a class name, handle N) 76 | const categoryTitleEls = window.document.querySelectorAll( 77 | ".quarto-listing-category-title" 78 | ); 79 | for (const categoryTitleEl of categoryTitleEls) { 80 | categoryTitleEl.onclick = () => { 81 | activateCategory(""); 82 | setCategoryHash(""); 83 | }; 84 | } 85 | 86 | categoriesLoaded = true; 87 | }); 88 | 89 | function toggleNoMatchingMessage(list) { 90 | const selector = `#${list.listContainer.id} .listing-no-matching`; 91 | const noMatchingEl = window.document.querySelector(selector); 92 | if (noMatchingEl) { 93 | if (list.visibleItems.length === 0) { 94 | noMatchingEl.classList.remove("d-none"); 95 | } else { 96 | if (!noMatchingEl.classList.contains("d-none")) { 97 | noMatchingEl.classList.add("d-none"); 98 | } 99 | } 100 | } 101 | } 102 | 103 | function setCategoryHash(category) { 104 | setHash({ category }); 105 | } 106 | 107 | function setPageHash(listingId, page) { 108 | const currentHash = getHash() || {}; 109 | currentHash[getListingPageKey(listingId)] = page; 110 | setHash(currentHash); 111 | } 112 | 113 | function getListingPageKey(listingId) { 114 | return `${listingId}-page`; 115 | } 116 | 117 | function refreshPaginationHandlers(listingId) { 118 | const listingEl = window.document.getElementById(listingId); 119 | const paginationEls = listingEl.querySelectorAll( 120 | ".pagination li.page-item:not(.disabled) .page.page-link" 121 | ); 122 | for (const paginationEl of paginationEls) { 123 | paginationEl.onclick = (sender) => { 124 | setPageHash(listingId, sender.target.getAttribute("data-i")); 125 | showPage(listingId, sender.target.getAttribute("data-i")); 126 | return false; 127 | }; 128 | } 129 | } 130 | 131 | function renderVisibleProgressiveImages(list) { 132 | // Run through the visible items and render any progressive images 133 | for (const item of list.visibleItems) { 134 | const itemEl = item.elm; 135 | if (itemEl) { 136 | const progressiveImgs = itemEl.querySelectorAll( 137 | `img[${kProgressiveAttr}]` 138 | ); 139 | for (const progressiveImg of progressiveImgs) { 140 | const srcValue = progressiveImg.getAttribute(kProgressiveAttr); 141 | if (srcValue) { 142 | progressiveImg.setAttribute("src", srcValue); 143 | } 144 | progressiveImg.removeAttribute(kProgressiveAttr); 145 | } 146 | } 147 | } 148 | } 149 | 150 | function getHash() { 151 | // Hashes are of the form 152 | // #name:value|name1:value1|name2:value2 153 | const currentUrl = new URL(window.location); 154 | const hashRaw = currentUrl.hash ? currentUrl.hash.slice(1) : undefined; 155 | return parseHash(hashRaw); 156 | } 157 | 158 | const kAnd = "&"; 159 | const kEquals = "="; 160 | 161 | function parseHash(hash) { 162 | if (!hash) { 163 | return undefined; 164 | } 165 | const hasValuesStrs = hash.split(kAnd); 166 | const hashValues = hasValuesStrs 167 | .map((hashValueStr) => { 168 | const vals = hashValueStr.split(kEquals); 169 | if (vals.length === 2) { 170 | return { name: vals[0], value: vals[1] }; 171 | } else { 172 | return undefined; 173 | } 174 | }) 175 | .filter((value) => { 176 | return value !== undefined; 177 | }); 178 | 179 | const hashObj = {}; 180 | hashValues.forEach((hashValue) => { 181 | hashObj[hashValue.name] = decodeURIComponent(hashValue.value); 182 | }); 183 | return hashObj; 184 | } 185 | 186 | function makeHash(obj) { 187 | return Object.keys(obj) 188 | .map((key) => { 189 | return `${key}${kEquals}${obj[key]}`; 190 | }) 191 | .join(kAnd); 192 | } 193 | 194 | function setHash(obj) { 195 | const hash = makeHash(obj); 196 | window.history.pushState(null, null, `#${hash}`); 197 | } 198 | 199 | function showPage(listingId, page) { 200 | const list = window["quarto-listings"][listingId]; 201 | if (list) { 202 | list.show((page - 1) * list.page + 1, list.page); 203 | } 204 | } 205 | 206 | function activateCategory(category) { 207 | // Deactivate existing categories 208 | const activeEls = window.document.querySelectorAll( 209 | ".quarto-listing-category .category.active" 210 | ); 211 | for (const activeEl of activeEls) { 212 | activeEl.classList.remove("active"); 213 | } 214 | 215 | // Activate this category 216 | const categoryEl = window.document.querySelector( 217 | `.quarto-listing-category .category[data-category='${btoa( 218 | encodeURIComponent(category) 219 | )}']` 220 | ); 221 | if (categoryEl) { 222 | categoryEl.classList.add("active"); 223 | } 224 | 225 | // Filter the listings to this category 226 | filterListingCategory(category); 227 | } 228 | 229 | function filterListingCategory(category) { 230 | const listingIds = Object.keys(window["quarto-listings"]); 231 | for (const listingId of listingIds) { 232 | const list = window["quarto-listings"][listingId]; 233 | if (list) { 234 | if (category === "") { 235 | // resets the filter 236 | list.filter(); 237 | } else { 238 | // filter to this category 239 | list.filter(function (item) { 240 | const itemValues = item.values(); 241 | if (itemValues.categories !== null) { 242 | const categories = decodeURIComponent( 243 | atob(itemValues.categories) 244 | ).split(","); 245 | return categories.includes(category); 246 | } else { 247 | return false; 248 | } 249 | }); 250 | } 251 | } 252 | } 253 | } 254 | -------------------------------------------------------------------------------- /_quarto.yml: -------------------------------------------------------------------------------- 1 | project: 2 | type: website 3 | resources: 4 | - fonts 5 | preview: 6 | port: 4321 7 | 8 | execute: 9 | freeze: auto 10 | 11 | website: 12 | title: "Advent of Code" 13 | description: My solutions to Advent of Code 14 | repo-url: https://github.com/EllaKaye/advent-of-code-website-template 15 | navbar: 16 | left: 17 | - 2022.qmd 18 | - 2024.qmd 19 | right: 20 | - icon: github 21 | href: https://github.com/EllaKaye/advent-of-code-website-template 22 | open-graph: true 23 | 24 | format: 25 | html: 26 | theme: 27 | light: [cosmo, custom-light.scss] 28 | dark: custom-dark.scss 29 | css: styles.css 30 | code-block-border-left: true 31 | smooth-scroll: true 32 | link-external-newwindow: true 33 | 34 | editor: source 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /_templates/YYYY-conclusion/index.qmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "YYYY: Conclusion" 3 | date: YYYY-12-26 4 | code-tools: false 5 | --- -------------------------------------------------------------------------------- /_templates/YYYY-intro/index.qmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "YYYY: Introduction" 3 | date: YYYY-11-30 4 | code-tools: false 5 | --- 6 | -------------------------------------------------------------------------------- /_templates/YYYY.qmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "YYYY" 3 | listing: 4 | contents: "YYYY/day" 5 | sort: "date" 6 | type: table 7 | categories: true 8 | sort-ui: false 9 | filter-ui: false 10 | fields: [title, categories] 11 | --- 12 | -------------------------------------------------------------------------------- /_templates/_metadata.yml: -------------------------------------------------------------------------------- 1 | # options specified here will apply to all posts in this folder 2 | 3 | freeze: auto 4 | 5 | toc: true 6 | toc-depth: 3 7 | 8 | code-fold: show 9 | code-summary: "Toggle the code" 10 | code-tools: true 11 | 12 | execute: 13 | echo: true 14 | message: false 15 | warning: false 16 | -------------------------------------------------------------------------------- /_templates/post-template/index.qmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "YYYY: Day DD" 3 | date: YYYY-12-DD 4 | categories: 5 | - TAG_1 6 | - TAG_2 7 | draft: false 8 | --- 9 | 10 | ## Setup 11 | 12 | [The original challenge](https://adventofcode.com/YYYY/day/DD) 13 | 14 | ## Part 1 15 | 16 | ```{r} 17 | #| echo: false 18 | OK <- "YYYY" < 3000 19 | # Will only evaluate next code block if an actual year has been substituted for the placeholder 20 | ``` 21 | 22 | 23 | ```{r} 24 | #| eval: !expr OK 25 | library(aochelpers) 26 | # other options: aoc_input_data_frame(), aoc_input_matrix() 27 | input <- aoc_input_vector(DD, YYYY) 28 | head(input) 29 | ``` 30 | 31 | ## Part 2 32 | 33 | 34 | -------------------------------------------------------------------------------- /_templates/post-template/script.R: -------------------------------------------------------------------------------- 1 | library(aochelpers) 2 | # input <- aoc_input_vector(DD, YYYY) # uncomment at end, once correct on test input 3 | # also consider aoc_input_data_frame() or aoc_input_matrix(), with view = TRUE 4 | 5 | browseURL("https://adventofcode.com/YYYY/day/DD") 6 | # use datapasta addin to copy in test input from the website 7 | # triple-click in test input box in the puzzle to select, 8 | # then choose appropriate paste format from addin 9 | # comment out once ready to run on full input 10 | 11 | # input <- 12 | 13 | # Part 1 --------------------------------------------------------------------- 14 | 15 | 16 | 17 | # Part 2 --------------------------------------------------------------------- 18 | -------------------------------------------------------------------------------- /advent-of-code-website-template.Rproj: -------------------------------------------------------------------------------- 1 | Version: 1.0 2 | 3 | RestoreWorkspace: Default 4 | SaveWorkspace: Default 5 | AlwaysSaveHistory: Default 6 | 7 | EnableCodeIndexing: Yes 8 | UseSpacesForTab: No 9 | NumSpacesForTab: 2 10 | Encoding: UTF-8 11 | 12 | RnwWeave: Sweave 13 | LaTeX: pdfLaTeX 14 | -------------------------------------------------------------------------------- /custom-dark.scss: -------------------------------------------------------------------------------- 1 | /*-- scss:defaults --*/ 2 | 3 | @font-face { 4 | font-family: 'iAWriterMonoS-Bold'; 5 | src: local('iAWriterMonoS-Bold'), url('fonts/iAWriterMonoS-Bold.woff2') format('woff2'), url('fonts/iAWriterMonoS-Bold.woff') format('woff'); 6 | } 7 | 8 | @font-face { 9 | font-family: 'iAWriterMonoS-Regular'; 10 | src: local('iAWriterMonoS-Regular'), url('fonts/iAWriterMonoS-Regular.woff2') format('woff2'), url('fonts/iAWriterMonoS-Regular.woff') format('woff'); 11 | } 12 | 13 | // fonts 14 | $font-family-sans-serif: "iAWriterMonoS-Regular", monospace !default; 15 | $font-family-monospace: "iAWriterMonoS-Regular", monospace; 16 | $headings-font-family: "iAWriterMonoS-Bold", monospace !default; 17 | 18 | $toc-font-size: 1rem; 19 | 20 | // colors 21 | $dark: #181829 !default; 22 | $green: #00B200 !default; 23 | $red: #FF2743 !default; 24 | $yellow: #FFFF46 !default; 25 | 26 | $primary: $green; 27 | 28 | $secondary: #CCCCCC !default; 29 | $body-bg: $dark; 30 | $navbar-bg: $body-bg; 31 | $navbar-fg: $primary; 32 | $body-color: $secondary; 33 | $code-bg: $dark; 34 | $code-color: $yellow; 35 | 36 | pre code { 37 | background-color: $code-bg; 38 | color: $secondary !important; 39 | } 40 | 41 | // navbar 42 | #quarto-header { 43 | font-family: $headings-font-family; 44 | } 45 | -------------------------------------------------------------------------------- /custom-light.scss: -------------------------------------------------------------------------------- 1 | /*-- scss:defaults --*/ 2 | 3 | @font-face { 4 | font-family: 'iAWriterQuattroS-Regular'; 5 | src: local('iAWriterQuattroS-Regular'), url('fonts/iAWriterQuattroS-Regular.woff2') format('woff2'), url('fonts/iAWriterQuattroS-Regular.woff') format('woff'); 6 | } 7 | 8 | @font-face { 9 | font-family: 'iAWriterQuattroS-Bold'; 10 | src: local('iAWriterQuattroS-Bold'), url('fonts/iAWriterQuattroS-Bold.woff2') format('woff2'), url('fonts/iAWriterQuattroS-Bold.woff') format('woff'); 11 | } 12 | 13 | @font-face { 14 | font-family: 'iAWriterMonoS-Regular'; 15 | src: local('iAWriterMonoS-Regular'), url('fonts/iAWriterMonoS-Regular.woff2') format('woff2'), url('fonts/iAWriterMonoS-Regular.woff') format('woff'); 16 | } 17 | 18 | // fonts 19 | $font-family-sans-serif: "iAWriterQuattroS-Regular", Helvetica, sans-serif !default; 20 | $font-family-monospace: "iAWriterMonoS-Regular", monospace; 21 | $headings-font-family: "iAWriterQuattroS-Bold", Figtree, Helvetica, sans-serif !default; 22 | 23 | // colors 24 | $green: #328800; 25 | $red: #b01b2e; 26 | 27 | $primary: $green; 28 | $body-bg: #FFFFFF; 29 | $navbar-bg: $body-bg; 30 | $navbar-fg: $primary; 31 | $code-color: $red; 32 | $code-bg: $body-bg; 33 | 34 | // navbar 35 | #quarto-header { 36 | //font-family: "LEMONMILKPro-Regular", Jost, Helvetica, sans-serif; 37 | // font-family: "ABCSocialExtendedEdu-Bold", Jost, Helvetica, sans-serif; 38 | font-family: $headings-font-family; 39 | } 40 | 41 | // make year links on navbar bigger 42 | #navbarCollapse > ul.navbar-nav.navbar-nav-scroll.me-auto > li > a > span { 43 | font-size: 1.5rem; 44 | } 45 | -------------------------------------------------------------------------------- /fonts/LICENSE.md: -------------------------------------------------------------------------------- 1 | # iA Writer Typeface 2 | 3 | Copyright © 2018 Information Architects Inc. with Reserved Font Name "iA Writer" 4 | 5 | # Based on IBM Plex Typeface 6 | 7 | Copyright © 2017 IBM Corp. with Reserved Font Name "Plex" 8 | 9 | # License 10 | 11 | This Font Software is licensed under the SIL Open Font License, Version 1.1. 12 | This license is copied below, and is also available with a FAQ at: 13 | http://scripts.sil.org/OFL 14 | 15 | ----------------------------------------------------------- 16 | SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 17 | ----------------------------------------------------------- 18 | 19 | PREAMBLE 20 | The goals of the Open Font License (OFL) are to stimulate worldwide 21 | development of collaborative font projects, to support the font creation 22 | efforts of academic and linguistic communities, and to provide a free and 23 | open framework in which fonts may be shared and improved in partnership 24 | with others. 25 | 26 | The OFL allows the licensed fonts to be used, studied, modified and 27 | redistributed freely as long as they are not sold by themselves. The 28 | fonts, including any derivative works, can be bundled, embedded, 29 | redistributed and/or sold with any software provided that any reserved 30 | names are not used by derivative works. The fonts and derivatives, 31 | however, cannot be released under any other type of license. The 32 | requirement for fonts to remain under this license does not apply 33 | to any document created using the fonts or their derivatives. 34 | 35 | DEFINITIONS 36 | "Font Software" refers to the set of files released by the Copyright 37 | Holder(s) under this license and clearly marked as such. This may 38 | include source files, build scripts and documentation. 39 | 40 | "Reserved Font Name" refers to any names specified as such after the 41 | copyright statement(s). 42 | 43 | "Original Version" refers to the collection of Font Software components as 44 | distributed by the Copyright Holder(s). 45 | 46 | "Modified Version" refers to any derivative made by adding to, deleting, 47 | or substituting -- in part or in whole -- any of the components of the 48 | Original Version, by changing formats or by porting the Font Software to a 49 | new environment. 50 | 51 | "Author" refers to any designer, engineer, programmer, technical 52 | writer or other person who contributed to the Font Software. 53 | 54 | PERMISSION & CONDITIONS 55 | Permission is hereby granted, free of charge, to any person obtaining 56 | a copy of the Font Software, to use, study, copy, merge, embed, modify, 57 | redistribute, and sell modified and unmodified copies of the Font 58 | Software, subject to the following conditions: 59 | 60 | 1) Neither the Font Software nor any of its individual components, 61 | in Original or Modified Versions, may be sold by itself. 62 | 63 | 2) Original or Modified Versions of the Font Software may be bundled, 64 | redistributed and/or sold with any software, provided that each copy 65 | contains the above copyright notice and this license. These can be 66 | included either as stand-alone text files, human-readable headers or 67 | in the appropriate machine-readable metadata fields within text or 68 | binary files as long as those fields can be easily viewed by the user. 69 | 70 | 3) No Modified Version of the Font Software may use the Reserved Font 71 | Name(s) unless explicit written permission is granted by the corresponding 72 | Copyright Holder. This restriction only applies to the primary font name as 73 | presented to the users. 74 | 75 | 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font 76 | Software shall not be used to promote, endorse or advertise any 77 | Modified Version, except to acknowledge the contribution(s) of the 78 | Copyright Holder(s) and the Author(s) or with their explicit written 79 | permission. 80 | 81 | 5) The Font Software, modified or unmodified, in part or in whole, 82 | must be distributed entirely under this license, and must not be 83 | distributed under any other license. The requirement for fonts to 84 | remain under this license does not apply to any document created 85 | using the Font Software. 86 | 87 | TERMINATION 88 | This license becomes null and void if any of the above conditions are 89 | not met. 90 | 91 | DISCLAIMER 92 | THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 93 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF 94 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT 95 | OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE 96 | COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 97 | INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL 98 | DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 99 | FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM 100 | OTHER DEALINGS IN THE FONT SOFTWARE. -------------------------------------------------------------------------------- /fonts/Readme.md: -------------------------------------------------------------------------------- 1 | # iA-Fonts 2 | 3 | The iA Writer fonts comes bundled with [iA Writer for for Android, Windows, Mac, iPadOS and iOS](https://ia.net/writer/) 4 | 5 | For in depth explanation of iA Writer Mono, Duo, and Quattro please read our [blog entry on Duospace](http://ia.net/topics/in-search-of-the-perfect-writing-font/) and on [iA Writer Mono, Duo, and Quattro](https://ia.net/topics/a-typographic-christmas) 6 | 7 | This is a modification of IBM's Plex font. 8 | The upstream project is [here](https://github.com/IBM/type) 9 | Please read the licensing file before working with it. 10 | 11 | If you fork or use our fonts, please reference iA Writer clearly. Use them creatively. 12 | 13 | Don't be a copycat. With or without the fonts, do not clone our products or our website. Selling our work under your name is blatantly disrespectful and criminal. Distributing knockoffs of our work for free doesn't make you Robin Hood either. We do not approve of free plugins or themes for other apps and other counterfeits that imitate our products. They're poor quality, they undermine our business, and they openly violate our copyright. Due to their poor quality, they tarnish our reputation. They're unethical, illegal, and lame. 14 | -------------------------------------------------------------------------------- /fonts/iAWriterMonoS-Bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EllaKaye/advent-of-code-website-template/39437a5ed3c0ba6e1db6ccd761de56bb1f2f0b47/fonts/iAWriterMonoS-Bold.woff -------------------------------------------------------------------------------- /fonts/iAWriterMonoS-Bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EllaKaye/advent-of-code-website-template/39437a5ed3c0ba6e1db6ccd761de56bb1f2f0b47/fonts/iAWriterMonoS-Bold.woff2 -------------------------------------------------------------------------------- /fonts/iAWriterMonoS-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EllaKaye/advent-of-code-website-template/39437a5ed3c0ba6e1db6ccd761de56bb1f2f0b47/fonts/iAWriterMonoS-Regular.woff -------------------------------------------------------------------------------- /fonts/iAWriterMonoS-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EllaKaye/advent-of-code-website-template/39437a5ed3c0ba6e1db6ccd761de56bb1f2f0b47/fonts/iAWriterMonoS-Regular.woff2 -------------------------------------------------------------------------------- /fonts/iAWriterQuattroS-Bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EllaKaye/advent-of-code-website-template/39437a5ed3c0ba6e1db6ccd761de56bb1f2f0b47/fonts/iAWriterQuattroS-Bold.woff -------------------------------------------------------------------------------- /fonts/iAWriterQuattroS-Bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EllaKaye/advent-of-code-website-template/39437a5ed3c0ba6e1db6ccd761de56bb1f2f0b47/fonts/iAWriterQuattroS-Bold.woff2 -------------------------------------------------------------------------------- /fonts/iAWriterQuattroS-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EllaKaye/advent-of-code-website-template/39437a5ed3c0ba6e1db6ccd761de56bb1f2f0b47/fonts/iAWriterQuattroS-Regular.woff -------------------------------------------------------------------------------- /fonts/iAWriterQuattroS-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EllaKaye/advent-of-code-website-template/39437a5ed3c0ba6e1db6ccd761de56bb1f2f0b47/fonts/iAWriterQuattroS-Regular.woff2 -------------------------------------------------------------------------------- /index.qmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Advent of Code" 3 | subtitle: "My solutions and notes" 4 | #description: "My solutions and notes for Advent of Code." 5 | code-tools: false 6 | --- 7 | 8 | [Advent of Code](https://adventofcode.com) is a series of increasingly difficult programming challenges, 9 | released daily each year throughout December in the run-up to Christmas. 10 | 11 | This website is created from the [EllaKaye/advent-of-code-website-template](https://github.com/EllaKaye/advent-of-code-website-template) template repository. 12 | There's documentation on how to use and adapt the template in the repo README. 13 | 14 | It is built with [Quarto](https://quarto.org) and works hand-in-hand with the R package [**aochelpers**](https://github.com/EllaKaye/aochelpers). 15 | The package provides function to manage this website, e.g. to create new posts from a template, 16 | to download and read in the puzzle input, 17 | and will eventually include functions to help with the challenges themselves. See the [package website](https://ellakaye.github.io/aochelpers/) for more details. 18 | 19 | As part of the demo, this template comes with an example listing page and Day 1 post for 2022, which you can delete with `aochelpers::aoc_delete_year(2022)`, as well as a listing and introduction to get started for 2024. 20 | 21 | There are two built-in themes. The light theme is designed to be quite clean, with a Christmas green and red colours. The dark theme is designed to be reminiscent of the Advent of Code website (though not identical, since the design of is part of its registered trademark). You can switch between them using the toggle in the top right corner of the page. Both themes use [fonts from iA](https://github.com/iaolo/iA-Fonts). The themes can be adapted in the `custom-light.scss` and `custom-dark.scss` files. 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /styles.css: -------------------------------------------------------------------------------- 1 | /* css styles */ --------------------------------------------------------------------------------