{"version":3,"file":"jardo-CGlvcEt9.js","sources":["../../../app/vite/MobileNavigation.res.mjs","../../../node_modules/@georgedoescode/spline/spline.js","../../../node_modules/simplex-noise/dist/esm/simplex-noise.js","../../../app/vite/blobs.js","../../../app/vite/posts-filter-bar.js","../../../app/vite/table-of-contents.js","../../../app/vite/entrypoints/jardo.js"],"sourcesContent":["// Generated by ReScript, PLEASE EDIT WITH CARE\n\nimport * as Caml_option from \"rescript/lib/es6/caml_option.js\";\n\nfunction elementById(id) {\n return Caml_option.nullable_to_opt(document.getElementById(id));\n}\n\nvar openButton = Caml_option.nullable_to_opt(document.getElementById(\"open-mobile-navigation\"));\n\nvar closeButton = Caml_option.nullable_to_opt(document.getElementById(\"close-mobile-navigation\"));\n\nvar mobileNavigation = Caml_option.nullable_to_opt(document.getElementById(\"mobile-navigation-overlay\"));\n\nif (openButton !== undefined && closeButton !== undefined && mobileNavigation !== undefined) {\n var mobileNavigation$1 = Caml_option.valFromOption(mobileNavigation);\n Caml_option.valFromOption(openButton).addEventListener(\"click\", (function (param) {\n mobileNavigation$1.classList.add(\"mobile-navigation-component__overlay--open\");\n }));\n Caml_option.valFromOption(closeButton).addEventListener(\"click\", (function (param) {\n mobileNavigation$1.classList.remove(\"mobile-navigation-component__overlay--open\");\n }));\n}\n\nexport {\n elementById ,\n openButton ,\n closeButton ,\n mobileNavigation ,\n}\n/* openButton Not a pure module */\n","function formatPoints(points, close) {\n points = [...points];\n // so that coords can be passed as objects or arrays\n if (!Array.isArray(points[0])) {\n points = points.map(({ x, y }) => [x, y]);\n }\n\n if (close) {\n const lastPoint = points[points.length - 1];\n const secondToLastPoint = points[points.length - 2];\n\n const firstPoint = points[0];\n const secondPoint = points[1];\n\n points.unshift(lastPoint);\n points.unshift(secondToLastPoint);\n\n points.push(firstPoint);\n points.push(secondPoint);\n }\n\n return points.flat();\n}\n\nfunction spline(points = [], tension = 1, close = false, cb) {\n points = formatPoints(points, close);\n\n const size = points.length;\n const last = size - 4;\n\n const startPointX = close ? points[2] : points[0];\n const startPointY = close ? points[3] : points[1];\n\n let path = \"M\" + [startPointX, startPointY];\n\n cb && cb(\"MOVE\", [startPointX, startPointY]);\n\n const startIteration = close ? 2 : 0;\n const maxIteration = close ? size - 4 : size - 2;\n const inc = 2;\n\n for (let i = startIteration; i < maxIteration; i += inc) {\n const x0 = i ? points[i - 2] : points[0];\n const y0 = i ? points[i - 1] : points[1];\n\n const x1 = points[i + 0];\n const y1 = points[i + 1];\n\n const x2 = points[i + 2];\n const y2 = points[i + 3];\n\n const x3 = i !== last ? points[i + 4] : x2;\n const y3 = i !== last ? points[i + 5] : y2;\n\n const cp1x = x1 + ((x2 - x0) / 6) * tension;\n const cp1y = y1 + ((y2 - y0) / 6) * tension;\n\n const cp2x = x2 - ((x3 - x1) / 6) * tension;\n const cp2y = y2 - ((y3 - y1) / 6) * tension;\n\n path += \"C\" + [cp1x, cp1y, cp2x, cp2y, x2, y2];\n\n cb && cb(\"CURVE\", [cp1x, cp1y, cp2x, cp2y, x2, y2]);\n }\n\n return path;\n}\n\nexport { spline };\n","/*\n * A fast javascript implementation of simplex noise by Jonas Wagner\n\nBased on a speed-improved simplex noise algorithm for 2D, 3D and 4D in Java.\nWhich is based on example code by Stefan Gustavson (stegu@itn.liu.se).\nWith Optimisations by Peter Eastman (peastman@drizzle.stanford.edu).\nBetter rank ordering method by Stefan Gustavson in 2012.\n\n Copyright (c) 2024 Jonas Wagner\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n */\n// these __PURE__ comments help uglifyjs with dead code removal\n//\nconst SQRT3 = /*#__PURE__*/ Math.sqrt(3.0);\nconst SQRT5 = /*#__PURE__*/ Math.sqrt(5.0);\nconst F2 = 0.5 * (SQRT3 - 1.0);\nconst G2 = (3.0 - SQRT3) / 6.0;\nconst F3 = 1.0 / 3.0;\nconst G3 = 1.0 / 6.0;\nconst F4 = (SQRT5 - 1.0) / 4.0;\nconst G4 = (5.0 - SQRT5) / 20.0;\n// I'm really not sure why this | 0 (basically a coercion to int)\n// is making this faster but I get ~5 million ops/sec more on the\n// benchmarks across the board or a ~10% speedup.\nconst fastFloor = (x) => Math.floor(x) | 0;\nconst grad2 = /*#__PURE__*/ new Float64Array([1, 1,\n -1, 1,\n 1, -1,\n -1, -1,\n 1, 0,\n -1, 0,\n 1, 0,\n -1, 0,\n 0, 1,\n 0, -1,\n 0, 1,\n 0, -1]);\n// double seems to be faster than single or int's\n// probably because most operations are in double precision\nconst grad3 = /*#__PURE__*/ new Float64Array([1, 1, 0,\n -1, 1, 0,\n 1, -1, 0,\n -1, -1, 0,\n 1, 0, 1,\n -1, 0, 1,\n 1, 0, -1,\n -1, 0, -1,\n 0, 1, 1,\n 0, -1, 1,\n 0, 1, -1,\n 0, -1, -1]);\n// double is a bit quicker here as well\nconst grad4 = /*#__PURE__*/ new Float64Array([0, 1, 1, 1, 0, 1, 1, -1, 0, 1, -1, 1, 0, 1, -1, -1,\n 0, -1, 1, 1, 0, -1, 1, -1, 0, -1, -1, 1, 0, -1, -1, -1,\n 1, 0, 1, 1, 1, 0, 1, -1, 1, 0, -1, 1, 1, 0, -1, -1,\n -1, 0, 1, 1, -1, 0, 1, -1, -1, 0, -1, 1, -1, 0, -1, -1,\n 1, 1, 0, 1, 1, 1, 0, -1, 1, -1, 0, 1, 1, -1, 0, -1,\n -1, 1, 0, 1, -1, 1, 0, -1, -1, -1, 0, 1, -1, -1, 0, -1,\n 1, 1, 1, 0, 1, 1, -1, 0, 1, -1, 1, 0, 1, -1, -1, 0,\n -1, 1, 1, 0, -1, 1, -1, 0, -1, -1, 1, 0, -1, -1, -1, 0]);\n/**\n * Creates a 2D noise function\n * @param random the random function that will be used to build the permutation table\n * @returns {NoiseFunction2D}\n */\nexport function createNoise2D(random = Math.random) {\n const perm = buildPermutationTable(random);\n // precalculating this yields a little ~3% performance improvement.\n const permGrad2x = new Float64Array(perm).map(v => grad2[(v % 12) * 2]);\n const permGrad2y = new Float64Array(perm).map(v => grad2[(v % 12) * 2 + 1]);\n return function noise2D(x, y) {\n // if(!isFinite(x) || !isFinite(y)) return 0;\n let n0 = 0; // Noise contributions from the three corners\n let n1 = 0;\n let n2 = 0;\n // Skew the input space to determine which simplex cell we're in\n const s = (x + y) * F2; // Hairy factor for 2D\n const i = fastFloor(x + s);\n const j = fastFloor(y + s);\n const t = (i + j) * G2;\n const X0 = i - t; // Unskew the cell origin back to (x,y) space\n const Y0 = j - t;\n const x0 = x - X0; // The x,y distances from the cell origin\n const y0 = y - Y0;\n // For the 2D case, the simplex shape is an equilateral triangle.\n // Determine which simplex we are in.\n let i1, j1; // Offsets for second (middle) corner of simplex in (i,j) coords\n if (x0 > y0) {\n i1 = 1;\n j1 = 0;\n } // lower triangle, XY order: (0,0)->(1,0)->(1,1)\n else {\n i1 = 0;\n j1 = 1;\n } // upper triangle, YX order: (0,0)->(0,1)->(1,1)\n // A step of (1,0) in (i,j) means a step of (1-c,-c) in (x,y), and\n // a step of (0,1) in (i,j) means a step of (-c,1-c) in (x,y), where\n // c = (3-sqrt(3))/6\n const x1 = x0 - i1 + G2; // Offsets for middle corner in (x,y) unskewed coords\n const y1 = y0 - j1 + G2;\n const x2 = x0 - 1.0 + 2.0 * G2; // Offsets for last corner in (x,y) unskewed coords\n const y2 = y0 - 1.0 + 2.0 * G2;\n // Work out the hashed gradient indices of the three simplex corners\n const ii = i & 255;\n const jj = j & 255;\n // Calculate the contribution from the three corners\n let t0 = 0.5 - x0 * x0 - y0 * y0;\n if (t0 >= 0) {\n const gi0 = ii + perm[jj];\n const g0x = permGrad2x[gi0];\n const g0y = permGrad2y[gi0];\n t0 *= t0;\n // n0 = t0 * t0 * (grad2[gi0] * x0 + grad2[gi0 + 1] * y0); // (x,y) of grad3 used for 2D gradient\n n0 = t0 * t0 * (g0x * x0 + g0y * y0);\n }\n let t1 = 0.5 - x1 * x1 - y1 * y1;\n if (t1 >= 0) {\n const gi1 = ii + i1 + perm[jj + j1];\n const g1x = permGrad2x[gi1];\n const g1y = permGrad2y[gi1];\n t1 *= t1;\n // n1 = t1 * t1 * (grad2[gi1] * x1 + grad2[gi1 + 1] * y1);\n n1 = t1 * t1 * (g1x * x1 + g1y * y1);\n }\n let t2 = 0.5 - x2 * x2 - y2 * y2;\n if (t2 >= 0) {\n const gi2 = ii + 1 + perm[jj + 1];\n const g2x = permGrad2x[gi2];\n const g2y = permGrad2y[gi2];\n t2 *= t2;\n // n2 = t2 * t2 * (grad2[gi2] * x2 + grad2[gi2 + 1] * y2);\n n2 = t2 * t2 * (g2x * x2 + g2y * y2);\n }\n // Add contributions from each corner to get the final noise value.\n // The result is scaled to return values in the interval [-1,1].\n return 70.0 * (n0 + n1 + n2);\n };\n}\n/**\n * Creates a 3D noise function\n * @param random the random function that will be used to build the permutation table\n * @returns {NoiseFunction3D}\n */\nexport function createNoise3D(random = Math.random) {\n const perm = buildPermutationTable(random);\n // precalculating these seems to yield a speedup of over 15%\n const permGrad3x = new Float64Array(perm).map(v => grad3[(v % 12) * 3]);\n const permGrad3y = new Float64Array(perm).map(v => grad3[(v % 12) * 3 + 1]);\n const permGrad3z = new Float64Array(perm).map(v => grad3[(v % 12) * 3 + 2]);\n return function noise3D(x, y, z) {\n let n0, n1, n2, n3; // Noise contributions from the four corners\n // Skew the input space to determine which simplex cell we're in\n const s = (x + y + z) * F3; // Very nice and simple skew factor for 3D\n const i = fastFloor(x + s);\n const j = fastFloor(y + s);\n const k = fastFloor(z + s);\n const t = (i + j + k) * G3;\n const X0 = i - t; // Unskew the cell origin back to (x,y,z) space\n const Y0 = j - t;\n const Z0 = k - t;\n const x0 = x - X0; // The x,y,z distances from the cell origin\n const y0 = y - Y0;\n const z0 = z - Z0;\n // For the 3D case, the simplex shape is a slightly irregular tetrahedron.\n // Determine which simplex we are in.\n let i1, j1, k1; // Offsets for second corner of simplex in (i,j,k) coords\n let i2, j2, k2; // Offsets for third corner of simplex in (i,j,k) coords\n if (x0 >= y0) {\n if (y0 >= z0) {\n i1 = 1;\n j1 = 0;\n k1 = 0;\n i2 = 1;\n j2 = 1;\n k2 = 0;\n } // X Y Z order\n else if (x0 >= z0) {\n i1 = 1;\n j1 = 0;\n k1 = 0;\n i2 = 1;\n j2 = 0;\n k2 = 1;\n } // X Z Y order\n else {\n i1 = 0;\n j1 = 0;\n k1 = 1;\n i2 = 1;\n j2 = 0;\n k2 = 1;\n } // Z X Y order\n }\n else { // x0 grad4[(v % 32) * 4]);\n const permGrad4y = new Float64Array(perm).map(v => grad4[(v % 32) * 4 + 1]);\n const permGrad4z = new Float64Array(perm).map(v => grad4[(v % 32) * 4 + 2]);\n const permGrad4w = new Float64Array(perm).map(v => grad4[(v % 32) * 4 + 3]);\n return function noise4D(x, y, z, w) {\n let n0, n1, n2, n3, n4; // Noise contributions from the five corners\n // Skew the (x,y,z,w) space to determine which cell of 24 simplices we're in\n const s = (x + y + z + w) * F4; // Factor for 4D skewing\n const i = fastFloor(x + s);\n const j = fastFloor(y + s);\n const k = fastFloor(z + s);\n const l = fastFloor(w + s);\n const t = (i + j + k + l) * G4; // Factor for 4D unskewing\n const X0 = i - t; // Unskew the cell origin back to (x,y,z,w) space\n const Y0 = j - t;\n const Z0 = k - t;\n const W0 = l - t;\n const x0 = x - X0; // The x,y,z,w distances from the cell origin\n const y0 = y - Y0;\n const z0 = z - Z0;\n const w0 = w - W0;\n // For the 4D case, the simplex is a 4D shape I won't even try to describe.\n // To find out which of the 24 possible simplices we're in, we need to\n // determine the magnitude ordering of x0, y0, z0 and w0.\n // Six pair-wise comparisons are performed between each possible pair\n // of the four coordinates, and the results are used to rank the numbers.\n let rankx = 0;\n let ranky = 0;\n let rankz = 0;\n let rankw = 0;\n if (x0 > y0)\n rankx++;\n else\n ranky++;\n if (x0 > z0)\n rankx++;\n else\n rankz++;\n if (x0 > w0)\n rankx++;\n else\n rankw++;\n if (y0 > z0)\n ranky++;\n else\n rankz++;\n if (y0 > w0)\n ranky++;\n else\n rankw++;\n if (z0 > w0)\n rankz++;\n else\n rankw++;\n // simplex[c] is a 4-vector with the numbers 0, 1, 2 and 3 in some order.\n // Many values of c will never occur, since e.g. x>y>z>w makes x= 3 ? 1 : 0;\n const j1 = ranky >= 3 ? 1 : 0;\n const k1 = rankz >= 3 ? 1 : 0;\n const l1 = rankw >= 3 ? 1 : 0;\n // The integer offsets for the third simplex corner\n const i2 = rankx >= 2 ? 1 : 0;\n const j2 = ranky >= 2 ? 1 : 0;\n const k2 = rankz >= 2 ? 1 : 0;\n const l2 = rankw >= 2 ? 1 : 0;\n // The integer offsets for the fourth simplex corner\n const i3 = rankx >= 1 ? 1 : 0;\n const j3 = ranky >= 1 ? 1 : 0;\n const k3 = rankz >= 1 ? 1 : 0;\n const l3 = rankw >= 1 ? 1 : 0;\n // The fifth corner has all coordinate offsets = 1, so no need to compute that.\n const x1 = x0 - i1 + G4; // Offsets for second corner in (x,y,z,w) coords\n const y1 = y0 - j1 + G4;\n const z1 = z0 - k1 + G4;\n const w1 = w0 - l1 + G4;\n const x2 = x0 - i2 + 2.0 * G4; // Offsets for third corner in (x,y,z,w) coords\n const y2 = y0 - j2 + 2.0 * G4;\n const z2 = z0 - k2 + 2.0 * G4;\n const w2 = w0 - l2 + 2.0 * G4;\n const x3 = x0 - i3 + 3.0 * G4; // Offsets for fourth corner in (x,y,z,w) coords\n const y3 = y0 - j3 + 3.0 * G4;\n const z3 = z0 - k3 + 3.0 * G4;\n const w3 = w0 - l3 + 3.0 * G4;\n const x4 = x0 - 1.0 + 4.0 * G4; // Offsets for last corner in (x,y,z,w) coords\n const y4 = y0 - 1.0 + 4.0 * G4;\n const z4 = z0 - 1.0 + 4.0 * G4;\n const w4 = w0 - 1.0 + 4.0 * G4;\n // Work out the hashed gradient indices of the five simplex corners\n const ii = i & 255;\n const jj = j & 255;\n const kk = k & 255;\n const ll = l & 255;\n // Calculate the contribution from the five corners\n let t0 = 0.6 - x0 * x0 - y0 * y0 - z0 * z0 - w0 * w0;\n if (t0 < 0)\n n0 = 0.0;\n else {\n const gi0 = ii + perm[jj + perm[kk + perm[ll]]];\n t0 *= t0;\n n0 = t0 * t0 * (permGrad4x[gi0] * x0 + permGrad4y[gi0] * y0 + permGrad4z[gi0] * z0 + permGrad4w[gi0] * w0);\n }\n let t1 = 0.6 - x1 * x1 - y1 * y1 - z1 * z1 - w1 * w1;\n if (t1 < 0)\n n1 = 0.0;\n else {\n const gi1 = ii + i1 + perm[jj + j1 + perm[kk + k1 + perm[ll + l1]]];\n t1 *= t1;\n n1 = t1 * t1 * (permGrad4x[gi1] * x1 + permGrad4y[gi1] * y1 + permGrad4z[gi1] * z1 + permGrad4w[gi1] * w1);\n }\n let t2 = 0.6 - x2 * x2 - y2 * y2 - z2 * z2 - w2 * w2;\n if (t2 < 0)\n n2 = 0.0;\n else {\n const gi2 = ii + i2 + perm[jj + j2 + perm[kk + k2 + perm[ll + l2]]];\n t2 *= t2;\n n2 = t2 * t2 * (permGrad4x[gi2] * x2 + permGrad4y[gi2] * y2 + permGrad4z[gi2] * z2 + permGrad4w[gi2] * w2);\n }\n let t3 = 0.6 - x3 * x3 - y3 * y3 - z3 * z3 - w3 * w3;\n if (t3 < 0)\n n3 = 0.0;\n else {\n const gi3 = ii + i3 + perm[jj + j3 + perm[kk + k3 + perm[ll + l3]]];\n t3 *= t3;\n n3 = t3 * t3 * (permGrad4x[gi3] * x3 + permGrad4y[gi3] * y3 + permGrad4z[gi3] * z3 + permGrad4w[gi3] * w3);\n }\n let t4 = 0.6 - x4 * x4 - y4 * y4 - z4 * z4 - w4 * w4;\n if (t4 < 0)\n n4 = 0.0;\n else {\n const gi4 = ii + 1 + perm[jj + 1 + perm[kk + 1 + perm[ll + 1]]];\n t4 *= t4;\n n4 = t4 * t4 * (permGrad4x[gi4] * x4 + permGrad4y[gi4] * y4 + permGrad4z[gi4] * z4 + permGrad4w[gi4] * w4);\n }\n // Sum up and scale the result to cover the range [-1,1]\n return 27.0 * (n0 + n1 + n2 + n3 + n4);\n };\n}\n/**\n * Builds a random permutation table.\n * This is exported only for (internal) testing purposes.\n * Do not rely on this export.\n * @private\n */\nexport function buildPermutationTable(random) {\n const tableSize = 512;\n const p = new Uint8Array(tableSize);\n for (let i = 0; i < tableSize / 2; i++) {\n p[i] = i;\n }\n for (let i = 0; i < tableSize / 2 - 1; i++) {\n const r = i + ~~(random() * (256 - i));\n const aux = p[i];\n p[i] = p[r];\n p[r] = aux;\n }\n for (let i = 256; i < tableSize; i++) {\n p[i] = p[i - 256];\n }\n return p;\n}\n//# sourceMappingURL=simplex-noise.js.map","import { spline } from \"@georgedoescode/spline\"\nimport { createNoise2D } from \"simplex-noise\"\n\nconst POINTS = [\n [\n [0.45, 0.05],\n [0.9, 0.35],\n [0.83, 0.81],\n [0.35, 0.95],\n [0.05, 0.48],\n ],\n [\n [0.45, 0.95],\n [0.9, 0.65],\n [0.83, 0.19],\n [0.35, 0.05],\n [0.05, 0.52],\n ],\n [\n [0.55, 0.05],\n [0.11, 0.27],\n [0.17, 0.77],\n [0.61, 0.95],\n [0.92, 0.54],\n ],\n [\n [0.55, 0.95],\n [0.1, 0.65],\n [0.17, 0.19],\n [0.65, 0.05],\n [0.95, 0.52],\n ],\n]\n\nfunction shuffleArray(array) {\n for (var i = array.length - 1; i >= 0; i--) {\n var j = Math.floor(Math.random() * (i + 1))\n var temp = array[i]\n array[i] = array[j]\n array[j] = temp\n }\n}\n\nshuffleArray(POINTS)\n\ndocument.querySelectorAll(\"[data-blob]\").forEach((svgElement, index) => {\n const path = svgElement.querySelector(\"path\")\n\n const noise2D = createNoise2D()\n\n let noiseStep = 0.001\n\n function noise(x, y) {\n return noise2D(x, y)\n }\n\n // map a number from 1 range to another\n function map(n, start1, end1, start2, end2) {\n return ((n - start1) / (end1 - start1)) * (end2 - start2) + start2\n }\n\n const points = []\n\n let newPoint = (x, y) =>\n points.push({\n x,\n y,\n originX: x,\n originY: y,\n noiseOffsetX: Math.random() * 1000,\n noiseOffsetY: Math.random() * 1000,\n })\n\n POINTS[index % POINTS.length].forEach(([x, y]) => newPoint(x, y))\n\n let animate = () => {\n path.setAttribute(\"d\", spline(points, 1, true))\n\n for (let i = 0; i < points.length; i++) {\n const point = points[i]\n\n const nX = noise(point.noiseOffsetX, point.noiseOffsetX)\n const nY = noise(point.noiseOffsetY, point.noiseOffsetY)\n\n let spread = 0.025\n\n const x = map(nX, -1, 1, point.originX - spread, point.originX + spread)\n const y = map(nY, -1, 1, point.originY - spread, point.originY + spread)\n\n point.x = x\n point.y = y\n\n point.noiseOffsetX += noiseStep\n point.noiseOffsetY += noiseStep\n }\n\n requestAnimationFrame(animate)\n }\n\n animate()\n})\n","const filterBar = document.getElementById(\"posts-filter-bar\")\n\nif (filterBar) {\n const typeButtons = filterBar.querySelectorAll(\n \".posts-filter-bar-component__button\",\n )\n\n const typeSelector = filterBar.querySelector(\n \".posts-filter-bar-component__select--post-type\",\n )\n\n const topicSelector = filterBar.querySelector(\n \".posts-filter-bar-component__select--post-topic\",\n )\n\n let type = \"all\"\n let topic = new URLSearchParams(window.location.search).get(\"topic\") || \"all\"\n\n const sync = () => {\n typeButtons.forEach((button) => {\n if (button.dataset.type === type) {\n button.classList.add(\"posts-filter-bar-component__button--active\")\n } else {\n button.classList.remove(\"posts-filter-bar-component__button--active\")\n }\n })\n\n typeSelector.value = type\n topicSelector.value = topic\n\n // Set the topic query parameter.\n const url = new URL(window.location)\n url.searchParams.set(\"topic\", topic)\n window.history.replaceState({}, \"\", url)\n\n document.querySelectorAll(\".posts-detail-component\").forEach((post) => {\n if (type === \"all\" && topic === \"all\") {\n post.classList.remove(\"posts-detail-component--hidden\")\n } else {\n const matchesType = type === \"all\" || post.dataset.type === type\n const matchesTopic = topic === \"all\" || post.dataset.topic === topic\n\n if (matchesType && matchesTopic) {\n post.classList.remove(\"posts-detail-component--hidden\")\n } else {\n post.classList.add(\"posts-detail-component--hidden\")\n }\n }\n })\n\n document\n .querySelectorAll(\".posts-by-topic-component\")\n .forEach((topicComponent) => {\n const postCount = topicComponent.querySelectorAll(\n \".posts-detail-component:not(.posts-detail-component--hidden)\",\n ).length\n\n if (postCount === 0) {\n topicComponent.classList.add(\"posts-by-topic-component--hidden\")\n } else {\n topicComponent.classList.remove(\"posts-by-topic-component--hidden\")\n }\n })\n }\n\n typeButtons.forEach((button) => {\n const buttonType = button.dataset.type\n\n button.addEventListener(\"click\", () => {\n type = buttonType\n\n sync()\n })\n })\n\n typeSelector.addEventListener(\"change\", (e) => {\n type = e.target.value\n\n sync()\n })\n\n topicSelector.addEventListener(\"change\", (e) => {\n topic = e.target.value\n\n sync()\n })\n\n sync()\n}\n","const activeClass = \"posts-table-of-contents-component__link--active\"\n\ndocument.addEventListener(\"DOMContentLoaded\", () => {\n // Get all links in the table of contents\n const tocLinks = document.querySelectorAll(\n \".posts-table-of-contents-component__link\",\n )\n\n if (tocLinks.length === 0) return\n\n const sections = [...tocLinks].map((anchor) => {\n const href = anchor.href\n const hashIndex = href.lastIndexOf(\"#\")\n const id = href.slice(hashIndex)\n\n return document.querySelector(id)\n })\n\n let currentSection\n\n // Function to update active state\n const updateActiveSection = () => {\n const scrollPosition = window.scrollY\n\n let newSection\n\n // Find the current section based on scroll position\n sections.forEach((section) => {\n const sectionTop = section.offsetTop - window.innerHeight / 2 // Offset for better UX\n\n if (scrollPosition >= sectionTop) {\n newSection = section\n }\n })\n\n // Only update if the current section has changed\n if (currentSection !== newSection) {\n // Remove active class from all links\n tocLinks.forEach((link) => {\n link.classList.remove(activeClass)\n })\n\n if (newSection) {\n // Add active class to current section's link\n const activeLink = document.querySelector(\n `.posts-table-of-contents-component__link[href=\"#${newSection.id}\"]`,\n )\n\n if (activeLink) {\n activeLink.classList.add(activeClass)\n }\n }\n\n currentSection = newSection\n }\n }\n\n // Add scroll event listener with throttling for better performance\n let ticking = false\n window.addEventListener(\"scroll\", () => {\n if (!ticking) {\n window.requestAnimationFrame(() => {\n updateActiveSection()\n ticking = false\n })\n ticking = true\n }\n })\n\n // Initial call to set active state on page load\n updateActiveSection()\n})\n","import UJS from \"@rails/ujs\"\n\nimport \"../MobileNavigation.res.mjs\"\nimport \"../blobs\"\nimport \"../posts-filter-bar\"\nimport \"../table-of-contents\"\n\nUJS.start()\n"],"names":["openButton","Caml_option.nullable_to_opt","closeButton","mobileNavigation","mobileNavigation$1","Caml_option.valFromOption","param","formatPoints","points","close","x","y","lastPoint","secondToLastPoint","firstPoint","secondPoint","spline","tension","cb","size","last","startPointX","startPointY","path","startIteration","maxIteration","inc","i","x0","y0","x1","y1","x2","y2","x3","y3","cp1x","cp1y","cp2x","cp2y","SQRT3","F2","G2","fastFloor","grad2","createNoise2D","random","perm","buildPermutationTable","permGrad2x","v","permGrad2y","n0","n1","n2","s","j","t","X0","Y0","i1","j1","ii","jj","t0","gi0","g0x","g0y","t1","gi1","g1x","g1y","t2","gi2","g2x","g2y","p","r","aux","POINTS","shuffleArray","array","temp","svgElement","index","noise2D","noiseStep","noise","map","n","start1","end1","start2","end2","newPoint","animate","point","nX","nY","spread","filterBar","typeButtons","typeSelector","topicSelector","type","topic","sync","button","url","post","matchesType","matchesTopic","topicComponent","buttonType","e","activeClass","tocLinks","sections","anchor","href","hashIndex","id","currentSection","updateActiveSection","scrollPosition","newSection","section","sectionTop","link","activeLink","ticking","UJS"],"mappings":"4DAQA,IAAIA,EAAaC,EAA4B,SAAS,eAAe,wBAAwB,CAAC,EAE1FC,EAAcD,EAA4B,SAAS,eAAe,yBAAyB,CAAC,EAE5FE,EAAmBF,EAA4B,SAAS,eAAe,2BAA2B,CAAC,EAEvG,GAAID,IAAe,QAAaE,IAAgB,QAAaC,IAAqB,OAAW,CAC3F,IAAIC,EAAqBC,EAA0BF,CAAgB,EACnEE,EAA0BL,CAAU,EAAE,iBAAiB,QAAU,SAAUM,EAAO,CAC1EF,EAAmB,UAAU,IAAI,4CAA4C,CACvF,GACEC,EAA0BH,CAAW,EAAE,iBAAiB,QAAU,SAAUI,EAAO,CAC3EF,EAAmB,UAAU,OAAO,4CAA4C,CAC1F,EACA,CCtBA,SAASG,EAAaC,EAAQC,EAAO,CAOnC,GANAD,EAAS,CAAC,GAAGA,CAAM,EAEd,MAAM,QAAQA,EAAO,CAAC,CAAC,IAC1BA,EAASA,EAAO,IAAI,CAAC,CAAE,EAAAE,EAAG,EAAAC,CAAC,IAAO,CAACD,EAAGC,CAAC,CAAC,GAGtCF,EAAO,CACT,MAAMG,EAAYJ,EAAOA,EAAO,OAAS,CAAC,EACpCK,EAAoBL,EAAOA,EAAO,OAAS,CAAC,EAE5CM,EAAaN,EAAO,CAAC,EACrBO,EAAcP,EAAO,CAAC,EAE5BA,EAAO,QAAQI,CAAS,EACxBJ,EAAO,QAAQK,CAAiB,EAEhCL,EAAO,KAAKM,CAAU,EACtBN,EAAO,KAAKO,CAAW,CACxB,CAED,OAAOP,EAAO,MAChB,CAEA,SAASQ,EAAOR,EAAS,GAAIS,EAAU,EAAGR,EAAQ,GAAOS,EAAI,CAC3DV,EAASD,EAAaC,EAAQC,CAAK,EAEnC,MAAMU,EAAOX,EAAO,OACdY,EAAOD,EAAO,EAEdE,EAAcZ,EAAQD,EAAO,CAAC,EAAIA,EAAO,C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